cola Report for GDS3885

Date: 2019-12-25 21:02:07 CET, cola version: 1.3.2

Document is loading...


Summary

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

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

The call of run_all_consensus_partition_methods() was:

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

Dimension of the input matrix:

mat = get_matrix(res_list)
dim(mat)
#> [1] 51941    92

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
ATC:kmeans 2 1.000 1.000 1.000 **
ATC:skmeans 3 1.000 0.984 0.993 ** 2
MAD:pam 6 0.995 0.930 0.973 ** 3,4,5
CV:mclust 4 0.987 0.956 0.982 ** 2,3
ATC:hclust 6 0.983 0.931 0.960 ** 2,5
MAD:NMF 4 0.981 0.925 0.967 ** 2,3
CV:skmeans 5 0.978 0.950 0.967 ** 2,3,4
MAD:skmeans 5 0.959 0.924 0.959 ** 2,3,4
SD:skmeans 5 0.956 0.929 0.961 ** 2,3,4
SD:pam 6 0.950 0.916 0.958 * 4,5
CV:NMF 5 0.949 0.876 0.944 * 2,4
SD:mclust 4 0.947 0.943 0.976 * 2
MAD:mclust 2 0.933 0.925 0.969 *
SD:hclust 4 0.932 0.925 0.962 *
ATC:pam 6 0.925 0.910 0.929 * 2,3,4,5
CV:pam 6 0.921 0.874 0.943 * 4,5
SD:NMF 5 0.920 0.881 0.944 * 2,3,4
MAD:hclust 6 0.918 0.883 0.936 *
ATC:mclust 3 0.914 0.964 0.976 * 2
ATC:NMF 5 0.908 0.891 0.930 * 2,4
CV:hclust 4 0.886 0.928 0.966
CV:kmeans 4 0.833 0.934 0.882
MAD:kmeans 2 0.724 0.896 0.944
SD:kmeans 2 0.688 0.932 0.952

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

CDF of consensus matrices

Cumulative distribution function curves of consensus matrix for all methods.

collect_plots(res_list, fun = plot_ecdf)

plot of chunk collect-plots

Consensus heatmap

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

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

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

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

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

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

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

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

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

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

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

Membership heatmap

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

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

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

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

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

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

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

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

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

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

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

Signature heatmap

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

Note in following heatmaps, rows are scaled.

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

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

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

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

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

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

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

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

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

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

Statistics table

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

get_stats(res_list, k = 2)
#>             k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> SD:NMF      2 1.000           0.998       0.999          0.500 0.500   0.500
#> CV:NMF      2 1.000           0.991       0.996          0.501 0.500   0.500
#> MAD:NMF     2 1.000           0.983       0.992          0.501 0.500   0.500
#> ATC:NMF     2 1.000           0.984       0.993          0.489 0.514   0.514
#> SD:skmeans  2 1.000           0.988       0.995          0.501 0.500   0.500
#> CV:skmeans  2 1.000           0.991       0.996          0.501 0.500   0.500
#> MAD:skmeans 2 1.000           0.974       0.987          0.504 0.497   0.497
#> ATC:skmeans 2 1.000           1.000       1.000          0.487 0.514   0.514
#> SD:mclust   2 0.955           0.943       0.976          0.465 0.548   0.548
#> CV:mclust   2 0.955           0.970       0.986          0.474 0.523   0.523
#> MAD:mclust  2 0.933           0.925       0.969          0.469 0.535   0.535
#> ATC:mclust  2 1.000           1.000       1.000          0.429 0.572   0.572
#> SD:kmeans   2 0.688           0.932       0.952          0.482 0.500   0.500
#> CV:kmeans   2 0.719           0.904       0.933          0.470 0.500   0.500
#> MAD:kmeans  2 0.724           0.896       0.944          0.494 0.500   0.500
#> ATC:kmeans  2 1.000           1.000       1.000          0.477 0.523   0.523
#> SD:pam      2 0.853           0.945       0.973          0.501 0.500   0.500
#> CV:pam      2 0.749           0.950       0.973          0.499 0.500   0.500
#> MAD:pam     2 0.853           0.912       0.962          0.501 0.498   0.498
#> ATC:pam     2 1.000           0.987       0.995          0.479 0.523   0.523
#> SD:hclust   2 0.635           0.828       0.908          0.483 0.518   0.518
#> CV:hclust   2 0.653           0.840       0.923          0.482 0.514   0.514
#> MAD:hclust  2 0.669           0.903       0.941          0.484 0.518   0.518
#> ATC:hclust  2 0.912           0.947       0.965          0.466 0.541   0.541
get_stats(res_list, k = 3)
#>             k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> SD:NMF      3 0.910           0.904       0.958          0.250 0.843   0.695
#> CV:NMF      3 0.776           0.925       0.944          0.219 0.888   0.778
#> MAD:NMF     3 0.909           0.909       0.954          0.305 0.703   0.482
#> ATC:NMF     3 0.864           0.861       0.938          0.304 0.809   0.647
#> SD:skmeans  3 1.000           0.979       0.989          0.290 0.821   0.653
#> CV:skmeans  3 1.000           0.969       0.984          0.288 0.821   0.653
#> MAD:skmeans 3 1.000           0.966       0.984          0.269 0.832   0.671
#> ATC:skmeans 3 1.000           0.984       0.993          0.337 0.816   0.647
#> SD:mclust   3 0.786           0.910       0.960          0.298 0.610   0.415
#> CV:mclust   3 0.939           0.953       0.979          0.286 0.678   0.478
#> MAD:mclust  3 0.667           0.802       0.877          0.326 0.598   0.400
#> ATC:mclust  3 0.914           0.964       0.976          0.289 0.893   0.813
#> SD:kmeans   3 0.673           0.876       0.873          0.323 0.793   0.605
#> CV:kmeans   3 0.670           0.882       0.873          0.347 0.793   0.605
#> MAD:kmeans  3 0.781           0.897       0.913          0.318 0.783   0.588
#> ATC:kmeans  3 0.803           0.945       0.947          0.377 0.777   0.587
#> SD:pam      3 0.753           0.871       0.904          0.206 0.917   0.834
#> CV:pam      3 0.760           0.831       0.896          0.202 0.917   0.834
#> MAD:pam     3 0.937           0.954       0.979          0.322 0.791   0.601
#> ATC:pam     3 1.000           0.997       0.998          0.393 0.777   0.587
#> SD:hclust   3 0.676           0.868       0.901          0.305 0.832   0.676
#> CV:hclust   3 0.629           0.818       0.865          0.208 0.928   0.861
#> MAD:hclust  3 0.801           0.882       0.922          0.345 0.832   0.676
#> ATC:hclust  3 0.827           0.980       0.977          0.407 0.791   0.614
get_stats(res_list, k = 4)
#>             k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> SD:NMF      4 0.999           0.968       0.985         0.1564 0.807   0.544
#> CV:NMF      4 0.989           0.947       0.979         0.1895 0.815   0.568
#> MAD:NMF     4 0.981           0.925       0.967         0.1164 0.883   0.683
#> ATC:NMF     4 0.934           0.932       0.956         0.1451 0.841   0.604
#> SD:skmeans  4 0.982           0.949       0.975         0.1196 0.899   0.721
#> CV:skmeans  4 0.990           0.923       0.965         0.1110 0.893   0.714
#> MAD:skmeans 4 0.964           0.953       0.972         0.1338 0.890   0.704
#> ATC:skmeans 4 0.878           0.759       0.873         0.0519 0.977   0.934
#> SD:mclust   4 0.947           0.943       0.976         0.2097 0.853   0.637
#> CV:mclust   4 0.987           0.956       0.982         0.1857 0.844   0.620
#> MAD:mclust  4 0.864           0.903       0.953         0.1645 0.863   0.660
#> ATC:mclust  4 0.782           0.860       0.923         0.2452 0.842   0.659
#> SD:kmeans   4 0.854           0.926       0.885         0.1164 0.934   0.806
#> CV:kmeans   4 0.833           0.934       0.882         0.1199 0.934   0.806
#> MAD:kmeans  4 0.783           0.758       0.773         0.1030 0.922   0.770
#> ATC:kmeans  4 0.869           0.873       0.867         0.0914 0.912   0.744
#> SD:pam      4 1.000           0.949       0.982         0.2015 0.803   0.556
#> CV:pam      4 1.000           0.960       0.986         0.2139 0.805   0.558
#> MAD:pam     4 0.977           0.941       0.974         0.1015 0.899   0.716
#> ATC:pam     4 1.000           0.972       0.987         0.0914 0.937   0.810
#> SD:hclust   4 0.932           0.925       0.962         0.1436 0.928   0.796
#> CV:hclust   4 0.886           0.928       0.966         0.2426 0.817   0.593
#> MAD:hclust  4 0.831           0.859       0.890         0.0971 0.928   0.796
#> ATC:hclust  4 0.826           0.946       0.926         0.0522 0.980   0.940
get_stats(res_list, k = 5)
#>             k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> SD:NMF      5 0.920           0.881       0.944         0.0616 0.941   0.792
#> CV:NMF      5 0.949           0.876       0.944         0.0598 0.934   0.768
#> MAD:NMF     5 0.884           0.884       0.932         0.0544 0.958   0.849
#> ATC:NMF     5 0.908           0.891       0.930         0.0616 0.922   0.726
#> SD:skmeans  5 0.956           0.929       0.961         0.0358 0.963   0.868
#> CV:skmeans  5 0.978           0.950       0.967         0.0452 0.947   0.821
#> MAD:skmeans 5 0.959           0.924       0.959         0.0335 0.974   0.908
#> ATC:skmeans 5 0.807           0.801       0.853         0.0586 0.953   0.860
#> SD:mclust   5 0.887           0.796       0.887         0.0435 0.968   0.886
#> CV:mclust   5 0.898           0.833       0.908         0.0528 0.978   0.918
#> MAD:mclust  5 0.802           0.749       0.858         0.0518 0.961   0.857
#> ATC:mclust  5 0.757           0.812       0.849         0.0886 0.854   0.585
#> SD:kmeans   5 0.747           0.847       0.840         0.0682 1.000   1.000
#> CV:kmeans   5 0.759           0.858       0.837         0.0706 1.000   1.000
#> MAD:kmeans  5 0.740           0.810       0.823         0.0610 0.953   0.841
#> ATC:kmeans  5 0.761           0.823       0.812         0.0526 0.978   0.921
#> SD:pam      5 0.989           0.956       0.982         0.0463 0.948   0.817
#> CV:pam      5 0.979           0.928       0.958         0.0464 0.953   0.829
#> MAD:pam     5 0.990           0.937       0.970         0.0399 0.953   0.830
#> ATC:pam     5 1.000           0.967       0.983         0.0459 0.960   0.853
#> SD:hclust   5 0.880           0.844       0.934         0.0409 0.984   0.942
#> CV:hclust   5 0.883           0.878       0.924         0.0446 0.969   0.890
#> MAD:hclust  5 0.898           0.876       0.932         0.0629 0.969   0.890
#> ATC:hclust  5 1.000           0.982       0.990         0.0927 0.934   0.789
get_stats(res_list, k = 6)
#>             k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> SD:NMF      6 0.850           0.736       0.853         0.0432 0.957   0.819
#> CV:NMF      6 0.850           0.705       0.823         0.0369 0.952   0.799
#> MAD:NMF     6 0.811           0.699       0.838         0.0395 0.974   0.893
#> ATC:NMF     6 0.870           0.816       0.877         0.0255 0.973   0.879
#> SD:skmeans  6 0.934           0.867       0.906         0.0280 0.994   0.977
#> CV:skmeans  6 0.895           0.877       0.897         0.0298 0.989   0.957
#> MAD:skmeans 6 0.926           0.837       0.897         0.0285 0.989   0.957
#> ATC:skmeans 6 0.814           0.781       0.786         0.0452 0.920   0.737
#> SD:mclust   6 0.845           0.765       0.871         0.0440 0.951   0.811
#> CV:mclust   6 0.873           0.815       0.898         0.0552 0.954   0.820
#> MAD:mclust  6 0.799           0.733       0.855         0.0367 0.954   0.813
#> ATC:mclust  6 0.754           0.687       0.802         0.0470 0.917   0.693
#> SD:kmeans   6 0.727           0.774       0.769         0.0396 1.000   1.000
#> CV:kmeans   6 0.789           0.641       0.767         0.0436 0.984   0.942
#> MAD:kmeans  6 0.716           0.684       0.775         0.0433 0.931   0.748
#> ATC:kmeans  6 0.742           0.766       0.808         0.0421 0.955   0.831
#> SD:pam      6 0.950           0.916       0.958         0.0307 0.980   0.916
#> CV:pam      6 0.921           0.874       0.943         0.0273 0.967   0.865
#> MAD:pam     6 0.995           0.930       0.973         0.0323 0.970   0.879
#> ATC:pam     6 0.925           0.910       0.929         0.0330 0.976   0.897
#> SD:hclust   6 0.871           0.835       0.922         0.0421 0.964   0.864
#> CV:hclust   6 0.872           0.769       0.880         0.0352 0.991   0.963
#> MAD:hclust  6 0.918           0.883       0.936         0.0368 0.964   0.856
#> ATC:hclust  6 0.983           0.931       0.960         0.0203 0.987   0.948

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 specimen(p) k
#> SD:NMF      92    4.01e-14 2
#> CV:NMF      92    4.01e-14 2
#> MAD:NMF     92    4.01e-14 2
#> ATC:NMF     92    7.21e-17 2
#> SD:skmeans  92    4.01e-14 2
#> CV:skmeans  92    4.01e-14 2
#> MAD:skmeans 92    1.41e-13 2
#> ATC:skmeans 92    7.21e-17 2
#> SD:mclust   88    7.88e-17 2
#> CV:mclust   92    1.16e-17 2
#> MAD:mclust  88    7.88e-17 2
#> ATC:mclust  92    3.07e-14 2
#> SD:kmeans   92    4.01e-14 2
#> CV:kmeans   92    4.01e-14 2
#> MAD:kmeans  92    4.01e-14 2
#> ATC:kmeans  92    5.33e-17 2
#> SD:pam      92    4.01e-14 2
#> CV:pam      92    4.01e-14 2
#> MAD:pam     85    2.23e-13 2
#> ATC:pam     91    1.88e-17 2
#> SD:hclust   82    1.38e-15 2
#> CV:hclust   90    3.03e-17 2
#> MAD:hclust  92    1.16e-17 2
#> ATC:hclust  92    1.16e-17 2
test_to_known_factors(res_list, k = 3)
#>              n specimen(p) k
#> SD:NMF      89    4.94e-24 3
#> CV:NMF      92    7.13e-26 3
#> MAD:NMF     89    3.87e-26 3
#> ATC:NMF     84    5.05e-28 3
#> SD:skmeans  92    3.33e-30 3
#> CV:skmeans  90    2.83e-29 3
#> MAD:skmeans 91    1.42e-27 3
#> ATC:skmeans 92    2.19e-29 3
#> SD:mclust   89    1.10e-31 3
#> CV:mclust   92    7.03e-30 3
#> MAD:mclust  91    1.66e-32 3
#> ATC:mclust  92    2.81e-22 3
#> SD:kmeans   92    7.20e-32 3
#> CV:kmeans   92    7.20e-32 3
#> MAD:kmeans  92    1.23e-30 3
#> ATC:kmeans  92    6.44e-33 3
#> SD:pam      92    1.29e-28 3
#> CV:pam      90    6.60e-29 3
#> MAD:pam     91    6.53e-28 3
#> ATC:pam     92    6.44e-33 3
#> SD:hclust   88    2.82e-31 3
#> CV:hclust   90    4.27e-32 3
#> MAD:hclust  92    4.55e-28 3
#> ATC:hclust  92    6.44e-33 3
test_to_known_factors(res_list, k = 4)
#>              n specimen(p) k
#> SD:NMF      92    1.69e-42 4
#> CV:NMF      90    7.15e-46 4
#> MAD:NMF     88    1.85e-38 4
#> ATC:NMF     90    5.52e-35 4
#> SD:skmeans  90    1.98e-39 4
#> CV:skmeans  87    4.69e-45 4
#> MAD:skmeans 91    2.41e-37 4
#> ATC:skmeans 72    3.93e-14 4
#> SD:mclust   90    6.82e-47 4
#> CV:mclust   91    1.66e-47 4
#> MAD:mclust  91    1.66e-47 4
#> ATC:mclust  88    3.64e-26 4
#> SD:kmeans   92    4.48e-47 4
#> CV:kmeans   92    4.48e-47 4
#> MAD:kmeans  84    2.84e-42 4
#> ATC:kmeans  90    6.82e-47 4
#> SD:pam      89    2.80e-46 4
#> CV:pam      90    7.34e-46 4
#> MAD:pam     90    7.15e-46 4
#> ATC:pam     91    9.29e-41 4
#> SD:hclust   88    1.15e-45 4
#> CV:hclust   92    4.04e-48 4
#> MAD:hclust  85    7.83e-44 4
#> ATC:hclust  92    4.04e-48 4
test_to_known_factors(res_list, k = 5)
#>              n specimen(p) k
#> SD:NMF      88    5.18e-38 5
#> CV:NMF      86    3.52e-39 5
#> MAD:NMF     91    3.78e-39 5
#> ATC:NMF     89    3.95e-34 5
#> SD:skmeans  90    1.60e-43 5
#> CV:skmeans  91    3.30e-44 5
#> MAD:skmeans 89    6.34e-43 5
#> ATC:skmeans 85    5.98e-38 5
#> SD:mclust   84    1.06e-41 5
#> CV:mclust   87    6.47e-47 5
#> MAD:mclust  82    6.99e-43 5
#> ATC:mclust  91    1.56e-24 5
#> SD:kmeans   92    4.48e-47 5
#> CV:kmeans   92    4.48e-47 5
#> MAD:kmeans  88    1.14e-44 5
#> ATC:kmeans  86    1.92e-44 5
#> SD:pam      91    2.31e-41 5
#> CV:pam      90    3.55e-41 5
#> MAD:pam     89    9.56e-41 5
#> ATC:pam     91    1.00e-38 5
#> SD:hclust   86    2.09e-58 5
#> CV:hclust   91    6.79e-45 5
#> MAD:hclust  87    3.47e-56 5
#> ATC:hclust  92    2.68e-63 5
test_to_known_factors(res_list, k = 6)
#>              n specimen(p) k
#> SD:NMF      77    1.31e-34 6
#> CV:NMF      73    1.11e-31 6
#> MAD:NMF     74    2.34e-29 6
#> ATC:NMF     87    6.15e-33 6
#> SD:skmeans  88    2.73e-39 6
#> CV:skmeans  86    4.00e-41 6
#> MAD:skmeans 87    4.84e-40 6
#> ATC:skmeans 77    6.99e-48 6
#> SD:mclust   84    1.37e-53 6
#> CV:mclust   82    1.00e-45 6
#> MAD:mclust  79    1.39e-49 6
#> ATC:mclust  70    7.18e-24 6
#> SD:kmeans   92    4.48e-47 6
#> CV:kmeans   80    1.36e-37 6
#> MAD:kmeans  76    1.62e-32 6
#> ATC:kmeans  87    1.08e-41 6
#> SD:pam      91    1.54e-38 6
#> CV:pam      88    3.66e-37 6
#> MAD:pam     89    1.64e-35 6
#> ATC:pam     91    4.25e-37 6
#> SD:hclust   87    1.01e-52 6
#> CV:hclust   78    2.81e-36 6
#> MAD:hclust  84    2.67e-51 6
#> ATC:hclust  88    2.84e-59 6

Results for each method


SD:hclust*

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

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

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

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

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

collect_plots(res)

plot of chunk SD-hclust-collect-plots

The plots are:

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

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

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

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

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.635           0.828       0.908         0.4832 0.518   0.518
#> 3 3 0.676           0.868       0.901         0.3045 0.832   0.676
#> 4 4 0.932           0.925       0.962         0.1436 0.928   0.796
#> 5 5 0.880           0.844       0.934         0.0409 0.984   0.942
#> 6 6 0.871           0.835       0.922         0.0421 0.964   0.864

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
#> GSM587155     2   0.000      1.000 0.000 1.000
#> GSM587156     2   0.000      1.000 0.000 1.000
#> GSM587157     2   0.000      1.000 0.000 1.000
#> GSM587158     2   0.000      1.000 0.000 1.000
#> GSM587159     2   0.000      1.000 0.000 1.000
#> GSM587160     2   0.000      1.000 0.000 1.000
#> GSM587161     2   0.000      1.000 0.000 1.000
#> GSM587162     2   0.000      1.000 0.000 1.000
#> GSM587163     2   0.000      1.000 0.000 1.000
#> GSM587164     2   0.000      1.000 0.000 1.000
#> GSM587165     2   0.000      1.000 0.000 1.000
#> GSM587166     2   0.000      1.000 0.000 1.000
#> GSM587167     2   0.000      1.000 0.000 1.000
#> GSM587168     2   0.000      1.000 0.000 1.000
#> GSM587169     2   0.000      1.000 0.000 1.000
#> GSM587170     2   0.000      1.000 0.000 1.000
#> GSM587171     2   0.000      1.000 0.000 1.000
#> GSM587172     2   0.000      1.000 0.000 1.000
#> GSM587173     2   0.000      1.000 0.000 1.000
#> GSM587174     2   0.000      1.000 0.000 1.000
#> GSM587175     2   0.000      1.000 0.000 1.000
#> GSM587176     2   0.000      1.000 0.000 1.000
#> GSM587177     2   0.000      1.000 0.000 1.000
#> GSM587178     2   0.000      1.000 0.000 1.000
#> GSM587179     2   0.000      1.000 0.000 1.000
#> GSM587180     2   0.000      1.000 0.000 1.000
#> GSM587181     2   0.000      1.000 0.000 1.000
#> GSM587182     2   0.000      1.000 0.000 1.000
#> GSM587183     2   0.000      1.000 0.000 1.000
#> GSM587184     2   0.000      1.000 0.000 1.000
#> GSM587185     2   0.000      1.000 0.000 1.000
#> GSM587186     2   0.000      1.000 0.000 1.000
#> GSM587187     2   0.000      1.000 0.000 1.000
#> GSM587188     2   0.000      1.000 0.000 1.000
#> GSM587189     2   0.000      1.000 0.000 1.000
#> GSM587190     2   0.000      1.000 0.000 1.000
#> GSM587203     1   0.000      0.830 1.000 0.000
#> GSM587204     1   0.000      0.830 1.000 0.000
#> GSM587205     1   0.000      0.830 1.000 0.000
#> GSM587206     1   0.000      0.830 1.000 0.000
#> GSM587207     1   0.000      0.830 1.000 0.000
#> GSM587208     1   0.000      0.830 1.000 0.000
#> GSM587209     1   0.000      0.830 1.000 0.000
#> GSM587210     1   0.000      0.830 1.000 0.000
#> GSM587211     1   0.000      0.830 1.000 0.000
#> GSM587212     1   0.000      0.830 1.000 0.000
#> GSM587213     1   0.000      0.830 1.000 0.000
#> GSM587214     1   0.000      0.830 1.000 0.000
#> GSM587215     1   0.000      0.830 1.000 0.000
#> GSM587216     1   0.000      0.830 1.000 0.000
#> GSM587217     1   0.000      0.830 1.000 0.000
#> GSM587191     1   0.991      0.478 0.556 0.444
#> GSM587192     1   0.991      0.478 0.556 0.444
#> GSM587193     1   0.969      0.551 0.604 0.396
#> GSM587194     1   0.969      0.551 0.604 0.396
#> GSM587195     1   0.991      0.478 0.556 0.444
#> GSM587196     1   0.991      0.478 0.556 0.444
#> GSM587197     1   0.991      0.478 0.556 0.444
#> GSM587198     1   0.975      0.536 0.592 0.408
#> GSM587199     1   0.975      0.536 0.592 0.408
#> GSM587200     1   0.714      0.724 0.804 0.196
#> GSM587201     1   0.714      0.724 0.804 0.196
#> GSM587202     1   0.975      0.536 0.592 0.408
#> GSM198767     1   0.000      0.830 1.000 0.000
#> GSM198769     1   0.000      0.830 1.000 0.000
#> GSM198772     1   0.000      0.830 1.000 0.000
#> GSM198773     1   0.000      0.830 1.000 0.000
#> GSM198776     1   0.000      0.830 1.000 0.000
#> GSM198778     1   0.000      0.830 1.000 0.000
#> GSM198780     1   0.000      0.830 1.000 0.000
#> GSM198781     1   0.000      0.830 1.000 0.000
#> GSM198765     1   0.991      0.478 0.556 0.444
#> GSM198766     1   0.969      0.551 0.604 0.396
#> GSM198768     1   0.991      0.478 0.556 0.444
#> GSM198770     1   0.991      0.478 0.556 0.444
#> GSM198771     1   0.975      0.536 0.592 0.408
#> GSM198774     1   0.991      0.478 0.556 0.444
#> GSM198775     1   0.969      0.551 0.604 0.396
#> GSM198777     1   0.991      0.478 0.556 0.444
#> GSM198779     1   0.975      0.536 0.592 0.408
#> GSM587218     1   0.000      0.830 1.000 0.000
#> GSM587219     1   0.000      0.830 1.000 0.000
#> GSM587220     1   0.000      0.830 1.000 0.000
#> GSM587221     1   0.000      0.830 1.000 0.000
#> GSM587222     1   0.000      0.830 1.000 0.000
#> GSM587223     1   0.000      0.830 1.000 0.000
#> GSM587224     1   0.000      0.830 1.000 0.000
#> GSM587225     1   0.000      0.830 1.000 0.000
#> GSM587226     1   0.000      0.830 1.000 0.000
#> GSM587227     1   0.000      0.830 1.000 0.000
#> GSM587228     1   0.000      0.830 1.000 0.000
#> GSM587229     1   0.000      0.830 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
#> GSM587155     2  0.0000      0.995 0.000 1.000 0.000
#> GSM587156     2  0.1411      0.961 0.000 0.964 0.036
#> GSM587157     2  0.0000      0.995 0.000 1.000 0.000
#> GSM587158     2  0.0000      0.995 0.000 1.000 0.000
#> GSM587159     2  0.0000      0.995 0.000 1.000 0.000
#> GSM587160     2  0.0000      0.995 0.000 1.000 0.000
#> GSM587161     2  0.0000      0.995 0.000 1.000 0.000
#> GSM587162     2  0.0000      0.995 0.000 1.000 0.000
#> GSM587163     2  0.0000      0.995 0.000 1.000 0.000
#> GSM587164     2  0.0000      0.995 0.000 1.000 0.000
#> GSM587165     2  0.0000      0.995 0.000 1.000 0.000
#> GSM587166     2  0.1411      0.961 0.000 0.964 0.036
#> GSM587167     2  0.1411      0.961 0.000 0.964 0.036
#> GSM587168     2  0.0000      0.995 0.000 1.000 0.000
#> GSM587169     2  0.0000      0.995 0.000 1.000 0.000
#> GSM587170     2  0.0000      0.995 0.000 1.000 0.000
#> GSM587171     2  0.0000      0.995 0.000 1.000 0.000
#> GSM587172     2  0.0000      0.995 0.000 1.000 0.000
#> GSM587173     2  0.0000      0.995 0.000 1.000 0.000
#> GSM587174     2  0.0000      0.995 0.000 1.000 0.000
#> GSM587175     2  0.0000      0.995 0.000 1.000 0.000
#> GSM587176     2  0.0000      0.995 0.000 1.000 0.000
#> GSM587177     2  0.0000      0.995 0.000 1.000 0.000
#> GSM587178     2  0.0000      0.995 0.000 1.000 0.000
#> GSM587179     2  0.0000      0.995 0.000 1.000 0.000
#> GSM587180     2  0.0000      0.995 0.000 1.000 0.000
#> GSM587181     2  0.0000      0.995 0.000 1.000 0.000
#> GSM587182     2  0.0000      0.995 0.000 1.000 0.000
#> GSM587183     2  0.0000      0.995 0.000 1.000 0.000
#> GSM587184     2  0.0000      0.995 0.000 1.000 0.000
#> GSM587185     2  0.0000      0.995 0.000 1.000 0.000
#> GSM587186     2  0.0000      0.995 0.000 1.000 0.000
#> GSM587187     2  0.0000      0.995 0.000 1.000 0.000
#> GSM587188     2  0.0000      0.995 0.000 1.000 0.000
#> GSM587189     2  0.0000      0.995 0.000 1.000 0.000
#> GSM587190     2  0.1411      0.961 0.000 0.964 0.036
#> GSM587203     1  0.0000      0.998 1.000 0.000 0.000
#> GSM587204     1  0.0000      0.998 1.000 0.000 0.000
#> GSM587205     1  0.0000      0.998 1.000 0.000 0.000
#> GSM587206     1  0.0000      0.998 1.000 0.000 0.000
#> GSM587207     1  0.0000      0.998 1.000 0.000 0.000
#> GSM587208     1  0.0000      0.998 1.000 0.000 0.000
#> GSM587209     1  0.0892      0.979 0.980 0.000 0.020
#> GSM587210     3  0.6204      0.453 0.424 0.000 0.576
#> GSM587211     1  0.0000      0.998 1.000 0.000 0.000
#> GSM587212     3  0.6215      0.449 0.428 0.000 0.572
#> GSM587213     1  0.0000      0.998 1.000 0.000 0.000
#> GSM587214     1  0.0000      0.998 1.000 0.000 0.000
#> GSM587215     1  0.0000      0.998 1.000 0.000 0.000
#> GSM587216     1  0.0000      0.998 1.000 0.000 0.000
#> GSM587217     1  0.0000      0.998 1.000 0.000 0.000
#> GSM587191     3  0.5291      0.733 0.000 0.268 0.732
#> GSM587192     3  0.5291      0.733 0.000 0.268 0.732
#> GSM587193     3  0.4796      0.760 0.000 0.220 0.780
#> GSM587194     3  0.4796      0.760 0.000 0.220 0.780
#> GSM587195     3  0.5291      0.733 0.000 0.268 0.732
#> GSM587196     3  0.5291      0.733 0.000 0.268 0.732
#> GSM587197     3  0.5291      0.733 0.000 0.268 0.732
#> GSM587198     3  0.4931      0.756 0.000 0.232 0.768
#> GSM587199     3  0.4931      0.756 0.000 0.232 0.768
#> GSM587200     3  0.5356      0.662 0.196 0.020 0.784
#> GSM587201     3  0.5356      0.662 0.196 0.020 0.784
#> GSM587202     3  0.4931      0.756 0.000 0.232 0.768
#> GSM198767     1  0.0000      0.998 1.000 0.000 0.000
#> GSM198769     1  0.0892      0.979 0.980 0.000 0.020
#> GSM198772     1  0.0000      0.998 1.000 0.000 0.000
#> GSM198773     1  0.0000      0.998 1.000 0.000 0.000
#> GSM198776     1  0.0000      0.998 1.000 0.000 0.000
#> GSM198778     3  0.6204      0.453 0.424 0.000 0.576
#> GSM198780     3  0.6215      0.449 0.428 0.000 0.572
#> GSM198781     1  0.0000      0.998 1.000 0.000 0.000
#> GSM198765     3  0.5291      0.733 0.000 0.268 0.732
#> GSM198766     3  0.4796      0.760 0.000 0.220 0.780
#> GSM198768     3  0.5291      0.733 0.000 0.268 0.732
#> GSM198770     3  0.5291      0.733 0.000 0.268 0.732
#> GSM198771     3  0.4931      0.756 0.000 0.232 0.768
#> GSM198774     3  0.5291      0.733 0.000 0.268 0.732
#> GSM198775     3  0.4796      0.760 0.000 0.220 0.780
#> GSM198777     3  0.5291      0.733 0.000 0.268 0.732
#> GSM198779     3  0.4931      0.756 0.000 0.232 0.768
#> GSM587218     3  0.4235      0.662 0.176 0.000 0.824
#> GSM587219     3  0.4235      0.662 0.176 0.000 0.824
#> GSM587220     3  0.4235      0.662 0.176 0.000 0.824
#> GSM587221     3  0.4235      0.662 0.176 0.000 0.824
#> GSM587222     3  0.4235      0.662 0.176 0.000 0.824
#> GSM587223     3  0.4235      0.662 0.176 0.000 0.824
#> GSM587224     3  0.4235      0.662 0.176 0.000 0.824
#> GSM587225     3  0.4235      0.662 0.176 0.000 0.824
#> GSM587226     3  0.4235      0.662 0.176 0.000 0.824
#> GSM587227     3  0.4235      0.662 0.176 0.000 0.824
#> GSM587228     3  0.4235      0.662 0.176 0.000 0.824
#> GSM587229     3  0.4235      0.662 0.176 0.000 0.824

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM587155     2  0.1302      0.953 0.000 0.956 0.044 0.000
#> GSM587156     2  0.2704      0.882 0.000 0.876 0.124 0.000
#> GSM587157     2  0.1302      0.953 0.000 0.956 0.044 0.000
#> GSM587158     2  0.0000      0.977 0.000 1.000 0.000 0.000
#> GSM587159     2  0.0000      0.977 0.000 1.000 0.000 0.000
#> GSM587160     2  0.0000      0.977 0.000 1.000 0.000 0.000
#> GSM587161     2  0.0000      0.977 0.000 1.000 0.000 0.000
#> GSM587162     2  0.0000      0.977 0.000 1.000 0.000 0.000
#> GSM587163     2  0.0000      0.977 0.000 1.000 0.000 0.000
#> GSM587164     2  0.1302      0.953 0.000 0.956 0.044 0.000
#> GSM587165     2  0.0000      0.977 0.000 1.000 0.000 0.000
#> GSM587166     2  0.2704      0.882 0.000 0.876 0.124 0.000
#> GSM587167     2  0.2704      0.882 0.000 0.876 0.124 0.000
#> GSM587168     2  0.0000      0.977 0.000 1.000 0.000 0.000
#> GSM587169     2  0.0000      0.977 0.000 1.000 0.000 0.000
#> GSM587170     2  0.1302      0.953 0.000 0.956 0.044 0.000
#> GSM587171     2  0.0000      0.977 0.000 1.000 0.000 0.000
#> GSM587172     2  0.0000      0.977 0.000 1.000 0.000 0.000
#> GSM587173     2  0.0000      0.977 0.000 1.000 0.000 0.000
#> GSM587174     2  0.0000      0.977 0.000 1.000 0.000 0.000
#> GSM587175     2  0.1302      0.953 0.000 0.956 0.044 0.000
#> GSM587176     2  0.0000      0.977 0.000 1.000 0.000 0.000
#> GSM587177     2  0.0000      0.977 0.000 1.000 0.000 0.000
#> GSM587178     2  0.0000      0.977 0.000 1.000 0.000 0.000
#> GSM587179     2  0.0000      0.977 0.000 1.000 0.000 0.000
#> GSM587180     2  0.0000      0.977 0.000 1.000 0.000 0.000
#> GSM587181     2  0.0000      0.977 0.000 1.000 0.000 0.000
#> GSM587182     2  0.0000      0.977 0.000 1.000 0.000 0.000
#> GSM587183     2  0.0000      0.977 0.000 1.000 0.000 0.000
#> GSM587184     2  0.0000      0.977 0.000 1.000 0.000 0.000
#> GSM587185     2  0.0000      0.977 0.000 1.000 0.000 0.000
#> GSM587186     2  0.0000      0.977 0.000 1.000 0.000 0.000
#> GSM587187     2  0.0188      0.975 0.000 0.996 0.004 0.000
#> GSM587188     2  0.0707      0.965 0.000 0.980 0.020 0.000
#> GSM587189     2  0.0817      0.964 0.000 0.976 0.024 0.000
#> GSM587190     2  0.2704      0.882 0.000 0.876 0.124 0.000
#> GSM587203     1  0.0000      0.998 1.000 0.000 0.000 0.000
#> GSM587204     1  0.0000      0.998 1.000 0.000 0.000 0.000
#> GSM587205     1  0.0000      0.998 1.000 0.000 0.000 0.000
#> GSM587206     1  0.0000      0.998 1.000 0.000 0.000 0.000
#> GSM587207     1  0.0000      0.998 1.000 0.000 0.000 0.000
#> GSM587208     1  0.0000      0.998 1.000 0.000 0.000 0.000
#> GSM587209     1  0.0779      0.982 0.980 0.000 0.016 0.004
#> GSM587210     3  0.5088      0.362 0.424 0.000 0.572 0.004
#> GSM587211     1  0.0000      0.998 1.000 0.000 0.000 0.000
#> GSM587212     3  0.4925      0.357 0.428 0.000 0.572 0.000
#> GSM587213     1  0.0000      0.998 1.000 0.000 0.000 0.000
#> GSM587214     1  0.0000      0.998 1.000 0.000 0.000 0.000
#> GSM587215     1  0.0000      0.998 1.000 0.000 0.000 0.000
#> GSM587216     1  0.0000      0.998 1.000 0.000 0.000 0.000
#> GSM587217     1  0.0000      0.998 1.000 0.000 0.000 0.000
#> GSM587191     3  0.1389      0.874 0.000 0.048 0.952 0.000
#> GSM587192     3  0.1389      0.874 0.000 0.048 0.952 0.000
#> GSM587193     3  0.0376      0.869 0.000 0.004 0.992 0.004
#> GSM587194     3  0.0376      0.869 0.000 0.004 0.992 0.004
#> GSM587195     3  0.1389      0.874 0.000 0.048 0.952 0.000
#> GSM587196     3  0.1389      0.874 0.000 0.048 0.952 0.000
#> GSM587197     3  0.1389      0.874 0.000 0.048 0.952 0.000
#> GSM587198     3  0.0469      0.874 0.000 0.012 0.988 0.000
#> GSM587199     3  0.0469      0.874 0.000 0.012 0.988 0.000
#> GSM587200     3  0.3751      0.728 0.196 0.000 0.800 0.004
#> GSM587201     3  0.3751      0.728 0.196 0.000 0.800 0.004
#> GSM587202     3  0.0469      0.874 0.000 0.012 0.988 0.000
#> GSM198767     1  0.0000      0.998 1.000 0.000 0.000 0.000
#> GSM198769     1  0.0779      0.982 0.980 0.000 0.016 0.004
#> GSM198772     1  0.0000      0.998 1.000 0.000 0.000 0.000
#> GSM198773     1  0.0000      0.998 1.000 0.000 0.000 0.000
#> GSM198776     1  0.0000      0.998 1.000 0.000 0.000 0.000
#> GSM198778     3  0.5088      0.362 0.424 0.000 0.572 0.004
#> GSM198780     3  0.4925      0.357 0.428 0.000 0.572 0.000
#> GSM198781     1  0.0000      0.998 1.000 0.000 0.000 0.000
#> GSM198765     3  0.1389      0.874 0.000 0.048 0.952 0.000
#> GSM198766     3  0.0376      0.869 0.000 0.004 0.992 0.004
#> GSM198768     3  0.1389      0.874 0.000 0.048 0.952 0.000
#> GSM198770     3  0.1389      0.874 0.000 0.048 0.952 0.000
#> GSM198771     3  0.0469      0.874 0.000 0.012 0.988 0.000
#> GSM198774     3  0.1389      0.874 0.000 0.048 0.952 0.000
#> GSM198775     3  0.0376      0.869 0.000 0.004 0.992 0.004
#> GSM198777     3  0.1389      0.874 0.000 0.048 0.952 0.000
#> GSM198779     3  0.0469      0.874 0.000 0.012 0.988 0.000
#> GSM587218     4  0.0000      1.000 0.000 0.000 0.000 1.000
#> GSM587219     4  0.0000      1.000 0.000 0.000 0.000 1.000
#> GSM587220     4  0.0000      1.000 0.000 0.000 0.000 1.000
#> GSM587221     4  0.0000      1.000 0.000 0.000 0.000 1.000
#> GSM587222     4  0.0000      1.000 0.000 0.000 0.000 1.000
#> GSM587223     4  0.0000      1.000 0.000 0.000 0.000 1.000
#> GSM587224     4  0.0000      1.000 0.000 0.000 0.000 1.000
#> GSM587225     4  0.0000      1.000 0.000 0.000 0.000 1.000
#> GSM587226     4  0.0000      1.000 0.000 0.000 0.000 1.000
#> GSM587227     4  0.0000      1.000 0.000 0.000 0.000 1.000
#> GSM587228     4  0.0000      1.000 0.000 0.000 0.000 1.000
#> GSM587229     4  0.0000      1.000 0.000 0.000 0.000 1.000

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3 p4    p5
#> GSM587155     2  0.2471     0.7852 0.000 0.864 0.000  0 0.136
#> GSM587156     2  0.4404     0.5332 0.000 0.712 0.036  0 0.252
#> GSM587157     2  0.2471     0.7852 0.000 0.864 0.000  0 0.136
#> GSM587158     2  0.0162     0.8877 0.000 0.996 0.000  0 0.004
#> GSM587159     2  0.0000     0.8884 0.000 1.000 0.000  0 0.000
#> GSM587160     2  0.0162     0.8877 0.000 0.996 0.000  0 0.004
#> GSM587161     2  0.0609     0.8823 0.000 0.980 0.000  0 0.020
#> GSM587162     2  0.0404     0.8846 0.000 0.988 0.000  0 0.012
#> GSM587163     2  0.0609     0.8823 0.000 0.980 0.000  0 0.020
#> GSM587164     2  0.2516     0.7808 0.000 0.860 0.000  0 0.140
#> GSM587165     2  0.0000     0.8884 0.000 1.000 0.000  0 0.000
#> GSM587166     2  0.4404     0.5332 0.000 0.712 0.036  0 0.252
#> GSM587167     2  0.4430     0.5244 0.000 0.708 0.036  0 0.256
#> GSM587168     2  0.0000     0.8884 0.000 1.000 0.000  0 0.000
#> GSM587169     2  0.0290     0.8868 0.000 0.992 0.000  0 0.008
#> GSM587170     2  0.2516     0.7808 0.000 0.860 0.000  0 0.140
#> GSM587171     2  0.0000     0.8884 0.000 1.000 0.000  0 0.000
#> GSM587172     2  0.0000     0.8884 0.000 1.000 0.000  0 0.000
#> GSM587173     2  0.0000     0.8884 0.000 1.000 0.000  0 0.000
#> GSM587174     2  0.0000     0.8884 0.000 1.000 0.000  0 0.000
#> GSM587175     2  0.2471     0.7852 0.000 0.864 0.000  0 0.136
#> GSM587176     2  0.1270     0.8587 0.000 0.948 0.000  0 0.052
#> GSM587177     2  0.0000     0.8884 0.000 1.000 0.000  0 0.000
#> GSM587178     2  0.0000     0.8884 0.000 1.000 0.000  0 0.000
#> GSM587179     2  0.0609     0.8823 0.000 0.980 0.000  0 0.020
#> GSM587180     2  0.0000     0.8884 0.000 1.000 0.000  0 0.000
#> GSM587181     2  0.0000     0.8884 0.000 1.000 0.000  0 0.000
#> GSM587182     2  0.0000     0.8884 0.000 1.000 0.000  0 0.000
#> GSM587183     2  0.0000     0.8884 0.000 1.000 0.000  0 0.000
#> GSM587184     2  0.0000     0.8884 0.000 1.000 0.000  0 0.000
#> GSM587185     2  0.0609     0.8823 0.000 0.980 0.000  0 0.020
#> GSM587186     2  0.0000     0.8884 0.000 1.000 0.000  0 0.000
#> GSM587187     2  0.4118     0.0523 0.000 0.660 0.004  0 0.336
#> GSM587188     5  0.4206     0.6203 0.000 0.288 0.016  0 0.696
#> GSM587189     2  0.4872    -0.4210 0.000 0.540 0.024  0 0.436
#> GSM587190     5  0.4637     0.5610 0.000 0.292 0.036  0 0.672
#> GSM587203     1  0.0000     0.9956 1.000 0.000 0.000  0 0.000
#> GSM587204     1  0.0000     0.9956 1.000 0.000 0.000  0 0.000
#> GSM587205     1  0.0000     0.9956 1.000 0.000 0.000  0 0.000
#> GSM587206     1  0.0000     0.9956 1.000 0.000 0.000  0 0.000
#> GSM587207     1  0.0000     0.9956 1.000 0.000 0.000  0 0.000
#> GSM587208     1  0.0000     0.9956 1.000 0.000 0.000  0 0.000
#> GSM587209     1  0.1041     0.9660 0.964 0.000 0.004  0 0.032
#> GSM587210     3  0.5151     0.4075 0.396 0.000 0.560  0 0.044
#> GSM587211     1  0.0000     0.9956 1.000 0.000 0.000  0 0.000
#> GSM587212     3  0.5036     0.3991 0.404 0.000 0.560  0 0.036
#> GSM587213     1  0.0000     0.9956 1.000 0.000 0.000  0 0.000
#> GSM587214     1  0.0000     0.9956 1.000 0.000 0.000  0 0.000
#> GSM587215     1  0.0000     0.9956 1.000 0.000 0.000  0 0.000
#> GSM587216     1  0.0290     0.9896 0.992 0.000 0.000  0 0.008
#> GSM587217     1  0.0000     0.9956 1.000 0.000 0.000  0 0.000
#> GSM587191     3  0.1082     0.8542 0.000 0.028 0.964  0 0.008
#> GSM587192     3  0.1082     0.8542 0.000 0.028 0.964  0 0.008
#> GSM587193     3  0.1478     0.8369 0.000 0.000 0.936  0 0.064
#> GSM587194     3  0.1478     0.8369 0.000 0.000 0.936  0 0.064
#> GSM587195     3  0.1082     0.8542 0.000 0.028 0.964  0 0.008
#> GSM587196     3  0.1082     0.8542 0.000 0.028 0.964  0 0.008
#> GSM587197     3  0.1082     0.8542 0.000 0.028 0.964  0 0.008
#> GSM587198     3  0.0290     0.8525 0.000 0.000 0.992  0 0.008
#> GSM587199     3  0.0290     0.8525 0.000 0.000 0.992  0 0.008
#> GSM587200     3  0.4021     0.7121 0.168 0.000 0.780  0 0.052
#> GSM587201     3  0.4021     0.7121 0.168 0.000 0.780  0 0.052
#> GSM587202     3  0.0290     0.8525 0.000 0.000 0.992  0 0.008
#> GSM198767     1  0.0000     0.9956 1.000 0.000 0.000  0 0.000
#> GSM198769     1  0.1041     0.9660 0.964 0.000 0.004  0 0.032
#> GSM198772     1  0.0000     0.9956 1.000 0.000 0.000  0 0.000
#> GSM198773     1  0.0000     0.9956 1.000 0.000 0.000  0 0.000
#> GSM198776     1  0.0000     0.9956 1.000 0.000 0.000  0 0.000
#> GSM198778     3  0.5151     0.4075 0.396 0.000 0.560  0 0.044
#> GSM198780     3  0.5036     0.3991 0.404 0.000 0.560  0 0.036
#> GSM198781     1  0.0000     0.9956 1.000 0.000 0.000  0 0.000
#> GSM198765     3  0.1082     0.8542 0.000 0.028 0.964  0 0.008
#> GSM198766     3  0.1478     0.8369 0.000 0.000 0.936  0 0.064
#> GSM198768     3  0.1082     0.8542 0.000 0.028 0.964  0 0.008
#> GSM198770     3  0.1082     0.8542 0.000 0.028 0.964  0 0.008
#> GSM198771     3  0.0290     0.8525 0.000 0.000 0.992  0 0.008
#> GSM198774     3  0.1082     0.8542 0.000 0.028 0.964  0 0.008
#> GSM198775     3  0.1478     0.8369 0.000 0.000 0.936  0 0.064
#> GSM198777     3  0.1082     0.8542 0.000 0.028 0.964  0 0.008
#> GSM198779     3  0.0290     0.8525 0.000 0.000 0.992  0 0.008
#> GSM587218     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000
#> GSM587219     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000
#> GSM587220     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000
#> GSM587221     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000
#> GSM587222     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000
#> GSM587223     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000
#> GSM587224     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000
#> GSM587225     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000
#> GSM587226     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000
#> GSM587227     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000
#> GSM587228     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000
#> GSM587229     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3 p4    p5    p6
#> GSM587155     2  0.2260     0.7844 0.000 0.860 0.000  0 0.000 0.140
#> GSM587156     2  0.3713     0.5349 0.000 0.704 0.008  0 0.004 0.284
#> GSM587157     2  0.2260     0.7844 0.000 0.860 0.000  0 0.000 0.140
#> GSM587158     2  0.0146     0.8872 0.000 0.996 0.000  0 0.000 0.004
#> GSM587159     2  0.0000     0.8878 0.000 1.000 0.000  0 0.000 0.000
#> GSM587160     2  0.0146     0.8872 0.000 0.996 0.000  0 0.000 0.004
#> GSM587161     2  0.0547     0.8819 0.000 0.980 0.000  0 0.000 0.020
#> GSM587162     2  0.0363     0.8842 0.000 0.988 0.000  0 0.000 0.012
#> GSM587163     2  0.0547     0.8819 0.000 0.980 0.000  0 0.000 0.020
#> GSM587164     2  0.2300     0.7800 0.000 0.856 0.000  0 0.000 0.144
#> GSM587165     2  0.0000     0.8878 0.000 1.000 0.000  0 0.000 0.000
#> GSM587166     2  0.3713     0.5349 0.000 0.704 0.008  0 0.004 0.284
#> GSM587167     2  0.4127     0.4908 0.000 0.684 0.028  0 0.004 0.284
#> GSM587168     2  0.0000     0.8878 0.000 1.000 0.000  0 0.000 0.000
#> GSM587169     2  0.0260     0.8863 0.000 0.992 0.000  0 0.000 0.008
#> GSM587170     2  0.2300     0.7800 0.000 0.856 0.000  0 0.000 0.144
#> GSM587171     2  0.0000     0.8878 0.000 1.000 0.000  0 0.000 0.000
#> GSM587172     2  0.0000     0.8878 0.000 1.000 0.000  0 0.000 0.000
#> GSM587173     2  0.0000     0.8878 0.000 1.000 0.000  0 0.000 0.000
#> GSM587174     2  0.0000     0.8878 0.000 1.000 0.000  0 0.000 0.000
#> GSM587175     2  0.2260     0.7844 0.000 0.860 0.000  0 0.000 0.140
#> GSM587176     2  0.1141     0.8591 0.000 0.948 0.000  0 0.000 0.052
#> GSM587177     2  0.0000     0.8878 0.000 1.000 0.000  0 0.000 0.000
#> GSM587178     2  0.0000     0.8878 0.000 1.000 0.000  0 0.000 0.000
#> GSM587179     2  0.0547     0.8819 0.000 0.980 0.000  0 0.000 0.020
#> GSM587180     2  0.0000     0.8878 0.000 1.000 0.000  0 0.000 0.000
#> GSM587181     2  0.0000     0.8878 0.000 1.000 0.000  0 0.000 0.000
#> GSM587182     2  0.0000     0.8878 0.000 1.000 0.000  0 0.000 0.000
#> GSM587183     2  0.0000     0.8878 0.000 1.000 0.000  0 0.000 0.000
#> GSM587184     2  0.0000     0.8878 0.000 1.000 0.000  0 0.000 0.000
#> GSM587185     2  0.0547     0.8819 0.000 0.980 0.000  0 0.000 0.020
#> GSM587186     2  0.0000     0.8878 0.000 1.000 0.000  0 0.000 0.000
#> GSM587187     2  0.3984     0.0454 0.000 0.648 0.016  0 0.000 0.336
#> GSM587188     6  0.3534     0.5562 0.000 0.276 0.000  0 0.008 0.716
#> GSM587189     2  0.4819    -0.4612 0.000 0.512 0.044  0 0.004 0.440
#> GSM587190     6  0.4245     0.5734 0.000 0.256 0.044  0 0.004 0.696
#> GSM587203     1  0.0000     0.9677 1.000 0.000 0.000  0 0.000 0.000
#> GSM587204     1  0.0000     0.9677 1.000 0.000 0.000  0 0.000 0.000
#> GSM587205     1  0.0000     0.9677 1.000 0.000 0.000  0 0.000 0.000
#> GSM587206     1  0.0000     0.9677 1.000 0.000 0.000  0 0.000 0.000
#> GSM587207     1  0.0000     0.9677 1.000 0.000 0.000  0 0.000 0.000
#> GSM587208     1  0.0000     0.9677 1.000 0.000 0.000  0 0.000 0.000
#> GSM587209     1  0.2823     0.7560 0.796 0.000 0.000  0 0.204 0.000
#> GSM587210     5  0.3136     0.6021 0.228 0.000 0.004  0 0.768 0.000
#> GSM587211     1  0.0000     0.9677 1.000 0.000 0.000  0 0.000 0.000
#> GSM587212     5  0.3383     0.5892 0.268 0.000 0.004  0 0.728 0.000
#> GSM587213     1  0.0000     0.9677 1.000 0.000 0.000  0 0.000 0.000
#> GSM587214     1  0.0000     0.9677 1.000 0.000 0.000  0 0.000 0.000
#> GSM587215     1  0.0000     0.9677 1.000 0.000 0.000  0 0.000 0.000
#> GSM587216     1  0.2003     0.8577 0.884 0.000 0.000  0 0.116 0.000
#> GSM587217     1  0.0000     0.9677 1.000 0.000 0.000  0 0.000 0.000
#> GSM587191     3  0.0713     0.9424 0.000 0.000 0.972  0 0.028 0.000
#> GSM587192     3  0.0713     0.9424 0.000 0.000 0.972  0 0.028 0.000
#> GSM587193     5  0.4024     0.6318 0.000 0.000 0.184  0 0.744 0.072
#> GSM587194     5  0.4024     0.6318 0.000 0.000 0.184  0 0.744 0.072
#> GSM587195     3  0.0146     0.9405 0.000 0.000 0.996  0 0.000 0.004
#> GSM587196     3  0.0146     0.9405 0.000 0.000 0.996  0 0.000 0.004
#> GSM587197     3  0.0146     0.9405 0.000 0.000 0.996  0 0.000 0.004
#> GSM587198     3  0.2092     0.9017 0.000 0.000 0.876  0 0.124 0.000
#> GSM587199     3  0.2092     0.9017 0.000 0.000 0.876  0 0.124 0.000
#> GSM587200     5  0.3531     0.3500 0.000 0.000 0.328  0 0.672 0.000
#> GSM587201     5  0.3531     0.3500 0.000 0.000 0.328  0 0.672 0.000
#> GSM587202     3  0.2092     0.9017 0.000 0.000 0.876  0 0.124 0.000
#> GSM198767     1  0.0000     0.9677 1.000 0.000 0.000  0 0.000 0.000
#> GSM198769     1  0.2823     0.7560 0.796 0.000 0.000  0 0.204 0.000
#> GSM198772     1  0.0000     0.9677 1.000 0.000 0.000  0 0.000 0.000
#> GSM198773     1  0.0000     0.9677 1.000 0.000 0.000  0 0.000 0.000
#> GSM198776     1  0.0000     0.9677 1.000 0.000 0.000  0 0.000 0.000
#> GSM198778     5  0.3136     0.6021 0.228 0.000 0.004  0 0.768 0.000
#> GSM198780     5  0.3383     0.5892 0.268 0.000 0.004  0 0.728 0.000
#> GSM198781     1  0.0000     0.9677 1.000 0.000 0.000  0 0.000 0.000
#> GSM198765     3  0.0713     0.9424 0.000 0.000 0.972  0 0.028 0.000
#> GSM198766     5  0.4024     0.6318 0.000 0.000 0.184  0 0.744 0.072
#> GSM198768     3  0.0146     0.9405 0.000 0.000 0.996  0 0.000 0.004
#> GSM198770     3  0.0146     0.9405 0.000 0.000 0.996  0 0.000 0.004
#> GSM198771     3  0.2092     0.9017 0.000 0.000 0.876  0 0.124 0.000
#> GSM198774     3  0.0713     0.9424 0.000 0.000 0.972  0 0.028 0.000
#> GSM198775     5  0.4024     0.6318 0.000 0.000 0.184  0 0.744 0.072
#> GSM198777     3  0.0146     0.9405 0.000 0.000 0.996  0 0.000 0.004
#> GSM198779     3  0.2092     0.9017 0.000 0.000 0.876  0 0.124 0.000
#> GSM587218     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587219     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587220     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587221     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587222     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587223     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587224     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587225     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587226     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587227     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587228     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587229     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000 0.000

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

consensus_heatmap(res, k = 2)

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

consensus_heatmap(res, k = 3)

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

consensus_heatmap(res, k = 4)

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

consensus_heatmap(res, k = 5)

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

consensus_heatmap(res, k = 6)

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

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

membership_heatmap(res, k = 2)

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

membership_heatmap(res, k = 3)

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

membership_heatmap(res, k = 4)

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

membership_heatmap(res, k = 5)

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

membership_heatmap(res, k = 6)

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

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

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

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

get_signatures(res, k = 3)

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

get_signatures(res, k = 4)

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 specimen(p) k
#> SD:hclust 82    1.38e-15 2
#> SD:hclust 88    2.82e-31 3
#> SD:hclust 88    1.15e-45 4
#> SD:hclust 86    2.09e-58 5
#> SD:hclust 87    1.01e-52 6

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


SD:kmeans

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

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

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

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

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

collect_plots(res)

plot of chunk SD-kmeans-collect-plots

The plots are:

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

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

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

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

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.688           0.932       0.952         0.4823 0.500   0.500
#> 3 3 0.673           0.876       0.873         0.3235 0.793   0.605
#> 4 4 0.854           0.926       0.885         0.1164 0.934   0.806
#> 5 5 0.747           0.847       0.840         0.0682 1.000   1.000
#> 6 6 0.727           0.774       0.769         0.0396 1.000   1.000

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
#> GSM587155     2   0.000      0.940 0.000 1.000
#> GSM587156     2   0.000      0.940 0.000 1.000
#> GSM587157     2   0.000      0.940 0.000 1.000
#> GSM587158     2   0.000      0.940 0.000 1.000
#> GSM587159     2   0.000      0.940 0.000 1.000
#> GSM587160     2   0.000      0.940 0.000 1.000
#> GSM587161     2   0.000      0.940 0.000 1.000
#> GSM587162     2   0.000      0.940 0.000 1.000
#> GSM587163     2   0.000      0.940 0.000 1.000
#> GSM587164     2   0.000      0.940 0.000 1.000
#> GSM587165     2   0.000      0.940 0.000 1.000
#> GSM587166     2   0.000      0.940 0.000 1.000
#> GSM587167     2   0.000      0.940 0.000 1.000
#> GSM587168     2   0.000      0.940 0.000 1.000
#> GSM587169     2   0.000      0.940 0.000 1.000
#> GSM587170     2   0.000      0.940 0.000 1.000
#> GSM587171     2   0.000      0.940 0.000 1.000
#> GSM587172     2   0.000      0.940 0.000 1.000
#> GSM587173     2   0.000      0.940 0.000 1.000
#> GSM587174     2   0.000      0.940 0.000 1.000
#> GSM587175     2   0.000      0.940 0.000 1.000
#> GSM587176     2   0.000      0.940 0.000 1.000
#> GSM587177     2   0.000      0.940 0.000 1.000
#> GSM587178     2   0.000      0.940 0.000 1.000
#> GSM587179     2   0.000      0.940 0.000 1.000
#> GSM587180     2   0.000      0.940 0.000 1.000
#> GSM587181     2   0.000      0.940 0.000 1.000
#> GSM587182     2   0.000      0.940 0.000 1.000
#> GSM587183     2   0.000      0.940 0.000 1.000
#> GSM587184     2   0.000      0.940 0.000 1.000
#> GSM587185     2   0.000      0.940 0.000 1.000
#> GSM587186     2   0.000      0.940 0.000 1.000
#> GSM587187     2   0.000      0.940 0.000 1.000
#> GSM587188     2   0.000      0.940 0.000 1.000
#> GSM587189     2   0.000      0.940 0.000 1.000
#> GSM587190     2   0.000      0.940 0.000 1.000
#> GSM587203     1   0.295      0.975 0.948 0.052
#> GSM587204     1   0.295      0.975 0.948 0.052
#> GSM587205     1   0.295      0.975 0.948 0.052
#> GSM587206     1   0.295      0.975 0.948 0.052
#> GSM587207     1   0.295      0.975 0.948 0.052
#> GSM587208     1   0.295      0.975 0.948 0.052
#> GSM587209     1   0.295      0.975 0.948 0.052
#> GSM587210     1   0.295      0.975 0.948 0.052
#> GSM587211     1   0.295      0.975 0.948 0.052
#> GSM587212     1   0.295      0.975 0.948 0.052
#> GSM587213     1   0.295      0.975 0.948 0.052
#> GSM587214     1   0.295      0.975 0.948 0.052
#> GSM587215     1   0.295      0.975 0.948 0.052
#> GSM587216     1   0.295      0.975 0.948 0.052
#> GSM587217     1   0.295      0.975 0.948 0.052
#> GSM587191     2   0.680      0.830 0.180 0.820
#> GSM587192     1   0.662      0.831 0.828 0.172
#> GSM587193     1   0.295      0.975 0.948 0.052
#> GSM587194     2   0.680      0.830 0.180 0.820
#> GSM587195     2   0.671      0.834 0.176 0.824
#> GSM587196     2   0.680      0.830 0.180 0.820
#> GSM587197     2   0.671      0.834 0.176 0.824
#> GSM587198     2   0.680      0.830 0.180 0.820
#> GSM587199     2   0.680      0.830 0.180 0.820
#> GSM587200     1   0.295      0.975 0.948 0.052
#> GSM587201     1   0.295      0.975 0.948 0.052
#> GSM587202     2   0.680      0.830 0.180 0.820
#> GSM198767     1   0.295      0.975 0.948 0.052
#> GSM198769     1   0.295      0.975 0.948 0.052
#> GSM198772     1   0.295      0.975 0.948 0.052
#> GSM198773     1   0.295      0.975 0.948 0.052
#> GSM198776     1   0.295      0.975 0.948 0.052
#> GSM198778     1   0.295      0.975 0.948 0.052
#> GSM198780     1   0.295      0.975 0.948 0.052
#> GSM198781     1   0.295      0.975 0.948 0.052
#> GSM198765     2   0.680      0.830 0.180 0.820
#> GSM198766     1   0.295      0.975 0.948 0.052
#> GSM198768     2   0.671      0.834 0.176 0.824
#> GSM198770     2   0.671      0.834 0.176 0.824
#> GSM198771     2   0.680      0.830 0.180 0.820
#> GSM198774     1   0.662      0.831 0.828 0.172
#> GSM198775     2   0.680      0.830 0.180 0.820
#> GSM198777     2   0.680      0.830 0.180 0.820
#> GSM198779     2   0.680      0.830 0.180 0.820
#> GSM587218     1   0.000      0.951 1.000 0.000
#> GSM587219     1   0.000      0.951 1.000 0.000
#> GSM587220     1   0.000      0.951 1.000 0.000
#> GSM587221     1   0.000      0.951 1.000 0.000
#> GSM587222     1   0.000      0.951 1.000 0.000
#> GSM587223     1   0.000      0.951 1.000 0.000
#> GSM587224     1   0.000      0.951 1.000 0.000
#> GSM587225     1   0.000      0.951 1.000 0.000
#> GSM587226     1   0.000      0.951 1.000 0.000
#> GSM587227     1   0.000      0.951 1.000 0.000
#> GSM587228     1   0.000      0.951 1.000 0.000
#> GSM587229     1   0.000      0.951 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
#> GSM587155     2  0.0000      0.998 0.000 1.000 0.000
#> GSM587156     2  0.0424      0.990 0.000 0.992 0.008
#> GSM587157     2  0.0000      0.998 0.000 1.000 0.000
#> GSM587158     2  0.0000      0.998 0.000 1.000 0.000
#> GSM587159     2  0.0000      0.998 0.000 1.000 0.000
#> GSM587160     2  0.0000      0.998 0.000 1.000 0.000
#> GSM587161     2  0.0000      0.998 0.000 1.000 0.000
#> GSM587162     2  0.0000      0.998 0.000 1.000 0.000
#> GSM587163     2  0.0000      0.998 0.000 1.000 0.000
#> GSM587164     2  0.0000      0.998 0.000 1.000 0.000
#> GSM587165     2  0.0237      0.996 0.000 0.996 0.004
#> GSM587166     2  0.0747      0.980 0.000 0.984 0.016
#> GSM587167     2  0.0000      0.998 0.000 1.000 0.000
#> GSM587168     2  0.0237      0.996 0.000 0.996 0.004
#> GSM587169     2  0.0000      0.998 0.000 1.000 0.000
#> GSM587170     2  0.0000      0.998 0.000 1.000 0.000
#> GSM587171     2  0.0000      0.998 0.000 1.000 0.000
#> GSM587172     2  0.0000      0.998 0.000 1.000 0.000
#> GSM587173     2  0.0237      0.996 0.000 0.996 0.004
#> GSM587174     2  0.0000      0.998 0.000 1.000 0.000
#> GSM587175     2  0.0000      0.998 0.000 1.000 0.000
#> GSM587176     2  0.0000      0.998 0.000 1.000 0.000
#> GSM587177     2  0.0237      0.996 0.000 0.996 0.004
#> GSM587178     2  0.0000      0.998 0.000 1.000 0.000
#> GSM587179     2  0.0000      0.998 0.000 1.000 0.000
#> GSM587180     2  0.0237      0.996 0.000 0.996 0.004
#> GSM587181     2  0.0000      0.998 0.000 1.000 0.000
#> GSM587182     2  0.0000      0.998 0.000 1.000 0.000
#> GSM587183     2  0.0237      0.996 0.000 0.996 0.004
#> GSM587184     2  0.0000      0.998 0.000 1.000 0.000
#> GSM587185     2  0.0000      0.998 0.000 1.000 0.000
#> GSM587186     2  0.0237      0.996 0.000 0.996 0.004
#> GSM587187     2  0.0237      0.996 0.000 0.996 0.004
#> GSM587188     2  0.0424      0.993 0.000 0.992 0.008
#> GSM587189     2  0.0424      0.993 0.000 0.992 0.008
#> GSM587190     3  0.5621      0.803 0.000 0.308 0.692
#> GSM587203     1  0.5058      0.838 0.756 0.000 0.244
#> GSM587204     1  0.5058      0.838 0.756 0.000 0.244
#> GSM587205     1  0.5058      0.838 0.756 0.000 0.244
#> GSM587206     1  0.5058      0.838 0.756 0.000 0.244
#> GSM587207     1  0.5058      0.838 0.756 0.000 0.244
#> GSM587208     1  0.5058      0.838 0.756 0.000 0.244
#> GSM587209     1  0.5058      0.838 0.756 0.000 0.244
#> GSM587210     1  0.6008      0.794 0.628 0.000 0.372
#> GSM587211     1  0.5058      0.838 0.756 0.000 0.244
#> GSM587212     1  0.5988      0.796 0.632 0.000 0.368
#> GSM587213     1  0.5058      0.838 0.756 0.000 0.244
#> GSM587214     1  0.5058      0.838 0.756 0.000 0.244
#> GSM587215     1  0.5058      0.838 0.756 0.000 0.244
#> GSM587216     1  0.5058      0.838 0.756 0.000 0.244
#> GSM587217     1  0.5058      0.838 0.756 0.000 0.244
#> GSM587191     3  0.5325      0.894 0.004 0.248 0.748
#> GSM587192     3  0.2955      0.762 0.008 0.080 0.912
#> GSM587193     3  0.0592      0.645 0.012 0.000 0.988
#> GSM587194     3  0.5406      0.886 0.012 0.224 0.764
#> GSM587195     3  0.5541      0.893 0.008 0.252 0.740
#> GSM587196     3  0.5541      0.893 0.008 0.252 0.740
#> GSM587197     3  0.5541      0.893 0.008 0.252 0.740
#> GSM587198     3  0.5502      0.895 0.008 0.248 0.744
#> GSM587199     3  0.5619      0.894 0.012 0.244 0.744
#> GSM587200     3  0.0592      0.645 0.012 0.000 0.988
#> GSM587201     3  0.0747      0.644 0.016 0.000 0.984
#> GSM587202     3  0.5502      0.895 0.008 0.248 0.744
#> GSM198767     1  0.5058      0.838 0.756 0.000 0.244
#> GSM198769     1  0.5058      0.838 0.756 0.000 0.244
#> GSM198772     1  0.5058      0.838 0.756 0.000 0.244
#> GSM198773     1  0.5058      0.838 0.756 0.000 0.244
#> GSM198776     1  0.5058      0.838 0.756 0.000 0.244
#> GSM198778     1  0.6008      0.794 0.628 0.000 0.372
#> GSM198780     1  0.5988      0.796 0.632 0.000 0.368
#> GSM198781     1  0.5058      0.838 0.756 0.000 0.244
#> GSM198765     3  0.5325      0.894 0.004 0.248 0.748
#> GSM198766     3  0.0592      0.645 0.012 0.000 0.988
#> GSM198768     3  0.5541      0.893 0.008 0.252 0.740
#> GSM198770     3  0.5541      0.893 0.008 0.252 0.740
#> GSM198771     3  0.5502      0.895 0.008 0.248 0.744
#> GSM198774     3  0.2955      0.762 0.008 0.080 0.912
#> GSM198775     3  0.5406      0.886 0.012 0.224 0.764
#> GSM198777     3  0.5541      0.893 0.008 0.252 0.740
#> GSM198779     3  0.5619      0.894 0.012 0.244 0.744
#> GSM587218     1  0.5560      0.525 0.700 0.000 0.300
#> GSM587219     1  0.4235      0.706 0.824 0.000 0.176
#> GSM587220     1  0.4178      0.709 0.828 0.000 0.172
#> GSM587221     1  0.4235      0.706 0.824 0.000 0.176
#> GSM587222     1  0.4178      0.709 0.828 0.000 0.172
#> GSM587223     1  0.4235      0.706 0.824 0.000 0.176
#> GSM587224     1  0.4235      0.706 0.824 0.000 0.176
#> GSM587225     1  0.4178      0.709 0.828 0.000 0.172
#> GSM587226     1  0.4235      0.706 0.824 0.000 0.176
#> GSM587227     1  0.4178      0.709 0.828 0.000 0.172
#> GSM587228     1  0.4178      0.709 0.828 0.000 0.172
#> GSM587229     1  0.4178      0.709 0.828 0.000 0.172

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM587155     2  0.2266      0.922 0.084 0.912 0.000 0.004
#> GSM587156     2  0.3972      0.853 0.164 0.816 0.016 0.004
#> GSM587157     2  0.2401      0.918 0.092 0.904 0.000 0.004
#> GSM587158     2  0.0188      0.949 0.004 0.996 0.000 0.000
#> GSM587159     2  0.0000      0.949 0.000 1.000 0.000 0.000
#> GSM587160     2  0.0188      0.949 0.004 0.996 0.000 0.000
#> GSM587161     2  0.1209      0.942 0.032 0.964 0.000 0.004
#> GSM587162     2  0.0779      0.947 0.016 0.980 0.000 0.004
#> GSM587163     2  0.0188      0.949 0.004 0.996 0.000 0.000
#> GSM587164     2  0.2401      0.918 0.092 0.904 0.000 0.004
#> GSM587165     2  0.2053      0.939 0.072 0.924 0.000 0.004
#> GSM587166     2  0.4559      0.827 0.164 0.792 0.040 0.004
#> GSM587167     2  0.2530      0.913 0.100 0.896 0.000 0.004
#> GSM587168     2  0.2053      0.939 0.072 0.924 0.000 0.004
#> GSM587169     2  0.0188      0.949 0.004 0.996 0.000 0.000
#> GSM587170     2  0.2401      0.918 0.092 0.904 0.000 0.004
#> GSM587171     2  0.0000      0.949 0.000 1.000 0.000 0.000
#> GSM587172     2  0.0000      0.949 0.000 1.000 0.000 0.000
#> GSM587173     2  0.2053      0.939 0.072 0.924 0.000 0.004
#> GSM587174     2  0.0817      0.949 0.024 0.976 0.000 0.000
#> GSM587175     2  0.2266      0.922 0.084 0.912 0.000 0.004
#> GSM587176     2  0.0657      0.947 0.012 0.984 0.000 0.004
#> GSM587177     2  0.2053      0.939 0.072 0.924 0.000 0.004
#> GSM587178     2  0.1978      0.940 0.068 0.928 0.000 0.004
#> GSM587179     2  0.0779      0.947 0.016 0.980 0.000 0.004
#> GSM587180     2  0.2053      0.939 0.072 0.924 0.000 0.004
#> GSM587181     2  0.0817      0.949 0.024 0.976 0.000 0.000
#> GSM587182     2  0.1978      0.940 0.068 0.928 0.000 0.004
#> GSM587183     2  0.2053      0.939 0.072 0.924 0.000 0.004
#> GSM587184     2  0.0592      0.949 0.016 0.984 0.000 0.000
#> GSM587185     2  0.0779      0.947 0.016 0.980 0.000 0.004
#> GSM587186     2  0.2053      0.939 0.072 0.924 0.000 0.004
#> GSM587187     2  0.2197      0.936 0.080 0.916 0.000 0.004
#> GSM587188     2  0.2586      0.928 0.092 0.900 0.004 0.004
#> GSM587189     2  0.2586      0.928 0.092 0.900 0.004 0.004
#> GSM587190     3  0.3521      0.922 0.084 0.052 0.864 0.000
#> GSM587203     1  0.5231      0.927 0.604 0.000 0.012 0.384
#> GSM587204     1  0.5231      0.927 0.604 0.000 0.012 0.384
#> GSM587205     1  0.5231      0.927 0.604 0.000 0.012 0.384
#> GSM587206     1  0.5231      0.927 0.604 0.000 0.012 0.384
#> GSM587207     1  0.5231      0.927 0.604 0.000 0.012 0.384
#> GSM587208     1  0.5231      0.927 0.604 0.000 0.012 0.384
#> GSM587209     1  0.5659      0.929 0.600 0.000 0.032 0.368
#> GSM587210     1  0.7504      0.668 0.464 0.000 0.192 0.344
#> GSM587211     1  0.5673      0.930 0.596 0.000 0.032 0.372
#> GSM587212     1  0.6961      0.809 0.512 0.000 0.120 0.368
#> GSM587213     1  0.5510      0.932 0.600 0.000 0.024 0.376
#> GSM587214     1  0.5510      0.932 0.600 0.000 0.024 0.376
#> GSM587215     1  0.5673      0.930 0.596 0.000 0.032 0.372
#> GSM587216     1  0.5645      0.926 0.604 0.000 0.032 0.364
#> GSM587217     1  0.5587      0.931 0.600 0.000 0.028 0.372
#> GSM587191     3  0.3160      0.937 0.060 0.040 0.892 0.008
#> GSM587192     3  0.2342      0.920 0.080 0.000 0.912 0.008
#> GSM587193     3  0.2999      0.891 0.132 0.000 0.864 0.004
#> GSM587194     3  0.3931      0.908 0.128 0.040 0.832 0.000
#> GSM587195     3  0.3385      0.932 0.072 0.040 0.880 0.008
#> GSM587196     3  0.3385      0.932 0.072 0.040 0.880 0.008
#> GSM587197     3  0.3160      0.934 0.060 0.040 0.892 0.008
#> GSM587198     3  0.2245      0.940 0.020 0.040 0.932 0.008
#> GSM587199     3  0.2245      0.940 0.020 0.040 0.932 0.008
#> GSM587200     3  0.2342      0.915 0.080 0.000 0.912 0.008
#> GSM587201     3  0.2342      0.915 0.080 0.000 0.912 0.008
#> GSM587202     3  0.2245      0.940 0.020 0.040 0.932 0.008
#> GSM198767     1  0.5231      0.927 0.604 0.000 0.012 0.384
#> GSM198769     1  0.5659      0.929 0.600 0.000 0.032 0.368
#> GSM198772     1  0.5673      0.930 0.596 0.000 0.032 0.372
#> GSM198773     1  0.5510      0.932 0.600 0.000 0.024 0.376
#> GSM198776     1  0.5231      0.927 0.604 0.000 0.012 0.384
#> GSM198778     1  0.7504      0.668 0.464 0.000 0.192 0.344
#> GSM198780     1  0.6961      0.809 0.512 0.000 0.120 0.368
#> GSM198781     1  0.5510      0.932 0.600 0.000 0.024 0.376
#> GSM198765     3  0.3160      0.937 0.060 0.040 0.892 0.008
#> GSM198766     3  0.2999      0.891 0.132 0.000 0.864 0.004
#> GSM198768     3  0.3385      0.932 0.072 0.040 0.880 0.008
#> GSM198770     3  0.3160      0.934 0.060 0.040 0.892 0.008
#> GSM198771     3  0.2245      0.940 0.020 0.040 0.932 0.008
#> GSM198774     3  0.2342      0.920 0.080 0.000 0.912 0.008
#> GSM198775     3  0.3931      0.908 0.128 0.040 0.832 0.000
#> GSM198777     3  0.3385      0.932 0.072 0.040 0.880 0.008
#> GSM198779     3  0.2245      0.940 0.020 0.040 0.932 0.008
#> GSM587218     4  0.3013      0.840 0.032 0.000 0.080 0.888
#> GSM587219     4  0.1004      0.975 0.004 0.000 0.024 0.972
#> GSM587220     4  0.1004      0.975 0.004 0.000 0.024 0.972
#> GSM587221     4  0.0707      0.975 0.000 0.000 0.020 0.980
#> GSM587222     4  0.0707      0.975 0.000 0.000 0.020 0.980
#> GSM587223     4  0.0895      0.974 0.004 0.000 0.020 0.976
#> GSM587224     4  0.0707      0.975 0.000 0.000 0.020 0.980
#> GSM587225     4  0.1398      0.970 0.004 0.000 0.040 0.956
#> GSM587226     4  0.0707      0.975 0.000 0.000 0.020 0.980
#> GSM587227     4  0.1545      0.970 0.008 0.000 0.040 0.952
#> GSM587228     4  0.1398      0.970 0.004 0.000 0.040 0.956
#> GSM587229     4  0.1545      0.970 0.008 0.000 0.040 0.952

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4 p5
#> GSM587155     2  0.4218      0.736 0.000 0.660 0.000 0.008 NA
#> GSM587156     2  0.4936      0.651 0.000 0.564 0.012 0.012 NA
#> GSM587157     2  0.4182      0.723 0.000 0.644 0.000 0.004 NA
#> GSM587158     2  0.0162      0.873 0.000 0.996 0.000 0.000 NA
#> GSM587159     2  0.0404      0.873 0.000 0.988 0.000 0.000 NA
#> GSM587160     2  0.0798      0.872 0.000 0.976 0.000 0.008 NA
#> GSM587161     2  0.2929      0.831 0.000 0.840 0.000 0.008 NA
#> GSM587162     2  0.2077      0.862 0.000 0.908 0.000 0.008 NA
#> GSM587163     2  0.0912      0.872 0.000 0.972 0.000 0.012 NA
#> GSM587164     2  0.4045      0.722 0.000 0.644 0.000 0.000 NA
#> GSM587165     2  0.2735      0.856 0.000 0.880 0.000 0.036 NA
#> GSM587166     2  0.5028      0.646 0.000 0.560 0.016 0.012 NA
#> GSM587167     2  0.4074      0.715 0.000 0.636 0.000 0.000 NA
#> GSM587168     2  0.2946      0.856 0.000 0.868 0.000 0.044 NA
#> GSM587169     2  0.0912      0.872 0.000 0.972 0.000 0.012 NA
#> GSM587170     2  0.4045      0.722 0.000 0.644 0.000 0.000 NA
#> GSM587171     2  0.0404      0.873 0.000 0.988 0.000 0.000 NA
#> GSM587172     2  0.0404      0.873 0.000 0.988 0.000 0.000 NA
#> GSM587173     2  0.2983      0.855 0.000 0.864 0.000 0.040 NA
#> GSM587174     2  0.1211      0.871 0.000 0.960 0.000 0.016 NA
#> GSM587175     2  0.4101      0.737 0.000 0.664 0.000 0.004 NA
#> GSM587176     2  0.1628      0.866 0.000 0.936 0.000 0.008 NA
#> GSM587177     2  0.2735      0.856 0.000 0.880 0.000 0.036 NA
#> GSM587178     2  0.2270      0.860 0.000 0.904 0.000 0.020 NA
#> GSM587179     2  0.1597      0.868 0.000 0.940 0.000 0.012 NA
#> GSM587180     2  0.3019      0.858 0.000 0.864 0.000 0.048 NA
#> GSM587181     2  0.1211      0.871 0.000 0.960 0.000 0.016 NA
#> GSM587182     2  0.2946      0.859 0.000 0.868 0.000 0.044 NA
#> GSM587183     2  0.2735      0.856 0.000 0.880 0.000 0.036 NA
#> GSM587184     2  0.0324      0.873 0.000 0.992 0.000 0.004 NA
#> GSM587185     2  0.1597      0.868 0.000 0.940 0.000 0.012 NA
#> GSM587186     2  0.2983      0.855 0.000 0.864 0.000 0.040 NA
#> GSM587187     2  0.3323      0.848 0.000 0.844 0.000 0.056 NA
#> GSM587188     2  0.4275      0.824 0.000 0.796 0.024 0.052 NA
#> GSM587189     2  0.4364      0.826 0.000 0.788 0.024 0.052 NA
#> GSM587190     3  0.4145      0.830 0.000 0.012 0.772 0.028 NA
#> GSM587203     1  0.2179      0.840 0.896 0.000 0.000 0.004 NA
#> GSM587204     1  0.2179      0.840 0.896 0.000 0.000 0.004 NA
#> GSM587205     1  0.2179      0.840 0.896 0.000 0.000 0.004 NA
#> GSM587206     1  0.2179      0.840 0.896 0.000 0.000 0.004 NA
#> GSM587207     1  0.2179      0.840 0.896 0.000 0.000 0.004 NA
#> GSM587208     1  0.2179      0.840 0.896 0.000 0.000 0.004 NA
#> GSM587209     1  0.2052      0.852 0.912 0.000 0.004 0.004 NA
#> GSM587210     1  0.5910      0.633 0.652 0.000 0.092 0.036 NA
#> GSM587211     1  0.2445      0.841 0.884 0.000 0.004 0.004 NA
#> GSM587212     1  0.4604      0.743 0.748 0.000 0.040 0.020 NA
#> GSM587213     1  0.0290      0.859 0.992 0.000 0.000 0.008 NA
#> GSM587214     1  0.0290      0.859 0.992 0.000 0.000 0.008 NA
#> GSM587215     1  0.1928      0.852 0.920 0.000 0.004 0.004 NA
#> GSM587216     1  0.3299      0.808 0.828 0.000 0.004 0.016 NA
#> GSM587217     1  0.1768      0.853 0.924 0.000 0.000 0.004 NA
#> GSM587191     3  0.3532      0.870 0.004 0.004 0.840 0.044 NA
#> GSM587192     3  0.3881      0.864 0.008 0.000 0.812 0.052 NA
#> GSM587193     3  0.5890      0.789 0.032 0.000 0.640 0.084 NA
#> GSM587194     3  0.5395      0.811 0.004 0.004 0.664 0.084 NA
#> GSM587195     3  0.2227      0.867 0.004 0.004 0.920 0.028 NA
#> GSM587196     3  0.2227      0.867 0.004 0.004 0.920 0.028 NA
#> GSM587197     3  0.2312      0.869 0.004 0.004 0.916 0.032 NA
#> GSM587198     3  0.1471      0.878 0.000 0.004 0.952 0.024 NA
#> GSM587199     3  0.2369      0.877 0.000 0.004 0.908 0.032 NA
#> GSM587200     3  0.4848      0.832 0.012 0.000 0.736 0.076 NA
#> GSM587201     3  0.4848      0.832 0.012 0.000 0.736 0.076 NA
#> GSM587202     3  0.1560      0.878 0.000 0.004 0.948 0.028 NA
#> GSM198767     1  0.2179      0.840 0.896 0.000 0.000 0.004 NA
#> GSM198769     1  0.2052      0.852 0.912 0.000 0.004 0.004 NA
#> GSM198772     1  0.2445      0.841 0.884 0.000 0.004 0.004 NA
#> GSM198773     1  0.0290      0.859 0.992 0.000 0.000 0.008 NA
#> GSM198776     1  0.2179      0.840 0.896 0.000 0.000 0.004 NA
#> GSM198778     1  0.5910      0.633 0.652 0.000 0.092 0.036 NA
#> GSM198780     1  0.4604      0.743 0.748 0.000 0.040 0.020 NA
#> GSM198781     1  0.0290      0.859 0.992 0.000 0.000 0.008 NA
#> GSM198765     3  0.3532      0.870 0.004 0.004 0.840 0.044 NA
#> GSM198766     3  0.5890      0.789 0.032 0.000 0.640 0.084 NA
#> GSM198768     3  0.2227      0.867 0.004 0.004 0.920 0.028 NA
#> GSM198770     3  0.2312      0.869 0.004 0.004 0.916 0.032 NA
#> GSM198771     3  0.1471      0.878 0.000 0.004 0.952 0.024 NA
#> GSM198774     3  0.3881      0.864 0.008 0.000 0.812 0.052 NA
#> GSM198775     3  0.5395      0.811 0.004 0.004 0.664 0.084 NA
#> GSM198777     3  0.2227      0.867 0.004 0.004 0.920 0.028 NA
#> GSM198779     3  0.2369      0.877 0.000 0.004 0.908 0.032 NA
#> GSM587218     4  0.3327      0.888 0.144 0.000 0.028 0.828 NA
#> GSM587219     4  0.3972      0.965 0.212 0.000 0.008 0.764 NA
#> GSM587220     4  0.3883      0.964 0.216 0.000 0.004 0.764 NA
#> GSM587221     4  0.3764      0.964 0.212 0.000 0.008 0.772 NA
#> GSM587222     4  0.3675      0.963 0.216 0.000 0.004 0.772 NA
#> GSM587223     4  0.3487      0.964 0.212 0.000 0.008 0.780 NA
#> GSM587224     4  0.3764      0.964 0.212 0.000 0.008 0.772 NA
#> GSM587225     4  0.5009      0.953 0.216 0.000 0.008 0.704 NA
#> GSM587226     4  0.3764      0.964 0.212 0.000 0.008 0.772 NA
#> GSM587227     4  0.4893      0.952 0.216 0.000 0.008 0.712 NA
#> GSM587228     4  0.5009      0.953 0.216 0.000 0.008 0.704 NA
#> GSM587229     4  0.4893      0.952 0.216 0.000 0.008 0.712 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
#> GSM587155     2  0.3769      0.689 0.000 0.640 0.000 0.000 NA NA
#> GSM587156     2  0.5125      0.534 0.000 0.480 0.016 0.016 NA NA
#> GSM587157     2  0.3807      0.681 0.000 0.628 0.000 0.000 NA NA
#> GSM587158     2  0.1082      0.820 0.000 0.956 0.000 0.000 NA NA
#> GSM587159     2  0.0260      0.819 0.000 0.992 0.000 0.000 NA NA
#> GSM587160     2  0.0717      0.818 0.000 0.976 0.000 0.000 NA NA
#> GSM587161     2  0.2092      0.791 0.000 0.876 0.000 0.000 NA NA
#> GSM587162     2  0.1858      0.808 0.000 0.912 0.000 0.000 NA NA
#> GSM587163     2  0.0547      0.818 0.000 0.980 0.000 0.000 NA NA
#> GSM587164     2  0.3717      0.672 0.000 0.616 0.000 0.000 NA NA
#> GSM587165     2  0.3266      0.773 0.000 0.728 0.000 0.000 NA NA
#> GSM587166     2  0.5198      0.527 0.000 0.476 0.020 0.016 NA NA
#> GSM587167     2  0.4486      0.653 0.000 0.584 0.000 0.004 NA NA
#> GSM587168     2  0.3629      0.770 0.000 0.712 0.000 0.000 NA NA
#> GSM587169     2  0.0547      0.818 0.000 0.980 0.000 0.000 NA NA
#> GSM587170     2  0.3737      0.670 0.000 0.608 0.000 0.000 NA NA
#> GSM587171     2  0.0260      0.819 0.000 0.992 0.000 0.000 NA NA
#> GSM587172     2  0.0260      0.819 0.000 0.992 0.000 0.000 NA NA
#> GSM587173     2  0.3489      0.766 0.000 0.708 0.000 0.004 NA NA
#> GSM587174     2  0.1462      0.819 0.000 0.936 0.000 0.000 NA NA
#> GSM587175     2  0.3607      0.693 0.000 0.652 0.000 0.000 NA NA
#> GSM587176     2  0.1398      0.814 0.000 0.940 0.000 0.000 NA NA
#> GSM587177     2  0.3221      0.774 0.000 0.736 0.000 0.000 NA NA
#> GSM587178     2  0.2738      0.796 0.000 0.820 0.000 0.000 NA NA
#> GSM587179     2  0.1196      0.816 0.000 0.952 0.000 0.000 NA NA
#> GSM587180     2  0.3641      0.781 0.000 0.732 0.000 0.000 NA NA
#> GSM587181     2  0.1462      0.819 0.000 0.936 0.000 0.000 NA NA
#> GSM587182     2  0.3460      0.790 0.000 0.760 0.000 0.000 NA NA
#> GSM587183     2  0.3221      0.774 0.000 0.736 0.000 0.000 NA NA
#> GSM587184     2  0.0865      0.819 0.000 0.964 0.000 0.000 NA NA
#> GSM587185     2  0.1196      0.816 0.000 0.952 0.000 0.000 NA NA
#> GSM587186     2  0.3489      0.766 0.000 0.708 0.000 0.004 NA NA
#> GSM587187     2  0.3990      0.752 0.000 0.676 0.000 0.016 NA NA
#> GSM587188     2  0.5369      0.689 0.000 0.592 0.036 0.016 NA NA
#> GSM587189     2  0.5355      0.696 0.000 0.596 0.036 0.016 NA NA
#> GSM587190     3  0.5951      0.718 0.000 0.012 0.588 0.024 NA NA
#> GSM587203     1  0.3702      0.777 0.720 0.000 0.000 0.004 NA NA
#> GSM587204     1  0.3767      0.777 0.720 0.000 0.000 0.004 NA NA
#> GSM587205     1  0.3702      0.777 0.720 0.000 0.000 0.004 NA NA
#> GSM587206     1  0.3702      0.777 0.720 0.000 0.000 0.004 NA NA
#> GSM587207     1  0.3702      0.777 0.720 0.000 0.000 0.004 NA NA
#> GSM587208     1  0.3702      0.777 0.720 0.000 0.000 0.004 NA NA
#> GSM587209     1  0.0547      0.791 0.980 0.000 0.000 0.000 NA NA
#> GSM587210     1  0.6030      0.534 0.616 0.000 0.076 0.012 NA NA
#> GSM587211     1  0.1777      0.774 0.928 0.000 0.004 0.000 NA NA
#> GSM587212     1  0.5228      0.600 0.672 0.000 0.048 0.000 NA NA
#> GSM587213     1  0.2288      0.801 0.876 0.000 0.000 0.004 NA NA
#> GSM587214     1  0.2288      0.801 0.876 0.000 0.000 0.004 NA NA
#> GSM587215     1  0.0806      0.788 0.972 0.000 0.000 0.000 NA NA
#> GSM587216     1  0.2437      0.752 0.888 0.000 0.000 0.004 NA NA
#> GSM587217     1  0.0717      0.789 0.976 0.000 0.000 0.000 NA NA
#> GSM587191     3  0.5138      0.761 0.000 0.004 0.684 0.020 NA NA
#> GSM587192     3  0.5615      0.747 0.000 0.004 0.620 0.020 NA NA
#> GSM587193     3  0.7451      0.632 0.068 0.000 0.396 0.040 NA NA
#> GSM587194     3  0.6769      0.651 0.004 0.004 0.412 0.048 NA NA
#> GSM587195     3  0.2924      0.769 0.000 0.004 0.876 0.040 NA NA
#> GSM587196     3  0.2924      0.769 0.000 0.004 0.876 0.040 NA NA
#> GSM587197     3  0.3054      0.773 0.000 0.004 0.868 0.036 NA NA
#> GSM587198     3  0.1218      0.787 0.000 0.004 0.956 0.012 NA NA
#> GSM587199     3  0.3361      0.787 0.000 0.004 0.832 0.012 NA NA
#> GSM587200     3  0.6137      0.730 0.056 0.000 0.636 0.036 NA NA
#> GSM587201     3  0.6137      0.730 0.056 0.000 0.636 0.036 NA NA
#> GSM587202     3  0.1218      0.787 0.000 0.004 0.956 0.012 NA NA
#> GSM198767     1  0.3702      0.777 0.720 0.000 0.000 0.004 NA NA
#> GSM198769     1  0.0547      0.791 0.980 0.000 0.000 0.000 NA NA
#> GSM198772     1  0.1777      0.774 0.928 0.000 0.004 0.000 NA NA
#> GSM198773     1  0.2288      0.801 0.876 0.000 0.000 0.004 NA NA
#> GSM198776     1  0.3767      0.777 0.720 0.000 0.000 0.004 NA NA
#> GSM198778     1  0.6030      0.534 0.616 0.000 0.076 0.012 NA NA
#> GSM198780     1  0.5228      0.600 0.672 0.000 0.048 0.000 NA NA
#> GSM198781     1  0.2288      0.801 0.876 0.000 0.000 0.004 NA NA
#> GSM198765     3  0.5138      0.761 0.000 0.004 0.684 0.020 NA NA
#> GSM198766     3  0.7451      0.632 0.068 0.000 0.396 0.040 NA NA
#> GSM198768     3  0.2924      0.769 0.000 0.004 0.876 0.040 NA NA
#> GSM198770     3  0.3054      0.773 0.000 0.004 0.868 0.036 NA NA
#> GSM198771     3  0.1218      0.787 0.000 0.004 0.956 0.012 NA NA
#> GSM198774     3  0.5615      0.747 0.000 0.004 0.620 0.020 NA NA
#> GSM198775     3  0.6769      0.651 0.004 0.004 0.412 0.048 NA NA
#> GSM198777     3  0.2924      0.769 0.000 0.004 0.876 0.040 NA NA
#> GSM198779     3  0.3361      0.787 0.000 0.004 0.832 0.012 NA NA
#> GSM587218     4  0.2757      0.909 0.084 0.000 0.020 0.876 NA NA
#> GSM587219     4  0.3395      0.949 0.132 0.000 0.000 0.820 NA NA
#> GSM587220     4  0.3395      0.949 0.132 0.000 0.000 0.820 NA NA
#> GSM587221     4  0.2178      0.950 0.132 0.000 0.000 0.868 NA NA
#> GSM587222     4  0.2178      0.950 0.132 0.000 0.000 0.868 NA NA
#> GSM587223     4  0.2716      0.949 0.132 0.000 0.004 0.852 NA NA
#> GSM587224     4  0.2178      0.950 0.132 0.000 0.000 0.868 NA NA
#> GSM587225     4  0.4737      0.927 0.132 0.000 0.000 0.736 NA NA
#> GSM587226     4  0.2178      0.950 0.132 0.000 0.000 0.868 NA NA
#> GSM587227     4  0.4844      0.926 0.132 0.000 0.000 0.728 NA NA
#> GSM587228     4  0.4737      0.927 0.132 0.000 0.000 0.736 NA NA
#> GSM587229     4  0.4844      0.926 0.132 0.000 0.000 0.728 NA NA

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

consensus_heatmap(res, k = 2)

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

consensus_heatmap(res, k = 3)

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

consensus_heatmap(res, k = 4)

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

consensus_heatmap(res, k = 5)

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

consensus_heatmap(res, k = 6)

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

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

membership_heatmap(res, k = 2)

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

membership_heatmap(res, k = 3)

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

membership_heatmap(res, k = 4)

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

membership_heatmap(res, k = 5)

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

membership_heatmap(res, k = 6)

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

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

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

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

get_signatures(res, k = 3)

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

get_signatures(res, k = 4)

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

get_signatures(res, k = 5)

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

get_signatures(res, k = 6)

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

Signature heatmaps where rows are not scaled:

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

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

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

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

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

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

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

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

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

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

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk SD-kmeans-signature_compare

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

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

An example of the output of tb is:

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

The columns in tb are:

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

UMAP plot which shows how samples are separated.

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

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

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

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

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

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

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

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

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

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

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk SD-kmeans-collect-classes

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

test_to_known_factors(res)
#>            n specimen(p) k
#> SD:kmeans 92    4.01e-14 2
#> SD:kmeans 92    7.20e-32 3
#> SD:kmeans 92    4.48e-47 4
#> SD:kmeans 92    4.48e-47 5
#> SD:kmeans 92    4.48e-47 6

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


SD:skmeans**

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

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

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

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

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

collect_plots(res)

plot of chunk SD-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.988       0.995         0.5010 0.500   0.500
#> 3 3 1.000           0.979       0.989         0.2903 0.821   0.653
#> 4 4 0.982           0.949       0.975         0.1196 0.899   0.721
#> 5 5 0.956           0.929       0.961         0.0358 0.963   0.868
#> 6 6 0.934           0.867       0.906         0.0280 0.994   0.977

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

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

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

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

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

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>           class entropy silhouette    p1    p2
#> GSM587155     2   0.000      0.990 0.000 1.000
#> GSM587156     2   0.000      0.990 0.000 1.000
#> GSM587157     2   0.000      0.990 0.000 1.000
#> GSM587158     2   0.000      0.990 0.000 1.000
#> GSM587159     2   0.000      0.990 0.000 1.000
#> GSM587160     2   0.000      0.990 0.000 1.000
#> GSM587161     2   0.000      0.990 0.000 1.000
#> GSM587162     2   0.000      0.990 0.000 1.000
#> GSM587163     2   0.000      0.990 0.000 1.000
#> GSM587164     2   0.000      0.990 0.000 1.000
#> GSM587165     2   0.000      0.990 0.000 1.000
#> GSM587166     2   0.000      0.990 0.000 1.000
#> GSM587167     2   0.000      0.990 0.000 1.000
#> GSM587168     2   0.000      0.990 0.000 1.000
#> GSM587169     2   0.000      0.990 0.000 1.000
#> GSM587170     2   0.000      0.990 0.000 1.000
#> GSM587171     2   0.000      0.990 0.000 1.000
#> GSM587172     2   0.000      0.990 0.000 1.000
#> GSM587173     2   0.000      0.990 0.000 1.000
#> GSM587174     2   0.000      0.990 0.000 1.000
#> GSM587175     2   0.000      0.990 0.000 1.000
#> GSM587176     2   0.000      0.990 0.000 1.000
#> GSM587177     2   0.000      0.990 0.000 1.000
#> GSM587178     2   0.000      0.990 0.000 1.000
#> GSM587179     2   0.000      0.990 0.000 1.000
#> GSM587180     2   0.000      0.990 0.000 1.000
#> GSM587181     2   0.000      0.990 0.000 1.000
#> GSM587182     2   0.000      0.990 0.000 1.000
#> GSM587183     2   0.000      0.990 0.000 1.000
#> GSM587184     2   0.000      0.990 0.000 1.000
#> GSM587185     2   0.000      0.990 0.000 1.000
#> GSM587186     2   0.000      0.990 0.000 1.000
#> GSM587187     2   0.000      0.990 0.000 1.000
#> GSM587188     2   0.000      0.990 0.000 1.000
#> GSM587189     2   0.000      0.990 0.000 1.000
#> GSM587190     2   0.000      0.990 0.000 1.000
#> GSM587203     1   0.000      1.000 1.000 0.000
#> GSM587204     1   0.000      1.000 1.000 0.000
#> GSM587205     1   0.000      1.000 1.000 0.000
#> GSM587206     1   0.000      1.000 1.000 0.000
#> GSM587207     1   0.000      1.000 1.000 0.000
#> GSM587208     1   0.000      1.000 1.000 0.000
#> GSM587209     1   0.000      1.000 1.000 0.000
#> GSM587210     1   0.000      1.000 1.000 0.000
#> GSM587211     1   0.000      1.000 1.000 0.000
#> GSM587212     1   0.000      1.000 1.000 0.000
#> GSM587213     1   0.000      1.000 1.000 0.000
#> GSM587214     1   0.000      1.000 1.000 0.000
#> GSM587215     1   0.000      1.000 1.000 0.000
#> GSM587216     1   0.000      1.000 1.000 0.000
#> GSM587217     1   0.000      1.000 1.000 0.000
#> GSM587191     2   0.000      0.990 0.000 1.000
#> GSM587192     1   0.000      1.000 1.000 0.000
#> GSM587193     1   0.000      1.000 1.000 0.000
#> GSM587194     2   0.808      0.677 0.248 0.752
#> GSM587195     2   0.000      0.990 0.000 1.000
#> GSM587196     2   0.000      0.990 0.000 1.000
#> GSM587197     2   0.000      0.990 0.000 1.000
#> GSM587198     2   0.000      0.990 0.000 1.000
#> GSM587199     2   0.000      0.990 0.000 1.000
#> GSM587200     1   0.000      1.000 1.000 0.000
#> GSM587201     1   0.000      1.000 1.000 0.000
#> GSM587202     2   0.000      0.990 0.000 1.000
#> GSM198767     1   0.000      1.000 1.000 0.000
#> GSM198769     1   0.000      1.000 1.000 0.000
#> GSM198772     1   0.000      1.000 1.000 0.000
#> GSM198773     1   0.000      1.000 1.000 0.000
#> GSM198776     1   0.000      1.000 1.000 0.000
#> GSM198778     1   0.000      1.000 1.000 0.000
#> GSM198780     1   0.000      1.000 1.000 0.000
#> GSM198781     1   0.000      1.000 1.000 0.000
#> GSM198765     2   0.000      0.990 0.000 1.000
#> GSM198766     1   0.000      1.000 1.000 0.000
#> GSM198768     2   0.000      0.990 0.000 1.000
#> GSM198770     2   0.000      0.990 0.000 1.000
#> GSM198771     2   0.000      0.990 0.000 1.000
#> GSM198774     1   0.000      1.000 1.000 0.000
#> GSM198775     2   0.808      0.677 0.248 0.752
#> GSM198777     2   0.000      0.990 0.000 1.000
#> GSM198779     2   0.000      0.990 0.000 1.000
#> GSM587218     1   0.000      1.000 1.000 0.000
#> GSM587219     1   0.000      1.000 1.000 0.000
#> GSM587220     1   0.000      1.000 1.000 0.000
#> GSM587221     1   0.000      1.000 1.000 0.000
#> GSM587222     1   0.000      1.000 1.000 0.000
#> GSM587223     1   0.000      1.000 1.000 0.000
#> GSM587224     1   0.000      1.000 1.000 0.000
#> GSM587225     1   0.000      1.000 1.000 0.000
#> GSM587226     1   0.000      1.000 1.000 0.000
#> GSM587227     1   0.000      1.000 1.000 0.000
#> GSM587228     1   0.000      1.000 1.000 0.000
#> GSM587229     1   0.000      1.000 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1    p2    p3
#> GSM587155     2  0.0000      0.997 0.000 1.000 0.000
#> GSM587156     2  0.0000      0.997 0.000 1.000 0.000
#> GSM587157     2  0.0000      0.997 0.000 1.000 0.000
#> GSM587158     2  0.0000      0.997 0.000 1.000 0.000
#> GSM587159     2  0.0000      0.997 0.000 1.000 0.000
#> GSM587160     2  0.0000      0.997 0.000 1.000 0.000
#> GSM587161     2  0.0000      0.997 0.000 1.000 0.000
#> GSM587162     2  0.0000      0.997 0.000 1.000 0.000
#> GSM587163     2  0.0000      0.997 0.000 1.000 0.000
#> GSM587164     2  0.0000      0.997 0.000 1.000 0.000
#> GSM587165     2  0.0000      0.997 0.000 1.000 0.000
#> GSM587166     2  0.0000      0.997 0.000 1.000 0.000
#> GSM587167     2  0.0000      0.997 0.000 1.000 0.000
#> GSM587168     2  0.0000      0.997 0.000 1.000 0.000
#> GSM587169     2  0.0000      0.997 0.000 1.000 0.000
#> GSM587170     2  0.0000      0.997 0.000 1.000 0.000
#> GSM587171     2  0.0000      0.997 0.000 1.000 0.000
#> GSM587172     2  0.0000      0.997 0.000 1.000 0.000
#> GSM587173     2  0.0000      0.997 0.000 1.000 0.000
#> GSM587174     2  0.0000      0.997 0.000 1.000 0.000
#> GSM587175     2  0.0000      0.997 0.000 1.000 0.000
#> GSM587176     2  0.0000      0.997 0.000 1.000 0.000
#> GSM587177     2  0.0000      0.997 0.000 1.000 0.000
#> GSM587178     2  0.0000      0.997 0.000 1.000 0.000
#> GSM587179     2  0.0000      0.997 0.000 1.000 0.000
#> GSM587180     2  0.0000      0.997 0.000 1.000 0.000
#> GSM587181     2  0.0000      0.997 0.000 1.000 0.000
#> GSM587182     2  0.0000      0.997 0.000 1.000 0.000
#> GSM587183     2  0.0000      0.997 0.000 1.000 0.000
#> GSM587184     2  0.0000      0.997 0.000 1.000 0.000
#> GSM587185     2  0.0000      0.997 0.000 1.000 0.000
#> GSM587186     2  0.0000      0.997 0.000 1.000 0.000
#> GSM587187     2  0.0000      0.997 0.000 1.000 0.000
#> GSM587188     2  0.0000      0.997 0.000 1.000 0.000
#> GSM587189     2  0.0000      0.997 0.000 1.000 0.000
#> GSM587190     2  0.2711      0.899 0.000 0.912 0.088
#> GSM587203     1  0.0000      0.998 1.000 0.000 0.000
#> GSM587204     1  0.0000      0.998 1.000 0.000 0.000
#> GSM587205     1  0.0000      0.998 1.000 0.000 0.000
#> GSM587206     1  0.0000      0.998 1.000 0.000 0.000
#> GSM587207     1  0.0000      0.998 1.000 0.000 0.000
#> GSM587208     1  0.0000      0.998 1.000 0.000 0.000
#> GSM587209     1  0.0000      0.998 1.000 0.000 0.000
#> GSM587210     1  0.0000      0.998 1.000 0.000 0.000
#> GSM587211     1  0.0000      0.998 1.000 0.000 0.000
#> GSM587212     1  0.0000      0.998 1.000 0.000 0.000
#> GSM587213     1  0.0000      0.998 1.000 0.000 0.000
#> GSM587214     1  0.0000      0.998 1.000 0.000 0.000
#> GSM587215     1  0.0000      0.998 1.000 0.000 0.000
#> GSM587216     1  0.0000      0.998 1.000 0.000 0.000
#> GSM587217     1  0.0000      0.998 1.000 0.000 0.000
#> GSM587191     3  0.0000      0.956 0.000 0.000 1.000
#> GSM587192     3  0.0000      0.956 0.000 0.000 1.000
#> GSM587193     1  0.0237      0.996 0.996 0.000 0.004
#> GSM587194     3  0.6224      0.684 0.032 0.240 0.728
#> GSM587195     3  0.0000      0.956 0.000 0.000 1.000
#> GSM587196     3  0.0000      0.956 0.000 0.000 1.000
#> GSM587197     3  0.0000      0.956 0.000 0.000 1.000
#> GSM587198     3  0.0000      0.956 0.000 0.000 1.000
#> GSM587199     3  0.0000      0.956 0.000 0.000 1.000
#> GSM587200     3  0.1643      0.922 0.044 0.000 0.956
#> GSM587201     3  0.5058      0.684 0.244 0.000 0.756
#> GSM587202     3  0.0000      0.956 0.000 0.000 1.000
#> GSM198767     1  0.0000      0.998 1.000 0.000 0.000
#> GSM198769     1  0.0000      0.998 1.000 0.000 0.000
#> GSM198772     1  0.0000      0.998 1.000 0.000 0.000
#> GSM198773     1  0.0000      0.998 1.000 0.000 0.000
#> GSM198776     1  0.0000      0.998 1.000 0.000 0.000
#> GSM198778     1  0.0000      0.998 1.000 0.000 0.000
#> GSM198780     1  0.0000      0.998 1.000 0.000 0.000
#> GSM198781     1  0.0000      0.998 1.000 0.000 0.000
#> GSM198765     3  0.0000      0.956 0.000 0.000 1.000
#> GSM198766     1  0.0237      0.996 0.996 0.000 0.004
#> GSM198768     3  0.0000      0.956 0.000 0.000 1.000
#> GSM198770     3  0.0000      0.956 0.000 0.000 1.000
#> GSM198771     3  0.0000      0.956 0.000 0.000 1.000
#> GSM198774     3  0.0000      0.956 0.000 0.000 1.000
#> GSM198775     3  0.6224      0.684 0.032 0.240 0.728
#> GSM198777     3  0.0000      0.956 0.000 0.000 1.000
#> GSM198779     3  0.0000      0.956 0.000 0.000 1.000
#> GSM587218     1  0.0237      0.997 0.996 0.000 0.004
#> GSM587219     1  0.0237      0.997 0.996 0.000 0.004
#> GSM587220     1  0.0237      0.997 0.996 0.000 0.004
#> GSM587221     1  0.0237      0.997 0.996 0.000 0.004
#> GSM587222     1  0.0237      0.997 0.996 0.000 0.004
#> GSM587223     1  0.0237      0.997 0.996 0.000 0.004
#> GSM587224     1  0.0237      0.997 0.996 0.000 0.004
#> GSM587225     1  0.0237      0.997 0.996 0.000 0.004
#> GSM587226     1  0.0237      0.997 0.996 0.000 0.004
#> GSM587227     1  0.0237      0.997 0.996 0.000 0.004
#> GSM587228     1  0.0237      0.997 0.996 0.000 0.004
#> GSM587229     1  0.0237      0.997 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
#> GSM587155     2  0.0000      0.997 0.000 1.000 0.000 0.000
#> GSM587156     2  0.0000      0.997 0.000 1.000 0.000 0.000
#> GSM587157     2  0.0000      0.997 0.000 1.000 0.000 0.000
#> GSM587158     2  0.0000      0.997 0.000 1.000 0.000 0.000
#> GSM587159     2  0.0000      0.997 0.000 1.000 0.000 0.000
#> GSM587160     2  0.0000      0.997 0.000 1.000 0.000 0.000
#> GSM587161     2  0.0000      0.997 0.000 1.000 0.000 0.000
#> GSM587162     2  0.0000      0.997 0.000 1.000 0.000 0.000
#> GSM587163     2  0.0000      0.997 0.000 1.000 0.000 0.000
#> GSM587164     2  0.0000      0.997 0.000 1.000 0.000 0.000
#> GSM587165     2  0.0000      0.997 0.000 1.000 0.000 0.000
#> GSM587166     2  0.0000      0.997 0.000 1.000 0.000 0.000
#> GSM587167     2  0.0000      0.997 0.000 1.000 0.000 0.000
#> GSM587168     2  0.0000      0.997 0.000 1.000 0.000 0.000
#> GSM587169     2  0.0000      0.997 0.000 1.000 0.000 0.000
#> GSM587170     2  0.0000      0.997 0.000 1.000 0.000 0.000
#> GSM587171     2  0.0000      0.997 0.000 1.000 0.000 0.000
#> GSM587172     2  0.0000      0.997 0.000 1.000 0.000 0.000
#> GSM587173     2  0.0000      0.997 0.000 1.000 0.000 0.000
#> GSM587174     2  0.0000      0.997 0.000 1.000 0.000 0.000
#> GSM587175     2  0.0000      0.997 0.000 1.000 0.000 0.000
#> GSM587176     2  0.0000      0.997 0.000 1.000 0.000 0.000
#> GSM587177     2  0.0000      0.997 0.000 1.000 0.000 0.000
#> GSM587178     2  0.0000      0.997 0.000 1.000 0.000 0.000
#> GSM587179     2  0.0000      0.997 0.000 1.000 0.000 0.000
#> GSM587180     2  0.0000      0.997 0.000 1.000 0.000 0.000
#> GSM587181     2  0.0000      0.997 0.000 1.000 0.000 0.000
#> GSM587182     2  0.0000      0.997 0.000 1.000 0.000 0.000
#> GSM587183     2  0.0000      0.997 0.000 1.000 0.000 0.000
#> GSM587184     2  0.0000      0.997 0.000 1.000 0.000 0.000
#> GSM587185     2  0.0000      0.997 0.000 1.000 0.000 0.000
#> GSM587186     2  0.0000      0.997 0.000 1.000 0.000 0.000
#> GSM587187     2  0.0000      0.997 0.000 1.000 0.000 0.000
#> GSM587188     2  0.0000      0.997 0.000 1.000 0.000 0.000
#> GSM587189     2  0.0000      0.997 0.000 1.000 0.000 0.000
#> GSM587190     2  0.2412      0.898 0.000 0.908 0.084 0.008
#> GSM587203     1  0.0000      0.979 1.000 0.000 0.000 0.000
#> GSM587204     1  0.0000      0.979 1.000 0.000 0.000 0.000
#> GSM587205     1  0.0000      0.979 1.000 0.000 0.000 0.000
#> GSM587206     1  0.0000      0.979 1.000 0.000 0.000 0.000
#> GSM587207     1  0.0000      0.979 1.000 0.000 0.000 0.000
#> GSM587208     1  0.0000      0.979 1.000 0.000 0.000 0.000
#> GSM587209     1  0.0000      0.979 1.000 0.000 0.000 0.000
#> GSM587210     1  0.0469      0.970 0.988 0.000 0.000 0.012
#> GSM587211     1  0.0000      0.979 1.000 0.000 0.000 0.000
#> GSM587212     1  0.0592      0.967 0.984 0.000 0.000 0.016
#> GSM587213     1  0.0000      0.979 1.000 0.000 0.000 0.000
#> GSM587214     1  0.0000      0.979 1.000 0.000 0.000 0.000
#> GSM587215     1  0.0000      0.979 1.000 0.000 0.000 0.000
#> GSM587216     1  0.0000      0.979 1.000 0.000 0.000 0.000
#> GSM587217     1  0.0000      0.979 1.000 0.000 0.000 0.000
#> GSM587191     3  0.0707      0.954 0.000 0.000 0.980 0.020
#> GSM587192     3  0.0707      0.954 0.000 0.000 0.980 0.020
#> GSM587193     4  0.4088      0.722 0.232 0.000 0.004 0.764
#> GSM587194     4  0.4716      0.715 0.000 0.040 0.196 0.764
#> GSM587195     3  0.0188      0.961 0.000 0.000 0.996 0.004
#> GSM587196     3  0.0188      0.961 0.000 0.000 0.996 0.004
#> GSM587197     3  0.0188      0.961 0.000 0.000 0.996 0.004
#> GSM587198     3  0.0000      0.961 0.000 0.000 1.000 0.000
#> GSM587199     3  0.0000      0.961 0.000 0.000 1.000 0.000
#> GSM587200     3  0.5193      0.267 0.412 0.000 0.580 0.008
#> GSM587201     1  0.5099      0.340 0.612 0.000 0.380 0.008
#> GSM587202     3  0.0000      0.961 0.000 0.000 1.000 0.000
#> GSM198767     1  0.0000      0.979 1.000 0.000 0.000 0.000
#> GSM198769     1  0.0000      0.979 1.000 0.000 0.000 0.000
#> GSM198772     1  0.0000      0.979 1.000 0.000 0.000 0.000
#> GSM198773     1  0.0000      0.979 1.000 0.000 0.000 0.000
#> GSM198776     1  0.0000      0.979 1.000 0.000 0.000 0.000
#> GSM198778     1  0.0469      0.970 0.988 0.000 0.000 0.012
#> GSM198780     1  0.0592      0.967 0.984 0.000 0.000 0.016
#> GSM198781     1  0.0000      0.979 1.000 0.000 0.000 0.000
#> GSM198765     3  0.0707      0.954 0.000 0.000 0.980 0.020
#> GSM198766     4  0.4088      0.722 0.232 0.000 0.004 0.764
#> GSM198768     3  0.0188      0.961 0.000 0.000 0.996 0.004
#> GSM198770     3  0.0188      0.961 0.000 0.000 0.996 0.004
#> GSM198771     3  0.0000      0.961 0.000 0.000 1.000 0.000
#> GSM198774     3  0.0707      0.954 0.000 0.000 0.980 0.020
#> GSM198775     4  0.4716      0.715 0.000 0.040 0.196 0.764
#> GSM198777     3  0.0188      0.961 0.000 0.000 0.996 0.004
#> GSM198779     3  0.0000      0.961 0.000 0.000 1.000 0.000
#> GSM587218     4  0.0817      0.933 0.024 0.000 0.000 0.976
#> GSM587219     4  0.0817      0.933 0.024 0.000 0.000 0.976
#> GSM587220     4  0.0817      0.933 0.024 0.000 0.000 0.976
#> GSM587221     4  0.0817      0.933 0.024 0.000 0.000 0.976
#> GSM587222     4  0.0817      0.933 0.024 0.000 0.000 0.976
#> GSM587223     4  0.0817      0.933 0.024 0.000 0.000 0.976
#> GSM587224     4  0.0817      0.933 0.024 0.000 0.000 0.976
#> GSM587225     4  0.0817      0.933 0.024 0.000 0.000 0.976
#> GSM587226     4  0.0817      0.933 0.024 0.000 0.000 0.976
#> GSM587227     4  0.0817      0.933 0.024 0.000 0.000 0.976
#> GSM587228     4  0.0817      0.933 0.024 0.000 0.000 0.976
#> GSM587229     4  0.0817      0.933 0.024 0.000 0.000 0.976

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM587155     2  0.0162      0.990 0.000 0.996 0.000 0.000 0.004
#> GSM587156     2  0.0609      0.978 0.000 0.980 0.000 0.000 0.020
#> GSM587157     2  0.0162      0.990 0.000 0.996 0.000 0.000 0.004
#> GSM587158     2  0.0000      0.991 0.000 1.000 0.000 0.000 0.000
#> GSM587159     2  0.0000      0.991 0.000 1.000 0.000 0.000 0.000
#> GSM587160     2  0.0000      0.991 0.000 1.000 0.000 0.000 0.000
#> GSM587161     2  0.0162      0.990 0.000 0.996 0.000 0.000 0.004
#> GSM587162     2  0.0000      0.991 0.000 1.000 0.000 0.000 0.000
#> GSM587163     2  0.0162      0.990 0.000 0.996 0.000 0.000 0.004
#> GSM587164     2  0.0162      0.990 0.000 0.996 0.000 0.000 0.004
#> GSM587165     2  0.0000      0.991 0.000 1.000 0.000 0.000 0.000
#> GSM587166     2  0.0609      0.978 0.000 0.980 0.000 0.000 0.020
#> GSM587167     2  0.0162      0.990 0.000 0.996 0.000 0.000 0.004
#> GSM587168     2  0.0000      0.991 0.000 1.000 0.000 0.000 0.000
#> GSM587169     2  0.0162      0.990 0.000 0.996 0.000 0.000 0.004
#> GSM587170     2  0.0162      0.990 0.000 0.996 0.000 0.000 0.004
#> GSM587171     2  0.0000      0.991 0.000 1.000 0.000 0.000 0.000
#> GSM587172     2  0.0000      0.991 0.000 1.000 0.000 0.000 0.000
#> GSM587173     2  0.0162      0.989 0.000 0.996 0.000 0.000 0.004
#> GSM587174     2  0.0000      0.991 0.000 1.000 0.000 0.000 0.000
#> GSM587175     2  0.0162      0.990 0.000 0.996 0.000 0.000 0.004
#> GSM587176     2  0.0162      0.990 0.000 0.996 0.000 0.000 0.004
#> GSM587177     2  0.0000      0.991 0.000 1.000 0.000 0.000 0.000
#> GSM587178     2  0.0000      0.991 0.000 1.000 0.000 0.000 0.000
#> GSM587179     2  0.0162      0.990 0.000 0.996 0.000 0.000 0.004
#> GSM587180     2  0.0000      0.991 0.000 1.000 0.000 0.000 0.000
#> GSM587181     2  0.0000      0.991 0.000 1.000 0.000 0.000 0.000
#> GSM587182     2  0.0000      0.991 0.000 1.000 0.000 0.000 0.000
#> GSM587183     2  0.0000      0.991 0.000 1.000 0.000 0.000 0.000
#> GSM587184     2  0.0000      0.991 0.000 1.000 0.000 0.000 0.000
#> GSM587185     2  0.0162      0.990 0.000 0.996 0.000 0.000 0.004
#> GSM587186     2  0.0162      0.989 0.000 0.996 0.000 0.000 0.004
#> GSM587187     2  0.0162      0.989 0.000 0.996 0.000 0.000 0.004
#> GSM587188     2  0.0162      0.989 0.000 0.996 0.000 0.000 0.004
#> GSM587189     2  0.0162      0.989 0.000 0.996 0.000 0.000 0.004
#> GSM587190     2  0.3789      0.705 0.000 0.768 0.020 0.000 0.212
#> GSM587203     1  0.0000      0.973 1.000 0.000 0.000 0.000 0.000
#> GSM587204     1  0.0000      0.973 1.000 0.000 0.000 0.000 0.000
#> GSM587205     1  0.0000      0.973 1.000 0.000 0.000 0.000 0.000
#> GSM587206     1  0.0000      0.973 1.000 0.000 0.000 0.000 0.000
#> GSM587207     1  0.0000      0.973 1.000 0.000 0.000 0.000 0.000
#> GSM587208     1  0.0000      0.973 1.000 0.000 0.000 0.000 0.000
#> GSM587209     1  0.0000      0.973 1.000 0.000 0.000 0.000 0.000
#> GSM587210     1  0.2561      0.846 0.856 0.000 0.000 0.000 0.144
#> GSM587211     1  0.0000      0.973 1.000 0.000 0.000 0.000 0.000
#> GSM587212     1  0.2377      0.864 0.872 0.000 0.000 0.000 0.128
#> GSM587213     1  0.0000      0.973 1.000 0.000 0.000 0.000 0.000
#> GSM587214     1  0.0000      0.973 1.000 0.000 0.000 0.000 0.000
#> GSM587215     1  0.0000      0.973 1.000 0.000 0.000 0.000 0.000
#> GSM587216     1  0.0000      0.973 1.000 0.000 0.000 0.000 0.000
#> GSM587217     1  0.0000      0.973 1.000 0.000 0.000 0.000 0.000
#> GSM587191     5  0.2773      0.743 0.000 0.000 0.164 0.000 0.836
#> GSM587192     5  0.2605      0.754 0.000 0.000 0.148 0.000 0.852
#> GSM587193     5  0.1628      0.759 0.008 0.000 0.000 0.056 0.936
#> GSM587194     5  0.0510      0.767 0.000 0.000 0.000 0.016 0.984
#> GSM587195     3  0.0000      0.917 0.000 0.000 1.000 0.000 0.000
#> GSM587196     3  0.0000      0.917 0.000 0.000 1.000 0.000 0.000
#> GSM587197     3  0.0162      0.916 0.000 0.000 0.996 0.000 0.004
#> GSM587198     3  0.2280      0.892 0.000 0.000 0.880 0.000 0.120
#> GSM587199     3  0.2929      0.837 0.000 0.000 0.820 0.000 0.180
#> GSM587200     5  0.6441      0.157 0.188 0.000 0.344 0.000 0.468
#> GSM587201     5  0.6766      0.144 0.300 0.000 0.300 0.000 0.400
#> GSM587202     3  0.2179      0.895 0.000 0.000 0.888 0.000 0.112
#> GSM198767     1  0.0000      0.973 1.000 0.000 0.000 0.000 0.000
#> GSM198769     1  0.0000      0.973 1.000 0.000 0.000 0.000 0.000
#> GSM198772     1  0.0000      0.973 1.000 0.000 0.000 0.000 0.000
#> GSM198773     1  0.0000      0.973 1.000 0.000 0.000 0.000 0.000
#> GSM198776     1  0.0000      0.973 1.000 0.000 0.000 0.000 0.000
#> GSM198778     1  0.2561      0.846 0.856 0.000 0.000 0.000 0.144
#> GSM198780     1  0.2377      0.864 0.872 0.000 0.000 0.000 0.128
#> GSM198781     1  0.0000      0.973 1.000 0.000 0.000 0.000 0.000
#> GSM198765     5  0.2773      0.743 0.000 0.000 0.164 0.000 0.836
#> GSM198766     5  0.1628      0.759 0.008 0.000 0.000 0.056 0.936
#> GSM198768     3  0.0000      0.917 0.000 0.000 1.000 0.000 0.000
#> GSM198770     3  0.0162      0.916 0.000 0.000 0.996 0.000 0.004
#> GSM198771     3  0.2280      0.892 0.000 0.000 0.880 0.000 0.120
#> GSM198774     5  0.2605      0.754 0.000 0.000 0.148 0.000 0.852
#> GSM198775     5  0.0510      0.767 0.000 0.000 0.000 0.016 0.984
#> GSM198777     3  0.0000      0.917 0.000 0.000 1.000 0.000 0.000
#> GSM198779     3  0.2929      0.837 0.000 0.000 0.820 0.000 0.180
#> GSM587218     4  0.0000      1.000 0.000 0.000 0.000 1.000 0.000
#> GSM587219     4  0.0000      1.000 0.000 0.000 0.000 1.000 0.000
#> GSM587220     4  0.0000      1.000 0.000 0.000 0.000 1.000 0.000
#> GSM587221     4  0.0000      1.000 0.000 0.000 0.000 1.000 0.000
#> GSM587222     4  0.0000      1.000 0.000 0.000 0.000 1.000 0.000
#> GSM587223     4  0.0000      1.000 0.000 0.000 0.000 1.000 0.000
#> GSM587224     4  0.0000      1.000 0.000 0.000 0.000 1.000 0.000
#> GSM587225     4  0.0000      1.000 0.000 0.000 0.000 1.000 0.000
#> GSM587226     4  0.0000      1.000 0.000 0.000 0.000 1.000 0.000
#> GSM587227     4  0.0000      1.000 0.000 0.000 0.000 1.000 0.000
#> GSM587228     4  0.0000      1.000 0.000 0.000 0.000 1.000 0.000
#> GSM587229     4  0.0000      1.000 0.000 0.000 0.000 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM587155     2  0.1398      0.935 0.000 0.940 0.000 0.000 0.052 0.008
#> GSM587156     2  0.2664      0.859 0.000 0.848 0.000 0.000 0.136 0.016
#> GSM587157     2  0.1340      0.940 0.000 0.948 0.004 0.000 0.040 0.008
#> GSM587158     2  0.0146      0.959 0.000 0.996 0.000 0.000 0.004 0.000
#> GSM587159     2  0.0146      0.959 0.000 0.996 0.000 0.000 0.004 0.000
#> GSM587160     2  0.0291      0.959 0.000 0.992 0.000 0.000 0.004 0.004
#> GSM587161     2  0.0508      0.957 0.000 0.984 0.000 0.000 0.012 0.004
#> GSM587162     2  0.0146      0.959 0.000 0.996 0.000 0.000 0.000 0.004
#> GSM587163     2  0.0291      0.959 0.000 0.992 0.000 0.000 0.004 0.004
#> GSM587164     2  0.1625      0.928 0.000 0.928 0.000 0.000 0.060 0.012
#> GSM587165     2  0.0935      0.955 0.000 0.964 0.000 0.000 0.032 0.004
#> GSM587166     2  0.2704      0.855 0.000 0.844 0.000 0.000 0.140 0.016
#> GSM587167     2  0.1779      0.923 0.000 0.920 0.000 0.000 0.064 0.016
#> GSM587168     2  0.0858      0.954 0.000 0.968 0.000 0.000 0.028 0.004
#> GSM587169     2  0.0291      0.959 0.000 0.992 0.000 0.000 0.004 0.004
#> GSM587170     2  0.1779      0.922 0.000 0.920 0.000 0.000 0.064 0.016
#> GSM587171     2  0.0146      0.959 0.000 0.996 0.000 0.000 0.004 0.000
#> GSM587172     2  0.0146      0.959 0.000 0.996 0.000 0.000 0.004 0.000
#> GSM587173     2  0.0935      0.955 0.000 0.964 0.000 0.000 0.032 0.004
#> GSM587174     2  0.0458      0.958 0.000 0.984 0.000 0.000 0.016 0.000
#> GSM587175     2  0.1124      0.946 0.000 0.956 0.000 0.000 0.036 0.008
#> GSM587176     2  0.0146      0.959 0.000 0.996 0.000 0.000 0.000 0.004
#> GSM587177     2  0.0935      0.955 0.000 0.964 0.000 0.000 0.032 0.004
#> GSM587178     2  0.0458      0.958 0.000 0.984 0.000 0.000 0.016 0.000
#> GSM587179     2  0.0291      0.959 0.000 0.992 0.000 0.000 0.004 0.004
#> GSM587180     2  0.0858      0.954 0.000 0.968 0.000 0.000 0.028 0.004
#> GSM587181     2  0.0458      0.958 0.000 0.984 0.000 0.000 0.016 0.000
#> GSM587182     2  0.0458      0.958 0.000 0.984 0.000 0.000 0.016 0.000
#> GSM587183     2  0.0935      0.955 0.000 0.964 0.000 0.000 0.032 0.004
#> GSM587184     2  0.0260      0.959 0.000 0.992 0.000 0.000 0.008 0.000
#> GSM587185     2  0.0291      0.959 0.000 0.992 0.000 0.000 0.004 0.004
#> GSM587186     2  0.0935      0.955 0.000 0.964 0.000 0.000 0.032 0.004
#> GSM587187     2  0.1049      0.952 0.000 0.960 0.000 0.000 0.032 0.008
#> GSM587188     2  0.1511      0.941 0.000 0.940 0.004 0.000 0.044 0.012
#> GSM587189     2  0.1410      0.943 0.000 0.944 0.004 0.000 0.044 0.008
#> GSM587190     2  0.5727      0.504 0.000 0.604 0.028 0.000 0.200 0.168
#> GSM587203     1  0.0508      0.913 0.984 0.000 0.000 0.000 0.012 0.004
#> GSM587204     1  0.0508      0.913 0.984 0.000 0.000 0.000 0.012 0.004
#> GSM587205     1  0.0508      0.913 0.984 0.000 0.000 0.000 0.012 0.004
#> GSM587206     1  0.0508      0.913 0.984 0.000 0.000 0.000 0.012 0.004
#> GSM587207     1  0.0508      0.913 0.984 0.000 0.000 0.000 0.012 0.004
#> GSM587208     1  0.0508      0.913 0.984 0.000 0.000 0.000 0.012 0.004
#> GSM587209     1  0.0713      0.908 0.972 0.000 0.000 0.000 0.028 0.000
#> GSM587210     1  0.4210      0.578 0.636 0.000 0.000 0.000 0.336 0.028
#> GSM587211     1  0.1556      0.881 0.920 0.000 0.000 0.000 0.080 0.000
#> GSM587212     1  0.4181      0.588 0.644 0.000 0.000 0.000 0.328 0.028
#> GSM587213     1  0.0000      0.915 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM587214     1  0.0000      0.915 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM587215     1  0.0000      0.915 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM587216     1  0.1219      0.898 0.948 0.000 0.000 0.000 0.048 0.004
#> GSM587217     1  0.0458      0.911 0.984 0.000 0.000 0.000 0.016 0.000
#> GSM587191     6  0.1007      0.988 0.000 0.000 0.044 0.000 0.000 0.956
#> GSM587192     6  0.1196      0.988 0.000 0.000 0.040 0.000 0.008 0.952
#> GSM587193     5  0.4250      0.434 0.000 0.000 0.000 0.016 0.528 0.456
#> GSM587194     5  0.3684      0.526 0.000 0.000 0.000 0.000 0.628 0.372
#> GSM587195     3  0.0146      0.785 0.000 0.000 0.996 0.000 0.000 0.004
#> GSM587196     3  0.0146      0.785 0.000 0.000 0.996 0.000 0.000 0.004
#> GSM587197     3  0.0458      0.781 0.000 0.000 0.984 0.000 0.000 0.016
#> GSM587198     3  0.4977      0.707 0.000 0.000 0.648 0.000 0.188 0.164
#> GSM587199     3  0.5519      0.613 0.000 0.000 0.548 0.000 0.280 0.172
#> GSM587200     5  0.5431      0.326 0.036 0.000 0.128 0.000 0.652 0.184
#> GSM587201     5  0.5644      0.328 0.064 0.000 0.120 0.000 0.648 0.168
#> GSM587202     3  0.4977      0.707 0.000 0.000 0.648 0.000 0.188 0.164
#> GSM198767     1  0.0508      0.913 0.984 0.000 0.000 0.000 0.012 0.004
#> GSM198769     1  0.0713      0.908 0.972 0.000 0.000 0.000 0.028 0.000
#> GSM198772     1  0.1556      0.881 0.920 0.000 0.000 0.000 0.080 0.000
#> GSM198773     1  0.0000      0.915 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM198776     1  0.0508      0.913 0.984 0.000 0.000 0.000 0.012 0.004
#> GSM198778     1  0.4210      0.578 0.636 0.000 0.000 0.000 0.336 0.028
#> GSM198780     1  0.4181      0.588 0.644 0.000 0.000 0.000 0.328 0.028
#> GSM198781     1  0.0000      0.915 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM198765     6  0.1007      0.988 0.000 0.000 0.044 0.000 0.000 0.956
#> GSM198766     5  0.4250      0.434 0.000 0.000 0.000 0.016 0.528 0.456
#> GSM198768     3  0.0146      0.785 0.000 0.000 0.996 0.000 0.000 0.004
#> GSM198770     3  0.0458      0.781 0.000 0.000 0.984 0.000 0.000 0.016
#> GSM198771     3  0.4977      0.707 0.000 0.000 0.648 0.000 0.188 0.164
#> GSM198774     6  0.1196      0.988 0.000 0.000 0.040 0.000 0.008 0.952
#> GSM198775     5  0.3684      0.526 0.000 0.000 0.000 0.000 0.628 0.372
#> GSM198777     3  0.0146      0.785 0.000 0.000 0.996 0.000 0.000 0.004
#> GSM198779     3  0.5519      0.613 0.000 0.000 0.548 0.000 0.280 0.172
#> GSM587218     4  0.0000      1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM587219     4  0.0000      1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM587220     4  0.0000      1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM587221     4  0.0000      1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM587222     4  0.0000      1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM587223     4  0.0000      1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM587224     4  0.0000      1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM587225     4  0.0000      1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM587226     4  0.0000      1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM587227     4  0.0000      1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM587228     4  0.0000      1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM587229     4  0.0000      1.000 0.000 0.000 0.000 1.000 0.000 0.000

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

consensus_heatmap(res, k = 2)

plot of chunk tab-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 specimen(p) k
#> SD:skmeans 92    4.01e-14 2
#> SD:skmeans 92    3.33e-30 3
#> SD:skmeans 90    1.98e-39 4
#> SD:skmeans 90    1.60e-43 5
#> SD:skmeans 88    2.73e-39 6

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


SD:pam*

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

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

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

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

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

collect_plots(res)

plot of chunk SD-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.853           0.945       0.973         0.5011 0.500   0.500
#> 3 3 0.753           0.871       0.904         0.2056 0.917   0.834
#> 4 4 1.000           0.949       0.982         0.2015 0.803   0.556
#> 5 5 0.989           0.956       0.982         0.0463 0.948   0.817
#> 6 6 0.950           0.916       0.958         0.0307 0.980   0.916

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

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

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

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

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>           class entropy silhouette    p1    p2
#> GSM587155     2  0.0000      0.950 0.000 1.000
#> GSM587156     2  0.0000      0.950 0.000 1.000
#> GSM587157     2  0.0000      0.950 0.000 1.000
#> GSM587158     2  0.0000      0.950 0.000 1.000
#> GSM587159     2  0.0000      0.950 0.000 1.000
#> GSM587160     2  0.0000      0.950 0.000 1.000
#> GSM587161     2  0.0000      0.950 0.000 1.000
#> GSM587162     2  0.0000      0.950 0.000 1.000
#> GSM587163     2  0.0000      0.950 0.000 1.000
#> GSM587164     2  0.0000      0.950 0.000 1.000
#> GSM587165     2  0.0000      0.950 0.000 1.000
#> GSM587166     2  0.0000      0.950 0.000 1.000
#> GSM587167     2  0.0000      0.950 0.000 1.000
#> GSM587168     2  0.0000      0.950 0.000 1.000
#> GSM587169     2  0.0000      0.950 0.000 1.000
#> GSM587170     2  0.0000      0.950 0.000 1.000
#> GSM587171     2  0.0000      0.950 0.000 1.000
#> GSM587172     2  0.0000      0.950 0.000 1.000
#> GSM587173     2  0.0000      0.950 0.000 1.000
#> GSM587174     2  0.0000      0.950 0.000 1.000
#> GSM587175     2  0.0000      0.950 0.000 1.000
#> GSM587176     2  0.0000      0.950 0.000 1.000
#> GSM587177     2  0.0000      0.950 0.000 1.000
#> GSM587178     2  0.0000      0.950 0.000 1.000
#> GSM587179     2  0.0000      0.950 0.000 1.000
#> GSM587180     2  0.0000      0.950 0.000 1.000
#> GSM587181     2  0.0000      0.950 0.000 1.000
#> GSM587182     2  0.0000      0.950 0.000 1.000
#> GSM587183     2  0.0000      0.950 0.000 1.000
#> GSM587184     2  0.0000      0.950 0.000 1.000
#> GSM587185     2  0.0000      0.950 0.000 1.000
#> GSM587186     2  0.0000      0.950 0.000 1.000
#> GSM587187     2  0.0000      0.950 0.000 1.000
#> GSM587188     2  0.0000      0.950 0.000 1.000
#> GSM587189     2  0.0000      0.950 0.000 1.000
#> GSM587190     2  0.0000      0.950 0.000 1.000
#> GSM587203     1  0.0000      1.000 1.000 0.000
#> GSM587204     1  0.0000      1.000 1.000 0.000
#> GSM587205     1  0.0000      1.000 1.000 0.000
#> GSM587206     1  0.0000      1.000 1.000 0.000
#> GSM587207     1  0.0000      1.000 1.000 0.000
#> GSM587208     1  0.0000      1.000 1.000 0.000
#> GSM587209     1  0.0000      1.000 1.000 0.000
#> GSM587210     1  0.0000      1.000 1.000 0.000
#> GSM587211     1  0.0000      1.000 1.000 0.000
#> GSM587212     1  0.0000      1.000 1.000 0.000
#> GSM587213     1  0.0000      1.000 1.000 0.000
#> GSM587214     1  0.0000      1.000 1.000 0.000
#> GSM587215     1  0.0000      1.000 1.000 0.000
#> GSM587216     1  0.0000      1.000 1.000 0.000
#> GSM587217     1  0.0000      1.000 1.000 0.000
#> GSM587191     2  0.0000      0.950 0.000 1.000
#> GSM587192     1  0.0000      1.000 1.000 0.000
#> GSM587193     1  0.0000      1.000 1.000 0.000
#> GSM587194     2  0.5059      0.863 0.112 0.888
#> GSM587195     2  0.8443      0.680 0.272 0.728
#> GSM587196     2  0.8713      0.651 0.292 0.708
#> GSM587197     2  0.6887      0.789 0.184 0.816
#> GSM587198     2  0.8661      0.657 0.288 0.712
#> GSM587199     2  0.0000      0.950 0.000 1.000
#> GSM587200     1  0.0000      1.000 1.000 0.000
#> GSM587201     1  0.0000      1.000 1.000 0.000
#> GSM587202     2  0.8661      0.657 0.288 0.712
#> GSM198767     1  0.0000      1.000 1.000 0.000
#> GSM198769     1  0.0000      1.000 1.000 0.000
#> GSM198772     1  0.0000      1.000 1.000 0.000
#> GSM198773     1  0.0000      1.000 1.000 0.000
#> GSM198776     1  0.0000      1.000 1.000 0.000
#> GSM198778     1  0.0000      1.000 1.000 0.000
#> GSM198780     1  0.0000      1.000 1.000 0.000
#> GSM198781     1  0.0000      1.000 1.000 0.000
#> GSM198765     2  0.0000      0.950 0.000 1.000
#> GSM198766     1  0.0000      1.000 1.000 0.000
#> GSM198768     2  0.8661      0.657 0.288 0.712
#> GSM198770     2  0.0376      0.947 0.004 0.996
#> GSM198771     2  0.9427      0.521 0.360 0.640
#> GSM198774     1  0.0000      1.000 1.000 0.000
#> GSM198775     2  0.4431      0.880 0.092 0.908
#> GSM198777     2  0.8661      0.657 0.288 0.712
#> GSM198779     2  0.0000      0.950 0.000 1.000
#> GSM587218     1  0.0000      1.000 1.000 0.000
#> GSM587219     1  0.0000      1.000 1.000 0.000
#> GSM587220     1  0.0000      1.000 1.000 0.000
#> GSM587221     1  0.0000      1.000 1.000 0.000
#> GSM587222     1  0.0000      1.000 1.000 0.000
#> GSM587223     1  0.0000      1.000 1.000 0.000
#> GSM587224     1  0.0000      1.000 1.000 0.000
#> GSM587225     1  0.0000      1.000 1.000 0.000
#> GSM587226     1  0.0000      1.000 1.000 0.000
#> GSM587227     1  0.0000      1.000 1.000 0.000
#> GSM587228     1  0.0000      1.000 1.000 0.000
#> GSM587229     1  0.0000      1.000 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1    p2    p3
#> GSM587155     2  0.0000      0.918 0.000 1.000 0.000
#> GSM587156     2  0.0424      0.915 0.008 0.992 0.000
#> GSM587157     2  0.0000      0.918 0.000 1.000 0.000
#> GSM587158     2  0.0000      0.918 0.000 1.000 0.000
#> GSM587159     2  0.0000      0.918 0.000 1.000 0.000
#> GSM587160     2  0.0000      0.918 0.000 1.000 0.000
#> GSM587161     2  0.0000      0.918 0.000 1.000 0.000
#> GSM587162     2  0.0000      0.918 0.000 1.000 0.000
#> GSM587163     2  0.0000      0.918 0.000 1.000 0.000
#> GSM587164     2  0.0237      0.916 0.004 0.996 0.000
#> GSM587165     2  0.0000      0.918 0.000 1.000 0.000
#> GSM587166     2  0.3686      0.861 0.140 0.860 0.000
#> GSM587167     2  0.0000      0.918 0.000 1.000 0.000
#> GSM587168     2  0.0000      0.918 0.000 1.000 0.000
#> GSM587169     2  0.0000      0.918 0.000 1.000 0.000
#> GSM587170     2  0.0000      0.918 0.000 1.000 0.000
#> GSM587171     2  0.0000      0.918 0.000 1.000 0.000
#> GSM587172     2  0.0000      0.918 0.000 1.000 0.000
#> GSM587173     2  0.0000      0.918 0.000 1.000 0.000
#> GSM587174     2  0.0000      0.918 0.000 1.000 0.000
#> GSM587175     2  0.0000      0.918 0.000 1.000 0.000
#> GSM587176     2  0.0000      0.918 0.000 1.000 0.000
#> GSM587177     2  0.0000      0.918 0.000 1.000 0.000
#> GSM587178     2  0.0000      0.918 0.000 1.000 0.000
#> GSM587179     2  0.0000      0.918 0.000 1.000 0.000
#> GSM587180     2  0.0000      0.918 0.000 1.000 0.000
#> GSM587181     2  0.0000      0.918 0.000 1.000 0.000
#> GSM587182     2  0.0000      0.918 0.000 1.000 0.000
#> GSM587183     2  0.0000      0.918 0.000 1.000 0.000
#> GSM587184     2  0.0000      0.918 0.000 1.000 0.000
#> GSM587185     2  0.0000      0.918 0.000 1.000 0.000
#> GSM587186     2  0.0000      0.918 0.000 1.000 0.000
#> GSM587187     2  0.0000      0.918 0.000 1.000 0.000
#> GSM587188     2  0.0000      0.918 0.000 1.000 0.000
#> GSM587189     2  0.0000      0.918 0.000 1.000 0.000
#> GSM587190     2  0.4750      0.825 0.216 0.784 0.000
#> GSM587203     1  0.4796      0.899 0.780 0.000 0.220
#> GSM587204     1  0.4796      0.899 0.780 0.000 0.220
#> GSM587205     1  0.4796      0.899 0.780 0.000 0.220
#> GSM587206     1  0.4796      0.899 0.780 0.000 0.220
#> GSM587207     1  0.4796      0.899 0.780 0.000 0.220
#> GSM587208     1  0.4796      0.899 0.780 0.000 0.220
#> GSM587209     1  0.4796      0.899 0.780 0.000 0.220
#> GSM587210     1  0.5621      0.840 0.692 0.000 0.308
#> GSM587211     1  0.4796      0.899 0.780 0.000 0.220
#> GSM587212     1  0.5621      0.840 0.692 0.000 0.308
#> GSM587213     1  0.4796      0.899 0.780 0.000 0.220
#> GSM587214     1  0.4796      0.899 0.780 0.000 0.220
#> GSM587215     1  0.4796      0.899 0.780 0.000 0.220
#> GSM587216     1  0.5621      0.840 0.692 0.000 0.308
#> GSM587217     1  0.4796      0.899 0.780 0.000 0.220
#> GSM587191     2  0.4796      0.823 0.220 0.780 0.000
#> GSM587192     1  0.4316      0.600 0.868 0.044 0.088
#> GSM587193     1  0.3695      0.632 0.880 0.012 0.108
#> GSM587194     2  0.4931      0.815 0.232 0.768 0.000
#> GSM587195     2  0.5216      0.795 0.260 0.740 0.000
#> GSM587196     2  0.5254      0.791 0.264 0.736 0.000
#> GSM587197     2  0.5216      0.795 0.260 0.740 0.000
#> GSM587198     2  0.5216      0.795 0.260 0.740 0.000
#> GSM587199     2  0.4796      0.823 0.220 0.780 0.000
#> GSM587200     1  0.2711      0.656 0.912 0.000 0.088
#> GSM587201     1  0.0000      0.688 1.000 0.000 0.000
#> GSM587202     2  0.5216      0.795 0.260 0.740 0.000
#> GSM198767     1  0.4796      0.899 0.780 0.000 0.220
#> GSM198769     1  0.4796      0.899 0.780 0.000 0.220
#> GSM198772     1  0.4796      0.899 0.780 0.000 0.220
#> GSM198773     1  0.4796      0.899 0.780 0.000 0.220
#> GSM198776     1  0.4796      0.899 0.780 0.000 0.220
#> GSM198778     1  0.5621      0.840 0.692 0.000 0.308
#> GSM198780     1  0.5621      0.840 0.692 0.000 0.308
#> GSM198781     1  0.4796      0.899 0.780 0.000 0.220
#> GSM198765     2  0.4796      0.823 0.220 0.780 0.000
#> GSM198766     1  0.4346      0.735 0.816 0.000 0.184
#> GSM198768     2  0.5216      0.795 0.260 0.740 0.000
#> GSM198770     2  0.4796      0.823 0.220 0.780 0.000
#> GSM198771     2  0.6260      0.521 0.448 0.552 0.000
#> GSM198774     1  0.4316      0.600 0.868 0.044 0.088
#> GSM198775     2  0.4887      0.818 0.228 0.772 0.000
#> GSM198777     2  0.5216      0.795 0.260 0.740 0.000
#> GSM198779     2  0.4796      0.823 0.220 0.780 0.000
#> GSM587218     3  0.4796      0.681 0.220 0.000 0.780
#> GSM587219     3  0.0000      0.959 0.000 0.000 1.000
#> GSM587220     3  0.0000      0.959 0.000 0.000 1.000
#> GSM587221     3  0.0000      0.959 0.000 0.000 1.000
#> GSM587222     3  0.0000      0.959 0.000 0.000 1.000
#> GSM587223     3  0.0000      0.959 0.000 0.000 1.000
#> GSM587224     3  0.1964      0.895 0.056 0.000 0.944
#> GSM587225     3  0.0000      0.959 0.000 0.000 1.000
#> GSM587226     3  0.0000      0.959 0.000 0.000 1.000
#> GSM587227     3  0.0000      0.959 0.000 0.000 1.000
#> GSM587228     3  0.0000      0.959 0.000 0.000 1.000
#> GSM587229     3  0.0000      0.959 0.000 0.000 1.000

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3 p4
#> GSM587155     2  0.0000     0.9908 0.000 1.000 0.000  0
#> GSM587156     2  0.0336     0.9831 0.000 0.992 0.008  0
#> GSM587157     2  0.0000     0.9908 0.000 1.000 0.000  0
#> GSM587158     2  0.0000     0.9908 0.000 1.000 0.000  0
#> GSM587159     2  0.0000     0.9908 0.000 1.000 0.000  0
#> GSM587160     2  0.0000     0.9908 0.000 1.000 0.000  0
#> GSM587161     2  0.0000     0.9908 0.000 1.000 0.000  0
#> GSM587162     2  0.0000     0.9908 0.000 1.000 0.000  0
#> GSM587163     2  0.0000     0.9908 0.000 1.000 0.000  0
#> GSM587164     2  0.0336     0.9831 0.000 0.992 0.008  0
#> GSM587165     2  0.0000     0.9908 0.000 1.000 0.000  0
#> GSM587166     2  0.4193     0.6236 0.000 0.732 0.268  0
#> GSM587167     2  0.0000     0.9908 0.000 1.000 0.000  0
#> GSM587168     2  0.0000     0.9908 0.000 1.000 0.000  0
#> GSM587169     2  0.0000     0.9908 0.000 1.000 0.000  0
#> GSM587170     2  0.0000     0.9908 0.000 1.000 0.000  0
#> GSM587171     2  0.0000     0.9908 0.000 1.000 0.000  0
#> GSM587172     2  0.0000     0.9908 0.000 1.000 0.000  0
#> GSM587173     2  0.0000     0.9908 0.000 1.000 0.000  0
#> GSM587174     2  0.0000     0.9908 0.000 1.000 0.000  0
#> GSM587175     2  0.0000     0.9908 0.000 1.000 0.000  0
#> GSM587176     2  0.0000     0.9908 0.000 1.000 0.000  0
#> GSM587177     2  0.0000     0.9908 0.000 1.000 0.000  0
#> GSM587178     2  0.0000     0.9908 0.000 1.000 0.000  0
#> GSM587179     2  0.0000     0.9908 0.000 1.000 0.000  0
#> GSM587180     2  0.0000     0.9908 0.000 1.000 0.000  0
#> GSM587181     2  0.0000     0.9908 0.000 1.000 0.000  0
#> GSM587182     2  0.0000     0.9908 0.000 1.000 0.000  0
#> GSM587183     2  0.0000     0.9908 0.000 1.000 0.000  0
#> GSM587184     2  0.0000     0.9908 0.000 1.000 0.000  0
#> GSM587185     2  0.0000     0.9908 0.000 1.000 0.000  0
#> GSM587186     2  0.0000     0.9908 0.000 1.000 0.000  0
#> GSM587187     2  0.0000     0.9908 0.000 1.000 0.000  0
#> GSM587188     2  0.0000     0.9908 0.000 1.000 0.000  0
#> GSM587189     2  0.0000     0.9908 0.000 1.000 0.000  0
#> GSM587190     3  0.4998     0.0111 0.000 0.488 0.512  0
#> GSM587203     1  0.0000     0.9763 1.000 0.000 0.000  0
#> GSM587204     1  0.0000     0.9763 1.000 0.000 0.000  0
#> GSM587205     1  0.0000     0.9763 1.000 0.000 0.000  0
#> GSM587206     1  0.0000     0.9763 1.000 0.000 0.000  0
#> GSM587207     1  0.0000     0.9763 1.000 0.000 0.000  0
#> GSM587208     1  0.0000     0.9763 1.000 0.000 0.000  0
#> GSM587209     1  0.0000     0.9763 1.000 0.000 0.000  0
#> GSM587210     1  0.4790     0.3768 0.620 0.000 0.380  0
#> GSM587211     1  0.1557     0.9188 0.944 0.000 0.056  0
#> GSM587212     1  0.0000     0.9763 1.000 0.000 0.000  0
#> GSM587213     1  0.0000     0.9763 1.000 0.000 0.000  0
#> GSM587214     1  0.0000     0.9763 1.000 0.000 0.000  0
#> GSM587215     1  0.0000     0.9763 1.000 0.000 0.000  0
#> GSM587216     1  0.0000     0.9763 1.000 0.000 0.000  0
#> GSM587217     1  0.0000     0.9763 1.000 0.000 0.000  0
#> GSM587191     3  0.0000     0.9488 0.000 0.000 1.000  0
#> GSM587192     3  0.0000     0.9488 0.000 0.000 1.000  0
#> GSM587193     3  0.0000     0.9488 0.000 0.000 1.000  0
#> GSM587194     3  0.0000     0.9488 0.000 0.000 1.000  0
#> GSM587195     3  0.0000     0.9488 0.000 0.000 1.000  0
#> GSM587196     3  0.0000     0.9488 0.000 0.000 1.000  0
#> GSM587197     3  0.0000     0.9488 0.000 0.000 1.000  0
#> GSM587198     3  0.0000     0.9488 0.000 0.000 1.000  0
#> GSM587199     3  0.0000     0.9488 0.000 0.000 1.000  0
#> GSM587200     3  0.0000     0.9488 0.000 0.000 1.000  0
#> GSM587201     3  0.0000     0.9488 0.000 0.000 1.000  0
#> GSM587202     3  0.0000     0.9488 0.000 0.000 1.000  0
#> GSM198767     1  0.0000     0.9763 1.000 0.000 0.000  0
#> GSM198769     1  0.0000     0.9763 1.000 0.000 0.000  0
#> GSM198772     1  0.0000     0.9763 1.000 0.000 0.000  0
#> GSM198773     1  0.0000     0.9763 1.000 0.000 0.000  0
#> GSM198776     1  0.0000     0.9763 1.000 0.000 0.000  0
#> GSM198778     3  0.4907     0.2171 0.420 0.000 0.580  0
#> GSM198780     1  0.0000     0.9763 1.000 0.000 0.000  0
#> GSM198781     1  0.0000     0.9763 1.000 0.000 0.000  0
#> GSM198765     3  0.0000     0.9488 0.000 0.000 1.000  0
#> GSM198766     3  0.0000     0.9488 0.000 0.000 1.000  0
#> GSM198768     3  0.0000     0.9488 0.000 0.000 1.000  0
#> GSM198770     3  0.0000     0.9488 0.000 0.000 1.000  0
#> GSM198771     3  0.0000     0.9488 0.000 0.000 1.000  0
#> GSM198774     3  0.0000     0.9488 0.000 0.000 1.000  0
#> GSM198775     3  0.0000     0.9488 0.000 0.000 1.000  0
#> GSM198777     3  0.0000     0.9488 0.000 0.000 1.000  0
#> GSM198779     3  0.0000     0.9488 0.000 0.000 1.000  0
#> GSM587218     4  0.0000     1.0000 0.000 0.000 0.000  1
#> GSM587219     4  0.0000     1.0000 0.000 0.000 0.000  1
#> GSM587220     4  0.0000     1.0000 0.000 0.000 0.000  1
#> GSM587221     4  0.0000     1.0000 0.000 0.000 0.000  1
#> GSM587222     4  0.0000     1.0000 0.000 0.000 0.000  1
#> GSM587223     4  0.0000     1.0000 0.000 0.000 0.000  1
#> GSM587224     4  0.0000     1.0000 0.000 0.000 0.000  1
#> GSM587225     4  0.0000     1.0000 0.000 0.000 0.000  1
#> GSM587226     4  0.0000     1.0000 0.000 0.000 0.000  1
#> GSM587227     4  0.0000     1.0000 0.000 0.000 0.000  1
#> GSM587228     4  0.0000     1.0000 0.000 0.000 0.000  1
#> GSM587229     4  0.0000     1.0000 0.000 0.000 0.000  1

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3 p4    p5
#> GSM587155     2   0.000      0.991 0.000 1.000 0.000  0 0.000
#> GSM587156     2   0.029      0.983 0.000 0.992 0.008  0 0.000
#> GSM587157     2   0.000      0.991 0.000 1.000 0.000  0 0.000
#> GSM587158     2   0.000      0.991 0.000 1.000 0.000  0 0.000
#> GSM587159     2   0.000      0.991 0.000 1.000 0.000  0 0.000
#> GSM587160     2   0.000      0.991 0.000 1.000 0.000  0 0.000
#> GSM587161     2   0.000      0.991 0.000 1.000 0.000  0 0.000
#> GSM587162     2   0.000      0.991 0.000 1.000 0.000  0 0.000
#> GSM587163     2   0.000      0.991 0.000 1.000 0.000  0 0.000
#> GSM587164     2   0.029      0.983 0.000 0.992 0.008  0 0.000
#> GSM587165     2   0.000      0.991 0.000 1.000 0.000  0 0.000
#> GSM587166     2   0.361      0.619 0.000 0.732 0.268  0 0.000
#> GSM587167     2   0.000      0.991 0.000 1.000 0.000  0 0.000
#> GSM587168     2   0.000      0.991 0.000 1.000 0.000  0 0.000
#> GSM587169     2   0.000      0.991 0.000 1.000 0.000  0 0.000
#> GSM587170     2   0.000      0.991 0.000 1.000 0.000  0 0.000
#> GSM587171     2   0.000      0.991 0.000 1.000 0.000  0 0.000
#> GSM587172     2   0.000      0.991 0.000 1.000 0.000  0 0.000
#> GSM587173     2   0.000      0.991 0.000 1.000 0.000  0 0.000
#> GSM587174     2   0.000      0.991 0.000 1.000 0.000  0 0.000
#> GSM587175     2   0.000      0.991 0.000 1.000 0.000  0 0.000
#> GSM587176     2   0.000      0.991 0.000 1.000 0.000  0 0.000
#> GSM587177     2   0.000      0.991 0.000 1.000 0.000  0 0.000
#> GSM587178     2   0.000      0.991 0.000 1.000 0.000  0 0.000
#> GSM587179     2   0.000      0.991 0.000 1.000 0.000  0 0.000
#> GSM587180     2   0.000      0.991 0.000 1.000 0.000  0 0.000
#> GSM587181     2   0.000      0.991 0.000 1.000 0.000  0 0.000
#> GSM587182     2   0.000      0.991 0.000 1.000 0.000  0 0.000
#> GSM587183     2   0.000      0.991 0.000 1.000 0.000  0 0.000
#> GSM587184     2   0.000      0.991 0.000 1.000 0.000  0 0.000
#> GSM587185     2   0.000      0.991 0.000 1.000 0.000  0 0.000
#> GSM587186     2   0.000      0.991 0.000 1.000 0.000  0 0.000
#> GSM587187     2   0.000      0.991 0.000 1.000 0.000  0 0.000
#> GSM587188     2   0.000      0.991 0.000 1.000 0.000  0 0.000
#> GSM587189     2   0.000      0.991 0.000 1.000 0.000  0 0.000
#> GSM587190     3   0.421      0.284 0.000 0.412 0.588  0 0.000
#> GSM587203     5   0.000      0.960 0.000 0.000 0.000  0 1.000
#> GSM587204     5   0.000      0.960 0.000 0.000 0.000  0 1.000
#> GSM587205     5   0.000      0.960 0.000 0.000 0.000  0 1.000
#> GSM587206     5   0.000      0.960 0.000 0.000 0.000  0 1.000
#> GSM587207     5   0.000      0.960 0.000 0.000 0.000  0 1.000
#> GSM587208     5   0.000      0.960 0.000 0.000 0.000  0 1.000
#> GSM587209     1   0.000      0.948 1.000 0.000 0.000  0 0.000
#> GSM587210     1   0.000      0.948 1.000 0.000 0.000  0 0.000
#> GSM587211     1   0.000      0.948 1.000 0.000 0.000  0 0.000
#> GSM587212     1   0.000      0.948 1.000 0.000 0.000  0 0.000
#> GSM587213     1   0.223      0.852 0.884 0.000 0.000  0 0.116
#> GSM587214     5   0.285      0.813 0.172 0.000 0.000  0 0.828
#> GSM587215     1   0.000      0.948 1.000 0.000 0.000  0 0.000
#> GSM587216     1   0.000      0.948 1.000 0.000 0.000  0 0.000
#> GSM587217     1   0.000      0.948 1.000 0.000 0.000  0 0.000
#> GSM587191     3   0.000      0.970 0.000 0.000 1.000  0 0.000
#> GSM587192     3   0.000      0.970 0.000 0.000 1.000  0 0.000
#> GSM587193     1   0.368      0.619 0.720 0.000 0.280  0 0.000
#> GSM587194     3   0.000      0.970 0.000 0.000 1.000  0 0.000
#> GSM587195     3   0.000      0.970 0.000 0.000 1.000  0 0.000
#> GSM587196     3   0.000      0.970 0.000 0.000 1.000  0 0.000
#> GSM587197     3   0.000      0.970 0.000 0.000 1.000  0 0.000
#> GSM587198     3   0.000      0.970 0.000 0.000 1.000  0 0.000
#> GSM587199     3   0.000      0.970 0.000 0.000 1.000  0 0.000
#> GSM587200     3   0.000      0.970 0.000 0.000 1.000  0 0.000
#> GSM587201     3   0.000      0.970 0.000 0.000 1.000  0 0.000
#> GSM587202     3   0.000      0.970 0.000 0.000 1.000  0 0.000
#> GSM198767     5   0.000      0.960 0.000 0.000 0.000  0 1.000
#> GSM198769     1   0.000      0.948 1.000 0.000 0.000  0 0.000
#> GSM198772     1   0.000      0.948 1.000 0.000 0.000  0 0.000
#> GSM198773     1   0.223      0.852 0.884 0.000 0.000  0 0.116
#> GSM198776     5   0.000      0.960 0.000 0.000 0.000  0 1.000
#> GSM198778     1   0.000      0.948 1.000 0.000 0.000  0 0.000
#> GSM198780     1   0.000      0.948 1.000 0.000 0.000  0 0.000
#> GSM198781     5   0.285      0.813 0.172 0.000 0.000  0 0.828
#> GSM198765     3   0.000      0.970 0.000 0.000 1.000  0 0.000
#> GSM198766     1   0.191      0.861 0.908 0.000 0.092  0 0.000
#> GSM198768     3   0.000      0.970 0.000 0.000 1.000  0 0.000
#> GSM198770     3   0.000      0.970 0.000 0.000 1.000  0 0.000
#> GSM198771     3   0.000      0.970 0.000 0.000 1.000  0 0.000
#> GSM198774     3   0.000      0.970 0.000 0.000 1.000  0 0.000
#> GSM198775     3   0.000      0.970 0.000 0.000 1.000  0 0.000
#> GSM198777     3   0.000      0.970 0.000 0.000 1.000  0 0.000
#> GSM198779     3   0.000      0.970 0.000 0.000 1.000  0 0.000
#> GSM587218     4   0.000      1.000 0.000 0.000 0.000  1 0.000
#> GSM587219     4   0.000      1.000 0.000 0.000 0.000  1 0.000
#> GSM587220     4   0.000      1.000 0.000 0.000 0.000  1 0.000
#> GSM587221     4   0.000      1.000 0.000 0.000 0.000  1 0.000
#> GSM587222     4   0.000      1.000 0.000 0.000 0.000  1 0.000
#> GSM587223     4   0.000      1.000 0.000 0.000 0.000  1 0.000
#> GSM587224     4   0.000      1.000 0.000 0.000 0.000  1 0.000
#> GSM587225     4   0.000      1.000 0.000 0.000 0.000  1 0.000
#> GSM587226     4   0.000      1.000 0.000 0.000 0.000  1 0.000
#> GSM587227     4   0.000      1.000 0.000 0.000 0.000  1 0.000
#> GSM587228     4   0.000      1.000 0.000 0.000 0.000  1 0.000
#> GSM587229     4   0.000      1.000 0.000 0.000 0.000  1 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3 p4    p5    p6
#> GSM587155     2  0.0000      0.981 0.000 1.000 0.000  0 0.000 0.000
#> GSM587156     2  0.0146      0.978 0.000 0.996 0.004  0 0.000 0.000
#> GSM587157     2  0.3409      0.592 0.000 0.700 0.300  0 0.000 0.000
#> GSM587158     2  0.0000      0.981 0.000 1.000 0.000  0 0.000 0.000
#> GSM587159     2  0.0000      0.981 0.000 1.000 0.000  0 0.000 0.000
#> GSM587160     2  0.0000      0.981 0.000 1.000 0.000  0 0.000 0.000
#> GSM587161     2  0.0000      0.981 0.000 1.000 0.000  0 0.000 0.000
#> GSM587162     2  0.0000      0.981 0.000 1.000 0.000  0 0.000 0.000
#> GSM587163     2  0.0000      0.981 0.000 1.000 0.000  0 0.000 0.000
#> GSM587164     2  0.0363      0.972 0.000 0.988 0.012  0 0.000 0.000
#> GSM587165     2  0.0000      0.981 0.000 1.000 0.000  0 0.000 0.000
#> GSM587166     2  0.4162      0.667 0.000 0.744 0.136  0 0.120 0.000
#> GSM587167     2  0.0632      0.961 0.000 0.976 0.024  0 0.000 0.000
#> GSM587168     2  0.0000      0.981 0.000 1.000 0.000  0 0.000 0.000
#> GSM587169     2  0.0000      0.981 0.000 1.000 0.000  0 0.000 0.000
#> GSM587170     2  0.0000      0.981 0.000 1.000 0.000  0 0.000 0.000
#> GSM587171     2  0.0000      0.981 0.000 1.000 0.000  0 0.000 0.000
#> GSM587172     2  0.0000      0.981 0.000 1.000 0.000  0 0.000 0.000
#> GSM587173     2  0.0000      0.981 0.000 1.000 0.000  0 0.000 0.000
#> GSM587174     2  0.0000      0.981 0.000 1.000 0.000  0 0.000 0.000
#> GSM587175     2  0.0146      0.979 0.000 0.996 0.004  0 0.000 0.000
#> GSM587176     2  0.0000      0.981 0.000 1.000 0.000  0 0.000 0.000
#> GSM587177     2  0.0000      0.981 0.000 1.000 0.000  0 0.000 0.000
#> GSM587178     2  0.0000      0.981 0.000 1.000 0.000  0 0.000 0.000
#> GSM587179     2  0.0000      0.981 0.000 1.000 0.000  0 0.000 0.000
#> GSM587180     2  0.0000      0.981 0.000 1.000 0.000  0 0.000 0.000
#> GSM587181     2  0.0000      0.981 0.000 1.000 0.000  0 0.000 0.000
#> GSM587182     2  0.0000      0.981 0.000 1.000 0.000  0 0.000 0.000
#> GSM587183     2  0.0000      0.981 0.000 1.000 0.000  0 0.000 0.000
#> GSM587184     2  0.0000      0.981 0.000 1.000 0.000  0 0.000 0.000
#> GSM587185     2  0.0000      0.981 0.000 1.000 0.000  0 0.000 0.000
#> GSM587186     2  0.0000      0.981 0.000 1.000 0.000  0 0.000 0.000
#> GSM587187     2  0.0000      0.981 0.000 1.000 0.000  0 0.000 0.000
#> GSM587188     2  0.0000      0.981 0.000 1.000 0.000  0 0.000 0.000
#> GSM587189     2  0.0363      0.972 0.000 0.988 0.012  0 0.000 0.000
#> GSM587190     3  0.4781      0.449 0.000 0.296 0.624  0 0.080 0.000
#> GSM587203     6  0.0000      0.928 0.000 0.000 0.000  0 0.000 1.000
#> GSM587204     6  0.0000      0.928 0.000 0.000 0.000  0 0.000 1.000
#> GSM587205     6  0.0000      0.928 0.000 0.000 0.000  0 0.000 1.000
#> GSM587206     6  0.0000      0.928 0.000 0.000 0.000  0 0.000 1.000
#> GSM587207     6  0.0000      0.928 0.000 0.000 0.000  0 0.000 1.000
#> GSM587208     6  0.0000      0.928 0.000 0.000 0.000  0 0.000 1.000
#> GSM587209     1  0.0000      0.914 1.000 0.000 0.000  0 0.000 0.000
#> GSM587210     1  0.1765      0.877 0.904 0.000 0.000  0 0.096 0.000
#> GSM587211     1  0.0000      0.914 1.000 0.000 0.000  0 0.000 0.000
#> GSM587212     1  0.1444      0.891 0.928 0.000 0.000  0 0.072 0.000
#> GSM587213     1  0.2048      0.830 0.880 0.000 0.000  0 0.000 0.120
#> GSM587214     6  0.3288      0.669 0.276 0.000 0.000  0 0.000 0.724
#> GSM587215     1  0.0000      0.914 1.000 0.000 0.000  0 0.000 0.000
#> GSM587216     1  0.0000      0.914 1.000 0.000 0.000  0 0.000 0.000
#> GSM587217     1  0.0000      0.914 1.000 0.000 0.000  0 0.000 0.000
#> GSM587191     5  0.0000      0.997 0.000 0.000 0.000  0 1.000 0.000
#> GSM587192     5  0.0000      0.997 0.000 0.000 0.000  0 1.000 0.000
#> GSM587193     1  0.4967      0.528 0.640 0.000 0.132  0 0.228 0.000
#> GSM587194     5  0.0146      0.995 0.000 0.000 0.004  0 0.996 0.000
#> GSM587195     3  0.0000      0.860 0.000 0.000 1.000  0 0.000 0.000
#> GSM587196     3  0.0000      0.860 0.000 0.000 1.000  0 0.000 0.000
#> GSM587197     3  0.0000      0.860 0.000 0.000 1.000  0 0.000 0.000
#> GSM587198     3  0.1556      0.853 0.000 0.000 0.920  0 0.080 0.000
#> GSM587199     3  0.1910      0.841 0.000 0.000 0.892  0 0.108 0.000
#> GSM587200     3  0.4808      0.579 0.272 0.000 0.636  0 0.092 0.000
#> GSM587201     3  0.4729      0.571 0.284 0.000 0.636  0 0.080 0.000
#> GSM587202     3  0.1556      0.853 0.000 0.000 0.920  0 0.080 0.000
#> GSM198767     6  0.0000      0.928 0.000 0.000 0.000  0 0.000 1.000
#> GSM198769     1  0.0000      0.914 1.000 0.000 0.000  0 0.000 0.000
#> GSM198772     1  0.0000      0.914 1.000 0.000 0.000  0 0.000 0.000
#> GSM198773     1  0.2048      0.830 0.880 0.000 0.000  0 0.000 0.120
#> GSM198776     6  0.0000      0.928 0.000 0.000 0.000  0 0.000 1.000
#> GSM198778     1  0.1814      0.874 0.900 0.000 0.000  0 0.100 0.000
#> GSM198780     1  0.1444      0.891 0.928 0.000 0.000  0 0.072 0.000
#> GSM198781     6  0.3288      0.669 0.276 0.000 0.000  0 0.000 0.724
#> GSM198765     5  0.0000      0.997 0.000 0.000 0.000  0 1.000 0.000
#> GSM198766     1  0.2896      0.777 0.824 0.000 0.016  0 0.160 0.000
#> GSM198768     3  0.0000      0.860 0.000 0.000 1.000  0 0.000 0.000
#> GSM198770     3  0.0000      0.860 0.000 0.000 1.000  0 0.000 0.000
#> GSM198771     3  0.1556      0.853 0.000 0.000 0.920  0 0.080 0.000
#> GSM198774     5  0.0000      0.997 0.000 0.000 0.000  0 1.000 0.000
#> GSM198775     5  0.0260      0.991 0.000 0.000 0.008  0 0.992 0.000
#> GSM198777     3  0.0000      0.860 0.000 0.000 1.000  0 0.000 0.000
#> GSM198779     3  0.1910      0.841 0.000 0.000 0.892  0 0.108 0.000
#> GSM587218     4  0.0000      1.000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587219     4  0.0000      1.000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587220     4  0.0000      1.000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587221     4  0.0000      1.000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587222     4  0.0000      1.000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587223     4  0.0000      1.000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587224     4  0.0000      1.000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587225     4  0.0000      1.000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587226     4  0.0000      1.000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587227     4  0.0000      1.000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587228     4  0.0000      1.000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587229     4  0.0000      1.000 0.000 0.000 0.000  1 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 specimen(p) k
#> SD:pam 92    4.01e-14 2
#> SD:pam 92    1.29e-28 3
#> SD:pam 89    2.80e-46 4
#> SD:pam 91    2.31e-41 5
#> SD:pam 91    1.54e-38 6

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


SD:mclust*

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

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

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

res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#>   On a matrix with 51941 rows and 92 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.955           0.943       0.976         0.4650 0.548   0.548
#> 3 3 0.786           0.910       0.960         0.2984 0.610   0.415
#> 4 4 0.947           0.943       0.976         0.2097 0.853   0.637
#> 5 5 0.887           0.796       0.887         0.0435 0.968   0.886
#> 6 6 0.845           0.765       0.871         0.0440 0.951   0.811

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

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

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

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

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

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>           class entropy silhouette    p1    p2
#> GSM587155     2   0.000      0.963 0.000 1.000
#> GSM587156     2   0.000      0.963 0.000 1.000
#> GSM587157     2   0.000      0.963 0.000 1.000
#> GSM587158     2   0.000      0.963 0.000 1.000
#> GSM587159     2   0.000      0.963 0.000 1.000
#> GSM587160     2   0.000      0.963 0.000 1.000
#> GSM587161     2   0.000      0.963 0.000 1.000
#> GSM587162     2   0.000      0.963 0.000 1.000
#> GSM587163     2   0.000      0.963 0.000 1.000
#> GSM587164     2   0.000      0.963 0.000 1.000
#> GSM587165     2   0.000      0.963 0.000 1.000
#> GSM587166     2   0.000      0.963 0.000 1.000
#> GSM587167     2   0.000      0.963 0.000 1.000
#> GSM587168     2   0.000      0.963 0.000 1.000
#> GSM587169     2   0.000      0.963 0.000 1.000
#> GSM587170     2   0.000      0.963 0.000 1.000
#> GSM587171     2   0.000      0.963 0.000 1.000
#> GSM587172     2   0.000      0.963 0.000 1.000
#> GSM587173     2   0.000      0.963 0.000 1.000
#> GSM587174     2   0.000      0.963 0.000 1.000
#> GSM587175     2   0.000      0.963 0.000 1.000
#> GSM587176     2   0.000      0.963 0.000 1.000
#> GSM587177     2   0.000      0.963 0.000 1.000
#> GSM587178     2   0.000      0.963 0.000 1.000
#> GSM587179     2   0.000      0.963 0.000 1.000
#> GSM587180     2   0.000      0.963 0.000 1.000
#> GSM587181     2   0.000      0.963 0.000 1.000
#> GSM587182     2   0.000      0.963 0.000 1.000
#> GSM587183     2   0.000      0.963 0.000 1.000
#> GSM587184     2   0.000      0.963 0.000 1.000
#> GSM587185     2   0.000      0.963 0.000 1.000
#> GSM587186     2   0.000      0.963 0.000 1.000
#> GSM587187     2   0.000      0.963 0.000 1.000
#> GSM587188     2   0.000      0.963 0.000 1.000
#> GSM587189     2   0.000      0.963 0.000 1.000
#> GSM587190     2   0.000      0.963 0.000 1.000
#> GSM587203     1   0.000      1.000 1.000 0.000
#> GSM587204     1   0.000      1.000 1.000 0.000
#> GSM587205     1   0.000      1.000 1.000 0.000
#> GSM587206     1   0.000      1.000 1.000 0.000
#> GSM587207     1   0.000      1.000 1.000 0.000
#> GSM587208     1   0.000      1.000 1.000 0.000
#> GSM587209     1   0.000      1.000 1.000 0.000
#> GSM587210     2   0.971      0.391 0.400 0.600
#> GSM587211     1   0.000      1.000 1.000 0.000
#> GSM587212     2   0.980      0.351 0.416 0.584
#> GSM587213     1   0.000      1.000 1.000 0.000
#> GSM587214     1   0.000      1.000 1.000 0.000
#> GSM587215     1   0.000      1.000 1.000 0.000
#> GSM587216     1   0.000      1.000 1.000 0.000
#> GSM587217     1   0.000      1.000 1.000 0.000
#> GSM587191     2   0.000      0.963 0.000 1.000
#> GSM587192     2   0.000      0.963 0.000 1.000
#> GSM587193     2   0.644      0.800 0.164 0.836
#> GSM587194     2   0.000      0.963 0.000 1.000
#> GSM587195     2   0.000      0.963 0.000 1.000
#> GSM587196     2   0.000      0.963 0.000 1.000
#> GSM587197     2   0.000      0.963 0.000 1.000
#> GSM587198     2   0.000      0.963 0.000 1.000
#> GSM587199     2   0.000      0.963 0.000 1.000
#> GSM587200     2   0.118      0.950 0.016 0.984
#> GSM587201     2   0.714      0.760 0.196 0.804
#> GSM587202     2   0.000      0.963 0.000 1.000
#> GSM198767     1   0.000      1.000 1.000 0.000
#> GSM198769     1   0.000      1.000 1.000 0.000
#> GSM198772     1   0.000      1.000 1.000 0.000
#> GSM198773     1   0.000      1.000 1.000 0.000
#> GSM198776     1   0.000      1.000 1.000 0.000
#> GSM198778     2   0.971      0.391 0.400 0.600
#> GSM198780     2   0.978      0.361 0.412 0.588
#> GSM198781     1   0.000      1.000 1.000 0.000
#> GSM198765     2   0.000      0.963 0.000 1.000
#> GSM198766     2   0.706      0.765 0.192 0.808
#> GSM198768     2   0.000      0.963 0.000 1.000
#> GSM198770     2   0.000      0.963 0.000 1.000
#> GSM198771     2   0.000      0.963 0.000 1.000
#> GSM198774     2   0.000      0.963 0.000 1.000
#> GSM198775     2   0.000      0.963 0.000 1.000
#> GSM198777     2   0.000      0.963 0.000 1.000
#> GSM198779     2   0.000      0.963 0.000 1.000
#> GSM587218     1   0.000      1.000 1.000 0.000
#> GSM587219     1   0.000      1.000 1.000 0.000
#> GSM587220     1   0.000      1.000 1.000 0.000
#> GSM587221     1   0.000      1.000 1.000 0.000
#> GSM587222     1   0.000      1.000 1.000 0.000
#> GSM587223     1   0.000      1.000 1.000 0.000
#> GSM587224     1   0.000      1.000 1.000 0.000
#> GSM587225     1   0.000      1.000 1.000 0.000
#> GSM587226     1   0.000      1.000 1.000 0.000
#> GSM587227     1   0.000      1.000 1.000 0.000
#> GSM587228     1   0.000      1.000 1.000 0.000
#> GSM587229     1   0.000      1.000 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1    p2    p3
#> GSM587155     2  0.0000      0.968 0.000 1.000 0.000
#> GSM587156     2  0.0000      0.968 0.000 1.000 0.000
#> GSM587157     2  0.0000      0.968 0.000 1.000 0.000
#> GSM587158     2  0.0000      0.968 0.000 1.000 0.000
#> GSM587159     2  0.0000      0.968 0.000 1.000 0.000
#> GSM587160     2  0.0000      0.968 0.000 1.000 0.000
#> GSM587161     2  0.0000      0.968 0.000 1.000 0.000
#> GSM587162     2  0.0000      0.968 0.000 1.000 0.000
#> GSM587163     2  0.0000      0.968 0.000 1.000 0.000
#> GSM587164     2  0.0000      0.968 0.000 1.000 0.000
#> GSM587165     2  0.0000      0.968 0.000 1.000 0.000
#> GSM587166     2  0.1163      0.936 0.000 0.972 0.028
#> GSM587167     2  0.0000      0.968 0.000 1.000 0.000
#> GSM587168     2  0.0000      0.968 0.000 1.000 0.000
#> GSM587169     2  0.0000      0.968 0.000 1.000 0.000
#> GSM587170     2  0.0000      0.968 0.000 1.000 0.000
#> GSM587171     2  0.0000      0.968 0.000 1.000 0.000
#> GSM587172     2  0.0000      0.968 0.000 1.000 0.000
#> GSM587173     2  0.0000      0.968 0.000 1.000 0.000
#> GSM587174     2  0.0000      0.968 0.000 1.000 0.000
#> GSM587175     2  0.0000      0.968 0.000 1.000 0.000
#> GSM587176     2  0.0000      0.968 0.000 1.000 0.000
#> GSM587177     2  0.0000      0.968 0.000 1.000 0.000
#> GSM587178     2  0.0000      0.968 0.000 1.000 0.000
#> GSM587179     2  0.0000      0.968 0.000 1.000 0.000
#> GSM587180     2  0.0000      0.968 0.000 1.000 0.000
#> GSM587181     2  0.0000      0.968 0.000 1.000 0.000
#> GSM587182     2  0.0000      0.968 0.000 1.000 0.000
#> GSM587183     2  0.0000      0.968 0.000 1.000 0.000
#> GSM587184     2  0.0000      0.968 0.000 1.000 0.000
#> GSM587185     2  0.0000      0.968 0.000 1.000 0.000
#> GSM587186     2  0.0000      0.968 0.000 1.000 0.000
#> GSM587187     2  0.0237      0.964 0.000 0.996 0.004
#> GSM587188     2  0.6215      0.137 0.000 0.572 0.428
#> GSM587189     2  0.6062      0.284 0.000 0.616 0.384
#> GSM587190     3  0.6008      0.498 0.000 0.372 0.628
#> GSM587203     3  0.0237      0.925 0.004 0.000 0.996
#> GSM587204     3  0.0237      0.925 0.004 0.000 0.996
#> GSM587205     3  0.0237      0.925 0.004 0.000 0.996
#> GSM587206     3  0.0237      0.925 0.004 0.000 0.996
#> GSM587207     3  0.0237      0.925 0.004 0.000 0.996
#> GSM587208     3  0.0237      0.925 0.004 0.000 0.996
#> GSM587209     3  0.0237      0.925 0.004 0.000 0.996
#> GSM587210     3  0.0000      0.924 0.000 0.000 1.000
#> GSM587211     3  0.0237      0.925 0.004 0.000 0.996
#> GSM587212     3  0.0000      0.924 0.000 0.000 1.000
#> GSM587213     3  0.0237      0.925 0.004 0.000 0.996
#> GSM587214     3  0.0237      0.925 0.004 0.000 0.996
#> GSM587215     3  0.0237      0.925 0.004 0.000 0.996
#> GSM587216     3  0.0000      0.924 0.000 0.000 1.000
#> GSM587217     3  0.0237      0.925 0.004 0.000 0.996
#> GSM587191     3  0.3116      0.871 0.000 0.108 0.892
#> GSM587192     3  0.0237      0.924 0.000 0.004 0.996
#> GSM587193     3  0.1289      0.911 0.000 0.032 0.968
#> GSM587194     3  0.5678      0.615 0.000 0.316 0.684
#> GSM587195     3  0.4452      0.792 0.000 0.192 0.808
#> GSM587196     3  0.2959      0.876 0.000 0.100 0.900
#> GSM587197     3  0.5621      0.629 0.000 0.308 0.692
#> GSM587198     3  0.2959      0.876 0.000 0.100 0.900
#> GSM587199     3  0.0237      0.924 0.000 0.004 0.996
#> GSM587200     3  0.0237      0.924 0.000 0.004 0.996
#> GSM587201     3  0.0237      0.924 0.000 0.004 0.996
#> GSM587202     3  0.2959      0.876 0.000 0.100 0.900
#> GSM198767     3  0.0237      0.925 0.004 0.000 0.996
#> GSM198769     3  0.0237      0.925 0.004 0.000 0.996
#> GSM198772     3  0.0237      0.925 0.004 0.000 0.996
#> GSM198773     3  0.0237      0.925 0.004 0.000 0.996
#> GSM198776     3  0.0237      0.925 0.004 0.000 0.996
#> GSM198778     3  0.0000      0.924 0.000 0.000 1.000
#> GSM198780     3  0.0000      0.924 0.000 0.000 1.000
#> GSM198781     3  0.0237      0.925 0.004 0.000 0.996
#> GSM198765     3  0.3038      0.874 0.000 0.104 0.896
#> GSM198766     3  0.1289      0.911 0.000 0.032 0.968
#> GSM198768     3  0.3551      0.850 0.000 0.132 0.868
#> GSM198770     3  0.5678      0.615 0.000 0.316 0.684
#> GSM198771     3  0.2959      0.876 0.000 0.100 0.900
#> GSM198774     3  0.0424      0.923 0.000 0.008 0.992
#> GSM198775     3  0.5678      0.615 0.000 0.316 0.684
#> GSM198777     3  0.2959      0.876 0.000 0.100 0.900
#> GSM198779     3  0.0237      0.924 0.000 0.004 0.996
#> GSM587218     1  0.0000      1.000 1.000 0.000 0.000
#> GSM587219     1  0.0000      1.000 1.000 0.000 0.000
#> GSM587220     1  0.0000      1.000 1.000 0.000 0.000
#> GSM587221     1  0.0000      1.000 1.000 0.000 0.000
#> GSM587222     1  0.0000      1.000 1.000 0.000 0.000
#> GSM587223     1  0.0000      1.000 1.000 0.000 0.000
#> GSM587224     1  0.0000      1.000 1.000 0.000 0.000
#> GSM587225     1  0.0000      1.000 1.000 0.000 0.000
#> GSM587226     1  0.0000      1.000 1.000 0.000 0.000
#> GSM587227     1  0.0000      1.000 1.000 0.000 0.000
#> GSM587228     1  0.0000      1.000 1.000 0.000 0.000
#> GSM587229     1  0.0000      1.000 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
#> GSM587155     2  0.0000      0.981 0.000 1.000 0.000  0
#> GSM587156     2  0.0188      0.977 0.000 0.996 0.004  0
#> GSM587157     2  0.0188      0.977 0.000 0.996 0.004  0
#> GSM587158     2  0.0000      0.981 0.000 1.000 0.000  0
#> GSM587159     2  0.0000      0.981 0.000 1.000 0.000  0
#> GSM587160     2  0.0000      0.981 0.000 1.000 0.000  0
#> GSM587161     2  0.0000      0.981 0.000 1.000 0.000  0
#> GSM587162     2  0.0000      0.981 0.000 1.000 0.000  0
#> GSM587163     2  0.0000      0.981 0.000 1.000 0.000  0
#> GSM587164     2  0.0000      0.981 0.000 1.000 0.000  0
#> GSM587165     2  0.0000      0.981 0.000 1.000 0.000  0
#> GSM587166     2  0.3764      0.717 0.000 0.784 0.216  0
#> GSM587167     2  0.0188      0.977 0.000 0.996 0.004  0
#> GSM587168     2  0.0000      0.981 0.000 1.000 0.000  0
#> GSM587169     2  0.0000      0.981 0.000 1.000 0.000  0
#> GSM587170     2  0.0000      0.981 0.000 1.000 0.000  0
#> GSM587171     2  0.0000      0.981 0.000 1.000 0.000  0
#> GSM587172     2  0.0000      0.981 0.000 1.000 0.000  0
#> GSM587173     2  0.0000      0.981 0.000 1.000 0.000  0
#> GSM587174     2  0.0000      0.981 0.000 1.000 0.000  0
#> GSM587175     2  0.0188      0.977 0.000 0.996 0.004  0
#> GSM587176     2  0.0000      0.981 0.000 1.000 0.000  0
#> GSM587177     2  0.0000      0.981 0.000 1.000 0.000  0
#> GSM587178     2  0.0000      0.981 0.000 1.000 0.000  0
#> GSM587179     2  0.0000      0.981 0.000 1.000 0.000  0
#> GSM587180     2  0.0000      0.981 0.000 1.000 0.000  0
#> GSM587181     2  0.0000      0.981 0.000 1.000 0.000  0
#> GSM587182     2  0.0000      0.981 0.000 1.000 0.000  0
#> GSM587183     2  0.0000      0.981 0.000 1.000 0.000  0
#> GSM587184     2  0.0000      0.981 0.000 1.000 0.000  0
#> GSM587185     2  0.0000      0.981 0.000 1.000 0.000  0
#> GSM587186     2  0.0000      0.981 0.000 1.000 0.000  0
#> GSM587187     2  0.4543      0.488 0.000 0.676 0.324  0
#> GSM587188     3  0.4522      0.543 0.000 0.320 0.680  0
#> GSM587189     3  0.4730      0.447 0.000 0.364 0.636  0
#> GSM587190     3  0.0469      0.931 0.000 0.012 0.988  0
#> GSM587203     1  0.0000      0.970 1.000 0.000 0.000  0
#> GSM587204     1  0.0000      0.970 1.000 0.000 0.000  0
#> GSM587205     1  0.0000      0.970 1.000 0.000 0.000  0
#> GSM587206     1  0.0000      0.970 1.000 0.000 0.000  0
#> GSM587207     1  0.0000      0.970 1.000 0.000 0.000  0
#> GSM587208     1  0.0000      0.970 1.000 0.000 0.000  0
#> GSM587209     1  0.0000      0.970 1.000 0.000 0.000  0
#> GSM587210     1  0.2760      0.866 0.872 0.000 0.128  0
#> GSM587211     1  0.0000      0.970 1.000 0.000 0.000  0
#> GSM587212     1  0.2530      0.881 0.888 0.000 0.112  0
#> GSM587213     1  0.0000      0.970 1.000 0.000 0.000  0
#> GSM587214     1  0.0000      0.970 1.000 0.000 0.000  0
#> GSM587215     1  0.1716      0.919 0.936 0.000 0.064  0
#> GSM587216     1  0.0592      0.960 0.984 0.000 0.016  0
#> GSM587217     1  0.0000      0.970 1.000 0.000 0.000  0
#> GSM587191     3  0.0000      0.942 0.000 0.000 1.000  0
#> GSM587192     3  0.0000      0.942 0.000 0.000 1.000  0
#> GSM587193     3  0.0000      0.942 0.000 0.000 1.000  0
#> GSM587194     3  0.0000      0.942 0.000 0.000 1.000  0
#> GSM587195     3  0.0000      0.942 0.000 0.000 1.000  0
#> GSM587196     3  0.0000      0.942 0.000 0.000 1.000  0
#> GSM587197     3  0.0000      0.942 0.000 0.000 1.000  0
#> GSM587198     3  0.0000      0.942 0.000 0.000 1.000  0
#> GSM587199     3  0.0000      0.942 0.000 0.000 1.000  0
#> GSM587200     3  0.3610      0.735 0.200 0.000 0.800  0
#> GSM587201     3  0.3649      0.729 0.204 0.000 0.796  0
#> GSM587202     3  0.0000      0.942 0.000 0.000 1.000  0
#> GSM198767     1  0.0000      0.970 1.000 0.000 0.000  0
#> GSM198769     1  0.0000      0.970 1.000 0.000 0.000  0
#> GSM198772     1  0.0000      0.970 1.000 0.000 0.000  0
#> GSM198773     1  0.0000      0.970 1.000 0.000 0.000  0
#> GSM198776     1  0.0000      0.970 1.000 0.000 0.000  0
#> GSM198778     1  0.2760      0.866 0.872 0.000 0.128  0
#> GSM198780     1  0.2530      0.881 0.888 0.000 0.112  0
#> GSM198781     1  0.0000      0.970 1.000 0.000 0.000  0
#> GSM198765     3  0.0000      0.942 0.000 0.000 1.000  0
#> GSM198766     3  0.0000      0.942 0.000 0.000 1.000  0
#> GSM198768     3  0.0000      0.942 0.000 0.000 1.000  0
#> GSM198770     3  0.0000      0.942 0.000 0.000 1.000  0
#> GSM198771     3  0.0000      0.942 0.000 0.000 1.000  0
#> GSM198774     3  0.0000      0.942 0.000 0.000 1.000  0
#> GSM198775     3  0.0000      0.942 0.000 0.000 1.000  0
#> GSM198777     3  0.0000      0.942 0.000 0.000 1.000  0
#> GSM198779     3  0.0000      0.942 0.000 0.000 1.000  0
#> GSM587218     4  0.0000      1.000 0.000 0.000 0.000  1
#> GSM587219     4  0.0000      1.000 0.000 0.000 0.000  1
#> GSM587220     4  0.0000      1.000 0.000 0.000 0.000  1
#> GSM587221     4  0.0000      1.000 0.000 0.000 0.000  1
#> GSM587222     4  0.0000      1.000 0.000 0.000 0.000  1
#> GSM587223     4  0.0000      1.000 0.000 0.000 0.000  1
#> GSM587224     4  0.0000      1.000 0.000 0.000 0.000  1
#> GSM587225     4  0.0000      1.000 0.000 0.000 0.000  1
#> GSM587226     4  0.0000      1.000 0.000 0.000 0.000  1
#> GSM587227     4  0.0000      1.000 0.000 0.000 0.000  1
#> GSM587228     4  0.0000      1.000 0.000 0.000 0.000  1
#> GSM587229     4  0.0000      1.000 0.000 0.000 0.000  1

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3 p4    p5
#> GSM587155     2  0.0703     0.9535 0.000 0.976 0.000  0 0.024
#> GSM587156     2  0.1851     0.9113 0.000 0.912 0.000  0 0.088
#> GSM587157     2  0.1478     0.9284 0.000 0.936 0.000  0 0.064
#> GSM587158     2  0.0000     0.9595 0.000 1.000 0.000  0 0.000
#> GSM587159     2  0.0000     0.9595 0.000 1.000 0.000  0 0.000
#> GSM587160     2  0.0000     0.9595 0.000 1.000 0.000  0 0.000
#> GSM587161     2  0.0000     0.9595 0.000 1.000 0.000  0 0.000
#> GSM587162     2  0.0510     0.9566 0.000 0.984 0.000  0 0.016
#> GSM587163     2  0.0000     0.9595 0.000 1.000 0.000  0 0.000
#> GSM587164     2  0.1608     0.9228 0.000 0.928 0.000  0 0.072
#> GSM587165     2  0.0000     0.9595 0.000 1.000 0.000  0 0.000
#> GSM587166     2  0.1851     0.9113 0.000 0.912 0.000  0 0.088
#> GSM587167     2  0.1732     0.9173 0.000 0.920 0.000  0 0.080
#> GSM587168     2  0.0404     0.9577 0.000 0.988 0.000  0 0.012
#> GSM587169     2  0.0000     0.9595 0.000 1.000 0.000  0 0.000
#> GSM587170     2  0.0703     0.9535 0.000 0.976 0.000  0 0.024
#> GSM587171     2  0.0000     0.9595 0.000 1.000 0.000  0 0.000
#> GSM587172     2  0.0000     0.9595 0.000 1.000 0.000  0 0.000
#> GSM587173     2  0.0000     0.9595 0.000 1.000 0.000  0 0.000
#> GSM587174     2  0.0404     0.9577 0.000 0.988 0.000  0 0.012
#> GSM587175     2  0.0880     0.9496 0.000 0.968 0.000  0 0.032
#> GSM587176     2  0.0404     0.9577 0.000 0.988 0.000  0 0.012
#> GSM587177     2  0.0000     0.9595 0.000 1.000 0.000  0 0.000
#> GSM587178     2  0.0000     0.9595 0.000 1.000 0.000  0 0.000
#> GSM587179     2  0.0000     0.9595 0.000 1.000 0.000  0 0.000
#> GSM587180     2  0.0510     0.9566 0.000 0.984 0.000  0 0.016
#> GSM587181     2  0.0404     0.9577 0.000 0.988 0.000  0 0.012
#> GSM587182     2  0.0404     0.9577 0.000 0.988 0.000  0 0.012
#> GSM587183     2  0.0000     0.9595 0.000 1.000 0.000  0 0.000
#> GSM587184     2  0.0000     0.9595 0.000 1.000 0.000  0 0.000
#> GSM587185     2  0.0000     0.9595 0.000 1.000 0.000  0 0.000
#> GSM587186     2  0.0000     0.9595 0.000 1.000 0.000  0 0.000
#> GSM587187     2  0.3921     0.7516 0.000 0.784 0.044  0 0.172
#> GSM587188     5  0.5725     0.4505 0.000 0.204 0.172  0 0.624
#> GSM587189     2  0.6625    -0.2726 0.000 0.412 0.220  0 0.368
#> GSM587190     5  0.4114     0.6244 0.000 0.000 0.376  0 0.624
#> GSM587203     1  0.3274     0.8101 0.780 0.000 0.000  0 0.220
#> GSM587204     1  0.3210     0.8113 0.788 0.000 0.000  0 0.212
#> GSM587205     1  0.3305     0.8084 0.776 0.000 0.000  0 0.224
#> GSM587206     1  0.3305     0.8084 0.776 0.000 0.000  0 0.224
#> GSM587207     1  0.3305     0.8084 0.776 0.000 0.000  0 0.224
#> GSM587208     1  0.3305     0.8084 0.776 0.000 0.000  0 0.224
#> GSM587209     1  0.1282     0.8438 0.952 0.000 0.004  0 0.044
#> GSM587210     1  0.5025     0.6506 0.704 0.000 0.124  0 0.172
#> GSM587211     1  0.1965     0.8373 0.924 0.000 0.024  0 0.052
#> GSM587212     1  0.4926     0.6643 0.712 0.000 0.112  0 0.176
#> GSM587213     1  0.0162     0.8502 0.996 0.000 0.000  0 0.004
#> GSM587214     1  0.0794     0.8503 0.972 0.000 0.000  0 0.028
#> GSM587215     1  0.1800     0.8405 0.932 0.000 0.020  0 0.048
#> GSM587216     1  0.1981     0.8372 0.924 0.000 0.028  0 0.048
#> GSM587217     1  0.1300     0.8512 0.956 0.000 0.016  0 0.028
#> GSM587191     3  0.0703     0.7538 0.000 0.000 0.976  0 0.024
#> GSM587192     3  0.0865     0.7478 0.004 0.000 0.972  0 0.024
#> GSM587193     5  0.4367     0.6353 0.004 0.000 0.416  0 0.580
#> GSM587194     3  0.4291    -0.4172 0.000 0.000 0.536  0 0.464
#> GSM587195     3  0.1478     0.7243 0.000 0.000 0.936  0 0.064
#> GSM587196     3  0.0703     0.7538 0.000 0.000 0.976  0 0.024
#> GSM587197     3  0.4101    -0.0543 0.000 0.000 0.628  0 0.372
#> GSM587198     3  0.0510     0.7506 0.000 0.000 0.984  0 0.016
#> GSM587199     3  0.1124     0.7409 0.004 0.000 0.960  0 0.036
#> GSM587200     3  0.4250     0.3830 0.252 0.000 0.720  0 0.028
#> GSM587201     3  0.4465     0.4077 0.204 0.000 0.736  0 0.060
#> GSM587202     3  0.1043     0.7524 0.000 0.000 0.960  0 0.040
#> GSM198767     1  0.3305     0.8084 0.776 0.000 0.000  0 0.224
#> GSM198769     1  0.1701     0.8407 0.936 0.000 0.016  0 0.048
#> GSM198772     1  0.1965     0.8373 0.924 0.000 0.024  0 0.052
#> GSM198773     1  0.0404     0.8508 0.988 0.000 0.000  0 0.012
#> GSM198776     1  0.3210     0.8113 0.788 0.000 0.000  0 0.212
#> GSM198778     1  0.5025     0.6506 0.704 0.000 0.124  0 0.172
#> GSM198780     1  0.4926     0.6643 0.712 0.000 0.112  0 0.176
#> GSM198781     1  0.0794     0.8503 0.972 0.000 0.000  0 0.028
#> GSM198765     3  0.0703     0.7538 0.000 0.000 0.976  0 0.024
#> GSM198766     5  0.4367     0.6353 0.004 0.000 0.416  0 0.580
#> GSM198768     3  0.0963     0.7499 0.000 0.000 0.964  0 0.036
#> GSM198770     3  0.4101    -0.0543 0.000 0.000 0.628  0 0.372
#> GSM198771     3  0.0609     0.7488 0.000 0.000 0.980  0 0.020
#> GSM198774     3  0.0404     0.7523 0.000 0.000 0.988  0 0.012
#> GSM198775     3  0.4291    -0.4172 0.000 0.000 0.536  0 0.464
#> GSM198777     3  0.0703     0.7538 0.000 0.000 0.976  0 0.024
#> GSM198779     3  0.1124     0.7409 0.004 0.000 0.960  0 0.036
#> GSM587218     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000
#> GSM587219     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000
#> GSM587220     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000
#> GSM587221     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000
#> GSM587222     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000
#> GSM587223     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000
#> GSM587224     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000
#> GSM587225     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000
#> GSM587226     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000
#> GSM587227     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000
#> GSM587228     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000
#> GSM587229     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3 p4    p5    p6
#> GSM587155     2  0.2969    0.78425 0.000 0.776 0.000  0 0.224 0.000
#> GSM587156     2  0.3351    0.72171 0.000 0.712 0.000  0 0.288 0.000
#> GSM587157     2  0.3101    0.76719 0.000 0.756 0.000  0 0.244 0.000
#> GSM587158     2  0.0000    0.90292 0.000 1.000 0.000  0 0.000 0.000
#> GSM587159     2  0.0000    0.90292 0.000 1.000 0.000  0 0.000 0.000
#> GSM587160     2  0.0000    0.90292 0.000 1.000 0.000  0 0.000 0.000
#> GSM587161     2  0.0146    0.90254 0.000 0.996 0.000  0 0.004 0.000
#> GSM587162     2  0.2854    0.79673 0.000 0.792 0.000  0 0.208 0.000
#> GSM587163     2  0.0000    0.90292 0.000 1.000 0.000  0 0.000 0.000
#> GSM587164     2  0.3198    0.75247 0.000 0.740 0.000  0 0.260 0.000
#> GSM587165     2  0.0000    0.90292 0.000 1.000 0.000  0 0.000 0.000
#> GSM587166     2  0.3508    0.71310 0.000 0.704 0.000  0 0.292 0.004
#> GSM587167     2  0.3351    0.72171 0.000 0.712 0.000  0 0.288 0.000
#> GSM587168     2  0.0260    0.90175 0.000 0.992 0.000  0 0.008 0.000
#> GSM587169     2  0.0260    0.90130 0.000 0.992 0.000  0 0.008 0.000
#> GSM587170     2  0.2854    0.79591 0.000 0.792 0.000  0 0.208 0.000
#> GSM587171     2  0.0000    0.90292 0.000 1.000 0.000  0 0.000 0.000
#> GSM587172     2  0.0000    0.90292 0.000 1.000 0.000  0 0.000 0.000
#> GSM587173     2  0.0000    0.90292 0.000 1.000 0.000  0 0.000 0.000
#> GSM587174     2  0.0000    0.90292 0.000 1.000 0.000  0 0.000 0.000
#> GSM587175     2  0.3023    0.77751 0.000 0.768 0.000  0 0.232 0.000
#> GSM587176     2  0.0146    0.90266 0.000 0.996 0.000  0 0.004 0.000
#> GSM587177     2  0.0000    0.90292 0.000 1.000 0.000  0 0.000 0.000
#> GSM587178     2  0.0000    0.90292 0.000 1.000 0.000  0 0.000 0.000
#> GSM587179     2  0.0000    0.90292 0.000 1.000 0.000  0 0.000 0.000
#> GSM587180     2  0.2454    0.82539 0.000 0.840 0.000  0 0.160 0.000
#> GSM587181     2  0.0146    0.90266 0.000 0.996 0.000  0 0.004 0.000
#> GSM587182     2  0.0458    0.89903 0.000 0.984 0.000  0 0.016 0.000
#> GSM587183     2  0.0000    0.90292 0.000 1.000 0.000  0 0.000 0.000
#> GSM587184     2  0.0146    0.90126 0.000 0.996 0.000  0 0.000 0.004
#> GSM587185     2  0.0291    0.90135 0.000 0.992 0.000  0 0.004 0.004
#> GSM587186     2  0.0146    0.90262 0.000 0.996 0.000  0 0.004 0.000
#> GSM587187     2  0.3833    0.44016 0.000 0.556 0.000  0 0.444 0.000
#> GSM587188     5  0.1219    0.63464 0.000 0.000 0.048  0 0.948 0.004
#> GSM587189     5  0.3516    0.56602 0.000 0.164 0.048  0 0.788 0.000
#> GSM587190     5  0.3405    0.27946 0.000 0.000 0.272  0 0.724 0.004
#> GSM587203     1  0.0363    0.80466 0.988 0.000 0.000  0 0.000 0.012
#> GSM587204     1  0.1501    0.80508 0.924 0.000 0.000  0 0.000 0.076
#> GSM587205     1  0.0260    0.80489 0.992 0.000 0.000  0 0.000 0.008
#> GSM587206     1  0.0790    0.80132 0.968 0.000 0.000  0 0.000 0.032
#> GSM587207     1  0.0260    0.80626 0.992 0.000 0.000  0 0.000 0.008
#> GSM587208     1  0.0790    0.80132 0.968 0.000 0.000  0 0.000 0.032
#> GSM587209     6  0.3351    0.70230 0.288 0.000 0.000  0 0.000 0.712
#> GSM587210     6  0.3897    0.78048 0.076 0.000 0.060  0 0.056 0.808
#> GSM587211     6  0.3078    0.79278 0.192 0.000 0.000  0 0.012 0.796
#> GSM587212     6  0.3717    0.78489 0.076 0.000 0.052  0 0.052 0.820
#> GSM587213     1  0.3464    0.59621 0.688 0.000 0.000  0 0.000 0.312
#> GSM587214     1  0.3409    0.63034 0.700 0.000 0.000  0 0.000 0.300
#> GSM587215     6  0.3410    0.72140 0.216 0.000 0.008  0 0.008 0.768
#> GSM587216     6  0.3600    0.79976 0.192 0.000 0.020  0 0.012 0.776
#> GSM587217     1  0.3547    0.60344 0.668 0.000 0.000  0 0.000 0.332
#> GSM587191     3  0.0713    0.75949 0.000 0.000 0.972  0 0.028 0.000
#> GSM587192     3  0.1780    0.74866 0.000 0.000 0.924  0 0.048 0.028
#> GSM587193     3  0.6089    0.00337 0.000 0.000 0.392  0 0.308 0.300
#> GSM587194     3  0.4338    0.16729 0.000 0.000 0.496  0 0.484 0.020
#> GSM587195     3  0.1285    0.75297 0.000 0.000 0.944  0 0.052 0.004
#> GSM587196     3  0.0508    0.75994 0.000 0.000 0.984  0 0.012 0.004
#> GSM587197     3  0.4361    0.29968 0.000 0.000 0.552  0 0.424 0.024
#> GSM587198     3  0.0260    0.75813 0.000 0.000 0.992  0 0.000 0.008
#> GSM587199     3  0.1092    0.75086 0.000 0.000 0.960  0 0.020 0.020
#> GSM587200     3  0.5198    0.52680 0.060 0.000 0.676  0 0.064 0.200
#> GSM587201     3  0.4176    0.61716 0.024 0.000 0.760  0 0.052 0.164
#> GSM587202     3  0.0405    0.75928 0.000 0.000 0.988  0 0.004 0.008
#> GSM198767     1  0.0146    0.80533 0.996 0.000 0.000  0 0.000 0.004
#> GSM198769     6  0.3499    0.65292 0.320 0.000 0.000  0 0.000 0.680
#> GSM198772     6  0.2980    0.78934 0.192 0.000 0.000  0 0.008 0.800
#> GSM198773     1  0.3499    0.60729 0.680 0.000 0.000  0 0.000 0.320
#> GSM198776     1  0.1501    0.80508 0.924 0.000 0.000  0 0.000 0.076
#> GSM198778     6  0.3897    0.78048 0.076 0.000 0.060  0 0.056 0.808
#> GSM198780     6  0.3717    0.78489 0.076 0.000 0.052  0 0.052 0.820
#> GSM198781     1  0.3351    0.63212 0.712 0.000 0.000  0 0.000 0.288
#> GSM198765     3  0.0547    0.76034 0.000 0.000 0.980  0 0.020 0.000
#> GSM198766     3  0.6089    0.00337 0.000 0.000 0.392  0 0.308 0.300
#> GSM198768     3  0.1082    0.75426 0.000 0.000 0.956  0 0.040 0.004
#> GSM198770     3  0.4372    0.28305 0.000 0.000 0.544  0 0.432 0.024
#> GSM198771     3  0.0260    0.75813 0.000 0.000 0.992  0 0.000 0.008
#> GSM198774     3  0.1908    0.74918 0.000 0.000 0.916  0 0.056 0.028
#> GSM198775     3  0.4338    0.16729 0.000 0.000 0.496  0 0.484 0.020
#> GSM198777     3  0.0458    0.76004 0.000 0.000 0.984  0 0.016 0.000
#> GSM198779     3  0.1092    0.75086 0.000 0.000 0.960  0 0.020 0.020
#> GSM587218     4  0.0000    1.00000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587219     4  0.0000    1.00000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587220     4  0.0000    1.00000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587221     4  0.0000    1.00000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587222     4  0.0000    1.00000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587223     4  0.0000    1.00000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587224     4  0.0000    1.00000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587225     4  0.0000    1.00000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587226     4  0.0000    1.00000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587227     4  0.0000    1.00000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587228     4  0.0000    1.00000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587229     4  0.0000    1.00000 0.000 0.000 0.000  1 0.000 0.000

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

consensus_heatmap(res, k = 2)

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

consensus_heatmap(res, k = 3)

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

consensus_heatmap(res, k = 4)

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

consensus_heatmap(res, k = 5)

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

consensus_heatmap(res, k = 6)

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

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

membership_heatmap(res, k = 2)

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

membership_heatmap(res, k = 3)

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

membership_heatmap(res, k = 4)

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

membership_heatmap(res, k = 5)

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

membership_heatmap(res, k = 6)

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

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

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

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

get_signatures(res, k = 3)

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

get_signatures(res, k = 4)

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

get_signatures(res, k = 5)

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

get_signatures(res, k = 6)

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

Signature heatmaps where rows are not scaled:

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

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

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

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

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

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

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

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

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

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

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk SD-mclust-signature_compare

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

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

An example of the output of tb is:

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

The columns in tb are:

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

UMAP plot which shows how samples are separated.

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

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

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

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

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

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

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

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

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

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

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk SD-mclust-collect-classes

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

test_to_known_factors(res)
#>            n specimen(p) k
#> SD:mclust 88    7.88e-17 2
#> SD:mclust 89    1.10e-31 3
#> SD:mclust 90    6.82e-47 4
#> SD:mclust 84    1.06e-41 5
#> SD:mclust 84    1.37e-53 6

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


SD:NMF*

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

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

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

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

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

collect_plots(res)

plot of chunk SD-NMF-collect-plots

The plots are:

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

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

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

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

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 1.000           0.998       0.999         0.5001 0.500   0.500
#> 3 3 0.910           0.904       0.958         0.2505 0.843   0.695
#> 4 4 0.999           0.968       0.985         0.1564 0.807   0.544
#> 5 5 0.920           0.881       0.944         0.0616 0.941   0.792
#> 6 6 0.850           0.736       0.853         0.0432 0.957   0.819

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

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

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

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

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

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>           class entropy silhouette    p1    p2
#> GSM587155     2  0.0000      0.999 0.000 1.000
#> GSM587156     2  0.0000      0.999 0.000 1.000
#> GSM587157     2  0.0000      0.999 0.000 1.000
#> GSM587158     2  0.0000      0.999 0.000 1.000
#> GSM587159     2  0.0000      0.999 0.000 1.000
#> GSM587160     2  0.0000      0.999 0.000 1.000
#> GSM587161     2  0.0000      0.999 0.000 1.000
#> GSM587162     2  0.0000      0.999 0.000 1.000
#> GSM587163     2  0.0000      0.999 0.000 1.000
#> GSM587164     2  0.0000      0.999 0.000 1.000
#> GSM587165     2  0.0000      0.999 0.000 1.000
#> GSM587166     2  0.0000      0.999 0.000 1.000
#> GSM587167     2  0.0000      0.999 0.000 1.000
#> GSM587168     2  0.0000      0.999 0.000 1.000
#> GSM587169     2  0.0000      0.999 0.000 1.000
#> GSM587170     2  0.0000      0.999 0.000 1.000
#> GSM587171     2  0.0000      0.999 0.000 1.000
#> GSM587172     2  0.0000      0.999 0.000 1.000
#> GSM587173     2  0.0000      0.999 0.000 1.000
#> GSM587174     2  0.0000      0.999 0.000 1.000
#> GSM587175     2  0.0000      0.999 0.000 1.000
#> GSM587176     2  0.0000      0.999 0.000 1.000
#> GSM587177     2  0.0000      0.999 0.000 1.000
#> GSM587178     2  0.0000      0.999 0.000 1.000
#> GSM587179     2  0.0000      0.999 0.000 1.000
#> GSM587180     2  0.0000      0.999 0.000 1.000
#> GSM587181     2  0.0000      0.999 0.000 1.000
#> GSM587182     2  0.0000      0.999 0.000 1.000
#> GSM587183     2  0.0000      0.999 0.000 1.000
#> GSM587184     2  0.0000      0.999 0.000 1.000
#> GSM587185     2  0.0000      0.999 0.000 1.000
#> GSM587186     2  0.0000      0.999 0.000 1.000
#> GSM587187     2  0.0000      0.999 0.000 1.000
#> GSM587188     2  0.0000      0.999 0.000 1.000
#> GSM587189     2  0.0000      0.999 0.000 1.000
#> GSM587190     2  0.0000      0.999 0.000 1.000
#> GSM587203     1  0.0000      1.000 1.000 0.000
#> GSM587204     1  0.0000      1.000 1.000 0.000
#> GSM587205     1  0.0000      1.000 1.000 0.000
#> GSM587206     1  0.0000      1.000 1.000 0.000
#> GSM587207     1  0.0000      1.000 1.000 0.000
#> GSM587208     1  0.0000      1.000 1.000 0.000
#> GSM587209     1  0.0000      1.000 1.000 0.000
#> GSM587210     1  0.0000      1.000 1.000 0.000
#> GSM587211     1  0.0000      1.000 1.000 0.000
#> GSM587212     1  0.0000      1.000 1.000 0.000
#> GSM587213     1  0.0000      1.000 1.000 0.000
#> GSM587214     1  0.0000      1.000 1.000 0.000
#> GSM587215     1  0.0000      1.000 1.000 0.000
#> GSM587216     1  0.0000      1.000 1.000 0.000
#> GSM587217     1  0.0000      1.000 1.000 0.000
#> GSM587191     2  0.0000      0.999 0.000 1.000
#> GSM587192     1  0.0376      0.996 0.996 0.004
#> GSM587193     1  0.0000      1.000 1.000 0.000
#> GSM587194     2  0.0000      0.999 0.000 1.000
#> GSM587195     2  0.0000      0.999 0.000 1.000
#> GSM587196     2  0.1843      0.972 0.028 0.972
#> GSM587197     2  0.0000      0.999 0.000 1.000
#> GSM587198     2  0.0000      0.999 0.000 1.000
#> GSM587199     2  0.0000      0.999 0.000 1.000
#> GSM587200     1  0.0000      1.000 1.000 0.000
#> GSM587201     1  0.0000      1.000 1.000 0.000
#> GSM587202     2  0.0000      0.999 0.000 1.000
#> GSM198767     1  0.0000      1.000 1.000 0.000
#> GSM198769     1  0.0000      1.000 1.000 0.000
#> GSM198772     1  0.0000      1.000 1.000 0.000
#> GSM198773     1  0.0000      1.000 1.000 0.000
#> GSM198776     1  0.0000      1.000 1.000 0.000
#> GSM198778     1  0.0000      1.000 1.000 0.000
#> GSM198780     1  0.0000      1.000 1.000 0.000
#> GSM198781     1  0.0000      1.000 1.000 0.000
#> GSM198765     2  0.0376      0.995 0.004 0.996
#> GSM198766     1  0.0000      1.000 1.000 0.000
#> GSM198768     2  0.0000      0.999 0.000 1.000
#> GSM198770     2  0.0000      0.999 0.000 1.000
#> GSM198771     2  0.1633      0.976 0.024 0.976
#> GSM198774     1  0.1184      0.984 0.984 0.016
#> GSM198775     2  0.0000      0.999 0.000 1.000
#> GSM198777     2  0.0672      0.992 0.008 0.992
#> GSM198779     2  0.0000      0.999 0.000 1.000
#> GSM587218     1  0.0000      1.000 1.000 0.000
#> GSM587219     1  0.0000      1.000 1.000 0.000
#> GSM587220     1  0.0000      1.000 1.000 0.000
#> GSM587221     1  0.0000      1.000 1.000 0.000
#> GSM587222     1  0.0000      1.000 1.000 0.000
#> GSM587223     1  0.0000      1.000 1.000 0.000
#> GSM587224     1  0.0000      1.000 1.000 0.000
#> GSM587225     1  0.0000      1.000 1.000 0.000
#> GSM587226     1  0.0000      1.000 1.000 0.000
#> GSM587227     1  0.0000      1.000 1.000 0.000
#> GSM587228     1  0.0000      1.000 1.000 0.000
#> GSM587229     1  0.0000      1.000 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1    p2    p3
#> GSM587155     2  0.0000      0.974 0.000 1.000 0.000
#> GSM587156     2  0.0000      0.974 0.000 1.000 0.000
#> GSM587157     2  0.0000      0.974 0.000 1.000 0.000
#> GSM587158     2  0.0000      0.974 0.000 1.000 0.000
#> GSM587159     2  0.0000      0.974 0.000 1.000 0.000
#> GSM587160     2  0.0000      0.974 0.000 1.000 0.000
#> GSM587161     2  0.0000      0.974 0.000 1.000 0.000
#> GSM587162     2  0.0000      0.974 0.000 1.000 0.000
#> GSM587163     2  0.0000      0.974 0.000 1.000 0.000
#> GSM587164     2  0.0000      0.974 0.000 1.000 0.000
#> GSM587165     2  0.0000      0.974 0.000 1.000 0.000
#> GSM587166     2  0.0237      0.971 0.000 0.996 0.004
#> GSM587167     2  0.0000      0.974 0.000 1.000 0.000
#> GSM587168     2  0.0000      0.974 0.000 1.000 0.000
#> GSM587169     2  0.0000      0.974 0.000 1.000 0.000
#> GSM587170     2  0.0000      0.974 0.000 1.000 0.000
#> GSM587171     2  0.0000      0.974 0.000 1.000 0.000
#> GSM587172     2  0.0000      0.974 0.000 1.000 0.000
#> GSM587173     2  0.0000      0.974 0.000 1.000 0.000
#> GSM587174     2  0.0000      0.974 0.000 1.000 0.000
#> GSM587175     2  0.0000      0.974 0.000 1.000 0.000
#> GSM587176     2  0.0000      0.974 0.000 1.000 0.000
#> GSM587177     2  0.0000      0.974 0.000 1.000 0.000
#> GSM587178     2  0.0000      0.974 0.000 1.000 0.000
#> GSM587179     2  0.0000      0.974 0.000 1.000 0.000
#> GSM587180     2  0.0000      0.974 0.000 1.000 0.000
#> GSM587181     2  0.0000      0.974 0.000 1.000 0.000
#> GSM587182     2  0.0000      0.974 0.000 1.000 0.000
#> GSM587183     2  0.0000      0.974 0.000 1.000 0.000
#> GSM587184     2  0.0000      0.974 0.000 1.000 0.000
#> GSM587185     2  0.0000      0.974 0.000 1.000 0.000
#> GSM587186     2  0.0000      0.974 0.000 1.000 0.000
#> GSM587187     2  0.0000      0.974 0.000 1.000 0.000
#> GSM587188     2  0.0000      0.974 0.000 1.000 0.000
#> GSM587189     2  0.0000      0.974 0.000 1.000 0.000
#> GSM587190     2  0.1529      0.941 0.000 0.960 0.040
#> GSM587203     1  0.0000      0.956 1.000 0.000 0.000
#> GSM587204     1  0.0000      0.956 1.000 0.000 0.000
#> GSM587205     1  0.0000      0.956 1.000 0.000 0.000
#> GSM587206     1  0.0000      0.956 1.000 0.000 0.000
#> GSM587207     1  0.0000      0.956 1.000 0.000 0.000
#> GSM587208     1  0.0000      0.956 1.000 0.000 0.000
#> GSM587209     1  0.0000      0.956 1.000 0.000 0.000
#> GSM587210     1  0.3412      0.862 0.876 0.000 0.124
#> GSM587211     1  0.0000      0.956 1.000 0.000 0.000
#> GSM587212     1  0.3941      0.819 0.844 0.000 0.156
#> GSM587213     1  0.0000      0.956 1.000 0.000 0.000
#> GSM587214     1  0.0000      0.956 1.000 0.000 0.000
#> GSM587215     1  0.0000      0.956 1.000 0.000 0.000
#> GSM587216     1  0.0424      0.951 0.992 0.000 0.008
#> GSM587217     1  0.0000      0.956 1.000 0.000 0.000
#> GSM587191     2  0.0424      0.969 0.000 0.992 0.008
#> GSM587192     1  0.1170      0.944 0.976 0.008 0.016
#> GSM587193     1  0.5706      0.560 0.680 0.000 0.320
#> GSM587194     3  0.1411      0.868 0.000 0.036 0.964
#> GSM587195     2  0.2537      0.905 0.000 0.920 0.080
#> GSM587196     2  0.1529      0.944 0.000 0.960 0.040
#> GSM587197     3  0.6154      0.321 0.000 0.408 0.592
#> GSM587198     2  0.3267      0.861 0.000 0.884 0.116
#> GSM587199     3  0.5291      0.643 0.000 0.268 0.732
#> GSM587200     3  0.6154      0.238 0.408 0.000 0.592
#> GSM587201     1  0.0424      0.951 0.992 0.000 0.008
#> GSM587202     2  0.0592      0.966 0.000 0.988 0.012
#> GSM198767     1  0.0000      0.956 1.000 0.000 0.000
#> GSM198769     1  0.0000      0.956 1.000 0.000 0.000
#> GSM198772     1  0.0000      0.956 1.000 0.000 0.000
#> GSM198773     1  0.0000      0.956 1.000 0.000 0.000
#> GSM198776     1  0.0000      0.956 1.000 0.000 0.000
#> GSM198778     1  0.2537      0.903 0.920 0.000 0.080
#> GSM198780     1  0.3267      0.865 0.884 0.000 0.116
#> GSM198781     1  0.0000      0.956 1.000 0.000 0.000
#> GSM198765     2  0.0424      0.969 0.000 0.992 0.008
#> GSM198766     1  0.5327      0.647 0.728 0.000 0.272
#> GSM198768     2  0.2711      0.897 0.000 0.912 0.088
#> GSM198770     2  0.6244      0.173 0.000 0.560 0.440
#> GSM198771     2  0.4974      0.677 0.000 0.764 0.236
#> GSM198774     1  0.1453      0.932 0.968 0.024 0.008
#> GSM198775     3  0.2711      0.830 0.000 0.088 0.912
#> GSM198777     2  0.1411      0.948 0.000 0.964 0.036
#> GSM198779     3  0.5497      0.605 0.000 0.292 0.708
#> GSM587218     3  0.0424      0.891 0.008 0.000 0.992
#> GSM587219     3  0.0424      0.891 0.008 0.000 0.992
#> GSM587220     3  0.0424      0.891 0.008 0.000 0.992
#> GSM587221     3  0.0424      0.891 0.008 0.000 0.992
#> GSM587222     3  0.0424      0.891 0.008 0.000 0.992
#> GSM587223     3  0.0424      0.891 0.008 0.000 0.992
#> GSM587224     3  0.0424      0.891 0.008 0.000 0.992
#> GSM587225     3  0.0424      0.891 0.008 0.000 0.992
#> GSM587226     3  0.0424      0.891 0.008 0.000 0.992
#> GSM587227     3  0.0424      0.891 0.008 0.000 0.992
#> GSM587228     3  0.0424      0.891 0.008 0.000 0.992
#> GSM587229     3  0.0424      0.891 0.008 0.000 0.992

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM587155     2  0.0000      0.990 0.000 1.000 0.000 0.000
#> GSM587156     2  0.0188      0.987 0.000 0.996 0.004 0.000
#> GSM587157     2  0.1557      0.933 0.000 0.944 0.056 0.000
#> GSM587158     2  0.0000      0.990 0.000 1.000 0.000 0.000
#> GSM587159     2  0.0000      0.990 0.000 1.000 0.000 0.000
#> GSM587160     2  0.0000      0.990 0.000 1.000 0.000 0.000
#> GSM587161     2  0.0000      0.990 0.000 1.000 0.000 0.000
#> GSM587162     2  0.0000      0.990 0.000 1.000 0.000 0.000
#> GSM587163     2  0.0000      0.990 0.000 1.000 0.000 0.000
#> GSM587164     2  0.0000      0.990 0.000 1.000 0.000 0.000
#> GSM587165     2  0.0000      0.990 0.000 1.000 0.000 0.000
#> GSM587166     2  0.0592      0.976 0.000 0.984 0.016 0.000
#> GSM587167     2  0.0000      0.990 0.000 1.000 0.000 0.000
#> GSM587168     2  0.0000      0.990 0.000 1.000 0.000 0.000
#> GSM587169     2  0.0000      0.990 0.000 1.000 0.000 0.000
#> GSM587170     2  0.0000      0.990 0.000 1.000 0.000 0.000
#> GSM587171     2  0.0000      0.990 0.000 1.000 0.000 0.000
#> GSM587172     2  0.0000      0.990 0.000 1.000 0.000 0.000
#> GSM587173     2  0.0000      0.990 0.000 1.000 0.000 0.000
#> GSM587174     2  0.0000      0.990 0.000 1.000 0.000 0.000
#> GSM587175     2  0.0000      0.990 0.000 1.000 0.000 0.000
#> GSM587176     2  0.0000      0.990 0.000 1.000 0.000 0.000
#> GSM587177     2  0.0000      0.990 0.000 1.000 0.000 0.000
#> GSM587178     2  0.0000      0.990 0.000 1.000 0.000 0.000
#> GSM587179     2  0.0000      0.990 0.000 1.000 0.000 0.000
#> GSM587180     2  0.0000      0.990 0.000 1.000 0.000 0.000
#> GSM587181     2  0.0000      0.990 0.000 1.000 0.000 0.000
#> GSM587182     2  0.0000      0.990 0.000 1.000 0.000 0.000
#> GSM587183     2  0.0000      0.990 0.000 1.000 0.000 0.000
#> GSM587184     2  0.0000      0.990 0.000 1.000 0.000 0.000
#> GSM587185     2  0.0000      0.990 0.000 1.000 0.000 0.000
#> GSM587186     2  0.0000      0.990 0.000 1.000 0.000 0.000
#> GSM587187     2  0.0188      0.987 0.000 0.996 0.004 0.000
#> GSM587188     2  0.0188      0.987 0.000 0.996 0.004 0.000
#> GSM587189     2  0.0188      0.987 0.000 0.996 0.004 0.000
#> GSM587190     2  0.3837      0.713 0.000 0.776 0.224 0.000
#> GSM587203     1  0.0000      1.000 1.000 0.000 0.000 0.000
#> GSM587204     1  0.0000      1.000 1.000 0.000 0.000 0.000
#> GSM587205     1  0.0000      1.000 1.000 0.000 0.000 0.000
#> GSM587206     1  0.0000      1.000 1.000 0.000 0.000 0.000
#> GSM587207     1  0.0000      1.000 1.000 0.000 0.000 0.000
#> GSM587208     1  0.0000      1.000 1.000 0.000 0.000 0.000
#> GSM587209     1  0.0000      1.000 1.000 0.000 0.000 0.000
#> GSM587210     3  0.2408      0.876 0.104 0.000 0.896 0.000
#> GSM587211     1  0.0000      1.000 1.000 0.000 0.000 0.000
#> GSM587212     3  0.4431      0.608 0.304 0.000 0.696 0.000
#> GSM587213     1  0.0000      1.000 1.000 0.000 0.000 0.000
#> GSM587214     1  0.0000      1.000 1.000 0.000 0.000 0.000
#> GSM587215     1  0.0000      1.000 1.000 0.000 0.000 0.000
#> GSM587216     1  0.0000      1.000 1.000 0.000 0.000 0.000
#> GSM587217     1  0.0000      1.000 1.000 0.000 0.000 0.000
#> GSM587191     3  0.0000      0.951 0.000 0.000 1.000 0.000
#> GSM587192     3  0.0188      0.949 0.004 0.000 0.996 0.000
#> GSM587193     3  0.2216      0.884 0.092 0.000 0.908 0.000
#> GSM587194     3  0.0336      0.946 0.000 0.000 0.992 0.008
#> GSM587195     3  0.0000      0.951 0.000 0.000 1.000 0.000
#> GSM587196     3  0.0000      0.951 0.000 0.000 1.000 0.000
#> GSM587197     3  0.0000      0.951 0.000 0.000 1.000 0.000
#> GSM587198     3  0.0000      0.951 0.000 0.000 1.000 0.000
#> GSM587199     3  0.0000      0.951 0.000 0.000 1.000 0.000
#> GSM587200     3  0.0188      0.949 0.004 0.000 0.996 0.000
#> GSM587201     3  0.0188      0.949 0.004 0.000 0.996 0.000
#> GSM587202     3  0.0000      0.951 0.000 0.000 1.000 0.000
#> GSM198767     1  0.0000      1.000 1.000 0.000 0.000 0.000
#> GSM198769     1  0.0000      1.000 1.000 0.000 0.000 0.000
#> GSM198772     1  0.0000      1.000 1.000 0.000 0.000 0.000
#> GSM198773     1  0.0000      1.000 1.000 0.000 0.000 0.000
#> GSM198776     1  0.0000      1.000 1.000 0.000 0.000 0.000
#> GSM198778     3  0.1867      0.903 0.072 0.000 0.928 0.000
#> GSM198780     3  0.4304      0.644 0.284 0.000 0.716 0.000
#> GSM198781     1  0.0000      1.000 1.000 0.000 0.000 0.000
#> GSM198765     3  0.0000      0.951 0.000 0.000 1.000 0.000
#> GSM198766     3  0.3610      0.763 0.200 0.000 0.800 0.000
#> GSM198768     3  0.0000      0.951 0.000 0.000 1.000 0.000
#> GSM198770     3  0.0000      0.951 0.000 0.000 1.000 0.000
#> GSM198771     3  0.0000      0.951 0.000 0.000 1.000 0.000
#> GSM198774     3  0.0188      0.949 0.004 0.000 0.996 0.000
#> GSM198775     3  0.0000      0.951 0.000 0.000 1.000 0.000
#> GSM198777     3  0.0000      0.951 0.000 0.000 1.000 0.000
#> GSM198779     3  0.0000      0.951 0.000 0.000 1.000 0.000
#> GSM587218     4  0.0000      1.000 0.000 0.000 0.000 1.000
#> GSM587219     4  0.0000      1.000 0.000 0.000 0.000 1.000
#> GSM587220     4  0.0000      1.000 0.000 0.000 0.000 1.000
#> GSM587221     4  0.0000      1.000 0.000 0.000 0.000 1.000
#> GSM587222     4  0.0000      1.000 0.000 0.000 0.000 1.000
#> GSM587223     4  0.0000      1.000 0.000 0.000 0.000 1.000
#> GSM587224     4  0.0000      1.000 0.000 0.000 0.000 1.000
#> GSM587225     4  0.0000      1.000 0.000 0.000 0.000 1.000
#> GSM587226     4  0.0000      1.000 0.000 0.000 0.000 1.000
#> GSM587227     4  0.0000      1.000 0.000 0.000 0.000 1.000
#> GSM587228     4  0.0000      1.000 0.000 0.000 0.000 1.000
#> GSM587229     4  0.0000      1.000 0.000 0.000 0.000 1.000

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3 p4    p5
#> GSM587155     2  0.1124     0.9453 0.000 0.960 0.036  0 0.004
#> GSM587156     2  0.3969     0.6024 0.000 0.692 0.304  0 0.004
#> GSM587157     5  0.4323     0.3961 0.000 0.332 0.012  0 0.656
#> GSM587158     2  0.0000     0.9699 0.000 1.000 0.000  0 0.000
#> GSM587159     2  0.0000     0.9699 0.000 1.000 0.000  0 0.000
#> GSM587160     2  0.0000     0.9699 0.000 1.000 0.000  0 0.000
#> GSM587161     2  0.0290     0.9664 0.000 0.992 0.008  0 0.000
#> GSM587162     2  0.0000     0.9699 0.000 1.000 0.000  0 0.000
#> GSM587163     2  0.0000     0.9699 0.000 1.000 0.000  0 0.000
#> GSM587164     2  0.1571     0.9263 0.000 0.936 0.060  0 0.004
#> GSM587165     2  0.0000     0.9699 0.000 1.000 0.000  0 0.000
#> GSM587166     2  0.4118     0.5396 0.000 0.660 0.336  0 0.004
#> GSM587167     2  0.2124     0.8938 0.000 0.900 0.096  0 0.004
#> GSM587168     2  0.0162     0.9685 0.000 0.996 0.000  0 0.004
#> GSM587169     2  0.0000     0.9699 0.000 1.000 0.000  0 0.000
#> GSM587170     2  0.2011     0.9016 0.000 0.908 0.088  0 0.004
#> GSM587171     2  0.0000     0.9699 0.000 1.000 0.000  0 0.000
#> GSM587172     2  0.0000     0.9699 0.000 1.000 0.000  0 0.000
#> GSM587173     2  0.0162     0.9685 0.000 0.996 0.000  0 0.004
#> GSM587174     2  0.0000     0.9699 0.000 1.000 0.000  0 0.000
#> GSM587175     2  0.0579     0.9622 0.000 0.984 0.008  0 0.008
#> GSM587176     2  0.0162     0.9683 0.000 0.996 0.004  0 0.000
#> GSM587177     2  0.0162     0.9685 0.000 0.996 0.000  0 0.004
#> GSM587178     2  0.0000     0.9699 0.000 1.000 0.000  0 0.000
#> GSM587179     2  0.0000     0.9699 0.000 1.000 0.000  0 0.000
#> GSM587180     2  0.0000     0.9699 0.000 1.000 0.000  0 0.000
#> GSM587181     2  0.0000     0.9699 0.000 1.000 0.000  0 0.000
#> GSM587182     2  0.0000     0.9699 0.000 1.000 0.000  0 0.000
#> GSM587183     2  0.0000     0.9699 0.000 1.000 0.000  0 0.000
#> GSM587184     2  0.0000     0.9699 0.000 1.000 0.000  0 0.000
#> GSM587185     2  0.0000     0.9699 0.000 1.000 0.000  0 0.000
#> GSM587186     2  0.0162     0.9685 0.000 0.996 0.000  0 0.004
#> GSM587187     2  0.0162     0.9685 0.000 0.996 0.000  0 0.004
#> GSM587188     2  0.0324     0.9667 0.000 0.992 0.004  0 0.004
#> GSM587189     2  0.0290     0.9663 0.000 0.992 0.000  0 0.008
#> GSM587190     3  0.4702     0.1270 0.000 0.432 0.552  0 0.016
#> GSM587203     1  0.0000     0.9818 1.000 0.000 0.000  0 0.000
#> GSM587204     1  0.0000     0.9818 1.000 0.000 0.000  0 0.000
#> GSM587205     1  0.0000     0.9818 1.000 0.000 0.000  0 0.000
#> GSM587206     1  0.0000     0.9818 1.000 0.000 0.000  0 0.000
#> GSM587207     1  0.0000     0.9818 1.000 0.000 0.000  0 0.000
#> GSM587208     1  0.0000     0.9818 1.000 0.000 0.000  0 0.000
#> GSM587209     1  0.0162     0.9803 0.996 0.000 0.004  0 0.000
#> GSM587210     3  0.4922     0.6649 0.156 0.000 0.716  0 0.128
#> GSM587211     1  0.1648     0.9403 0.940 0.000 0.040  0 0.020
#> GSM587212     3  0.4280     0.7009 0.140 0.000 0.772  0 0.088
#> GSM587213     1  0.0000     0.9818 1.000 0.000 0.000  0 0.000
#> GSM587214     1  0.0000     0.9818 1.000 0.000 0.000  0 0.000
#> GSM587215     1  0.0324     0.9786 0.992 0.000 0.004  0 0.004
#> GSM587216     1  0.3039     0.7598 0.808 0.000 0.192  0 0.000
#> GSM587217     1  0.0324     0.9786 0.992 0.000 0.004  0 0.004
#> GSM587191     3  0.2773     0.7169 0.000 0.000 0.836  0 0.164
#> GSM587192     3  0.1197     0.7739 0.000 0.000 0.952  0 0.048
#> GSM587193     3  0.0162     0.7667 0.000 0.000 0.996  0 0.004
#> GSM587194     3  0.0404     0.7725 0.000 0.000 0.988  0 0.012
#> GSM587195     5  0.0000     0.8687 0.000 0.000 0.000  0 1.000
#> GSM587196     5  0.0162     0.8706 0.000 0.000 0.004  0 0.996
#> GSM587197     5  0.0162     0.8706 0.000 0.000 0.004  0 0.996
#> GSM587198     5  0.1544     0.8424 0.000 0.000 0.068  0 0.932
#> GSM587199     5  0.3561     0.6013 0.000 0.000 0.260  0 0.740
#> GSM587200     3  0.4182     0.3711 0.000 0.000 0.600  0 0.400
#> GSM587201     3  0.4307     0.0809 0.000 0.000 0.500  0 0.500
#> GSM587202     5  0.0703     0.8652 0.000 0.000 0.024  0 0.976
#> GSM198767     1  0.0000     0.9818 1.000 0.000 0.000  0 0.000
#> GSM198769     1  0.0162     0.9803 0.996 0.000 0.004  0 0.000
#> GSM198772     1  0.1444     0.9465 0.948 0.000 0.040  0 0.012
#> GSM198773     1  0.0000     0.9818 1.000 0.000 0.000  0 0.000
#> GSM198776     1  0.0000     0.9818 1.000 0.000 0.000  0 0.000
#> GSM198778     3  0.4805     0.6770 0.128 0.000 0.728  0 0.144
#> GSM198780     3  0.4291     0.7026 0.136 0.000 0.772  0 0.092
#> GSM198781     1  0.0000     0.9818 1.000 0.000 0.000  0 0.000
#> GSM198765     3  0.2377     0.7433 0.000 0.000 0.872  0 0.128
#> GSM198766     3  0.0162     0.7705 0.000 0.000 0.996  0 0.004
#> GSM198768     5  0.0000     0.8687 0.000 0.000 0.000  0 1.000
#> GSM198770     5  0.0162     0.8706 0.000 0.000 0.004  0 0.996
#> GSM198771     5  0.1608     0.8396 0.000 0.000 0.072  0 0.928
#> GSM198774     3  0.1197     0.7739 0.000 0.000 0.952  0 0.048
#> GSM198775     3  0.0404     0.7725 0.000 0.000 0.988  0 0.012
#> GSM198777     5  0.0162     0.8706 0.000 0.000 0.004  0 0.996
#> GSM198779     5  0.3534     0.6091 0.000 0.000 0.256  0 0.744
#> GSM587218     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000
#> GSM587219     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000
#> GSM587220     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000
#> GSM587221     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000
#> GSM587222     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000
#> GSM587223     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000
#> GSM587224     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000
#> GSM587225     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000
#> GSM587226     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000
#> GSM587227     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000
#> GSM587228     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000
#> GSM587229     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3 p4    p5    p6
#> GSM587155     2  0.3934     0.6537 0.000 0.708 0.000  0 0.032 0.260
#> GSM587156     6  0.5823     0.0824 0.000 0.332 0.000  0 0.200 0.468
#> GSM587157     3  0.4250     0.5983 0.000 0.144 0.744  0 0.004 0.108
#> GSM587158     2  0.0000     0.9250 0.000 1.000 0.000  0 0.000 0.000
#> GSM587159     2  0.0146     0.9248 0.000 0.996 0.000  0 0.000 0.004
#> GSM587160     2  0.0632     0.9197 0.000 0.976 0.000  0 0.000 0.024
#> GSM587161     2  0.2219     0.8345 0.000 0.864 0.000  0 0.000 0.136
#> GSM587162     2  0.0632     0.9202 0.000 0.976 0.000  0 0.000 0.024
#> GSM587163     2  0.0363     0.9233 0.000 0.988 0.000  0 0.000 0.012
#> GSM587164     2  0.4350     0.5809 0.000 0.660 0.000  0 0.048 0.292
#> GSM587165     2  0.0458     0.9220 0.000 0.984 0.000  0 0.000 0.016
#> GSM587166     6  0.5813     0.0699 0.000 0.296 0.000  0 0.216 0.488
#> GSM587167     2  0.4747     0.4317 0.000 0.584 0.000  0 0.060 0.356
#> GSM587168     2  0.0458     0.9220 0.000 0.984 0.000  0 0.000 0.016
#> GSM587169     2  0.0458     0.9223 0.000 0.984 0.000  0 0.000 0.016
#> GSM587170     2  0.4436     0.5459 0.000 0.640 0.000  0 0.048 0.312
#> GSM587171     2  0.0146     0.9248 0.000 0.996 0.000  0 0.000 0.004
#> GSM587172     2  0.0146     0.9248 0.000 0.996 0.000  0 0.000 0.004
#> GSM587173     2  0.0547     0.9204 0.000 0.980 0.000  0 0.000 0.020
#> GSM587174     2  0.0000     0.9250 0.000 1.000 0.000  0 0.000 0.000
#> GSM587175     2  0.3309     0.7588 0.000 0.788 0.016  0 0.004 0.192
#> GSM587176     2  0.0865     0.9140 0.000 0.964 0.000  0 0.000 0.036
#> GSM587177     2  0.0363     0.9232 0.000 0.988 0.000  0 0.000 0.012
#> GSM587178     2  0.0260     0.9241 0.000 0.992 0.000  0 0.000 0.008
#> GSM587179     2  0.0632     0.9197 0.000 0.976 0.000  0 0.000 0.024
#> GSM587180     2  0.0260     0.9241 0.000 0.992 0.000  0 0.000 0.008
#> GSM587181     2  0.0000     0.9250 0.000 1.000 0.000  0 0.000 0.000
#> GSM587182     2  0.0260     0.9241 0.000 0.992 0.000  0 0.000 0.008
#> GSM587183     2  0.0363     0.9232 0.000 0.988 0.000  0 0.000 0.012
#> GSM587184     2  0.0260     0.9251 0.000 0.992 0.000  0 0.000 0.008
#> GSM587185     2  0.0713     0.9180 0.000 0.972 0.000  0 0.000 0.028
#> GSM587186     2  0.0547     0.9204 0.000 0.980 0.000  0 0.000 0.020
#> GSM587187     2  0.0806     0.9165 0.000 0.972 0.008  0 0.000 0.020
#> GSM587188     2  0.1434     0.8980 0.000 0.948 0.024  0 0.008 0.020
#> GSM587189     2  0.1871     0.8835 0.000 0.928 0.032  0 0.016 0.024
#> GSM587190     5  0.5929     0.3363 0.000 0.168 0.036  0 0.584 0.212
#> GSM587203     1  0.0000     0.8713 1.000 0.000 0.000  0 0.000 0.000
#> GSM587204     1  0.0000     0.8713 1.000 0.000 0.000  0 0.000 0.000
#> GSM587205     1  0.0000     0.8713 1.000 0.000 0.000  0 0.000 0.000
#> GSM587206     1  0.0000     0.8713 1.000 0.000 0.000  0 0.000 0.000
#> GSM587207     1  0.0000     0.8713 1.000 0.000 0.000  0 0.000 0.000
#> GSM587208     1  0.0000     0.8713 1.000 0.000 0.000  0 0.000 0.000
#> GSM587209     1  0.2941     0.7200 0.780 0.000 0.000  0 0.000 0.220
#> GSM587210     5  0.5128     0.2106 0.056 0.000 0.012  0 0.524 0.408
#> GSM587211     6  0.4976    -0.1733 0.428 0.000 0.032  0 0.020 0.520
#> GSM587212     6  0.5370     0.0175 0.060 0.000 0.036  0 0.312 0.592
#> GSM587213     1  0.1007     0.8614 0.956 0.000 0.000  0 0.000 0.044
#> GSM587214     1  0.0632     0.8676 0.976 0.000 0.000  0 0.000 0.024
#> GSM587215     1  0.4153     0.5279 0.636 0.000 0.024  0 0.000 0.340
#> GSM587216     1  0.5176     0.3034 0.548 0.000 0.000  0 0.100 0.352
#> GSM587217     1  0.3795     0.5108 0.632 0.000 0.004  0 0.000 0.364
#> GSM587191     5  0.1950     0.6429 0.000 0.000 0.064  0 0.912 0.024
#> GSM587192     5  0.2165     0.6251 0.000 0.000 0.008  0 0.884 0.108
#> GSM587193     5  0.3838     0.3913 0.000 0.000 0.000  0 0.552 0.448
#> GSM587194     5  0.2854     0.5802 0.000 0.000 0.000  0 0.792 0.208
#> GSM587195     3  0.0458     0.8622 0.000 0.000 0.984  0 0.000 0.016
#> GSM587196     3  0.0458     0.8621 0.000 0.000 0.984  0 0.000 0.016
#> GSM587197     3  0.0291     0.8611 0.000 0.000 0.992  0 0.004 0.004
#> GSM587198     3  0.3834     0.6649 0.000 0.000 0.732  0 0.232 0.036
#> GSM587199     5  0.4466     0.3438 0.000 0.000 0.336  0 0.620 0.044
#> GSM587200     5  0.3660     0.6000 0.000 0.000 0.160  0 0.780 0.060
#> GSM587201     5  0.4066     0.5589 0.000 0.000 0.204  0 0.732 0.064
#> GSM587202     3  0.2909     0.7736 0.000 0.000 0.836  0 0.136 0.028
#> GSM198767     1  0.0000     0.8713 1.000 0.000 0.000  0 0.000 0.000
#> GSM198769     1  0.2941     0.7200 0.780 0.000 0.000  0 0.000 0.220
#> GSM198772     6  0.4854    -0.1898 0.436 0.000 0.024  0 0.020 0.520
#> GSM198773     1  0.0937     0.8626 0.960 0.000 0.000  0 0.000 0.040
#> GSM198776     1  0.0000     0.8713 1.000 0.000 0.000  0 0.000 0.000
#> GSM198778     5  0.5147     0.2306 0.052 0.000 0.016  0 0.532 0.400
#> GSM198780     6  0.5370     0.0175 0.060 0.000 0.036  0 0.312 0.592
#> GSM198781     1  0.0547     0.8685 0.980 0.000 0.000  0 0.000 0.020
#> GSM198765     5  0.1829     0.6429 0.000 0.000 0.056  0 0.920 0.024
#> GSM198766     5  0.3810     0.4123 0.000 0.000 0.000  0 0.572 0.428
#> GSM198768     3  0.0632     0.8603 0.000 0.000 0.976  0 0.000 0.024
#> GSM198770     3  0.0405     0.8605 0.000 0.000 0.988  0 0.008 0.004
#> GSM198771     3  0.3860     0.6589 0.000 0.000 0.728  0 0.236 0.036
#> GSM198774     5  0.2118     0.6261 0.000 0.000 0.008  0 0.888 0.104
#> GSM198775     5  0.2912     0.5775 0.000 0.000 0.000  0 0.784 0.216
#> GSM198777     3  0.0458     0.8621 0.000 0.000 0.984  0 0.000 0.016
#> GSM198779     5  0.4480     0.3350 0.000 0.000 0.340  0 0.616 0.044
#> GSM587218     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587219     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587220     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587221     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587222     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587223     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587224     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587225     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587226     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587227     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587228     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587229     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000 0.000

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

consensus_heatmap(res, k = 2)

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

consensus_heatmap(res, k = 3)

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

consensus_heatmap(res, k = 4)

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

consensus_heatmap(res, k = 5)

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

consensus_heatmap(res, k = 6)

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

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

membership_heatmap(res, k = 2)

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

membership_heatmap(res, k = 3)

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

membership_heatmap(res, k = 4)

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

membership_heatmap(res, k = 5)

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

membership_heatmap(res, k = 6)

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

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

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

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

get_signatures(res, k = 3)

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

get_signatures(res, k = 4)

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

get_signatures(res, k = 5)

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

get_signatures(res, k = 6)

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

Signature heatmaps where rows are not scaled:

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

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

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

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

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

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

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

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

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

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

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk SD-NMF-signature_compare

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

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

An example of the output of tb is:

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

The columns in tb are:

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

UMAP plot which shows how samples are separated.

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

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

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

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

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

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

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

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

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

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

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk SD-NMF-collect-classes

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

test_to_known_factors(res)
#>         n specimen(p) k
#> SD:NMF 92    4.01e-14 2
#> SD:NMF 89    4.94e-24 3
#> SD:NMF 92    1.69e-42 4
#> SD:NMF 88    5.18e-38 5
#> SD:NMF 77    1.31e-34 6

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


CV:hclust

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

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

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

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

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

collect_plots(res)

plot of chunk CV-hclust-collect-plots

The plots are:

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

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

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

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

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.653           0.840       0.923         0.4819 0.514   0.514
#> 3 3 0.629           0.818       0.865         0.2075 0.928   0.861
#> 4 4 0.886           0.928       0.966         0.2426 0.817   0.593
#> 5 5 0.883           0.878       0.924         0.0446 0.969   0.890
#> 6 6 0.872           0.769       0.880         0.0352 0.991   0.963

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
#> GSM587155     2  0.0000      0.871 0.000 1.000
#> GSM587156     2  0.0000      0.871 0.000 1.000
#> GSM587157     2  0.0000      0.871 0.000 1.000
#> GSM587158     2  0.0000      0.871 0.000 1.000
#> GSM587159     2  0.0000      0.871 0.000 1.000
#> GSM587160     2  0.0000      0.871 0.000 1.000
#> GSM587161     2  0.0000      0.871 0.000 1.000
#> GSM587162     2  0.0000      0.871 0.000 1.000
#> GSM587163     2  0.0000      0.871 0.000 1.000
#> GSM587164     2  0.0000      0.871 0.000 1.000
#> GSM587165     2  0.0000      0.871 0.000 1.000
#> GSM587166     2  0.0000      0.871 0.000 1.000
#> GSM587167     2  0.0000      0.871 0.000 1.000
#> GSM587168     2  0.0000      0.871 0.000 1.000
#> GSM587169     2  0.0000      0.871 0.000 1.000
#> GSM587170     2  0.0000      0.871 0.000 1.000
#> GSM587171     2  0.0000      0.871 0.000 1.000
#> GSM587172     2  0.0000      0.871 0.000 1.000
#> GSM587173     2  0.0000      0.871 0.000 1.000
#> GSM587174     2  0.0000      0.871 0.000 1.000
#> GSM587175     2  0.0000      0.871 0.000 1.000
#> GSM587176     2  0.0000      0.871 0.000 1.000
#> GSM587177     2  0.0000      0.871 0.000 1.000
#> GSM587178     2  0.0000      0.871 0.000 1.000
#> GSM587179     2  0.0000      0.871 0.000 1.000
#> GSM587180     2  0.0000      0.871 0.000 1.000
#> GSM587181     2  0.0000      0.871 0.000 1.000
#> GSM587182     2  0.0000      0.871 0.000 1.000
#> GSM587183     2  0.0000      0.871 0.000 1.000
#> GSM587184     2  0.0000      0.871 0.000 1.000
#> GSM587185     2  0.0000      0.871 0.000 1.000
#> GSM587186     2  0.0000      0.871 0.000 1.000
#> GSM587187     2  0.0000      0.871 0.000 1.000
#> GSM587188     2  0.0000      0.871 0.000 1.000
#> GSM587189     2  0.0000      0.871 0.000 1.000
#> GSM587190     2  0.0000      0.871 0.000 1.000
#> GSM587203     1  0.0000      0.967 1.000 0.000
#> GSM587204     1  0.0000      0.967 1.000 0.000
#> GSM587205     1  0.0000      0.967 1.000 0.000
#> GSM587206     1  0.0000      0.967 1.000 0.000
#> GSM587207     1  0.0000      0.967 1.000 0.000
#> GSM587208     1  0.0000      0.967 1.000 0.000
#> GSM587209     1  0.0938      0.956 0.988 0.012
#> GSM587210     1  0.1184      0.952 0.984 0.016
#> GSM587211     1  0.0000      0.967 1.000 0.000
#> GSM587212     1  0.0376      0.964 0.996 0.004
#> GSM587213     1  0.0000      0.967 1.000 0.000
#> GSM587214     1  0.0000      0.967 1.000 0.000
#> GSM587215     1  0.0000      0.967 1.000 0.000
#> GSM587216     1  0.0000      0.967 1.000 0.000
#> GSM587217     1  0.0000      0.967 1.000 0.000
#> GSM587191     2  0.9248      0.633 0.340 0.660
#> GSM587192     2  0.9248      0.633 0.340 0.660
#> GSM587193     2  0.8207      0.716 0.256 0.744
#> GSM587194     2  0.8207      0.716 0.256 0.744
#> GSM587195     2  0.9248      0.633 0.340 0.660
#> GSM587196     2  0.9248      0.633 0.340 0.660
#> GSM587197     2  0.9248      0.633 0.340 0.660
#> GSM587198     2  0.9286      0.627 0.344 0.656
#> GSM587199     2  0.9286      0.627 0.344 0.656
#> GSM587200     1  0.9944     -0.106 0.544 0.456
#> GSM587201     1  0.9944     -0.106 0.544 0.456
#> GSM587202     2  0.9286      0.627 0.344 0.656
#> GSM198767     1  0.0000      0.967 1.000 0.000
#> GSM198769     1  0.0938      0.956 0.988 0.012
#> GSM198772     1  0.0000      0.967 1.000 0.000
#> GSM198773     1  0.0000      0.967 1.000 0.000
#> GSM198776     1  0.0000      0.967 1.000 0.000
#> GSM198778     1  0.1184      0.952 0.984 0.016
#> GSM198780     1  0.0376      0.964 0.996 0.004
#> GSM198781     1  0.0000      0.967 1.000 0.000
#> GSM198765     2  0.9248      0.633 0.340 0.660
#> GSM198766     2  0.8207      0.716 0.256 0.744
#> GSM198768     2  0.9248      0.633 0.340 0.660
#> GSM198770     2  0.9248      0.633 0.340 0.660
#> GSM198771     2  0.9286      0.627 0.344 0.656
#> GSM198774     2  0.9248      0.633 0.340 0.660
#> GSM198775     2  0.8207      0.716 0.256 0.744
#> GSM198777     2  0.9248      0.633 0.340 0.660
#> GSM198779     2  0.9286      0.627 0.344 0.656
#> GSM587218     1  0.0000      0.967 1.000 0.000
#> GSM587219     1  0.0000      0.967 1.000 0.000
#> GSM587220     1  0.0000      0.967 1.000 0.000
#> GSM587221     1  0.0000      0.967 1.000 0.000
#> GSM587222     1  0.0000      0.967 1.000 0.000
#> GSM587223     1  0.0000      0.967 1.000 0.000
#> GSM587224     1  0.0000      0.967 1.000 0.000
#> GSM587225     1  0.0000      0.967 1.000 0.000
#> GSM587226     1  0.0000      0.967 1.000 0.000
#> GSM587227     1  0.0000      0.967 1.000 0.000
#> GSM587228     1  0.0000      0.967 1.000 0.000
#> GSM587229     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
#> GSM587155     2  0.0000      0.873 0.000 1.000 0.000
#> GSM587156     2  0.0237      0.872 0.004 0.996 0.000
#> GSM587157     2  0.0000      0.873 0.000 1.000 0.000
#> GSM587158     2  0.0000      0.873 0.000 1.000 0.000
#> GSM587159     2  0.0000      0.873 0.000 1.000 0.000
#> GSM587160     2  0.0000      0.873 0.000 1.000 0.000
#> GSM587161     2  0.0000      0.873 0.000 1.000 0.000
#> GSM587162     2  0.0000      0.873 0.000 1.000 0.000
#> GSM587163     2  0.0000      0.873 0.000 1.000 0.000
#> GSM587164     2  0.0000      0.873 0.000 1.000 0.000
#> GSM587165     2  0.0000      0.873 0.000 1.000 0.000
#> GSM587166     2  0.0237      0.872 0.004 0.996 0.000
#> GSM587167     2  0.0237      0.872 0.004 0.996 0.000
#> GSM587168     2  0.0000      0.873 0.000 1.000 0.000
#> GSM587169     2  0.0000      0.873 0.000 1.000 0.000
#> GSM587170     2  0.0000      0.873 0.000 1.000 0.000
#> GSM587171     2  0.0000      0.873 0.000 1.000 0.000
#> GSM587172     2  0.0000      0.873 0.000 1.000 0.000
#> GSM587173     2  0.0000      0.873 0.000 1.000 0.000
#> GSM587174     2  0.0000      0.873 0.000 1.000 0.000
#> GSM587175     2  0.0000      0.873 0.000 1.000 0.000
#> GSM587176     2  0.0000      0.873 0.000 1.000 0.000
#> GSM587177     2  0.0000      0.873 0.000 1.000 0.000
#> GSM587178     2  0.0000      0.873 0.000 1.000 0.000
#> GSM587179     2  0.0000      0.873 0.000 1.000 0.000
#> GSM587180     2  0.0000      0.873 0.000 1.000 0.000
#> GSM587181     2  0.0000      0.873 0.000 1.000 0.000
#> GSM587182     2  0.0000      0.873 0.000 1.000 0.000
#> GSM587183     2  0.0000      0.873 0.000 1.000 0.000
#> GSM587184     2  0.0000      0.873 0.000 1.000 0.000
#> GSM587185     2  0.0000      0.873 0.000 1.000 0.000
#> GSM587186     2  0.0000      0.873 0.000 1.000 0.000
#> GSM587187     2  0.0000      0.873 0.000 1.000 0.000
#> GSM587188     2  0.0000      0.873 0.000 1.000 0.000
#> GSM587189     2  0.0000      0.873 0.000 1.000 0.000
#> GSM587190     2  0.0237      0.872 0.004 0.996 0.000
#> GSM587203     1  0.4178      0.866 0.828 0.000 0.172
#> GSM587204     1  0.4178      0.866 0.828 0.000 0.172
#> GSM587205     1  0.4178      0.866 0.828 0.000 0.172
#> GSM587206     1  0.4178      0.866 0.828 0.000 0.172
#> GSM587207     1  0.4178      0.866 0.828 0.000 0.172
#> GSM587208     1  0.4178      0.866 0.828 0.000 0.172
#> GSM587209     1  0.2356      0.766 0.928 0.000 0.072
#> GSM587210     1  0.2165      0.698 0.936 0.000 0.064
#> GSM587211     1  0.4178      0.866 0.828 0.000 0.172
#> GSM587212     1  0.4062      0.813 0.836 0.000 0.164
#> GSM587213     1  0.4178      0.866 0.828 0.000 0.172
#> GSM587214     1  0.4178      0.866 0.828 0.000 0.172
#> GSM587215     1  0.4178      0.866 0.828 0.000 0.172
#> GSM587216     1  0.4178      0.866 0.828 0.000 0.172
#> GSM587217     1  0.4178      0.866 0.828 0.000 0.172
#> GSM587191     2  0.7327      0.679 0.312 0.636 0.052
#> GSM587192     2  0.7327      0.679 0.312 0.636 0.052
#> GSM587193     2  0.6586      0.743 0.216 0.728 0.056
#> GSM587194     2  0.6586      0.743 0.216 0.728 0.056
#> GSM587195     2  0.7327      0.679 0.312 0.636 0.052
#> GSM587196     2  0.7327      0.679 0.312 0.636 0.052
#> GSM587197     2  0.7327      0.679 0.312 0.636 0.052
#> GSM587198     2  0.7417      0.675 0.312 0.632 0.056
#> GSM587199     2  0.7417      0.675 0.312 0.632 0.056
#> GSM587200     1  0.7890     -0.275 0.512 0.432 0.056
#> GSM587201     1  0.7890     -0.275 0.512 0.432 0.056
#> GSM587202     2  0.7417      0.675 0.312 0.632 0.056
#> GSM198767     1  0.4178      0.866 0.828 0.000 0.172
#> GSM198769     1  0.2356      0.766 0.928 0.000 0.072
#> GSM198772     1  0.4178      0.866 0.828 0.000 0.172
#> GSM198773     1  0.4178      0.866 0.828 0.000 0.172
#> GSM198776     1  0.4178      0.866 0.828 0.000 0.172
#> GSM198778     1  0.2165      0.698 0.936 0.000 0.064
#> GSM198780     1  0.4062      0.813 0.836 0.000 0.164
#> GSM198781     1  0.4178      0.866 0.828 0.000 0.172
#> GSM198765     2  0.7327      0.679 0.312 0.636 0.052
#> GSM198766     2  0.6586      0.743 0.216 0.728 0.056
#> GSM198768     2  0.7327      0.679 0.312 0.636 0.052
#> GSM198770     2  0.7327      0.679 0.312 0.636 0.052
#> GSM198771     2  0.7417      0.675 0.312 0.632 0.056
#> GSM198774     2  0.7327      0.679 0.312 0.636 0.052
#> GSM198775     2  0.6586      0.743 0.216 0.728 0.056
#> GSM198777     2  0.7327      0.679 0.312 0.636 0.052
#> GSM198779     2  0.7417      0.675 0.312 0.632 0.056
#> GSM587218     3  0.0000      1.000 0.000 0.000 1.000
#> GSM587219     3  0.0000      1.000 0.000 0.000 1.000
#> GSM587220     3  0.0000      1.000 0.000 0.000 1.000
#> GSM587221     3  0.0000      1.000 0.000 0.000 1.000
#> GSM587222     3  0.0000      1.000 0.000 0.000 1.000
#> GSM587223     3  0.0000      1.000 0.000 0.000 1.000
#> GSM587224     3  0.0000      1.000 0.000 0.000 1.000
#> GSM587225     3  0.0000      1.000 0.000 0.000 1.000
#> GSM587226     3  0.0000      1.000 0.000 0.000 1.000
#> GSM587227     3  0.0000      1.000 0.000 0.000 1.000
#> GSM587228     3  0.0000      1.000 0.000 0.000 1.000
#> GSM587229     3  0.0000      1.000 0.000 0.000 1.000

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3 p4
#> GSM587155     2  0.0188      0.968 0.000 0.996 0.004  0
#> GSM587156     2  0.3837      0.728 0.000 0.776 0.224  0
#> GSM587157     2  0.0188      0.968 0.000 0.996 0.004  0
#> GSM587158     2  0.0000      0.970 0.000 1.000 0.000  0
#> GSM587159     2  0.0000      0.970 0.000 1.000 0.000  0
#> GSM587160     2  0.0000      0.970 0.000 1.000 0.000  0
#> GSM587161     2  0.0000      0.970 0.000 1.000 0.000  0
#> GSM587162     2  0.0000      0.970 0.000 1.000 0.000  0
#> GSM587163     2  0.0000      0.970 0.000 1.000 0.000  0
#> GSM587164     2  0.0188      0.968 0.000 0.996 0.004  0
#> GSM587165     2  0.0000      0.970 0.000 1.000 0.000  0
#> GSM587166     2  0.3837      0.728 0.000 0.776 0.224  0
#> GSM587167     2  0.3873      0.722 0.000 0.772 0.228  0
#> GSM587168     2  0.0000      0.970 0.000 1.000 0.000  0
#> GSM587169     2  0.0000      0.970 0.000 1.000 0.000  0
#> GSM587170     2  0.0188      0.968 0.000 0.996 0.004  0
#> GSM587171     2  0.0000      0.970 0.000 1.000 0.000  0
#> GSM587172     2  0.0000      0.970 0.000 1.000 0.000  0
#> GSM587173     2  0.0000      0.970 0.000 1.000 0.000  0
#> GSM587174     2  0.0000      0.970 0.000 1.000 0.000  0
#> GSM587175     2  0.0188      0.968 0.000 0.996 0.004  0
#> GSM587176     2  0.0000      0.970 0.000 1.000 0.000  0
#> GSM587177     2  0.0000      0.970 0.000 1.000 0.000  0
#> GSM587178     2  0.0000      0.970 0.000 1.000 0.000  0
#> GSM587179     2  0.0000      0.970 0.000 1.000 0.000  0
#> GSM587180     2  0.0000      0.970 0.000 1.000 0.000  0
#> GSM587181     2  0.0000      0.970 0.000 1.000 0.000  0
#> GSM587182     2  0.0000      0.970 0.000 1.000 0.000  0
#> GSM587183     2  0.0000      0.970 0.000 1.000 0.000  0
#> GSM587184     2  0.0000      0.970 0.000 1.000 0.000  0
#> GSM587185     2  0.0000      0.970 0.000 1.000 0.000  0
#> GSM587186     2  0.0000      0.970 0.000 1.000 0.000  0
#> GSM587187     2  0.0336      0.966 0.000 0.992 0.008  0
#> GSM587188     2  0.0469      0.964 0.000 0.988 0.012  0
#> GSM587189     2  0.0469      0.964 0.000 0.988 0.012  0
#> GSM587190     2  0.3942      0.716 0.000 0.764 0.236  0
#> GSM587203     1  0.0000      0.937 1.000 0.000 0.000  0
#> GSM587204     1  0.0000      0.937 1.000 0.000 0.000  0
#> GSM587205     1  0.0000      0.937 1.000 0.000 0.000  0
#> GSM587206     1  0.0000      0.937 1.000 0.000 0.000  0
#> GSM587207     1  0.0000      0.937 1.000 0.000 0.000  0
#> GSM587208     1  0.0000      0.937 1.000 0.000 0.000  0
#> GSM587209     1  0.3764      0.751 0.784 0.000 0.216  0
#> GSM587210     1  0.4477      0.617 0.688 0.000 0.312  0
#> GSM587211     1  0.0000      0.937 1.000 0.000 0.000  0
#> GSM587212     1  0.2281      0.873 0.904 0.000 0.096  0
#> GSM587213     1  0.0000      0.937 1.000 0.000 0.000  0
#> GSM587214     1  0.0000      0.937 1.000 0.000 0.000  0
#> GSM587215     1  0.0000      0.937 1.000 0.000 0.000  0
#> GSM587216     1  0.0000      0.937 1.000 0.000 0.000  0
#> GSM587217     1  0.0000      0.937 1.000 0.000 0.000  0
#> GSM587191     3  0.0336      0.945 0.000 0.008 0.992  0
#> GSM587192     3  0.0336      0.945 0.000 0.008 0.992  0
#> GSM587193     3  0.2593      0.866 0.004 0.104 0.892  0
#> GSM587194     3  0.2593      0.866 0.004 0.104 0.892  0
#> GSM587195     3  0.0469      0.945 0.000 0.012 0.988  0
#> GSM587196     3  0.0469      0.945 0.000 0.012 0.988  0
#> GSM587197     3  0.0469      0.945 0.000 0.012 0.988  0
#> GSM587198     3  0.0188      0.944 0.000 0.004 0.996  0
#> GSM587199     3  0.0188      0.944 0.000 0.004 0.996  0
#> GSM587200     3  0.3610      0.716 0.200 0.000 0.800  0
#> GSM587201     3  0.3610      0.716 0.200 0.000 0.800  0
#> GSM587202     3  0.0188      0.944 0.000 0.004 0.996  0
#> GSM198767     1  0.0000      0.937 1.000 0.000 0.000  0
#> GSM198769     1  0.3764      0.751 0.784 0.000 0.216  0
#> GSM198772     1  0.0000      0.937 1.000 0.000 0.000  0
#> GSM198773     1  0.0000      0.937 1.000 0.000 0.000  0
#> GSM198776     1  0.0000      0.937 1.000 0.000 0.000  0
#> GSM198778     1  0.4477      0.617 0.688 0.000 0.312  0
#> GSM198780     1  0.2281      0.873 0.904 0.000 0.096  0
#> GSM198781     1  0.0000      0.937 1.000 0.000 0.000  0
#> GSM198765     3  0.0336      0.945 0.000 0.008 0.992  0
#> GSM198766     3  0.2593      0.866 0.004 0.104 0.892  0
#> GSM198768     3  0.0469      0.945 0.000 0.012 0.988  0
#> GSM198770     3  0.0469      0.945 0.000 0.012 0.988  0
#> GSM198771     3  0.0188      0.944 0.000 0.004 0.996  0
#> GSM198774     3  0.0336      0.945 0.000 0.008 0.992  0
#> GSM198775     3  0.2593      0.866 0.004 0.104 0.892  0
#> GSM198777     3  0.0469      0.945 0.000 0.012 0.988  0
#> GSM198779     3  0.0188      0.944 0.000 0.004 0.996  0
#> GSM587218     4  0.0000      1.000 0.000 0.000 0.000  1
#> GSM587219     4  0.0000      1.000 0.000 0.000 0.000  1
#> GSM587220     4  0.0000      1.000 0.000 0.000 0.000  1
#> GSM587221     4  0.0000      1.000 0.000 0.000 0.000  1
#> GSM587222     4  0.0000      1.000 0.000 0.000 0.000  1
#> GSM587223     4  0.0000      1.000 0.000 0.000 0.000  1
#> GSM587224     4  0.0000      1.000 0.000 0.000 0.000  1
#> GSM587225     4  0.0000      1.000 0.000 0.000 0.000  1
#> GSM587226     4  0.0000      1.000 0.000 0.000 0.000  1
#> GSM587227     4  0.0000      1.000 0.000 0.000 0.000  1
#> GSM587228     4  0.0000      1.000 0.000 0.000 0.000  1
#> GSM587229     4  0.0000      1.000 0.000 0.000 0.000  1

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3 p4    p5
#> GSM587155     2  0.1478      0.868 0.000 0.936 0.000  0 0.064
#> GSM587156     5  0.4294      0.867 0.000 0.468 0.000  0 0.532
#> GSM587157     2  0.1478      0.871 0.000 0.936 0.000  0 0.064
#> GSM587158     2  0.0162      0.941 0.000 0.996 0.000  0 0.004
#> GSM587159     2  0.0162      0.941 0.000 0.996 0.000  0 0.004
#> GSM587160     2  0.0000      0.941 0.000 1.000 0.000  0 0.000
#> GSM587161     2  0.0000      0.941 0.000 1.000 0.000  0 0.000
#> GSM587162     2  0.0000      0.941 0.000 1.000 0.000  0 0.000
#> GSM587163     2  0.0000      0.941 0.000 1.000 0.000  0 0.000
#> GSM587164     2  0.1478      0.868 0.000 0.936 0.000  0 0.064
#> GSM587165     2  0.0162      0.941 0.000 0.996 0.000  0 0.004
#> GSM587166     5  0.4294      0.867 0.000 0.468 0.000  0 0.532
#> GSM587167     5  0.4287      0.867 0.000 0.460 0.000  0 0.540
#> GSM587168     2  0.0000      0.941 0.000 1.000 0.000  0 0.000
#> GSM587169     2  0.0000      0.941 0.000 1.000 0.000  0 0.000
#> GSM587170     2  0.1478      0.868 0.000 0.936 0.000  0 0.064
#> GSM587171     2  0.0162      0.941 0.000 0.996 0.000  0 0.004
#> GSM587172     2  0.0162      0.941 0.000 0.996 0.000  0 0.004
#> GSM587173     2  0.0162      0.941 0.000 0.996 0.000  0 0.004
#> GSM587174     2  0.0000      0.941 0.000 1.000 0.000  0 0.000
#> GSM587175     2  0.1478      0.871 0.000 0.936 0.000  0 0.064
#> GSM587176     2  0.0510      0.927 0.000 0.984 0.000  0 0.016
#> GSM587177     2  0.0162      0.941 0.000 0.996 0.000  0 0.004
#> GSM587178     2  0.0162      0.941 0.000 0.996 0.000  0 0.004
#> GSM587179     2  0.0000      0.941 0.000 1.000 0.000  0 0.000
#> GSM587180     2  0.0000      0.941 0.000 1.000 0.000  0 0.000
#> GSM587181     2  0.0000      0.941 0.000 1.000 0.000  0 0.000
#> GSM587182     2  0.0000      0.941 0.000 1.000 0.000  0 0.000
#> GSM587183     2  0.0162      0.941 0.000 0.996 0.000  0 0.004
#> GSM587184     2  0.0162      0.941 0.000 0.996 0.000  0 0.004
#> GSM587185     2  0.0000      0.941 0.000 1.000 0.000  0 0.000
#> GSM587186     2  0.0162      0.941 0.000 0.996 0.000  0 0.004
#> GSM587187     2  0.2929      0.640 0.000 0.820 0.000  0 0.180
#> GSM587188     2  0.3837      0.319 0.000 0.692 0.000  0 0.308
#> GSM587189     2  0.3074      0.604 0.000 0.804 0.000  0 0.196
#> GSM587190     5  0.3636      0.704 0.000 0.272 0.000  0 0.728
#> GSM587203     1  0.0000      0.935 1.000 0.000 0.000  0 0.000
#> GSM587204     1  0.0000      0.935 1.000 0.000 0.000  0 0.000
#> GSM587205     1  0.0000      0.935 1.000 0.000 0.000  0 0.000
#> GSM587206     1  0.0000      0.935 1.000 0.000 0.000  0 0.000
#> GSM587207     1  0.0000      0.935 1.000 0.000 0.000  0 0.000
#> GSM587208     1  0.0000      0.935 1.000 0.000 0.000  0 0.000
#> GSM587209     1  0.3242      0.731 0.784 0.000 0.216  0 0.000
#> GSM587210     1  0.3857      0.583 0.688 0.000 0.312  0 0.000
#> GSM587211     1  0.0000      0.935 1.000 0.000 0.000  0 0.000
#> GSM587212     1  0.1965      0.864 0.904 0.000 0.096  0 0.000
#> GSM587213     1  0.0000      0.935 1.000 0.000 0.000  0 0.000
#> GSM587214     1  0.0000      0.935 1.000 0.000 0.000  0 0.000
#> GSM587215     1  0.0000      0.935 1.000 0.000 0.000  0 0.000
#> GSM587216     1  0.0000      0.935 1.000 0.000 0.000  0 0.000
#> GSM587217     1  0.0000      0.935 1.000 0.000 0.000  0 0.000
#> GSM587191     3  0.1043      0.862 0.000 0.000 0.960  0 0.040
#> GSM587192     3  0.1043      0.862 0.000 0.000 0.960  0 0.040
#> GSM587193     3  0.4211      0.624 0.004 0.000 0.636  0 0.360
#> GSM587194     3  0.4211      0.624 0.004 0.000 0.636  0 0.360
#> GSM587195     3  0.2377      0.840 0.000 0.000 0.872  0 0.128
#> GSM587196     3  0.2377      0.840 0.000 0.000 0.872  0 0.128
#> GSM587197     3  0.2377      0.840 0.000 0.000 0.872  0 0.128
#> GSM587198     3  0.0000      0.864 0.000 0.000 1.000  0 0.000
#> GSM587199     3  0.0000      0.864 0.000 0.000 1.000  0 0.000
#> GSM587200     3  0.3266      0.704 0.200 0.000 0.796  0 0.004
#> GSM587201     3  0.3266      0.704 0.200 0.000 0.796  0 0.004
#> GSM587202     3  0.0000      0.864 0.000 0.000 1.000  0 0.000
#> GSM198767     1  0.0000      0.935 1.000 0.000 0.000  0 0.000
#> GSM198769     1  0.3242      0.731 0.784 0.000 0.216  0 0.000
#> GSM198772     1  0.0000      0.935 1.000 0.000 0.000  0 0.000
#> GSM198773     1  0.0000      0.935 1.000 0.000 0.000  0 0.000
#> GSM198776     1  0.0000      0.935 1.000 0.000 0.000  0 0.000
#> GSM198778     1  0.3857      0.583 0.688 0.000 0.312  0 0.000
#> GSM198780     1  0.1965      0.864 0.904 0.000 0.096  0 0.000
#> GSM198781     1  0.0000      0.935 1.000 0.000 0.000  0 0.000
#> GSM198765     3  0.1043      0.862 0.000 0.000 0.960  0 0.040
#> GSM198766     3  0.4211      0.624 0.004 0.000 0.636  0 0.360
#> GSM198768     3  0.2377      0.840 0.000 0.000 0.872  0 0.128
#> GSM198770     3  0.2377      0.840 0.000 0.000 0.872  0 0.128
#> GSM198771     3  0.0000      0.864 0.000 0.000 1.000  0 0.000
#> GSM198774     3  0.1043      0.862 0.000 0.000 0.960  0 0.040
#> GSM198775     3  0.4211      0.624 0.004 0.000 0.636  0 0.360
#> GSM198777     3  0.2377      0.840 0.000 0.000 0.872  0 0.128
#> GSM198779     3  0.0000      0.864 0.000 0.000 1.000  0 0.000
#> GSM587218     4  0.0000      1.000 0.000 0.000 0.000  1 0.000
#> GSM587219     4  0.0000      1.000 0.000 0.000 0.000  1 0.000
#> GSM587220     4  0.0000      1.000 0.000 0.000 0.000  1 0.000
#> GSM587221     4  0.0000      1.000 0.000 0.000 0.000  1 0.000
#> GSM587222     4  0.0000      1.000 0.000 0.000 0.000  1 0.000
#> GSM587223     4  0.0000      1.000 0.000 0.000 0.000  1 0.000
#> GSM587224     4  0.0000      1.000 0.000 0.000 0.000  1 0.000
#> GSM587225     4  0.0000      1.000 0.000 0.000 0.000  1 0.000
#> GSM587226     4  0.0000      1.000 0.000 0.000 0.000  1 0.000
#> GSM587227     4  0.0000      1.000 0.000 0.000 0.000  1 0.000
#> GSM587228     4  0.0000      1.000 0.000 0.000 0.000  1 0.000
#> GSM587229     4  0.0000      1.000 0.000 0.000 0.000  1 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3 p4    p5    p6
#> GSM587155     2  0.2527     0.7499 0.000 0.832 0.000  0 0.168 0.000
#> GSM587156     5  0.3330     0.8842 0.000 0.284 0.000  0 0.716 0.000
#> GSM587157     2  0.2389     0.7967 0.000 0.864 0.000  0 0.128 0.008
#> GSM587158     2  0.0146     0.9227 0.000 0.996 0.000  0 0.004 0.000
#> GSM587159     2  0.0146     0.9227 0.000 0.996 0.000  0 0.004 0.000
#> GSM587160     2  0.0146     0.9224 0.000 0.996 0.000  0 0.004 0.000
#> GSM587161     2  0.0146     0.9224 0.000 0.996 0.000  0 0.004 0.000
#> GSM587162     2  0.0363     0.9183 0.000 0.988 0.000  0 0.012 0.000
#> GSM587163     2  0.0146     0.9224 0.000 0.996 0.000  0 0.004 0.000
#> GSM587164     2  0.2527     0.7499 0.000 0.832 0.000  0 0.168 0.000
#> GSM587165     2  0.0146     0.9227 0.000 0.996 0.000  0 0.004 0.000
#> GSM587166     5  0.3330     0.8842 0.000 0.284 0.000  0 0.716 0.000
#> GSM587167     5  0.3534     0.8821 0.000 0.276 0.008  0 0.716 0.000
#> GSM587168     2  0.0146     0.9223 0.000 0.996 0.000  0 0.004 0.000
#> GSM587169     2  0.0146     0.9224 0.000 0.996 0.000  0 0.004 0.000
#> GSM587170     2  0.2527     0.7499 0.000 0.832 0.000  0 0.168 0.000
#> GSM587171     2  0.0146     0.9227 0.000 0.996 0.000  0 0.004 0.000
#> GSM587172     2  0.0146     0.9227 0.000 0.996 0.000  0 0.004 0.000
#> GSM587173     2  0.0260     0.9208 0.000 0.992 0.000  0 0.008 0.000
#> GSM587174     2  0.0146     0.9224 0.000 0.996 0.000  0 0.004 0.000
#> GSM587175     2  0.2389     0.7967 0.000 0.864 0.000  0 0.128 0.008
#> GSM587176     2  0.1501     0.8631 0.000 0.924 0.000  0 0.076 0.000
#> GSM587177     2  0.0260     0.9208 0.000 0.992 0.000  0 0.008 0.000
#> GSM587178     2  0.0146     0.9227 0.000 0.996 0.000  0 0.004 0.000
#> GSM587179     2  0.0146     0.9224 0.000 0.996 0.000  0 0.004 0.000
#> GSM587180     2  0.0000     0.9228 0.000 1.000 0.000  0 0.000 0.000
#> GSM587181     2  0.0146     0.9224 0.000 0.996 0.000  0 0.004 0.000
#> GSM587182     2  0.0000     0.9228 0.000 1.000 0.000  0 0.000 0.000
#> GSM587183     2  0.0146     0.9227 0.000 0.996 0.000  0 0.004 0.000
#> GSM587184     2  0.0146     0.9227 0.000 0.996 0.000  0 0.004 0.000
#> GSM587185     2  0.0146     0.9224 0.000 0.996 0.000  0 0.004 0.000
#> GSM587186     2  0.0260     0.9208 0.000 0.992 0.000  0 0.008 0.000
#> GSM587187     2  0.2664     0.7104 0.000 0.816 0.000  0 0.184 0.000
#> GSM587188     2  0.5640     0.0879 0.000 0.528 0.000  0 0.280 0.192
#> GSM587189     2  0.2980     0.6856 0.000 0.800 0.008  0 0.192 0.000
#> GSM587190     5  0.1918     0.6225 0.000 0.088 0.008  0 0.904 0.000
#> GSM587203     1  0.0000     0.9095 1.000 0.000 0.000  0 0.000 0.000
#> GSM587204     1  0.0000     0.9095 1.000 0.000 0.000  0 0.000 0.000
#> GSM587205     1  0.0000     0.9095 1.000 0.000 0.000  0 0.000 0.000
#> GSM587206     1  0.0000     0.9095 1.000 0.000 0.000  0 0.000 0.000
#> GSM587207     1  0.0000     0.9095 1.000 0.000 0.000  0 0.000 0.000
#> GSM587208     1  0.0000     0.9095 1.000 0.000 0.000  0 0.000 0.000
#> GSM587209     1  0.4781     0.4855 0.624 0.000 0.080  0 0.000 0.296
#> GSM587210     1  0.5059     0.3112 0.528 0.000 0.080  0 0.000 0.392
#> GSM587211     1  0.0000     0.9095 1.000 0.000 0.000  0 0.000 0.000
#> GSM587212     1  0.1765     0.8331 0.904 0.000 0.000  0 0.000 0.096
#> GSM587213     1  0.0000     0.9095 1.000 0.000 0.000  0 0.000 0.000
#> GSM587214     1  0.0000     0.9095 1.000 0.000 0.000  0 0.000 0.000
#> GSM587215     1  0.0000     0.9095 1.000 0.000 0.000  0 0.000 0.000
#> GSM587216     1  0.0260     0.9049 0.992 0.000 0.000  0 0.000 0.008
#> GSM587217     1  0.0000     0.9095 1.000 0.000 0.000  0 0.000 0.000
#> GSM587191     3  0.2362     0.5059 0.000 0.000 0.860  0 0.004 0.136
#> GSM587192     3  0.2362     0.5059 0.000 0.000 0.860  0 0.004 0.136
#> GSM587193     3  0.5962     0.0371 0.000 0.000 0.436  0 0.328 0.236
#> GSM587194     3  0.5962     0.0371 0.000 0.000 0.436  0 0.328 0.236
#> GSM587195     3  0.2340     0.5205 0.000 0.000 0.852  0 0.000 0.148
#> GSM587196     3  0.2340     0.5205 0.000 0.000 0.852  0 0.000 0.148
#> GSM587197     3  0.2340     0.5205 0.000 0.000 0.852  0 0.000 0.148
#> GSM587198     3  0.2340     0.4094 0.000 0.000 0.852  0 0.000 0.148
#> GSM587199     3  0.2340     0.4094 0.000 0.000 0.852  0 0.000 0.148
#> GSM587200     6  0.4589     1.0000 0.036 0.000 0.460  0 0.000 0.504
#> GSM587201     6  0.4589     1.0000 0.036 0.000 0.460  0 0.000 0.504
#> GSM587202     3  0.2340     0.4094 0.000 0.000 0.852  0 0.000 0.148
#> GSM198767     1  0.0000     0.9095 1.000 0.000 0.000  0 0.000 0.000
#> GSM198769     1  0.4781     0.4855 0.624 0.000 0.080  0 0.000 0.296
#> GSM198772     1  0.0000     0.9095 1.000 0.000 0.000  0 0.000 0.000
#> GSM198773     1  0.0000     0.9095 1.000 0.000 0.000  0 0.000 0.000
#> GSM198776     1  0.0000     0.9095 1.000 0.000 0.000  0 0.000 0.000
#> GSM198778     1  0.5059     0.3112 0.528 0.000 0.080  0 0.000 0.392
#> GSM198780     1  0.1765     0.8331 0.904 0.000 0.000  0 0.000 0.096
#> GSM198781     1  0.0000     0.9095 1.000 0.000 0.000  0 0.000 0.000
#> GSM198765     3  0.2362     0.5059 0.000 0.000 0.860  0 0.004 0.136
#> GSM198766     3  0.5962     0.0371 0.000 0.000 0.436  0 0.328 0.236
#> GSM198768     3  0.2340     0.5205 0.000 0.000 0.852  0 0.000 0.148
#> GSM198770     3  0.2340     0.5205 0.000 0.000 0.852  0 0.000 0.148
#> GSM198771     3  0.2340     0.4094 0.000 0.000 0.852  0 0.000 0.148
#> GSM198774     3  0.2362     0.5059 0.000 0.000 0.860  0 0.004 0.136
#> GSM198775     3  0.5962     0.0371 0.000 0.000 0.436  0 0.328 0.236
#> GSM198777     3  0.2340     0.5205 0.000 0.000 0.852  0 0.000 0.148
#> GSM198779     3  0.2340     0.4094 0.000 0.000 0.852  0 0.000 0.148
#> GSM587218     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587219     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587220     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587221     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587222     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587223     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587224     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587225     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587226     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587227     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587228     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587229     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000 0.000

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

consensus_heatmap(res, k = 2)

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

consensus_heatmap(res, k = 3)

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

consensus_heatmap(res, k = 4)

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

consensus_heatmap(res, k = 5)

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

consensus_heatmap(res, k = 6)

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

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

membership_heatmap(res, k = 2)

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

membership_heatmap(res, k = 3)

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

membership_heatmap(res, k = 4)

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

membership_heatmap(res, k = 5)

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

membership_heatmap(res, k = 6)

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

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

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

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 specimen(p) k
#> CV:hclust 90    3.03e-17 2
#> CV:hclust 90    4.27e-32 3
#> CV:hclust 92    4.04e-48 4
#> CV:hclust 91    6.79e-45 5
#> CV:hclust 78    2.81e-36 6

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


CV:kmeans

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

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

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

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

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

collect_plots(res)

plot of chunk CV-kmeans-collect-plots

The plots are:

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

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

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

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

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.719           0.904       0.933         0.4695 0.500   0.500
#> 3 3 0.670           0.882       0.873         0.3473 0.793   0.605
#> 4 4 0.833           0.934       0.882         0.1199 0.934   0.806
#> 5 5 0.759           0.858       0.837         0.0706 1.000   1.000
#> 6 6 0.789           0.641       0.767         0.0436 0.984   0.942

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
#> GSM587155     2   0.000      0.932 0.000 1.000
#> GSM587156     2   0.000      0.932 0.000 1.000
#> GSM587157     2   0.000      0.932 0.000 1.000
#> GSM587158     2   0.000      0.932 0.000 1.000
#> GSM587159     2   0.000      0.932 0.000 1.000
#> GSM587160     2   0.000      0.932 0.000 1.000
#> GSM587161     2   0.000      0.932 0.000 1.000
#> GSM587162     2   0.000      0.932 0.000 1.000
#> GSM587163     2   0.000      0.932 0.000 1.000
#> GSM587164     2   0.000      0.932 0.000 1.000
#> GSM587165     2   0.000      0.932 0.000 1.000
#> GSM587166     2   0.000      0.932 0.000 1.000
#> GSM587167     2   0.000      0.932 0.000 1.000
#> GSM587168     2   0.000      0.932 0.000 1.000
#> GSM587169     2   0.000      0.932 0.000 1.000
#> GSM587170     2   0.000      0.932 0.000 1.000
#> GSM587171     2   0.000      0.932 0.000 1.000
#> GSM587172     2   0.000      0.932 0.000 1.000
#> GSM587173     2   0.000      0.932 0.000 1.000
#> GSM587174     2   0.000      0.932 0.000 1.000
#> GSM587175     2   0.000      0.932 0.000 1.000
#> GSM587176     2   0.000      0.932 0.000 1.000
#> GSM587177     2   0.000      0.932 0.000 1.000
#> GSM587178     2   0.000      0.932 0.000 1.000
#> GSM587179     2   0.000      0.932 0.000 1.000
#> GSM587180     2   0.000      0.932 0.000 1.000
#> GSM587181     2   0.000      0.932 0.000 1.000
#> GSM587182     2   0.000      0.932 0.000 1.000
#> GSM587183     2   0.000      0.932 0.000 1.000
#> GSM587184     2   0.000      0.932 0.000 1.000
#> GSM587185     2   0.000      0.932 0.000 1.000
#> GSM587186     2   0.000      0.932 0.000 1.000
#> GSM587187     2   0.000      0.932 0.000 1.000
#> GSM587188     2   0.000      0.932 0.000 1.000
#> GSM587189     2   0.000      0.932 0.000 1.000
#> GSM587190     2   0.000      0.932 0.000 1.000
#> GSM587203     1   0.456      0.949 0.904 0.096
#> GSM587204     1   0.456      0.949 0.904 0.096
#> GSM587205     1   0.456      0.949 0.904 0.096
#> GSM587206     1   0.456      0.949 0.904 0.096
#> GSM587207     1   0.456      0.949 0.904 0.096
#> GSM587208     1   0.456      0.949 0.904 0.096
#> GSM587209     1   0.456      0.949 0.904 0.096
#> GSM587210     1   0.456      0.949 0.904 0.096
#> GSM587211     1   0.456      0.949 0.904 0.096
#> GSM587212     1   0.456      0.949 0.904 0.096
#> GSM587213     1   0.456      0.949 0.904 0.096
#> GSM587214     1   0.456      0.949 0.904 0.096
#> GSM587215     1   0.456      0.949 0.904 0.096
#> GSM587216     1   0.456      0.949 0.904 0.096
#> GSM587217     1   0.456      0.949 0.904 0.096
#> GSM587191     2   0.714      0.799 0.196 0.804
#> GSM587192     1   0.921      0.565 0.664 0.336
#> GSM587193     1   0.456      0.949 0.904 0.096
#> GSM587194     2   0.697      0.806 0.188 0.812
#> GSM587195     2   0.714      0.799 0.196 0.804
#> GSM587196     2   0.714      0.799 0.196 0.804
#> GSM587197     2   0.714      0.799 0.196 0.804
#> GSM587198     2   0.714      0.799 0.196 0.804
#> GSM587199     2   0.680      0.813 0.180 0.820
#> GSM587200     1   0.456      0.949 0.904 0.096
#> GSM587201     1   0.456      0.949 0.904 0.096
#> GSM587202     2   0.714      0.799 0.196 0.804
#> GSM198767     1   0.456      0.949 0.904 0.096
#> GSM198769     1   0.456      0.949 0.904 0.096
#> GSM198772     1   0.456      0.949 0.904 0.096
#> GSM198773     1   0.456      0.949 0.904 0.096
#> GSM198776     1   0.456      0.949 0.904 0.096
#> GSM198778     1   0.456      0.949 0.904 0.096
#> GSM198780     1   0.456      0.949 0.904 0.096
#> GSM198781     1   0.456      0.949 0.904 0.096
#> GSM198765     2   0.714      0.799 0.196 0.804
#> GSM198766     1   0.456      0.949 0.904 0.096
#> GSM198768     2   0.714      0.799 0.196 0.804
#> GSM198770     2   0.714      0.799 0.196 0.804
#> GSM198771     2   0.714      0.799 0.196 0.804
#> GSM198774     1   0.921      0.565 0.664 0.336
#> GSM198775     2   0.697      0.806 0.188 0.812
#> GSM198777     2   0.714      0.799 0.196 0.804
#> GSM198779     2   0.680      0.813 0.180 0.820
#> GSM587218     1   0.000      0.906 1.000 0.000
#> GSM587219     1   0.000      0.906 1.000 0.000
#> GSM587220     1   0.000      0.906 1.000 0.000
#> GSM587221     1   0.000      0.906 1.000 0.000
#> GSM587222     1   0.000      0.906 1.000 0.000
#> GSM587223     1   0.000      0.906 1.000 0.000
#> GSM587224     1   0.000      0.906 1.000 0.000
#> GSM587225     1   0.000      0.906 1.000 0.000
#> GSM587226     1   0.000      0.906 1.000 0.000
#> GSM587227     1   0.000      0.906 1.000 0.000
#> GSM587228     1   0.000      0.906 1.000 0.000
#> GSM587229     1   0.000      0.906 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
#> GSM587155     2  0.0000      0.997 0.000 1.000 0.000
#> GSM587156     2  0.0000      0.997 0.000 1.000 0.000
#> GSM587157     2  0.0000      0.997 0.000 1.000 0.000
#> GSM587158     2  0.0000      0.997 0.000 1.000 0.000
#> GSM587159     2  0.0000      0.997 0.000 1.000 0.000
#> GSM587160     2  0.0000      0.997 0.000 1.000 0.000
#> GSM587161     2  0.0000      0.997 0.000 1.000 0.000
#> GSM587162     2  0.0000      0.997 0.000 1.000 0.000
#> GSM587163     2  0.0000      0.997 0.000 1.000 0.000
#> GSM587164     2  0.0000      0.997 0.000 1.000 0.000
#> GSM587165     2  0.0424      0.995 0.000 0.992 0.008
#> GSM587166     2  0.0237      0.994 0.000 0.996 0.004
#> GSM587167     2  0.0000      0.997 0.000 1.000 0.000
#> GSM587168     2  0.0424      0.995 0.000 0.992 0.008
#> GSM587169     2  0.0000      0.997 0.000 1.000 0.000
#> GSM587170     2  0.0000      0.997 0.000 1.000 0.000
#> GSM587171     2  0.0000      0.997 0.000 1.000 0.000
#> GSM587172     2  0.0000      0.997 0.000 1.000 0.000
#> GSM587173     2  0.0424      0.995 0.000 0.992 0.008
#> GSM587174     2  0.0237      0.996 0.000 0.996 0.004
#> GSM587175     2  0.0000      0.997 0.000 1.000 0.000
#> GSM587176     2  0.0000      0.997 0.000 1.000 0.000
#> GSM587177     2  0.0424      0.995 0.000 0.992 0.008
#> GSM587178     2  0.0424      0.995 0.000 0.992 0.008
#> GSM587179     2  0.0000      0.997 0.000 1.000 0.000
#> GSM587180     2  0.0424      0.995 0.000 0.992 0.008
#> GSM587181     2  0.0237      0.996 0.000 0.996 0.004
#> GSM587182     2  0.0424      0.995 0.000 0.992 0.008
#> GSM587183     2  0.0424      0.995 0.000 0.992 0.008
#> GSM587184     2  0.0000      0.997 0.000 1.000 0.000
#> GSM587185     2  0.0000      0.997 0.000 1.000 0.000
#> GSM587186     2  0.0424      0.995 0.000 0.992 0.008
#> GSM587187     2  0.0424      0.995 0.000 0.992 0.008
#> GSM587188     2  0.0424      0.995 0.000 0.992 0.008
#> GSM587189     2  0.0424      0.995 0.000 0.992 0.008
#> GSM587190     3  0.5835      0.737 0.000 0.340 0.660
#> GSM587203     1  0.0829      0.850 0.984 0.012 0.004
#> GSM587204     1  0.0829      0.850 0.984 0.012 0.004
#> GSM587205     1  0.0829      0.850 0.984 0.012 0.004
#> GSM587206     1  0.0829      0.850 0.984 0.012 0.004
#> GSM587207     1  0.0829      0.850 0.984 0.012 0.004
#> GSM587208     1  0.0829      0.850 0.984 0.012 0.004
#> GSM587209     1  0.1015      0.847 0.980 0.012 0.008
#> GSM587210     1  0.2116      0.836 0.948 0.012 0.040
#> GSM587211     1  0.1182      0.845 0.976 0.012 0.012
#> GSM587212     1  0.1999      0.838 0.952 0.012 0.036
#> GSM587213     1  0.0592      0.850 0.988 0.012 0.000
#> GSM587214     1  0.0592      0.850 0.988 0.012 0.000
#> GSM587215     1  0.1182      0.845 0.976 0.012 0.012
#> GSM587216     1  0.1182      0.845 0.976 0.012 0.012
#> GSM587217     1  0.0592      0.850 0.988 0.012 0.000
#> GSM587191     3  0.7265      0.897 0.076 0.240 0.684
#> GSM587192     3  0.7339      0.767 0.224 0.088 0.688
#> GSM587193     3  0.6143      0.657 0.304 0.012 0.684
#> GSM587194     3  0.7306      0.897 0.080 0.236 0.684
#> GSM587195     3  0.7381      0.897 0.080 0.244 0.676
#> GSM587196     3  0.7381      0.897 0.080 0.244 0.676
#> GSM587197     3  0.7381      0.897 0.080 0.244 0.676
#> GSM587198     3  0.7344      0.898 0.080 0.240 0.680
#> GSM587199     3  0.7112      0.877 0.060 0.260 0.680
#> GSM587200     3  0.6143      0.657 0.304 0.012 0.684
#> GSM587201     3  0.6143      0.657 0.304 0.012 0.684
#> GSM587202     3  0.7344      0.898 0.080 0.240 0.680
#> GSM198767     1  0.0829      0.850 0.984 0.012 0.004
#> GSM198769     1  0.1015      0.847 0.980 0.012 0.008
#> GSM198772     1  0.1182      0.845 0.976 0.012 0.012
#> GSM198773     1  0.0592      0.850 0.988 0.012 0.000
#> GSM198776     1  0.0829      0.850 0.984 0.012 0.004
#> GSM198778     1  0.2116      0.836 0.948 0.012 0.040
#> GSM198780     1  0.1999      0.838 0.952 0.012 0.036
#> GSM198781     1  0.0592      0.850 0.988 0.012 0.000
#> GSM198765     3  0.7265      0.897 0.076 0.240 0.684
#> GSM198766     3  0.6143      0.657 0.304 0.012 0.684
#> GSM198768     3  0.7381      0.897 0.080 0.244 0.676
#> GSM198770     3  0.7381      0.897 0.080 0.244 0.676
#> GSM198771     3  0.7344      0.898 0.080 0.240 0.680
#> GSM198774     3  0.7339      0.767 0.224 0.088 0.688
#> GSM198775     3  0.7306      0.897 0.080 0.236 0.684
#> GSM198777     3  0.7381      0.897 0.080 0.244 0.676
#> GSM198779     3  0.7112      0.877 0.060 0.260 0.680
#> GSM587218     1  0.6062      0.712 0.616 0.000 0.384
#> GSM587219     1  0.6079      0.712 0.612 0.000 0.388
#> GSM587220     1  0.6079      0.712 0.612 0.000 0.388
#> GSM587221     1  0.6079      0.712 0.612 0.000 0.388
#> GSM587222     1  0.6079      0.712 0.612 0.000 0.388
#> GSM587223     1  0.6062      0.712 0.616 0.000 0.384
#> GSM587224     1  0.6079      0.712 0.612 0.000 0.388
#> GSM587225     1  0.6111      0.712 0.604 0.000 0.396
#> GSM587226     1  0.6079      0.712 0.612 0.000 0.388
#> GSM587227     1  0.6095      0.712 0.608 0.000 0.392
#> GSM587228     1  0.6095      0.712 0.608 0.000 0.392
#> GSM587229     1  0.6095      0.712 0.608 0.000 0.392

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM587155     2  0.2921      0.888 0.000 0.860 0.000 0.140
#> GSM587156     2  0.3356      0.863 0.000 0.824 0.000 0.176
#> GSM587157     2  0.2921      0.888 0.000 0.860 0.000 0.140
#> GSM587158     2  0.0000      0.940 0.000 1.000 0.000 0.000
#> GSM587159     2  0.0000      0.940 0.000 1.000 0.000 0.000
#> GSM587160     2  0.0000      0.940 0.000 1.000 0.000 0.000
#> GSM587161     2  0.1389      0.929 0.000 0.952 0.000 0.048
#> GSM587162     2  0.0707      0.937 0.000 0.980 0.000 0.020
#> GSM587163     2  0.0000      0.940 0.000 1.000 0.000 0.000
#> GSM587164     2  0.2921      0.888 0.000 0.860 0.000 0.140
#> GSM587165     2  0.2197      0.928 0.000 0.916 0.004 0.080
#> GSM587166     2  0.3539      0.860 0.000 0.820 0.004 0.176
#> GSM587167     2  0.3074      0.880 0.000 0.848 0.000 0.152
#> GSM587168     2  0.2197      0.928 0.000 0.916 0.004 0.080
#> GSM587169     2  0.0000      0.940 0.000 1.000 0.000 0.000
#> GSM587170     2  0.2921      0.888 0.000 0.860 0.000 0.140
#> GSM587171     2  0.0000      0.940 0.000 1.000 0.000 0.000
#> GSM587172     2  0.0000      0.940 0.000 1.000 0.000 0.000
#> GSM587173     2  0.2197      0.928 0.000 0.916 0.004 0.080
#> GSM587174     2  0.0817      0.939 0.000 0.976 0.000 0.024
#> GSM587175     2  0.2921      0.888 0.000 0.860 0.000 0.140
#> GSM587176     2  0.0921      0.936 0.000 0.972 0.000 0.028
#> GSM587177     2  0.2197      0.928 0.000 0.916 0.004 0.080
#> GSM587178     2  0.2011      0.929 0.000 0.920 0.000 0.080
#> GSM587179     2  0.0469      0.939 0.000 0.988 0.000 0.012
#> GSM587180     2  0.2125      0.929 0.000 0.920 0.004 0.076
#> GSM587181     2  0.0817      0.939 0.000 0.976 0.000 0.024
#> GSM587182     2  0.1940      0.930 0.000 0.924 0.000 0.076
#> GSM587183     2  0.2197      0.928 0.000 0.916 0.004 0.080
#> GSM587184     2  0.0188      0.940 0.000 0.996 0.000 0.004
#> GSM587185     2  0.0469      0.939 0.000 0.988 0.000 0.012
#> GSM587186     2  0.2197      0.928 0.000 0.916 0.004 0.080
#> GSM587187     2  0.2266      0.926 0.000 0.912 0.004 0.084
#> GSM587188     2  0.2401      0.923 0.000 0.904 0.004 0.092
#> GSM587189     2  0.2654      0.924 0.000 0.888 0.004 0.108
#> GSM587190     3  0.5222      0.836 0.000 0.112 0.756 0.132
#> GSM587203     1  0.1697      0.948 0.952 0.004 0.016 0.028
#> GSM587204     1  0.1697      0.948 0.952 0.004 0.016 0.028
#> GSM587205     1  0.1697      0.948 0.952 0.004 0.016 0.028
#> GSM587206     1  0.1697      0.948 0.952 0.004 0.016 0.028
#> GSM587207     1  0.1697      0.948 0.952 0.004 0.016 0.028
#> GSM587208     1  0.1697      0.948 0.952 0.004 0.016 0.028
#> GSM587209     1  0.0524      0.956 0.988 0.004 0.008 0.000
#> GSM587210     1  0.2053      0.883 0.924 0.004 0.072 0.000
#> GSM587211     1  0.0524      0.956 0.988 0.004 0.008 0.000
#> GSM587212     1  0.1398      0.927 0.956 0.004 0.040 0.000
#> GSM587213     1  0.0844      0.956 0.980 0.004 0.004 0.012
#> GSM587214     1  0.0844      0.956 0.980 0.004 0.004 0.012
#> GSM587215     1  0.0524      0.956 0.988 0.004 0.008 0.000
#> GSM587216     1  0.0524      0.956 0.988 0.004 0.008 0.000
#> GSM587217     1  0.0524      0.956 0.988 0.004 0.008 0.000
#> GSM587191     3  0.4254      0.932 0.036 0.056 0.848 0.060
#> GSM587192     3  0.3938      0.904 0.080 0.008 0.852 0.060
#> GSM587193     3  0.4457      0.883 0.108 0.004 0.816 0.072
#> GSM587194     3  0.4918      0.922 0.040 0.064 0.812 0.084
#> GSM587195     3  0.3720      0.939 0.032 0.064 0.872 0.032
#> GSM587196     3  0.3720      0.939 0.032 0.064 0.872 0.032
#> GSM587197     3  0.3813      0.940 0.032 0.064 0.868 0.036
#> GSM587198     3  0.2722      0.941 0.032 0.064 0.904 0.000
#> GSM587199     3  0.2635      0.935 0.020 0.076 0.904 0.000
#> GSM587200     3  0.3109      0.902 0.100 0.004 0.880 0.016
#> GSM587201     3  0.3109      0.902 0.100 0.004 0.880 0.016
#> GSM587202     3  0.2722      0.941 0.032 0.064 0.904 0.000
#> GSM198767     1  0.1697      0.948 0.952 0.004 0.016 0.028
#> GSM198769     1  0.0524      0.956 0.988 0.004 0.008 0.000
#> GSM198772     1  0.0524      0.956 0.988 0.004 0.008 0.000
#> GSM198773     1  0.0844      0.956 0.980 0.004 0.004 0.012
#> GSM198776     1  0.1697      0.948 0.952 0.004 0.016 0.028
#> GSM198778     1  0.2053      0.883 0.924 0.004 0.072 0.000
#> GSM198780     1  0.1398      0.927 0.956 0.004 0.040 0.000
#> GSM198781     1  0.0844      0.956 0.980 0.004 0.004 0.012
#> GSM198765     3  0.4254      0.932 0.036 0.056 0.848 0.060
#> GSM198766     3  0.4457      0.883 0.108 0.004 0.816 0.072
#> GSM198768     3  0.3720      0.939 0.032 0.064 0.872 0.032
#> GSM198770     3  0.3813      0.940 0.032 0.064 0.868 0.036
#> GSM198771     3  0.2722      0.941 0.032 0.064 0.904 0.000
#> GSM198774     3  0.3938      0.904 0.080 0.008 0.852 0.060
#> GSM198775     3  0.4918      0.922 0.040 0.064 0.812 0.084
#> GSM198777     3  0.3720      0.939 0.032 0.064 0.872 0.032
#> GSM198779     3  0.2635      0.935 0.020 0.076 0.904 0.000
#> GSM587218     4  0.5548      0.977 0.340 0.000 0.032 0.628
#> GSM587219     4  0.5368      0.979 0.340 0.000 0.024 0.636
#> GSM587220     4  0.5368      0.979 0.340 0.000 0.024 0.636
#> GSM587221     4  0.5565      0.979 0.344 0.000 0.032 0.624
#> GSM587222     4  0.5565      0.979 0.344 0.000 0.032 0.624
#> GSM587223     4  0.5548      0.977 0.340 0.000 0.032 0.628
#> GSM587224     4  0.5730      0.977 0.344 0.000 0.040 0.616
#> GSM587225     4  0.6382      0.966 0.340 0.000 0.080 0.580
#> GSM587226     4  0.5565      0.979 0.344 0.000 0.032 0.624
#> GSM587227     4  0.6265      0.966 0.340 0.000 0.072 0.588
#> GSM587228     4  0.6382      0.966 0.340 0.000 0.080 0.580
#> GSM587229     4  0.6265      0.966 0.340 0.000 0.072 0.588

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4 p5
#> GSM587155     2  0.3885      0.758 0.000 0.724 0.000 0.008 NA
#> GSM587156     2  0.4553      0.657 0.000 0.604 0.008 0.004 NA
#> GSM587157     2  0.3861      0.749 0.000 0.712 0.000 0.004 NA
#> GSM587158     2  0.0579      0.859 0.000 0.984 0.000 0.008 NA
#> GSM587159     2  0.0290      0.860 0.000 0.992 0.000 0.000 NA
#> GSM587160     2  0.0898      0.857 0.000 0.972 0.000 0.008 NA
#> GSM587161     2  0.2411      0.835 0.000 0.884 0.000 0.008 NA
#> GSM587162     2  0.1956      0.846 0.000 0.916 0.000 0.008 NA
#> GSM587163     2  0.0992      0.856 0.000 0.968 0.000 0.008 NA
#> GSM587164     2  0.3928      0.741 0.000 0.700 0.004 0.000 NA
#> GSM587165     2  0.3495      0.829 0.000 0.812 0.000 0.028 NA
#> GSM587166     2  0.4655      0.651 0.000 0.600 0.012 0.004 NA
#> GSM587167     2  0.4353      0.711 0.000 0.660 0.004 0.008 NA
#> GSM587168     2  0.3536      0.830 0.000 0.812 0.000 0.032 NA
#> GSM587169     2  0.1012      0.858 0.000 0.968 0.000 0.012 NA
#> GSM587170     2  0.3928      0.741 0.000 0.700 0.004 0.000 NA
#> GSM587171     2  0.0290      0.860 0.000 0.992 0.000 0.000 NA
#> GSM587172     2  0.0290      0.860 0.000 0.992 0.000 0.000 NA
#> GSM587173     2  0.3655      0.828 0.000 0.804 0.000 0.036 NA
#> GSM587174     2  0.1809      0.856 0.000 0.928 0.000 0.012 NA
#> GSM587175     2  0.3838      0.752 0.000 0.716 0.000 0.004 NA
#> GSM587176     2  0.1956      0.847 0.000 0.916 0.000 0.008 NA
#> GSM587177     2  0.3495      0.829 0.000 0.812 0.000 0.028 NA
#> GSM587178     2  0.3278      0.832 0.000 0.824 0.000 0.020 NA
#> GSM587179     2  0.1251      0.855 0.000 0.956 0.000 0.008 NA
#> GSM587180     2  0.3536      0.832 0.000 0.812 0.000 0.032 NA
#> GSM587181     2  0.1809      0.856 0.000 0.928 0.000 0.012 NA
#> GSM587182     2  0.3368      0.834 0.000 0.820 0.000 0.024 NA
#> GSM587183     2  0.3495      0.829 0.000 0.812 0.000 0.028 NA
#> GSM587184     2  0.0703      0.859 0.000 0.976 0.000 0.000 NA
#> GSM587185     2  0.1251      0.855 0.000 0.956 0.000 0.008 NA
#> GSM587186     2  0.3655      0.828 0.000 0.804 0.000 0.036 NA
#> GSM587187     2  0.3914      0.822 0.000 0.788 0.000 0.048 NA
#> GSM587188     2  0.4220      0.816 0.000 0.768 0.004 0.048 NA
#> GSM587189     2  0.4549      0.811 0.000 0.728 0.004 0.048 NA
#> GSM587190     3  0.6002      0.712 0.000 0.064 0.596 0.036 NA
#> GSM587203     1  0.2228      0.898 0.912 0.000 0.000 0.040 NA
#> GSM587204     1  0.2313      0.898 0.912 0.000 0.004 0.040 NA
#> GSM587205     1  0.2228      0.898 0.912 0.000 0.000 0.040 NA
#> GSM587206     1  0.2228      0.898 0.912 0.000 0.000 0.040 NA
#> GSM587207     1  0.2228      0.898 0.912 0.000 0.000 0.040 NA
#> GSM587208     1  0.2228      0.898 0.912 0.000 0.000 0.040 NA
#> GSM587209     1  0.1571      0.910 0.936 0.000 0.004 0.000 NA
#> GSM587210     1  0.3289      0.846 0.844 0.000 0.048 0.000 NA
#> GSM587211     1  0.1831      0.905 0.920 0.000 0.004 0.000 NA
#> GSM587212     1  0.2597      0.883 0.884 0.000 0.024 0.000 NA
#> GSM587213     1  0.0566      0.913 0.984 0.000 0.000 0.012 NA
#> GSM587214     1  0.0566      0.913 0.984 0.000 0.000 0.012 NA
#> GSM587215     1  0.1571      0.911 0.936 0.000 0.004 0.000 NA
#> GSM587216     1  0.2011      0.899 0.908 0.000 0.004 0.000 NA
#> GSM587217     1  0.1270      0.912 0.948 0.000 0.000 0.000 NA
#> GSM587191     3  0.5347      0.817 0.012 0.012 0.700 0.064 NA
#> GSM587192     3  0.5439      0.808 0.028 0.000 0.680 0.064 NA
#> GSM587193     3  0.5608      0.775 0.052 0.000 0.660 0.040 NA
#> GSM587194     3  0.5677      0.783 0.016 0.020 0.652 0.044 NA
#> GSM587195     3  0.3765      0.847 0.016 0.020 0.848 0.036 NA
#> GSM587196     3  0.3765      0.847 0.016 0.020 0.848 0.036 NA
#> GSM587197     3  0.4222      0.845 0.016 0.020 0.816 0.040 NA
#> GSM587198     3  0.1299      0.860 0.012 0.020 0.960 0.000 NA
#> GSM587199     3  0.1851      0.860 0.008 0.024 0.940 0.004 NA
#> GSM587200     3  0.3590      0.839 0.036 0.000 0.828 0.008 NA
#> GSM587201     3  0.3590      0.839 0.036 0.000 0.828 0.008 NA
#> GSM587202     3  0.1299      0.860 0.012 0.020 0.960 0.000 NA
#> GSM198767     1  0.2228      0.898 0.912 0.000 0.000 0.040 NA
#> GSM198769     1  0.1571      0.910 0.936 0.000 0.004 0.000 NA
#> GSM198772     1  0.1831      0.905 0.920 0.000 0.004 0.000 NA
#> GSM198773     1  0.0566      0.913 0.984 0.000 0.000 0.012 NA
#> GSM198776     1  0.2313      0.898 0.912 0.000 0.004 0.040 NA
#> GSM198778     1  0.3289      0.846 0.844 0.000 0.048 0.000 NA
#> GSM198780     1  0.2597      0.883 0.884 0.000 0.024 0.000 NA
#> GSM198781     1  0.0566      0.913 0.984 0.000 0.000 0.012 NA
#> GSM198765     3  0.5347      0.817 0.012 0.012 0.700 0.064 NA
#> GSM198766     3  0.5608      0.775 0.052 0.000 0.660 0.040 NA
#> GSM198768     3  0.3765      0.847 0.016 0.020 0.848 0.036 NA
#> GSM198770     3  0.4222      0.845 0.016 0.020 0.816 0.040 NA
#> GSM198771     3  0.1299      0.860 0.012 0.020 0.960 0.000 NA
#> GSM198774     3  0.5439      0.808 0.028 0.000 0.680 0.064 NA
#> GSM198775     3  0.5677      0.783 0.016 0.020 0.652 0.044 NA
#> GSM198777     3  0.3765      0.847 0.016 0.020 0.848 0.036 NA
#> GSM198779     3  0.1851      0.860 0.008 0.024 0.940 0.004 NA
#> GSM587218     4  0.3391      0.971 0.188 0.000 0.012 0.800 NA
#> GSM587219     4  0.3652      0.980 0.200 0.000 0.012 0.784 NA
#> GSM587220     4  0.3652      0.980 0.200 0.000 0.012 0.784 NA
#> GSM587221     4  0.3752      0.980 0.200 0.000 0.016 0.780 NA
#> GSM587222     4  0.3752      0.980 0.200 0.000 0.016 0.780 NA
#> GSM587223     4  0.3496      0.979 0.200 0.000 0.012 0.788 NA
#> GSM587224     4  0.3752      0.980 0.200 0.000 0.016 0.780 NA
#> GSM587225     4  0.4913      0.966 0.200 0.000 0.016 0.724 NA
#> GSM587226     4  0.3752      0.980 0.200 0.000 0.016 0.780 NA
#> GSM587227     4  0.4877      0.966 0.200 0.000 0.020 0.728 NA
#> GSM587228     4  0.4850      0.966 0.200 0.000 0.016 0.728 NA
#> GSM587229     4  0.4850      0.966 0.200 0.000 0.016 0.728 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
#> GSM587155     2  0.3944     -0.699 0.000 0.568 0.000 0.004 0.428 NA
#> GSM587156     5  0.4714      1.000 0.000 0.460 0.008 0.008 0.508 NA
#> GSM587157     2  0.4093     -0.746 0.000 0.552 0.004 0.000 0.440 NA
#> GSM587158     2  0.0767      0.598 0.000 0.976 0.000 0.004 0.012 NA
#> GSM587159     2  0.0881      0.598 0.000 0.972 0.000 0.008 0.008 NA
#> GSM587160     2  0.0779      0.591 0.000 0.976 0.000 0.008 0.008 NA
#> GSM587161     2  0.2845      0.312 0.000 0.820 0.000 0.004 0.172 NA
#> GSM587162     2  0.2320      0.424 0.000 0.864 0.000 0.000 0.132 NA
#> GSM587163     2  0.0862      0.589 0.000 0.972 0.000 0.004 0.016 NA
#> GSM587164     2  0.3851     -0.768 0.000 0.540 0.000 0.000 0.460 NA
#> GSM587165     2  0.3958      0.584 0.000 0.764 0.000 0.016 0.040 NA
#> GSM587166     5  0.4714      1.000 0.000 0.460 0.008 0.008 0.508 NA
#> GSM587167     2  0.4452     -0.859 0.000 0.508 0.004 0.008 0.472 NA
#> GSM587168     2  0.4173      0.580 0.000 0.752 0.000 0.016 0.056 NA
#> GSM587169     2  0.0653      0.593 0.000 0.980 0.000 0.004 0.012 NA
#> GSM587170     2  0.3843     -0.745 0.000 0.548 0.000 0.000 0.452 NA
#> GSM587171     2  0.0881      0.598 0.000 0.972 0.000 0.008 0.008 NA
#> GSM587172     2  0.0881      0.598 0.000 0.972 0.000 0.008 0.008 NA
#> GSM587173     2  0.4308      0.569 0.000 0.736 0.000 0.024 0.044 NA
#> GSM587174     2  0.1863      0.612 0.000 0.920 0.000 0.000 0.036 NA
#> GSM587175     2  0.4039     -0.694 0.000 0.568 0.000 0.008 0.424 NA
#> GSM587176     2  0.2737      0.348 0.000 0.832 0.000 0.004 0.160 NA
#> GSM587177     2  0.4042      0.582 0.000 0.760 0.000 0.020 0.040 NA
#> GSM587178     2  0.3309      0.600 0.000 0.824 0.000 0.004 0.056 NA
#> GSM587179     2  0.1364      0.560 0.000 0.944 0.000 0.004 0.048 NA
#> GSM587180     2  0.4197      0.584 0.000 0.752 0.000 0.016 0.060 NA
#> GSM587181     2  0.1863      0.612 0.000 0.920 0.000 0.000 0.036 NA
#> GSM587182     2  0.3603      0.601 0.000 0.808 0.000 0.012 0.056 NA
#> GSM587183     2  0.4042      0.582 0.000 0.760 0.000 0.020 0.040 NA
#> GSM587184     2  0.0748      0.604 0.000 0.976 0.000 0.004 0.004 NA
#> GSM587185     2  0.1477      0.559 0.000 0.940 0.000 0.008 0.048 NA
#> GSM587186     2  0.4308      0.569 0.000 0.736 0.000 0.024 0.044 NA
#> GSM587187     2  0.4836      0.541 0.000 0.704 0.000 0.036 0.068 NA
#> GSM587188     2  0.5379      0.492 0.000 0.664 0.004 0.044 0.084 NA
#> GSM587189     2  0.6218      0.340 0.000 0.568 0.004 0.044 0.184 NA
#> GSM587190     3  0.7122      0.421 0.000 0.072 0.440 0.028 0.336 NA
#> GSM587203     1  0.3835      0.821 0.748 0.000 0.000 0.000 0.204 NA
#> GSM587204     1  0.3867      0.821 0.748 0.000 0.000 0.000 0.200 NA
#> GSM587205     1  0.3835      0.821 0.748 0.000 0.000 0.000 0.204 NA
#> GSM587206     1  0.3835      0.821 0.748 0.000 0.000 0.000 0.204 NA
#> GSM587207     1  0.3835      0.821 0.748 0.000 0.000 0.000 0.204 NA
#> GSM587208     1  0.3835      0.821 0.748 0.000 0.000 0.000 0.204 NA
#> GSM587209     1  0.1096      0.862 0.964 0.000 0.004 0.008 0.004 NA
#> GSM587210     1  0.3523      0.784 0.816 0.000 0.048 0.008 0.004 NA
#> GSM587211     1  0.1526      0.859 0.944 0.000 0.004 0.008 0.008 NA
#> GSM587212     1  0.2480      0.838 0.884 0.000 0.008 0.008 0.008 NA
#> GSM587213     1  0.1938      0.865 0.920 0.000 0.000 0.008 0.052 NA
#> GSM587214     1  0.1938      0.865 0.920 0.000 0.000 0.008 0.052 NA
#> GSM587215     1  0.1210      0.862 0.960 0.000 0.004 0.008 0.008 NA
#> GSM587216     1  0.1988      0.845 0.912 0.000 0.004 0.008 0.004 NA
#> GSM587217     1  0.0976      0.863 0.968 0.000 0.000 0.008 0.008 NA
#> GSM587191     3  0.4015      0.728 0.004 0.000 0.596 0.000 0.004 NA
#> GSM587192     3  0.4088      0.715 0.004 0.000 0.556 0.000 0.004 NA
#> GSM587193     3  0.6485      0.665 0.084 0.000 0.484 0.004 0.088 NA
#> GSM587194     3  0.6188      0.686 0.024 0.000 0.508 0.008 0.136 NA
#> GSM587195     3  0.3355      0.757 0.008 0.000 0.840 0.016 0.036 NA
#> GSM587196     3  0.3355      0.757 0.008 0.000 0.840 0.016 0.036 NA
#> GSM587197     3  0.4077      0.753 0.008 0.000 0.772 0.012 0.048 NA
#> GSM587198     3  0.0551      0.785 0.008 0.000 0.984 0.004 0.000 NA
#> GSM587199     3  0.2026      0.786 0.008 0.000 0.916 0.004 0.012 NA
#> GSM587200     3  0.4462      0.762 0.044 0.000 0.736 0.004 0.028 NA
#> GSM587201     3  0.4462      0.762 0.044 0.000 0.736 0.004 0.028 NA
#> GSM587202     3  0.0405      0.784 0.008 0.000 0.988 0.004 0.000 NA
#> GSM198767     1  0.3835      0.821 0.748 0.000 0.000 0.000 0.204 NA
#> GSM198769     1  0.1096      0.862 0.964 0.000 0.004 0.008 0.004 NA
#> GSM198772     1  0.1526      0.859 0.944 0.000 0.004 0.008 0.008 NA
#> GSM198773     1  0.1938      0.865 0.920 0.000 0.000 0.008 0.052 NA
#> GSM198776     1  0.3867      0.821 0.748 0.000 0.000 0.000 0.200 NA
#> GSM198778     1  0.3523      0.784 0.816 0.000 0.048 0.008 0.004 NA
#> GSM198780     1  0.2480      0.838 0.884 0.000 0.008 0.008 0.008 NA
#> GSM198781     1  0.1938      0.865 0.920 0.000 0.000 0.008 0.052 NA
#> GSM198765     3  0.4015      0.728 0.004 0.000 0.596 0.000 0.004 NA
#> GSM198766     3  0.6485      0.665 0.084 0.000 0.484 0.004 0.088 NA
#> GSM198768     3  0.3355      0.757 0.008 0.000 0.840 0.016 0.036 NA
#> GSM198770     3  0.4077      0.753 0.008 0.000 0.772 0.012 0.048 NA
#> GSM198771     3  0.0551      0.785 0.008 0.000 0.984 0.004 0.000 NA
#> GSM198774     3  0.4088      0.715 0.004 0.000 0.556 0.000 0.004 NA
#> GSM198775     3  0.6188      0.686 0.024 0.000 0.508 0.008 0.136 NA
#> GSM198777     3  0.3355      0.757 0.008 0.000 0.840 0.016 0.036 NA
#> GSM198779     3  0.2026      0.786 0.008 0.000 0.916 0.004 0.012 NA
#> GSM587218     4  0.2290      0.952 0.084 0.000 0.000 0.892 0.004 NA
#> GSM587219     4  0.1806      0.955 0.088 0.000 0.000 0.908 0.000 NA
#> GSM587220     4  0.1806      0.955 0.088 0.000 0.000 0.908 0.000 NA
#> GSM587221     4  0.2816      0.954 0.088 0.000 0.000 0.868 0.020 NA
#> GSM587222     4  0.2816      0.954 0.088 0.000 0.000 0.868 0.020 NA
#> GSM587223     4  0.2255      0.953 0.088 0.000 0.000 0.892 0.004 NA
#> GSM587224     4  0.3051      0.953 0.088 0.000 0.000 0.856 0.024 NA
#> GSM587225     4  0.4517      0.930 0.088 0.000 0.004 0.764 0.100 NA
#> GSM587226     4  0.2816      0.954 0.088 0.000 0.000 0.868 0.020 NA
#> GSM587227     4  0.4124      0.931 0.088 0.000 0.004 0.792 0.084 NA
#> GSM587228     4  0.4339      0.931 0.088 0.000 0.004 0.776 0.096 NA
#> GSM587229     4  0.4124      0.931 0.088 0.000 0.004 0.792 0.084 NA

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

consensus_heatmap(res, k = 2)

plot of chunk tab-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 specimen(p) k
#> CV:kmeans 92    4.01e-14 2
#> CV:kmeans 92    7.20e-32 3
#> CV:kmeans 92    4.48e-47 4
#> CV:kmeans 92    4.48e-47 5
#> CV:kmeans 80    1.36e-37 6

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


CV:skmeans**

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

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

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

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

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

collect_plots(res)

plot of chunk 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.991       0.996         0.5007 0.500   0.500
#> 3 3 1.000           0.969       0.984         0.2879 0.821   0.653
#> 4 4 0.990           0.923       0.965         0.1110 0.893   0.714
#> 5 5 0.978           0.950       0.967         0.0452 0.947   0.821
#> 6 6 0.895           0.877       0.897         0.0298 0.989   0.957

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

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

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

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

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

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>           class entropy silhouette    p1    p2
#> GSM587155     2   0.000      0.993 0.000 1.000
#> GSM587156     2   0.000      0.993 0.000 1.000
#> GSM587157     2   0.000      0.993 0.000 1.000
#> GSM587158     2   0.000      0.993 0.000 1.000
#> GSM587159     2   0.000      0.993 0.000 1.000
#> GSM587160     2   0.000      0.993 0.000 1.000
#> GSM587161     2   0.000      0.993 0.000 1.000
#> GSM587162     2   0.000      0.993 0.000 1.000
#> GSM587163     2   0.000      0.993 0.000 1.000
#> GSM587164     2   0.000      0.993 0.000 1.000
#> GSM587165     2   0.000      0.993 0.000 1.000
#> GSM587166     2   0.000      0.993 0.000 1.000
#> GSM587167     2   0.000      0.993 0.000 1.000
#> GSM587168     2   0.000      0.993 0.000 1.000
#> GSM587169     2   0.000      0.993 0.000 1.000
#> GSM587170     2   0.000      0.993 0.000 1.000
#> GSM587171     2   0.000      0.993 0.000 1.000
#> GSM587172     2   0.000      0.993 0.000 1.000
#> GSM587173     2   0.000      0.993 0.000 1.000
#> GSM587174     2   0.000      0.993 0.000 1.000
#> GSM587175     2   0.000      0.993 0.000 1.000
#> GSM587176     2   0.000      0.993 0.000 1.000
#> GSM587177     2   0.000      0.993 0.000 1.000
#> GSM587178     2   0.000      0.993 0.000 1.000
#> GSM587179     2   0.000      0.993 0.000 1.000
#> GSM587180     2   0.000      0.993 0.000 1.000
#> GSM587181     2   0.000      0.993 0.000 1.000
#> GSM587182     2   0.000      0.993 0.000 1.000
#> GSM587183     2   0.000      0.993 0.000 1.000
#> GSM587184     2   0.000      0.993 0.000 1.000
#> GSM587185     2   0.000      0.993 0.000 1.000
#> GSM587186     2   0.000      0.993 0.000 1.000
#> GSM587187     2   0.000      0.993 0.000 1.000
#> GSM587188     2   0.000      0.993 0.000 1.000
#> GSM587189     2   0.000      0.993 0.000 1.000
#> GSM587190     2   0.000      0.993 0.000 1.000
#> GSM587203     1   0.000      1.000 1.000 0.000
#> GSM587204     1   0.000      1.000 1.000 0.000
#> GSM587205     1   0.000      1.000 1.000 0.000
#> GSM587206     1   0.000      1.000 1.000 0.000
#> GSM587207     1   0.000      1.000 1.000 0.000
#> GSM587208     1   0.000      1.000 1.000 0.000
#> GSM587209     1   0.000      1.000 1.000 0.000
#> GSM587210     1   0.000      1.000 1.000 0.000
#> GSM587211     1   0.000      1.000 1.000 0.000
#> GSM587212     1   0.000      1.000 1.000 0.000
#> GSM587213     1   0.000      1.000 1.000 0.000
#> GSM587214     1   0.000      1.000 1.000 0.000
#> GSM587215     1   0.000      1.000 1.000 0.000
#> GSM587216     1   0.000      1.000 1.000 0.000
#> GSM587217     1   0.000      1.000 1.000 0.000
#> GSM587191     2   0.000      0.993 0.000 1.000
#> GSM587192     1   0.000      1.000 1.000 0.000
#> GSM587193     1   0.000      1.000 1.000 0.000
#> GSM587194     2   0.689      0.779 0.184 0.816
#> GSM587195     2   0.000      0.993 0.000 1.000
#> GSM587196     2   0.000      0.993 0.000 1.000
#> GSM587197     2   0.000      0.993 0.000 1.000
#> GSM587198     2   0.000      0.993 0.000 1.000
#> GSM587199     2   0.000      0.993 0.000 1.000
#> GSM587200     1   0.000      1.000 1.000 0.000
#> GSM587201     1   0.000      1.000 1.000 0.000
#> GSM587202     2   0.000      0.993 0.000 1.000
#> GSM198767     1   0.000      1.000 1.000 0.000
#> GSM198769     1   0.000      1.000 1.000 0.000
#> GSM198772     1   0.000      1.000 1.000 0.000
#> GSM198773     1   0.000      1.000 1.000 0.000
#> GSM198776     1   0.000      1.000 1.000 0.000
#> GSM198778     1   0.000      1.000 1.000 0.000
#> GSM198780     1   0.000      1.000 1.000 0.000
#> GSM198781     1   0.000      1.000 1.000 0.000
#> GSM198765     2   0.000      0.993 0.000 1.000
#> GSM198766     1   0.000      1.000 1.000 0.000
#> GSM198768     2   0.000      0.993 0.000 1.000
#> GSM198770     2   0.000      0.993 0.000 1.000
#> GSM198771     2   0.000      0.993 0.000 1.000
#> GSM198774     1   0.000      1.000 1.000 0.000
#> GSM198775     2   0.689      0.779 0.184 0.816
#> GSM198777     2   0.000      0.993 0.000 1.000
#> GSM198779     2   0.000      0.993 0.000 1.000
#> GSM587218     1   0.000      1.000 1.000 0.000
#> GSM587219     1   0.000      1.000 1.000 0.000
#> GSM587220     1   0.000      1.000 1.000 0.000
#> GSM587221     1   0.000      1.000 1.000 0.000
#> GSM587222     1   0.000      1.000 1.000 0.000
#> GSM587223     1   0.000      1.000 1.000 0.000
#> GSM587224     1   0.000      1.000 1.000 0.000
#> GSM587225     1   0.000      1.000 1.000 0.000
#> GSM587226     1   0.000      1.000 1.000 0.000
#> GSM587227     1   0.000      1.000 1.000 0.000
#> GSM587228     1   0.000      1.000 1.000 0.000
#> GSM587229     1   0.000      1.000 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1    p2    p3
#> GSM587155     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587156     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587157     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587158     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587159     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587160     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587161     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587162     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587163     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587164     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587165     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587166     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587167     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587168     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587169     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587170     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587171     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587172     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587173     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587174     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587175     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587176     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587177     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587178     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587179     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587180     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587181     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587182     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587183     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587184     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587185     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587186     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587187     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587188     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587189     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587190     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587203     1  0.0000      0.994 1.000 0.000 0.000
#> GSM587204     1  0.0000      0.994 1.000 0.000 0.000
#> GSM587205     1  0.0000      0.994 1.000 0.000 0.000
#> GSM587206     1  0.0000      0.994 1.000 0.000 0.000
#> GSM587207     1  0.0000      0.994 1.000 0.000 0.000
#> GSM587208     1  0.0000      0.994 1.000 0.000 0.000
#> GSM587209     1  0.0000      0.994 1.000 0.000 0.000
#> GSM587210     1  0.0000      0.994 1.000 0.000 0.000
#> GSM587211     1  0.0000      0.994 1.000 0.000 0.000
#> GSM587212     1  0.0000      0.994 1.000 0.000 0.000
#> GSM587213     1  0.0000      0.994 1.000 0.000 0.000
#> GSM587214     1  0.0000      0.994 1.000 0.000 0.000
#> GSM587215     1  0.0000      0.994 1.000 0.000 0.000
#> GSM587216     1  0.0000      0.994 1.000 0.000 0.000
#> GSM587217     1  0.0000      0.994 1.000 0.000 0.000
#> GSM587191     3  0.0747      0.942 0.000 0.016 0.984
#> GSM587192     3  0.0747      0.932 0.016 0.000 0.984
#> GSM587193     1  0.0237      0.993 0.996 0.000 0.004
#> GSM587194     3  0.6274      0.232 0.000 0.456 0.544
#> GSM587195     3  0.0892      0.943 0.000 0.020 0.980
#> GSM587196     3  0.0892      0.943 0.000 0.020 0.980
#> GSM587197     3  0.0747      0.942 0.000 0.016 0.984
#> GSM587198     3  0.0892      0.943 0.000 0.020 0.980
#> GSM587199     3  0.0892      0.943 0.000 0.020 0.980
#> GSM587200     3  0.0892      0.931 0.020 0.000 0.980
#> GSM587201     3  0.0892      0.931 0.020 0.000 0.980
#> GSM587202     3  0.0892      0.943 0.000 0.020 0.980
#> GSM198767     1  0.0000      0.994 1.000 0.000 0.000
#> GSM198769     1  0.0000      0.994 1.000 0.000 0.000
#> GSM198772     1  0.0000      0.994 1.000 0.000 0.000
#> GSM198773     1  0.0000      0.994 1.000 0.000 0.000
#> GSM198776     1  0.0000      0.994 1.000 0.000 0.000
#> GSM198778     1  0.0000      0.994 1.000 0.000 0.000
#> GSM198780     1  0.0000      0.994 1.000 0.000 0.000
#> GSM198781     1  0.0000      0.994 1.000 0.000 0.000
#> GSM198765     3  0.0747      0.942 0.000 0.016 0.984
#> GSM198766     1  0.0237      0.993 0.996 0.000 0.004
#> GSM198768     3  0.0892      0.943 0.000 0.020 0.980
#> GSM198770     3  0.0747      0.942 0.000 0.016 0.984
#> GSM198771     3  0.0892      0.943 0.000 0.020 0.980
#> GSM198774     3  0.0747      0.932 0.016 0.000 0.984
#> GSM198775     3  0.6274      0.232 0.000 0.456 0.544
#> GSM198777     3  0.0892      0.943 0.000 0.020 0.980
#> GSM198779     3  0.0892      0.943 0.000 0.020 0.980
#> GSM587218     1  0.0892      0.988 0.980 0.000 0.020
#> GSM587219     1  0.0892      0.988 0.980 0.000 0.020
#> GSM587220     1  0.0892      0.988 0.980 0.000 0.020
#> GSM587221     1  0.0892      0.988 0.980 0.000 0.020
#> GSM587222     1  0.0892      0.988 0.980 0.000 0.020
#> GSM587223     1  0.0892      0.988 0.980 0.000 0.020
#> GSM587224     1  0.0892      0.988 0.980 0.000 0.020
#> GSM587225     1  0.0892      0.988 0.980 0.000 0.020
#> GSM587226     1  0.0892      0.988 0.980 0.000 0.020
#> GSM587227     1  0.0892      0.988 0.980 0.000 0.020
#> GSM587228     1  0.0892      0.988 0.980 0.000 0.020
#> GSM587229     1  0.0892      0.988 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
#> GSM587155     2  0.0000     0.9703 0.000 1.000 0.000 0.000
#> GSM587156     2  0.0000     0.9703 0.000 1.000 0.000 0.000
#> GSM587157     2  0.0000     0.9703 0.000 1.000 0.000 0.000
#> GSM587158     2  0.0000     0.9703 0.000 1.000 0.000 0.000
#> GSM587159     2  0.0000     0.9703 0.000 1.000 0.000 0.000
#> GSM587160     2  0.0000     0.9703 0.000 1.000 0.000 0.000
#> GSM587161     2  0.0000     0.9703 0.000 1.000 0.000 0.000
#> GSM587162     2  0.0000     0.9703 0.000 1.000 0.000 0.000
#> GSM587163     2  0.0000     0.9703 0.000 1.000 0.000 0.000
#> GSM587164     2  0.0000     0.9703 0.000 1.000 0.000 0.000
#> GSM587165     2  0.0000     0.9703 0.000 1.000 0.000 0.000
#> GSM587166     2  0.0000     0.9703 0.000 1.000 0.000 0.000
#> GSM587167     2  0.0000     0.9703 0.000 1.000 0.000 0.000
#> GSM587168     2  0.0000     0.9703 0.000 1.000 0.000 0.000
#> GSM587169     2  0.0000     0.9703 0.000 1.000 0.000 0.000
#> GSM587170     2  0.0000     0.9703 0.000 1.000 0.000 0.000
#> GSM587171     2  0.0000     0.9703 0.000 1.000 0.000 0.000
#> GSM587172     2  0.0000     0.9703 0.000 1.000 0.000 0.000
#> GSM587173     2  0.0000     0.9703 0.000 1.000 0.000 0.000
#> GSM587174     2  0.0000     0.9703 0.000 1.000 0.000 0.000
#> GSM587175     2  0.0000     0.9703 0.000 1.000 0.000 0.000
#> GSM587176     2  0.0000     0.9703 0.000 1.000 0.000 0.000
#> GSM587177     2  0.0000     0.9703 0.000 1.000 0.000 0.000
#> GSM587178     2  0.0000     0.9703 0.000 1.000 0.000 0.000
#> GSM587179     2  0.0000     0.9703 0.000 1.000 0.000 0.000
#> GSM587180     2  0.0000     0.9703 0.000 1.000 0.000 0.000
#> GSM587181     2  0.0000     0.9703 0.000 1.000 0.000 0.000
#> GSM587182     2  0.0000     0.9703 0.000 1.000 0.000 0.000
#> GSM587183     2  0.0000     0.9703 0.000 1.000 0.000 0.000
#> GSM587184     2  0.0000     0.9703 0.000 1.000 0.000 0.000
#> GSM587185     2  0.0000     0.9703 0.000 1.000 0.000 0.000
#> GSM587186     2  0.0000     0.9703 0.000 1.000 0.000 0.000
#> GSM587187     2  0.0000     0.9703 0.000 1.000 0.000 0.000
#> GSM587188     2  0.0000     0.9703 0.000 1.000 0.000 0.000
#> GSM587189     2  0.0000     0.9703 0.000 1.000 0.000 0.000
#> GSM587190     2  0.0524     0.9599 0.000 0.988 0.004 0.008
#> GSM587203     1  0.0000     0.9501 1.000 0.000 0.000 0.000
#> GSM587204     1  0.0000     0.9501 1.000 0.000 0.000 0.000
#> GSM587205     1  0.0000     0.9501 1.000 0.000 0.000 0.000
#> GSM587206     1  0.0000     0.9501 1.000 0.000 0.000 0.000
#> GSM587207     1  0.0000     0.9501 1.000 0.000 0.000 0.000
#> GSM587208     1  0.0000     0.9501 1.000 0.000 0.000 0.000
#> GSM587209     1  0.0000     0.9501 1.000 0.000 0.000 0.000
#> GSM587210     1  0.0000     0.9501 1.000 0.000 0.000 0.000
#> GSM587211     1  0.0000     0.9501 1.000 0.000 0.000 0.000
#> GSM587212     1  0.0000     0.9501 1.000 0.000 0.000 0.000
#> GSM587213     1  0.0000     0.9501 1.000 0.000 0.000 0.000
#> GSM587214     1  0.0000     0.9501 1.000 0.000 0.000 0.000
#> GSM587215     1  0.0000     0.9501 1.000 0.000 0.000 0.000
#> GSM587216     1  0.0000     0.9501 1.000 0.000 0.000 0.000
#> GSM587217     1  0.0000     0.9501 1.000 0.000 0.000 0.000
#> GSM587191     3  0.1118     0.9534 0.000 0.000 0.964 0.036
#> GSM587192     3  0.1118     0.9534 0.000 0.000 0.964 0.036
#> GSM587193     1  0.4790     0.4344 0.620 0.000 0.000 0.380
#> GSM587194     2  0.7823     0.0367 0.004 0.440 0.332 0.224
#> GSM587195     3  0.0000     0.9665 0.000 0.000 1.000 0.000
#> GSM587196     3  0.0000     0.9665 0.000 0.000 1.000 0.000
#> GSM587197     3  0.0000     0.9665 0.000 0.000 1.000 0.000
#> GSM587198     3  0.0000     0.9665 0.000 0.000 1.000 0.000
#> GSM587199     3  0.0188     0.9655 0.000 0.000 0.996 0.004
#> GSM587200     3  0.4769     0.5286 0.308 0.000 0.684 0.008
#> GSM587201     1  0.5229     0.2098 0.564 0.000 0.428 0.008
#> GSM587202     3  0.0000     0.9665 0.000 0.000 1.000 0.000
#> GSM198767     1  0.0000     0.9501 1.000 0.000 0.000 0.000
#> GSM198769     1  0.0000     0.9501 1.000 0.000 0.000 0.000
#> GSM198772     1  0.0000     0.9501 1.000 0.000 0.000 0.000
#> GSM198773     1  0.0000     0.9501 1.000 0.000 0.000 0.000
#> GSM198776     1  0.0000     0.9501 1.000 0.000 0.000 0.000
#> GSM198778     1  0.0000     0.9501 1.000 0.000 0.000 0.000
#> GSM198780     1  0.0000     0.9501 1.000 0.000 0.000 0.000
#> GSM198781     1  0.0000     0.9501 1.000 0.000 0.000 0.000
#> GSM198765     3  0.1118     0.9534 0.000 0.000 0.964 0.036
#> GSM198766     1  0.4790     0.4344 0.620 0.000 0.000 0.380
#> GSM198768     3  0.0000     0.9665 0.000 0.000 1.000 0.000
#> GSM198770     3  0.0000     0.9665 0.000 0.000 1.000 0.000
#> GSM198771     3  0.0000     0.9665 0.000 0.000 1.000 0.000
#> GSM198774     3  0.1118     0.9534 0.000 0.000 0.964 0.036
#> GSM198775     2  0.7823     0.0367 0.004 0.440 0.332 0.224
#> GSM198777     3  0.0000     0.9665 0.000 0.000 1.000 0.000
#> GSM198779     3  0.0188     0.9655 0.000 0.000 0.996 0.004
#> GSM587218     4  0.1118     1.0000 0.036 0.000 0.000 0.964
#> GSM587219     4  0.1118     1.0000 0.036 0.000 0.000 0.964
#> GSM587220     4  0.1118     1.0000 0.036 0.000 0.000 0.964
#> GSM587221     4  0.1118     1.0000 0.036 0.000 0.000 0.964
#> GSM587222     4  0.1118     1.0000 0.036 0.000 0.000 0.964
#> GSM587223     4  0.1118     1.0000 0.036 0.000 0.000 0.964
#> GSM587224     4  0.1118     1.0000 0.036 0.000 0.000 0.964
#> GSM587225     4  0.1118     1.0000 0.036 0.000 0.000 0.964
#> GSM587226     4  0.1118     1.0000 0.036 0.000 0.000 0.964
#> GSM587227     4  0.1118     1.0000 0.036 0.000 0.000 0.964
#> GSM587228     4  0.1118     1.0000 0.036 0.000 0.000 0.964
#> GSM587229     4  0.1118     1.0000 0.036 0.000 0.000 0.964

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM587155     2  0.0000      0.993 0.000 1.000 0.000 0.000 0.000
#> GSM587156     2  0.0703      0.973 0.000 0.976 0.000 0.000 0.024
#> GSM587157     2  0.0162      0.990 0.000 0.996 0.004 0.000 0.000
#> GSM587158     2  0.0000      0.993 0.000 1.000 0.000 0.000 0.000
#> GSM587159     2  0.0000      0.993 0.000 1.000 0.000 0.000 0.000
#> GSM587160     2  0.0000      0.993 0.000 1.000 0.000 0.000 0.000
#> GSM587161     2  0.0000      0.993 0.000 1.000 0.000 0.000 0.000
#> GSM587162     2  0.0000      0.993 0.000 1.000 0.000 0.000 0.000
#> GSM587163     2  0.0000      0.993 0.000 1.000 0.000 0.000 0.000
#> GSM587164     2  0.0000      0.993 0.000 1.000 0.000 0.000 0.000
#> GSM587165     2  0.0000      0.993 0.000 1.000 0.000 0.000 0.000
#> GSM587166     2  0.0703      0.973 0.000 0.976 0.000 0.000 0.024
#> GSM587167     2  0.0000      0.993 0.000 1.000 0.000 0.000 0.000
#> GSM587168     2  0.0000      0.993 0.000 1.000 0.000 0.000 0.000
#> GSM587169     2  0.0000      0.993 0.000 1.000 0.000 0.000 0.000
#> GSM587170     2  0.0000      0.993 0.000 1.000 0.000 0.000 0.000
#> GSM587171     2  0.0000      0.993 0.000 1.000 0.000 0.000 0.000
#> GSM587172     2  0.0000      0.993 0.000 1.000 0.000 0.000 0.000
#> GSM587173     2  0.0000      0.993 0.000 1.000 0.000 0.000 0.000
#> GSM587174     2  0.0000      0.993 0.000 1.000 0.000 0.000 0.000
#> GSM587175     2  0.0000      0.993 0.000 1.000 0.000 0.000 0.000
#> GSM587176     2  0.0000      0.993 0.000 1.000 0.000 0.000 0.000
#> GSM587177     2  0.0000      0.993 0.000 1.000 0.000 0.000 0.000
#> GSM587178     2  0.0000      0.993 0.000 1.000 0.000 0.000 0.000
#> GSM587179     2  0.0000      0.993 0.000 1.000 0.000 0.000 0.000
#> GSM587180     2  0.0000      0.993 0.000 1.000 0.000 0.000 0.000
#> GSM587181     2  0.0000      0.993 0.000 1.000 0.000 0.000 0.000
#> GSM587182     2  0.0000      0.993 0.000 1.000 0.000 0.000 0.000
#> GSM587183     2  0.0000      0.993 0.000 1.000 0.000 0.000 0.000
#> GSM587184     2  0.0000      0.993 0.000 1.000 0.000 0.000 0.000
#> GSM587185     2  0.0000      0.993 0.000 1.000 0.000 0.000 0.000
#> GSM587186     2  0.0000      0.993 0.000 1.000 0.000 0.000 0.000
#> GSM587187     2  0.0162      0.990 0.000 0.996 0.000 0.000 0.004
#> GSM587188     2  0.0162      0.990 0.000 0.996 0.000 0.000 0.004
#> GSM587189     2  0.0162      0.990 0.000 0.996 0.000 0.000 0.004
#> GSM587190     2  0.3246      0.767 0.000 0.808 0.008 0.000 0.184
#> GSM587203     1  0.0404      0.989 0.988 0.000 0.000 0.000 0.012
#> GSM587204     1  0.0404      0.989 0.988 0.000 0.000 0.000 0.012
#> GSM587205     1  0.0404      0.989 0.988 0.000 0.000 0.000 0.012
#> GSM587206     1  0.0404      0.989 0.988 0.000 0.000 0.000 0.012
#> GSM587207     1  0.0404      0.989 0.988 0.000 0.000 0.000 0.012
#> GSM587208     1  0.0404      0.989 0.988 0.000 0.000 0.000 0.012
#> GSM587209     1  0.0000      0.991 1.000 0.000 0.000 0.000 0.000
#> GSM587210     1  0.0963      0.966 0.964 0.000 0.000 0.000 0.036
#> GSM587211     1  0.0000      0.991 1.000 0.000 0.000 0.000 0.000
#> GSM587212     1  0.0609      0.979 0.980 0.000 0.000 0.000 0.020
#> GSM587213     1  0.0000      0.991 1.000 0.000 0.000 0.000 0.000
#> GSM587214     1  0.0000      0.991 1.000 0.000 0.000 0.000 0.000
#> GSM587215     1  0.0000      0.991 1.000 0.000 0.000 0.000 0.000
#> GSM587216     1  0.0000      0.991 1.000 0.000 0.000 0.000 0.000
#> GSM587217     1  0.0000      0.991 1.000 0.000 0.000 0.000 0.000
#> GSM587191     5  0.2852      0.882 0.000 0.000 0.172 0.000 0.828
#> GSM587192     5  0.2852      0.882 0.000 0.000 0.172 0.000 0.828
#> GSM587193     5  0.0865      0.876 0.024 0.000 0.000 0.004 0.972
#> GSM587194     5  0.0451      0.881 0.000 0.008 0.004 0.000 0.988
#> GSM587195     3  0.0000      0.844 0.000 0.000 1.000 0.000 0.000
#> GSM587196     3  0.0000      0.844 0.000 0.000 1.000 0.000 0.000
#> GSM587197     3  0.0290      0.843 0.000 0.000 0.992 0.000 0.008
#> GSM587198     3  0.2930      0.829 0.000 0.000 0.832 0.004 0.164
#> GSM587199     3  0.3048      0.823 0.000 0.000 0.820 0.004 0.176
#> GSM587200     3  0.5761      0.550 0.092 0.000 0.572 0.004 0.332
#> GSM587201     3  0.6527      0.402 0.184 0.000 0.484 0.004 0.328
#> GSM587202     3  0.2583      0.837 0.000 0.000 0.864 0.004 0.132
#> GSM198767     1  0.0404      0.989 0.988 0.000 0.000 0.000 0.012
#> GSM198769     1  0.0000      0.991 1.000 0.000 0.000 0.000 0.000
#> GSM198772     1  0.0000      0.991 1.000 0.000 0.000 0.000 0.000
#> GSM198773     1  0.0000      0.991 1.000 0.000 0.000 0.000 0.000
#> GSM198776     1  0.0404      0.989 0.988 0.000 0.000 0.000 0.012
#> GSM198778     1  0.0963      0.966 0.964 0.000 0.000 0.000 0.036
#> GSM198780     1  0.0609      0.979 0.980 0.000 0.000 0.000 0.020
#> GSM198781     1  0.0000      0.991 1.000 0.000 0.000 0.000 0.000
#> GSM198765     5  0.2852      0.882 0.000 0.000 0.172 0.000 0.828
#> GSM198766     5  0.0865      0.876 0.024 0.000 0.000 0.004 0.972
#> GSM198768     3  0.0000      0.844 0.000 0.000 1.000 0.000 0.000
#> GSM198770     3  0.0290      0.843 0.000 0.000 0.992 0.000 0.008
#> GSM198771     3  0.2930      0.829 0.000 0.000 0.832 0.004 0.164
#> GSM198774     5  0.2852      0.882 0.000 0.000 0.172 0.000 0.828
#> GSM198775     5  0.0451      0.881 0.000 0.008 0.004 0.000 0.988
#> GSM198777     3  0.0000      0.844 0.000 0.000 1.000 0.000 0.000
#> GSM198779     3  0.3048      0.823 0.000 0.000 0.820 0.004 0.176
#> GSM587218     4  0.0162      1.000 0.004 0.000 0.000 0.996 0.000
#> GSM587219     4  0.0162      1.000 0.004 0.000 0.000 0.996 0.000
#> GSM587220     4  0.0162      1.000 0.004 0.000 0.000 0.996 0.000
#> GSM587221     4  0.0162      1.000 0.004 0.000 0.000 0.996 0.000
#> GSM587222     4  0.0162      1.000 0.004 0.000 0.000 0.996 0.000
#> GSM587223     4  0.0162      1.000 0.004 0.000 0.000 0.996 0.000
#> GSM587224     4  0.0162      1.000 0.004 0.000 0.000 0.996 0.000
#> GSM587225     4  0.0162      1.000 0.004 0.000 0.000 0.996 0.000
#> GSM587226     4  0.0162      1.000 0.004 0.000 0.000 0.996 0.000
#> GSM587227     4  0.0162      1.000 0.004 0.000 0.000 0.996 0.000
#> GSM587228     4  0.0162      1.000 0.004 0.000 0.000 0.996 0.000
#> GSM587229     4  0.0162      1.000 0.004 0.000 0.000 0.996 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
#> GSM587155     2  0.2020      0.899 0.000 0.896 0.000  0 0.096 0.008
#> GSM587156     2  0.3629      0.705 0.000 0.712 0.000  0 0.276 0.012
#> GSM587157     2  0.1866      0.906 0.000 0.908 0.000  0 0.084 0.008
#> GSM587158     2  0.0000      0.947 0.000 1.000 0.000  0 0.000 0.000
#> GSM587159     2  0.0000      0.947 0.000 1.000 0.000  0 0.000 0.000
#> GSM587160     2  0.0000      0.947 0.000 1.000 0.000  0 0.000 0.000
#> GSM587161     2  0.1010      0.934 0.000 0.960 0.000  0 0.036 0.004
#> GSM587162     2  0.0458      0.944 0.000 0.984 0.000  0 0.016 0.000
#> GSM587163     2  0.0000      0.947 0.000 1.000 0.000  0 0.000 0.000
#> GSM587164     2  0.2165      0.891 0.000 0.884 0.000  0 0.108 0.008
#> GSM587165     2  0.0858      0.941 0.000 0.968 0.000  0 0.028 0.004
#> GSM587166     2  0.3629      0.705 0.000 0.712 0.000  0 0.276 0.012
#> GSM587167     2  0.2257      0.885 0.000 0.876 0.000  0 0.116 0.008
#> GSM587168     2  0.0858      0.941 0.000 0.968 0.000  0 0.028 0.004
#> GSM587169     2  0.0000      0.947 0.000 1.000 0.000  0 0.000 0.000
#> GSM587170     2  0.2165      0.891 0.000 0.884 0.000  0 0.108 0.008
#> GSM587171     2  0.0000      0.947 0.000 1.000 0.000  0 0.000 0.000
#> GSM587172     2  0.0000      0.947 0.000 1.000 0.000  0 0.000 0.000
#> GSM587173     2  0.0858      0.941 0.000 0.968 0.000  0 0.028 0.004
#> GSM587174     2  0.0000      0.947 0.000 1.000 0.000  0 0.000 0.000
#> GSM587175     2  0.1812      0.909 0.000 0.912 0.000  0 0.080 0.008
#> GSM587176     2  0.0363      0.945 0.000 0.988 0.000  0 0.012 0.000
#> GSM587177     2  0.0858      0.941 0.000 0.968 0.000  0 0.028 0.004
#> GSM587178     2  0.0260      0.946 0.000 0.992 0.000  0 0.008 0.000
#> GSM587179     2  0.0000      0.947 0.000 1.000 0.000  0 0.000 0.000
#> GSM587180     2  0.0777      0.942 0.000 0.972 0.000  0 0.024 0.004
#> GSM587181     2  0.0000      0.947 0.000 1.000 0.000  0 0.000 0.000
#> GSM587182     2  0.0405      0.946 0.000 0.988 0.000  0 0.008 0.004
#> GSM587183     2  0.0858      0.941 0.000 0.968 0.000  0 0.028 0.004
#> GSM587184     2  0.0000      0.947 0.000 1.000 0.000  0 0.000 0.000
#> GSM587185     2  0.0000      0.947 0.000 1.000 0.000  0 0.000 0.000
#> GSM587186     2  0.0858      0.941 0.000 0.968 0.000  0 0.028 0.004
#> GSM587187     2  0.0935      0.940 0.000 0.964 0.000  0 0.032 0.004
#> GSM587188     2  0.1010      0.938 0.000 0.960 0.000  0 0.036 0.004
#> GSM587189     2  0.1082      0.939 0.000 0.956 0.000  0 0.040 0.004
#> GSM587190     2  0.5331      0.578 0.000 0.616 0.016  0 0.260 0.108
#> GSM587203     1  0.1007      0.929 0.956 0.000 0.000  0 0.044 0.000
#> GSM587204     1  0.1007      0.929 0.956 0.000 0.000  0 0.044 0.000
#> GSM587205     1  0.1007      0.929 0.956 0.000 0.000  0 0.044 0.000
#> GSM587206     1  0.1007      0.929 0.956 0.000 0.000  0 0.044 0.000
#> GSM587207     1  0.1007      0.929 0.956 0.000 0.000  0 0.044 0.000
#> GSM587208     1  0.1007      0.929 0.956 0.000 0.000  0 0.044 0.000
#> GSM587209     1  0.1700      0.921 0.916 0.000 0.000  0 0.080 0.004
#> GSM587210     1  0.2968      0.851 0.816 0.000 0.000  0 0.168 0.016
#> GSM587211     1  0.1644      0.922 0.920 0.000 0.000  0 0.076 0.004
#> GSM587212     1  0.2653      0.873 0.844 0.000 0.000  0 0.144 0.012
#> GSM587213     1  0.0000      0.936 1.000 0.000 0.000  0 0.000 0.000
#> GSM587214     1  0.0000      0.936 1.000 0.000 0.000  0 0.000 0.000
#> GSM587215     1  0.0632      0.934 0.976 0.000 0.000  0 0.024 0.000
#> GSM587216     1  0.1588      0.924 0.924 0.000 0.000  0 0.072 0.004
#> GSM587217     1  0.1219      0.930 0.948 0.000 0.000  0 0.048 0.004
#> GSM587191     6  0.0790      1.000 0.000 0.000 0.032  0 0.000 0.968
#> GSM587192     6  0.0790      1.000 0.000 0.000 0.032  0 0.000 0.968
#> GSM587193     5  0.3996      0.410 0.004 0.000 0.000  0 0.512 0.484
#> GSM587194     5  0.3828      0.452 0.000 0.000 0.000  0 0.560 0.440
#> GSM587195     3  0.0547      0.812 0.000 0.000 0.980  0 0.000 0.020
#> GSM587196     3  0.0547      0.812 0.000 0.000 0.980  0 0.000 0.020
#> GSM587197     3  0.1524      0.790 0.000 0.000 0.932  0 0.008 0.060
#> GSM587198     3  0.4358      0.762 0.000 0.000 0.712  0 0.196 0.092
#> GSM587199     3  0.4441      0.753 0.000 0.000 0.700  0 0.208 0.092
#> GSM587200     5  0.6269      0.176 0.060 0.000 0.248  0 0.548 0.144
#> GSM587201     5  0.6479      0.227 0.096 0.000 0.216  0 0.548 0.140
#> GSM587202     3  0.4311      0.764 0.000 0.000 0.716  0 0.196 0.088
#> GSM198767     1  0.1007      0.929 0.956 0.000 0.000  0 0.044 0.000
#> GSM198769     1  0.1700      0.921 0.916 0.000 0.000  0 0.080 0.004
#> GSM198772     1  0.1644      0.922 0.920 0.000 0.000  0 0.076 0.004
#> GSM198773     1  0.0000      0.936 1.000 0.000 0.000  0 0.000 0.000
#> GSM198776     1  0.1007      0.929 0.956 0.000 0.000  0 0.044 0.000
#> GSM198778     1  0.2968      0.851 0.816 0.000 0.000  0 0.168 0.016
#> GSM198780     1  0.2653      0.873 0.844 0.000 0.000  0 0.144 0.012
#> GSM198781     1  0.0000      0.936 1.000 0.000 0.000  0 0.000 0.000
#> GSM198765     6  0.0790      1.000 0.000 0.000 0.032  0 0.000 0.968
#> GSM198766     5  0.3996      0.410 0.004 0.000 0.000  0 0.512 0.484
#> GSM198768     3  0.0547      0.812 0.000 0.000 0.980  0 0.000 0.020
#> GSM198770     3  0.1524      0.790 0.000 0.000 0.932  0 0.008 0.060
#> GSM198771     3  0.4358      0.762 0.000 0.000 0.712  0 0.196 0.092
#> GSM198774     6  0.0790      1.000 0.000 0.000 0.032  0 0.000 0.968
#> GSM198775     5  0.3828      0.452 0.000 0.000 0.000  0 0.560 0.440
#> GSM198777     3  0.0547      0.812 0.000 0.000 0.980  0 0.000 0.020
#> GSM198779     3  0.4441      0.753 0.000 0.000 0.700  0 0.208 0.092
#> GSM587218     4  0.0000      1.000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587219     4  0.0000      1.000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587220     4  0.0000      1.000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587221     4  0.0000      1.000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587222     4  0.0000      1.000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587223     4  0.0000      1.000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587224     4  0.0000      1.000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587225     4  0.0000      1.000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587226     4  0.0000      1.000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587227     4  0.0000      1.000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587228     4  0.0000      1.000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587229     4  0.0000      1.000 0.000 0.000 0.000  1 0.000 0.000

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

consensus_heatmap(res, k = 2)

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

consensus_heatmap(res, k = 3)

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

consensus_heatmap(res, k = 4)

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

consensus_heatmap(res, k = 5)

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

consensus_heatmap(res, k = 6)

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

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

membership_heatmap(res, k = 2)

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

membership_heatmap(res, k = 3)

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

membership_heatmap(res, k = 4)

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

membership_heatmap(res, k = 5)

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

membership_heatmap(res, k = 6)

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

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

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

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 specimen(p) k
#> CV:skmeans 92    4.01e-14 2
#> CV:skmeans 90    2.83e-29 3
#> CV:skmeans 87    4.69e-45 4
#> CV:skmeans 91    3.30e-44 5
#> CV:skmeans 86    4.00e-41 6

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


CV:pam*

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

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

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

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

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

collect_plots(res)

plot of chunk CV-pam-collect-plots

The plots are:

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

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

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

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

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.749           0.950       0.973         0.4989 0.500   0.500
#> 3 3 0.760           0.831       0.896         0.2020 0.917   0.834
#> 4 4 1.000           0.960       0.986         0.2139 0.805   0.558
#> 5 5 0.979           0.928       0.958         0.0464 0.953   0.829
#> 6 6 0.921           0.874       0.943         0.0273 0.967   0.865

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

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

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

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

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>           class entropy silhouette    p1    p2
#> GSM587155     2   0.000      0.953 0.000 1.000
#> GSM587156     2   0.000      0.953 0.000 1.000
#> GSM587157     2   0.000      0.953 0.000 1.000
#> GSM587158     2   0.000      0.953 0.000 1.000
#> GSM587159     2   0.000      0.953 0.000 1.000
#> GSM587160     2   0.000      0.953 0.000 1.000
#> GSM587161     2   0.000      0.953 0.000 1.000
#> GSM587162     2   0.000      0.953 0.000 1.000
#> GSM587163     2   0.000      0.953 0.000 1.000
#> GSM587164     2   0.000      0.953 0.000 1.000
#> GSM587165     2   0.000      0.953 0.000 1.000
#> GSM587166     2   0.000      0.953 0.000 1.000
#> GSM587167     2   0.000      0.953 0.000 1.000
#> GSM587168     2   0.000      0.953 0.000 1.000
#> GSM587169     2   0.000      0.953 0.000 1.000
#> GSM587170     2   0.000      0.953 0.000 1.000
#> GSM587171     2   0.000      0.953 0.000 1.000
#> GSM587172     2   0.000      0.953 0.000 1.000
#> GSM587173     2   0.000      0.953 0.000 1.000
#> GSM587174     2   0.000      0.953 0.000 1.000
#> GSM587175     2   0.000      0.953 0.000 1.000
#> GSM587176     2   0.000      0.953 0.000 1.000
#> GSM587177     2   0.000      0.953 0.000 1.000
#> GSM587178     2   0.000      0.953 0.000 1.000
#> GSM587179     2   0.000      0.953 0.000 1.000
#> GSM587180     2   0.000      0.953 0.000 1.000
#> GSM587181     2   0.000      0.953 0.000 1.000
#> GSM587182     2   0.000      0.953 0.000 1.000
#> GSM587183     2   0.000      0.953 0.000 1.000
#> GSM587184     2   0.000      0.953 0.000 1.000
#> GSM587185     2   0.000      0.953 0.000 1.000
#> GSM587186     2   0.000      0.953 0.000 1.000
#> GSM587187     2   0.000      0.953 0.000 1.000
#> GSM587188     2   0.000      0.953 0.000 1.000
#> GSM587189     2   0.000      0.953 0.000 1.000
#> GSM587190     2   0.000      0.953 0.000 1.000
#> GSM587203     1   0.000      0.995 1.000 0.000
#> GSM587204     1   0.000      0.995 1.000 0.000
#> GSM587205     1   0.000      0.995 1.000 0.000
#> GSM587206     1   0.000      0.995 1.000 0.000
#> GSM587207     1   0.000      0.995 1.000 0.000
#> GSM587208     1   0.000      0.995 1.000 0.000
#> GSM587209     1   0.000      0.995 1.000 0.000
#> GSM587210     1   0.000      0.995 1.000 0.000
#> GSM587211     1   0.000      0.995 1.000 0.000
#> GSM587212     1   0.000      0.995 1.000 0.000
#> GSM587213     1   0.000      0.995 1.000 0.000
#> GSM587214     1   0.000      0.995 1.000 0.000
#> GSM587215     1   0.000      0.995 1.000 0.000
#> GSM587216     1   0.000      0.995 1.000 0.000
#> GSM587217     1   0.000      0.995 1.000 0.000
#> GSM587191     2   0.000      0.953 0.000 1.000
#> GSM587192     1   0.469      0.882 0.900 0.100
#> GSM587193     1   0.000      0.995 1.000 0.000
#> GSM587194     2   0.738      0.789 0.208 0.792
#> GSM587195     2   0.722      0.798 0.200 0.800
#> GSM587196     2   0.738      0.789 0.208 0.792
#> GSM587197     2   0.722      0.798 0.200 0.800
#> GSM587198     2   0.738      0.789 0.208 0.792
#> GSM587199     2   0.000      0.953 0.000 1.000
#> GSM587200     1   0.000      0.995 1.000 0.000
#> GSM587201     1   0.000      0.995 1.000 0.000
#> GSM587202     2   0.722      0.798 0.200 0.800
#> GSM198767     1   0.000      0.995 1.000 0.000
#> GSM198769     1   0.000      0.995 1.000 0.000
#> GSM198772     1   0.000      0.995 1.000 0.000
#> GSM198773     1   0.000      0.995 1.000 0.000
#> GSM198776     1   0.000      0.995 1.000 0.000
#> GSM198778     1   0.000      0.995 1.000 0.000
#> GSM198780     1   0.000      0.995 1.000 0.000
#> GSM198781     1   0.000      0.995 1.000 0.000
#> GSM198765     2   0.278      0.922 0.048 0.952
#> GSM198766     1   0.000      0.995 1.000 0.000
#> GSM198768     2   0.738      0.789 0.208 0.792
#> GSM198770     2   0.644      0.832 0.164 0.836
#> GSM198771     2   0.738      0.789 0.208 0.792
#> GSM198774     1   0.469      0.882 0.900 0.100
#> GSM198775     2   0.738      0.789 0.208 0.792
#> GSM198777     2   0.738      0.789 0.208 0.792
#> GSM198779     2   0.000      0.953 0.000 1.000
#> GSM587218     1   0.000      0.995 1.000 0.000
#> GSM587219     1   0.000      0.995 1.000 0.000
#> GSM587220     1   0.000      0.995 1.000 0.000
#> GSM587221     1   0.000      0.995 1.000 0.000
#> GSM587222     1   0.000      0.995 1.000 0.000
#> GSM587223     1   0.000      0.995 1.000 0.000
#> GSM587224     1   0.000      0.995 1.000 0.000
#> GSM587225     1   0.000      0.995 1.000 0.000
#> GSM587226     1   0.000      0.995 1.000 0.000
#> GSM587227     1   0.000      0.995 1.000 0.000
#> GSM587228     1   0.000      0.995 1.000 0.000
#> GSM587229     1   0.000      0.995 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1    p2    p3
#> GSM587155     2  0.0000      0.903 0.000 1.000 0.000
#> GSM587156     2  0.0000      0.903 0.000 1.000 0.000
#> GSM587157     2  0.0000      0.903 0.000 1.000 0.000
#> GSM587158     2  0.0000      0.903 0.000 1.000 0.000
#> GSM587159     2  0.0000      0.903 0.000 1.000 0.000
#> GSM587160     2  0.0000      0.903 0.000 1.000 0.000
#> GSM587161     2  0.0000      0.903 0.000 1.000 0.000
#> GSM587162     2  0.0000      0.903 0.000 1.000 0.000
#> GSM587163     2  0.0000      0.903 0.000 1.000 0.000
#> GSM587164     2  0.0000      0.903 0.000 1.000 0.000
#> GSM587165     2  0.0000      0.903 0.000 1.000 0.000
#> GSM587166     2  0.3192      0.858 0.112 0.888 0.000
#> GSM587167     2  0.0000      0.903 0.000 1.000 0.000
#> GSM587168     2  0.0000      0.903 0.000 1.000 0.000
#> GSM587169     2  0.0000      0.903 0.000 1.000 0.000
#> GSM587170     2  0.0000      0.903 0.000 1.000 0.000
#> GSM587171     2  0.0000      0.903 0.000 1.000 0.000
#> GSM587172     2  0.0000      0.903 0.000 1.000 0.000
#> GSM587173     2  0.0000      0.903 0.000 1.000 0.000
#> GSM587174     2  0.0000      0.903 0.000 1.000 0.000
#> GSM587175     2  0.0000      0.903 0.000 1.000 0.000
#> GSM587176     2  0.0000      0.903 0.000 1.000 0.000
#> GSM587177     2  0.0000      0.903 0.000 1.000 0.000
#> GSM587178     2  0.0000      0.903 0.000 1.000 0.000
#> GSM587179     2  0.0000      0.903 0.000 1.000 0.000
#> GSM587180     2  0.0000      0.903 0.000 1.000 0.000
#> GSM587181     2  0.0000      0.903 0.000 1.000 0.000
#> GSM587182     2  0.0000      0.903 0.000 1.000 0.000
#> GSM587183     2  0.0000      0.903 0.000 1.000 0.000
#> GSM587184     2  0.0000      0.903 0.000 1.000 0.000
#> GSM587185     2  0.0000      0.903 0.000 1.000 0.000
#> GSM587186     2  0.0000      0.903 0.000 1.000 0.000
#> GSM587187     2  0.0000      0.903 0.000 1.000 0.000
#> GSM587188     2  0.0000      0.903 0.000 1.000 0.000
#> GSM587189     2  0.0892      0.896 0.020 0.980 0.000
#> GSM587190     2  0.5016      0.795 0.240 0.760 0.000
#> GSM587203     1  0.5016      0.874 0.760 0.000 0.240
#> GSM587204     1  0.5016      0.874 0.760 0.000 0.240
#> GSM587205     1  0.5016      0.874 0.760 0.000 0.240
#> GSM587206     1  0.5016      0.874 0.760 0.000 0.240
#> GSM587207     1  0.5016      0.874 0.760 0.000 0.240
#> GSM587208     1  0.5016      0.874 0.760 0.000 0.240
#> GSM587209     1  0.5016      0.874 0.760 0.000 0.240
#> GSM587210     1  0.5058      0.871 0.756 0.000 0.244
#> GSM587211     1  0.5016      0.874 0.760 0.000 0.240
#> GSM587212     1  0.5058      0.871 0.756 0.000 0.244
#> GSM587213     1  0.5016      0.874 0.760 0.000 0.240
#> GSM587214     1  0.5016      0.874 0.760 0.000 0.240
#> GSM587215     1  0.5016      0.874 0.760 0.000 0.240
#> GSM587216     1  0.5058      0.871 0.756 0.000 0.244
#> GSM587217     1  0.5016      0.874 0.760 0.000 0.240
#> GSM587191     2  0.5016      0.795 0.240 0.760 0.000
#> GSM587192     1  0.6509     -0.393 0.524 0.472 0.004
#> GSM587193     1  0.0747      0.620 0.984 0.000 0.016
#> GSM587194     2  0.5678      0.745 0.316 0.684 0.000
#> GSM587195     2  0.5678      0.745 0.316 0.684 0.000
#> GSM587196     2  0.5706      0.741 0.320 0.680 0.000
#> GSM587197     2  0.5678      0.745 0.316 0.684 0.000
#> GSM587198     2  0.5678      0.745 0.316 0.684 0.000
#> GSM587199     2  0.5016      0.795 0.240 0.760 0.000
#> GSM587200     1  0.0237      0.614 0.996 0.000 0.004
#> GSM587201     1  0.0000      0.615 1.000 0.000 0.000
#> GSM587202     2  0.5678      0.745 0.316 0.684 0.000
#> GSM198767     1  0.5016      0.874 0.760 0.000 0.240
#> GSM198769     1  0.5016      0.874 0.760 0.000 0.240
#> GSM198772     1  0.5016      0.874 0.760 0.000 0.240
#> GSM198773     1  0.5016      0.874 0.760 0.000 0.240
#> GSM198776     1  0.5016      0.874 0.760 0.000 0.240
#> GSM198778     1  0.5058      0.871 0.756 0.000 0.244
#> GSM198780     1  0.5058      0.871 0.756 0.000 0.244
#> GSM198781     1  0.5016      0.874 0.760 0.000 0.240
#> GSM198765     2  0.5216      0.783 0.260 0.740 0.000
#> GSM198766     1  0.3879      0.778 0.848 0.000 0.152
#> GSM198768     2  0.5706      0.741 0.320 0.680 0.000
#> GSM198770     2  0.5621      0.751 0.308 0.692 0.000
#> GSM198771     2  0.5706      0.741 0.320 0.680 0.000
#> GSM198774     1  0.6516     -0.412 0.516 0.480 0.004
#> GSM198775     2  0.5678      0.745 0.316 0.684 0.000
#> GSM198777     2  0.5706      0.741 0.320 0.680 0.000
#> GSM198779     2  0.5016      0.795 0.240 0.760 0.000
#> GSM587218     3  0.5016      0.685 0.240 0.000 0.760
#> GSM587219     3  0.0000      0.941 0.000 0.000 1.000
#> GSM587220     3  0.0000      0.941 0.000 0.000 1.000
#> GSM587221     3  0.0000      0.941 0.000 0.000 1.000
#> GSM587222     3  0.0000      0.941 0.000 0.000 1.000
#> GSM587223     3  0.0000      0.941 0.000 0.000 1.000
#> GSM587224     3  0.4235      0.758 0.176 0.000 0.824
#> GSM587225     3  0.0000      0.941 0.000 0.000 1.000
#> GSM587226     3  0.0000      0.941 0.000 0.000 1.000
#> GSM587227     3  0.0000      0.941 0.000 0.000 1.000
#> GSM587228     3  0.0000      0.941 0.000 0.000 1.000
#> GSM587229     3  0.0000      0.941 0.000 0.000 1.000

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3 p4
#> GSM587155     2  0.0000      1.000 0.000 1.000 0.000  0
#> GSM587156     2  0.0000      1.000 0.000 1.000 0.000  0
#> GSM587157     2  0.0000      1.000 0.000 1.000 0.000  0
#> GSM587158     2  0.0000      1.000 0.000 1.000 0.000  0
#> GSM587159     2  0.0000      1.000 0.000 1.000 0.000  0
#> GSM587160     2  0.0000      1.000 0.000 1.000 0.000  0
#> GSM587161     2  0.0000      1.000 0.000 1.000 0.000  0
#> GSM587162     2  0.0000      1.000 0.000 1.000 0.000  0
#> GSM587163     2  0.0000      1.000 0.000 1.000 0.000  0
#> GSM587164     2  0.0000      1.000 0.000 1.000 0.000  0
#> GSM587165     2  0.0000      1.000 0.000 1.000 0.000  0
#> GSM587166     3  0.4998      0.039 0.000 0.488 0.512  0
#> GSM587167     2  0.0000      1.000 0.000 1.000 0.000  0
#> GSM587168     2  0.0000      1.000 0.000 1.000 0.000  0
#> GSM587169     2  0.0000      1.000 0.000 1.000 0.000  0
#> GSM587170     2  0.0000      1.000 0.000 1.000 0.000  0
#> GSM587171     2  0.0000      1.000 0.000 1.000 0.000  0
#> GSM587172     2  0.0000      1.000 0.000 1.000 0.000  0
#> GSM587173     2  0.0000      1.000 0.000 1.000 0.000  0
#> GSM587174     2  0.0000      1.000 0.000 1.000 0.000  0
#> GSM587175     2  0.0000      1.000 0.000 1.000 0.000  0
#> GSM587176     2  0.0000      1.000 0.000 1.000 0.000  0
#> GSM587177     2  0.0000      1.000 0.000 1.000 0.000  0
#> GSM587178     2  0.0000      1.000 0.000 1.000 0.000  0
#> GSM587179     2  0.0000      1.000 0.000 1.000 0.000  0
#> GSM587180     2  0.0000      1.000 0.000 1.000 0.000  0
#> GSM587181     2  0.0000      1.000 0.000 1.000 0.000  0
#> GSM587182     2  0.0000      1.000 0.000 1.000 0.000  0
#> GSM587183     2  0.0000      1.000 0.000 1.000 0.000  0
#> GSM587184     2  0.0000      1.000 0.000 1.000 0.000  0
#> GSM587185     2  0.0000      1.000 0.000 1.000 0.000  0
#> GSM587186     2  0.0000      1.000 0.000 1.000 0.000  0
#> GSM587187     2  0.0000      1.000 0.000 1.000 0.000  0
#> GSM587188     2  0.0000      1.000 0.000 1.000 0.000  0
#> GSM587189     2  0.0188      0.996 0.000 0.996 0.004  0
#> GSM587190     3  0.0921      0.938 0.000 0.028 0.972  0
#> GSM587203     1  0.0000      0.961 1.000 0.000 0.000  0
#> GSM587204     1  0.0000      0.961 1.000 0.000 0.000  0
#> GSM587205     1  0.0000      0.961 1.000 0.000 0.000  0
#> GSM587206     1  0.0000      0.961 1.000 0.000 0.000  0
#> GSM587207     1  0.0000      0.961 1.000 0.000 0.000  0
#> GSM587208     1  0.0000      0.961 1.000 0.000 0.000  0
#> GSM587209     1  0.0000      0.961 1.000 0.000 0.000  0
#> GSM587210     1  0.4564      0.526 0.672 0.000 0.328  0
#> GSM587211     1  0.0000      0.961 1.000 0.000 0.000  0
#> GSM587212     1  0.0000      0.961 1.000 0.000 0.000  0
#> GSM587213     1  0.0000      0.961 1.000 0.000 0.000  0
#> GSM587214     1  0.0000      0.961 1.000 0.000 0.000  0
#> GSM587215     1  0.0000      0.961 1.000 0.000 0.000  0
#> GSM587216     1  0.0000      0.961 1.000 0.000 0.000  0
#> GSM587217     1  0.0000      0.961 1.000 0.000 0.000  0
#> GSM587191     3  0.0000      0.968 0.000 0.000 1.000  0
#> GSM587192     3  0.0000      0.968 0.000 0.000 1.000  0
#> GSM587193     3  0.0000      0.968 0.000 0.000 1.000  0
#> GSM587194     3  0.0000      0.968 0.000 0.000 1.000  0
#> GSM587195     3  0.0000      0.968 0.000 0.000 1.000  0
#> GSM587196     3  0.0000      0.968 0.000 0.000 1.000  0
#> GSM587197     3  0.0000      0.968 0.000 0.000 1.000  0
#> GSM587198     3  0.0000      0.968 0.000 0.000 1.000  0
#> GSM587199     3  0.0000      0.968 0.000 0.000 1.000  0
#> GSM587200     3  0.0000      0.968 0.000 0.000 1.000  0
#> GSM587201     3  0.0000      0.968 0.000 0.000 1.000  0
#> GSM587202     3  0.0000      0.968 0.000 0.000 1.000  0
#> GSM198767     1  0.0000      0.961 1.000 0.000 0.000  0
#> GSM198769     1  0.0000      0.961 1.000 0.000 0.000  0
#> GSM198772     1  0.0000      0.961 1.000 0.000 0.000  0
#> GSM198773     1  0.0000      0.961 1.000 0.000 0.000  0
#> GSM198776     1  0.0000      0.961 1.000 0.000 0.000  0
#> GSM198778     1  0.4916      0.299 0.576 0.000 0.424  0
#> GSM198780     1  0.0000      0.961 1.000 0.000 0.000  0
#> GSM198781     1  0.0000      0.961 1.000 0.000 0.000  0
#> GSM198765     3  0.0000      0.968 0.000 0.000 1.000  0
#> GSM198766     3  0.0817      0.944 0.024 0.000 0.976  0
#> GSM198768     3  0.0000      0.968 0.000 0.000 1.000  0
#> GSM198770     3  0.0000      0.968 0.000 0.000 1.000  0
#> GSM198771     3  0.0000      0.968 0.000 0.000 1.000  0
#> GSM198774     3  0.0000      0.968 0.000 0.000 1.000  0
#> GSM198775     3  0.0000      0.968 0.000 0.000 1.000  0
#> GSM198777     3  0.0000      0.968 0.000 0.000 1.000  0
#> GSM198779     3  0.0000      0.968 0.000 0.000 1.000  0
#> GSM587218     4  0.0000      1.000 0.000 0.000 0.000  1
#> GSM587219     4  0.0000      1.000 0.000 0.000 0.000  1
#> GSM587220     4  0.0000      1.000 0.000 0.000 0.000  1
#> GSM587221     4  0.0000      1.000 0.000 0.000 0.000  1
#> GSM587222     4  0.0000      1.000 0.000 0.000 0.000  1
#> GSM587223     4  0.0000      1.000 0.000 0.000 0.000  1
#> GSM587224     4  0.0000      1.000 0.000 0.000 0.000  1
#> GSM587225     4  0.0000      1.000 0.000 0.000 0.000  1
#> GSM587226     4  0.0000      1.000 0.000 0.000 0.000  1
#> GSM587227     4  0.0000      1.000 0.000 0.000 0.000  1
#> GSM587228     4  0.0000      1.000 0.000 0.000 0.000  1
#> GSM587229     4  0.0000      1.000 0.000 0.000 0.000  1

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3 p4    p5
#> GSM587155     2  0.0000      0.995 0.000 1.000 0.000  0 0.000
#> GSM587156     2  0.0000      0.995 0.000 1.000 0.000  0 0.000
#> GSM587157     2  0.1764      0.930 0.000 0.928 0.008  0 0.064
#> GSM587158     2  0.0000      0.995 0.000 1.000 0.000  0 0.000
#> GSM587159     2  0.0000      0.995 0.000 1.000 0.000  0 0.000
#> GSM587160     2  0.0000      0.995 0.000 1.000 0.000  0 0.000
#> GSM587161     2  0.0000      0.995 0.000 1.000 0.000  0 0.000
#> GSM587162     2  0.0000      0.995 0.000 1.000 0.000  0 0.000
#> GSM587163     2  0.0000      0.995 0.000 1.000 0.000  0 0.000
#> GSM587164     2  0.0000      0.995 0.000 1.000 0.000  0 0.000
#> GSM587165     2  0.0000      0.995 0.000 1.000 0.000  0 0.000
#> GSM587166     3  0.4294      0.111 0.000 0.468 0.532  0 0.000
#> GSM587167     2  0.0000      0.995 0.000 1.000 0.000  0 0.000
#> GSM587168     2  0.0000      0.995 0.000 1.000 0.000  0 0.000
#> GSM587169     2  0.0000      0.995 0.000 1.000 0.000  0 0.000
#> GSM587170     2  0.0000      0.995 0.000 1.000 0.000  0 0.000
#> GSM587171     2  0.0000      0.995 0.000 1.000 0.000  0 0.000
#> GSM587172     2  0.0000      0.995 0.000 1.000 0.000  0 0.000
#> GSM587173     2  0.0000      0.995 0.000 1.000 0.000  0 0.000
#> GSM587174     2  0.0000      0.995 0.000 1.000 0.000  0 0.000
#> GSM587175     2  0.1430      0.946 0.000 0.944 0.004  0 0.052
#> GSM587176     2  0.0000      0.995 0.000 1.000 0.000  0 0.000
#> GSM587177     2  0.0000      0.995 0.000 1.000 0.000  0 0.000
#> GSM587178     2  0.0000      0.995 0.000 1.000 0.000  0 0.000
#> GSM587179     2  0.0000      0.995 0.000 1.000 0.000  0 0.000
#> GSM587180     2  0.0000      0.995 0.000 1.000 0.000  0 0.000
#> GSM587181     2  0.0000      0.995 0.000 1.000 0.000  0 0.000
#> GSM587182     2  0.0000      0.995 0.000 1.000 0.000  0 0.000
#> GSM587183     2  0.0000      0.995 0.000 1.000 0.000  0 0.000
#> GSM587184     2  0.0000      0.995 0.000 1.000 0.000  0 0.000
#> GSM587185     2  0.0000      0.995 0.000 1.000 0.000  0 0.000
#> GSM587186     2  0.0000      0.995 0.000 1.000 0.000  0 0.000
#> GSM587187     2  0.0000      0.995 0.000 1.000 0.000  0 0.000
#> GSM587188     2  0.0000      0.995 0.000 1.000 0.000  0 0.000
#> GSM587189     2  0.0963      0.958 0.000 0.964 0.036  0 0.000
#> GSM587190     3  0.0963      0.918 0.000 0.036 0.964  0 0.000
#> GSM587203     5  0.1732      0.930 0.080 0.000 0.000  0 0.920
#> GSM587204     5  0.1732      0.930 0.080 0.000 0.000  0 0.920
#> GSM587205     5  0.1732      0.930 0.080 0.000 0.000  0 0.920
#> GSM587206     5  0.1732      0.930 0.080 0.000 0.000  0 0.920
#> GSM587207     5  0.1732      0.930 0.080 0.000 0.000  0 0.920
#> GSM587208     5  0.1732      0.930 0.080 0.000 0.000  0 0.920
#> GSM587209     1  0.1270      0.865 0.948 0.000 0.000  0 0.052
#> GSM587210     1  0.0000      0.898 1.000 0.000 0.000  0 0.000
#> GSM587211     1  0.0000      0.898 1.000 0.000 0.000  0 0.000
#> GSM587212     1  0.0000      0.898 1.000 0.000 0.000  0 0.000
#> GSM587213     1  0.2732      0.750 0.840 0.000 0.000  0 0.160
#> GSM587214     5  0.3999      0.622 0.344 0.000 0.000  0 0.656
#> GSM587215     1  0.0000      0.898 1.000 0.000 0.000  0 0.000
#> GSM587216     1  0.0000      0.898 1.000 0.000 0.000  0 0.000
#> GSM587217     1  0.0000      0.898 1.000 0.000 0.000  0 0.000
#> GSM587191     3  0.0510      0.939 0.000 0.000 0.984  0 0.016
#> GSM587192     3  0.0510      0.939 0.000 0.000 0.984  0 0.016
#> GSM587193     1  0.4457      0.403 0.620 0.000 0.368  0 0.012
#> GSM587194     3  0.1251      0.921 0.036 0.000 0.956  0 0.008
#> GSM587195     3  0.1478      0.923 0.000 0.000 0.936  0 0.064
#> GSM587196     3  0.1478      0.923 0.000 0.000 0.936  0 0.064
#> GSM587197     3  0.1478      0.923 0.000 0.000 0.936  0 0.064
#> GSM587198     3  0.0000      0.940 0.000 0.000 1.000  0 0.000
#> GSM587199     3  0.0000      0.940 0.000 0.000 1.000  0 0.000
#> GSM587200     3  0.0290      0.939 0.000 0.000 0.992  0 0.008
#> GSM587201     3  0.0290      0.938 0.008 0.000 0.992  0 0.000
#> GSM587202     3  0.0000      0.940 0.000 0.000 1.000  0 0.000
#> GSM198767     5  0.1732      0.930 0.080 0.000 0.000  0 0.920
#> GSM198769     1  0.1732      0.842 0.920 0.000 0.000  0 0.080
#> GSM198772     1  0.0000      0.898 1.000 0.000 0.000  0 0.000
#> GSM198773     1  0.3143      0.681 0.796 0.000 0.000  0 0.204
#> GSM198776     5  0.1732      0.930 0.080 0.000 0.000  0 0.920
#> GSM198778     1  0.0000      0.898 1.000 0.000 0.000  0 0.000
#> GSM198780     1  0.0000      0.898 1.000 0.000 0.000  0 0.000
#> GSM198781     5  0.3999      0.622 0.344 0.000 0.000  0 0.656
#> GSM198765     3  0.0510      0.939 0.000 0.000 0.984  0 0.016
#> GSM198766     1  0.3318      0.699 0.808 0.000 0.180  0 0.012
#> GSM198768     3  0.1478      0.923 0.000 0.000 0.936  0 0.064
#> GSM198770     3  0.1478      0.923 0.000 0.000 0.936  0 0.064
#> GSM198771     3  0.0000      0.940 0.000 0.000 1.000  0 0.000
#> GSM198774     3  0.0510      0.939 0.000 0.000 0.984  0 0.016
#> GSM198775     3  0.1251      0.921 0.036 0.000 0.956  0 0.008
#> GSM198777     3  0.1478      0.923 0.000 0.000 0.936  0 0.064
#> GSM198779     3  0.0000      0.940 0.000 0.000 1.000  0 0.000
#> GSM587218     4  0.0000      1.000 0.000 0.000 0.000  1 0.000
#> GSM587219     4  0.0000      1.000 0.000 0.000 0.000  1 0.000
#> GSM587220     4  0.0000      1.000 0.000 0.000 0.000  1 0.000
#> GSM587221     4  0.0000      1.000 0.000 0.000 0.000  1 0.000
#> GSM587222     4  0.0000      1.000 0.000 0.000 0.000  1 0.000
#> GSM587223     4  0.0000      1.000 0.000 0.000 0.000  1 0.000
#> GSM587224     4  0.0000      1.000 0.000 0.000 0.000  1 0.000
#> GSM587225     4  0.0000      1.000 0.000 0.000 0.000  1 0.000
#> GSM587226     4  0.0000      1.000 0.000 0.000 0.000  1 0.000
#> GSM587227     4  0.0000      1.000 0.000 0.000 0.000  1 0.000
#> GSM587228     4  0.0000      1.000 0.000 0.000 0.000  1 0.000
#> GSM587229     4  0.0000      1.000 0.000 0.000 0.000  1 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3 p4    p5    p6
#> GSM587155     2  0.0000      0.969 0.000 1.000 0.000  0 0.000 0.000
#> GSM587156     2  0.0000      0.969 0.000 1.000 0.000  0 0.000 0.000
#> GSM587157     2  0.3629      0.625 0.000 0.712 0.276  0 0.000 0.012
#> GSM587158     2  0.0000      0.969 0.000 1.000 0.000  0 0.000 0.000
#> GSM587159     2  0.0000      0.969 0.000 1.000 0.000  0 0.000 0.000
#> GSM587160     2  0.0000      0.969 0.000 1.000 0.000  0 0.000 0.000
#> GSM587161     2  0.0000      0.969 0.000 1.000 0.000  0 0.000 0.000
#> GSM587162     2  0.0000      0.969 0.000 1.000 0.000  0 0.000 0.000
#> GSM587163     2  0.0000      0.969 0.000 1.000 0.000  0 0.000 0.000
#> GSM587164     2  0.0000      0.969 0.000 1.000 0.000  0 0.000 0.000
#> GSM587165     2  0.0000      0.969 0.000 1.000 0.000  0 0.000 0.000
#> GSM587166     2  0.4926      0.286 0.000 0.584 0.336  0 0.080 0.000
#> GSM587167     2  0.0000      0.969 0.000 1.000 0.000  0 0.000 0.000
#> GSM587168     2  0.0000      0.969 0.000 1.000 0.000  0 0.000 0.000
#> GSM587169     2  0.0000      0.969 0.000 1.000 0.000  0 0.000 0.000
#> GSM587170     2  0.0000      0.969 0.000 1.000 0.000  0 0.000 0.000
#> GSM587171     2  0.0000      0.969 0.000 1.000 0.000  0 0.000 0.000
#> GSM587172     2  0.0000      0.969 0.000 1.000 0.000  0 0.000 0.000
#> GSM587173     2  0.0000      0.969 0.000 1.000 0.000  0 0.000 0.000
#> GSM587174     2  0.0000      0.969 0.000 1.000 0.000  0 0.000 0.000
#> GSM587175     2  0.2738      0.779 0.000 0.820 0.176  0 0.000 0.004
#> GSM587176     2  0.0000      0.969 0.000 1.000 0.000  0 0.000 0.000
#> GSM587177     2  0.0000      0.969 0.000 1.000 0.000  0 0.000 0.000
#> GSM587178     2  0.0000      0.969 0.000 1.000 0.000  0 0.000 0.000
#> GSM587179     2  0.0000      0.969 0.000 1.000 0.000  0 0.000 0.000
#> GSM587180     2  0.0000      0.969 0.000 1.000 0.000  0 0.000 0.000
#> GSM587181     2  0.0000      0.969 0.000 1.000 0.000  0 0.000 0.000
#> GSM587182     2  0.0000      0.969 0.000 1.000 0.000  0 0.000 0.000
#> GSM587183     2  0.0000      0.969 0.000 1.000 0.000  0 0.000 0.000
#> GSM587184     2  0.0000      0.969 0.000 1.000 0.000  0 0.000 0.000
#> GSM587185     2  0.0000      0.969 0.000 1.000 0.000  0 0.000 0.000
#> GSM587186     2  0.0000      0.969 0.000 1.000 0.000  0 0.000 0.000
#> GSM587187     2  0.0000      0.969 0.000 1.000 0.000  0 0.000 0.000
#> GSM587188     2  0.0000      0.969 0.000 1.000 0.000  0 0.000 0.000
#> GSM587189     2  0.1765      0.874 0.000 0.904 0.096  0 0.000 0.000
#> GSM587190     3  0.3680      0.660 0.000 0.144 0.784  0 0.072 0.000
#> GSM587203     6  0.0363      0.919 0.012 0.000 0.000  0 0.000 0.988
#> GSM587204     6  0.0363      0.919 0.012 0.000 0.000  0 0.000 0.988
#> GSM587205     6  0.0363      0.919 0.012 0.000 0.000  0 0.000 0.988
#> GSM587206     6  0.0363      0.919 0.012 0.000 0.000  0 0.000 0.988
#> GSM587207     6  0.0363      0.919 0.012 0.000 0.000  0 0.000 0.988
#> GSM587208     6  0.0363      0.919 0.012 0.000 0.000  0 0.000 0.988
#> GSM587209     1  0.1556      0.848 0.920 0.000 0.000  0 0.000 0.080
#> GSM587210     1  0.1471      0.856 0.932 0.000 0.000  0 0.064 0.004
#> GSM587211     1  0.0000      0.888 1.000 0.000 0.000  0 0.000 0.000
#> GSM587212     1  0.0000      0.888 1.000 0.000 0.000  0 0.000 0.000
#> GSM587213     1  0.2941      0.695 0.780 0.000 0.000  0 0.000 0.220
#> GSM587214     6  0.3428      0.598 0.304 0.000 0.000  0 0.000 0.696
#> GSM587215     1  0.0000      0.888 1.000 0.000 0.000  0 0.000 0.000
#> GSM587216     1  0.0000      0.888 1.000 0.000 0.000  0 0.000 0.000
#> GSM587217     1  0.0000      0.888 1.000 0.000 0.000  0 0.000 0.000
#> GSM587191     5  0.0000      0.783 0.000 0.000 0.000  0 1.000 0.000
#> GSM587192     5  0.0000      0.783 0.000 0.000 0.000  0 1.000 0.000
#> GSM587193     1  0.3905      0.453 0.668 0.000 0.316  0 0.016 0.000
#> GSM587194     5  0.4372      0.237 0.024 0.000 0.432  0 0.544 0.000
#> GSM587195     3  0.0363      0.873 0.000 0.000 0.988  0 0.000 0.012
#> GSM587196     3  0.0363      0.873 0.000 0.000 0.988  0 0.000 0.012
#> GSM587197     3  0.0363      0.873 0.000 0.000 0.988  0 0.000 0.012
#> GSM587198     3  0.1556      0.869 0.000 0.000 0.920  0 0.080 0.000
#> GSM587199     3  0.1556      0.869 0.000 0.000 0.920  0 0.080 0.000
#> GSM587200     3  0.4215      0.650 0.196 0.000 0.724  0 0.080 0.000
#> GSM587201     3  0.4215      0.650 0.196 0.000 0.724  0 0.080 0.000
#> GSM587202     3  0.1556      0.869 0.000 0.000 0.920  0 0.080 0.000
#> GSM198767     6  0.0363      0.919 0.012 0.000 0.000  0 0.000 0.988
#> GSM198769     1  0.2135      0.808 0.872 0.000 0.000  0 0.000 0.128
#> GSM198772     1  0.0000      0.888 1.000 0.000 0.000  0 0.000 0.000
#> GSM198773     1  0.3221      0.622 0.736 0.000 0.000  0 0.000 0.264
#> GSM198776     6  0.0363      0.919 0.012 0.000 0.000  0 0.000 0.988
#> GSM198778     1  0.1806      0.837 0.908 0.000 0.000  0 0.088 0.004
#> GSM198780     1  0.0000      0.888 1.000 0.000 0.000  0 0.000 0.000
#> GSM198781     6  0.3428      0.598 0.304 0.000 0.000  0 0.000 0.696
#> GSM198765     5  0.0000      0.783 0.000 0.000 0.000  0 1.000 0.000
#> GSM198766     1  0.2212      0.785 0.880 0.000 0.112  0 0.008 0.000
#> GSM198768     3  0.0363      0.873 0.000 0.000 0.988  0 0.000 0.012
#> GSM198770     3  0.0363      0.873 0.000 0.000 0.988  0 0.000 0.012
#> GSM198771     3  0.1556      0.869 0.000 0.000 0.920  0 0.080 0.000
#> GSM198774     5  0.0000      0.783 0.000 0.000 0.000  0 1.000 0.000
#> GSM198775     5  0.4305      0.224 0.020 0.000 0.436  0 0.544 0.000
#> GSM198777     3  0.0363      0.873 0.000 0.000 0.988  0 0.000 0.012
#> GSM198779     3  0.1556      0.869 0.000 0.000 0.920  0 0.080 0.000
#> GSM587218     4  0.0000      1.000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587219     4  0.0000      1.000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587220     4  0.0000      1.000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587221     4  0.0000      1.000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587222     4  0.0000      1.000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587223     4  0.0000      1.000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587224     4  0.0000      1.000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587225     4  0.0000      1.000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587226     4  0.0000      1.000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587227     4  0.0000      1.000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587228     4  0.0000      1.000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587229     4  0.0000      1.000 0.000 0.000 0.000  1 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 specimen(p) k
#> CV:pam 92    4.01e-14 2
#> CV:pam 90    6.60e-29 3
#> CV:pam 90    7.34e-46 4
#> CV:pam 90    3.55e-41 5
#> CV:pam 88    3.66e-37 6

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


CV:mclust**

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

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

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

res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#>   On a matrix with 51941 rows and 92 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.955           0.970       0.986         0.4745 0.523   0.523
#> 3 3 0.939           0.953       0.979         0.2856 0.678   0.478
#> 4 4 0.987           0.956       0.982         0.1857 0.844   0.620
#> 5 5 0.898           0.833       0.908         0.0528 0.978   0.918
#> 6 6 0.873           0.815       0.898         0.0552 0.954   0.820

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

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

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

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

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

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>           class entropy silhouette    p1    p2
#> GSM587155     2   0.000      0.990 0.000 1.000
#> GSM587156     2   0.000      0.990 0.000 1.000
#> GSM587157     2   0.000      0.990 0.000 1.000
#> GSM587158     2   0.000      0.990 0.000 1.000
#> GSM587159     2   0.000      0.990 0.000 1.000
#> GSM587160     2   0.000      0.990 0.000 1.000
#> GSM587161     2   0.000      0.990 0.000 1.000
#> GSM587162     2   0.000      0.990 0.000 1.000
#> GSM587163     2   0.000      0.990 0.000 1.000
#> GSM587164     2   0.000      0.990 0.000 1.000
#> GSM587165     2   0.000      0.990 0.000 1.000
#> GSM587166     2   0.000      0.990 0.000 1.000
#> GSM587167     2   0.000      0.990 0.000 1.000
#> GSM587168     2   0.000      0.990 0.000 1.000
#> GSM587169     2   0.000      0.990 0.000 1.000
#> GSM587170     2   0.000      0.990 0.000 1.000
#> GSM587171     2   0.000      0.990 0.000 1.000
#> GSM587172     2   0.000      0.990 0.000 1.000
#> GSM587173     2   0.000      0.990 0.000 1.000
#> GSM587174     2   0.000      0.990 0.000 1.000
#> GSM587175     2   0.000      0.990 0.000 1.000
#> GSM587176     2   0.000      0.990 0.000 1.000
#> GSM587177     2   0.000      0.990 0.000 1.000
#> GSM587178     2   0.000      0.990 0.000 1.000
#> GSM587179     2   0.000      0.990 0.000 1.000
#> GSM587180     2   0.000      0.990 0.000 1.000
#> GSM587181     2   0.000      0.990 0.000 1.000
#> GSM587182     2   0.000      0.990 0.000 1.000
#> GSM587183     2   0.000      0.990 0.000 1.000
#> GSM587184     2   0.000      0.990 0.000 1.000
#> GSM587185     2   0.000      0.990 0.000 1.000
#> GSM587186     2   0.000      0.990 0.000 1.000
#> GSM587187     2   0.000      0.990 0.000 1.000
#> GSM587188     2   0.000      0.990 0.000 1.000
#> GSM587189     2   0.000      0.990 0.000 1.000
#> GSM587190     2   0.000      0.990 0.000 1.000
#> GSM587203     1   0.000      0.976 1.000 0.000
#> GSM587204     1   0.000      0.976 1.000 0.000
#> GSM587205     1   0.000      0.976 1.000 0.000
#> GSM587206     1   0.000      0.976 1.000 0.000
#> GSM587207     1   0.000      0.976 1.000 0.000
#> GSM587208     1   0.000      0.976 1.000 0.000
#> GSM587209     1   0.000      0.976 1.000 0.000
#> GSM587210     1   0.745      0.748 0.788 0.212
#> GSM587211     1   0.000      0.976 1.000 0.000
#> GSM587212     1   0.697      0.782 0.812 0.188
#> GSM587213     1   0.000      0.976 1.000 0.000
#> GSM587214     1   0.000      0.976 1.000 0.000
#> GSM587215     1   0.000      0.976 1.000 0.000
#> GSM587216     1   0.000      0.976 1.000 0.000
#> GSM587217     1   0.000      0.976 1.000 0.000
#> GSM587191     2   0.000      0.990 0.000 1.000
#> GSM587192     2   0.000      0.990 0.000 1.000
#> GSM587193     2   0.584      0.839 0.140 0.860
#> GSM587194     2   0.000      0.990 0.000 1.000
#> GSM587195     2   0.000      0.990 0.000 1.000
#> GSM587196     2   0.000      0.990 0.000 1.000
#> GSM587197     2   0.000      0.990 0.000 1.000
#> GSM587198     2   0.000      0.990 0.000 1.000
#> GSM587199     2   0.000      0.990 0.000 1.000
#> GSM587200     2   0.430      0.901 0.088 0.912
#> GSM587201     2   0.615      0.823 0.152 0.848
#> GSM587202     2   0.000      0.990 0.000 1.000
#> GSM198767     1   0.000      0.976 1.000 0.000
#> GSM198769     1   0.000      0.976 1.000 0.000
#> GSM198772     1   0.000      0.976 1.000 0.000
#> GSM198773     1   0.000      0.976 1.000 0.000
#> GSM198776     1   0.000      0.976 1.000 0.000
#> GSM198778     1   0.738      0.754 0.792 0.208
#> GSM198780     1   0.697      0.782 0.812 0.188
#> GSM198781     1   0.000      0.976 1.000 0.000
#> GSM198765     2   0.000      0.990 0.000 1.000
#> GSM198766     2   0.584      0.839 0.140 0.860
#> GSM198768     2   0.000      0.990 0.000 1.000
#> GSM198770     2   0.000      0.990 0.000 1.000
#> GSM198771     2   0.000      0.990 0.000 1.000
#> GSM198774     2   0.000      0.990 0.000 1.000
#> GSM198775     2   0.000      0.990 0.000 1.000
#> GSM198777     2   0.000      0.990 0.000 1.000
#> GSM198779     2   0.000      0.990 0.000 1.000
#> GSM587218     1   0.000      0.976 1.000 0.000
#> GSM587219     1   0.000      0.976 1.000 0.000
#> GSM587220     1   0.000      0.976 1.000 0.000
#> GSM587221     1   0.000      0.976 1.000 0.000
#> GSM587222     1   0.000      0.976 1.000 0.000
#> GSM587223     1   0.000      0.976 1.000 0.000
#> GSM587224     1   0.000      0.976 1.000 0.000
#> GSM587225     1   0.000      0.976 1.000 0.000
#> GSM587226     1   0.000      0.976 1.000 0.000
#> GSM587227     1   0.000      0.976 1.000 0.000
#> GSM587228     1   0.000      0.976 1.000 0.000
#> GSM587229     1   0.000      0.976 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
#> GSM587155     2  0.0000      0.951 0.000 1.000 0.000
#> GSM587156     2  0.0000      0.951 0.000 1.000 0.000
#> GSM587157     2  0.0000      0.951 0.000 1.000 0.000
#> GSM587158     2  0.0000      0.951 0.000 1.000 0.000
#> GSM587159     2  0.0000      0.951 0.000 1.000 0.000
#> GSM587160     2  0.0000      0.951 0.000 1.000 0.000
#> GSM587161     2  0.0000      0.951 0.000 1.000 0.000
#> GSM587162     2  0.0000      0.951 0.000 1.000 0.000
#> GSM587163     2  0.0000      0.951 0.000 1.000 0.000
#> GSM587164     2  0.0000      0.951 0.000 1.000 0.000
#> GSM587165     2  0.0000      0.951 0.000 1.000 0.000
#> GSM587166     2  0.0000      0.951 0.000 1.000 0.000
#> GSM587167     2  0.0000      0.951 0.000 1.000 0.000
#> GSM587168     2  0.0000      0.951 0.000 1.000 0.000
#> GSM587169     2  0.0000      0.951 0.000 1.000 0.000
#> GSM587170     2  0.0000      0.951 0.000 1.000 0.000
#> GSM587171     2  0.0000      0.951 0.000 1.000 0.000
#> GSM587172     2  0.0000      0.951 0.000 1.000 0.000
#> GSM587173     2  0.0000      0.951 0.000 1.000 0.000
#> GSM587174     2  0.0000      0.951 0.000 1.000 0.000
#> GSM587175     2  0.0000      0.951 0.000 1.000 0.000
#> GSM587176     2  0.0000      0.951 0.000 1.000 0.000
#> GSM587177     2  0.0000      0.951 0.000 1.000 0.000
#> GSM587178     2  0.0000      0.951 0.000 1.000 0.000
#> GSM587179     2  0.0000      0.951 0.000 1.000 0.000
#> GSM587180     2  0.0000      0.951 0.000 1.000 0.000
#> GSM587181     2  0.0000      0.951 0.000 1.000 0.000
#> GSM587182     2  0.0000      0.951 0.000 1.000 0.000
#> GSM587183     2  0.0000      0.951 0.000 1.000 0.000
#> GSM587184     2  0.0000      0.951 0.000 1.000 0.000
#> GSM587185     2  0.0000      0.951 0.000 1.000 0.000
#> GSM587186     2  0.0000      0.951 0.000 1.000 0.000
#> GSM587187     2  0.0000      0.951 0.000 1.000 0.000
#> GSM587188     2  0.4121      0.793 0.000 0.832 0.168
#> GSM587189     2  0.4121      0.793 0.000 0.832 0.168
#> GSM587190     2  0.4235      0.784 0.000 0.824 0.176
#> GSM587203     3  0.0592      0.982 0.012 0.000 0.988
#> GSM587204     3  0.0592      0.982 0.012 0.000 0.988
#> GSM587205     3  0.0592      0.982 0.012 0.000 0.988
#> GSM587206     3  0.0592      0.982 0.012 0.000 0.988
#> GSM587207     3  0.0592      0.982 0.012 0.000 0.988
#> GSM587208     3  0.0592      0.982 0.012 0.000 0.988
#> GSM587209     3  0.0000      0.987 0.000 0.000 1.000
#> GSM587210     3  0.0000      0.987 0.000 0.000 1.000
#> GSM587211     3  0.0000      0.987 0.000 0.000 1.000
#> GSM587212     3  0.0000      0.987 0.000 0.000 1.000
#> GSM587213     3  0.0000      0.987 0.000 0.000 1.000
#> GSM587214     3  0.0000      0.987 0.000 0.000 1.000
#> GSM587215     3  0.0000      0.987 0.000 0.000 1.000
#> GSM587216     3  0.0000      0.987 0.000 0.000 1.000
#> GSM587217     3  0.0000      0.987 0.000 0.000 1.000
#> GSM587191     3  0.3816      0.807 0.000 0.148 0.852
#> GSM587192     3  0.0000      0.987 0.000 0.000 1.000
#> GSM587193     3  0.1031      0.967 0.000 0.024 0.976
#> GSM587194     2  0.4974      0.713 0.000 0.764 0.236
#> GSM587195     3  0.0592      0.979 0.000 0.012 0.988
#> GSM587196     3  0.0000      0.987 0.000 0.000 1.000
#> GSM587197     2  0.5254      0.677 0.000 0.736 0.264
#> GSM587198     3  0.0000      0.987 0.000 0.000 1.000
#> GSM587199     3  0.0424      0.983 0.000 0.008 0.992
#> GSM587200     3  0.0000      0.987 0.000 0.000 1.000
#> GSM587201     3  0.0000      0.987 0.000 0.000 1.000
#> GSM587202     3  0.0237      0.985 0.000 0.004 0.996
#> GSM198767     3  0.0592      0.982 0.012 0.000 0.988
#> GSM198769     3  0.0000      0.987 0.000 0.000 1.000
#> GSM198772     3  0.0000      0.987 0.000 0.000 1.000
#> GSM198773     3  0.0000      0.987 0.000 0.000 1.000
#> GSM198776     3  0.0592      0.982 0.012 0.000 0.988
#> GSM198778     3  0.0000      0.987 0.000 0.000 1.000
#> GSM198780     3  0.0000      0.987 0.000 0.000 1.000
#> GSM198781     3  0.0000      0.987 0.000 0.000 1.000
#> GSM198765     3  0.2711      0.889 0.000 0.088 0.912
#> GSM198766     3  0.1031      0.967 0.000 0.024 0.976
#> GSM198768     3  0.0237      0.985 0.000 0.004 0.996
#> GSM198770     2  0.5254      0.677 0.000 0.736 0.264
#> GSM198771     3  0.0000      0.987 0.000 0.000 1.000
#> GSM198774     3  0.0000      0.987 0.000 0.000 1.000
#> GSM198775     2  0.4974      0.713 0.000 0.764 0.236
#> GSM198777     3  0.0000      0.987 0.000 0.000 1.000
#> GSM198779     3  0.0424      0.983 0.000 0.008 0.992
#> GSM587218     1  0.0000      1.000 1.000 0.000 0.000
#> GSM587219     1  0.0000      1.000 1.000 0.000 0.000
#> GSM587220     1  0.0000      1.000 1.000 0.000 0.000
#> GSM587221     1  0.0000      1.000 1.000 0.000 0.000
#> GSM587222     1  0.0000      1.000 1.000 0.000 0.000
#> GSM587223     1  0.0000      1.000 1.000 0.000 0.000
#> GSM587224     1  0.0000      1.000 1.000 0.000 0.000
#> GSM587225     1  0.0000      1.000 1.000 0.000 0.000
#> GSM587226     1  0.0000      1.000 1.000 0.000 0.000
#> GSM587227     1  0.0000      1.000 1.000 0.000 0.000
#> GSM587228     1  0.0000      1.000 1.000 0.000 0.000
#> GSM587229     1  0.0000      1.000 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
#> GSM587155     2  0.0000      0.991 0.000 1.000 0.000  0
#> GSM587156     2  0.0000      0.991 0.000 1.000 0.000  0
#> GSM587157     2  0.0000      0.991 0.000 1.000 0.000  0
#> GSM587158     2  0.0000      0.991 0.000 1.000 0.000  0
#> GSM587159     2  0.0000      0.991 0.000 1.000 0.000  0
#> GSM587160     2  0.0000      0.991 0.000 1.000 0.000  0
#> GSM587161     2  0.0000      0.991 0.000 1.000 0.000  0
#> GSM587162     2  0.0000      0.991 0.000 1.000 0.000  0
#> GSM587163     2  0.0000      0.991 0.000 1.000 0.000  0
#> GSM587164     2  0.0000      0.991 0.000 1.000 0.000  0
#> GSM587165     2  0.0000      0.991 0.000 1.000 0.000  0
#> GSM587166     2  0.0592      0.977 0.000 0.984 0.016  0
#> GSM587167     2  0.0336      0.984 0.000 0.992 0.008  0
#> GSM587168     2  0.0000      0.991 0.000 1.000 0.000  0
#> GSM587169     2  0.0000      0.991 0.000 1.000 0.000  0
#> GSM587170     2  0.0000      0.991 0.000 1.000 0.000  0
#> GSM587171     2  0.0000      0.991 0.000 1.000 0.000  0
#> GSM587172     2  0.0000      0.991 0.000 1.000 0.000  0
#> GSM587173     2  0.0000      0.991 0.000 1.000 0.000  0
#> GSM587174     2  0.0000      0.991 0.000 1.000 0.000  0
#> GSM587175     2  0.0000      0.991 0.000 1.000 0.000  0
#> GSM587176     2  0.0000      0.991 0.000 1.000 0.000  0
#> GSM587177     2  0.0000      0.991 0.000 1.000 0.000  0
#> GSM587178     2  0.0000      0.991 0.000 1.000 0.000  0
#> GSM587179     2  0.0000      0.991 0.000 1.000 0.000  0
#> GSM587180     2  0.0000      0.991 0.000 1.000 0.000  0
#> GSM587181     2  0.0000      0.991 0.000 1.000 0.000  0
#> GSM587182     2  0.0000      0.991 0.000 1.000 0.000  0
#> GSM587183     2  0.0000      0.991 0.000 1.000 0.000  0
#> GSM587184     2  0.0000      0.991 0.000 1.000 0.000  0
#> GSM587185     2  0.0000      0.991 0.000 1.000 0.000  0
#> GSM587186     2  0.0000      0.991 0.000 1.000 0.000  0
#> GSM587187     2  0.1557      0.937 0.000 0.944 0.056  0
#> GSM587188     2  0.3024      0.819 0.000 0.852 0.148  0
#> GSM587189     2  0.1792      0.924 0.000 0.932 0.068  0
#> GSM587190     3  0.4925      0.300 0.000 0.428 0.572  0
#> GSM587203     1  0.0000      1.000 1.000 0.000 0.000  0
#> GSM587204     1  0.0000      1.000 1.000 0.000 0.000  0
#> GSM587205     1  0.0000      1.000 1.000 0.000 0.000  0
#> GSM587206     1  0.0000      1.000 1.000 0.000 0.000  0
#> GSM587207     1  0.0000      1.000 1.000 0.000 0.000  0
#> GSM587208     1  0.0000      1.000 1.000 0.000 0.000  0
#> GSM587209     1  0.0000      1.000 1.000 0.000 0.000  0
#> GSM587210     1  0.0000      1.000 1.000 0.000 0.000  0
#> GSM587211     1  0.0000      1.000 1.000 0.000 0.000  0
#> GSM587212     1  0.0000      1.000 1.000 0.000 0.000  0
#> GSM587213     1  0.0000      1.000 1.000 0.000 0.000  0
#> GSM587214     1  0.0000      1.000 1.000 0.000 0.000  0
#> GSM587215     1  0.0000      1.000 1.000 0.000 0.000  0
#> GSM587216     1  0.0000      1.000 1.000 0.000 0.000  0
#> GSM587217     1  0.0000      1.000 1.000 0.000 0.000  0
#> GSM587191     3  0.0000      0.917 0.000 0.000 1.000  0
#> GSM587192     3  0.0469      0.909 0.012 0.000 0.988  0
#> GSM587193     3  0.0000      0.917 0.000 0.000 1.000  0
#> GSM587194     3  0.4454      0.576 0.000 0.308 0.692  0
#> GSM587195     3  0.0000      0.917 0.000 0.000 1.000  0
#> GSM587196     3  0.0000      0.917 0.000 0.000 1.000  0
#> GSM587197     3  0.0000      0.917 0.000 0.000 1.000  0
#> GSM587198     3  0.0000      0.917 0.000 0.000 1.000  0
#> GSM587199     3  0.0000      0.917 0.000 0.000 1.000  0
#> GSM587200     3  0.3123      0.774 0.156 0.000 0.844  0
#> GSM587201     3  0.2921      0.792 0.140 0.000 0.860  0
#> GSM587202     3  0.0000      0.917 0.000 0.000 1.000  0
#> GSM198767     1  0.0000      1.000 1.000 0.000 0.000  0
#> GSM198769     1  0.0000      1.000 1.000 0.000 0.000  0
#> GSM198772     1  0.0000      1.000 1.000 0.000 0.000  0
#> GSM198773     1  0.0000      1.000 1.000 0.000 0.000  0
#> GSM198776     1  0.0000      1.000 1.000 0.000 0.000  0
#> GSM198778     1  0.0000      1.000 1.000 0.000 0.000  0
#> GSM198780     1  0.0000      1.000 1.000 0.000 0.000  0
#> GSM198781     1  0.0000      1.000 1.000 0.000 0.000  0
#> GSM198765     3  0.0000      0.917 0.000 0.000 1.000  0
#> GSM198766     3  0.0000      0.917 0.000 0.000 1.000  0
#> GSM198768     3  0.0000      0.917 0.000 0.000 1.000  0
#> GSM198770     3  0.0000      0.917 0.000 0.000 1.000  0
#> GSM198771     3  0.0000      0.917 0.000 0.000 1.000  0
#> GSM198774     3  0.0188      0.915 0.004 0.000 0.996  0
#> GSM198775     3  0.4454      0.576 0.000 0.308 0.692  0
#> GSM198777     3  0.0000      0.917 0.000 0.000 1.000  0
#> GSM198779     3  0.0000      0.917 0.000 0.000 1.000  0
#> GSM587218     4  0.0000      1.000 0.000 0.000 0.000  1
#> GSM587219     4  0.0000      1.000 0.000 0.000 0.000  1
#> GSM587220     4  0.0000      1.000 0.000 0.000 0.000  1
#> GSM587221     4  0.0000      1.000 0.000 0.000 0.000  1
#> GSM587222     4  0.0000      1.000 0.000 0.000 0.000  1
#> GSM587223     4  0.0000      1.000 0.000 0.000 0.000  1
#> GSM587224     4  0.0000      1.000 0.000 0.000 0.000  1
#> GSM587225     4  0.0000      1.000 0.000 0.000 0.000  1
#> GSM587226     4  0.0000      1.000 0.000 0.000 0.000  1
#> GSM587227     4  0.0000      1.000 0.000 0.000 0.000  1
#> GSM587228     4  0.0000      1.000 0.000 0.000 0.000  1
#> GSM587229     4  0.0000      1.000 0.000 0.000 0.000  1

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3 p4    p5
#> GSM587155     2  0.0000      0.943 0.000 1.000 0.000  0 0.000
#> GSM587156     2  0.2648      0.798 0.000 0.848 0.000  0 0.152
#> GSM587157     2  0.1121      0.912 0.000 0.956 0.000  0 0.044
#> GSM587158     2  0.0000      0.943 0.000 1.000 0.000  0 0.000
#> GSM587159     2  0.0000      0.943 0.000 1.000 0.000  0 0.000
#> GSM587160     2  0.0000      0.943 0.000 1.000 0.000  0 0.000
#> GSM587161     2  0.0000      0.943 0.000 1.000 0.000  0 0.000
#> GSM587162     2  0.0404      0.935 0.000 0.988 0.000  0 0.012
#> GSM587163     2  0.0000      0.943 0.000 1.000 0.000  0 0.000
#> GSM587164     2  0.0794      0.924 0.000 0.972 0.000  0 0.028
#> GSM587165     2  0.0000      0.943 0.000 1.000 0.000  0 0.000
#> GSM587166     2  0.2930      0.777 0.000 0.832 0.004  0 0.164
#> GSM587167     2  0.2561      0.810 0.000 0.856 0.000  0 0.144
#> GSM587168     2  0.0000      0.943 0.000 1.000 0.000  0 0.000
#> GSM587169     2  0.0000      0.943 0.000 1.000 0.000  0 0.000
#> GSM587170     2  0.0404      0.935 0.000 0.988 0.000  0 0.012
#> GSM587171     2  0.0000      0.943 0.000 1.000 0.000  0 0.000
#> GSM587172     2  0.0000      0.943 0.000 1.000 0.000  0 0.000
#> GSM587173     2  0.0000      0.943 0.000 1.000 0.000  0 0.000
#> GSM587174     2  0.0000      0.943 0.000 1.000 0.000  0 0.000
#> GSM587175     2  0.1732      0.874 0.000 0.920 0.000  0 0.080
#> GSM587176     2  0.0000      0.943 0.000 1.000 0.000  0 0.000
#> GSM587177     2  0.0000      0.943 0.000 1.000 0.000  0 0.000
#> GSM587178     2  0.0000      0.943 0.000 1.000 0.000  0 0.000
#> GSM587179     2  0.0000      0.943 0.000 1.000 0.000  0 0.000
#> GSM587180     2  0.0000      0.943 0.000 1.000 0.000  0 0.000
#> GSM587181     2  0.0000      0.943 0.000 1.000 0.000  0 0.000
#> GSM587182     2  0.0000      0.943 0.000 1.000 0.000  0 0.000
#> GSM587183     2  0.0000      0.943 0.000 1.000 0.000  0 0.000
#> GSM587184     2  0.0000      0.943 0.000 1.000 0.000  0 0.000
#> GSM587185     2  0.0000      0.943 0.000 1.000 0.000  0 0.000
#> GSM587186     2  0.0000      0.943 0.000 1.000 0.000  0 0.000
#> GSM587187     2  0.5646     -0.118 0.000 0.520 0.080  0 0.400
#> GSM587188     5  0.5845      0.453 0.000 0.352 0.108  0 0.540
#> GSM587189     2  0.5775     -0.277 0.000 0.472 0.088  0 0.440
#> GSM587190     5  0.5373      0.676 0.000 0.092 0.276  0 0.632
#> GSM587203     1  0.3452      0.804 0.756 0.000 0.000  0 0.244
#> GSM587204     1  0.3424      0.803 0.760 0.000 0.000  0 0.240
#> GSM587205     1  0.3534      0.798 0.744 0.000 0.000  0 0.256
#> GSM587206     1  0.3534      0.798 0.744 0.000 0.000  0 0.256
#> GSM587207     1  0.3534      0.798 0.744 0.000 0.000  0 0.256
#> GSM587208     1  0.3534      0.798 0.744 0.000 0.000  0 0.256
#> GSM587209     1  0.1608      0.865 0.928 0.000 0.000  0 0.072
#> GSM587210     1  0.2964      0.837 0.856 0.000 0.024  0 0.120
#> GSM587211     1  0.1608      0.865 0.928 0.000 0.000  0 0.072
#> GSM587212     1  0.2915      0.839 0.860 0.000 0.024  0 0.116
#> GSM587213     1  0.0000      0.871 1.000 0.000 0.000  0 0.000
#> GSM587214     1  0.0000      0.871 1.000 0.000 0.000  0 0.000
#> GSM587215     1  0.2304      0.854 0.892 0.000 0.008  0 0.100
#> GSM587216     1  0.2017      0.860 0.912 0.000 0.008  0 0.080
#> GSM587217     1  0.0000      0.871 1.000 0.000 0.000  0 0.000
#> GSM587191     3  0.0609      0.857 0.000 0.000 0.980  0 0.020
#> GSM587192     3  0.1197      0.848 0.000 0.000 0.952  0 0.048
#> GSM587193     3  0.4397     -0.058 0.004 0.000 0.564  0 0.432
#> GSM587194     5  0.5423      0.641 0.000 0.064 0.388  0 0.548
#> GSM587195     3  0.0404      0.859 0.000 0.000 0.988  0 0.012
#> GSM587196     3  0.0162      0.859 0.000 0.000 0.996  0 0.004
#> GSM587197     3  0.2020      0.803 0.000 0.000 0.900  0 0.100
#> GSM587198     3  0.0609      0.854 0.000 0.000 0.980  0 0.020
#> GSM587199     3  0.0609      0.854 0.000 0.000 0.980  0 0.020
#> GSM587200     3  0.4333      0.583 0.188 0.000 0.752  0 0.060
#> GSM587201     3  0.4367      0.575 0.192 0.000 0.748  0 0.060
#> GSM587202     3  0.0290      0.858 0.000 0.000 0.992  0 0.008
#> GSM198767     1  0.3534      0.798 0.744 0.000 0.000  0 0.256
#> GSM198769     1  0.1608      0.865 0.928 0.000 0.000  0 0.072
#> GSM198772     1  0.1608      0.865 0.928 0.000 0.000  0 0.072
#> GSM198773     1  0.0000      0.871 1.000 0.000 0.000  0 0.000
#> GSM198776     1  0.3424      0.803 0.760 0.000 0.000  0 0.240
#> GSM198778     1  0.3002      0.836 0.856 0.000 0.028  0 0.116
#> GSM198780     1  0.2964      0.837 0.856 0.000 0.024  0 0.120
#> GSM198781     1  0.0000      0.871 1.000 0.000 0.000  0 0.000
#> GSM198765     3  0.0609      0.857 0.000 0.000 0.980  0 0.020
#> GSM198766     3  0.4397     -0.058 0.004 0.000 0.564  0 0.432
#> GSM198768     3  0.0290      0.858 0.000 0.000 0.992  0 0.008
#> GSM198770     3  0.2127      0.795 0.000 0.000 0.892  0 0.108
#> GSM198771     3  0.0510      0.855 0.000 0.000 0.984  0 0.016
#> GSM198774     3  0.1197      0.848 0.000 0.000 0.952  0 0.048
#> GSM198775     5  0.5423      0.641 0.000 0.064 0.388  0 0.548
#> GSM198777     3  0.0000      0.859 0.000 0.000 1.000  0 0.000
#> GSM198779     3  0.0609      0.854 0.000 0.000 0.980  0 0.020
#> GSM587218     4  0.0000      1.000 0.000 0.000 0.000  1 0.000
#> GSM587219     4  0.0000      1.000 0.000 0.000 0.000  1 0.000
#> GSM587220     4  0.0000      1.000 0.000 0.000 0.000  1 0.000
#> GSM587221     4  0.0000      1.000 0.000 0.000 0.000  1 0.000
#> GSM587222     4  0.0000      1.000 0.000 0.000 0.000  1 0.000
#> GSM587223     4  0.0000      1.000 0.000 0.000 0.000  1 0.000
#> GSM587224     4  0.0000      1.000 0.000 0.000 0.000  1 0.000
#> GSM587225     4  0.0000      1.000 0.000 0.000 0.000  1 0.000
#> GSM587226     4  0.0000      1.000 0.000 0.000 0.000  1 0.000
#> GSM587227     4  0.0000      1.000 0.000 0.000 0.000  1 0.000
#> GSM587228     4  0.0000      1.000 0.000 0.000 0.000  1 0.000
#> GSM587229     4  0.0000      1.000 0.000 0.000 0.000  1 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3 p4    p5    p6
#> GSM587155     2  0.1765     0.8588 0.000 0.904 0.000  0 0.096 0.000
#> GSM587156     2  0.3817     0.4355 0.000 0.568 0.000  0 0.432 0.000
#> GSM587157     2  0.3819     0.5956 0.000 0.652 0.000  0 0.340 0.008
#> GSM587158     2  0.0000     0.9059 0.000 1.000 0.000  0 0.000 0.000
#> GSM587159     2  0.0000     0.9059 0.000 1.000 0.000  0 0.000 0.000
#> GSM587160     2  0.0000     0.9059 0.000 1.000 0.000  0 0.000 0.000
#> GSM587161     2  0.0000     0.9059 0.000 1.000 0.000  0 0.000 0.000
#> GSM587162     2  0.2491     0.8025 0.000 0.836 0.000  0 0.164 0.000
#> GSM587163     2  0.0000     0.9059 0.000 1.000 0.000  0 0.000 0.000
#> GSM587164     2  0.3330     0.6812 0.000 0.716 0.000  0 0.284 0.000
#> GSM587165     2  0.0000     0.9059 0.000 1.000 0.000  0 0.000 0.000
#> GSM587166     2  0.3828     0.4181 0.000 0.560 0.000  0 0.440 0.000
#> GSM587167     2  0.3823     0.4281 0.000 0.564 0.000  0 0.436 0.000
#> GSM587168     2  0.0000     0.9059 0.000 1.000 0.000  0 0.000 0.000
#> GSM587169     2  0.0000     0.9059 0.000 1.000 0.000  0 0.000 0.000
#> GSM587170     2  0.1444     0.8740 0.000 0.928 0.000  0 0.072 0.000
#> GSM587171     2  0.0000     0.9059 0.000 1.000 0.000  0 0.000 0.000
#> GSM587172     2  0.0000     0.9059 0.000 1.000 0.000  0 0.000 0.000
#> GSM587173     2  0.0000     0.9059 0.000 1.000 0.000  0 0.000 0.000
#> GSM587174     2  0.0000     0.9059 0.000 1.000 0.000  0 0.000 0.000
#> GSM587175     2  0.3684     0.5398 0.000 0.628 0.000  0 0.372 0.000
#> GSM587176     2  0.0000     0.9059 0.000 1.000 0.000  0 0.000 0.000
#> GSM587177     2  0.0000     0.9059 0.000 1.000 0.000  0 0.000 0.000
#> GSM587178     2  0.0000     0.9059 0.000 1.000 0.000  0 0.000 0.000
#> GSM587179     2  0.0000     0.9059 0.000 1.000 0.000  0 0.000 0.000
#> GSM587180     2  0.1714     0.8618 0.000 0.908 0.000  0 0.092 0.000
#> GSM587181     2  0.0260     0.9037 0.000 0.992 0.000  0 0.008 0.000
#> GSM587182     2  0.0000     0.9059 0.000 1.000 0.000  0 0.000 0.000
#> GSM587183     2  0.1387     0.8771 0.000 0.932 0.000  0 0.068 0.000
#> GSM587184     2  0.0146     0.9045 0.000 0.996 0.000  0 0.004 0.000
#> GSM587185     2  0.0632     0.8974 0.000 0.976 0.000  0 0.024 0.000
#> GSM587186     2  0.0363     0.9025 0.000 0.988 0.000  0 0.012 0.000
#> GSM587187     5  0.1204     0.8230 0.000 0.056 0.000  0 0.944 0.000
#> GSM587188     5  0.1152     0.8309 0.000 0.044 0.000  0 0.952 0.004
#> GSM587189     5  0.0865     0.8301 0.000 0.036 0.000  0 0.964 0.000
#> GSM587190     5  0.2213     0.8052 0.000 0.004 0.100  0 0.888 0.008
#> GSM587203     6  0.1556     0.9880 0.080 0.000 0.000  0 0.000 0.920
#> GSM587204     6  0.1753     0.9817 0.084 0.000 0.000  0 0.004 0.912
#> GSM587205     6  0.1444     0.9940 0.072 0.000 0.000  0 0.000 0.928
#> GSM587206     6  0.1444     0.9940 0.072 0.000 0.000  0 0.000 0.928
#> GSM587207     6  0.1444     0.9940 0.072 0.000 0.000  0 0.000 0.928
#> GSM587208     6  0.1444     0.9940 0.072 0.000 0.000  0 0.000 0.928
#> GSM587209     1  0.0858     0.8125 0.968 0.000 0.000  0 0.004 0.028
#> GSM587210     1  0.0000     0.8090 1.000 0.000 0.000  0 0.000 0.000
#> GSM587211     1  0.0632     0.8141 0.976 0.000 0.000  0 0.000 0.024
#> GSM587212     1  0.0000     0.8090 1.000 0.000 0.000  0 0.000 0.000
#> GSM587213     1  0.3830     0.4894 0.620 0.000 0.000  0 0.004 0.376
#> GSM587214     1  0.3955     0.3823 0.560 0.000 0.000  0 0.004 0.436
#> GSM587215     1  0.1082     0.8106 0.956 0.000 0.000  0 0.004 0.040
#> GSM587216     1  0.0363     0.8126 0.988 0.000 0.000  0 0.000 0.012
#> GSM587217     1  0.3747     0.4564 0.604 0.000 0.000  0 0.000 0.396
#> GSM587191     3  0.0777     0.8440 0.004 0.000 0.972  0 0.024 0.000
#> GSM587192     3  0.3537     0.7873 0.040 0.000 0.824  0 0.104 0.032
#> GSM587193     3  0.5613     0.0683 0.036 0.000 0.468  0 0.436 0.060
#> GSM587194     5  0.4120     0.6968 0.008 0.000 0.228  0 0.724 0.040
#> GSM587195     3  0.0458     0.8458 0.000 0.000 0.984  0 0.016 0.000
#> GSM587196     3  0.0260     0.8451 0.008 0.000 0.992  0 0.000 0.000
#> GSM587197     3  0.3788     0.6686 0.008 0.000 0.740  0 0.232 0.020
#> GSM587198     3  0.0260     0.8451 0.008 0.000 0.992  0 0.000 0.000
#> GSM587199     3  0.0547     0.8433 0.020 0.000 0.980  0 0.000 0.000
#> GSM587200     3  0.4661     0.7122 0.136 0.000 0.732  0 0.104 0.028
#> GSM587201     3  0.4842     0.6949 0.148 0.000 0.716  0 0.104 0.032
#> GSM587202     3  0.0000     0.8446 0.000 0.000 1.000  0 0.000 0.000
#> GSM198767     6  0.1444     0.9940 0.072 0.000 0.000  0 0.000 0.928
#> GSM198769     1  0.0777     0.8136 0.972 0.000 0.000  0 0.004 0.024
#> GSM198772     1  0.0632     0.8141 0.976 0.000 0.000  0 0.000 0.024
#> GSM198773     1  0.3955     0.3823 0.560 0.000 0.000  0 0.004 0.436
#> GSM198776     6  0.1644     0.9890 0.076 0.000 0.000  0 0.004 0.920
#> GSM198778     1  0.0000     0.8090 1.000 0.000 0.000  0 0.000 0.000
#> GSM198780     1  0.0000     0.8090 1.000 0.000 0.000  0 0.000 0.000
#> GSM198781     1  0.3955     0.3823 0.560 0.000 0.000  0 0.004 0.436
#> GSM198765     3  0.0692     0.8447 0.004 0.000 0.976  0 0.020 0.000
#> GSM198766     3  0.5613     0.0683 0.036 0.000 0.468  0 0.436 0.060
#> GSM198768     3  0.0146     0.8454 0.000 0.000 0.996  0 0.004 0.000
#> GSM198770     3  0.3788     0.6686 0.008 0.000 0.740  0 0.232 0.020
#> GSM198771     3  0.0260     0.8451 0.008 0.000 0.992  0 0.000 0.000
#> GSM198774     3  0.3463     0.7886 0.040 0.000 0.828  0 0.104 0.028
#> GSM198775     5  0.4120     0.6968 0.008 0.000 0.228  0 0.724 0.040
#> GSM198777     3  0.0000     0.8446 0.000 0.000 1.000  0 0.000 0.000
#> GSM198779     3  0.0547     0.8433 0.020 0.000 0.980  0 0.000 0.000
#> GSM587218     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587219     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587220     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587221     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587222     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587223     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587224     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587225     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587226     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587227     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587228     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587229     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000 0.000

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

consensus_heatmap(res, k = 2)

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

consensus_heatmap(res, k = 3)

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

consensus_heatmap(res, k = 4)

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

consensus_heatmap(res, k = 5)

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

consensus_heatmap(res, k = 6)

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

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

membership_heatmap(res, k = 2)

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

membership_heatmap(res, k = 3)

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

membership_heatmap(res, k = 4)

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

membership_heatmap(res, k = 5)

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

membership_heatmap(res, k = 6)

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

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

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

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

get_signatures(res, k = 3)

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

get_signatures(res, k = 4)

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

get_signatures(res, k = 5)

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

get_signatures(res, k = 6)

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

Signature heatmaps where rows are not scaled:

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

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

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

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

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

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

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

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

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

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

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk CV-mclust-signature_compare

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

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

An example of the output of tb is:

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

The columns in tb are:

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

UMAP plot which shows how samples are separated.

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

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

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

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

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

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

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

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

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

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

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk CV-mclust-collect-classes

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

test_to_known_factors(res)
#>            n specimen(p) k
#> CV:mclust 92    1.16e-17 2
#> CV:mclust 92    7.03e-30 3
#> CV:mclust 91    1.66e-47 4
#> CV:mclust 87    6.47e-47 5
#> CV:mclust 82    1.00e-45 6

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


CV:NMF*

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

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

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

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

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

collect_plots(res)

plot of chunk 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.991       0.996         0.5007 0.500   0.500
#> 3 3 0.776           0.925       0.944         0.2185 0.888   0.778
#> 4 4 0.989           0.947       0.979         0.1895 0.815   0.568
#> 5 5 0.949           0.876       0.944         0.0598 0.934   0.768
#> 6 6 0.850           0.705       0.823         0.0369 0.952   0.799

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

suggest_best_k(res)
#> [1] 5
#> attr(,"optional")
#> [1] 2 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
#> GSM587155     2  0.0000      0.993 0.000 1.000
#> GSM587156     2  0.0000      0.993 0.000 1.000
#> GSM587157     2  0.0000      0.993 0.000 1.000
#> GSM587158     2  0.0000      0.993 0.000 1.000
#> GSM587159     2  0.0000      0.993 0.000 1.000
#> GSM587160     2  0.0000      0.993 0.000 1.000
#> GSM587161     2  0.0000      0.993 0.000 1.000
#> GSM587162     2  0.0000      0.993 0.000 1.000
#> GSM587163     2  0.0000      0.993 0.000 1.000
#> GSM587164     2  0.0000      0.993 0.000 1.000
#> GSM587165     2  0.0000      0.993 0.000 1.000
#> GSM587166     2  0.0000      0.993 0.000 1.000
#> GSM587167     2  0.0000      0.993 0.000 1.000
#> GSM587168     2  0.0000      0.993 0.000 1.000
#> GSM587169     2  0.0000      0.993 0.000 1.000
#> GSM587170     2  0.0000      0.993 0.000 1.000
#> GSM587171     2  0.0000      0.993 0.000 1.000
#> GSM587172     2  0.0000      0.993 0.000 1.000
#> GSM587173     2  0.0000      0.993 0.000 1.000
#> GSM587174     2  0.0000      0.993 0.000 1.000
#> GSM587175     2  0.0000      0.993 0.000 1.000
#> GSM587176     2  0.0000      0.993 0.000 1.000
#> GSM587177     2  0.0000      0.993 0.000 1.000
#> GSM587178     2  0.0000      0.993 0.000 1.000
#> GSM587179     2  0.0000      0.993 0.000 1.000
#> GSM587180     2  0.0000      0.993 0.000 1.000
#> GSM587181     2  0.0000      0.993 0.000 1.000
#> GSM587182     2  0.0000      0.993 0.000 1.000
#> GSM587183     2  0.0000      0.993 0.000 1.000
#> GSM587184     2  0.0000      0.993 0.000 1.000
#> GSM587185     2  0.0000      0.993 0.000 1.000
#> GSM587186     2  0.0000      0.993 0.000 1.000
#> GSM587187     2  0.0000      0.993 0.000 1.000
#> GSM587188     2  0.0000      0.993 0.000 1.000
#> GSM587189     2  0.0000      0.993 0.000 1.000
#> GSM587190     2  0.0000      0.993 0.000 1.000
#> GSM587203     1  0.0000      1.000 1.000 0.000
#> GSM587204     1  0.0000      1.000 1.000 0.000
#> GSM587205     1  0.0000      1.000 1.000 0.000
#> GSM587206     1  0.0000      1.000 1.000 0.000
#> GSM587207     1  0.0000      1.000 1.000 0.000
#> GSM587208     1  0.0000      1.000 1.000 0.000
#> GSM587209     1  0.0000      1.000 1.000 0.000
#> GSM587210     1  0.0000      1.000 1.000 0.000
#> GSM587211     1  0.0000      1.000 1.000 0.000
#> GSM587212     1  0.0000      1.000 1.000 0.000
#> GSM587213     1  0.0000      1.000 1.000 0.000
#> GSM587214     1  0.0000      1.000 1.000 0.000
#> GSM587215     1  0.0000      1.000 1.000 0.000
#> GSM587216     1  0.0000      1.000 1.000 0.000
#> GSM587217     1  0.0000      1.000 1.000 0.000
#> GSM587191     2  0.0000      0.993 0.000 1.000
#> GSM587192     1  0.0000      1.000 1.000 0.000
#> GSM587193     1  0.0000      1.000 1.000 0.000
#> GSM587194     2  0.0672      0.986 0.008 0.992
#> GSM587195     2  0.0000      0.993 0.000 1.000
#> GSM587196     2  0.8443      0.631 0.272 0.728
#> GSM587197     2  0.0000      0.993 0.000 1.000
#> GSM587198     2  0.0000      0.993 0.000 1.000
#> GSM587199     2  0.0000      0.993 0.000 1.000
#> GSM587200     1  0.0000      1.000 1.000 0.000
#> GSM587201     1  0.0000      1.000 1.000 0.000
#> GSM587202     2  0.0000      0.993 0.000 1.000
#> GSM198767     1  0.0000      1.000 1.000 0.000
#> GSM198769     1  0.0000      1.000 1.000 0.000
#> GSM198772     1  0.0000      1.000 1.000 0.000
#> GSM198773     1  0.0000      1.000 1.000 0.000
#> GSM198776     1  0.0000      1.000 1.000 0.000
#> GSM198778     1  0.0000      1.000 1.000 0.000
#> GSM198780     1  0.0000      1.000 1.000 0.000
#> GSM198781     1  0.0000      1.000 1.000 0.000
#> GSM198765     2  0.0000      0.993 0.000 1.000
#> GSM198766     1  0.0000      1.000 1.000 0.000
#> GSM198768     2  0.0000      0.993 0.000 1.000
#> GSM198770     2  0.0000      0.993 0.000 1.000
#> GSM198771     2  0.0000      0.993 0.000 1.000
#> GSM198774     1  0.0000      1.000 1.000 0.000
#> GSM198775     2  0.0376      0.989 0.004 0.996
#> GSM198777     2  0.3733      0.920 0.072 0.928
#> GSM198779     2  0.0000      0.993 0.000 1.000
#> GSM587218     1  0.0000      1.000 1.000 0.000
#> GSM587219     1  0.0000      1.000 1.000 0.000
#> GSM587220     1  0.0000      1.000 1.000 0.000
#> GSM587221     1  0.0000      1.000 1.000 0.000
#> GSM587222     1  0.0000      1.000 1.000 0.000
#> GSM587223     1  0.0000      1.000 1.000 0.000
#> GSM587224     1  0.0000      1.000 1.000 0.000
#> GSM587225     1  0.0000      1.000 1.000 0.000
#> GSM587226     1  0.0000      1.000 1.000 0.000
#> GSM587227     1  0.0000      1.000 1.000 0.000
#> GSM587228     1  0.0000      1.000 1.000 0.000
#> GSM587229     1  0.0000      1.000 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1    p2    p3
#> GSM587155     2  0.0000      0.954 0.000 1.000 0.000
#> GSM587156     2  0.0000      0.954 0.000 1.000 0.000
#> GSM587157     2  0.0237      0.952 0.000 0.996 0.004
#> GSM587158     2  0.0000      0.954 0.000 1.000 0.000
#> GSM587159     2  0.0000      0.954 0.000 1.000 0.000
#> GSM587160     2  0.0000      0.954 0.000 1.000 0.000
#> GSM587161     2  0.0000      0.954 0.000 1.000 0.000
#> GSM587162     2  0.0000      0.954 0.000 1.000 0.000
#> GSM587163     2  0.0000      0.954 0.000 1.000 0.000
#> GSM587164     2  0.0000      0.954 0.000 1.000 0.000
#> GSM587165     2  0.0000      0.954 0.000 1.000 0.000
#> GSM587166     2  0.0000      0.954 0.000 1.000 0.000
#> GSM587167     2  0.0000      0.954 0.000 1.000 0.000
#> GSM587168     2  0.0000      0.954 0.000 1.000 0.000
#> GSM587169     2  0.0000      0.954 0.000 1.000 0.000
#> GSM587170     2  0.0000      0.954 0.000 1.000 0.000
#> GSM587171     2  0.0000      0.954 0.000 1.000 0.000
#> GSM587172     2  0.0000      0.954 0.000 1.000 0.000
#> GSM587173     2  0.0000      0.954 0.000 1.000 0.000
#> GSM587174     2  0.0000      0.954 0.000 1.000 0.000
#> GSM587175     2  0.0000      0.954 0.000 1.000 0.000
#> GSM587176     2  0.0000      0.954 0.000 1.000 0.000
#> GSM587177     2  0.0000      0.954 0.000 1.000 0.000
#> GSM587178     2  0.0000      0.954 0.000 1.000 0.000
#> GSM587179     2  0.0000      0.954 0.000 1.000 0.000
#> GSM587180     2  0.0000      0.954 0.000 1.000 0.000
#> GSM587181     2  0.0000      0.954 0.000 1.000 0.000
#> GSM587182     2  0.0000      0.954 0.000 1.000 0.000
#> GSM587183     2  0.0000      0.954 0.000 1.000 0.000
#> GSM587184     2  0.0000      0.954 0.000 1.000 0.000
#> GSM587185     2  0.0000      0.954 0.000 1.000 0.000
#> GSM587186     2  0.0000      0.954 0.000 1.000 0.000
#> GSM587187     2  0.0000      0.954 0.000 1.000 0.000
#> GSM587188     2  0.0000      0.954 0.000 1.000 0.000
#> GSM587189     2  0.0000      0.954 0.000 1.000 0.000
#> GSM587190     2  0.1031      0.942 0.000 0.976 0.024
#> GSM587203     1  0.0000      0.946 1.000 0.000 0.000
#> GSM587204     1  0.0000      0.946 1.000 0.000 0.000
#> GSM587205     1  0.0000      0.946 1.000 0.000 0.000
#> GSM587206     1  0.0000      0.946 1.000 0.000 0.000
#> GSM587207     1  0.0000      0.946 1.000 0.000 0.000
#> GSM587208     1  0.0000      0.946 1.000 0.000 0.000
#> GSM587209     1  0.0000      0.946 1.000 0.000 0.000
#> GSM587210     1  0.3192      0.889 0.888 0.000 0.112
#> GSM587211     1  0.0000      0.946 1.000 0.000 0.000
#> GSM587212     1  0.0424      0.944 0.992 0.000 0.008
#> GSM587213     1  0.0000      0.946 1.000 0.000 0.000
#> GSM587214     1  0.0000      0.946 1.000 0.000 0.000
#> GSM587215     1  0.0000      0.946 1.000 0.000 0.000
#> GSM587216     1  0.2537      0.908 0.920 0.000 0.080
#> GSM587217     1  0.0000      0.946 1.000 0.000 0.000
#> GSM587191     2  0.3619      0.879 0.000 0.864 0.136
#> GSM587192     1  0.3619      0.872 0.864 0.000 0.136
#> GSM587193     1  0.3619      0.872 0.864 0.000 0.136
#> GSM587194     3  0.1643      0.800 0.000 0.044 0.956
#> GSM587195     2  0.3619      0.879 0.000 0.864 0.136
#> GSM587196     2  0.8399      0.524 0.256 0.608 0.136
#> GSM587197     2  0.3619      0.879 0.000 0.864 0.136
#> GSM587198     2  0.3619      0.879 0.000 0.864 0.136
#> GSM587199     2  0.4002      0.862 0.000 0.840 0.160
#> GSM587200     1  0.3619      0.872 0.864 0.000 0.136
#> GSM587201     1  0.3619      0.872 0.864 0.000 0.136
#> GSM587202     2  0.3619      0.879 0.000 0.864 0.136
#> GSM198767     1  0.0000      0.946 1.000 0.000 0.000
#> GSM198769     1  0.0000      0.946 1.000 0.000 0.000
#> GSM198772     1  0.0000      0.946 1.000 0.000 0.000
#> GSM198773     1  0.0000      0.946 1.000 0.000 0.000
#> GSM198776     1  0.0000      0.946 1.000 0.000 0.000
#> GSM198778     1  0.3412      0.881 0.876 0.000 0.124
#> GSM198780     1  0.0892      0.938 0.980 0.000 0.020
#> GSM198781     1  0.0000      0.946 1.000 0.000 0.000
#> GSM198765     2  0.3851      0.877 0.004 0.860 0.136
#> GSM198766     1  0.3619      0.872 0.864 0.000 0.136
#> GSM198768     2  0.3619      0.879 0.000 0.864 0.136
#> GSM198770     2  0.3619      0.879 0.000 0.864 0.136
#> GSM198771     2  0.4345      0.867 0.016 0.848 0.136
#> GSM198774     1  0.3619      0.872 0.864 0.000 0.136
#> GSM198775     3  0.3038      0.742 0.000 0.104 0.896
#> GSM198777     2  0.7104      0.719 0.140 0.724 0.136
#> GSM198779     2  0.3686      0.877 0.000 0.860 0.140
#> GSM587218     3  0.3619      0.963 0.136 0.000 0.864
#> GSM587219     3  0.3619      0.963 0.136 0.000 0.864
#> GSM587220     3  0.3619      0.963 0.136 0.000 0.864
#> GSM587221     3  0.3619      0.963 0.136 0.000 0.864
#> GSM587222     3  0.3619      0.963 0.136 0.000 0.864
#> GSM587223     3  0.3619      0.963 0.136 0.000 0.864
#> GSM587224     3  0.3619      0.963 0.136 0.000 0.864
#> GSM587225     3  0.3619      0.963 0.136 0.000 0.864
#> GSM587226     3  0.3619      0.963 0.136 0.000 0.864
#> GSM587227     3  0.3619      0.963 0.136 0.000 0.864
#> GSM587228     3  0.3619      0.963 0.136 0.000 0.864
#> GSM587229     3  0.3619      0.963 0.136 0.000 0.864

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM587155     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> GSM587156     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> GSM587157     2  0.3610      0.748 0.000 0.800 0.200 0.000
#> GSM587158     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> GSM587159     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> GSM587160     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> GSM587161     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> GSM587162     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> GSM587163     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> GSM587164     2  0.0469      0.981 0.000 0.988 0.012 0.000
#> GSM587165     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> GSM587166     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> GSM587167     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> GSM587168     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> GSM587169     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> GSM587170     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> GSM587171     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> GSM587172     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> GSM587173     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> GSM587174     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> GSM587175     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> GSM587176     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> GSM587177     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> GSM587178     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> GSM587179     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> GSM587180     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> GSM587181     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> GSM587182     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> GSM587183     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> GSM587184     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> GSM587185     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> GSM587186     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> GSM587187     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> GSM587188     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> GSM587189     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> GSM587190     3  0.4431      0.557 0.000 0.304 0.696 0.000
#> GSM587203     1  0.0000      0.930 1.000 0.000 0.000 0.000
#> GSM587204     1  0.0000      0.930 1.000 0.000 0.000 0.000
#> GSM587205     1  0.0000      0.930 1.000 0.000 0.000 0.000
#> GSM587206     1  0.0000      0.930 1.000 0.000 0.000 0.000
#> GSM587207     1  0.0000      0.930 1.000 0.000 0.000 0.000
#> GSM587208     1  0.0000      0.930 1.000 0.000 0.000 0.000
#> GSM587209     1  0.0000      0.930 1.000 0.000 0.000 0.000
#> GSM587210     1  0.4955      0.276 0.556 0.000 0.444 0.000
#> GSM587211     1  0.0000      0.930 1.000 0.000 0.000 0.000
#> GSM587212     1  0.3444      0.765 0.816 0.000 0.184 0.000
#> GSM587213     1  0.0000      0.930 1.000 0.000 0.000 0.000
#> GSM587214     1  0.0000      0.930 1.000 0.000 0.000 0.000
#> GSM587215     1  0.0000      0.930 1.000 0.000 0.000 0.000
#> GSM587216     1  0.0000      0.930 1.000 0.000 0.000 0.000
#> GSM587217     1  0.0000      0.930 1.000 0.000 0.000 0.000
#> GSM587191     3  0.0000      0.978 0.000 0.000 1.000 0.000
#> GSM587192     3  0.0000      0.978 0.000 0.000 1.000 0.000
#> GSM587193     3  0.0000      0.978 0.000 0.000 1.000 0.000
#> GSM587194     3  0.0592      0.965 0.000 0.000 0.984 0.016
#> GSM587195     3  0.0000      0.978 0.000 0.000 1.000 0.000
#> GSM587196     3  0.0000      0.978 0.000 0.000 1.000 0.000
#> GSM587197     3  0.0000      0.978 0.000 0.000 1.000 0.000
#> GSM587198     3  0.0000      0.978 0.000 0.000 1.000 0.000
#> GSM587199     3  0.0000      0.978 0.000 0.000 1.000 0.000
#> GSM587200     3  0.0000      0.978 0.000 0.000 1.000 0.000
#> GSM587201     3  0.0000      0.978 0.000 0.000 1.000 0.000
#> GSM587202     3  0.0000      0.978 0.000 0.000 1.000 0.000
#> GSM198767     1  0.0000      0.930 1.000 0.000 0.000 0.000
#> GSM198769     1  0.0000      0.930 1.000 0.000 0.000 0.000
#> GSM198772     1  0.0000      0.930 1.000 0.000 0.000 0.000
#> GSM198773     1  0.0000      0.930 1.000 0.000 0.000 0.000
#> GSM198776     1  0.0000      0.930 1.000 0.000 0.000 0.000
#> GSM198778     1  0.4996      0.153 0.516 0.000 0.484 0.000
#> GSM198780     1  0.3873      0.708 0.772 0.000 0.228 0.000
#> GSM198781     1  0.0000      0.930 1.000 0.000 0.000 0.000
#> GSM198765     3  0.0000      0.978 0.000 0.000 1.000 0.000
#> GSM198766     3  0.1118      0.943 0.036 0.000 0.964 0.000
#> GSM198768     3  0.0000      0.978 0.000 0.000 1.000 0.000
#> GSM198770     3  0.0000      0.978 0.000 0.000 1.000 0.000
#> GSM198771     3  0.0000      0.978 0.000 0.000 1.000 0.000
#> GSM198774     3  0.0000      0.978 0.000 0.000 1.000 0.000
#> GSM198775     3  0.0336      0.972 0.000 0.000 0.992 0.008
#> GSM198777     3  0.0000      0.978 0.000 0.000 1.000 0.000
#> GSM198779     3  0.0000      0.978 0.000 0.000 1.000 0.000
#> GSM587218     4  0.0000      1.000 0.000 0.000 0.000 1.000
#> GSM587219     4  0.0000      1.000 0.000 0.000 0.000 1.000
#> GSM587220     4  0.0000      1.000 0.000 0.000 0.000 1.000
#> GSM587221     4  0.0000      1.000 0.000 0.000 0.000 1.000
#> GSM587222     4  0.0000      1.000 0.000 0.000 0.000 1.000
#> GSM587223     4  0.0000      1.000 0.000 0.000 0.000 1.000
#> GSM587224     4  0.0000      1.000 0.000 0.000 0.000 1.000
#> GSM587225     4  0.0000      1.000 0.000 0.000 0.000 1.000
#> GSM587226     4  0.0000      1.000 0.000 0.000 0.000 1.000
#> GSM587227     4  0.0000      1.000 0.000 0.000 0.000 1.000
#> GSM587228     4  0.0000      1.000 0.000 0.000 0.000 1.000
#> GSM587229     4  0.0000      1.000 0.000 0.000 0.000 1.000

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3 p4    p5
#> GSM587155     2  0.1082     0.9537 0.000 0.964 0.028  0 0.008
#> GSM587156     2  0.4632     0.1767 0.000 0.540 0.448  0 0.012
#> GSM587157     5  0.2971     0.7157 0.000 0.156 0.008  0 0.836
#> GSM587158     2  0.0000     0.9782 0.000 1.000 0.000  0 0.000
#> GSM587159     2  0.0000     0.9782 0.000 1.000 0.000  0 0.000
#> GSM587160     2  0.0000     0.9782 0.000 1.000 0.000  0 0.000
#> GSM587161     2  0.0290     0.9731 0.000 0.992 0.008  0 0.000
#> GSM587162     2  0.0000     0.9782 0.000 1.000 0.000  0 0.000
#> GSM587163     2  0.0000     0.9782 0.000 1.000 0.000  0 0.000
#> GSM587164     2  0.1364     0.9447 0.000 0.952 0.036  0 0.012
#> GSM587165     2  0.0000     0.9782 0.000 1.000 0.000  0 0.000
#> GSM587166     3  0.4632     0.0601 0.000 0.448 0.540  0 0.012
#> GSM587167     2  0.1740     0.9256 0.000 0.932 0.056  0 0.012
#> GSM587168     2  0.0000     0.9782 0.000 1.000 0.000  0 0.000
#> GSM587169     2  0.0000     0.9782 0.000 1.000 0.000  0 0.000
#> GSM587170     2  0.1331     0.9442 0.000 0.952 0.040  0 0.008
#> GSM587171     2  0.0000     0.9782 0.000 1.000 0.000  0 0.000
#> GSM587172     2  0.0000     0.9782 0.000 1.000 0.000  0 0.000
#> GSM587173     2  0.0000     0.9782 0.000 1.000 0.000  0 0.000
#> GSM587174     2  0.0000     0.9782 0.000 1.000 0.000  0 0.000
#> GSM587175     2  0.0865     0.9597 0.000 0.972 0.004  0 0.024
#> GSM587176     2  0.0000     0.9782 0.000 1.000 0.000  0 0.000
#> GSM587177     2  0.0000     0.9782 0.000 1.000 0.000  0 0.000
#> GSM587178     2  0.0000     0.9782 0.000 1.000 0.000  0 0.000
#> GSM587179     2  0.0000     0.9782 0.000 1.000 0.000  0 0.000
#> GSM587180     2  0.0000     0.9782 0.000 1.000 0.000  0 0.000
#> GSM587181     2  0.0000     0.9782 0.000 1.000 0.000  0 0.000
#> GSM587182     2  0.0000     0.9782 0.000 1.000 0.000  0 0.000
#> GSM587183     2  0.0000     0.9782 0.000 1.000 0.000  0 0.000
#> GSM587184     2  0.0000     0.9782 0.000 1.000 0.000  0 0.000
#> GSM587185     2  0.0000     0.9782 0.000 1.000 0.000  0 0.000
#> GSM587186     2  0.0000     0.9782 0.000 1.000 0.000  0 0.000
#> GSM587187     2  0.0000     0.9782 0.000 1.000 0.000  0 0.000
#> GSM587188     2  0.0000     0.9782 0.000 1.000 0.000  0 0.000
#> GSM587189     2  0.0000     0.9782 0.000 1.000 0.000  0 0.000
#> GSM587190     3  0.2300     0.7532 0.000 0.052 0.908  0 0.040
#> GSM587203     1  0.0794     0.9294 0.972 0.000 0.028  0 0.000
#> GSM587204     1  0.0794     0.9294 0.972 0.000 0.028  0 0.000
#> GSM587205     1  0.0794     0.9294 0.972 0.000 0.028  0 0.000
#> GSM587206     1  0.0794     0.9294 0.972 0.000 0.028  0 0.000
#> GSM587207     1  0.0794     0.9294 0.972 0.000 0.028  0 0.000
#> GSM587208     1  0.0794     0.9294 0.972 0.000 0.028  0 0.000
#> GSM587209     1  0.0162     0.9321 0.996 0.000 0.004  0 0.000
#> GSM587210     3  0.5109     0.0287 0.460 0.000 0.504  0 0.036
#> GSM587211     1  0.0404     0.9292 0.988 0.000 0.012  0 0.000
#> GSM587212     1  0.4182     0.4468 0.644 0.000 0.352  0 0.004
#> GSM587213     1  0.0162     0.9321 0.996 0.000 0.004  0 0.000
#> GSM587214     1  0.0000     0.9323 1.000 0.000 0.000  0 0.000
#> GSM587215     1  0.0162     0.9321 0.996 0.000 0.004  0 0.000
#> GSM587216     1  0.3336     0.6863 0.772 0.000 0.228  0 0.000
#> GSM587217     1  0.0290     0.9309 0.992 0.000 0.008  0 0.000
#> GSM587191     3  0.1608     0.7848 0.000 0.000 0.928  0 0.072
#> GSM587192     3  0.1544     0.7859 0.000 0.000 0.932  0 0.068
#> GSM587193     3  0.1195     0.7813 0.012 0.000 0.960  0 0.028
#> GSM587194     3  0.0963     0.7874 0.000 0.000 0.964  0 0.036
#> GSM587195     5  0.0000     0.9202 0.000 0.000 0.000  0 1.000
#> GSM587196     5  0.0162     0.9220 0.000 0.000 0.004  0 0.996
#> GSM587197     5  0.0290     0.9220 0.000 0.000 0.008  0 0.992
#> GSM587198     5  0.1732     0.8932 0.000 0.000 0.080  0 0.920
#> GSM587199     5  0.2929     0.7950 0.000 0.000 0.180  0 0.820
#> GSM587200     3  0.2929     0.6906 0.000 0.000 0.820  0 0.180
#> GSM587201     3  0.3661     0.5553 0.000 0.000 0.724  0 0.276
#> GSM587202     5  0.0510     0.9207 0.000 0.000 0.016  0 0.984
#> GSM198767     1  0.0794     0.9294 0.972 0.000 0.028  0 0.000
#> GSM198769     1  0.0162     0.9321 0.996 0.000 0.004  0 0.000
#> GSM198772     1  0.0404     0.9292 0.988 0.000 0.012  0 0.000
#> GSM198773     1  0.0162     0.9321 0.996 0.000 0.004  0 0.000
#> GSM198776     1  0.0794     0.9294 0.972 0.000 0.028  0 0.000
#> GSM198778     3  0.5161     0.0828 0.444 0.000 0.516  0 0.040
#> GSM198780     1  0.4392     0.3697 0.612 0.000 0.380  0 0.008
#> GSM198781     1  0.0000     0.9323 1.000 0.000 0.000  0 0.000
#> GSM198765     3  0.1608     0.7848 0.000 0.000 0.928  0 0.072
#> GSM198766     3  0.1106     0.7828 0.012 0.000 0.964  0 0.024
#> GSM198768     5  0.0000     0.9202 0.000 0.000 0.000  0 1.000
#> GSM198770     5  0.0290     0.9220 0.000 0.000 0.008  0 0.992
#> GSM198771     5  0.1792     0.8906 0.000 0.000 0.084  0 0.916
#> GSM198774     3  0.1544     0.7859 0.000 0.000 0.932  0 0.068
#> GSM198775     3  0.0963     0.7874 0.000 0.000 0.964  0 0.036
#> GSM198777     5  0.0162     0.9220 0.000 0.000 0.004  0 0.996
#> GSM198779     5  0.2891     0.8004 0.000 0.000 0.176  0 0.824
#> GSM587218     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000
#> GSM587219     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000
#> GSM587220     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000
#> GSM587221     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000
#> GSM587222     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000
#> GSM587223     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000
#> GSM587224     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000
#> GSM587225     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000
#> GSM587226     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000
#> GSM587227     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000
#> GSM587228     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000
#> GSM587229     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3 p4    p5    p6
#> GSM587155     2  0.3046     0.7972 0.000 0.800 0.000  0 0.188 0.012
#> GSM587156     5  0.3871     0.3534 0.000 0.308 0.000  0 0.676 0.016
#> GSM587157     3  0.2882     0.7280 0.000 0.076 0.860  0 0.060 0.004
#> GSM587158     2  0.0000     0.9543 0.000 1.000 0.000  0 0.000 0.000
#> GSM587159     2  0.0000     0.9543 0.000 1.000 0.000  0 0.000 0.000
#> GSM587160     2  0.0000     0.9543 0.000 1.000 0.000  0 0.000 0.000
#> GSM587161     2  0.2489     0.8516 0.000 0.860 0.000  0 0.128 0.012
#> GSM587162     2  0.0260     0.9499 0.000 0.992 0.000  0 0.000 0.008
#> GSM587163     2  0.0000     0.9543 0.000 1.000 0.000  0 0.000 0.000
#> GSM587164     2  0.3509     0.7341 0.000 0.744 0.000  0 0.240 0.016
#> GSM587165     2  0.0000     0.9543 0.000 1.000 0.000  0 0.000 0.000
#> GSM587166     5  0.3766     0.4191 0.000 0.256 0.000  0 0.720 0.024
#> GSM587167     2  0.3927     0.5724 0.000 0.644 0.000  0 0.344 0.012
#> GSM587168     2  0.0000     0.9543 0.000 1.000 0.000  0 0.000 0.000
#> GSM587169     2  0.0000     0.9543 0.000 1.000 0.000  0 0.000 0.000
#> GSM587170     2  0.3230     0.7720 0.000 0.776 0.000  0 0.212 0.012
#> GSM587171     2  0.0000     0.9543 0.000 1.000 0.000  0 0.000 0.000
#> GSM587172     2  0.0000     0.9543 0.000 1.000 0.000  0 0.000 0.000
#> GSM587173     2  0.0000     0.9543 0.000 1.000 0.000  0 0.000 0.000
#> GSM587174     2  0.0000     0.9543 0.000 1.000 0.000  0 0.000 0.000
#> GSM587175     2  0.4403     0.7365 0.000 0.740 0.100  0 0.148 0.012
#> GSM587176     2  0.0508     0.9451 0.000 0.984 0.000  0 0.004 0.012
#> GSM587177     2  0.0000     0.9543 0.000 1.000 0.000  0 0.000 0.000
#> GSM587178     2  0.0000     0.9543 0.000 1.000 0.000  0 0.000 0.000
#> GSM587179     2  0.0000     0.9543 0.000 1.000 0.000  0 0.000 0.000
#> GSM587180     2  0.0000     0.9543 0.000 1.000 0.000  0 0.000 0.000
#> GSM587181     2  0.0000     0.9543 0.000 1.000 0.000  0 0.000 0.000
#> GSM587182     2  0.0000     0.9543 0.000 1.000 0.000  0 0.000 0.000
#> GSM587183     2  0.0000     0.9543 0.000 1.000 0.000  0 0.000 0.000
#> GSM587184     2  0.0000     0.9543 0.000 1.000 0.000  0 0.000 0.000
#> GSM587185     2  0.0000     0.9543 0.000 1.000 0.000  0 0.000 0.000
#> GSM587186     2  0.0000     0.9543 0.000 1.000 0.000  0 0.000 0.000
#> GSM587187     2  0.0000     0.9543 0.000 1.000 0.000  0 0.000 0.000
#> GSM587188     2  0.0000     0.9543 0.000 1.000 0.000  0 0.000 0.000
#> GSM587189     2  0.0146     0.9520 0.000 0.996 0.000  0 0.004 0.000
#> GSM587190     5  0.2604     0.7535 0.000 0.028 0.004  0 0.872 0.096
#> GSM587203     1  0.0000     0.6367 1.000 0.000 0.000  0 0.000 0.000
#> GSM587204     1  0.0000     0.6367 1.000 0.000 0.000  0 0.000 0.000
#> GSM587205     1  0.0000     0.6367 1.000 0.000 0.000  0 0.000 0.000
#> GSM587206     1  0.0000     0.6367 1.000 0.000 0.000  0 0.000 0.000
#> GSM587207     1  0.0000     0.6367 1.000 0.000 0.000  0 0.000 0.000
#> GSM587208     1  0.0000     0.6367 1.000 0.000 0.000  0 0.000 0.000
#> GSM587209     1  0.3868    -0.2100 0.504 0.000 0.000  0 0.000 0.496
#> GSM587210     6  0.2908     0.3827 0.104 0.000 0.000  0 0.048 0.848
#> GSM587211     6  0.4086     0.2090 0.464 0.000 0.000  0 0.008 0.528
#> GSM587212     6  0.4269     0.4170 0.316 0.000 0.000  0 0.036 0.648
#> GSM587213     1  0.3847    -0.0613 0.544 0.000 0.000  0 0.000 0.456
#> GSM587214     1  0.3833    -0.0230 0.556 0.000 0.000  0 0.000 0.444
#> GSM587215     6  0.3862     0.1730 0.476 0.000 0.000  0 0.000 0.524
#> GSM587216     6  0.4004     0.3751 0.368 0.000 0.000  0 0.012 0.620
#> GSM587217     6  0.3860     0.1857 0.472 0.000 0.000  0 0.000 0.528
#> GSM587191     5  0.3672     0.7672 0.000 0.000 0.008  0 0.688 0.304
#> GSM587192     5  0.3565     0.7687 0.000 0.000 0.004  0 0.692 0.304
#> GSM587193     5  0.1863     0.7527 0.000 0.000 0.000  0 0.896 0.104
#> GSM587194     5  0.2597     0.7783 0.000 0.000 0.000  0 0.824 0.176
#> GSM587195     3  0.0000     0.8431 0.000 0.000 1.000  0 0.000 0.000
#> GSM587196     3  0.0000     0.8431 0.000 0.000 1.000  0 0.000 0.000
#> GSM587197     3  0.0000     0.8431 0.000 0.000 1.000  0 0.000 0.000
#> GSM587198     3  0.4149     0.7129 0.000 0.000 0.720  0 0.064 0.216
#> GSM587199     6  0.6117    -0.4471 0.000 0.000 0.344  0 0.300 0.356
#> GSM587200     5  0.4514     0.6372 0.000 0.000 0.040  0 0.588 0.372
#> GSM587201     5  0.4868     0.5713 0.000 0.000 0.060  0 0.524 0.416
#> GSM587202     3  0.2838     0.7708 0.000 0.000 0.808  0 0.004 0.188
#> GSM198767     1  0.0000     0.6367 1.000 0.000 0.000  0 0.000 0.000
#> GSM198769     1  0.3868    -0.2100 0.504 0.000 0.000  0 0.000 0.496
#> GSM198772     6  0.4086     0.2090 0.464 0.000 0.000  0 0.008 0.528
#> GSM198773     1  0.3843    -0.0483 0.548 0.000 0.000  0 0.000 0.452
#> GSM198776     1  0.0000     0.6367 1.000 0.000 0.000  0 0.000 0.000
#> GSM198778     6  0.2762     0.3772 0.092 0.000 0.000  0 0.048 0.860
#> GSM198780     6  0.4316     0.4183 0.312 0.000 0.000  0 0.040 0.648
#> GSM198781     1  0.3828    -0.0120 0.560 0.000 0.000  0 0.000 0.440
#> GSM198765     5  0.3672     0.7672 0.000 0.000 0.008  0 0.688 0.304
#> GSM198766     5  0.2300     0.7693 0.000 0.000 0.000  0 0.856 0.144
#> GSM198768     3  0.0000     0.8431 0.000 0.000 1.000  0 0.000 0.000
#> GSM198770     3  0.0000     0.8431 0.000 0.000 1.000  0 0.000 0.000
#> GSM198771     3  0.4500     0.6814 0.000 0.000 0.688  0 0.088 0.224
#> GSM198774     5  0.3565     0.7687 0.000 0.000 0.004  0 0.692 0.304
#> GSM198775     5  0.2597     0.7783 0.000 0.000 0.000  0 0.824 0.176
#> GSM198777     3  0.0000     0.8431 0.000 0.000 1.000  0 0.000 0.000
#> GSM198779     3  0.6113    -0.0386 0.000 0.000 0.356  0 0.296 0.348
#> GSM587218     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587219     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587220     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587221     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587222     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587223     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587224     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587225     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587226     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587227     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587228     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587229     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000 0.000

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

consensus_heatmap(res, k = 2)

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

consensus_heatmap(res, k = 3)

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

consensus_heatmap(res, k = 4)

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

consensus_heatmap(res, k = 5)

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

consensus_heatmap(res, k = 6)

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

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

membership_heatmap(res, k = 2)

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

membership_heatmap(res, k = 3)

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

membership_heatmap(res, k = 4)

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

membership_heatmap(res, k = 5)

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

membership_heatmap(res, k = 6)

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

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

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

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

get_signatures(res, k = 3)

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

get_signatures(res, k = 4)

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

get_signatures(res, k = 5)

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

get_signatures(res, k = 6)

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

Signature heatmaps where rows are not scaled:

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

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

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

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

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

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

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

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

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

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

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk CV-NMF-signature_compare

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

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

An example of the output of tb is:

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

The columns in tb are:

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

UMAP plot which shows how samples are separated.

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

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

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

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

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

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

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

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

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

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

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk CV-NMF-collect-classes

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

test_to_known_factors(res)
#>         n specimen(p) k
#> CV:NMF 92    4.01e-14 2
#> CV:NMF 92    7.13e-26 3
#> CV:NMF 90    7.15e-46 4
#> CV:NMF 86    3.52e-39 5
#> CV:NMF 73    1.11e-31 6

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


MAD:hclust*

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

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

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

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

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

collect_plots(res)

plot of chunk MAD-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.669           0.903       0.941         0.4836 0.518   0.518
#> 3 3 0.801           0.882       0.922         0.3454 0.832   0.676
#> 4 4 0.831           0.859       0.890         0.0971 0.928   0.796
#> 5 5 0.898           0.876       0.932         0.0629 0.969   0.890
#> 6 6 0.918           0.883       0.936         0.0368 0.964   0.856

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

suggest_best_k(res)
#> [1] 6

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

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

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>           class entropy silhouette    p1    p2
#> GSM587155     2   0.000      1.000 0.000 1.000
#> GSM587156     2   0.000      1.000 0.000 1.000
#> GSM587157     2   0.000      1.000 0.000 1.000
#> GSM587158     2   0.000      1.000 0.000 1.000
#> GSM587159     2   0.000      1.000 0.000 1.000
#> GSM587160     2   0.000      1.000 0.000 1.000
#> GSM587161     2   0.000      1.000 0.000 1.000
#> GSM587162     2   0.000      1.000 0.000 1.000
#> GSM587163     2   0.000      1.000 0.000 1.000
#> GSM587164     2   0.000      1.000 0.000 1.000
#> GSM587165     2   0.000      1.000 0.000 1.000
#> GSM587166     2   0.000      1.000 0.000 1.000
#> GSM587167     2   0.000      1.000 0.000 1.000
#> GSM587168     2   0.000      1.000 0.000 1.000
#> GSM587169     2   0.000      1.000 0.000 1.000
#> GSM587170     2   0.000      1.000 0.000 1.000
#> GSM587171     2   0.000      1.000 0.000 1.000
#> GSM587172     2   0.000      1.000 0.000 1.000
#> GSM587173     2   0.000      1.000 0.000 1.000
#> GSM587174     2   0.000      1.000 0.000 1.000
#> GSM587175     2   0.000      1.000 0.000 1.000
#> GSM587176     2   0.000      1.000 0.000 1.000
#> GSM587177     2   0.000      1.000 0.000 1.000
#> GSM587178     2   0.000      1.000 0.000 1.000
#> GSM587179     2   0.000      1.000 0.000 1.000
#> GSM587180     2   0.000      1.000 0.000 1.000
#> GSM587181     2   0.000      1.000 0.000 1.000
#> GSM587182     2   0.000      1.000 0.000 1.000
#> GSM587183     2   0.000      1.000 0.000 1.000
#> GSM587184     2   0.000      1.000 0.000 1.000
#> GSM587185     2   0.000      1.000 0.000 1.000
#> GSM587186     2   0.000      1.000 0.000 1.000
#> GSM587187     2   0.000      1.000 0.000 1.000
#> GSM587188     2   0.000      1.000 0.000 1.000
#> GSM587189     2   0.000      1.000 0.000 1.000
#> GSM587190     2   0.000      1.000 0.000 1.000
#> GSM587203     1   0.000      0.894 1.000 0.000
#> GSM587204     1   0.000      0.894 1.000 0.000
#> GSM587205     1   0.000      0.894 1.000 0.000
#> GSM587206     1   0.000      0.894 1.000 0.000
#> GSM587207     1   0.000      0.894 1.000 0.000
#> GSM587208     1   0.000      0.894 1.000 0.000
#> GSM587209     1   0.000      0.894 1.000 0.000
#> GSM587210     1   0.000      0.894 1.000 0.000
#> GSM587211     1   0.000      0.894 1.000 0.000
#> GSM587212     1   0.000      0.894 1.000 0.000
#> GSM587213     1   0.000      0.894 1.000 0.000
#> GSM587214     1   0.000      0.894 1.000 0.000
#> GSM587215     1   0.000      0.894 1.000 0.000
#> GSM587216     1   0.000      0.894 1.000 0.000
#> GSM587217     1   0.000      0.894 1.000 0.000
#> GSM587191     1   0.866      0.731 0.712 0.288
#> GSM587192     1   0.866      0.731 0.712 0.288
#> GSM587193     1   0.795      0.770 0.760 0.240
#> GSM587194     1   0.795      0.770 0.760 0.240
#> GSM587195     1   0.866      0.731 0.712 0.288
#> GSM587196     1   0.866      0.731 0.712 0.288
#> GSM587197     1   0.866      0.731 0.712 0.288
#> GSM587198     1   0.866      0.731 0.712 0.288
#> GSM587199     1   0.866      0.731 0.712 0.288
#> GSM587200     1   0.295      0.874 0.948 0.052
#> GSM587201     1   0.295      0.874 0.948 0.052
#> GSM587202     1   0.866      0.731 0.712 0.288
#> GSM198767     1   0.000      0.894 1.000 0.000
#> GSM198769     1   0.000      0.894 1.000 0.000
#> GSM198772     1   0.000      0.894 1.000 0.000
#> GSM198773     1   0.000      0.894 1.000 0.000
#> GSM198776     1   0.000      0.894 1.000 0.000
#> GSM198778     1   0.000      0.894 1.000 0.000
#> GSM198780     1   0.000      0.894 1.000 0.000
#> GSM198781     1   0.000      0.894 1.000 0.000
#> GSM198765     1   0.866      0.731 0.712 0.288
#> GSM198766     1   0.795      0.770 0.760 0.240
#> GSM198768     1   0.866      0.731 0.712 0.288
#> GSM198770     1   0.866      0.731 0.712 0.288
#> GSM198771     1   0.866      0.731 0.712 0.288
#> GSM198774     1   0.866      0.731 0.712 0.288
#> GSM198775     1   0.795      0.770 0.760 0.240
#> GSM198777     1   0.866      0.731 0.712 0.288
#> GSM198779     1   0.866      0.731 0.712 0.288
#> GSM587218     1   0.000      0.894 1.000 0.000
#> GSM587219     1   0.000      0.894 1.000 0.000
#> GSM587220     1   0.000      0.894 1.000 0.000
#> GSM587221     1   0.000      0.894 1.000 0.000
#> GSM587222     1   0.000      0.894 1.000 0.000
#> GSM587223     1   0.000      0.894 1.000 0.000
#> GSM587224     1   0.000      0.894 1.000 0.000
#> GSM587225     1   0.000      0.894 1.000 0.000
#> GSM587226     1   0.000      0.894 1.000 0.000
#> GSM587227     1   0.000      0.894 1.000 0.000
#> GSM587228     1   0.000      0.894 1.000 0.000
#> GSM587229     1   0.000      0.894 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
#> GSM587155     2  0.0000      0.983 0.000 1.000 0.000
#> GSM587156     2  0.3941      0.843 0.000 0.844 0.156
#> GSM587157     2  0.0000      0.983 0.000 1.000 0.000
#> GSM587158     2  0.0000      0.983 0.000 1.000 0.000
#> GSM587159     2  0.0000      0.983 0.000 1.000 0.000
#> GSM587160     2  0.0000      0.983 0.000 1.000 0.000
#> GSM587161     2  0.0000      0.983 0.000 1.000 0.000
#> GSM587162     2  0.0000      0.983 0.000 1.000 0.000
#> GSM587163     2  0.0000      0.983 0.000 1.000 0.000
#> GSM587164     2  0.0000      0.983 0.000 1.000 0.000
#> GSM587165     2  0.0000      0.983 0.000 1.000 0.000
#> GSM587166     2  0.3941      0.843 0.000 0.844 0.156
#> GSM587167     2  0.3941      0.843 0.000 0.844 0.156
#> GSM587168     2  0.0000      0.983 0.000 1.000 0.000
#> GSM587169     2  0.0000      0.983 0.000 1.000 0.000
#> GSM587170     2  0.0000      0.983 0.000 1.000 0.000
#> GSM587171     2  0.0000      0.983 0.000 1.000 0.000
#> GSM587172     2  0.0000      0.983 0.000 1.000 0.000
#> GSM587173     2  0.0000      0.983 0.000 1.000 0.000
#> GSM587174     2  0.0000      0.983 0.000 1.000 0.000
#> GSM587175     2  0.0000      0.983 0.000 1.000 0.000
#> GSM587176     2  0.0000      0.983 0.000 1.000 0.000
#> GSM587177     2  0.0000      0.983 0.000 1.000 0.000
#> GSM587178     2  0.0000      0.983 0.000 1.000 0.000
#> GSM587179     2  0.0000      0.983 0.000 1.000 0.000
#> GSM587180     2  0.0000      0.983 0.000 1.000 0.000
#> GSM587181     2  0.0000      0.983 0.000 1.000 0.000
#> GSM587182     2  0.0000      0.983 0.000 1.000 0.000
#> GSM587183     2  0.0000      0.983 0.000 1.000 0.000
#> GSM587184     2  0.0000      0.983 0.000 1.000 0.000
#> GSM587185     2  0.0000      0.983 0.000 1.000 0.000
#> GSM587186     2  0.0000      0.983 0.000 1.000 0.000
#> GSM587187     2  0.0000      0.983 0.000 1.000 0.000
#> GSM587188     2  0.0000      0.983 0.000 1.000 0.000
#> GSM587189     2  0.0000      0.983 0.000 1.000 0.000
#> GSM587190     2  0.3412      0.876 0.000 0.876 0.124
#> GSM587203     1  0.0000      0.994 1.000 0.000 0.000
#> GSM587204     1  0.0000      0.994 1.000 0.000 0.000
#> GSM587205     1  0.0000      0.994 1.000 0.000 0.000
#> GSM587206     1  0.0000      0.994 1.000 0.000 0.000
#> GSM587207     1  0.0000      0.994 1.000 0.000 0.000
#> GSM587208     1  0.0000      0.994 1.000 0.000 0.000
#> GSM587209     1  0.1643      0.944 0.956 0.000 0.044
#> GSM587210     3  0.5968      0.640 0.364 0.000 0.636
#> GSM587211     1  0.0000      0.994 1.000 0.000 0.000
#> GSM587212     3  0.6126      0.584 0.400 0.000 0.600
#> GSM587213     1  0.0000      0.994 1.000 0.000 0.000
#> GSM587214     1  0.0000      0.994 1.000 0.000 0.000
#> GSM587215     1  0.0000      0.994 1.000 0.000 0.000
#> GSM587216     1  0.0000      0.994 1.000 0.000 0.000
#> GSM587217     1  0.0000      0.994 1.000 0.000 0.000
#> GSM587191     3  0.1860      0.792 0.000 0.052 0.948
#> GSM587192     3  0.1860      0.792 0.000 0.052 0.948
#> GSM587193     3  0.0661      0.789 0.004 0.008 0.988
#> GSM587194     3  0.0661      0.789 0.004 0.008 0.988
#> GSM587195     3  0.1860      0.792 0.000 0.052 0.948
#> GSM587196     3  0.1860      0.792 0.000 0.052 0.948
#> GSM587197     3  0.1860      0.792 0.000 0.052 0.948
#> GSM587198     3  0.1860      0.792 0.000 0.052 0.948
#> GSM587199     3  0.1860      0.792 0.000 0.052 0.948
#> GSM587200     3  0.4346      0.756 0.184 0.000 0.816
#> GSM587201     3  0.4346      0.756 0.184 0.000 0.816
#> GSM587202     3  0.1860      0.792 0.000 0.052 0.948
#> GSM198767     1  0.0000      0.994 1.000 0.000 0.000
#> GSM198769     1  0.1643      0.944 0.956 0.000 0.044
#> GSM198772     1  0.0000      0.994 1.000 0.000 0.000
#> GSM198773     1  0.0000      0.994 1.000 0.000 0.000
#> GSM198776     1  0.0000      0.994 1.000 0.000 0.000
#> GSM198778     3  0.5968      0.640 0.364 0.000 0.636
#> GSM198780     3  0.6126      0.584 0.400 0.000 0.600
#> GSM198781     1  0.0000      0.994 1.000 0.000 0.000
#> GSM198765     3  0.1860      0.792 0.000 0.052 0.948
#> GSM198766     3  0.0661      0.789 0.004 0.008 0.988
#> GSM198768     3  0.1860      0.792 0.000 0.052 0.948
#> GSM198770     3  0.1860      0.792 0.000 0.052 0.948
#> GSM198771     3  0.1860      0.792 0.000 0.052 0.948
#> GSM198774     3  0.1860      0.792 0.000 0.052 0.948
#> GSM198775     3  0.0661      0.789 0.004 0.008 0.988
#> GSM198777     3  0.1860      0.792 0.000 0.052 0.948
#> GSM198779     3  0.1860      0.792 0.000 0.052 0.948
#> GSM587218     3  0.5650      0.709 0.312 0.000 0.688
#> GSM587219     3  0.5650      0.709 0.312 0.000 0.688
#> GSM587220     3  0.5650      0.709 0.312 0.000 0.688
#> GSM587221     3  0.5650      0.709 0.312 0.000 0.688
#> GSM587222     3  0.5650      0.709 0.312 0.000 0.688
#> GSM587223     3  0.5650      0.709 0.312 0.000 0.688
#> GSM587224     3  0.5650      0.709 0.312 0.000 0.688
#> GSM587225     3  0.5650      0.709 0.312 0.000 0.688
#> GSM587226     3  0.5650      0.709 0.312 0.000 0.688
#> GSM587227     3  0.5650      0.709 0.312 0.000 0.688
#> GSM587228     3  0.5650      0.709 0.312 0.000 0.688
#> GSM587229     3  0.5650      0.709 0.312 0.000 0.688

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM587155     2   0.000     0.9456 0.000 1.000 0.000 0.000
#> GSM587156     2   0.370     0.8014 0.000 0.828 0.156 0.016
#> GSM587157     2   0.000     0.9456 0.000 1.000 0.000 0.000
#> GSM587158     2   0.000     0.9456 0.000 1.000 0.000 0.000
#> GSM587159     2   0.000     0.9456 0.000 1.000 0.000 0.000
#> GSM587160     2   0.000     0.9456 0.000 1.000 0.000 0.000
#> GSM587161     2   0.000     0.9456 0.000 1.000 0.000 0.000
#> GSM587162     2   0.000     0.9456 0.000 1.000 0.000 0.000
#> GSM587163     2   0.000     0.9456 0.000 1.000 0.000 0.000
#> GSM587164     2   0.000     0.9456 0.000 1.000 0.000 0.000
#> GSM587165     2   0.000     0.9456 0.000 1.000 0.000 0.000
#> GSM587166     2   0.370     0.8014 0.000 0.828 0.156 0.016
#> GSM587167     2   0.370     0.8014 0.000 0.828 0.156 0.016
#> GSM587168     2   0.000     0.9456 0.000 1.000 0.000 0.000
#> GSM587169     2   0.000     0.9456 0.000 1.000 0.000 0.000
#> GSM587170     2   0.000     0.9456 0.000 1.000 0.000 0.000
#> GSM587171     2   0.000     0.9456 0.000 1.000 0.000 0.000
#> GSM587172     2   0.000     0.9456 0.000 1.000 0.000 0.000
#> GSM587173     2   0.000     0.9456 0.000 1.000 0.000 0.000
#> GSM587174     2   0.000     0.9456 0.000 1.000 0.000 0.000
#> GSM587175     2   0.000     0.9456 0.000 1.000 0.000 0.000
#> GSM587176     2   0.000     0.9456 0.000 1.000 0.000 0.000
#> GSM587177     2   0.000     0.9456 0.000 1.000 0.000 0.000
#> GSM587178     2   0.000     0.9456 0.000 1.000 0.000 0.000
#> GSM587179     2   0.000     0.9456 0.000 1.000 0.000 0.000
#> GSM587180     2   0.000     0.9456 0.000 1.000 0.000 0.000
#> GSM587181     2   0.000     0.9456 0.000 1.000 0.000 0.000
#> GSM587182     2   0.000     0.9456 0.000 1.000 0.000 0.000
#> GSM587183     2   0.000     0.9456 0.000 1.000 0.000 0.000
#> GSM587184     2   0.000     0.9456 0.000 1.000 0.000 0.000
#> GSM587185     2   0.000     0.9456 0.000 1.000 0.000 0.000
#> GSM587186     2   0.000     0.9456 0.000 1.000 0.000 0.000
#> GSM587187     2   0.583     0.6401 0.000 0.632 0.052 0.316
#> GSM587188     2   0.583     0.6401 0.000 0.632 0.052 0.316
#> GSM587189     2   0.583     0.6401 0.000 0.632 0.052 0.316
#> GSM587190     2   0.736     0.4688 0.000 0.492 0.176 0.332
#> GSM587203     1   0.000     0.9709 1.000 0.000 0.000 0.000
#> GSM587204     1   0.000     0.9709 1.000 0.000 0.000 0.000
#> GSM587205     1   0.000     0.9709 1.000 0.000 0.000 0.000
#> GSM587206     1   0.000     0.9709 1.000 0.000 0.000 0.000
#> GSM587207     1   0.000     0.9709 1.000 0.000 0.000 0.000
#> GSM587208     1   0.000     0.9709 1.000 0.000 0.000 0.000
#> GSM587209     1   0.409     0.7288 0.776 0.000 0.008 0.216
#> GSM587210     3   0.717     0.0118 0.184 0.000 0.548 0.268
#> GSM587211     1   0.000     0.9709 1.000 0.000 0.000 0.000
#> GSM587212     3   0.631     0.2182 0.392 0.000 0.544 0.064
#> GSM587213     1   0.000     0.9709 1.000 0.000 0.000 0.000
#> GSM587214     1   0.000     0.9709 1.000 0.000 0.000 0.000
#> GSM587215     1   0.000     0.9709 1.000 0.000 0.000 0.000
#> GSM587216     1   0.147     0.9275 0.948 0.000 0.000 0.052
#> GSM587217     1   0.000     0.9709 1.000 0.000 0.000 0.000
#> GSM587191     3   0.000     0.8360 0.000 0.000 1.000 0.000
#> GSM587192     3   0.000     0.8360 0.000 0.000 1.000 0.000
#> GSM587193     3   0.139     0.7999 0.000 0.000 0.952 0.048
#> GSM587194     3   0.139     0.7999 0.000 0.000 0.952 0.048
#> GSM587195     3   0.000     0.8360 0.000 0.000 1.000 0.000
#> GSM587196     3   0.000     0.8360 0.000 0.000 1.000 0.000
#> GSM587197     3   0.000     0.8360 0.000 0.000 1.000 0.000
#> GSM587198     3   0.000     0.8360 0.000 0.000 1.000 0.000
#> GSM587199     3   0.000     0.8360 0.000 0.000 1.000 0.000
#> GSM587200     3   0.419     0.3577 0.000 0.000 0.732 0.268
#> GSM587201     3   0.419     0.3577 0.000 0.000 0.732 0.268
#> GSM587202     3   0.000     0.8360 0.000 0.000 1.000 0.000
#> GSM198767     1   0.000     0.9709 1.000 0.000 0.000 0.000
#> GSM198769     1   0.409     0.7288 0.776 0.000 0.008 0.216
#> GSM198772     1   0.000     0.9709 1.000 0.000 0.000 0.000
#> GSM198773     1   0.000     0.9709 1.000 0.000 0.000 0.000
#> GSM198776     1   0.000     0.9709 1.000 0.000 0.000 0.000
#> GSM198778     3   0.717     0.0118 0.184 0.000 0.548 0.268
#> GSM198780     3   0.631     0.2182 0.392 0.000 0.544 0.064
#> GSM198781     1   0.000     0.9709 1.000 0.000 0.000 0.000
#> GSM198765     3   0.000     0.8360 0.000 0.000 1.000 0.000
#> GSM198766     3   0.139     0.7999 0.000 0.000 0.952 0.048
#> GSM198768     3   0.000     0.8360 0.000 0.000 1.000 0.000
#> GSM198770     3   0.000     0.8360 0.000 0.000 1.000 0.000
#> GSM198771     3   0.000     0.8360 0.000 0.000 1.000 0.000
#> GSM198774     3   0.000     0.8360 0.000 0.000 1.000 0.000
#> GSM198775     3   0.139     0.7999 0.000 0.000 0.952 0.048
#> GSM198777     3   0.000     0.8360 0.000 0.000 1.000 0.000
#> GSM198779     3   0.000     0.8360 0.000 0.000 1.000 0.000
#> GSM587218     4   0.458     1.0000 0.000 0.000 0.332 0.668
#> GSM587219     4   0.458     1.0000 0.000 0.000 0.332 0.668
#> GSM587220     4   0.458     1.0000 0.000 0.000 0.332 0.668
#> GSM587221     4   0.458     1.0000 0.000 0.000 0.332 0.668
#> GSM587222     4   0.458     1.0000 0.000 0.000 0.332 0.668
#> GSM587223     4   0.458     1.0000 0.000 0.000 0.332 0.668
#> GSM587224     4   0.458     1.0000 0.000 0.000 0.332 0.668
#> GSM587225     4   0.458     1.0000 0.000 0.000 0.332 0.668
#> GSM587226     4   0.458     1.0000 0.000 0.000 0.332 0.668
#> GSM587227     4   0.458     1.0000 0.000 0.000 0.332 0.668
#> GSM587228     4   0.458     1.0000 0.000 0.000 0.332 0.668
#> GSM587229     4   0.458     1.0000 0.000 0.000 0.332 0.668

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM587155     2  0.1270      0.909 0.000 0.948 0.000 0.000 0.052
#> GSM587156     2  0.4066      0.475 0.000 0.672 0.004 0.000 0.324
#> GSM587157     2  0.1197      0.911 0.000 0.952 0.000 0.000 0.048
#> GSM587158     2  0.0000      0.945 0.000 1.000 0.000 0.000 0.000
#> GSM587159     2  0.0000      0.945 0.000 1.000 0.000 0.000 0.000
#> GSM587160     2  0.0290      0.941 0.000 0.992 0.000 0.000 0.008
#> GSM587161     2  0.0162      0.943 0.000 0.996 0.000 0.000 0.004
#> GSM587162     2  0.0290      0.941 0.000 0.992 0.000 0.000 0.008
#> GSM587163     2  0.0000      0.945 0.000 1.000 0.000 0.000 0.000
#> GSM587164     2  0.1197      0.911 0.000 0.952 0.000 0.000 0.048
#> GSM587165     2  0.0000      0.945 0.000 1.000 0.000 0.000 0.000
#> GSM587166     2  0.4066      0.475 0.000 0.672 0.004 0.000 0.324
#> GSM587167     2  0.4084      0.470 0.000 0.668 0.004 0.000 0.328
#> GSM587168     2  0.0000      0.945 0.000 1.000 0.000 0.000 0.000
#> GSM587169     2  0.0000      0.945 0.000 1.000 0.000 0.000 0.000
#> GSM587170     2  0.1197      0.911 0.000 0.952 0.000 0.000 0.048
#> GSM587171     2  0.0000      0.945 0.000 1.000 0.000 0.000 0.000
#> GSM587172     2  0.0000      0.945 0.000 1.000 0.000 0.000 0.000
#> GSM587173     2  0.0000      0.945 0.000 1.000 0.000 0.000 0.000
#> GSM587174     2  0.0290      0.941 0.000 0.992 0.000 0.000 0.008
#> GSM587175     2  0.1197      0.911 0.000 0.952 0.000 0.000 0.048
#> GSM587176     2  0.0290      0.941 0.000 0.992 0.000 0.000 0.008
#> GSM587177     2  0.0000      0.945 0.000 1.000 0.000 0.000 0.000
#> GSM587178     2  0.0000      0.945 0.000 1.000 0.000 0.000 0.000
#> GSM587179     2  0.0162      0.943 0.000 0.996 0.000 0.000 0.004
#> GSM587180     2  0.0000      0.945 0.000 1.000 0.000 0.000 0.000
#> GSM587181     2  0.0290      0.941 0.000 0.992 0.000 0.000 0.008
#> GSM587182     2  0.0000      0.945 0.000 1.000 0.000 0.000 0.000
#> GSM587183     2  0.0000      0.945 0.000 1.000 0.000 0.000 0.000
#> GSM587184     2  0.0000      0.945 0.000 1.000 0.000 0.000 0.000
#> GSM587185     2  0.0162      0.943 0.000 0.996 0.000 0.000 0.004
#> GSM587186     2  0.0000      0.945 0.000 1.000 0.000 0.000 0.000
#> GSM587187     5  0.4957      0.852 0.000 0.332 0.044 0.000 0.624
#> GSM587188     5  0.4972      0.849 0.000 0.336 0.044 0.000 0.620
#> GSM587189     5  0.4957      0.852 0.000 0.332 0.044 0.000 0.624
#> GSM587190     5  0.2228      0.564 0.000 0.040 0.048 0.000 0.912
#> GSM587203     1  0.0000      0.966 1.000 0.000 0.000 0.000 0.000
#> GSM587204     1  0.0000      0.966 1.000 0.000 0.000 0.000 0.000
#> GSM587205     1  0.0000      0.966 1.000 0.000 0.000 0.000 0.000
#> GSM587206     1  0.0000      0.966 1.000 0.000 0.000 0.000 0.000
#> GSM587207     1  0.0000      0.966 1.000 0.000 0.000 0.000 0.000
#> GSM587208     1  0.0000      0.966 1.000 0.000 0.000 0.000 0.000
#> GSM587209     1  0.3305      0.712 0.776 0.000 0.000 0.224 0.000
#> GSM587210     3  0.6983      0.502 0.184 0.000 0.536 0.236 0.044
#> GSM587211     1  0.0000      0.966 1.000 0.000 0.000 0.000 0.000
#> GSM587212     3  0.5834      0.405 0.392 0.000 0.536 0.028 0.044
#> GSM587213     1  0.0000      0.966 1.000 0.000 0.000 0.000 0.000
#> GSM587214     1  0.0000      0.966 1.000 0.000 0.000 0.000 0.000
#> GSM587215     1  0.0000      0.966 1.000 0.000 0.000 0.000 0.000
#> GSM587216     1  0.1270      0.917 0.948 0.000 0.000 0.052 0.000
#> GSM587217     1  0.0000      0.966 1.000 0.000 0.000 0.000 0.000
#> GSM587191     3  0.0000      0.856 0.000 0.000 1.000 0.000 0.000
#> GSM587192     3  0.0000      0.856 0.000 0.000 1.000 0.000 0.000
#> GSM587193     3  0.3177      0.768 0.000 0.000 0.792 0.000 0.208
#> GSM587194     3  0.3177      0.768 0.000 0.000 0.792 0.000 0.208
#> GSM587195     3  0.0000      0.856 0.000 0.000 1.000 0.000 0.000
#> GSM587196     3  0.0000      0.856 0.000 0.000 1.000 0.000 0.000
#> GSM587197     3  0.0000      0.856 0.000 0.000 1.000 0.000 0.000
#> GSM587198     3  0.0000      0.856 0.000 0.000 1.000 0.000 0.000
#> GSM587199     3  0.0000      0.856 0.000 0.000 1.000 0.000 0.000
#> GSM587200     3  0.4584      0.680 0.000 0.000 0.716 0.228 0.056
#> GSM587201     3  0.4584      0.680 0.000 0.000 0.716 0.228 0.056
#> GSM587202     3  0.0000      0.856 0.000 0.000 1.000 0.000 0.000
#> GSM198767     1  0.0000      0.966 1.000 0.000 0.000 0.000 0.000
#> GSM198769     1  0.3305      0.712 0.776 0.000 0.000 0.224 0.000
#> GSM198772     1  0.0000      0.966 1.000 0.000 0.000 0.000 0.000
#> GSM198773     1  0.0000      0.966 1.000 0.000 0.000 0.000 0.000
#> GSM198776     1  0.0000      0.966 1.000 0.000 0.000 0.000 0.000
#> GSM198778     3  0.6983      0.502 0.184 0.000 0.536 0.236 0.044
#> GSM198780     3  0.5834      0.405 0.392 0.000 0.536 0.028 0.044
#> GSM198781     1  0.0000      0.966 1.000 0.000 0.000 0.000 0.000
#> GSM198765     3  0.0000      0.856 0.000 0.000 1.000 0.000 0.000
#> GSM198766     3  0.3177      0.768 0.000 0.000 0.792 0.000 0.208
#> GSM198768     3  0.0000      0.856 0.000 0.000 1.000 0.000 0.000
#> GSM198770     3  0.0000      0.856 0.000 0.000 1.000 0.000 0.000
#> GSM198771     3  0.0000      0.856 0.000 0.000 1.000 0.000 0.000
#> GSM198774     3  0.0000      0.856 0.000 0.000 1.000 0.000 0.000
#> GSM198775     3  0.3177      0.768 0.000 0.000 0.792 0.000 0.208
#> GSM198777     3  0.0000      0.856 0.000 0.000 1.000 0.000 0.000
#> GSM198779     3  0.0000      0.856 0.000 0.000 1.000 0.000 0.000
#> GSM587218     4  0.0000      1.000 0.000 0.000 0.000 1.000 0.000
#> GSM587219     4  0.0000      1.000 0.000 0.000 0.000 1.000 0.000
#> GSM587220     4  0.0000      1.000 0.000 0.000 0.000 1.000 0.000
#> GSM587221     4  0.0000      1.000 0.000 0.000 0.000 1.000 0.000
#> GSM587222     4  0.0000      1.000 0.000 0.000 0.000 1.000 0.000
#> GSM587223     4  0.0000      1.000 0.000 0.000 0.000 1.000 0.000
#> GSM587224     4  0.0000      1.000 0.000 0.000 0.000 1.000 0.000
#> GSM587225     4  0.0000      1.000 0.000 0.000 0.000 1.000 0.000
#> GSM587226     4  0.0000      1.000 0.000 0.000 0.000 1.000 0.000
#> GSM587227     4  0.0000      1.000 0.000 0.000 0.000 1.000 0.000
#> GSM587228     4  0.0000      1.000 0.000 0.000 0.000 1.000 0.000
#> GSM587229     4  0.0000      1.000 0.000 0.000 0.000 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM587155     2  0.1267      0.904 0.000 0.940 0.000 0.000 0.000 0.060
#> GSM587156     2  0.3905      0.482 0.000 0.668 0.000 0.000 0.016 0.316
#> GSM587157     2  0.1141      0.908 0.000 0.948 0.000 0.000 0.000 0.052
#> GSM587158     2  0.0000      0.944 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587159     2  0.0000      0.944 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587160     2  0.0363      0.938 0.000 0.988 0.000 0.000 0.000 0.012
#> GSM587161     2  0.0146      0.942 0.000 0.996 0.000 0.000 0.000 0.004
#> GSM587162     2  0.0363      0.938 0.000 0.988 0.000 0.000 0.000 0.012
#> GSM587163     2  0.0000      0.944 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587164     2  0.1141      0.908 0.000 0.948 0.000 0.000 0.000 0.052
#> GSM587165     2  0.0000      0.944 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587166     2  0.3905      0.482 0.000 0.668 0.000 0.000 0.016 0.316
#> GSM587167     2  0.3938      0.472 0.000 0.660 0.000 0.000 0.016 0.324
#> GSM587168     2  0.0000      0.944 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587169     2  0.0000      0.944 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587170     2  0.1141      0.908 0.000 0.948 0.000 0.000 0.000 0.052
#> GSM587171     2  0.0000      0.944 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587172     2  0.0000      0.944 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587173     2  0.0000      0.944 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587174     2  0.0363      0.938 0.000 0.988 0.000 0.000 0.000 0.012
#> GSM587175     2  0.1141      0.908 0.000 0.948 0.000 0.000 0.000 0.052
#> GSM587176     2  0.0363      0.938 0.000 0.988 0.000 0.000 0.000 0.012
#> GSM587177     2  0.0000      0.944 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587178     2  0.0000      0.944 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587179     2  0.0146      0.942 0.000 0.996 0.000 0.000 0.000 0.004
#> GSM587180     2  0.0000      0.944 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587181     2  0.0363      0.938 0.000 0.988 0.000 0.000 0.000 0.012
#> GSM587182     2  0.0000      0.944 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587183     2  0.0000      0.944 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587184     2  0.0000      0.944 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587185     2  0.0146      0.942 0.000 0.996 0.000 0.000 0.000 0.004
#> GSM587186     2  0.0000      0.944 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587187     6  0.3464      0.838 0.000 0.312 0.000 0.000 0.000 0.688
#> GSM587188     6  0.3482      0.835 0.000 0.316 0.000 0.000 0.000 0.684
#> GSM587189     6  0.3464      0.838 0.000 0.312 0.000 0.000 0.000 0.688
#> GSM587190     6  0.0891      0.408 0.000 0.024 0.000 0.000 0.008 0.968
#> GSM587203     1  0.0000      0.967 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM587204     1  0.0000      0.967 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM587205     1  0.0000      0.967 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM587206     1  0.0000      0.967 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM587207     1  0.0000      0.967 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM587208     1  0.0000      0.967 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM587209     1  0.3796      0.705 0.776 0.000 0.000 0.084 0.140 0.000
#> GSM587210     5  0.4314      0.624 0.184 0.000 0.000 0.096 0.720 0.000
#> GSM587211     1  0.0000      0.967 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM587212     5  0.4228      0.475 0.392 0.000 0.000 0.020 0.588 0.000
#> GSM587213     1  0.0000      0.967 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM587214     1  0.0000      0.967 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM587215     1  0.0000      0.967 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM587216     1  0.1334      0.918 0.948 0.000 0.000 0.020 0.032 0.000
#> GSM587217     1  0.0000      0.967 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM587191     3  0.0000      0.969 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM587192     3  0.0000      0.969 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM587193     5  0.2362      0.653 0.000 0.000 0.004 0.000 0.860 0.136
#> GSM587194     5  0.2362      0.653 0.000 0.000 0.004 0.000 0.860 0.136
#> GSM587195     3  0.0000      0.969 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM587196     3  0.0000      0.969 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM587197     3  0.0000      0.969 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM587198     3  0.0000      0.969 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM587199     3  0.2664      0.762 0.000 0.000 0.816 0.000 0.184 0.000
#> GSM587200     5  0.4705      0.494 0.000 0.000 0.260 0.088 0.652 0.000
#> GSM587201     5  0.4705      0.494 0.000 0.000 0.260 0.088 0.652 0.000
#> GSM587202     3  0.0000      0.969 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM198767     1  0.0000      0.967 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM198769     1  0.3796      0.705 0.776 0.000 0.000 0.084 0.140 0.000
#> GSM198772     1  0.0000      0.967 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM198773     1  0.0000      0.967 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM198776     1  0.0000      0.967 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM198778     5  0.4314      0.624 0.184 0.000 0.000 0.096 0.720 0.000
#> GSM198780     5  0.4228      0.475 0.392 0.000 0.000 0.020 0.588 0.000
#> GSM198781     1  0.0000      0.967 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM198765     3  0.0000      0.969 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM198766     5  0.2362      0.653 0.000 0.000 0.004 0.000 0.860 0.136
#> GSM198768     3  0.0000      0.969 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM198770     3  0.0000      0.969 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM198771     3  0.0000      0.969 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM198774     3  0.0000      0.969 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM198775     5  0.2362      0.653 0.000 0.000 0.004 0.000 0.860 0.136
#> GSM198777     3  0.0000      0.969 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM198779     3  0.2664      0.762 0.000 0.000 0.816 0.000 0.184 0.000
#> GSM587218     4  0.0000      1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM587219     4  0.0000      1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM587220     4  0.0000      1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM587221     4  0.0000      1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM587222     4  0.0000      1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM587223     4  0.0000      1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM587224     4  0.0000      1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM587225     4  0.0000      1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM587226     4  0.0000      1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM587227     4  0.0000      1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM587228     4  0.0000      1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM587229     4  0.0000      1.000 0.000 0.000 0.000 1.000 0.000 0.000

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

consensus_heatmap(res, k = 2)

plot of chunk tab-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 specimen(p) k
#> MAD:hclust 92    1.16e-17 2
#> MAD:hclust 92    4.55e-28 3
#> MAD:hclust 85    7.83e-44 4
#> MAD:hclust 87    3.47e-56 5
#> MAD:hclust 84    2.67e-51 6

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


MAD:kmeans

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

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

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

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

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

collect_plots(res)

plot of chunk MAD-kmeans-collect-plots

The plots are:

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

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

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

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

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.724           0.896       0.944         0.4940 0.500   0.500
#> 3 3 0.781           0.897       0.913         0.3181 0.783   0.588
#> 4 4 0.783           0.758       0.773         0.1030 0.922   0.770
#> 5 5 0.740           0.810       0.823         0.0610 0.953   0.841
#> 6 6 0.716           0.684       0.775         0.0433 0.931   0.748

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
#> GSM587155     2  0.0000      0.889 0.000 1.000
#> GSM587156     2  0.0000      0.889 0.000 1.000
#> GSM587157     2  0.0000      0.889 0.000 1.000
#> GSM587158     2  0.0000      0.889 0.000 1.000
#> GSM587159     2  0.0000      0.889 0.000 1.000
#> GSM587160     2  0.0000      0.889 0.000 1.000
#> GSM587161     2  0.0000      0.889 0.000 1.000
#> GSM587162     2  0.0000      0.889 0.000 1.000
#> GSM587163     2  0.0000      0.889 0.000 1.000
#> GSM587164     2  0.0000      0.889 0.000 1.000
#> GSM587165     2  0.0000      0.889 0.000 1.000
#> GSM587166     2  0.0000      0.889 0.000 1.000
#> GSM587167     2  0.0000      0.889 0.000 1.000
#> GSM587168     2  0.0000      0.889 0.000 1.000
#> GSM587169     2  0.0000      0.889 0.000 1.000
#> GSM587170     2  0.0000      0.889 0.000 1.000
#> GSM587171     2  0.0000      0.889 0.000 1.000
#> GSM587172     2  0.0000      0.889 0.000 1.000
#> GSM587173     2  0.0000      0.889 0.000 1.000
#> GSM587174     2  0.0000      0.889 0.000 1.000
#> GSM587175     2  0.0000      0.889 0.000 1.000
#> GSM587176     2  0.0000      0.889 0.000 1.000
#> GSM587177     2  0.0000      0.889 0.000 1.000
#> GSM587178     2  0.0000      0.889 0.000 1.000
#> GSM587179     2  0.0000      0.889 0.000 1.000
#> GSM587180     2  0.0000      0.889 0.000 1.000
#> GSM587181     2  0.0000      0.889 0.000 1.000
#> GSM587182     2  0.0000      0.889 0.000 1.000
#> GSM587183     2  0.0000      0.889 0.000 1.000
#> GSM587184     2  0.0000      0.889 0.000 1.000
#> GSM587185     2  0.0000      0.889 0.000 1.000
#> GSM587186     2  0.0000      0.889 0.000 1.000
#> GSM587187     2  0.0000      0.889 0.000 1.000
#> GSM587188     2  0.0000      0.889 0.000 1.000
#> GSM587189     2  0.0000      0.889 0.000 1.000
#> GSM587190     2  0.0672      0.885 0.008 0.992
#> GSM587203     1  0.0000      1.000 1.000 0.000
#> GSM587204     1  0.0000      1.000 1.000 0.000
#> GSM587205     1  0.0000      1.000 1.000 0.000
#> GSM587206     1  0.0000      1.000 1.000 0.000
#> GSM587207     1  0.0000      1.000 1.000 0.000
#> GSM587208     1  0.0000      1.000 1.000 0.000
#> GSM587209     1  0.0000      1.000 1.000 0.000
#> GSM587210     1  0.0000      1.000 1.000 0.000
#> GSM587211     1  0.0000      1.000 1.000 0.000
#> GSM587212     1  0.0000      1.000 1.000 0.000
#> GSM587213     1  0.0000      1.000 1.000 0.000
#> GSM587214     1  0.0000      1.000 1.000 0.000
#> GSM587215     1  0.0000      1.000 1.000 0.000
#> GSM587216     1  0.0000      1.000 1.000 0.000
#> GSM587217     1  0.0000      1.000 1.000 0.000
#> GSM587191     2  0.9286      0.623 0.344 0.656
#> GSM587192     1  0.0000      1.000 1.000 0.000
#> GSM587193     1  0.0000      1.000 1.000 0.000
#> GSM587194     2  0.9286      0.623 0.344 0.656
#> GSM587195     2  0.9170      0.637 0.332 0.668
#> GSM587196     2  0.9286      0.623 0.344 0.656
#> GSM587197     2  0.9286      0.623 0.344 0.656
#> GSM587198     2  0.9286      0.623 0.344 0.656
#> GSM587199     2  0.9129      0.641 0.328 0.672
#> GSM587200     1  0.0000      1.000 1.000 0.000
#> GSM587201     1  0.0000      1.000 1.000 0.000
#> GSM587202     2  0.9286      0.623 0.344 0.656
#> GSM198767     1  0.0000      1.000 1.000 0.000
#> GSM198769     1  0.0000      1.000 1.000 0.000
#> GSM198772     1  0.0000      1.000 1.000 0.000
#> GSM198773     1  0.0000      1.000 1.000 0.000
#> GSM198776     1  0.0000      1.000 1.000 0.000
#> GSM198778     1  0.0000      1.000 1.000 0.000
#> GSM198780     1  0.0000      1.000 1.000 0.000
#> GSM198781     1  0.0000      1.000 1.000 0.000
#> GSM198765     2  0.9286      0.623 0.344 0.656
#> GSM198766     1  0.0000      1.000 1.000 0.000
#> GSM198768     2  0.9286      0.623 0.344 0.656
#> GSM198770     2  0.9286      0.623 0.344 0.656
#> GSM198771     2  0.9286      0.623 0.344 0.656
#> GSM198774     1  0.0000      1.000 1.000 0.000
#> GSM198775     2  0.9286      0.623 0.344 0.656
#> GSM198777     2  0.9286      0.623 0.344 0.656
#> GSM198779     2  0.9129      0.641 0.328 0.672
#> GSM587218     1  0.0000      1.000 1.000 0.000
#> GSM587219     1  0.0000      1.000 1.000 0.000
#> GSM587220     1  0.0000      1.000 1.000 0.000
#> GSM587221     1  0.0000      1.000 1.000 0.000
#> GSM587222     1  0.0000      1.000 1.000 0.000
#> GSM587223     1  0.0000      1.000 1.000 0.000
#> GSM587224     1  0.0000      1.000 1.000 0.000
#> GSM587225     1  0.0000      1.000 1.000 0.000
#> GSM587226     1  0.0000      1.000 1.000 0.000
#> GSM587227     1  0.0000      1.000 1.000 0.000
#> GSM587228     1  0.0000      1.000 1.000 0.000
#> GSM587229     1  0.0000      1.000 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1    p2    p3
#> GSM587155     2  0.0592      0.985 0.000 0.988 0.012
#> GSM587156     2  0.0592      0.985 0.000 0.988 0.012
#> GSM587157     2  0.0592      0.985 0.000 0.988 0.012
#> GSM587158     2  0.0000      0.988 0.000 1.000 0.000
#> GSM587159     2  0.0000      0.988 0.000 1.000 0.000
#> GSM587160     2  0.0000      0.988 0.000 1.000 0.000
#> GSM587161     2  0.0592      0.985 0.000 0.988 0.012
#> GSM587162     2  0.0000      0.988 0.000 1.000 0.000
#> GSM587163     2  0.0000      0.988 0.000 1.000 0.000
#> GSM587164     2  0.0592      0.985 0.000 0.988 0.012
#> GSM587165     2  0.0592      0.986 0.000 0.988 0.012
#> GSM587166     2  0.0592      0.985 0.000 0.988 0.012
#> GSM587167     2  0.0592      0.985 0.000 0.988 0.012
#> GSM587168     2  0.0592      0.986 0.000 0.988 0.012
#> GSM587169     2  0.0000      0.988 0.000 1.000 0.000
#> GSM587170     2  0.0592      0.985 0.000 0.988 0.012
#> GSM587171     2  0.0000      0.988 0.000 1.000 0.000
#> GSM587172     2  0.0000      0.988 0.000 1.000 0.000
#> GSM587173     2  0.0592      0.986 0.000 0.988 0.012
#> GSM587174     2  0.0424      0.987 0.000 0.992 0.008
#> GSM587175     2  0.0592      0.985 0.000 0.988 0.012
#> GSM587176     2  0.0000      0.988 0.000 1.000 0.000
#> GSM587177     2  0.0592      0.986 0.000 0.988 0.012
#> GSM587178     2  0.0424      0.987 0.000 0.992 0.008
#> GSM587179     2  0.0000      0.988 0.000 1.000 0.000
#> GSM587180     2  0.0592      0.986 0.000 0.988 0.012
#> GSM587181     2  0.0424      0.987 0.000 0.992 0.008
#> GSM587182     2  0.0424      0.987 0.000 0.992 0.008
#> GSM587183     2  0.0592      0.986 0.000 0.988 0.012
#> GSM587184     2  0.0000      0.988 0.000 1.000 0.000
#> GSM587185     2  0.0000      0.988 0.000 1.000 0.000
#> GSM587186     2  0.0592      0.986 0.000 0.988 0.012
#> GSM587187     2  0.0592      0.986 0.000 0.988 0.012
#> GSM587188     2  0.2959      0.896 0.000 0.900 0.100
#> GSM587189     2  0.2959      0.896 0.000 0.900 0.100
#> GSM587190     3  0.3482      0.879 0.000 0.128 0.872
#> GSM587203     1  0.1289      0.855 0.968 0.000 0.032
#> GSM587204     1  0.1411      0.854 0.964 0.000 0.036
#> GSM587205     1  0.1289      0.855 0.968 0.000 0.032
#> GSM587206     1  0.1289      0.855 0.968 0.000 0.032
#> GSM587207     1  0.1289      0.855 0.968 0.000 0.032
#> GSM587208     1  0.1289      0.855 0.968 0.000 0.032
#> GSM587209     1  0.1031      0.857 0.976 0.000 0.024
#> GSM587210     1  0.4399      0.802 0.812 0.000 0.188
#> GSM587211     1  0.1031      0.857 0.976 0.000 0.024
#> GSM587212     1  0.4062      0.815 0.836 0.000 0.164
#> GSM587213     1  0.1031      0.857 0.976 0.000 0.024
#> GSM587214     1  0.1031      0.857 0.976 0.000 0.024
#> GSM587215     1  0.1031      0.857 0.976 0.000 0.024
#> GSM587216     1  0.1031      0.857 0.976 0.000 0.024
#> GSM587217     1  0.1031      0.857 0.976 0.000 0.024
#> GSM587191     3  0.4007      0.943 0.036 0.084 0.880
#> GSM587192     3  0.2878      0.886 0.096 0.000 0.904
#> GSM587193     3  0.2878      0.886 0.096 0.000 0.904
#> GSM587194     3  0.3550      0.939 0.024 0.080 0.896
#> GSM587195     3  0.4174      0.942 0.036 0.092 0.872
#> GSM587196     3  0.4174      0.942 0.036 0.092 0.872
#> GSM587197     3  0.4174      0.942 0.036 0.092 0.872
#> GSM587198     3  0.4007      0.943 0.036 0.084 0.880
#> GSM587199     3  0.3805      0.939 0.024 0.092 0.884
#> GSM587200     3  0.3267      0.879 0.116 0.000 0.884
#> GSM587201     3  0.3267      0.879 0.116 0.000 0.884
#> GSM587202     3  0.4174      0.942 0.036 0.092 0.872
#> GSM198767     1  0.1289      0.855 0.968 0.000 0.032
#> GSM198769     1  0.1031      0.857 0.976 0.000 0.024
#> GSM198772     1  0.1031      0.857 0.976 0.000 0.024
#> GSM198773     1  0.1031      0.857 0.976 0.000 0.024
#> GSM198776     1  0.1411      0.854 0.964 0.000 0.036
#> GSM198778     1  0.4399      0.802 0.812 0.000 0.188
#> GSM198780     1  0.4062      0.815 0.836 0.000 0.164
#> GSM198781     1  0.1031      0.857 0.976 0.000 0.024
#> GSM198765     3  0.4007      0.943 0.036 0.084 0.880
#> GSM198766     3  0.2878      0.886 0.096 0.000 0.904
#> GSM198768     3  0.4174      0.942 0.036 0.092 0.872
#> GSM198770     3  0.4174      0.942 0.036 0.092 0.872
#> GSM198771     3  0.4007      0.943 0.036 0.084 0.880
#> GSM198774     3  0.2878      0.886 0.096 0.000 0.904
#> GSM198775     3  0.3550      0.939 0.024 0.080 0.896
#> GSM198777     3  0.4174      0.942 0.036 0.092 0.872
#> GSM198779     3  0.3805      0.939 0.024 0.092 0.884
#> GSM587218     3  0.4452      0.678 0.192 0.000 0.808
#> GSM587219     1  0.5810      0.695 0.664 0.000 0.336
#> GSM587220     1  0.5785      0.700 0.668 0.000 0.332
#> GSM587221     1  0.5810      0.695 0.664 0.000 0.336
#> GSM587222     1  0.5785      0.700 0.668 0.000 0.332
#> GSM587223     1  0.5810      0.695 0.664 0.000 0.336
#> GSM587224     1  0.5810      0.695 0.664 0.000 0.336
#> GSM587225     1  0.5810      0.699 0.664 0.000 0.336
#> GSM587226     1  0.5810      0.695 0.664 0.000 0.336
#> GSM587227     1  0.5810      0.699 0.664 0.000 0.336
#> GSM587228     1  0.5810      0.699 0.664 0.000 0.336
#> GSM587229     1  0.5327      0.750 0.728 0.000 0.272

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM587155     2  0.2760      0.894 0.128 0.872 0.000 0.000
#> GSM587156     2  0.3649      0.847 0.204 0.796 0.000 0.000
#> GSM587157     2  0.2868      0.890 0.136 0.864 0.000 0.000
#> GSM587158     2  0.0000      0.936 0.000 1.000 0.000 0.000
#> GSM587159     2  0.0000      0.936 0.000 1.000 0.000 0.000
#> GSM587160     2  0.0336      0.936 0.008 0.992 0.000 0.000
#> GSM587161     2  0.2408      0.905 0.104 0.896 0.000 0.000
#> GSM587162     2  0.0336      0.936 0.008 0.992 0.000 0.000
#> GSM587163     2  0.0336      0.936 0.008 0.992 0.000 0.000
#> GSM587164     2  0.3074      0.882 0.152 0.848 0.000 0.000
#> GSM587165     2  0.1940      0.922 0.076 0.924 0.000 0.000
#> GSM587166     2  0.3649      0.847 0.204 0.796 0.000 0.000
#> GSM587167     2  0.3123      0.879 0.156 0.844 0.000 0.000
#> GSM587168     2  0.1940      0.922 0.076 0.924 0.000 0.000
#> GSM587169     2  0.0336      0.936 0.008 0.992 0.000 0.000
#> GSM587170     2  0.3074      0.882 0.152 0.848 0.000 0.000
#> GSM587171     2  0.0000      0.936 0.000 1.000 0.000 0.000
#> GSM587172     2  0.0000      0.936 0.000 1.000 0.000 0.000
#> GSM587173     2  0.1940      0.922 0.076 0.924 0.000 0.000
#> GSM587174     2  0.0336      0.936 0.008 0.992 0.000 0.000
#> GSM587175     2  0.2868      0.890 0.136 0.864 0.000 0.000
#> GSM587176     2  0.0336      0.936 0.008 0.992 0.000 0.000
#> GSM587177     2  0.1940      0.922 0.076 0.924 0.000 0.000
#> GSM587178     2  0.1716      0.926 0.064 0.936 0.000 0.000
#> GSM587179     2  0.0336      0.936 0.008 0.992 0.000 0.000
#> GSM587180     2  0.1867      0.924 0.072 0.928 0.000 0.000
#> GSM587181     2  0.0336      0.936 0.008 0.992 0.000 0.000
#> GSM587182     2  0.1792      0.925 0.068 0.932 0.000 0.000
#> GSM587183     2  0.1940      0.922 0.076 0.924 0.000 0.000
#> GSM587184     2  0.0000      0.936 0.000 1.000 0.000 0.000
#> GSM587185     2  0.0336      0.936 0.008 0.992 0.000 0.000
#> GSM587186     2  0.1940      0.922 0.076 0.924 0.000 0.000
#> GSM587187     2  0.2345      0.911 0.100 0.900 0.000 0.000
#> GSM587188     2  0.4780      0.815 0.116 0.788 0.096 0.000
#> GSM587189     2  0.4780      0.815 0.116 0.788 0.096 0.000
#> GSM587190     3  0.3328      0.912 0.100 0.024 0.872 0.004
#> GSM587203     1  0.5774      0.932 0.508 0.000 0.028 0.464
#> GSM587204     1  0.5678      0.926 0.524 0.000 0.024 0.452
#> GSM587205     1  0.5774      0.932 0.508 0.000 0.028 0.464
#> GSM587206     1  0.5774      0.932 0.508 0.000 0.028 0.464
#> GSM587207     1  0.5774      0.932 0.508 0.000 0.028 0.464
#> GSM587208     1  0.5774      0.932 0.508 0.000 0.028 0.464
#> GSM587209     1  0.5861      0.920 0.492 0.000 0.032 0.476
#> GSM587210     4  0.6972     -0.207 0.356 0.000 0.124 0.520
#> GSM587211     4  0.5862     -0.932 0.484 0.000 0.032 0.484
#> GSM587212     4  0.6677     -0.341 0.364 0.000 0.096 0.540
#> GSM587213     4  0.5861     -0.930 0.476 0.000 0.032 0.492
#> GSM587214     1  0.5861      0.924 0.488 0.000 0.032 0.480
#> GSM587215     1  0.5859      0.922 0.496 0.000 0.032 0.472
#> GSM587216     1  0.5858      0.920 0.500 0.000 0.032 0.468
#> GSM587217     1  0.5861      0.922 0.492 0.000 0.032 0.476
#> GSM587191     3  0.1722      0.928 0.048 0.008 0.944 0.000
#> GSM587192     3  0.2179      0.924 0.064 0.000 0.924 0.012
#> GSM587193     3  0.5280      0.808 0.124 0.000 0.752 0.124
#> GSM587194     3  0.4406      0.880 0.184 0.004 0.788 0.024
#> GSM587195     3  0.2048      0.920 0.064 0.008 0.928 0.000
#> GSM587196     3  0.2048      0.920 0.064 0.008 0.928 0.000
#> GSM587197     3  0.1994      0.924 0.052 0.008 0.936 0.004
#> GSM587198     3  0.1339      0.929 0.024 0.008 0.964 0.004
#> GSM587199     3  0.2530      0.924 0.072 0.008 0.912 0.008
#> GSM587200     3  0.2741      0.917 0.096 0.000 0.892 0.012
#> GSM587201     3  0.2610      0.917 0.088 0.000 0.900 0.012
#> GSM587202     3  0.1339      0.929 0.024 0.008 0.964 0.004
#> GSM198767     1  0.5774      0.932 0.508 0.000 0.028 0.464
#> GSM198769     1  0.5861      0.920 0.492 0.000 0.032 0.476
#> GSM198772     1  0.5862      0.924 0.484 0.000 0.032 0.484
#> GSM198773     4  0.5861     -0.930 0.476 0.000 0.032 0.492
#> GSM198776     1  0.5678      0.926 0.524 0.000 0.024 0.452
#> GSM198778     4  0.6972     -0.207 0.356 0.000 0.124 0.520
#> GSM198780     4  0.6677     -0.341 0.364 0.000 0.096 0.540
#> GSM198781     1  0.5861      0.924 0.488 0.000 0.032 0.480
#> GSM198765     3  0.1722      0.928 0.048 0.008 0.944 0.000
#> GSM198766     3  0.5280      0.808 0.124 0.000 0.752 0.124
#> GSM198768     3  0.2048      0.920 0.064 0.008 0.928 0.000
#> GSM198770     3  0.1994      0.924 0.052 0.008 0.936 0.004
#> GSM198771     3  0.1339      0.929 0.024 0.008 0.964 0.004
#> GSM198774     3  0.2179      0.924 0.064 0.000 0.924 0.012
#> GSM198775     3  0.4406      0.880 0.184 0.004 0.788 0.024
#> GSM198777     3  0.2048      0.920 0.064 0.008 0.928 0.000
#> GSM198779     3  0.2530      0.924 0.072 0.008 0.912 0.008
#> GSM587218     4  0.6100      0.223 0.084 0.000 0.272 0.644
#> GSM587219     4  0.1022      0.617 0.000 0.000 0.032 0.968
#> GSM587220     4  0.1022      0.617 0.000 0.000 0.032 0.968
#> GSM587221     4  0.1022      0.617 0.000 0.000 0.032 0.968
#> GSM587222     4  0.1022      0.617 0.000 0.000 0.032 0.968
#> GSM587223     4  0.1022      0.617 0.000 0.000 0.032 0.968
#> GSM587224     4  0.1022      0.617 0.000 0.000 0.032 0.968
#> GSM587225     4  0.1284      0.612 0.012 0.000 0.024 0.964
#> GSM587226     4  0.1022      0.617 0.000 0.000 0.032 0.968
#> GSM587227     4  0.1284      0.612 0.012 0.000 0.024 0.964
#> GSM587228     4  0.1284      0.612 0.012 0.000 0.024 0.964
#> GSM587229     4  0.1059      0.603 0.012 0.000 0.016 0.972

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4 p5
#> GSM587155     2  0.4074      0.711 0.000 0.636 0.000 0.000 NA
#> GSM587156     2  0.4510      0.653 0.008 0.560 0.000 0.000 NA
#> GSM587157     2  0.4088      0.708 0.000 0.632 0.000 0.000 NA
#> GSM587158     2  0.0566      0.862 0.004 0.984 0.000 0.000 NA
#> GSM587159     2  0.0693      0.862 0.012 0.980 0.000 0.000 NA
#> GSM587160     2  0.0703      0.860 0.000 0.976 0.000 0.000 NA
#> GSM587161     2  0.3612      0.762 0.000 0.732 0.000 0.000 NA
#> GSM587162     2  0.1121      0.858 0.000 0.956 0.000 0.000 NA
#> GSM587163     2  0.0992      0.860 0.008 0.968 0.000 0.000 NA
#> GSM587164     2  0.4150      0.696 0.000 0.612 0.000 0.000 NA
#> GSM587165     2  0.2914      0.841 0.052 0.872 0.000 0.000 NA
#> GSM587166     2  0.4658      0.648 0.008 0.556 0.004 0.000 NA
#> GSM587167     2  0.4192      0.684 0.000 0.596 0.000 0.000 NA
#> GSM587168     2  0.3085      0.841 0.060 0.868 0.000 0.004 NA
#> GSM587169     2  0.0992      0.860 0.008 0.968 0.000 0.000 NA
#> GSM587170     2  0.4150      0.697 0.000 0.612 0.000 0.000 NA
#> GSM587171     2  0.0693      0.862 0.012 0.980 0.000 0.000 NA
#> GSM587172     2  0.0693      0.862 0.012 0.980 0.000 0.000 NA
#> GSM587173     2  0.3461      0.837 0.068 0.848 0.000 0.008 NA
#> GSM587174     2  0.0671      0.862 0.004 0.980 0.000 0.000 NA
#> GSM587175     2  0.4060      0.713 0.000 0.640 0.000 0.000 NA
#> GSM587176     2  0.0794      0.860 0.000 0.972 0.000 0.000 NA
#> GSM587177     2  0.2914      0.841 0.052 0.872 0.000 0.000 NA
#> GSM587178     2  0.2632      0.844 0.040 0.888 0.000 0.000 NA
#> GSM587179     2  0.0771      0.861 0.004 0.976 0.000 0.000 NA
#> GSM587180     2  0.3018      0.842 0.056 0.872 0.000 0.004 NA
#> GSM587181     2  0.0671      0.862 0.004 0.980 0.000 0.000 NA
#> GSM587182     2  0.2949      0.843 0.052 0.876 0.000 0.004 NA
#> GSM587183     2  0.2914      0.841 0.052 0.872 0.000 0.000 NA
#> GSM587184     2  0.0671      0.862 0.016 0.980 0.000 0.000 NA
#> GSM587185     2  0.0771      0.861 0.004 0.976 0.000 0.000 NA
#> GSM587186     2  0.3461      0.837 0.068 0.848 0.000 0.008 NA
#> GSM587187     2  0.3436      0.835 0.056 0.852 0.000 0.012 NA
#> GSM587188     2  0.6182      0.702 0.072 0.688 0.116 0.012 NA
#> GSM587189     2  0.6125      0.704 0.068 0.692 0.116 0.012 NA
#> GSM587190     3  0.4261      0.837 0.048 0.000 0.780 0.012 NA
#> GSM587203     1  0.5358      0.811 0.648 0.000 0.000 0.248 NA
#> GSM587204     1  0.5423      0.809 0.644 0.000 0.000 0.244 NA
#> GSM587205     1  0.5358      0.811 0.648 0.000 0.000 0.248 NA
#> GSM587206     1  0.5358      0.811 0.648 0.000 0.000 0.248 NA
#> GSM587207     1  0.5358      0.811 0.648 0.000 0.000 0.248 NA
#> GSM587208     1  0.5358      0.811 0.648 0.000 0.000 0.248 NA
#> GSM587209     1  0.4668      0.831 0.684 0.000 0.000 0.272 NA
#> GSM587210     1  0.7263      0.391 0.400 0.000 0.048 0.396 NA
#> GSM587211     1  0.4800      0.827 0.676 0.000 0.000 0.272 NA
#> GSM587212     1  0.6781      0.465 0.424 0.000 0.028 0.420 NA
#> GSM587213     1  0.3636      0.837 0.728 0.000 0.000 0.272 NA
#> GSM587214     1  0.3612      0.837 0.732 0.000 0.000 0.268 NA
#> GSM587215     1  0.4268      0.835 0.708 0.000 0.000 0.268 NA
#> GSM587216     1  0.5470      0.788 0.628 0.000 0.000 0.268 NA
#> GSM587217     1  0.4268      0.835 0.708 0.000 0.000 0.268 NA
#> GSM587191     3  0.4014      0.842 0.060 0.000 0.804 0.008 NA
#> GSM587192     3  0.4314      0.838 0.068 0.000 0.780 0.008 NA
#> GSM587193     3  0.7312      0.653 0.088 0.000 0.512 0.132 NA
#> GSM587194     3  0.6167      0.754 0.068 0.000 0.600 0.048 NA
#> GSM587195     3  0.2313      0.837 0.044 0.000 0.912 0.004 NA
#> GSM587196     3  0.2313      0.837 0.044 0.000 0.912 0.004 NA
#> GSM587197     3  0.2751      0.839 0.056 0.000 0.888 0.004 NA
#> GSM587198     3  0.1331      0.852 0.008 0.000 0.952 0.000 NA
#> GSM587199     3  0.2561      0.852 0.020 0.000 0.884 0.000 NA
#> GSM587200     3  0.5047      0.800 0.056 0.000 0.724 0.028 NA
#> GSM587201     3  0.5229      0.791 0.068 0.000 0.712 0.028 NA
#> GSM587202     3  0.1408      0.851 0.008 0.000 0.948 0.000 NA
#> GSM198767     1  0.5358      0.811 0.648 0.000 0.000 0.248 NA
#> GSM198769     1  0.4668      0.831 0.684 0.000 0.000 0.272 NA
#> GSM198772     1  0.4800      0.827 0.676 0.000 0.000 0.272 NA
#> GSM198773     1  0.3636      0.837 0.728 0.000 0.000 0.272 NA
#> GSM198776     1  0.5423      0.809 0.644 0.000 0.000 0.244 NA
#> GSM198778     1  0.7263      0.391 0.400 0.000 0.048 0.396 NA
#> GSM198780     1  0.6781      0.465 0.424 0.000 0.028 0.420 NA
#> GSM198781     1  0.3612      0.837 0.732 0.000 0.000 0.268 NA
#> GSM198765     3  0.4014      0.842 0.060 0.000 0.804 0.008 NA
#> GSM198766     3  0.7312      0.653 0.088 0.000 0.512 0.132 NA
#> GSM198768     3  0.2313      0.837 0.044 0.000 0.912 0.004 NA
#> GSM198770     3  0.2751      0.839 0.056 0.000 0.888 0.004 NA
#> GSM198771     3  0.1331      0.852 0.008 0.000 0.952 0.000 NA
#> GSM198774     3  0.4314      0.838 0.068 0.000 0.780 0.008 NA
#> GSM198775     3  0.6167      0.754 0.068 0.000 0.600 0.048 NA
#> GSM198777     3  0.2313      0.837 0.044 0.000 0.912 0.004 NA
#> GSM198779     3  0.2561      0.852 0.020 0.000 0.884 0.000 NA
#> GSM587218     4  0.4282      0.703 0.064 0.000 0.112 0.800 NA
#> GSM587219     4  0.0609      0.955 0.000 0.000 0.020 0.980 NA
#> GSM587220     4  0.0609      0.955 0.000 0.000 0.020 0.980 NA
#> GSM587221     4  0.0609      0.955 0.000 0.000 0.020 0.980 NA
#> GSM587222     4  0.0609      0.955 0.000 0.000 0.020 0.980 NA
#> GSM587223     4  0.0609      0.955 0.000 0.000 0.020 0.980 NA
#> GSM587224     4  0.0771      0.952 0.004 0.000 0.020 0.976 NA
#> GSM587225     4  0.1461      0.943 0.004 0.000 0.016 0.952 NA
#> GSM587226     4  0.0609      0.955 0.000 0.000 0.020 0.980 NA
#> GSM587227     4  0.1461      0.943 0.004 0.000 0.016 0.952 NA
#> GSM587228     4  0.1461      0.943 0.004 0.000 0.016 0.952 NA
#> GSM587229     4  0.1483      0.939 0.008 0.000 0.012 0.952 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
#> GSM587155     6  0.3989    0.91900 0.000 0.468 0.000 0.004 0.000 0.528
#> GSM587156     6  0.5233    0.86719 0.000 0.384 0.000 0.012 0.068 0.536
#> GSM587157     6  0.3851    0.93042 0.000 0.460 0.000 0.000 0.000 0.540
#> GSM587158     2  0.0551    0.74351 0.000 0.984 0.000 0.004 0.004 0.008
#> GSM587159     2  0.0551    0.74351 0.000 0.984 0.000 0.004 0.004 0.008
#> GSM587160     2  0.1074    0.72474 0.000 0.960 0.000 0.012 0.000 0.028
#> GSM587161     2  0.3714   -0.42252 0.000 0.656 0.000 0.004 0.000 0.340
#> GSM587162     2  0.2006    0.66514 0.000 0.904 0.000 0.016 0.000 0.080
#> GSM587163     2  0.0632    0.73003 0.000 0.976 0.000 0.000 0.000 0.024
#> GSM587164     6  0.3833    0.93680 0.000 0.444 0.000 0.000 0.000 0.556
#> GSM587165     2  0.4055    0.70416 0.000 0.792 0.000 0.068 0.040 0.100
#> GSM587166     6  0.5233    0.86719 0.000 0.384 0.000 0.012 0.068 0.536
#> GSM587167     6  0.4199    0.93539 0.000 0.444 0.000 0.004 0.008 0.544
#> GSM587168     2  0.4637    0.68215 0.000 0.752 0.000 0.080 0.072 0.096
#> GSM587169     2  0.0713    0.73187 0.000 0.972 0.000 0.000 0.000 0.028
#> GSM587170     6  0.4103    0.93706 0.000 0.448 0.000 0.004 0.004 0.544
#> GSM587171     2  0.0551    0.74351 0.000 0.984 0.000 0.004 0.004 0.008
#> GSM587172     2  0.0551    0.74351 0.000 0.984 0.000 0.004 0.004 0.008
#> GSM587173     2  0.5020    0.65040 0.000 0.720 0.000 0.084 0.092 0.104
#> GSM587174     2  0.0914    0.74833 0.000 0.968 0.000 0.016 0.000 0.016
#> GSM587175     6  0.3854    0.92712 0.000 0.464 0.000 0.000 0.000 0.536
#> GSM587176     2  0.1367    0.71094 0.000 0.944 0.000 0.012 0.000 0.044
#> GSM587177     2  0.3861    0.71035 0.000 0.804 0.000 0.064 0.032 0.100
#> GSM587178     2  0.2402    0.73896 0.000 0.888 0.000 0.020 0.008 0.084
#> GSM587179     2  0.1605    0.72375 0.000 0.940 0.000 0.016 0.012 0.032
#> GSM587180     2  0.4435    0.69328 0.000 0.768 0.000 0.080 0.064 0.088
#> GSM587181     2  0.0914    0.74833 0.000 0.968 0.000 0.016 0.000 0.016
#> GSM587182     2  0.4284    0.70003 0.000 0.780 0.000 0.080 0.064 0.076
#> GSM587183     2  0.3861    0.71035 0.000 0.804 0.000 0.064 0.032 0.100
#> GSM587184     2  0.0767    0.74816 0.000 0.976 0.000 0.012 0.004 0.008
#> GSM587185     2  0.1605    0.72375 0.000 0.940 0.000 0.016 0.012 0.032
#> GSM587186     2  0.5020    0.65040 0.000 0.720 0.000 0.084 0.092 0.104
#> GSM587187     2  0.5998    0.55177 0.000 0.640 0.016 0.068 0.108 0.168
#> GSM587188     2  0.7664    0.31057 0.000 0.488 0.108 0.072 0.144 0.188
#> GSM587189     2  0.7614    0.31586 0.000 0.496 0.108 0.072 0.140 0.184
#> GSM587190     3  0.6133    0.12518 0.000 0.004 0.540 0.024 0.256 0.176
#> GSM587203     1  0.2712    0.80328 0.864 0.000 0.000 0.016 0.012 0.108
#> GSM587204     1  0.2880    0.80207 0.856 0.000 0.000 0.012 0.024 0.108
#> GSM587205     1  0.2712    0.80328 0.864 0.000 0.000 0.016 0.012 0.108
#> GSM587206     1  0.2712    0.80328 0.864 0.000 0.000 0.016 0.012 0.108
#> GSM587207     1  0.2712    0.80328 0.864 0.000 0.000 0.016 0.012 0.108
#> GSM587208     1  0.2712    0.80328 0.864 0.000 0.000 0.016 0.012 0.108
#> GSM587209     1  0.2351    0.79901 0.900 0.000 0.000 0.012 0.052 0.036
#> GSM587210     1  0.6918    0.32705 0.452 0.000 0.008 0.164 0.308 0.068
#> GSM587211     1  0.2384    0.80019 0.896 0.000 0.000 0.008 0.056 0.040
#> GSM587212     1  0.6500    0.43068 0.536 0.000 0.004 0.156 0.240 0.064
#> GSM587213     1  0.0458    0.81806 0.984 0.000 0.000 0.016 0.000 0.000
#> GSM587214     1  0.0458    0.81806 0.984 0.000 0.000 0.016 0.000 0.000
#> GSM587215     1  0.1562    0.81060 0.940 0.000 0.000 0.004 0.024 0.032
#> GSM587216     1  0.3822    0.73786 0.800 0.000 0.000 0.020 0.112 0.068
#> GSM587217     1  0.1675    0.81122 0.936 0.000 0.000 0.008 0.024 0.032
#> GSM587191     3  0.4603    0.34482 0.008 0.000 0.664 0.016 0.288 0.024
#> GSM587192     3  0.4965    0.00625 0.008 0.000 0.552 0.020 0.400 0.020
#> GSM587193     5  0.6080    0.82226 0.032 0.000 0.280 0.104 0.568 0.016
#> GSM587194     5  0.4928    0.81265 0.000 0.000 0.288 0.040 0.640 0.032
#> GSM587195     3  0.1109    0.61845 0.004 0.000 0.964 0.012 0.016 0.004
#> GSM587196     3  0.1109    0.61845 0.004 0.000 0.964 0.012 0.016 0.004
#> GSM587197     3  0.1419    0.61508 0.004 0.000 0.952 0.016 0.012 0.016
#> GSM587198     3  0.3655    0.58813 0.004 0.000 0.804 0.020 0.144 0.028
#> GSM587199     3  0.4545    0.45838 0.000 0.000 0.668 0.020 0.280 0.032
#> GSM587200     3  0.6252    0.02119 0.016 0.000 0.476 0.044 0.388 0.076
#> GSM587201     3  0.6325    0.00790 0.020 0.000 0.472 0.044 0.388 0.076
#> GSM587202     3  0.3577    0.59018 0.004 0.000 0.812 0.020 0.136 0.028
#> GSM198767     1  0.2712    0.80328 0.864 0.000 0.000 0.016 0.012 0.108
#> GSM198769     1  0.2351    0.79901 0.900 0.000 0.000 0.012 0.052 0.036
#> GSM198772     1  0.2384    0.80019 0.896 0.000 0.000 0.008 0.056 0.040
#> GSM198773     1  0.0458    0.81806 0.984 0.000 0.000 0.016 0.000 0.000
#> GSM198776     1  0.2880    0.80207 0.856 0.000 0.000 0.012 0.024 0.108
#> GSM198778     1  0.6918    0.32705 0.452 0.000 0.008 0.164 0.308 0.068
#> GSM198780     1  0.6500    0.43068 0.536 0.000 0.004 0.156 0.240 0.064
#> GSM198781     1  0.0458    0.81806 0.984 0.000 0.000 0.016 0.000 0.000
#> GSM198765     3  0.4603    0.34482 0.008 0.000 0.664 0.016 0.288 0.024
#> GSM198766     5  0.6080    0.82226 0.032 0.000 0.280 0.104 0.568 0.016
#> GSM198768     3  0.1109    0.61845 0.004 0.000 0.964 0.012 0.016 0.004
#> GSM198770     3  0.1419    0.61508 0.004 0.000 0.952 0.016 0.012 0.016
#> GSM198771     3  0.3655    0.58813 0.004 0.000 0.804 0.020 0.144 0.028
#> GSM198774     3  0.4965    0.00625 0.008 0.000 0.552 0.020 0.400 0.020
#> GSM198775     5  0.4928    0.81265 0.000 0.000 0.288 0.040 0.640 0.032
#> GSM198777     3  0.1109    0.61845 0.004 0.000 0.964 0.012 0.016 0.004
#> GSM198779     3  0.4545    0.45838 0.000 0.000 0.668 0.020 0.280 0.032
#> GSM587218     4  0.3755    0.71676 0.044 0.000 0.056 0.816 0.084 0.000
#> GSM587219     4  0.2915    0.95268 0.184 0.000 0.008 0.808 0.000 0.000
#> GSM587220     4  0.2915    0.95268 0.184 0.000 0.008 0.808 0.000 0.000
#> GSM587221     4  0.2915    0.95268 0.184 0.000 0.008 0.808 0.000 0.000
#> GSM587222     4  0.2915    0.95268 0.184 0.000 0.008 0.808 0.000 0.000
#> GSM587223     4  0.2915    0.95268 0.184 0.000 0.008 0.808 0.000 0.000
#> GSM587224     4  0.2882    0.95020 0.180 0.000 0.008 0.812 0.000 0.000
#> GSM587225     4  0.4138    0.93246 0.184 0.000 0.000 0.752 0.020 0.044
#> GSM587226     4  0.2915    0.95268 0.184 0.000 0.008 0.808 0.000 0.000
#> GSM587227     4  0.4138    0.93246 0.184 0.000 0.000 0.752 0.020 0.044
#> GSM587228     4  0.4138    0.93246 0.184 0.000 0.000 0.752 0.020 0.044
#> GSM587229     4  0.4138    0.93246 0.184 0.000 0.000 0.752 0.020 0.044

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

consensus_heatmap(res, k = 2)

plot of chunk tab-MAD-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 specimen(p) k
#> MAD:kmeans 92    4.01e-14 2
#> MAD:kmeans 92    1.23e-30 3
#> MAD:kmeans 84    2.84e-42 4
#> MAD:kmeans 88    1.14e-44 5
#> MAD:kmeans 76    1.62e-32 6

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


MAD:skmeans**

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

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

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

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

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

collect_plots(res)

plot of chunk 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.974       0.987         0.5038 0.497   0.497
#> 3 3 1.000           0.966       0.984         0.2693 0.832   0.671
#> 4 4 0.964           0.953       0.972         0.1338 0.890   0.704
#> 5 5 0.959           0.924       0.959         0.0335 0.974   0.908
#> 6 6 0.926           0.837       0.897         0.0285 0.989   0.957

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

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

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

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

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

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>           class entropy silhouette    p1    p2
#> GSM587155     2   0.000      0.977 0.000 1.000
#> GSM587156     2   0.000      0.977 0.000 1.000
#> GSM587157     2   0.000      0.977 0.000 1.000
#> GSM587158     2   0.000      0.977 0.000 1.000
#> GSM587159     2   0.000      0.977 0.000 1.000
#> GSM587160     2   0.000      0.977 0.000 1.000
#> GSM587161     2   0.000      0.977 0.000 1.000
#> GSM587162     2   0.000      0.977 0.000 1.000
#> GSM587163     2   0.000      0.977 0.000 1.000
#> GSM587164     2   0.000      0.977 0.000 1.000
#> GSM587165     2   0.000      0.977 0.000 1.000
#> GSM587166     2   0.000      0.977 0.000 1.000
#> GSM587167     2   0.000      0.977 0.000 1.000
#> GSM587168     2   0.000      0.977 0.000 1.000
#> GSM587169     2   0.000      0.977 0.000 1.000
#> GSM587170     2   0.000      0.977 0.000 1.000
#> GSM587171     2   0.000      0.977 0.000 1.000
#> GSM587172     2   0.000      0.977 0.000 1.000
#> GSM587173     2   0.000      0.977 0.000 1.000
#> GSM587174     2   0.000      0.977 0.000 1.000
#> GSM587175     2   0.000      0.977 0.000 1.000
#> GSM587176     2   0.000      0.977 0.000 1.000
#> GSM587177     2   0.000      0.977 0.000 1.000
#> GSM587178     2   0.000      0.977 0.000 1.000
#> GSM587179     2   0.000      0.977 0.000 1.000
#> GSM587180     2   0.000      0.977 0.000 1.000
#> GSM587181     2   0.000      0.977 0.000 1.000
#> GSM587182     2   0.000      0.977 0.000 1.000
#> GSM587183     2   0.000      0.977 0.000 1.000
#> GSM587184     2   0.000      0.977 0.000 1.000
#> GSM587185     2   0.000      0.977 0.000 1.000
#> GSM587186     2   0.000      0.977 0.000 1.000
#> GSM587187     2   0.000      0.977 0.000 1.000
#> GSM587188     2   0.000      0.977 0.000 1.000
#> GSM587189     2   0.000      0.977 0.000 1.000
#> GSM587190     2   0.000      0.977 0.000 1.000
#> GSM587203     1   0.000      0.998 1.000 0.000
#> GSM587204     1   0.000      0.998 1.000 0.000
#> GSM587205     1   0.000      0.998 1.000 0.000
#> GSM587206     1   0.000      0.998 1.000 0.000
#> GSM587207     1   0.000      0.998 1.000 0.000
#> GSM587208     1   0.000      0.998 1.000 0.000
#> GSM587209     1   0.000      0.998 1.000 0.000
#> GSM587210     1   0.000      0.998 1.000 0.000
#> GSM587211     1   0.000      0.998 1.000 0.000
#> GSM587212     1   0.000      0.998 1.000 0.000
#> GSM587213     1   0.000      0.998 1.000 0.000
#> GSM587214     1   0.000      0.998 1.000 0.000
#> GSM587215     1   0.000      0.998 1.000 0.000
#> GSM587216     1   0.000      0.998 1.000 0.000
#> GSM587217     1   0.000      0.998 1.000 0.000
#> GSM587191     2   0.000      0.977 0.000 1.000
#> GSM587192     1   0.000      0.998 1.000 0.000
#> GSM587193     1   0.000      0.998 1.000 0.000
#> GSM587194     1   0.278      0.950 0.952 0.048
#> GSM587195     2   0.000      0.977 0.000 1.000
#> GSM587196     2   0.260      0.943 0.044 0.956
#> GSM587197     2   0.000      0.977 0.000 1.000
#> GSM587198     2   0.706      0.786 0.192 0.808
#> GSM587199     2   0.722      0.776 0.200 0.800
#> GSM587200     1   0.000      0.998 1.000 0.000
#> GSM587201     1   0.000      0.998 1.000 0.000
#> GSM587202     2   0.722      0.776 0.200 0.800
#> GSM198767     1   0.000      0.998 1.000 0.000
#> GSM198769     1   0.000      0.998 1.000 0.000
#> GSM198772     1   0.000      0.998 1.000 0.000
#> GSM198773     1   0.000      0.998 1.000 0.000
#> GSM198776     1   0.000      0.998 1.000 0.000
#> GSM198778     1   0.000      0.998 1.000 0.000
#> GSM198780     1   0.000      0.998 1.000 0.000
#> GSM198781     1   0.000      0.998 1.000 0.000
#> GSM198765     2   0.224      0.950 0.036 0.964
#> GSM198766     1   0.000      0.998 1.000 0.000
#> GSM198768     2   0.000      0.977 0.000 1.000
#> GSM198770     2   0.000      0.977 0.000 1.000
#> GSM198771     2   0.722      0.776 0.200 0.800
#> GSM198774     1   0.000      0.998 1.000 0.000
#> GSM198775     1   0.278      0.950 0.952 0.048
#> GSM198777     2   0.260      0.943 0.044 0.956
#> GSM198779     2   0.722      0.776 0.200 0.800
#> GSM587218     1   0.000      0.998 1.000 0.000
#> GSM587219     1   0.000      0.998 1.000 0.000
#> GSM587220     1   0.000      0.998 1.000 0.000
#> GSM587221     1   0.000      0.998 1.000 0.000
#> GSM587222     1   0.000      0.998 1.000 0.000
#> GSM587223     1   0.000      0.998 1.000 0.000
#> GSM587224     1   0.000      0.998 1.000 0.000
#> GSM587225     1   0.000      0.998 1.000 0.000
#> GSM587226     1   0.000      0.998 1.000 0.000
#> GSM587227     1   0.000      0.998 1.000 0.000
#> GSM587228     1   0.000      0.998 1.000 0.000
#> GSM587229     1   0.000      0.998 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
#> GSM587155     2   0.000      1.000 0.000 1.00 0.000
#> GSM587156     2   0.000      1.000 0.000 1.00 0.000
#> GSM587157     2   0.000      1.000 0.000 1.00 0.000
#> GSM587158     2   0.000      1.000 0.000 1.00 0.000
#> GSM587159     2   0.000      1.000 0.000 1.00 0.000
#> GSM587160     2   0.000      1.000 0.000 1.00 0.000
#> GSM587161     2   0.000      1.000 0.000 1.00 0.000
#> GSM587162     2   0.000      1.000 0.000 1.00 0.000
#> GSM587163     2   0.000      1.000 0.000 1.00 0.000
#> GSM587164     2   0.000      1.000 0.000 1.00 0.000
#> GSM587165     2   0.000      1.000 0.000 1.00 0.000
#> GSM587166     2   0.000      1.000 0.000 1.00 0.000
#> GSM587167     2   0.000      1.000 0.000 1.00 0.000
#> GSM587168     2   0.000      1.000 0.000 1.00 0.000
#> GSM587169     2   0.000      1.000 0.000 1.00 0.000
#> GSM587170     2   0.000      1.000 0.000 1.00 0.000
#> GSM587171     2   0.000      1.000 0.000 1.00 0.000
#> GSM587172     2   0.000      1.000 0.000 1.00 0.000
#> GSM587173     2   0.000      1.000 0.000 1.00 0.000
#> GSM587174     2   0.000      1.000 0.000 1.00 0.000
#> GSM587175     2   0.000      1.000 0.000 1.00 0.000
#> GSM587176     2   0.000      1.000 0.000 1.00 0.000
#> GSM587177     2   0.000      1.000 0.000 1.00 0.000
#> GSM587178     2   0.000      1.000 0.000 1.00 0.000
#> GSM587179     2   0.000      1.000 0.000 1.00 0.000
#> GSM587180     2   0.000      1.000 0.000 1.00 0.000
#> GSM587181     2   0.000      1.000 0.000 1.00 0.000
#> GSM587182     2   0.000      1.000 0.000 1.00 0.000
#> GSM587183     2   0.000      1.000 0.000 1.00 0.000
#> GSM587184     2   0.000      1.000 0.000 1.00 0.000
#> GSM587185     2   0.000      1.000 0.000 1.00 0.000
#> GSM587186     2   0.000      1.000 0.000 1.00 0.000
#> GSM587187     2   0.000      1.000 0.000 1.00 0.000
#> GSM587188     2   0.000      1.000 0.000 1.00 0.000
#> GSM587189     2   0.000      1.000 0.000 1.00 0.000
#> GSM587190     3   0.628      0.224 0.000 0.46 0.540
#> GSM587203     1   0.000      0.995 1.000 0.00 0.000
#> GSM587204     1   0.000      0.995 1.000 0.00 0.000
#> GSM587205     1   0.000      0.995 1.000 0.00 0.000
#> GSM587206     1   0.000      0.995 1.000 0.00 0.000
#> GSM587207     1   0.000      0.995 1.000 0.00 0.000
#> GSM587208     1   0.000      0.995 1.000 0.00 0.000
#> GSM587209     1   0.000      0.995 1.000 0.00 0.000
#> GSM587210     1   0.000      0.995 1.000 0.00 0.000
#> GSM587211     1   0.000      0.995 1.000 0.00 0.000
#> GSM587212     1   0.000      0.995 1.000 0.00 0.000
#> GSM587213     1   0.000      0.995 1.000 0.00 0.000
#> GSM587214     1   0.000      0.995 1.000 0.00 0.000
#> GSM587215     1   0.000      0.995 1.000 0.00 0.000
#> GSM587216     1   0.000      0.995 1.000 0.00 0.000
#> GSM587217     1   0.000      0.995 1.000 0.00 0.000
#> GSM587191     3   0.000      0.931 0.000 0.00 1.000
#> GSM587192     3   0.000      0.931 0.000 0.00 1.000
#> GSM587193     1   0.000      0.995 1.000 0.00 0.000
#> GSM587194     3   0.811      0.537 0.096 0.30 0.604
#> GSM587195     3   0.000      0.931 0.000 0.00 1.000
#> GSM587196     3   0.000      0.931 0.000 0.00 1.000
#> GSM587197     3   0.000      0.931 0.000 0.00 1.000
#> GSM587198     3   0.000      0.931 0.000 0.00 1.000
#> GSM587199     3   0.000      0.931 0.000 0.00 1.000
#> GSM587200     1   0.388      0.817 0.848 0.00 0.152
#> GSM587201     1   0.141      0.959 0.964 0.00 0.036
#> GSM587202     3   0.000      0.931 0.000 0.00 1.000
#> GSM198767     1   0.000      0.995 1.000 0.00 0.000
#> GSM198769     1   0.000      0.995 1.000 0.00 0.000
#> GSM198772     1   0.000      0.995 1.000 0.00 0.000
#> GSM198773     1   0.000      0.995 1.000 0.00 0.000
#> GSM198776     1   0.000      0.995 1.000 0.00 0.000
#> GSM198778     1   0.000      0.995 1.000 0.00 0.000
#> GSM198780     1   0.000      0.995 1.000 0.00 0.000
#> GSM198781     1   0.000      0.995 1.000 0.00 0.000
#> GSM198765     3   0.000      0.931 0.000 0.00 1.000
#> GSM198766     1   0.000      0.995 1.000 0.00 0.000
#> GSM198768     3   0.000      0.931 0.000 0.00 1.000
#> GSM198770     3   0.000      0.931 0.000 0.00 1.000
#> GSM198771     3   0.000      0.931 0.000 0.00 1.000
#> GSM198774     3   0.000      0.931 0.000 0.00 1.000
#> GSM198775     3   0.811      0.537 0.096 0.30 0.604
#> GSM198777     3   0.000      0.931 0.000 0.00 1.000
#> GSM198779     3   0.000      0.931 0.000 0.00 1.000
#> GSM587218     1   0.000      0.995 1.000 0.00 0.000
#> GSM587219     1   0.000      0.995 1.000 0.00 0.000
#> GSM587220     1   0.000      0.995 1.000 0.00 0.000
#> GSM587221     1   0.000      0.995 1.000 0.00 0.000
#> GSM587222     1   0.000      0.995 1.000 0.00 0.000
#> GSM587223     1   0.000      0.995 1.000 0.00 0.000
#> GSM587224     1   0.000      0.995 1.000 0.00 0.000
#> GSM587225     1   0.000      0.995 1.000 0.00 0.000
#> GSM587226     1   0.000      0.995 1.000 0.00 0.000
#> GSM587227     1   0.000      0.995 1.000 0.00 0.000
#> GSM587228     1   0.000      0.995 1.000 0.00 0.000
#> GSM587229     1   0.000      0.995 1.000 0.00 0.000

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM587155     2  0.0000      0.990 0.000 1.000 0.000 0.000
#> GSM587156     2  0.0000      0.990 0.000 1.000 0.000 0.000
#> GSM587157     2  0.0000      0.990 0.000 1.000 0.000 0.000
#> GSM587158     2  0.0000      0.990 0.000 1.000 0.000 0.000
#> GSM587159     2  0.0000      0.990 0.000 1.000 0.000 0.000
#> GSM587160     2  0.0000      0.990 0.000 1.000 0.000 0.000
#> GSM587161     2  0.0000      0.990 0.000 1.000 0.000 0.000
#> GSM587162     2  0.0000      0.990 0.000 1.000 0.000 0.000
#> GSM587163     2  0.0000      0.990 0.000 1.000 0.000 0.000
#> GSM587164     2  0.0000      0.990 0.000 1.000 0.000 0.000
#> GSM587165     2  0.0000      0.990 0.000 1.000 0.000 0.000
#> GSM587166     2  0.0000      0.990 0.000 1.000 0.000 0.000
#> GSM587167     2  0.0000      0.990 0.000 1.000 0.000 0.000
#> GSM587168     2  0.0000      0.990 0.000 1.000 0.000 0.000
#> GSM587169     2  0.0000      0.990 0.000 1.000 0.000 0.000
#> GSM587170     2  0.0000      0.990 0.000 1.000 0.000 0.000
#> GSM587171     2  0.0000      0.990 0.000 1.000 0.000 0.000
#> GSM587172     2  0.0000      0.990 0.000 1.000 0.000 0.000
#> GSM587173     2  0.0000      0.990 0.000 1.000 0.000 0.000
#> GSM587174     2  0.0000      0.990 0.000 1.000 0.000 0.000
#> GSM587175     2  0.0000      0.990 0.000 1.000 0.000 0.000
#> GSM587176     2  0.0000      0.990 0.000 1.000 0.000 0.000
#> GSM587177     2  0.0000      0.990 0.000 1.000 0.000 0.000
#> GSM587178     2  0.0000      0.990 0.000 1.000 0.000 0.000
#> GSM587179     2  0.0000      0.990 0.000 1.000 0.000 0.000
#> GSM587180     2  0.0000      0.990 0.000 1.000 0.000 0.000
#> GSM587181     2  0.0000      0.990 0.000 1.000 0.000 0.000
#> GSM587182     2  0.0000      0.990 0.000 1.000 0.000 0.000
#> GSM587183     2  0.0000      0.990 0.000 1.000 0.000 0.000
#> GSM587184     2  0.0000      0.990 0.000 1.000 0.000 0.000
#> GSM587185     2  0.0000      0.990 0.000 1.000 0.000 0.000
#> GSM587186     2  0.0000      0.990 0.000 1.000 0.000 0.000
#> GSM587187     2  0.0000      0.990 0.000 1.000 0.000 0.000
#> GSM587188     2  0.0000      0.990 0.000 1.000 0.000 0.000
#> GSM587189     2  0.0000      0.990 0.000 1.000 0.000 0.000
#> GSM587190     2  0.5271      0.483 0.000 0.656 0.320 0.024
#> GSM587203     1  0.0000      0.942 1.000 0.000 0.000 0.000
#> GSM587204     1  0.0000      0.942 1.000 0.000 0.000 0.000
#> GSM587205     1  0.0000      0.942 1.000 0.000 0.000 0.000
#> GSM587206     1  0.0000      0.942 1.000 0.000 0.000 0.000
#> GSM587207     1  0.0000      0.942 1.000 0.000 0.000 0.000
#> GSM587208     1  0.0000      0.942 1.000 0.000 0.000 0.000
#> GSM587209     1  0.0000      0.942 1.000 0.000 0.000 0.000
#> GSM587210     1  0.3873      0.732 0.772 0.000 0.000 0.228
#> GSM587211     1  0.0000      0.942 1.000 0.000 0.000 0.000
#> GSM587212     1  0.3873      0.732 0.772 0.000 0.000 0.228
#> GSM587213     1  0.0000      0.942 1.000 0.000 0.000 0.000
#> GSM587214     1  0.0000      0.942 1.000 0.000 0.000 0.000
#> GSM587215     1  0.0000      0.942 1.000 0.000 0.000 0.000
#> GSM587216     1  0.0000      0.942 1.000 0.000 0.000 0.000
#> GSM587217     1  0.0000      0.942 1.000 0.000 0.000 0.000
#> GSM587191     3  0.1474      0.964 0.000 0.000 0.948 0.052
#> GSM587192     3  0.1867      0.951 0.000 0.000 0.928 0.072
#> GSM587193     4  0.0592      0.946 0.016 0.000 0.000 0.984
#> GSM587194     4  0.0524      0.943 0.000 0.004 0.008 0.988
#> GSM587195     3  0.0000      0.986 0.000 0.000 1.000 0.000
#> GSM587196     3  0.0000      0.986 0.000 0.000 1.000 0.000
#> GSM587197     3  0.0000      0.986 0.000 0.000 1.000 0.000
#> GSM587198     3  0.0000      0.986 0.000 0.000 1.000 0.000
#> GSM587199     3  0.0000      0.986 0.000 0.000 1.000 0.000
#> GSM587200     1  0.6429      0.611 0.644 0.000 0.144 0.212
#> GSM587201     1  0.2048      0.889 0.928 0.000 0.064 0.008
#> GSM587202     3  0.0000      0.986 0.000 0.000 1.000 0.000
#> GSM198767     1  0.0000      0.942 1.000 0.000 0.000 0.000
#> GSM198769     1  0.0000      0.942 1.000 0.000 0.000 0.000
#> GSM198772     1  0.0000      0.942 1.000 0.000 0.000 0.000
#> GSM198773     1  0.0000      0.942 1.000 0.000 0.000 0.000
#> GSM198776     1  0.0000      0.942 1.000 0.000 0.000 0.000
#> GSM198778     1  0.3873      0.732 0.772 0.000 0.000 0.228
#> GSM198780     1  0.3873      0.732 0.772 0.000 0.000 0.228
#> GSM198781     1  0.0000      0.942 1.000 0.000 0.000 0.000
#> GSM198765     3  0.1474      0.964 0.000 0.000 0.948 0.052
#> GSM198766     4  0.0592      0.946 0.016 0.000 0.000 0.984
#> GSM198768     3  0.0000      0.986 0.000 0.000 1.000 0.000
#> GSM198770     3  0.0000      0.986 0.000 0.000 1.000 0.000
#> GSM198771     3  0.0000      0.986 0.000 0.000 1.000 0.000
#> GSM198774     3  0.1867      0.951 0.000 0.000 0.928 0.072
#> GSM198775     4  0.0524      0.943 0.000 0.004 0.008 0.988
#> GSM198777     3  0.0000      0.986 0.000 0.000 1.000 0.000
#> GSM198779     3  0.0000      0.986 0.000 0.000 1.000 0.000
#> GSM587218     4  0.1118      0.973 0.036 0.000 0.000 0.964
#> GSM587219     4  0.1474      0.981 0.052 0.000 0.000 0.948
#> GSM587220     4  0.1474      0.981 0.052 0.000 0.000 0.948
#> GSM587221     4  0.1474      0.981 0.052 0.000 0.000 0.948
#> GSM587222     4  0.1474      0.981 0.052 0.000 0.000 0.948
#> GSM587223     4  0.1474      0.981 0.052 0.000 0.000 0.948
#> GSM587224     4  0.1474      0.981 0.052 0.000 0.000 0.948
#> GSM587225     4  0.1474      0.981 0.052 0.000 0.000 0.948
#> GSM587226     4  0.1474      0.981 0.052 0.000 0.000 0.948
#> GSM587227     4  0.1474      0.981 0.052 0.000 0.000 0.948
#> GSM587228     4  0.1474      0.981 0.052 0.000 0.000 0.948
#> GSM587229     4  0.1474      0.981 0.052 0.000 0.000 0.948

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM587155     2  0.0000     0.9890 0.000 1.000 0.000 0.000 0.000
#> GSM587156     2  0.0000     0.9890 0.000 1.000 0.000 0.000 0.000
#> GSM587157     2  0.0000     0.9890 0.000 1.000 0.000 0.000 0.000
#> GSM587158     2  0.0000     0.9890 0.000 1.000 0.000 0.000 0.000
#> GSM587159     2  0.0000     0.9890 0.000 1.000 0.000 0.000 0.000
#> GSM587160     2  0.0000     0.9890 0.000 1.000 0.000 0.000 0.000
#> GSM587161     2  0.0000     0.9890 0.000 1.000 0.000 0.000 0.000
#> GSM587162     2  0.0000     0.9890 0.000 1.000 0.000 0.000 0.000
#> GSM587163     2  0.0000     0.9890 0.000 1.000 0.000 0.000 0.000
#> GSM587164     2  0.0000     0.9890 0.000 1.000 0.000 0.000 0.000
#> GSM587165     2  0.0000     0.9890 0.000 1.000 0.000 0.000 0.000
#> GSM587166     2  0.0000     0.9890 0.000 1.000 0.000 0.000 0.000
#> GSM587167     2  0.0000     0.9890 0.000 1.000 0.000 0.000 0.000
#> GSM587168     2  0.0000     0.9890 0.000 1.000 0.000 0.000 0.000
#> GSM587169     2  0.0000     0.9890 0.000 1.000 0.000 0.000 0.000
#> GSM587170     2  0.0000     0.9890 0.000 1.000 0.000 0.000 0.000
#> GSM587171     2  0.0000     0.9890 0.000 1.000 0.000 0.000 0.000
#> GSM587172     2  0.0000     0.9890 0.000 1.000 0.000 0.000 0.000
#> GSM587173     2  0.0000     0.9890 0.000 1.000 0.000 0.000 0.000
#> GSM587174     2  0.0000     0.9890 0.000 1.000 0.000 0.000 0.000
#> GSM587175     2  0.0000     0.9890 0.000 1.000 0.000 0.000 0.000
#> GSM587176     2  0.0000     0.9890 0.000 1.000 0.000 0.000 0.000
#> GSM587177     2  0.0000     0.9890 0.000 1.000 0.000 0.000 0.000
#> GSM587178     2  0.0000     0.9890 0.000 1.000 0.000 0.000 0.000
#> GSM587179     2  0.0000     0.9890 0.000 1.000 0.000 0.000 0.000
#> GSM587180     2  0.0000     0.9890 0.000 1.000 0.000 0.000 0.000
#> GSM587181     2  0.0000     0.9890 0.000 1.000 0.000 0.000 0.000
#> GSM587182     2  0.0000     0.9890 0.000 1.000 0.000 0.000 0.000
#> GSM587183     2  0.0000     0.9890 0.000 1.000 0.000 0.000 0.000
#> GSM587184     2  0.0000     0.9890 0.000 1.000 0.000 0.000 0.000
#> GSM587185     2  0.0000     0.9890 0.000 1.000 0.000 0.000 0.000
#> GSM587186     2  0.0000     0.9890 0.000 1.000 0.000 0.000 0.000
#> GSM587187     2  0.0000     0.9890 0.000 1.000 0.000 0.000 0.000
#> GSM587188     2  0.0162     0.9855 0.000 0.996 0.004 0.000 0.000
#> GSM587189     2  0.0162     0.9855 0.000 0.996 0.004 0.000 0.000
#> GSM587190     2  0.5708     0.4120 0.000 0.616 0.112 0.004 0.268
#> GSM587203     1  0.0000     0.9172 1.000 0.000 0.000 0.000 0.000
#> GSM587204     1  0.0162     0.9151 0.996 0.000 0.000 0.000 0.004
#> GSM587205     1  0.0000     0.9172 1.000 0.000 0.000 0.000 0.000
#> GSM587206     1  0.0000     0.9172 1.000 0.000 0.000 0.000 0.000
#> GSM587207     1  0.0000     0.9172 1.000 0.000 0.000 0.000 0.000
#> GSM587208     1  0.0000     0.9172 1.000 0.000 0.000 0.000 0.000
#> GSM587209     1  0.0000     0.9172 1.000 0.000 0.000 0.000 0.000
#> GSM587210     1  0.4617     0.7194 0.744 0.000 0.000 0.108 0.148
#> GSM587211     1  0.0000     0.9172 1.000 0.000 0.000 0.000 0.000
#> GSM587212     1  0.4361     0.7437 0.768 0.000 0.000 0.108 0.124
#> GSM587213     1  0.0000     0.9172 1.000 0.000 0.000 0.000 0.000
#> GSM587214     1  0.0000     0.9172 1.000 0.000 0.000 0.000 0.000
#> GSM587215     1  0.0000     0.9172 1.000 0.000 0.000 0.000 0.000
#> GSM587216     1  0.0000     0.9172 1.000 0.000 0.000 0.000 0.000
#> GSM587217     1  0.0000     0.9172 1.000 0.000 0.000 0.000 0.000
#> GSM587191     5  0.1608     0.9001 0.000 0.000 0.072 0.000 0.928
#> GSM587192     5  0.0963     0.9132 0.000 0.000 0.036 0.000 0.964
#> GSM587193     5  0.3011     0.8616 0.016 0.000 0.000 0.140 0.844
#> GSM587194     5  0.1270     0.9119 0.000 0.000 0.000 0.052 0.948
#> GSM587195     3  0.0162     0.9355 0.000 0.000 0.996 0.000 0.004
#> GSM587196     3  0.0162     0.9355 0.000 0.000 0.996 0.000 0.004
#> GSM587197     3  0.0162     0.9355 0.000 0.000 0.996 0.000 0.004
#> GSM587198     3  0.1892     0.9193 0.000 0.000 0.916 0.004 0.080
#> GSM587199     3  0.3231     0.8262 0.000 0.000 0.800 0.004 0.196
#> GSM587200     1  0.7197     0.0885 0.412 0.000 0.292 0.020 0.276
#> GSM587201     1  0.6202     0.3997 0.564 0.000 0.260 0.004 0.172
#> GSM587202     3  0.1892     0.9193 0.000 0.000 0.916 0.004 0.080
#> GSM198767     1  0.0000     0.9172 1.000 0.000 0.000 0.000 0.000
#> GSM198769     1  0.0000     0.9172 1.000 0.000 0.000 0.000 0.000
#> GSM198772     1  0.0000     0.9172 1.000 0.000 0.000 0.000 0.000
#> GSM198773     1  0.0000     0.9172 1.000 0.000 0.000 0.000 0.000
#> GSM198776     1  0.0162     0.9151 0.996 0.000 0.000 0.000 0.004
#> GSM198778     1  0.4617     0.7194 0.744 0.000 0.000 0.108 0.148
#> GSM198780     1  0.4361     0.7437 0.768 0.000 0.000 0.108 0.124
#> GSM198781     1  0.0000     0.9172 1.000 0.000 0.000 0.000 0.000
#> GSM198765     5  0.1608     0.9001 0.000 0.000 0.072 0.000 0.928
#> GSM198766     5  0.3011     0.8616 0.016 0.000 0.000 0.140 0.844
#> GSM198768     3  0.0162     0.9355 0.000 0.000 0.996 0.000 0.004
#> GSM198770     3  0.0162     0.9355 0.000 0.000 0.996 0.000 0.004
#> GSM198771     3  0.1892     0.9193 0.000 0.000 0.916 0.004 0.080
#> GSM198774     5  0.0963     0.9132 0.000 0.000 0.036 0.000 0.964
#> GSM198775     5  0.1270     0.9119 0.000 0.000 0.000 0.052 0.948
#> GSM198777     3  0.0162     0.9355 0.000 0.000 0.996 0.000 0.004
#> GSM198779     3  0.3231     0.8262 0.000 0.000 0.800 0.004 0.196
#> GSM587218     4  0.0162     1.0000 0.004 0.000 0.000 0.996 0.000
#> GSM587219     4  0.0162     1.0000 0.004 0.000 0.000 0.996 0.000
#> GSM587220     4  0.0162     1.0000 0.004 0.000 0.000 0.996 0.000
#> GSM587221     4  0.0162     1.0000 0.004 0.000 0.000 0.996 0.000
#> GSM587222     4  0.0162     1.0000 0.004 0.000 0.000 0.996 0.000
#> GSM587223     4  0.0162     1.0000 0.004 0.000 0.000 0.996 0.000
#> GSM587224     4  0.0162     1.0000 0.004 0.000 0.000 0.996 0.000
#> GSM587225     4  0.0162     1.0000 0.004 0.000 0.000 0.996 0.000
#> GSM587226     4  0.0162     1.0000 0.004 0.000 0.000 0.996 0.000
#> GSM587227     4  0.0162     1.0000 0.004 0.000 0.000 0.996 0.000
#> GSM587228     4  0.0162     1.0000 0.004 0.000 0.000 0.996 0.000
#> GSM587229     4  0.0162     1.0000 0.004 0.000 0.000 0.996 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
#> GSM587155     2  0.1349     0.9293 0.000 0.940 0.000 0.000 0.004 0.056
#> GSM587156     2  0.3252     0.8283 0.000 0.824 0.000 0.000 0.108 0.068
#> GSM587157     2  0.1285     0.9315 0.000 0.944 0.000 0.000 0.004 0.052
#> GSM587158     2  0.0000     0.9523 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587159     2  0.0000     0.9523 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587160     2  0.0146     0.9521 0.000 0.996 0.000 0.000 0.000 0.004
#> GSM587161     2  0.0363     0.9503 0.000 0.988 0.000 0.000 0.000 0.012
#> GSM587162     2  0.0146     0.9521 0.000 0.996 0.000 0.000 0.000 0.004
#> GSM587163     2  0.0146     0.9521 0.000 0.996 0.000 0.000 0.000 0.004
#> GSM587164     2  0.1471     0.9248 0.000 0.932 0.000 0.000 0.004 0.064
#> GSM587165     2  0.0713     0.9470 0.000 0.972 0.000 0.000 0.000 0.028
#> GSM587166     2  0.3252     0.8283 0.000 0.824 0.000 0.000 0.108 0.068
#> GSM587167     2  0.1531     0.9223 0.000 0.928 0.000 0.000 0.004 0.068
#> GSM587168     2  0.0547     0.9495 0.000 0.980 0.000 0.000 0.000 0.020
#> GSM587169     2  0.0146     0.9521 0.000 0.996 0.000 0.000 0.000 0.004
#> GSM587170     2  0.1471     0.9248 0.000 0.932 0.000 0.000 0.004 0.064
#> GSM587171     2  0.0000     0.9523 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587172     2  0.0000     0.9523 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587173     2  0.0713     0.9470 0.000 0.972 0.000 0.000 0.000 0.028
#> GSM587174     2  0.0260     0.9518 0.000 0.992 0.000 0.000 0.000 0.008
#> GSM587175     2  0.1082     0.9375 0.000 0.956 0.000 0.000 0.004 0.040
#> GSM587176     2  0.0146     0.9521 0.000 0.996 0.000 0.000 0.000 0.004
#> GSM587177     2  0.0713     0.9470 0.000 0.972 0.000 0.000 0.000 0.028
#> GSM587178     2  0.0363     0.9512 0.000 0.988 0.000 0.000 0.000 0.012
#> GSM587179     2  0.0146     0.9521 0.000 0.996 0.000 0.000 0.000 0.004
#> GSM587180     2  0.0547     0.9495 0.000 0.980 0.000 0.000 0.000 0.020
#> GSM587181     2  0.0260     0.9518 0.000 0.992 0.000 0.000 0.000 0.008
#> GSM587182     2  0.0458     0.9504 0.000 0.984 0.000 0.000 0.000 0.016
#> GSM587183     2  0.0713     0.9470 0.000 0.972 0.000 0.000 0.000 0.028
#> GSM587184     2  0.0000     0.9523 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587185     2  0.0146     0.9521 0.000 0.996 0.000 0.000 0.000 0.004
#> GSM587186     2  0.0713     0.9470 0.000 0.972 0.000 0.000 0.000 0.028
#> GSM587187     2  0.1204     0.9325 0.000 0.944 0.000 0.000 0.000 0.056
#> GSM587188     2  0.2361     0.8853 0.000 0.884 0.028 0.000 0.000 0.088
#> GSM587189     2  0.2361     0.8853 0.000 0.884 0.028 0.000 0.000 0.088
#> GSM587190     2  0.7097     0.0888 0.000 0.440 0.108 0.000 0.204 0.248
#> GSM587203     1  0.0363     0.8821 0.988 0.000 0.000 0.000 0.000 0.012
#> GSM587204     1  0.0458     0.8817 0.984 0.000 0.000 0.000 0.000 0.016
#> GSM587205     1  0.0363     0.8821 0.988 0.000 0.000 0.000 0.000 0.012
#> GSM587206     1  0.0363     0.8821 0.988 0.000 0.000 0.000 0.000 0.012
#> GSM587207     1  0.0363     0.8821 0.988 0.000 0.000 0.000 0.000 0.012
#> GSM587208     1  0.0363     0.8821 0.988 0.000 0.000 0.000 0.000 0.012
#> GSM587209     1  0.0713     0.8752 0.972 0.000 0.000 0.000 0.000 0.028
#> GSM587210     1  0.6134     0.2562 0.588 0.000 0.000 0.068 0.156 0.188
#> GSM587211     1  0.1584     0.8470 0.928 0.000 0.000 0.000 0.008 0.064
#> GSM587212     1  0.5839     0.3649 0.624 0.000 0.000 0.060 0.156 0.160
#> GSM587213     1  0.0291     0.8827 0.992 0.000 0.000 0.000 0.004 0.004
#> GSM587214     1  0.0291     0.8827 0.992 0.000 0.000 0.000 0.004 0.004
#> GSM587215     1  0.0405     0.8822 0.988 0.000 0.000 0.000 0.004 0.008
#> GSM587216     1  0.1462     0.8569 0.936 0.000 0.000 0.000 0.008 0.056
#> GSM587217     1  0.0508     0.8812 0.984 0.000 0.000 0.000 0.004 0.012
#> GSM587191     5  0.4636     0.6573 0.000 0.000 0.040 0.000 0.516 0.444
#> GSM587192     5  0.4377     0.6672 0.000 0.000 0.024 0.000 0.540 0.436
#> GSM587193     5  0.2288     0.6172 0.016 0.000 0.000 0.068 0.900 0.016
#> GSM587194     5  0.2301     0.5780 0.000 0.000 0.000 0.020 0.884 0.096
#> GSM587195     3  0.0000     0.7619 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM587196     3  0.0000     0.7619 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM587197     3  0.1219     0.7421 0.000 0.000 0.948 0.000 0.004 0.048
#> GSM587198     3  0.3592     0.6498 0.000 0.000 0.656 0.000 0.000 0.344
#> GSM587199     3  0.4802     0.5215 0.000 0.000 0.540 0.000 0.056 0.404
#> GSM587200     6  0.7127     0.8640 0.196 0.000 0.112 0.012 0.184 0.496
#> GSM587201     6  0.6961     0.8707 0.264 0.000 0.092 0.004 0.168 0.472
#> GSM587202     3  0.3592     0.6498 0.000 0.000 0.656 0.000 0.000 0.344
#> GSM198767     1  0.0363     0.8821 0.988 0.000 0.000 0.000 0.000 0.012
#> GSM198769     1  0.0713     0.8752 0.972 0.000 0.000 0.000 0.000 0.028
#> GSM198772     1  0.1584     0.8470 0.928 0.000 0.000 0.000 0.008 0.064
#> GSM198773     1  0.0291     0.8827 0.992 0.000 0.000 0.000 0.004 0.004
#> GSM198776     1  0.0458     0.8817 0.984 0.000 0.000 0.000 0.000 0.016
#> GSM198778     1  0.6134     0.2562 0.588 0.000 0.000 0.068 0.156 0.188
#> GSM198780     1  0.5839     0.3649 0.624 0.000 0.000 0.060 0.156 0.160
#> GSM198781     1  0.0291     0.8827 0.992 0.000 0.000 0.000 0.004 0.004
#> GSM198765     5  0.4636     0.6573 0.000 0.000 0.040 0.000 0.516 0.444
#> GSM198766     5  0.2288     0.6172 0.016 0.000 0.000 0.068 0.900 0.016
#> GSM198768     3  0.0000     0.7619 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM198770     3  0.1219     0.7421 0.000 0.000 0.948 0.000 0.004 0.048
#> GSM198771     3  0.3592     0.6498 0.000 0.000 0.656 0.000 0.000 0.344
#> GSM198774     5  0.4377     0.6672 0.000 0.000 0.024 0.000 0.540 0.436
#> GSM198775     5  0.2301     0.5780 0.000 0.000 0.000 0.020 0.884 0.096
#> GSM198777     3  0.0000     0.7619 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM198779     3  0.4802     0.5215 0.000 0.000 0.540 0.000 0.056 0.404
#> GSM587218     4  0.0000     1.0000 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM587219     4  0.0000     1.0000 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM587220     4  0.0000     1.0000 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM587221     4  0.0000     1.0000 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM587222     4  0.0000     1.0000 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM587223     4  0.0000     1.0000 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM587224     4  0.0000     1.0000 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM587225     4  0.0000     1.0000 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM587226     4  0.0000     1.0000 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM587227     4  0.0000     1.0000 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM587228     4  0.0000     1.0000 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM587229     4  0.0000     1.0000 0.000 0.000 0.000 1.000 0.000 0.000

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

consensus_heatmap(res, k = 2)

plot of chunk tab-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 specimen(p) k
#> MAD:skmeans 92    1.41e-13 2
#> MAD:skmeans 91    1.42e-27 3
#> MAD:skmeans 91    2.41e-37 4
#> MAD:skmeans 89    6.34e-43 5
#> MAD:skmeans 87    4.84e-40 6

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


MAD:pam**

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

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

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

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

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

collect_plots(res)

plot of chunk MAD-pam-collect-plots

The plots are:

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

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

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

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

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.853           0.912       0.962         0.5015 0.498   0.498
#> 3 3 0.937           0.954       0.979         0.3219 0.791   0.601
#> 4 4 0.977           0.941       0.974         0.1015 0.899   0.716
#> 5 5 0.990           0.937       0.970         0.0399 0.953   0.830
#> 6 6 0.995           0.930       0.973         0.0323 0.970   0.879

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

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

There is also optional best \(k\) = 3 4 5 that is worth to check.

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

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

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>           class entropy silhouette    p1    p2
#> GSM587155     2   0.000      0.930 0.000 1.000
#> GSM587156     2   0.000      0.930 0.000 1.000
#> GSM587157     2   0.000      0.930 0.000 1.000
#> GSM587158     2   0.000      0.930 0.000 1.000
#> GSM587159     2   0.000      0.930 0.000 1.000
#> GSM587160     2   0.000      0.930 0.000 1.000
#> GSM587161     2   0.000      0.930 0.000 1.000
#> GSM587162     2   0.000      0.930 0.000 1.000
#> GSM587163     2   0.000      0.930 0.000 1.000
#> GSM587164     2   0.000      0.930 0.000 1.000
#> GSM587165     2   0.000      0.930 0.000 1.000
#> GSM587166     2   0.000      0.930 0.000 1.000
#> GSM587167     2   0.000      0.930 0.000 1.000
#> GSM587168     2   0.000      0.930 0.000 1.000
#> GSM587169     2   0.000      0.930 0.000 1.000
#> GSM587170     2   0.000      0.930 0.000 1.000
#> GSM587171     2   0.000      0.930 0.000 1.000
#> GSM587172     2   0.000      0.930 0.000 1.000
#> GSM587173     2   0.000      0.930 0.000 1.000
#> GSM587174     2   0.000      0.930 0.000 1.000
#> GSM587175     2   0.000      0.930 0.000 1.000
#> GSM587176     2   0.000      0.930 0.000 1.000
#> GSM587177     2   0.000      0.930 0.000 1.000
#> GSM587178     2   0.000      0.930 0.000 1.000
#> GSM587179     2   0.000      0.930 0.000 1.000
#> GSM587180     2   0.000      0.930 0.000 1.000
#> GSM587181     2   0.000      0.930 0.000 1.000
#> GSM587182     2   0.000      0.930 0.000 1.000
#> GSM587183     2   0.000      0.930 0.000 1.000
#> GSM587184     2   0.000      0.930 0.000 1.000
#> GSM587185     2   0.000      0.930 0.000 1.000
#> GSM587186     2   0.000      0.930 0.000 1.000
#> GSM587187     2   0.000      0.930 0.000 1.000
#> GSM587188     2   0.000      0.930 0.000 1.000
#> GSM587189     2   0.000      0.930 0.000 1.000
#> GSM587190     2   0.000      0.930 0.000 1.000
#> GSM587203     1   0.000      0.993 1.000 0.000
#> GSM587204     1   0.000      0.993 1.000 0.000
#> GSM587205     1   0.000      0.993 1.000 0.000
#> GSM587206     1   0.000      0.993 1.000 0.000
#> GSM587207     1   0.000      0.993 1.000 0.000
#> GSM587208     1   0.000      0.993 1.000 0.000
#> GSM587209     1   0.000      0.993 1.000 0.000
#> GSM587210     1   0.000      0.993 1.000 0.000
#> GSM587211     1   0.000      0.993 1.000 0.000
#> GSM587212     1   0.000      0.993 1.000 0.000
#> GSM587213     1   0.000      0.993 1.000 0.000
#> GSM587214     1   0.000      0.993 1.000 0.000
#> GSM587215     1   0.000      0.993 1.000 0.000
#> GSM587216     1   0.000      0.993 1.000 0.000
#> GSM587217     1   0.000      0.993 1.000 0.000
#> GSM587191     2   0.000      0.930 0.000 1.000
#> GSM587192     1   0.000      0.993 1.000 0.000
#> GSM587193     1   0.000      0.993 1.000 0.000
#> GSM587194     2   0.430      0.869 0.088 0.912
#> GSM587195     2   0.978      0.399 0.412 0.588
#> GSM587196     2   0.978      0.399 0.412 0.588
#> GSM587197     2   0.969      0.433 0.396 0.604
#> GSM587198     2   0.980      0.389 0.416 0.584
#> GSM587199     2   0.184      0.913 0.028 0.972
#> GSM587200     1   0.000      0.993 1.000 0.000
#> GSM587201     1   0.000      0.993 1.000 0.000
#> GSM587202     2   0.978      0.399 0.412 0.588
#> GSM198767     1   0.000      0.993 1.000 0.000
#> GSM198769     1   0.000      0.993 1.000 0.000
#> GSM198772     1   0.000      0.993 1.000 0.000
#> GSM198773     1   0.000      0.993 1.000 0.000
#> GSM198776     1   0.000      0.993 1.000 0.000
#> GSM198778     1   0.000      0.993 1.000 0.000
#> GSM198780     1   0.000      0.993 1.000 0.000
#> GSM198781     1   0.000      0.993 1.000 0.000
#> GSM198765     2   0.388      0.878 0.076 0.924
#> GSM198766     1   0.000      0.993 1.000 0.000
#> GSM198768     2   0.980      0.389 0.416 0.584
#> GSM198770     2   0.506      0.846 0.112 0.888
#> GSM198771     1   0.795      0.638 0.760 0.240
#> GSM198774     1   0.000      0.993 1.000 0.000
#> GSM198775     2   0.443      0.866 0.092 0.908
#> GSM198777     2   0.978      0.399 0.412 0.588
#> GSM198779     2   0.184      0.913 0.028 0.972
#> GSM587218     1   0.000      0.993 1.000 0.000
#> GSM587219     1   0.000      0.993 1.000 0.000
#> GSM587220     1   0.000      0.993 1.000 0.000
#> GSM587221     1   0.000      0.993 1.000 0.000
#> GSM587222     1   0.000      0.993 1.000 0.000
#> GSM587223     1   0.000      0.993 1.000 0.000
#> GSM587224     1   0.000      0.993 1.000 0.000
#> GSM587225     1   0.000      0.993 1.000 0.000
#> GSM587226     1   0.000      0.993 1.000 0.000
#> GSM587227     1   0.000      0.993 1.000 0.000
#> GSM587228     1   0.000      0.993 1.000 0.000
#> GSM587229     1   0.000      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
#> GSM587155     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587156     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587157     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587158     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587159     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587160     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587161     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587162     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587163     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587164     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587165     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587166     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587167     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587168     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587169     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587170     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587171     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587172     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587173     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587174     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587175     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587176     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587177     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587178     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587179     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587180     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587181     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587182     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587183     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587184     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587185     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587186     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587187     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587188     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587189     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587190     3  0.0237      0.981 0.000 0.004 0.996
#> GSM587203     1  0.0000      0.951 1.000 0.000 0.000
#> GSM587204     1  0.0000      0.951 1.000 0.000 0.000
#> GSM587205     1  0.0000      0.951 1.000 0.000 0.000
#> GSM587206     1  0.0000      0.951 1.000 0.000 0.000
#> GSM587207     1  0.0000      0.951 1.000 0.000 0.000
#> GSM587208     1  0.0000      0.951 1.000 0.000 0.000
#> GSM587209     1  0.0000      0.951 1.000 0.000 0.000
#> GSM587210     1  0.1289      0.929 0.968 0.000 0.032
#> GSM587211     1  0.4178      0.815 0.828 0.000 0.172
#> GSM587212     1  0.0000      0.951 1.000 0.000 0.000
#> GSM587213     1  0.0000      0.951 1.000 0.000 0.000
#> GSM587214     1  0.0000      0.951 1.000 0.000 0.000
#> GSM587215     1  0.0000      0.951 1.000 0.000 0.000
#> GSM587216     1  0.0000      0.951 1.000 0.000 0.000
#> GSM587217     1  0.0000      0.951 1.000 0.000 0.000
#> GSM587191     3  0.0000      0.985 0.000 0.000 1.000
#> GSM587192     3  0.0000      0.985 0.000 0.000 1.000
#> GSM587193     1  0.6305      0.140 0.516 0.000 0.484
#> GSM587194     3  0.0000      0.985 0.000 0.000 1.000
#> GSM587195     3  0.0000      0.985 0.000 0.000 1.000
#> GSM587196     3  0.0000      0.985 0.000 0.000 1.000
#> GSM587197     3  0.0000      0.985 0.000 0.000 1.000
#> GSM587198     3  0.0000      0.985 0.000 0.000 1.000
#> GSM587199     3  0.0000      0.985 0.000 0.000 1.000
#> GSM587200     3  0.0000      0.985 0.000 0.000 1.000
#> GSM587201     3  0.0000      0.985 0.000 0.000 1.000
#> GSM587202     3  0.0000      0.985 0.000 0.000 1.000
#> GSM198767     1  0.0000      0.951 1.000 0.000 0.000
#> GSM198769     1  0.0000      0.951 1.000 0.000 0.000
#> GSM198772     1  0.2165      0.909 0.936 0.000 0.064
#> GSM198773     1  0.0000      0.951 1.000 0.000 0.000
#> GSM198776     1  0.0000      0.951 1.000 0.000 0.000
#> GSM198778     1  0.4235      0.808 0.824 0.000 0.176
#> GSM198780     1  0.0000      0.951 1.000 0.000 0.000
#> GSM198781     1  0.0000      0.951 1.000 0.000 0.000
#> GSM198765     3  0.0000      0.985 0.000 0.000 1.000
#> GSM198766     1  0.4235      0.810 0.824 0.000 0.176
#> GSM198768     3  0.0000      0.985 0.000 0.000 1.000
#> GSM198770     3  0.0000      0.985 0.000 0.000 1.000
#> GSM198771     3  0.0000      0.985 0.000 0.000 1.000
#> GSM198774     3  0.0000      0.985 0.000 0.000 1.000
#> GSM198775     3  0.0000      0.985 0.000 0.000 1.000
#> GSM198777     3  0.0000      0.985 0.000 0.000 1.000
#> GSM198779     3  0.0000      0.985 0.000 0.000 1.000
#> GSM587218     3  0.0000      0.985 0.000 0.000 1.000
#> GSM587219     1  0.4121      0.819 0.832 0.000 0.168
#> GSM587220     1  0.0000      0.951 1.000 0.000 0.000
#> GSM587221     1  0.4235      0.810 0.824 0.000 0.176
#> GSM587222     1  0.0237      0.948 0.996 0.000 0.004
#> GSM587223     1  0.0000      0.951 1.000 0.000 0.000
#> GSM587224     3  0.5497      0.541 0.292 0.000 0.708
#> GSM587225     1  0.0000      0.951 1.000 0.000 0.000
#> GSM587226     1  0.4235      0.810 0.824 0.000 0.176
#> GSM587227     1  0.0000      0.951 1.000 0.000 0.000
#> GSM587228     1  0.0000      0.951 1.000 0.000 0.000
#> GSM587229     1  0.0000      0.951 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
#> GSM587155     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587156     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587157     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587158     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587159     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587160     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587161     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587162     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587163     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587164     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587165     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587166     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587167     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587168     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587169     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587170     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587171     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587172     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587173     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587174     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587175     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587176     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587177     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587178     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587179     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587180     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587181     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587182     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587183     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587184     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587185     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587186     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587187     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587188     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587189     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587190     3  0.0188      0.970 0.000 0.004 0.996 0.000
#> GSM587203     1  0.0000      0.948 1.000 0.000 0.000 0.000
#> GSM587204     1  0.0000      0.948 1.000 0.000 0.000 0.000
#> GSM587205     1  0.0000      0.948 1.000 0.000 0.000 0.000
#> GSM587206     1  0.0000      0.948 1.000 0.000 0.000 0.000
#> GSM587207     1  0.0000      0.948 1.000 0.000 0.000 0.000
#> GSM587208     1  0.0000      0.948 1.000 0.000 0.000 0.000
#> GSM587209     1  0.0000      0.948 1.000 0.000 0.000 0.000
#> GSM587210     4  0.6206      0.232 0.404 0.000 0.056 0.540
#> GSM587211     1  0.4163      0.736 0.792 0.000 0.188 0.020
#> GSM587212     1  0.4103      0.663 0.744 0.000 0.000 0.256
#> GSM587213     1  0.0000      0.948 1.000 0.000 0.000 0.000
#> GSM587214     1  0.0000      0.948 1.000 0.000 0.000 0.000
#> GSM587215     1  0.0000      0.948 1.000 0.000 0.000 0.000
#> GSM587216     1  0.2011      0.889 0.920 0.000 0.000 0.080
#> GSM587217     1  0.1389      0.916 0.952 0.000 0.000 0.048
#> GSM587191     3  0.0000      0.974 0.000 0.000 1.000 0.000
#> GSM587192     3  0.1557      0.924 0.000 0.000 0.944 0.056
#> GSM587193     3  0.3978      0.758 0.012 0.000 0.796 0.192
#> GSM587194     3  0.0000      0.974 0.000 0.000 1.000 0.000
#> GSM587195     3  0.0000      0.974 0.000 0.000 1.000 0.000
#> GSM587196     3  0.0000      0.974 0.000 0.000 1.000 0.000
#> GSM587197     3  0.0000      0.974 0.000 0.000 1.000 0.000
#> GSM587198     3  0.0000      0.974 0.000 0.000 1.000 0.000
#> GSM587199     3  0.0000      0.974 0.000 0.000 1.000 0.000
#> GSM587200     3  0.0000      0.974 0.000 0.000 1.000 0.000
#> GSM587201     3  0.0000      0.974 0.000 0.000 1.000 0.000
#> GSM587202     3  0.0000      0.974 0.000 0.000 1.000 0.000
#> GSM198767     1  0.0000      0.948 1.000 0.000 0.000 0.000
#> GSM198769     1  0.0000      0.948 1.000 0.000 0.000 0.000
#> GSM198772     1  0.2742      0.872 0.900 0.000 0.076 0.024
#> GSM198773     1  0.0000      0.948 1.000 0.000 0.000 0.000
#> GSM198776     1  0.0000      0.948 1.000 0.000 0.000 0.000
#> GSM198778     4  0.7020      0.328 0.332 0.000 0.136 0.532
#> GSM198780     1  0.4103      0.663 0.744 0.000 0.000 0.256
#> GSM198781     1  0.0000      0.948 1.000 0.000 0.000 0.000
#> GSM198765     3  0.0000      0.974 0.000 0.000 1.000 0.000
#> GSM198766     3  0.5109      0.698 0.060 0.000 0.744 0.196
#> GSM198768     3  0.0000      0.974 0.000 0.000 1.000 0.000
#> GSM198770     3  0.0000      0.974 0.000 0.000 1.000 0.000
#> GSM198771     3  0.0000      0.974 0.000 0.000 1.000 0.000
#> GSM198774     3  0.0707      0.958 0.000 0.000 0.980 0.020
#> GSM198775     3  0.0000      0.974 0.000 0.000 1.000 0.000
#> GSM198777     3  0.0000      0.974 0.000 0.000 1.000 0.000
#> GSM198779     3  0.0000      0.974 0.000 0.000 1.000 0.000
#> GSM587218     4  0.0000      0.930 0.000 0.000 0.000 1.000
#> GSM587219     4  0.0000      0.930 0.000 0.000 0.000 1.000
#> GSM587220     4  0.0000      0.930 0.000 0.000 0.000 1.000
#> GSM587221     4  0.0000      0.930 0.000 0.000 0.000 1.000
#> GSM587222     4  0.0000      0.930 0.000 0.000 0.000 1.000
#> GSM587223     4  0.0000      0.930 0.000 0.000 0.000 1.000
#> GSM587224     4  0.0000      0.930 0.000 0.000 0.000 1.000
#> GSM587225     4  0.0000      0.930 0.000 0.000 0.000 1.000
#> GSM587226     4  0.0000      0.930 0.000 0.000 0.000 1.000
#> GSM587227     4  0.0000      0.930 0.000 0.000 0.000 1.000
#> GSM587228     4  0.0000      0.930 0.000 0.000 0.000 1.000
#> GSM587229     4  0.0000      0.930 0.000 0.000 0.000 1.000

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM587155     2  0.0000     0.9999 0.000 1.000 0.000 0.000 0.000
#> GSM587156     2  0.0000     0.9999 0.000 1.000 0.000 0.000 0.000
#> GSM587157     2  0.0000     0.9999 0.000 1.000 0.000 0.000 0.000
#> GSM587158     2  0.0000     0.9999 0.000 1.000 0.000 0.000 0.000
#> GSM587159     2  0.0000     0.9999 0.000 1.000 0.000 0.000 0.000
#> GSM587160     2  0.0000     0.9999 0.000 1.000 0.000 0.000 0.000
#> GSM587161     2  0.0000     0.9999 0.000 1.000 0.000 0.000 0.000
#> GSM587162     2  0.0000     0.9999 0.000 1.000 0.000 0.000 0.000
#> GSM587163     2  0.0000     0.9999 0.000 1.000 0.000 0.000 0.000
#> GSM587164     2  0.0000     0.9999 0.000 1.000 0.000 0.000 0.000
#> GSM587165     2  0.0000     0.9999 0.000 1.000 0.000 0.000 0.000
#> GSM587166     2  0.0000     0.9999 0.000 1.000 0.000 0.000 0.000
#> GSM587167     2  0.0000     0.9999 0.000 1.000 0.000 0.000 0.000
#> GSM587168     2  0.0000     0.9999 0.000 1.000 0.000 0.000 0.000
#> GSM587169     2  0.0000     0.9999 0.000 1.000 0.000 0.000 0.000
#> GSM587170     2  0.0000     0.9999 0.000 1.000 0.000 0.000 0.000
#> GSM587171     2  0.0000     0.9999 0.000 1.000 0.000 0.000 0.000
#> GSM587172     2  0.0000     0.9999 0.000 1.000 0.000 0.000 0.000
#> GSM587173     2  0.0000     0.9999 0.000 1.000 0.000 0.000 0.000
#> GSM587174     2  0.0000     0.9999 0.000 1.000 0.000 0.000 0.000
#> GSM587175     2  0.0000     0.9999 0.000 1.000 0.000 0.000 0.000
#> GSM587176     2  0.0000     0.9999 0.000 1.000 0.000 0.000 0.000
#> GSM587177     2  0.0000     0.9999 0.000 1.000 0.000 0.000 0.000
#> GSM587178     2  0.0000     0.9999 0.000 1.000 0.000 0.000 0.000
#> GSM587179     2  0.0000     0.9999 0.000 1.000 0.000 0.000 0.000
#> GSM587180     2  0.0000     0.9999 0.000 1.000 0.000 0.000 0.000
#> GSM587181     2  0.0000     0.9999 0.000 1.000 0.000 0.000 0.000
#> GSM587182     2  0.0000     0.9999 0.000 1.000 0.000 0.000 0.000
#> GSM587183     2  0.0000     0.9999 0.000 1.000 0.000 0.000 0.000
#> GSM587184     2  0.0000     0.9999 0.000 1.000 0.000 0.000 0.000
#> GSM587185     2  0.0000     0.9999 0.000 1.000 0.000 0.000 0.000
#> GSM587186     2  0.0000     0.9999 0.000 1.000 0.000 0.000 0.000
#> GSM587187     2  0.0000     0.9999 0.000 1.000 0.000 0.000 0.000
#> GSM587188     2  0.0000     0.9999 0.000 1.000 0.000 0.000 0.000
#> GSM587189     2  0.0162     0.9957 0.000 0.996 0.004 0.000 0.000
#> GSM587190     3  0.0162     0.9888 0.000 0.004 0.996 0.000 0.000
#> GSM587203     5  0.0000     1.0000 0.000 0.000 0.000 0.000 1.000
#> GSM587204     5  0.0000     1.0000 0.000 0.000 0.000 0.000 1.000
#> GSM587205     5  0.0000     1.0000 0.000 0.000 0.000 0.000 1.000
#> GSM587206     5  0.0000     1.0000 0.000 0.000 0.000 0.000 1.000
#> GSM587207     5  0.0000     1.0000 0.000 0.000 0.000 0.000 1.000
#> GSM587208     5  0.0000     1.0000 0.000 0.000 0.000 0.000 1.000
#> GSM587209     1  0.0703     0.8703 0.976 0.000 0.000 0.000 0.024
#> GSM587210     4  0.6372    -0.0640 0.408 0.000 0.000 0.428 0.164
#> GSM587211     1  0.0798     0.8682 0.976 0.000 0.008 0.000 0.016
#> GSM587212     1  0.3039     0.7122 0.808 0.000 0.000 0.000 0.192
#> GSM587213     1  0.0703     0.8703 0.976 0.000 0.000 0.000 0.024
#> GSM587214     1  0.1544     0.8485 0.932 0.000 0.000 0.000 0.068
#> GSM587215     1  0.0703     0.8703 0.976 0.000 0.000 0.000 0.024
#> GSM587216     1  0.0000     0.8593 1.000 0.000 0.000 0.000 0.000
#> GSM587217     1  0.0703     0.8703 0.976 0.000 0.000 0.000 0.024
#> GSM587191     3  0.0703     0.9827 0.024 0.000 0.976 0.000 0.000
#> GSM587192     3  0.0703     0.9827 0.024 0.000 0.976 0.000 0.000
#> GSM587193     1  0.6357     0.3609 0.512 0.000 0.288 0.200 0.000
#> GSM587194     3  0.0703     0.9827 0.024 0.000 0.976 0.000 0.000
#> GSM587195     3  0.0000     0.9923 0.000 0.000 1.000 0.000 0.000
#> GSM587196     3  0.0000     0.9923 0.000 0.000 1.000 0.000 0.000
#> GSM587197     3  0.0000     0.9923 0.000 0.000 1.000 0.000 0.000
#> GSM587198     3  0.0000     0.9923 0.000 0.000 1.000 0.000 0.000
#> GSM587199     3  0.0000     0.9923 0.000 0.000 1.000 0.000 0.000
#> GSM587200     3  0.0000     0.9923 0.000 0.000 1.000 0.000 0.000
#> GSM587201     3  0.0000     0.9923 0.000 0.000 1.000 0.000 0.000
#> GSM587202     3  0.0000     0.9923 0.000 0.000 1.000 0.000 0.000
#> GSM198767     5  0.0000     1.0000 0.000 0.000 0.000 0.000 1.000
#> GSM198769     1  0.0703     0.8703 0.976 0.000 0.000 0.000 0.024
#> GSM198772     1  0.0798     0.8682 0.976 0.000 0.008 0.000 0.016
#> GSM198773     1  0.0703     0.8703 0.976 0.000 0.000 0.000 0.024
#> GSM198776     5  0.0000     1.0000 0.000 0.000 0.000 0.000 1.000
#> GSM198778     1  0.7149     0.0574 0.440 0.000 0.084 0.388 0.088
#> GSM198780     1  0.3039     0.7122 0.808 0.000 0.000 0.000 0.192
#> GSM198781     1  0.1544     0.8485 0.932 0.000 0.000 0.000 0.068
#> GSM198765     3  0.0703     0.9827 0.024 0.000 0.976 0.000 0.000
#> GSM198766     1  0.2966     0.7062 0.816 0.000 0.000 0.184 0.000
#> GSM198768     3  0.0000     0.9923 0.000 0.000 1.000 0.000 0.000
#> GSM198770     3  0.0000     0.9923 0.000 0.000 1.000 0.000 0.000
#> GSM198771     3  0.0000     0.9923 0.000 0.000 1.000 0.000 0.000
#> GSM198774     3  0.0703     0.9827 0.024 0.000 0.976 0.000 0.000
#> GSM198775     3  0.0703     0.9827 0.024 0.000 0.976 0.000 0.000
#> GSM198777     3  0.0000     0.9923 0.000 0.000 1.000 0.000 0.000
#> GSM198779     3  0.0000     0.9923 0.000 0.000 1.000 0.000 0.000
#> GSM587218     4  0.0000     0.9512 0.000 0.000 0.000 1.000 0.000
#> GSM587219     4  0.0000     0.9512 0.000 0.000 0.000 1.000 0.000
#> GSM587220     4  0.0000     0.9512 0.000 0.000 0.000 1.000 0.000
#> GSM587221     4  0.0000     0.9512 0.000 0.000 0.000 1.000 0.000
#> GSM587222     4  0.0000     0.9512 0.000 0.000 0.000 1.000 0.000
#> GSM587223     4  0.0000     0.9512 0.000 0.000 0.000 1.000 0.000
#> GSM587224     4  0.0000     0.9512 0.000 0.000 0.000 1.000 0.000
#> GSM587225     4  0.0000     0.9512 0.000 0.000 0.000 1.000 0.000
#> GSM587226     4  0.0000     0.9512 0.000 0.000 0.000 1.000 0.000
#> GSM587227     4  0.0000     0.9512 0.000 0.000 0.000 1.000 0.000
#> GSM587228     4  0.0000     0.9512 0.000 0.000 0.000 1.000 0.000
#> GSM587229     4  0.0000     0.9512 0.000 0.000 0.000 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM587155     2  0.0000    0.99627 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587156     2  0.0000    0.99627 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587157     2  0.0458    0.98142 0.000 0.984 0.016 0.000 0.000 0.000
#> GSM587158     2  0.0000    0.99627 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587159     2  0.0000    0.99627 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587160     2  0.0000    0.99627 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587161     2  0.0000    0.99627 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587162     2  0.0000    0.99627 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587163     2  0.0000    0.99627 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587164     2  0.0000    0.99627 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587165     2  0.0000    0.99627 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587166     2  0.1444    0.92459 0.000 0.928 0.000 0.000 0.072 0.000
#> GSM587167     2  0.0000    0.99627 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587168     2  0.0000    0.99627 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587169     2  0.0000    0.99627 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587170     2  0.0000    0.99627 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587171     2  0.0000    0.99627 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587172     2  0.0000    0.99627 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587173     2  0.0000    0.99627 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587174     2  0.0000    0.99627 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587175     2  0.0000    0.99627 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587176     2  0.0000    0.99627 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587177     2  0.0000    0.99627 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587178     2  0.0000    0.99627 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587179     2  0.0000    0.99627 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587180     2  0.0000    0.99627 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587181     2  0.0000    0.99627 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587182     2  0.0000    0.99627 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587183     2  0.0000    0.99627 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587184     2  0.0000    0.99627 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587185     2  0.0000    0.99627 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587186     2  0.0000    0.99627 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587187     2  0.0000    0.99627 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587188     2  0.0000    0.99627 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587189     2  0.0865    0.96004 0.000 0.964 0.036 0.000 0.000 0.000
#> GSM587190     3  0.0000    0.99740 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM587203     6  0.0000    1.00000 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM587204     6  0.0000    1.00000 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM587205     6  0.0000    1.00000 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM587206     6  0.0000    1.00000 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM587207     6  0.0000    1.00000 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM587208     6  0.0000    1.00000 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM587209     1  0.0000    0.85584 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM587210     5  0.4117    0.65626 0.228 0.000 0.000 0.056 0.716 0.000
#> GSM587211     1  0.0000    0.85584 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM587212     1  0.3860    0.00741 0.528 0.000 0.000 0.000 0.472 0.000
#> GSM587213     1  0.0000    0.85584 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM587214     1  0.0458    0.84666 0.984 0.000 0.000 0.000 0.000 0.016
#> GSM587215     1  0.0000    0.85584 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM587216     1  0.0000    0.85584 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM587217     1  0.0000    0.85584 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM587191     5  0.0000    0.90966 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM587192     5  0.0000    0.90966 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM587193     1  0.6653    0.06971 0.416 0.000 0.176 0.052 0.356 0.000
#> GSM587194     5  0.0000    0.90966 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM587195     3  0.0000    0.99740 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM587196     3  0.0000    0.99740 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM587197     3  0.0000    0.99740 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM587198     3  0.0000    0.99740 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM587199     3  0.0000    0.99740 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM587200     3  0.0508    0.98497 0.004 0.000 0.984 0.000 0.012 0.000
#> GSM587201     3  0.0458    0.98155 0.016 0.000 0.984 0.000 0.000 0.000
#> GSM587202     3  0.0000    0.99740 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM198767     6  0.0000    1.00000 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM198769     1  0.0000    0.85584 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM198772     1  0.0000    0.85584 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM198773     1  0.0000    0.85584 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM198776     6  0.0000    1.00000 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM198778     5  0.3841    0.62957 0.256 0.000 0.000 0.028 0.716 0.000
#> GSM198780     1  0.3864   -0.02214 0.520 0.000 0.000 0.000 0.480 0.000
#> GSM198781     1  0.0458    0.84666 0.984 0.000 0.000 0.000 0.000 0.016
#> GSM198765     5  0.0000    0.90966 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM198766     1  0.3821    0.64725 0.772 0.000 0.000 0.080 0.148 0.000
#> GSM198768     3  0.0000    0.99740 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM198770     3  0.0000    0.99740 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM198771     3  0.0000    0.99740 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM198774     5  0.0000    0.90966 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM198775     5  0.0000    0.90966 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM198777     3  0.0000    0.99740 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM198779     3  0.0000    0.99740 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM587218     4  0.0000    1.00000 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM587219     4  0.0000    1.00000 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM587220     4  0.0000    1.00000 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM587221     4  0.0000    1.00000 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM587222     4  0.0000    1.00000 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM587223     4  0.0000    1.00000 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM587224     4  0.0000    1.00000 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM587225     4  0.0000    1.00000 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM587226     4  0.0000    1.00000 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM587227     4  0.0000    1.00000 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM587228     4  0.0000    1.00000 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM587229     4  0.0000    1.00000 0.000 0.000 0.000 1.000 0.000 0.000

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

consensus_heatmap(res, k = 2)

plot of chunk tab-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 specimen(p) k
#> MAD:pam 85    2.23e-13 2
#> MAD:pam 91    6.53e-28 3
#> MAD:pam 90    7.15e-46 4
#> MAD:pam 89    9.56e-41 5
#> MAD:pam 89    1.64e-35 6

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


MAD:mclust*

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

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

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

res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#>   On a matrix with 51941 rows and 92 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 0.933           0.925       0.969         0.4686 0.535   0.535
#> 3 3 0.667           0.802       0.877         0.3263 0.598   0.400
#> 4 4 0.864           0.903       0.953         0.1645 0.863   0.660
#> 5 5 0.802           0.749       0.858         0.0518 0.961   0.857
#> 6 6 0.799           0.733       0.855         0.0367 0.954   0.813

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
#> GSM587155     2  0.0000      0.964 0.000 1.000
#> GSM587156     2  0.0000      0.964 0.000 1.000
#> GSM587157     2  0.0000      0.964 0.000 1.000
#> GSM587158     2  0.0000      0.964 0.000 1.000
#> GSM587159     2  0.0000      0.964 0.000 1.000
#> GSM587160     2  0.0000      0.964 0.000 1.000
#> GSM587161     2  0.0000      0.964 0.000 1.000
#> GSM587162     2  0.0000      0.964 0.000 1.000
#> GSM587163     2  0.0000      0.964 0.000 1.000
#> GSM587164     2  0.0000      0.964 0.000 1.000
#> GSM587165     2  0.0000      0.964 0.000 1.000
#> GSM587166     2  0.0000      0.964 0.000 1.000
#> GSM587167     2  0.0000      0.964 0.000 1.000
#> GSM587168     2  0.0000      0.964 0.000 1.000
#> GSM587169     2  0.0000      0.964 0.000 1.000
#> GSM587170     2  0.0000      0.964 0.000 1.000
#> GSM587171     2  0.0000      0.964 0.000 1.000
#> GSM587172     2  0.0000      0.964 0.000 1.000
#> GSM587173     2  0.0000      0.964 0.000 1.000
#> GSM587174     2  0.0000      0.964 0.000 1.000
#> GSM587175     2  0.0000      0.964 0.000 1.000
#> GSM587176     2  0.0000      0.964 0.000 1.000
#> GSM587177     2  0.0000      0.964 0.000 1.000
#> GSM587178     2  0.0000      0.964 0.000 1.000
#> GSM587179     2  0.0000      0.964 0.000 1.000
#> GSM587180     2  0.0000      0.964 0.000 1.000
#> GSM587181     2  0.0000      0.964 0.000 1.000
#> GSM587182     2  0.0000      0.964 0.000 1.000
#> GSM587183     2  0.0000      0.964 0.000 1.000
#> GSM587184     2  0.0000      0.964 0.000 1.000
#> GSM587185     2  0.0000      0.964 0.000 1.000
#> GSM587186     2  0.0000      0.964 0.000 1.000
#> GSM587187     2  0.0000      0.964 0.000 1.000
#> GSM587188     2  0.0672      0.963 0.008 0.992
#> GSM587189     2  0.0672      0.963 0.008 0.992
#> GSM587190     2  0.0938      0.962 0.012 0.988
#> GSM587203     1  0.0000      0.972 1.000 0.000
#> GSM587204     1  0.0000      0.972 1.000 0.000
#> GSM587205     1  0.0000      0.972 1.000 0.000
#> GSM587206     1  0.0000      0.972 1.000 0.000
#> GSM587207     1  0.0000      0.972 1.000 0.000
#> GSM587208     1  0.0000      0.972 1.000 0.000
#> GSM587209     1  0.0000      0.972 1.000 0.000
#> GSM587210     2  0.9815      0.305 0.420 0.580
#> GSM587211     1  0.0000      0.972 1.000 0.000
#> GSM587212     1  0.9795      0.242 0.584 0.416
#> GSM587213     1  0.0000      0.972 1.000 0.000
#> GSM587214     1  0.0000      0.972 1.000 0.000
#> GSM587215     1  0.0000      0.972 1.000 0.000
#> GSM587216     1  0.0000      0.972 1.000 0.000
#> GSM587217     1  0.0000      0.972 1.000 0.000
#> GSM587191     2  0.0938      0.962 0.012 0.988
#> GSM587192     2  0.0938      0.962 0.012 0.988
#> GSM587193     2  0.7815      0.708 0.232 0.768
#> GSM587194     2  0.0938      0.962 0.012 0.988
#> GSM587195     2  0.0938      0.962 0.012 0.988
#> GSM587196     2  0.0938      0.962 0.012 0.988
#> GSM587197     2  0.0938      0.962 0.012 0.988
#> GSM587198     2  0.0938      0.962 0.012 0.988
#> GSM587199     2  0.0938      0.962 0.012 0.988
#> GSM587200     2  0.6438      0.802 0.164 0.836
#> GSM587201     2  0.8608      0.620 0.284 0.716
#> GSM587202     2  0.0938      0.962 0.012 0.988
#> GSM198767     1  0.0000      0.972 1.000 0.000
#> GSM198769     1  0.0000      0.972 1.000 0.000
#> GSM198772     1  0.0000      0.972 1.000 0.000
#> GSM198773     1  0.0000      0.972 1.000 0.000
#> GSM198776     1  0.0000      0.972 1.000 0.000
#> GSM198778     2  0.9815      0.305 0.420 0.580
#> GSM198780     1  0.9815      0.229 0.580 0.420
#> GSM198781     1  0.0000      0.972 1.000 0.000
#> GSM198765     2  0.0938      0.962 0.012 0.988
#> GSM198766     2  0.7815      0.708 0.232 0.768
#> GSM198768     2  0.0938      0.962 0.012 0.988
#> GSM198770     2  0.0938      0.962 0.012 0.988
#> GSM198771     2  0.0938      0.962 0.012 0.988
#> GSM198774     2  0.0938      0.962 0.012 0.988
#> GSM198775     2  0.0938      0.962 0.012 0.988
#> GSM198777     2  0.0938      0.962 0.012 0.988
#> GSM198779     2  0.0938      0.962 0.012 0.988
#> GSM587218     1  0.0000      0.972 1.000 0.000
#> GSM587219     1  0.0000      0.972 1.000 0.000
#> GSM587220     1  0.0000      0.972 1.000 0.000
#> GSM587221     1  0.0000      0.972 1.000 0.000
#> GSM587222     1  0.0000      0.972 1.000 0.000
#> GSM587223     1  0.0000      0.972 1.000 0.000
#> GSM587224     1  0.0000      0.972 1.000 0.000
#> GSM587225     1  0.0000      0.972 1.000 0.000
#> GSM587226     1  0.0000      0.972 1.000 0.000
#> GSM587227     1  0.0000      0.972 1.000 0.000
#> GSM587228     1  0.0000      0.972 1.000 0.000
#> GSM587229     1  0.0000      0.972 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
#> GSM587155     2  0.0000     0.9938 0.000 1.000 0.000
#> GSM587156     2  0.0592     0.9822 0.000 0.988 0.012
#> GSM587157     2  0.2056     0.9509 0.024 0.952 0.024
#> GSM587158     2  0.0000     0.9938 0.000 1.000 0.000
#> GSM587159     2  0.0000     0.9938 0.000 1.000 0.000
#> GSM587160     2  0.0000     0.9938 0.000 1.000 0.000
#> GSM587161     2  0.0000     0.9938 0.000 1.000 0.000
#> GSM587162     2  0.0000     0.9938 0.000 1.000 0.000
#> GSM587163     2  0.0000     0.9938 0.000 1.000 0.000
#> GSM587164     2  0.1031     0.9685 0.000 0.976 0.024
#> GSM587165     2  0.0000     0.9938 0.000 1.000 0.000
#> GSM587166     2  0.2165     0.9249 0.000 0.936 0.064
#> GSM587167     2  0.0747     0.9778 0.000 0.984 0.016
#> GSM587168     2  0.0000     0.9938 0.000 1.000 0.000
#> GSM587169     2  0.0000     0.9938 0.000 1.000 0.000
#> GSM587170     2  0.0000     0.9938 0.000 1.000 0.000
#> GSM587171     2  0.0000     0.9938 0.000 1.000 0.000
#> GSM587172     2  0.0000     0.9938 0.000 1.000 0.000
#> GSM587173     2  0.0000     0.9938 0.000 1.000 0.000
#> GSM587174     2  0.0000     0.9938 0.000 1.000 0.000
#> GSM587175     2  0.0000     0.9938 0.000 1.000 0.000
#> GSM587176     2  0.0000     0.9938 0.000 1.000 0.000
#> GSM587177     2  0.0000     0.9938 0.000 1.000 0.000
#> GSM587178     2  0.0000     0.9938 0.000 1.000 0.000
#> GSM587179     2  0.0000     0.9938 0.000 1.000 0.000
#> GSM587180     2  0.0000     0.9938 0.000 1.000 0.000
#> GSM587181     2  0.0000     0.9938 0.000 1.000 0.000
#> GSM587182     2  0.0000     0.9938 0.000 1.000 0.000
#> GSM587183     2  0.0000     0.9938 0.000 1.000 0.000
#> GSM587184     2  0.0000     0.9938 0.000 1.000 0.000
#> GSM587185     2  0.0000     0.9938 0.000 1.000 0.000
#> GSM587186     2  0.0000     0.9938 0.000 1.000 0.000
#> GSM587187     3  0.7841     0.0872 0.052 0.468 0.480
#> GSM587188     3  0.6850     0.5342 0.072 0.208 0.720
#> GSM587189     3  0.6673     0.5299 0.056 0.224 0.720
#> GSM587190     3  0.6168     0.6276 0.096 0.124 0.780
#> GSM587203     3  0.5497     0.6412 0.292 0.000 0.708
#> GSM587204     3  0.5497     0.6412 0.292 0.000 0.708
#> GSM587205     3  0.5497     0.6412 0.292 0.000 0.708
#> GSM587206     3  0.5497     0.6412 0.292 0.000 0.708
#> GSM587207     3  0.5497     0.6412 0.292 0.000 0.708
#> GSM587208     3  0.5497     0.6412 0.292 0.000 0.708
#> GSM587209     3  0.5465     0.6423 0.288 0.000 0.712
#> GSM587210     3  0.0592     0.7202 0.012 0.000 0.988
#> GSM587211     3  0.5465     0.6423 0.288 0.000 0.712
#> GSM587212     3  0.0592     0.7202 0.012 0.000 0.988
#> GSM587213     3  0.5497     0.6412 0.292 0.000 0.708
#> GSM587214     3  0.5497     0.6412 0.292 0.000 0.708
#> GSM587215     3  0.5465     0.6423 0.288 0.000 0.712
#> GSM587216     3  0.4062     0.6831 0.164 0.000 0.836
#> GSM587217     3  0.5497     0.6412 0.292 0.000 0.708
#> GSM587191     3  0.5260     0.6793 0.092 0.080 0.828
#> GSM587192     3  0.4174     0.7017 0.092 0.036 0.872
#> GSM587193     3  0.4291     0.6370 0.180 0.000 0.820
#> GSM587194     3  0.6176     0.6284 0.100 0.120 0.780
#> GSM587195     3  0.4443     0.7021 0.084 0.052 0.864
#> GSM587196     3  0.4179     0.7080 0.072 0.052 0.876
#> GSM587197     3  0.5416     0.6730 0.100 0.080 0.820
#> GSM587198     3  0.3896     0.7123 0.060 0.052 0.888
#> GSM587199     3  0.2066     0.7166 0.060 0.000 0.940
#> GSM587200     3  0.1643     0.7197 0.044 0.000 0.956
#> GSM587201     3  0.1753     0.7192 0.048 0.000 0.952
#> GSM587202     3  0.3896     0.7123 0.060 0.052 0.888
#> GSM198767     3  0.5497     0.6412 0.292 0.000 0.708
#> GSM198769     3  0.5465     0.6423 0.288 0.000 0.712
#> GSM198772     3  0.5465     0.6423 0.288 0.000 0.712
#> GSM198773     3  0.5497     0.6412 0.292 0.000 0.708
#> GSM198776     3  0.5497     0.6412 0.292 0.000 0.708
#> GSM198778     3  0.0592     0.7202 0.012 0.000 0.988
#> GSM198780     3  0.0592     0.7202 0.012 0.000 0.988
#> GSM198781     3  0.5497     0.6412 0.292 0.000 0.708
#> GSM198765     3  0.5260     0.6793 0.092 0.080 0.828
#> GSM198766     3  0.4291     0.6370 0.180 0.000 0.820
#> GSM198768     3  0.4269     0.7062 0.076 0.052 0.872
#> GSM198770     3  0.5416     0.6730 0.100 0.080 0.820
#> GSM198771     3  0.3896     0.7123 0.060 0.052 0.888
#> GSM198774     3  0.4505     0.6980 0.092 0.048 0.860
#> GSM198775     3  0.6176     0.6284 0.100 0.120 0.780
#> GSM198777     3  0.4179     0.7080 0.072 0.052 0.876
#> GSM198779     3  0.2066     0.7166 0.060 0.000 0.940
#> GSM587218     1  0.2959     0.9317 0.900 0.000 0.100
#> GSM587219     1  0.2959     0.9317 0.900 0.000 0.100
#> GSM587220     1  0.2959     0.9317 0.900 0.000 0.100
#> GSM587221     1  0.2959     0.9317 0.900 0.000 0.100
#> GSM587222     1  0.2959     0.9317 0.900 0.000 0.100
#> GSM587223     1  0.2959     0.9317 0.900 0.000 0.100
#> GSM587224     1  0.2959     0.9317 0.900 0.000 0.100
#> GSM587225     1  0.4796     0.8397 0.780 0.000 0.220
#> GSM587226     1  0.2959     0.9317 0.900 0.000 0.100
#> GSM587227     1  0.4796     0.8397 0.780 0.000 0.220
#> GSM587228     1  0.4796     0.8397 0.780 0.000 0.220
#> GSM587229     1  0.4796     0.8397 0.780 0.000 0.220

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM587155     2  0.0000      0.995 0.000 1.000 0.000 0.000
#> GSM587156     2  0.0592      0.982 0.000 0.984 0.016 0.000
#> GSM587157     2  0.0707      0.979 0.000 0.980 0.020 0.000
#> GSM587158     2  0.0000      0.995 0.000 1.000 0.000 0.000
#> GSM587159     2  0.0000      0.995 0.000 1.000 0.000 0.000
#> GSM587160     2  0.0000      0.995 0.000 1.000 0.000 0.000
#> GSM587161     2  0.0000      0.995 0.000 1.000 0.000 0.000
#> GSM587162     2  0.0000      0.995 0.000 1.000 0.000 0.000
#> GSM587163     2  0.0000      0.995 0.000 1.000 0.000 0.000
#> GSM587164     2  0.0592      0.982 0.000 0.984 0.016 0.000
#> GSM587165     2  0.0000      0.995 0.000 1.000 0.000 0.000
#> GSM587166     2  0.1389      0.944 0.000 0.952 0.048 0.000
#> GSM587167     2  0.0817      0.974 0.000 0.976 0.024 0.000
#> GSM587168     2  0.0000      0.995 0.000 1.000 0.000 0.000
#> GSM587169     2  0.0000      0.995 0.000 1.000 0.000 0.000
#> GSM587170     2  0.0000      0.995 0.000 1.000 0.000 0.000
#> GSM587171     2  0.0000      0.995 0.000 1.000 0.000 0.000
#> GSM587172     2  0.0000      0.995 0.000 1.000 0.000 0.000
#> GSM587173     2  0.0000      0.995 0.000 1.000 0.000 0.000
#> GSM587174     2  0.0000      0.995 0.000 1.000 0.000 0.000
#> GSM587175     2  0.0000      0.995 0.000 1.000 0.000 0.000
#> GSM587176     2  0.0000      0.995 0.000 1.000 0.000 0.000
#> GSM587177     2  0.0000      0.995 0.000 1.000 0.000 0.000
#> GSM587178     2  0.0000      0.995 0.000 1.000 0.000 0.000
#> GSM587179     2  0.0000      0.995 0.000 1.000 0.000 0.000
#> GSM587180     2  0.0000      0.995 0.000 1.000 0.000 0.000
#> GSM587181     2  0.0000      0.995 0.000 1.000 0.000 0.000
#> GSM587182     2  0.0000      0.995 0.000 1.000 0.000 0.000
#> GSM587183     2  0.0000      0.995 0.000 1.000 0.000 0.000
#> GSM587184     2  0.0000      0.995 0.000 1.000 0.000 0.000
#> GSM587185     2  0.0000      0.995 0.000 1.000 0.000 0.000
#> GSM587186     2  0.0000      0.995 0.000 1.000 0.000 0.000
#> GSM587187     3  0.4877      0.383 0.000 0.408 0.592 0.000
#> GSM587188     3  0.3486      0.749 0.000 0.188 0.812 0.000
#> GSM587189     3  0.3486      0.749 0.000 0.188 0.812 0.000
#> GSM587190     3  0.1022      0.905 0.000 0.032 0.968 0.000
#> GSM587203     1  0.0000      0.879 1.000 0.000 0.000 0.000
#> GSM587204     1  0.0000      0.879 1.000 0.000 0.000 0.000
#> GSM587205     1  0.0000      0.879 1.000 0.000 0.000 0.000
#> GSM587206     1  0.0000      0.879 1.000 0.000 0.000 0.000
#> GSM587207     1  0.0000      0.879 1.000 0.000 0.000 0.000
#> GSM587208     1  0.0000      0.879 1.000 0.000 0.000 0.000
#> GSM587209     1  0.1940      0.863 0.924 0.000 0.076 0.000
#> GSM587210     1  0.4564      0.620 0.672 0.000 0.328 0.000
#> GSM587211     1  0.3688      0.775 0.792 0.000 0.208 0.000
#> GSM587212     1  0.4564      0.620 0.672 0.000 0.328 0.000
#> GSM587213     1  0.0188      0.880 0.996 0.000 0.004 0.000
#> GSM587214     1  0.0188      0.880 0.996 0.000 0.004 0.000
#> GSM587215     1  0.1940      0.863 0.924 0.000 0.076 0.000
#> GSM587216     1  0.3688      0.775 0.792 0.000 0.208 0.000
#> GSM587217     1  0.0188      0.880 0.996 0.000 0.004 0.000
#> GSM587191     3  0.0000      0.923 0.000 0.000 1.000 0.000
#> GSM587192     3  0.0000      0.923 0.000 0.000 1.000 0.000
#> GSM587193     3  0.1807      0.890 0.000 0.008 0.940 0.052
#> GSM587194     3  0.1302      0.897 0.000 0.044 0.956 0.000
#> GSM587195     3  0.0000      0.923 0.000 0.000 1.000 0.000
#> GSM587196     3  0.0000      0.923 0.000 0.000 1.000 0.000
#> GSM587197     3  0.0000      0.923 0.000 0.000 1.000 0.000
#> GSM587198     3  0.0000      0.923 0.000 0.000 1.000 0.000
#> GSM587199     3  0.0000      0.923 0.000 0.000 1.000 0.000
#> GSM587200     3  0.4103      0.597 0.256 0.000 0.744 0.000
#> GSM587201     3  0.3649      0.693 0.204 0.000 0.796 0.000
#> GSM587202     3  0.0000      0.923 0.000 0.000 1.000 0.000
#> GSM198767     1  0.0000      0.879 1.000 0.000 0.000 0.000
#> GSM198769     1  0.1940      0.863 0.924 0.000 0.076 0.000
#> GSM198772     1  0.3528      0.790 0.808 0.000 0.192 0.000
#> GSM198773     1  0.0188      0.880 0.996 0.000 0.004 0.000
#> GSM198776     1  0.0000      0.879 1.000 0.000 0.000 0.000
#> GSM198778     1  0.4585      0.613 0.668 0.000 0.332 0.000
#> GSM198780     1  0.4564      0.620 0.672 0.000 0.328 0.000
#> GSM198781     1  0.0188      0.880 0.996 0.000 0.004 0.000
#> GSM198765     3  0.0000      0.923 0.000 0.000 1.000 0.000
#> GSM198766     3  0.1807      0.890 0.000 0.008 0.940 0.052
#> GSM198768     3  0.0000      0.923 0.000 0.000 1.000 0.000
#> GSM198770     3  0.0000      0.923 0.000 0.000 1.000 0.000
#> GSM198771     3  0.0000      0.923 0.000 0.000 1.000 0.000
#> GSM198774     3  0.0000      0.923 0.000 0.000 1.000 0.000
#> GSM198775     3  0.1302      0.897 0.000 0.044 0.956 0.000
#> GSM198777     3  0.0000      0.923 0.000 0.000 1.000 0.000
#> GSM198779     3  0.0000      0.923 0.000 0.000 1.000 0.000
#> GSM587218     4  0.0000      0.941 0.000 0.000 0.000 1.000
#> GSM587219     4  0.0000      0.941 0.000 0.000 0.000 1.000
#> GSM587220     4  0.0000      0.941 0.000 0.000 0.000 1.000
#> GSM587221     4  0.0000      0.941 0.000 0.000 0.000 1.000
#> GSM587222     4  0.0000      0.941 0.000 0.000 0.000 1.000
#> GSM587223     4  0.0000      0.941 0.000 0.000 0.000 1.000
#> GSM587224     4  0.0000      0.941 0.000 0.000 0.000 1.000
#> GSM587225     4  0.2814      0.872 0.000 0.000 0.132 0.868
#> GSM587226     4  0.0000      0.941 0.000 0.000 0.000 1.000
#> GSM587227     4  0.2814      0.872 0.000 0.000 0.132 0.868
#> GSM587228     4  0.2814      0.872 0.000 0.000 0.132 0.868
#> GSM587229     4  0.2814      0.872 0.000 0.000 0.132 0.868

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM587155     2  0.0404    0.95351 0.000 0.988 0.000 0.000 0.012
#> GSM587156     2  0.3409    0.79799 0.000 0.836 0.112 0.000 0.052
#> GSM587157     2  0.2889    0.84405 0.000 0.872 0.084 0.000 0.044
#> GSM587158     2  0.0000    0.95900 0.000 1.000 0.000 0.000 0.000
#> GSM587159     2  0.0000    0.95900 0.000 1.000 0.000 0.000 0.000
#> GSM587160     2  0.0000    0.95900 0.000 1.000 0.000 0.000 0.000
#> GSM587161     2  0.0000    0.95900 0.000 1.000 0.000 0.000 0.000
#> GSM587162     2  0.0162    0.95744 0.000 0.996 0.000 0.000 0.004
#> GSM587163     2  0.0000    0.95900 0.000 1.000 0.000 0.000 0.000
#> GSM587164     2  0.2067    0.89552 0.000 0.920 0.048 0.000 0.032
#> GSM587165     2  0.0162    0.95744 0.000 0.996 0.000 0.000 0.004
#> GSM587166     2  0.4298    0.67446 0.000 0.756 0.184 0.000 0.060
#> GSM587167     2  0.1992    0.89963 0.000 0.924 0.044 0.000 0.032
#> GSM587168     2  0.0162    0.95744 0.000 0.996 0.000 0.000 0.004
#> GSM587169     2  0.0000    0.95900 0.000 1.000 0.000 0.000 0.000
#> GSM587170     2  0.0290    0.95527 0.000 0.992 0.000 0.000 0.008
#> GSM587171     2  0.0000    0.95900 0.000 1.000 0.000 0.000 0.000
#> GSM587172     2  0.0000    0.95900 0.000 1.000 0.000 0.000 0.000
#> GSM587173     2  0.0000    0.95900 0.000 1.000 0.000 0.000 0.000
#> GSM587174     2  0.0000    0.95900 0.000 1.000 0.000 0.000 0.000
#> GSM587175     2  0.0290    0.95527 0.000 0.992 0.000 0.000 0.008
#> GSM587176     2  0.0000    0.95900 0.000 1.000 0.000 0.000 0.000
#> GSM587177     2  0.0000    0.95900 0.000 1.000 0.000 0.000 0.000
#> GSM587178     2  0.0000    0.95900 0.000 1.000 0.000 0.000 0.000
#> GSM587179     2  0.0000    0.95900 0.000 1.000 0.000 0.000 0.000
#> GSM587180     2  0.0000    0.95900 0.000 1.000 0.000 0.000 0.000
#> GSM587181     2  0.0000    0.95900 0.000 1.000 0.000 0.000 0.000
#> GSM587182     2  0.0162    0.95744 0.000 0.996 0.000 0.000 0.004
#> GSM587183     2  0.0000    0.95900 0.000 1.000 0.000 0.000 0.000
#> GSM587184     2  0.0000    0.95900 0.000 1.000 0.000 0.000 0.000
#> GSM587185     2  0.0000    0.95900 0.000 1.000 0.000 0.000 0.000
#> GSM587186     2  0.0000    0.95900 0.000 1.000 0.000 0.000 0.000
#> GSM587187     2  0.6458    0.00563 0.000 0.500 0.260 0.000 0.240
#> GSM587188     5  0.5819    0.63144 0.004 0.088 0.368 0.000 0.540
#> GSM587189     3  0.6181   -0.52186 0.004 0.120 0.484 0.000 0.392
#> GSM587190     5  0.4450    0.71204 0.004 0.000 0.488 0.000 0.508
#> GSM587203     1  0.3039    0.77507 0.808 0.000 0.000 0.000 0.192
#> GSM587204     1  0.2471    0.78398 0.864 0.000 0.000 0.000 0.136
#> GSM587205     1  0.3039    0.77507 0.808 0.000 0.000 0.000 0.192
#> GSM587206     1  0.3039    0.77507 0.808 0.000 0.000 0.000 0.192
#> GSM587207     1  0.3039    0.77507 0.808 0.000 0.000 0.000 0.192
#> GSM587208     1  0.3039    0.77507 0.808 0.000 0.000 0.000 0.192
#> GSM587209     1  0.0290    0.79897 0.992 0.000 0.000 0.000 0.008
#> GSM587210     1  0.6695    0.24142 0.432 0.000 0.284 0.000 0.284
#> GSM587211     1  0.4696    0.64622 0.736 0.000 0.108 0.000 0.156
#> GSM587212     1  0.6417    0.37785 0.504 0.000 0.216 0.000 0.280
#> GSM587213     1  0.0290    0.79926 0.992 0.000 0.000 0.000 0.008
#> GSM587214     1  0.0000    0.79998 1.000 0.000 0.000 0.000 0.000
#> GSM587215     1  0.0703    0.79424 0.976 0.000 0.000 0.000 0.024
#> GSM587216     1  0.5481    0.57095 0.656 0.000 0.172 0.000 0.172
#> GSM587217     1  0.0000    0.79998 1.000 0.000 0.000 0.000 0.000
#> GSM587191     3  0.2583    0.59460 0.004 0.000 0.864 0.000 0.132
#> GSM587192     3  0.2763    0.55844 0.004 0.000 0.848 0.000 0.148
#> GSM587193     5  0.4473    0.72269 0.008 0.000 0.412 0.000 0.580
#> GSM587194     5  0.4425    0.66409 0.004 0.000 0.452 0.000 0.544
#> GSM587195     3  0.1478    0.61180 0.000 0.000 0.936 0.000 0.064
#> GSM587196     3  0.1608    0.61820 0.000 0.000 0.928 0.000 0.072
#> GSM587197     3  0.3160    0.40784 0.004 0.000 0.808 0.000 0.188
#> GSM587198     3  0.0703    0.65094 0.000 0.000 0.976 0.000 0.024
#> GSM587199     3  0.2732    0.54292 0.000 0.000 0.840 0.000 0.160
#> GSM587200     3  0.6193    0.11495 0.192 0.000 0.548 0.000 0.260
#> GSM587201     3  0.5702    0.16954 0.192 0.000 0.628 0.000 0.180
#> GSM587202     3  0.1908    0.61415 0.000 0.000 0.908 0.000 0.092
#> GSM198767     1  0.3039    0.77507 0.808 0.000 0.000 0.000 0.192
#> GSM198769     1  0.0290    0.79897 0.992 0.000 0.000 0.000 0.008
#> GSM198772     1  0.4117    0.69066 0.788 0.000 0.096 0.000 0.116
#> GSM198773     1  0.0162    0.79955 0.996 0.000 0.000 0.000 0.004
#> GSM198776     1  0.2471    0.78398 0.864 0.000 0.000 0.000 0.136
#> GSM198778     1  0.6695    0.24142 0.432 0.000 0.284 0.000 0.284
#> GSM198780     1  0.6417    0.37785 0.504 0.000 0.216 0.000 0.280
#> GSM198781     1  0.0000    0.79998 1.000 0.000 0.000 0.000 0.000
#> GSM198765     3  0.2536    0.59851 0.004 0.000 0.868 0.000 0.128
#> GSM198766     5  0.4464    0.71782 0.008 0.000 0.408 0.000 0.584
#> GSM198768     3  0.0880    0.63566 0.000 0.000 0.968 0.000 0.032
#> GSM198770     3  0.3160    0.40784 0.004 0.000 0.808 0.000 0.188
#> GSM198771     3  0.0880    0.65112 0.000 0.000 0.968 0.000 0.032
#> GSM198774     3  0.2719    0.55962 0.004 0.000 0.852 0.000 0.144
#> GSM198775     5  0.4420    0.66609 0.004 0.000 0.448 0.000 0.548
#> GSM198777     3  0.1671    0.61665 0.000 0.000 0.924 0.000 0.076
#> GSM198779     3  0.2732    0.54292 0.000 0.000 0.840 0.000 0.160
#> GSM587218     4  0.3507    0.79151 0.000 0.000 0.120 0.828 0.052
#> GSM587219     4  0.0000    0.91924 0.000 0.000 0.000 1.000 0.000
#> GSM587220     4  0.0000    0.91924 0.000 0.000 0.000 1.000 0.000
#> GSM587221     4  0.0000    0.91924 0.000 0.000 0.000 1.000 0.000
#> GSM587222     4  0.0000    0.91924 0.000 0.000 0.000 1.000 0.000
#> GSM587223     4  0.0000    0.91924 0.000 0.000 0.000 1.000 0.000
#> GSM587224     4  0.0000    0.91924 0.000 0.000 0.000 1.000 0.000
#> GSM587225     4  0.3362    0.85603 0.000 0.000 0.076 0.844 0.080
#> GSM587226     4  0.0000    0.91924 0.000 0.000 0.000 1.000 0.000
#> GSM587227     4  0.3119    0.86764 0.000 0.000 0.072 0.860 0.068
#> GSM587228     4  0.3119    0.86764 0.000 0.000 0.072 0.860 0.068
#> GSM587229     4  0.3119    0.86764 0.000 0.000 0.072 0.860 0.068

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM587155     2  0.0777      0.947 0.000 0.972 0.000 0.000 0.024 0.004
#> GSM587156     2  0.2871      0.765 0.000 0.804 0.000 0.000 0.192 0.004
#> GSM587157     2  0.2442      0.827 0.000 0.852 0.000 0.000 0.144 0.004
#> GSM587158     2  0.0000      0.965 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587159     2  0.0000      0.965 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587160     2  0.0000      0.965 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587161     2  0.0000      0.965 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587162     2  0.0000      0.965 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587163     2  0.0000      0.965 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587164     2  0.2362      0.838 0.000 0.860 0.000 0.000 0.136 0.004
#> GSM587165     2  0.0000      0.965 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587166     2  0.3915      0.587 0.000 0.704 0.020 0.000 0.272 0.004
#> GSM587167     2  0.2362      0.839 0.000 0.860 0.000 0.000 0.136 0.004
#> GSM587168     2  0.0000      0.965 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587169     2  0.0260      0.960 0.000 0.992 0.000 0.000 0.008 0.000
#> GSM587170     2  0.0603      0.953 0.000 0.980 0.000 0.000 0.016 0.004
#> GSM587171     2  0.0000      0.965 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587172     2  0.0000      0.965 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587173     2  0.0000      0.965 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587174     2  0.0000      0.965 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587175     2  0.0260      0.961 0.000 0.992 0.000 0.000 0.008 0.000
#> GSM587176     2  0.0000      0.965 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587177     2  0.0000      0.965 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587178     2  0.0000      0.965 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587179     2  0.0000      0.965 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587180     2  0.0000      0.965 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587181     2  0.0000      0.965 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587182     2  0.0146      0.963 0.000 0.996 0.000 0.000 0.004 0.000
#> GSM587183     2  0.0000      0.965 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587184     2  0.0000      0.965 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587185     2  0.0000      0.965 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587186     2  0.0000      0.965 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587187     5  0.5022      0.107 0.000 0.432 0.072 0.000 0.496 0.000
#> GSM587188     5  0.3516      0.524 0.000 0.088 0.096 0.000 0.812 0.004
#> GSM587189     5  0.3611      0.520 0.000 0.108 0.096 0.000 0.796 0.000
#> GSM587190     5  0.3076      0.479 0.000 0.000 0.240 0.000 0.760 0.000
#> GSM587203     1  0.0000      0.700 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM587204     1  0.3288      0.676 0.724 0.000 0.000 0.000 0.000 0.276
#> GSM587205     1  0.0363      0.708 0.988 0.000 0.000 0.000 0.000 0.012
#> GSM587206     1  0.0363      0.708 0.988 0.000 0.000 0.000 0.000 0.012
#> GSM587207     1  0.0363      0.708 0.988 0.000 0.000 0.000 0.000 0.012
#> GSM587208     1  0.0363      0.708 0.988 0.000 0.000 0.000 0.000 0.012
#> GSM587209     6  0.2883      0.352 0.212 0.000 0.000 0.000 0.000 0.788
#> GSM587210     6  0.5328      0.384 0.000 0.000 0.200 0.000 0.204 0.596
#> GSM587211     6  0.1225      0.586 0.036 0.000 0.012 0.000 0.000 0.952
#> GSM587212     6  0.4316      0.547 0.000 0.000 0.128 0.000 0.144 0.728
#> GSM587213     1  0.3854      0.526 0.536 0.000 0.000 0.000 0.000 0.464
#> GSM587214     1  0.3857      0.542 0.532 0.000 0.000 0.000 0.000 0.468
#> GSM587215     6  0.3175      0.247 0.256 0.000 0.000 0.000 0.000 0.744
#> GSM587216     6  0.3628      0.626 0.036 0.000 0.044 0.000 0.100 0.820
#> GSM587217     1  0.3860      0.536 0.528 0.000 0.000 0.000 0.000 0.472
#> GSM587191     3  0.2491      0.708 0.000 0.000 0.836 0.000 0.164 0.000
#> GSM587192     3  0.4161      0.604 0.036 0.000 0.696 0.000 0.264 0.004
#> GSM587193     5  0.5817      0.314 0.000 0.000 0.312 0.000 0.480 0.208
#> GSM587194     5  0.3930      0.264 0.000 0.000 0.420 0.000 0.576 0.004
#> GSM587195     3  0.0935      0.756 0.000 0.000 0.964 0.000 0.032 0.004
#> GSM587196     3  0.0865      0.739 0.000 0.000 0.964 0.000 0.036 0.000
#> GSM587197     3  0.3023      0.664 0.000 0.000 0.784 0.000 0.212 0.004
#> GSM587198     3  0.0508      0.755 0.000 0.000 0.984 0.000 0.012 0.004
#> GSM587199     3  0.2831      0.690 0.024 0.000 0.840 0.000 0.136 0.000
#> GSM587200     3  0.5817      0.385 0.016 0.000 0.544 0.000 0.288 0.152
#> GSM587201     3  0.6256      0.302 0.032 0.000 0.508 0.000 0.276 0.184
#> GSM587202     3  0.0865      0.739 0.000 0.000 0.964 0.000 0.036 0.000
#> GSM198767     1  0.0363      0.708 0.988 0.000 0.000 0.000 0.000 0.012
#> GSM198769     6  0.3076      0.290 0.240 0.000 0.000 0.000 0.000 0.760
#> GSM198772     6  0.1082      0.576 0.040 0.000 0.004 0.000 0.000 0.956
#> GSM198773     1  0.3843      0.545 0.548 0.000 0.000 0.000 0.000 0.452
#> GSM198776     1  0.3288      0.676 0.724 0.000 0.000 0.000 0.000 0.276
#> GSM198778     6  0.5328      0.384 0.000 0.000 0.200 0.000 0.204 0.596
#> GSM198780     6  0.4316      0.547 0.000 0.000 0.128 0.000 0.144 0.728
#> GSM198781     1  0.3857      0.542 0.532 0.000 0.000 0.000 0.000 0.468
#> GSM198765     3  0.2491      0.708 0.000 0.000 0.836 0.000 0.164 0.000
#> GSM198766     5  0.5784      0.328 0.000 0.000 0.260 0.000 0.504 0.236
#> GSM198768     3  0.0858      0.756 0.000 0.000 0.968 0.000 0.028 0.004
#> GSM198770     3  0.3109      0.649 0.000 0.000 0.772 0.000 0.224 0.004
#> GSM198771     3  0.0146      0.758 0.000 0.000 0.996 0.000 0.000 0.004
#> GSM198774     3  0.4161      0.604 0.036 0.000 0.696 0.000 0.264 0.004
#> GSM198775     5  0.3923      0.269 0.000 0.000 0.416 0.000 0.580 0.004
#> GSM198777     3  0.0865      0.739 0.000 0.000 0.964 0.000 0.036 0.000
#> GSM198779     3  0.2831      0.690 0.024 0.000 0.840 0.000 0.136 0.000
#> GSM587218     4  0.2697      0.808 0.000 0.000 0.000 0.812 0.188 0.000
#> GSM587219     4  0.0000      0.919 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM587220     4  0.0000      0.919 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM587221     4  0.0000      0.919 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM587222     4  0.0000      0.919 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM587223     4  0.0000      0.919 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM587224     4  0.0000      0.919 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM587225     4  0.2658      0.872 0.000 0.000 0.036 0.864 0.100 0.000
#> GSM587226     4  0.0000      0.919 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM587227     4  0.2658      0.872 0.000 0.000 0.036 0.864 0.100 0.000
#> GSM587228     4  0.2658      0.872 0.000 0.000 0.036 0.864 0.100 0.000
#> GSM587229     4  0.2658      0.872 0.000 0.000 0.036 0.864 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-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 specimen(p) k
#> MAD:mclust 88    7.88e-17 2
#> MAD:mclust 91    1.66e-32 3
#> MAD:mclust 91    1.66e-47 4
#> MAD:mclust 82    6.99e-43 5
#> MAD:mclust 79    1.39e-49 6

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


MAD:NMF**

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

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

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

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

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

collect_plots(res)

plot of chunk MAD-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.983       0.992         0.5012 0.500   0.500
#> 3 3 0.909           0.909       0.954         0.3050 0.703   0.482
#> 4 4 0.981           0.925       0.967         0.1164 0.883   0.683
#> 5 5 0.884           0.884       0.932         0.0544 0.958   0.849
#> 6 6 0.811           0.699       0.838         0.0395 0.974   0.893

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

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

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

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

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

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>           class entropy silhouette    p1    p2
#> GSM587155     2  0.0000      0.985 0.000 1.000
#> GSM587156     2  0.0000      0.985 0.000 1.000
#> GSM587157     2  0.0000      0.985 0.000 1.000
#> GSM587158     2  0.0000      0.985 0.000 1.000
#> GSM587159     2  0.0000      0.985 0.000 1.000
#> GSM587160     2  0.0000      0.985 0.000 1.000
#> GSM587161     2  0.0000      0.985 0.000 1.000
#> GSM587162     2  0.0000      0.985 0.000 1.000
#> GSM587163     2  0.0000      0.985 0.000 1.000
#> GSM587164     2  0.0000      0.985 0.000 1.000
#> GSM587165     2  0.0000      0.985 0.000 1.000
#> GSM587166     2  0.0000      0.985 0.000 1.000
#> GSM587167     2  0.0000      0.985 0.000 1.000
#> GSM587168     2  0.0000      0.985 0.000 1.000
#> GSM587169     2  0.0000      0.985 0.000 1.000
#> GSM587170     2  0.0000      0.985 0.000 1.000
#> GSM587171     2  0.0000      0.985 0.000 1.000
#> GSM587172     2  0.0000      0.985 0.000 1.000
#> GSM587173     2  0.0000      0.985 0.000 1.000
#> GSM587174     2  0.0000      0.985 0.000 1.000
#> GSM587175     2  0.0000      0.985 0.000 1.000
#> GSM587176     2  0.0000      0.985 0.000 1.000
#> GSM587177     2  0.0000      0.985 0.000 1.000
#> GSM587178     2  0.0000      0.985 0.000 1.000
#> GSM587179     2  0.0000      0.985 0.000 1.000
#> GSM587180     2  0.0000      0.985 0.000 1.000
#> GSM587181     2  0.0000      0.985 0.000 1.000
#> GSM587182     2  0.0000      0.985 0.000 1.000
#> GSM587183     2  0.0000      0.985 0.000 1.000
#> GSM587184     2  0.0000      0.985 0.000 1.000
#> GSM587185     2  0.0000      0.985 0.000 1.000
#> GSM587186     2  0.0000      0.985 0.000 1.000
#> GSM587187     2  0.0000      0.985 0.000 1.000
#> GSM587188     2  0.0000      0.985 0.000 1.000
#> GSM587189     2  0.0000      0.985 0.000 1.000
#> GSM587190     2  0.0000      0.985 0.000 1.000
#> GSM587203     1  0.0000      1.000 1.000 0.000
#> GSM587204     1  0.0000      1.000 1.000 0.000
#> GSM587205     1  0.0000      1.000 1.000 0.000
#> GSM587206     1  0.0000      1.000 1.000 0.000
#> GSM587207     1  0.0000      1.000 1.000 0.000
#> GSM587208     1  0.0000      1.000 1.000 0.000
#> GSM587209     1  0.0000      1.000 1.000 0.000
#> GSM587210     1  0.0000      1.000 1.000 0.000
#> GSM587211     1  0.0000      1.000 1.000 0.000
#> GSM587212     1  0.0000      1.000 1.000 0.000
#> GSM587213     1  0.0000      1.000 1.000 0.000
#> GSM587214     1  0.0000      1.000 1.000 0.000
#> GSM587215     1  0.0000      1.000 1.000 0.000
#> GSM587216     1  0.0000      1.000 1.000 0.000
#> GSM587217     1  0.0000      1.000 1.000 0.000
#> GSM587191     2  0.0000      0.985 0.000 1.000
#> GSM587192     1  0.0000      1.000 1.000 0.000
#> GSM587193     1  0.0000      1.000 1.000 0.000
#> GSM587194     2  0.0672      0.979 0.008 0.992
#> GSM587195     2  0.0000      0.985 0.000 1.000
#> GSM587196     2  0.7139      0.766 0.196 0.804
#> GSM587197     2  0.0000      0.985 0.000 1.000
#> GSM587198     2  0.0376      0.982 0.004 0.996
#> GSM587199     2  0.0000      0.985 0.000 1.000
#> GSM587200     1  0.0000      1.000 1.000 0.000
#> GSM587201     1  0.0000      1.000 1.000 0.000
#> GSM587202     2  0.4690      0.889 0.100 0.900
#> GSM198767     1  0.0000      1.000 1.000 0.000
#> GSM198769     1  0.0000      1.000 1.000 0.000
#> GSM198772     1  0.0000      1.000 1.000 0.000
#> GSM198773     1  0.0000      1.000 1.000 0.000
#> GSM198776     1  0.0000      1.000 1.000 0.000
#> GSM198778     1  0.0000      1.000 1.000 0.000
#> GSM198780     1  0.0000      1.000 1.000 0.000
#> GSM198781     1  0.0000      1.000 1.000 0.000
#> GSM198765     2  0.1184      0.972 0.016 0.984
#> GSM198766     1  0.0000      1.000 1.000 0.000
#> GSM198768     2  0.0000      0.985 0.000 1.000
#> GSM198770     2  0.0000      0.985 0.000 1.000
#> GSM198771     2  0.8955      0.566 0.312 0.688
#> GSM198774     1  0.0000      1.000 1.000 0.000
#> GSM198775     2  0.0000      0.985 0.000 1.000
#> GSM198777     2  0.4562      0.894 0.096 0.904
#> GSM198779     2  0.0000      0.985 0.000 1.000
#> GSM587218     1  0.0000      1.000 1.000 0.000
#> GSM587219     1  0.0000      1.000 1.000 0.000
#> GSM587220     1  0.0000      1.000 1.000 0.000
#> GSM587221     1  0.0000      1.000 1.000 0.000
#> GSM587222     1  0.0000      1.000 1.000 0.000
#> GSM587223     1  0.0000      1.000 1.000 0.000
#> GSM587224     1  0.0000      1.000 1.000 0.000
#> GSM587225     1  0.0000      1.000 1.000 0.000
#> GSM587226     1  0.0000      1.000 1.000 0.000
#> GSM587227     1  0.0000      1.000 1.000 0.000
#> GSM587228     1  0.0000      1.000 1.000 0.000
#> GSM587229     1  0.0000      1.000 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1    p2    p3
#> GSM587155     2  0.0000      0.973 0.000 1.000 0.000
#> GSM587156     2  0.0000      0.973 0.000 1.000 0.000
#> GSM587157     2  0.0237      0.970 0.000 0.996 0.004
#> GSM587158     2  0.0000      0.973 0.000 1.000 0.000
#> GSM587159     2  0.0000      0.973 0.000 1.000 0.000
#> GSM587160     2  0.0000      0.973 0.000 1.000 0.000
#> GSM587161     2  0.0000      0.973 0.000 1.000 0.000
#> GSM587162     2  0.0000      0.973 0.000 1.000 0.000
#> GSM587163     2  0.0000      0.973 0.000 1.000 0.000
#> GSM587164     2  0.0000      0.973 0.000 1.000 0.000
#> GSM587165     2  0.0000      0.973 0.000 1.000 0.000
#> GSM587166     2  0.0000      0.973 0.000 1.000 0.000
#> GSM587167     2  0.0000      0.973 0.000 1.000 0.000
#> GSM587168     2  0.0000      0.973 0.000 1.000 0.000
#> GSM587169     2  0.0000      0.973 0.000 1.000 0.000
#> GSM587170     2  0.0000      0.973 0.000 1.000 0.000
#> GSM587171     2  0.0000      0.973 0.000 1.000 0.000
#> GSM587172     2  0.0000      0.973 0.000 1.000 0.000
#> GSM587173     2  0.0000      0.973 0.000 1.000 0.000
#> GSM587174     2  0.0000      0.973 0.000 1.000 0.000
#> GSM587175     2  0.0000      0.973 0.000 1.000 0.000
#> GSM587176     2  0.0000      0.973 0.000 1.000 0.000
#> GSM587177     2  0.0000      0.973 0.000 1.000 0.000
#> GSM587178     2  0.0000      0.973 0.000 1.000 0.000
#> GSM587179     2  0.0000      0.973 0.000 1.000 0.000
#> GSM587180     2  0.0000      0.973 0.000 1.000 0.000
#> GSM587181     2  0.0000      0.973 0.000 1.000 0.000
#> GSM587182     2  0.0000      0.973 0.000 1.000 0.000
#> GSM587183     2  0.0000      0.973 0.000 1.000 0.000
#> GSM587184     2  0.0000      0.973 0.000 1.000 0.000
#> GSM587185     2  0.0000      0.973 0.000 1.000 0.000
#> GSM587186     2  0.0000      0.973 0.000 1.000 0.000
#> GSM587187     2  0.0424      0.967 0.000 0.992 0.008
#> GSM587188     2  0.0892      0.957 0.000 0.980 0.020
#> GSM587189     2  0.0747      0.961 0.000 0.984 0.016
#> GSM587190     3  0.1289      0.898 0.000 0.032 0.968
#> GSM587203     1  0.0000      1.000 1.000 0.000 0.000
#> GSM587204     1  0.0000      1.000 1.000 0.000 0.000
#> GSM587205     1  0.0000      1.000 1.000 0.000 0.000
#> GSM587206     1  0.0000      1.000 1.000 0.000 0.000
#> GSM587207     1  0.0000      1.000 1.000 0.000 0.000
#> GSM587208     1  0.0000      1.000 1.000 0.000 0.000
#> GSM587209     1  0.0000      1.000 1.000 0.000 0.000
#> GSM587210     3  0.2448      0.887 0.076 0.000 0.924
#> GSM587211     1  0.0000      1.000 1.000 0.000 0.000
#> GSM587212     3  0.5497      0.673 0.292 0.000 0.708
#> GSM587213     1  0.0000      1.000 1.000 0.000 0.000
#> GSM587214     1  0.0000      1.000 1.000 0.000 0.000
#> GSM587215     1  0.0000      1.000 1.000 0.000 0.000
#> GSM587216     1  0.0000      1.000 1.000 0.000 0.000
#> GSM587217     1  0.0000      1.000 1.000 0.000 0.000
#> GSM587191     2  0.6008      0.368 0.000 0.628 0.372
#> GSM587192     3  0.4654      0.779 0.208 0.000 0.792
#> GSM587193     3  0.4974      0.742 0.236 0.000 0.764
#> GSM587194     3  0.0000      0.903 0.000 0.000 1.000
#> GSM587195     2  0.6280      0.106 0.000 0.540 0.460
#> GSM587196     3  0.2537      0.867 0.000 0.080 0.920
#> GSM587197     3  0.0892      0.902 0.000 0.020 0.980
#> GSM587198     3  0.0592      0.903 0.000 0.012 0.988
#> GSM587199     3  0.0592      0.903 0.000 0.012 0.988
#> GSM587200     3  0.0892      0.905 0.020 0.000 0.980
#> GSM587201     3  0.5905      0.562 0.352 0.000 0.648
#> GSM587202     3  0.1411      0.895 0.000 0.036 0.964
#> GSM198767     1  0.0000      1.000 1.000 0.000 0.000
#> GSM198769     1  0.0000      1.000 1.000 0.000 0.000
#> GSM198772     1  0.0000      1.000 1.000 0.000 0.000
#> GSM198773     1  0.0000      1.000 1.000 0.000 0.000
#> GSM198776     1  0.0000      1.000 1.000 0.000 0.000
#> GSM198778     3  0.2448      0.887 0.076 0.000 0.924
#> GSM198780     3  0.5591      0.656 0.304 0.000 0.696
#> GSM198781     1  0.0000      1.000 1.000 0.000 0.000
#> GSM198765     3  0.6126      0.363 0.000 0.400 0.600
#> GSM198766     3  0.5835      0.579 0.340 0.000 0.660
#> GSM198768     3  0.4178      0.778 0.000 0.172 0.828
#> GSM198770     3  0.1163      0.899 0.000 0.028 0.972
#> GSM198771     3  0.0592      0.903 0.000 0.012 0.988
#> GSM198774     3  0.4702      0.774 0.212 0.000 0.788
#> GSM198775     3  0.0237      0.904 0.000 0.004 0.996
#> GSM198777     3  0.2878      0.854 0.000 0.096 0.904
#> GSM198779     3  0.0592      0.903 0.000 0.012 0.988
#> GSM587218     3  0.0237      0.904 0.004 0.000 0.996
#> GSM587219     3  0.0747      0.905 0.016 0.000 0.984
#> GSM587220     3  0.1411      0.901 0.036 0.000 0.964
#> GSM587221     3  0.0747      0.905 0.016 0.000 0.984
#> GSM587222     3  0.1031      0.904 0.024 0.000 0.976
#> GSM587223     3  0.0592      0.905 0.012 0.000 0.988
#> GSM587224     3  0.0592      0.905 0.012 0.000 0.988
#> GSM587225     3  0.1289      0.902 0.032 0.000 0.968
#> GSM587226     3  0.0747      0.905 0.016 0.000 0.984
#> GSM587227     3  0.1031      0.904 0.024 0.000 0.976
#> GSM587228     3  0.1289      0.902 0.032 0.000 0.968
#> GSM587229     3  0.2625      0.877 0.084 0.000 0.916

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM587155     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> GSM587156     2  0.0188      0.995 0.000 0.996 0.004 0.000
#> GSM587157     2  0.0188      0.995 0.000 0.996 0.004 0.000
#> GSM587158     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> GSM587159     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> GSM587160     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> GSM587161     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> GSM587162     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> GSM587163     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> GSM587164     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> GSM587165     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> GSM587166     2  0.0188      0.995 0.000 0.996 0.004 0.000
#> GSM587167     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> GSM587168     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> GSM587169     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> GSM587170     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> GSM587171     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> GSM587172     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> GSM587173     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> GSM587174     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> GSM587175     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> GSM587176     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> GSM587177     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> GSM587178     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> GSM587179     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> GSM587180     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> GSM587181     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> GSM587182     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> GSM587183     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> GSM587184     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> GSM587185     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> GSM587186     2  0.0000      0.999 0.000 1.000 0.000 0.000
#> GSM587187     2  0.0336      0.992 0.000 0.992 0.008 0.000
#> GSM587188     2  0.0657      0.986 0.000 0.984 0.012 0.004
#> GSM587189     2  0.0657      0.986 0.000 0.984 0.012 0.004
#> GSM587190     4  0.2983      0.880 0.000 0.068 0.040 0.892
#> GSM587203     1  0.0000      0.953 1.000 0.000 0.000 0.000
#> GSM587204     1  0.0000      0.953 1.000 0.000 0.000 0.000
#> GSM587205     1  0.0000      0.953 1.000 0.000 0.000 0.000
#> GSM587206     1  0.0000      0.953 1.000 0.000 0.000 0.000
#> GSM587207     1  0.0000      0.953 1.000 0.000 0.000 0.000
#> GSM587208     1  0.0000      0.953 1.000 0.000 0.000 0.000
#> GSM587209     1  0.0000      0.953 1.000 0.000 0.000 0.000
#> GSM587210     3  0.0895      0.903 0.020 0.000 0.976 0.004
#> GSM587211     1  0.0188      0.950 0.996 0.000 0.004 0.000
#> GSM587212     3  0.4454      0.589 0.308 0.000 0.692 0.000
#> GSM587213     1  0.0000      0.953 1.000 0.000 0.000 0.000
#> GSM587214     1  0.0000      0.953 1.000 0.000 0.000 0.000
#> GSM587215     1  0.0188      0.950 0.996 0.000 0.004 0.000
#> GSM587216     1  0.0188      0.950 0.996 0.000 0.004 0.000
#> GSM587217     1  0.0000      0.953 1.000 0.000 0.000 0.000
#> GSM587191     3  0.1867      0.856 0.000 0.072 0.928 0.000
#> GSM587192     3  0.0707      0.903 0.020 0.000 0.980 0.000
#> GSM587193     1  0.6392      0.198 0.528 0.000 0.068 0.404
#> GSM587194     3  0.4877      0.344 0.000 0.000 0.592 0.408
#> GSM587195     3  0.1902      0.862 0.000 0.064 0.932 0.004
#> GSM587196     3  0.0188      0.906 0.000 0.000 0.996 0.004
#> GSM587197     3  0.2334      0.857 0.000 0.004 0.908 0.088
#> GSM587198     3  0.0336      0.906 0.000 0.000 0.992 0.008
#> GSM587199     3  0.0336      0.906 0.000 0.000 0.992 0.008
#> GSM587200     3  0.0524      0.906 0.008 0.000 0.988 0.004
#> GSM587201     3  0.0707      0.903 0.020 0.000 0.980 0.000
#> GSM587202     3  0.0336      0.906 0.000 0.000 0.992 0.008
#> GSM198767     1  0.0000      0.953 1.000 0.000 0.000 0.000
#> GSM198769     1  0.0000      0.953 1.000 0.000 0.000 0.000
#> GSM198772     1  0.0000      0.953 1.000 0.000 0.000 0.000
#> GSM198773     1  0.0000      0.953 1.000 0.000 0.000 0.000
#> GSM198776     1  0.0000      0.953 1.000 0.000 0.000 0.000
#> GSM198778     3  0.0779      0.905 0.016 0.000 0.980 0.004
#> GSM198780     3  0.4356      0.616 0.292 0.000 0.708 0.000
#> GSM198781     1  0.0000      0.953 1.000 0.000 0.000 0.000
#> GSM198765     3  0.0817      0.896 0.000 0.024 0.976 0.000
#> GSM198766     1  0.6031      0.280 0.564 0.000 0.048 0.388
#> GSM198768     3  0.0376      0.905 0.000 0.004 0.992 0.004
#> GSM198770     3  0.2845      0.853 0.000 0.028 0.896 0.076
#> GSM198771     3  0.0336      0.906 0.000 0.000 0.992 0.008
#> GSM198774     3  0.0707      0.903 0.020 0.000 0.980 0.000
#> GSM198775     3  0.4877      0.344 0.000 0.000 0.592 0.408
#> GSM198777     3  0.0188      0.906 0.000 0.000 0.996 0.004
#> GSM198779     3  0.0336      0.906 0.000 0.000 0.992 0.008
#> GSM587218     4  0.0000      0.987 0.000 0.000 0.000 1.000
#> GSM587219     4  0.0000      0.987 0.000 0.000 0.000 1.000
#> GSM587220     4  0.0336      0.985 0.008 0.000 0.000 0.992
#> GSM587221     4  0.0000      0.987 0.000 0.000 0.000 1.000
#> GSM587222     4  0.0188      0.986 0.004 0.000 0.000 0.996
#> GSM587223     4  0.0000      0.987 0.000 0.000 0.000 1.000
#> GSM587224     4  0.0000      0.987 0.000 0.000 0.000 1.000
#> GSM587225     4  0.0336      0.985 0.008 0.000 0.000 0.992
#> GSM587226     4  0.0000      0.987 0.000 0.000 0.000 1.000
#> GSM587227     4  0.0188      0.986 0.004 0.000 0.000 0.996
#> GSM587228     4  0.0336      0.985 0.008 0.000 0.000 0.992
#> GSM587229     4  0.0469      0.982 0.012 0.000 0.000 0.988

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM587155     2  0.1732      0.905 0.000 0.920 0.000 0.000 0.080
#> GSM587156     2  0.3838      0.683 0.000 0.716 0.000 0.004 0.280
#> GSM587157     2  0.2677      0.863 0.000 0.872 0.112 0.000 0.016
#> GSM587158     2  0.0000      0.943 0.000 1.000 0.000 0.000 0.000
#> GSM587159     2  0.0000      0.943 0.000 1.000 0.000 0.000 0.000
#> GSM587160     2  0.0290      0.942 0.000 0.992 0.000 0.000 0.008
#> GSM587161     2  0.1197      0.925 0.000 0.952 0.000 0.000 0.048
#> GSM587162     2  0.0290      0.942 0.000 0.992 0.000 0.000 0.008
#> GSM587163     2  0.0290      0.942 0.000 0.992 0.000 0.000 0.008
#> GSM587164     2  0.1908      0.897 0.000 0.908 0.000 0.000 0.092
#> GSM587165     2  0.0404      0.940 0.000 0.988 0.012 0.000 0.000
#> GSM587166     2  0.3990      0.638 0.000 0.688 0.000 0.004 0.308
#> GSM587167     2  0.2127      0.886 0.000 0.892 0.000 0.000 0.108
#> GSM587168     2  0.0404      0.940 0.000 0.988 0.012 0.000 0.000
#> GSM587169     2  0.0290      0.942 0.000 0.992 0.000 0.000 0.008
#> GSM587170     2  0.2605      0.850 0.000 0.852 0.000 0.000 0.148
#> GSM587171     2  0.0000      0.943 0.000 1.000 0.000 0.000 0.000
#> GSM587172     2  0.0162      0.943 0.000 0.996 0.000 0.000 0.004
#> GSM587173     2  0.0404      0.940 0.000 0.988 0.012 0.000 0.000
#> GSM587174     2  0.0290      0.942 0.000 0.992 0.000 0.000 0.008
#> GSM587175     2  0.0912      0.938 0.000 0.972 0.016 0.000 0.012
#> GSM587176     2  0.0290      0.942 0.000 0.992 0.000 0.000 0.008
#> GSM587177     2  0.0290      0.942 0.000 0.992 0.008 0.000 0.000
#> GSM587178     2  0.0162      0.942 0.000 0.996 0.004 0.000 0.000
#> GSM587179     2  0.0162      0.942 0.000 0.996 0.004 0.000 0.000
#> GSM587180     2  0.0290      0.942 0.000 0.992 0.000 0.000 0.008
#> GSM587181     2  0.0162      0.942 0.000 0.996 0.004 0.000 0.000
#> GSM587182     2  0.0324      0.943 0.000 0.992 0.004 0.000 0.004
#> GSM587183     2  0.0162      0.942 0.000 0.996 0.004 0.000 0.000
#> GSM587184     2  0.0162      0.942 0.000 0.996 0.004 0.000 0.000
#> GSM587185     2  0.0290      0.942 0.000 0.992 0.000 0.000 0.008
#> GSM587186     2  0.0671      0.938 0.000 0.980 0.016 0.000 0.004
#> GSM587187     2  0.1965      0.880 0.000 0.904 0.096 0.000 0.000
#> GSM587188     2  0.2964      0.839 0.000 0.856 0.120 0.000 0.024
#> GSM587189     2  0.4126      0.403 0.000 0.620 0.380 0.000 0.000
#> GSM587190     4  0.3509      0.755 0.000 0.132 0.020 0.832 0.016
#> GSM587203     1  0.0000      0.966 1.000 0.000 0.000 0.000 0.000
#> GSM587204     1  0.0609      0.962 0.980 0.000 0.000 0.000 0.020
#> GSM587205     1  0.0000      0.966 1.000 0.000 0.000 0.000 0.000
#> GSM587206     1  0.0290      0.966 0.992 0.000 0.000 0.000 0.008
#> GSM587207     1  0.0000      0.966 1.000 0.000 0.000 0.000 0.000
#> GSM587208     1  0.0290      0.966 0.992 0.000 0.000 0.000 0.008
#> GSM587209     1  0.0324      0.965 0.992 0.000 0.004 0.000 0.004
#> GSM587210     5  0.4535      0.606 0.024 0.000 0.288 0.004 0.684
#> GSM587211     1  0.2228      0.908 0.912 0.000 0.048 0.000 0.040
#> GSM587212     5  0.4904      0.722 0.176 0.000 0.080 0.012 0.732
#> GSM587213     1  0.0162      0.966 0.996 0.000 0.000 0.000 0.004
#> GSM587214     1  0.0404      0.965 0.988 0.000 0.000 0.000 0.012
#> GSM587215     1  0.1106      0.956 0.964 0.000 0.012 0.000 0.024
#> GSM587216     1  0.3730      0.573 0.712 0.000 0.000 0.000 0.288
#> GSM587217     1  0.0880      0.958 0.968 0.000 0.000 0.000 0.032
#> GSM587191     3  0.3934      0.732 0.000 0.016 0.740 0.000 0.244
#> GSM587192     5  0.2624      0.791 0.000 0.000 0.116 0.012 0.872
#> GSM587193     5  0.2260      0.793 0.028 0.000 0.000 0.064 0.908
#> GSM587194     5  0.1710      0.802 0.000 0.004 0.016 0.040 0.940
#> GSM587195     3  0.0693      0.864 0.000 0.008 0.980 0.000 0.012
#> GSM587196     3  0.0510      0.866 0.000 0.000 0.984 0.000 0.016
#> GSM587197     3  0.0609      0.860 0.000 0.020 0.980 0.000 0.000
#> GSM587198     3  0.0880      0.869 0.000 0.000 0.968 0.000 0.032
#> GSM587199     3  0.3210      0.770 0.000 0.000 0.788 0.000 0.212
#> GSM587200     3  0.3586      0.711 0.000 0.000 0.736 0.000 0.264
#> GSM587201     3  0.4199      0.759 0.068 0.000 0.772 0.000 0.160
#> GSM587202     3  0.0880      0.869 0.000 0.000 0.968 0.000 0.032
#> GSM198767     1  0.0000      0.966 1.000 0.000 0.000 0.000 0.000
#> GSM198769     1  0.0162      0.966 0.996 0.000 0.000 0.000 0.004
#> GSM198772     1  0.1753      0.929 0.936 0.000 0.032 0.000 0.032
#> GSM198773     1  0.0162      0.966 0.996 0.000 0.000 0.000 0.004
#> GSM198776     1  0.0609      0.962 0.980 0.000 0.000 0.000 0.020
#> GSM198778     5  0.4445      0.583 0.024 0.000 0.300 0.000 0.676
#> GSM198780     5  0.4903      0.731 0.164 0.000 0.088 0.012 0.736
#> GSM198781     1  0.0290      0.966 0.992 0.000 0.000 0.000 0.008
#> GSM198765     3  0.3949      0.666 0.000 0.004 0.696 0.000 0.300
#> GSM198766     5  0.2278      0.794 0.032 0.000 0.000 0.060 0.908
#> GSM198768     3  0.0404      0.867 0.000 0.000 0.988 0.000 0.012
#> GSM198770     3  0.0794      0.852 0.000 0.028 0.972 0.000 0.000
#> GSM198771     3  0.0880      0.869 0.000 0.000 0.968 0.000 0.032
#> GSM198774     5  0.2624      0.791 0.000 0.000 0.116 0.012 0.872
#> GSM198775     5  0.1710      0.802 0.000 0.004 0.016 0.040 0.940
#> GSM198777     3  0.0510      0.866 0.000 0.000 0.984 0.000 0.016
#> GSM198779     3  0.3074      0.786 0.000 0.000 0.804 0.000 0.196
#> GSM587218     4  0.0000      0.981 0.000 0.000 0.000 1.000 0.000
#> GSM587219     4  0.0000      0.981 0.000 0.000 0.000 1.000 0.000
#> GSM587220     4  0.0000      0.981 0.000 0.000 0.000 1.000 0.000
#> GSM587221     4  0.0000      0.981 0.000 0.000 0.000 1.000 0.000
#> GSM587222     4  0.0000      0.981 0.000 0.000 0.000 1.000 0.000
#> GSM587223     4  0.0000      0.981 0.000 0.000 0.000 1.000 0.000
#> GSM587224     4  0.0000      0.981 0.000 0.000 0.000 1.000 0.000
#> GSM587225     4  0.0000      0.981 0.000 0.000 0.000 1.000 0.000
#> GSM587226     4  0.0000      0.981 0.000 0.000 0.000 1.000 0.000
#> GSM587227     4  0.0000      0.981 0.000 0.000 0.000 1.000 0.000
#> GSM587228     4  0.0000      0.981 0.000 0.000 0.000 1.000 0.000
#> GSM587229     4  0.0000      0.981 0.000 0.000 0.000 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM587155     2  0.3428      0.469 0.000 0.696 0.000 0.000 0.000 0.304
#> GSM587156     6  0.4067      0.226 0.000 0.444 0.000 0.000 0.008 0.548
#> GSM587157     2  0.5410      0.229 0.000 0.576 0.248 0.000 0.000 0.176
#> GSM587158     2  0.0000      0.869 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587159     2  0.0000      0.869 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587160     2  0.0146      0.868 0.000 0.996 0.000 0.000 0.000 0.004
#> GSM587161     2  0.2416      0.727 0.000 0.844 0.000 0.000 0.000 0.156
#> GSM587162     2  0.0260      0.868 0.000 0.992 0.000 0.000 0.000 0.008
#> GSM587163     2  0.0260      0.868 0.000 0.992 0.000 0.000 0.000 0.008
#> GSM587164     2  0.3578      0.378 0.000 0.660 0.000 0.000 0.000 0.340
#> GSM587165     2  0.0632      0.862 0.000 0.976 0.000 0.000 0.000 0.024
#> GSM587166     6  0.4118      0.344 0.000 0.396 0.000 0.004 0.008 0.592
#> GSM587167     2  0.3737      0.215 0.000 0.608 0.000 0.000 0.000 0.392
#> GSM587168     2  0.0713      0.860 0.000 0.972 0.000 0.000 0.000 0.028
#> GSM587169     2  0.0260      0.868 0.000 0.992 0.000 0.000 0.000 0.008
#> GSM587170     2  0.3782      0.136 0.000 0.588 0.000 0.000 0.000 0.412
#> GSM587171     2  0.0000      0.869 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587172     2  0.0000      0.869 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587173     2  0.1082      0.850 0.000 0.956 0.004 0.000 0.000 0.040
#> GSM587174     2  0.0000      0.869 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587175     2  0.2826      0.736 0.000 0.844 0.028 0.000 0.000 0.128
#> GSM587176     2  0.0260      0.868 0.000 0.992 0.000 0.000 0.000 0.008
#> GSM587177     2  0.0547      0.864 0.000 0.980 0.000 0.000 0.000 0.020
#> GSM587178     2  0.0363      0.867 0.000 0.988 0.000 0.000 0.000 0.012
#> GSM587179     2  0.0260      0.868 0.000 0.992 0.000 0.000 0.000 0.008
#> GSM587180     2  0.0405      0.868 0.000 0.988 0.000 0.000 0.004 0.008
#> GSM587181     2  0.0000      0.869 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587182     2  0.0146      0.869 0.000 0.996 0.000 0.000 0.000 0.004
#> GSM587183     2  0.0632      0.862 0.000 0.976 0.000 0.000 0.000 0.024
#> GSM587184     2  0.0000      0.869 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587185     2  0.0363      0.866 0.000 0.988 0.000 0.000 0.000 0.012
#> GSM587186     2  0.1152      0.847 0.000 0.952 0.004 0.000 0.000 0.044
#> GSM587187     2  0.2905      0.743 0.000 0.852 0.084 0.000 0.000 0.064
#> GSM587188     2  0.4798      0.533 0.000 0.708 0.168 0.012 0.004 0.108
#> GSM587189     2  0.4330      0.503 0.000 0.696 0.236 0.000 0.000 0.068
#> GSM587190     4  0.4424      0.684 0.000 0.124 0.076 0.764 0.004 0.032
#> GSM587203     1  0.0000      0.842 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM587204     1  0.0458      0.838 0.984 0.000 0.000 0.000 0.016 0.000
#> GSM587205     1  0.0000      0.842 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM587206     1  0.0000      0.842 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM587207     1  0.0000      0.842 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM587208     1  0.0000      0.842 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM587209     1  0.3535      0.822 0.832 0.000 0.040 0.000 0.060 0.068
#> GSM587210     5  0.2971      0.663 0.028 0.000 0.076 0.000 0.864 0.032
#> GSM587211     1  0.7649      0.339 0.360 0.000 0.144 0.012 0.180 0.304
#> GSM587212     5  0.4813      0.554 0.052 0.000 0.052 0.012 0.740 0.144
#> GSM587213     1  0.4324      0.782 0.748 0.000 0.020 0.000 0.068 0.164
#> GSM587214     1  0.2231      0.837 0.900 0.000 0.004 0.000 0.068 0.028
#> GSM587215     1  0.5197      0.741 0.696 0.000 0.056 0.000 0.120 0.128
#> GSM587216     1  0.4884      0.271 0.488 0.000 0.004 0.000 0.460 0.048
#> GSM587217     1  0.3782      0.788 0.788 0.000 0.008 0.000 0.140 0.064
#> GSM587191     3  0.5439      0.325 0.000 0.000 0.472 0.000 0.408 0.120
#> GSM587192     5  0.2669      0.665 0.000 0.000 0.008 0.000 0.836 0.156
#> GSM587193     6  0.4625     -0.126 0.000 0.004 0.000 0.032 0.424 0.540
#> GSM587194     5  0.3240      0.580 0.000 0.000 0.000 0.004 0.752 0.244
#> GSM587195     3  0.2163      0.680 0.000 0.000 0.892 0.000 0.016 0.092
#> GSM587196     3  0.1498      0.695 0.000 0.000 0.940 0.000 0.028 0.032
#> GSM587197     3  0.1409      0.707 0.000 0.008 0.948 0.000 0.012 0.032
#> GSM587198     3  0.3325      0.711 0.000 0.000 0.820 0.000 0.096 0.084
#> GSM587199     3  0.5368      0.434 0.000 0.000 0.488 0.000 0.400 0.112
#> GSM587200     3  0.5585      0.367 0.000 0.000 0.444 0.000 0.416 0.140
#> GSM587201     3  0.6320      0.470 0.032 0.000 0.472 0.000 0.324 0.172
#> GSM587202     3  0.3274      0.711 0.000 0.000 0.824 0.000 0.080 0.096
#> GSM198767     1  0.0000      0.842 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM198769     1  0.2941      0.833 0.868 0.000 0.024 0.000 0.060 0.048
#> GSM198772     1  0.7389      0.401 0.400 0.000 0.112 0.008 0.188 0.292
#> GSM198773     1  0.3930      0.802 0.784 0.000 0.016 0.000 0.064 0.136
#> GSM198776     1  0.0260      0.841 0.992 0.000 0.000 0.000 0.008 0.000
#> GSM198778     5  0.2818      0.662 0.028 0.000 0.076 0.000 0.872 0.024
#> GSM198780     5  0.4812      0.555 0.048 0.000 0.056 0.012 0.740 0.144
#> GSM198781     1  0.2307      0.837 0.896 0.000 0.004 0.000 0.068 0.032
#> GSM198765     5  0.5387     -0.351 0.000 0.000 0.424 0.000 0.464 0.112
#> GSM198766     6  0.4520     -0.178 0.000 0.000 0.000 0.032 0.448 0.520
#> GSM198768     3  0.2301      0.675 0.000 0.000 0.884 0.000 0.020 0.096
#> GSM198770     3  0.1478      0.702 0.000 0.020 0.944 0.000 0.004 0.032
#> GSM198771     3  0.3563      0.706 0.000 0.000 0.800 0.000 0.108 0.092
#> GSM198774     5  0.2706      0.664 0.000 0.000 0.008 0.000 0.832 0.160
#> GSM198775     5  0.3265      0.576 0.000 0.000 0.000 0.004 0.748 0.248
#> GSM198777     3  0.1498      0.695 0.000 0.000 0.940 0.000 0.028 0.032
#> GSM198779     3  0.5374      0.462 0.000 0.000 0.504 0.000 0.380 0.116
#> GSM587218     4  0.0260      0.969 0.000 0.000 0.000 0.992 0.000 0.008
#> GSM587219     4  0.0146      0.971 0.000 0.000 0.000 0.996 0.000 0.004
#> GSM587220     4  0.0000      0.973 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM587221     4  0.0000      0.973 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM587222     4  0.0146      0.973 0.000 0.000 0.000 0.996 0.000 0.004
#> GSM587223     4  0.0000      0.973 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM587224     4  0.0000      0.973 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM587225     4  0.0363      0.970 0.000 0.000 0.000 0.988 0.000 0.012
#> GSM587226     4  0.0146      0.973 0.000 0.000 0.000 0.996 0.000 0.004
#> GSM587227     4  0.0363      0.970 0.000 0.000 0.000 0.988 0.000 0.012
#> GSM587228     4  0.0260      0.972 0.000 0.000 0.000 0.992 0.000 0.008
#> GSM587229     4  0.0363      0.970 0.000 0.000 0.000 0.988 0.000 0.012

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

consensus_heatmap(res, k = 2)

plot of chunk tab-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 specimen(p) k
#> MAD:NMF 92    4.01e-14 2
#> MAD:NMF 89    3.87e-26 3
#> MAD:NMF 88    1.85e-38 4
#> MAD:NMF 91    3.78e-39 5
#> MAD:NMF 74    2.34e-29 6

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


ATC:hclust**

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

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

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

res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#>   On a matrix with 51941 rows and 92 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 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-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.912           0.947       0.965         0.4663 0.541   0.541
#> 3 3 0.827           0.980       0.977         0.4072 0.791   0.614
#> 4 4 0.826           0.946       0.926         0.0522 0.980   0.940
#> 5 5 1.000           0.982       0.990         0.0927 0.934   0.789
#> 6 6 0.983           0.931       0.960         0.0203 0.987   0.948

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 5

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

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

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

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>           class entropy silhouette    p1    p2
#> GSM587155     2   0.000      1.000 0.000 1.000
#> GSM587156     2   0.000      1.000 0.000 1.000
#> GSM587157     2   0.000      1.000 0.000 1.000
#> GSM587158     2   0.000      1.000 0.000 1.000
#> GSM587159     2   0.000      1.000 0.000 1.000
#> GSM587160     2   0.000      1.000 0.000 1.000
#> GSM587161     2   0.000      1.000 0.000 1.000
#> GSM587162     2   0.000      1.000 0.000 1.000
#> GSM587163     2   0.000      1.000 0.000 1.000
#> GSM587164     2   0.000      1.000 0.000 1.000
#> GSM587165     2   0.000      1.000 0.000 1.000
#> GSM587166     2   0.000      1.000 0.000 1.000
#> GSM587167     2   0.000      1.000 0.000 1.000
#> GSM587168     2   0.000      1.000 0.000 1.000
#> GSM587169     2   0.000      1.000 0.000 1.000
#> GSM587170     2   0.000      1.000 0.000 1.000
#> GSM587171     2   0.000      1.000 0.000 1.000
#> GSM587172     2   0.000      1.000 0.000 1.000
#> GSM587173     2   0.000      1.000 0.000 1.000
#> GSM587174     2   0.000      1.000 0.000 1.000
#> GSM587175     2   0.000      1.000 0.000 1.000
#> GSM587176     2   0.000      1.000 0.000 1.000
#> GSM587177     2   0.000      1.000 0.000 1.000
#> GSM587178     2   0.000      1.000 0.000 1.000
#> GSM587179     2   0.000      1.000 0.000 1.000
#> GSM587180     2   0.000      1.000 0.000 1.000
#> GSM587181     2   0.000      1.000 0.000 1.000
#> GSM587182     2   0.000      1.000 0.000 1.000
#> GSM587183     2   0.000      1.000 0.000 1.000
#> GSM587184     2   0.000      1.000 0.000 1.000
#> GSM587185     2   0.000      1.000 0.000 1.000
#> GSM587186     2   0.000      1.000 0.000 1.000
#> GSM587187     1   0.814      0.753 0.748 0.252
#> GSM587188     1   0.814      0.753 0.748 0.252
#> GSM587189     1   0.814      0.753 0.748 0.252
#> GSM587190     1   0.788      0.775 0.764 0.236
#> GSM587203     1   0.000      0.946 1.000 0.000
#> GSM587204     1   0.000      0.946 1.000 0.000
#> GSM587205     1   0.000      0.946 1.000 0.000
#> GSM587206     1   0.000      0.946 1.000 0.000
#> GSM587207     1   0.000      0.946 1.000 0.000
#> GSM587208     1   0.000      0.946 1.000 0.000
#> GSM587209     1   0.000      0.946 1.000 0.000
#> GSM587210     1   0.000      0.946 1.000 0.000
#> GSM587211     1   0.000      0.946 1.000 0.000
#> GSM587212     1   0.000      0.946 1.000 0.000
#> GSM587213     1   0.000      0.946 1.000 0.000
#> GSM587214     1   0.000      0.946 1.000 0.000
#> GSM587215     1   0.000      0.946 1.000 0.000
#> GSM587216     1   0.000      0.946 1.000 0.000
#> GSM587217     1   0.000      0.946 1.000 0.000
#> GSM587191     1   0.430      0.921 0.912 0.088
#> GSM587192     1   0.430      0.921 0.912 0.088
#> GSM587193     1   0.430      0.921 0.912 0.088
#> GSM587194     1   0.706      0.829 0.808 0.192
#> GSM587195     1   0.430      0.921 0.912 0.088
#> GSM587196     1   0.430      0.921 0.912 0.088
#> GSM587197     1   0.430      0.921 0.912 0.088
#> GSM587198     1   0.430      0.921 0.912 0.088
#> GSM587199     1   0.706      0.829 0.808 0.192
#> GSM587200     1   0.358      0.928 0.932 0.068
#> GSM587201     1   0.358      0.928 0.932 0.068
#> GSM587202     1   0.358      0.928 0.932 0.068
#> GSM198767     1   0.000      0.946 1.000 0.000
#> GSM198769     1   0.000      0.946 1.000 0.000
#> GSM198772     1   0.000      0.946 1.000 0.000
#> GSM198773     1   0.000      0.946 1.000 0.000
#> GSM198776     1   0.000      0.946 1.000 0.000
#> GSM198778     1   0.000      0.946 1.000 0.000
#> GSM198780     1   0.000      0.946 1.000 0.000
#> GSM198781     1   0.000      0.946 1.000 0.000
#> GSM198765     1   0.430      0.921 0.912 0.088
#> GSM198766     1   0.430      0.921 0.912 0.088
#> GSM198768     1   0.430      0.921 0.912 0.088
#> GSM198770     1   0.430      0.921 0.912 0.088
#> GSM198771     1   0.430      0.921 0.912 0.088
#> GSM198774     1   0.430      0.921 0.912 0.088
#> GSM198775     1   0.706      0.829 0.808 0.192
#> GSM198777     1   0.430      0.921 0.912 0.088
#> GSM198779     1   0.706      0.829 0.808 0.192
#> GSM587218     1   0.000      0.946 1.000 0.000
#> GSM587219     1   0.000      0.946 1.000 0.000
#> GSM587220     1   0.000      0.946 1.000 0.000
#> GSM587221     1   0.000      0.946 1.000 0.000
#> GSM587222     1   0.000      0.946 1.000 0.000
#> GSM587223     1   0.000      0.946 1.000 0.000
#> GSM587224     1   0.000      0.946 1.000 0.000
#> GSM587225     1   0.000      0.946 1.000 0.000
#> GSM587226     1   0.000      0.946 1.000 0.000
#> GSM587227     1   0.000      0.946 1.000 0.000
#> GSM587228     1   0.000      0.946 1.000 0.000
#> GSM587229     1   0.000      0.946 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
#> GSM587155     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587156     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587157     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587158     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587159     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587160     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587161     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587162     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587163     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587164     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587165     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587166     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587167     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587168     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587169     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587170     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587171     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587172     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587173     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587174     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587175     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587176     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587177     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587178     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587179     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587180     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587181     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587182     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587183     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587184     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587185     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587186     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587187     3  0.2066      0.880 0.000 0.060 0.940
#> GSM587188     3  0.2066      0.880 0.000 0.060 0.940
#> GSM587189     3  0.2066      0.880 0.000 0.060 0.940
#> GSM587190     3  0.1643      0.890 0.000 0.044 0.956
#> GSM587203     1  0.0000      0.997 1.000 0.000 0.000
#> GSM587204     1  0.0747      0.985 0.984 0.000 0.016
#> GSM587205     1  0.0000      0.997 1.000 0.000 0.000
#> GSM587206     1  0.0000      0.997 1.000 0.000 0.000
#> GSM587207     1  0.0000      0.997 1.000 0.000 0.000
#> GSM587208     1  0.0000      0.997 1.000 0.000 0.000
#> GSM587209     1  0.0000      0.997 1.000 0.000 0.000
#> GSM587210     1  0.0747      0.985 0.984 0.000 0.016
#> GSM587211     1  0.0000      0.997 1.000 0.000 0.000
#> GSM587212     1  0.0747      0.985 0.984 0.000 0.016
#> GSM587213     1  0.0000      0.997 1.000 0.000 0.000
#> GSM587214     1  0.0000      0.997 1.000 0.000 0.000
#> GSM587215     1  0.0000      0.997 1.000 0.000 0.000
#> GSM587216     1  0.0000      0.997 1.000 0.000 0.000
#> GSM587217     1  0.0000      0.997 1.000 0.000 0.000
#> GSM587191     3  0.3038      0.953 0.104 0.000 0.896
#> GSM587192     3  0.3038      0.953 0.104 0.000 0.896
#> GSM587193     3  0.3038      0.953 0.104 0.000 0.896
#> GSM587194     3  0.0000      0.910 0.000 0.000 1.000
#> GSM587195     3  0.3038      0.953 0.104 0.000 0.896
#> GSM587196     3  0.3038      0.953 0.104 0.000 0.896
#> GSM587197     3  0.3038      0.953 0.104 0.000 0.896
#> GSM587198     3  0.3038      0.953 0.104 0.000 0.896
#> GSM587199     3  0.0000      0.910 0.000 0.000 1.000
#> GSM587200     3  0.3412      0.937 0.124 0.000 0.876
#> GSM587201     3  0.3412      0.937 0.124 0.000 0.876
#> GSM587202     3  0.3412      0.937 0.124 0.000 0.876
#> GSM198767     1  0.0000      0.997 1.000 0.000 0.000
#> GSM198769     1  0.0000      0.997 1.000 0.000 0.000
#> GSM198772     1  0.0000      0.997 1.000 0.000 0.000
#> GSM198773     1  0.0000      0.997 1.000 0.000 0.000
#> GSM198776     1  0.0747      0.985 0.984 0.000 0.016
#> GSM198778     1  0.0747      0.985 0.984 0.000 0.016
#> GSM198780     1  0.0747      0.985 0.984 0.000 0.016
#> GSM198781     1  0.0000      0.997 1.000 0.000 0.000
#> GSM198765     3  0.3038      0.953 0.104 0.000 0.896
#> GSM198766     3  0.3038      0.953 0.104 0.000 0.896
#> GSM198768     3  0.3038      0.953 0.104 0.000 0.896
#> GSM198770     3  0.3038      0.953 0.104 0.000 0.896
#> GSM198771     3  0.3038      0.953 0.104 0.000 0.896
#> GSM198774     3  0.3038      0.953 0.104 0.000 0.896
#> GSM198775     3  0.0000      0.910 0.000 0.000 1.000
#> GSM198777     3  0.3038      0.953 0.104 0.000 0.896
#> GSM198779     3  0.0000      0.910 0.000 0.000 1.000
#> GSM587218     1  0.0000      0.997 1.000 0.000 0.000
#> GSM587219     1  0.0000      0.997 1.000 0.000 0.000
#> GSM587220     1  0.0000      0.997 1.000 0.000 0.000
#> GSM587221     1  0.0000      0.997 1.000 0.000 0.000
#> GSM587222     1  0.0000      0.997 1.000 0.000 0.000
#> GSM587223     1  0.0000      0.997 1.000 0.000 0.000
#> GSM587224     1  0.0000      0.997 1.000 0.000 0.000
#> GSM587225     1  0.0000      0.997 1.000 0.000 0.000
#> GSM587226     1  0.0000      0.997 1.000 0.000 0.000
#> GSM587227     1  0.0000      0.997 1.000 0.000 0.000
#> GSM587228     1  0.0000      0.997 1.000 0.000 0.000
#> GSM587229     1  0.0000      0.997 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
#> GSM587155     2  0.0000      1.000 0.000 1.00 0.000 0.000
#> GSM587156     2  0.0000      1.000 0.000 1.00 0.000 0.000
#> GSM587157     2  0.0000      1.000 0.000 1.00 0.000 0.000
#> GSM587158     2  0.0000      1.000 0.000 1.00 0.000 0.000
#> GSM587159     2  0.0000      1.000 0.000 1.00 0.000 0.000
#> GSM587160     2  0.0000      1.000 0.000 1.00 0.000 0.000
#> GSM587161     2  0.0000      1.000 0.000 1.00 0.000 0.000
#> GSM587162     2  0.0000      1.000 0.000 1.00 0.000 0.000
#> GSM587163     2  0.0000      1.000 0.000 1.00 0.000 0.000
#> GSM587164     2  0.0000      1.000 0.000 1.00 0.000 0.000
#> GSM587165     2  0.0000      1.000 0.000 1.00 0.000 0.000
#> GSM587166     2  0.0000      1.000 0.000 1.00 0.000 0.000
#> GSM587167     2  0.0000      1.000 0.000 1.00 0.000 0.000
#> GSM587168     2  0.0000      1.000 0.000 1.00 0.000 0.000
#> GSM587169     2  0.0000      1.000 0.000 1.00 0.000 0.000
#> GSM587170     2  0.0000      1.000 0.000 1.00 0.000 0.000
#> GSM587171     2  0.0000      1.000 0.000 1.00 0.000 0.000
#> GSM587172     2  0.0000      1.000 0.000 1.00 0.000 0.000
#> GSM587173     2  0.0000      1.000 0.000 1.00 0.000 0.000
#> GSM587174     2  0.0000      1.000 0.000 1.00 0.000 0.000
#> GSM587175     2  0.0000      1.000 0.000 1.00 0.000 0.000
#> GSM587176     2  0.0000      1.000 0.000 1.00 0.000 0.000
#> GSM587177     2  0.0000      1.000 0.000 1.00 0.000 0.000
#> GSM587178     2  0.0000      1.000 0.000 1.00 0.000 0.000
#> GSM587179     2  0.0000      1.000 0.000 1.00 0.000 0.000
#> GSM587180     2  0.0000      1.000 0.000 1.00 0.000 0.000
#> GSM587181     2  0.0000      1.000 0.000 1.00 0.000 0.000
#> GSM587182     2  0.0000      1.000 0.000 1.00 0.000 0.000
#> GSM587183     2  0.0000      1.000 0.000 1.00 0.000 0.000
#> GSM587184     2  0.0000      1.000 0.000 1.00 0.000 0.000
#> GSM587185     2  0.0000      1.000 0.000 1.00 0.000 0.000
#> GSM587186     2  0.0000      1.000 0.000 1.00 0.000 0.000
#> GSM587187     4  0.2751      0.994 0.000 0.04 0.056 0.904
#> GSM587188     4  0.2751      0.994 0.000 0.04 0.056 0.904
#> GSM587189     4  0.2751      0.994 0.000 0.04 0.056 0.904
#> GSM587190     4  0.3056      0.982 0.000 0.04 0.072 0.888
#> GSM587203     1  0.2408      0.922 0.896 0.00 0.104 0.000
#> GSM587204     1  0.2647      0.916 0.880 0.00 0.120 0.000
#> GSM587205     1  0.2408      0.922 0.896 0.00 0.104 0.000
#> GSM587206     1  0.2408      0.922 0.896 0.00 0.104 0.000
#> GSM587207     1  0.2408      0.922 0.896 0.00 0.104 0.000
#> GSM587208     1  0.2408      0.922 0.896 0.00 0.104 0.000
#> GSM587209     1  0.2408      0.922 0.896 0.00 0.104 0.000
#> GSM587210     1  0.2647      0.916 0.880 0.00 0.120 0.000
#> GSM587211     1  0.2408      0.922 0.896 0.00 0.104 0.000
#> GSM587212     1  0.2647      0.916 0.880 0.00 0.120 0.000
#> GSM587213     1  0.2408      0.922 0.896 0.00 0.104 0.000
#> GSM587214     1  0.2408      0.922 0.896 0.00 0.104 0.000
#> GSM587215     1  0.2408      0.922 0.896 0.00 0.104 0.000
#> GSM587216     1  0.2408      0.922 0.896 0.00 0.104 0.000
#> GSM587217     1  0.2408      0.922 0.896 0.00 0.104 0.000
#> GSM587191     3  0.0000      0.963 0.000 0.00 1.000 0.000
#> GSM587192     3  0.0000      0.963 0.000 0.00 1.000 0.000
#> GSM587193     3  0.0000      0.963 0.000 0.00 1.000 0.000
#> GSM587194     3  0.2469      0.847 0.000 0.00 0.892 0.108
#> GSM587195     3  0.0000      0.963 0.000 0.00 1.000 0.000
#> GSM587196     3  0.0000      0.963 0.000 0.00 1.000 0.000
#> GSM587197     3  0.0000      0.963 0.000 0.00 1.000 0.000
#> GSM587198     3  0.0000      0.963 0.000 0.00 1.000 0.000
#> GSM587199     3  0.2469      0.847 0.000 0.00 0.892 0.108
#> GSM587200     3  0.0707      0.943 0.020 0.00 0.980 0.000
#> GSM587201     3  0.0707      0.943 0.020 0.00 0.980 0.000
#> GSM587202     3  0.0707      0.943 0.020 0.00 0.980 0.000
#> GSM198767     1  0.2408      0.922 0.896 0.00 0.104 0.000
#> GSM198769     1  0.2408      0.922 0.896 0.00 0.104 0.000
#> GSM198772     1  0.2408      0.922 0.896 0.00 0.104 0.000
#> GSM198773     1  0.2408      0.922 0.896 0.00 0.104 0.000
#> GSM198776     1  0.2647      0.916 0.880 0.00 0.120 0.000
#> GSM198778     1  0.2647      0.916 0.880 0.00 0.120 0.000
#> GSM198780     1  0.2647      0.916 0.880 0.00 0.120 0.000
#> GSM198781     1  0.2408      0.922 0.896 0.00 0.104 0.000
#> GSM198765     3  0.0000      0.963 0.000 0.00 1.000 0.000
#> GSM198766     3  0.0000      0.963 0.000 0.00 1.000 0.000
#> GSM198768     3  0.0000      0.963 0.000 0.00 1.000 0.000
#> GSM198770     3  0.0000      0.963 0.000 0.00 1.000 0.000
#> GSM198771     3  0.0000      0.963 0.000 0.00 1.000 0.000
#> GSM198774     3  0.0000      0.963 0.000 0.00 1.000 0.000
#> GSM198775     3  0.2469      0.847 0.000 0.00 0.892 0.108
#> GSM198777     3  0.0000      0.963 0.000 0.00 1.000 0.000
#> GSM198779     3  0.2469      0.847 0.000 0.00 0.892 0.108
#> GSM587218     1  0.2281      0.848 0.904 0.00 0.000 0.096
#> GSM587219     1  0.2281      0.848 0.904 0.00 0.000 0.096
#> GSM587220     1  0.2281      0.848 0.904 0.00 0.000 0.096
#> GSM587221     1  0.2281      0.848 0.904 0.00 0.000 0.096
#> GSM587222     1  0.2281      0.848 0.904 0.00 0.000 0.096
#> GSM587223     1  0.2281      0.848 0.904 0.00 0.000 0.096
#> GSM587224     1  0.2281      0.848 0.904 0.00 0.000 0.096
#> GSM587225     1  0.2281      0.848 0.904 0.00 0.000 0.096
#> GSM587226     1  0.2281      0.848 0.904 0.00 0.000 0.096
#> GSM587227     1  0.2281      0.848 0.904 0.00 0.000 0.096
#> GSM587228     1  0.2281      0.848 0.904 0.00 0.000 0.096
#> GSM587229     1  0.2281      0.848 0.904 0.00 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
#> GSM587155     2  0.0000      1.000 0.000  1 0.000 0.000 0.000
#> GSM587156     2  0.0000      1.000 0.000  1 0.000 0.000 0.000
#> GSM587157     2  0.0000      1.000 0.000  1 0.000 0.000 0.000
#> GSM587158     2  0.0000      1.000 0.000  1 0.000 0.000 0.000
#> GSM587159     2  0.0000      1.000 0.000  1 0.000 0.000 0.000
#> GSM587160     2  0.0000      1.000 0.000  1 0.000 0.000 0.000
#> GSM587161     2  0.0000      1.000 0.000  1 0.000 0.000 0.000
#> GSM587162     2  0.0000      1.000 0.000  1 0.000 0.000 0.000
#> GSM587163     2  0.0000      1.000 0.000  1 0.000 0.000 0.000
#> GSM587164     2  0.0000      1.000 0.000  1 0.000 0.000 0.000
#> GSM587165     2  0.0000      1.000 0.000  1 0.000 0.000 0.000
#> GSM587166     2  0.0000      1.000 0.000  1 0.000 0.000 0.000
#> GSM587167     2  0.0000      1.000 0.000  1 0.000 0.000 0.000
#> GSM587168     2  0.0000      1.000 0.000  1 0.000 0.000 0.000
#> GSM587169     2  0.0000      1.000 0.000  1 0.000 0.000 0.000
#> GSM587170     2  0.0000      1.000 0.000  1 0.000 0.000 0.000
#> GSM587171     2  0.0000      1.000 0.000  1 0.000 0.000 0.000
#> GSM587172     2  0.0000      1.000 0.000  1 0.000 0.000 0.000
#> GSM587173     2  0.0000      1.000 0.000  1 0.000 0.000 0.000
#> GSM587174     2  0.0000      1.000 0.000  1 0.000 0.000 0.000
#> GSM587175     2  0.0000      1.000 0.000  1 0.000 0.000 0.000
#> GSM587176     2  0.0000      1.000 0.000  1 0.000 0.000 0.000
#> GSM587177     2  0.0000      1.000 0.000  1 0.000 0.000 0.000
#> GSM587178     2  0.0000      1.000 0.000  1 0.000 0.000 0.000
#> GSM587179     2  0.0000      1.000 0.000  1 0.000 0.000 0.000
#> GSM587180     2  0.0000      1.000 0.000  1 0.000 0.000 0.000
#> GSM587181     2  0.0000      1.000 0.000  1 0.000 0.000 0.000
#> GSM587182     2  0.0000      1.000 0.000  1 0.000 0.000 0.000
#> GSM587183     2  0.0000      1.000 0.000  1 0.000 0.000 0.000
#> GSM587184     2  0.0000      1.000 0.000  1 0.000 0.000 0.000
#> GSM587185     2  0.0000      1.000 0.000  1 0.000 0.000 0.000
#> GSM587186     2  0.0000      1.000 0.000  1 0.000 0.000 0.000
#> GSM587187     5  0.0162      0.993 0.000  0 0.004 0.000 0.996
#> GSM587188     5  0.0162      0.993 0.000  0 0.004 0.000 0.996
#> GSM587189     5  0.0162      0.993 0.000  0 0.004 0.000 0.996
#> GSM587190     5  0.0609      0.980 0.000  0 0.020 0.000 0.980
#> GSM587203     1  0.0000      0.993 1.000  0 0.000 0.000 0.000
#> GSM587204     1  0.0671      0.982 0.980  0 0.016 0.004 0.000
#> GSM587205     1  0.0000      0.993 1.000  0 0.000 0.000 0.000
#> GSM587206     1  0.0000      0.993 1.000  0 0.000 0.000 0.000
#> GSM587207     1  0.0000      0.993 1.000  0 0.000 0.000 0.000
#> GSM587208     1  0.0000      0.993 1.000  0 0.000 0.000 0.000
#> GSM587209     1  0.0000      0.993 1.000  0 0.000 0.000 0.000
#> GSM587210     1  0.0671      0.982 0.980  0 0.016 0.004 0.000
#> GSM587211     1  0.0000      0.993 1.000  0 0.000 0.000 0.000
#> GSM587212     1  0.0671      0.982 0.980  0 0.016 0.004 0.000
#> GSM587213     1  0.0000      0.993 1.000  0 0.000 0.000 0.000
#> GSM587214     1  0.0000      0.993 1.000  0 0.000 0.000 0.000
#> GSM587215     1  0.0000      0.993 1.000  0 0.000 0.000 0.000
#> GSM587216     1  0.0162      0.991 0.996  0 0.000 0.004 0.000
#> GSM587217     1  0.0162      0.991 0.996  0 0.000 0.004 0.000
#> GSM587191     3  0.0000      0.973 0.000  0 1.000 0.000 0.000
#> GSM587192     3  0.0000      0.973 0.000  0 1.000 0.000 0.000
#> GSM587193     3  0.0000      0.973 0.000  0 1.000 0.000 0.000
#> GSM587194     3  0.2179      0.892 0.000  0 0.888 0.000 0.112
#> GSM587195     3  0.0000      0.973 0.000  0 1.000 0.000 0.000
#> GSM587196     3  0.0000      0.973 0.000  0 1.000 0.000 0.000
#> GSM587197     3  0.0000      0.973 0.000  0 1.000 0.000 0.000
#> GSM587198     3  0.0000      0.973 0.000  0 1.000 0.000 0.000
#> GSM587199     3  0.2179      0.892 0.000  0 0.888 0.000 0.112
#> GSM587200     3  0.0671      0.959 0.016  0 0.980 0.000 0.004
#> GSM587201     3  0.0671      0.959 0.016  0 0.980 0.000 0.004
#> GSM587202     3  0.0671      0.959 0.016  0 0.980 0.000 0.004
#> GSM198767     1  0.0000      0.993 1.000  0 0.000 0.000 0.000
#> GSM198769     1  0.0000      0.993 1.000  0 0.000 0.000 0.000
#> GSM198772     1  0.0000      0.993 1.000  0 0.000 0.000 0.000
#> GSM198773     1  0.0000      0.993 1.000  0 0.000 0.000 0.000
#> GSM198776     1  0.0671      0.982 0.980  0 0.016 0.004 0.000
#> GSM198778     1  0.0671      0.982 0.980  0 0.016 0.004 0.000
#> GSM198780     1  0.0671      0.982 0.980  0 0.016 0.004 0.000
#> GSM198781     1  0.0000      0.993 1.000  0 0.000 0.000 0.000
#> GSM198765     3  0.0000      0.973 0.000  0 1.000 0.000 0.000
#> GSM198766     3  0.0000      0.973 0.000  0 1.000 0.000 0.000
#> GSM198768     3  0.0000      0.973 0.000  0 1.000 0.000 0.000
#> GSM198770     3  0.0000      0.973 0.000  0 1.000 0.000 0.000
#> GSM198771     3  0.0000      0.973 0.000  0 1.000 0.000 0.000
#> GSM198774     3  0.0000      0.973 0.000  0 1.000 0.000 0.000
#> GSM198775     3  0.2179      0.892 0.000  0 0.888 0.000 0.112
#> GSM198777     3  0.0000      0.973 0.000  0 1.000 0.000 0.000
#> GSM198779     3  0.2179      0.892 0.000  0 0.888 0.000 0.112
#> GSM587218     4  0.0000      0.970 0.000  0 0.000 1.000 0.000
#> GSM587219     4  0.0000      0.970 0.000  0 0.000 1.000 0.000
#> GSM587220     4  0.0000      0.970 0.000  0 0.000 1.000 0.000
#> GSM587221     4  0.0000      0.970 0.000  0 0.000 1.000 0.000
#> GSM587222     4  0.0000      0.970 0.000  0 0.000 1.000 0.000
#> GSM587223     4  0.0000      0.970 0.000  0 0.000 1.000 0.000
#> GSM587224     4  0.0000      0.970 0.000  0 0.000 1.000 0.000
#> GSM587225     4  0.1671      0.907 0.076  0 0.000 0.924 0.000
#> GSM587226     4  0.0000      0.970 0.000  0 0.000 1.000 0.000
#> GSM587227     4  0.1197      0.943 0.048  0 0.000 0.952 0.000
#> GSM587228     4  0.1197      0.943 0.048  0 0.000 0.952 0.000
#> GSM587229     4  0.1197      0.943 0.048  0 0.000 0.952 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
#> GSM587155     2  0.0000      0.995 0.000 1.00 0.000 0.000 0.000 0.000
#> GSM587156     2  0.0000      0.995 0.000 1.00 0.000 0.000 0.000 0.000
#> GSM587157     2  0.0000      0.995 0.000 1.00 0.000 0.000 0.000 0.000
#> GSM587158     2  0.0000      0.995 0.000 1.00 0.000 0.000 0.000 0.000
#> GSM587159     2  0.0000      0.995 0.000 1.00 0.000 0.000 0.000 0.000
#> GSM587160     2  0.0000      0.995 0.000 1.00 0.000 0.000 0.000 0.000
#> GSM587161     2  0.0000      0.995 0.000 1.00 0.000 0.000 0.000 0.000
#> GSM587162     2  0.0000      0.995 0.000 1.00 0.000 0.000 0.000 0.000
#> GSM587163     2  0.0000      0.995 0.000 1.00 0.000 0.000 0.000 0.000
#> GSM587164     2  0.0000      0.995 0.000 1.00 0.000 0.000 0.000 0.000
#> GSM587165     2  0.0000      0.995 0.000 1.00 0.000 0.000 0.000 0.000
#> GSM587166     2  0.0000      0.995 0.000 1.00 0.000 0.000 0.000 0.000
#> GSM587167     2  0.0000      0.995 0.000 1.00 0.000 0.000 0.000 0.000
#> GSM587168     2  0.0000      0.995 0.000 1.00 0.000 0.000 0.000 0.000
#> GSM587169     2  0.0000      0.995 0.000 1.00 0.000 0.000 0.000 0.000
#> GSM587170     2  0.0000      0.995 0.000 1.00 0.000 0.000 0.000 0.000
#> GSM587171     2  0.0000      0.995 0.000 1.00 0.000 0.000 0.000 0.000
#> GSM587172     2  0.0000      0.995 0.000 1.00 0.000 0.000 0.000 0.000
#> GSM587173     2  0.0000      0.995 0.000 1.00 0.000 0.000 0.000 0.000
#> GSM587174     2  0.0000      0.995 0.000 1.00 0.000 0.000 0.000 0.000
#> GSM587175     2  0.0000      0.995 0.000 1.00 0.000 0.000 0.000 0.000
#> GSM587176     2  0.0000      0.995 0.000 1.00 0.000 0.000 0.000 0.000
#> GSM587177     2  0.0000      0.995 0.000 1.00 0.000 0.000 0.000 0.000
#> GSM587178     2  0.0000      0.995 0.000 1.00 0.000 0.000 0.000 0.000
#> GSM587179     2  0.0000      0.995 0.000 1.00 0.000 0.000 0.000 0.000
#> GSM587180     2  0.0000      0.995 0.000 1.00 0.000 0.000 0.000 0.000
#> GSM587181     2  0.0000      0.995 0.000 1.00 0.000 0.000 0.000 0.000
#> GSM587182     2  0.0000      0.995 0.000 1.00 0.000 0.000 0.000 0.000
#> GSM587183     2  0.0937      0.965 0.000 0.96 0.000 0.000 0.000 0.040
#> GSM587184     2  0.0937      0.965 0.000 0.96 0.000 0.000 0.000 0.040
#> GSM587185     2  0.0937      0.965 0.000 0.96 0.000 0.000 0.000 0.040
#> GSM587186     2  0.0937      0.965 0.000 0.96 0.000 0.000 0.000 0.040
#> GSM587187     5  0.0000      0.992 0.000 0.00 0.000 0.000 1.000 0.000
#> GSM587188     5  0.0000      0.992 0.000 0.00 0.000 0.000 1.000 0.000
#> GSM587189     5  0.0000      0.992 0.000 0.00 0.000 0.000 1.000 0.000
#> GSM587190     5  0.0508      0.975 0.000 0.00 0.012 0.000 0.984 0.004
#> GSM587203     1  0.0000      0.994 1.000 0.00 0.000 0.000 0.000 0.000
#> GSM587204     1  0.0603      0.985 0.980 0.00 0.016 0.004 0.000 0.000
#> GSM587205     1  0.0000      0.994 1.000 0.00 0.000 0.000 0.000 0.000
#> GSM587206     1  0.0000      0.994 1.000 0.00 0.000 0.000 0.000 0.000
#> GSM587207     1  0.0000      0.994 1.000 0.00 0.000 0.000 0.000 0.000
#> GSM587208     1  0.0000      0.994 1.000 0.00 0.000 0.000 0.000 0.000
#> GSM587209     1  0.0000      0.994 1.000 0.00 0.000 0.000 0.000 0.000
#> GSM587210     1  0.0603      0.985 0.980 0.00 0.016 0.004 0.000 0.000
#> GSM587211     1  0.0000      0.994 1.000 0.00 0.000 0.000 0.000 0.000
#> GSM587212     1  0.0603      0.985 0.980 0.00 0.016 0.004 0.000 0.000
#> GSM587213     1  0.0000      0.994 1.000 0.00 0.000 0.000 0.000 0.000
#> GSM587214     1  0.0000      0.994 1.000 0.00 0.000 0.000 0.000 0.000
#> GSM587215     1  0.0000      0.994 1.000 0.00 0.000 0.000 0.000 0.000
#> GSM587216     1  0.0146      0.992 0.996 0.00 0.000 0.004 0.000 0.000
#> GSM587217     1  0.0146      0.992 0.996 0.00 0.000 0.004 0.000 0.000
#> GSM587191     3  0.3515      0.812 0.000 0.00 0.676 0.000 0.000 0.324
#> GSM587192     3  0.3515      0.812 0.000 0.00 0.676 0.000 0.000 0.324
#> GSM587193     3  0.3515      0.812 0.000 0.00 0.676 0.000 0.000 0.324
#> GSM587194     3  0.1910      0.401 0.000 0.00 0.892 0.000 0.108 0.000
#> GSM587195     3  0.3515      0.812 0.000 0.00 0.676 0.000 0.000 0.324
#> GSM587196     3  0.3515      0.812 0.000 0.00 0.676 0.000 0.000 0.324
#> GSM587197     3  0.3515      0.812 0.000 0.00 0.676 0.000 0.000 0.324
#> GSM587198     3  0.3828      0.641 0.000 0.00 0.560 0.000 0.000 0.440
#> GSM587199     3  0.1910      0.401 0.000 0.00 0.892 0.000 0.108 0.000
#> GSM587200     6  0.0937      1.000 0.000 0.00 0.040 0.000 0.000 0.960
#> GSM587201     6  0.0937      1.000 0.000 0.00 0.040 0.000 0.000 0.960
#> GSM587202     6  0.0937      1.000 0.000 0.00 0.040 0.000 0.000 0.960
#> GSM198767     1  0.0000      0.994 1.000 0.00 0.000 0.000 0.000 0.000
#> GSM198769     1  0.0000      0.994 1.000 0.00 0.000 0.000 0.000 0.000
#> GSM198772     1  0.0000      0.994 1.000 0.00 0.000 0.000 0.000 0.000
#> GSM198773     1  0.0000      0.994 1.000 0.00 0.000 0.000 0.000 0.000
#> GSM198776     1  0.0603      0.985 0.980 0.00 0.016 0.004 0.000 0.000
#> GSM198778     1  0.0603      0.985 0.980 0.00 0.016 0.004 0.000 0.000
#> GSM198780     1  0.0603      0.985 0.980 0.00 0.016 0.004 0.000 0.000
#> GSM198781     1  0.0000      0.994 1.000 0.00 0.000 0.000 0.000 0.000
#> GSM198765     3  0.3515      0.812 0.000 0.00 0.676 0.000 0.000 0.324
#> GSM198766     3  0.3515      0.812 0.000 0.00 0.676 0.000 0.000 0.324
#> GSM198768     3  0.3515      0.812 0.000 0.00 0.676 0.000 0.000 0.324
#> GSM198770     3  0.3515      0.812 0.000 0.00 0.676 0.000 0.000 0.324
#> GSM198771     3  0.3828      0.641 0.000 0.00 0.560 0.000 0.000 0.440
#> GSM198774     3  0.3515      0.812 0.000 0.00 0.676 0.000 0.000 0.324
#> GSM198775     3  0.1910      0.401 0.000 0.00 0.892 0.000 0.108 0.000
#> GSM198777     3  0.3515      0.812 0.000 0.00 0.676 0.000 0.000 0.324
#> GSM198779     3  0.1910      0.401 0.000 0.00 0.892 0.000 0.108 0.000
#> GSM587218     4  0.0000      0.970 0.000 0.00 0.000 1.000 0.000 0.000
#> GSM587219     4  0.0000      0.970 0.000 0.00 0.000 1.000 0.000 0.000
#> GSM587220     4  0.0000      0.970 0.000 0.00 0.000 1.000 0.000 0.000
#> GSM587221     4  0.0000      0.970 0.000 0.00 0.000 1.000 0.000 0.000
#> GSM587222     4  0.0000      0.970 0.000 0.00 0.000 1.000 0.000 0.000
#> GSM587223     4  0.0000      0.970 0.000 0.00 0.000 1.000 0.000 0.000
#> GSM587224     4  0.0000      0.970 0.000 0.00 0.000 1.000 0.000 0.000
#> GSM587225     4  0.1501      0.907 0.076 0.00 0.000 0.924 0.000 0.000
#> GSM587226     4  0.0000      0.970 0.000 0.00 0.000 1.000 0.000 0.000
#> GSM587227     4  0.1075      0.943 0.048 0.00 0.000 0.952 0.000 0.000
#> GSM587228     4  0.1075      0.943 0.048 0.00 0.000 0.952 0.000 0.000
#> GSM587229     4  0.1075      0.943 0.048 0.00 0.000 0.952 0.000 0.000

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

consensus_heatmap(res, k = 2)

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

consensus_heatmap(res, k = 3)

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

consensus_heatmap(res, k = 4)

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

consensus_heatmap(res, k = 5)

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

consensus_heatmap(res, k = 6)

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

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

membership_heatmap(res, k = 2)

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

membership_heatmap(res, k = 3)

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

membership_heatmap(res, k = 4)

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

membership_heatmap(res, k = 5)

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

membership_heatmap(res, k = 6)

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

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

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

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

get_signatures(res, k = 3)

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

get_signatures(res, k = 4)

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

get_signatures(res, k = 5)

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

get_signatures(res, k = 6)

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

Signature heatmaps where rows are not scaled:

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

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

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

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

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

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

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

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

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

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

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk ATC-hclust-signature_compare

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

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

An example of the output of tb is:

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

The columns in tb are:

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

UMAP plot which shows how samples are separated.

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

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

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

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

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

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

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

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

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

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

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk ATC-hclust-collect-classes

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

test_to_known_factors(res)
#>             n specimen(p) k
#> ATC:hclust 92    1.16e-17 2
#> ATC:hclust 92    6.44e-33 3
#> ATC:hclust 92    4.04e-48 4
#> ATC:hclust 92    2.68e-63 5
#> ATC:hclust 88    2.84e-59 6

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


ATC:kmeans**

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

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

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

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

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

collect_plots(res)

plot of chunk ATC-kmeans-collect-plots

The plots are:

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

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

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

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

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 1.000           1.000       1.000         0.4771 0.523   0.523
#> 3 3 0.803           0.945       0.947         0.3769 0.777   0.587
#> 4 4 0.869           0.873       0.867         0.0914 0.912   0.744
#> 5 5 0.761           0.823       0.812         0.0526 0.978   0.921
#> 6 6 0.742           0.766       0.808         0.0421 0.955   0.831

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
#> GSM587155     2       0          1  0  1
#> GSM587156     2       0          1  0  1
#> GSM587157     2       0          1  0  1
#> GSM587158     2       0          1  0  1
#> GSM587159     2       0          1  0  1
#> GSM587160     2       0          1  0  1
#> GSM587161     2       0          1  0  1
#> GSM587162     2       0          1  0  1
#> GSM587163     2       0          1  0  1
#> GSM587164     2       0          1  0  1
#> GSM587165     2       0          1  0  1
#> GSM587166     2       0          1  0  1
#> GSM587167     2       0          1  0  1
#> GSM587168     2       0          1  0  1
#> GSM587169     2       0          1  0  1
#> GSM587170     2       0          1  0  1
#> GSM587171     2       0          1  0  1
#> GSM587172     2       0          1  0  1
#> GSM587173     2       0          1  0  1
#> GSM587174     2       0          1  0  1
#> GSM587175     2       0          1  0  1
#> GSM587176     2       0          1  0  1
#> GSM587177     2       0          1  0  1
#> GSM587178     2       0          1  0  1
#> GSM587179     2       0          1  0  1
#> GSM587180     2       0          1  0  1
#> GSM587181     2       0          1  0  1
#> GSM587182     2       0          1  0  1
#> GSM587183     2       0          1  0  1
#> GSM587184     2       0          1  0  1
#> GSM587185     2       0          1  0  1
#> GSM587186     2       0          1  0  1
#> GSM587187     2       0          1  0  1
#> GSM587188     2       0          1  0  1
#> GSM587189     2       0          1  0  1
#> GSM587190     1       0          1  1  0
#> GSM587203     1       0          1  1  0
#> GSM587204     1       0          1  1  0
#> GSM587205     1       0          1  1  0
#> GSM587206     1       0          1  1  0
#> GSM587207     1       0          1  1  0
#> GSM587208     1       0          1  1  0
#> GSM587209     1       0          1  1  0
#> GSM587210     1       0          1  1  0
#> GSM587211     1       0          1  1  0
#> GSM587212     1       0          1  1  0
#> GSM587213     1       0          1  1  0
#> GSM587214     1       0          1  1  0
#> GSM587215     1       0          1  1  0
#> GSM587216     1       0          1  1  0
#> GSM587217     1       0          1  1  0
#> GSM587191     1       0          1  1  0
#> GSM587192     1       0          1  1  0
#> GSM587193     1       0          1  1  0
#> GSM587194     1       0          1  1  0
#> GSM587195     1       0          1  1  0
#> GSM587196     1       0          1  1  0
#> GSM587197     1       0          1  1  0
#> GSM587198     1       0          1  1  0
#> GSM587199     1       0          1  1  0
#> GSM587200     1       0          1  1  0
#> GSM587201     1       0          1  1  0
#> GSM587202     1       0          1  1  0
#> GSM198767     1       0          1  1  0
#> GSM198769     1       0          1  1  0
#> GSM198772     1       0          1  1  0
#> GSM198773     1       0          1  1  0
#> GSM198776     1       0          1  1  0
#> GSM198778     1       0          1  1  0
#> GSM198780     1       0          1  1  0
#> GSM198781     1       0          1  1  0
#> GSM198765     1       0          1  1  0
#> GSM198766     1       0          1  1  0
#> GSM198768     1       0          1  1  0
#> GSM198770     1       0          1  1  0
#> GSM198771     1       0          1  1  0
#> GSM198774     1       0          1  1  0
#> GSM198775     1       0          1  1  0
#> GSM198777     1       0          1  1  0
#> GSM198779     1       0          1  1  0
#> GSM587218     1       0          1  1  0
#> GSM587219     1       0          1  1  0
#> GSM587220     1       0          1  1  0
#> GSM587221     1       0          1  1  0
#> GSM587222     1       0          1  1  0
#> GSM587223     1       0          1  1  0
#> GSM587224     1       0          1  1  0
#> GSM587225     1       0          1  1  0
#> GSM587226     1       0          1  1  0
#> GSM587227     1       0          1  1  0
#> GSM587228     1       0          1  1  0
#> GSM587229     1       0          1  1  0

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1    p2    p3
#> GSM587155     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587156     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587157     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587158     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587159     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587160     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587161     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587162     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587163     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587164     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587165     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587166     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587167     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587168     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587169     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587170     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587171     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587172     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587173     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587174     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587175     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587176     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587177     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587178     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587179     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587180     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587181     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587182     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587183     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587184     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587185     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587186     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587187     3  0.4504      0.740 0.000 0.196 0.804
#> GSM587188     3  0.4452      0.746 0.000 0.192 0.808
#> GSM587189     3  0.4178      0.776 0.000 0.172 0.828
#> GSM587190     3  0.0747      0.966 0.016 0.000 0.984
#> GSM587203     1  0.2066      0.881 0.940 0.000 0.060
#> GSM587204     1  0.4291      0.915 0.820 0.000 0.180
#> GSM587205     1  0.4346      0.912 0.816 0.000 0.184
#> GSM587206     1  0.4346      0.912 0.816 0.000 0.184
#> GSM587207     1  0.4346      0.912 0.816 0.000 0.184
#> GSM587208     1  0.4346      0.912 0.816 0.000 0.184
#> GSM587209     1  0.4291      0.915 0.820 0.000 0.180
#> GSM587210     1  0.4235      0.916 0.824 0.000 0.176
#> GSM587211     1  0.4291      0.915 0.820 0.000 0.180
#> GSM587212     1  0.4291      0.915 0.820 0.000 0.180
#> GSM587213     1  0.4291      0.915 0.820 0.000 0.180
#> GSM587214     1  0.4291      0.915 0.820 0.000 0.180
#> GSM587215     1  0.4291      0.915 0.820 0.000 0.180
#> GSM587216     1  0.4291      0.915 0.820 0.000 0.180
#> GSM587217     1  0.4291      0.915 0.820 0.000 0.180
#> GSM587191     3  0.0747      0.966 0.016 0.000 0.984
#> GSM587192     3  0.0747      0.966 0.016 0.000 0.984
#> GSM587193     3  0.0747      0.966 0.016 0.000 0.984
#> GSM587194     3  0.0747      0.966 0.016 0.000 0.984
#> GSM587195     3  0.0747      0.966 0.016 0.000 0.984
#> GSM587196     3  0.0747      0.966 0.016 0.000 0.984
#> GSM587197     3  0.0747      0.966 0.016 0.000 0.984
#> GSM587198     3  0.0747      0.966 0.016 0.000 0.984
#> GSM587199     3  0.0747      0.966 0.016 0.000 0.984
#> GSM587200     3  0.0237      0.953 0.004 0.000 0.996
#> GSM587201     3  0.0237      0.953 0.004 0.000 0.996
#> GSM587202     3  0.0000      0.954 0.000 0.000 1.000
#> GSM198767     1  0.4346      0.912 0.816 0.000 0.184
#> GSM198769     1  0.4291      0.915 0.820 0.000 0.180
#> GSM198772     1  0.4291      0.915 0.820 0.000 0.180
#> GSM198773     1  0.4291      0.915 0.820 0.000 0.180
#> GSM198776     1  0.4291      0.915 0.820 0.000 0.180
#> GSM198778     1  0.4235      0.916 0.824 0.000 0.176
#> GSM198780     1  0.4291      0.915 0.820 0.000 0.180
#> GSM198781     1  0.4291      0.915 0.820 0.000 0.180
#> GSM198765     3  0.0747      0.966 0.016 0.000 0.984
#> GSM198766     3  0.0747      0.966 0.016 0.000 0.984
#> GSM198768     3  0.0747      0.966 0.016 0.000 0.984
#> GSM198770     3  0.0747      0.966 0.016 0.000 0.984
#> GSM198771     3  0.0747      0.966 0.016 0.000 0.984
#> GSM198774     3  0.0747      0.966 0.016 0.000 0.984
#> GSM198775     3  0.0747      0.966 0.016 0.000 0.984
#> GSM198777     3  0.0747      0.966 0.016 0.000 0.984
#> GSM198779     3  0.0747      0.966 0.016 0.000 0.984
#> GSM587218     1  0.0000      0.872 1.000 0.000 0.000
#> GSM587219     1  0.0000      0.872 1.000 0.000 0.000
#> GSM587220     1  0.0000      0.872 1.000 0.000 0.000
#> GSM587221     1  0.0000      0.872 1.000 0.000 0.000
#> GSM587222     1  0.0000      0.872 1.000 0.000 0.000
#> GSM587223     1  0.0000      0.872 1.000 0.000 0.000
#> GSM587224     1  0.0000      0.872 1.000 0.000 0.000
#> GSM587225     1  0.0000      0.872 1.000 0.000 0.000
#> GSM587226     1  0.0000      0.872 1.000 0.000 0.000
#> GSM587227     1  0.0000      0.872 1.000 0.000 0.000
#> GSM587228     1  0.0000      0.872 1.000 0.000 0.000
#> GSM587229     1  0.0000      0.872 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
#> GSM587155     2  0.1302      0.939 0.044 0.956 0.000 0.000
#> GSM587156     2  0.1302      0.939 0.044 0.956 0.000 0.000
#> GSM587157     2  0.1302      0.939 0.044 0.956 0.000 0.000
#> GSM587158     2  0.0336      0.949 0.008 0.992 0.000 0.000
#> GSM587159     2  0.0336      0.949 0.008 0.992 0.000 0.000
#> GSM587160     2  0.0336      0.949 0.008 0.992 0.000 0.000
#> GSM587161     2  0.1302      0.939 0.044 0.956 0.000 0.000
#> GSM587162     2  0.1302      0.939 0.044 0.956 0.000 0.000
#> GSM587163     2  0.0336      0.949 0.008 0.992 0.000 0.000
#> GSM587164     2  0.1302      0.939 0.044 0.956 0.000 0.000
#> GSM587165     2  0.0336      0.949 0.008 0.992 0.000 0.000
#> GSM587166     2  0.1302      0.939 0.044 0.956 0.000 0.000
#> GSM587167     2  0.1302      0.939 0.044 0.956 0.000 0.000
#> GSM587168     2  0.0336      0.949 0.008 0.992 0.000 0.000
#> GSM587169     2  0.0000      0.950 0.000 1.000 0.000 0.000
#> GSM587170     2  0.0000      0.950 0.000 1.000 0.000 0.000
#> GSM587171     2  0.0000      0.950 0.000 1.000 0.000 0.000
#> GSM587172     2  0.0000      0.950 0.000 1.000 0.000 0.000
#> GSM587173     2  0.0000      0.950 0.000 1.000 0.000 0.000
#> GSM587174     2  0.0000      0.950 0.000 1.000 0.000 0.000
#> GSM587175     2  0.0000      0.950 0.000 1.000 0.000 0.000
#> GSM587176     2  0.0000      0.950 0.000 1.000 0.000 0.000
#> GSM587177     2  0.0000      0.950 0.000 1.000 0.000 0.000
#> GSM587178     2  0.0000      0.950 0.000 1.000 0.000 0.000
#> GSM587179     2  0.0000      0.950 0.000 1.000 0.000 0.000
#> GSM587180     2  0.0000      0.950 0.000 1.000 0.000 0.000
#> GSM587181     2  0.0000      0.950 0.000 1.000 0.000 0.000
#> GSM587182     2  0.0000      0.950 0.000 1.000 0.000 0.000
#> GSM587183     2  0.5384      0.671 0.028 0.648 0.324 0.000
#> GSM587184     2  0.5384      0.671 0.028 0.648 0.324 0.000
#> GSM587185     2  0.5384      0.671 0.028 0.648 0.324 0.000
#> GSM587186     2  0.5384      0.671 0.028 0.648 0.324 0.000
#> GSM587187     3  0.0592      0.675 0.000 0.016 0.984 0.000
#> GSM587188     3  0.0592      0.675 0.000 0.016 0.984 0.000
#> GSM587189     3  0.0592      0.675 0.000 0.016 0.984 0.000
#> GSM587190     3  0.4250      0.889 0.276 0.000 0.724 0.000
#> GSM587203     1  0.5000      0.761 0.504 0.000 0.000 0.496
#> GSM587204     1  0.4967      0.859 0.548 0.000 0.000 0.452
#> GSM587205     1  0.5126      0.847 0.552 0.000 0.004 0.444
#> GSM587206     1  0.5126      0.847 0.552 0.000 0.004 0.444
#> GSM587207     1  0.5126      0.847 0.552 0.000 0.004 0.444
#> GSM587208     1  0.5126      0.847 0.552 0.000 0.004 0.444
#> GSM587209     1  0.5155      0.857 0.528 0.000 0.004 0.468
#> GSM587210     1  0.4961      0.858 0.552 0.000 0.000 0.448
#> GSM587211     1  0.5155      0.857 0.528 0.000 0.004 0.468
#> GSM587212     1  0.4961      0.858 0.552 0.000 0.000 0.448
#> GSM587213     1  0.5155      0.857 0.528 0.000 0.004 0.468
#> GSM587214     1  0.4967      0.859 0.548 0.000 0.000 0.452
#> GSM587215     1  0.4605      0.676 0.664 0.000 0.000 0.336
#> GSM587216     1  0.4967      0.859 0.548 0.000 0.000 0.452
#> GSM587217     1  0.4967      0.859 0.548 0.000 0.000 0.452
#> GSM587191     3  0.4382      0.893 0.296 0.000 0.704 0.000
#> GSM587192     3  0.4877      0.930 0.408 0.000 0.592 0.000
#> GSM587193     3  0.4817      0.931 0.388 0.000 0.612 0.000
#> GSM587194     3  0.4804      0.926 0.384 0.000 0.616 0.000
#> GSM587195     3  0.4746      0.930 0.368 0.000 0.632 0.000
#> GSM587196     3  0.4776      0.932 0.376 0.000 0.624 0.000
#> GSM587197     3  0.4730      0.929 0.364 0.000 0.636 0.000
#> GSM587198     3  0.4888      0.928 0.412 0.000 0.588 0.000
#> GSM587199     3  0.4877      0.926 0.408 0.000 0.592 0.000
#> GSM587200     1  0.3870     -0.282 0.788 0.000 0.208 0.004
#> GSM587201     1  0.3870     -0.282 0.788 0.000 0.208 0.004
#> GSM587202     3  0.4898      0.926 0.416 0.000 0.584 0.000
#> GSM198767     1  0.5132      0.849 0.548 0.000 0.004 0.448
#> GSM198769     1  0.5155      0.857 0.528 0.000 0.004 0.468
#> GSM198772     1  0.5155      0.857 0.528 0.000 0.004 0.468
#> GSM198773     1  0.5155      0.857 0.528 0.000 0.004 0.468
#> GSM198776     1  0.4967      0.859 0.548 0.000 0.000 0.452
#> GSM198778     1  0.4961      0.858 0.552 0.000 0.000 0.448
#> GSM198780     1  0.4961      0.858 0.552 0.000 0.000 0.448
#> GSM198781     1  0.4967      0.859 0.548 0.000 0.000 0.452
#> GSM198765     3  0.4730      0.930 0.364 0.000 0.636 0.000
#> GSM198766     3  0.4817      0.931 0.388 0.000 0.612 0.000
#> GSM198768     3  0.4776      0.931 0.376 0.000 0.624 0.000
#> GSM198770     3  0.4730      0.929 0.364 0.000 0.636 0.000
#> GSM198771     3  0.4888      0.928 0.412 0.000 0.588 0.000
#> GSM198774     3  0.4877      0.930 0.408 0.000 0.592 0.000
#> GSM198775     3  0.4804      0.926 0.384 0.000 0.616 0.000
#> GSM198777     3  0.4776      0.932 0.376 0.000 0.624 0.000
#> GSM198779     3  0.4877      0.926 0.408 0.000 0.592 0.000
#> GSM587218     4  0.0000      0.985 0.000 0.000 0.000 1.000
#> GSM587219     4  0.0000      0.985 0.000 0.000 0.000 1.000
#> GSM587220     4  0.0000      0.985 0.000 0.000 0.000 1.000
#> GSM587221     4  0.0000      0.985 0.000 0.000 0.000 1.000
#> GSM587222     4  0.0000      0.985 0.000 0.000 0.000 1.000
#> GSM587223     4  0.0000      0.985 0.000 0.000 0.000 1.000
#> GSM587224     4  0.0000      0.985 0.000 0.000 0.000 1.000
#> GSM587225     4  0.0937      0.973 0.012 0.000 0.012 0.976
#> GSM587226     4  0.0000      0.985 0.000 0.000 0.000 1.000
#> GSM587227     4  0.1284      0.965 0.024 0.000 0.012 0.964
#> GSM587228     4  0.1284      0.965 0.024 0.000 0.012 0.964
#> GSM587229     4  0.1284      0.965 0.024 0.000 0.012 0.964

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4 p5
#> GSM587155     2  0.3274      0.812 0.000 0.780 0.000 0.000 NA
#> GSM587156     2  0.3430      0.813 0.004 0.776 0.000 0.000 NA
#> GSM587157     2  0.3274      0.812 0.000 0.780 0.000 0.000 NA
#> GSM587158     2  0.0162      0.884 0.004 0.996 0.000 0.000 NA
#> GSM587159     2  0.0162      0.884 0.004 0.996 0.000 0.000 NA
#> GSM587160     2  0.0162      0.884 0.004 0.996 0.000 0.000 NA
#> GSM587161     2  0.3274      0.812 0.000 0.780 0.000 0.000 NA
#> GSM587162     2  0.3039      0.824 0.000 0.808 0.000 0.000 NA
#> GSM587163     2  0.0162      0.884 0.004 0.996 0.000 0.000 NA
#> GSM587164     2  0.3274      0.812 0.000 0.780 0.000 0.000 NA
#> GSM587165     2  0.0000      0.884 0.000 1.000 0.000 0.000 NA
#> GSM587166     2  0.3430      0.813 0.004 0.776 0.000 0.000 NA
#> GSM587167     2  0.3274      0.812 0.000 0.780 0.000 0.000 NA
#> GSM587168     2  0.0693      0.884 0.008 0.980 0.000 0.000 NA
#> GSM587169     2  0.0290      0.884 0.008 0.992 0.000 0.000 NA
#> GSM587170     2  0.0324      0.884 0.004 0.992 0.000 0.000 NA
#> GSM587171     2  0.0162      0.884 0.004 0.996 0.000 0.000 NA
#> GSM587172     2  0.0162      0.884 0.004 0.996 0.000 0.000 NA
#> GSM587173     2  0.0290      0.883 0.008 0.992 0.000 0.000 NA
#> GSM587174     2  0.0693      0.884 0.008 0.980 0.000 0.000 NA
#> GSM587175     2  0.0324      0.884 0.004 0.992 0.000 0.000 NA
#> GSM587176     2  0.0404      0.883 0.012 0.988 0.000 0.000 NA
#> GSM587177     2  0.0290      0.883 0.008 0.992 0.000 0.000 NA
#> GSM587178     2  0.0404      0.883 0.012 0.988 0.000 0.000 NA
#> GSM587179     2  0.0693      0.884 0.008 0.980 0.000 0.000 NA
#> GSM587180     2  0.0693      0.884 0.008 0.980 0.000 0.000 NA
#> GSM587181     2  0.0693      0.884 0.008 0.980 0.000 0.000 NA
#> GSM587182     2  0.0693      0.884 0.008 0.980 0.000 0.000 NA
#> GSM587183     2  0.6635      0.412 0.224 0.416 0.000 0.000 NA
#> GSM587184     2  0.6635      0.412 0.224 0.416 0.000 0.000 NA
#> GSM587185     2  0.6635      0.412 0.224 0.416 0.000 0.000 NA
#> GSM587186     2  0.6650      0.408 0.228 0.412 0.000 0.000 NA
#> GSM587187     3  0.6587      0.547 0.168 0.008 0.472 0.000 NA
#> GSM587188     3  0.6478      0.551 0.168 0.004 0.476 0.000 NA
#> GSM587189     3  0.6478      0.551 0.168 0.004 0.476 0.000 NA
#> GSM587190     3  0.3601      0.815 0.052 0.000 0.820 0.000 NA
#> GSM587203     1  0.5711      0.832 0.572 0.000 0.020 0.356 NA
#> GSM587204     1  0.6881      0.847 0.500 0.000 0.052 0.340 NA
#> GSM587205     1  0.6128      0.831 0.580 0.000 0.044 0.316 NA
#> GSM587206     1  0.6128      0.831 0.580 0.000 0.044 0.316 NA
#> GSM587207     1  0.6128      0.831 0.580 0.000 0.044 0.316 NA
#> GSM587208     1  0.6128      0.831 0.580 0.000 0.044 0.316 NA
#> GSM587209     1  0.5230      0.879 0.600 0.000 0.048 0.348 NA
#> GSM587210     1  0.7095      0.824 0.484 0.000 0.052 0.328 NA
#> GSM587211     1  0.5230      0.879 0.600 0.000 0.048 0.348 NA
#> GSM587212     1  0.7075      0.819 0.492 0.000 0.052 0.320 NA
#> GSM587213     1  0.5230      0.879 0.600 0.000 0.048 0.348 NA
#> GSM587214     1  0.6017      0.876 0.572 0.000 0.052 0.336 NA
#> GSM587215     1  0.6479      0.804 0.588 0.000 0.120 0.252 NA
#> GSM587216     1  0.6811      0.848 0.516 0.000 0.052 0.328 NA
#> GSM587217     1  0.6437      0.868 0.540 0.000 0.052 0.340 NA
#> GSM587191     3  0.2983      0.833 0.056 0.000 0.868 0.000 NA
#> GSM587192     3  0.2729      0.841 0.056 0.000 0.884 0.000 NA
#> GSM587193     3  0.1750      0.851 0.036 0.000 0.936 0.000 NA
#> GSM587194     3  0.3301      0.833 0.080 0.000 0.848 0.000 NA
#> GSM587195     3  0.2448      0.843 0.020 0.000 0.892 0.000 NA
#> GSM587196     3  0.1195      0.853 0.012 0.000 0.960 0.000 NA
#> GSM587197     3  0.2505      0.843 0.020 0.000 0.888 0.000 NA
#> GSM587198     3  0.1965      0.845 0.024 0.000 0.924 0.000 NA
#> GSM587199     3  0.2928      0.835 0.064 0.000 0.872 0.000 NA
#> GSM587200     3  0.6113      0.320 0.372 0.000 0.508 0.004 NA
#> GSM587201     3  0.6113      0.320 0.372 0.000 0.508 0.004 NA
#> GSM587202     3  0.2719      0.831 0.048 0.000 0.884 0.000 NA
#> GSM198767     1  0.6017      0.847 0.572 0.000 0.040 0.336 NA
#> GSM198769     1  0.5230      0.879 0.600 0.000 0.048 0.348 NA
#> GSM198772     1  0.5230      0.879 0.600 0.000 0.048 0.348 NA
#> GSM198773     1  0.5230      0.879 0.600 0.000 0.048 0.348 NA
#> GSM198776     1  0.6881      0.847 0.500 0.000 0.052 0.340 NA
#> GSM198778     1  0.7095      0.824 0.484 0.000 0.052 0.328 NA
#> GSM198780     1  0.7075      0.819 0.492 0.000 0.052 0.320 NA
#> GSM198781     1  0.6017      0.876 0.572 0.000 0.052 0.336 NA
#> GSM198765     3  0.1741      0.850 0.024 0.000 0.936 0.000 NA
#> GSM198766     3  0.1750      0.851 0.036 0.000 0.936 0.000 NA
#> GSM198768     3  0.2208      0.845 0.020 0.000 0.908 0.000 NA
#> GSM198770     3  0.2505      0.843 0.020 0.000 0.888 0.000 NA
#> GSM198771     3  0.1893      0.844 0.024 0.000 0.928 0.000 NA
#> GSM198774     3  0.2729      0.841 0.056 0.000 0.884 0.000 NA
#> GSM198775     3  0.3301      0.833 0.080 0.000 0.848 0.000 NA
#> GSM198777     3  0.1195      0.853 0.012 0.000 0.960 0.000 NA
#> GSM198779     3  0.2928      0.835 0.064 0.000 0.872 0.000 NA
#> GSM587218     4  0.0000      0.953 0.000 0.000 0.000 1.000 NA
#> GSM587219     4  0.0000      0.953 0.000 0.000 0.000 1.000 NA
#> GSM587220     4  0.0000      0.953 0.000 0.000 0.000 1.000 NA
#> GSM587221     4  0.0000      0.953 0.000 0.000 0.000 1.000 NA
#> GSM587222     4  0.0000      0.953 0.000 0.000 0.000 1.000 NA
#> GSM587223     4  0.0000      0.953 0.000 0.000 0.000 1.000 NA
#> GSM587224     4  0.0000      0.953 0.000 0.000 0.000 1.000 NA
#> GSM587225     4  0.2249      0.905 0.008 0.000 0.000 0.896 NA
#> GSM587226     4  0.0000      0.953 0.000 0.000 0.000 1.000 NA
#> GSM587227     4  0.2573      0.895 0.016 0.000 0.000 0.880 NA
#> GSM587228     4  0.2573      0.895 0.016 0.000 0.000 0.880 NA
#> GSM587229     4  0.2573      0.895 0.016 0.000 0.000 0.880 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
#> GSM587155     2  0.3706      0.639 0.000 0.620 0.000 0.000 NA 0.000
#> GSM587156     2  0.4193      0.635 0.024 0.624 0.000 0.000 NA 0.000
#> GSM587157     2  0.3706      0.639 0.000 0.620 0.000 0.000 NA 0.000
#> GSM587158     2  0.0622      0.851 0.008 0.980 0.000 0.000 NA 0.000
#> GSM587159     2  0.0520      0.851 0.008 0.984 0.000 0.000 NA 0.000
#> GSM587160     2  0.0622      0.851 0.008 0.980 0.000 0.000 NA 0.000
#> GSM587161     2  0.3706      0.639 0.000 0.620 0.000 0.000 NA 0.000
#> GSM587162     2  0.3578      0.668 0.000 0.660 0.000 0.000 NA 0.000
#> GSM587163     2  0.0622      0.851 0.008 0.980 0.000 0.000 NA 0.000
#> GSM587164     2  0.3695      0.640 0.000 0.624 0.000 0.000 NA 0.000
#> GSM587165     2  0.0520      0.851 0.008 0.984 0.000 0.000 NA 0.000
#> GSM587166     2  0.4193      0.635 0.024 0.624 0.000 0.000 NA 0.000
#> GSM587167     2  0.3819      0.639 0.004 0.624 0.000 0.000 NA 0.000
#> GSM587168     2  0.2003      0.843 0.044 0.912 0.000 0.000 NA 0.000
#> GSM587169     2  0.0260      0.851 0.008 0.992 0.000 0.000 NA 0.000
#> GSM587170     2  0.0260      0.851 0.008 0.992 0.000 0.000 NA 0.000
#> GSM587171     2  0.0363      0.851 0.012 0.988 0.000 0.000 NA 0.000
#> GSM587172     2  0.0363      0.851 0.012 0.988 0.000 0.000 NA 0.000
#> GSM587173     2  0.0937      0.847 0.040 0.960 0.000 0.000 NA 0.000
#> GSM587174     2  0.1649      0.844 0.036 0.932 0.000 0.000 NA 0.000
#> GSM587175     2  0.0260      0.851 0.008 0.992 0.000 0.000 NA 0.000
#> GSM587176     2  0.0000      0.851 0.000 1.000 0.000 0.000 NA 0.000
#> GSM587177     2  0.1010      0.846 0.036 0.960 0.000 0.000 NA 0.000
#> GSM587178     2  0.0146      0.851 0.004 0.996 0.000 0.000 NA 0.000
#> GSM587179     2  0.1649      0.844 0.036 0.932 0.000 0.000 NA 0.000
#> GSM587180     2  0.1720      0.844 0.040 0.928 0.000 0.000 NA 0.000
#> GSM587181     2  0.1649      0.844 0.036 0.932 0.000 0.000 NA 0.000
#> GSM587182     2  0.1720      0.844 0.040 0.928 0.000 0.000 NA 0.000
#> GSM587183     6  0.6328      0.569 0.088 0.312 0.000 0.000 NA 0.512
#> GSM587184     6  0.6328      0.569 0.088 0.312 0.000 0.000 NA 0.512
#> GSM587185     6  0.6327      0.568 0.092 0.312 0.000 0.000 NA 0.512
#> GSM587186     6  0.6328      0.569 0.088 0.312 0.000 0.000 NA 0.512
#> GSM587187     6  0.3756      0.254 0.000 0.004 0.352 0.000 NA 0.644
#> GSM587188     6  0.3620      0.248 0.000 0.000 0.352 0.000 NA 0.648
#> GSM587189     6  0.3620      0.248 0.000 0.000 0.352 0.000 NA 0.648
#> GSM587190     3  0.3690      0.624 0.000 0.000 0.700 0.000 NA 0.288
#> GSM587203     1  0.5293      0.781 0.644 0.000 0.004 0.216 NA 0.012
#> GSM587204     1  0.6092      0.807 0.612 0.000 0.016 0.216 NA 0.096
#> GSM587205     1  0.5426      0.771 0.632 0.000 0.012 0.204 NA 0.004
#> GSM587206     1  0.5426      0.771 0.632 0.000 0.012 0.204 NA 0.004
#> GSM587207     1  0.5426      0.771 0.632 0.000 0.012 0.204 NA 0.004
#> GSM587208     1  0.5426      0.771 0.632 0.000 0.012 0.204 NA 0.004
#> GSM587209     1  0.4891      0.835 0.692 0.000 0.024 0.228 NA 0.016
#> GSM587210     1  0.6591      0.777 0.568 0.000 0.016 0.212 NA 0.112
#> GSM587211     1  0.4600      0.836 0.708 0.000 0.024 0.228 NA 0.012
#> GSM587212     1  0.6798      0.758 0.552 0.000 0.020 0.208 NA 0.116
#> GSM587213     1  0.4891      0.834 0.692 0.000 0.024 0.228 NA 0.016
#> GSM587214     1  0.5229      0.833 0.680 0.000 0.020 0.216 NA 0.048
#> GSM587215     1  0.5597      0.752 0.696 0.000 0.116 0.104 NA 0.048
#> GSM587216     1  0.5930      0.813 0.628 0.000 0.016 0.212 NA 0.088
#> GSM587217     1  0.4958      0.834 0.696 0.000 0.020 0.216 NA 0.044
#> GSM587191     3  0.2793      0.779 0.004 0.000 0.856 0.000 NA 0.112
#> GSM587192     3  0.3571      0.778 0.024 0.000 0.824 0.000 NA 0.068
#> GSM587193     3  0.2051      0.800 0.008 0.000 0.916 0.000 NA 0.040
#> GSM587194     3  0.4591      0.738 0.028 0.000 0.740 0.000 NA 0.112
#> GSM587195     3  0.2834      0.763 0.008 0.000 0.852 0.000 NA 0.120
#> GSM587196     3  0.1719      0.800 0.008 0.000 0.928 0.000 NA 0.056
#> GSM587197     3  0.2834      0.762 0.008 0.000 0.848 0.000 NA 0.128
#> GSM587198     3  0.2362      0.785 0.016 0.000 0.892 0.000 NA 0.012
#> GSM587199     3  0.4239      0.749 0.028 0.000 0.768 0.000 NA 0.072
#> GSM587200     3  0.6003      0.359 0.272 0.000 0.496 0.000 NA 0.008
#> GSM587201     3  0.6003      0.359 0.272 0.000 0.496 0.000 NA 0.008
#> GSM587202     3  0.3043      0.757 0.024 0.000 0.836 0.000 NA 0.008
#> GSM198767     1  0.5442      0.787 0.644 0.000 0.012 0.208 NA 0.012
#> GSM198769     1  0.4891      0.835 0.692 0.000 0.024 0.228 NA 0.016
#> GSM198772     1  0.4600      0.836 0.708 0.000 0.024 0.228 NA 0.012
#> GSM198773     1  0.4891      0.834 0.692 0.000 0.024 0.228 NA 0.016
#> GSM198776     1  0.6092      0.807 0.612 0.000 0.016 0.216 NA 0.096
#> GSM198778     1  0.6591      0.777 0.568 0.000 0.016 0.212 NA 0.112
#> GSM198780     1  0.6798      0.758 0.552 0.000 0.020 0.208 NA 0.116
#> GSM198781     1  0.5229      0.833 0.680 0.000 0.020 0.216 NA 0.048
#> GSM198765     3  0.2052      0.798 0.004 0.000 0.912 0.000 NA 0.056
#> GSM198766     3  0.2051      0.800 0.008 0.000 0.916 0.000 NA 0.040
#> GSM198768     3  0.2454      0.781 0.008 0.000 0.884 0.000 NA 0.088
#> GSM198770     3  0.2834      0.762 0.008 0.000 0.848 0.000 NA 0.128
#> GSM198771     3  0.2149      0.785 0.016 0.000 0.900 0.000 NA 0.004
#> GSM198774     3  0.3571      0.778 0.024 0.000 0.824 0.000 NA 0.068
#> GSM198775     3  0.4591      0.738 0.028 0.000 0.740 0.000 NA 0.112
#> GSM198777     3  0.1719      0.800 0.008 0.000 0.928 0.000 NA 0.056
#> GSM198779     3  0.4239      0.749 0.028 0.000 0.768 0.000 NA 0.072
#> GSM587218     4  0.0000      0.935 0.000 0.000 0.000 1.000 NA 0.000
#> GSM587219     4  0.0000      0.935 0.000 0.000 0.000 1.000 NA 0.000
#> GSM587220     4  0.0000      0.935 0.000 0.000 0.000 1.000 NA 0.000
#> GSM587221     4  0.0000      0.935 0.000 0.000 0.000 1.000 NA 0.000
#> GSM587222     4  0.0000      0.935 0.000 0.000 0.000 1.000 NA 0.000
#> GSM587223     4  0.0000      0.935 0.000 0.000 0.000 1.000 NA 0.000
#> GSM587224     4  0.0000      0.935 0.000 0.000 0.000 1.000 NA 0.000
#> GSM587225     4  0.3821      0.855 0.028 0.000 0.000 0.804 NA 0.060
#> GSM587226     4  0.0000      0.935 0.000 0.000 0.000 1.000 NA 0.000
#> GSM587227     4  0.3776      0.859 0.028 0.000 0.000 0.808 NA 0.060
#> GSM587228     4  0.3776      0.859 0.028 0.000 0.000 0.808 NA 0.060
#> GSM587229     4  0.3776      0.859 0.028 0.000 0.000 0.808 NA 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 specimen(p) k
#> ATC:kmeans 92    5.33e-17 2
#> ATC:kmeans 92    6.44e-33 3
#> ATC:kmeans 90    6.82e-47 4
#> ATC:kmeans 86    1.92e-44 5
#> ATC:kmeans 87    1.08e-41 6

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


ATC:skmeans**

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

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

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

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

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

collect_plots(res)

plot of chunk ATC-skmeans-collect-plots

The plots are:

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

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

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

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

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 1.000           1.000       1.000         0.4867 0.514   0.514
#> 3 3 1.000           0.984       0.993         0.3373 0.816   0.647
#> 4 4 0.878           0.759       0.873         0.0519 0.977   0.934
#> 5 5 0.807           0.801       0.853         0.0586 0.953   0.860
#> 6 6 0.814           0.781       0.786         0.0452 0.920   0.737

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
#> GSM587155     2       0          1  0  1
#> GSM587156     2       0          1  0  1
#> GSM587157     2       0          1  0  1
#> GSM587158     2       0          1  0  1
#> GSM587159     2       0          1  0  1
#> GSM587160     2       0          1  0  1
#> GSM587161     2       0          1  0  1
#> GSM587162     2       0          1  0  1
#> GSM587163     2       0          1  0  1
#> GSM587164     2       0          1  0  1
#> GSM587165     2       0          1  0  1
#> GSM587166     2       0          1  0  1
#> GSM587167     2       0          1  0  1
#> GSM587168     2       0          1  0  1
#> GSM587169     2       0          1  0  1
#> GSM587170     2       0          1  0  1
#> GSM587171     2       0          1  0  1
#> GSM587172     2       0          1  0  1
#> GSM587173     2       0          1  0  1
#> GSM587174     2       0          1  0  1
#> GSM587175     2       0          1  0  1
#> GSM587176     2       0          1  0  1
#> GSM587177     2       0          1  0  1
#> GSM587178     2       0          1  0  1
#> GSM587179     2       0          1  0  1
#> GSM587180     2       0          1  0  1
#> GSM587181     2       0          1  0  1
#> GSM587182     2       0          1  0  1
#> GSM587183     2       0          1  0  1
#> GSM587184     2       0          1  0  1
#> GSM587185     2       0          1  0  1
#> GSM587186     2       0          1  0  1
#> GSM587187     2       0          1  0  1
#> GSM587188     2       0          1  0  1
#> GSM587189     2       0          1  0  1
#> GSM587190     2       0          1  0  1
#> GSM587203     1       0          1  1  0
#> GSM587204     1       0          1  1  0
#> GSM587205     1       0          1  1  0
#> GSM587206     1       0          1  1  0
#> GSM587207     1       0          1  1  0
#> GSM587208     1       0          1  1  0
#> GSM587209     1       0          1  1  0
#> GSM587210     1       0          1  1  0
#> GSM587211     1       0          1  1  0
#> GSM587212     1       0          1  1  0
#> GSM587213     1       0          1  1  0
#> GSM587214     1       0          1  1  0
#> GSM587215     1       0          1  1  0
#> GSM587216     1       0          1  1  0
#> GSM587217     1       0          1  1  0
#> GSM587191     2       0          1  0  1
#> GSM587192     1       0          1  1  0
#> GSM587193     1       0          1  1  0
#> GSM587194     1       0          1  1  0
#> GSM587195     1       0          1  1  0
#> GSM587196     1       0          1  1  0
#> GSM587197     1       0          1  1  0
#> GSM587198     1       0          1  1  0
#> GSM587199     1       0          1  1  0
#> GSM587200     1       0          1  1  0
#> GSM587201     1       0          1  1  0
#> GSM587202     1       0          1  1  0
#> GSM198767     1       0          1  1  0
#> GSM198769     1       0          1  1  0
#> GSM198772     1       0          1  1  0
#> GSM198773     1       0          1  1  0
#> GSM198776     1       0          1  1  0
#> GSM198778     1       0          1  1  0
#> GSM198780     1       0          1  1  0
#> GSM198781     1       0          1  1  0
#> GSM198765     1       0          1  1  0
#> GSM198766     1       0          1  1  0
#> GSM198768     1       0          1  1  0
#> GSM198770     1       0          1  1  0
#> GSM198771     1       0          1  1  0
#> GSM198774     1       0          1  1  0
#> GSM198775     1       0          1  1  0
#> GSM198777     1       0          1  1  0
#> GSM198779     1       0          1  1  0
#> GSM587218     1       0          1  1  0
#> GSM587219     1       0          1  1  0
#> GSM587220     1       0          1  1  0
#> GSM587221     1       0          1  1  0
#> GSM587222     1       0          1  1  0
#> GSM587223     1       0          1  1  0
#> GSM587224     1       0          1  1  0
#> GSM587225     1       0          1  1  0
#> GSM587226     1       0          1  1  0
#> GSM587227     1       0          1  1  0
#> GSM587228     1       0          1  1  0
#> GSM587229     1       0          1  1  0

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1 p2    p3
#> GSM587155     2   0.000      1.000 0.000  1 0.000
#> GSM587156     2   0.000      1.000 0.000  1 0.000
#> GSM587157     2   0.000      1.000 0.000  1 0.000
#> GSM587158     2   0.000      1.000 0.000  1 0.000
#> GSM587159     2   0.000      1.000 0.000  1 0.000
#> GSM587160     2   0.000      1.000 0.000  1 0.000
#> GSM587161     2   0.000      1.000 0.000  1 0.000
#> GSM587162     2   0.000      1.000 0.000  1 0.000
#> GSM587163     2   0.000      1.000 0.000  1 0.000
#> GSM587164     2   0.000      1.000 0.000  1 0.000
#> GSM587165     2   0.000      1.000 0.000  1 0.000
#> GSM587166     2   0.000      1.000 0.000  1 0.000
#> GSM587167     2   0.000      1.000 0.000  1 0.000
#> GSM587168     2   0.000      1.000 0.000  1 0.000
#> GSM587169     2   0.000      1.000 0.000  1 0.000
#> GSM587170     2   0.000      1.000 0.000  1 0.000
#> GSM587171     2   0.000      1.000 0.000  1 0.000
#> GSM587172     2   0.000      1.000 0.000  1 0.000
#> GSM587173     2   0.000      1.000 0.000  1 0.000
#> GSM587174     2   0.000      1.000 0.000  1 0.000
#> GSM587175     2   0.000      1.000 0.000  1 0.000
#> GSM587176     2   0.000      1.000 0.000  1 0.000
#> GSM587177     2   0.000      1.000 0.000  1 0.000
#> GSM587178     2   0.000      1.000 0.000  1 0.000
#> GSM587179     2   0.000      1.000 0.000  1 0.000
#> GSM587180     2   0.000      1.000 0.000  1 0.000
#> GSM587181     2   0.000      1.000 0.000  1 0.000
#> GSM587182     2   0.000      1.000 0.000  1 0.000
#> GSM587183     2   0.000      1.000 0.000  1 0.000
#> GSM587184     2   0.000      1.000 0.000  1 0.000
#> GSM587185     2   0.000      1.000 0.000  1 0.000
#> GSM587186     2   0.000      1.000 0.000  1 0.000
#> GSM587187     2   0.000      1.000 0.000  1 0.000
#> GSM587188     2   0.000      1.000 0.000  1 0.000
#> GSM587189     2   0.000      1.000 0.000  1 0.000
#> GSM587190     3   0.000      0.965 0.000  0 1.000
#> GSM587203     1   0.000      1.000 1.000  0 0.000
#> GSM587204     1   0.000      1.000 1.000  0 0.000
#> GSM587205     1   0.000      1.000 1.000  0 0.000
#> GSM587206     1   0.000      1.000 1.000  0 0.000
#> GSM587207     1   0.000      1.000 1.000  0 0.000
#> GSM587208     1   0.000      1.000 1.000  0 0.000
#> GSM587209     1   0.000      1.000 1.000  0 0.000
#> GSM587210     1   0.000      1.000 1.000  0 0.000
#> GSM587211     1   0.000      1.000 1.000  0 0.000
#> GSM587212     1   0.000      1.000 1.000  0 0.000
#> GSM587213     1   0.000      1.000 1.000  0 0.000
#> GSM587214     1   0.000      1.000 1.000  0 0.000
#> GSM587215     1   0.000      1.000 1.000  0 0.000
#> GSM587216     1   0.000      1.000 1.000  0 0.000
#> GSM587217     1   0.000      1.000 1.000  0 0.000
#> GSM587191     3   0.000      0.965 0.000  0 1.000
#> GSM587192     3   0.000      0.965 0.000  0 1.000
#> GSM587193     3   0.559      0.588 0.304  0 0.696
#> GSM587194     3   0.000      0.965 0.000  0 1.000
#> GSM587195     3   0.000      0.965 0.000  0 1.000
#> GSM587196     3   0.000      0.965 0.000  0 1.000
#> GSM587197     3   0.000      0.965 0.000  0 1.000
#> GSM587198     3   0.000      0.965 0.000  0 1.000
#> GSM587199     3   0.000      0.965 0.000  0 1.000
#> GSM587200     1   0.000      1.000 1.000  0 0.000
#> GSM587201     1   0.000      1.000 1.000  0 0.000
#> GSM587202     3   0.129      0.940 0.032  0 0.968
#> GSM198767     1   0.000      1.000 1.000  0 0.000
#> GSM198769     1   0.000      1.000 1.000  0 0.000
#> GSM198772     1   0.000      1.000 1.000  0 0.000
#> GSM198773     1   0.000      1.000 1.000  0 0.000
#> GSM198776     1   0.000      1.000 1.000  0 0.000
#> GSM198778     1   0.000      1.000 1.000  0 0.000
#> GSM198780     1   0.000      1.000 1.000  0 0.000
#> GSM198781     1   0.000      1.000 1.000  0 0.000
#> GSM198765     3   0.000      0.965 0.000  0 1.000
#> GSM198766     3   0.559      0.588 0.304  0 0.696
#> GSM198768     3   0.000      0.965 0.000  0 1.000
#> GSM198770     3   0.000      0.965 0.000  0 1.000
#> GSM198771     3   0.000      0.965 0.000  0 1.000
#> GSM198774     3   0.000      0.965 0.000  0 1.000
#> GSM198775     3   0.000      0.965 0.000  0 1.000
#> GSM198777     3   0.000      0.965 0.000  0 1.000
#> GSM198779     3   0.000      0.965 0.000  0 1.000
#> GSM587218     1   0.000      1.000 1.000  0 0.000
#> GSM587219     1   0.000      1.000 1.000  0 0.000
#> GSM587220     1   0.000      1.000 1.000  0 0.000
#> GSM587221     1   0.000      1.000 1.000  0 0.000
#> GSM587222     1   0.000      1.000 1.000  0 0.000
#> GSM587223     1   0.000      1.000 1.000  0 0.000
#> GSM587224     1   0.000      1.000 1.000  0 0.000
#> GSM587225     1   0.000      1.000 1.000  0 0.000
#> GSM587226     1   0.000      1.000 1.000  0 0.000
#> GSM587227     1   0.000      1.000 1.000  0 0.000
#> GSM587228     1   0.000      1.000 1.000  0 0.000
#> GSM587229     1   0.000      1.000 1.000  0 0.000

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM587155     2  0.0000    0.98052 0.000 1.000 0.000 0.000
#> GSM587156     2  0.0000    0.98052 0.000 1.000 0.000 0.000
#> GSM587157     2  0.0000    0.98052 0.000 1.000 0.000 0.000
#> GSM587158     2  0.0000    0.98052 0.000 1.000 0.000 0.000
#> GSM587159     2  0.0000    0.98052 0.000 1.000 0.000 0.000
#> GSM587160     2  0.0000    0.98052 0.000 1.000 0.000 0.000
#> GSM587161     2  0.0000    0.98052 0.000 1.000 0.000 0.000
#> GSM587162     2  0.0000    0.98052 0.000 1.000 0.000 0.000
#> GSM587163     2  0.0000    0.98052 0.000 1.000 0.000 0.000
#> GSM587164     2  0.0000    0.98052 0.000 1.000 0.000 0.000
#> GSM587165     2  0.0000    0.98052 0.000 1.000 0.000 0.000
#> GSM587166     2  0.0000    0.98052 0.000 1.000 0.000 0.000
#> GSM587167     2  0.0000    0.98052 0.000 1.000 0.000 0.000
#> GSM587168     2  0.0000    0.98052 0.000 1.000 0.000 0.000
#> GSM587169     2  0.0000    0.98052 0.000 1.000 0.000 0.000
#> GSM587170     2  0.0000    0.98052 0.000 1.000 0.000 0.000
#> GSM587171     2  0.0000    0.98052 0.000 1.000 0.000 0.000
#> GSM587172     2  0.0000    0.98052 0.000 1.000 0.000 0.000
#> GSM587173     2  0.0000    0.98052 0.000 1.000 0.000 0.000
#> GSM587174     2  0.0000    0.98052 0.000 1.000 0.000 0.000
#> GSM587175     2  0.0000    0.98052 0.000 1.000 0.000 0.000
#> GSM587176     2  0.0000    0.98052 0.000 1.000 0.000 0.000
#> GSM587177     2  0.0000    0.98052 0.000 1.000 0.000 0.000
#> GSM587178     2  0.0000    0.98052 0.000 1.000 0.000 0.000
#> GSM587179     2  0.0000    0.98052 0.000 1.000 0.000 0.000
#> GSM587180     2  0.0000    0.98052 0.000 1.000 0.000 0.000
#> GSM587181     2  0.0000    0.98052 0.000 1.000 0.000 0.000
#> GSM587182     2  0.0000    0.98052 0.000 1.000 0.000 0.000
#> GSM587183     2  0.0000    0.98052 0.000 1.000 0.000 0.000
#> GSM587184     2  0.0000    0.98052 0.000 1.000 0.000 0.000
#> GSM587185     2  0.0000    0.98052 0.000 1.000 0.000 0.000
#> GSM587186     2  0.0000    0.98052 0.000 1.000 0.000 0.000
#> GSM587187     2  0.3610    0.77294 0.000 0.800 0.000 0.200
#> GSM587188     2  0.3649    0.76863 0.000 0.796 0.000 0.204
#> GSM587189     2  0.4867    0.68057 0.000 0.736 0.032 0.232
#> GSM587190     4  0.4998    0.03195 0.000 0.000 0.488 0.512
#> GSM587203     1  0.0000    0.95775 1.000 0.000 0.000 0.000
#> GSM587204     1  0.1824    0.93797 0.936 0.000 0.060 0.004
#> GSM587205     1  0.0188    0.95766 0.996 0.000 0.000 0.004
#> GSM587206     1  0.0188    0.95766 0.996 0.000 0.000 0.004
#> GSM587207     1  0.0188    0.95766 0.996 0.000 0.000 0.004
#> GSM587208     1  0.0188    0.95766 0.996 0.000 0.000 0.004
#> GSM587209     1  0.0188    0.95801 0.996 0.000 0.000 0.004
#> GSM587210     1  0.2255    0.93349 0.920 0.000 0.068 0.012
#> GSM587211     1  0.0188    0.95801 0.996 0.000 0.000 0.004
#> GSM587212     1  0.2741    0.91117 0.892 0.000 0.096 0.012
#> GSM587213     1  0.0188    0.95801 0.996 0.000 0.000 0.004
#> GSM587214     1  0.1743    0.94005 0.940 0.000 0.056 0.004
#> GSM587215     1  0.1824    0.93797 0.936 0.000 0.060 0.004
#> GSM587216     1  0.1824    0.93797 0.936 0.000 0.060 0.004
#> GSM587217     1  0.1743    0.94005 0.940 0.000 0.056 0.004
#> GSM587191     4  0.4661    0.13046 0.000 0.000 0.348 0.652
#> GSM587192     3  0.5016    0.06384 0.004 0.000 0.600 0.396
#> GSM587193     4  0.6603    0.11163 0.100 0.000 0.328 0.572
#> GSM587194     3  0.4855    0.05803 0.000 0.000 0.600 0.400
#> GSM587195     4  0.5000   -0.03098 0.000 0.000 0.496 0.504
#> GSM587196     3  0.3311    0.21921 0.000 0.000 0.828 0.172
#> GSM587197     4  0.4989    0.00663 0.000 0.000 0.472 0.528
#> GSM587198     3  0.4994   -0.14173 0.000 0.000 0.520 0.480
#> GSM587199     3  0.0000    0.23968 0.000 0.000 1.000 0.000
#> GSM587200     1  0.0657    0.95489 0.984 0.000 0.004 0.012
#> GSM587201     1  0.0657    0.95489 0.984 0.000 0.004 0.012
#> GSM587202     3  0.7315    0.03219 0.216 0.000 0.532 0.252
#> GSM198767     1  0.0188    0.95801 0.996 0.000 0.000 0.004
#> GSM198769     1  0.0188    0.95801 0.996 0.000 0.000 0.004
#> GSM198772     1  0.0188    0.95801 0.996 0.000 0.000 0.004
#> GSM198773     1  0.0188    0.95801 0.996 0.000 0.000 0.004
#> GSM198776     1  0.1824    0.93797 0.936 0.000 0.060 0.004
#> GSM198778     1  0.2255    0.93349 0.920 0.000 0.068 0.012
#> GSM198780     1  0.2741    0.91117 0.892 0.000 0.096 0.012
#> GSM198781     1  0.1743    0.94005 0.940 0.000 0.056 0.004
#> GSM198765     4  0.4776    0.11266 0.000 0.000 0.376 0.624
#> GSM198766     4  0.6898    0.05883 0.116 0.000 0.360 0.524
#> GSM198768     3  0.5000   -0.15731 0.000 0.000 0.504 0.496
#> GSM198770     4  0.4989    0.00663 0.000 0.000 0.472 0.528
#> GSM198771     3  0.4989   -0.13211 0.000 0.000 0.528 0.472
#> GSM198774     3  0.5016    0.06384 0.004 0.000 0.600 0.396
#> GSM198775     3  0.4855    0.05803 0.000 0.000 0.600 0.400
#> GSM198777     3  0.3311    0.21921 0.000 0.000 0.828 0.172
#> GSM198779     3  0.0000    0.23968 0.000 0.000 1.000 0.000
#> GSM587218     1  0.1557    0.94847 0.944 0.000 0.000 0.056
#> GSM587219     1  0.1557    0.94847 0.944 0.000 0.000 0.056
#> GSM587220     1  0.1557    0.94847 0.944 0.000 0.000 0.056
#> GSM587221     1  0.1557    0.94847 0.944 0.000 0.000 0.056
#> GSM587222     1  0.1557    0.94847 0.944 0.000 0.000 0.056
#> GSM587223     1  0.1557    0.94847 0.944 0.000 0.000 0.056
#> GSM587224     1  0.1557    0.94847 0.944 0.000 0.000 0.056
#> GSM587225     1  0.1557    0.94847 0.944 0.000 0.000 0.056
#> GSM587226     1  0.1557    0.94847 0.944 0.000 0.000 0.056
#> GSM587227     1  0.1557    0.94847 0.944 0.000 0.000 0.056
#> GSM587228     1  0.1557    0.94847 0.944 0.000 0.000 0.056
#> GSM587229     1  0.1557    0.94847 0.944 0.000 0.000 0.056

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM587155     2  0.0000     1.0000 0.000 1.000 0.000 0.000 0.000
#> GSM587156     2  0.0000     1.0000 0.000 1.000 0.000 0.000 0.000
#> GSM587157     2  0.0000     1.0000 0.000 1.000 0.000 0.000 0.000
#> GSM587158     2  0.0000     1.0000 0.000 1.000 0.000 0.000 0.000
#> GSM587159     2  0.0000     1.0000 0.000 1.000 0.000 0.000 0.000
#> GSM587160     2  0.0000     1.0000 0.000 1.000 0.000 0.000 0.000
#> GSM587161     2  0.0000     1.0000 0.000 1.000 0.000 0.000 0.000
#> GSM587162     2  0.0000     1.0000 0.000 1.000 0.000 0.000 0.000
#> GSM587163     2  0.0000     1.0000 0.000 1.000 0.000 0.000 0.000
#> GSM587164     2  0.0000     1.0000 0.000 1.000 0.000 0.000 0.000
#> GSM587165     2  0.0000     1.0000 0.000 1.000 0.000 0.000 0.000
#> GSM587166     2  0.0000     1.0000 0.000 1.000 0.000 0.000 0.000
#> GSM587167     2  0.0000     1.0000 0.000 1.000 0.000 0.000 0.000
#> GSM587168     2  0.0000     1.0000 0.000 1.000 0.000 0.000 0.000
#> GSM587169     2  0.0000     1.0000 0.000 1.000 0.000 0.000 0.000
#> GSM587170     2  0.0000     1.0000 0.000 1.000 0.000 0.000 0.000
#> GSM587171     2  0.0000     1.0000 0.000 1.000 0.000 0.000 0.000
#> GSM587172     2  0.0000     1.0000 0.000 1.000 0.000 0.000 0.000
#> GSM587173     2  0.0000     1.0000 0.000 1.000 0.000 0.000 0.000
#> GSM587174     2  0.0000     1.0000 0.000 1.000 0.000 0.000 0.000
#> GSM587175     2  0.0000     1.0000 0.000 1.000 0.000 0.000 0.000
#> GSM587176     2  0.0000     1.0000 0.000 1.000 0.000 0.000 0.000
#> GSM587177     2  0.0000     1.0000 0.000 1.000 0.000 0.000 0.000
#> GSM587178     2  0.0000     1.0000 0.000 1.000 0.000 0.000 0.000
#> GSM587179     2  0.0000     1.0000 0.000 1.000 0.000 0.000 0.000
#> GSM587180     2  0.0000     1.0000 0.000 1.000 0.000 0.000 0.000
#> GSM587181     2  0.0000     1.0000 0.000 1.000 0.000 0.000 0.000
#> GSM587182     2  0.0000     1.0000 0.000 1.000 0.000 0.000 0.000
#> GSM587183     2  0.0000     1.0000 0.000 1.000 0.000 0.000 0.000
#> GSM587184     2  0.0000     1.0000 0.000 1.000 0.000 0.000 0.000
#> GSM587185     2  0.0000     1.0000 0.000 1.000 0.000 0.000 0.000
#> GSM587186     2  0.0000     1.0000 0.000 1.000 0.000 0.000 0.000
#> GSM587187     5  0.7235     0.7297 0.000 0.352 0.032 0.200 0.416
#> GSM587188     5  0.7235     0.7297 0.000 0.352 0.032 0.200 0.416
#> GSM587189     5  0.7363     0.6991 0.000 0.288 0.032 0.264 0.416
#> GSM587190     5  0.5816    -0.0724 0.000 0.000 0.092 0.440 0.468
#> GSM587203     1  0.0703     0.8236 0.976 0.000 0.000 0.000 0.024
#> GSM587204     1  0.1364     0.8157 0.952 0.000 0.036 0.000 0.012
#> GSM587205     1  0.1732     0.8065 0.920 0.000 0.000 0.000 0.080
#> GSM587206     1  0.1732     0.8065 0.920 0.000 0.000 0.000 0.080
#> GSM587207     1  0.1732     0.8065 0.920 0.000 0.000 0.000 0.080
#> GSM587208     1  0.1732     0.8065 0.920 0.000 0.000 0.000 0.080
#> GSM587209     1  0.0162     0.8242 0.996 0.000 0.000 0.000 0.004
#> GSM587210     1  0.4394     0.7634 0.764 0.000 0.136 0.000 0.100
#> GSM587211     1  0.0162     0.8242 0.996 0.000 0.000 0.000 0.004
#> GSM587212     1  0.4428     0.7587 0.760 0.000 0.144 0.000 0.096
#> GSM587213     1  0.0162     0.8242 0.996 0.000 0.000 0.000 0.004
#> GSM587214     1  0.1300     0.8153 0.956 0.000 0.028 0.000 0.016
#> GSM587215     1  0.1386     0.8149 0.952 0.000 0.032 0.000 0.016
#> GSM587216     1  0.1469     0.8143 0.948 0.000 0.036 0.000 0.016
#> GSM587217     1  0.1300     0.8153 0.956 0.000 0.028 0.000 0.016
#> GSM587191     3  0.6092     0.4406 0.000 0.000 0.564 0.256 0.180
#> GSM587192     3  0.1617     0.6637 0.012 0.000 0.948 0.020 0.020
#> GSM587193     3  0.6551     0.5357 0.136 0.000 0.632 0.144 0.088
#> GSM587194     3  0.1809     0.6544 0.000 0.000 0.928 0.012 0.060
#> GSM587195     4  0.0324     0.7551 0.000 0.000 0.004 0.992 0.004
#> GSM587196     4  0.4675     0.3561 0.000 0.000 0.380 0.600 0.020
#> GSM587197     4  0.0671     0.7493 0.000 0.000 0.004 0.980 0.016
#> GSM587198     4  0.2124     0.7387 0.000 0.000 0.004 0.900 0.096
#> GSM587199     3  0.5488     0.2439 0.000 0.000 0.608 0.300 0.092
#> GSM587200     1  0.3562     0.7220 0.788 0.000 0.000 0.016 0.196
#> GSM587201     1  0.3381     0.7197 0.808 0.000 0.000 0.016 0.176
#> GSM587202     4  0.6311     0.4294 0.188 0.000 0.020 0.600 0.192
#> GSM198767     1  0.0000     0.8245 1.000 0.000 0.000 0.000 0.000
#> GSM198769     1  0.0162     0.8242 0.996 0.000 0.000 0.000 0.004
#> GSM198772     1  0.0162     0.8242 0.996 0.000 0.000 0.000 0.004
#> GSM198773     1  0.0162     0.8242 0.996 0.000 0.000 0.000 0.004
#> GSM198776     1  0.1364     0.8157 0.952 0.000 0.036 0.000 0.012
#> GSM198778     1  0.4394     0.7634 0.764 0.000 0.136 0.000 0.100
#> GSM198780     1  0.4428     0.7587 0.760 0.000 0.144 0.000 0.096
#> GSM198781     1  0.1300     0.8153 0.956 0.000 0.028 0.000 0.016
#> GSM198765     3  0.5490     0.5101 0.000 0.000 0.644 0.228 0.128
#> GSM198766     3  0.6411     0.5277 0.172 0.000 0.640 0.104 0.084
#> GSM198768     4  0.0290     0.7574 0.000 0.000 0.008 0.992 0.000
#> GSM198770     4  0.0671     0.7493 0.000 0.000 0.004 0.980 0.016
#> GSM198771     4  0.2573     0.7313 0.000 0.000 0.016 0.880 0.104
#> GSM198774     3  0.1617     0.6637 0.012 0.000 0.948 0.020 0.020
#> GSM198775     3  0.1809     0.6544 0.000 0.000 0.928 0.012 0.060
#> GSM198777     4  0.4663     0.3640 0.000 0.000 0.376 0.604 0.020
#> GSM198779     3  0.5488     0.2439 0.000 0.000 0.608 0.300 0.092
#> GSM587218     1  0.4030     0.7371 0.648 0.000 0.000 0.000 0.352
#> GSM587219     1  0.4030     0.7371 0.648 0.000 0.000 0.000 0.352
#> GSM587220     1  0.4030     0.7371 0.648 0.000 0.000 0.000 0.352
#> GSM587221     1  0.4030     0.7371 0.648 0.000 0.000 0.000 0.352
#> GSM587222     1  0.4030     0.7371 0.648 0.000 0.000 0.000 0.352
#> GSM587223     1  0.4030     0.7371 0.648 0.000 0.000 0.000 0.352
#> GSM587224     1  0.4030     0.7371 0.648 0.000 0.000 0.000 0.352
#> GSM587225     1  0.4045     0.7363 0.644 0.000 0.000 0.000 0.356
#> GSM587226     1  0.4030     0.7371 0.648 0.000 0.000 0.000 0.352
#> GSM587227     1  0.4045     0.7363 0.644 0.000 0.000 0.000 0.356
#> GSM587228     1  0.4045     0.7363 0.644 0.000 0.000 0.000 0.356
#> GSM587229     1  0.4045     0.7363 0.644 0.000 0.000 0.000 0.356

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM587155     2  0.0000     0.9994 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587156     2  0.0000     0.9994 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587157     2  0.0000     0.9994 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587158     2  0.0000     0.9994 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587159     2  0.0000     0.9994 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587160     2  0.0000     0.9994 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587161     2  0.0000     0.9994 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587162     2  0.0000     0.9994 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587163     2  0.0000     0.9994 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587164     2  0.0000     0.9994 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587165     2  0.0000     0.9994 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587166     2  0.0000     0.9994 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587167     2  0.0000     0.9994 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587168     2  0.0000     0.9994 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587169     2  0.0000     0.9994 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587170     2  0.0000     0.9994 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587171     2  0.0000     0.9994 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587172     2  0.0000     0.9994 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587173     2  0.0000     0.9994 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587174     2  0.0000     0.9994 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587175     2  0.0000     0.9994 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587176     2  0.0000     0.9994 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587177     2  0.0000     0.9994 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587178     2  0.0000     0.9994 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587179     2  0.0000     0.9994 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587180     2  0.0000     0.9994 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587181     2  0.0000     0.9994 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587182     2  0.0000     0.9994 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587183     2  0.0146     0.9960 0.000 0.996 0.000 0.000 0.000 0.004
#> GSM587184     2  0.0146     0.9960 0.000 0.996 0.000 0.000 0.000 0.004
#> GSM587185     2  0.0146     0.9960 0.000 0.996 0.000 0.000 0.000 0.004
#> GSM587186     2  0.0146     0.9960 0.000 0.996 0.000 0.000 0.000 0.004
#> GSM587187     6  0.3010     0.8661 0.000 0.148 0.020 0.000 0.004 0.828
#> GSM587188     6  0.2971     0.8714 0.000 0.144 0.020 0.000 0.004 0.832
#> GSM587189     6  0.3072     0.8678 0.000 0.124 0.036 0.000 0.004 0.836
#> GSM587190     6  0.1950     0.6445 0.000 0.000 0.064 0.000 0.024 0.912
#> GSM587203     1  0.1141     0.7403 0.948 0.000 0.000 0.052 0.000 0.000
#> GSM587204     1  0.2009     0.7535 0.908 0.000 0.000 0.068 0.024 0.000
#> GSM587205     1  0.2964     0.7136 0.868 0.000 0.036 0.060 0.000 0.036
#> GSM587206     1  0.2964     0.7136 0.868 0.000 0.036 0.060 0.000 0.036
#> GSM587207     1  0.2964     0.7136 0.868 0.000 0.036 0.060 0.000 0.036
#> GSM587208     1  0.2964     0.7136 0.868 0.000 0.036 0.060 0.000 0.036
#> GSM587209     1  0.0363     0.7674 0.988 0.000 0.000 0.012 0.000 0.000
#> GSM587210     1  0.5411     0.1320 0.572 0.000 0.000 0.260 0.168 0.000
#> GSM587211     1  0.0363     0.7674 0.988 0.000 0.000 0.012 0.000 0.000
#> GSM587212     1  0.5579     0.1287 0.548 0.000 0.000 0.248 0.204 0.000
#> GSM587213     1  0.0458     0.7674 0.984 0.000 0.000 0.016 0.000 0.000
#> GSM587214     1  0.1594     0.7614 0.932 0.000 0.000 0.052 0.016 0.000
#> GSM587215     1  0.1765     0.7576 0.924 0.000 0.000 0.052 0.024 0.000
#> GSM587216     1  0.1829     0.7581 0.920 0.000 0.000 0.056 0.024 0.000
#> GSM587217     1  0.1594     0.7623 0.932 0.000 0.000 0.052 0.016 0.000
#> GSM587191     5  0.7142     0.2045 0.000 0.000 0.100 0.188 0.364 0.348
#> GSM587192     5  0.3110     0.5579 0.020 0.000 0.000 0.128 0.836 0.016
#> GSM587193     5  0.8252     0.3259 0.136 0.000 0.092 0.200 0.404 0.168
#> GSM587194     5  0.2216     0.5567 0.000 0.000 0.024 0.016 0.908 0.052
#> GSM587195     3  0.2706     0.7804 0.000 0.000 0.832 0.000 0.008 0.160
#> GSM587196     5  0.4962     0.0840 0.004 0.000 0.464 0.004 0.484 0.044
#> GSM587197     3  0.3198     0.7664 0.000 0.000 0.796 0.008 0.008 0.188
#> GSM587198     3  0.3330     0.7203 0.000 0.000 0.828 0.108 0.008 0.056
#> GSM587199     5  0.5031     0.4642 0.004 0.000 0.160 0.056 0.712 0.068
#> GSM587200     1  0.6200     0.3852 0.576 0.000 0.152 0.216 0.004 0.052
#> GSM587201     1  0.5979     0.4335 0.612 0.000 0.152 0.180 0.004 0.052
#> GSM587202     3  0.5779     0.4653 0.108 0.000 0.660 0.160 0.016 0.056
#> GSM198767     1  0.0547     0.7641 0.980 0.000 0.000 0.020 0.000 0.000
#> GSM198769     1  0.0363     0.7674 0.988 0.000 0.000 0.012 0.000 0.000
#> GSM198772     1  0.0363     0.7674 0.988 0.000 0.000 0.012 0.000 0.000
#> GSM198773     1  0.0458     0.7674 0.984 0.000 0.000 0.016 0.000 0.000
#> GSM198776     1  0.2009     0.7535 0.908 0.000 0.000 0.068 0.024 0.000
#> GSM198778     1  0.5411     0.1320 0.572 0.000 0.000 0.260 0.168 0.000
#> GSM198780     1  0.5579     0.1287 0.548 0.000 0.000 0.248 0.204 0.000
#> GSM198781     1  0.1594     0.7614 0.932 0.000 0.000 0.052 0.016 0.000
#> GSM198765     5  0.7086     0.2773 0.000 0.000 0.100 0.188 0.416 0.296
#> GSM198766     5  0.8207     0.3333 0.164 0.000 0.092 0.200 0.412 0.132
#> GSM198768     3  0.2730     0.7803 0.000 0.000 0.836 0.000 0.012 0.152
#> GSM198770     3  0.3198     0.7664 0.000 0.000 0.796 0.008 0.008 0.188
#> GSM198771     3  0.3269     0.7178 0.000 0.000 0.832 0.108 0.008 0.052
#> GSM198774     5  0.3110     0.5579 0.020 0.000 0.000 0.128 0.836 0.016
#> GSM198775     5  0.2216     0.5567 0.000 0.000 0.024 0.016 0.908 0.052
#> GSM198777     5  0.5015     0.0667 0.004 0.000 0.468 0.004 0.476 0.048
#> GSM198779     5  0.4997     0.4680 0.004 0.000 0.156 0.056 0.716 0.068
#> GSM587218     4  0.3765     0.9749 0.404 0.000 0.000 0.596 0.000 0.000
#> GSM587219     4  0.3765     0.9749 0.404 0.000 0.000 0.596 0.000 0.000
#> GSM587220     4  0.3765     0.9749 0.404 0.000 0.000 0.596 0.000 0.000
#> GSM587221     4  0.3765     0.9749 0.404 0.000 0.000 0.596 0.000 0.000
#> GSM587222     4  0.3765     0.9749 0.404 0.000 0.000 0.596 0.000 0.000
#> GSM587223     4  0.3765     0.9749 0.404 0.000 0.000 0.596 0.000 0.000
#> GSM587224     4  0.3765     0.9749 0.404 0.000 0.000 0.596 0.000 0.000
#> GSM587225     4  0.3756     0.9717 0.400 0.000 0.000 0.600 0.000 0.000
#> GSM587226     4  0.3765     0.9749 0.404 0.000 0.000 0.596 0.000 0.000
#> GSM587227     4  0.3672     0.9270 0.368 0.000 0.000 0.632 0.000 0.000
#> GSM587228     4  0.3672     0.9270 0.368 0.000 0.000 0.632 0.000 0.000
#> GSM587229     4  0.3672     0.9270 0.368 0.000 0.000 0.632 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-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 specimen(p) k
#> ATC:skmeans 92    7.21e-17 2
#> ATC:skmeans 92    2.19e-29 3
#> ATC:skmeans 72    3.93e-14 4
#> ATC:skmeans 85    5.98e-38 5
#> ATC:skmeans 77    6.99e-48 6

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


ATC:pam*

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

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

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

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

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

collect_plots(res)

plot of chunk ATC-pam-collect-plots

The plots are:

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

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

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

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

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 1.000           0.987       0.995         0.4793 0.523   0.523
#> 3 3 1.000           0.997       0.998         0.3933 0.777   0.587
#> 4 4 1.000           0.972       0.987         0.0914 0.937   0.810
#> 5 5 1.000           0.967       0.983         0.0459 0.960   0.853
#> 6 6 0.925           0.910       0.929         0.0330 0.976   0.897

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 4 5

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

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

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

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>           class entropy silhouette   p1   p2
#> GSM587155     2    0.00      1.000 0.00 1.00
#> GSM587156     2    0.00      1.000 0.00 1.00
#> GSM587157     2    0.00      1.000 0.00 1.00
#> GSM587158     2    0.00      1.000 0.00 1.00
#> GSM587159     2    0.00      1.000 0.00 1.00
#> GSM587160     2    0.00      1.000 0.00 1.00
#> GSM587161     2    0.00      1.000 0.00 1.00
#> GSM587162     2    0.00      1.000 0.00 1.00
#> GSM587163     2    0.00      1.000 0.00 1.00
#> GSM587164     2    0.00      1.000 0.00 1.00
#> GSM587165     2    0.00      1.000 0.00 1.00
#> GSM587166     2    0.00      1.000 0.00 1.00
#> GSM587167     2    0.00      1.000 0.00 1.00
#> GSM587168     2    0.00      1.000 0.00 1.00
#> GSM587169     2    0.00      1.000 0.00 1.00
#> GSM587170     2    0.00      1.000 0.00 1.00
#> GSM587171     2    0.00      1.000 0.00 1.00
#> GSM587172     2    0.00      1.000 0.00 1.00
#> GSM587173     2    0.00      1.000 0.00 1.00
#> GSM587174     2    0.00      1.000 0.00 1.00
#> GSM587175     2    0.00      1.000 0.00 1.00
#> GSM587176     2    0.00      1.000 0.00 1.00
#> GSM587177     2    0.00      1.000 0.00 1.00
#> GSM587178     2    0.00      1.000 0.00 1.00
#> GSM587179     2    0.00      1.000 0.00 1.00
#> GSM587180     2    0.00      1.000 0.00 1.00
#> GSM587181     2    0.00      1.000 0.00 1.00
#> GSM587182     2    0.00      1.000 0.00 1.00
#> GSM587183     2    0.00      1.000 0.00 1.00
#> GSM587184     2    0.00      1.000 0.00 1.00
#> GSM587185     2    0.00      1.000 0.00 1.00
#> GSM587186     2    0.00      1.000 0.00 1.00
#> GSM587187     2    0.00      1.000 0.00 1.00
#> GSM587188     2    0.00      1.000 0.00 1.00
#> GSM587189     2    0.00      1.000 0.00 1.00
#> GSM587190     1    0.99      0.214 0.56 0.44
#> GSM587203     1    0.00      0.992 1.00 0.00
#> GSM587204     1    0.00      0.992 1.00 0.00
#> GSM587205     1    0.00      0.992 1.00 0.00
#> GSM587206     1    0.00      0.992 1.00 0.00
#> GSM587207     1    0.00      0.992 1.00 0.00
#> GSM587208     1    0.00      0.992 1.00 0.00
#> GSM587209     1    0.00      0.992 1.00 0.00
#> GSM587210     1    0.00      0.992 1.00 0.00
#> GSM587211     1    0.00      0.992 1.00 0.00
#> GSM587212     1    0.00      0.992 1.00 0.00
#> GSM587213     1    0.00      0.992 1.00 0.00
#> GSM587214     1    0.00      0.992 1.00 0.00
#> GSM587215     1    0.00      0.992 1.00 0.00
#> GSM587216     1    0.00      0.992 1.00 0.00
#> GSM587217     1    0.00      0.992 1.00 0.00
#> GSM587191     1    0.00      0.992 1.00 0.00
#> GSM587192     1    0.00      0.992 1.00 0.00
#> GSM587193     1    0.00      0.992 1.00 0.00
#> GSM587194     1    0.00      0.992 1.00 0.00
#> GSM587195     1    0.00      0.992 1.00 0.00
#> GSM587196     1    0.00      0.992 1.00 0.00
#> GSM587197     1    0.00      0.992 1.00 0.00
#> GSM587198     1    0.00      0.992 1.00 0.00
#> GSM587199     1    0.00      0.992 1.00 0.00
#> GSM587200     1    0.00      0.992 1.00 0.00
#> GSM587201     1    0.00      0.992 1.00 0.00
#> GSM587202     1    0.00      0.992 1.00 0.00
#> GSM198767     1    0.00      0.992 1.00 0.00
#> GSM198769     1    0.00      0.992 1.00 0.00
#> GSM198772     1    0.00      0.992 1.00 0.00
#> GSM198773     1    0.00      0.992 1.00 0.00
#> GSM198776     1    0.00      0.992 1.00 0.00
#> GSM198778     1    0.00      0.992 1.00 0.00
#> GSM198780     1    0.00      0.992 1.00 0.00
#> GSM198781     1    0.00      0.992 1.00 0.00
#> GSM198765     1    0.00      0.992 1.00 0.00
#> GSM198766     1    0.00      0.992 1.00 0.00
#> GSM198768     1    0.00      0.992 1.00 0.00
#> GSM198770     1    0.00      0.992 1.00 0.00
#> GSM198771     1    0.00      0.992 1.00 0.00
#> GSM198774     1    0.00      0.992 1.00 0.00
#> GSM198775     1    0.00      0.992 1.00 0.00
#> GSM198777     1    0.00      0.992 1.00 0.00
#> GSM198779     1    0.00      0.992 1.00 0.00
#> GSM587218     1    0.00      0.992 1.00 0.00
#> GSM587219     1    0.00      0.992 1.00 0.00
#> GSM587220     1    0.00      0.992 1.00 0.00
#> GSM587221     1    0.00      0.992 1.00 0.00
#> GSM587222     1    0.00      0.992 1.00 0.00
#> GSM587223     1    0.00      0.992 1.00 0.00
#> GSM587224     1    0.00      0.992 1.00 0.00
#> GSM587225     1    0.00      0.992 1.00 0.00
#> GSM587226     1    0.00      0.992 1.00 0.00
#> GSM587227     1    0.00      0.992 1.00 0.00
#> GSM587228     1    0.00      0.992 1.00 0.00
#> GSM587229     1    0.00      0.992 1.00 0.00

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1    p2    p3
#> GSM587155     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587156     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587157     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587158     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587159     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587160     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587161     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587162     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587163     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587164     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587165     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587166     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587167     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587168     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587169     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587170     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587171     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587172     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587173     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587174     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587175     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587176     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587177     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587178     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587179     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587180     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587181     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587182     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587183     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587184     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587185     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587186     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587187     3  0.0424      0.989 0.000 0.008 0.992
#> GSM587188     3  0.0424      0.989 0.000 0.008 0.992
#> GSM587189     3  0.0000      0.995 0.000 0.000 1.000
#> GSM587190     3  0.0000      0.995 0.000 0.000 1.000
#> GSM587203     1  0.0000      0.999 1.000 0.000 0.000
#> GSM587204     1  0.0000      0.999 1.000 0.000 0.000
#> GSM587205     1  0.0000      0.999 1.000 0.000 0.000
#> GSM587206     1  0.0000      0.999 1.000 0.000 0.000
#> GSM587207     1  0.0000      0.999 1.000 0.000 0.000
#> GSM587208     1  0.0000      0.999 1.000 0.000 0.000
#> GSM587209     1  0.0000      0.999 1.000 0.000 0.000
#> GSM587210     1  0.0000      0.999 1.000 0.000 0.000
#> GSM587211     1  0.1163      0.972 0.972 0.000 0.028
#> GSM587212     1  0.0000      0.999 1.000 0.000 0.000
#> GSM587213     1  0.0000      0.999 1.000 0.000 0.000
#> GSM587214     1  0.0000      0.999 1.000 0.000 0.000
#> GSM587215     1  0.0747      0.984 0.984 0.000 0.016
#> GSM587216     1  0.0000      0.999 1.000 0.000 0.000
#> GSM587217     1  0.0000      0.999 1.000 0.000 0.000
#> GSM587191     3  0.0000      0.995 0.000 0.000 1.000
#> GSM587192     3  0.1529      0.962 0.040 0.000 0.960
#> GSM587193     3  0.0000      0.995 0.000 0.000 1.000
#> GSM587194     3  0.0000      0.995 0.000 0.000 1.000
#> GSM587195     3  0.0000      0.995 0.000 0.000 1.000
#> GSM587196     3  0.0000      0.995 0.000 0.000 1.000
#> GSM587197     3  0.0000      0.995 0.000 0.000 1.000
#> GSM587198     3  0.0000      0.995 0.000 0.000 1.000
#> GSM587199     3  0.0000      0.995 0.000 0.000 1.000
#> GSM587200     3  0.1031      0.977 0.024 0.000 0.976
#> GSM587201     3  0.1031      0.977 0.024 0.000 0.976
#> GSM587202     3  0.0000      0.995 0.000 0.000 1.000
#> GSM198767     1  0.0000      0.999 1.000 0.000 0.000
#> GSM198769     1  0.0000      0.999 1.000 0.000 0.000
#> GSM198772     1  0.0000      0.999 1.000 0.000 0.000
#> GSM198773     1  0.0000      0.999 1.000 0.000 0.000
#> GSM198776     1  0.0000      0.999 1.000 0.000 0.000
#> GSM198778     1  0.0000      0.999 1.000 0.000 0.000
#> GSM198780     1  0.0000      0.999 1.000 0.000 0.000
#> GSM198781     1  0.0000      0.999 1.000 0.000 0.000
#> GSM198765     3  0.0000      0.995 0.000 0.000 1.000
#> GSM198766     3  0.0000      0.995 0.000 0.000 1.000
#> GSM198768     3  0.0000      0.995 0.000 0.000 1.000
#> GSM198770     3  0.0000      0.995 0.000 0.000 1.000
#> GSM198771     3  0.0000      0.995 0.000 0.000 1.000
#> GSM198774     3  0.0892      0.980 0.020 0.000 0.980
#> GSM198775     3  0.0000      0.995 0.000 0.000 1.000
#> GSM198777     3  0.0000      0.995 0.000 0.000 1.000
#> GSM198779     3  0.0000      0.995 0.000 0.000 1.000
#> GSM587218     1  0.0000      0.999 1.000 0.000 0.000
#> GSM587219     1  0.0000      0.999 1.000 0.000 0.000
#> GSM587220     1  0.0000      0.999 1.000 0.000 0.000
#> GSM587221     1  0.0000      0.999 1.000 0.000 0.000
#> GSM587222     1  0.0000      0.999 1.000 0.000 0.000
#> GSM587223     1  0.0000      0.999 1.000 0.000 0.000
#> GSM587224     1  0.0000      0.999 1.000 0.000 0.000
#> GSM587225     1  0.0000      0.999 1.000 0.000 0.000
#> GSM587226     1  0.0000      0.999 1.000 0.000 0.000
#> GSM587227     1  0.0000      0.999 1.000 0.000 0.000
#> GSM587228     1  0.0000      0.999 1.000 0.000 0.000
#> GSM587229     1  0.0000      0.999 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
#> GSM587155     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587156     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587157     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587158     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587159     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587160     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587161     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587162     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587163     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587164     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587165     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587166     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587167     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587168     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587169     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587170     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587171     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587172     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587173     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587174     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587175     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587176     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587177     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587178     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587179     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587180     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587181     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587182     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587183     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587184     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587185     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587186     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587187     3  0.0336      0.986 0.000 0.008 0.992 0.000
#> GSM587188     3  0.0336      0.986 0.000 0.008 0.992 0.000
#> GSM587189     3  0.0000      0.993 0.000 0.000 1.000 0.000
#> GSM587190     3  0.0000      0.993 0.000 0.000 1.000 0.000
#> GSM587203     4  0.3400      0.778 0.180 0.000 0.000 0.820
#> GSM587204     1  0.0000      0.990 1.000 0.000 0.000 0.000
#> GSM587205     1  0.0000      0.990 1.000 0.000 0.000 0.000
#> GSM587206     1  0.0000      0.990 1.000 0.000 0.000 0.000
#> GSM587207     1  0.0000      0.990 1.000 0.000 0.000 0.000
#> GSM587208     1  0.0000      0.990 1.000 0.000 0.000 0.000
#> GSM587209     1  0.0000      0.990 1.000 0.000 0.000 0.000
#> GSM587210     1  0.0000      0.990 1.000 0.000 0.000 0.000
#> GSM587211     1  0.0000      0.990 1.000 0.000 0.000 0.000
#> GSM587212     1  0.0000      0.990 1.000 0.000 0.000 0.000
#> GSM587213     1  0.0000      0.990 1.000 0.000 0.000 0.000
#> GSM587214     1  0.0000      0.990 1.000 0.000 0.000 0.000
#> GSM587215     1  0.0000      0.990 1.000 0.000 0.000 0.000
#> GSM587216     1  0.0000      0.990 1.000 0.000 0.000 0.000
#> GSM587217     1  0.0000      0.990 1.000 0.000 0.000 0.000
#> GSM587191     3  0.0000      0.993 0.000 0.000 1.000 0.000
#> GSM587192     3  0.1118      0.960 0.036 0.000 0.964 0.000
#> GSM587193     3  0.0000      0.993 0.000 0.000 1.000 0.000
#> GSM587194     3  0.0000      0.993 0.000 0.000 1.000 0.000
#> GSM587195     3  0.0000      0.993 0.000 0.000 1.000 0.000
#> GSM587196     3  0.0000      0.993 0.000 0.000 1.000 0.000
#> GSM587197     3  0.0000      0.993 0.000 0.000 1.000 0.000
#> GSM587198     3  0.0000      0.993 0.000 0.000 1.000 0.000
#> GSM587199     3  0.0000      0.993 0.000 0.000 1.000 0.000
#> GSM587200     3  0.0921      0.968 0.028 0.000 0.972 0.000
#> GSM587201     3  0.0817      0.972 0.024 0.000 0.976 0.000
#> GSM587202     3  0.0000      0.993 0.000 0.000 1.000 0.000
#> GSM198767     1  0.0000      0.990 1.000 0.000 0.000 0.000
#> GSM198769     1  0.0000      0.990 1.000 0.000 0.000 0.000
#> GSM198772     1  0.0000      0.990 1.000 0.000 0.000 0.000
#> GSM198773     1  0.0000      0.990 1.000 0.000 0.000 0.000
#> GSM198776     1  0.0000      0.990 1.000 0.000 0.000 0.000
#> GSM198778     1  0.0000      0.990 1.000 0.000 0.000 0.000
#> GSM198780     1  0.0000      0.990 1.000 0.000 0.000 0.000
#> GSM198781     1  0.0000      0.990 1.000 0.000 0.000 0.000
#> GSM198765     3  0.0000      0.993 0.000 0.000 1.000 0.000
#> GSM198766     3  0.0000      0.993 0.000 0.000 1.000 0.000
#> GSM198768     3  0.0000      0.993 0.000 0.000 1.000 0.000
#> GSM198770     3  0.0000      0.993 0.000 0.000 1.000 0.000
#> GSM198771     3  0.0000      0.993 0.000 0.000 1.000 0.000
#> GSM198774     3  0.1022      0.964 0.032 0.000 0.968 0.000
#> GSM198775     3  0.0000      0.993 0.000 0.000 1.000 0.000
#> GSM198777     3  0.0000      0.993 0.000 0.000 1.000 0.000
#> GSM198779     3  0.0000      0.993 0.000 0.000 1.000 0.000
#> GSM587218     4  0.0000      0.916 0.000 0.000 0.000 1.000
#> GSM587219     4  0.0000      0.916 0.000 0.000 0.000 1.000
#> GSM587220     4  0.0000      0.916 0.000 0.000 0.000 1.000
#> GSM587221     4  0.0000      0.916 0.000 0.000 0.000 1.000
#> GSM587222     4  0.0000      0.916 0.000 0.000 0.000 1.000
#> GSM587223     4  0.0000      0.916 0.000 0.000 0.000 1.000
#> GSM587224     4  0.0000      0.916 0.000 0.000 0.000 1.000
#> GSM587225     4  0.4866      0.395 0.404 0.000 0.000 0.596
#> GSM587226     4  0.0000      0.916 0.000 0.000 0.000 1.000
#> GSM587227     1  0.2530      0.866 0.888 0.000 0.000 0.112
#> GSM587228     4  0.3975      0.697 0.240 0.000 0.000 0.760
#> GSM587229     1  0.2345      0.882 0.900 0.000 0.000 0.100

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM587155     2  0.0000      1.000 0.000 1.000 0.000 0.000 0.000
#> GSM587156     2  0.0000      1.000 0.000 1.000 0.000 0.000 0.000
#> GSM587157     2  0.0000      1.000 0.000 1.000 0.000 0.000 0.000
#> GSM587158     2  0.0000      1.000 0.000 1.000 0.000 0.000 0.000
#> GSM587159     2  0.0000      1.000 0.000 1.000 0.000 0.000 0.000
#> GSM587160     2  0.0000      1.000 0.000 1.000 0.000 0.000 0.000
#> GSM587161     2  0.0000      1.000 0.000 1.000 0.000 0.000 0.000
#> GSM587162     2  0.0000      1.000 0.000 1.000 0.000 0.000 0.000
#> GSM587163     2  0.0000      1.000 0.000 1.000 0.000 0.000 0.000
#> GSM587164     2  0.0000      1.000 0.000 1.000 0.000 0.000 0.000
#> GSM587165     2  0.0000      1.000 0.000 1.000 0.000 0.000 0.000
#> GSM587166     2  0.0000      1.000 0.000 1.000 0.000 0.000 0.000
#> GSM587167     2  0.0000      1.000 0.000 1.000 0.000 0.000 0.000
#> GSM587168     2  0.0000      1.000 0.000 1.000 0.000 0.000 0.000
#> GSM587169     2  0.0000      1.000 0.000 1.000 0.000 0.000 0.000
#> GSM587170     2  0.0000      1.000 0.000 1.000 0.000 0.000 0.000
#> GSM587171     2  0.0000      1.000 0.000 1.000 0.000 0.000 0.000
#> GSM587172     2  0.0000      1.000 0.000 1.000 0.000 0.000 0.000
#> GSM587173     2  0.0000      1.000 0.000 1.000 0.000 0.000 0.000
#> GSM587174     2  0.0000      1.000 0.000 1.000 0.000 0.000 0.000
#> GSM587175     2  0.0000      1.000 0.000 1.000 0.000 0.000 0.000
#> GSM587176     2  0.0000      1.000 0.000 1.000 0.000 0.000 0.000
#> GSM587177     2  0.0000      1.000 0.000 1.000 0.000 0.000 0.000
#> GSM587178     2  0.0000      1.000 0.000 1.000 0.000 0.000 0.000
#> GSM587179     2  0.0000      1.000 0.000 1.000 0.000 0.000 0.000
#> GSM587180     2  0.0000      1.000 0.000 1.000 0.000 0.000 0.000
#> GSM587181     2  0.0000      1.000 0.000 1.000 0.000 0.000 0.000
#> GSM587182     2  0.0000      1.000 0.000 1.000 0.000 0.000 0.000
#> GSM587183     2  0.0000      1.000 0.000 1.000 0.000 0.000 0.000
#> GSM587184     2  0.0000      1.000 0.000 1.000 0.000 0.000 0.000
#> GSM587185     2  0.0000      1.000 0.000 1.000 0.000 0.000 0.000
#> GSM587186     2  0.0404      0.988 0.000 0.988 0.000 0.000 0.012
#> GSM587187     3  0.0703      0.984 0.000 0.000 0.976 0.000 0.024
#> GSM587188     3  0.0703      0.984 0.000 0.000 0.976 0.000 0.024
#> GSM587189     3  0.0703      0.984 0.000 0.000 0.976 0.000 0.024
#> GSM587190     3  0.0703      0.984 0.000 0.000 0.976 0.000 0.024
#> GSM587203     5  0.0865      0.965 0.004 0.000 0.000 0.024 0.972
#> GSM587204     1  0.0162      0.971 0.996 0.000 0.000 0.000 0.004
#> GSM587205     5  0.0794      0.980 0.028 0.000 0.000 0.000 0.972
#> GSM587206     5  0.0794      0.980 0.028 0.000 0.000 0.000 0.972
#> GSM587207     5  0.0794      0.980 0.028 0.000 0.000 0.000 0.972
#> GSM587208     5  0.0794      0.980 0.028 0.000 0.000 0.000 0.972
#> GSM587209     1  0.1478      0.933 0.936 0.000 0.000 0.000 0.064
#> GSM587210     1  0.0162      0.971 0.996 0.000 0.000 0.000 0.004
#> GSM587211     1  0.0865      0.961 0.972 0.000 0.004 0.000 0.024
#> GSM587212     1  0.0162      0.971 0.996 0.000 0.000 0.000 0.004
#> GSM587213     1  0.1121      0.949 0.956 0.000 0.000 0.000 0.044
#> GSM587214     1  0.0162      0.970 0.996 0.000 0.000 0.000 0.004
#> GSM587215     1  0.0000      0.971 1.000 0.000 0.000 0.000 0.000
#> GSM587216     1  0.0162      0.971 0.996 0.000 0.000 0.000 0.004
#> GSM587217     1  0.0162      0.971 0.996 0.000 0.000 0.000 0.004
#> GSM587191     3  0.0609      0.984 0.000 0.000 0.980 0.000 0.020
#> GSM587192     3  0.0324      0.988 0.004 0.000 0.992 0.000 0.004
#> GSM587193     3  0.0162      0.994 0.000 0.000 0.996 0.000 0.004
#> GSM587194     3  0.0000      0.994 0.000 0.000 1.000 0.000 0.000
#> GSM587195     3  0.0162      0.994 0.000 0.000 0.996 0.000 0.004
#> GSM587196     3  0.0000      0.994 0.000 0.000 1.000 0.000 0.000
#> GSM587197     3  0.0162      0.994 0.000 0.000 0.996 0.000 0.004
#> GSM587198     3  0.0162      0.994 0.000 0.000 0.996 0.000 0.004
#> GSM587199     3  0.0000      0.994 0.000 0.000 1.000 0.000 0.000
#> GSM587200     5  0.0794      0.960 0.000 0.000 0.028 0.000 0.972
#> GSM587201     5  0.0794      0.960 0.000 0.000 0.028 0.000 0.972
#> GSM587202     3  0.0162      0.994 0.000 0.000 0.996 0.000 0.004
#> GSM198767     5  0.0794      0.976 0.028 0.000 0.000 0.000 0.972
#> GSM198769     1  0.0510      0.966 0.984 0.000 0.000 0.000 0.016
#> GSM198772     1  0.0162      0.970 0.996 0.000 0.000 0.000 0.004
#> GSM198773     1  0.0510      0.966 0.984 0.000 0.000 0.000 0.016
#> GSM198776     1  0.0162      0.971 0.996 0.000 0.000 0.000 0.004
#> GSM198778     1  0.0162      0.971 0.996 0.000 0.000 0.000 0.004
#> GSM198780     1  0.0162      0.971 0.996 0.000 0.000 0.000 0.004
#> GSM198781     1  0.0162      0.970 0.996 0.000 0.000 0.000 0.004
#> GSM198765     3  0.0000      0.994 0.000 0.000 1.000 0.000 0.000
#> GSM198766     3  0.0000      0.994 0.000 0.000 1.000 0.000 0.000
#> GSM198768     3  0.0162      0.994 0.000 0.000 0.996 0.000 0.004
#> GSM198770     3  0.0162      0.994 0.000 0.000 0.996 0.000 0.004
#> GSM198771     3  0.0162      0.994 0.000 0.000 0.996 0.000 0.004
#> GSM198774     3  0.0000      0.994 0.000 0.000 1.000 0.000 0.000
#> GSM198775     3  0.0000      0.994 0.000 0.000 1.000 0.000 0.000
#> GSM198777     3  0.0000      0.994 0.000 0.000 1.000 0.000 0.000
#> GSM198779     3  0.0000      0.994 0.000 0.000 1.000 0.000 0.000
#> GSM587218     4  0.0000      0.913 0.000 0.000 0.000 1.000 0.000
#> GSM587219     4  0.0000      0.913 0.000 0.000 0.000 1.000 0.000
#> GSM587220     4  0.0000      0.913 0.000 0.000 0.000 1.000 0.000
#> GSM587221     4  0.0000      0.913 0.000 0.000 0.000 1.000 0.000
#> GSM587222     4  0.0000      0.913 0.000 0.000 0.000 1.000 0.000
#> GSM587223     4  0.0000      0.913 0.000 0.000 0.000 1.000 0.000
#> GSM587224     4  0.0000      0.913 0.000 0.000 0.000 1.000 0.000
#> GSM587225     4  0.4321      0.386 0.396 0.000 0.000 0.600 0.004
#> GSM587226     4  0.0000      0.913 0.000 0.000 0.000 1.000 0.000
#> GSM587227     1  0.3109      0.746 0.800 0.000 0.000 0.200 0.000
#> GSM587228     4  0.3305      0.698 0.224 0.000 0.000 0.776 0.000
#> GSM587229     1  0.2179      0.881 0.896 0.000 0.000 0.100 0.004

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM587155     2  0.0000      0.994 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587156     2  0.0000      0.994 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587157     2  0.0000      0.994 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587158     2  0.0000      0.994 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587159     2  0.0000      0.994 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587160     2  0.0000      0.994 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587161     2  0.0000      0.994 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587162     2  0.0000      0.994 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587163     2  0.0000      0.994 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587164     2  0.0000      0.994 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587165     2  0.0000      0.994 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587166     2  0.0000      0.994 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587167     2  0.0000      0.994 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587168     2  0.0000      0.994 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587169     2  0.0000      0.994 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587170     2  0.0000      0.994 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587171     2  0.0000      0.994 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587172     2  0.0000      0.994 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587173     2  0.0000      0.994 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587174     2  0.0000      0.994 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587175     2  0.0000      0.994 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587176     2  0.0000      0.994 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587177     2  0.0000      0.994 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587178     2  0.0000      0.994 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587179     2  0.0000      0.994 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587180     2  0.0000      0.994 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587181     2  0.0000      0.994 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587182     2  0.0000      0.994 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587183     2  0.0000      0.994 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587184     2  0.0000      0.994 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587185     2  0.0000      0.994 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587186     2  0.2871      0.772 0.000 0.804 0.000 0.000 0.192 0.004
#> GSM587187     3  0.3136      0.678 0.000 0.000 0.768 0.000 0.228 0.004
#> GSM587188     3  0.3360      0.662 0.000 0.000 0.732 0.000 0.264 0.004
#> GSM587189     3  0.3314      0.668 0.000 0.000 0.740 0.000 0.256 0.004
#> GSM587190     3  0.3468      0.656 0.000 0.000 0.712 0.000 0.284 0.004
#> GSM587203     6  0.0146      0.958 0.000 0.000 0.000 0.004 0.000 0.996
#> GSM587204     1  0.0000      0.930 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM587205     6  0.0146      0.961 0.004 0.000 0.000 0.000 0.000 0.996
#> GSM587206     6  0.0146      0.961 0.004 0.000 0.000 0.000 0.000 0.996
#> GSM587207     6  0.0146      0.961 0.004 0.000 0.000 0.000 0.000 0.996
#> GSM587208     6  0.0146      0.961 0.004 0.000 0.000 0.000 0.000 0.996
#> GSM587209     1  0.3078      0.899 0.836 0.000 0.000 0.000 0.108 0.056
#> GSM587210     1  0.0000      0.930 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM587211     1  0.3075      0.904 0.844 0.000 0.008 0.000 0.108 0.040
#> GSM587212     1  0.0000      0.930 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM587213     1  0.2822      0.907 0.852 0.000 0.000 0.000 0.108 0.040
#> GSM587214     1  0.1910      0.917 0.892 0.000 0.000 0.000 0.108 0.000
#> GSM587215     1  0.0260      0.930 0.992 0.000 0.000 0.000 0.008 0.000
#> GSM587216     1  0.0000      0.930 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM587217     1  0.0000      0.930 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM587191     5  0.2092      0.674 0.000 0.000 0.124 0.000 0.876 0.000
#> GSM587192     5  0.3782      0.889 0.004 0.000 0.360 0.000 0.636 0.000
#> GSM587193     5  0.3592      0.875 0.000 0.000 0.344 0.000 0.656 0.000
#> GSM587194     3  0.0260      0.872 0.000 0.000 0.992 0.000 0.008 0.000
#> GSM587195     3  0.0146      0.871 0.000 0.000 0.996 0.000 0.004 0.000
#> GSM587196     3  0.0260      0.872 0.000 0.000 0.992 0.000 0.008 0.000
#> GSM587197     3  0.1267      0.846 0.000 0.000 0.940 0.000 0.060 0.000
#> GSM587198     3  0.1267      0.845 0.000 0.000 0.940 0.000 0.060 0.000
#> GSM587199     3  0.0260      0.872 0.000 0.000 0.992 0.000 0.008 0.000
#> GSM587200     6  0.2176      0.879 0.000 0.000 0.080 0.000 0.024 0.896
#> GSM587201     6  0.2255      0.875 0.000 0.000 0.080 0.000 0.028 0.892
#> GSM587202     3  0.0713      0.861 0.000 0.000 0.972 0.000 0.028 0.000
#> GSM198767     6  0.0291      0.959 0.004 0.000 0.000 0.000 0.004 0.992
#> GSM198769     1  0.2822      0.907 0.852 0.000 0.000 0.000 0.108 0.040
#> GSM198772     1  0.2822      0.907 0.852 0.000 0.000 0.000 0.108 0.040
#> GSM198773     1  0.2822      0.907 0.852 0.000 0.000 0.000 0.108 0.040
#> GSM198776     1  0.0000      0.930 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM198778     1  0.0000      0.930 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM198780     1  0.0000      0.930 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM198781     1  0.1910      0.917 0.892 0.000 0.000 0.000 0.108 0.000
#> GSM198765     5  0.3659      0.888 0.000 0.000 0.364 0.000 0.636 0.000
#> GSM198766     5  0.3351      0.852 0.000 0.000 0.288 0.000 0.712 0.000
#> GSM198768     3  0.0000      0.871 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM198770     3  0.2378      0.715 0.000 0.000 0.848 0.000 0.152 0.000
#> GSM198771     3  0.0790      0.859 0.000 0.000 0.968 0.000 0.032 0.000
#> GSM198774     5  0.3672      0.886 0.000 0.000 0.368 0.000 0.632 0.000
#> GSM198775     3  0.0260      0.872 0.000 0.000 0.992 0.000 0.008 0.000
#> GSM198777     3  0.0260      0.872 0.000 0.000 0.992 0.000 0.008 0.000
#> GSM198779     3  0.0260      0.872 0.000 0.000 0.992 0.000 0.008 0.000
#> GSM587218     4  0.0000      0.918 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM587219     4  0.0000      0.918 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM587220     4  0.0000      0.918 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM587221     4  0.0000      0.918 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM587222     4  0.0000      0.918 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM587223     4  0.0000      0.918 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM587224     4  0.0000      0.918 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM587225     4  0.3672      0.486 0.368 0.000 0.000 0.632 0.000 0.000
#> GSM587226     4  0.0000      0.918 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM587227     1  0.2631      0.777 0.820 0.000 0.000 0.180 0.000 0.000
#> GSM587228     4  0.2996      0.697 0.228 0.000 0.000 0.772 0.000 0.000
#> GSM587229     1  0.1141      0.898 0.948 0.000 0.000 0.052 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 specimen(p) k
#> ATC:pam 91    1.88e-17 2
#> ATC:pam 92    6.44e-33 3
#> ATC:pam 91    9.29e-41 4
#> ATC:pam 91    1.00e-38 5
#> ATC:pam 91    4.25e-37 6

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


ATC:mclust*

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

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

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

res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#>   On a matrix with 51941 rows and 92 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 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-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           1.000       1.000         0.4288 0.572   0.572
#> 3 3 0.914           0.964       0.976         0.2890 0.893   0.813
#> 4 4 0.782           0.860       0.923         0.2452 0.842   0.659
#> 5 5 0.757           0.812       0.849         0.0886 0.854   0.585
#> 6 6 0.754           0.687       0.802         0.0470 0.917   0.693

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
#> GSM587155     2  0.0000      1.000 0.000 1.000
#> GSM587156     2  0.0000      1.000 0.000 1.000
#> GSM587157     2  0.0000      1.000 0.000 1.000
#> GSM587158     2  0.0000      1.000 0.000 1.000
#> GSM587159     2  0.0000      1.000 0.000 1.000
#> GSM587160     2  0.0000      1.000 0.000 1.000
#> GSM587161     2  0.0000      1.000 0.000 1.000
#> GSM587162     2  0.0000      1.000 0.000 1.000
#> GSM587163     2  0.0000      1.000 0.000 1.000
#> GSM587164     2  0.0000      1.000 0.000 1.000
#> GSM587165     2  0.0000      1.000 0.000 1.000
#> GSM587166     2  0.0000      1.000 0.000 1.000
#> GSM587167     2  0.0000      1.000 0.000 1.000
#> GSM587168     2  0.0000      1.000 0.000 1.000
#> GSM587169     2  0.0000      1.000 0.000 1.000
#> GSM587170     2  0.0000      1.000 0.000 1.000
#> GSM587171     2  0.0000      1.000 0.000 1.000
#> GSM587172     2  0.0000      1.000 0.000 1.000
#> GSM587173     2  0.0000      1.000 0.000 1.000
#> GSM587174     2  0.0000      1.000 0.000 1.000
#> GSM587175     2  0.0000      1.000 0.000 1.000
#> GSM587176     2  0.0000      1.000 0.000 1.000
#> GSM587177     2  0.0000      1.000 0.000 1.000
#> GSM587178     2  0.0000      1.000 0.000 1.000
#> GSM587179     2  0.0000      1.000 0.000 1.000
#> GSM587180     2  0.0000      1.000 0.000 1.000
#> GSM587181     2  0.0000      1.000 0.000 1.000
#> GSM587182     2  0.0000      1.000 0.000 1.000
#> GSM587183     1  0.0376      0.996 0.996 0.004
#> GSM587184     1  0.0376      0.996 0.996 0.004
#> GSM587185     1  0.0376      0.996 0.996 0.004
#> GSM587186     1  0.0376      0.996 0.996 0.004
#> GSM587187     1  0.0000      1.000 1.000 0.000
#> GSM587188     1  0.0000      1.000 1.000 0.000
#> GSM587189     1  0.0000      1.000 1.000 0.000
#> GSM587190     1  0.0000      1.000 1.000 0.000
#> GSM587203     1  0.0000      1.000 1.000 0.000
#> GSM587204     1  0.0000      1.000 1.000 0.000
#> GSM587205     1  0.0000      1.000 1.000 0.000
#> GSM587206     1  0.0000      1.000 1.000 0.000
#> GSM587207     1  0.0000      1.000 1.000 0.000
#> GSM587208     1  0.0000      1.000 1.000 0.000
#> GSM587209     1  0.0000      1.000 1.000 0.000
#> GSM587210     1  0.0000      1.000 1.000 0.000
#> GSM587211     1  0.0000      1.000 1.000 0.000
#> GSM587212     1  0.0000      1.000 1.000 0.000
#> GSM587213     1  0.0000      1.000 1.000 0.000
#> GSM587214     1  0.0000      1.000 1.000 0.000
#> GSM587215     1  0.0000      1.000 1.000 0.000
#> GSM587216     1  0.0000      1.000 1.000 0.000
#> GSM587217     1  0.0000      1.000 1.000 0.000
#> GSM587191     1  0.0000      1.000 1.000 0.000
#> GSM587192     1  0.0000      1.000 1.000 0.000
#> GSM587193     1  0.0000      1.000 1.000 0.000
#> GSM587194     1  0.0000      1.000 1.000 0.000
#> GSM587195     1  0.0000      1.000 1.000 0.000
#> GSM587196     1  0.0000      1.000 1.000 0.000
#> GSM587197     1  0.0000      1.000 1.000 0.000
#> GSM587198     1  0.0000      1.000 1.000 0.000
#> GSM587199     1  0.0000      1.000 1.000 0.000
#> GSM587200     1  0.0000      1.000 1.000 0.000
#> GSM587201     1  0.0000      1.000 1.000 0.000
#> GSM587202     1  0.0000      1.000 1.000 0.000
#> GSM198767     1  0.0000      1.000 1.000 0.000
#> GSM198769     1  0.0000      1.000 1.000 0.000
#> GSM198772     1  0.0000      1.000 1.000 0.000
#> GSM198773     1  0.0000      1.000 1.000 0.000
#> GSM198776     1  0.0000      1.000 1.000 0.000
#> GSM198778     1  0.0000      1.000 1.000 0.000
#> GSM198780     1  0.0000      1.000 1.000 0.000
#> GSM198781     1  0.0000      1.000 1.000 0.000
#> GSM198765     1  0.0000      1.000 1.000 0.000
#> GSM198766     1  0.0000      1.000 1.000 0.000
#> GSM198768     1  0.0000      1.000 1.000 0.000
#> GSM198770     1  0.0000      1.000 1.000 0.000
#> GSM198771     1  0.0000      1.000 1.000 0.000
#> GSM198774     1  0.0000      1.000 1.000 0.000
#> GSM198775     1  0.0000      1.000 1.000 0.000
#> GSM198777     1  0.0000      1.000 1.000 0.000
#> GSM198779     1  0.0000      1.000 1.000 0.000
#> GSM587218     1  0.0000      1.000 1.000 0.000
#> GSM587219     1  0.0000      1.000 1.000 0.000
#> GSM587220     1  0.0000      1.000 1.000 0.000
#> GSM587221     1  0.0000      1.000 1.000 0.000
#> GSM587222     1  0.0000      1.000 1.000 0.000
#> GSM587223     1  0.0000      1.000 1.000 0.000
#> GSM587224     1  0.0000      1.000 1.000 0.000
#> GSM587225     1  0.0000      1.000 1.000 0.000
#> GSM587226     1  0.0000      1.000 1.000 0.000
#> GSM587227     1  0.0000      1.000 1.000 0.000
#> GSM587228     1  0.0000      1.000 1.000 0.000
#> GSM587229     1  0.0000      1.000 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1    p2    p3
#> GSM587155     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587156     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587157     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587158     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587159     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587160     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587161     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587162     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587163     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587164     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587165     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587166     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587167     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587168     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587169     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587170     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587171     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587172     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587173     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587174     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587175     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587176     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587177     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587178     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587179     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587180     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587181     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587182     2  0.0000      1.000 0.000 1.000 0.000
#> GSM587183     3  0.4047      0.871 0.148 0.004 0.848
#> GSM587184     3  0.4047      0.871 0.148 0.004 0.848
#> GSM587185     3  0.4047      0.871 0.148 0.004 0.848
#> GSM587186     3  0.4047      0.871 0.148 0.004 0.848
#> GSM587187     3  0.2537      0.924 0.080 0.000 0.920
#> GSM587188     3  0.2537      0.924 0.080 0.000 0.920
#> GSM587189     3  0.2537      0.924 0.080 0.000 0.920
#> GSM587190     3  0.2165      0.933 0.064 0.000 0.936
#> GSM587203     3  0.3116      0.910 0.108 0.000 0.892
#> GSM587204     3  0.0237      0.960 0.004 0.000 0.996
#> GSM587205     3  0.0424      0.960 0.008 0.000 0.992
#> GSM587206     3  0.0424      0.960 0.008 0.000 0.992
#> GSM587207     3  0.0424      0.960 0.008 0.000 0.992
#> GSM587208     3  0.0424      0.960 0.008 0.000 0.992
#> GSM587209     3  0.0424      0.960 0.008 0.000 0.992
#> GSM587210     3  0.3619      0.887 0.136 0.000 0.864
#> GSM587211     3  0.0237      0.960 0.004 0.000 0.996
#> GSM587212     3  0.0237      0.960 0.004 0.000 0.996
#> GSM587213     3  0.0237      0.960 0.004 0.000 0.996
#> GSM587214     3  0.0424      0.960 0.008 0.000 0.992
#> GSM587215     3  0.0000      0.960 0.000 0.000 1.000
#> GSM587216     3  0.0237      0.960 0.004 0.000 0.996
#> GSM587217     3  0.0424      0.960 0.008 0.000 0.992
#> GSM587191     3  0.0000      0.960 0.000 0.000 1.000
#> GSM587192     3  0.0000      0.960 0.000 0.000 1.000
#> GSM587193     3  0.0000      0.960 0.000 0.000 1.000
#> GSM587194     3  0.0000      0.960 0.000 0.000 1.000
#> GSM587195     3  0.1163      0.950 0.028 0.000 0.972
#> GSM587196     3  0.0000      0.960 0.000 0.000 1.000
#> GSM587197     3  0.2448      0.926 0.076 0.000 0.924
#> GSM587198     3  0.0000      0.960 0.000 0.000 1.000
#> GSM587199     3  0.0000      0.960 0.000 0.000 1.000
#> GSM587200     3  0.0000      0.960 0.000 0.000 1.000
#> GSM587201     3  0.0000      0.960 0.000 0.000 1.000
#> GSM587202     3  0.0000      0.960 0.000 0.000 1.000
#> GSM198767     3  0.0424      0.960 0.008 0.000 0.992
#> GSM198769     3  0.0424      0.960 0.008 0.000 0.992
#> GSM198772     3  0.0424      0.960 0.008 0.000 0.992
#> GSM198773     3  0.0424      0.960 0.008 0.000 0.992
#> GSM198776     3  0.0237      0.960 0.004 0.000 0.996
#> GSM198778     3  0.3551      0.890 0.132 0.000 0.868
#> GSM198780     3  0.0237      0.960 0.004 0.000 0.996
#> GSM198781     3  0.0424      0.960 0.008 0.000 0.992
#> GSM198765     3  0.0000      0.960 0.000 0.000 1.000
#> GSM198766     3  0.0000      0.960 0.000 0.000 1.000
#> GSM198768     3  0.0000      0.960 0.000 0.000 1.000
#> GSM198770     3  0.2356      0.929 0.072 0.000 0.928
#> GSM198771     3  0.0000      0.960 0.000 0.000 1.000
#> GSM198774     3  0.0000      0.960 0.000 0.000 1.000
#> GSM198775     3  0.0000      0.960 0.000 0.000 1.000
#> GSM198777     3  0.0000      0.960 0.000 0.000 1.000
#> GSM198779     3  0.0000      0.960 0.000 0.000 1.000
#> GSM587218     1  0.0000      1.000 1.000 0.000 0.000
#> GSM587219     1  0.0000      1.000 1.000 0.000 0.000
#> GSM587220     1  0.0000      1.000 1.000 0.000 0.000
#> GSM587221     1  0.0000      1.000 1.000 0.000 0.000
#> GSM587222     1  0.0000      1.000 1.000 0.000 0.000
#> GSM587223     1  0.0000      1.000 1.000 0.000 0.000
#> GSM587224     1  0.0000      1.000 1.000 0.000 0.000
#> GSM587225     3  0.3941      0.871 0.156 0.000 0.844
#> GSM587226     1  0.0000      1.000 1.000 0.000 0.000
#> GSM587227     3  0.3941      0.871 0.156 0.000 0.844
#> GSM587228     3  0.3941      0.871 0.156 0.000 0.844
#> GSM587229     3  0.3941      0.871 0.156 0.000 0.844

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM587155     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587156     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587157     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587158     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587159     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587160     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587161     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587162     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587163     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587164     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587165     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587166     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587167     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587168     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587169     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587170     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587171     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587172     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587173     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587174     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587175     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587176     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587177     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587178     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587179     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587180     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587181     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587182     2  0.0000      1.000 0.000 1.000 0.000 0.000
#> GSM587183     3  0.0657      0.715 0.000 0.012 0.984 0.004
#> GSM587184     3  0.0657      0.715 0.000 0.012 0.984 0.004
#> GSM587185     3  0.0657      0.715 0.000 0.012 0.984 0.004
#> GSM587186     3  0.0657      0.715 0.000 0.012 0.984 0.004
#> GSM587187     3  0.3942      0.703 0.236 0.000 0.764 0.000
#> GSM587188     3  0.3942      0.703 0.236 0.000 0.764 0.000
#> GSM587189     3  0.3942      0.703 0.236 0.000 0.764 0.000
#> GSM587190     3  0.4008      0.694 0.244 0.000 0.756 0.000
#> GSM587203     1  0.4283      0.495 0.740 0.000 0.256 0.004
#> GSM587204     1  0.1022      0.873 0.968 0.000 0.032 0.000
#> GSM587205     1  0.0188      0.868 0.996 0.000 0.004 0.000
#> GSM587206     1  0.0188      0.868 0.996 0.000 0.004 0.000
#> GSM587207     1  0.0188      0.868 0.996 0.000 0.004 0.000
#> GSM587208     1  0.0188      0.868 0.996 0.000 0.004 0.000
#> GSM587209     1  0.0188      0.868 0.996 0.000 0.004 0.000
#> GSM587210     1  0.4319      0.571 0.760 0.000 0.228 0.012
#> GSM587211     1  0.1302      0.873 0.956 0.000 0.044 0.000
#> GSM587212     1  0.0927      0.867 0.976 0.000 0.016 0.008
#> GSM587213     1  0.0921      0.872 0.972 0.000 0.028 0.000
#> GSM587214     1  0.0188      0.869 0.996 0.000 0.004 0.000
#> GSM587215     1  0.1211      0.873 0.960 0.000 0.040 0.000
#> GSM587216     1  0.0188      0.869 0.996 0.000 0.004 0.000
#> GSM587217     1  0.0188      0.869 0.996 0.000 0.004 0.000
#> GSM587191     1  0.3172      0.843 0.840 0.000 0.160 0.000
#> GSM587192     1  0.3123      0.844 0.844 0.000 0.156 0.000
#> GSM587193     1  0.3172      0.843 0.840 0.000 0.160 0.000
#> GSM587194     1  0.3172      0.843 0.840 0.000 0.160 0.000
#> GSM587195     3  0.4382      0.617 0.296 0.000 0.704 0.000
#> GSM587196     1  0.3266      0.838 0.832 0.000 0.168 0.000
#> GSM587197     3  0.2281      0.753 0.096 0.000 0.904 0.000
#> GSM587198     3  0.4730      0.462 0.364 0.000 0.636 0.000
#> GSM587199     1  0.3266      0.838 0.832 0.000 0.168 0.000
#> GSM587200     1  0.3123      0.846 0.844 0.000 0.156 0.000
#> GSM587201     1  0.3123      0.846 0.844 0.000 0.156 0.000
#> GSM587202     1  0.3219      0.843 0.836 0.000 0.164 0.000
#> GSM198767     1  0.0188      0.868 0.996 0.000 0.004 0.000
#> GSM198769     1  0.0188      0.868 0.996 0.000 0.004 0.000
#> GSM198772     1  0.0188      0.868 0.996 0.000 0.004 0.000
#> GSM198773     1  0.0188      0.868 0.996 0.000 0.004 0.000
#> GSM198776     1  0.1022      0.873 0.968 0.000 0.032 0.000
#> GSM198778     1  0.4387      0.556 0.752 0.000 0.236 0.012
#> GSM198780     1  0.1151      0.866 0.968 0.000 0.024 0.008
#> GSM198781     1  0.0188      0.869 0.996 0.000 0.004 0.000
#> GSM198765     1  0.3172      0.843 0.840 0.000 0.160 0.000
#> GSM198766     1  0.3172      0.843 0.840 0.000 0.160 0.000
#> GSM198768     3  0.4967      0.196 0.452 0.000 0.548 0.000
#> GSM198770     3  0.2281      0.753 0.096 0.000 0.904 0.000
#> GSM198771     1  0.4776      0.448 0.624 0.000 0.376 0.000
#> GSM198774     1  0.3123      0.844 0.844 0.000 0.156 0.000
#> GSM198775     1  0.3172      0.843 0.840 0.000 0.160 0.000
#> GSM198777     1  0.3266      0.838 0.832 0.000 0.168 0.000
#> GSM198779     1  0.3266      0.838 0.832 0.000 0.168 0.000
#> GSM587218     4  0.0000      1.000 0.000 0.000 0.000 1.000
#> GSM587219     4  0.0000      1.000 0.000 0.000 0.000 1.000
#> GSM587220     4  0.0000      1.000 0.000 0.000 0.000 1.000
#> GSM587221     4  0.0000      1.000 0.000 0.000 0.000 1.000
#> GSM587222     4  0.0000      1.000 0.000 0.000 0.000 1.000
#> GSM587223     4  0.0000      1.000 0.000 0.000 0.000 1.000
#> GSM587224     4  0.0000      1.000 0.000 0.000 0.000 1.000
#> GSM587225     3  0.3428      0.657 0.144 0.000 0.844 0.012
#> GSM587226     4  0.0000      1.000 0.000 0.000 0.000 1.000
#> GSM587227     3  0.3428      0.657 0.144 0.000 0.844 0.012
#> GSM587228     3  0.3428      0.657 0.144 0.000 0.844 0.012
#> GSM587229     3  0.3428      0.657 0.144 0.000 0.844 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
#> GSM587155     2  0.0000      0.999 0.000 1.000 0.000  0 0.000
#> GSM587156     2  0.0404      0.984 0.000 0.988 0.012  0 0.000
#> GSM587157     2  0.0000      0.999 0.000 1.000 0.000  0 0.000
#> GSM587158     2  0.0000      0.999 0.000 1.000 0.000  0 0.000
#> GSM587159     2  0.0000      0.999 0.000 1.000 0.000  0 0.000
#> GSM587160     2  0.0000      0.999 0.000 1.000 0.000  0 0.000
#> GSM587161     2  0.0000      0.999 0.000 1.000 0.000  0 0.000
#> GSM587162     2  0.0000      0.999 0.000 1.000 0.000  0 0.000
#> GSM587163     2  0.0000      0.999 0.000 1.000 0.000  0 0.000
#> GSM587164     2  0.0000      0.999 0.000 1.000 0.000  0 0.000
#> GSM587165     2  0.0000      0.999 0.000 1.000 0.000  0 0.000
#> GSM587166     2  0.0404      0.984 0.000 0.988 0.012  0 0.000
#> GSM587167     2  0.0000      0.999 0.000 1.000 0.000  0 0.000
#> GSM587168     2  0.0000      0.999 0.000 1.000 0.000  0 0.000
#> GSM587169     2  0.0000      0.999 0.000 1.000 0.000  0 0.000
#> GSM587170     2  0.0000      0.999 0.000 1.000 0.000  0 0.000
#> GSM587171     2  0.0000      0.999 0.000 1.000 0.000  0 0.000
#> GSM587172     2  0.0000      0.999 0.000 1.000 0.000  0 0.000
#> GSM587173     2  0.0000      0.999 0.000 1.000 0.000  0 0.000
#> GSM587174     2  0.0000      0.999 0.000 1.000 0.000  0 0.000
#> GSM587175     2  0.0000      0.999 0.000 1.000 0.000  0 0.000
#> GSM587176     2  0.0000      0.999 0.000 1.000 0.000  0 0.000
#> GSM587177     2  0.0000      0.999 0.000 1.000 0.000  0 0.000
#> GSM587178     2  0.0000      0.999 0.000 1.000 0.000  0 0.000
#> GSM587179     2  0.0000      0.999 0.000 1.000 0.000  0 0.000
#> GSM587180     2  0.0000      0.999 0.000 1.000 0.000  0 0.000
#> GSM587181     2  0.0000      0.999 0.000 1.000 0.000  0 0.000
#> GSM587182     2  0.0000      0.999 0.000 1.000 0.000  0 0.000
#> GSM587183     3  0.3333      0.697 0.000 0.004 0.788  0 0.208
#> GSM587184     3  0.3333      0.697 0.000 0.004 0.788  0 0.208
#> GSM587185     3  0.3333      0.697 0.000 0.004 0.788  0 0.208
#> GSM587186     3  0.3333      0.697 0.000 0.004 0.788  0 0.208
#> GSM587187     3  0.1281      0.789 0.012 0.000 0.956  0 0.032
#> GSM587188     3  0.1106      0.789 0.012 0.000 0.964  0 0.024
#> GSM587189     3  0.1106      0.789 0.012 0.000 0.964  0 0.024
#> GSM587190     3  0.0963      0.794 0.036 0.000 0.964  0 0.000
#> GSM587203     5  0.5336      0.762 0.252 0.000 0.100  0 0.648
#> GSM587204     1  0.3862      0.694 0.808 0.000 0.088  0 0.104
#> GSM587205     5  0.4150      0.935 0.388 0.000 0.000  0 0.612
#> GSM587206     5  0.4150      0.935 0.388 0.000 0.000  0 0.612
#> GSM587207     5  0.4150      0.935 0.388 0.000 0.000  0 0.612
#> GSM587208     5  0.4150      0.935 0.388 0.000 0.000  0 0.612
#> GSM587209     1  0.1579      0.629 0.944 0.000 0.024  0 0.032
#> GSM587210     3  0.4612      0.752 0.084 0.000 0.736  0 0.180
#> GSM587211     1  0.1981      0.676 0.920 0.000 0.064  0 0.016
#> GSM587212     3  0.5379      0.716 0.164 0.000 0.668  0 0.168
#> GSM587213     1  0.1484      0.664 0.944 0.000 0.048  0 0.008
#> GSM587214     1  0.3868      0.662 0.800 0.000 0.060  0 0.140
#> GSM587215     1  0.4680      0.685 0.740 0.000 0.132  0 0.128
#> GSM587216     1  0.3857      0.692 0.808 0.000 0.084  0 0.108
#> GSM587217     1  0.3759      0.663 0.808 0.000 0.056  0 0.136
#> GSM587191     1  0.4925      0.571 0.632 0.000 0.324  0 0.044
#> GSM587192     1  0.6101      0.545 0.528 0.000 0.328  0 0.144
#> GSM587193     1  0.4046      0.621 0.696 0.000 0.296  0 0.008
#> GSM587194     3  0.4855      0.676 0.168 0.000 0.720  0 0.112
#> GSM587195     3  0.1830      0.793 0.028 0.000 0.932  0 0.040
#> GSM587196     3  0.4748      0.683 0.172 0.000 0.728  0 0.100
#> GSM587197     3  0.1800      0.793 0.020 0.000 0.932  0 0.048
#> GSM587198     3  0.3477      0.767 0.136 0.000 0.824  0 0.040
#> GSM587199     3  0.4457      0.728 0.116 0.000 0.760  0 0.124
#> GSM587200     1  0.2771      0.692 0.860 0.000 0.128  0 0.012
#> GSM587201     1  0.2674      0.693 0.868 0.000 0.120  0 0.012
#> GSM587202     1  0.3861      0.649 0.728 0.000 0.264  0 0.008
#> GSM198767     1  0.4313     -0.307 0.636 0.000 0.008  0 0.356
#> GSM198769     1  0.1386      0.622 0.952 0.000 0.016  0 0.032
#> GSM198772     1  0.1211      0.636 0.960 0.000 0.024  0 0.016
#> GSM198773     1  0.1082      0.611 0.964 0.000 0.008  0 0.028
#> GSM198776     1  0.3862      0.694 0.808 0.000 0.088  0 0.104
#> GSM198778     3  0.4612      0.752 0.084 0.000 0.736  0 0.180
#> GSM198780     3  0.5379      0.716 0.164 0.000 0.668  0 0.168
#> GSM198781     1  0.4054      0.671 0.788 0.000 0.072  0 0.140
#> GSM198765     1  0.4957      0.575 0.624 0.000 0.332  0 0.044
#> GSM198766     1  0.3934      0.639 0.716 0.000 0.276  0 0.008
#> GSM198768     3  0.3810      0.744 0.176 0.000 0.788  0 0.036
#> GSM198770     3  0.1549      0.791 0.016 0.000 0.944  0 0.040
#> GSM198771     3  0.3942      0.697 0.232 0.000 0.748  0 0.020
#> GSM198774     1  0.6068      0.549 0.532 0.000 0.328  0 0.140
#> GSM198775     3  0.4743      0.692 0.156 0.000 0.732  0 0.112
#> GSM198777     3  0.4599      0.704 0.156 0.000 0.744  0 0.100
#> GSM198779     3  0.4457      0.729 0.116 0.000 0.760  0 0.124
#> GSM587218     4  0.0000      1.000 0.000 0.000 0.000  1 0.000
#> GSM587219     4  0.0000      1.000 0.000 0.000 0.000  1 0.000
#> GSM587220     4  0.0000      1.000 0.000 0.000 0.000  1 0.000
#> GSM587221     4  0.0000      1.000 0.000 0.000 0.000  1 0.000
#> GSM587222     4  0.0000      1.000 0.000 0.000 0.000  1 0.000
#> GSM587223     4  0.0000      1.000 0.000 0.000 0.000  1 0.000
#> GSM587224     4  0.0000      1.000 0.000 0.000 0.000  1 0.000
#> GSM587225     3  0.4786      0.696 0.188 0.000 0.720  0 0.092
#> GSM587226     4  0.0000      1.000 0.000 0.000 0.000  1 0.000
#> GSM587227     3  0.4803      0.695 0.184 0.000 0.720  0 0.096
#> GSM587228     3  0.4836      0.695 0.188 0.000 0.716  0 0.096
#> GSM587229     3  0.4836      0.695 0.188 0.000 0.716  0 0.096

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3 p4    p5    p6
#> GSM587155     2  0.0000     0.9877 0.000 1.000 0.000  0 0.000 0.000
#> GSM587156     2  0.1714     0.8810 0.000 0.908 0.000  0 0.000 0.092
#> GSM587157     2  0.0146     0.9848 0.000 0.996 0.000  0 0.000 0.004
#> GSM587158     2  0.0000     0.9877 0.000 1.000 0.000  0 0.000 0.000
#> GSM587159     2  0.0000     0.9877 0.000 1.000 0.000  0 0.000 0.000
#> GSM587160     2  0.0000     0.9877 0.000 1.000 0.000  0 0.000 0.000
#> GSM587161     2  0.0146     0.9848 0.000 0.996 0.000  0 0.000 0.004
#> GSM587162     2  0.0000     0.9877 0.000 1.000 0.000  0 0.000 0.000
#> GSM587163     2  0.0000     0.9877 0.000 1.000 0.000  0 0.000 0.000
#> GSM587164     2  0.0000     0.9877 0.000 1.000 0.000  0 0.000 0.000
#> GSM587165     2  0.0000     0.9877 0.000 1.000 0.000  0 0.000 0.000
#> GSM587166     2  0.1714     0.8810 0.000 0.908 0.000  0 0.000 0.092
#> GSM587167     2  0.1387     0.9107 0.000 0.932 0.000  0 0.000 0.068
#> GSM587168     2  0.0000     0.9877 0.000 1.000 0.000  0 0.000 0.000
#> GSM587169     2  0.0000     0.9877 0.000 1.000 0.000  0 0.000 0.000
#> GSM587170     2  0.0000     0.9877 0.000 1.000 0.000  0 0.000 0.000
#> GSM587171     2  0.0000     0.9877 0.000 1.000 0.000  0 0.000 0.000
#> GSM587172     2  0.0000     0.9877 0.000 1.000 0.000  0 0.000 0.000
#> GSM587173     2  0.0000     0.9877 0.000 1.000 0.000  0 0.000 0.000
#> GSM587174     2  0.0000     0.9877 0.000 1.000 0.000  0 0.000 0.000
#> GSM587175     2  0.0000     0.9877 0.000 1.000 0.000  0 0.000 0.000
#> GSM587176     2  0.0000     0.9877 0.000 1.000 0.000  0 0.000 0.000
#> GSM587177     2  0.0000     0.9877 0.000 1.000 0.000  0 0.000 0.000
#> GSM587178     2  0.0000     0.9877 0.000 1.000 0.000  0 0.000 0.000
#> GSM587179     2  0.0000     0.9877 0.000 1.000 0.000  0 0.000 0.000
#> GSM587180     2  0.0000     0.9877 0.000 1.000 0.000  0 0.000 0.000
#> GSM587181     2  0.0000     0.9877 0.000 1.000 0.000  0 0.000 0.000
#> GSM587182     2  0.0000     0.9877 0.000 1.000 0.000  0 0.000 0.000
#> GSM587183     6  0.0363     0.6191 0.000 0.000 0.012  0 0.000 0.988
#> GSM587184     6  0.0363     0.6191 0.000 0.000 0.012  0 0.000 0.988
#> GSM587185     6  0.0363     0.6191 0.000 0.000 0.012  0 0.000 0.988
#> GSM587186     6  0.0363     0.6191 0.000 0.000 0.012  0 0.000 0.988
#> GSM587187     3  0.4595     0.5534 0.020 0.000 0.676  0 0.040 0.264
#> GSM587188     3  0.4146     0.5698 0.008 0.000 0.720  0 0.040 0.232
#> GSM587189     3  0.4146     0.5698 0.008 0.000 0.720  0 0.040 0.232
#> GSM587190     3  0.3804     0.5820 0.012 0.000 0.748  0 0.020 0.220
#> GSM587203     5  0.4923     0.2911 0.072 0.000 0.000  0 0.560 0.368
#> GSM587204     1  0.1958     0.5604 0.896 0.000 0.100  0 0.004 0.000
#> GSM587205     5  0.2009     0.7770 0.084 0.000 0.004  0 0.904 0.008
#> GSM587206     5  0.1753     0.7811 0.084 0.000 0.004  0 0.912 0.000
#> GSM587207     5  0.1753     0.7789 0.084 0.000 0.004  0 0.912 0.000
#> GSM587208     5  0.1753     0.7811 0.084 0.000 0.004  0 0.912 0.000
#> GSM587209     1  0.6071     0.4000 0.520 0.000 0.152  0 0.028 0.300
#> GSM587210     3  0.6034     0.0655 0.392 0.000 0.472  0 0.048 0.088
#> GSM587211     1  0.5988     0.3764 0.536 0.000 0.132  0 0.032 0.300
#> GSM587212     3  0.3983     0.5405 0.120 0.000 0.792  0 0.048 0.040
#> GSM587213     1  0.6405     0.4470 0.508 0.000 0.140  0 0.060 0.292
#> GSM587214     1  0.2791     0.5508 0.864 0.000 0.096  0 0.032 0.008
#> GSM587215     1  0.2588     0.5472 0.860 0.000 0.124  0 0.004 0.012
#> GSM587216     1  0.3500     0.5215 0.768 0.000 0.204  0 0.028 0.000
#> GSM587217     1  0.2201     0.5561 0.896 0.000 0.076  0 0.028 0.000
#> GSM587191     3  0.5789     0.3477 0.348 0.000 0.520  0 0.024 0.108
#> GSM587192     3  0.3010     0.5883 0.148 0.000 0.828  0 0.004 0.020
#> GSM587193     1  0.5501     0.3307 0.580 0.000 0.300  0 0.020 0.100
#> GSM587194     3  0.2680     0.6440 0.056 0.000 0.868  0 0.000 0.076
#> GSM587195     3  0.6185     0.4365 0.220 0.000 0.500  0 0.020 0.260
#> GSM587196     3  0.2066     0.6425 0.072 0.000 0.904  0 0.000 0.024
#> GSM587197     6  0.6434    -0.3694 0.232 0.000 0.372  0 0.020 0.376
#> GSM587198     3  0.6305     0.3835 0.236 0.000 0.468  0 0.020 0.276
#> GSM587199     3  0.1003     0.6487 0.004 0.000 0.964  0 0.004 0.028
#> GSM587200     1  0.6496     0.4021 0.436 0.000 0.236  0 0.028 0.300
#> GSM587201     1  0.6109     0.4649 0.524 0.000 0.152  0 0.032 0.292
#> GSM587202     1  0.6361     0.4000 0.452 0.000 0.252  0 0.020 0.276
#> GSM198767     5  0.6530     0.2448 0.232 0.000 0.036  0 0.460 0.272
#> GSM198769     1  0.6467     0.4246 0.492 0.000 0.164  0 0.052 0.292
#> GSM198772     1  0.5111     0.4756 0.672 0.000 0.124  0 0.020 0.184
#> GSM198773     1  0.6399     0.4511 0.516 0.000 0.116  0 0.076 0.292
#> GSM198776     1  0.2053     0.5605 0.888 0.000 0.108  0 0.004 0.000
#> GSM198778     3  0.5865     0.2205 0.360 0.000 0.516  0 0.048 0.076
#> GSM198780     3  0.4026     0.5501 0.112 0.000 0.792  0 0.048 0.048
#> GSM198781     1  0.2604     0.5523 0.872 0.000 0.100  0 0.020 0.008
#> GSM198765     3  0.3883     0.5723 0.196 0.000 0.760  0 0.024 0.020
#> GSM198766     1  0.5347     0.3644 0.600 0.000 0.292  0 0.020 0.088
#> GSM198768     3  0.6141     0.4474 0.224 0.000 0.512  0 0.020 0.244
#> GSM198770     3  0.6434     0.2607 0.232 0.000 0.380  0 0.020 0.368
#> GSM198771     3  0.6107     0.4447 0.260 0.000 0.516  0 0.020 0.204
#> GSM198774     3  0.3053     0.5917 0.144 0.000 0.828  0 0.004 0.024
#> GSM198775     3  0.2876     0.6432 0.056 0.000 0.860  0 0.004 0.080
#> GSM198777     3  0.2189     0.6465 0.060 0.000 0.904  0 0.004 0.032
#> GSM198779     3  0.1003     0.6487 0.004 0.000 0.964  0 0.004 0.028
#> GSM587218     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587219     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587220     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587221     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587222     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587223     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587224     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587225     6  0.5429     0.5296 0.272 0.000 0.044  0 0.068 0.616
#> GSM587226     4  0.0000     1.0000 0.000 0.000 0.000  1 0.000 0.000
#> GSM587227     6  0.5447     0.5227 0.276 0.000 0.044  0 0.068 0.612
#> GSM587228     6  0.5415     0.5244 0.280 0.000 0.044  0 0.064 0.612
#> GSM587229     6  0.5415     0.5244 0.280 0.000 0.044  0 0.064 0.612

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 specimen(p) k
#> ATC:mclust 92    3.07e-14 2
#> ATC:mclust 92    2.81e-22 3
#> ATC:mclust 88    3.64e-26 4
#> ATC:mclust 91    1.56e-24 5
#> ATC:mclust 70    7.18e-24 6

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


ATC:NMF*

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

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

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

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

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

collect_plots(res)

plot of chunk ATC-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.984       0.993         0.4890 0.514   0.514
#> 3 3 0.864           0.861       0.938         0.3039 0.809   0.647
#> 4 4 0.934           0.932       0.956         0.1451 0.841   0.604
#> 5 5 0.908           0.891       0.930         0.0616 0.922   0.726
#> 6 6 0.870           0.816       0.877         0.0255 0.973   0.879

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

suggest_best_k(res)
#> [1] 5
#> attr(,"optional")
#> [1] 2 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
#> GSM587155     2   0.000      1.000 0.000 1.000
#> GSM587156     2   0.000      1.000 0.000 1.000
#> GSM587157     2   0.000      1.000 0.000 1.000
#> GSM587158     2   0.000      1.000 0.000 1.000
#> GSM587159     2   0.000      1.000 0.000 1.000
#> GSM587160     2   0.000      1.000 0.000 1.000
#> GSM587161     2   0.000      1.000 0.000 1.000
#> GSM587162     2   0.000      1.000 0.000 1.000
#> GSM587163     2   0.000      1.000 0.000 1.000
#> GSM587164     2   0.000      1.000 0.000 1.000
#> GSM587165     2   0.000      1.000 0.000 1.000
#> GSM587166     2   0.000      1.000 0.000 1.000
#> GSM587167     2   0.000      1.000 0.000 1.000
#> GSM587168     2   0.000      1.000 0.000 1.000
#> GSM587169     2   0.000      1.000 0.000 1.000
#> GSM587170     2   0.000      1.000 0.000 1.000
#> GSM587171     2   0.000      1.000 0.000 1.000
#> GSM587172     2   0.000      1.000 0.000 1.000
#> GSM587173     2   0.000      1.000 0.000 1.000
#> GSM587174     2   0.000      1.000 0.000 1.000
#> GSM587175     2   0.000      1.000 0.000 1.000
#> GSM587176     2   0.000      1.000 0.000 1.000
#> GSM587177     2   0.000      1.000 0.000 1.000
#> GSM587178     2   0.000      1.000 0.000 1.000
#> GSM587179     2   0.000      1.000 0.000 1.000
#> GSM587180     2   0.000      1.000 0.000 1.000
#> GSM587181     2   0.000      1.000 0.000 1.000
#> GSM587182     2   0.000      1.000 0.000 1.000
#> GSM587183     2   0.000      1.000 0.000 1.000
#> GSM587184     2   0.000      1.000 0.000 1.000
#> GSM587185     2   0.000      1.000 0.000 1.000
#> GSM587186     2   0.000      1.000 0.000 1.000
#> GSM587187     2   0.000      1.000 0.000 1.000
#> GSM587188     2   0.000      1.000 0.000 1.000
#> GSM587189     2   0.000      1.000 0.000 1.000
#> GSM587190     2   0.000      1.000 0.000 1.000
#> GSM587203     1   0.000      0.988 1.000 0.000
#> GSM587204     1   0.000      0.988 1.000 0.000
#> GSM587205     1   0.000      0.988 1.000 0.000
#> GSM587206     1   0.000      0.988 1.000 0.000
#> GSM587207     1   0.000      0.988 1.000 0.000
#> GSM587208     1   0.000      0.988 1.000 0.000
#> GSM587209     1   0.000      0.988 1.000 0.000
#> GSM587210     1   0.000      0.988 1.000 0.000
#> GSM587211     1   0.000      0.988 1.000 0.000
#> GSM587212     1   0.000      0.988 1.000 0.000
#> GSM587213     1   0.000      0.988 1.000 0.000
#> GSM587214     1   0.000      0.988 1.000 0.000
#> GSM587215     1   0.000      0.988 1.000 0.000
#> GSM587216     1   0.000      0.988 1.000 0.000
#> GSM587217     1   0.000      0.988 1.000 0.000
#> GSM587191     2   0.000      1.000 0.000 1.000
#> GSM587192     1   0.000      0.988 1.000 0.000
#> GSM587193     1   0.118      0.974 0.984 0.016
#> GSM587194     1   0.118      0.974 0.984 0.016
#> GSM587195     1   0.278      0.944 0.952 0.048
#> GSM587196     1   0.000      0.988 1.000 0.000
#> GSM587197     1   0.000      0.988 1.000 0.000
#> GSM587198     1   0.000      0.988 1.000 0.000
#> GSM587199     1   0.000      0.988 1.000 0.000
#> GSM587200     1   0.000      0.988 1.000 0.000
#> GSM587201     1   0.000      0.988 1.000 0.000
#> GSM587202     1   0.000      0.988 1.000 0.000
#> GSM198767     1   0.000      0.988 1.000 0.000
#> GSM198769     1   0.000      0.988 1.000 0.000
#> GSM198772     1   0.000      0.988 1.000 0.000
#> GSM198773     1   0.000      0.988 1.000 0.000
#> GSM198776     1   0.000      0.988 1.000 0.000
#> GSM198778     1   0.000      0.988 1.000 0.000
#> GSM198780     1   0.000      0.988 1.000 0.000
#> GSM198781     1   0.000      0.988 1.000 0.000
#> GSM198765     1   0.802      0.690 0.756 0.244
#> GSM198766     1   0.000      0.988 1.000 0.000
#> GSM198768     1   0.000      0.988 1.000 0.000
#> GSM198770     1   0.833      0.656 0.736 0.264
#> GSM198771     1   0.000      0.988 1.000 0.000
#> GSM198774     1   0.000      0.988 1.000 0.000
#> GSM198775     1   0.402      0.911 0.920 0.080
#> GSM198777     1   0.000      0.988 1.000 0.000
#> GSM198779     1   0.000      0.988 1.000 0.000
#> GSM587218     1   0.000      0.988 1.000 0.000
#> GSM587219     1   0.000      0.988 1.000 0.000
#> GSM587220     1   0.000      0.988 1.000 0.000
#> GSM587221     1   0.000      0.988 1.000 0.000
#> GSM587222     1   0.000      0.988 1.000 0.000
#> GSM587223     1   0.000      0.988 1.000 0.000
#> GSM587224     1   0.000      0.988 1.000 0.000
#> GSM587225     1   0.000      0.988 1.000 0.000
#> GSM587226     1   0.000      0.988 1.000 0.000
#> GSM587227     1   0.000      0.988 1.000 0.000
#> GSM587228     1   0.000      0.988 1.000 0.000
#> GSM587229     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
#> GSM587155     2  0.0000      0.988 0.000 1.000 0.000
#> GSM587156     2  0.0000      0.988 0.000 1.000 0.000
#> GSM587157     2  0.0000      0.988 0.000 1.000 0.000
#> GSM587158     2  0.0000      0.988 0.000 1.000 0.000
#> GSM587159     2  0.0000      0.988 0.000 1.000 0.000
#> GSM587160     2  0.0000      0.988 0.000 1.000 0.000
#> GSM587161     2  0.0000      0.988 0.000 1.000 0.000
#> GSM587162     2  0.0000      0.988 0.000 1.000 0.000
#> GSM587163     2  0.0000      0.988 0.000 1.000 0.000
#> GSM587164     2  0.0000      0.988 0.000 1.000 0.000
#> GSM587165     2  0.0000      0.988 0.000 1.000 0.000
#> GSM587166     2  0.0000      0.988 0.000 1.000 0.000
#> GSM587167     2  0.0000      0.988 0.000 1.000 0.000
#> GSM587168     2  0.0000      0.988 0.000 1.000 0.000
#> GSM587169     2  0.0000      0.988 0.000 1.000 0.000
#> GSM587170     2  0.0000      0.988 0.000 1.000 0.000
#> GSM587171     2  0.0000      0.988 0.000 1.000 0.000
#> GSM587172     2  0.0000      0.988 0.000 1.000 0.000
#> GSM587173     2  0.0000      0.988 0.000 1.000 0.000
#> GSM587174     2  0.0000      0.988 0.000 1.000 0.000
#> GSM587175     2  0.0000      0.988 0.000 1.000 0.000
#> GSM587176     2  0.0000      0.988 0.000 1.000 0.000
#> GSM587177     2  0.0000      0.988 0.000 1.000 0.000
#> GSM587178     2  0.0000      0.988 0.000 1.000 0.000
#> GSM587179     2  0.0000      0.988 0.000 1.000 0.000
#> GSM587180     2  0.0000      0.988 0.000 1.000 0.000
#> GSM587181     2  0.0000      0.988 0.000 1.000 0.000
#> GSM587182     2  0.0000      0.988 0.000 1.000 0.000
#> GSM587183     2  0.0000      0.988 0.000 1.000 0.000
#> GSM587184     2  0.0000      0.988 0.000 1.000 0.000
#> GSM587185     2  0.0000      0.988 0.000 1.000 0.000
#> GSM587186     2  0.0000      0.988 0.000 1.000 0.000
#> GSM587187     2  0.0237      0.984 0.000 0.996 0.004
#> GSM587188     2  0.0424      0.980 0.000 0.992 0.008
#> GSM587189     2  0.0592      0.976 0.000 0.988 0.012
#> GSM587190     3  0.6045      0.352 0.000 0.380 0.620
#> GSM587203     1  0.2066      0.892 0.940 0.000 0.060
#> GSM587204     3  0.1289      0.870 0.032 0.000 0.968
#> GSM587205     3  0.5363      0.651 0.276 0.000 0.724
#> GSM587206     1  0.6307     -0.187 0.512 0.000 0.488
#> GSM587207     3  0.6274      0.271 0.456 0.000 0.544
#> GSM587208     3  0.6309      0.162 0.496 0.000 0.504
#> GSM587209     3  0.6154      0.428 0.408 0.000 0.592
#> GSM587210     3  0.4654      0.736 0.208 0.000 0.792
#> GSM587211     3  0.5560      0.627 0.300 0.000 0.700
#> GSM587212     3  0.0892      0.873 0.020 0.000 0.980
#> GSM587213     3  0.6154      0.401 0.408 0.000 0.592
#> GSM587214     3  0.0237      0.874 0.004 0.000 0.996
#> GSM587215     3  0.0424      0.873 0.008 0.000 0.992
#> GSM587216     3  0.0424      0.874 0.008 0.000 0.992
#> GSM587217     3  0.1031      0.873 0.024 0.000 0.976
#> GSM587191     3  0.1031      0.864 0.000 0.024 0.976
#> GSM587192     3  0.0237      0.873 0.004 0.000 0.996
#> GSM587193     3  0.0237      0.874 0.000 0.004 0.996
#> GSM587194     3  0.0592      0.874 0.012 0.000 0.988
#> GSM587195     3  0.2681      0.843 0.028 0.040 0.932
#> GSM587196     3  0.0237      0.874 0.004 0.000 0.996
#> GSM587197     3  0.4370      0.810 0.076 0.056 0.868
#> GSM587198     3  0.1781      0.864 0.020 0.020 0.960
#> GSM587199     3  0.0424      0.874 0.008 0.000 0.992
#> GSM587200     3  0.1289      0.869 0.032 0.000 0.968
#> GSM587201     3  0.1289      0.870 0.032 0.000 0.968
#> GSM587202     3  0.0592      0.874 0.012 0.000 0.988
#> GSM198767     3  0.6244      0.337 0.440 0.000 0.560
#> GSM198769     3  0.5058      0.703 0.244 0.000 0.756
#> GSM198772     3  0.4121      0.778 0.168 0.000 0.832
#> GSM198773     3  0.4974      0.699 0.236 0.000 0.764
#> GSM198776     3  0.0592      0.874 0.012 0.000 0.988
#> GSM198778     3  0.3941      0.790 0.156 0.000 0.844
#> GSM198780     3  0.0747      0.874 0.016 0.000 0.984
#> GSM198781     3  0.0424      0.873 0.008 0.000 0.992
#> GSM198765     3  0.0237      0.873 0.004 0.000 0.996
#> GSM198766     3  0.0237      0.873 0.004 0.000 0.996
#> GSM198768     3  0.1031      0.872 0.024 0.000 0.976
#> GSM198770     2  0.6497      0.450 0.016 0.648 0.336
#> GSM198771     3  0.0747      0.874 0.016 0.000 0.984
#> GSM198774     3  0.0237      0.873 0.004 0.000 0.996
#> GSM198775     3  0.0475      0.872 0.004 0.004 0.992
#> GSM198777     3  0.0237      0.874 0.004 0.000 0.996
#> GSM198779     3  0.0424      0.874 0.008 0.000 0.992
#> GSM587218     1  0.0237      0.949 0.996 0.000 0.004
#> GSM587219     1  0.0237      0.949 0.996 0.000 0.004
#> GSM587220     1  0.0237      0.949 0.996 0.000 0.004
#> GSM587221     1  0.0237      0.949 0.996 0.000 0.004
#> GSM587222     1  0.0237      0.949 0.996 0.000 0.004
#> GSM587223     1  0.0237      0.949 0.996 0.000 0.004
#> GSM587224     1  0.0237      0.949 0.996 0.000 0.004
#> GSM587225     1  0.0237      0.949 0.996 0.000 0.004
#> GSM587226     1  0.0237      0.949 0.996 0.000 0.004
#> GSM587227     1  0.0237      0.949 0.996 0.000 0.004
#> GSM587228     1  0.0237      0.949 0.996 0.000 0.004
#> GSM587229     1  0.0237      0.949 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
#> GSM587155     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> GSM587156     2  0.0707      0.979 0.000 0.980 0.000 0.020
#> GSM587157     2  0.0188      0.990 0.000 0.996 0.000 0.004
#> GSM587158     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> GSM587159     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> GSM587160     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> GSM587161     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> GSM587162     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> GSM587163     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> GSM587164     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> GSM587165     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> GSM587166     2  0.0817      0.976 0.000 0.976 0.000 0.024
#> GSM587167     2  0.0336      0.988 0.000 0.992 0.000 0.008
#> GSM587168     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> GSM587169     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> GSM587170     2  0.0188      0.990 0.000 0.996 0.000 0.004
#> GSM587171     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> GSM587172     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> GSM587173     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> GSM587174     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> GSM587175     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> GSM587176     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> GSM587177     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> GSM587178     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> GSM587179     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> GSM587180     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> GSM587181     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> GSM587182     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> GSM587183     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> GSM587184     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> GSM587185     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> GSM587186     2  0.0000      0.993 0.000 1.000 0.000 0.000
#> GSM587187     2  0.3311      0.794 0.000 0.828 0.172 0.000
#> GSM587188     3  0.4981      0.132 0.000 0.464 0.536 0.000
#> GSM587189     3  0.1716      0.878 0.000 0.064 0.936 0.000
#> GSM587190     3  0.0000      0.920 0.000 0.000 1.000 0.000
#> GSM587203     1  0.4804      0.476 0.616 0.000 0.000 0.384
#> GSM587204     1  0.4595      0.805 0.776 0.000 0.040 0.184
#> GSM587205     1  0.0336      0.925 0.992 0.000 0.000 0.008
#> GSM587206     1  0.1637      0.922 0.940 0.000 0.000 0.060
#> GSM587207     1  0.0817      0.927 0.976 0.000 0.000 0.024
#> GSM587208     1  0.1118      0.927 0.964 0.000 0.000 0.036
#> GSM587209     1  0.2814      0.879 0.868 0.000 0.000 0.132
#> GSM587210     3  0.3047      0.851 0.012 0.000 0.872 0.116
#> GSM587211     1  0.1940      0.917 0.924 0.000 0.000 0.076
#> GSM587212     3  0.1833      0.915 0.032 0.000 0.944 0.024
#> GSM587213     1  0.1022      0.928 0.968 0.000 0.000 0.032
#> GSM587214     1  0.0524      0.924 0.988 0.000 0.008 0.004
#> GSM587215     1  0.1109      0.911 0.968 0.000 0.028 0.004
#> GSM587216     1  0.3047      0.853 0.872 0.000 0.116 0.012
#> GSM587217     1  0.1824      0.923 0.936 0.000 0.004 0.060
#> GSM587191     3  0.2334      0.895 0.088 0.004 0.908 0.000
#> GSM587192     3  0.1557      0.914 0.056 0.000 0.944 0.000
#> GSM587193     1  0.0921      0.914 0.972 0.000 0.028 0.000
#> GSM587194     3  0.0000      0.920 0.000 0.000 1.000 0.000
#> GSM587195     3  0.0469      0.922 0.012 0.000 0.988 0.000
#> GSM587196     3  0.0707      0.922 0.020 0.000 0.980 0.000
#> GSM587197     3  0.0469      0.918 0.000 0.000 0.988 0.012
#> GSM587198     3  0.2345      0.878 0.100 0.000 0.900 0.000
#> GSM587199     3  0.0000      0.920 0.000 0.000 1.000 0.000
#> GSM587200     1  0.0336      0.926 0.992 0.000 0.000 0.008
#> GSM587201     1  0.0188      0.922 0.996 0.000 0.000 0.004
#> GSM587202     1  0.1109      0.915 0.968 0.000 0.028 0.004
#> GSM198767     1  0.2281      0.905 0.904 0.000 0.000 0.096
#> GSM198769     1  0.2589      0.892 0.884 0.000 0.000 0.116
#> GSM198772     1  0.1743      0.924 0.940 0.000 0.004 0.056
#> GSM198773     1  0.1022      0.928 0.968 0.000 0.000 0.032
#> GSM198776     1  0.4590      0.824 0.792 0.000 0.060 0.148
#> GSM198778     3  0.2376      0.893 0.016 0.000 0.916 0.068
#> GSM198780     3  0.1677      0.917 0.040 0.000 0.948 0.012
#> GSM198781     1  0.0524      0.924 0.988 0.000 0.008 0.004
#> GSM198765     3  0.1557      0.914 0.056 0.000 0.944 0.000
#> GSM198766     1  0.1716      0.895 0.936 0.000 0.064 0.000
#> GSM198768     3  0.0817      0.922 0.024 0.000 0.976 0.000
#> GSM198770     3  0.3895      0.733 0.000 0.184 0.804 0.012
#> GSM198771     3  0.2216      0.887 0.092 0.000 0.908 0.000
#> GSM198774     3  0.1389      0.917 0.048 0.000 0.952 0.000
#> GSM198775     3  0.0000      0.920 0.000 0.000 1.000 0.000
#> GSM198777     3  0.0469      0.922 0.012 0.000 0.988 0.000
#> GSM198779     3  0.0000      0.920 0.000 0.000 1.000 0.000
#> GSM587218     4  0.0921      1.000 0.028 0.000 0.000 0.972
#> GSM587219     4  0.0921      1.000 0.028 0.000 0.000 0.972
#> GSM587220     4  0.0921      1.000 0.028 0.000 0.000 0.972
#> GSM587221     4  0.0921      1.000 0.028 0.000 0.000 0.972
#> GSM587222     4  0.0921      1.000 0.028 0.000 0.000 0.972
#> GSM587223     4  0.0921      1.000 0.028 0.000 0.000 0.972
#> GSM587224     4  0.0921      1.000 0.028 0.000 0.000 0.972
#> GSM587225     4  0.0921      1.000 0.028 0.000 0.000 0.972
#> GSM587226     4  0.0921      1.000 0.028 0.000 0.000 0.972
#> GSM587227     4  0.0921      1.000 0.028 0.000 0.000 0.972
#> GSM587228     4  0.0921      1.000 0.028 0.000 0.000 0.972
#> GSM587229     4  0.0921      1.000 0.028 0.000 0.000 0.972

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM587155     2  0.0000      0.993 0.000 1.000 0.000 0.000 0.000
#> GSM587156     2  0.0671      0.985 0.016 0.980 0.004 0.000 0.000
#> GSM587157     2  0.0451      0.990 0.008 0.988 0.004 0.000 0.000
#> GSM587158     2  0.0162      0.993 0.000 0.996 0.004 0.000 0.000
#> GSM587159     2  0.0162      0.993 0.000 0.996 0.004 0.000 0.000
#> GSM587160     2  0.0162      0.993 0.000 0.996 0.004 0.000 0.000
#> GSM587161     2  0.0162      0.992 0.004 0.996 0.000 0.000 0.000
#> GSM587162     2  0.0162      0.993 0.000 0.996 0.004 0.000 0.000
#> GSM587163     2  0.0000      0.993 0.000 1.000 0.000 0.000 0.000
#> GSM587164     2  0.0162      0.992 0.004 0.996 0.000 0.000 0.000
#> GSM587165     2  0.0162      0.993 0.000 0.996 0.004 0.000 0.000
#> GSM587166     2  0.1026      0.977 0.024 0.968 0.004 0.000 0.004
#> GSM587167     2  0.0451      0.990 0.008 0.988 0.004 0.000 0.000
#> GSM587168     2  0.0162      0.993 0.000 0.996 0.004 0.000 0.000
#> GSM587169     2  0.0324      0.991 0.004 0.992 0.004 0.000 0.000
#> GSM587170     2  0.0451      0.990 0.008 0.988 0.004 0.000 0.000
#> GSM587171     2  0.0162      0.992 0.004 0.996 0.000 0.000 0.000
#> GSM587172     2  0.0324      0.991 0.004 0.992 0.004 0.000 0.000
#> GSM587173     2  0.0162      0.993 0.000 0.996 0.004 0.000 0.000
#> GSM587174     2  0.0324      0.992 0.000 0.992 0.004 0.000 0.004
#> GSM587175     2  0.0324      0.991 0.004 0.992 0.004 0.000 0.000
#> GSM587176     2  0.0162      0.993 0.000 0.996 0.004 0.000 0.000
#> GSM587177     2  0.0162      0.993 0.000 0.996 0.004 0.000 0.000
#> GSM587178     2  0.0000      0.993 0.000 1.000 0.000 0.000 0.000
#> GSM587179     2  0.0162      0.992 0.004 0.996 0.000 0.000 0.000
#> GSM587180     2  0.0162      0.992 0.000 0.996 0.000 0.000 0.004
#> GSM587181     2  0.0162      0.993 0.000 0.996 0.004 0.000 0.000
#> GSM587182     2  0.0486      0.990 0.004 0.988 0.004 0.000 0.004
#> GSM587183     2  0.0609      0.985 0.000 0.980 0.020 0.000 0.000
#> GSM587184     2  0.0609      0.985 0.000 0.980 0.020 0.000 0.000
#> GSM587185     2  0.0609      0.985 0.000 0.980 0.020 0.000 0.000
#> GSM587186     2  0.0609      0.985 0.000 0.980 0.020 0.000 0.000
#> GSM587187     3  0.1872      0.885 0.000 0.052 0.928 0.000 0.020
#> GSM587188     3  0.2928      0.854 0.000 0.064 0.872 0.000 0.064
#> GSM587189     3  0.1741      0.903 0.000 0.024 0.936 0.000 0.040
#> GSM587190     3  0.1121      0.910 0.000 0.000 0.956 0.000 0.044
#> GSM587203     1  0.4542      0.297 0.536 0.000 0.000 0.456 0.008
#> GSM587204     5  0.3112      0.800 0.100 0.000 0.000 0.044 0.856
#> GSM587205     1  0.1547      0.865 0.948 0.000 0.004 0.032 0.016
#> GSM587206     1  0.2608      0.852 0.888 0.000 0.004 0.088 0.020
#> GSM587207     1  0.1630      0.865 0.944 0.000 0.004 0.036 0.016
#> GSM587208     1  0.2364      0.861 0.908 0.000 0.008 0.064 0.020
#> GSM587209     1  0.2976      0.853 0.880 0.000 0.064 0.044 0.012
#> GSM587210     5  0.1547      0.856 0.004 0.000 0.016 0.032 0.948
#> GSM587211     1  0.2802      0.827 0.876 0.000 0.100 0.016 0.008
#> GSM587212     5  0.0671      0.860 0.004 0.000 0.016 0.000 0.980
#> GSM587213     1  0.1787      0.865 0.940 0.000 0.032 0.016 0.012
#> GSM587214     1  0.4846      0.366 0.588 0.000 0.000 0.028 0.384
#> GSM587215     5  0.4173      0.533 0.300 0.000 0.000 0.012 0.688
#> GSM587216     5  0.2464      0.817 0.096 0.000 0.000 0.016 0.888
#> GSM587217     5  0.6525      0.172 0.308 0.000 0.000 0.220 0.472
#> GSM587191     3  0.2677      0.880 0.112 0.000 0.872 0.000 0.016
#> GSM587192     5  0.0798      0.860 0.008 0.000 0.016 0.000 0.976
#> GSM587193     1  0.2351      0.839 0.896 0.000 0.088 0.000 0.016
#> GSM587194     5  0.1544      0.843 0.000 0.000 0.068 0.000 0.932
#> GSM587195     3  0.0693      0.918 0.012 0.000 0.980 0.000 0.008
#> GSM587196     5  0.3395      0.684 0.000 0.000 0.236 0.000 0.764
#> GSM587197     3  0.0693      0.918 0.012 0.000 0.980 0.000 0.008
#> GSM587198     3  0.1965      0.888 0.096 0.000 0.904 0.000 0.000
#> GSM587199     5  0.1965      0.827 0.000 0.000 0.096 0.000 0.904
#> GSM587200     1  0.1455      0.863 0.952 0.000 0.032 0.008 0.008
#> GSM587201     1  0.1186      0.863 0.964 0.000 0.020 0.008 0.008
#> GSM587202     1  0.1671      0.844 0.924 0.000 0.076 0.000 0.000
#> GSM198767     1  0.3495      0.809 0.816 0.000 0.000 0.152 0.032
#> GSM198769     1  0.5086      0.632 0.660 0.000 0.016 0.288 0.036
#> GSM198772     1  0.2910      0.863 0.888 0.000 0.052 0.036 0.024
#> GSM198773     1  0.2072      0.867 0.928 0.000 0.016 0.036 0.020
#> GSM198776     5  0.3141      0.796 0.108 0.000 0.000 0.040 0.852
#> GSM198778     5  0.1278      0.859 0.004 0.000 0.016 0.020 0.960
#> GSM198780     5  0.0671      0.860 0.004 0.000 0.016 0.000 0.980
#> GSM198781     1  0.4268      0.625 0.708 0.000 0.000 0.024 0.268
#> GSM198765     3  0.3841      0.793 0.188 0.000 0.780 0.000 0.032
#> GSM198766     1  0.2712      0.839 0.880 0.000 0.032 0.000 0.088
#> GSM198768     3  0.1018      0.918 0.016 0.000 0.968 0.000 0.016
#> GSM198770     3  0.0693      0.918 0.012 0.000 0.980 0.000 0.008
#> GSM198771     3  0.2806      0.842 0.152 0.000 0.844 0.000 0.004
#> GSM198774     5  0.0955      0.859 0.004 0.000 0.028 0.000 0.968
#> GSM198775     5  0.1908      0.830 0.000 0.000 0.092 0.000 0.908
#> GSM198777     3  0.2020      0.879 0.000 0.000 0.900 0.000 0.100
#> GSM198779     5  0.2852      0.752 0.000 0.000 0.172 0.000 0.828
#> GSM587218     4  0.0162      0.994 0.004 0.000 0.000 0.996 0.000
#> GSM587219     4  0.0162      0.994 0.004 0.000 0.000 0.996 0.000
#> GSM587220     4  0.0162      0.994 0.004 0.000 0.000 0.996 0.000
#> GSM587221     4  0.0162      0.994 0.004 0.000 0.000 0.996 0.000
#> GSM587222     4  0.0162      0.994 0.004 0.000 0.000 0.996 0.000
#> GSM587223     4  0.0162      0.994 0.004 0.000 0.000 0.996 0.000
#> GSM587224     4  0.0162      0.994 0.004 0.000 0.000 0.996 0.000
#> GSM587225     4  0.0162      0.994 0.004 0.000 0.000 0.996 0.000
#> GSM587226     4  0.0162      0.994 0.004 0.000 0.000 0.996 0.000
#> GSM587227     4  0.0579      0.986 0.008 0.000 0.000 0.984 0.008
#> GSM587228     4  0.0290      0.991 0.008 0.000 0.000 0.992 0.000
#> GSM587229     4  0.1251      0.958 0.008 0.000 0.000 0.956 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
#> GSM587155     2  0.0000      0.985 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587156     2  0.0405      0.980 0.000 0.988 0.000 0.000 0.004 0.008
#> GSM587157     2  0.0000      0.985 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587158     2  0.0000      0.985 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587159     2  0.0000      0.985 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587160     2  0.0000      0.985 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587161     2  0.0146      0.984 0.000 0.996 0.000 0.000 0.000 0.004
#> GSM587162     2  0.0000      0.985 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587163     2  0.0000      0.985 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587164     2  0.0000      0.985 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587165     2  0.0000      0.985 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587166     2  0.0622      0.975 0.000 0.980 0.000 0.000 0.008 0.012
#> GSM587167     2  0.0000      0.985 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587168     2  0.0000      0.985 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587169     2  0.0146      0.984 0.000 0.996 0.000 0.000 0.000 0.004
#> GSM587170     2  0.0146      0.984 0.000 0.996 0.000 0.000 0.000 0.004
#> GSM587171     2  0.0000      0.985 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587172     2  0.0000      0.985 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587173     2  0.0405      0.979 0.000 0.988 0.008 0.000 0.000 0.004
#> GSM587174     2  0.0000      0.985 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587175     2  0.0000      0.985 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587176     2  0.0000      0.985 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587177     2  0.0000      0.985 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587178     2  0.0000      0.985 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587179     2  0.0146      0.984 0.000 0.996 0.000 0.000 0.000 0.004
#> GSM587180     2  0.0000      0.985 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587181     2  0.0000      0.985 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM587182     2  0.0146      0.984 0.000 0.996 0.000 0.000 0.000 0.004
#> GSM587183     2  0.2173      0.914 0.000 0.904 0.028 0.000 0.064 0.004
#> GSM587184     2  0.2034      0.921 0.000 0.912 0.024 0.000 0.060 0.004
#> GSM587185     2  0.2492      0.901 0.000 0.888 0.036 0.000 0.068 0.008
#> GSM587186     2  0.2744      0.871 0.000 0.864 0.072 0.000 0.064 0.000
#> GSM587187     3  0.1736      0.718 0.008 0.020 0.936 0.000 0.032 0.004
#> GSM587188     3  0.3075      0.679 0.028 0.036 0.864 0.000 0.068 0.004
#> GSM587189     3  0.1129      0.723 0.008 0.012 0.964 0.000 0.012 0.004
#> GSM587190     3  0.1630      0.727 0.020 0.000 0.940 0.000 0.024 0.016
#> GSM587203     6  0.6000      0.282 0.004 0.000 0.000 0.368 0.200 0.428
#> GSM587204     1  0.3919      0.739 0.796 0.000 0.000 0.044 0.120 0.040
#> GSM587205     6  0.2432      0.792 0.000 0.000 0.000 0.024 0.100 0.876
#> GSM587206     6  0.2579      0.795 0.000 0.000 0.000 0.040 0.088 0.872
#> GSM587207     6  0.2487      0.797 0.000 0.000 0.000 0.032 0.092 0.876
#> GSM587208     6  0.2457      0.799 0.000 0.000 0.000 0.036 0.084 0.880
#> GSM587209     5  0.4493      0.796 0.008 0.000 0.040 0.060 0.764 0.128
#> GSM587210     1  0.1708      0.799 0.932 0.000 0.000 0.040 0.024 0.004
#> GSM587211     5  0.4430      0.688 0.004 0.000 0.116 0.008 0.744 0.128
#> GSM587212     1  0.0891      0.803 0.968 0.000 0.000 0.008 0.024 0.000
#> GSM587213     5  0.3879      0.774 0.008 0.000 0.020 0.012 0.764 0.196
#> GSM587214     1  0.6351     -0.123 0.412 0.000 0.000 0.036 0.400 0.152
#> GSM587215     1  0.4948      0.521 0.648 0.000 0.000 0.012 0.260 0.080
#> GSM587216     1  0.3092      0.756 0.840 0.000 0.000 0.028 0.120 0.012
#> GSM587217     1  0.6795      0.323 0.500 0.000 0.000 0.164 0.232 0.104
#> GSM587191     3  0.4101      0.554 0.000 0.000 0.580 0.000 0.408 0.012
#> GSM587192     1  0.0858      0.803 0.968 0.000 0.000 0.000 0.028 0.004
#> GSM587193     5  0.3972      0.752 0.016 0.000 0.076 0.000 0.784 0.124
#> GSM587194     1  0.2220      0.778 0.908 0.000 0.044 0.000 0.036 0.012
#> GSM587195     3  0.3607      0.656 0.000 0.000 0.652 0.000 0.348 0.000
#> GSM587196     1  0.2912      0.716 0.816 0.000 0.172 0.000 0.012 0.000
#> GSM587197     3  0.2854      0.736 0.000 0.000 0.792 0.000 0.208 0.000
#> GSM587198     3  0.4232      0.701 0.000 0.000 0.732 0.000 0.168 0.100
#> GSM587199     1  0.3416      0.747 0.836 0.000 0.088 0.000 0.040 0.036
#> GSM587200     6  0.1604      0.756 0.008 0.000 0.024 0.008 0.016 0.944
#> GSM587201     6  0.1829      0.775 0.004 0.000 0.012 0.000 0.064 0.920
#> GSM587202     6  0.2146      0.725 0.008 0.000 0.060 0.000 0.024 0.908
#> GSM198767     6  0.5860      0.272 0.016 0.000 0.000 0.144 0.320 0.520
#> GSM198769     5  0.5641      0.610 0.052 0.000 0.000 0.208 0.632 0.108
#> GSM198772     5  0.4400      0.799 0.028 0.000 0.020 0.064 0.780 0.108
#> GSM198773     5  0.4104      0.777 0.020 0.000 0.000 0.048 0.760 0.172
#> GSM198776     1  0.4016      0.726 0.784 0.000 0.000 0.040 0.136 0.040
#> GSM198778     1  0.1296      0.802 0.952 0.000 0.004 0.032 0.012 0.000
#> GSM198780     1  0.0748      0.802 0.976 0.000 0.004 0.004 0.016 0.000
#> GSM198781     5  0.6028      0.505 0.248 0.000 0.000 0.036 0.560 0.156
#> GSM198765     3  0.4928      0.366 0.032 0.000 0.480 0.000 0.472 0.016
#> GSM198766     5  0.4104      0.760 0.092 0.000 0.028 0.000 0.784 0.096
#> GSM198768     3  0.3966      0.529 0.000 0.000 0.552 0.000 0.444 0.004
#> GSM198770     3  0.3126      0.723 0.000 0.000 0.752 0.000 0.248 0.000
#> GSM198771     3  0.4958      0.659 0.008 0.000 0.660 0.000 0.224 0.108
#> GSM198774     1  0.0508      0.801 0.984 0.000 0.004 0.000 0.012 0.000
#> GSM198775     1  0.2787      0.763 0.872 0.000 0.072 0.000 0.044 0.012
#> GSM198777     3  0.3291      0.706 0.104 0.000 0.828 0.000 0.064 0.004
#> GSM198779     1  0.4823      0.604 0.700 0.000 0.204 0.000 0.056 0.040
#> GSM587218     4  0.0363      0.974 0.000 0.000 0.000 0.988 0.012 0.000
#> GSM587219     4  0.0000      0.982 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM587220     4  0.0000      0.982 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM587221     4  0.0000      0.982 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM587222     4  0.0000      0.982 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM587223     4  0.0000      0.982 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM587224     4  0.0000      0.982 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM587225     4  0.0146      0.980 0.000 0.000 0.000 0.996 0.004 0.000
#> GSM587226     4  0.0000      0.982 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM587227     4  0.0717      0.968 0.016 0.000 0.000 0.976 0.008 0.000
#> GSM587228     4  0.0881      0.965 0.008 0.000 0.000 0.972 0.012 0.008
#> GSM587229     4  0.2321      0.879 0.052 0.000 0.000 0.900 0.040 0.008

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

consensus_heatmap(res, k = 2)

plot of chunk tab-ATC-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 specimen(p) k
#> ATC:NMF 92    7.21e-17 2
#> ATC:NMF 84    5.05e-28 3
#> ATC:NMF 90    5.52e-35 4
#> ATC:NMF 89    3.95e-34 5
#> ATC:NMF 87    6.15e-33 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