cola Report for GDS4318

Date: 2019-12-25 21:30:38 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 31589 rows and 108 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] 31589   108

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
SD:kmeans 2 1.000 0.995 0.998 **
SD:skmeans 2 1.000 0.974 0.989 **
SD:mclust 2 1.000 0.995 0.998 **
MAD:mclust 2 1.000 0.989 0.995 **
ATC:kmeans 2 1.000 0.986 0.994 **
ATC:skmeans 2 1.000 0.999 0.999 **
ATC:pam 2 1.000 0.972 0.989 **
ATC:mclust 2 1.000 0.990 0.993 **
ATC:NMF 2 1.000 0.970 0.987 **
SD:NMF 2 0.999 0.955 0.981 **
CV:mclust 2 0.980 0.962 0.983 **
ATC:hclust 2 0.978 0.949 0.974 **
MAD:kmeans 2 0.923 0.936 0.970 *
MAD:skmeans 2 0.923 0.940 0.975 *
MAD:NMF 2 0.867 0.918 0.965
CV:skmeans 2 0.830 0.886 0.954
CV:NMF 2 0.813 0.883 0.952
CV:kmeans 3 0.772 0.853 0.915
SD:pam 3 0.697 0.865 0.927
MAD:pam 2 0.642 0.893 0.927
CV:pam 3 0.484 0.727 0.873
SD:hclust 4 0.327 0.583 0.729
CV:hclust 4 0.313 0.586 0.733
MAD:hclust 3 0.302 0.638 0.791

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

CDF of consensus matrices

Cumulative distribution function curves of consensus matrix for all methods.

collect_plots(res_list, fun = plot_ecdf)

plot of chunk collect-plots

Consensus heatmap

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

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

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

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

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

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

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

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

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

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

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

Membership heatmap

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

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

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

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

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

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

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

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

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

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

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

Signature heatmap

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

Note in following heatmaps, rows are scaled.

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

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

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

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

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

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

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

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

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

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

Statistics table

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

get_stats(res_list, k = 2)
#>             k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> SD:NMF      2 0.999           0.955       0.981          0.446 0.551   0.551
#> CV:NMF      2 0.813           0.883       0.952          0.459 0.551   0.551
#> MAD:NMF     2 0.867           0.918       0.965          0.462 0.534   0.534
#> ATC:NMF     2 1.000           0.970       0.987          0.447 0.558   0.558
#> SD:skmeans  2 1.000           0.974       0.989          0.481 0.520   0.520
#> CV:skmeans  2 0.830           0.886       0.954          0.496 0.502   0.502
#> MAD:skmeans 2 0.923           0.940       0.975          0.490 0.516   0.516
#> ATC:skmeans 2 1.000           0.999       0.999          0.476 0.525   0.525
#> SD:mclust   2 1.000           0.995       0.998          0.347 0.651   0.651
#> CV:mclust   2 0.980           0.962       0.983          0.315 0.695   0.695
#> MAD:mclust  2 1.000           0.989       0.995          0.348 0.651   0.651
#> ATC:mclust  2 1.000           0.990       0.993          0.354 0.651   0.651
#> SD:kmeans   2 1.000           0.995       0.998          0.352 0.651   0.651
#> CV:kmeans   2 0.799           0.898       0.954          0.390 0.641   0.641
#> MAD:kmeans  2 0.923           0.936       0.970          0.378 0.651   0.651
#> ATC:kmeans  2 1.000           0.986       0.994          0.370 0.631   0.631
#> SD:pam      2 0.681           0.830       0.909          0.371 0.565   0.565
#> CV:pam      2 0.506           0.880       0.853          0.318 0.732   0.732
#> MAD:pam     2 0.642           0.893       0.927          0.448 0.551   0.551
#> ATC:pam     2 1.000           0.972       0.989          0.384 0.612   0.612
#> SD:hclust   2 0.760           0.863       0.940          0.325 0.720   0.720
#> CV:hclust   2 0.430           0.814       0.886          0.362 0.662   0.662
#> MAD:hclust  2 0.719           0.849       0.934          0.335 0.707   0.707
#> ATC:hclust  2 0.978           0.949       0.974          0.341 0.684   0.684
get_stats(res_list, k = 3)
#>             k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> SD:NMF      3 0.794           0.871       0.942          0.262 0.861   0.758
#> CV:NMF      3 0.592           0.737       0.876          0.296 0.797   0.655
#> MAD:NMF     3 0.749           0.795       0.914          0.279 0.802   0.658
#> ATC:NMF     3 0.657           0.748       0.887          0.392 0.747   0.566
#> SD:skmeans  3 0.860           0.874       0.945          0.379 0.750   0.547
#> CV:skmeans  3 0.693           0.779       0.898          0.334 0.748   0.538
#> MAD:skmeans 3 0.811           0.871       0.940          0.360 0.771   0.575
#> ATC:skmeans 3 0.896           0.886       0.952          0.263 0.877   0.771
#> SD:mclust   3 0.556           0.746       0.812          0.645 0.745   0.608
#> CV:mclust   3 0.414           0.716       0.818          0.877 0.648   0.503
#> MAD:mclust  3 0.598           0.799       0.847          0.669 0.709   0.553
#> ATC:mclust  3 0.470           0.629       0.803          0.745 0.695   0.531
#> SD:kmeans   3 0.680           0.847       0.904          0.816 0.695   0.531
#> CV:kmeans   3 0.772           0.853       0.915          0.655 0.693   0.526
#> MAD:kmeans  3 0.783           0.915       0.938          0.720 0.695   0.531
#> ATC:kmeans  3 0.866           0.889       0.952          0.709 0.695   0.528
#> SD:pam      3 0.697           0.865       0.927          0.650 0.701   0.523
#> CV:pam      3 0.484           0.727       0.873          0.858 0.669   0.548
#> MAD:pam     3 0.514           0.774       0.857          0.372 0.714   0.534
#> ATC:pam     3 0.899           0.925       0.969          0.539 0.745   0.603
#> SD:hclust   3 0.272           0.498       0.728          0.828 0.634   0.496
#> CV:hclust   3 0.259           0.544       0.712          0.595 0.690   0.538
#> MAD:hclust  3 0.302           0.638       0.791          0.834 0.641   0.497
#> ATC:hclust  3 0.432           0.726       0.821          0.625 0.760   0.649
get_stats(res_list, k = 4)
#>             k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> SD:NMF      4 0.614           0.722       0.863         0.2209 0.729   0.472
#> CV:NMF      4 0.591           0.699       0.858         0.1790 0.778   0.529
#> MAD:NMF     4 0.589           0.660       0.846         0.1716 0.776   0.528
#> ATC:NMF     4 0.491           0.435       0.687         0.1376 0.868   0.664
#> SD:skmeans  4 0.620           0.534       0.737         0.1192 0.916   0.758
#> CV:skmeans  4 0.533           0.594       0.776         0.1297 0.853   0.599
#> MAD:skmeans 4 0.588           0.536       0.739         0.1181 0.940   0.825
#> ATC:skmeans 4 0.757           0.836       0.894         0.1852 0.828   0.597
#> SD:mclust   4 0.604           0.768       0.845         0.1866 0.824   0.603
#> CV:mclust   4 0.304           0.586       0.752         0.1281 0.858   0.647
#> MAD:mclust  4 0.639           0.761       0.877         0.1847 0.896   0.733
#> ATC:mclust  4 0.585           0.674       0.805         0.1036 0.811   0.543
#> SD:kmeans   4 0.598           0.636       0.806         0.1483 0.882   0.678
#> CV:kmeans   4 0.555           0.585       0.775         0.1358 0.855   0.624
#> MAD:kmeans  4 0.586           0.615       0.795         0.1375 0.892   0.702
#> ATC:kmeans  4 0.594           0.608       0.766         0.1292 0.930   0.811
#> SD:pam      4 0.763           0.826       0.918         0.1621 0.893   0.731
#> CV:pam      4 0.488           0.635       0.797         0.2016 0.734   0.442
#> MAD:pam     4 0.678           0.772       0.883         0.1680 0.861   0.663
#> ATC:pam     4 0.718           0.790       0.841         0.0973 0.958   0.902
#> SD:hclust   4 0.327           0.583       0.729         0.1813 0.794   0.516
#> CV:hclust   4 0.313           0.586       0.733         0.1725 0.848   0.638
#> MAD:hclust  4 0.348           0.533       0.712         0.1398 0.918   0.783
#> ATC:hclust  4 0.471           0.660       0.784         0.1730 0.971   0.935
get_stats(res_list, k = 5)
#>             k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> SD:NMF      5 0.531           0.539       0.752         0.0942 0.877   0.637
#> CV:NMF      5 0.536           0.553       0.747         0.0962 0.866   0.588
#> MAD:NMF     5 0.550           0.559       0.756         0.0920 0.862   0.605
#> ATC:NMF     5 0.532           0.506       0.715         0.0659 0.774   0.431
#> SD:skmeans  5 0.624           0.488       0.729         0.0602 0.868   0.575
#> CV:skmeans  5 0.531           0.438       0.656         0.0595 0.955   0.828
#> MAD:skmeans 5 0.596           0.468       0.704         0.0616 0.854   0.552
#> ATC:skmeans 5 0.745           0.746       0.848         0.0551 0.911   0.690
#> SD:mclust   5 0.603           0.744       0.822         0.0820 0.842   0.568
#> CV:mclust   5 0.452           0.524       0.688         0.1040 0.909   0.720
#> MAD:mclust  5 0.613           0.693       0.798         0.0690 0.845   0.570
#> ATC:mclust  5 0.587           0.664       0.768         0.0610 0.768   0.453
#> SD:kmeans   5 0.614           0.550       0.751         0.0747 0.902   0.659
#> CV:kmeans   5 0.555           0.468       0.695         0.0726 0.893   0.645
#> MAD:kmeans  5 0.599           0.529       0.711         0.0699 0.889   0.619
#> ATC:kmeans  5 0.627           0.600       0.754         0.0762 0.877   0.639
#> SD:pam      5 0.614           0.554       0.784         0.0610 0.927   0.763
#> CV:pam      5 0.480           0.520       0.716         0.0597 0.962   0.872
#> MAD:pam     5 0.631           0.609       0.789         0.0515 0.907   0.710
#> ATC:pam     5 0.701           0.707       0.858         0.1372 0.862   0.655
#> SD:hclust   5 0.438           0.514       0.682         0.0857 0.944   0.804
#> CV:hclust   5 0.393           0.525       0.681         0.0905 0.956   0.867
#> MAD:hclust  5 0.419           0.486       0.668         0.0875 0.890   0.668
#> ATC:hclust  5 0.463           0.419       0.615         0.0772 0.783   0.516
get_stats(res_list, k = 6)
#>             k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> SD:NMF      6 0.558           0.432       0.687         0.0594 0.834   0.469
#> CV:NMF      6 0.551           0.457       0.676         0.0550 0.925   0.692
#> MAD:NMF     6 0.545           0.425       0.679         0.0592 0.877   0.580
#> ATC:NMF     6 0.572           0.476       0.705         0.0352 0.876   0.611
#> SD:skmeans  6 0.618           0.397       0.633         0.0374 0.920   0.681
#> CV:skmeans  6 0.537           0.372       0.597         0.0398 0.898   0.612
#> MAD:skmeans 6 0.609           0.403       0.654         0.0400 0.898   0.591
#> ATC:skmeans 6 0.725           0.669       0.772         0.0279 0.946   0.775
#> SD:mclust   6 0.577           0.582       0.771         0.0504 0.915   0.697
#> CV:mclust   6 0.473           0.432       0.624         0.0570 0.820   0.438
#> MAD:mclust  6 0.558           0.565       0.755         0.0514 0.917   0.695
#> ATC:mclust  6 0.611           0.660       0.789         0.0275 0.923   0.765
#> SD:kmeans   6 0.626           0.468       0.668         0.0440 0.897   0.573
#> CV:kmeans   6 0.589           0.417       0.648         0.0468 0.884   0.532
#> MAD:kmeans  6 0.614           0.480       0.676         0.0443 0.907   0.602
#> ATC:kmeans  6 0.656           0.473       0.658         0.0490 0.873   0.558
#> SD:pam      6 0.705           0.679       0.838         0.0488 0.920   0.708
#> CV:pam      6 0.510           0.520       0.721         0.0443 0.906   0.669
#> MAD:pam     6 0.711           0.735       0.861         0.0521 0.929   0.734
#> ATC:pam     6 0.799           0.730       0.877         0.0701 0.864   0.549
#> SD:hclust   6 0.481           0.407       0.644         0.0440 0.986   0.939
#> CV:hclust   6 0.444           0.324       0.609         0.0495 0.958   0.870
#> MAD:hclust  6 0.490           0.435       0.645         0.0531 0.927   0.718
#> ATC:hclust  6 0.547           0.589       0.748         0.0704 0.876   0.592

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 genotype/variation(p) k
#> SD:NMF      106                0.1703 2
#> CV:NMF      101                0.2989 2
#> MAD:NMF     104                0.1517 2
#> ATC:NMF     107                0.3054 2
#> SD:skmeans  107                0.0967 2
#> CV:skmeans  101                0.4818 2
#> MAD:skmeans 104                0.1161 2
#> ATC:skmeans 108                0.1127 2
#> SD:mclust   108                0.9101 2
#> CV:mclust   108                0.7818 2
#> MAD:mclust  108                0.9101 2
#> ATC:mclust  108                0.9101 2
#> SD:kmeans   108                0.9101 2
#> CV:kmeans   104                0.8866 2
#> MAD:kmeans  107                0.9119 2
#> ATC:kmeans  108                0.7470 2
#> SD:pam      106                0.4059 2
#> CV:pam      107                0.7068 2
#> MAD:pam     107                0.5658 2
#> ATC:pam     106                0.7408 2
#> SD:hclust   103                0.9795 2
#> CV:hclust   100                0.9401 2
#> MAD:hclust  102                0.9727 2
#> ATC:hclust  106                0.8237 2
test_to_known_factors(res_list, k = 3)
#>               n genotype/variation(p) k
#> SD:NMF      103                0.6063 3
#> CV:NMF       93                0.5810 3
#> MAD:NMF      95                0.5170 3
#> ATC:NMF      94                0.9274 3
#> SD:skmeans  102                0.5557 3
#> CV:skmeans   93                0.9101 3
#> MAD:skmeans 104                0.6209 3
#> ATC:skmeans  99                0.0945 3
#> SD:mclust    99                0.7376 3
#> CV:mclust    95                0.9285 3
#> MAD:mclust  100                0.9540 3
#> ATC:mclust   78                0.7427 3
#> SD:kmeans   107                0.9822 3
#> CV:kmeans   103                0.9627 3
#> MAD:kmeans  107                0.9822 3
#> ATC:kmeans  103                0.5524 3
#> SD:pam      104                0.5352 3
#> CV:pam       93                0.8518 3
#> MAD:pam     102                0.4210 3
#> ATC:pam     105                0.1090 3
#> SD:hclust    69                0.9949 3
#> CV:hclust    79                0.9990 3
#> MAD:hclust   84                0.9654 3
#> ATC:hclust   99                0.1951 3
test_to_known_factors(res_list, k = 4)
#>               n genotype/variation(p) k
#> SD:NMF       94                 0.907 4
#> CV:NMF       90                 0.653 4
#> MAD:NMF      85                 0.878 4
#> ATC:NMF      51                 0.792 4
#> SD:skmeans   66                 0.790 4
#> CV:skmeans   76                 0.831 4
#> MAD:skmeans  64                 0.844 4
#> ATC:skmeans 102                 0.138 4
#> SD:mclust   100                 0.763 4
#> CV:mclust    79                 0.797 4
#> MAD:mclust   95                 0.840 4
#> ATC:mclust   86                 0.866 4
#> SD:kmeans    84                 0.630 4
#> CV:kmeans    82                 0.870 4
#> MAD:kmeans   83                 0.673 4
#> ATC:kmeans   86                 0.863 4
#> SD:pam      100                 0.558 4
#> CV:pam       86                 0.458 4
#> MAD:pam      96                 0.290 4
#> ATC:pam      98                 0.102 4
#> SD:hclust    83                 0.888 4
#> CV:hclust    78                 0.956 4
#> MAD:hclust   77                 0.978 4
#> ATC:hclust   89                 0.148 4
test_to_known_factors(res_list, k = 5)
#>              n genotype/variation(p) k
#> SD:NMF      70                0.8109 5
#> CV:NMF      68                0.6960 5
#> MAD:NMF     76                0.4894 5
#> ATC:NMF     56                0.2711 5
#> SD:skmeans  55                0.5412 5
#> CV:skmeans  43                0.9809 5
#> MAD:skmeans 55                0.6989 5
#> ATC:skmeans 95                0.2010 5
#> SD:mclust   94                0.8831 5
#> CV:mclust   70                0.6162 5
#> MAD:mclust  92                0.7667 5
#> ATC:mclust  93                0.0901 5
#> SD:kmeans   69                0.5907 5
#> CV:kmeans   55                0.9848 5
#> MAD:kmeans  63                0.5201 5
#> ATC:kmeans  90                0.5543 5
#> SD:pam      77                0.3166 5
#> CV:pam      77                0.1401 5
#> MAD:pam     80                0.1433 5
#> ATC:pam     86                0.3476 5
#> SD:hclust   63                0.8169 5
#> CV:hclust   75                0.9425 5
#> MAD:hclust  60                0.9389 5
#> ATC:hclust  61                0.5502 5
test_to_known_factors(res_list, k = 6)
#>              n genotype/variation(p) k
#> SD:NMF      41                 0.651 6
#> CV:NMF      52                 0.439 6
#> MAD:NMF     40                 0.767 6
#> ATC:NMF     57                 0.059 6
#> SD:skmeans  36                 0.477 6
#> CV:skmeans  36                 0.623 6
#> MAD:skmeans 38                 0.346 6
#> ATC:skmeans 87                 0.759 6
#> SD:mclust   83                 0.716 6
#> CV:mclust   67                 0.296 6
#> MAD:mclust  79                 0.481 6
#> ATC:mclust  84                 0.179 6
#> SD:kmeans   50                 0.459 6
#> CV:kmeans   50                 0.596 6
#> MAD:kmeans  54                 0.466 6
#> ATC:kmeans  65                 0.248 6
#> SD:pam      93                 0.829 6
#> CV:pam      67                 0.200 6
#> MAD:pam     97                 0.584 6
#> ATC:pam     90                 0.154 6
#> SD:hclust   46                 0.898 6
#> CV:hclust   17                 0.499 6
#> MAD:hclust  42                 0.920 6
#> ATC:hclust  77                 0.241 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 31589 rows and 108 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.760           0.863       0.940         0.3245 0.720   0.720
#> 3 3 0.272           0.498       0.728         0.8276 0.634   0.496
#> 4 4 0.327           0.583       0.729         0.1813 0.794   0.516
#> 5 5 0.438           0.514       0.682         0.0857 0.944   0.804
#> 6 6 0.481           0.407       0.644         0.0440 0.986   0.939

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
#> GSM955002     2  0.2236     0.9144 0.036 0.964
#> GSM955008     2  0.0000     0.9347 0.000 1.000
#> GSM955016     2  0.9922     0.2588 0.448 0.552
#> GSM955019     2  0.0000     0.9347 0.000 1.000
#> GSM955022     2  0.0376     0.9334 0.004 0.996
#> GSM955023     2  0.0376     0.9334 0.004 0.996
#> GSM955027     2  0.0000     0.9347 0.000 1.000
#> GSM955043     2  0.0000     0.9347 0.000 1.000
#> GSM955048     1  0.0000     0.9357 1.000 0.000
#> GSM955049     2  0.0000     0.9347 0.000 1.000
#> GSM955054     2  0.0000     0.9347 0.000 1.000
#> GSM955064     2  0.0000     0.9347 0.000 1.000
#> GSM955072     2  0.0000     0.9347 0.000 1.000
#> GSM955075     2  0.0000     0.9347 0.000 1.000
#> GSM955079     2  0.0672     0.9316 0.008 0.992
#> GSM955087     1  0.0000     0.9357 1.000 0.000
#> GSM955088     2  0.0000     0.9347 0.000 1.000
#> GSM955089     1  0.0376     0.9337 0.996 0.004
#> GSM955095     2  0.0000     0.9347 0.000 1.000
#> GSM955097     2  0.1843     0.9208 0.028 0.972
#> GSM955101     2  0.0000     0.9347 0.000 1.000
#> GSM954999     2  0.8955     0.5956 0.312 0.688
#> GSM955001     2  0.0000     0.9347 0.000 1.000
#> GSM955003     2  0.0000     0.9347 0.000 1.000
#> GSM955004     2  0.0376     0.9332 0.004 0.996
#> GSM955005     2  0.6148     0.8138 0.152 0.848
#> GSM955009     2  0.0000     0.9347 0.000 1.000
#> GSM955011     2  0.9286     0.5329 0.344 0.656
#> GSM955012     2  0.0000     0.9347 0.000 1.000
#> GSM955013     2  0.3114     0.9004 0.056 0.944
#> GSM955015     2  0.0000     0.9347 0.000 1.000
#> GSM955017     1  0.4022     0.8736 0.920 0.080
#> GSM955021     2  0.0000     0.9347 0.000 1.000
#> GSM955025     2  0.1184     0.9274 0.016 0.984
#> GSM955028     1  0.0000     0.9357 1.000 0.000
#> GSM955029     2  0.0000     0.9347 0.000 1.000
#> GSM955030     2  0.6623     0.7917 0.172 0.828
#> GSM955032     2  0.0672     0.9316 0.008 0.992
#> GSM955033     2  0.5737     0.8293 0.136 0.864
#> GSM955034     1  0.0000     0.9357 1.000 0.000
#> GSM955035     2  0.0000     0.9347 0.000 1.000
#> GSM955036     2  0.0376     0.9334 0.004 0.996
#> GSM955037     2  0.9983     0.1000 0.476 0.524
#> GSM955039     2  0.3114     0.9001 0.056 0.944
#> GSM955041     2  0.0000     0.9347 0.000 1.000
#> GSM955042     2  0.9000     0.5883 0.316 0.684
#> GSM955045     2  0.0000     0.9347 0.000 1.000
#> GSM955046     2  0.0376     0.9334 0.004 0.996
#> GSM955047     1  0.1184     0.9262 0.984 0.016
#> GSM955050     2  0.8608     0.6436 0.284 0.716
#> GSM955052     2  0.0000     0.9347 0.000 1.000
#> GSM955053     1  0.0000     0.9357 1.000 0.000
#> GSM955056     2  0.0000     0.9347 0.000 1.000
#> GSM955058     2  0.0000     0.9347 0.000 1.000
#> GSM955059     2  0.0376     0.9334 0.004 0.996
#> GSM955060     1  0.3733     0.8814 0.928 0.072
#> GSM955061     2  0.0000     0.9347 0.000 1.000
#> GSM955065     1  0.0000     0.9357 1.000 0.000
#> GSM955066     2  0.1633     0.9235 0.024 0.976
#> GSM955067     1  0.0000     0.9357 1.000 0.000
#> GSM955073     2  0.0000     0.9347 0.000 1.000
#> GSM955074     1  0.9754     0.2366 0.592 0.408
#> GSM955076     2  0.0000     0.9347 0.000 1.000
#> GSM955078     2  0.0000     0.9347 0.000 1.000
#> GSM955083     2  0.7299     0.7552 0.204 0.796
#> GSM955084     2  0.0000     0.9347 0.000 1.000
#> GSM955086     2  0.1184     0.9276 0.016 0.984
#> GSM955091     2  0.0000     0.9347 0.000 1.000
#> GSM955092     2  0.0000     0.9347 0.000 1.000
#> GSM955093     2  0.0000     0.9347 0.000 1.000
#> GSM955098     2  0.0000     0.9347 0.000 1.000
#> GSM955099     2  0.0000     0.9347 0.000 1.000
#> GSM955100     2  0.9087     0.5731 0.324 0.676
#> GSM955103     2  0.0376     0.9334 0.004 0.996
#> GSM955104     2  0.2778     0.9072 0.048 0.952
#> GSM955106     2  0.0376     0.9333 0.004 0.996
#> GSM955000     1  0.9754     0.2785 0.592 0.408
#> GSM955006     2  1.0000     0.0735 0.500 0.500
#> GSM955007     2  0.0000     0.9347 0.000 1.000
#> GSM955010     2  0.7815     0.7187 0.232 0.768
#> GSM955014     1  0.0000     0.9357 1.000 0.000
#> GSM955018     2  0.0672     0.9316 0.008 0.992
#> GSM955020     1  0.0000     0.9357 1.000 0.000
#> GSM955024     2  0.0000     0.9347 0.000 1.000
#> GSM955026     2  0.0000     0.9347 0.000 1.000
#> GSM955031     2  0.8713     0.6280 0.292 0.708
#> GSM955038     2  0.8499     0.6558 0.276 0.724
#> GSM955040     2  0.8661     0.6367 0.288 0.712
#> GSM955044     2  0.0000     0.9347 0.000 1.000
#> GSM955051     1  0.0000     0.9357 1.000 0.000
#> GSM955055     2  0.0000     0.9347 0.000 1.000
#> GSM955057     1  0.0000     0.9357 1.000 0.000
#> GSM955062     2  0.0000     0.9347 0.000 1.000
#> GSM955063     2  0.0000     0.9347 0.000 1.000
#> GSM955068     2  0.0000     0.9347 0.000 1.000
#> GSM955069     2  0.0000     0.9347 0.000 1.000
#> GSM955070     2  0.0000     0.9347 0.000 1.000
#> GSM955071     2  0.8081     0.6981 0.248 0.752
#> GSM955077     2  0.3431     0.8944 0.064 0.936
#> GSM955080     2  0.0000     0.9347 0.000 1.000
#> GSM955081     2  0.0000     0.9347 0.000 1.000
#> GSM955082     2  0.0000     0.9347 0.000 1.000
#> GSM955085     2  0.0000     0.9347 0.000 1.000
#> GSM955090     1  0.0000     0.9357 1.000 0.000
#> GSM955094     2  0.0672     0.9317 0.008 0.992
#> GSM955096     2  0.0000     0.9347 0.000 1.000
#> GSM955102     2  0.1843     0.9209 0.028 0.972
#> GSM955105     2  0.0672     0.9316 0.008 0.992

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1    p2    p3
#> GSM955002     2  0.7207     0.2019 0.032 0.584 0.384
#> GSM955008     3  0.6126     0.4034 0.000 0.400 0.600
#> GSM955016     1  0.9776     0.0458 0.424 0.332 0.244
#> GSM955019     2  0.4235     0.6351 0.000 0.824 0.176
#> GSM955022     3  0.5760     0.5351 0.000 0.328 0.672
#> GSM955023     3  0.5760     0.5351 0.000 0.328 0.672
#> GSM955027     2  0.4121     0.6354 0.000 0.832 0.168
#> GSM955043     2  0.2261     0.6760 0.000 0.932 0.068
#> GSM955048     1  0.0237     0.8765 0.996 0.000 0.004
#> GSM955049     2  0.6235     0.0489 0.000 0.564 0.436
#> GSM955054     2  0.6168     0.1690 0.000 0.588 0.412
#> GSM955064     2  0.6140     0.2437 0.000 0.596 0.404
#> GSM955072     2  0.2165     0.6607 0.000 0.936 0.064
#> GSM955075     2  0.3038     0.6719 0.000 0.896 0.104
#> GSM955079     3  0.5178     0.5922 0.000 0.256 0.744
#> GSM955087     1  0.0237     0.8756 0.996 0.000 0.004
#> GSM955088     3  0.5760     0.5423 0.000 0.328 0.672
#> GSM955089     1  0.0475     0.8750 0.992 0.004 0.004
#> GSM955095     2  0.5098     0.5805 0.000 0.752 0.248
#> GSM955097     2  0.4663     0.6344 0.016 0.828 0.156
#> GSM955101     2  0.6180     0.2165 0.000 0.584 0.416
#> GSM954999     2  0.9871    -0.0488 0.280 0.412 0.308
#> GSM955001     2  0.4750     0.5931 0.000 0.784 0.216
#> GSM955003     2  0.6280    -0.0132 0.000 0.540 0.460
#> GSM955004     2  0.1163     0.6533 0.000 0.972 0.028
#> GSM955005     3  0.8967     0.3807 0.148 0.324 0.528
#> GSM955009     2  0.1163     0.6617 0.000 0.972 0.028
#> GSM955011     3  0.9980     0.1499 0.312 0.324 0.364
#> GSM955012     2  0.3267     0.6688 0.000 0.884 0.116
#> GSM955013     3  0.7831     0.3477 0.056 0.404 0.540
#> GSM955015     2  0.6215     0.1218 0.000 0.572 0.428
#> GSM955017     1  0.3459     0.8273 0.892 0.012 0.096
#> GSM955021     2  0.4796     0.5921 0.000 0.780 0.220
#> GSM955025     2  0.3377     0.6513 0.012 0.896 0.092
#> GSM955028     1  0.0237     0.8756 0.996 0.000 0.004
#> GSM955029     2  0.3267     0.6688 0.000 0.884 0.116
#> GSM955030     3  0.9256     0.3346 0.168 0.344 0.488
#> GSM955032     3  0.5327     0.5896 0.000 0.272 0.728
#> GSM955033     2  0.8814     0.0124 0.116 0.480 0.404
#> GSM955034     1  0.0237     0.8756 0.996 0.000 0.004
#> GSM955035     2  0.5497     0.4918 0.000 0.708 0.292
#> GSM955036     3  0.4062     0.5788 0.000 0.164 0.836
#> GSM955037     3  0.7657    -0.1630 0.448 0.044 0.508
#> GSM955039     3  0.7246     0.4997 0.052 0.300 0.648
#> GSM955041     3  0.6309     0.0904 0.000 0.496 0.504
#> GSM955042     2  0.9874    -0.0483 0.284 0.412 0.304
#> GSM955045     2  0.5650     0.4850 0.000 0.688 0.312
#> GSM955046     3  0.4062     0.5788 0.000 0.164 0.836
#> GSM955047     1  0.1585     0.8659 0.964 0.008 0.028
#> GSM955050     3  0.9870     0.1364 0.256 0.364 0.380
#> GSM955052     3  0.6140     0.3970 0.000 0.404 0.596
#> GSM955053     1  0.0237     0.8756 0.996 0.000 0.004
#> GSM955056     3  0.6215     0.3598 0.000 0.428 0.572
#> GSM955058     2  0.3267     0.6688 0.000 0.884 0.116
#> GSM955059     3  0.5650     0.5482 0.000 0.312 0.688
#> GSM955060     1  0.3213     0.8321 0.900 0.008 0.092
#> GSM955061     2  0.3267     0.6688 0.000 0.884 0.116
#> GSM955065     1  0.0424     0.8759 0.992 0.000 0.008
#> GSM955066     3  0.4413     0.5766 0.008 0.160 0.832
#> GSM955067     1  0.0424     0.8759 0.992 0.000 0.008
#> GSM955073     3  0.4062     0.5750 0.000 0.164 0.836
#> GSM955074     1  0.8702     0.3730 0.568 0.292 0.140
#> GSM955076     2  0.2261     0.6634 0.000 0.932 0.068
#> GSM955078     2  0.1529     0.6727 0.000 0.960 0.040
#> GSM955083     2  0.9267     0.1092 0.180 0.504 0.316
#> GSM955084     2  0.1031     0.6556 0.000 0.976 0.024
#> GSM955086     3  0.6102     0.5622 0.008 0.320 0.672
#> GSM955091     2  0.4399     0.6275 0.000 0.812 0.188
#> GSM955092     3  0.6309     0.1467 0.000 0.496 0.504
#> GSM955093     3  0.4178     0.5914 0.000 0.172 0.828
#> GSM955098     2  0.1964     0.6501 0.000 0.944 0.056
#> GSM955099     2  0.1529     0.6727 0.000 0.960 0.040
#> GSM955100     3  0.9941     0.1587 0.292 0.324 0.384
#> GSM955103     3  0.5902     0.5464 0.004 0.316 0.680
#> GSM955104     3  0.6423     0.5905 0.044 0.228 0.728
#> GSM955106     2  0.4465     0.6436 0.004 0.820 0.176
#> GSM955000     1  0.6973     0.3903 0.564 0.020 0.416
#> GSM955006     1  0.9613     0.0786 0.472 0.244 0.284
#> GSM955007     3  0.4750     0.5898 0.000 0.216 0.784
#> GSM955010     3  0.9621     0.1847 0.208 0.360 0.432
#> GSM955014     1  0.0237     0.8765 0.996 0.000 0.004
#> GSM955018     3  0.5138     0.5931 0.000 0.252 0.748
#> GSM955020     1  0.0000     0.8762 1.000 0.000 0.000
#> GSM955024     2  0.6305    -0.1018 0.000 0.516 0.484
#> GSM955026     2  0.2066     0.6560 0.000 0.940 0.060
#> GSM955031     2  0.9706    -0.0226 0.272 0.456 0.272
#> GSM955038     2  0.8734     0.2359 0.248 0.584 0.168
#> GSM955040     3  0.9884     0.1273 0.260 0.364 0.376
#> GSM955044     2  0.2066     0.6748 0.000 0.940 0.060
#> GSM955051     1  0.0424     0.8758 0.992 0.000 0.008
#> GSM955055     2  0.2066     0.6744 0.000 0.940 0.060
#> GSM955057     1  0.0237     0.8765 0.996 0.000 0.004
#> GSM955062     2  0.5497     0.4814 0.000 0.708 0.292
#> GSM955063     3  0.4178     0.5818 0.000 0.172 0.828
#> GSM955068     2  0.1860     0.6529 0.000 0.948 0.052
#> GSM955069     3  0.5291     0.5859 0.000 0.268 0.732
#> GSM955070     2  0.4887     0.5946 0.000 0.772 0.228
#> GSM955071     3  0.9734     0.1447 0.224 0.376 0.400
#> GSM955077     2  0.4887     0.6082 0.060 0.844 0.096
#> GSM955080     2  0.3619     0.6682 0.000 0.864 0.136
#> GSM955081     2  0.6308    -0.1565 0.000 0.508 0.492
#> GSM955082     3  0.6305     0.1873 0.000 0.484 0.516
#> GSM955085     2  0.3267     0.6783 0.000 0.884 0.116
#> GSM955090     1  0.0237     0.8763 0.996 0.000 0.004
#> GSM955094     2  0.4702     0.6084 0.000 0.788 0.212
#> GSM955096     3  0.5882     0.5093 0.000 0.348 0.652
#> GSM955102     3  0.2448     0.5458 0.000 0.076 0.924
#> GSM955105     3  0.5178     0.5947 0.000 0.256 0.744

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM955002     2  0.8046   -0.05434 0.004 0.372 0.332 0.292
#> GSM955008     3  0.4567    0.58521 0.000 0.244 0.740 0.016
#> GSM955016     4  0.5919    0.58770 0.204 0.036 0.044 0.716
#> GSM955019     2  0.5690    0.63890 0.000 0.700 0.216 0.084
#> GSM955022     3  0.5568    0.65255 0.000 0.152 0.728 0.120
#> GSM955023     3  0.5568    0.65255 0.000 0.152 0.728 0.120
#> GSM955027     2  0.5298    0.63639 0.000 0.708 0.244 0.048
#> GSM955043     2  0.4150    0.71734 0.000 0.824 0.120 0.056
#> GSM955048     1  0.1792    0.85514 0.932 0.000 0.000 0.068
#> GSM955049     3  0.6079    0.26119 0.000 0.408 0.544 0.048
#> GSM955054     3  0.6114    0.13907 0.000 0.428 0.524 0.048
#> GSM955064     3  0.6242    0.13095 0.000 0.424 0.520 0.056
#> GSM955072     2  0.5757    0.61524 0.000 0.684 0.076 0.240
#> GSM955075     2  0.4656    0.70209 0.000 0.792 0.136 0.072
#> GSM955079     3  0.4307    0.61123 0.000 0.048 0.808 0.144
#> GSM955087     1  0.0000    0.86168 1.000 0.000 0.000 0.000
#> GSM955088     3  0.6115    0.64180 0.000 0.172 0.680 0.148
#> GSM955089     1  0.0921    0.86157 0.972 0.000 0.000 0.028
#> GSM955095     2  0.5901    0.58729 0.000 0.652 0.280 0.068
#> GSM955097     2  0.5705    0.64301 0.000 0.704 0.092 0.204
#> GSM955101     3  0.6278    0.17230 0.000 0.408 0.532 0.060
#> GSM954999     4  0.5398    0.71569 0.060 0.076 0.076 0.788
#> GSM955001     2  0.5599    0.56463 0.000 0.664 0.288 0.048
#> GSM955003     3  0.6009    0.33092 0.000 0.380 0.572 0.048
#> GSM955004     2  0.2589    0.68962 0.000 0.884 0.000 0.116
#> GSM955005     3  0.7710   -0.14939 0.044 0.084 0.452 0.420
#> GSM955009     2  0.2722    0.68474 0.000 0.904 0.032 0.064
#> GSM955011     4  0.7087    0.71839 0.108 0.068 0.156 0.668
#> GSM955012     2  0.4673    0.69420 0.000 0.792 0.132 0.076
#> GSM955013     3  0.7682    0.38652 0.012 0.212 0.528 0.248
#> GSM955015     3  0.5999    0.18102 0.000 0.404 0.552 0.044
#> GSM955017     1  0.4343    0.68230 0.732 0.000 0.004 0.264
#> GSM955021     2  0.5256    0.57695 0.000 0.692 0.272 0.036
#> GSM955025     2  0.5035    0.65166 0.000 0.748 0.056 0.196
#> GSM955028     1  0.0000    0.86168 1.000 0.000 0.000 0.000
#> GSM955029     2  0.4673    0.69420 0.000 0.792 0.132 0.076
#> GSM955030     4  0.7840    0.17932 0.052 0.084 0.424 0.440
#> GSM955032     3  0.4458    0.64132 0.000 0.076 0.808 0.116
#> GSM955033     4  0.7093    0.49405 0.000 0.212 0.220 0.568
#> GSM955034     1  0.0000    0.86168 1.000 0.000 0.000 0.000
#> GSM955035     2  0.5969    0.34349 0.000 0.564 0.392 0.044
#> GSM955036     3  0.4335    0.55850 0.000 0.036 0.796 0.168
#> GSM955037     1  0.7581   -0.00747 0.440 0.000 0.360 0.200
#> GSM955039     3  0.6701    0.34341 0.008 0.100 0.608 0.284
#> GSM955041     3  0.5973    0.38283 0.000 0.332 0.612 0.056
#> GSM955042     4  0.5471    0.71616 0.064 0.076 0.076 0.784
#> GSM955045     2  0.5936    0.38565 0.000 0.576 0.380 0.044
#> GSM955046     3  0.4335    0.55850 0.000 0.036 0.796 0.168
#> GSM955047     1  0.3610    0.75238 0.800 0.000 0.000 0.200
#> GSM955050     4  0.7387    0.70434 0.072 0.108 0.180 0.640
#> GSM955052     3  0.4675    0.58519 0.000 0.244 0.736 0.020
#> GSM955053     1  0.0188    0.86186 0.996 0.000 0.000 0.004
#> GSM955056     3  0.5256    0.58322 0.000 0.260 0.700 0.040
#> GSM955058     2  0.4673    0.69420 0.000 0.792 0.132 0.076
#> GSM955059     3  0.5432    0.65106 0.000 0.136 0.740 0.124
#> GSM955060     1  0.4134    0.69199 0.740 0.000 0.000 0.260
#> GSM955061     2  0.4673    0.69420 0.000 0.792 0.132 0.076
#> GSM955065     1  0.0188    0.86234 0.996 0.000 0.000 0.004
#> GSM955066     3  0.5050    0.44066 0.000 0.028 0.704 0.268
#> GSM955067     1  0.2081    0.85081 0.916 0.000 0.000 0.084
#> GSM955073     3  0.0927    0.63551 0.000 0.008 0.976 0.016
#> GSM955074     4  0.5712    0.24953 0.384 0.032 0.000 0.584
#> GSM955076     2  0.5910    0.59792 0.000 0.672 0.084 0.244
#> GSM955078     2  0.3796    0.72100 0.000 0.848 0.096 0.056
#> GSM955083     4  0.7018    0.59259 0.024 0.204 0.136 0.636
#> GSM955084     2  0.2266    0.69471 0.000 0.912 0.004 0.084
#> GSM955086     3  0.5759    0.57391 0.000 0.112 0.708 0.180
#> GSM955091     2  0.5820    0.62647 0.000 0.684 0.232 0.084
#> GSM955092     3  0.5368    0.46669 0.000 0.340 0.636 0.024
#> GSM955093     3  0.2255    0.62459 0.000 0.012 0.920 0.068
#> GSM955098     2  0.5799    0.57327 0.000 0.668 0.068 0.264
#> GSM955099     2  0.3652    0.71999 0.000 0.856 0.092 0.052
#> GSM955100     4  0.6772    0.71774 0.092 0.060 0.160 0.688
#> GSM955103     3  0.5208    0.65780 0.000 0.172 0.748 0.080
#> GSM955104     3  0.5322    0.50770 0.016 0.032 0.732 0.220
#> GSM955106     2  0.5690    0.66346 0.000 0.700 0.216 0.084
#> GSM955000     1  0.7220    0.26827 0.544 0.000 0.260 0.196
#> GSM955006     4  0.8009    0.50088 0.332 0.052 0.112 0.504
#> GSM955007     3  0.3687    0.64696 0.000 0.080 0.856 0.064
#> GSM955010     4  0.6924    0.62339 0.032 0.088 0.248 0.632
#> GSM955014     1  0.1867    0.85464 0.928 0.000 0.000 0.072
#> GSM955018     3  0.4307    0.61128 0.000 0.048 0.808 0.144
#> GSM955020     1  0.0592    0.86316 0.984 0.000 0.000 0.016
#> GSM955024     3  0.5954    0.40864 0.000 0.344 0.604 0.052
#> GSM955026     2  0.5799    0.57926 0.000 0.668 0.068 0.264
#> GSM955031     4  0.8523    0.60443 0.096 0.216 0.156 0.532
#> GSM955038     4  0.6075    0.55415 0.036 0.204 0.052 0.708
#> GSM955040     4  0.6729    0.72000 0.068 0.080 0.160 0.692
#> GSM955044     2  0.4780    0.72036 0.000 0.788 0.116 0.096
#> GSM955051     1  0.2345    0.83432 0.900 0.000 0.000 0.100
#> GSM955055     2  0.3505    0.70225 0.000 0.864 0.088 0.048
#> GSM955057     1  0.0817    0.86322 0.976 0.000 0.000 0.024
#> GSM955062     2  0.6052    0.31768 0.000 0.556 0.396 0.048
#> GSM955063     3  0.1624    0.64231 0.000 0.020 0.952 0.028
#> GSM955068     2  0.5478    0.59402 0.000 0.696 0.056 0.248
#> GSM955069     3  0.4469    0.65652 0.000 0.080 0.808 0.112
#> GSM955070     2  0.6745    0.55632 0.000 0.612 0.212 0.176
#> GSM955071     4  0.7511    0.67178 0.060 0.112 0.212 0.616
#> GSM955077     2  0.5880    0.53839 0.012 0.676 0.048 0.264
#> GSM955080     2  0.5265    0.69535 0.000 0.748 0.160 0.092
#> GSM955081     3  0.6074    0.42937 0.000 0.340 0.600 0.060
#> GSM955082     3  0.5548    0.45971 0.000 0.340 0.628 0.032
#> GSM955085     2  0.5222    0.70789 0.000 0.756 0.132 0.112
#> GSM955090     1  0.1022    0.85742 0.968 0.000 0.000 0.032
#> GSM955094     2  0.6585    0.58923 0.000 0.632 0.180 0.188
#> GSM955096     3  0.4446    0.64529 0.000 0.196 0.776 0.028
#> GSM955102     3  0.4155    0.42742 0.004 0.000 0.756 0.240
#> GSM955105     3  0.4332    0.59686 0.000 0.040 0.800 0.160

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM955002     4  0.8549   -0.05257 0.000 0.192 0.252 0.280 0.276
#> GSM955008     3  0.5587    0.57224 0.000 0.100 0.688 0.028 0.184
#> GSM955016     4  0.5627    0.56441 0.148 0.084 0.020 0.720 0.028
#> GSM955019     5  0.6865    0.22617 0.000 0.352 0.184 0.016 0.448
#> GSM955022     3  0.5972    0.63308 0.000 0.060 0.680 0.124 0.136
#> GSM955023     3  0.5972    0.63308 0.000 0.060 0.680 0.124 0.136
#> GSM955027     5  0.6132    0.50510 0.000 0.200 0.212 0.004 0.584
#> GSM955043     5  0.4567    0.53425 0.000 0.164 0.080 0.004 0.752
#> GSM955048     1  0.2228    0.83615 0.908 0.012 0.000 0.076 0.004
#> GSM955049     3  0.6855    0.26588 0.000 0.160 0.500 0.028 0.312
#> GSM955054     3  0.7011    0.15232 0.000 0.184 0.476 0.028 0.312
#> GSM955064     3  0.6685    0.14538 0.000 0.160 0.488 0.016 0.336
#> GSM955072     2  0.5182    0.71651 0.000 0.704 0.032 0.048 0.216
#> GSM955075     5  0.3103    0.57136 0.000 0.044 0.072 0.012 0.872
#> GSM955079     3  0.4146    0.58882 0.000 0.024 0.780 0.176 0.020
#> GSM955087     1  0.0404    0.84830 0.988 0.012 0.000 0.000 0.000
#> GSM955088     3  0.6477    0.61589 0.000 0.092 0.636 0.168 0.104
#> GSM955089     1  0.0671    0.84855 0.980 0.004 0.000 0.016 0.000
#> GSM955095     5  0.5472    0.52307 0.000 0.076 0.220 0.024 0.680
#> GSM955097     5  0.4187    0.45190 0.000 0.048 0.040 0.100 0.812
#> GSM955101     3  0.6727    0.18534 0.000 0.160 0.500 0.020 0.320
#> GSM954999     4  0.3872    0.64022 0.012 0.072 0.028 0.844 0.044
#> GSM955001     5  0.6663    0.40929 0.000 0.224 0.244 0.012 0.520
#> GSM955003     3  0.6776    0.33151 0.000 0.148 0.540 0.036 0.276
#> GSM955004     5  0.3492    0.37878 0.000 0.188 0.000 0.016 0.796
#> GSM955005     4  0.7139    0.18624 0.020 0.068 0.368 0.484 0.060
#> GSM955009     2  0.4700    0.33948 0.000 0.516 0.008 0.004 0.472
#> GSM955011     4  0.4277    0.67678 0.052 0.044 0.076 0.820 0.008
#> GSM955012     5  0.1864    0.56302 0.000 0.004 0.068 0.004 0.924
#> GSM955013     3  0.7614    0.32787 0.000 0.076 0.460 0.268 0.196
#> GSM955015     3  0.6555    0.15708 0.000 0.160 0.508 0.012 0.320
#> GSM955017     1  0.4668    0.63793 0.684 0.044 0.000 0.272 0.000
#> GSM955021     5  0.6908    0.18206 0.000 0.324 0.244 0.008 0.424
#> GSM955025     2  0.6770    0.45873 0.004 0.484 0.024 0.124 0.364
#> GSM955028     1  0.0404    0.84830 0.988 0.012 0.000 0.000 0.000
#> GSM955029     5  0.1864    0.56302 0.000 0.004 0.068 0.004 0.924
#> GSM955030     4  0.7052    0.30542 0.024 0.072 0.324 0.528 0.052
#> GSM955032     3  0.4352    0.62373 0.000 0.040 0.792 0.132 0.036
#> GSM955033     4  0.6887    0.51271 0.000 0.108 0.152 0.600 0.140
#> GSM955034     1  0.0404    0.84830 0.988 0.012 0.000 0.000 0.000
#> GSM955035     5  0.6998    0.27158 0.000 0.232 0.356 0.012 0.400
#> GSM955036     3  0.5603    0.50935 0.000 0.072 0.704 0.164 0.060
#> GSM955037     1  0.7542    0.02498 0.420 0.052 0.308 0.220 0.000
#> GSM955039     3  0.6857    0.27310 0.000 0.064 0.524 0.316 0.096
#> GSM955041     3  0.6123    0.34545 0.000 0.108 0.576 0.016 0.300
#> GSM955042     4  0.3974    0.63992 0.016 0.072 0.028 0.840 0.044
#> GSM955045     5  0.5741    0.37111 0.000 0.088 0.340 0.004 0.568
#> GSM955046     3  0.5603    0.50935 0.000 0.072 0.704 0.164 0.060
#> GSM955047     1  0.4254    0.70968 0.740 0.040 0.000 0.220 0.000
#> GSM955050     4  0.4800    0.67695 0.016 0.076 0.100 0.784 0.024
#> GSM955052     3  0.5664    0.57221 0.000 0.100 0.684 0.032 0.184
#> GSM955053     1  0.0290    0.84857 0.992 0.008 0.000 0.000 0.000
#> GSM955056     3  0.5584    0.58689 0.000 0.132 0.696 0.028 0.144
#> GSM955058     5  0.1864    0.56302 0.000 0.004 0.068 0.004 0.924
#> GSM955059     3  0.5784    0.62932 0.000 0.048 0.692 0.128 0.132
#> GSM955060     1  0.4645    0.64670 0.688 0.044 0.000 0.268 0.000
#> GSM955061     5  0.1864    0.56302 0.000 0.004 0.068 0.004 0.924
#> GSM955065     1  0.0566    0.84860 0.984 0.012 0.000 0.004 0.000
#> GSM955066     3  0.6065    0.36976 0.000 0.084 0.596 0.292 0.028
#> GSM955067     1  0.2644    0.83065 0.888 0.012 0.000 0.088 0.012
#> GSM955073     3  0.1686    0.64181 0.000 0.020 0.944 0.008 0.028
#> GSM955074     4  0.6353    0.22135 0.344 0.080 0.004 0.544 0.028
#> GSM955076     2  0.4865    0.73374 0.000 0.748 0.040 0.044 0.168
#> GSM955078     5  0.5076    0.45450 0.000 0.252 0.068 0.004 0.676
#> GSM955083     4  0.6479    0.55167 0.004 0.092 0.100 0.648 0.156
#> GSM955084     5  0.4193    0.16307 0.000 0.304 0.000 0.012 0.684
#> GSM955086     3  0.5570    0.55235 0.000 0.100 0.684 0.192 0.024
#> GSM955091     5  0.6878    0.28152 0.000 0.324 0.196 0.016 0.464
#> GSM955092     3  0.6272    0.47589 0.000 0.152 0.608 0.024 0.216
#> GSM955093     3  0.3251    0.62356 0.000 0.040 0.864 0.080 0.016
#> GSM955098     2  0.4469    0.73590 0.000 0.776 0.020 0.056 0.148
#> GSM955099     5  0.4904    0.47307 0.000 0.240 0.072 0.000 0.688
#> GSM955100     4  0.3486    0.68009 0.028 0.036 0.072 0.860 0.004
#> GSM955103     3  0.5779    0.63832 0.000 0.072 0.696 0.080 0.152
#> GSM955104     3  0.5429    0.44593 0.004 0.036 0.656 0.276 0.028
#> GSM955106     5  0.4808    0.56508 0.000 0.064 0.152 0.028 0.756
#> GSM955000     1  0.7167    0.28910 0.520 0.052 0.220 0.208 0.000
#> GSM955006     4  0.5842    0.46982 0.288 0.036 0.048 0.624 0.004
#> GSM955007     3  0.4167    0.64483 0.000 0.040 0.812 0.044 0.104
#> GSM955010     4  0.5306    0.62466 0.016 0.056 0.176 0.728 0.024
#> GSM955014     1  0.2349    0.83434 0.900 0.012 0.000 0.084 0.004
#> GSM955018     3  0.4194    0.59254 0.000 0.028 0.780 0.172 0.020
#> GSM955020     1  0.0451    0.84888 0.988 0.008 0.000 0.004 0.000
#> GSM955024     3  0.6342    0.39246 0.000 0.092 0.556 0.032 0.320
#> GSM955026     2  0.4892    0.73879 0.000 0.744 0.020 0.076 0.160
#> GSM955031     4  0.7206    0.43467 0.028 0.280 0.124 0.536 0.032
#> GSM955038     4  0.5895    0.36764 0.004 0.352 0.008 0.560 0.076
#> GSM955040     4  0.4103    0.68107 0.016 0.064 0.076 0.828 0.016
#> GSM955044     5  0.5094    0.45741 0.000 0.220 0.076 0.008 0.696
#> GSM955051     1  0.2886    0.81249 0.864 0.016 0.000 0.116 0.004
#> GSM955055     5  0.5566   -0.00678 0.000 0.416 0.060 0.004 0.520
#> GSM955057     1  0.0671    0.84969 0.980 0.004 0.000 0.016 0.000
#> GSM955062     5  0.6894    0.25872 0.000 0.204 0.364 0.012 0.420
#> GSM955063     3  0.2060    0.64492 0.000 0.024 0.928 0.012 0.036
#> GSM955068     2  0.4745    0.73940 0.000 0.740 0.020 0.048 0.192
#> GSM955069     3  0.4933    0.63209 0.000 0.048 0.756 0.140 0.056
#> GSM955070     5  0.7860    0.28098 0.000 0.228 0.156 0.148 0.468
#> GSM955071     4  0.5805    0.64643 0.020 0.096 0.128 0.716 0.040
#> GSM955077     2  0.6838    0.48535 0.004 0.488 0.016 0.164 0.328
#> GSM955080     5  0.3894    0.57473 0.000 0.056 0.092 0.024 0.828
#> GSM955081     3  0.6943    0.43468 0.000 0.156 0.548 0.052 0.244
#> GSM955082     3  0.6445    0.48394 0.000 0.128 0.600 0.040 0.232
#> GSM955085     5  0.6340    0.15168 0.000 0.316 0.076 0.044 0.564
#> GSM955090     1  0.1612    0.83923 0.948 0.016 0.000 0.024 0.012
#> GSM955094     5  0.7674    0.29724 0.000 0.224 0.120 0.164 0.492
#> GSM955096     3  0.4876    0.63101 0.000 0.076 0.764 0.040 0.120
#> GSM955102     3  0.5446    0.38186 0.000 0.072 0.648 0.268 0.012
#> GSM955105     3  0.4088    0.57954 0.000 0.036 0.780 0.176 0.008

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM955002     4  0.8193    -0.0357 0.000 0.168 0.220 0.308 0.268 0.036
#> GSM955008     3  0.5934     0.5397 0.000 0.096 0.648 0.040 0.180 0.036
#> GSM955016     4  0.5568    -0.4453 0.104 0.004 0.004 0.480 0.000 0.408
#> GSM955019     5  0.6395     0.1602 0.000 0.400 0.152 0.008 0.416 0.024
#> GSM955022     3  0.5840     0.5785 0.000 0.040 0.672 0.128 0.116 0.044
#> GSM955023     3  0.5840     0.5785 0.000 0.040 0.672 0.128 0.116 0.044
#> GSM955027     5  0.6293     0.4662 0.000 0.204 0.160 0.008 0.576 0.052
#> GSM955043     5  0.4584     0.5306 0.000 0.180 0.040 0.008 0.736 0.036
#> GSM955048     1  0.3417     0.6997 0.812 0.004 0.000 0.052 0.000 0.132
#> GSM955049     3  0.6842     0.2526 0.000 0.176 0.460 0.028 0.308 0.028
#> GSM955054     3  0.6924     0.1357 0.000 0.196 0.448 0.028 0.300 0.028
#> GSM955064     3  0.6614     0.0829 0.000 0.176 0.448 0.012 0.336 0.028
#> GSM955072     2  0.3532     0.6254 0.000 0.816 0.012 0.024 0.136 0.012
#> GSM955075     5  0.2266     0.5757 0.000 0.052 0.024 0.004 0.908 0.012
#> GSM955079     3  0.5065     0.5232 0.000 0.008 0.688 0.196 0.020 0.088
#> GSM955087     1  0.0653     0.7406 0.980 0.004 0.000 0.000 0.004 0.012
#> GSM955088     3  0.7052     0.5361 0.000 0.052 0.544 0.212 0.092 0.100
#> GSM955089     1  0.1148     0.7366 0.960 0.004 0.000 0.016 0.000 0.020
#> GSM955095     5  0.5044     0.5105 0.000 0.068 0.180 0.024 0.708 0.020
#> GSM955097     5  0.3875     0.4677 0.000 0.012 0.012 0.088 0.808 0.080
#> GSM955101     3  0.6663     0.1244 0.000 0.176 0.460 0.016 0.320 0.028
#> GSM954999     4  0.3996    -0.0232 0.000 0.000 0.004 0.604 0.004 0.388
#> GSM955001     5  0.6706     0.3213 0.000 0.256 0.212 0.012 0.484 0.036
#> GSM955003     3  0.6753     0.2993 0.000 0.160 0.508 0.036 0.268 0.028
#> GSM955004     5  0.4258     0.4039 0.000 0.204 0.000 0.004 0.724 0.068
#> GSM955005     4  0.6457     0.1976 0.020 0.032 0.316 0.544 0.052 0.036
#> GSM955009     2  0.4616     0.4194 0.000 0.596 0.004 0.000 0.360 0.040
#> GSM955011     4  0.2632     0.3902 0.032 0.028 0.020 0.900 0.004 0.016
#> GSM955012     5  0.0806     0.5700 0.000 0.000 0.020 0.000 0.972 0.008
#> GSM955013     3  0.7248     0.2605 0.000 0.044 0.416 0.304 0.204 0.032
#> GSM955015     3  0.6489     0.1267 0.000 0.172 0.476 0.012 0.316 0.024
#> GSM955017     1  0.5316     0.4705 0.644 0.008 0.000 0.228 0.012 0.108
#> GSM955021     2  0.6812    -0.0598 0.000 0.368 0.216 0.000 0.364 0.052
#> GSM955025     2  0.6615     0.4459 0.004 0.540 0.020 0.104 0.276 0.056
#> GSM955028     1  0.0653     0.7406 0.980 0.004 0.000 0.000 0.004 0.012
#> GSM955029     5  0.0806     0.5700 0.000 0.000 0.020 0.000 0.972 0.008
#> GSM955030     4  0.6372     0.3103 0.024 0.040 0.256 0.596 0.044 0.040
#> GSM955032     3  0.5258     0.5625 0.000 0.024 0.708 0.152 0.036 0.080
#> GSM955033     4  0.7287     0.2766 0.000 0.080 0.104 0.548 0.132 0.136
#> GSM955034     1  0.0508     0.7411 0.984 0.004 0.000 0.000 0.000 0.012
#> GSM955035     5  0.6888     0.2617 0.000 0.256 0.320 0.012 0.384 0.028
#> GSM955036     3  0.6418     0.3789 0.000 0.024 0.572 0.120 0.048 0.236
#> GSM955037     1  0.7710    -0.0853 0.416 0.012 0.220 0.168 0.004 0.180
#> GSM955039     3  0.6778     0.2201 0.000 0.024 0.468 0.348 0.092 0.068
#> GSM955041     3  0.6485     0.2355 0.000 0.112 0.504 0.008 0.316 0.060
#> GSM955042     4  0.4131    -0.0274 0.004 0.000 0.004 0.600 0.004 0.388
#> GSM955045     5  0.5688     0.3657 0.000 0.088 0.300 0.008 0.580 0.024
#> GSM955046     3  0.6418     0.3789 0.000 0.024 0.572 0.120 0.048 0.236
#> GSM955047     1  0.5288     0.5362 0.660 0.012 0.000 0.188 0.008 0.132
#> GSM955050     4  0.3344     0.4317 0.008 0.052 0.048 0.860 0.012 0.020
#> GSM955052     3  0.5995     0.5394 0.000 0.096 0.644 0.044 0.180 0.036
#> GSM955053     1  0.0363     0.7421 0.988 0.000 0.000 0.000 0.000 0.012
#> GSM955056     3  0.6053     0.5587 0.000 0.112 0.656 0.048 0.136 0.048
#> GSM955058     5  0.0806     0.5700 0.000 0.000 0.020 0.000 0.972 0.008
#> GSM955059     3  0.5802     0.5740 0.000 0.032 0.672 0.136 0.112 0.048
#> GSM955060     1  0.5308     0.4799 0.648 0.008 0.000 0.220 0.012 0.112
#> GSM955061     5  0.0806     0.5700 0.000 0.000 0.020 0.000 0.972 0.008
#> GSM955065     1  0.0748     0.7397 0.976 0.004 0.000 0.000 0.004 0.016
#> GSM955066     3  0.6579     0.2598 0.000 0.028 0.484 0.284 0.012 0.192
#> GSM955067     1  0.4017     0.6694 0.764 0.012 0.000 0.056 0.000 0.168
#> GSM955073     3  0.2520     0.5962 0.000 0.012 0.888 0.000 0.032 0.068
#> GSM955074     6  0.6443     0.0000 0.292 0.008 0.004 0.336 0.000 0.360
#> GSM955076     2  0.3446     0.6400 0.000 0.840 0.024 0.020 0.096 0.020
#> GSM955078     5  0.4896     0.4487 0.000 0.280 0.028 0.004 0.652 0.036
#> GSM955083     4  0.6389     0.0769 0.000 0.008 0.048 0.504 0.116 0.324
#> GSM955084     5  0.4255     0.1226 0.000 0.380 0.000 0.004 0.600 0.016
#> GSM955086     3  0.6280     0.4892 0.000 0.080 0.604 0.208 0.020 0.088
#> GSM955091     5  0.6447     0.2138 0.000 0.372 0.164 0.008 0.432 0.024
#> GSM955092     3  0.6554     0.4554 0.000 0.156 0.568 0.040 0.204 0.032
#> GSM955093     3  0.3851     0.5750 0.000 0.008 0.812 0.080 0.020 0.080
#> GSM955098     2  0.2308     0.6354 0.000 0.904 0.004 0.028 0.056 0.008
#> GSM955099     5  0.5016     0.4654 0.000 0.264 0.036 0.004 0.656 0.040
#> GSM955100     4  0.1337     0.4067 0.008 0.012 0.016 0.956 0.000 0.008
#> GSM955103     3  0.6115     0.5900 0.000 0.032 0.644 0.092 0.160 0.072
#> GSM955104     3  0.5799     0.3749 0.000 0.004 0.588 0.260 0.028 0.120
#> GSM955106     5  0.4149     0.5657 0.000 0.064 0.100 0.016 0.796 0.024
#> GSM955000     1  0.7349     0.1130 0.500 0.012 0.152 0.152 0.008 0.176
#> GSM955006     4  0.4374    -0.0373 0.264 0.016 0.012 0.696 0.004 0.008
#> GSM955007     3  0.4984     0.5791 0.000 0.016 0.724 0.024 0.108 0.128
#> GSM955010     4  0.5346     0.3570 0.008 0.024 0.112 0.704 0.016 0.136
#> GSM955014     1  0.3851     0.6779 0.776 0.008 0.000 0.056 0.000 0.160
#> GSM955018     3  0.5113     0.5290 0.000 0.008 0.688 0.192 0.024 0.088
#> GSM955020     1  0.1155     0.7379 0.956 0.004 0.000 0.004 0.000 0.036
#> GSM955024     3  0.6425     0.3577 0.000 0.088 0.532 0.040 0.308 0.032
#> GSM955026     2  0.2873     0.6403 0.000 0.872 0.004 0.044 0.068 0.012
#> GSM955031     4  0.6781     0.1971 0.004 0.248 0.084 0.528 0.008 0.128
#> GSM955038     4  0.6543    -0.1384 0.000 0.328 0.008 0.352 0.008 0.304
#> GSM955040     4  0.1877     0.4231 0.000 0.024 0.024 0.932 0.008 0.012
#> GSM955044     5  0.4930     0.4697 0.000 0.248 0.040 0.004 0.672 0.036
#> GSM955051     1  0.4048     0.6758 0.776 0.012 0.000 0.112 0.000 0.100
#> GSM955055     2  0.5475     0.0885 0.000 0.472 0.040 0.000 0.444 0.044
#> GSM955057     1  0.0692     0.7441 0.976 0.000 0.000 0.004 0.000 0.020
#> GSM955062     5  0.6894     0.2491 0.000 0.216 0.328 0.012 0.408 0.036
#> GSM955063     3  0.2971     0.5977 0.000 0.020 0.868 0.004 0.036 0.072
#> GSM955068     2  0.3178     0.6381 0.000 0.848 0.008 0.024 0.104 0.016
#> GSM955069     3  0.5174     0.5741 0.000 0.020 0.716 0.148 0.044 0.072
#> GSM955070     5  0.7762     0.2614 0.000 0.240 0.124 0.140 0.444 0.052
#> GSM955071     4  0.4190     0.4373 0.008 0.056 0.080 0.808 0.032 0.016
#> GSM955077     2  0.7073     0.4631 0.004 0.504 0.012 0.132 0.244 0.104
#> GSM955080     5  0.3447     0.5738 0.000 0.048 0.036 0.020 0.852 0.044
#> GSM955081     3  0.7091     0.4276 0.000 0.164 0.508 0.068 0.228 0.032
#> GSM955082     3  0.6470     0.4648 0.000 0.136 0.572 0.048 0.220 0.024
#> GSM955085     5  0.6391     0.0572 0.000 0.340 0.052 0.044 0.516 0.048
#> GSM955090     1  0.3121     0.6644 0.804 0.012 0.000 0.004 0.000 0.180
#> GSM955094     5  0.7545     0.2731 0.000 0.232 0.084 0.172 0.464 0.048
#> GSM955096     3  0.5675     0.5941 0.000 0.064 0.700 0.072 0.108 0.056
#> GSM955102     3  0.6103     0.2787 0.000 0.020 0.520 0.216 0.000 0.244
#> GSM955105     3  0.4999     0.5168 0.000 0.012 0.688 0.204 0.012 0.084

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

consensus_heatmap(res, k = 2)

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

consensus_heatmap(res, k = 3)

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

consensus_heatmap(res, k = 4)

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

consensus_heatmap(res, k = 5)

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

consensus_heatmap(res, k = 6)

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

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

membership_heatmap(res, k = 2)

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

membership_heatmap(res, k = 3)

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

membership_heatmap(res, k = 4)

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

membership_heatmap(res, k = 5)

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

membership_heatmap(res, k = 6)

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

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

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

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

get_signatures(res, k = 3)

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

get_signatures(res, k = 4)

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

get_signatures(res, k = 5)

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

get_signatures(res, k = 6)

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

Signature heatmaps where rows are not scaled:

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

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

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

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

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

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

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

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

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

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

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk SD-hclust-signature_compare

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

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

An example of the output of tb is:

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

The columns in tb are:

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

UMAP plot which shows how samples are separated.

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

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

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

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

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

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

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

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

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

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

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk SD-hclust-collect-classes

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

test_to_known_factors(res)
#>             n genotype/variation(p) k
#> SD:hclust 103                 0.979 2
#> SD:hclust  69                 0.995 3
#> SD:hclust  83                 0.888 4
#> SD:hclust  63                 0.817 5
#> SD:hclust  46                 0.898 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 31589 rows and 108 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'SD' method.
#>   Subgroups are detected by 'kmeans' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 2.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

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

collect_plots(res)

plot of chunk SD-kmeans-collect-plots

The plots are:

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

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

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

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

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 1.000           0.995       0.998         0.3520 0.651   0.651
#> 3 3 0.680           0.847       0.904         0.8157 0.695   0.531
#> 4 4 0.598           0.636       0.806         0.1483 0.882   0.678
#> 5 5 0.614           0.550       0.751         0.0747 0.902   0.659
#> 6 6 0.626           0.468       0.668         0.0440 0.897   0.573

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
#> GSM955002     2  0.0000      0.997 0.000 1.000
#> GSM955008     2  0.0000      0.997 0.000 1.000
#> GSM955016     1  0.0000      1.000 1.000 0.000
#> GSM955019     2  0.0000      0.997 0.000 1.000
#> GSM955022     2  0.0000      0.997 0.000 1.000
#> GSM955023     2  0.0000      0.997 0.000 1.000
#> GSM955027     2  0.0000      0.997 0.000 1.000
#> GSM955043     2  0.0000      0.997 0.000 1.000
#> GSM955048     1  0.0000      1.000 1.000 0.000
#> GSM955049     2  0.0000      0.997 0.000 1.000
#> GSM955054     2  0.0000      0.997 0.000 1.000
#> GSM955064     2  0.0000      0.997 0.000 1.000
#> GSM955072     2  0.0000      0.997 0.000 1.000
#> GSM955075     2  0.0000      0.997 0.000 1.000
#> GSM955079     2  0.0000      0.997 0.000 1.000
#> GSM955087     1  0.0000      1.000 1.000 0.000
#> GSM955088     2  0.0000      0.997 0.000 1.000
#> GSM955089     1  0.0000      1.000 1.000 0.000
#> GSM955095     2  0.0000      0.997 0.000 1.000
#> GSM955097     2  0.0000      0.997 0.000 1.000
#> GSM955101     2  0.0000      0.997 0.000 1.000
#> GSM954999     2  0.0376      0.994 0.004 0.996
#> GSM955001     2  0.0000      0.997 0.000 1.000
#> GSM955003     2  0.0000      0.997 0.000 1.000
#> GSM955004     2  0.0000      0.997 0.000 1.000
#> GSM955005     2  0.0000      0.997 0.000 1.000
#> GSM955009     2  0.0000      0.997 0.000 1.000
#> GSM955011     1  0.0000      1.000 1.000 0.000
#> GSM955012     2  0.0000      0.997 0.000 1.000
#> GSM955013     2  0.0000      0.997 0.000 1.000
#> GSM955015     2  0.0000      0.997 0.000 1.000
#> GSM955017     1  0.0000      1.000 1.000 0.000
#> GSM955021     2  0.0000      0.997 0.000 1.000
#> GSM955025     2  0.0000      0.997 0.000 1.000
#> GSM955028     1  0.0000      1.000 1.000 0.000
#> GSM955029     2  0.0000      0.997 0.000 1.000
#> GSM955030     2  0.0376      0.994 0.004 0.996
#> GSM955032     2  0.0000      0.997 0.000 1.000
#> GSM955033     2  0.0376      0.994 0.004 0.996
#> GSM955034     1  0.0000      1.000 1.000 0.000
#> GSM955035     2  0.0000      0.997 0.000 1.000
#> GSM955036     2  0.0376      0.994 0.004 0.996
#> GSM955037     1  0.0000      1.000 1.000 0.000
#> GSM955039     2  0.0000      0.997 0.000 1.000
#> GSM955041     2  0.0000      0.997 0.000 1.000
#> GSM955042     1  0.0000      1.000 1.000 0.000
#> GSM955045     2  0.0000      0.997 0.000 1.000
#> GSM955046     2  0.0000      0.997 0.000 1.000
#> GSM955047     1  0.0000      1.000 1.000 0.000
#> GSM955050     2  0.0376      0.994 0.004 0.996
#> GSM955052     2  0.0000      0.997 0.000 1.000
#> GSM955053     1  0.0000      1.000 1.000 0.000
#> GSM955056     2  0.0000      0.997 0.000 1.000
#> GSM955058     2  0.0000      0.997 0.000 1.000
#> GSM955059     2  0.0000      0.997 0.000 1.000
#> GSM955060     1  0.0000      1.000 1.000 0.000
#> GSM955061     2  0.0000      0.997 0.000 1.000
#> GSM955065     1  0.0000      1.000 1.000 0.000
#> GSM955066     2  0.0376      0.994 0.004 0.996
#> GSM955067     1  0.0000      1.000 1.000 0.000
#> GSM955073     2  0.0000      0.997 0.000 1.000
#> GSM955074     1  0.0000      1.000 1.000 0.000
#> GSM955076     2  0.0000      0.997 0.000 1.000
#> GSM955078     2  0.0000      0.997 0.000 1.000
#> GSM955083     2  0.0376      0.994 0.004 0.996
#> GSM955084     2  0.0000      0.997 0.000 1.000
#> GSM955086     2  0.0000      0.997 0.000 1.000
#> GSM955091     2  0.0000      0.997 0.000 1.000
#> GSM955092     2  0.0000      0.997 0.000 1.000
#> GSM955093     2  0.0000      0.997 0.000 1.000
#> GSM955098     2  0.0000      0.997 0.000 1.000
#> GSM955099     2  0.0000      0.997 0.000 1.000
#> GSM955100     1  0.0000      1.000 1.000 0.000
#> GSM955103     2  0.0000      0.997 0.000 1.000
#> GSM955104     2  0.0000      0.997 0.000 1.000
#> GSM955106     2  0.0000      0.997 0.000 1.000
#> GSM955000     1  0.0000      1.000 1.000 0.000
#> GSM955006     1  0.0000      1.000 1.000 0.000
#> GSM955007     2  0.0000      0.997 0.000 1.000
#> GSM955010     2  0.0376      0.994 0.004 0.996
#> GSM955014     1  0.0000      1.000 1.000 0.000
#> GSM955018     2  0.0000      0.997 0.000 1.000
#> GSM955020     1  0.0000      1.000 1.000 0.000
#> GSM955024     2  0.0000      0.997 0.000 1.000
#> GSM955026     2  0.0000      0.997 0.000 1.000
#> GSM955031     2  0.0000      0.997 0.000 1.000
#> GSM955038     2  0.7299      0.745 0.204 0.796
#> GSM955040     2  0.0376      0.994 0.004 0.996
#> GSM955044     2  0.0000      0.997 0.000 1.000
#> GSM955051     1  0.0000      1.000 1.000 0.000
#> GSM955055     2  0.0000      0.997 0.000 1.000
#> GSM955057     1  0.0000      1.000 1.000 0.000
#> GSM955062     2  0.0000      0.997 0.000 1.000
#> GSM955063     2  0.0000      0.997 0.000 1.000
#> GSM955068     2  0.0000      0.997 0.000 1.000
#> GSM955069     2  0.0000      0.997 0.000 1.000
#> GSM955070     2  0.0000      0.997 0.000 1.000
#> GSM955071     2  0.0376      0.994 0.004 0.996
#> GSM955077     2  0.0000      0.997 0.000 1.000
#> GSM955080     2  0.0000      0.997 0.000 1.000
#> GSM955081     2  0.0000      0.997 0.000 1.000
#> GSM955082     2  0.0000      0.997 0.000 1.000
#> GSM955085     2  0.0000      0.997 0.000 1.000
#> GSM955090     1  0.0000      1.000 1.000 0.000
#> GSM955094     2  0.0000      0.997 0.000 1.000
#> GSM955096     2  0.0000      0.997 0.000 1.000
#> GSM955102     2  0.1184      0.983 0.016 0.984
#> GSM955105     2  0.0000      0.997 0.000 1.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1    p2    p3
#> GSM955002     3  0.6126     0.5662 0.000 0.400 0.600
#> GSM955008     3  0.5397     0.7428 0.000 0.280 0.720
#> GSM955016     1  0.5216     0.7743 0.740 0.000 0.260
#> GSM955019     2  0.0237     0.9310 0.000 0.996 0.004
#> GSM955022     3  0.4750     0.7934 0.000 0.216 0.784
#> GSM955023     3  0.5431     0.7393 0.000 0.284 0.716
#> GSM955027     2  0.0892     0.9314 0.000 0.980 0.020
#> GSM955043     2  0.1031     0.9306 0.000 0.976 0.024
#> GSM955048     1  0.0237     0.9375 0.996 0.000 0.004
#> GSM955049     2  0.1529     0.9263 0.000 0.960 0.040
#> GSM955054     3  0.5988     0.6487 0.000 0.368 0.632
#> GSM955064     2  0.1860     0.9218 0.000 0.948 0.052
#> GSM955072     2  0.0237     0.9293 0.000 0.996 0.004
#> GSM955075     2  0.1643     0.9247 0.000 0.956 0.044
#> GSM955079     3  0.2448     0.8447 0.000 0.076 0.924
#> GSM955087     1  0.0000     0.9378 1.000 0.000 0.000
#> GSM955088     3  0.1411     0.8437 0.000 0.036 0.964
#> GSM955089     1  0.0000     0.9378 1.000 0.000 0.000
#> GSM955095     2  0.2796     0.8848 0.000 0.908 0.092
#> GSM955097     2  0.4452     0.7844 0.000 0.808 0.192
#> GSM955101     3  0.5254     0.7618 0.000 0.264 0.736
#> GSM954999     3  0.0424     0.8247 0.000 0.008 0.992
#> GSM955001     2  0.0424     0.9317 0.000 0.992 0.008
#> GSM955003     3  0.5905     0.6742 0.000 0.352 0.648
#> GSM955004     2  0.1031     0.9189 0.000 0.976 0.024
#> GSM955005     3  0.1031     0.8401 0.000 0.024 0.976
#> GSM955009     2  0.0237     0.9310 0.000 0.996 0.004
#> GSM955011     1  0.5058     0.7838 0.756 0.000 0.244
#> GSM955012     2  0.1643     0.9247 0.000 0.956 0.044
#> GSM955013     3  0.1163     0.8417 0.000 0.028 0.972
#> GSM955015     3  0.6204     0.5270 0.000 0.424 0.576
#> GSM955017     1  0.1860     0.9177 0.948 0.000 0.052
#> GSM955021     2  0.0424     0.9317 0.000 0.992 0.008
#> GSM955025     2  0.1411     0.9164 0.000 0.964 0.036
#> GSM955028     1  0.0000     0.9378 1.000 0.000 0.000
#> GSM955029     2  0.1643     0.9247 0.000 0.956 0.044
#> GSM955030     3  0.1031     0.8401 0.000 0.024 0.976
#> GSM955032     3  0.4291     0.8157 0.000 0.180 0.820
#> GSM955033     3  0.4504     0.7231 0.000 0.196 0.804
#> GSM955034     1  0.0000     0.9378 1.000 0.000 0.000
#> GSM955035     2  0.0592     0.9319 0.000 0.988 0.012
#> GSM955036     3  0.1163     0.8390 0.000 0.028 0.972
#> GSM955037     1  0.4887     0.7947 0.772 0.000 0.228
#> GSM955039     3  0.1163     0.8417 0.000 0.028 0.972
#> GSM955041     2  0.3340     0.8506 0.000 0.880 0.120
#> GSM955042     1  0.5178     0.7785 0.744 0.000 0.256
#> GSM955045     2  0.1860     0.9217 0.000 0.948 0.052
#> GSM955046     3  0.1289     0.8423 0.000 0.032 0.968
#> GSM955047     1  0.0237     0.9375 0.996 0.000 0.004
#> GSM955050     3  0.3482     0.7889 0.000 0.128 0.872
#> GSM955052     3  0.5138     0.7692 0.000 0.252 0.748
#> GSM955053     1  0.0000     0.9378 1.000 0.000 0.000
#> GSM955056     3  0.5529     0.7342 0.000 0.296 0.704
#> GSM955058     2  0.1643     0.9247 0.000 0.956 0.044
#> GSM955059     3  0.1411     0.8437 0.000 0.036 0.964
#> GSM955060     1  0.0000     0.9378 1.000 0.000 0.000
#> GSM955061     2  0.1643     0.9247 0.000 0.956 0.044
#> GSM955065     1  0.0000     0.9378 1.000 0.000 0.000
#> GSM955066     3  0.1163     0.8412 0.000 0.028 0.972
#> GSM955067     1  0.0424     0.9372 0.992 0.000 0.008
#> GSM955073     3  0.4974     0.7810 0.000 0.236 0.764
#> GSM955074     1  0.3816     0.8649 0.852 0.000 0.148
#> GSM955076     2  0.0424     0.9313 0.000 0.992 0.008
#> GSM955078     2  0.0000     0.9302 0.000 1.000 0.000
#> GSM955083     3  0.2959     0.7986 0.000 0.100 0.900
#> GSM955084     2  0.1031     0.9189 0.000 0.976 0.024
#> GSM955086     3  0.1860     0.8434 0.000 0.052 0.948
#> GSM955091     2  0.0237     0.9310 0.000 0.996 0.004
#> GSM955092     2  0.2711     0.8792 0.000 0.912 0.088
#> GSM955093     3  0.1529     0.8443 0.000 0.040 0.960
#> GSM955098     2  0.1163     0.9203 0.000 0.972 0.028
#> GSM955099     2  0.0237     0.9310 0.000 0.996 0.004
#> GSM955100     1  0.5138     0.7754 0.748 0.000 0.252
#> GSM955103     3  0.5363     0.7493 0.000 0.276 0.724
#> GSM955104     3  0.1031     0.8401 0.000 0.024 0.976
#> GSM955106     2  0.1753     0.9251 0.000 0.952 0.048
#> GSM955000     1  0.1860     0.9177 0.948 0.000 0.052
#> GSM955006     1  0.0000     0.9378 1.000 0.000 0.000
#> GSM955007     3  0.5098     0.7724 0.000 0.248 0.752
#> GSM955010     3  0.0424     0.8294 0.000 0.008 0.992
#> GSM955014     1  0.0424     0.9372 0.992 0.000 0.008
#> GSM955018     3  0.1753     0.8452 0.000 0.048 0.952
#> GSM955020     1  0.0424     0.9372 0.992 0.000 0.008
#> GSM955024     3  0.6062     0.5828 0.000 0.384 0.616
#> GSM955026     2  0.1163     0.9203 0.000 0.972 0.028
#> GSM955031     3  0.2165     0.8173 0.000 0.064 0.936
#> GSM955038     2  0.9790     0.0519 0.272 0.436 0.292
#> GSM955040     3  0.3038     0.8009 0.000 0.104 0.896
#> GSM955044     2  0.0892     0.9306 0.000 0.980 0.020
#> GSM955051     1  0.0424     0.9372 0.992 0.000 0.008
#> GSM955055     2  0.0424     0.9317 0.000 0.992 0.008
#> GSM955057     1  0.0237     0.9375 0.996 0.000 0.004
#> GSM955062     2  0.0892     0.9314 0.000 0.980 0.020
#> GSM955063     3  0.4931     0.7838 0.000 0.232 0.768
#> GSM955068     2  0.1031     0.9189 0.000 0.976 0.024
#> GSM955069     3  0.1289     0.8423 0.000 0.032 0.968
#> GSM955070     2  0.2356     0.9030 0.000 0.928 0.072
#> GSM955071     3  0.0592     0.8280 0.000 0.012 0.988
#> GSM955077     2  0.5058     0.6506 0.000 0.756 0.244
#> GSM955080     2  0.1529     0.9262 0.000 0.960 0.040
#> GSM955081     3  0.5178     0.7721 0.000 0.256 0.744
#> GSM955082     2  0.5363     0.5780 0.000 0.724 0.276
#> GSM955085     2  0.0237     0.9310 0.000 0.996 0.004
#> GSM955090     1  0.0424     0.9372 0.992 0.000 0.008
#> GSM955094     2  0.2878     0.8861 0.000 0.904 0.096
#> GSM955096     3  0.5216     0.7701 0.000 0.260 0.740
#> GSM955102     3  0.1289     0.8423 0.000 0.032 0.968
#> GSM955105     3  0.1753     0.8424 0.000 0.048 0.952

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM955002     4  0.7867    -0.0720 0.000 0.292 0.316 0.392
#> GSM955008     3  0.2522     0.7340 0.000 0.076 0.908 0.016
#> GSM955016     4  0.5203     0.3698 0.348 0.000 0.016 0.636
#> GSM955019     2  0.5662     0.6938 0.000 0.692 0.072 0.236
#> GSM955022     3  0.3009     0.7409 0.000 0.056 0.892 0.052
#> GSM955023     3  0.2871     0.7309 0.000 0.072 0.896 0.032
#> GSM955027     2  0.1302     0.8032 0.000 0.956 0.044 0.000
#> GSM955043     2  0.2002     0.7945 0.000 0.936 0.020 0.044
#> GSM955048     1  0.0188     0.9256 0.996 0.000 0.004 0.000
#> GSM955049     2  0.5386     0.6885 0.000 0.708 0.236 0.056
#> GSM955054     3  0.5624     0.5951 0.000 0.128 0.724 0.148
#> GSM955064     2  0.5559     0.6868 0.000 0.696 0.240 0.064
#> GSM955072     2  0.4105     0.7629 0.000 0.812 0.032 0.156
#> GSM955075     2  0.2408     0.7940 0.000 0.920 0.036 0.044
#> GSM955079     3  0.1767     0.7379 0.000 0.012 0.944 0.044
#> GSM955087     1  0.0188     0.9261 0.996 0.000 0.004 0.000
#> GSM955088     3  0.1302     0.7277 0.000 0.000 0.956 0.044
#> GSM955089     1  0.0188     0.9261 0.996 0.000 0.004 0.000
#> GSM955095     2  0.2840     0.7888 0.000 0.900 0.044 0.056
#> GSM955097     2  0.5130     0.4832 0.000 0.668 0.020 0.312
#> GSM955101     3  0.2845     0.7297 0.000 0.076 0.896 0.028
#> GSM954999     4  0.4535     0.4732 0.000 0.004 0.292 0.704
#> GSM955001     2  0.1724     0.8040 0.000 0.948 0.032 0.020
#> GSM955003     3  0.5361     0.6149 0.000 0.108 0.744 0.148
#> GSM955004     2  0.1867     0.7787 0.000 0.928 0.000 0.072
#> GSM955005     3  0.5050     0.1543 0.000 0.004 0.588 0.408
#> GSM955009     2  0.3760     0.7696 0.000 0.836 0.028 0.136
#> GSM955011     4  0.5807     0.3557 0.364 0.000 0.040 0.596
#> GSM955012     2  0.2408     0.7940 0.000 0.920 0.036 0.044
#> GSM955013     4  0.5294     0.0535 0.000 0.008 0.484 0.508
#> GSM955015     3  0.5972     0.4430 0.000 0.292 0.640 0.068
#> GSM955017     1  0.4562     0.6734 0.764 0.000 0.028 0.208
#> GSM955021     2  0.6080     0.6514 0.000 0.664 0.236 0.100
#> GSM955025     2  0.5712     0.5366 0.000 0.584 0.032 0.384
#> GSM955028     1  0.0188     0.9261 0.996 0.000 0.004 0.000
#> GSM955029     2  0.2408     0.7940 0.000 0.920 0.036 0.044
#> GSM955030     3  0.5163    -0.0733 0.000 0.004 0.516 0.480
#> GSM955032     3  0.2021     0.7391 0.000 0.024 0.936 0.040
#> GSM955033     4  0.2198     0.6071 0.000 0.008 0.072 0.920
#> GSM955034     1  0.0188     0.9261 0.996 0.000 0.004 0.000
#> GSM955035     2  0.6025     0.6584 0.000 0.668 0.236 0.096
#> GSM955036     4  0.4973     0.3904 0.000 0.008 0.348 0.644
#> GSM955037     1  0.6083     0.2061 0.584 0.000 0.056 0.360
#> GSM955039     3  0.5167    -0.0495 0.000 0.004 0.508 0.488
#> GSM955041     2  0.6016     0.3400 0.000 0.544 0.412 0.044
#> GSM955042     4  0.5237     0.3544 0.356 0.000 0.016 0.628
#> GSM955045     2  0.3821     0.7617 0.000 0.840 0.120 0.040
#> GSM955046     3  0.4313     0.4779 0.000 0.004 0.736 0.260
#> GSM955047     1  0.1109     0.9214 0.968 0.000 0.004 0.028
#> GSM955050     4  0.2021     0.5983 0.000 0.040 0.024 0.936
#> GSM955052     3  0.1474     0.7435 0.000 0.052 0.948 0.000
#> GSM955053     1  0.0188     0.9261 0.996 0.000 0.004 0.000
#> GSM955056     3  0.3128     0.7277 0.000 0.076 0.884 0.040
#> GSM955058     2  0.2408     0.7940 0.000 0.920 0.036 0.044
#> GSM955059     3  0.1557     0.7178 0.000 0.000 0.944 0.056
#> GSM955060     1  0.0657     0.9254 0.984 0.000 0.004 0.012
#> GSM955061     2  0.2408     0.7940 0.000 0.920 0.036 0.044
#> GSM955065     1  0.0188     0.9261 0.996 0.000 0.004 0.000
#> GSM955066     3  0.4800     0.3249 0.000 0.004 0.656 0.340
#> GSM955067     1  0.1489     0.9179 0.952 0.000 0.004 0.044
#> GSM955073     3  0.1854     0.7446 0.000 0.048 0.940 0.012
#> GSM955074     4  0.5039     0.2392 0.404 0.000 0.004 0.592
#> GSM955076     2  0.7331     0.5464 0.000 0.528 0.212 0.260
#> GSM955078     2  0.1004     0.7977 0.000 0.972 0.004 0.024
#> GSM955083     4  0.4098     0.5525 0.000 0.012 0.204 0.784
#> GSM955084     2  0.2281     0.7736 0.000 0.904 0.000 0.096
#> GSM955086     3  0.2198     0.7308 0.000 0.008 0.920 0.072
#> GSM955091     2  0.2483     0.7996 0.000 0.916 0.032 0.052
#> GSM955092     2  0.4838     0.6618 0.000 0.724 0.252 0.024
#> GSM955093     3  0.1545     0.7292 0.000 0.008 0.952 0.040
#> GSM955098     2  0.6295     0.5743 0.000 0.580 0.072 0.348
#> GSM955099     2  0.2399     0.8010 0.000 0.920 0.032 0.048
#> GSM955100     4  0.5713     0.3976 0.340 0.000 0.040 0.620
#> GSM955103     3  0.5354     0.5765 0.000 0.232 0.712 0.056
#> GSM955104     3  0.5165    -0.0864 0.000 0.004 0.512 0.484
#> GSM955106     2  0.2313     0.7935 0.000 0.924 0.032 0.044
#> GSM955000     1  0.3907     0.7664 0.828 0.000 0.032 0.140
#> GSM955006     1  0.2125     0.8902 0.920 0.000 0.004 0.076
#> GSM955007     3  0.2222     0.7426 0.000 0.060 0.924 0.016
#> GSM955010     4  0.4950     0.3726 0.000 0.004 0.376 0.620
#> GSM955014     1  0.1489     0.9179 0.952 0.000 0.004 0.044
#> GSM955018     3  0.1452     0.7304 0.000 0.008 0.956 0.036
#> GSM955020     1  0.0779     0.9228 0.980 0.000 0.004 0.016
#> GSM955024     3  0.4671     0.6049 0.000 0.220 0.752 0.028
#> GSM955026     2  0.6295     0.5743 0.000 0.580 0.072 0.348
#> GSM955031     4  0.6362     0.1061 0.000 0.072 0.368 0.560
#> GSM955038     4  0.2048     0.5913 0.008 0.064 0.000 0.928
#> GSM955040     4  0.2751     0.6039 0.000 0.040 0.056 0.904
#> GSM955044     2  0.2466     0.8049 0.000 0.916 0.028 0.056
#> GSM955051     1  0.1489     0.9179 0.952 0.000 0.004 0.044
#> GSM955055     2  0.2124     0.8031 0.000 0.932 0.040 0.028
#> GSM955057     1  0.0000     0.9260 1.000 0.000 0.000 0.000
#> GSM955062     2  0.5537     0.6606 0.000 0.688 0.256 0.056
#> GSM955063     3  0.1767     0.7451 0.000 0.044 0.944 0.012
#> GSM955068     2  0.5297     0.6624 0.000 0.676 0.032 0.292
#> GSM955069     3  0.3266     0.6076 0.000 0.000 0.832 0.168
#> GSM955070     2  0.6457     0.6324 0.000 0.604 0.100 0.296
#> GSM955071     4  0.3668     0.5741 0.000 0.004 0.188 0.808
#> GSM955077     4  0.5596     0.1032 0.000 0.332 0.036 0.632
#> GSM955080     2  0.2565     0.7897 0.000 0.912 0.032 0.056
#> GSM955081     3  0.5174     0.6414 0.000 0.092 0.756 0.152
#> GSM955082     3  0.5353     0.1298 0.000 0.432 0.556 0.012
#> GSM955085     2  0.1182     0.8017 0.000 0.968 0.016 0.016
#> GSM955090     1  0.1398     0.9190 0.956 0.000 0.004 0.040
#> GSM955094     2  0.5773     0.6179 0.000 0.620 0.044 0.336
#> GSM955096     3  0.2313     0.7404 0.000 0.044 0.924 0.032
#> GSM955102     3  0.4382     0.4221 0.000 0.000 0.704 0.296
#> GSM955105     3  0.2053     0.7272 0.000 0.004 0.924 0.072

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM955002     2  0.6894    0.43223 0.000 0.572 0.104 0.236 0.088
#> GSM955008     3  0.3246    0.65168 0.000 0.184 0.808 0.000 0.008
#> GSM955016     4  0.4075    0.67231 0.100 0.096 0.000 0.800 0.004
#> GSM955019     2  0.4532    0.47469 0.000 0.672 0.020 0.004 0.304
#> GSM955022     3  0.5258    0.63215 0.000 0.060 0.740 0.124 0.076
#> GSM955023     3  0.4096    0.63109 0.000 0.200 0.760 0.000 0.040
#> GSM955027     5  0.4284    0.51376 0.000 0.204 0.040 0.004 0.752
#> GSM955043     5  0.0693    0.64461 0.000 0.012 0.008 0.000 0.980
#> GSM955048     1  0.0865    0.90001 0.972 0.024 0.000 0.004 0.000
#> GSM955049     5  0.6615   -0.15291 0.000 0.356 0.220 0.000 0.424
#> GSM955054     3  0.4565    0.32621 0.000 0.408 0.580 0.000 0.012
#> GSM955064     5  0.6608    0.01920 0.000 0.276 0.228 0.004 0.492
#> GSM955072     2  0.4562    0.20615 0.000 0.548 0.004 0.004 0.444
#> GSM955075     5  0.0324    0.64517 0.000 0.004 0.004 0.000 0.992
#> GSM955079     3  0.1725    0.72626 0.000 0.044 0.936 0.020 0.000
#> GSM955087     1  0.0290    0.89776 0.992 0.008 0.000 0.000 0.000
#> GSM955088     3  0.2989    0.69255 0.000 0.060 0.868 0.072 0.000
#> GSM955089     1  0.1195    0.89892 0.960 0.012 0.000 0.028 0.000
#> GSM955095     5  0.2931    0.59483 0.000 0.028 0.040 0.044 0.888
#> GSM955097     5  0.3573    0.48354 0.000 0.036 0.000 0.152 0.812
#> GSM955101     3  0.4065    0.61682 0.000 0.224 0.752 0.008 0.016
#> GSM954999     4  0.2876    0.73778 0.000 0.044 0.052 0.888 0.016
#> GSM955001     5  0.4295    0.47315 0.000 0.248 0.024 0.004 0.724
#> GSM955003     3  0.4565    0.33875 0.000 0.408 0.580 0.000 0.012
#> GSM955004     5  0.3086    0.54997 0.000 0.180 0.000 0.004 0.816
#> GSM955005     3  0.5447    0.11746 0.000 0.064 0.536 0.400 0.000
#> GSM955009     2  0.4891    0.17281 0.000 0.532 0.012 0.008 0.448
#> GSM955011     4  0.4450    0.66096 0.152 0.080 0.004 0.764 0.000
#> GSM955012     5  0.0162    0.64546 0.000 0.000 0.004 0.000 0.996
#> GSM955013     4  0.6439    0.43461 0.000 0.048 0.300 0.568 0.084
#> GSM955015     3  0.6626    0.11304 0.000 0.364 0.476 0.016 0.144
#> GSM955017     1  0.4840    0.60134 0.688 0.064 0.000 0.248 0.000
#> GSM955021     2  0.6636    0.33309 0.000 0.488 0.244 0.004 0.264
#> GSM955025     2  0.5530    0.51596 0.000 0.664 0.004 0.160 0.172
#> GSM955028     1  0.0290    0.89776 0.992 0.008 0.000 0.000 0.000
#> GSM955029     5  0.0613    0.64478 0.000 0.008 0.004 0.004 0.984
#> GSM955030     4  0.5218    0.47660 0.000 0.068 0.308 0.624 0.000
#> GSM955032     3  0.1628    0.72600 0.000 0.056 0.936 0.008 0.000
#> GSM955033     4  0.3658    0.70878 0.000 0.112 0.012 0.832 0.044
#> GSM955034     1  0.0290    0.89776 0.992 0.008 0.000 0.000 0.000
#> GSM955035     2  0.6811    0.25388 0.000 0.432 0.256 0.004 0.308
#> GSM955036     4  0.5209    0.66569 0.000 0.056 0.136 0.740 0.068
#> GSM955037     4  0.6496    0.28943 0.396 0.048 0.068 0.488 0.000
#> GSM955039     4  0.6132    0.46669 0.000 0.096 0.276 0.600 0.028
#> GSM955041     5  0.6626    0.00957 0.000 0.200 0.332 0.004 0.464
#> GSM955042     4  0.4366    0.64918 0.124 0.096 0.000 0.776 0.004
#> GSM955045     5  0.2550    0.59964 0.000 0.020 0.084 0.004 0.892
#> GSM955046     3  0.5995    0.42101 0.000 0.076 0.620 0.268 0.036
#> GSM955047     1  0.2888    0.88574 0.880 0.060 0.000 0.056 0.004
#> GSM955050     4  0.3561    0.61252 0.000 0.260 0.000 0.740 0.000
#> GSM955052     3  0.1952    0.71636 0.000 0.084 0.912 0.004 0.000
#> GSM955053     1  0.0162    0.89811 0.996 0.004 0.000 0.000 0.000
#> GSM955056     3  0.2629    0.68958 0.000 0.136 0.860 0.000 0.004
#> GSM955058     5  0.0162    0.64546 0.000 0.000 0.004 0.000 0.996
#> GSM955059     3  0.3201    0.66609 0.000 0.052 0.852 0.096 0.000
#> GSM955060     1  0.1907    0.89319 0.928 0.044 0.000 0.028 0.000
#> GSM955061     5  0.0162    0.64546 0.000 0.000 0.004 0.000 0.996
#> GSM955065     1  0.0290    0.89776 0.992 0.008 0.000 0.000 0.000
#> GSM955066     3  0.5328    0.26678 0.000 0.064 0.584 0.352 0.000
#> GSM955067     1  0.4006    0.85231 0.804 0.112 0.000 0.080 0.004
#> GSM955073     3  0.1770    0.72607 0.000 0.048 0.936 0.008 0.008
#> GSM955074     4  0.4634    0.62549 0.144 0.100 0.000 0.752 0.004
#> GSM955076     2  0.5104    0.53597 0.000 0.704 0.088 0.008 0.200
#> GSM955078     5  0.3838    0.43253 0.000 0.280 0.000 0.004 0.716
#> GSM955083     4  0.2930    0.73423 0.000 0.048 0.032 0.888 0.032
#> GSM955084     5  0.3885    0.42911 0.000 0.268 0.000 0.008 0.724
#> GSM955086     3  0.2426    0.72191 0.000 0.064 0.900 0.036 0.000
#> GSM955091     5  0.4574    0.14965 0.000 0.412 0.012 0.000 0.576
#> GSM955092     5  0.6745    0.11800 0.000 0.228 0.284 0.008 0.480
#> GSM955093     3  0.1579    0.72222 0.000 0.032 0.944 0.024 0.000
#> GSM955098     2  0.4850    0.55675 0.000 0.728 0.016 0.056 0.200
#> GSM955099     5  0.4789    0.16606 0.000 0.400 0.016 0.004 0.580
#> GSM955100     4  0.3683    0.71463 0.096 0.072 0.004 0.828 0.000
#> GSM955103     3  0.6670    0.24988 0.000 0.096 0.480 0.040 0.384
#> GSM955104     4  0.5492    0.41806 0.000 0.068 0.340 0.588 0.004
#> GSM955106     5  0.1179    0.63497 0.000 0.016 0.004 0.016 0.964
#> GSM955000     1  0.4681    0.69299 0.744 0.060 0.012 0.184 0.000
#> GSM955006     1  0.4459    0.76238 0.744 0.052 0.000 0.200 0.004
#> GSM955007     3  0.3742    0.70050 0.000 0.064 0.844 0.044 0.048
#> GSM955010     4  0.3507    0.69947 0.000 0.052 0.120 0.828 0.000
#> GSM955014     1  0.3317    0.87692 0.852 0.088 0.000 0.056 0.004
#> GSM955018     3  0.1300    0.71621 0.000 0.016 0.956 0.028 0.000
#> GSM955020     1  0.2313    0.88940 0.912 0.044 0.000 0.040 0.004
#> GSM955024     3  0.5535    0.46126 0.000 0.116 0.628 0.000 0.256
#> GSM955026     2  0.4895    0.55608 0.000 0.728 0.012 0.072 0.188
#> GSM955031     2  0.5618    0.32403 0.000 0.628 0.136 0.236 0.000
#> GSM955038     4  0.4182    0.54830 0.000 0.352 0.000 0.644 0.004
#> GSM955040     4  0.2891    0.68785 0.000 0.176 0.000 0.824 0.000
#> GSM955044     5  0.3289    0.55531 0.000 0.172 0.008 0.004 0.816
#> GSM955051     1  0.3517    0.87028 0.840 0.084 0.000 0.072 0.004
#> GSM955055     5  0.4774    0.31152 0.000 0.340 0.024 0.004 0.632
#> GSM955057     1  0.0000    0.89837 1.000 0.000 0.000 0.000 0.000
#> GSM955062     2  0.6745    0.25072 0.000 0.408 0.280 0.000 0.312
#> GSM955063     3  0.1695    0.72552 0.000 0.044 0.940 0.008 0.008
#> GSM955068     2  0.4829    0.47684 0.000 0.660 0.004 0.036 0.300
#> GSM955069     3  0.4238    0.55590 0.000 0.052 0.756 0.192 0.000
#> GSM955070     2  0.7101    0.31205 0.000 0.484 0.072 0.104 0.340
#> GSM955071     4  0.3193    0.71960 0.000 0.132 0.028 0.840 0.000
#> GSM955077     2  0.5878    0.22833 0.000 0.576 0.028 0.340 0.056
#> GSM955080     5  0.0613    0.64404 0.000 0.008 0.004 0.004 0.984
#> GSM955081     3  0.5411    0.34416 0.000 0.396 0.552 0.044 0.008
#> GSM955082     3  0.6418    0.06131 0.000 0.112 0.468 0.016 0.404
#> GSM955085     5  0.3439    0.55509 0.000 0.188 0.004 0.008 0.800
#> GSM955090     1  0.3693    0.85977 0.828 0.088 0.000 0.080 0.004
#> GSM955094     5  0.6664   -0.21543 0.000 0.412 0.012 0.156 0.420
#> GSM955096     3  0.2077    0.71712 0.000 0.084 0.908 0.008 0.000
#> GSM955102     3  0.5027    0.37967 0.000 0.056 0.640 0.304 0.000
#> GSM955105     3  0.2359    0.71712 0.000 0.060 0.904 0.036 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM955002     2  0.8067   0.263176 0.000 0.388 0.240 0.092 0.072 0.208
#> GSM955008     3  0.1745   0.500265 0.000 0.068 0.920 0.000 0.012 0.000
#> GSM955016     4  0.1555   0.653193 0.040 0.008 0.000 0.940 0.000 0.012
#> GSM955019     2  0.3913   0.556206 0.000 0.784 0.040 0.012 0.156 0.008
#> GSM955022     3  0.5679  -0.091594 0.000 0.012 0.484 0.004 0.096 0.404
#> GSM955023     3  0.4894   0.481826 0.000 0.112 0.736 0.004 0.064 0.084
#> GSM955027     5  0.5365   0.270899 0.000 0.308 0.084 0.000 0.588 0.020
#> GSM955043     5  0.2002   0.716616 0.000 0.040 0.012 0.000 0.920 0.028
#> GSM955048     1  0.1269   0.838020 0.956 0.012 0.000 0.012 0.000 0.020
#> GSM955049     3  0.6876  -0.172681 0.000 0.352 0.372 0.004 0.228 0.044
#> GSM955054     3  0.5095   0.228111 0.000 0.352 0.576 0.000 0.016 0.056
#> GSM955064     3  0.7018   0.000779 0.000 0.224 0.416 0.004 0.292 0.064
#> GSM955072     2  0.4419   0.490719 0.000 0.724 0.020 0.004 0.212 0.040
#> GSM955075     5  0.0881   0.735463 0.000 0.012 0.008 0.000 0.972 0.008
#> GSM955079     3  0.4076   0.343727 0.000 0.024 0.724 0.016 0.000 0.236
#> GSM955087     1  0.1799   0.830359 0.928 0.008 0.000 0.008 0.004 0.052
#> GSM955088     3  0.4858   0.171505 0.000 0.060 0.588 0.004 0.000 0.348
#> GSM955089     1  0.1938   0.838161 0.920 0.008 0.000 0.052 0.000 0.020
#> GSM955095     5  0.3453   0.672481 0.000 0.032 0.064 0.000 0.836 0.068
#> GSM955097     5  0.3237   0.640937 0.000 0.016 0.004 0.112 0.840 0.028
#> GSM955101     3  0.3325   0.495606 0.000 0.120 0.832 0.004 0.016 0.028
#> GSM954999     4  0.3135   0.633797 0.000 0.004 0.008 0.816 0.008 0.164
#> GSM955001     5  0.5585   0.069474 0.000 0.392 0.072 0.000 0.508 0.028
#> GSM955003     3  0.4750   0.303041 0.000 0.316 0.628 0.000 0.016 0.040
#> GSM955004     5  0.3244   0.557997 0.000 0.268 0.000 0.000 0.732 0.000
#> GSM955005     6  0.5258   0.577747 0.000 0.004 0.188 0.184 0.000 0.624
#> GSM955009     2  0.3514   0.489574 0.000 0.768 0.004 0.000 0.208 0.020
#> GSM955011     4  0.4702   0.611400 0.084 0.024 0.000 0.716 0.000 0.176
#> GSM955012     5  0.0405   0.735640 0.000 0.000 0.004 0.000 0.988 0.008
#> GSM955013     6  0.7513   0.312588 0.000 0.008 0.264 0.268 0.104 0.356
#> GSM955015     3  0.6739   0.116732 0.000 0.284 0.496 0.004 0.100 0.116
#> GSM955017     1  0.6357   0.354639 0.500 0.024 0.000 0.224 0.004 0.248
#> GSM955021     2  0.6148   0.311219 0.000 0.508 0.328 0.000 0.120 0.044
#> GSM955025     2  0.4568   0.538816 0.000 0.764 0.004 0.084 0.088 0.060
#> GSM955028     1  0.1542   0.831126 0.936 0.008 0.000 0.000 0.004 0.052
#> GSM955029     5  0.0653   0.735682 0.000 0.012 0.004 0.000 0.980 0.004
#> GSM955030     6  0.5156   0.349692 0.000 0.000 0.112 0.308 0.000 0.580
#> GSM955032     3  0.4439   0.375935 0.000 0.064 0.692 0.000 0.004 0.240
#> GSM955033     4  0.5098   0.589625 0.000 0.052 0.004 0.644 0.028 0.272
#> GSM955034     1  0.1542   0.831126 0.936 0.008 0.000 0.000 0.004 0.052
#> GSM955035     3  0.6668  -0.222827 0.000 0.384 0.404 0.004 0.160 0.048
#> GSM955036     4  0.5794   0.199972 0.000 0.004 0.044 0.480 0.056 0.416
#> GSM955037     6  0.6652  -0.065264 0.264 0.008 0.012 0.300 0.004 0.412
#> GSM955039     6  0.7337   0.278823 0.000 0.028 0.312 0.248 0.044 0.368
#> GSM955041     3  0.6485   0.231957 0.000 0.128 0.524 0.004 0.276 0.068
#> GSM955042     4  0.1152   0.653288 0.044 0.004 0.000 0.952 0.000 0.000
#> GSM955045     5  0.4026   0.632335 0.000 0.048 0.112 0.000 0.792 0.048
#> GSM955046     6  0.5680   0.485986 0.000 0.004 0.356 0.088 0.020 0.532
#> GSM955047     1  0.3931   0.803439 0.800 0.036 0.000 0.100 0.000 0.064
#> GSM955050     4  0.5395   0.577024 0.000 0.220 0.000 0.584 0.000 0.196
#> GSM955052     3  0.1700   0.460480 0.000 0.004 0.916 0.000 0.000 0.080
#> GSM955053     1  0.1542   0.831126 0.936 0.008 0.000 0.000 0.004 0.052
#> GSM955056     3  0.3985   0.457680 0.000 0.088 0.768 0.000 0.004 0.140
#> GSM955058     5  0.0436   0.736410 0.000 0.004 0.004 0.000 0.988 0.004
#> GSM955059     6  0.4103   0.244193 0.000 0.004 0.448 0.004 0.000 0.544
#> GSM955060     1  0.3557   0.810920 0.828 0.032 0.000 0.080 0.000 0.060
#> GSM955061     5  0.0436   0.736410 0.000 0.004 0.004 0.000 0.988 0.004
#> GSM955065     1  0.1799   0.830359 0.928 0.008 0.000 0.008 0.004 0.052
#> GSM955066     6  0.4894   0.577134 0.000 0.004 0.180 0.144 0.000 0.672
#> GSM955067     1  0.4030   0.774902 0.752 0.020 0.000 0.196 0.000 0.032
#> GSM955073     3  0.2573   0.417579 0.000 0.004 0.856 0.000 0.008 0.132
#> GSM955074     4  0.2058   0.631743 0.072 0.008 0.000 0.908 0.000 0.012
#> GSM955076     2  0.3361   0.573014 0.000 0.844 0.040 0.004 0.084 0.028
#> GSM955078     5  0.3659   0.402334 0.000 0.364 0.000 0.000 0.636 0.000
#> GSM955083     4  0.3023   0.641919 0.000 0.004 0.000 0.808 0.008 0.180
#> GSM955084     5  0.3737   0.372409 0.000 0.392 0.000 0.000 0.608 0.000
#> GSM955086     3  0.4531   0.317175 0.000 0.044 0.672 0.012 0.000 0.272
#> GSM955091     2  0.5084   0.316804 0.000 0.580 0.056 0.000 0.348 0.016
#> GSM955092     3  0.6769   0.184189 0.000 0.192 0.448 0.000 0.296 0.064
#> GSM955093     3  0.2964   0.367949 0.000 0.000 0.792 0.000 0.004 0.204
#> GSM955098     2  0.3556   0.571288 0.000 0.840 0.008 0.044 0.060 0.048
#> GSM955099     2  0.5340   0.291920 0.000 0.552 0.068 0.000 0.360 0.020
#> GSM955100     4  0.4684   0.622149 0.048 0.024 0.000 0.684 0.000 0.244
#> GSM955103     3  0.6169   0.307637 0.000 0.044 0.516 0.000 0.312 0.128
#> GSM955104     6  0.5724   0.480112 0.000 0.000 0.180 0.260 0.008 0.552
#> GSM955106     5  0.1821   0.714327 0.000 0.008 0.024 0.000 0.928 0.040
#> GSM955000     1  0.6067   0.440765 0.540 0.024 0.000 0.152 0.004 0.280
#> GSM955006     1  0.5118   0.573578 0.612 0.028 0.000 0.308 0.000 0.052
#> GSM955007     3  0.4876   0.213357 0.000 0.008 0.620 0.000 0.064 0.308
#> GSM955010     4  0.4361   0.376423 0.000 0.004 0.016 0.544 0.000 0.436
#> GSM955014     1  0.3386   0.813569 0.824 0.020 0.000 0.124 0.000 0.032
#> GSM955018     3  0.4180   0.290939 0.000 0.024 0.680 0.008 0.000 0.288
#> GSM955020     1  0.2247   0.832182 0.904 0.012 0.000 0.060 0.000 0.024
#> GSM955024     3  0.4987   0.453081 0.000 0.048 0.720 0.004 0.140 0.088
#> GSM955026     2  0.3496   0.571414 0.000 0.844 0.008 0.044 0.056 0.048
#> GSM955031     2  0.6887   0.087095 0.000 0.452 0.088 0.172 0.000 0.288
#> GSM955038     4  0.4117   0.554765 0.000 0.228 0.000 0.716 0.000 0.056
#> GSM955040     4  0.4932   0.633396 0.000 0.128 0.000 0.644 0.000 0.228
#> GSM955044     5  0.5915   0.166114 0.000 0.320 0.096 0.000 0.540 0.044
#> GSM955051     1  0.3700   0.800793 0.792 0.020 0.000 0.156 0.000 0.032
#> GSM955055     2  0.5658   0.030902 0.000 0.464 0.064 0.000 0.436 0.036
#> GSM955057     1  0.0692   0.837049 0.976 0.004 0.000 0.000 0.000 0.020
#> GSM955062     2  0.6483   0.245060 0.000 0.436 0.360 0.004 0.168 0.032
#> GSM955063     3  0.2734   0.417380 0.000 0.004 0.840 0.000 0.008 0.148
#> GSM955068     2  0.3492   0.559025 0.000 0.824 0.004 0.012 0.112 0.048
#> GSM955069     6  0.4746   0.298007 0.000 0.004 0.424 0.040 0.000 0.532
#> GSM955070     2  0.8114   0.317312 0.000 0.372 0.252 0.048 0.168 0.160
#> GSM955071     4  0.4698   0.620798 0.000 0.064 0.008 0.660 0.000 0.268
#> GSM955077     2  0.6068   0.140779 0.000 0.556 0.032 0.200 0.000 0.212
#> GSM955080     5  0.1275   0.731767 0.000 0.016 0.012 0.000 0.956 0.016
#> GSM955081     3  0.5822   0.370780 0.000 0.284 0.532 0.004 0.004 0.176
#> GSM955082     3  0.6508   0.341187 0.000 0.104 0.524 0.000 0.264 0.108
#> GSM955085     5  0.4416   0.392451 0.000 0.340 0.016 0.000 0.628 0.016
#> GSM955090     1  0.3673   0.790290 0.780 0.016 0.000 0.180 0.000 0.024
#> GSM955094     2  0.7850   0.316599 0.000 0.396 0.072 0.060 0.232 0.240
#> GSM955096     3  0.4329   0.358974 0.000 0.056 0.700 0.004 0.000 0.240
#> GSM955102     6  0.5090   0.597210 0.000 0.004 0.232 0.128 0.000 0.636
#> GSM955105     3  0.4656   0.307002 0.000 0.048 0.668 0.016 0.000 0.268

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

consensus_heatmap(res, k = 2)

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

consensus_heatmap(res, k = 3)

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

consensus_heatmap(res, k = 4)

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

consensus_heatmap(res, k = 5)

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

consensus_heatmap(res, k = 6)

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

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

membership_heatmap(res, k = 2)

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

membership_heatmap(res, k = 3)

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

membership_heatmap(res, k = 4)

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

membership_heatmap(res, k = 5)

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

membership_heatmap(res, k = 6)

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

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

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

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

get_signatures(res, k = 3)

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

get_signatures(res, k = 4)

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

get_signatures(res, k = 5)

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

get_signatures(res, k = 6)

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

Signature heatmaps where rows are not scaled:

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

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

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

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

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

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

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

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

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

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

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk SD-kmeans-signature_compare

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

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

An example of the output of tb is:

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

The columns in tb are:

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

UMAP plot which shows how samples are separated.

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

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

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

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

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

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

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

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

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

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

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk SD-kmeans-collect-classes

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

test_to_known_factors(res)
#>             n genotype/variation(p) k
#> SD:kmeans 108                 0.910 2
#> SD:kmeans 107                 0.982 3
#> SD:kmeans  84                 0.630 4
#> SD:kmeans  69                 0.591 5
#> SD:kmeans  50                 0.459 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 31589 rows and 108 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'SD' method.
#>   Subgroups are detected by 'skmeans' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 2.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

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

collect_plots(res)

plot of chunk SD-skmeans-collect-plots

The plots are:

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

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

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

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

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 1.000           0.974       0.989         0.4811 0.520   0.520
#> 3 3 0.860           0.874       0.945         0.3791 0.750   0.547
#> 4 4 0.620           0.534       0.737         0.1192 0.916   0.758
#> 5 5 0.624           0.488       0.729         0.0602 0.868   0.575
#> 6 6 0.618           0.397       0.633         0.0374 0.920   0.681

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
#> GSM955002     2  0.0000      0.989 0.000 1.000
#> GSM955008     2  0.0000      0.989 0.000 1.000
#> GSM955016     1  0.0000      0.989 1.000 0.000
#> GSM955019     2  0.0000      0.989 0.000 1.000
#> GSM955022     2  0.0000      0.989 0.000 1.000
#> GSM955023     2  0.0000      0.989 0.000 1.000
#> GSM955027     2  0.0000      0.989 0.000 1.000
#> GSM955043     2  0.0000      0.989 0.000 1.000
#> GSM955048     1  0.0000      0.989 1.000 0.000
#> GSM955049     2  0.0000      0.989 0.000 1.000
#> GSM955054     2  0.0000      0.989 0.000 1.000
#> GSM955064     2  0.0000      0.989 0.000 1.000
#> GSM955072     2  0.0000      0.989 0.000 1.000
#> GSM955075     2  0.0000      0.989 0.000 1.000
#> GSM955079     2  0.2236      0.955 0.036 0.964
#> GSM955087     1  0.0000      0.989 1.000 0.000
#> GSM955088     2  0.0000      0.989 0.000 1.000
#> GSM955089     1  0.0000      0.989 1.000 0.000
#> GSM955095     2  0.0000      0.989 0.000 1.000
#> GSM955097     2  0.9635      0.362 0.388 0.612
#> GSM955101     2  0.0000      0.989 0.000 1.000
#> GSM954999     1  0.0000      0.989 1.000 0.000
#> GSM955001     2  0.0000      0.989 0.000 1.000
#> GSM955003     2  0.0000      0.989 0.000 1.000
#> GSM955004     2  0.0000      0.989 0.000 1.000
#> GSM955005     1  0.0000      0.989 1.000 0.000
#> GSM955009     2  0.0000      0.989 0.000 1.000
#> GSM955011     1  0.0000      0.989 1.000 0.000
#> GSM955012     2  0.0000      0.989 0.000 1.000
#> GSM955013     2  0.0000      0.989 0.000 1.000
#> GSM955015     2  0.0000      0.989 0.000 1.000
#> GSM955017     1  0.0000      0.989 1.000 0.000
#> GSM955021     2  0.0000      0.989 0.000 1.000
#> GSM955025     2  0.1843      0.963 0.028 0.972
#> GSM955028     1  0.0000      0.989 1.000 0.000
#> GSM955029     2  0.0000      0.989 0.000 1.000
#> GSM955030     1  0.0000      0.989 1.000 0.000
#> GSM955032     2  0.0000      0.989 0.000 1.000
#> GSM955033     1  0.1633      0.967 0.976 0.024
#> GSM955034     1  0.0000      0.989 1.000 0.000
#> GSM955035     2  0.0000      0.989 0.000 1.000
#> GSM955036     1  0.0672      0.982 0.992 0.008
#> GSM955037     1  0.0000      0.989 1.000 0.000
#> GSM955039     2  0.0000      0.989 0.000 1.000
#> GSM955041     2  0.0000      0.989 0.000 1.000
#> GSM955042     1  0.0000      0.989 1.000 0.000
#> GSM955045     2  0.0000      0.989 0.000 1.000
#> GSM955046     2  0.0000      0.989 0.000 1.000
#> GSM955047     1  0.0000      0.989 1.000 0.000
#> GSM955050     1  0.0000      0.989 1.000 0.000
#> GSM955052     2  0.0000      0.989 0.000 1.000
#> GSM955053     1  0.0000      0.989 1.000 0.000
#> GSM955056     2  0.0000      0.989 0.000 1.000
#> GSM955058     2  0.0000      0.989 0.000 1.000
#> GSM955059     2  0.0672      0.982 0.008 0.992
#> GSM955060     1  0.0000      0.989 1.000 0.000
#> GSM955061     2  0.0000      0.989 0.000 1.000
#> GSM955065     1  0.0000      0.989 1.000 0.000
#> GSM955066     1  0.0000      0.989 1.000 0.000
#> GSM955067     1  0.0000      0.989 1.000 0.000
#> GSM955073     2  0.0000      0.989 0.000 1.000
#> GSM955074     1  0.0000      0.989 1.000 0.000
#> GSM955076     2  0.0000      0.989 0.000 1.000
#> GSM955078     2  0.0000      0.989 0.000 1.000
#> GSM955083     1  0.0000      0.989 1.000 0.000
#> GSM955084     2  0.0000      0.989 0.000 1.000
#> GSM955086     2  0.7883      0.690 0.236 0.764
#> GSM955091     2  0.0000      0.989 0.000 1.000
#> GSM955092     2  0.0000      0.989 0.000 1.000
#> GSM955093     2  0.0000      0.989 0.000 1.000
#> GSM955098     2  0.0000      0.989 0.000 1.000
#> GSM955099     2  0.0000      0.989 0.000 1.000
#> GSM955100     1  0.0000      0.989 1.000 0.000
#> GSM955103     2  0.0000      0.989 0.000 1.000
#> GSM955104     1  0.0000      0.989 1.000 0.000
#> GSM955106     2  0.0000      0.989 0.000 1.000
#> GSM955000     1  0.0000      0.989 1.000 0.000
#> GSM955006     1  0.0000      0.989 1.000 0.000
#> GSM955007     2  0.0000      0.989 0.000 1.000
#> GSM955010     1  0.0000      0.989 1.000 0.000
#> GSM955014     1  0.0000      0.989 1.000 0.000
#> GSM955018     2  0.1633      0.967 0.024 0.976
#> GSM955020     1  0.0000      0.989 1.000 0.000
#> GSM955024     2  0.0000      0.989 0.000 1.000
#> GSM955026     2  0.0000      0.989 0.000 1.000
#> GSM955031     1  0.0000      0.989 1.000 0.000
#> GSM955038     1  0.0000      0.989 1.000 0.000
#> GSM955040     1  0.0000      0.989 1.000 0.000
#> GSM955044     2  0.0000      0.989 0.000 1.000
#> GSM955051     1  0.0000      0.989 1.000 0.000
#> GSM955055     2  0.0000      0.989 0.000 1.000
#> GSM955057     1  0.0000      0.989 1.000 0.000
#> GSM955062     2  0.0000      0.989 0.000 1.000
#> GSM955063     2  0.0000      0.989 0.000 1.000
#> GSM955068     2  0.0000      0.989 0.000 1.000
#> GSM955069     1  0.9044      0.520 0.680 0.320
#> GSM955070     2  0.0000      0.989 0.000 1.000
#> GSM955071     1  0.0000      0.989 1.000 0.000
#> GSM955077     1  0.0000      0.989 1.000 0.000
#> GSM955080     2  0.0000      0.989 0.000 1.000
#> GSM955081     2  0.0000      0.989 0.000 1.000
#> GSM955082     2  0.0000      0.989 0.000 1.000
#> GSM955085     2  0.0000      0.989 0.000 1.000
#> GSM955090     1  0.0000      0.989 1.000 0.000
#> GSM955094     2  0.0000      0.989 0.000 1.000
#> GSM955096     2  0.0000      0.989 0.000 1.000
#> GSM955102     1  0.0000      0.989 1.000 0.000
#> GSM955105     1  0.4815      0.880 0.896 0.104

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1    p2    p3
#> GSM955002     2  0.2625     0.8786 0.000 0.916 0.084
#> GSM955008     3  0.2537     0.8385 0.000 0.080 0.920
#> GSM955016     1  0.0000     0.9906 1.000 0.000 0.000
#> GSM955019     2  0.0000     0.9419 0.000 1.000 0.000
#> GSM955022     3  0.0000     0.8775 0.000 0.000 1.000
#> GSM955023     3  0.5178     0.6463 0.000 0.256 0.744
#> GSM955027     2  0.0237     0.9402 0.000 0.996 0.004
#> GSM955043     2  0.0000     0.9419 0.000 1.000 0.000
#> GSM955048     1  0.0000     0.9906 1.000 0.000 0.000
#> GSM955049     2  0.0424     0.9385 0.000 0.992 0.008
#> GSM955054     3  0.6180     0.3046 0.000 0.416 0.584
#> GSM955064     2  0.0747     0.9343 0.000 0.984 0.016
#> GSM955072     2  0.0000     0.9419 0.000 1.000 0.000
#> GSM955075     2  0.0000     0.9419 0.000 1.000 0.000
#> GSM955079     3  0.0000     0.8775 0.000 0.000 1.000
#> GSM955087     1  0.0000     0.9906 1.000 0.000 0.000
#> GSM955088     3  0.0000     0.8775 0.000 0.000 1.000
#> GSM955089     1  0.0000     0.9906 1.000 0.000 0.000
#> GSM955095     2  0.0000     0.9419 0.000 1.000 0.000
#> GSM955097     2  0.2625     0.8618 0.084 0.916 0.000
#> GSM955101     3  0.3752     0.7868 0.000 0.144 0.856
#> GSM954999     1  0.0000     0.9906 1.000 0.000 0.000
#> GSM955001     2  0.0000     0.9419 0.000 1.000 0.000
#> GSM955003     3  0.6274     0.1731 0.000 0.456 0.544
#> GSM955004     2  0.0000     0.9419 0.000 1.000 0.000
#> GSM955005     3  0.2711     0.8331 0.088 0.000 0.912
#> GSM955009     2  0.0000     0.9419 0.000 1.000 0.000
#> GSM955011     1  0.0000     0.9906 1.000 0.000 0.000
#> GSM955012     2  0.0000     0.9419 0.000 1.000 0.000
#> GSM955013     3  0.4178     0.7590 0.000 0.172 0.828
#> GSM955015     2  0.6305    -0.0271 0.000 0.516 0.484
#> GSM955017     1  0.0000     0.9906 1.000 0.000 0.000
#> GSM955021     2  0.2066     0.9036 0.000 0.940 0.060
#> GSM955025     2  0.0000     0.9419 0.000 1.000 0.000
#> GSM955028     1  0.0000     0.9906 1.000 0.000 0.000
#> GSM955029     2  0.0000     0.9419 0.000 1.000 0.000
#> GSM955030     3  0.6192     0.3017 0.420 0.000 0.580
#> GSM955032     3  0.0000     0.8775 0.000 0.000 1.000
#> GSM955033     1  0.4293     0.7819 0.832 0.164 0.004
#> GSM955034     1  0.0000     0.9906 1.000 0.000 0.000
#> GSM955035     2  0.1753     0.9135 0.000 0.952 0.048
#> GSM955036     3  0.5244     0.6630 0.240 0.004 0.756
#> GSM955037     1  0.0000     0.9906 1.000 0.000 0.000
#> GSM955039     3  0.3816     0.7901 0.000 0.148 0.852
#> GSM955041     2  0.4062     0.7882 0.000 0.836 0.164
#> GSM955042     1  0.0000     0.9906 1.000 0.000 0.000
#> GSM955045     2  0.1529     0.9181 0.000 0.960 0.040
#> GSM955046     3  0.0000     0.8775 0.000 0.000 1.000
#> GSM955047     1  0.0000     0.9906 1.000 0.000 0.000
#> GSM955050     1  0.0000     0.9906 1.000 0.000 0.000
#> GSM955052     3  0.0000     0.8775 0.000 0.000 1.000
#> GSM955053     1  0.0000     0.9906 1.000 0.000 0.000
#> GSM955056     3  0.2261     0.8460 0.000 0.068 0.932
#> GSM955058     2  0.0000     0.9419 0.000 1.000 0.000
#> GSM955059     3  0.0000     0.8775 0.000 0.000 1.000
#> GSM955060     1  0.0000     0.9906 1.000 0.000 0.000
#> GSM955061     2  0.0000     0.9419 0.000 1.000 0.000
#> GSM955065     1  0.0000     0.9906 1.000 0.000 0.000
#> GSM955066     3  0.3116     0.8154 0.108 0.000 0.892
#> GSM955067     1  0.0000     0.9906 1.000 0.000 0.000
#> GSM955073     3  0.0000     0.8775 0.000 0.000 1.000
#> GSM955074     1  0.0000     0.9906 1.000 0.000 0.000
#> GSM955076     2  0.1964     0.9069 0.000 0.944 0.056
#> GSM955078     2  0.0000     0.9419 0.000 1.000 0.000
#> GSM955083     1  0.0000     0.9906 1.000 0.000 0.000
#> GSM955084     2  0.0000     0.9419 0.000 1.000 0.000
#> GSM955086     3  0.0000     0.8775 0.000 0.000 1.000
#> GSM955091     2  0.0000     0.9419 0.000 1.000 0.000
#> GSM955092     2  0.2878     0.8677 0.000 0.904 0.096
#> GSM955093     3  0.0000     0.8775 0.000 0.000 1.000
#> GSM955098     2  0.0000     0.9419 0.000 1.000 0.000
#> GSM955099     2  0.0000     0.9419 0.000 1.000 0.000
#> GSM955100     1  0.0000     0.9906 1.000 0.000 0.000
#> GSM955103     2  0.5650     0.5469 0.000 0.688 0.312
#> GSM955104     3  0.5591     0.5520 0.304 0.000 0.696
#> GSM955106     2  0.0000     0.9419 0.000 1.000 0.000
#> GSM955000     1  0.0000     0.9906 1.000 0.000 0.000
#> GSM955006     1  0.0000     0.9906 1.000 0.000 0.000
#> GSM955007     3  0.0237     0.8763 0.000 0.004 0.996
#> GSM955010     1  0.1753     0.9419 0.952 0.000 0.048
#> GSM955014     1  0.0000     0.9906 1.000 0.000 0.000
#> GSM955018     3  0.0000     0.8775 0.000 0.000 1.000
#> GSM955020     1  0.0000     0.9906 1.000 0.000 0.000
#> GSM955024     3  0.6180     0.2986 0.000 0.416 0.584
#> GSM955026     2  0.0000     0.9419 0.000 1.000 0.000
#> GSM955031     1  0.0237     0.9870 0.996 0.000 0.004
#> GSM955038     1  0.0592     0.9787 0.988 0.012 0.000
#> GSM955040     1  0.0000     0.9906 1.000 0.000 0.000
#> GSM955044     2  0.0000     0.9419 0.000 1.000 0.000
#> GSM955051     1  0.0000     0.9906 1.000 0.000 0.000
#> GSM955055     2  0.0237     0.9402 0.000 0.996 0.004
#> GSM955057     1  0.0000     0.9906 1.000 0.000 0.000
#> GSM955062     2  0.1411     0.9218 0.000 0.964 0.036
#> GSM955063     3  0.0000     0.8775 0.000 0.000 1.000
#> GSM955068     2  0.0000     0.9419 0.000 1.000 0.000
#> GSM955069     3  0.0000     0.8775 0.000 0.000 1.000
#> GSM955070     2  0.0000     0.9419 0.000 1.000 0.000
#> GSM955071     1  0.0000     0.9906 1.000 0.000 0.000
#> GSM955077     1  0.1411     0.9532 0.964 0.036 0.000
#> GSM955080     2  0.0000     0.9419 0.000 1.000 0.000
#> GSM955081     2  0.6154     0.2849 0.000 0.592 0.408
#> GSM955082     2  0.5621     0.5568 0.000 0.692 0.308
#> GSM955085     2  0.0000     0.9419 0.000 1.000 0.000
#> GSM955090     1  0.0000     0.9906 1.000 0.000 0.000
#> GSM955094     2  0.0000     0.9419 0.000 1.000 0.000
#> GSM955096     3  0.0000     0.8775 0.000 0.000 1.000
#> GSM955102     3  0.2711     0.8309 0.088 0.000 0.912
#> GSM955105     3  0.0237     0.8763 0.004 0.000 0.996

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM955002     4  0.6392    -0.1106 0.000 0.452 0.064 0.484
#> GSM955008     3  0.4046     0.6518 0.000 0.124 0.828 0.048
#> GSM955016     1  0.0336     0.9248 0.992 0.000 0.000 0.008
#> GSM955019     2  0.3325     0.5236 0.000 0.864 0.024 0.112
#> GSM955022     4  0.5793     0.0652 0.000 0.040 0.360 0.600
#> GSM955023     3  0.7188     0.2599 0.000 0.308 0.528 0.164
#> GSM955027     2  0.3271     0.5448 0.000 0.856 0.012 0.132
#> GSM955043     2  0.4961     0.1749 0.000 0.552 0.000 0.448
#> GSM955048     1  0.0000     0.9282 1.000 0.000 0.000 0.000
#> GSM955049     2  0.5457     0.4977 0.000 0.728 0.088 0.184
#> GSM955054     3  0.7043     0.1190 0.000 0.424 0.456 0.120
#> GSM955064     2  0.6495     0.2857 0.000 0.560 0.084 0.356
#> GSM955072     2  0.2408     0.5431 0.000 0.896 0.000 0.104
#> GSM955075     2  0.4977     0.1521 0.000 0.540 0.000 0.460
#> GSM955079     3  0.2002     0.7214 0.000 0.020 0.936 0.044
#> GSM955087     1  0.0000     0.9282 1.000 0.000 0.000 0.000
#> GSM955088     3  0.2053     0.7185 0.000 0.004 0.924 0.072
#> GSM955089     1  0.0000     0.9282 1.000 0.000 0.000 0.000
#> GSM955095     4  0.4999    -0.1326 0.000 0.492 0.000 0.508
#> GSM955097     4  0.5402    -0.1016 0.012 0.472 0.000 0.516
#> GSM955101     3  0.5566     0.5222 0.000 0.224 0.704 0.072
#> GSM954999     1  0.2839     0.8555 0.884 0.004 0.004 0.108
#> GSM955001     2  0.3757     0.5388 0.000 0.828 0.020 0.152
#> GSM955003     3  0.7107     0.1514 0.000 0.408 0.464 0.128
#> GSM955004     2  0.3610     0.4999 0.000 0.800 0.000 0.200
#> GSM955005     3  0.6172     0.5146 0.084 0.000 0.632 0.284
#> GSM955009     2  0.1890     0.5528 0.000 0.936 0.008 0.056
#> GSM955011     1  0.0000     0.9282 1.000 0.000 0.000 0.000
#> GSM955012     2  0.4985     0.1335 0.000 0.532 0.000 0.468
#> GSM955013     4  0.4898     0.4246 0.000 0.072 0.156 0.772
#> GSM955015     2  0.7540     0.0424 0.000 0.444 0.364 0.192
#> GSM955017     1  0.0000     0.9282 1.000 0.000 0.000 0.000
#> GSM955021     2  0.5100     0.4134 0.000 0.756 0.168 0.076
#> GSM955025     2  0.3266     0.5051 0.000 0.832 0.000 0.168
#> GSM955028     1  0.0000     0.9282 1.000 0.000 0.000 0.000
#> GSM955029     2  0.4955     0.1808 0.000 0.556 0.000 0.444
#> GSM955030     1  0.7906    -0.1987 0.356 0.000 0.344 0.300
#> GSM955032     3  0.2319     0.7201 0.000 0.036 0.924 0.040
#> GSM955033     4  0.5608     0.3385 0.148 0.080 0.020 0.752
#> GSM955034     1  0.0000     0.9282 1.000 0.000 0.000 0.000
#> GSM955035     2  0.5628     0.4326 0.000 0.724 0.144 0.132
#> GSM955036     4  0.5061     0.2971 0.048 0.004 0.196 0.752
#> GSM955037     1  0.1174     0.9118 0.968 0.000 0.012 0.020
#> GSM955039     4  0.5877     0.1073 0.000 0.068 0.276 0.656
#> GSM955041     2  0.7368     0.0998 0.000 0.460 0.164 0.376
#> GSM955042     1  0.0000     0.9282 1.000 0.000 0.000 0.000
#> GSM955045     2  0.6332     0.1679 0.000 0.532 0.064 0.404
#> GSM955046     3  0.4888     0.4433 0.000 0.000 0.588 0.412
#> GSM955047     1  0.0000     0.9282 1.000 0.000 0.000 0.000
#> GSM955050     1  0.3224     0.8468 0.864 0.016 0.000 0.120
#> GSM955052     3  0.1520     0.7266 0.000 0.020 0.956 0.024
#> GSM955053     1  0.0000     0.9282 1.000 0.000 0.000 0.000
#> GSM955056     3  0.4562     0.6205 0.000 0.152 0.792 0.056
#> GSM955058     2  0.4961     0.1765 0.000 0.552 0.000 0.448
#> GSM955059     3  0.3486     0.6594 0.000 0.000 0.812 0.188
#> GSM955060     1  0.0000     0.9282 1.000 0.000 0.000 0.000
#> GSM955061     2  0.4977     0.1521 0.000 0.540 0.000 0.460
#> GSM955065     1  0.0000     0.9282 1.000 0.000 0.000 0.000
#> GSM955066     3  0.5859     0.5366 0.064 0.000 0.652 0.284
#> GSM955067     1  0.0000     0.9282 1.000 0.000 0.000 0.000
#> GSM955073     3  0.1118     0.7274 0.000 0.000 0.964 0.036
#> GSM955074     1  0.0000     0.9282 1.000 0.000 0.000 0.000
#> GSM955076     2  0.5619     0.4021 0.000 0.724 0.124 0.152
#> GSM955078     2  0.2345     0.5539 0.000 0.900 0.000 0.100
#> GSM955083     1  0.3751     0.7724 0.800 0.004 0.000 0.196
#> GSM955084     2  0.3219     0.5303 0.000 0.836 0.000 0.164
#> GSM955086     3  0.1406     0.7270 0.000 0.024 0.960 0.016
#> GSM955091     2  0.2593     0.5608 0.000 0.892 0.004 0.104
#> GSM955092     2  0.6854     0.2973 0.000 0.596 0.232 0.172
#> GSM955093     3  0.1637     0.7234 0.000 0.000 0.940 0.060
#> GSM955098     2  0.4332     0.4599 0.000 0.792 0.032 0.176
#> GSM955099     2  0.2589     0.5591 0.000 0.884 0.000 0.116
#> GSM955100     1  0.0000     0.9282 1.000 0.000 0.000 0.000
#> GSM955103     4  0.7341     0.1632 0.000 0.292 0.192 0.516
#> GSM955104     3  0.7745     0.2158 0.240 0.000 0.420 0.340
#> GSM955106     4  0.4999    -0.1464 0.000 0.492 0.000 0.508
#> GSM955000     1  0.0188     0.9263 0.996 0.000 0.004 0.000
#> GSM955006     1  0.0000     0.9282 1.000 0.000 0.000 0.000
#> GSM955007     3  0.4908     0.5538 0.000 0.016 0.692 0.292
#> GSM955010     1  0.6499     0.5125 0.612 0.000 0.112 0.276
#> GSM955014     1  0.0000     0.9282 1.000 0.000 0.000 0.000
#> GSM955018     3  0.0921     0.7254 0.000 0.000 0.972 0.028
#> GSM955020     1  0.0000     0.9282 1.000 0.000 0.000 0.000
#> GSM955024     4  0.7874     0.1452 0.000 0.280 0.348 0.372
#> GSM955026     2  0.4677     0.4539 0.000 0.776 0.048 0.176
#> GSM955031     1  0.5941     0.6904 0.740 0.144 0.036 0.080
#> GSM955038     1  0.3754     0.8254 0.852 0.064 0.000 0.084
#> GSM955040     1  0.2125     0.8876 0.920 0.004 0.000 0.076
#> GSM955044     2  0.4697     0.4411 0.000 0.696 0.008 0.296
#> GSM955051     1  0.0000     0.9282 1.000 0.000 0.000 0.000
#> GSM955055     2  0.2563     0.5605 0.000 0.908 0.020 0.072
#> GSM955057     1  0.0000     0.9282 1.000 0.000 0.000 0.000
#> GSM955062     2  0.4514     0.4826 0.000 0.800 0.136 0.064
#> GSM955063     3  0.1389     0.7274 0.000 0.000 0.952 0.048
#> GSM955068     2  0.3257     0.5081 0.000 0.844 0.004 0.152
#> GSM955069     3  0.3528     0.6564 0.000 0.000 0.808 0.192
#> GSM955070     2  0.5237     0.3453 0.000 0.628 0.016 0.356
#> GSM955071     1  0.2593     0.8668 0.892 0.000 0.004 0.104
#> GSM955077     1  0.5675     0.6517 0.720 0.188 0.004 0.088
#> GSM955080     2  0.4994     0.1040 0.000 0.520 0.000 0.480
#> GSM955081     2  0.7340    -0.0392 0.000 0.436 0.408 0.156
#> GSM955082     2  0.7908    -0.1150 0.000 0.360 0.336 0.304
#> GSM955085     2  0.3024     0.5341 0.000 0.852 0.000 0.148
#> GSM955090     1  0.0000     0.9282 1.000 0.000 0.000 0.000
#> GSM955094     4  0.4961    -0.0682 0.000 0.448 0.000 0.552
#> GSM955096     3  0.1975     0.7198 0.000 0.048 0.936 0.016
#> GSM955102     3  0.5393     0.5728 0.044 0.000 0.688 0.268
#> GSM955105     3  0.1526     0.7273 0.012 0.016 0.960 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
#> GSM955002     2  0.6460   0.318740 0.000 0.576 0.056 0.288 0.080
#> GSM955008     3  0.4715   0.581359 0.000 0.212 0.728 0.048 0.012
#> GSM955016     1  0.2305   0.824099 0.896 0.012 0.000 0.092 0.000
#> GSM955019     2  0.4715   0.426234 0.000 0.672 0.020 0.012 0.296
#> GSM955022     4  0.7368   0.328001 0.000 0.040 0.220 0.436 0.304
#> GSM955023     3  0.7840   0.131972 0.000 0.284 0.440 0.116 0.160
#> GSM955027     5  0.5536   0.233555 0.000 0.340 0.044 0.020 0.596
#> GSM955043     5  0.2727   0.560542 0.000 0.116 0.000 0.016 0.868
#> GSM955048     1  0.0162   0.883472 0.996 0.000 0.000 0.004 0.000
#> GSM955049     5  0.6736  -0.041485 0.000 0.372 0.136 0.024 0.468
#> GSM955054     2  0.5619   0.069010 0.000 0.516 0.428 0.032 0.024
#> GSM955064     5  0.7118   0.079444 0.000 0.320 0.128 0.060 0.492
#> GSM955072     2  0.4668   0.282204 0.000 0.600 0.008 0.008 0.384
#> GSM955075     5  0.0566   0.584207 0.000 0.012 0.000 0.004 0.984
#> GSM955079     3  0.3494   0.651015 0.000 0.096 0.840 0.060 0.004
#> GSM955087     1  0.0162   0.883472 0.996 0.000 0.000 0.004 0.000
#> GSM955088     3  0.4233   0.488581 0.000 0.044 0.748 0.208 0.000
#> GSM955089     1  0.0000   0.883075 1.000 0.000 0.000 0.000 0.000
#> GSM955095     5  0.2353   0.564589 0.000 0.028 0.004 0.060 0.908
#> GSM955097     5  0.2544   0.554254 0.008 0.028 0.000 0.064 0.900
#> GSM955101     3  0.5977   0.453166 0.000 0.264 0.620 0.088 0.028
#> GSM954999     1  0.5039   0.518057 0.648 0.020 0.004 0.312 0.016
#> GSM955001     5  0.5190   0.259652 0.000 0.344 0.020 0.024 0.612
#> GSM955003     3  0.5781   0.010179 0.000 0.464 0.472 0.036 0.028
#> GSM955004     5  0.4473   0.321252 0.000 0.324 0.000 0.020 0.656
#> GSM955005     4  0.5894   0.330385 0.056 0.016 0.380 0.544 0.004
#> GSM955009     2  0.4920   0.308414 0.000 0.620 0.008 0.024 0.348
#> GSM955011     1  0.0162   0.883472 0.996 0.000 0.000 0.004 0.000
#> GSM955012     5  0.1012   0.583967 0.000 0.012 0.000 0.020 0.968
#> GSM955013     4  0.6972   0.343529 0.000 0.052 0.116 0.484 0.348
#> GSM955015     2  0.7711   0.245744 0.000 0.432 0.324 0.124 0.120
#> GSM955017     1  0.0880   0.873191 0.968 0.000 0.000 0.032 0.000
#> GSM955021     2  0.6775   0.425345 0.000 0.560 0.196 0.036 0.208
#> GSM955025     2  0.5180   0.417821 0.000 0.696 0.004 0.112 0.188
#> GSM955028     1  0.0162   0.883472 0.996 0.000 0.000 0.004 0.000
#> GSM955029     5  0.1124   0.581051 0.000 0.036 0.000 0.004 0.960
#> GSM955030     4  0.6338   0.441283 0.232 0.008 0.196 0.564 0.000
#> GSM955032     3  0.2554   0.658463 0.000 0.072 0.892 0.036 0.000
#> GSM955033     4  0.5899   0.394124 0.024 0.232 0.000 0.640 0.104
#> GSM955034     1  0.0162   0.883472 0.996 0.000 0.000 0.004 0.000
#> GSM955035     2  0.7163   0.388003 0.000 0.524 0.168 0.060 0.248
#> GSM955036     4  0.4377   0.507511 0.000 0.024 0.024 0.760 0.192
#> GSM955037     1  0.1952   0.829960 0.912 0.000 0.004 0.084 0.000
#> GSM955039     4  0.6113   0.444175 0.000 0.120 0.112 0.676 0.092
#> GSM955041     5  0.7284   0.210930 0.000 0.176 0.204 0.084 0.536
#> GSM955042     1  0.0798   0.876513 0.976 0.008 0.000 0.016 0.000
#> GSM955045     5  0.2800   0.573104 0.000 0.052 0.040 0.016 0.892
#> GSM955046     4  0.5141   0.383151 0.000 0.012 0.320 0.632 0.036
#> GSM955047     1  0.0162   0.883472 0.996 0.000 0.000 0.004 0.000
#> GSM955050     1  0.5329   0.611014 0.672 0.184 0.000 0.144 0.000
#> GSM955052     3  0.2437   0.658577 0.000 0.060 0.904 0.032 0.004
#> GSM955053     1  0.0162   0.883472 0.996 0.000 0.000 0.004 0.000
#> GSM955056     3  0.5151   0.582836 0.000 0.228 0.696 0.056 0.020
#> GSM955058     5  0.0703   0.583481 0.000 0.024 0.000 0.000 0.976
#> GSM955059     3  0.4389   0.178732 0.000 0.004 0.624 0.368 0.004
#> GSM955060     1  0.0162   0.883472 0.996 0.000 0.000 0.004 0.000
#> GSM955061     5  0.0609   0.583788 0.000 0.020 0.000 0.000 0.980
#> GSM955065     1  0.0290   0.882396 0.992 0.000 0.000 0.008 0.000
#> GSM955066     4  0.4752   0.311321 0.020 0.000 0.412 0.568 0.000
#> GSM955067     1  0.0451   0.880871 0.988 0.004 0.000 0.008 0.000
#> GSM955073     3  0.2968   0.636289 0.000 0.028 0.872 0.092 0.008
#> GSM955074     1  0.0451   0.880498 0.988 0.004 0.000 0.008 0.000
#> GSM955076     2  0.4882   0.518100 0.000 0.756 0.100 0.024 0.120
#> GSM955078     5  0.4367   0.242276 0.000 0.372 0.000 0.008 0.620
#> GSM955083     1  0.5721   0.463144 0.612 0.040 0.000 0.308 0.040
#> GSM955084     5  0.4953   0.045965 0.000 0.440 0.000 0.028 0.532
#> GSM955086     3  0.3102   0.637793 0.000 0.084 0.860 0.056 0.000
#> GSM955091     2  0.4800   0.131033 0.000 0.528 0.008 0.008 0.456
#> GSM955092     5  0.7178   0.173925 0.000 0.228 0.252 0.036 0.484
#> GSM955093     3  0.3621   0.568844 0.000 0.020 0.788 0.192 0.000
#> GSM955098     2  0.2914   0.501724 0.000 0.872 0.000 0.052 0.076
#> GSM955099     2  0.5295   0.115023 0.000 0.504 0.008 0.032 0.456
#> GSM955100     1  0.0963   0.871379 0.964 0.000 0.000 0.036 0.000
#> GSM955103     5  0.6173   0.406389 0.000 0.080 0.128 0.124 0.668
#> GSM955104     4  0.7456   0.436075 0.156 0.020 0.240 0.532 0.052
#> GSM955106     5  0.2110   0.561563 0.000 0.016 0.000 0.072 0.912
#> GSM955000     1  0.0880   0.872042 0.968 0.000 0.000 0.032 0.000
#> GSM955006     1  0.0000   0.883075 1.000 0.000 0.000 0.000 0.000
#> GSM955007     3  0.7355  -0.005727 0.000 0.048 0.432 0.340 0.180
#> GSM955010     4  0.5599   0.242319 0.376 0.028 0.032 0.564 0.000
#> GSM955014     1  0.0000   0.883075 1.000 0.000 0.000 0.000 0.000
#> GSM955018     3  0.2389   0.599786 0.000 0.004 0.880 0.116 0.000
#> GSM955020     1  0.0162   0.882505 0.996 0.004 0.000 0.000 0.000
#> GSM955024     5  0.7803   0.023913 0.000 0.124 0.348 0.128 0.400
#> GSM955026     2  0.3133   0.498599 0.000 0.864 0.004 0.052 0.080
#> GSM955031     1  0.7115   0.310597 0.508 0.308 0.100 0.084 0.000
#> GSM955038     1  0.5574   0.565334 0.640 0.244 0.000 0.112 0.004
#> GSM955040     1  0.5741   0.565039 0.636 0.156 0.004 0.204 0.000
#> GSM955044     5  0.5636   0.149403 0.000 0.372 0.012 0.056 0.560
#> GSM955051     1  0.0000   0.883075 1.000 0.000 0.000 0.000 0.000
#> GSM955055     5  0.5687  -0.036466 0.000 0.444 0.040 0.020 0.496
#> GSM955057     1  0.0162   0.883472 0.996 0.000 0.000 0.004 0.000
#> GSM955062     2  0.7097   0.322461 0.000 0.476 0.176 0.036 0.312
#> GSM955063     3  0.3110   0.629498 0.000 0.028 0.856 0.112 0.004
#> GSM955068     2  0.4197   0.474331 0.000 0.752 0.004 0.032 0.212
#> GSM955069     3  0.4533   0.000202 0.000 0.008 0.544 0.448 0.000
#> GSM955070     2  0.7175   0.236891 0.000 0.484 0.044 0.176 0.296
#> GSM955071     1  0.5039   0.649815 0.708 0.100 0.004 0.188 0.000
#> GSM955077     1  0.7295   0.262609 0.480 0.352 0.020 0.100 0.048
#> GSM955080     5  0.1992   0.578477 0.000 0.032 0.000 0.044 0.924
#> GSM955081     2  0.7564  -0.023548 0.000 0.408 0.372 0.124 0.096
#> GSM955082     5  0.6246   0.286837 0.000 0.064 0.316 0.048 0.572
#> GSM955085     5  0.4843   0.302802 0.000 0.328 0.008 0.024 0.640
#> GSM955090     1  0.0162   0.882505 0.996 0.004 0.000 0.000 0.000
#> GSM955094     5  0.6707  -0.048311 0.000 0.368 0.000 0.244 0.388
#> GSM955096     3  0.3159   0.645292 0.000 0.088 0.856 0.056 0.000
#> GSM955102     4  0.5100   0.233624 0.036 0.000 0.448 0.516 0.000
#> GSM955105     3  0.3213   0.625815 0.004 0.064 0.860 0.072 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
#> GSM955002     2  0.7255   -0.00516 0.000 0.428 0.036 0.340 0.076 0.120
#> GSM955008     6  0.3913    0.46740 0.000 0.072 0.128 0.008 0.004 0.788
#> GSM955016     1  0.3432    0.73019 0.764 0.020 0.000 0.216 0.000 0.000
#> GSM955019     2  0.6095    0.27001 0.000 0.532 0.000 0.040 0.296 0.132
#> GSM955022     3  0.7782   -0.17800 0.000 0.016 0.372 0.160 0.260 0.192
#> GSM955023     6  0.7328    0.36041 0.000 0.168 0.160 0.040 0.116 0.516
#> GSM955027     5  0.5760    0.40451 0.000 0.180 0.000 0.028 0.600 0.192
#> GSM955043     5  0.3390    0.54818 0.000 0.104 0.004 0.028 0.836 0.028
#> GSM955048     1  0.0260    0.84123 0.992 0.000 0.000 0.008 0.000 0.000
#> GSM955049     5  0.6671    0.15624 0.000 0.224 0.004 0.032 0.424 0.316
#> GSM955054     6  0.5849    0.27349 0.000 0.332 0.044 0.036 0.028 0.560
#> GSM955064     5  0.6872    0.13507 0.000 0.112 0.008 0.088 0.400 0.392
#> GSM955072     2  0.5537    0.25228 0.000 0.572 0.004 0.024 0.324 0.076
#> GSM955075     5  0.1155    0.57056 0.000 0.004 0.000 0.036 0.956 0.004
#> GSM955079     6  0.6607    0.29217 0.008 0.056 0.208 0.148 0.012 0.568
#> GSM955087     1  0.0260    0.84070 0.992 0.000 0.000 0.008 0.000 0.000
#> GSM955088     3  0.6647   -0.02979 0.000 0.076 0.464 0.116 0.004 0.340
#> GSM955089     1  0.0458    0.84090 0.984 0.000 0.000 0.016 0.000 0.000
#> GSM955095     5  0.3482    0.53707 0.000 0.024 0.008 0.116 0.828 0.024
#> GSM955097     5  0.2890    0.51626 0.000 0.024 0.004 0.128 0.844 0.000
#> GSM955101     6  0.4817    0.46558 0.000 0.100 0.052 0.072 0.020 0.756
#> GSM954999     1  0.6516    0.39670 0.520 0.032 0.116 0.308 0.016 0.008
#> GSM955001     5  0.5706    0.38347 0.000 0.208 0.000 0.024 0.600 0.168
#> GSM955003     6  0.4498    0.38498 0.000 0.260 0.016 0.032 0.004 0.688
#> GSM955004     5  0.4012    0.34151 0.000 0.344 0.000 0.016 0.640 0.000
#> GSM955005     3  0.4346    0.42260 0.040 0.020 0.788 0.100 0.000 0.052
#> GSM955009     2  0.5997    0.21509 0.000 0.544 0.008 0.044 0.324 0.080
#> GSM955011     1  0.0405    0.84002 0.988 0.000 0.008 0.004 0.000 0.000
#> GSM955012     5  0.0665    0.57808 0.000 0.008 0.000 0.004 0.980 0.008
#> GSM955013     4  0.7889    0.28657 0.000 0.052 0.152 0.364 0.324 0.108
#> GSM955015     6  0.7212    0.27969 0.000 0.224 0.124 0.060 0.072 0.520
#> GSM955017     1  0.1995    0.81481 0.912 0.000 0.052 0.036 0.000 0.000
#> GSM955021     6  0.6549   -0.05212 0.000 0.360 0.012 0.032 0.148 0.448
#> GSM955025     2  0.4160    0.46438 0.000 0.780 0.012 0.108 0.092 0.008
#> GSM955028     1  0.0260    0.84070 0.992 0.000 0.000 0.008 0.000 0.000
#> GSM955029     5  0.0862    0.57807 0.000 0.016 0.000 0.004 0.972 0.008
#> GSM955030     3  0.6136    0.18399 0.240 0.004 0.544 0.188 0.000 0.024
#> GSM955032     6  0.5384    0.33976 0.000 0.060 0.316 0.036 0.000 0.588
#> GSM955033     4  0.6694    0.37336 0.020 0.144 0.192 0.576 0.060 0.008
#> GSM955034     1  0.0146    0.84082 0.996 0.000 0.000 0.004 0.000 0.000
#> GSM955035     6  0.6741   -0.02347 0.000 0.336 0.008 0.048 0.164 0.444
#> GSM955036     3  0.5941   -0.31103 0.000 0.008 0.452 0.424 0.096 0.020
#> GSM955037     1  0.3010    0.75619 0.836 0.000 0.132 0.028 0.000 0.004
#> GSM955039     4  0.7618    0.29719 0.000 0.084 0.260 0.440 0.048 0.168
#> GSM955041     6  0.6837   -0.08100 0.000 0.076 0.048 0.052 0.392 0.432
#> GSM955042     1  0.2744    0.79429 0.840 0.016 0.000 0.144 0.000 0.000
#> GSM955045     5  0.4278    0.54483 0.000 0.044 0.004 0.084 0.784 0.084
#> GSM955046     3  0.3662    0.33937 0.000 0.000 0.800 0.128 0.008 0.064
#> GSM955047     1  0.1196    0.83569 0.952 0.000 0.008 0.040 0.000 0.000
#> GSM955050     1  0.6166    0.33853 0.484 0.212 0.016 0.288 0.000 0.000
#> GSM955052     6  0.4273    0.40539 0.000 0.036 0.248 0.012 0.000 0.704
#> GSM955053     1  0.0363    0.84085 0.988 0.000 0.000 0.012 0.000 0.000
#> GSM955056     6  0.6289    0.41859 0.000 0.128 0.196 0.068 0.012 0.596
#> GSM955058     5  0.0767    0.57810 0.000 0.012 0.000 0.004 0.976 0.008
#> GSM955059     3  0.3231    0.37625 0.000 0.000 0.784 0.016 0.000 0.200
#> GSM955060     1  0.0806    0.83856 0.972 0.000 0.008 0.020 0.000 0.000
#> GSM955061     5  0.0551    0.57626 0.000 0.004 0.000 0.008 0.984 0.004
#> GSM955065     1  0.0520    0.84046 0.984 0.000 0.008 0.008 0.000 0.000
#> GSM955066     3  0.2859    0.43177 0.024 0.008 0.880 0.056 0.000 0.032
#> GSM955067     1  0.1901    0.83054 0.912 0.008 0.004 0.076 0.000 0.000
#> GSM955073     6  0.4194    0.33957 0.000 0.004 0.320 0.016 0.004 0.656
#> GSM955074     1  0.2664    0.79859 0.848 0.016 0.000 0.136 0.000 0.000
#> GSM955076     2  0.4902    0.45947 0.000 0.696 0.004 0.012 0.112 0.176
#> GSM955078     5  0.4450    0.27946 0.000 0.380 0.000 0.012 0.592 0.016
#> GSM955083     1  0.6748    0.27586 0.468 0.040 0.076 0.360 0.056 0.000
#> GSM955084     5  0.4432    0.17097 0.000 0.432 0.000 0.020 0.544 0.004
#> GSM955086     6  0.6379    0.25742 0.000 0.076 0.308 0.108 0.000 0.508
#> GSM955091     5  0.5777    0.09339 0.000 0.412 0.000 0.024 0.468 0.096
#> GSM955092     5  0.7406    0.19934 0.000 0.164 0.028 0.080 0.416 0.312
#> GSM955093     6  0.5279    0.16267 0.000 0.012 0.384 0.072 0.000 0.532
#> GSM955098     2  0.3029    0.50969 0.000 0.868 0.004 0.028 0.040 0.060
#> GSM955099     5  0.5901    0.24129 0.000 0.340 0.000 0.032 0.520 0.108
#> GSM955100     1  0.1686    0.82519 0.924 0.000 0.012 0.064 0.000 0.000
#> GSM955103     5  0.6858    0.10741 0.000 0.032 0.044 0.184 0.524 0.216
#> GSM955104     3  0.7229    0.18471 0.152 0.004 0.484 0.260 0.024 0.076
#> GSM955106     5  0.2458    0.55120 0.000 0.016 0.004 0.084 0.888 0.008
#> GSM955000     1  0.2060    0.80309 0.900 0.000 0.084 0.016 0.000 0.000
#> GSM955006     1  0.0405    0.84097 0.988 0.000 0.004 0.008 0.000 0.000
#> GSM955007     3  0.6183   -0.00135 0.000 0.008 0.500 0.032 0.112 0.348
#> GSM955010     3  0.6671   -0.06320 0.316 0.028 0.336 0.320 0.000 0.000
#> GSM955014     1  0.1493    0.83607 0.936 0.004 0.004 0.056 0.000 0.000
#> GSM955018     6  0.5614    0.05049 0.000 0.016 0.440 0.092 0.000 0.452
#> GSM955020     1  0.1152    0.83758 0.952 0.004 0.000 0.044 0.000 0.000
#> GSM955024     5  0.7596    0.03657 0.000 0.056 0.104 0.100 0.396 0.344
#> GSM955026     2  0.2825    0.49785 0.000 0.884 0.008 0.040 0.036 0.032
#> GSM955031     1  0.7843    0.01880 0.376 0.328 0.088 0.140 0.000 0.068
#> GSM955038     1  0.5894    0.37720 0.500 0.280 0.004 0.216 0.000 0.000
#> GSM955040     1  0.6335    0.38017 0.512 0.144 0.052 0.292 0.000 0.000
#> GSM955044     5  0.6407    0.22507 0.000 0.312 0.004 0.072 0.512 0.100
#> GSM955051     1  0.0790    0.84127 0.968 0.000 0.000 0.032 0.000 0.000
#> GSM955055     5  0.6828    0.09433 0.000 0.320 0.004 0.048 0.420 0.208
#> GSM955057     1  0.0363    0.84118 0.988 0.000 0.000 0.012 0.000 0.000
#> GSM955062     6  0.7162   -0.12682 0.000 0.236 0.012 0.056 0.300 0.396
#> GSM955063     6  0.4118    0.30877 0.000 0.000 0.352 0.020 0.000 0.628
#> GSM955068     2  0.4659    0.42821 0.000 0.700 0.000 0.020 0.216 0.064
#> GSM955069     3  0.5410    0.31720 0.004 0.004 0.616 0.124 0.004 0.248
#> GSM955070     2  0.7993    0.17790 0.000 0.304 0.016 0.252 0.240 0.188
#> GSM955071     1  0.6021    0.45266 0.568 0.064 0.080 0.284 0.000 0.004
#> GSM955077     2  0.7206    0.03615 0.308 0.440 0.028 0.184 0.016 0.024
#> GSM955080     5  0.2265    0.56685 0.000 0.024 0.000 0.076 0.896 0.004
#> GSM955081     2  0.8041   -0.06776 0.000 0.340 0.108 0.168 0.060 0.324
#> GSM955082     5  0.7307    0.13616 0.000 0.056 0.044 0.152 0.440 0.308
#> GSM955085     5  0.4924    0.40970 0.000 0.288 0.004 0.040 0.644 0.024
#> GSM955090     1  0.2039    0.82605 0.908 0.016 0.004 0.072 0.000 0.000
#> GSM955094     2  0.8083   -0.00495 0.000 0.308 0.096 0.252 0.292 0.052
#> GSM955096     6  0.6085    0.30526 0.000 0.072 0.268 0.096 0.000 0.564
#> GSM955102     3  0.2642    0.45286 0.032 0.000 0.884 0.020 0.000 0.064
#> GSM955105     6  0.7057    0.19692 0.032 0.060 0.248 0.160 0.000 0.500

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

consensus_heatmap(res, k = 2)

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

consensus_heatmap(res, k = 3)

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

consensus_heatmap(res, k = 4)

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

consensus_heatmap(res, k = 5)

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

consensus_heatmap(res, k = 6)

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

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

membership_heatmap(res, k = 2)

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

membership_heatmap(res, k = 3)

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

membership_heatmap(res, k = 4)

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

membership_heatmap(res, k = 5)

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

membership_heatmap(res, k = 6)

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

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

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

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

get_signatures(res, k = 3)

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

get_signatures(res, k = 4)

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

get_signatures(res, k = 5)

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

get_signatures(res, k = 6)

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

Signature heatmaps where rows are not scaled:

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

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

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

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

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

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

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

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

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

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

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk SD-skmeans-signature_compare

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

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

An example of the output of tb is:

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

The columns in tb are:

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

UMAP plot which shows how samples are separated.

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

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

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

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

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

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

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

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

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

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

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk SD-skmeans-collect-classes

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

test_to_known_factors(res)
#>              n genotype/variation(p) k
#> SD:skmeans 107                0.0967 2
#> SD:skmeans 102                0.5557 3
#> SD:skmeans  66                0.7902 4
#> SD:skmeans  55                0.5412 5
#> SD:skmeans  36                0.4767 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 31589 rows and 108 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 3.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

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

collect_plots(res)

plot of chunk SD-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.681           0.830       0.909         0.3715 0.565   0.565
#> 3 3 0.697           0.865       0.927         0.6498 0.701   0.523
#> 4 4 0.763           0.826       0.918         0.1621 0.893   0.731
#> 5 5 0.614           0.554       0.784         0.0610 0.927   0.763
#> 6 6 0.705           0.679       0.838         0.0488 0.920   0.708

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

suggest_best_k(res)
#> [1] 3

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

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

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>           class entropy silhouette    p1    p2
#> GSM955002     2  0.1633      0.948 0.024 0.976
#> GSM955008     2  0.0672      0.959 0.008 0.992
#> GSM955016     1  0.9775      0.614 0.588 0.412
#> GSM955019     2  0.0000      0.959 0.000 1.000
#> GSM955022     2  0.1414      0.952 0.020 0.980
#> GSM955023     2  0.0938      0.958 0.012 0.988
#> GSM955027     2  0.0000      0.959 0.000 1.000
#> GSM955043     2  0.0376      0.959 0.004 0.996
#> GSM955048     1  0.0000      0.734 1.000 0.000
#> GSM955049     2  0.0000      0.959 0.000 1.000
#> GSM955054     2  0.0376      0.959 0.004 0.996
#> GSM955064     2  0.0000      0.959 0.000 1.000
#> GSM955072     2  0.0000      0.959 0.000 1.000
#> GSM955075     2  0.0000      0.959 0.000 1.000
#> GSM955079     2  0.1843      0.942 0.028 0.972
#> GSM955087     1  0.0000      0.734 1.000 0.000
#> GSM955088     2  0.0938      0.958 0.012 0.988
#> GSM955089     1  0.0000      0.734 1.000 0.000
#> GSM955095     2  0.0000      0.959 0.000 1.000
#> GSM955097     2  0.9983     -0.376 0.476 0.524
#> GSM955101     2  0.0000      0.959 0.000 1.000
#> GSM954999     1  0.9775      0.614 0.588 0.412
#> GSM955001     2  0.0000      0.959 0.000 1.000
#> GSM955003     2  0.0000      0.959 0.000 1.000
#> GSM955004     2  0.5519      0.795 0.128 0.872
#> GSM955005     2  0.6048      0.776 0.148 0.852
#> GSM955009     2  0.0000      0.959 0.000 1.000
#> GSM955011     1  0.9775      0.614 0.588 0.412
#> GSM955012     2  0.0938      0.958 0.012 0.988
#> GSM955013     2  0.3114      0.911 0.056 0.944
#> GSM955015     2  0.0938      0.958 0.012 0.988
#> GSM955017     1  0.9775      0.614 0.588 0.412
#> GSM955021     2  0.0000      0.959 0.000 1.000
#> GSM955025     2  0.1184      0.956 0.016 0.984
#> GSM955028     1  0.0000      0.734 1.000 0.000
#> GSM955029     2  0.0000      0.959 0.000 1.000
#> GSM955030     1  0.9833      0.594 0.576 0.424
#> GSM955032     2  0.0938      0.958 0.012 0.988
#> GSM955033     1  0.9963      0.514 0.536 0.464
#> GSM955034     1  0.0000      0.734 1.000 0.000
#> GSM955035     2  0.0000      0.959 0.000 1.000
#> GSM955036     1  0.9775      0.614 0.588 0.412
#> GSM955037     1  0.9775      0.614 0.588 0.412
#> GSM955039     2  0.0938      0.958 0.012 0.988
#> GSM955041     2  0.0938      0.958 0.012 0.988
#> GSM955042     1  0.9775      0.614 0.588 0.412
#> GSM955045     2  0.0000      0.959 0.000 1.000
#> GSM955046     2  0.0938      0.958 0.012 0.988
#> GSM955047     1  0.0000      0.734 1.000 0.000
#> GSM955050     1  0.9850      0.599 0.572 0.428
#> GSM955052     2  0.0938      0.958 0.012 0.988
#> GSM955053     1  0.0000      0.734 1.000 0.000
#> GSM955056     2  0.0938      0.958 0.012 0.988
#> GSM955058     2  0.0000      0.959 0.000 1.000
#> GSM955059     2  0.0938      0.958 0.012 0.988
#> GSM955060     1  0.0000      0.734 1.000 0.000
#> GSM955061     2  0.0000      0.959 0.000 1.000
#> GSM955065     1  0.0000      0.734 1.000 0.000
#> GSM955066     1  0.9866      0.580 0.568 0.432
#> GSM955067     1  0.0000      0.734 1.000 0.000
#> GSM955073     2  0.0938      0.958 0.012 0.988
#> GSM955074     1  0.9775      0.614 0.588 0.412
#> GSM955076     2  0.0000      0.959 0.000 1.000
#> GSM955078     2  0.0000      0.959 0.000 1.000
#> GSM955083     1  0.9795      0.608 0.584 0.416
#> GSM955084     2  0.0000      0.959 0.000 1.000
#> GSM955086     2  0.0938      0.958 0.012 0.988
#> GSM955091     2  0.0000      0.959 0.000 1.000
#> GSM955092     2  0.0000      0.959 0.000 1.000
#> GSM955093     2  0.0938      0.958 0.012 0.988
#> GSM955098     2  0.0938      0.958 0.012 0.988
#> GSM955099     2  0.0000      0.959 0.000 1.000
#> GSM955100     1  0.9775      0.614 0.588 0.412
#> GSM955103     2  0.0000      0.959 0.000 1.000
#> GSM955104     2  0.6048      0.776 0.148 0.852
#> GSM955106     2  0.0938      0.958 0.012 0.988
#> GSM955000     1  0.9775      0.614 0.588 0.412
#> GSM955006     1  0.0000      0.734 1.000 0.000
#> GSM955007     2  0.0672      0.959 0.008 0.992
#> GSM955010     2  0.4022      0.879 0.080 0.920
#> GSM955014     1  0.0000      0.734 1.000 0.000
#> GSM955018     2  0.1184      0.955 0.016 0.984
#> GSM955020     1  0.0000      0.734 1.000 0.000
#> GSM955024     2  0.0376      0.959 0.004 0.996
#> GSM955026     2  0.0376      0.959 0.004 0.996
#> GSM955031     2  0.0672      0.958 0.008 0.992
#> GSM955038     2  0.6712      0.724 0.176 0.824
#> GSM955040     1  0.9944      0.533 0.544 0.456
#> GSM955044     2  0.0000      0.959 0.000 1.000
#> GSM955051     1  0.0000      0.734 1.000 0.000
#> GSM955055     2  0.0000      0.959 0.000 1.000
#> GSM955057     1  0.0000      0.734 1.000 0.000
#> GSM955062     2  0.0000      0.959 0.000 1.000
#> GSM955063     2  0.0938      0.958 0.012 0.988
#> GSM955068     2  0.0000      0.959 0.000 1.000
#> GSM955069     2  0.6048      0.776 0.148 0.852
#> GSM955070     2  0.0000      0.959 0.000 1.000
#> GSM955071     2  0.9963     -0.300 0.464 0.536
#> GSM955077     1  0.9970      0.506 0.532 0.468
#> GSM955080     2  0.0000      0.959 0.000 1.000
#> GSM955081     2  0.0938      0.958 0.012 0.988
#> GSM955082     2  0.0000      0.959 0.000 1.000
#> GSM955085     2  0.0000      0.959 0.000 1.000
#> GSM955090     1  0.0000      0.734 1.000 0.000
#> GSM955094     2  0.0938      0.958 0.012 0.988
#> GSM955096     2  0.0938      0.958 0.012 0.988
#> GSM955102     1  0.9909      0.554 0.556 0.444
#> GSM955105     2  0.1414      0.952 0.020 0.980

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1    p2    p3
#> GSM955002     2  0.5138   7.70e-01 0.000 0.748 0.252
#> GSM955008     2  0.3267   8.63e-01 0.000 0.884 0.116
#> GSM955016     3  0.1289   9.15e-01 0.032 0.000 0.968
#> GSM955019     2  0.0000   8.95e-01 0.000 1.000 0.000
#> GSM955022     3  0.0000   9.16e-01 0.000 0.000 1.000
#> GSM955023     2  0.4702   8.10e-01 0.000 0.788 0.212
#> GSM955027     2  0.0000   8.95e-01 0.000 1.000 0.000
#> GSM955043     2  0.6307   7.87e-03 0.000 0.512 0.488
#> GSM955048     1  0.0000   1.00e+00 1.000 0.000 0.000
#> GSM955049     2  0.1411   8.94e-01 0.000 0.964 0.036
#> GSM955054     2  0.1529   8.94e-01 0.000 0.960 0.040
#> GSM955064     2  0.0000   8.95e-01 0.000 1.000 0.000
#> GSM955072     2  0.0892   8.93e-01 0.000 0.980 0.020
#> GSM955075     2  0.1289   8.90e-01 0.000 0.968 0.032
#> GSM955079     3  0.2537   8.88e-01 0.000 0.080 0.920
#> GSM955087     1  0.0000   1.00e+00 1.000 0.000 0.000
#> GSM955088     2  0.6095   4.83e-01 0.000 0.608 0.392
#> GSM955089     1  0.0000   1.00e+00 1.000 0.000 0.000
#> GSM955095     2  0.2711   8.67e-01 0.000 0.912 0.088
#> GSM955097     3  0.4291   7.55e-01 0.000 0.180 0.820
#> GSM955101     2  0.0237   8.96e-01 0.000 0.996 0.004
#> GSM954999     3  0.1163   9.16e-01 0.028 0.000 0.972
#> GSM955001     2  0.0000   8.95e-01 0.000 1.000 0.000
#> GSM955003     2  0.0000   8.95e-01 0.000 1.000 0.000
#> GSM955004     2  0.1289   8.90e-01 0.000 0.968 0.032
#> GSM955005     3  0.0000   9.16e-01 0.000 0.000 1.000
#> GSM955009     2  0.0000   8.95e-01 0.000 1.000 0.000
#> GSM955011     3  0.1289   9.15e-01 0.032 0.000 0.968
#> GSM955012     3  0.2356   8.78e-01 0.000 0.072 0.928
#> GSM955013     3  0.1411   9.00e-01 0.000 0.036 0.964
#> GSM955015     2  0.1529   8.94e-01 0.000 0.960 0.040
#> GSM955017     3  0.1289   9.15e-01 0.032 0.000 0.968
#> GSM955021     2  0.0000   8.95e-01 0.000 1.000 0.000
#> GSM955025     3  0.1411   9.09e-01 0.000 0.036 0.964
#> GSM955028     1  0.0000   1.00e+00 1.000 0.000 0.000
#> GSM955029     2  0.1529   8.89e-01 0.000 0.960 0.040
#> GSM955030     3  0.0000   9.16e-01 0.000 0.000 1.000
#> GSM955032     3  0.5621   5.41e-01 0.000 0.308 0.692
#> GSM955033     3  0.1289   9.15e-01 0.032 0.000 0.968
#> GSM955034     1  0.0000   1.00e+00 1.000 0.000 0.000
#> GSM955035     2  0.0000   8.95e-01 0.000 1.000 0.000
#> GSM955036     3  0.0000   9.16e-01 0.000 0.000 1.000
#> GSM955037     3  0.1289   9.15e-01 0.032 0.000 0.968
#> GSM955039     3  0.5760   4.28e-01 0.000 0.328 0.672
#> GSM955041     2  0.2878   8.74e-01 0.000 0.904 0.096
#> GSM955042     3  0.1289   9.15e-01 0.032 0.000 0.968
#> GSM955045     2  0.4504   7.56e-01 0.000 0.804 0.196
#> GSM955046     3  0.0000   9.16e-01 0.000 0.000 1.000
#> GSM955047     1  0.0000   1.00e+00 1.000 0.000 0.000
#> GSM955050     3  0.3966   8.46e-01 0.024 0.100 0.876
#> GSM955052     2  0.4291   8.20e-01 0.000 0.820 0.180
#> GSM955053     1  0.0000   1.00e+00 1.000 0.000 0.000
#> GSM955056     2  0.4291   8.20e-01 0.000 0.820 0.180
#> GSM955058     2  0.1289   8.91e-01 0.000 0.968 0.032
#> GSM955059     3  0.0000   9.16e-01 0.000 0.000 1.000
#> GSM955060     1  0.0000   1.00e+00 1.000 0.000 0.000
#> GSM955061     3  0.4291   7.55e-01 0.000 0.180 0.820
#> GSM955065     1  0.0000   1.00e+00 1.000 0.000 0.000
#> GSM955066     3  0.0000   9.16e-01 0.000 0.000 1.000
#> GSM955067     1  0.0000   1.00e+00 1.000 0.000 0.000
#> GSM955073     2  0.4291   8.20e-01 0.000 0.820 0.180
#> GSM955074     3  0.1289   9.15e-01 0.032 0.000 0.968
#> GSM955076     2  0.1163   8.95e-01 0.000 0.972 0.028
#> GSM955078     2  0.0424   8.95e-01 0.000 0.992 0.008
#> GSM955083     3  0.1031   9.16e-01 0.024 0.000 0.976
#> GSM955084     2  0.1529   8.91e-01 0.000 0.960 0.040
#> GSM955086     2  0.5859   5.90e-01 0.000 0.656 0.344
#> GSM955091     2  0.0237   8.96e-01 0.000 0.996 0.004
#> GSM955092     2  0.0000   8.95e-01 0.000 1.000 0.000
#> GSM955093     2  0.4291   8.20e-01 0.000 0.820 0.180
#> GSM955098     2  0.4291   8.20e-01 0.000 0.820 0.180
#> GSM955099     2  0.0000   8.95e-01 0.000 1.000 0.000
#> GSM955100     3  0.1289   9.15e-01 0.032 0.000 0.968
#> GSM955103     2  0.1529   8.94e-01 0.000 0.960 0.040
#> GSM955104     3  0.0000   9.16e-01 0.000 0.000 1.000
#> GSM955106     3  0.6252   6.26e-05 0.000 0.444 0.556
#> GSM955000     3  0.1529   9.11e-01 0.040 0.000 0.960
#> GSM955006     1  0.0000   1.00e+00 1.000 0.000 0.000
#> GSM955007     3  0.3038   8.45e-01 0.000 0.104 0.896
#> GSM955010     3  0.3879   7.81e-01 0.000 0.152 0.848
#> GSM955014     1  0.0000   1.00e+00 1.000 0.000 0.000
#> GSM955018     3  0.1964   8.98e-01 0.000 0.056 0.944
#> GSM955020     1  0.0000   1.00e+00 1.000 0.000 0.000
#> GSM955024     2  0.2356   8.87e-01 0.000 0.928 0.072
#> GSM955026     2  0.3412   8.63e-01 0.000 0.876 0.124
#> GSM955031     2  0.2959   8.74e-01 0.000 0.900 0.100
#> GSM955038     3  0.1905   9.14e-01 0.028 0.016 0.956
#> GSM955040     3  0.1289   9.15e-01 0.032 0.000 0.968
#> GSM955044     2  0.0892   8.93e-01 0.000 0.980 0.020
#> GSM955051     1  0.0000   1.00e+00 1.000 0.000 0.000
#> GSM955055     2  0.0000   8.95e-01 0.000 1.000 0.000
#> GSM955057     1  0.0000   1.00e+00 1.000 0.000 0.000
#> GSM955062     2  0.0000   8.95e-01 0.000 1.000 0.000
#> GSM955063     2  0.4291   8.21e-01 0.000 0.820 0.180
#> GSM955068     2  0.4555   7.33e-01 0.000 0.800 0.200
#> GSM955069     3  0.0000   9.16e-01 0.000 0.000 1.000
#> GSM955070     2  0.0237   8.95e-01 0.000 0.996 0.004
#> GSM955071     3  0.1529   9.07e-01 0.000 0.040 0.960
#> GSM955077     3  0.1289   9.15e-01 0.032 0.000 0.968
#> GSM955080     2  0.1289   8.90e-01 0.000 0.968 0.032
#> GSM955081     2  0.4346   8.18e-01 0.000 0.816 0.184
#> GSM955082     2  0.2711   8.86e-01 0.000 0.912 0.088
#> GSM955085     2  0.0000   8.95e-01 0.000 1.000 0.000
#> GSM955090     1  0.0000   1.00e+00 1.000 0.000 0.000
#> GSM955094     2  0.5363   7.42e-01 0.000 0.724 0.276
#> GSM955096     2  0.5431   7.01e-01 0.000 0.716 0.284
#> GSM955102     3  0.0000   9.16e-01 0.000 0.000 1.000
#> GSM955105     2  0.4452   8.13e-01 0.000 0.808 0.192

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM955002     2  0.3636     0.7443 0.000 0.820 0.172 0.008
#> GSM955008     2  0.0000     0.8545 0.000 1.000 0.000 0.000
#> GSM955016     3  0.0000     0.9374 0.000 0.000 1.000 0.000
#> GSM955019     2  0.1792     0.8427 0.000 0.932 0.000 0.068
#> GSM955022     3  0.0336     0.9375 0.000 0.000 0.992 0.008
#> GSM955023     2  0.0804     0.8539 0.000 0.980 0.012 0.008
#> GSM955027     4  0.4994     0.0274 0.000 0.480 0.000 0.520
#> GSM955043     4  0.3205     0.7822 0.000 0.104 0.024 0.872
#> GSM955048     1  0.0000     0.9984 1.000 0.000 0.000 0.000
#> GSM955049     2  0.0188     0.8551 0.000 0.996 0.004 0.000
#> GSM955054     2  0.0000     0.8545 0.000 1.000 0.000 0.000
#> GSM955064     2  0.3486     0.7704 0.000 0.812 0.000 0.188
#> GSM955072     2  0.4356     0.6725 0.000 0.708 0.000 0.292
#> GSM955075     4  0.0000     0.8447 0.000 0.000 0.000 1.000
#> GSM955079     3  0.2522     0.8726 0.000 0.016 0.908 0.076
#> GSM955087     1  0.0188     0.9961 0.996 0.000 0.004 0.000
#> GSM955088     2  0.4356     0.5619 0.000 0.708 0.292 0.000
#> GSM955089     1  0.0188     0.9961 0.996 0.000 0.004 0.000
#> GSM955095     4  0.5108     0.4087 0.000 0.308 0.020 0.672
#> GSM955097     4  0.0000     0.8447 0.000 0.000 0.000 1.000
#> GSM955101     2  0.0469     0.8552 0.000 0.988 0.000 0.012
#> GSM954999     3  0.0000     0.9374 0.000 0.000 1.000 0.000
#> GSM955001     2  0.4304     0.6805 0.000 0.716 0.000 0.284
#> GSM955003     2  0.0000     0.8545 0.000 1.000 0.000 0.000
#> GSM955004     4  0.0000     0.8447 0.000 0.000 0.000 1.000
#> GSM955005     3  0.0336     0.9375 0.000 0.000 0.992 0.008
#> GSM955009     2  0.4304     0.6805 0.000 0.716 0.000 0.284
#> GSM955011     3  0.0000     0.9374 0.000 0.000 1.000 0.000
#> GSM955012     4  0.3942     0.6413 0.000 0.000 0.236 0.764
#> GSM955013     3  0.1452     0.9110 0.000 0.036 0.956 0.008
#> GSM955015     2  0.0000     0.8545 0.000 1.000 0.000 0.000
#> GSM955017     3  0.0000     0.9374 0.000 0.000 1.000 0.000
#> GSM955021     2  0.3907     0.7361 0.000 0.768 0.000 0.232
#> GSM955025     3  0.0672     0.9333 0.000 0.008 0.984 0.008
#> GSM955028     1  0.0000     0.9984 1.000 0.000 0.000 0.000
#> GSM955029     4  0.0000     0.8447 0.000 0.000 0.000 1.000
#> GSM955030     3  0.0336     0.9375 0.000 0.000 0.992 0.008
#> GSM955032     3  0.4907     0.3230 0.000 0.420 0.580 0.000
#> GSM955033     3  0.0336     0.9375 0.000 0.000 0.992 0.008
#> GSM955034     1  0.0000     0.9984 1.000 0.000 0.000 0.000
#> GSM955035     2  0.0000     0.8545 0.000 1.000 0.000 0.000
#> GSM955036     3  0.0921     0.9268 0.000 0.000 0.972 0.028
#> GSM955037     3  0.0000     0.9374 0.000 0.000 1.000 0.000
#> GSM955039     3  0.5172     0.3188 0.000 0.404 0.588 0.008
#> GSM955041     2  0.4967    -0.0171 0.000 0.548 0.000 0.452
#> GSM955042     3  0.0000     0.9374 0.000 0.000 1.000 0.000
#> GSM955045     2  0.7188     0.3955 0.000 0.528 0.164 0.308
#> GSM955046     3  0.0336     0.9375 0.000 0.000 0.992 0.008
#> GSM955047     1  0.0000     0.9984 1.000 0.000 0.000 0.000
#> GSM955050     3  0.3123     0.7849 0.000 0.000 0.844 0.156
#> GSM955052     2  0.0000     0.8545 0.000 1.000 0.000 0.000
#> GSM955053     1  0.0000     0.9984 1.000 0.000 0.000 0.000
#> GSM955056     2  0.0000     0.8545 0.000 1.000 0.000 0.000
#> GSM955058     4  0.0000     0.8447 0.000 0.000 0.000 1.000
#> GSM955059     3  0.0336     0.9375 0.000 0.000 0.992 0.008
#> GSM955060     1  0.0000     0.9984 1.000 0.000 0.000 0.000
#> GSM955061     4  0.0000     0.8447 0.000 0.000 0.000 1.000
#> GSM955065     1  0.0000     0.9984 1.000 0.000 0.000 0.000
#> GSM955066     3  0.0336     0.9375 0.000 0.000 0.992 0.008
#> GSM955067     1  0.0000     0.9984 1.000 0.000 0.000 0.000
#> GSM955073     2  0.0188     0.8552 0.000 0.996 0.004 0.000
#> GSM955074     3  0.0000     0.9374 0.000 0.000 1.000 0.000
#> GSM955076     2  0.0000     0.8545 0.000 1.000 0.000 0.000
#> GSM955078     2  0.4955     0.2751 0.000 0.556 0.000 0.444
#> GSM955083     3  0.0336     0.9375 0.000 0.000 0.992 0.008
#> GSM955084     4  0.0000     0.8447 0.000 0.000 0.000 1.000
#> GSM955086     2  0.3942     0.6457 0.000 0.764 0.236 0.000
#> GSM955091     2  0.2530     0.8267 0.000 0.888 0.000 0.112
#> GSM955092     2  0.2081     0.8353 0.000 0.916 0.000 0.084
#> GSM955093     2  0.0000     0.8545 0.000 1.000 0.000 0.000
#> GSM955098     2  0.0000     0.8545 0.000 1.000 0.000 0.000
#> GSM955099     2  0.3123     0.7958 0.000 0.844 0.000 0.156
#> GSM955100     3  0.0000     0.9374 0.000 0.000 1.000 0.000
#> GSM955103     2  0.3208     0.8056 0.000 0.848 0.004 0.148
#> GSM955104     3  0.0336     0.9375 0.000 0.000 0.992 0.008
#> GSM955106     4  0.5041     0.6361 0.000 0.040 0.232 0.728
#> GSM955000     3  0.0336     0.9342 0.008 0.000 0.992 0.000
#> GSM955006     1  0.0336     0.9930 0.992 0.000 0.008 0.000
#> GSM955007     3  0.3024     0.8080 0.000 0.000 0.852 0.148
#> GSM955010     3  0.3852     0.7271 0.000 0.192 0.800 0.008
#> GSM955014     1  0.0000     0.9984 1.000 0.000 0.000 0.000
#> GSM955018     3  0.2011     0.8773 0.000 0.080 0.920 0.000
#> GSM955020     1  0.0000     0.9984 1.000 0.000 0.000 0.000
#> GSM955024     2  0.3958     0.7873 0.000 0.816 0.024 0.160
#> GSM955026     2  0.1109     0.8498 0.000 0.968 0.028 0.004
#> GSM955031     2  0.0817     0.8503 0.000 0.976 0.024 0.000
#> GSM955038     3  0.0469     0.9326 0.000 0.012 0.988 0.000
#> GSM955040     3  0.0000     0.9374 0.000 0.000 1.000 0.000
#> GSM955044     4  0.3486     0.7129 0.000 0.188 0.000 0.812
#> GSM955051     1  0.0336     0.9930 0.992 0.000 0.008 0.000
#> GSM955055     2  0.4304     0.6805 0.000 0.716 0.000 0.284
#> GSM955057     1  0.0000     0.9984 1.000 0.000 0.000 0.000
#> GSM955062     2  0.2081     0.8395 0.000 0.916 0.000 0.084
#> GSM955063     2  0.0336     0.8551 0.000 0.992 0.008 0.000
#> GSM955068     2  0.7110     0.4651 0.000 0.564 0.200 0.236
#> GSM955069     3  0.0188     0.9376 0.000 0.000 0.996 0.004
#> GSM955070     2  0.0469     0.8554 0.000 0.988 0.000 0.012
#> GSM955071     3  0.1118     0.9157 0.000 0.036 0.964 0.000
#> GSM955077     3  0.0000     0.9374 0.000 0.000 1.000 0.000
#> GSM955080     4  0.0000     0.8447 0.000 0.000 0.000 1.000
#> GSM955081     2  0.0336     0.8548 0.000 0.992 0.008 0.000
#> GSM955082     2  0.1406     0.8512 0.000 0.960 0.024 0.016
#> GSM955085     2  0.2589     0.8173 0.000 0.884 0.000 0.116
#> GSM955090     1  0.0000     0.9984 1.000 0.000 0.000 0.000
#> GSM955094     2  0.3401     0.7611 0.000 0.840 0.152 0.008
#> GSM955096     2  0.2814     0.7701 0.000 0.868 0.132 0.000
#> GSM955102     3  0.0336     0.9375 0.000 0.000 0.992 0.008
#> GSM955105     2  0.0336     0.8550 0.000 0.992 0.008 0.000

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM955002     3  0.3231    0.71764 0.000 0.004 0.800 0.196 0.000
#> GSM955008     3  0.0000    0.83814 0.000 0.000 1.000 0.000 0.000
#> GSM955016     1  0.4283   -0.31056 0.544 0.000 0.000 0.456 0.000
#> GSM955019     3  0.1544    0.81815 0.000 0.000 0.932 0.000 0.068
#> GSM955022     4  0.0162    0.81197 0.000 0.004 0.000 0.996 0.000
#> GSM955023     3  0.1831    0.81172 0.000 0.004 0.920 0.076 0.000
#> GSM955027     5  0.5546    0.11692 0.000 0.068 0.436 0.000 0.496
#> GSM955043     5  0.3334    0.62984 0.000 0.004 0.080 0.064 0.852
#> GSM955048     2  0.4278   -0.36582 0.452 0.548 0.000 0.000 0.000
#> GSM955049     3  0.0162    0.83842 0.000 0.000 0.996 0.004 0.000
#> GSM955054     3  0.0000    0.83814 0.000 0.000 1.000 0.000 0.000
#> GSM955064     3  0.3074    0.71940 0.000 0.000 0.804 0.000 0.196
#> GSM955072     2  0.6657    0.12673 0.000 0.424 0.340 0.000 0.236
#> GSM955075     5  0.0451    0.68405 0.000 0.004 0.000 0.008 0.988
#> GSM955079     4  0.2464    0.78532 0.000 0.000 0.016 0.888 0.096
#> GSM955087     1  0.4291    0.35423 0.536 0.464 0.000 0.000 0.000
#> GSM955088     3  0.3586    0.58602 0.000 0.000 0.736 0.264 0.000
#> GSM955089     1  0.1410    0.53439 0.940 0.060 0.000 0.000 0.000
#> GSM955095     2  0.6992   -0.38201 0.000 0.428 0.104 0.056 0.412
#> GSM955097     5  0.4235    0.48405 0.000 0.424 0.000 0.000 0.576
#> GSM955101     3  0.0404    0.83761 0.000 0.000 0.988 0.000 0.012
#> GSM954999     4  0.1197    0.81220 0.048 0.000 0.000 0.952 0.000
#> GSM955001     2  0.6657    0.12673 0.000 0.424 0.340 0.000 0.236
#> GSM955003     3  0.0000    0.83814 0.000 0.000 1.000 0.000 0.000
#> GSM955004     5  0.4235    0.48405 0.000 0.424 0.000 0.000 0.576
#> GSM955005     4  0.0000    0.81293 0.000 0.000 0.000 1.000 0.000
#> GSM955009     2  0.6657    0.12673 0.000 0.424 0.340 0.000 0.236
#> GSM955011     4  0.4287    0.43422 0.460 0.000 0.000 0.540 0.000
#> GSM955012     5  0.3366    0.57302 0.000 0.004 0.000 0.212 0.784
#> GSM955013     4  0.1124    0.79931 0.000 0.004 0.036 0.960 0.000
#> GSM955015     3  0.0000    0.83814 0.000 0.000 1.000 0.000 0.000
#> GSM955017     4  0.3561    0.70889 0.260 0.000 0.000 0.740 0.000
#> GSM955021     3  0.4732    0.61790 0.000 0.076 0.716 0.000 0.208
#> GSM955025     4  0.1753    0.80733 0.000 0.000 0.032 0.936 0.032
#> GSM955028     2  0.4242   -0.35250 0.428 0.572 0.000 0.000 0.000
#> GSM955029     5  0.0000    0.68240 0.000 0.000 0.000 0.000 1.000
#> GSM955030     4  0.0290    0.81459 0.008 0.000 0.000 0.992 0.000
#> GSM955032     4  0.4227    0.36088 0.000 0.000 0.420 0.580 0.000
#> GSM955033     4  0.2806    0.73701 0.152 0.004 0.000 0.844 0.000
#> GSM955034     2  0.4242   -0.35250 0.428 0.572 0.000 0.000 0.000
#> GSM955035     3  0.0000    0.83814 0.000 0.000 1.000 0.000 0.000
#> GSM955036     4  0.0955    0.80517 0.000 0.004 0.000 0.968 0.028
#> GSM955037     4  0.5348    0.63770 0.232 0.112 0.000 0.656 0.000
#> GSM955039     4  0.4161    0.33581 0.000 0.000 0.392 0.608 0.000
#> GSM955041     3  0.4294    0.03193 0.000 0.000 0.532 0.000 0.468
#> GSM955042     1  0.4278   -0.30291 0.548 0.000 0.000 0.452 0.000
#> GSM955045     2  0.8217   -0.00493 0.000 0.396 0.260 0.168 0.176
#> GSM955046     4  0.0000    0.81293 0.000 0.000 0.000 1.000 0.000
#> GSM955047     1  0.3305    0.53861 0.776 0.224 0.000 0.000 0.000
#> GSM955050     4  0.3750    0.72357 0.232 0.000 0.000 0.756 0.012
#> GSM955052     3  0.0000    0.83814 0.000 0.000 1.000 0.000 0.000
#> GSM955053     2  0.4256   -0.35881 0.436 0.564 0.000 0.000 0.000
#> GSM955056     3  0.0000    0.83814 0.000 0.000 1.000 0.000 0.000
#> GSM955058     5  0.0000    0.68240 0.000 0.000 0.000 0.000 1.000
#> GSM955059     4  0.0162    0.81197 0.000 0.004 0.000 0.996 0.000
#> GSM955060     1  0.3210    0.54183 0.788 0.212 0.000 0.000 0.000
#> GSM955061     5  0.0609    0.68220 0.000 0.000 0.000 0.020 0.980
#> GSM955065     1  0.4256    0.38106 0.564 0.436 0.000 0.000 0.000
#> GSM955066     4  0.0162    0.81399 0.004 0.000 0.000 0.996 0.000
#> GSM955067     1  0.4060    0.51084 0.640 0.360 0.000 0.000 0.000
#> GSM955073     3  0.0162    0.83859 0.000 0.000 0.996 0.004 0.000
#> GSM955074     4  0.3480    0.71762 0.248 0.000 0.000 0.752 0.000
#> GSM955076     3  0.0000    0.83814 0.000 0.000 1.000 0.000 0.000
#> GSM955078     3  0.5864    0.25593 0.000 0.056 0.528 0.020 0.396
#> GSM955083     4  0.1410    0.80577 0.060 0.000 0.000 0.940 0.000
#> GSM955084     5  0.4235    0.48405 0.000 0.424 0.000 0.000 0.576
#> GSM955086     3  0.3366    0.63512 0.000 0.000 0.768 0.232 0.000
#> GSM955091     3  0.2230    0.79612 0.000 0.000 0.884 0.000 0.116
#> GSM955092     3  0.5068    0.31848 0.000 0.364 0.592 0.000 0.044
#> GSM955093     3  0.0000    0.83814 0.000 0.000 1.000 0.000 0.000
#> GSM955098     3  0.0000    0.83814 0.000 0.000 1.000 0.000 0.000
#> GSM955099     3  0.2773    0.74998 0.000 0.000 0.836 0.000 0.164
#> GSM955100     1  0.4283   -0.30919 0.544 0.000 0.000 0.456 0.000
#> GSM955103     3  0.3781    0.76608 0.000 0.016 0.828 0.048 0.108
#> GSM955104     4  0.0162    0.81410 0.004 0.000 0.000 0.996 0.000
#> GSM955106     5  0.3585    0.56463 0.000 0.004 0.004 0.220 0.772
#> GSM955000     4  0.3039    0.75744 0.192 0.000 0.000 0.808 0.000
#> GSM955006     1  0.0000    0.51296 1.000 0.000 0.000 0.000 0.000
#> GSM955007     4  0.4847    0.49685 0.000 0.240 0.000 0.692 0.068
#> GSM955010     4  0.3167    0.68970 0.004 0.004 0.172 0.820 0.000
#> GSM955014     1  0.4060    0.51084 0.640 0.360 0.000 0.000 0.000
#> GSM955018     4  0.2127    0.77568 0.000 0.000 0.108 0.892 0.000
#> GSM955020     2  0.4278   -0.36582 0.452 0.548 0.000 0.000 0.000
#> GSM955024     3  0.4349    0.73286 0.000 0.012 0.788 0.088 0.112
#> GSM955026     3  0.0992    0.83380 0.000 0.000 0.968 0.024 0.008
#> GSM955031     3  0.0703    0.83353 0.000 0.000 0.976 0.024 0.000
#> GSM955038     4  0.2414    0.80725 0.080 0.000 0.012 0.900 0.008
#> GSM955040     4  0.4341    0.48708 0.364 0.000 0.008 0.628 0.000
#> GSM955044     5  0.2818    0.59994 0.000 0.000 0.132 0.012 0.856
#> GSM955051     1  0.2690    0.52671 0.844 0.156 0.000 0.000 0.000
#> GSM955055     2  0.6657    0.12673 0.000 0.424 0.340 0.000 0.236
#> GSM955057     1  0.4060    0.51084 0.640 0.360 0.000 0.000 0.000
#> GSM955062     3  0.3442    0.75282 0.000 0.104 0.836 0.000 0.060
#> GSM955063     3  0.0290    0.83840 0.000 0.000 0.992 0.008 0.000
#> GSM955068     3  0.8028   -0.03956 0.000 0.288 0.400 0.112 0.200
#> GSM955069     4  0.3300    0.74639 0.204 0.004 0.000 0.792 0.000
#> GSM955070     3  0.0451    0.83837 0.000 0.000 0.988 0.004 0.008
#> GSM955071     4  0.4489    0.49036 0.420 0.000 0.008 0.572 0.000
#> GSM955077     4  0.1845    0.81046 0.056 0.000 0.016 0.928 0.000
#> GSM955080     5  0.4630    0.50392 0.000 0.396 0.000 0.016 0.588
#> GSM955081     3  0.0290    0.83774 0.000 0.000 0.992 0.008 0.000
#> GSM955082     3  0.2295    0.80607 0.000 0.004 0.900 0.088 0.008
#> GSM955085     3  0.5309    0.28592 0.000 0.364 0.576 0.000 0.060
#> GSM955090     1  0.4060    0.51084 0.640 0.360 0.000 0.000 0.000
#> GSM955094     3  0.3196    0.72231 0.000 0.004 0.804 0.192 0.000
#> GSM955096     3  0.2329    0.76111 0.000 0.000 0.876 0.124 0.000
#> GSM955102     4  0.0510    0.81506 0.016 0.000 0.000 0.984 0.000
#> GSM955105     3  0.0609    0.83689 0.000 0.000 0.980 0.020 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM955002     2  0.3655     0.7614 0.000 0.792 0.096 0.000 0.112 0.000
#> GSM955008     2  0.0000     0.8535 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM955016     1  0.1753     0.5748 0.912 0.000 0.084 0.000 0.004 0.000
#> GSM955019     2  0.1387     0.8325 0.000 0.932 0.000 0.068 0.000 0.000
#> GSM955022     3  0.2562     0.7590 0.000 0.000 0.828 0.000 0.172 0.000
#> GSM955023     2  0.2912     0.7690 0.000 0.816 0.012 0.000 0.172 0.000
#> GSM955027     2  0.5832    -0.1131 0.000 0.428 0.000 0.188 0.384 0.000
#> GSM955043     5  0.2009     0.8271 0.000 0.040 0.004 0.040 0.916 0.000
#> GSM955048     6  0.1845     0.7576 0.072 0.000 0.000 0.004 0.008 0.916
#> GSM955049     2  0.0146     0.8536 0.000 0.996 0.004 0.000 0.000 0.000
#> GSM955054     2  0.0000     0.8535 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM955064     2  0.2762     0.7354 0.000 0.804 0.000 0.196 0.000 0.000
#> GSM955072     4  0.3076     0.6044 0.000 0.240 0.000 0.760 0.000 0.000
#> GSM955075     5  0.2871     0.8459 0.000 0.000 0.004 0.192 0.804 0.000
#> GSM955079     3  0.1812     0.7804 0.000 0.008 0.912 0.080 0.000 0.000
#> GSM955087     6  0.1910     0.7186 0.108 0.000 0.000 0.000 0.000 0.892
#> GSM955088     2  0.3371     0.5914 0.000 0.708 0.292 0.000 0.000 0.000
#> GSM955089     1  0.2051     0.5790 0.896 0.000 0.000 0.004 0.004 0.096
#> GSM955095     4  0.2631     0.7127 0.000 0.012 0.004 0.856 0.128 0.000
#> GSM955097     4  0.0458     0.7777 0.000 0.000 0.000 0.984 0.016 0.000
#> GSM955101     2  0.0363     0.8527 0.000 0.988 0.000 0.012 0.000 0.000
#> GSM954999     3  0.0146     0.7971 0.000 0.000 0.996 0.000 0.004 0.000
#> GSM955001     4  0.0458     0.7892 0.000 0.016 0.000 0.984 0.000 0.000
#> GSM955003     2  0.0000     0.8535 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM955004     4  0.0146     0.7803 0.000 0.000 0.000 0.996 0.004 0.000
#> GSM955005     3  0.0000     0.7980 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM955009     4  0.0458     0.7892 0.000 0.016 0.000 0.984 0.000 0.000
#> GSM955011     1  0.3881     0.0282 0.600 0.000 0.396 0.000 0.004 0.000
#> GSM955012     5  0.0458     0.8020 0.000 0.000 0.016 0.000 0.984 0.000
#> GSM955013     3  0.3210     0.7560 0.000 0.036 0.812 0.000 0.152 0.000
#> GSM955015     2  0.0000     0.8535 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM955017     3  0.3756     0.5646 0.352 0.000 0.644 0.000 0.004 0.000
#> GSM955021     2  0.3464     0.5739 0.000 0.688 0.000 0.312 0.000 0.000
#> GSM955025     3  0.0405     0.7978 0.000 0.004 0.988 0.008 0.000 0.000
#> GSM955028     6  0.0000     0.7965 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM955029     5  0.2697     0.8460 0.000 0.000 0.000 0.188 0.812 0.000
#> GSM955030     3  0.0000     0.7980 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM955032     3  0.3797     0.3667 0.000 0.420 0.580 0.000 0.000 0.000
#> GSM955033     3  0.4300     0.5975 0.208 0.000 0.712 0.000 0.080 0.000
#> GSM955034     6  0.0000     0.7965 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM955035     2  0.0000     0.8535 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM955036     3  0.2697     0.7543 0.000 0.000 0.812 0.000 0.188 0.000
#> GSM955037     6  0.6108     0.1259 0.292 0.000 0.264 0.000 0.004 0.440
#> GSM955039     3  0.5312     0.3335 0.000 0.364 0.524 0.000 0.112 0.000
#> GSM955041     2  0.3866     0.0236 0.000 0.516 0.000 0.000 0.484 0.000
#> GSM955042     1  0.1444     0.5810 0.928 0.000 0.072 0.000 0.000 0.000
#> GSM955045     4  0.3590     0.7087 0.000 0.076 0.004 0.804 0.116 0.000
#> GSM955046     3  0.0000     0.7980 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM955047     1  0.3767     0.4943 0.708 0.000 0.000 0.004 0.012 0.276
#> GSM955050     3  0.3646     0.6355 0.292 0.000 0.700 0.004 0.004 0.000
#> GSM955052     2  0.0000     0.8535 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM955053     6  0.0260     0.7959 0.008 0.000 0.000 0.000 0.000 0.992
#> GSM955056     2  0.0000     0.8535 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM955058     5  0.2697     0.8460 0.000 0.000 0.000 0.188 0.812 0.000
#> GSM955059     3  0.2454     0.7646 0.000 0.000 0.840 0.000 0.160 0.000
#> GSM955060     1  0.3702     0.5072 0.720 0.000 0.000 0.004 0.012 0.264
#> GSM955061     5  0.2340     0.8603 0.000 0.000 0.000 0.148 0.852 0.000
#> GSM955065     6  0.2340     0.6716 0.148 0.000 0.000 0.000 0.000 0.852
#> GSM955066     3  0.0000     0.7980 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM955067     1  0.4268     0.3852 0.556 0.000 0.000 0.004 0.012 0.428
#> GSM955073     2  0.0291     0.8542 0.000 0.992 0.004 0.000 0.004 0.000
#> GSM955074     3  0.3565     0.6249 0.304 0.000 0.692 0.000 0.004 0.000
#> GSM955076     2  0.0000     0.8535 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM955078     2  0.5547     0.2130 0.000 0.508 0.000 0.148 0.344 0.000
#> GSM955083     3  0.2301     0.7514 0.096 0.000 0.884 0.000 0.020 0.000
#> GSM955084     4  0.0146     0.7803 0.000 0.000 0.000 0.996 0.004 0.000
#> GSM955086     2  0.3076     0.6589 0.000 0.760 0.240 0.000 0.000 0.000
#> GSM955091     2  0.2301     0.8115 0.000 0.884 0.000 0.096 0.020 0.000
#> GSM955092     4  0.3371     0.5994 0.000 0.292 0.000 0.708 0.000 0.000
#> GSM955093     2  0.0000     0.8535 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM955098     2  0.0000     0.8535 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM955099     2  0.2491     0.7661 0.000 0.836 0.000 0.164 0.000 0.000
#> GSM955100     1  0.1501     0.5816 0.924 0.000 0.076 0.000 0.000 0.000
#> GSM955103     2  0.3673     0.7728 0.000 0.804 0.008 0.088 0.100 0.000
#> GSM955104     3  0.0000     0.7980 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM955106     5  0.0458     0.8020 0.000 0.000 0.016 0.000 0.984 0.000
#> GSM955000     3  0.2994     0.7116 0.208 0.000 0.788 0.000 0.004 0.000
#> GSM955006     1  0.0146     0.5804 0.996 0.000 0.000 0.000 0.004 0.000
#> GSM955007     3  0.5759     0.1352 0.000 0.000 0.436 0.392 0.172 0.000
#> GSM955010     3  0.4074     0.6739 0.000 0.160 0.748 0.000 0.092 0.000
#> GSM955014     1  0.4184     0.3808 0.556 0.000 0.000 0.004 0.008 0.432
#> GSM955018     3  0.1501     0.7791 0.000 0.076 0.924 0.000 0.000 0.000
#> GSM955020     6  0.1788     0.7561 0.076 0.000 0.000 0.004 0.004 0.916
#> GSM955024     2  0.3893     0.7416 0.000 0.772 0.016 0.040 0.172 0.000
#> GSM955026     2  0.0858     0.8480 0.000 0.968 0.028 0.004 0.000 0.000
#> GSM955031     2  0.0632     0.8490 0.000 0.976 0.024 0.000 0.000 0.000
#> GSM955038     3  0.1946     0.7878 0.072 0.012 0.912 0.000 0.004 0.000
#> GSM955040     1  0.3782     0.4426 0.636 0.000 0.360 0.000 0.004 0.000
#> GSM955044     5  0.4232     0.7580 0.000 0.100 0.000 0.168 0.732 0.000
#> GSM955051     1  0.2915     0.5270 0.808 0.000 0.000 0.000 0.008 0.184
#> GSM955055     4  0.0458     0.7892 0.000 0.016 0.000 0.984 0.000 0.000
#> GSM955057     1  0.4098     0.3635 0.548 0.000 0.000 0.004 0.004 0.444
#> GSM955062     2  0.3023     0.6652 0.000 0.768 0.000 0.232 0.000 0.000
#> GSM955063     2  0.0260     0.8537 0.000 0.992 0.008 0.000 0.000 0.000
#> GSM955068     4  0.4402     0.5274 0.000 0.268 0.060 0.672 0.000 0.000
#> GSM955069     3  0.4065     0.6899 0.220 0.000 0.724 0.000 0.056 0.000
#> GSM955070     2  0.0405     0.8536 0.000 0.988 0.000 0.008 0.004 0.000
#> GSM955071     1  0.4082    -0.0455 0.560 0.004 0.432 0.000 0.004 0.000
#> GSM955077     3  0.1910     0.7348 0.108 0.000 0.892 0.000 0.000 0.000
#> GSM955080     4  0.2003     0.7169 0.000 0.000 0.000 0.884 0.116 0.000
#> GSM955081     2  0.0260     0.8531 0.000 0.992 0.008 0.000 0.000 0.000
#> GSM955082     2  0.3168     0.7636 0.000 0.804 0.024 0.000 0.172 0.000
#> GSM955085     4  0.3620     0.5379 0.000 0.352 0.000 0.648 0.000 0.000
#> GSM955090     1  0.4268     0.3852 0.556 0.000 0.000 0.004 0.012 0.428
#> GSM955094     2  0.3927     0.7235 0.000 0.756 0.072 0.000 0.172 0.000
#> GSM955096     2  0.2178     0.7772 0.000 0.868 0.132 0.000 0.000 0.000
#> GSM955102     3  0.0000     0.7980 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM955105     2  0.0972     0.8490 0.000 0.964 0.008 0.000 0.028 0.000

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

consensus_heatmap(res, k = 2)

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

consensus_heatmap(res, k = 3)

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

consensus_heatmap(res, k = 4)

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

consensus_heatmap(res, k = 5)

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

consensus_heatmap(res, k = 6)

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

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

membership_heatmap(res, k = 2)

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

membership_heatmap(res, k = 3)

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

membership_heatmap(res, k = 4)

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

membership_heatmap(res, k = 5)

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

membership_heatmap(res, k = 6)

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

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

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

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

get_signatures(res, k = 3)

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

get_signatures(res, k = 4)

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

get_signatures(res, k = 5)

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

get_signatures(res, k = 6)

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

Signature heatmaps where rows are not scaled:

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

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

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

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

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

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

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

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

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

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

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk SD-pam-signature_compare

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

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

An example of the output of tb is:

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

The columns in tb are:

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

UMAP plot which shows how samples are separated.

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

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

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

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

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

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

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

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

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

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

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk SD-pam-collect-classes

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

test_to_known_factors(res)
#>          n genotype/variation(p) k
#> SD:pam 106                 0.406 2
#> SD:pam 104                 0.535 3
#> SD:pam 100                 0.558 4
#> SD:pam  77                 0.317 5
#> SD:pam  93                 0.829 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 31589 rows and 108 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 2.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

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

collect_plots(res)

plot of chunk SD-mclust-collect-plots

The plots are:

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

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

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

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

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 1.000           0.995       0.998         0.3468 0.651   0.651
#> 3 3 0.556           0.746       0.812         0.6445 0.745   0.608
#> 4 4 0.604           0.768       0.845         0.1866 0.824   0.603
#> 5 5 0.603           0.744       0.822         0.0820 0.842   0.568
#> 6 6 0.577           0.582       0.771         0.0504 0.915   0.697

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
#> GSM955002     2   0.000      1.000 0.000 1.000
#> GSM955008     2   0.000      1.000 0.000 1.000
#> GSM955016     1   0.494      0.886 0.892 0.108
#> GSM955019     2   0.000      1.000 0.000 1.000
#> GSM955022     2   0.000      1.000 0.000 1.000
#> GSM955023     2   0.000      1.000 0.000 1.000
#> GSM955027     2   0.000      1.000 0.000 1.000
#> GSM955043     2   0.000      1.000 0.000 1.000
#> GSM955048     1   0.000      0.989 1.000 0.000
#> GSM955049     2   0.000      1.000 0.000 1.000
#> GSM955054     2   0.000      1.000 0.000 1.000
#> GSM955064     2   0.000      1.000 0.000 1.000
#> GSM955072     2   0.000      1.000 0.000 1.000
#> GSM955075     2   0.000      1.000 0.000 1.000
#> GSM955079     2   0.000      1.000 0.000 1.000
#> GSM955087     1   0.000      0.989 1.000 0.000
#> GSM955088     2   0.000      1.000 0.000 1.000
#> GSM955089     1   0.000      0.989 1.000 0.000
#> GSM955095     2   0.000      1.000 0.000 1.000
#> GSM955097     2   0.000      1.000 0.000 1.000
#> GSM955101     2   0.000      1.000 0.000 1.000
#> GSM954999     2   0.000      1.000 0.000 1.000
#> GSM955001     2   0.000      1.000 0.000 1.000
#> GSM955003     2   0.000      1.000 0.000 1.000
#> GSM955004     2   0.000      1.000 0.000 1.000
#> GSM955005     2   0.000      1.000 0.000 1.000
#> GSM955009     2   0.000      1.000 0.000 1.000
#> GSM955011     1   0.000      0.989 1.000 0.000
#> GSM955012     2   0.000      1.000 0.000 1.000
#> GSM955013     2   0.000      1.000 0.000 1.000
#> GSM955015     2   0.000      1.000 0.000 1.000
#> GSM955017     1   0.000      0.989 1.000 0.000
#> GSM955021     2   0.000      1.000 0.000 1.000
#> GSM955025     2   0.000      1.000 0.000 1.000
#> GSM955028     1   0.000      0.989 1.000 0.000
#> GSM955029     2   0.000      1.000 0.000 1.000
#> GSM955030     2   0.000      1.000 0.000 1.000
#> GSM955032     2   0.000      1.000 0.000 1.000
#> GSM955033     2   0.000      1.000 0.000 1.000
#> GSM955034     1   0.000      0.989 1.000 0.000
#> GSM955035     2   0.000      1.000 0.000 1.000
#> GSM955036     2   0.000      1.000 0.000 1.000
#> GSM955037     1   0.000      0.989 1.000 0.000
#> GSM955039     2   0.000      1.000 0.000 1.000
#> GSM955041     2   0.000      1.000 0.000 1.000
#> GSM955042     1   0.506      0.881 0.888 0.112
#> GSM955045     2   0.000      1.000 0.000 1.000
#> GSM955046     2   0.000      1.000 0.000 1.000
#> GSM955047     1   0.000      0.989 1.000 0.000
#> GSM955050     2   0.000      1.000 0.000 1.000
#> GSM955052     2   0.000      1.000 0.000 1.000
#> GSM955053     1   0.000      0.989 1.000 0.000
#> GSM955056     2   0.000      1.000 0.000 1.000
#> GSM955058     2   0.000      1.000 0.000 1.000
#> GSM955059     2   0.000      1.000 0.000 1.000
#> GSM955060     1   0.000      0.989 1.000 0.000
#> GSM955061     2   0.000      1.000 0.000 1.000
#> GSM955065     1   0.000      0.989 1.000 0.000
#> GSM955066     2   0.000      1.000 0.000 1.000
#> GSM955067     1   0.000      0.989 1.000 0.000
#> GSM955073     2   0.000      1.000 0.000 1.000
#> GSM955074     1   0.000      0.989 1.000 0.000
#> GSM955076     2   0.000      1.000 0.000 1.000
#> GSM955078     2   0.000      1.000 0.000 1.000
#> GSM955083     2   0.000      1.000 0.000 1.000
#> GSM955084     2   0.000      1.000 0.000 1.000
#> GSM955086     2   0.000      1.000 0.000 1.000
#> GSM955091     2   0.000      1.000 0.000 1.000
#> GSM955092     2   0.000      1.000 0.000 1.000
#> GSM955093     2   0.000      1.000 0.000 1.000
#> GSM955098     2   0.000      1.000 0.000 1.000
#> GSM955099     2   0.000      1.000 0.000 1.000
#> GSM955100     1   0.242      0.956 0.960 0.040
#> GSM955103     2   0.000      1.000 0.000 1.000
#> GSM955104     2   0.000      1.000 0.000 1.000
#> GSM955106     2   0.000      1.000 0.000 1.000
#> GSM955000     1   0.000      0.989 1.000 0.000
#> GSM955006     1   0.000      0.989 1.000 0.000
#> GSM955007     2   0.000      1.000 0.000 1.000
#> GSM955010     2   0.000      1.000 0.000 1.000
#> GSM955014     1   0.000      0.989 1.000 0.000
#> GSM955018     2   0.000      1.000 0.000 1.000
#> GSM955020     1   0.000      0.989 1.000 0.000
#> GSM955024     2   0.000      1.000 0.000 1.000
#> GSM955026     2   0.000      1.000 0.000 1.000
#> GSM955031     2   0.000      1.000 0.000 1.000
#> GSM955038     2   0.000      1.000 0.000 1.000
#> GSM955040     2   0.000      1.000 0.000 1.000
#> GSM955044     2   0.000      1.000 0.000 1.000
#> GSM955051     1   0.000      0.989 1.000 0.000
#> GSM955055     2   0.000      1.000 0.000 1.000
#> GSM955057     1   0.000      0.989 1.000 0.000
#> GSM955062     2   0.000      1.000 0.000 1.000
#> GSM955063     2   0.000      1.000 0.000 1.000
#> GSM955068     2   0.000      1.000 0.000 1.000
#> GSM955069     2   0.000      1.000 0.000 1.000
#> GSM955070     2   0.000      1.000 0.000 1.000
#> GSM955071     2   0.000      1.000 0.000 1.000
#> GSM955077     2   0.000      1.000 0.000 1.000
#> GSM955080     2   0.000      1.000 0.000 1.000
#> GSM955081     2   0.000      1.000 0.000 1.000
#> GSM955082     2   0.000      1.000 0.000 1.000
#> GSM955085     2   0.000      1.000 0.000 1.000
#> GSM955090     1   0.000      0.989 1.000 0.000
#> GSM955094     2   0.000      1.000 0.000 1.000
#> GSM955096     2   0.000      1.000 0.000 1.000
#> GSM955102     2   0.000      1.000 0.000 1.000
#> GSM955105     2   0.000      1.000 0.000 1.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1    p2    p3
#> GSM955002     2  0.3686      0.720 0.000 0.860 0.140
#> GSM955008     3  0.6309      0.472 0.000 0.496 0.504
#> GSM955016     1  0.3237      0.923 0.912 0.032 0.056
#> GSM955019     2  0.1643      0.764 0.000 0.956 0.044
#> GSM955022     2  0.6307     -0.432 0.000 0.512 0.488
#> GSM955023     2  0.5178      0.547 0.000 0.744 0.256
#> GSM955027     2  0.0237      0.771 0.000 0.996 0.004
#> GSM955043     2  0.0424      0.771 0.000 0.992 0.008
#> GSM955048     1  0.0000      0.982 1.000 0.000 0.000
#> GSM955049     2  0.3686      0.754 0.000 0.860 0.140
#> GSM955054     2  0.4931      0.593 0.000 0.768 0.232
#> GSM955064     2  0.2878      0.749 0.000 0.904 0.096
#> GSM955072     2  0.0747      0.768 0.000 0.984 0.016
#> GSM955075     2  0.4654      0.584 0.000 0.792 0.208
#> GSM955079     3  0.5706      0.891 0.000 0.320 0.680
#> GSM955087     1  0.0237      0.981 0.996 0.000 0.004
#> GSM955088     3  0.5363      0.920 0.000 0.276 0.724
#> GSM955089     1  0.0000      0.982 1.000 0.000 0.000
#> GSM955095     2  0.3116      0.743 0.000 0.892 0.108
#> GSM955097     2  0.3038      0.747 0.000 0.896 0.104
#> GSM955101     3  0.6252      0.651 0.000 0.444 0.556
#> GSM954999     2  0.6302     -0.282 0.000 0.520 0.480
#> GSM955001     2  0.2165      0.763 0.000 0.936 0.064
#> GSM955003     2  0.5216      0.539 0.000 0.740 0.260
#> GSM955004     2  0.0747      0.768 0.000 0.984 0.016
#> GSM955005     3  0.5254      0.917 0.000 0.264 0.736
#> GSM955009     2  0.0592      0.769 0.000 0.988 0.012
#> GSM955011     1  0.1964      0.952 0.944 0.000 0.056
#> GSM955012     2  0.5016      0.606 0.000 0.760 0.240
#> GSM955013     2  0.6079      0.179 0.000 0.612 0.388
#> GSM955015     2  0.4931      0.619 0.000 0.768 0.232
#> GSM955017     1  0.0237      0.981 0.996 0.000 0.004
#> GSM955021     2  0.2261      0.763 0.000 0.932 0.068
#> GSM955025     2  0.0747      0.770 0.000 0.984 0.016
#> GSM955028     1  0.0237      0.981 0.996 0.000 0.004
#> GSM955029     2  0.4605      0.582 0.000 0.796 0.204
#> GSM955030     3  0.5216      0.916 0.000 0.260 0.740
#> GSM955032     3  0.5733      0.901 0.000 0.324 0.676
#> GSM955033     2  0.4121      0.709 0.000 0.832 0.168
#> GSM955034     1  0.0237      0.981 0.996 0.000 0.004
#> GSM955035     2  0.2796      0.765 0.000 0.908 0.092
#> GSM955036     3  0.5216      0.916 0.000 0.260 0.740
#> GSM955037     1  0.1964      0.957 0.944 0.000 0.056
#> GSM955039     2  0.6291     -0.348 0.000 0.532 0.468
#> GSM955041     2  0.4504      0.650 0.000 0.804 0.196
#> GSM955042     1  0.3356      0.919 0.908 0.036 0.056
#> GSM955045     2  0.3116      0.741 0.000 0.892 0.108
#> GSM955046     3  0.5678      0.906 0.000 0.316 0.684
#> GSM955047     1  0.0000      0.982 1.000 0.000 0.000
#> GSM955050     2  0.4702      0.662 0.000 0.788 0.212
#> GSM955052     3  0.5706      0.904 0.000 0.320 0.680
#> GSM955053     1  0.0237      0.981 0.996 0.000 0.004
#> GSM955056     2  0.6280     -0.310 0.000 0.540 0.460
#> GSM955058     2  0.4654      0.584 0.000 0.792 0.208
#> GSM955059     3  0.5254      0.918 0.000 0.264 0.736
#> GSM955060     1  0.0000      0.982 1.000 0.000 0.000
#> GSM955061     2  0.4654      0.584 0.000 0.792 0.208
#> GSM955065     1  0.0237      0.981 0.996 0.000 0.004
#> GSM955066     3  0.5216      0.916 0.000 0.260 0.740
#> GSM955067     1  0.0000      0.982 1.000 0.000 0.000
#> GSM955073     3  0.5678      0.906 0.000 0.316 0.684
#> GSM955074     1  0.1964      0.952 0.944 0.000 0.056
#> GSM955076     2  0.1031      0.774 0.000 0.976 0.024
#> GSM955078     2  0.0747      0.768 0.000 0.984 0.016
#> GSM955083     2  0.5397      0.547 0.000 0.720 0.280
#> GSM955084     2  0.0747      0.768 0.000 0.984 0.016
#> GSM955086     3  0.5497      0.911 0.000 0.292 0.708
#> GSM955091     2  0.1643      0.753 0.000 0.956 0.044
#> GSM955092     2  0.4062      0.735 0.000 0.836 0.164
#> GSM955093     3  0.5678      0.906 0.000 0.316 0.684
#> GSM955098     2  0.0747      0.768 0.000 0.984 0.016
#> GSM955099     2  0.1643      0.753 0.000 0.956 0.044
#> GSM955100     1  0.3406      0.916 0.904 0.028 0.068
#> GSM955103     2  0.5327      0.511 0.000 0.728 0.272
#> GSM955104     3  0.5216      0.916 0.000 0.260 0.740
#> GSM955106     2  0.1163      0.772 0.000 0.972 0.028
#> GSM955000     1  0.0237      0.981 0.996 0.000 0.004
#> GSM955006     1  0.0000      0.982 1.000 0.000 0.000
#> GSM955007     3  0.5810      0.888 0.000 0.336 0.664
#> GSM955010     3  0.5216      0.916 0.000 0.260 0.740
#> GSM955014     1  0.0000      0.982 1.000 0.000 0.000
#> GSM955018     3  0.5529      0.916 0.000 0.296 0.704
#> GSM955020     1  0.0000      0.982 1.000 0.000 0.000
#> GSM955024     2  0.5058      0.571 0.000 0.756 0.244
#> GSM955026     2  0.0592      0.769 0.000 0.988 0.012
#> GSM955031     2  0.6309     -0.362 0.000 0.504 0.496
#> GSM955038     2  0.2066      0.745 0.000 0.940 0.060
#> GSM955040     2  0.5810      0.399 0.000 0.664 0.336
#> GSM955044     2  0.0747      0.768 0.000 0.984 0.016
#> GSM955051     1  0.0000      0.982 1.000 0.000 0.000
#> GSM955055     2  0.2066      0.762 0.000 0.940 0.060
#> GSM955057     1  0.0000      0.982 1.000 0.000 0.000
#> GSM955062     2  0.4062      0.739 0.000 0.836 0.164
#> GSM955063     3  0.5678      0.906 0.000 0.316 0.684
#> GSM955068     2  0.0747      0.768 0.000 0.984 0.016
#> GSM955069     3  0.5216      0.916 0.000 0.260 0.740
#> GSM955070     2  0.2165      0.766 0.000 0.936 0.064
#> GSM955071     3  0.5591      0.896 0.000 0.304 0.696
#> GSM955077     2  0.3412      0.740 0.000 0.876 0.124
#> GSM955080     2  0.1529      0.770 0.000 0.960 0.040
#> GSM955081     2  0.5363      0.501 0.000 0.724 0.276
#> GSM955082     2  0.5465      0.479 0.000 0.712 0.288
#> GSM955085     2  0.1753      0.765 0.000 0.952 0.048
#> GSM955090     1  0.0000      0.982 1.000 0.000 0.000
#> GSM955094     2  0.1753      0.771 0.000 0.952 0.048
#> GSM955096     3  0.5810      0.888 0.000 0.336 0.664
#> GSM955102     3  0.5216      0.916 0.000 0.260 0.740
#> GSM955105     3  0.5291      0.917 0.000 0.268 0.732

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM955002     2  0.6327      0.664 0.000 0.648 0.228 0.124
#> GSM955008     3  0.3390      0.818 0.000 0.132 0.852 0.016
#> GSM955016     1  0.1677      0.946 0.948 0.000 0.040 0.012
#> GSM955019     2  0.3978      0.705 0.000 0.836 0.056 0.108
#> GSM955022     3  0.2412      0.854 0.000 0.084 0.908 0.008
#> GSM955023     3  0.5990      0.508 0.000 0.284 0.644 0.072
#> GSM955027     2  0.2699      0.738 0.000 0.904 0.068 0.028
#> GSM955043     2  0.5241      0.637 0.008 0.760 0.068 0.164
#> GSM955048     1  0.0000      0.977 1.000 0.000 0.000 0.000
#> GSM955049     2  0.6418      0.634 0.000 0.644 0.216 0.140
#> GSM955054     2  0.5823      0.514 0.000 0.608 0.348 0.044
#> GSM955064     2  0.6797      0.438 0.000 0.536 0.356 0.108
#> GSM955072     2  0.1953      0.728 0.012 0.940 0.044 0.004
#> GSM955075     4  0.4319      0.963 0.000 0.228 0.012 0.760
#> GSM955079     3  0.1557      0.859 0.000 0.056 0.944 0.000
#> GSM955087     1  0.1211      0.965 0.960 0.000 0.000 0.040
#> GSM955088     3  0.1004      0.854 0.000 0.024 0.972 0.004
#> GSM955089     1  0.0000      0.977 1.000 0.000 0.000 0.000
#> GSM955095     2  0.6486      0.546 0.012 0.612 0.308 0.068
#> GSM955097     2  0.7348      0.379 0.036 0.600 0.112 0.252
#> GSM955101     3  0.2466      0.845 0.000 0.096 0.900 0.004
#> GSM954999     3  0.5624      0.610 0.032 0.244 0.704 0.020
#> GSM955001     2  0.4017      0.680 0.000 0.828 0.044 0.128
#> GSM955003     2  0.5487      0.388 0.000 0.580 0.400 0.020
#> GSM955004     2  0.4412      0.615 0.016 0.820 0.036 0.128
#> GSM955005     3  0.0779      0.854 0.000 0.016 0.980 0.004
#> GSM955009     2  0.1953      0.728 0.012 0.940 0.044 0.004
#> GSM955011     1  0.1256      0.958 0.964 0.000 0.028 0.008
#> GSM955012     4  0.4059      0.977 0.000 0.200 0.012 0.788
#> GSM955013     3  0.4658      0.708 0.012 0.216 0.760 0.012
#> GSM955015     2  0.7003      0.246 0.000 0.460 0.424 0.116
#> GSM955017     1  0.0000      0.977 1.000 0.000 0.000 0.000
#> GSM955021     2  0.4022      0.735 0.000 0.836 0.096 0.068
#> GSM955025     2  0.2125      0.727 0.012 0.932 0.052 0.004
#> GSM955028     1  0.1211      0.965 0.960 0.000 0.000 0.040
#> GSM955029     4  0.4175      0.982 0.000 0.212 0.012 0.776
#> GSM955030     3  0.0592      0.844 0.000 0.000 0.984 0.016
#> GSM955032     3  0.1902      0.856 0.000 0.064 0.932 0.004
#> GSM955033     2  0.5531      0.671 0.012 0.716 0.228 0.044
#> GSM955034     1  0.1211      0.965 0.960 0.000 0.000 0.040
#> GSM955035     2  0.5483      0.684 0.000 0.736 0.128 0.136
#> GSM955036     3  0.4739      0.753 0.032 0.136 0.804 0.028
#> GSM955037     1  0.2759      0.926 0.904 0.000 0.052 0.044
#> GSM955039     3  0.3708      0.806 0.000 0.148 0.832 0.020
#> GSM955041     3  0.6637      0.305 0.000 0.368 0.540 0.092
#> GSM955042     1  0.1677      0.946 0.948 0.000 0.040 0.012
#> GSM955045     2  0.6374      0.385 0.000 0.556 0.372 0.072
#> GSM955046     3  0.1509      0.853 0.008 0.020 0.960 0.012
#> GSM955047     1  0.0000      0.977 1.000 0.000 0.000 0.000
#> GSM955050     2  0.4001      0.719 0.036 0.840 0.116 0.008
#> GSM955052     3  0.1807      0.858 0.000 0.052 0.940 0.008
#> GSM955053     1  0.1211      0.965 0.960 0.000 0.000 0.040
#> GSM955056     3  0.3863      0.796 0.000 0.144 0.828 0.028
#> GSM955058     4  0.4137      0.983 0.000 0.208 0.012 0.780
#> GSM955059     3  0.0937      0.850 0.000 0.012 0.976 0.012
#> GSM955060     1  0.0000      0.977 1.000 0.000 0.000 0.000
#> GSM955061     4  0.4059      0.979 0.000 0.200 0.012 0.788
#> GSM955065     1  0.1211      0.965 0.960 0.000 0.000 0.040
#> GSM955066     3  0.0592      0.844 0.000 0.000 0.984 0.016
#> GSM955067     1  0.0188      0.976 0.996 0.000 0.000 0.004
#> GSM955073     3  0.1388      0.854 0.000 0.028 0.960 0.012
#> GSM955074     1  0.1284      0.960 0.964 0.000 0.024 0.012
#> GSM955076     2  0.2271      0.730 0.012 0.928 0.052 0.008
#> GSM955078     2  0.2262      0.719 0.012 0.932 0.040 0.016
#> GSM955083     2  0.7176      0.374 0.032 0.516 0.388 0.064
#> GSM955084     2  0.3396      0.677 0.016 0.884 0.036 0.064
#> GSM955086     3  0.1890      0.859 0.000 0.056 0.936 0.008
#> GSM955091     2  0.3749      0.670 0.000 0.840 0.032 0.128
#> GSM955092     2  0.6951      0.535 0.000 0.556 0.304 0.140
#> GSM955093     3  0.1284      0.853 0.000 0.024 0.964 0.012
#> GSM955098     2  0.2075      0.727 0.016 0.936 0.044 0.004
#> GSM955099     2  0.3653      0.668 0.000 0.844 0.028 0.128
#> GSM955100     1  0.1722      0.941 0.944 0.000 0.048 0.008
#> GSM955103     3  0.5490      0.640 0.004 0.268 0.688 0.040
#> GSM955104     3  0.1262      0.845 0.008 0.008 0.968 0.016
#> GSM955106     2  0.6058      0.517 0.004 0.672 0.084 0.240
#> GSM955000     1  0.0336      0.975 0.992 0.000 0.000 0.008
#> GSM955006     1  0.0000      0.977 1.000 0.000 0.000 0.000
#> GSM955007     3  0.1489      0.857 0.000 0.044 0.952 0.004
#> GSM955010     3  0.1394      0.843 0.012 0.008 0.964 0.016
#> GSM955014     1  0.0000      0.977 1.000 0.000 0.000 0.000
#> GSM955018     3  0.1284      0.853 0.000 0.024 0.964 0.012
#> GSM955020     1  0.0000      0.977 1.000 0.000 0.000 0.000
#> GSM955024     3  0.5773      0.519 0.000 0.320 0.632 0.048
#> GSM955026     2  0.1985      0.727 0.016 0.940 0.040 0.004
#> GSM955031     2  0.4957      0.688 0.040 0.764 0.188 0.008
#> GSM955038     2  0.3130      0.709 0.024 0.892 0.072 0.012
#> GSM955040     2  0.5391      0.665 0.040 0.716 0.236 0.008
#> GSM955044     2  0.3385      0.725 0.012 0.884 0.056 0.048
#> GSM955051     1  0.0000      0.977 1.000 0.000 0.000 0.000
#> GSM955055     2  0.4259      0.690 0.000 0.816 0.056 0.128
#> GSM955057     1  0.0000      0.977 1.000 0.000 0.000 0.000
#> GSM955062     2  0.6893      0.524 0.000 0.564 0.300 0.136
#> GSM955063     3  0.1284      0.853 0.000 0.024 0.964 0.012
#> GSM955068     2  0.1985      0.727 0.016 0.940 0.040 0.004
#> GSM955069     3  0.0592      0.843 0.000 0.000 0.984 0.016
#> GSM955070     2  0.5042      0.687 0.000 0.768 0.096 0.136
#> GSM955071     3  0.4082      0.771 0.020 0.152 0.820 0.008
#> GSM955077     2  0.3315      0.731 0.016 0.872 0.104 0.008
#> GSM955080     2  0.5716      0.576 0.000 0.700 0.088 0.212
#> GSM955081     3  0.5028      0.320 0.000 0.400 0.596 0.004
#> GSM955082     3  0.4360      0.693 0.000 0.248 0.744 0.008
#> GSM955085     2  0.3842      0.679 0.000 0.836 0.036 0.128
#> GSM955090     1  0.0188      0.976 0.996 0.000 0.000 0.004
#> GSM955094     2  0.3080      0.740 0.000 0.880 0.096 0.024
#> GSM955096     3  0.2412      0.848 0.000 0.084 0.908 0.008
#> GSM955102     3  0.1724      0.828 0.032 0.000 0.948 0.020
#> GSM955105     3  0.1388      0.857 0.000 0.028 0.960 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
#> GSM955002     2  0.4676     0.3072 0.000 0.592 0.392 0.012 0.004
#> GSM955008     3  0.4455     0.7386 0.000 0.128 0.788 0.044 0.040
#> GSM955016     1  0.3671     0.8962 0.856 0.024 0.012 0.056 0.052
#> GSM955019     2  0.2535     0.7649 0.000 0.892 0.032 0.076 0.000
#> GSM955022     3  0.2915     0.7874 0.004 0.092 0.876 0.024 0.004
#> GSM955023     2  0.4928     0.4137 0.000 0.596 0.376 0.020 0.008
#> GSM955027     2  0.3452     0.7715 0.000 0.856 0.068 0.056 0.020
#> GSM955043     2  0.7397     0.2994 0.008 0.524 0.096 0.104 0.268
#> GSM955048     1  0.0579     0.9381 0.984 0.000 0.000 0.008 0.008
#> GSM955049     2  0.1478     0.7918 0.000 0.936 0.064 0.000 0.000
#> GSM955054     3  0.6356     0.3345 0.000 0.336 0.548 0.072 0.044
#> GSM955064     2  0.3569     0.7529 0.000 0.816 0.152 0.028 0.004
#> GSM955072     4  0.4568     0.7298 0.008 0.248 0.004 0.716 0.024
#> GSM955075     5  0.2850     0.9980 0.000 0.092 0.000 0.036 0.872
#> GSM955079     3  0.0727     0.8041 0.000 0.004 0.980 0.012 0.004
#> GSM955087     1  0.2506     0.9178 0.904 0.008 0.000 0.052 0.036
#> GSM955088     3  0.0833     0.8038 0.000 0.004 0.976 0.016 0.004
#> GSM955089     1  0.2067     0.9332 0.924 0.004 0.000 0.044 0.028
#> GSM955095     3  0.7395     0.4381 0.008 0.220 0.540 0.156 0.076
#> GSM955097     4  0.8195     0.3358 0.028 0.072 0.296 0.428 0.176
#> GSM955101     3  0.2897     0.7919 0.000 0.072 0.884 0.024 0.020
#> GSM954999     3  0.6652     0.5625 0.024 0.068 0.624 0.224 0.060
#> GSM955001     2  0.1469     0.7845 0.000 0.948 0.036 0.016 0.000
#> GSM955003     3  0.5944     0.6032 0.000 0.212 0.656 0.088 0.044
#> GSM955004     4  0.5204     0.7008 0.012 0.120 0.008 0.732 0.128
#> GSM955005     3  0.1187     0.8054 0.004 0.004 0.964 0.024 0.004
#> GSM955009     4  0.3561     0.7838 0.008 0.188 0.008 0.796 0.000
#> GSM955011     1  0.2803     0.9023 0.900 0.016 0.048 0.020 0.016
#> GSM955012     5  0.2850     0.9980 0.000 0.092 0.000 0.036 0.872
#> GSM955013     3  0.4834     0.7352 0.008 0.080 0.776 0.108 0.028
#> GSM955015     2  0.5064     0.6503 0.000 0.696 0.240 0.032 0.032
#> GSM955017     1  0.0960     0.9374 0.972 0.016 0.000 0.008 0.004
#> GSM955021     2  0.5913     0.6616 0.008 0.684 0.160 0.116 0.032
#> GSM955025     4  0.3825     0.7785 0.028 0.136 0.020 0.816 0.000
#> GSM955028     1  0.2506     0.9178 0.904 0.008 0.000 0.052 0.036
#> GSM955029     5  0.2850     0.9980 0.000 0.092 0.000 0.036 0.872
#> GSM955030     3  0.1202     0.8039 0.004 0.000 0.960 0.032 0.004
#> GSM955032     3  0.1173     0.8066 0.000 0.020 0.964 0.012 0.004
#> GSM955033     3  0.7401     0.3899 0.016 0.128 0.532 0.260 0.064
#> GSM955034     1  0.2283     0.9199 0.916 0.008 0.000 0.040 0.036
#> GSM955035     2  0.1792     0.7927 0.000 0.916 0.084 0.000 0.000
#> GSM955036     3  0.5679     0.6698 0.024 0.020 0.708 0.168 0.080
#> GSM955037     1  0.4040     0.8884 0.836 0.024 0.060 0.064 0.016
#> GSM955039     3  0.3344     0.7856 0.004 0.080 0.860 0.048 0.008
#> GSM955041     3  0.5766     0.5765 0.004 0.260 0.648 0.048 0.040
#> GSM955042     1  0.3634     0.8986 0.860 0.024 0.016 0.048 0.052
#> GSM955045     2  0.5208     0.6666 0.004 0.712 0.208 0.044 0.032
#> GSM955046     3  0.2027     0.8021 0.000 0.040 0.928 0.024 0.008
#> GSM955047     1  0.0000     0.9390 1.000 0.000 0.000 0.000 0.000
#> GSM955050     4  0.6838     0.5194 0.040 0.108 0.276 0.564 0.012
#> GSM955052     3  0.1949     0.8020 0.000 0.040 0.932 0.016 0.012
#> GSM955053     1  0.2506     0.9178 0.904 0.008 0.000 0.052 0.036
#> GSM955056     3  0.4554     0.7215 0.000 0.144 0.776 0.044 0.036
#> GSM955058     5  0.2850     0.9980 0.000 0.092 0.000 0.036 0.872
#> GSM955059     3  0.0671     0.8021 0.000 0.000 0.980 0.016 0.004
#> GSM955060     1  0.0162     0.9388 0.996 0.000 0.000 0.004 0.000
#> GSM955061     5  0.2871     0.9919 0.000 0.088 0.000 0.040 0.872
#> GSM955065     1  0.2506     0.9178 0.904 0.008 0.000 0.052 0.036
#> GSM955066     3  0.1329     0.8037 0.008 0.000 0.956 0.032 0.004
#> GSM955067     1  0.1708     0.9332 0.944 0.004 0.004 0.032 0.016
#> GSM955073     3  0.1442     0.8033 0.000 0.032 0.952 0.012 0.004
#> GSM955074     1  0.3046     0.9123 0.880 0.020 0.000 0.052 0.048
#> GSM955076     4  0.3966     0.7595 0.008 0.224 0.012 0.756 0.000
#> GSM955078     4  0.5104     0.7098 0.008 0.224 0.004 0.700 0.064
#> GSM955083     3  0.7381     0.3997 0.028 0.096 0.540 0.272 0.064
#> GSM955084     4  0.4630     0.7565 0.012 0.132 0.008 0.776 0.072
#> GSM955086     3  0.0960     0.8049 0.000 0.008 0.972 0.016 0.004
#> GSM955091     2  0.1597     0.7586 0.000 0.940 0.012 0.048 0.000
#> GSM955092     2  0.2787     0.7791 0.000 0.880 0.088 0.004 0.028
#> GSM955093     3  0.0833     0.8008 0.000 0.004 0.976 0.016 0.004
#> GSM955098     4  0.3403     0.7897 0.012 0.160 0.008 0.820 0.000
#> GSM955099     2  0.1774     0.7629 0.000 0.932 0.016 0.052 0.000
#> GSM955100     1  0.3554     0.8431 0.852 0.016 0.096 0.020 0.016
#> GSM955103     3  0.4516     0.7427 0.004 0.128 0.788 0.052 0.028
#> GSM955104     3  0.2235     0.8048 0.004 0.040 0.920 0.032 0.004
#> GSM955106     3  0.8319    -0.1098 0.000 0.136 0.328 0.236 0.300
#> GSM955000     1  0.1074     0.9378 0.968 0.016 0.000 0.012 0.004
#> GSM955006     1  0.1617     0.9353 0.948 0.012 0.020 0.000 0.020
#> GSM955007     3  0.2233     0.7962 0.000 0.080 0.904 0.016 0.000
#> GSM955010     3  0.1644     0.8036 0.012 0.004 0.948 0.028 0.008
#> GSM955014     1  0.0566     0.9390 0.984 0.000 0.000 0.004 0.012
#> GSM955018     3  0.0671     0.8021 0.000 0.000 0.980 0.016 0.004
#> GSM955020     1  0.2125     0.9327 0.920 0.004 0.000 0.052 0.024
#> GSM955024     3  0.5322     0.3766 0.000 0.372 0.580 0.036 0.012
#> GSM955026     4  0.3333     0.7896 0.008 0.164 0.008 0.820 0.000
#> GSM955031     4  0.6317     0.4346 0.040 0.076 0.328 0.556 0.000
#> GSM955038     4  0.3790     0.7627 0.028 0.112 0.024 0.832 0.004
#> GSM955040     3  0.7457     0.1320 0.064 0.104 0.468 0.348 0.016
#> GSM955044     2  0.6655     0.3501 0.008 0.596 0.040 0.236 0.120
#> GSM955051     1  0.0000     0.9390 1.000 0.000 0.000 0.000 0.000
#> GSM955055     2  0.1836     0.7831 0.000 0.932 0.036 0.032 0.000
#> GSM955057     1  0.0579     0.9381 0.984 0.000 0.000 0.008 0.008
#> GSM955062     2  0.2074     0.7875 0.000 0.896 0.104 0.000 0.000
#> GSM955063     3  0.1525     0.8038 0.000 0.036 0.948 0.012 0.004
#> GSM955068     4  0.3373     0.7900 0.008 0.168 0.008 0.816 0.000
#> GSM955069     3  0.1243     0.8040 0.000 0.008 0.960 0.028 0.004
#> GSM955070     2  0.1522     0.7873 0.000 0.944 0.044 0.012 0.000
#> GSM955071     3  0.3522     0.7742 0.020 0.020 0.844 0.112 0.004
#> GSM955077     4  0.5423     0.7022 0.032 0.104 0.136 0.724 0.004
#> GSM955080     3  0.8450    -0.0719 0.000 0.196 0.324 0.192 0.288
#> GSM955081     3  0.3569     0.7686 0.000 0.104 0.828 0.068 0.000
#> GSM955082     3  0.3795     0.7254 0.004 0.184 0.788 0.024 0.000
#> GSM955085     2  0.1568     0.7703 0.000 0.944 0.020 0.036 0.000
#> GSM955090     1  0.2267     0.9314 0.916 0.008 0.000 0.048 0.028
#> GSM955094     2  0.3690     0.7397 0.000 0.832 0.092 0.068 0.008
#> GSM955096     3  0.1588     0.8073 0.000 0.028 0.948 0.016 0.008
#> GSM955102     3  0.1686     0.7997 0.012 0.004 0.944 0.036 0.004
#> GSM955105     3  0.1116     0.8046 0.000 0.004 0.964 0.028 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
#> GSM955002     2  0.4413    0.16363 0.000 0.620 0.352 0.016 0.008 0.004
#> GSM955008     3  0.6360   -0.50252 0.000 0.236 0.408 0.016 0.000 0.340
#> GSM955016     1  0.4411    0.82310 0.704 0.012 0.020 0.000 0.016 0.248
#> GSM955019     2  0.2311    0.55042 0.000 0.880 0.016 0.104 0.000 0.000
#> GSM955022     3  0.4372    0.56719 0.000 0.224 0.720 0.024 0.028 0.004
#> GSM955023     2  0.5021    0.01992 0.000 0.536 0.408 0.024 0.000 0.032
#> GSM955027     2  0.4509    0.47716 0.000 0.764 0.056 0.060 0.116 0.004
#> GSM955043     5  0.6129    0.08175 0.000 0.432 0.060 0.068 0.436 0.004
#> GSM955048     1  0.0717    0.88369 0.976 0.000 0.000 0.008 0.000 0.016
#> GSM955049     2  0.0909    0.59000 0.000 0.968 0.020 0.000 0.000 0.012
#> GSM955054     6  0.5658    0.69089 0.000 0.380 0.112 0.012 0.000 0.496
#> GSM955064     2  0.3553    0.53249 0.000 0.820 0.096 0.016 0.068 0.000
#> GSM955072     4  0.4327    0.56910 0.004 0.260 0.000 0.688 0.048 0.000
#> GSM955075     5  0.1341    0.69417 0.000 0.028 0.000 0.024 0.948 0.000
#> GSM955079     3  0.0665    0.71893 0.000 0.008 0.980 0.004 0.000 0.008
#> GSM955087     1  0.2364    0.86191 0.904 0.004 0.000 0.012 0.036 0.044
#> GSM955088     3  0.0603    0.71726 0.000 0.004 0.980 0.000 0.000 0.016
#> GSM955089     1  0.1663    0.87898 0.912 0.000 0.000 0.000 0.000 0.088
#> GSM955095     3  0.7655    0.23300 0.000 0.272 0.432 0.132 0.124 0.040
#> GSM955097     3  0.7803   -0.23992 0.032 0.008 0.352 0.336 0.196 0.076
#> GSM955101     3  0.5232    0.33834 0.000 0.200 0.644 0.012 0.000 0.144
#> GSM954999     3  0.7042    0.51311 0.028 0.064 0.608 0.132 0.088 0.080
#> GSM955001     2  0.0520    0.58642 0.000 0.984 0.008 0.000 0.000 0.008
#> GSM955003     6  0.5978    0.78180 0.000 0.324 0.160 0.016 0.000 0.500
#> GSM955004     4  0.4478    0.56331 0.008 0.060 0.000 0.712 0.216 0.004
#> GSM955005     3  0.1026    0.71995 0.000 0.008 0.968 0.008 0.004 0.012
#> GSM955009     4  0.2805    0.65446 0.000 0.184 0.004 0.812 0.000 0.000
#> GSM955011     1  0.4322    0.85157 0.760 0.000 0.052 0.028 0.004 0.156
#> GSM955012     5  0.1492    0.68750 0.000 0.036 0.000 0.024 0.940 0.000
#> GSM955013     3  0.5066    0.64119 0.000 0.076 0.744 0.076 0.076 0.028
#> GSM955015     2  0.4868   -0.05116 0.000 0.632 0.060 0.012 0.000 0.296
#> GSM955017     1  0.2531    0.88984 0.860 0.000 0.000 0.004 0.008 0.128
#> GSM955021     2  0.6036   -0.38379 0.000 0.524 0.084 0.060 0.000 0.332
#> GSM955025     4  0.3079    0.64953 0.008 0.028 0.128 0.836 0.000 0.000
#> GSM955028     1  0.2364    0.86191 0.904 0.004 0.000 0.012 0.036 0.044
#> GSM955029     5  0.1341    0.69417 0.000 0.028 0.000 0.024 0.948 0.000
#> GSM955030     3  0.1225    0.72193 0.004 0.000 0.956 0.032 0.004 0.004
#> GSM955032     3  0.2384    0.67669 0.000 0.084 0.884 0.000 0.000 0.032
#> GSM955033     3  0.7651    0.33183 0.020 0.088 0.520 0.204 0.096 0.072
#> GSM955034     1  0.2430    0.86247 0.900 0.004 0.000 0.012 0.036 0.048
#> GSM955035     2  0.1088    0.58833 0.000 0.960 0.024 0.000 0.000 0.016
#> GSM955036     3  0.6479    0.48815 0.028 0.000 0.604 0.120 0.168 0.080
#> GSM955037     1  0.4628    0.85900 0.748 0.004 0.060 0.020 0.012 0.156
#> GSM955039     3  0.3572    0.69980 0.004 0.084 0.840 0.032 0.028 0.012
#> GSM955041     2  0.6103    0.12933 0.000 0.492 0.344 0.032 0.132 0.000
#> GSM955042     1  0.4094    0.83387 0.712 0.000 0.020 0.000 0.016 0.252
#> GSM955045     2  0.4890    0.41961 0.000 0.708 0.164 0.032 0.096 0.000
#> GSM955046     3  0.4225    0.66499 0.000 0.128 0.768 0.008 0.008 0.088
#> GSM955047     1  0.2257    0.89063 0.876 0.000 0.000 0.008 0.000 0.116
#> GSM955050     4  0.5978    0.49309 0.044 0.032 0.284 0.588 0.000 0.052
#> GSM955052     3  0.4166    0.57409 0.000 0.160 0.748 0.004 0.000 0.088
#> GSM955053     1  0.2364    0.86191 0.904 0.004 0.000 0.012 0.036 0.044
#> GSM955056     6  0.6282    0.68045 0.000 0.272 0.280 0.012 0.000 0.436
#> GSM955058     5  0.1341    0.69417 0.000 0.028 0.000 0.024 0.948 0.000
#> GSM955059     3  0.1327    0.71591 0.000 0.000 0.936 0.000 0.000 0.064
#> GSM955060     1  0.2278    0.88976 0.868 0.000 0.000 0.004 0.000 0.128
#> GSM955061     5  0.1341    0.69417 0.000 0.028 0.000 0.024 0.948 0.000
#> GSM955065     1  0.2364    0.86191 0.904 0.004 0.000 0.012 0.036 0.044
#> GSM955066     3  0.0951    0.71745 0.000 0.000 0.968 0.020 0.004 0.008
#> GSM955067     1  0.3098    0.88153 0.812 0.000 0.000 0.024 0.000 0.164
#> GSM955073     3  0.4741    0.54442 0.000 0.152 0.692 0.000 0.004 0.152
#> GSM955074     1  0.2994    0.87669 0.788 0.000 0.000 0.000 0.004 0.208
#> GSM955076     4  0.3348    0.62538 0.000 0.216 0.016 0.768 0.000 0.000
#> GSM955078     4  0.4672    0.58337 0.004 0.144 0.000 0.700 0.152 0.000
#> GSM955083     3  0.7758    0.27909 0.032 0.064 0.504 0.228 0.092 0.080
#> GSM955084     4  0.4589    0.58399 0.008 0.084 0.000 0.716 0.188 0.004
#> GSM955086     3  0.1078    0.71818 0.000 0.008 0.964 0.012 0.000 0.016
#> GSM955091     2  0.0653    0.58302 0.000 0.980 0.004 0.004 0.000 0.012
#> GSM955092     2  0.3139    0.47419 0.000 0.836 0.036 0.008 0.000 0.120
#> GSM955093     3  0.2001    0.70234 0.000 0.004 0.900 0.000 0.004 0.092
#> GSM955098     4  0.1700    0.65888 0.000 0.080 0.004 0.916 0.000 0.000
#> GSM955099     2  0.0870    0.58378 0.000 0.972 0.004 0.012 0.000 0.012
#> GSM955100     1  0.4775    0.81276 0.728 0.000 0.092 0.028 0.004 0.148
#> GSM955103     3  0.5955    0.48182 0.000 0.236 0.612 0.048 0.088 0.016
#> GSM955104     3  0.3672    0.70801 0.004 0.052 0.840 0.040 0.012 0.052
#> GSM955106     5  0.8120    0.00253 0.000 0.148 0.192 0.260 0.356 0.044
#> GSM955000     1  0.2573    0.88993 0.856 0.000 0.000 0.004 0.008 0.132
#> GSM955006     1  0.3555    0.88217 0.816 0.000 0.016 0.036 0.004 0.128
#> GSM955007     3  0.4357    0.58421 0.000 0.208 0.728 0.008 0.008 0.048
#> GSM955010     3  0.2263    0.71634 0.008 0.000 0.908 0.044 0.004 0.036
#> GSM955014     1  0.0806    0.88391 0.972 0.000 0.000 0.008 0.000 0.020
#> GSM955018     3  0.1075    0.71769 0.000 0.000 0.952 0.000 0.000 0.048
#> GSM955020     1  0.1913    0.87876 0.908 0.000 0.000 0.012 0.000 0.080
#> GSM955024     2  0.5120    0.21999 0.000 0.596 0.328 0.024 0.052 0.000
#> GSM955026     4  0.2149    0.66971 0.004 0.104 0.004 0.888 0.000 0.000
#> GSM955031     4  0.6299    0.47789 0.076 0.024 0.296 0.560 0.008 0.036
#> GSM955038     4  0.4303    0.64085 0.020 0.032 0.120 0.784 0.000 0.044
#> GSM955040     4  0.6598    0.08505 0.076 0.012 0.408 0.432 0.004 0.068
#> GSM955044     2  0.6376   -0.07511 0.000 0.444 0.020 0.244 0.292 0.000
#> GSM955051     1  0.2257    0.89063 0.876 0.000 0.000 0.008 0.000 0.116
#> GSM955055     2  0.0914    0.58690 0.000 0.968 0.016 0.000 0.000 0.016
#> GSM955057     1  0.0717    0.88369 0.976 0.000 0.000 0.008 0.000 0.016
#> GSM955062     2  0.1594    0.58222 0.000 0.932 0.052 0.000 0.000 0.016
#> GSM955063     3  0.4673    0.55135 0.000 0.148 0.700 0.000 0.004 0.148
#> GSM955068     4  0.2491    0.66648 0.000 0.164 0.000 0.836 0.000 0.000
#> GSM955069     3  0.1876    0.71292 0.000 0.004 0.916 0.004 0.004 0.072
#> GSM955070     2  0.1026    0.58951 0.000 0.968 0.012 0.008 0.004 0.008
#> GSM955071     3  0.3891    0.68020 0.020 0.008 0.812 0.104 0.004 0.052
#> GSM955077     4  0.4831    0.58647 0.020 0.024 0.216 0.704 0.000 0.036
#> GSM955080     5  0.7644    0.16695 0.000 0.328 0.140 0.136 0.372 0.024
#> GSM955081     3  0.3473    0.65978 0.000 0.136 0.812 0.040 0.000 0.012
#> GSM955082     2  0.4664    0.01788 0.000 0.488 0.476 0.032 0.004 0.000
#> GSM955085     2  0.1223    0.58739 0.000 0.960 0.008 0.016 0.004 0.012
#> GSM955090     1  0.1501    0.88220 0.924 0.000 0.000 0.000 0.000 0.076
#> GSM955094     2  0.3930    0.51001 0.000 0.812 0.088 0.052 0.040 0.008
#> GSM955096     3  0.3453    0.59490 0.000 0.132 0.804 0.000 0.000 0.064
#> GSM955102     3  0.2740    0.70686 0.008 0.004 0.876 0.020 0.004 0.088
#> GSM955105     3  0.0984    0.71904 0.000 0.008 0.968 0.012 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-SD-mclust-consensus-heatmap-1

consensus_heatmap(res, k = 3)

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

consensus_heatmap(res, k = 4)

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

consensus_heatmap(res, k = 5)

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

consensus_heatmap(res, k = 6)

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

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

membership_heatmap(res, k = 2)

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

membership_heatmap(res, k = 3)

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

membership_heatmap(res, k = 4)

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

membership_heatmap(res, k = 5)

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

membership_heatmap(res, k = 6)

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

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

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

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

get_signatures(res, k = 3)

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

get_signatures(res, k = 4)

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

get_signatures(res, k = 5)

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

get_signatures(res, k = 6)

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

Signature heatmaps where rows are not scaled:

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

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

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

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

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

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

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

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

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

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

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk SD-mclust-signature_compare

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

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

An example of the output of tb is:

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

The columns in tb are:

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

UMAP plot which shows how samples are separated.

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

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

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

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

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

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

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

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

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

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

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk SD-mclust-collect-classes

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

test_to_known_factors(res)
#>             n genotype/variation(p) k
#> SD:mclust 108                 0.910 2
#> SD:mclust  99                 0.738 3
#> SD:mclust 100                 0.763 4
#> SD:mclust  94                 0.883 5
#> SD:mclust  83                 0.716 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 31589 rows and 108 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 2.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

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

collect_plots(res)

plot of chunk SD-NMF-collect-plots

The plots are:

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

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

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

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

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.999           0.955       0.981         0.4463 0.551   0.551
#> 3 3 0.794           0.871       0.942         0.2617 0.861   0.758
#> 4 4 0.614           0.722       0.863         0.2209 0.729   0.472
#> 5 5 0.531           0.539       0.752         0.0942 0.877   0.637
#> 6 6 0.558           0.432       0.687         0.0594 0.834   0.469

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
#> GSM955002     2  0.0000      0.988 0.000 1.000
#> GSM955008     2  0.0000      0.988 0.000 1.000
#> GSM955016     1  0.0000      0.965 1.000 0.000
#> GSM955019     2  0.0000      0.988 0.000 1.000
#> GSM955022     2  0.0000      0.988 0.000 1.000
#> GSM955023     2  0.0000      0.988 0.000 1.000
#> GSM955027     2  0.0000      0.988 0.000 1.000
#> GSM955043     2  0.0000      0.988 0.000 1.000
#> GSM955048     1  0.0000      0.965 1.000 0.000
#> GSM955049     2  0.0000      0.988 0.000 1.000
#> GSM955054     2  0.0000      0.988 0.000 1.000
#> GSM955064     2  0.0000      0.988 0.000 1.000
#> GSM955072     2  0.0000      0.988 0.000 1.000
#> GSM955075     2  0.0000      0.988 0.000 1.000
#> GSM955079     2  0.0000      0.988 0.000 1.000
#> GSM955087     1  0.0000      0.965 1.000 0.000
#> GSM955088     2  0.0000      0.988 0.000 1.000
#> GSM955089     1  0.0000      0.965 1.000 0.000
#> GSM955095     2  0.0000      0.988 0.000 1.000
#> GSM955097     2  0.0000      0.988 0.000 1.000
#> GSM955101     2  0.0000      0.988 0.000 1.000
#> GSM954999     1  0.4431      0.884 0.908 0.092
#> GSM955001     2  0.0000      0.988 0.000 1.000
#> GSM955003     2  0.0000      0.988 0.000 1.000
#> GSM955004     2  0.0000      0.988 0.000 1.000
#> GSM955005     2  0.5408      0.850 0.124 0.876
#> GSM955009     2  0.0000      0.988 0.000 1.000
#> GSM955011     1  0.0000      0.965 1.000 0.000
#> GSM955012     2  0.0000      0.988 0.000 1.000
#> GSM955013     2  0.0000      0.988 0.000 1.000
#> GSM955015     2  0.0000      0.988 0.000 1.000
#> GSM955017     1  0.0000      0.965 1.000 0.000
#> GSM955021     2  0.0000      0.988 0.000 1.000
#> GSM955025     2  0.0000      0.988 0.000 1.000
#> GSM955028     1  0.0000      0.965 1.000 0.000
#> GSM955029     2  0.0000      0.988 0.000 1.000
#> GSM955030     1  0.0376      0.963 0.996 0.004
#> GSM955032     2  0.0000      0.988 0.000 1.000
#> GSM955033     2  0.4161      0.899 0.084 0.916
#> GSM955034     1  0.0000      0.965 1.000 0.000
#> GSM955035     2  0.0000      0.988 0.000 1.000
#> GSM955036     2  0.0000      0.988 0.000 1.000
#> GSM955037     1  0.0000      0.965 1.000 0.000
#> GSM955039     2  0.0000      0.988 0.000 1.000
#> GSM955041     2  0.0000      0.988 0.000 1.000
#> GSM955042     1  0.0000      0.965 1.000 0.000
#> GSM955045     2  0.0000      0.988 0.000 1.000
#> GSM955046     2  0.0000      0.988 0.000 1.000
#> GSM955047     1  0.0000      0.965 1.000 0.000
#> GSM955050     1  0.0000      0.965 1.000 0.000
#> GSM955052     2  0.0000      0.988 0.000 1.000
#> GSM955053     1  0.0000      0.965 1.000 0.000
#> GSM955056     2  0.0000      0.988 0.000 1.000
#> GSM955058     2  0.0000      0.988 0.000 1.000
#> GSM955059     2  0.0000      0.988 0.000 1.000
#> GSM955060     1  0.0000      0.965 1.000 0.000
#> GSM955061     2  0.0000      0.988 0.000 1.000
#> GSM955065     1  0.0000      0.965 1.000 0.000
#> GSM955066     1  0.9732      0.341 0.596 0.404
#> GSM955067     1  0.0000      0.965 1.000 0.000
#> GSM955073     2  0.0000      0.988 0.000 1.000
#> GSM955074     1  0.0000      0.965 1.000 0.000
#> GSM955076     2  0.0000      0.988 0.000 1.000
#> GSM955078     2  0.0000      0.988 0.000 1.000
#> GSM955083     1  0.8608      0.617 0.716 0.284
#> GSM955084     2  0.0000      0.988 0.000 1.000
#> GSM955086     2  0.0376      0.984 0.004 0.996
#> GSM955091     2  0.0000      0.988 0.000 1.000
#> GSM955092     2  0.0000      0.988 0.000 1.000
#> GSM955093     2  0.0000      0.988 0.000 1.000
#> GSM955098     2  0.0000      0.988 0.000 1.000
#> GSM955099     2  0.0000      0.988 0.000 1.000
#> GSM955100     1  0.0000      0.965 1.000 0.000
#> GSM955103     2  0.0000      0.988 0.000 1.000
#> GSM955104     2  0.9866      0.203 0.432 0.568
#> GSM955106     2  0.0000      0.988 0.000 1.000
#> GSM955000     1  0.0000      0.965 1.000 0.000
#> GSM955006     1  0.0000      0.965 1.000 0.000
#> GSM955007     2  0.0000      0.988 0.000 1.000
#> GSM955010     1  0.0000      0.965 1.000 0.000
#> GSM955014     1  0.0000      0.965 1.000 0.000
#> GSM955018     2  0.0000      0.988 0.000 1.000
#> GSM955020     1  0.0000      0.965 1.000 0.000
#> GSM955024     2  0.0000      0.988 0.000 1.000
#> GSM955026     2  0.0000      0.988 0.000 1.000
#> GSM955031     1  0.1184      0.955 0.984 0.016
#> GSM955038     1  0.2236      0.938 0.964 0.036
#> GSM955040     1  0.0000      0.965 1.000 0.000
#> GSM955044     2  0.0000      0.988 0.000 1.000
#> GSM955051     1  0.0000      0.965 1.000 0.000
#> GSM955055     2  0.0000      0.988 0.000 1.000
#> GSM955057     1  0.0000      0.965 1.000 0.000
#> GSM955062     2  0.0000      0.988 0.000 1.000
#> GSM955063     2  0.0000      0.988 0.000 1.000
#> GSM955068     2  0.0000      0.988 0.000 1.000
#> GSM955069     2  0.0000      0.988 0.000 1.000
#> GSM955070     2  0.0000      0.988 0.000 1.000
#> GSM955071     1  0.0672      0.960 0.992 0.008
#> GSM955077     1  0.1633      0.949 0.976 0.024
#> GSM955080     2  0.0000      0.988 0.000 1.000
#> GSM955081     2  0.0000      0.988 0.000 1.000
#> GSM955082     2  0.0000      0.988 0.000 1.000
#> GSM955085     2  0.0000      0.988 0.000 1.000
#> GSM955090     1  0.0000      0.965 1.000 0.000
#> GSM955094     2  0.0000      0.988 0.000 1.000
#> GSM955096     2  0.0000      0.988 0.000 1.000
#> GSM955102     1  0.9044      0.543 0.680 0.320
#> GSM955105     2  0.6531      0.789 0.168 0.832

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1    p2    p3
#> GSM955002     3  0.0424      0.923 0.000 0.008 0.992
#> GSM955008     3  0.0000      0.924 0.000 0.000 1.000
#> GSM955016     1  0.0000      0.966 1.000 0.000 0.000
#> GSM955019     3  0.1643      0.907 0.000 0.044 0.956
#> GSM955022     3  0.0000      0.924 0.000 0.000 1.000
#> GSM955023     3  0.0000      0.924 0.000 0.000 1.000
#> GSM955027     3  0.0747      0.920 0.000 0.016 0.984
#> GSM955043     3  0.2448      0.887 0.000 0.076 0.924
#> GSM955048     1  0.0000      0.966 1.000 0.000 0.000
#> GSM955049     3  0.0237      0.924 0.000 0.004 0.996
#> GSM955054     3  0.0000      0.924 0.000 0.000 1.000
#> GSM955064     3  0.0424      0.923 0.000 0.008 0.992
#> GSM955072     3  0.6168      0.357 0.000 0.412 0.588
#> GSM955075     3  0.5882      0.531 0.000 0.348 0.652
#> GSM955079     3  0.0000      0.924 0.000 0.000 1.000
#> GSM955087     1  0.0000      0.966 1.000 0.000 0.000
#> GSM955088     3  0.0000      0.924 0.000 0.000 1.000
#> GSM955089     1  0.0000      0.966 1.000 0.000 0.000
#> GSM955095     3  0.2356      0.889 0.000 0.072 0.928
#> GSM955097     2  0.0000      0.860 0.000 1.000 0.000
#> GSM955101     3  0.0000      0.924 0.000 0.000 1.000
#> GSM954999     1  0.0000      0.966 1.000 0.000 0.000
#> GSM955001     3  0.2261      0.893 0.000 0.068 0.932
#> GSM955003     3  0.0000      0.924 0.000 0.000 1.000
#> GSM955004     2  0.0000      0.860 0.000 1.000 0.000
#> GSM955005     3  0.0237      0.923 0.004 0.000 0.996
#> GSM955009     3  0.4931      0.731 0.000 0.232 0.768
#> GSM955011     1  0.0000      0.966 1.000 0.000 0.000
#> GSM955012     3  0.2711      0.878 0.000 0.088 0.912
#> GSM955013     3  0.0000      0.924 0.000 0.000 1.000
#> GSM955015     3  0.0000      0.924 0.000 0.000 1.000
#> GSM955017     1  0.0000      0.966 1.000 0.000 0.000
#> GSM955021     3  0.0424      0.923 0.000 0.008 0.992
#> GSM955025     2  0.0237      0.860 0.000 0.996 0.004
#> GSM955028     1  0.0000      0.966 1.000 0.000 0.000
#> GSM955029     3  0.5016      0.720 0.000 0.240 0.760
#> GSM955030     1  0.4887      0.622 0.772 0.000 0.228
#> GSM955032     3  0.0000      0.924 0.000 0.000 1.000
#> GSM955033     2  0.7470      0.480 0.052 0.612 0.336
#> GSM955034     1  0.0000      0.966 1.000 0.000 0.000
#> GSM955035     3  0.0747      0.920 0.000 0.016 0.984
#> GSM955036     3  0.0000      0.924 0.000 0.000 1.000
#> GSM955037     1  0.0000      0.966 1.000 0.000 0.000
#> GSM955039     3  0.0237      0.924 0.000 0.004 0.996
#> GSM955041     3  0.0000      0.924 0.000 0.000 1.000
#> GSM955042     1  0.0000      0.966 1.000 0.000 0.000
#> GSM955045     3  0.0237      0.924 0.000 0.004 0.996
#> GSM955046     3  0.0000      0.924 0.000 0.000 1.000
#> GSM955047     1  0.0000      0.966 1.000 0.000 0.000
#> GSM955050     1  0.0000      0.966 1.000 0.000 0.000
#> GSM955052     3  0.0000      0.924 0.000 0.000 1.000
#> GSM955053     1  0.0000      0.966 1.000 0.000 0.000
#> GSM955056     3  0.0000      0.924 0.000 0.000 1.000
#> GSM955058     3  0.4605      0.765 0.000 0.204 0.796
#> GSM955059     3  0.0000      0.924 0.000 0.000 1.000
#> GSM955060     1  0.0000      0.966 1.000 0.000 0.000
#> GSM955061     3  0.6307      0.122 0.000 0.488 0.512
#> GSM955065     1  0.0000      0.966 1.000 0.000 0.000
#> GSM955066     3  0.4974      0.618 0.236 0.000 0.764
#> GSM955067     1  0.0000      0.966 1.000 0.000 0.000
#> GSM955073     3  0.0000      0.924 0.000 0.000 1.000
#> GSM955074     1  0.0000      0.966 1.000 0.000 0.000
#> GSM955076     3  0.1529      0.909 0.000 0.040 0.960
#> GSM955078     2  0.3340      0.815 0.000 0.880 0.120
#> GSM955083     1  0.5810      0.486 0.664 0.336 0.000
#> GSM955084     2  0.0000      0.860 0.000 1.000 0.000
#> GSM955086     3  0.0000      0.924 0.000 0.000 1.000
#> GSM955091     3  0.3551      0.841 0.000 0.132 0.868
#> GSM955092     3  0.0237      0.924 0.000 0.004 0.996
#> GSM955093     3  0.0000      0.924 0.000 0.000 1.000
#> GSM955098     2  0.2165      0.848 0.000 0.936 0.064
#> GSM955099     3  0.3482      0.845 0.000 0.128 0.872
#> GSM955100     1  0.0000      0.966 1.000 0.000 0.000
#> GSM955103     3  0.0237      0.924 0.000 0.004 0.996
#> GSM955104     3  0.4842      0.651 0.224 0.000 0.776
#> GSM955106     3  0.4702      0.756 0.000 0.212 0.788
#> GSM955000     1  0.0000      0.966 1.000 0.000 0.000
#> GSM955006     1  0.0000      0.966 1.000 0.000 0.000
#> GSM955007     3  0.0000      0.924 0.000 0.000 1.000
#> GSM955010     1  0.2796      0.853 0.908 0.000 0.092
#> GSM955014     1  0.0000      0.966 1.000 0.000 0.000
#> GSM955018     3  0.0000      0.924 0.000 0.000 1.000
#> GSM955020     1  0.0000      0.966 1.000 0.000 0.000
#> GSM955024     3  0.0000      0.924 0.000 0.000 1.000
#> GSM955026     2  0.4346      0.756 0.000 0.816 0.184
#> GSM955031     1  0.3482      0.792 0.872 0.000 0.128
#> GSM955038     2  0.5591      0.490 0.304 0.696 0.000
#> GSM955040     1  0.0000      0.966 1.000 0.000 0.000
#> GSM955044     3  0.4062      0.812 0.000 0.164 0.836
#> GSM955051     1  0.0000      0.966 1.000 0.000 0.000
#> GSM955055     3  0.1964      0.900 0.000 0.056 0.944
#> GSM955057     1  0.0000      0.966 1.000 0.000 0.000
#> GSM955062     3  0.0237      0.924 0.000 0.004 0.996
#> GSM955063     3  0.0000      0.924 0.000 0.000 1.000
#> GSM955068     2  0.0000      0.860 0.000 1.000 0.000
#> GSM955069     3  0.0000      0.924 0.000 0.000 1.000
#> GSM955070     3  0.0424      0.923 0.000 0.008 0.992
#> GSM955071     1  0.1753      0.907 0.952 0.000 0.048
#> GSM955077     1  0.0424      0.959 0.992 0.008 0.000
#> GSM955080     3  0.5591      0.615 0.000 0.304 0.696
#> GSM955081     3  0.0000      0.924 0.000 0.000 1.000
#> GSM955082     3  0.0237      0.924 0.000 0.004 0.996
#> GSM955085     3  0.3752      0.830 0.000 0.144 0.856
#> GSM955090     1  0.0000      0.966 1.000 0.000 0.000
#> GSM955094     3  0.1753      0.905 0.000 0.048 0.952
#> GSM955096     3  0.0000      0.924 0.000 0.000 1.000
#> GSM955102     3  0.5431      0.527 0.284 0.000 0.716
#> GSM955105     3  0.0424      0.920 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
#> GSM955002     3  0.2530     0.7586 0.000 0.112 0.888 0.000
#> GSM955008     3  0.2408     0.7680 0.000 0.104 0.896 0.000
#> GSM955016     1  0.1878     0.9214 0.944 0.008 0.008 0.040
#> GSM955019     2  0.3219     0.7703 0.000 0.836 0.164 0.000
#> GSM955022     3  0.0188     0.8047 0.000 0.000 0.996 0.004
#> GSM955023     3  0.0469     0.8067 0.000 0.012 0.988 0.000
#> GSM955027     2  0.4837     0.6768 0.000 0.648 0.348 0.004
#> GSM955043     3  0.2742     0.7788 0.000 0.024 0.900 0.076
#> GSM955048     1  0.0188     0.9470 0.996 0.004 0.000 0.000
#> GSM955049     2  0.4977     0.4413 0.000 0.540 0.460 0.000
#> GSM955054     2  0.4776     0.6315 0.000 0.624 0.376 0.000
#> GSM955064     3  0.3123     0.7039 0.000 0.156 0.844 0.000
#> GSM955072     2  0.3372     0.7321 0.000 0.868 0.096 0.036
#> GSM955075     4  0.3791     0.7364 0.000 0.004 0.200 0.796
#> GSM955079     3  0.5310    -0.0160 0.012 0.412 0.576 0.000
#> GSM955087     1  0.0336     0.9460 0.992 0.008 0.000 0.000
#> GSM955088     3  0.0817     0.8077 0.000 0.024 0.976 0.000
#> GSM955089     1  0.0336     0.9460 0.992 0.008 0.000 0.000
#> GSM955095     3  0.3390     0.7262 0.000 0.016 0.852 0.132
#> GSM955097     4  0.0188     0.7391 0.000 0.000 0.004 0.996
#> GSM955101     3  0.4888     0.0545 0.000 0.412 0.588 0.000
#> GSM954999     1  0.4339     0.6381 0.764 0.008 0.224 0.004
#> GSM955001     2  0.4331     0.7487 0.000 0.712 0.288 0.000
#> GSM955003     2  0.3942     0.7756 0.000 0.764 0.236 0.000
#> GSM955004     4  0.0469     0.7385 0.000 0.012 0.000 0.988
#> GSM955005     3  0.2466     0.7521 0.096 0.004 0.900 0.000
#> GSM955009     2  0.1637     0.7170 0.000 0.940 0.060 0.000
#> GSM955011     1  0.0188     0.9470 0.996 0.004 0.000 0.000
#> GSM955012     3  0.3024     0.7096 0.000 0.000 0.852 0.148
#> GSM955013     3  0.1229     0.7941 0.020 0.004 0.968 0.008
#> GSM955015     3  0.1940     0.7866 0.000 0.076 0.924 0.000
#> GSM955017     1  0.0188     0.9468 0.996 0.004 0.000 0.000
#> GSM955021     2  0.3400     0.7746 0.000 0.820 0.180 0.000
#> GSM955025     2  0.0712     0.6673 0.004 0.984 0.004 0.008
#> GSM955028     1  0.0336     0.9460 0.992 0.008 0.000 0.000
#> GSM955029     4  0.7020     0.4469 0.000 0.136 0.332 0.532
#> GSM955030     3  0.4123     0.5250 0.220 0.008 0.772 0.000
#> GSM955032     3  0.4543     0.3370 0.000 0.324 0.676 0.000
#> GSM955033     3  0.6114    -0.0383 0.048 0.000 0.524 0.428
#> GSM955034     1  0.0000     0.9472 1.000 0.000 0.000 0.000
#> GSM955035     2  0.4331     0.7504 0.000 0.712 0.288 0.000
#> GSM955036     3  0.3005     0.7398 0.044 0.008 0.900 0.048
#> GSM955037     1  0.1970     0.8960 0.932 0.008 0.060 0.000
#> GSM955039     3  0.0707     0.8082 0.000 0.020 0.980 0.000
#> GSM955041     3  0.0592     0.8075 0.000 0.016 0.984 0.000
#> GSM955042     1  0.0336     0.9467 0.992 0.008 0.000 0.000
#> GSM955045     3  0.1824     0.7965 0.000 0.060 0.936 0.004
#> GSM955046     3  0.0524     0.8018 0.004 0.008 0.988 0.000
#> GSM955047     1  0.0469     0.9453 0.988 0.012 0.000 0.000
#> GSM955050     1  0.2081     0.8984 0.916 0.084 0.000 0.000
#> GSM955052     3  0.1211     0.8030 0.000 0.040 0.960 0.000
#> GSM955053     1  0.0000     0.9472 1.000 0.000 0.000 0.000
#> GSM955056     3  0.4933    -0.1001 0.000 0.432 0.568 0.000
#> GSM955058     4  0.6067     0.4343 0.000 0.052 0.376 0.572
#> GSM955059     3  0.0188     0.8045 0.000 0.004 0.996 0.000
#> GSM955060     1  0.0000     0.9472 1.000 0.000 0.000 0.000
#> GSM955061     4  0.2401     0.7680 0.000 0.004 0.092 0.904
#> GSM955065     1  0.0336     0.9460 0.992 0.008 0.000 0.000
#> GSM955066     3  0.1807     0.7698 0.052 0.008 0.940 0.000
#> GSM955067     1  0.1867     0.9085 0.928 0.072 0.000 0.000
#> GSM955073     3  0.0000     0.8054 0.000 0.000 1.000 0.000
#> GSM955074     1  0.0336     0.9462 0.992 0.000 0.000 0.008
#> GSM955076     2  0.1557     0.7131 0.000 0.944 0.056 0.000
#> GSM955078     2  0.4318     0.6967 0.000 0.816 0.068 0.116
#> GSM955083     1  0.3257     0.8267 0.844 0.000 0.004 0.152
#> GSM955084     4  0.2081     0.7179 0.000 0.084 0.000 0.916
#> GSM955086     2  0.6797     0.5566 0.108 0.536 0.356 0.000
#> GSM955091     2  0.3831     0.7785 0.000 0.792 0.204 0.004
#> GSM955092     2  0.4331     0.7490 0.000 0.712 0.288 0.000
#> GSM955093     3  0.0336     0.8077 0.000 0.008 0.992 0.000
#> GSM955098     2  0.0927     0.6682 0.000 0.976 0.008 0.016
#> GSM955099     2  0.4018     0.7776 0.000 0.772 0.224 0.004
#> GSM955100     1  0.0188     0.9468 0.996 0.004 0.000 0.000
#> GSM955103     3  0.1151     0.8075 0.000 0.024 0.968 0.008
#> GSM955104     3  0.3088     0.6795 0.128 0.008 0.864 0.000
#> GSM955106     3  0.4933     0.0371 0.000 0.000 0.568 0.432
#> GSM955000     1  0.0336     0.9460 0.992 0.008 0.000 0.000
#> GSM955006     1  0.0000     0.9472 1.000 0.000 0.000 0.000
#> GSM955007     3  0.0000     0.8054 0.000 0.000 1.000 0.000
#> GSM955010     3  0.5288     0.0612 0.472 0.008 0.520 0.000
#> GSM955014     1  0.1118     0.9340 0.964 0.036 0.000 0.000
#> GSM955018     3  0.1389     0.8006 0.000 0.048 0.952 0.000
#> GSM955020     1  0.0188     0.9470 0.996 0.004 0.000 0.000
#> GSM955024     3  0.0188     0.8060 0.000 0.004 0.996 0.000
#> GSM955026     2  0.0672     0.6717 0.000 0.984 0.008 0.008
#> GSM955031     2  0.1807     0.6305 0.052 0.940 0.008 0.000
#> GSM955038     1  0.5597     0.2914 0.516 0.464 0.000 0.020
#> GSM955040     1  0.0592     0.9443 0.984 0.016 0.000 0.000
#> GSM955044     3  0.7413     0.1987 0.000 0.232 0.516 0.252
#> GSM955051     1  0.0921     0.9387 0.972 0.028 0.000 0.000
#> GSM955055     2  0.3649     0.7784 0.000 0.796 0.204 0.000
#> GSM955057     1  0.1022     0.9371 0.968 0.032 0.000 0.000
#> GSM955062     2  0.4500     0.7212 0.000 0.684 0.316 0.000
#> GSM955063     3  0.0000     0.8054 0.000 0.000 1.000 0.000
#> GSM955068     2  0.0937     0.6750 0.000 0.976 0.012 0.012
#> GSM955069     3  0.0804     0.7983 0.012 0.008 0.980 0.000
#> GSM955070     3  0.1356     0.8064 0.000 0.032 0.960 0.008
#> GSM955071     1  0.2060     0.9029 0.932 0.016 0.052 0.000
#> GSM955077     2  0.3569     0.4268 0.196 0.804 0.000 0.000
#> GSM955080     4  0.4877     0.7183 0.000 0.044 0.204 0.752
#> GSM955081     2  0.4888     0.5573 0.000 0.588 0.412 0.000
#> GSM955082     3  0.2760     0.7454 0.000 0.128 0.872 0.000
#> GSM955085     2  0.4194     0.7763 0.000 0.764 0.228 0.008
#> GSM955090     1  0.0672     0.9458 0.984 0.008 0.000 0.008
#> GSM955094     3  0.2813     0.7823 0.000 0.080 0.896 0.024
#> GSM955096     2  0.4933     0.5096 0.000 0.568 0.432 0.000
#> GSM955102     3  0.2342     0.7426 0.080 0.008 0.912 0.000
#> GSM955105     3  0.6320     0.4641 0.204 0.140 0.656 0.000

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM955002     3  0.4986    0.41731 0.004 0.032 0.608 0.356 0.000
#> GSM955008     3  0.4252    0.56369 0.000 0.280 0.700 0.020 0.000
#> GSM955016     1  0.3432    0.84574 0.860 0.000 0.028 0.060 0.052
#> GSM955019     2  0.4252    0.19248 0.000 0.700 0.020 0.280 0.000
#> GSM955022     3  0.1484    0.70787 0.000 0.048 0.944 0.008 0.000
#> GSM955023     3  0.3438    0.68389 0.000 0.172 0.808 0.020 0.000
#> GSM955027     2  0.2393    0.56440 0.000 0.900 0.080 0.016 0.004
#> GSM955043     3  0.4253    0.66713 0.000 0.052 0.804 0.032 0.112
#> GSM955048     1  0.0609    0.88952 0.980 0.000 0.000 0.020 0.000
#> GSM955049     2  0.4620    0.43364 0.000 0.652 0.320 0.028 0.000
#> GSM955054     2  0.6793   -0.09162 0.000 0.376 0.332 0.292 0.000
#> GSM955064     3  0.4923    0.58094 0.000 0.212 0.700 0.088 0.000
#> GSM955072     2  0.5442   -0.07798 0.000 0.592 0.036 0.352 0.020
#> GSM955075     5  0.5726    0.37056 0.000 0.372 0.092 0.000 0.536
#> GSM955079     2  0.6478    0.29670 0.048 0.536 0.340 0.076 0.000
#> GSM955087     1  0.1568    0.88314 0.944 0.000 0.020 0.036 0.000
#> GSM955088     3  0.5631    0.00758 0.008 0.456 0.488 0.044 0.004
#> GSM955089     1  0.1018    0.88911 0.968 0.000 0.016 0.016 0.000
#> GSM955095     2  0.6322    0.23295 0.000 0.496 0.368 0.008 0.128
#> GSM955097     5  0.0932    0.59994 0.000 0.020 0.004 0.004 0.972
#> GSM955101     3  0.6492    0.14533 0.000 0.348 0.456 0.196 0.000
#> GSM954999     1  0.5898    0.33598 0.564 0.008 0.360 0.052 0.016
#> GSM955001     2  0.2237    0.54515 0.000 0.916 0.040 0.040 0.004
#> GSM955003     2  0.6127   -0.26440 0.000 0.484 0.132 0.384 0.000
#> GSM955004     5  0.2416    0.60811 0.000 0.100 0.000 0.012 0.888
#> GSM955005     3  0.4180    0.64882 0.132 0.024 0.800 0.044 0.000
#> GSM955009     2  0.2909    0.43191 0.000 0.848 0.000 0.140 0.012
#> GSM955011     1  0.0451    0.89139 0.988 0.000 0.000 0.008 0.004
#> GSM955012     3  0.6491    0.23193 0.000 0.228 0.488 0.000 0.284
#> GSM955013     3  0.2253    0.70759 0.012 0.036 0.924 0.020 0.008
#> GSM955015     3  0.4276    0.58129 0.000 0.032 0.724 0.244 0.000
#> GSM955017     1  0.1251    0.88747 0.956 0.000 0.008 0.036 0.000
#> GSM955021     2  0.4096    0.36222 0.000 0.760 0.040 0.200 0.000
#> GSM955025     2  0.5470   -0.16085 0.032 0.560 0.000 0.388 0.020
#> GSM955028     1  0.1399    0.88604 0.952 0.000 0.020 0.028 0.000
#> GSM955029     2  0.4624    0.45463 0.000 0.740 0.096 0.000 0.164
#> GSM955030     3  0.3317    0.66484 0.088 0.004 0.852 0.056 0.000
#> GSM955032     2  0.6066    0.05197 0.008 0.464 0.436 0.092 0.000
#> GSM955033     3  0.6816    0.28584 0.028 0.004 0.520 0.312 0.136
#> GSM955034     1  0.0451    0.89106 0.988 0.000 0.004 0.008 0.000
#> GSM955035     4  0.6771    0.30324 0.000 0.312 0.292 0.396 0.000
#> GSM955036     3  0.2927    0.67419 0.020 0.000 0.880 0.080 0.020
#> GSM955037     1  0.2504    0.85318 0.896 0.000 0.064 0.040 0.000
#> GSM955039     3  0.4755    0.55640 0.008 0.032 0.704 0.252 0.004
#> GSM955041     3  0.3239    0.69089 0.000 0.156 0.828 0.012 0.004
#> GSM955042     1  0.0960    0.89122 0.972 0.000 0.008 0.016 0.004
#> GSM955045     2  0.4879    0.45992 0.000 0.688 0.264 0.016 0.032
#> GSM955046     3  0.2026    0.68848 0.012 0.008 0.924 0.056 0.000
#> GSM955047     1  0.1331    0.88742 0.952 0.000 0.008 0.040 0.000
#> GSM955050     1  0.6044    0.24142 0.460 0.008 0.076 0.452 0.004
#> GSM955052     3  0.3906    0.54514 0.000 0.292 0.704 0.004 0.000
#> GSM955053     1  0.0932    0.88981 0.972 0.000 0.004 0.020 0.004
#> GSM955056     2  0.4138    0.50985 0.000 0.708 0.276 0.016 0.000
#> GSM955058     5  0.6066    0.19276 0.000 0.388 0.124 0.000 0.488
#> GSM955059     3  0.2624    0.70648 0.000 0.116 0.872 0.012 0.000
#> GSM955060     1  0.0880    0.88894 0.968 0.000 0.000 0.032 0.000
#> GSM955061     5  0.3835    0.62457 0.000 0.156 0.048 0.000 0.796
#> GSM955065     1  0.1485    0.88467 0.948 0.000 0.020 0.032 0.000
#> GSM955066     3  0.3424    0.68012 0.064 0.016 0.856 0.064 0.000
#> GSM955067     1  0.3741    0.70156 0.732 0.000 0.004 0.264 0.000
#> GSM955073     3  0.3318    0.67539 0.000 0.180 0.808 0.012 0.000
#> GSM955074     1  0.1310    0.88706 0.956 0.000 0.000 0.024 0.020
#> GSM955076     4  0.4689    0.49428 0.000 0.424 0.016 0.560 0.000
#> GSM955078     2  0.3184    0.47492 0.000 0.852 0.000 0.048 0.100
#> GSM955083     1  0.5119    0.72115 0.740 0.004 0.052 0.040 0.164
#> GSM955084     5  0.2234    0.58533 0.000 0.044 0.004 0.036 0.916
#> GSM955086     2  0.4707    0.55638 0.052 0.784 0.112 0.048 0.004
#> GSM955091     2  0.4430    0.27629 0.000 0.720 0.032 0.244 0.004
#> GSM955092     2  0.2754    0.56731 0.000 0.884 0.080 0.032 0.004
#> GSM955093     3  0.3236    0.69078 0.000 0.152 0.828 0.020 0.000
#> GSM955098     4  0.4394    0.67310 0.008 0.212 0.036 0.744 0.000
#> GSM955099     2  0.3336    0.44233 0.000 0.832 0.016 0.144 0.008
#> GSM955100     1  0.1485    0.88679 0.948 0.000 0.032 0.020 0.000
#> GSM955103     3  0.4500    0.48675 0.000 0.316 0.664 0.016 0.004
#> GSM955104     3  0.5737    0.55939 0.196 0.092 0.676 0.036 0.000
#> GSM955106     5  0.5781    0.13207 0.000 0.068 0.416 0.008 0.508
#> GSM955000     1  0.0807    0.89096 0.976 0.000 0.012 0.012 0.000
#> GSM955006     1  0.1117    0.88975 0.964 0.000 0.016 0.020 0.000
#> GSM955007     3  0.2574    0.70806 0.000 0.112 0.876 0.012 0.000
#> GSM955010     3  0.4569    0.56557 0.148 0.000 0.748 0.104 0.000
#> GSM955014     1  0.1864    0.87146 0.924 0.000 0.004 0.068 0.004
#> GSM955018     2  0.5496    0.24566 0.020 0.548 0.400 0.032 0.000
#> GSM955020     1  0.0451    0.89086 0.988 0.000 0.004 0.008 0.000
#> GSM955024     3  0.3246    0.66717 0.000 0.184 0.808 0.008 0.000
#> GSM955026     4  0.4724    0.66538 0.020 0.320 0.008 0.652 0.000
#> GSM955031     2  0.6819   -0.35141 0.236 0.396 0.004 0.364 0.000
#> GSM955038     4  0.4404    0.46960 0.156 0.056 0.008 0.776 0.004
#> GSM955040     1  0.5821    0.55032 0.604 0.000 0.156 0.240 0.000
#> GSM955044     3  0.7330   -0.07248 0.000 0.124 0.424 0.380 0.072
#> GSM955051     1  0.1662    0.87848 0.936 0.000 0.004 0.056 0.004
#> GSM955055     2  0.2144    0.50755 0.000 0.912 0.020 0.068 0.000
#> GSM955057     1  0.1202    0.88641 0.960 0.000 0.004 0.032 0.004
#> GSM955062     2  0.4020    0.52338 0.000 0.796 0.108 0.096 0.000
#> GSM955063     3  0.2864    0.69781 0.000 0.136 0.852 0.012 0.000
#> GSM955068     4  0.4227    0.67450 0.000 0.292 0.016 0.692 0.000
#> GSM955069     3  0.5082    0.64440 0.052 0.168 0.740 0.036 0.004
#> GSM955070     3  0.3880    0.63092 0.000 0.028 0.784 0.184 0.004
#> GSM955071     1  0.6140    0.50745 0.596 0.008 0.204 0.192 0.000
#> GSM955077     2  0.6320    0.13333 0.256 0.584 0.004 0.144 0.012
#> GSM955080     2  0.5904   -0.22983 0.000 0.468 0.068 0.012 0.452
#> GSM955081     2  0.5104    0.47328 0.000 0.692 0.192 0.116 0.000
#> GSM955082     2  0.4588    0.52725 0.000 0.756 0.180 0.040 0.024
#> GSM955085     2  0.3063    0.48923 0.000 0.864 0.012 0.104 0.020
#> GSM955090     1  0.1653    0.88282 0.944 0.000 0.004 0.028 0.024
#> GSM955094     3  0.4272    0.61164 0.000 0.020 0.752 0.212 0.016
#> GSM955096     2  0.2997    0.57048 0.000 0.840 0.148 0.012 0.000
#> GSM955102     3  0.4171    0.66143 0.112 0.052 0.808 0.028 0.000
#> GSM955105     2  0.7165    0.27504 0.236 0.476 0.256 0.032 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
#> GSM955002     4  0.3627    0.64418 0.000 0.008 0.136 0.800 0.000 0.056
#> GSM955008     3  0.3549    0.48762 0.000 0.016 0.812 0.044 0.000 0.128
#> GSM955016     1  0.2359    0.87241 0.904 0.000 0.008 0.020 0.056 0.012
#> GSM955019     6  0.5933    0.35856 0.000 0.212 0.268 0.008 0.000 0.512
#> GSM955022     3  0.3890   -0.05098 0.000 0.004 0.596 0.400 0.000 0.000
#> GSM955023     3  0.3789    0.39591 0.000 0.040 0.760 0.196 0.000 0.004
#> GSM955027     3  0.6039   -0.19644 0.000 0.344 0.436 0.000 0.004 0.216
#> GSM955043     4  0.6835    0.32813 0.000 0.028 0.352 0.400 0.204 0.016
#> GSM955048     1  0.0725    0.89439 0.976 0.000 0.000 0.012 0.000 0.012
#> GSM955049     3  0.5108    0.19326 0.000 0.096 0.620 0.008 0.000 0.276
#> GSM955054     3  0.7590   -0.13867 0.000 0.180 0.308 0.208 0.000 0.304
#> GSM955064     3  0.5874    0.30497 0.000 0.052 0.604 0.216 0.000 0.128
#> GSM955072     2  0.5510    0.12441 0.000 0.468 0.052 0.016 0.012 0.452
#> GSM955075     5  0.5379    0.37018 0.000 0.336 0.092 0.012 0.560 0.000
#> GSM955079     3  0.5661    0.25791 0.128 0.036 0.616 0.000 0.000 0.220
#> GSM955087     1  0.0405    0.89235 0.988 0.000 0.004 0.000 0.000 0.008
#> GSM955088     2  0.6044    0.15373 0.008 0.512 0.268 0.208 0.000 0.004
#> GSM955089     1  0.0665    0.89343 0.980 0.004 0.000 0.008 0.000 0.008
#> GSM955095     2  0.6947    0.14160 0.000 0.436 0.280 0.080 0.204 0.000
#> GSM955097     5  0.1554    0.62204 0.004 0.044 0.008 0.000 0.940 0.004
#> GSM955101     3  0.5208   -0.06714 0.000 0.036 0.528 0.032 0.000 0.404
#> GSM954999     1  0.4282    0.75359 0.788 0.004 0.124 0.032 0.020 0.032
#> GSM955001     2  0.5082    0.48902 0.000 0.648 0.188 0.004 0.000 0.160
#> GSM955003     6  0.6023    0.40882 0.000 0.076 0.308 0.072 0.000 0.544
#> GSM955004     5  0.3753    0.54098 0.000 0.292 0.000 0.004 0.696 0.008
#> GSM955005     3  0.5954    0.00946 0.172 0.008 0.540 0.272 0.000 0.008
#> GSM955009     2  0.2493    0.44267 0.000 0.884 0.036 0.004 0.000 0.076
#> GSM955011     1  0.0622    0.89386 0.980 0.000 0.000 0.008 0.000 0.012
#> GSM955012     3  0.4294    0.38729 0.000 0.016 0.724 0.016 0.228 0.016
#> GSM955013     3  0.3925    0.23089 0.004 0.012 0.700 0.280 0.000 0.004
#> GSM955015     4  0.5089    0.58877 0.000 0.024 0.280 0.632 0.000 0.064
#> GSM955017     1  0.3316    0.84107 0.828 0.024 0.000 0.124 0.000 0.024
#> GSM955021     2  0.5770    0.30780 0.000 0.532 0.132 0.016 0.000 0.320
#> GSM955025     2  0.6072    0.05110 0.028 0.556 0.008 0.108 0.004 0.296
#> GSM955028     1  0.0291    0.89232 0.992 0.000 0.004 0.000 0.000 0.004
#> GSM955029     2  0.6688    0.24804 0.000 0.428 0.296 0.004 0.240 0.032
#> GSM955030     3  0.5203   -0.34286 0.076 0.000 0.468 0.452 0.000 0.004
#> GSM955032     3  0.6735   -0.15203 0.016 0.272 0.468 0.028 0.000 0.216
#> GSM955033     4  0.1913    0.64813 0.000 0.000 0.080 0.908 0.000 0.012
#> GSM955034     1  0.0665    0.89367 0.980 0.004 0.000 0.008 0.000 0.008
#> GSM955035     6  0.5738    0.44807 0.000 0.020 0.244 0.156 0.000 0.580
#> GSM955036     4  0.4440    0.49488 0.004 0.004 0.380 0.596 0.012 0.004
#> GSM955037     1  0.1699    0.86869 0.928 0.004 0.060 0.004 0.000 0.004
#> GSM955039     4  0.4071    0.63441 0.000 0.000 0.248 0.712 0.004 0.036
#> GSM955041     3  0.2655    0.50095 0.000 0.004 0.876 0.060 0.000 0.060
#> GSM955042     1  0.0405    0.89359 0.988 0.000 0.000 0.004 0.000 0.008
#> GSM955045     2  0.4923    0.36613 0.000 0.564 0.388 0.012 0.028 0.008
#> GSM955046     4  0.3998    0.28405 0.000 0.004 0.492 0.504 0.000 0.000
#> GSM955047     1  0.2836    0.86421 0.872 0.052 0.000 0.060 0.000 0.016
#> GSM955050     4  0.6076    0.16718 0.104 0.096 0.000 0.600 0.000 0.200
#> GSM955052     3  0.2415    0.51446 0.000 0.040 0.900 0.024 0.000 0.036
#> GSM955053     1  0.0146    0.89230 0.996 0.000 0.000 0.000 0.000 0.004
#> GSM955056     2  0.5774    0.33206 0.000 0.452 0.420 0.016 0.000 0.112
#> GSM955058     3  0.6325   -0.18027 0.000 0.064 0.436 0.004 0.412 0.084
#> GSM955059     3  0.4090    0.15001 0.000 0.016 0.652 0.328 0.000 0.004
#> GSM955060     1  0.2386    0.87304 0.896 0.012 0.000 0.064 0.000 0.028
#> GSM955061     5  0.3888    0.54363 0.000 0.012 0.212 0.004 0.752 0.020
#> GSM955065     1  0.1167    0.89179 0.960 0.012 0.000 0.020 0.000 0.008
#> GSM955066     4  0.5479    0.56667 0.072 0.032 0.284 0.608 0.000 0.004
#> GSM955067     1  0.4859    0.65798 0.660 0.000 0.000 0.104 0.004 0.232
#> GSM955073     3  0.1590    0.50669 0.000 0.008 0.936 0.048 0.000 0.008
#> GSM955074     1  0.1924    0.87476 0.920 0.004 0.000 0.000 0.048 0.028
#> GSM955076     6  0.3942    0.41868 0.000 0.120 0.084 0.012 0.000 0.784
#> GSM955078     2  0.6957    0.27891 0.000 0.440 0.144 0.008 0.080 0.328
#> GSM955083     1  0.5589    0.56959 0.640 0.016 0.000 0.108 0.216 0.020
#> GSM955084     5  0.3776    0.60366 0.000 0.096 0.008 0.008 0.808 0.080
#> GSM955086     2  0.6430    0.41772 0.044 0.504 0.312 0.008 0.000 0.132
#> GSM955091     6  0.5766    0.34670 0.000 0.152 0.316 0.004 0.004 0.524
#> GSM955092     2  0.5682    0.31739 0.000 0.524 0.328 0.008 0.000 0.140
#> GSM955093     3  0.1788    0.49097 0.000 0.004 0.916 0.076 0.000 0.004
#> GSM955098     6  0.3797    0.45366 0.004 0.008 0.028 0.192 0.000 0.768
#> GSM955099     6  0.6194    0.18074 0.000 0.308 0.288 0.004 0.000 0.400
#> GSM955100     1  0.3527    0.81773 0.808 0.052 0.000 0.132 0.000 0.008
#> GSM955103     3  0.3200    0.46635 0.000 0.092 0.840 0.008 0.000 0.060
#> GSM955104     3  0.4401    0.30227 0.300 0.008 0.664 0.020 0.000 0.008
#> GSM955106     5  0.4719    0.35224 0.000 0.008 0.360 0.040 0.592 0.000
#> GSM955000     1  0.0653    0.89549 0.980 0.004 0.000 0.004 0.000 0.012
#> GSM955006     1  0.3337    0.84093 0.832 0.032 0.000 0.112 0.000 0.024
#> GSM955007     3  0.4303    0.23739 0.000 0.032 0.676 0.284 0.000 0.008
#> GSM955010     4  0.3652    0.65675 0.020 0.008 0.212 0.760 0.000 0.000
#> GSM955014     1  0.3123    0.84403 0.832 0.000 0.000 0.056 0.000 0.112
#> GSM955018     3  0.4093    0.42653 0.080 0.108 0.784 0.000 0.000 0.028
#> GSM955020     1  0.0146    0.89298 0.996 0.000 0.000 0.000 0.000 0.004
#> GSM955024     3  0.3025    0.42439 0.000 0.024 0.820 0.156 0.000 0.000
#> GSM955026     6  0.5415    0.45833 0.008 0.136 0.044 0.128 0.000 0.684
#> GSM955031     6  0.6850    0.02499 0.240 0.316 0.000 0.052 0.000 0.392
#> GSM955038     6  0.5853    0.26382 0.136 0.024 0.000 0.236 0.008 0.596
#> GSM955040     4  0.5114    0.34735 0.176 0.052 0.000 0.692 0.000 0.080
#> GSM955044     4  0.6893    0.00726 0.000 0.008 0.176 0.428 0.056 0.332
#> GSM955051     1  0.1812    0.87599 0.912 0.000 0.000 0.008 0.000 0.080
#> GSM955055     2  0.4207    0.48486 0.000 0.748 0.104 0.004 0.000 0.144
#> GSM955057     1  0.1458    0.89162 0.948 0.016 0.000 0.020 0.000 0.016
#> GSM955062     2  0.6075    0.42482 0.000 0.560 0.252 0.044 0.000 0.144
#> GSM955063     3  0.3076    0.32310 0.000 0.000 0.760 0.240 0.000 0.000
#> GSM955068     6  0.3597    0.42584 0.000 0.088 0.032 0.040 0.008 0.832
#> GSM955069     3  0.4547    0.44050 0.052 0.072 0.768 0.100 0.000 0.008
#> GSM955070     4  0.3529    0.66563 0.000 0.036 0.172 0.788 0.000 0.004
#> GSM955071     1  0.7426   -0.05609 0.376 0.028 0.120 0.368 0.000 0.108
#> GSM955077     2  0.5979    0.18383 0.192 0.636 0.020 0.060 0.000 0.092
#> GSM955080     2  0.6425   -0.13423 0.000 0.456 0.084 0.024 0.396 0.040
#> GSM955081     3  0.7222   -0.18711 0.004 0.336 0.344 0.076 0.000 0.240
#> GSM955082     3  0.4895    0.07074 0.004 0.364 0.584 0.004 0.004 0.040
#> GSM955085     2  0.4437    0.41082 0.000 0.764 0.096 0.016 0.012 0.112
#> GSM955090     1  0.1777    0.88587 0.932 0.000 0.000 0.012 0.032 0.024
#> GSM955094     4  0.3302    0.66415 0.000 0.028 0.136 0.824 0.004 0.008
#> GSM955096     3  0.5294   -0.08725 0.000 0.356 0.532 0.000 0.000 0.112
#> GSM955102     3  0.5567    0.05959 0.072 0.024 0.580 0.316 0.000 0.008
#> GSM955105     3  0.5761    0.20161 0.240 0.120 0.600 0.000 0.000 0.040

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

consensus_heatmap(res, k = 2)

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

consensus_heatmap(res, k = 3)

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

consensus_heatmap(res, k = 4)

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

consensus_heatmap(res, k = 5)

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

consensus_heatmap(res, k = 6)

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

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

membership_heatmap(res, k = 2)

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

membership_heatmap(res, k = 3)

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

membership_heatmap(res, k = 4)

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

membership_heatmap(res, k = 5)

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

membership_heatmap(res, k = 6)

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

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

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

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

get_signatures(res, k = 3)

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

get_signatures(res, k = 4)

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

get_signatures(res, k = 5)

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

get_signatures(res, k = 6)

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

Signature heatmaps where rows are not scaled:

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

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

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

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

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

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

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

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

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

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

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk SD-NMF-signature_compare

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

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

An example of the output of tb is:

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

The columns in tb are:

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

UMAP plot which shows how samples are separated.

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

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

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

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

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

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

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

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

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

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

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk SD-NMF-collect-classes

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

test_to_known_factors(res)
#>          n genotype/variation(p) k
#> SD:NMF 106                 0.170 2
#> SD:NMF 103                 0.606 3
#> SD:NMF  94                 0.907 4
#> SD:NMF  70                 0.811 5
#> SD:NMF  41                 0.651 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 31589 rows and 108 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.430           0.814       0.886         0.3617 0.662   0.662
#> 3 3 0.259           0.544       0.712         0.5949 0.690   0.538
#> 4 4 0.313           0.586       0.733         0.1725 0.848   0.638
#> 5 5 0.393           0.525       0.681         0.0905 0.956   0.867
#> 6 6 0.444           0.324       0.609         0.0495 0.958   0.870

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
#> GSM955002     2  0.3114      0.898 0.056 0.944
#> GSM955008     2  0.4022      0.897 0.080 0.920
#> GSM955016     1  0.8555      0.682 0.720 0.280
#> GSM955019     2  0.0938      0.891 0.012 0.988
#> GSM955022     2  0.3733      0.899 0.072 0.928
#> GSM955023     2  0.3584      0.900 0.068 0.932
#> GSM955027     2  0.0938      0.890 0.012 0.988
#> GSM955043     2  0.1184      0.892 0.016 0.984
#> GSM955048     1  0.1414      0.835 0.980 0.020
#> GSM955049     2  0.1633      0.898 0.024 0.976
#> GSM955054     2  0.2423      0.901 0.040 0.960
#> GSM955064     2  0.3114      0.900 0.056 0.944
#> GSM955072     2  0.1414      0.893 0.020 0.980
#> GSM955075     2  0.2236      0.901 0.036 0.964
#> GSM955079     2  0.5408      0.879 0.124 0.876
#> GSM955087     1  0.0672      0.833 0.992 0.008
#> GSM955088     2  0.6887      0.840 0.184 0.816
#> GSM955089     1  0.1414      0.836 0.980 0.020
#> GSM955095     2  0.2778      0.902 0.048 0.952
#> GSM955097     2  0.9933      0.129 0.452 0.548
#> GSM955101     2  0.3114      0.900 0.056 0.944
#> GSM954999     1  0.9552      0.493 0.624 0.376
#> GSM955001     2  0.2043      0.901 0.032 0.968
#> GSM955003     2  0.1414      0.898 0.020 0.980
#> GSM955004     2  0.1184      0.890 0.016 0.984
#> GSM955005     2  0.4939      0.883 0.108 0.892
#> GSM955009     2  0.0672      0.889 0.008 0.992
#> GSM955011     2  0.9754      0.421 0.408 0.592
#> GSM955012     2  0.2043      0.900 0.032 0.968
#> GSM955013     2  0.6801      0.821 0.180 0.820
#> GSM955015     2  0.2603      0.901 0.044 0.956
#> GSM955017     1  0.6531      0.780 0.832 0.168
#> GSM955021     2  0.0672      0.895 0.008 0.992
#> GSM955025     2  0.2423      0.892 0.040 0.960
#> GSM955028     1  0.0672      0.833 0.992 0.008
#> GSM955029     2  0.1633      0.899 0.024 0.976
#> GSM955030     2  0.8955      0.668 0.312 0.688
#> GSM955032     2  0.5178      0.883 0.116 0.884
#> GSM955033     2  0.6712      0.816 0.176 0.824
#> GSM955034     1  0.0672      0.833 0.992 0.008
#> GSM955035     2  0.1633      0.899 0.024 0.976
#> GSM955036     2  0.5946      0.871 0.144 0.856
#> GSM955037     1  0.9044      0.514 0.680 0.320
#> GSM955039     2  0.4431      0.897 0.092 0.908
#> GSM955041     2  0.3114      0.901 0.056 0.944
#> GSM955042     1  0.9358      0.538 0.648 0.352
#> GSM955045     2  0.3114      0.901 0.056 0.944
#> GSM955046     2  0.5946      0.871 0.144 0.856
#> GSM955047     1  0.4161      0.834 0.916 0.084
#> GSM955050     2  0.7376      0.770 0.208 0.792
#> GSM955052     2  0.4939      0.886 0.108 0.892
#> GSM955053     1  0.0672      0.833 0.992 0.008
#> GSM955056     2  0.4431      0.893 0.092 0.908
#> GSM955058     2  0.1414      0.898 0.020 0.980
#> GSM955059     2  0.6623      0.850 0.172 0.828
#> GSM955060     1  0.4022      0.832 0.920 0.080
#> GSM955061     2  0.1633      0.899 0.024 0.976
#> GSM955065     1  0.0672      0.833 0.992 0.008
#> GSM955066     2  0.7745      0.788 0.228 0.772
#> GSM955067     1  0.7056      0.783 0.808 0.192
#> GSM955073     2  0.5408      0.879 0.124 0.876
#> GSM955074     1  0.8327      0.703 0.736 0.264
#> GSM955076     2  0.0672      0.889 0.008 0.992
#> GSM955078     2  0.0672      0.889 0.008 0.992
#> GSM955083     2  0.9922      0.170 0.448 0.552
#> GSM955084     2  0.1184      0.890 0.016 0.984
#> GSM955086     2  0.5294      0.883 0.120 0.880
#> GSM955091     2  0.0938      0.890 0.012 0.988
#> GSM955092     2  0.2778      0.901 0.048 0.952
#> GSM955093     2  0.5737      0.873 0.136 0.864
#> GSM955098     2  0.0672      0.889 0.008 0.992
#> GSM955099     2  0.0672      0.889 0.008 0.992
#> GSM955100     2  0.9358      0.549 0.352 0.648
#> GSM955103     2  0.4298      0.895 0.088 0.912
#> GSM955104     2  0.6438      0.854 0.164 0.836
#> GSM955106     2  0.2236      0.900 0.036 0.964
#> GSM955000     1  0.9522      0.393 0.628 0.372
#> GSM955006     2  0.9944      0.260 0.456 0.544
#> GSM955007     2  0.5294      0.885 0.120 0.880
#> GSM955010     2  0.8661      0.702 0.288 0.712
#> GSM955014     1  0.6887      0.789 0.816 0.184
#> GSM955018     2  0.6048      0.868 0.148 0.852
#> GSM955020     1  0.1633      0.837 0.976 0.024
#> GSM955024     2  0.3733      0.898 0.072 0.928
#> GSM955026     2  0.0672      0.889 0.008 0.992
#> GSM955031     2  0.6247      0.831 0.156 0.844
#> GSM955038     1  0.9988      0.256 0.520 0.480
#> GSM955040     2  0.7528      0.762 0.216 0.784
#> GSM955044     2  0.0672      0.889 0.008 0.992
#> GSM955051     1  0.3733      0.835 0.928 0.072
#> GSM955055     2  0.0672      0.892 0.008 0.992
#> GSM955057     1  0.1184      0.836 0.984 0.016
#> GSM955062     2  0.2423      0.901 0.040 0.960
#> GSM955063     2  0.5178      0.883 0.116 0.884
#> GSM955068     2  0.0672      0.889 0.008 0.992
#> GSM955069     2  0.7376      0.816 0.208 0.792
#> GSM955070     2  0.4431      0.890 0.092 0.908
#> GSM955071     2  0.5842      0.858 0.140 0.860
#> GSM955077     2  0.2043      0.894 0.032 0.968
#> GSM955080     2  0.4022      0.898 0.080 0.920
#> GSM955081     2  0.2778      0.897 0.048 0.952
#> GSM955082     2  0.4298      0.896 0.088 0.912
#> GSM955085     2  0.2043      0.896 0.032 0.968
#> GSM955090     1  0.3431      0.834 0.936 0.064
#> GSM955094     2  0.2043      0.897 0.032 0.968
#> GSM955096     2  0.4939      0.886 0.108 0.892
#> GSM955102     2  0.9922      0.312 0.448 0.552
#> GSM955105     2  0.5946      0.870 0.144 0.856

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1    p2    p3
#> GSM955002     2  0.6318     0.1785 0.008 0.636 0.356
#> GSM955008     3  0.6500     0.5276 0.004 0.464 0.532
#> GSM955016     1  0.9248     0.6054 0.516 0.188 0.296
#> GSM955019     2  0.0892     0.7038 0.000 0.980 0.020
#> GSM955022     3  0.6483     0.5213 0.004 0.452 0.544
#> GSM955023     3  0.6495     0.5167 0.004 0.460 0.536
#> GSM955027     2  0.2959     0.6873 0.000 0.900 0.100
#> GSM955043     2  0.2066     0.7041 0.000 0.940 0.060
#> GSM955048     1  0.2939     0.7965 0.916 0.012 0.072
#> GSM955049     2  0.4399     0.5974 0.000 0.812 0.188
#> GSM955054     2  0.4796     0.5484 0.000 0.780 0.220
#> GSM955064     2  0.6267    -0.2547 0.000 0.548 0.452
#> GSM955072     2  0.1163     0.7002 0.000 0.972 0.028
#> GSM955075     2  0.2959     0.6970 0.000 0.900 0.100
#> GSM955079     3  0.6033     0.6938 0.004 0.336 0.660
#> GSM955087     1  0.1529     0.7864 0.960 0.000 0.040
#> GSM955088     3  0.7250     0.6978 0.056 0.288 0.656
#> GSM955089     1  0.2200     0.7947 0.940 0.004 0.056
#> GSM955095     2  0.3267     0.6911 0.000 0.884 0.116
#> GSM955097     2  0.9738     0.0629 0.288 0.448 0.264
#> GSM955101     2  0.6267    -0.2547 0.000 0.548 0.452
#> GSM954999     1  0.9724     0.4543 0.448 0.252 0.300
#> GSM955001     2  0.2878     0.6967 0.000 0.904 0.096
#> GSM955003     2  0.4842     0.5296 0.000 0.776 0.224
#> GSM955004     2  0.1163     0.6958 0.000 0.972 0.028
#> GSM955005     2  0.7584    -0.4605 0.040 0.488 0.472
#> GSM955009     2  0.1163     0.7014 0.000 0.972 0.028
#> GSM955011     3  0.9519     0.4092 0.292 0.224 0.484
#> GSM955012     2  0.2796     0.6978 0.000 0.908 0.092
#> GSM955013     3  0.7624     0.4668 0.052 0.368 0.580
#> GSM955015     2  0.5058     0.4948 0.000 0.756 0.244
#> GSM955017     1  0.6699     0.7228 0.700 0.044 0.256
#> GSM955021     2  0.3619     0.6584 0.000 0.864 0.136
#> GSM955025     2  0.4291     0.6480 0.008 0.840 0.152
#> GSM955028     1  0.1529     0.7864 0.960 0.000 0.040
#> GSM955029     2  0.1753     0.7047 0.000 0.952 0.048
#> GSM955030     3  0.7988     0.6119 0.144 0.200 0.656
#> GSM955032     2  0.6274    -0.2014 0.000 0.544 0.456
#> GSM955033     2  0.6744     0.4235 0.032 0.668 0.300
#> GSM955034     1  0.1529     0.7864 0.960 0.000 0.040
#> GSM955035     2  0.2796     0.6971 0.000 0.908 0.092
#> GSM955036     3  0.6051     0.7101 0.012 0.292 0.696
#> GSM955037     1  0.6209     0.4514 0.628 0.004 0.368
#> GSM955039     3  0.6647     0.6404 0.012 0.396 0.592
#> GSM955041     2  0.6192    -0.1490 0.000 0.580 0.420
#> GSM955042     1  0.9629     0.5033 0.456 0.224 0.320
#> GSM955045     2  0.5178     0.4949 0.000 0.744 0.256
#> GSM955046     3  0.6051     0.7101 0.012 0.292 0.696
#> GSM955047     1  0.5734     0.7872 0.788 0.048 0.164
#> GSM955050     3  0.8128     0.2773 0.068 0.440 0.492
#> GSM955052     3  0.6432     0.5861 0.004 0.428 0.568
#> GSM955053     1  0.1289     0.7873 0.968 0.000 0.032
#> GSM955056     2  0.6126     0.0424 0.000 0.600 0.400
#> GSM955058     2  0.1643     0.7046 0.000 0.956 0.044
#> GSM955059     3  0.6420     0.7113 0.024 0.288 0.688
#> GSM955060     1  0.5092     0.7871 0.804 0.020 0.176
#> GSM955061     2  0.1753     0.7047 0.000 0.952 0.048
#> GSM955065     1  0.1529     0.7864 0.960 0.000 0.040
#> GSM955066     3  0.7495     0.6579 0.084 0.248 0.668
#> GSM955067     1  0.8201     0.7132 0.612 0.112 0.276
#> GSM955073     3  0.5754     0.7031 0.004 0.296 0.700
#> GSM955074     1  0.9133     0.6253 0.528 0.176 0.296
#> GSM955076     2  0.2066     0.7017 0.000 0.940 0.060
#> GSM955078     2  0.0424     0.6977 0.000 0.992 0.008
#> GSM955083     2  0.9836    -0.0275 0.280 0.424 0.296
#> GSM955084     2  0.1163     0.6958 0.000 0.972 0.028
#> GSM955086     3  0.6339     0.6843 0.008 0.360 0.632
#> GSM955091     2  0.1031     0.7027 0.000 0.976 0.024
#> GSM955092     2  0.5733     0.2788 0.000 0.676 0.324
#> GSM955093     3  0.5623     0.7038 0.004 0.280 0.716
#> GSM955098     2  0.0424     0.6983 0.000 0.992 0.008
#> GSM955099     2  0.0592     0.6974 0.000 0.988 0.012
#> GSM955100     3  0.8911     0.5008 0.204 0.224 0.572
#> GSM955103     3  0.6359     0.6312 0.004 0.404 0.592
#> GSM955104     3  0.6501     0.7047 0.020 0.316 0.664
#> GSM955106     2  0.2959     0.6954 0.000 0.900 0.100
#> GSM955000     1  0.7747     0.2831 0.544 0.052 0.404
#> GSM955006     3  0.9500     0.2361 0.344 0.196 0.460
#> GSM955007     3  0.6102     0.7037 0.008 0.320 0.672
#> GSM955010     3  0.8103     0.6305 0.120 0.248 0.632
#> GSM955014     1  0.8142     0.7169 0.620 0.112 0.268
#> GSM955018     3  0.6445     0.7101 0.020 0.308 0.672
#> GSM955020     1  0.2301     0.7956 0.936 0.004 0.060
#> GSM955024     3  0.6309     0.4086 0.000 0.500 0.500
#> GSM955026     2  0.1289     0.6953 0.000 0.968 0.032
#> GSM955031     2  0.8350    -0.1313 0.088 0.532 0.380
#> GSM955038     2  0.9963    -0.2990 0.348 0.360 0.292
#> GSM955040     3  0.8273     0.2002 0.076 0.448 0.476
#> GSM955044     2  0.1289     0.6904 0.000 0.968 0.032
#> GSM955051     1  0.5778     0.7823 0.768 0.032 0.200
#> GSM955055     2  0.2356     0.7007 0.000 0.928 0.072
#> GSM955057     1  0.3038     0.7958 0.896 0.000 0.104
#> GSM955062     2  0.5327     0.4469 0.000 0.728 0.272
#> GSM955063     3  0.5591     0.7026 0.000 0.304 0.696
#> GSM955068     2  0.0237     0.6988 0.000 0.996 0.004
#> GSM955069     3  0.6875     0.6969 0.056 0.244 0.700
#> GSM955070     2  0.4931     0.5883 0.000 0.768 0.232
#> GSM955071     2  0.7993    -0.3855 0.060 0.484 0.456
#> GSM955077     2  0.3644     0.6796 0.004 0.872 0.124
#> GSM955080     2  0.4473     0.6522 0.008 0.828 0.164
#> GSM955081     2  0.6062     0.3810 0.016 0.708 0.276
#> GSM955082     3  0.6676     0.4790 0.008 0.476 0.516
#> GSM955085     2  0.3482     0.6807 0.000 0.872 0.128
#> GSM955090     1  0.5849     0.7771 0.756 0.028 0.216
#> GSM955094     2  0.2878     0.6993 0.000 0.904 0.096
#> GSM955096     3  0.6168     0.6132 0.000 0.412 0.588
#> GSM955102     3  0.5831     0.3191 0.284 0.008 0.708
#> GSM955105     3  0.6313     0.7119 0.016 0.308 0.676

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM955002     2  0.6801    0.00307 0.000 0.456 0.448 0.096
#> GSM955008     3  0.4775    0.61489 0.000 0.232 0.740 0.028
#> GSM955016     4  0.6625    0.63620 0.184 0.076 0.052 0.688
#> GSM955019     2  0.3128    0.76481 0.000 0.884 0.076 0.040
#> GSM955022     3  0.5361    0.62518 0.000 0.208 0.724 0.068
#> GSM955023     3  0.5397    0.61924 0.000 0.220 0.716 0.064
#> GSM955027     2  0.4323    0.74496 0.000 0.788 0.184 0.028
#> GSM955043     2  0.3856    0.76560 0.000 0.832 0.136 0.032
#> GSM955048     1  0.4737    0.51781 0.728 0.000 0.020 0.252
#> GSM955049     2  0.4908    0.63609 0.000 0.692 0.292 0.016
#> GSM955054     2  0.5807    0.46094 0.000 0.596 0.364 0.040
#> GSM955064     3  0.5289    0.42805 0.000 0.344 0.636 0.020
#> GSM955072     2  0.3323    0.76097 0.000 0.876 0.060 0.064
#> GSM955075     2  0.4500    0.73013 0.000 0.776 0.192 0.032
#> GSM955079     3  0.2631    0.70837 0.008 0.064 0.912 0.016
#> GSM955087     1  0.0188    0.71104 0.996 0.000 0.004 0.000
#> GSM955088     3  0.5164    0.70719 0.044 0.056 0.796 0.104
#> GSM955089     1  0.2329    0.70257 0.916 0.000 0.012 0.072
#> GSM955095     2  0.4831    0.71721 0.000 0.752 0.208 0.040
#> GSM955097     4  0.8678    0.39683 0.092 0.316 0.128 0.464
#> GSM955101     3  0.5306    0.42039 0.000 0.348 0.632 0.020
#> GSM954999     4  0.6589    0.64427 0.108 0.104 0.076 0.712
#> GSM955001     2  0.4919    0.73745 0.000 0.752 0.200 0.048
#> GSM955003     2  0.5812    0.52475 0.000 0.624 0.328 0.048
#> GSM955004     2  0.2565    0.74536 0.000 0.912 0.032 0.056
#> GSM955005     3  0.7029    0.50161 0.024 0.308 0.584 0.084
#> GSM955009     2  0.3088    0.74148 0.000 0.888 0.052 0.060
#> GSM955011     3  0.9142    0.30204 0.224 0.100 0.440 0.236
#> GSM955012     2  0.4245    0.73543 0.000 0.784 0.196 0.020
#> GSM955013     3  0.7308    0.52021 0.004 0.188 0.552 0.256
#> GSM955015     2  0.5912    0.27961 0.000 0.524 0.440 0.036
#> GSM955017     1  0.6757    0.40425 0.572 0.000 0.120 0.308
#> GSM955021     2  0.5184    0.70053 0.000 0.732 0.212 0.056
#> GSM955025     2  0.5650    0.69915 0.000 0.716 0.180 0.104
#> GSM955028     1  0.0188    0.71104 0.996 0.000 0.004 0.000
#> GSM955029     2  0.3495    0.75702 0.000 0.844 0.140 0.016
#> GSM955030     3  0.6396    0.60341 0.108 0.028 0.700 0.164
#> GSM955032     3  0.5393    0.46657 0.008 0.272 0.692 0.028
#> GSM955033     2  0.7290    0.32282 0.000 0.504 0.168 0.328
#> GSM955034     1  0.0188    0.71104 0.996 0.000 0.004 0.000
#> GSM955035     2  0.4549    0.73932 0.000 0.776 0.188 0.036
#> GSM955036     3  0.3574    0.71263 0.016 0.064 0.876 0.044
#> GSM955037     1  0.5453    0.35972 0.660 0.000 0.304 0.036
#> GSM955039     3  0.4685    0.68936 0.000 0.156 0.784 0.060
#> GSM955041     3  0.5313    0.35515 0.000 0.376 0.608 0.016
#> GSM955042     4  0.6161    0.64271 0.108 0.084 0.068 0.740
#> GSM955045     2  0.5693    0.27998 0.000 0.504 0.472 0.024
#> GSM955046     3  0.3574    0.71263 0.016 0.064 0.876 0.044
#> GSM955047     1  0.5395    0.45312 0.628 0.016 0.004 0.352
#> GSM955050     3  0.8239    0.30199 0.016 0.244 0.408 0.332
#> GSM955052     3  0.4199    0.65958 0.000 0.164 0.804 0.032
#> GSM955053     1  0.0657    0.71068 0.984 0.000 0.004 0.012
#> GSM955056     3  0.6098    0.34489 0.000 0.316 0.616 0.068
#> GSM955058     2  0.3390    0.75870 0.000 0.852 0.132 0.016
#> GSM955059     3  0.4255    0.71607 0.024 0.056 0.844 0.076
#> GSM955060     1  0.5331    0.50828 0.644 0.000 0.024 0.332
#> GSM955061     2  0.3597    0.75539 0.000 0.836 0.148 0.016
#> GSM955065     1  0.0188    0.71104 0.996 0.000 0.004 0.000
#> GSM955066     3  0.5910    0.66671 0.068 0.044 0.744 0.144
#> GSM955067     4  0.7144    0.44966 0.340 0.056 0.044 0.560
#> GSM955073     3  0.1624    0.70359 0.000 0.028 0.952 0.020
#> GSM955074     4  0.6546    0.63059 0.192 0.076 0.044 0.688
#> GSM955076     2  0.3833    0.74131 0.000 0.848 0.080 0.072
#> GSM955078     2  0.2408    0.75386 0.000 0.920 0.044 0.036
#> GSM955083     4  0.8058    0.52305 0.072 0.268 0.112 0.548
#> GSM955084     2  0.2565    0.74536 0.000 0.912 0.032 0.056
#> GSM955086     3  0.3313    0.71311 0.008 0.084 0.880 0.028
#> GSM955091     2  0.2660    0.76136 0.000 0.908 0.056 0.036
#> GSM955092     2  0.6213    0.14758 0.000 0.484 0.464 0.052
#> GSM955093     3  0.1962    0.70461 0.008 0.024 0.944 0.024
#> GSM955098     2  0.2816    0.74068 0.000 0.900 0.036 0.064
#> GSM955099     2  0.2773    0.75988 0.000 0.900 0.072 0.028
#> GSM955100     3  0.7712    0.36220 0.100 0.040 0.512 0.348
#> GSM955103     3  0.4277    0.68340 0.004 0.172 0.800 0.024
#> GSM955104     3  0.4014    0.71785 0.008 0.064 0.848 0.080
#> GSM955106     2  0.4485    0.72666 0.000 0.772 0.200 0.028
#> GSM955000     1  0.6635    0.22568 0.524 0.000 0.388 0.088
#> GSM955006     3  0.9311    0.15614 0.284 0.096 0.384 0.236
#> GSM955007     3  0.4149    0.71111 0.020 0.096 0.844 0.040
#> GSM955010     3  0.6672    0.58494 0.088 0.036 0.672 0.204
#> GSM955014     4  0.7083    0.43744 0.344 0.056 0.040 0.560
#> GSM955018     3  0.2780    0.71151 0.024 0.048 0.912 0.016
#> GSM955020     1  0.2342    0.70076 0.912 0.000 0.008 0.080
#> GSM955024     3  0.4857    0.54213 0.000 0.284 0.700 0.016
#> GSM955026     2  0.3156    0.72467 0.000 0.884 0.048 0.068
#> GSM955031     3  0.8602    0.16707 0.044 0.348 0.408 0.200
#> GSM955038     4  0.5964    0.62514 0.036 0.192 0.052 0.720
#> GSM955040     3  0.8414    0.18963 0.020 0.268 0.360 0.352
#> GSM955044     2  0.2222    0.71646 0.000 0.924 0.016 0.060
#> GSM955051     1  0.4888    0.35460 0.588 0.000 0.000 0.412
#> GSM955055     2  0.4337    0.75113 0.000 0.808 0.140 0.052
#> GSM955057     1  0.3569    0.63343 0.804 0.000 0.000 0.196
#> GSM955062     2  0.5510    0.43655 0.000 0.600 0.376 0.024
#> GSM955063     3  0.1796    0.70429 0.004 0.032 0.948 0.016
#> GSM955068     2  0.2840    0.75143 0.000 0.900 0.044 0.056
#> GSM955069     3  0.4277    0.70152 0.052 0.028 0.844 0.076
#> GSM955070     2  0.6790    0.54026 0.000 0.604 0.228 0.168
#> GSM955071     3  0.7879    0.43394 0.020 0.288 0.508 0.184
#> GSM955077     2  0.5277    0.71967 0.000 0.752 0.132 0.116
#> GSM955080     2  0.6513    0.65636 0.004 0.640 0.236 0.120
#> GSM955081     2  0.6626    0.34710 0.000 0.544 0.364 0.092
#> GSM955082     3  0.5366    0.60564 0.004 0.240 0.712 0.044
#> GSM955085     2  0.5454    0.73250 0.000 0.732 0.172 0.096
#> GSM955090     4  0.4843    0.13484 0.396 0.000 0.000 0.604
#> GSM955094     2  0.4720    0.74415 0.000 0.768 0.188 0.044
#> GSM955096     3  0.4050    0.67334 0.000 0.144 0.820 0.036
#> GSM955102     3  0.5857    0.41485 0.308 0.000 0.636 0.056
#> GSM955105     3  0.3232    0.71368 0.012 0.028 0.888 0.072

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM955002     3  0.7263     0.0332 0.000 0.404 0.412 0.080 0.104
#> GSM955008     3  0.5006     0.6040 0.000 0.184 0.712 0.004 0.100
#> GSM955016     4  0.4642     0.5628 0.120 0.032 0.020 0.792 0.036
#> GSM955019     2  0.4186     0.6923 0.000 0.796 0.064 0.012 0.128
#> GSM955022     3  0.5714     0.5916 0.000 0.184 0.688 0.072 0.056
#> GSM955023     3  0.5681     0.5863 0.000 0.196 0.684 0.072 0.048
#> GSM955027     2  0.4693     0.6701 0.000 0.752 0.148 0.008 0.092
#> GSM955043     2  0.4671     0.6837 0.000 0.776 0.092 0.028 0.104
#> GSM955048     1  0.5212     0.5169 0.696 0.000 0.016 0.216 0.072
#> GSM955049     2  0.5586     0.5534 0.000 0.648 0.260 0.020 0.072
#> GSM955054     2  0.6460     0.3029 0.000 0.476 0.356 0.004 0.164
#> GSM955064     3  0.5886     0.4410 0.000 0.288 0.608 0.020 0.084
#> GSM955072     2  0.4566     0.6767 0.000 0.768 0.032 0.040 0.160
#> GSM955075     2  0.5843     0.6194 0.000 0.684 0.168 0.056 0.092
#> GSM955079     3  0.2619     0.6814 0.004 0.024 0.896 0.004 0.072
#> GSM955087     1  0.0404     0.7224 0.988 0.000 0.000 0.000 0.012
#> GSM955088     3  0.5212     0.6530 0.028 0.032 0.756 0.048 0.136
#> GSM955089     1  0.2214     0.7137 0.916 0.000 0.004 0.052 0.028
#> GSM955095     2  0.6011     0.6042 0.000 0.664 0.184 0.052 0.100
#> GSM955097     4  0.7663     0.4499 0.052 0.204 0.080 0.564 0.100
#> GSM955101     3  0.5886     0.4426 0.000 0.288 0.608 0.020 0.084
#> GSM954999     4  0.3992     0.5826 0.040 0.036 0.024 0.844 0.056
#> GSM955001     2  0.5533     0.6456 0.000 0.684 0.176 0.016 0.124
#> GSM955003     2  0.6470     0.4147 0.000 0.552 0.308 0.032 0.108
#> GSM955004     2  0.3936     0.6494 0.000 0.800 0.004 0.052 0.144
#> GSM955005     3  0.7091     0.4609 0.024 0.276 0.560 0.064 0.076
#> GSM955009     2  0.4402     0.6085 0.000 0.688 0.012 0.008 0.292
#> GSM955011     3  0.9139     0.2259 0.220 0.064 0.384 0.184 0.148
#> GSM955012     2  0.5574     0.6265 0.000 0.696 0.176 0.036 0.092
#> GSM955013     3  0.7162     0.4048 0.000 0.144 0.504 0.292 0.060
#> GSM955015     2  0.6546     0.1292 0.000 0.428 0.412 0.008 0.152
#> GSM955017     1  0.7350     0.4458 0.520 0.000 0.080 0.224 0.176
#> GSM955021     2  0.6218     0.5361 0.000 0.544 0.152 0.004 0.300
#> GSM955025     2  0.6718     0.5968 0.000 0.596 0.120 0.072 0.212
#> GSM955028     1  0.0404     0.7224 0.988 0.000 0.000 0.000 0.012
#> GSM955029     2  0.4971     0.6629 0.000 0.752 0.112 0.028 0.108
#> GSM955030     3  0.6631     0.5626 0.100 0.016 0.656 0.124 0.104
#> GSM955032     3  0.5572     0.5265 0.004 0.112 0.660 0.004 0.220
#> GSM955033     2  0.7665     0.1380 0.000 0.428 0.124 0.336 0.112
#> GSM955034     1  0.0404     0.7224 0.988 0.000 0.000 0.000 0.012
#> GSM955035     2  0.5533     0.6440 0.000 0.684 0.176 0.016 0.124
#> GSM955036     3  0.4296     0.6726 0.008 0.048 0.808 0.024 0.112
#> GSM955037     1  0.5271     0.3930 0.652 0.000 0.284 0.016 0.048
#> GSM955039     3  0.4958     0.6619 0.000 0.136 0.756 0.056 0.052
#> GSM955041     3  0.5949     0.3752 0.000 0.328 0.576 0.020 0.076
#> GSM955042     4  0.3422     0.5757 0.044 0.020 0.020 0.872 0.044
#> GSM955045     2  0.6412     0.1576 0.000 0.436 0.432 0.012 0.120
#> GSM955046     3  0.4296     0.6726 0.008 0.048 0.808 0.024 0.112
#> GSM955047     1  0.6414     0.4849 0.560 0.012 0.000 0.248 0.180
#> GSM955050     4  0.8513    -0.1377 0.012 0.176 0.324 0.344 0.144
#> GSM955052     3  0.4425     0.6385 0.000 0.112 0.772 0.004 0.112
#> GSM955053     1  0.0290     0.7222 0.992 0.000 0.000 0.008 0.000
#> GSM955056     3  0.6380     0.3791 0.000 0.176 0.524 0.004 0.296
#> GSM955058     2  0.4874     0.6659 0.000 0.760 0.104 0.028 0.108
#> GSM955059     3  0.4298     0.6834 0.016 0.040 0.824 0.064 0.056
#> GSM955060     1  0.6190     0.5197 0.584 0.000 0.008 0.236 0.172
#> GSM955061     2  0.5063     0.6598 0.000 0.744 0.120 0.028 0.108
#> GSM955065     1  0.0404     0.7224 0.988 0.000 0.000 0.000 0.012
#> GSM955066     3  0.6759     0.5923 0.048 0.040 0.644 0.100 0.168
#> GSM955067     4  0.6023     0.3433 0.272 0.020 0.008 0.620 0.080
#> GSM955073     3  0.1877     0.6744 0.000 0.012 0.924 0.000 0.064
#> GSM955074     4  0.4694     0.5543 0.128 0.036 0.012 0.784 0.040
#> GSM955076     2  0.4774     0.5936 0.000 0.644 0.016 0.012 0.328
#> GSM955078     2  0.3116     0.6679 0.000 0.852 0.012 0.012 0.124
#> GSM955083     4  0.6580     0.5230 0.028 0.188 0.056 0.648 0.080
#> GSM955084     2  0.3936     0.6494 0.000 0.800 0.004 0.052 0.144
#> GSM955086     3  0.3368     0.6883 0.004 0.040 0.856 0.008 0.092
#> GSM955091     2  0.3405     0.6880 0.000 0.848 0.036 0.012 0.104
#> GSM955092     3  0.6780    -0.0323 0.000 0.368 0.404 0.004 0.224
#> GSM955093     3  0.1798     0.6723 0.004 0.004 0.928 0.000 0.064
#> GSM955098     2  0.4323     0.6458 0.000 0.760 0.020 0.024 0.196
#> GSM955099     2  0.2929     0.6903 0.000 0.876 0.044 0.004 0.076
#> GSM955100     3  0.7990     0.2561 0.088 0.012 0.448 0.280 0.172
#> GSM955103     3  0.4495     0.6577 0.004 0.148 0.776 0.012 0.060
#> GSM955104     3  0.4228     0.6895 0.008 0.048 0.824 0.068 0.052
#> GSM955106     2  0.5814     0.6192 0.000 0.684 0.172 0.052 0.092
#> GSM955000     1  0.6411     0.2525 0.528 0.000 0.356 0.044 0.072
#> GSM955006     3  0.9151     0.0895 0.284 0.052 0.328 0.192 0.144
#> GSM955007     3  0.4593     0.6775 0.012 0.068 0.792 0.020 0.108
#> GSM955010     3  0.7038     0.5074 0.072 0.020 0.612 0.160 0.136
#> GSM955014     4  0.6094     0.3308 0.276 0.020 0.008 0.612 0.084
#> GSM955018     3  0.2797     0.6826 0.020 0.016 0.896 0.008 0.060
#> GSM955020     1  0.2104     0.7126 0.916 0.000 0.000 0.060 0.024
#> GSM955024     3  0.5060     0.5374 0.000 0.240 0.688 0.008 0.064
#> GSM955026     2  0.4765     0.6242 0.000 0.728 0.020 0.040 0.212
#> GSM955031     3  0.8821     0.0712 0.024 0.264 0.300 0.124 0.288
#> GSM955038     4  0.3750     0.5893 0.004 0.096 0.012 0.836 0.052
#> GSM955040     4  0.8529     0.0181 0.012 0.172 0.268 0.384 0.164
#> GSM955044     2  0.4285     0.6191 0.000 0.752 0.008 0.032 0.208
#> GSM955051     1  0.6170     0.3838 0.524 0.000 0.000 0.320 0.156
#> GSM955055     2  0.5516     0.6150 0.000 0.624 0.088 0.004 0.284
#> GSM955057     1  0.4020     0.6650 0.796 0.000 0.000 0.108 0.096
#> GSM955062     2  0.6092     0.3539 0.000 0.552 0.340 0.016 0.092
#> GSM955063     3  0.1682     0.6795 0.000 0.012 0.940 0.004 0.044
#> GSM955068     2  0.3943     0.6651 0.000 0.796 0.020 0.020 0.164
#> GSM955069     3  0.4216     0.6637 0.040 0.008 0.824 0.068 0.060
#> GSM955070     2  0.7345     0.4517 0.000 0.536 0.188 0.180 0.096
#> GSM955071     3  0.8255     0.3901 0.016 0.232 0.452 0.176 0.124
#> GSM955077     2  0.6715     0.5538 0.004 0.548 0.068 0.068 0.312
#> GSM955080     2  0.7484     0.5184 0.000 0.528 0.192 0.144 0.136
#> GSM955081     2  0.7096     0.2516 0.000 0.488 0.332 0.064 0.116
#> GSM955082     3  0.5935     0.5845 0.004 0.196 0.660 0.024 0.116
#> GSM955085     2  0.6885     0.5901 0.000 0.548 0.108 0.068 0.276
#> GSM955090     4  0.6024     0.1487 0.296 0.000 0.000 0.556 0.148
#> GSM955094     2  0.5475     0.6548 0.000 0.720 0.136 0.052 0.092
#> GSM955096     3  0.4049     0.6495 0.000 0.084 0.792 0.000 0.124
#> GSM955102     3  0.5913     0.4074 0.296 0.000 0.588 0.008 0.108
#> GSM955105     3  0.3587     0.6757 0.000 0.012 0.824 0.024 0.140

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM955002     2  0.7246   -0.20933 0.000 0.388 0.376 0.076 0.028 0.132
#> GSM955008     3  0.5711    0.33874 0.000 0.176 0.628 0.004 0.032 0.160
#> GSM955016     4  0.4024    0.47882 0.032 0.016 0.012 0.796 0.136 0.008
#> GSM955019     2  0.3980    0.49057 0.000 0.780 0.056 0.012 0.004 0.148
#> GSM955022     3  0.6028    0.37730 0.000 0.184 0.644 0.068 0.036 0.068
#> GSM955023     3  0.5967    0.37074 0.000 0.192 0.644 0.064 0.032 0.068
#> GSM955027     2  0.4104    0.47978 0.000 0.772 0.132 0.000 0.016 0.080
#> GSM955043     2  0.4624    0.48916 0.000 0.764 0.056 0.020 0.040 0.120
#> GSM955048     1  0.5913   -0.04133 0.548 0.000 0.016 0.208 0.228 0.000
#> GSM955049     2  0.5110    0.37107 0.000 0.656 0.232 0.004 0.012 0.096
#> GSM955054     2  0.6515    0.03273 0.000 0.432 0.304 0.004 0.020 0.240
#> GSM955064     3  0.6305    0.24140 0.000 0.276 0.544 0.008 0.048 0.124
#> GSM955072     2  0.4330    0.47484 0.000 0.748 0.020 0.028 0.016 0.188
#> GSM955075     2  0.5928    0.46055 0.000 0.660 0.128 0.040 0.040 0.132
#> GSM955079     3  0.4006    0.48502 0.004 0.028 0.800 0.008 0.036 0.124
#> GSM955087     1  0.0000    0.68490 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM955088     3  0.6296    0.35934 0.016 0.032 0.632 0.028 0.152 0.140
#> GSM955089     1  0.2380    0.62205 0.892 0.000 0.004 0.036 0.068 0.000
#> GSM955095     2  0.6149    0.44460 0.000 0.640 0.148 0.040 0.048 0.124
#> GSM955097     4  0.7275    0.34122 0.012 0.156 0.076 0.568 0.084 0.104
#> GSM955101     3  0.6305    0.24207 0.000 0.276 0.544 0.008 0.048 0.124
#> GSM954999     4  0.2450    0.49640 0.012 0.020 0.004 0.908 0.036 0.020
#> GSM955001     2  0.5427    0.44129 0.000 0.676 0.160 0.016 0.024 0.124
#> GSM955003     2  0.6188    0.13642 0.000 0.516 0.284 0.032 0.000 0.168
#> GSM955004     2  0.4509    0.47928 0.000 0.744 0.004 0.040 0.044 0.168
#> GSM955005     3  0.7586    0.07407 0.024 0.264 0.492 0.052 0.076 0.092
#> GSM955009     2  0.4249    0.28269 0.000 0.624 0.008 0.004 0.008 0.356
#> GSM955011     3  0.9286   -0.08493 0.188 0.068 0.324 0.148 0.192 0.080
#> GSM955012     2  0.5659    0.46682 0.000 0.668 0.140 0.020 0.036 0.136
#> GSM955013     3  0.7336    0.15013 0.000 0.124 0.472 0.280 0.060 0.064
#> GSM955015     2  0.6810   -0.00444 0.000 0.388 0.344 0.008 0.032 0.228
#> GSM955017     5  0.7081    0.57707 0.336 0.000 0.068 0.124 0.444 0.028
#> GSM955021     2  0.5875    0.10378 0.000 0.496 0.124 0.000 0.020 0.360
#> GSM955025     2  0.6444    0.15490 0.000 0.548 0.080 0.064 0.024 0.284
#> GSM955028     1  0.0000    0.68490 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM955029     2  0.4817    0.49808 0.000 0.740 0.088 0.012 0.032 0.128
#> GSM955030     3  0.6999    0.33136 0.080 0.012 0.588 0.084 0.172 0.064
#> GSM955032     3  0.5943    0.19263 0.004 0.096 0.572 0.008 0.028 0.292
#> GSM955033     2  0.7713   -0.06278 0.000 0.396 0.076 0.332 0.084 0.112
#> GSM955034     1  0.0000    0.68490 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM955035     2  0.5185    0.44659 0.000 0.676 0.156 0.012 0.008 0.148
#> GSM955036     3  0.5683    0.46863 0.004 0.036 0.684 0.028 0.136 0.112
#> GSM955037     1  0.5369    0.30599 0.660 0.000 0.212 0.004 0.084 0.040
#> GSM955039     3  0.5515    0.47092 0.000 0.128 0.704 0.060 0.036 0.072
#> GSM955041     3  0.6420    0.17514 0.000 0.316 0.508 0.008 0.052 0.116
#> GSM955042     4  0.1967    0.49272 0.016 0.012 0.004 0.928 0.036 0.004
#> GSM955045     2  0.6534    0.06477 0.000 0.416 0.380 0.004 0.036 0.164
#> GSM955046     3  0.5683    0.46863 0.004 0.036 0.684 0.028 0.136 0.112
#> GSM955047     5  0.5702    0.72117 0.304 0.004 0.000 0.148 0.540 0.004
#> GSM955050     4  0.8540   -0.29532 0.000 0.160 0.256 0.332 0.128 0.124
#> GSM955052     3  0.5279    0.39379 0.000 0.120 0.684 0.004 0.036 0.156
#> GSM955053     1  0.0692    0.67651 0.976 0.000 0.000 0.004 0.020 0.000
#> GSM955056     3  0.6541   -0.17475 0.000 0.160 0.412 0.000 0.048 0.380
#> GSM955058     2  0.4729    0.49996 0.000 0.748 0.084 0.012 0.032 0.124
#> GSM955059     3  0.4698    0.50098 0.016 0.024 0.784 0.052 0.076 0.048
#> GSM955060     5  0.5792    0.71078 0.344 0.000 0.004 0.132 0.512 0.008
#> GSM955061     2  0.4910    0.49656 0.000 0.732 0.096 0.012 0.032 0.128
#> GSM955065     1  0.0000    0.68490 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM955066     3  0.7578    0.23985 0.028 0.040 0.516 0.068 0.200 0.148
#> GSM955067     4  0.5615    0.22502 0.116 0.008 0.000 0.592 0.272 0.012
#> GSM955073     3  0.3510    0.49611 0.000 0.012 0.828 0.004 0.072 0.084
#> GSM955074     4  0.4062    0.47179 0.036 0.016 0.004 0.788 0.144 0.012
#> GSM955076     2  0.4063    0.23364 0.000 0.572 0.004 0.000 0.004 0.420
#> GSM955078     2  0.2865    0.48112 0.000 0.840 0.000 0.008 0.012 0.140
#> GSM955083     4  0.5490    0.42837 0.008 0.164 0.028 0.700 0.056 0.044
#> GSM955084     2  0.4509    0.47928 0.000 0.744 0.004 0.040 0.044 0.168
#> GSM955086     3  0.4444    0.47372 0.004 0.040 0.768 0.008 0.040 0.140
#> GSM955091     2  0.3091    0.50291 0.000 0.844 0.028 0.008 0.004 0.116
#> GSM955092     2  0.6486   -0.27792 0.000 0.340 0.336 0.000 0.016 0.308
#> GSM955093     3  0.3569    0.49322 0.000 0.004 0.820 0.008 0.084 0.084
#> GSM955098     2  0.4377    0.41369 0.000 0.708 0.012 0.012 0.024 0.244
#> GSM955099     2  0.2420    0.51359 0.000 0.888 0.032 0.000 0.004 0.076
#> GSM955100     3  0.8431   -0.05782 0.060 0.016 0.352 0.232 0.244 0.096
#> GSM955103     3  0.5218    0.45953 0.000 0.160 0.704 0.012 0.048 0.076
#> GSM955104     3  0.4765    0.50143 0.004 0.056 0.776 0.060 0.064 0.040
#> GSM955106     2  0.5901    0.46053 0.000 0.660 0.132 0.036 0.040 0.132
#> GSM955000     1  0.6670    0.13991 0.508 0.000 0.280 0.016 0.148 0.048
#> GSM955006     3  0.9310   -0.14215 0.244 0.056 0.276 0.164 0.180 0.080
#> GSM955007     3  0.5765    0.47267 0.008 0.060 0.684 0.016 0.112 0.120
#> GSM955010     3  0.7545    0.23488 0.056 0.020 0.528 0.136 0.188 0.072
#> GSM955014     4  0.5716    0.18811 0.120 0.008 0.000 0.572 0.288 0.012
#> GSM955018     3  0.4297    0.48743 0.016 0.024 0.792 0.008 0.048 0.112
#> GSM955020     1  0.2376    0.61564 0.888 0.000 0.000 0.044 0.068 0.000
#> GSM955024     3  0.5380    0.34235 0.000 0.248 0.636 0.004 0.028 0.084
#> GSM955026     2  0.5075    0.38047 0.000 0.660 0.008 0.032 0.044 0.256
#> GSM955031     6  0.8553    0.00000 0.000 0.248 0.200 0.076 0.180 0.296
#> GSM955038     4  0.2958    0.50585 0.000 0.060 0.000 0.864 0.016 0.060
#> GSM955040     4  0.8470   -0.31981 0.000 0.148 0.188 0.380 0.128 0.156
#> GSM955044     2  0.4595    0.42868 0.000 0.684 0.008 0.008 0.044 0.256
#> GSM955051     5  0.6248    0.59981 0.308 0.000 0.000 0.240 0.440 0.012
#> GSM955055     2  0.5210    0.25773 0.000 0.576 0.068 0.000 0.016 0.340
#> GSM955057     1  0.4087    0.30487 0.744 0.000 0.000 0.064 0.188 0.004
#> GSM955062     2  0.6020    0.20770 0.000 0.552 0.304 0.012 0.028 0.104
#> GSM955063     3  0.3387    0.50979 0.000 0.016 0.840 0.004 0.068 0.072
#> GSM955068     2  0.3706    0.45403 0.000 0.772 0.008 0.012 0.012 0.196
#> GSM955069     3  0.4875    0.48785 0.036 0.012 0.772 0.056 0.080 0.044
#> GSM955070     2  0.7332    0.16528 0.000 0.520 0.136 0.184 0.048 0.112
#> GSM955071     3  0.8378   -0.23016 0.000 0.236 0.372 0.156 0.104 0.132
#> GSM955077     2  0.6322    0.03497 0.000 0.488 0.040 0.064 0.032 0.376
#> GSM955080     2  0.7628    0.28955 0.000 0.496 0.136 0.140 0.064 0.164
#> GSM955081     2  0.7110   -0.10143 0.000 0.468 0.300 0.064 0.032 0.136
#> GSM955082     3  0.5961    0.33036 0.000 0.220 0.600 0.012 0.028 0.140
#> GSM955085     2  0.6394    0.11507 0.000 0.496 0.064 0.064 0.020 0.356
#> GSM955090     4  0.5830   -0.01230 0.132 0.000 0.000 0.508 0.344 0.016
#> GSM955094     2  0.5521    0.45060 0.000 0.708 0.084 0.048 0.048 0.112
#> GSM955096     3  0.5223    0.40370 0.000 0.096 0.688 0.004 0.040 0.172
#> GSM955102     3  0.6778    0.19994 0.304 0.000 0.476 0.004 0.128 0.088
#> GSM955105     3  0.5258    0.37934 0.000 0.008 0.644 0.004 0.136 0.208

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

consensus_heatmap(res, k = 2)

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

consensus_heatmap(res, k = 3)

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

consensus_heatmap(res, k = 4)

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

consensus_heatmap(res, k = 5)

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

consensus_heatmap(res, k = 6)

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

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

membership_heatmap(res, k = 2)

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

membership_heatmap(res, k = 3)

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

membership_heatmap(res, k = 4)

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

membership_heatmap(res, k = 5)

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

membership_heatmap(res, k = 6)

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

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

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

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

get_signatures(res, k = 3)

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

get_signatures(res, k = 4)

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

get_signatures(res, k = 5)

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

get_signatures(res, k = 6)

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

Signature heatmaps where rows are not scaled:

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

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

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

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

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

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

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

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

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

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

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk CV-hclust-signature_compare

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

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

An example of the output of tb is:

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

The columns in tb are:

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

UMAP plot which shows how samples are separated.

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

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

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

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

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

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

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

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

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

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

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk CV-hclust-collect-classes

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

test_to_known_factors(res)
#>             n genotype/variation(p) k
#> CV:hclust 100                 0.940 2
#> CV:hclust  79                 0.999 3
#> CV:hclust  78                 0.956 4
#> CV:hclust  75                 0.942 5
#> CV:hclust  17                 0.499 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 31589 rows and 108 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 3.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

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

collect_plots(res)

plot of chunk CV-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.799           0.898       0.954         0.3898 0.641   0.641
#> 3 3 0.772           0.853       0.915         0.6550 0.693   0.526
#> 4 4 0.555           0.585       0.775         0.1358 0.855   0.624
#> 5 5 0.555           0.468       0.695         0.0726 0.893   0.645
#> 6 6 0.589           0.417       0.648         0.0468 0.884   0.532

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

suggest_best_k(res)
#> [1] 3

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

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

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>           class entropy silhouette    p1    p2
#> GSM955002     2  0.0000     0.9422 0.000 1.000
#> GSM955008     2  0.0000     0.9422 0.000 1.000
#> GSM955016     1  0.0000     0.9782 1.000 0.000
#> GSM955019     2  0.0000     0.9422 0.000 1.000
#> GSM955022     2  0.0000     0.9422 0.000 1.000
#> GSM955023     2  0.0000     0.9422 0.000 1.000
#> GSM955027     2  0.0000     0.9422 0.000 1.000
#> GSM955043     2  0.0000     0.9422 0.000 1.000
#> GSM955048     1  0.0000     0.9782 1.000 0.000
#> GSM955049     2  0.0000     0.9422 0.000 1.000
#> GSM955054     2  0.0000     0.9422 0.000 1.000
#> GSM955064     2  0.0000     0.9422 0.000 1.000
#> GSM955072     2  0.0000     0.9422 0.000 1.000
#> GSM955075     2  0.0000     0.9422 0.000 1.000
#> GSM955079     2  0.3431     0.8995 0.064 0.936
#> GSM955087     1  0.0000     0.9782 1.000 0.000
#> GSM955088     2  0.7219     0.7721 0.200 0.800
#> GSM955089     1  0.0000     0.9782 1.000 0.000
#> GSM955095     2  0.0000     0.9422 0.000 1.000
#> GSM955097     2  0.6247     0.8199 0.156 0.844
#> GSM955101     2  0.0000     0.9422 0.000 1.000
#> GSM954999     2  0.9491     0.5064 0.368 0.632
#> GSM955001     2  0.0000     0.9422 0.000 1.000
#> GSM955003     2  0.0000     0.9422 0.000 1.000
#> GSM955004     2  0.0000     0.9422 0.000 1.000
#> GSM955005     2  0.0672     0.9379 0.008 0.992
#> GSM955009     2  0.0000     0.9422 0.000 1.000
#> GSM955011     1  0.0000     0.9782 1.000 0.000
#> GSM955012     2  0.0000     0.9422 0.000 1.000
#> GSM955013     2  0.0672     0.9378 0.008 0.992
#> GSM955015     2  0.0000     0.9422 0.000 1.000
#> GSM955017     1  0.0000     0.9782 1.000 0.000
#> GSM955021     2  0.0000     0.9422 0.000 1.000
#> GSM955025     2  0.0000     0.9422 0.000 1.000
#> GSM955028     1  0.0000     0.9782 1.000 0.000
#> GSM955029     2  0.0000     0.9422 0.000 1.000
#> GSM955030     2  0.9460     0.5145 0.364 0.636
#> GSM955032     2  0.1633     0.9279 0.024 0.976
#> GSM955033     2  0.0000     0.9422 0.000 1.000
#> GSM955034     1  0.0000     0.9782 1.000 0.000
#> GSM955035     2  0.0000     0.9422 0.000 1.000
#> GSM955036     2  0.9580     0.4802 0.380 0.620
#> GSM955037     1  0.0000     0.9782 1.000 0.000
#> GSM955039     2  0.0000     0.9422 0.000 1.000
#> GSM955041     2  0.0000     0.9422 0.000 1.000
#> GSM955042     1  0.0000     0.9782 1.000 0.000
#> GSM955045     2  0.0000     0.9422 0.000 1.000
#> GSM955046     2  0.7219     0.7722 0.200 0.800
#> GSM955047     1  0.0000     0.9782 1.000 0.000
#> GSM955050     2  0.0000     0.9422 0.000 1.000
#> GSM955052     2  0.0000     0.9422 0.000 1.000
#> GSM955053     1  0.0000     0.9782 1.000 0.000
#> GSM955056     2  0.0000     0.9422 0.000 1.000
#> GSM955058     2  0.0000     0.9422 0.000 1.000
#> GSM955059     2  0.7602     0.7482 0.220 0.780
#> GSM955060     1  0.0000     0.9782 1.000 0.000
#> GSM955061     2  0.0000     0.9422 0.000 1.000
#> GSM955065     1  0.0000     0.9782 1.000 0.000
#> GSM955066     2  0.9129     0.5838 0.328 0.672
#> GSM955067     1  0.0000     0.9782 1.000 0.000
#> GSM955073     2  0.0000     0.9422 0.000 1.000
#> GSM955074     1  0.0000     0.9782 1.000 0.000
#> GSM955076     2  0.0000     0.9422 0.000 1.000
#> GSM955078     2  0.0000     0.9422 0.000 1.000
#> GSM955083     2  0.5946     0.8309 0.144 0.856
#> GSM955084     2  0.0000     0.9422 0.000 1.000
#> GSM955086     2  0.5842     0.8349 0.140 0.860
#> GSM955091     2  0.0000     0.9422 0.000 1.000
#> GSM955092     2  0.0000     0.9422 0.000 1.000
#> GSM955093     2  0.7745     0.7379 0.228 0.772
#> GSM955098     2  0.0000     0.9422 0.000 1.000
#> GSM955099     2  0.0000     0.9422 0.000 1.000
#> GSM955100     1  0.0000     0.9782 1.000 0.000
#> GSM955103     2  0.0000     0.9422 0.000 1.000
#> GSM955104     2  0.9286     0.5542 0.344 0.656
#> GSM955106     2  0.0000     0.9422 0.000 1.000
#> GSM955000     1  0.0000     0.9782 1.000 0.000
#> GSM955006     1  0.0000     0.9782 1.000 0.000
#> GSM955007     2  0.0376     0.9401 0.004 0.996
#> GSM955010     2  0.9710     0.4332 0.400 0.600
#> GSM955014     1  0.0000     0.9782 1.000 0.000
#> GSM955018     2  0.7745     0.7379 0.228 0.772
#> GSM955020     1  0.0000     0.9782 1.000 0.000
#> GSM955024     2  0.0000     0.9422 0.000 1.000
#> GSM955026     2  0.0000     0.9422 0.000 1.000
#> GSM955031     2  0.0000     0.9422 0.000 1.000
#> GSM955038     2  0.0000     0.9422 0.000 1.000
#> GSM955040     2  0.2423     0.9168 0.040 0.960
#> GSM955044     2  0.0000     0.9422 0.000 1.000
#> GSM955051     1  0.0000     0.9782 1.000 0.000
#> GSM955055     2  0.0000     0.9422 0.000 1.000
#> GSM955057     1  0.0000     0.9782 1.000 0.000
#> GSM955062     2  0.0000     0.9422 0.000 1.000
#> GSM955063     2  0.0938     0.9355 0.012 0.988
#> GSM955068     2  0.0000     0.9422 0.000 1.000
#> GSM955069     2  0.9580     0.4802 0.380 0.620
#> GSM955070     2  0.0000     0.9422 0.000 1.000
#> GSM955071     2  0.4431     0.8768 0.092 0.908
#> GSM955077     2  0.0000     0.9422 0.000 1.000
#> GSM955080     2  0.0000     0.9422 0.000 1.000
#> GSM955081     2  0.0000     0.9422 0.000 1.000
#> GSM955082     2  0.0000     0.9422 0.000 1.000
#> GSM955085     2  0.0000     0.9422 0.000 1.000
#> GSM955090     1  0.0000     0.9782 1.000 0.000
#> GSM955094     2  0.0000     0.9422 0.000 1.000
#> GSM955096     2  0.0000     0.9422 0.000 1.000
#> GSM955102     1  0.9963    -0.0373 0.536 0.464
#> GSM955105     2  0.7528     0.7534 0.216 0.784

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1    p2    p3
#> GSM955002     2  0.4346      0.767 0.000 0.816 0.184
#> GSM955008     3  0.3879      0.818 0.000 0.152 0.848
#> GSM955016     1  0.2804      0.954 0.924 0.016 0.060
#> GSM955019     2  0.1289      0.913 0.000 0.968 0.032
#> GSM955022     3  0.2165      0.880 0.000 0.064 0.936
#> GSM955023     3  0.5882      0.522 0.000 0.348 0.652
#> GSM955027     2  0.1289      0.913 0.000 0.968 0.032
#> GSM955043     2  0.0592      0.911 0.000 0.988 0.012
#> GSM955048     1  0.0424      0.980 0.992 0.000 0.008
#> GSM955049     2  0.1860      0.907 0.000 0.948 0.052
#> GSM955054     3  0.6235      0.327 0.000 0.436 0.564
#> GSM955064     2  0.1753      0.912 0.000 0.952 0.048
#> GSM955072     2  0.0237      0.911 0.000 0.996 0.004
#> GSM955075     2  0.0592      0.911 0.000 0.988 0.012
#> GSM955079     3  0.1643      0.883 0.000 0.044 0.956
#> GSM955087     1  0.0424      0.980 0.992 0.000 0.008
#> GSM955088     3  0.1399      0.883 0.004 0.028 0.968
#> GSM955089     1  0.0237      0.980 0.996 0.000 0.004
#> GSM955095     2  0.4291      0.771 0.000 0.820 0.180
#> GSM955097     2  0.5656      0.619 0.004 0.712 0.284
#> GSM955101     3  0.3116      0.851 0.000 0.108 0.892
#> GSM954999     3  0.2269      0.856 0.016 0.040 0.944
#> GSM955001     2  0.1163      0.914 0.000 0.972 0.028
#> GSM955003     3  0.6235      0.327 0.000 0.436 0.564
#> GSM955004     2  0.0237      0.909 0.000 0.996 0.004
#> GSM955005     3  0.1289      0.884 0.000 0.032 0.968
#> GSM955009     2  0.1289      0.913 0.000 0.968 0.032
#> GSM955011     1  0.1647      0.977 0.960 0.004 0.036
#> GSM955012     2  0.1289      0.905 0.000 0.968 0.032
#> GSM955013     3  0.2356      0.875 0.000 0.072 0.928
#> GSM955015     2  0.6280      0.038 0.000 0.540 0.460
#> GSM955017     1  0.1289      0.981 0.968 0.000 0.032
#> GSM955021     2  0.1860      0.907 0.000 0.948 0.052
#> GSM955025     2  0.1163      0.913 0.000 0.972 0.028
#> GSM955028     1  0.0424      0.980 0.992 0.000 0.008
#> GSM955029     2  0.0592      0.911 0.000 0.988 0.012
#> GSM955030     3  0.1751      0.866 0.028 0.012 0.960
#> GSM955032     3  0.1643      0.883 0.000 0.044 0.956
#> GSM955033     2  0.4555      0.752 0.000 0.800 0.200
#> GSM955034     1  0.0424      0.980 0.992 0.000 0.008
#> GSM955035     2  0.1643      0.910 0.000 0.956 0.044
#> GSM955036     3  0.2173      0.871 0.008 0.048 0.944
#> GSM955037     1  0.0424      0.980 0.992 0.000 0.008
#> GSM955039     3  0.1964      0.878 0.000 0.056 0.944
#> GSM955041     2  0.2625      0.890 0.000 0.916 0.084
#> GSM955042     1  0.1647      0.978 0.960 0.004 0.036
#> GSM955045     2  0.5016      0.695 0.000 0.760 0.240
#> GSM955046     3  0.2384      0.878 0.008 0.056 0.936
#> GSM955047     1  0.1289      0.979 0.968 0.000 0.032
#> GSM955050     2  0.4931      0.710 0.000 0.768 0.232
#> GSM955052     3  0.1964      0.879 0.000 0.056 0.944
#> GSM955053     1  0.0424      0.980 0.992 0.000 0.008
#> GSM955056     3  0.3551      0.835 0.000 0.132 0.868
#> GSM955058     2  0.0592      0.911 0.000 0.988 0.012
#> GSM955059     3  0.1585      0.883 0.008 0.028 0.964
#> GSM955060     1  0.0892      0.981 0.980 0.000 0.020
#> GSM955061     2  0.0592      0.911 0.000 0.988 0.012
#> GSM955065     1  0.0424      0.980 0.992 0.000 0.008
#> GSM955066     3  0.1751      0.877 0.012 0.028 0.960
#> GSM955067     1  0.1950      0.974 0.952 0.008 0.040
#> GSM955073     3  0.1753      0.881 0.000 0.048 0.952
#> GSM955074     1  0.2229      0.970 0.944 0.012 0.044
#> GSM955076     2  0.1860      0.907 0.000 0.948 0.052
#> GSM955078     2  0.0237      0.911 0.000 0.996 0.004
#> GSM955083     3  0.6075      0.522 0.008 0.316 0.676
#> GSM955084     2  0.0237      0.909 0.000 0.996 0.004
#> GSM955086     3  0.1643      0.883 0.000 0.044 0.956
#> GSM955091     2  0.1163      0.914 0.000 0.972 0.028
#> GSM955092     2  0.5016      0.694 0.000 0.760 0.240
#> GSM955093     3  0.1585      0.883 0.008 0.028 0.964
#> GSM955098     2  0.1163      0.913 0.000 0.972 0.028
#> GSM955099     2  0.1163      0.914 0.000 0.972 0.028
#> GSM955100     1  0.1647      0.977 0.960 0.004 0.036
#> GSM955103     3  0.2711      0.873 0.000 0.088 0.912
#> GSM955104     3  0.1781      0.877 0.020 0.020 0.960
#> GSM955106     2  0.1411      0.903 0.000 0.964 0.036
#> GSM955000     1  0.0424      0.980 0.992 0.000 0.008
#> GSM955006     1  0.1289      0.979 0.968 0.000 0.032
#> GSM955007     3  0.2165      0.880 0.000 0.064 0.936
#> GSM955010     3  0.2902      0.845 0.064 0.016 0.920
#> GSM955014     1  0.1529      0.978 0.960 0.000 0.040
#> GSM955018     3  0.1585      0.883 0.008 0.028 0.964
#> GSM955020     1  0.0237      0.980 0.996 0.000 0.004
#> GSM955024     3  0.2537      0.874 0.000 0.080 0.920
#> GSM955026     2  0.1163      0.913 0.000 0.972 0.028
#> GSM955031     3  0.6192      0.365 0.000 0.420 0.580
#> GSM955038     2  0.3310      0.852 0.064 0.908 0.028
#> GSM955040     2  0.5763      0.627 0.008 0.716 0.276
#> GSM955044     2  0.0424      0.911 0.000 0.992 0.008
#> GSM955051     1  0.1289      0.979 0.968 0.000 0.032
#> GSM955055     2  0.1289      0.913 0.000 0.968 0.032
#> GSM955057     1  0.0424      0.980 0.992 0.000 0.008
#> GSM955062     2  0.1964      0.905 0.000 0.944 0.056
#> GSM955063     3  0.1411      0.883 0.000 0.036 0.964
#> GSM955068     2  0.0000      0.910 0.000 1.000 0.000
#> GSM955069     3  0.2443      0.877 0.032 0.028 0.940
#> GSM955070     2  0.1031      0.914 0.000 0.976 0.024
#> GSM955071     3  0.3941      0.798 0.000 0.156 0.844
#> GSM955077     2  0.1411      0.911 0.000 0.964 0.036
#> GSM955080     2  0.5216      0.646 0.000 0.740 0.260
#> GSM955081     3  0.6291      0.222 0.000 0.468 0.532
#> GSM955082     3  0.5810      0.502 0.000 0.336 0.664
#> GSM955085     2  0.1031      0.914 0.000 0.976 0.024
#> GSM955090     1  0.1529      0.978 0.960 0.000 0.040
#> GSM955094     2  0.2165      0.885 0.000 0.936 0.064
#> GSM955096     3  0.2066      0.878 0.000 0.060 0.940
#> GSM955102     3  0.4291      0.746 0.180 0.000 0.820
#> GSM955105     3  0.1411      0.883 0.000 0.036 0.964

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM955002     2  0.4804     0.6560 0.000 0.780 0.072 0.148
#> GSM955008     3  0.2805     0.7166 0.000 0.100 0.888 0.012
#> GSM955016     4  0.4920    -0.2613 0.368 0.000 0.004 0.628
#> GSM955019     2  0.1677     0.7182 0.000 0.948 0.012 0.040
#> GSM955022     3  0.4980     0.6125 0.000 0.016 0.680 0.304
#> GSM955023     3  0.6483     0.3231 0.000 0.312 0.592 0.096
#> GSM955027     2  0.3697     0.7212 0.000 0.852 0.048 0.100
#> GSM955043     2  0.4456     0.6194 0.000 0.716 0.004 0.280
#> GSM955048     1  0.0592     0.8115 0.984 0.000 0.000 0.016
#> GSM955049     2  0.4227     0.6953 0.000 0.820 0.120 0.060
#> GSM955054     2  0.5846     0.1814 0.000 0.516 0.452 0.032
#> GSM955064     2  0.5947     0.6339 0.000 0.688 0.112 0.200
#> GSM955072     2  0.1978     0.7172 0.000 0.928 0.004 0.068
#> GSM955075     2  0.5075     0.5790 0.000 0.644 0.012 0.344
#> GSM955079     3  0.1297     0.7758 0.000 0.016 0.964 0.020
#> GSM955087     1  0.0000     0.8078 1.000 0.000 0.000 0.000
#> GSM955088     3  0.1637     0.7774 0.000 0.000 0.940 0.060
#> GSM955089     1  0.0817     0.8131 0.976 0.000 0.000 0.024
#> GSM955095     4  0.7115    -0.2000 0.000 0.420 0.128 0.452
#> GSM955097     4  0.4798     0.3978 0.000 0.180 0.052 0.768
#> GSM955101     3  0.2796     0.7232 0.000 0.092 0.892 0.016
#> GSM954999     4  0.4295     0.3180 0.008 0.000 0.240 0.752
#> GSM955001     2  0.3587     0.7234 0.000 0.856 0.040 0.104
#> GSM955003     2  0.5688     0.1664 0.000 0.512 0.464 0.024
#> GSM955004     2  0.3837     0.6710 0.000 0.776 0.000 0.224
#> GSM955005     3  0.3356     0.7356 0.000 0.000 0.824 0.176
#> GSM955009     2  0.2101     0.7179 0.000 0.928 0.012 0.060
#> GSM955011     1  0.4972     0.5565 0.544 0.000 0.000 0.456
#> GSM955012     2  0.5291     0.5753 0.000 0.652 0.024 0.324
#> GSM955013     4  0.5500    -0.2688 0.000 0.016 0.464 0.520
#> GSM955015     3  0.7431     0.0158 0.000 0.380 0.448 0.172
#> GSM955017     1  0.3311     0.7938 0.828 0.000 0.000 0.172
#> GSM955021     2  0.3659     0.6778 0.000 0.840 0.136 0.024
#> GSM955025     2  0.2342     0.7082 0.000 0.912 0.008 0.080
#> GSM955028     1  0.0000     0.8078 1.000 0.000 0.000 0.000
#> GSM955029     2  0.5038     0.6030 0.000 0.684 0.020 0.296
#> GSM955030     3  0.3688     0.7055 0.000 0.000 0.792 0.208
#> GSM955032     3  0.1510     0.7784 0.000 0.016 0.956 0.028
#> GSM955033     4  0.4332     0.4729 0.000 0.176 0.032 0.792
#> GSM955034     1  0.0000     0.8078 1.000 0.000 0.000 0.000
#> GSM955035     2  0.2611     0.7062 0.000 0.896 0.096 0.008
#> GSM955036     4  0.5168    -0.2970 0.000 0.004 0.496 0.500
#> GSM955037     1  0.3088     0.7279 0.864 0.000 0.008 0.128
#> GSM955039     3  0.5038     0.5657 0.000 0.012 0.652 0.336
#> GSM955041     2  0.6756     0.5419 0.000 0.612 0.200 0.188
#> GSM955042     1  0.4999     0.4961 0.508 0.000 0.000 0.492
#> GSM955045     2  0.7818     0.1847 0.000 0.408 0.268 0.324
#> GSM955046     3  0.4049     0.6990 0.000 0.008 0.780 0.212
#> GSM955047     1  0.4250     0.7557 0.724 0.000 0.000 0.276
#> GSM955050     4  0.5038     0.3724 0.000 0.336 0.012 0.652
#> GSM955052     3  0.1284     0.7688 0.000 0.024 0.964 0.012
#> GSM955053     1  0.0000     0.8078 1.000 0.000 0.000 0.000
#> GSM955056     3  0.3320     0.7323 0.000 0.068 0.876 0.056
#> GSM955058     2  0.5085     0.5971 0.000 0.676 0.020 0.304
#> GSM955059     3  0.2081     0.7712 0.000 0.000 0.916 0.084
#> GSM955060     1  0.2589     0.8051 0.884 0.000 0.000 0.116
#> GSM955061     2  0.5152     0.5864 0.000 0.664 0.020 0.316
#> GSM955065     1  0.0000     0.8078 1.000 0.000 0.000 0.000
#> GSM955066     3  0.3726     0.7075 0.000 0.000 0.788 0.212
#> GSM955067     1  0.4679     0.6920 0.648 0.000 0.000 0.352
#> GSM955073     3  0.0524     0.7772 0.000 0.004 0.988 0.008
#> GSM955074     4  0.4998    -0.5166 0.488 0.000 0.000 0.512
#> GSM955076     2  0.3370     0.6937 0.000 0.872 0.080 0.048
#> GSM955078     2  0.2704     0.7132 0.000 0.876 0.000 0.124
#> GSM955083     4  0.4057     0.4268 0.000 0.032 0.152 0.816
#> GSM955084     2  0.3610     0.6825 0.000 0.800 0.000 0.200
#> GSM955086     3  0.1610     0.7780 0.000 0.016 0.952 0.032
#> GSM955091     2  0.1151     0.7285 0.000 0.968 0.008 0.024
#> GSM955092     2  0.6100     0.5277 0.000 0.644 0.272 0.084
#> GSM955093     3  0.1118     0.7782 0.000 0.000 0.964 0.036
#> GSM955098     2  0.2402     0.7080 0.000 0.912 0.012 0.076
#> GSM955099     2  0.1489     0.7312 0.000 0.952 0.004 0.044
#> GSM955100     1  0.5168     0.4901 0.504 0.000 0.004 0.492
#> GSM955103     3  0.5907     0.5223 0.000 0.080 0.668 0.252
#> GSM955104     3  0.3837     0.6886 0.000 0.000 0.776 0.224
#> GSM955106     2  0.5517     0.4777 0.000 0.568 0.020 0.412
#> GSM955000     1  0.0469     0.8060 0.988 0.000 0.000 0.012
#> GSM955006     1  0.4406     0.7392 0.700 0.000 0.000 0.300
#> GSM955007     3  0.3718     0.7273 0.000 0.012 0.820 0.168
#> GSM955010     3  0.5110     0.5161 0.012 0.000 0.636 0.352
#> GSM955014     1  0.4277     0.7527 0.720 0.000 0.000 0.280
#> GSM955018     3  0.1022     0.7784 0.000 0.000 0.968 0.032
#> GSM955020     1  0.1022     0.8134 0.968 0.000 0.000 0.032
#> GSM955024     3  0.4378     0.6729 0.000 0.040 0.796 0.164
#> GSM955026     2  0.2473     0.7071 0.000 0.908 0.012 0.080
#> GSM955031     2  0.6889     0.1914 0.000 0.496 0.396 0.108
#> GSM955038     4  0.4999     0.0643 0.000 0.492 0.000 0.508
#> GSM955040     4  0.5130     0.3776 0.000 0.332 0.016 0.652
#> GSM955044     2  0.3448     0.6985 0.000 0.828 0.004 0.168
#> GSM955051     1  0.4222     0.7561 0.728 0.000 0.000 0.272
#> GSM955055     2  0.2675     0.7288 0.000 0.908 0.044 0.048
#> GSM955057     1  0.0817     0.8131 0.976 0.000 0.000 0.024
#> GSM955062     2  0.3427     0.7017 0.000 0.860 0.112 0.028
#> GSM955063     3  0.0592     0.7786 0.000 0.000 0.984 0.016
#> GSM955068     2  0.2053     0.7129 0.000 0.924 0.004 0.072
#> GSM955069     3  0.2868     0.7470 0.000 0.000 0.864 0.136
#> GSM955070     2  0.3625     0.7066 0.000 0.828 0.012 0.160
#> GSM955071     3  0.6759     0.3614 0.000 0.108 0.548 0.344
#> GSM955077     2  0.2805     0.6937 0.000 0.888 0.012 0.100
#> GSM955080     4  0.7300    -0.0673 0.000 0.372 0.156 0.472
#> GSM955081     2  0.6007     0.3064 0.000 0.548 0.408 0.044
#> GSM955082     3  0.6341     0.4067 0.000 0.212 0.652 0.136
#> GSM955085     2  0.2197     0.7245 0.000 0.916 0.004 0.080
#> GSM955090     1  0.4406     0.7383 0.700 0.000 0.000 0.300
#> GSM955094     2  0.5582     0.4956 0.000 0.620 0.032 0.348
#> GSM955096     3  0.1520     0.7707 0.000 0.024 0.956 0.020
#> GSM955102     3  0.6286     0.5680 0.200 0.000 0.660 0.140
#> GSM955105     3  0.1510     0.7784 0.000 0.016 0.956 0.028

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM955002     2  0.6196     0.4366 0.000 0.652 0.080 0.080 0.188
#> GSM955008     3  0.4322     0.6105 0.000 0.084 0.804 0.032 0.080
#> GSM955016     4  0.4098     0.4316 0.156 0.000 0.000 0.780 0.064
#> GSM955019     2  0.1117     0.6381 0.000 0.964 0.000 0.020 0.016
#> GSM955022     3  0.6066     0.2934 0.000 0.000 0.456 0.120 0.424
#> GSM955023     3  0.7470     0.1367 0.000 0.260 0.444 0.048 0.248
#> GSM955027     2  0.5375     0.4950 0.000 0.652 0.036 0.032 0.280
#> GSM955043     5  0.4644     0.3419 0.000 0.380 0.004 0.012 0.604
#> GSM955048     1  0.2361     0.7536 0.892 0.000 0.000 0.096 0.012
#> GSM955049     2  0.6106     0.5205 0.000 0.644 0.152 0.032 0.172
#> GSM955054     2  0.6704     0.3644 0.000 0.520 0.332 0.044 0.104
#> GSM955064     2  0.7186     0.1343 0.000 0.420 0.144 0.048 0.388
#> GSM955072     2  0.3011     0.5852 0.000 0.844 0.000 0.016 0.140
#> GSM955075     5  0.4359     0.4973 0.000 0.288 0.004 0.016 0.692
#> GSM955079     3  0.2305     0.6963 0.000 0.044 0.916 0.012 0.028
#> GSM955087     1  0.0404     0.7451 0.988 0.000 0.000 0.000 0.012
#> GSM955088     3  0.3339     0.7040 0.000 0.008 0.856 0.068 0.068
#> GSM955089     1  0.2338     0.7502 0.884 0.000 0.000 0.112 0.004
#> GSM955095     5  0.4851     0.5768 0.000 0.104 0.040 0.088 0.768
#> GSM955097     5  0.4592     0.3870 0.000 0.028 0.016 0.232 0.724
#> GSM955101     3  0.4844     0.5816 0.000 0.116 0.764 0.032 0.088
#> GSM954999     4  0.3779     0.4976 0.004 0.000 0.056 0.816 0.124
#> GSM955001     2  0.5287     0.5033 0.000 0.668 0.036 0.032 0.264
#> GSM955003     2  0.6652     0.3648 0.000 0.508 0.352 0.040 0.100
#> GSM955004     2  0.4397     0.0793 0.000 0.564 0.000 0.004 0.432
#> GSM955005     3  0.5039     0.6490 0.000 0.000 0.700 0.184 0.116
#> GSM955009     2  0.1018     0.6351 0.000 0.968 0.000 0.016 0.016
#> GSM955011     4  0.4109     0.2714 0.260 0.000 0.008 0.724 0.008
#> GSM955012     5  0.4207     0.4953 0.000 0.276 0.008 0.008 0.708
#> GSM955013     5  0.6976    -0.0714 0.000 0.012 0.228 0.348 0.412
#> GSM955015     5  0.8008     0.0883 0.000 0.272 0.268 0.088 0.372
#> GSM955017     1  0.4520     0.6331 0.680 0.000 0.008 0.296 0.016
#> GSM955021     2  0.4995     0.5900 0.000 0.752 0.120 0.032 0.096
#> GSM955025     2  0.1211     0.6308 0.000 0.960 0.000 0.024 0.016
#> GSM955028     1  0.0404     0.7451 0.988 0.000 0.000 0.000 0.012
#> GSM955029     5  0.4464     0.3837 0.000 0.356 0.004 0.008 0.632
#> GSM955030     3  0.5704     0.5797 0.000 0.000 0.620 0.232 0.148
#> GSM955032     3  0.3501     0.6953 0.000 0.056 0.856 0.028 0.060
#> GSM955033     4  0.6010     0.1641 0.000 0.060 0.024 0.512 0.404
#> GSM955034     1  0.0404     0.7451 0.988 0.000 0.000 0.000 0.012
#> GSM955035     2  0.4474     0.6216 0.000 0.796 0.076 0.040 0.088
#> GSM955036     4  0.6726    -0.0706 0.000 0.000 0.252 0.388 0.360
#> GSM955037     1  0.5059     0.4448 0.728 0.000 0.080 0.172 0.020
#> GSM955039     3  0.7114     0.1830 0.000 0.012 0.368 0.336 0.284
#> GSM955041     2  0.7020     0.0441 0.000 0.412 0.144 0.036 0.408
#> GSM955042     4  0.4026     0.3291 0.244 0.000 0.000 0.736 0.020
#> GSM955045     5  0.5346     0.4982 0.000 0.084 0.200 0.020 0.696
#> GSM955046     3  0.6061     0.5572 0.000 0.000 0.576 0.212 0.212
#> GSM955047     1  0.4597     0.4740 0.564 0.000 0.000 0.424 0.012
#> GSM955050     4  0.6608     0.3229 0.000 0.264 0.016 0.536 0.184
#> GSM955052     3  0.2887     0.6733 0.000 0.028 0.884 0.016 0.072
#> GSM955053     1  0.0404     0.7451 0.988 0.000 0.000 0.000 0.012
#> GSM955056     3  0.5789     0.5652 0.000 0.104 0.688 0.048 0.160
#> GSM955058     5  0.4387     0.4160 0.000 0.336 0.004 0.008 0.652
#> GSM955059     3  0.4450     0.6703 0.000 0.000 0.760 0.132 0.108
#> GSM955060     1  0.3967     0.6610 0.724 0.000 0.000 0.264 0.012
#> GSM955061     5  0.4181     0.4523 0.000 0.316 0.004 0.004 0.676
#> GSM955065     1  0.0404     0.7451 0.988 0.000 0.000 0.000 0.012
#> GSM955066     3  0.5917     0.5721 0.000 0.000 0.596 0.224 0.180
#> GSM955067     4  0.4744    -0.3500 0.476 0.000 0.000 0.508 0.016
#> GSM955073     3  0.1741     0.7048 0.000 0.000 0.936 0.024 0.040
#> GSM955074     4  0.4029     0.3463 0.232 0.000 0.000 0.744 0.024
#> GSM955076     2  0.1989     0.6357 0.000 0.932 0.032 0.016 0.020
#> GSM955078     2  0.3662     0.4538 0.000 0.744 0.000 0.004 0.252
#> GSM955083     4  0.4880     0.3149 0.000 0.000 0.036 0.616 0.348
#> GSM955084     2  0.4415     0.1716 0.000 0.604 0.000 0.008 0.388
#> GSM955086     3  0.3091     0.6991 0.000 0.044 0.880 0.032 0.044
#> GSM955091     2  0.3340     0.5989 0.000 0.824 0.004 0.016 0.156
#> GSM955092     2  0.7194     0.2399 0.000 0.416 0.380 0.040 0.164
#> GSM955093     3  0.2504     0.7030 0.000 0.000 0.896 0.064 0.040
#> GSM955098     2  0.1106     0.6315 0.000 0.964 0.000 0.024 0.012
#> GSM955099     2  0.3967     0.5741 0.000 0.772 0.008 0.020 0.200
#> GSM955100     4  0.4411     0.3315 0.232 0.000 0.012 0.732 0.024
#> GSM955103     5  0.6771    -0.1753 0.000 0.076 0.428 0.060 0.436
#> GSM955104     3  0.5554     0.5060 0.000 0.000 0.592 0.316 0.092
#> GSM955106     5  0.4522     0.5613 0.000 0.192 0.004 0.060 0.744
#> GSM955000     1  0.2363     0.7123 0.912 0.000 0.012 0.052 0.024
#> GSM955006     4  0.4562    -0.3812 0.492 0.000 0.000 0.500 0.008
#> GSM955007     3  0.5475     0.5648 0.000 0.000 0.604 0.088 0.308
#> GSM955010     3  0.6349     0.2907 0.000 0.000 0.424 0.416 0.160
#> GSM955014     1  0.4504     0.4665 0.564 0.000 0.000 0.428 0.008
#> GSM955018     3  0.1549     0.7074 0.000 0.000 0.944 0.040 0.016
#> GSM955020     1  0.2843     0.7392 0.848 0.000 0.000 0.144 0.008
#> GSM955024     3  0.5970     0.3994 0.000 0.040 0.572 0.048 0.340
#> GSM955026     2  0.1195     0.6310 0.000 0.960 0.000 0.028 0.012
#> GSM955031     2  0.6738     0.3814 0.000 0.560 0.280 0.088 0.072
#> GSM955038     4  0.5534     0.1751 0.000 0.424 0.000 0.508 0.068
#> GSM955040     4  0.5198     0.4644 0.000 0.196 0.004 0.692 0.108
#> GSM955044     2  0.4629     0.4135 0.000 0.688 0.012 0.020 0.280
#> GSM955051     1  0.4590     0.4738 0.568 0.000 0.000 0.420 0.012
#> GSM955055     2  0.4126     0.6159 0.000 0.800 0.028 0.032 0.140
#> GSM955057     1  0.2513     0.7500 0.876 0.000 0.000 0.116 0.008
#> GSM955062     2  0.4644     0.6081 0.000 0.780 0.084 0.032 0.104
#> GSM955063     3  0.2171     0.7067 0.000 0.000 0.912 0.024 0.064
#> GSM955068     2  0.1800     0.6197 0.000 0.932 0.000 0.020 0.048
#> GSM955069     3  0.4294     0.6677 0.000 0.000 0.768 0.152 0.080
#> GSM955070     2  0.6135     0.2515 0.000 0.544 0.036 0.060 0.360
#> GSM955071     4  0.6958    -0.0586 0.004 0.072 0.344 0.504 0.076
#> GSM955077     2  0.1978     0.6230 0.000 0.928 0.004 0.044 0.024
#> GSM955080     5  0.4581     0.5473 0.000 0.076 0.040 0.096 0.788
#> GSM955081     2  0.6646     0.4022 0.000 0.536 0.320 0.048 0.096
#> GSM955082     3  0.6554     0.3259 0.000 0.156 0.580 0.032 0.232
#> GSM955085     2  0.2522     0.6019 0.000 0.880 0.000 0.012 0.108
#> GSM955090     1  0.4637     0.4127 0.536 0.000 0.000 0.452 0.012
#> GSM955094     5  0.6112     0.4127 0.000 0.300 0.012 0.116 0.572
#> GSM955096     3  0.3452     0.6677 0.000 0.068 0.856 0.020 0.056
#> GSM955102     3  0.7350     0.4640 0.224 0.000 0.520 0.176 0.080
#> GSM955105     3  0.3448     0.6914 0.000 0.052 0.860 0.032 0.056

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM955002     2  0.6740     0.3156 0.000 0.552 0.036 0.044 0.176 0.192
#> GSM955008     6  0.4766     0.0608 0.000 0.044 0.400 0.000 0.004 0.552
#> GSM955016     4  0.2747     0.5564 0.068 0.000 0.008 0.880 0.036 0.008
#> GSM955019     2  0.1391     0.6188 0.000 0.944 0.000 0.000 0.016 0.040
#> GSM955022     5  0.6522     0.0422 0.000 0.000 0.356 0.048 0.436 0.160
#> GSM955023     6  0.7642     0.3883 0.000 0.172 0.156 0.020 0.224 0.428
#> GSM955027     2  0.5896     0.2932 0.000 0.460 0.000 0.000 0.224 0.316
#> GSM955043     5  0.5280     0.3620 0.000 0.236 0.000 0.004 0.612 0.148
#> GSM955048     1  0.2846     0.7560 0.856 0.000 0.000 0.084 0.000 0.060
#> GSM955049     6  0.6193    -0.0630 0.000 0.392 0.024 0.000 0.156 0.428
#> GSM955054     6  0.6519     0.2177 0.000 0.368 0.076 0.024 0.056 0.476
#> GSM955064     6  0.6383     0.1427 0.000 0.256 0.016 0.004 0.260 0.464
#> GSM955072     2  0.3798     0.5636 0.000 0.748 0.000 0.004 0.216 0.032
#> GSM955075     5  0.2709     0.5895 0.000 0.132 0.000 0.000 0.848 0.020
#> GSM955079     3  0.4301     0.4996 0.000 0.004 0.660 0.024 0.004 0.308
#> GSM955087     1  0.0000     0.7933 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM955088     3  0.4063     0.5623 0.000 0.012 0.752 0.028 0.008 0.200
#> GSM955089     1  0.2831     0.7377 0.840 0.000 0.000 0.136 0.000 0.024
#> GSM955095     5  0.3039     0.6002 0.000 0.032 0.040 0.028 0.876 0.024
#> GSM955097     5  0.3529     0.5363 0.000 0.008 0.028 0.148 0.808 0.008
#> GSM955101     6  0.5117     0.2220 0.000 0.076 0.336 0.008 0.000 0.580
#> GSM954999     4  0.3345     0.5349 0.000 0.000 0.068 0.844 0.052 0.036
#> GSM955001     2  0.6310     0.1357 0.000 0.376 0.000 0.008 0.288 0.328
#> GSM955003     6  0.5863     0.2279 0.000 0.368 0.072 0.012 0.028 0.520
#> GSM955004     5  0.4128    -0.0457 0.000 0.488 0.000 0.004 0.504 0.004
#> GSM955005     3  0.4209     0.6197 0.000 0.000 0.780 0.056 0.052 0.112
#> GSM955009     2  0.2144     0.6045 0.000 0.908 0.008 0.004 0.012 0.068
#> GSM955011     4  0.5764     0.4829 0.148 0.000 0.072 0.668 0.016 0.096
#> GSM955012     5  0.3655     0.5782 0.000 0.112 0.000 0.000 0.792 0.096
#> GSM955013     5  0.7514     0.1660 0.000 0.008 0.204 0.232 0.412 0.144
#> GSM955015     6  0.7714     0.2465 0.000 0.168 0.116 0.028 0.320 0.368
#> GSM955017     1  0.6505     0.3944 0.568 0.000 0.076 0.228 0.016 0.112
#> GSM955021     2  0.5295     0.1699 0.000 0.488 0.004 0.008 0.064 0.436
#> GSM955025     2  0.1942     0.5999 0.000 0.916 0.000 0.012 0.008 0.064
#> GSM955028     1  0.0000     0.7933 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM955029     5  0.4154     0.5164 0.000 0.144 0.000 0.000 0.744 0.112
#> GSM955030     3  0.3842     0.6110 0.000 0.000 0.812 0.068 0.052 0.068
#> GSM955032     3  0.4626     0.4899 0.000 0.000 0.652 0.028 0.024 0.296
#> GSM955033     4  0.7130     0.0560 0.000 0.056 0.060 0.444 0.348 0.092
#> GSM955034     1  0.0000     0.7933 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM955035     2  0.5385     0.2363 0.000 0.516 0.004 0.008 0.076 0.396
#> GSM955036     3  0.7206     0.1959 0.000 0.004 0.404 0.272 0.236 0.084
#> GSM955037     1  0.4329     0.4636 0.700 0.000 0.240 0.056 0.000 0.004
#> GSM955039     3  0.7784     0.2182 0.000 0.008 0.348 0.200 0.204 0.240
#> GSM955041     6  0.6927     0.1635 0.000 0.248 0.040 0.012 0.264 0.436
#> GSM955042     4  0.2852     0.5504 0.100 0.000 0.004 0.864 0.016 0.016
#> GSM955045     5  0.5792     0.4304 0.000 0.040 0.112 0.016 0.644 0.188
#> GSM955046     3  0.4972     0.5698 0.000 0.004 0.732 0.080 0.100 0.084
#> GSM955047     4  0.6008     0.1507 0.384 0.000 0.000 0.464 0.024 0.128
#> GSM955050     4  0.7896     0.2542 0.000 0.208 0.044 0.412 0.216 0.120
#> GSM955052     6  0.4128    -0.2468 0.000 0.000 0.492 0.004 0.004 0.500
#> GSM955053     1  0.0000     0.7933 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM955056     6  0.6719     0.0715 0.000 0.048 0.356 0.032 0.096 0.468
#> GSM955058     5  0.3985     0.5486 0.000 0.140 0.000 0.000 0.760 0.100
#> GSM955059     3  0.1332     0.6339 0.000 0.000 0.952 0.028 0.012 0.008
#> GSM955060     1  0.5496     0.3841 0.588 0.000 0.000 0.280 0.016 0.116
#> GSM955061     5  0.3718     0.5720 0.000 0.132 0.000 0.000 0.784 0.084
#> GSM955065     1  0.0000     0.7933 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM955066     3  0.4445     0.5921 0.000 0.000 0.768 0.076 0.080 0.076
#> GSM955067     4  0.4945     0.2922 0.344 0.004 0.000 0.584 0.000 0.068
#> GSM955073     3  0.3981     0.5078 0.000 0.004 0.672 0.008 0.004 0.312
#> GSM955074     4  0.2871     0.5499 0.116 0.000 0.000 0.852 0.024 0.008
#> GSM955076     2  0.3056     0.5515 0.000 0.820 0.000 0.008 0.012 0.160
#> GSM955078     2  0.3641     0.4889 0.000 0.732 0.000 0.000 0.248 0.020
#> GSM955083     4  0.5277     0.3019 0.000 0.004 0.044 0.628 0.280 0.044
#> GSM955084     2  0.4103     0.0779 0.000 0.544 0.000 0.004 0.448 0.004
#> GSM955086     3  0.4625     0.4916 0.000 0.008 0.656 0.028 0.012 0.296
#> GSM955091     2  0.4250     0.5740 0.000 0.744 0.000 0.004 0.108 0.144
#> GSM955092     6  0.6544     0.3675 0.000 0.212 0.116 0.012 0.092 0.568
#> GSM955093     3  0.3263     0.5988 0.000 0.004 0.800 0.020 0.000 0.176
#> GSM955098     2  0.0692     0.6094 0.000 0.976 0.000 0.004 0.000 0.020
#> GSM955099     2  0.5173     0.5030 0.000 0.620 0.000 0.000 0.180 0.200
#> GSM955100     4  0.5897     0.5029 0.092 0.004 0.084 0.668 0.016 0.136
#> GSM955103     5  0.6761    -0.0337 0.000 0.028 0.228 0.008 0.376 0.360
#> GSM955104     3  0.4870     0.5645 0.000 0.000 0.708 0.136 0.024 0.132
#> GSM955106     5  0.2006     0.6173 0.000 0.060 0.016 0.004 0.916 0.004
#> GSM955000     1  0.2997     0.7287 0.868 0.000 0.068 0.024 0.004 0.036
#> GSM955006     4  0.5516     0.3091 0.328 0.000 0.000 0.556 0.016 0.100
#> GSM955007     3  0.5431     0.5094 0.000 0.004 0.664 0.032 0.144 0.156
#> GSM955010     3  0.6293     0.4202 0.000 0.004 0.556 0.256 0.064 0.120
#> GSM955014     4  0.5082     0.1757 0.408 0.000 0.000 0.512 0.000 0.080
#> GSM955018     3  0.3201     0.5776 0.000 0.000 0.780 0.012 0.000 0.208
#> GSM955020     1  0.3555     0.6794 0.776 0.000 0.000 0.184 0.000 0.040
#> GSM955024     6  0.7044     0.2080 0.000 0.032 0.240 0.020 0.316 0.392
#> GSM955026     2  0.0858     0.6085 0.000 0.968 0.000 0.004 0.000 0.028
#> GSM955031     6  0.7006     0.1702 0.000 0.348 0.120 0.068 0.024 0.440
#> GSM955038     4  0.5004     0.3693 0.000 0.316 0.000 0.604 0.072 0.008
#> GSM955040     4  0.6989     0.4347 0.000 0.208 0.048 0.548 0.076 0.120
#> GSM955044     2  0.4840     0.4737 0.000 0.672 0.000 0.012 0.232 0.084
#> GSM955051     4  0.5656     0.1749 0.396 0.000 0.000 0.488 0.016 0.100
#> GSM955055     2  0.5443     0.3585 0.000 0.556 0.000 0.008 0.112 0.324
#> GSM955057     1  0.3227     0.7279 0.824 0.000 0.000 0.116 0.000 0.060
#> GSM955062     2  0.5408     0.2629 0.000 0.524 0.004 0.008 0.080 0.384
#> GSM955063     3  0.3795     0.5357 0.000 0.004 0.724 0.012 0.004 0.256
#> GSM955068     2  0.1780     0.6160 0.000 0.924 0.000 0.000 0.048 0.028
#> GSM955069     3  0.2002     0.6352 0.000 0.000 0.920 0.028 0.012 0.040
#> GSM955070     2  0.6829     0.1680 0.000 0.420 0.008 0.036 0.304 0.232
#> GSM955071     6  0.7635    -0.0329 0.000 0.104 0.180 0.344 0.024 0.348
#> GSM955077     2  0.3746     0.5114 0.000 0.804 0.008 0.036 0.016 0.136
#> GSM955080     5  0.2472     0.5992 0.000 0.016 0.052 0.024 0.900 0.008
#> GSM955081     6  0.6769     0.2209 0.000 0.352 0.124 0.016 0.056 0.452
#> GSM955082     6  0.6470     0.3638 0.000 0.064 0.212 0.004 0.172 0.548
#> GSM955085     2  0.3302     0.6136 0.000 0.836 0.008 0.004 0.104 0.048
#> GSM955090     4  0.5012     0.2712 0.352 0.000 0.000 0.580 0.012 0.056
#> GSM955094     5  0.6663     0.3221 0.000 0.276 0.040 0.040 0.532 0.112
#> GSM955096     3  0.4992     0.3553 0.000 0.016 0.548 0.032 0.004 0.400
#> GSM955102     3  0.4451     0.5185 0.212 0.000 0.716 0.060 0.004 0.008
#> GSM955105     3  0.5063     0.4530 0.000 0.012 0.612 0.032 0.020 0.324

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

consensus_heatmap(res, k = 2)

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

consensus_heatmap(res, k = 3)

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

consensus_heatmap(res, k = 4)

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

consensus_heatmap(res, k = 5)

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

consensus_heatmap(res, k = 6)

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

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

membership_heatmap(res, k = 2)

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

membership_heatmap(res, k = 3)

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

membership_heatmap(res, k = 4)

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

membership_heatmap(res, k = 5)

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

membership_heatmap(res, k = 6)

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

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

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

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

get_signatures(res, k = 3)

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

get_signatures(res, k = 4)

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

get_signatures(res, k = 5)

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

get_signatures(res, k = 6)

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

Signature heatmaps where rows are not scaled:

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

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

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

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

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

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

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

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

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

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

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk CV-kmeans-signature_compare

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

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

An example of the output of tb is:

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

The columns in tb are:

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

UMAP plot which shows how samples are separated.

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

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

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

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

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

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

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

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

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

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

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk CV-kmeans-collect-classes

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

test_to_known_factors(res)
#>             n genotype/variation(p) k
#> CV:kmeans 104                 0.887 2
#> CV:kmeans 103                 0.963 3
#> CV:kmeans  82                 0.870 4
#> CV:kmeans  55                 0.985 5
#> CV:kmeans  50                 0.596 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 31589 rows and 108 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'CV' method.
#>   Subgroups are detected by 'skmeans' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 2.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

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

collect_plots(res)

plot of chunk CV-skmeans-collect-plots

The plots are:

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

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

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

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

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.830           0.886       0.954         0.4960 0.502   0.502
#> 3 3 0.693           0.779       0.898         0.3335 0.748   0.538
#> 4 4 0.533           0.594       0.776         0.1297 0.853   0.599
#> 5 5 0.531           0.438       0.656         0.0595 0.955   0.828
#> 6 6 0.537           0.372       0.597         0.0398 0.898   0.612

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
#> GSM955002     2  0.0000     0.9626 0.000 1.000
#> GSM955008     2  0.0000     0.9626 0.000 1.000
#> GSM955016     1  0.0000     0.9323 1.000 0.000
#> GSM955019     2  0.0000     0.9626 0.000 1.000
#> GSM955022     2  0.0672     0.9562 0.008 0.992
#> GSM955023     2  0.0000     0.9626 0.000 1.000
#> GSM955027     2  0.0000     0.9626 0.000 1.000
#> GSM955043     2  0.0000     0.9626 0.000 1.000
#> GSM955048     1  0.0000     0.9323 1.000 0.000
#> GSM955049     2  0.0000     0.9626 0.000 1.000
#> GSM955054     2  0.0000     0.9626 0.000 1.000
#> GSM955064     2  0.0000     0.9626 0.000 1.000
#> GSM955072     2  0.0000     0.9626 0.000 1.000
#> GSM955075     2  0.0000     0.9626 0.000 1.000
#> GSM955079     1  0.5178     0.8495 0.884 0.116
#> GSM955087     1  0.0000     0.9323 1.000 0.000
#> GSM955088     1  0.8081     0.6914 0.752 0.248
#> GSM955089     1  0.0000     0.9323 1.000 0.000
#> GSM955095     2  0.0000     0.9626 0.000 1.000
#> GSM955097     1  0.8955     0.5744 0.688 0.312
#> GSM955101     2  0.0000     0.9626 0.000 1.000
#> GSM954999     1  0.0000     0.9323 1.000 0.000
#> GSM955001     2  0.0000     0.9626 0.000 1.000
#> GSM955003     2  0.0000     0.9626 0.000 1.000
#> GSM955004     2  0.0000     0.9626 0.000 1.000
#> GSM955005     1  0.0376     0.9304 0.996 0.004
#> GSM955009     2  0.0000     0.9626 0.000 1.000
#> GSM955011     1  0.0000     0.9323 1.000 0.000
#> GSM955012     2  0.0000     0.9626 0.000 1.000
#> GSM955013     2  1.0000    -0.1036 0.500 0.500
#> GSM955015     2  0.0000     0.9626 0.000 1.000
#> GSM955017     1  0.0000     0.9323 1.000 0.000
#> GSM955021     2  0.0000     0.9626 0.000 1.000
#> GSM955025     2  0.0000     0.9626 0.000 1.000
#> GSM955028     1  0.0000     0.9323 1.000 0.000
#> GSM955029     2  0.0000     0.9626 0.000 1.000
#> GSM955030     1  0.0000     0.9323 1.000 0.000
#> GSM955032     1  0.9775     0.3535 0.588 0.412
#> GSM955033     2  0.5946     0.8093 0.144 0.856
#> GSM955034     1  0.0000     0.9323 1.000 0.000
#> GSM955035     2  0.0000     0.9626 0.000 1.000
#> GSM955036     1  0.4939     0.8531 0.892 0.108
#> GSM955037     1  0.0000     0.9323 1.000 0.000
#> GSM955039     2  0.3879     0.8892 0.076 0.924
#> GSM955041     2  0.0000     0.9626 0.000 1.000
#> GSM955042     1  0.0000     0.9323 1.000 0.000
#> GSM955045     2  0.0000     0.9626 0.000 1.000
#> GSM955046     1  0.9635     0.4158 0.612 0.388
#> GSM955047     1  0.0000     0.9323 1.000 0.000
#> GSM955050     1  0.8661     0.5954 0.712 0.288
#> GSM955052     2  0.0000     0.9626 0.000 1.000
#> GSM955053     1  0.0000     0.9323 1.000 0.000
#> GSM955056     2  0.0000     0.9626 0.000 1.000
#> GSM955058     2  0.0000     0.9626 0.000 1.000
#> GSM955059     1  0.7602     0.7307 0.780 0.220
#> GSM955060     1  0.0000     0.9323 1.000 0.000
#> GSM955061     2  0.0000     0.9626 0.000 1.000
#> GSM955065     1  0.0000     0.9323 1.000 0.000
#> GSM955066     1  0.0000     0.9323 1.000 0.000
#> GSM955067     1  0.0000     0.9323 1.000 0.000
#> GSM955073     2  0.3274     0.9059 0.060 0.940
#> GSM955074     1  0.0000     0.9323 1.000 0.000
#> GSM955076     2  0.0000     0.9626 0.000 1.000
#> GSM955078     2  0.0000     0.9626 0.000 1.000
#> GSM955083     1  0.1633     0.9188 0.976 0.024
#> GSM955084     2  0.0000     0.9626 0.000 1.000
#> GSM955086     1  0.4161     0.8771 0.916 0.084
#> GSM955091     2  0.0000     0.9626 0.000 1.000
#> GSM955092     2  0.0000     0.9626 0.000 1.000
#> GSM955093     1  0.7056     0.7665 0.808 0.192
#> GSM955098     2  0.0000     0.9626 0.000 1.000
#> GSM955099     2  0.0000     0.9626 0.000 1.000
#> GSM955100     1  0.0000     0.9323 1.000 0.000
#> GSM955103     2  0.0000     0.9626 0.000 1.000
#> GSM955104     1  0.0000     0.9323 1.000 0.000
#> GSM955106     2  0.0000     0.9626 0.000 1.000
#> GSM955000     1  0.0000     0.9323 1.000 0.000
#> GSM955006     1  0.0000     0.9323 1.000 0.000
#> GSM955007     2  0.2423     0.9266 0.040 0.960
#> GSM955010     1  0.0000     0.9323 1.000 0.000
#> GSM955014     1  0.0000     0.9323 1.000 0.000
#> GSM955018     1  0.4161     0.8767 0.916 0.084
#> GSM955020     1  0.0000     0.9323 1.000 0.000
#> GSM955024     2  0.0000     0.9626 0.000 1.000
#> GSM955026     2  0.0000     0.9626 0.000 1.000
#> GSM955031     1  0.9866     0.2460 0.568 0.432
#> GSM955038     2  0.9988     0.0458 0.480 0.520
#> GSM955040     1  0.1843     0.9163 0.972 0.028
#> GSM955044     2  0.0000     0.9626 0.000 1.000
#> GSM955051     1  0.0000     0.9323 1.000 0.000
#> GSM955055     2  0.0000     0.9626 0.000 1.000
#> GSM955057     1  0.0000     0.9323 1.000 0.000
#> GSM955062     2  0.0000     0.9626 0.000 1.000
#> GSM955063     2  0.9170     0.4525 0.332 0.668
#> GSM955068     2  0.0000     0.9626 0.000 1.000
#> GSM955069     1  0.2043     0.9146 0.968 0.032
#> GSM955070     2  0.0000     0.9626 0.000 1.000
#> GSM955071     1  0.0376     0.9304 0.996 0.004
#> GSM955077     2  0.9460     0.4048 0.364 0.636
#> GSM955080     2  0.0376     0.9594 0.004 0.996
#> GSM955081     2  0.0000     0.9626 0.000 1.000
#> GSM955082     2  0.0000     0.9626 0.000 1.000
#> GSM955085     2  0.0000     0.9626 0.000 1.000
#> GSM955090     1  0.0000     0.9323 1.000 0.000
#> GSM955094     2  0.0000     0.9626 0.000 1.000
#> GSM955096     2  0.0672     0.9561 0.008 0.992
#> GSM955102     1  0.0000     0.9323 1.000 0.000
#> GSM955105     1  0.0376     0.9305 0.996 0.004

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1    p2    p3
#> GSM955002     2  0.1411     0.8846 0.000 0.964 0.036
#> GSM955008     3  0.3116     0.7982 0.000 0.108 0.892
#> GSM955016     1  0.0000     0.9145 1.000 0.000 0.000
#> GSM955019     2  0.0000     0.8956 0.000 1.000 0.000
#> GSM955022     3  0.3340     0.7842 0.000 0.120 0.880
#> GSM955023     2  0.6274     0.1897 0.000 0.544 0.456
#> GSM955027     2  0.0592     0.8955 0.000 0.988 0.012
#> GSM955043     2  0.0237     0.8956 0.000 0.996 0.004
#> GSM955048     1  0.0000     0.9145 1.000 0.000 0.000
#> GSM955049     2  0.2066     0.8767 0.000 0.940 0.060
#> GSM955054     2  0.6302     0.0758 0.000 0.520 0.480
#> GSM955064     2  0.2356     0.8695 0.000 0.928 0.072
#> GSM955072     2  0.0424     0.8948 0.000 0.992 0.008
#> GSM955075     2  0.0747     0.8946 0.000 0.984 0.016
#> GSM955079     3  0.1411     0.8399 0.036 0.000 0.964
#> GSM955087     1  0.0237     0.9126 0.996 0.000 0.004
#> GSM955088     3  0.2356     0.8290 0.072 0.000 0.928
#> GSM955089     1  0.0000     0.9145 1.000 0.000 0.000
#> GSM955095     2  0.2878     0.8461 0.000 0.904 0.096
#> GSM955097     1  0.7309     0.2361 0.552 0.416 0.032
#> GSM955101     3  0.2625     0.8151 0.000 0.084 0.916
#> GSM954999     1  0.0424     0.9102 0.992 0.000 0.008
#> GSM955001     2  0.0892     0.8953 0.000 0.980 0.020
#> GSM955003     3  0.6302     0.0276 0.000 0.480 0.520
#> GSM955004     2  0.0237     0.8954 0.000 0.996 0.004
#> GSM955005     3  0.3267     0.8063 0.116 0.000 0.884
#> GSM955009     2  0.0000     0.8956 0.000 1.000 0.000
#> GSM955011     1  0.0000     0.9145 1.000 0.000 0.000
#> GSM955012     2  0.1289     0.8906 0.000 0.968 0.032
#> GSM955013     3  0.9333     0.4571 0.216 0.268 0.516
#> GSM955015     2  0.6204     0.2949 0.000 0.576 0.424
#> GSM955017     1  0.0000     0.9145 1.000 0.000 0.000
#> GSM955021     2  0.3482     0.8155 0.000 0.872 0.128
#> GSM955025     2  0.0000     0.8956 0.000 1.000 0.000
#> GSM955028     1  0.0237     0.9126 0.996 0.000 0.004
#> GSM955029     2  0.0424     0.8956 0.000 0.992 0.008
#> GSM955030     3  0.6026     0.4693 0.376 0.000 0.624
#> GSM955032     3  0.0424     0.8395 0.008 0.000 0.992
#> GSM955033     2  0.5881     0.6144 0.256 0.728 0.016
#> GSM955034     1  0.0000     0.9145 1.000 0.000 0.000
#> GSM955035     2  0.1031     0.8927 0.000 0.976 0.024
#> GSM955036     3  0.7671     0.4007 0.380 0.052 0.568
#> GSM955037     1  0.2261     0.8570 0.932 0.000 0.068
#> GSM955039     3  0.4121     0.8031 0.024 0.108 0.868
#> GSM955041     2  0.2878     0.8542 0.000 0.904 0.096
#> GSM955042     1  0.0000     0.9145 1.000 0.000 0.000
#> GSM955045     2  0.4702     0.7308 0.000 0.788 0.212
#> GSM955046     3  0.0892     0.8414 0.020 0.000 0.980
#> GSM955047     1  0.0000     0.9145 1.000 0.000 0.000
#> GSM955050     1  0.5536     0.6474 0.752 0.236 0.012
#> GSM955052     3  0.1163     0.8376 0.000 0.028 0.972
#> GSM955053     1  0.0000     0.9145 1.000 0.000 0.000
#> GSM955056     3  0.4887     0.6569 0.000 0.228 0.772
#> GSM955058     2  0.0592     0.8953 0.000 0.988 0.012
#> GSM955059     3  0.0747     0.8405 0.016 0.000 0.984
#> GSM955060     1  0.0000     0.9145 1.000 0.000 0.000
#> GSM955061     2  0.0747     0.8951 0.000 0.984 0.016
#> GSM955065     1  0.0237     0.9126 0.996 0.000 0.004
#> GSM955066     3  0.5138     0.6748 0.252 0.000 0.748
#> GSM955067     1  0.0000     0.9145 1.000 0.000 0.000
#> GSM955073     3  0.0237     0.8388 0.000 0.004 0.996
#> GSM955074     1  0.0237     0.9120 0.996 0.000 0.004
#> GSM955076     2  0.1964     0.8723 0.000 0.944 0.056
#> GSM955078     2  0.0000     0.8956 0.000 1.000 0.000
#> GSM955083     1  0.1585     0.8941 0.964 0.008 0.028
#> GSM955084     2  0.0237     0.8954 0.000 0.996 0.004
#> GSM955086     3  0.1860     0.8368 0.052 0.000 0.948
#> GSM955091     2  0.0237     0.8957 0.000 0.996 0.004
#> GSM955092     2  0.5138     0.6722 0.000 0.748 0.252
#> GSM955093     3  0.0592     0.8397 0.012 0.000 0.988
#> GSM955098     2  0.0000     0.8956 0.000 1.000 0.000
#> GSM955099     2  0.0237     0.8957 0.000 0.996 0.004
#> GSM955100     1  0.0000     0.9145 1.000 0.000 0.000
#> GSM955103     3  0.5678     0.4988 0.000 0.316 0.684
#> GSM955104     3  0.5905     0.5083 0.352 0.000 0.648
#> GSM955106     2  0.0592     0.8941 0.000 0.988 0.012
#> GSM955000     1  0.0892     0.9020 0.980 0.000 0.020
#> GSM955006     1  0.0000     0.9145 1.000 0.000 0.000
#> GSM955007     3  0.0892     0.8382 0.000 0.020 0.980
#> GSM955010     1  0.5882     0.3664 0.652 0.000 0.348
#> GSM955014     1  0.0000     0.9145 1.000 0.000 0.000
#> GSM955018     3  0.1031     0.8408 0.024 0.000 0.976
#> GSM955020     1  0.0000     0.9145 1.000 0.000 0.000
#> GSM955024     3  0.5733     0.4795 0.000 0.324 0.676
#> GSM955026     2  0.0000     0.8956 0.000 1.000 0.000
#> GSM955031     1  0.9322     0.2621 0.504 0.304 0.192
#> GSM955038     1  0.6267     0.1860 0.548 0.452 0.000
#> GSM955040     1  0.2945     0.8336 0.908 0.088 0.004
#> GSM955044     2  0.0000     0.8956 0.000 1.000 0.000
#> GSM955051     1  0.0000     0.9145 1.000 0.000 0.000
#> GSM955055     2  0.0747     0.8944 0.000 0.984 0.016
#> GSM955057     1  0.0000     0.9145 1.000 0.000 0.000
#> GSM955062     2  0.1753     0.8839 0.000 0.952 0.048
#> GSM955063     3  0.0237     0.8389 0.004 0.000 0.996
#> GSM955068     2  0.0000     0.8956 0.000 1.000 0.000
#> GSM955069     3  0.2448     0.8260 0.076 0.000 0.924
#> GSM955070     2  0.0592     0.8954 0.000 0.988 0.012
#> GSM955071     1  0.2173     0.8769 0.944 0.008 0.048
#> GSM955077     2  0.5178     0.6211 0.256 0.744 0.000
#> GSM955080     2  0.4062     0.7832 0.000 0.836 0.164
#> GSM955081     2  0.5760     0.4973 0.000 0.672 0.328
#> GSM955082     2  0.6307     0.0777 0.000 0.512 0.488
#> GSM955085     2  0.0000     0.8956 0.000 1.000 0.000
#> GSM955090     1  0.0000     0.9145 1.000 0.000 0.000
#> GSM955094     2  0.1289     0.8889 0.000 0.968 0.032
#> GSM955096     3  0.0592     0.8391 0.000 0.012 0.988
#> GSM955102     3  0.4796     0.7157 0.220 0.000 0.780
#> GSM955105     3  0.3038     0.8136 0.104 0.000 0.896

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM955002     2  0.5430     0.4641 0.000 0.664 0.036 0.300
#> GSM955008     3  0.4761     0.6267 0.000 0.192 0.764 0.044
#> GSM955016     1  0.1474     0.8734 0.948 0.000 0.000 0.052
#> GSM955019     2  0.1902     0.6749 0.000 0.932 0.004 0.064
#> GSM955022     4  0.4631     0.3904 0.004 0.008 0.260 0.728
#> GSM955023     2  0.7771     0.1075 0.000 0.408 0.348 0.244
#> GSM955027     2  0.4406     0.6154 0.000 0.780 0.028 0.192
#> GSM955043     4  0.5296     0.0901 0.000 0.492 0.008 0.500
#> GSM955048     1  0.0188     0.8907 0.996 0.000 0.004 0.000
#> GSM955049     2  0.6397     0.5060 0.000 0.648 0.144 0.208
#> GSM955054     2  0.5673     0.4467 0.000 0.660 0.288 0.052
#> GSM955064     4  0.7226     0.1806 0.000 0.388 0.144 0.468
#> GSM955072     2  0.3311     0.6369 0.000 0.828 0.000 0.172
#> GSM955075     4  0.4313     0.5197 0.000 0.260 0.004 0.736
#> GSM955079     3  0.3304     0.7514 0.052 0.048 0.888 0.012
#> GSM955087     1  0.0779     0.8861 0.980 0.000 0.016 0.004
#> GSM955088     3  0.4371     0.7530 0.080 0.020 0.836 0.064
#> GSM955089     1  0.0188     0.8907 0.996 0.000 0.004 0.000
#> GSM955095     4  0.3384     0.5897 0.000 0.116 0.024 0.860
#> GSM955097     4  0.5230     0.5333 0.152 0.084 0.004 0.760
#> GSM955101     3  0.5254     0.5915 0.000 0.220 0.724 0.056
#> GSM954999     1  0.3894     0.7957 0.844 0.000 0.068 0.088
#> GSM955001     2  0.5733     0.4322 0.000 0.640 0.048 0.312
#> GSM955003     2  0.5213     0.4134 0.000 0.652 0.328 0.020
#> GSM955004     2  0.4916     0.2129 0.000 0.576 0.000 0.424
#> GSM955005     3  0.6327     0.6911 0.140 0.048 0.720 0.092
#> GSM955009     2  0.1716     0.6732 0.000 0.936 0.000 0.064
#> GSM955011     1  0.0188     0.8907 0.996 0.000 0.004 0.000
#> GSM955012     4  0.4718     0.5217 0.000 0.280 0.012 0.708
#> GSM955013     4  0.5263     0.5040 0.060 0.020 0.148 0.772
#> GSM955015     2  0.7886    -0.0164 0.000 0.380 0.324 0.296
#> GSM955017     1  0.0657     0.8878 0.984 0.000 0.012 0.004
#> GSM955021     2  0.3612     0.6401 0.000 0.856 0.100 0.044
#> GSM955025     2  0.2593     0.6695 0.000 0.892 0.004 0.104
#> GSM955028     1  0.0779     0.8861 0.980 0.000 0.016 0.004
#> GSM955029     4  0.5112     0.3591 0.000 0.384 0.008 0.608
#> GSM955030     3  0.6562     0.3245 0.404 0.000 0.516 0.080
#> GSM955032     3  0.2877     0.7507 0.008 0.060 0.904 0.028
#> GSM955033     4  0.4603     0.5334 0.032 0.160 0.012 0.796
#> GSM955034     1  0.0376     0.8902 0.992 0.000 0.004 0.004
#> GSM955035     2  0.3521     0.6664 0.000 0.864 0.052 0.084
#> GSM955036     4  0.6074     0.3146 0.104 0.000 0.228 0.668
#> GSM955037     1  0.3441     0.7788 0.856 0.000 0.120 0.024
#> GSM955039     4  0.7213    -0.0457 0.012 0.100 0.400 0.488
#> GSM955041     4  0.7338     0.2451 0.000 0.376 0.160 0.464
#> GSM955042     1  0.0592     0.8891 0.984 0.000 0.000 0.016
#> GSM955045     4  0.6792     0.4710 0.000 0.272 0.140 0.588
#> GSM955046     3  0.4677     0.5822 0.004 0.000 0.680 0.316
#> GSM955047     1  0.0469     0.8890 0.988 0.000 0.000 0.012
#> GSM955050     1  0.8077     0.0154 0.408 0.360 0.012 0.220
#> GSM955052     3  0.3525     0.7232 0.000 0.100 0.860 0.040
#> GSM955053     1  0.0376     0.8902 0.992 0.000 0.004 0.004
#> GSM955056     3  0.6640     0.4459 0.000 0.268 0.604 0.128
#> GSM955058     4  0.5167     0.4370 0.000 0.340 0.016 0.644
#> GSM955059     3  0.2861     0.7434 0.016 0.000 0.888 0.096
#> GSM955060     1  0.0188     0.8907 0.996 0.000 0.000 0.004
#> GSM955061     4  0.4814     0.4671 0.000 0.316 0.008 0.676
#> GSM955065     1  0.0657     0.8878 0.984 0.000 0.012 0.004
#> GSM955066     3  0.6991     0.5780 0.232 0.004 0.596 0.168
#> GSM955067     1  0.1022     0.8824 0.968 0.000 0.000 0.032
#> GSM955073     3  0.1109     0.7515 0.000 0.004 0.968 0.028
#> GSM955074     1  0.1118     0.8804 0.964 0.000 0.000 0.036
#> GSM955076     2  0.2300     0.6641 0.000 0.924 0.048 0.028
#> GSM955078     2  0.3486     0.6242 0.000 0.812 0.000 0.188
#> GSM955083     1  0.6001     0.5397 0.648 0.028 0.024 0.300
#> GSM955084     2  0.4585     0.4291 0.000 0.668 0.000 0.332
#> GSM955086     3  0.3768     0.7602 0.044 0.048 0.872 0.036
#> GSM955091     2  0.3355     0.6437 0.000 0.836 0.004 0.160
#> GSM955092     2  0.6921     0.3917 0.000 0.580 0.260 0.160
#> GSM955093     3  0.1389     0.7520 0.000 0.000 0.952 0.048
#> GSM955098     2  0.1211     0.6692 0.000 0.960 0.000 0.040
#> GSM955099     2  0.3444     0.6286 0.000 0.816 0.000 0.184
#> GSM955100     1  0.0188     0.8908 0.996 0.000 0.000 0.004
#> GSM955103     4  0.5599     0.5423 0.000 0.072 0.228 0.700
#> GSM955104     3  0.7540     0.3876 0.304 0.000 0.480 0.216
#> GSM955106     4  0.3791     0.5618 0.000 0.200 0.004 0.796
#> GSM955000     1  0.1576     0.8659 0.948 0.000 0.048 0.004
#> GSM955006     1  0.0188     0.8907 0.996 0.000 0.004 0.000
#> GSM955007     3  0.4978     0.5235 0.000 0.012 0.664 0.324
#> GSM955010     1  0.6457     0.3409 0.604 0.000 0.296 0.100
#> GSM955014     1  0.0592     0.8875 0.984 0.000 0.000 0.016
#> GSM955018     3  0.1174     0.7567 0.012 0.000 0.968 0.020
#> GSM955020     1  0.0000     0.8904 1.000 0.000 0.000 0.000
#> GSM955024     4  0.6993     0.3475 0.000 0.124 0.364 0.512
#> GSM955026     2  0.1389     0.6691 0.000 0.952 0.000 0.048
#> GSM955031     2  0.7744     0.3361 0.148 0.572 0.240 0.040
#> GSM955038     1  0.7343    -0.0714 0.428 0.416 0.000 0.156
#> GSM955040     1  0.5950     0.6284 0.704 0.176 0.004 0.116
#> GSM955044     2  0.4746     0.3238 0.000 0.632 0.000 0.368
#> GSM955051     1  0.0336     0.8894 0.992 0.000 0.000 0.008
#> GSM955055     2  0.4046     0.6631 0.000 0.828 0.048 0.124
#> GSM955057     1  0.0188     0.8907 0.996 0.000 0.004 0.000
#> GSM955062     2  0.4428     0.6562 0.000 0.808 0.068 0.124
#> GSM955063     3  0.1004     0.7516 0.000 0.004 0.972 0.024
#> GSM955068     2  0.2281     0.6642 0.000 0.904 0.000 0.096
#> GSM955069     3  0.5171     0.7094 0.128 0.000 0.760 0.112
#> GSM955070     2  0.5295     0.0513 0.000 0.504 0.008 0.488
#> GSM955071     1  0.6112     0.6852 0.744 0.092 0.096 0.068
#> GSM955077     2  0.4444     0.5890 0.112 0.816 0.004 0.068
#> GSM955080     4  0.3749     0.5908 0.000 0.128 0.032 0.840
#> GSM955081     2  0.6068     0.4955 0.000 0.676 0.208 0.116
#> GSM955082     4  0.7775     0.2373 0.000 0.240 0.376 0.384
#> GSM955085     2  0.3688     0.6058 0.000 0.792 0.000 0.208
#> GSM955090     1  0.0592     0.8875 0.984 0.000 0.000 0.016
#> GSM955094     4  0.5130     0.3637 0.004 0.344 0.008 0.644
#> GSM955096     3  0.3757     0.6911 0.000 0.152 0.828 0.020
#> GSM955102     3  0.6025     0.6272 0.236 0.000 0.668 0.096
#> GSM955105     3  0.4723     0.7403 0.108 0.036 0.816 0.040

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM955002     2  0.6612     0.3368 0.000 0.568 0.028 0.228 0.176
#> GSM955008     3  0.5020     0.4666 0.000 0.140 0.748 0.076 0.036
#> GSM955016     1  0.2903     0.8019 0.872 0.000 0.000 0.080 0.048
#> GSM955019     2  0.3809     0.5329 0.000 0.824 0.016 0.044 0.116
#> GSM955022     5  0.6675    -0.0228 0.000 0.020 0.136 0.384 0.460
#> GSM955023     2  0.8454     0.1356 0.000 0.348 0.220 0.196 0.236
#> GSM955027     2  0.6197     0.3110 0.000 0.560 0.044 0.060 0.336
#> GSM955043     5  0.5579     0.2301 0.000 0.368 0.000 0.080 0.552
#> GSM955048     1  0.0609     0.8533 0.980 0.000 0.000 0.020 0.000
#> GSM955049     2  0.7393     0.2760 0.000 0.488 0.152 0.076 0.284
#> GSM955054     2  0.6958     0.2716 0.000 0.484 0.356 0.096 0.064
#> GSM955064     5  0.7932     0.0844 0.000 0.316 0.116 0.164 0.404
#> GSM955072     2  0.5195     0.4561 0.000 0.692 0.008 0.088 0.212
#> GSM955075     5  0.4203     0.4798 0.000 0.188 0.000 0.052 0.760
#> GSM955079     3  0.5025     0.5112 0.060 0.040 0.772 0.112 0.016
#> GSM955087     1  0.1300     0.8467 0.956 0.000 0.016 0.028 0.000
#> GSM955088     3  0.6264     0.3230 0.060 0.032 0.604 0.288 0.016
#> GSM955089     1  0.0404     0.8527 0.988 0.000 0.000 0.012 0.000
#> GSM955095     5  0.4431     0.5343 0.000 0.068 0.004 0.168 0.760
#> GSM955097     5  0.5108     0.4807 0.108 0.028 0.000 0.124 0.740
#> GSM955101     3  0.6210     0.3735 0.000 0.136 0.656 0.148 0.060
#> GSM954999     1  0.5711     0.5625 0.668 0.000 0.048 0.224 0.060
#> GSM955001     2  0.6792     0.2124 0.000 0.476 0.072 0.068 0.384
#> GSM955003     2  0.6555     0.2840 0.000 0.496 0.380 0.080 0.044
#> GSM955004     2  0.5352     0.1053 0.000 0.480 0.000 0.052 0.468
#> GSM955005     4  0.7970     0.1404 0.132 0.056 0.376 0.400 0.036
#> GSM955009     2  0.3445     0.5313 0.000 0.856 0.020 0.052 0.072
#> GSM955011     1  0.0912     0.8548 0.972 0.000 0.000 0.016 0.012
#> GSM955012     5  0.4435     0.4968 0.000 0.164 0.012 0.056 0.768
#> GSM955013     5  0.6791     0.1966 0.028 0.016 0.092 0.344 0.520
#> GSM955015     2  0.8549     0.0295 0.000 0.296 0.272 0.228 0.204
#> GSM955017     1  0.2102     0.8329 0.916 0.000 0.012 0.068 0.004
#> GSM955021     2  0.6139     0.4636 0.000 0.648 0.204 0.060 0.088
#> GSM955025     2  0.4277     0.5071 0.000 0.784 0.004 0.112 0.100
#> GSM955028     1  0.1386     0.8450 0.952 0.000 0.016 0.032 0.000
#> GSM955029     5  0.4243     0.4009 0.000 0.264 0.000 0.024 0.712
#> GSM955030     4  0.7253     0.3311 0.300 0.000 0.296 0.384 0.020
#> GSM955032     3  0.4612     0.5427 0.004 0.056 0.768 0.156 0.016
#> GSM955033     5  0.6729     0.2732 0.016 0.132 0.004 0.416 0.432
#> GSM955034     1  0.0771     0.8505 0.976 0.000 0.004 0.020 0.000
#> GSM955035     2  0.6254     0.4957 0.000 0.664 0.116 0.100 0.120
#> GSM955036     4  0.6976     0.3379 0.048 0.000 0.140 0.516 0.296
#> GSM955037     1  0.4309     0.6367 0.768 0.000 0.084 0.148 0.000
#> GSM955039     4  0.7398     0.1966 0.012 0.040 0.300 0.484 0.164
#> GSM955041     5  0.8042     0.1820 0.000 0.292 0.148 0.152 0.408
#> GSM955042     1  0.1978     0.8412 0.928 0.000 0.004 0.044 0.024
#> GSM955045     5  0.7399     0.3688 0.000 0.192 0.156 0.116 0.536
#> GSM955046     4  0.6120     0.1974 0.012 0.000 0.392 0.504 0.092
#> GSM955047     1  0.1484     0.8488 0.944 0.000 0.000 0.048 0.008
#> GSM955050     2  0.8691     0.1211 0.216 0.356 0.012 0.244 0.172
#> GSM955052     3  0.4062     0.5359 0.000 0.068 0.820 0.084 0.028
#> GSM955053     1  0.0912     0.8510 0.972 0.000 0.012 0.016 0.000
#> GSM955056     3  0.6889     0.3243 0.000 0.232 0.572 0.120 0.076
#> GSM955058     5  0.4026     0.4213 0.000 0.244 0.000 0.020 0.736
#> GSM955059     3  0.5115     0.2099 0.012 0.000 0.608 0.352 0.028
#> GSM955060     1  0.0794     0.8543 0.972 0.000 0.000 0.028 0.000
#> GSM955061     5  0.4229     0.4643 0.000 0.208 0.012 0.024 0.756
#> GSM955065     1  0.1195     0.8469 0.960 0.000 0.012 0.028 0.000
#> GSM955066     4  0.7571     0.2898 0.148 0.008 0.344 0.440 0.060
#> GSM955067     1  0.2291     0.8287 0.908 0.008 0.000 0.072 0.012
#> GSM955073     3  0.3127     0.5324 0.000 0.004 0.848 0.128 0.020
#> GSM955074     1  0.2074     0.8341 0.920 0.000 0.000 0.044 0.036
#> GSM955076     2  0.3870     0.5303 0.000 0.832 0.088 0.048 0.032
#> GSM955078     2  0.4546     0.3976 0.000 0.668 0.000 0.028 0.304
#> GSM955083     1  0.7637     0.0203 0.436 0.020 0.024 0.244 0.276
#> GSM955084     2  0.5215     0.2799 0.000 0.576 0.000 0.052 0.372
#> GSM955086     3  0.4611     0.5392 0.024 0.044 0.784 0.136 0.012
#> GSM955091     2  0.5292     0.4493 0.000 0.668 0.020 0.052 0.260
#> GSM955092     2  0.7944     0.1505 0.000 0.360 0.328 0.084 0.228
#> GSM955093     3  0.3905     0.4471 0.000 0.004 0.752 0.232 0.012
#> GSM955098     2  0.2393     0.5246 0.000 0.900 0.004 0.080 0.016
#> GSM955099     2  0.5053     0.3993 0.000 0.644 0.004 0.048 0.304
#> GSM955100     1  0.2115     0.8363 0.916 0.000 0.008 0.068 0.008
#> GSM955103     5  0.6779     0.3085 0.000 0.028 0.220 0.208 0.544
#> GSM955104     4  0.8174     0.3679 0.248 0.008 0.300 0.364 0.080
#> GSM955106     5  0.4010     0.5186 0.000 0.116 0.000 0.088 0.796
#> GSM955000     1  0.2554     0.8019 0.892 0.000 0.036 0.072 0.000
#> GSM955006     1  0.0510     0.8535 0.984 0.000 0.000 0.016 0.000
#> GSM955007     3  0.6891    -0.0886 0.000 0.012 0.456 0.308 0.224
#> GSM955010     1  0.6917    -0.3359 0.412 0.000 0.172 0.396 0.020
#> GSM955014     1  0.1597     0.8434 0.940 0.000 0.000 0.048 0.012
#> GSM955018     3  0.3560     0.5191 0.008 0.004 0.816 0.160 0.012
#> GSM955020     1  0.0566     0.8529 0.984 0.000 0.000 0.012 0.004
#> GSM955024     5  0.8097     0.2569 0.000 0.124 0.264 0.208 0.404
#> GSM955026     2  0.3289     0.5273 0.000 0.860 0.016 0.088 0.036
#> GSM955031     2  0.8348     0.2299 0.112 0.456 0.252 0.148 0.032
#> GSM955038     2  0.7691     0.1351 0.356 0.408 0.000 0.120 0.116
#> GSM955040     1  0.7732     0.1853 0.468 0.216 0.000 0.220 0.096
#> GSM955044     2  0.5979     0.2363 0.000 0.520 0.000 0.120 0.360
#> GSM955051     1  0.1043     0.8536 0.960 0.000 0.000 0.040 0.000
#> GSM955055     2  0.5836     0.4678 0.000 0.668 0.072 0.052 0.208
#> GSM955057     1  0.0609     0.8533 0.980 0.000 0.000 0.020 0.000
#> GSM955062     2  0.6866     0.4357 0.000 0.584 0.108 0.092 0.216
#> GSM955063     3  0.3320     0.5277 0.000 0.008 0.828 0.152 0.012
#> GSM955068     2  0.3748     0.5197 0.000 0.832 0.016 0.052 0.100
#> GSM955069     3  0.6631    -0.0428 0.112 0.000 0.528 0.324 0.036
#> GSM955070     2  0.7086     0.1606 0.000 0.448 0.028 0.188 0.336
#> GSM955071     1  0.7681     0.2348 0.532 0.112 0.096 0.236 0.024
#> GSM955077     2  0.6097     0.4642 0.056 0.704 0.028 0.124 0.088
#> GSM955080     5  0.4398     0.5342 0.000 0.060 0.016 0.144 0.780
#> GSM955081     2  0.7560     0.3483 0.000 0.512 0.212 0.152 0.124
#> GSM955082     5  0.8065     0.1748 0.000 0.180 0.348 0.120 0.352
#> GSM955085     2  0.5110     0.4274 0.000 0.668 0.012 0.048 0.272
#> GSM955090     1  0.1549     0.8456 0.944 0.000 0.000 0.040 0.016
#> GSM955094     5  0.6887     0.1608 0.000 0.308 0.004 0.284 0.404
#> GSM955096     3  0.4456     0.5383 0.000 0.088 0.796 0.080 0.036
#> GSM955102     3  0.6480    -0.2753 0.184 0.000 0.416 0.400 0.000
#> GSM955105     3  0.5423     0.4831 0.064 0.052 0.740 0.132 0.012

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM955002     2  0.7236    0.30637 0.000 0.532 0.076 0.168 0.164 0.060
#> GSM955008     6  0.5037    0.42584 0.000 0.096 0.060 0.048 0.048 0.748
#> GSM955016     1  0.4881    0.56025 0.616 0.004 0.032 0.328 0.020 0.000
#> GSM955019     2  0.5186    0.52434 0.000 0.716 0.012 0.068 0.136 0.068
#> GSM955022     3  0.7466   -0.03576 0.000 0.024 0.384 0.124 0.348 0.120
#> GSM955023     6  0.8551    0.05756 0.000 0.260 0.144 0.104 0.172 0.320
#> GSM955027     2  0.7007    0.21052 0.000 0.408 0.020 0.072 0.380 0.120
#> GSM955043     5  0.6354    0.34722 0.000 0.232 0.044 0.100 0.588 0.036
#> GSM955048     1  0.1082    0.81121 0.956 0.000 0.004 0.040 0.000 0.000
#> GSM955049     2  0.7341    0.23082 0.000 0.380 0.036 0.036 0.292 0.256
#> GSM955054     6  0.6962   -0.03737 0.000 0.396 0.048 0.108 0.040 0.408
#> GSM955064     5  0.8205    0.10417 0.000 0.196 0.068 0.128 0.380 0.228
#> GSM955072     2  0.5571    0.43403 0.000 0.632 0.020 0.056 0.256 0.036
#> GSM955075     5  0.3126    0.56519 0.000 0.080 0.024 0.028 0.860 0.008
#> GSM955079     6  0.6986    0.28282 0.052 0.036 0.232 0.112 0.016 0.552
#> GSM955087     1  0.1049    0.80328 0.960 0.000 0.032 0.008 0.000 0.000
#> GSM955088     6  0.7589    0.01435 0.084 0.044 0.320 0.128 0.004 0.420
#> GSM955089     1  0.1643    0.81078 0.924 0.000 0.008 0.068 0.000 0.000
#> GSM955095     5  0.5298    0.44572 0.000 0.036 0.144 0.112 0.696 0.012
#> GSM955097     5  0.5332    0.28469 0.080 0.004 0.044 0.204 0.668 0.000
#> GSM955101     6  0.7157    0.33596 0.000 0.112 0.204 0.096 0.052 0.536
#> GSM954999     1  0.6823    0.26047 0.468 0.000 0.148 0.320 0.036 0.028
#> GSM955001     5  0.7045   -0.12602 0.000 0.356 0.024 0.080 0.432 0.108
#> GSM955003     6  0.6190   -0.02464 0.000 0.416 0.024 0.060 0.040 0.460
#> GSM955004     5  0.4916    0.01221 0.000 0.436 0.008 0.044 0.512 0.000
#> GSM955005     3  0.8361    0.23552 0.116 0.052 0.416 0.140 0.032 0.244
#> GSM955009     2  0.4552    0.52677 0.000 0.772 0.012 0.072 0.092 0.052
#> GSM955011     1  0.1926    0.80840 0.912 0.000 0.020 0.068 0.000 0.000
#> GSM955012     5  0.2806    0.57188 0.000 0.056 0.016 0.028 0.884 0.016
#> GSM955013     4  0.8154    0.04090 0.016 0.024 0.252 0.316 0.288 0.104
#> GSM955015     2  0.8726   -0.03481 0.000 0.284 0.160 0.156 0.136 0.264
#> GSM955017     1  0.2619    0.78313 0.880 0.000 0.072 0.040 0.000 0.008
#> GSM955021     2  0.6617    0.34889 0.000 0.528 0.032 0.064 0.080 0.296
#> GSM955025     2  0.5093    0.49031 0.008 0.720 0.008 0.144 0.092 0.028
#> GSM955028     1  0.1196    0.80135 0.952 0.000 0.040 0.008 0.000 0.000
#> GSM955029     5  0.3475    0.51511 0.000 0.132 0.004 0.040 0.816 0.008
#> GSM955030     3  0.6598    0.30773 0.340 0.000 0.472 0.092 0.004 0.092
#> GSM955032     6  0.6416    0.30724 0.024 0.044 0.252 0.084 0.012 0.584
#> GSM955033     4  0.7800    0.25480 0.012 0.168 0.176 0.412 0.224 0.008
#> GSM955034     1  0.0603    0.80627 0.980 0.000 0.016 0.004 0.000 0.000
#> GSM955035     2  0.6736    0.44703 0.000 0.576 0.036 0.072 0.136 0.180
#> GSM955036     3  0.6555    0.15325 0.040 0.000 0.532 0.244 0.168 0.016
#> GSM955037     1  0.4029    0.56340 0.736 0.000 0.220 0.012 0.000 0.032
#> GSM955039     3  0.8460    0.05244 0.008 0.068 0.348 0.256 0.124 0.196
#> GSM955041     5  0.8268    0.12333 0.000 0.196 0.100 0.108 0.392 0.204
#> GSM955042     1  0.3709    0.71467 0.748 0.000 0.016 0.228 0.004 0.004
#> GSM955045     5  0.7709    0.37032 0.000 0.128 0.120 0.092 0.496 0.164
#> GSM955046     3  0.4659    0.37425 0.008 0.000 0.752 0.060 0.048 0.132
#> GSM955047     1  0.2566    0.79688 0.868 0.000 0.012 0.112 0.000 0.008
#> GSM955050     4  0.8614    0.35439 0.172 0.296 0.060 0.340 0.096 0.036
#> GSM955052     6  0.4810    0.39444 0.000 0.028 0.124 0.060 0.036 0.752
#> GSM955053     1  0.0603    0.80728 0.980 0.000 0.016 0.004 0.000 0.000
#> GSM955056     6  0.7503    0.38480 0.000 0.192 0.144 0.108 0.056 0.500
#> GSM955058     5  0.3145    0.55117 0.000 0.104 0.004 0.028 0.848 0.016
#> GSM955059     3  0.4941    0.23299 0.032 0.000 0.624 0.020 0.008 0.316
#> GSM955060     1  0.1807    0.81184 0.920 0.000 0.020 0.060 0.000 0.000
#> GSM955061     5  0.3314    0.56029 0.000 0.100 0.004 0.040 0.840 0.016
#> GSM955065     1  0.1010    0.80145 0.960 0.000 0.036 0.004 0.000 0.000
#> GSM955066     3  0.6935    0.39761 0.152 0.004 0.556 0.148 0.016 0.124
#> GSM955067     1  0.3460    0.72673 0.760 0.020 0.000 0.220 0.000 0.000
#> GSM955073     6  0.4397    0.24878 0.000 0.000 0.284 0.032 0.012 0.672
#> GSM955074     1  0.3672    0.69511 0.712 0.000 0.008 0.276 0.004 0.000
#> GSM955076     2  0.4639    0.51857 0.000 0.748 0.012 0.048 0.040 0.152
#> GSM955078     2  0.4975    0.38491 0.000 0.616 0.004 0.052 0.316 0.012
#> GSM955083     1  0.7817   -0.15935 0.372 0.028 0.112 0.332 0.148 0.008
#> GSM955084     2  0.4770    0.07183 0.000 0.508 0.004 0.040 0.448 0.000
#> GSM955086     6  0.7089    0.21859 0.080 0.036 0.216 0.096 0.016 0.556
#> GSM955091     2  0.6376    0.41438 0.000 0.544 0.008 0.084 0.280 0.084
#> GSM955092     6  0.8034   -0.00336 0.000 0.240 0.060 0.092 0.236 0.372
#> GSM955093     3  0.5224   -0.00479 0.016 0.000 0.480 0.044 0.004 0.456
#> GSM955098     2  0.1965    0.51960 0.000 0.924 0.004 0.040 0.024 0.008
#> GSM955099     2  0.5979    0.33105 0.000 0.532 0.012 0.056 0.348 0.052
#> GSM955100     1  0.3165    0.76199 0.844 0.000 0.072 0.076 0.000 0.008
#> GSM955103     5  0.7358    0.17255 0.000 0.012 0.208 0.148 0.464 0.168
#> GSM955104     3  0.7996    0.28740 0.244 0.000 0.416 0.120 0.068 0.152
#> GSM955106     5  0.3889    0.54918 0.000 0.072 0.048 0.072 0.808 0.000
#> GSM955000     1  0.2803    0.74309 0.856 0.000 0.116 0.016 0.000 0.012
#> GSM955006     1  0.1075    0.81434 0.952 0.000 0.000 0.048 0.000 0.000
#> GSM955007     3  0.6672    0.16472 0.000 0.012 0.532 0.060 0.172 0.224
#> GSM955010     3  0.6610    0.21819 0.368 0.012 0.456 0.120 0.004 0.040
#> GSM955014     1  0.2773    0.77346 0.828 0.004 0.004 0.164 0.000 0.000
#> GSM955018     6  0.5537    0.10567 0.040 0.000 0.328 0.040 0.012 0.580
#> GSM955020     1  0.1806    0.80586 0.908 0.000 0.004 0.088 0.000 0.000
#> GSM955024     6  0.8549    0.06414 0.000 0.100 0.180 0.140 0.280 0.300
#> GSM955026     2  0.2961    0.52393 0.000 0.872 0.004 0.048 0.052 0.024
#> GSM955031     2  0.8531   -0.06952 0.144 0.332 0.040 0.180 0.024 0.280
#> GSM955038     2  0.7193   -0.31083 0.232 0.372 0.004 0.316 0.076 0.000
#> GSM955040     4  0.8092    0.31102 0.300 0.252 0.060 0.328 0.040 0.020
#> GSM955044     2  0.6457    0.17313 0.000 0.472 0.040 0.060 0.384 0.044
#> GSM955051     1  0.2006    0.80002 0.892 0.000 0.004 0.104 0.000 0.000
#> GSM955055     2  0.7303    0.41383 0.000 0.516 0.052 0.092 0.208 0.132
#> GSM955057     1  0.0858    0.81291 0.968 0.000 0.004 0.028 0.000 0.000
#> GSM955062     2  0.7401    0.38329 0.000 0.484 0.040 0.084 0.208 0.184
#> GSM955063     6  0.4752    0.20842 0.004 0.000 0.360 0.028 0.012 0.596
#> GSM955068     2  0.3838    0.51224 0.000 0.800 0.004 0.048 0.128 0.020
#> GSM955069     3  0.6132    0.33377 0.116 0.000 0.584 0.044 0.012 0.244
#> GSM955070     2  0.7827    0.16861 0.000 0.396 0.088 0.204 0.264 0.048
#> GSM955071     1  0.8435   -0.03814 0.428 0.100 0.128 0.208 0.020 0.116
#> GSM955077     2  0.6636    0.31468 0.056 0.612 0.024 0.196 0.072 0.040
#> GSM955080     5  0.4862    0.47606 0.000 0.040 0.156 0.068 0.728 0.008
#> GSM955081     2  0.7868    0.19916 0.000 0.416 0.048 0.144 0.136 0.256
#> GSM955082     6  0.8129    0.02771 0.000 0.080 0.124 0.128 0.328 0.340
#> GSM955085     2  0.5706    0.38075 0.000 0.588 0.012 0.084 0.292 0.024
#> GSM955090     1  0.2964    0.75104 0.792 0.000 0.004 0.204 0.000 0.000
#> GSM955094     5  0.8076    0.04266 0.000 0.276 0.172 0.204 0.320 0.028
#> GSM955096     6  0.4873    0.41585 0.000 0.072 0.088 0.060 0.024 0.756
#> GSM955102     3  0.6294    0.39066 0.208 0.000 0.560 0.048 0.004 0.180
#> GSM955105     6  0.6701    0.26905 0.072 0.024 0.180 0.108 0.016 0.600

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

consensus_heatmap(res, k = 2)

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

consensus_heatmap(res, k = 3)

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

consensus_heatmap(res, k = 4)

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

consensus_heatmap(res, k = 5)

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

consensus_heatmap(res, k = 6)

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

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

membership_heatmap(res, k = 2)

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

membership_heatmap(res, k = 3)

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

membership_heatmap(res, k = 4)

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

membership_heatmap(res, k = 5)

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

membership_heatmap(res, k = 6)

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

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

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

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

get_signatures(res, k = 3)

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

get_signatures(res, k = 4)

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

get_signatures(res, k = 5)

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

get_signatures(res, k = 6)

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

Signature heatmaps where rows are not scaled:

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

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

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

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

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

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

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

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

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

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

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk CV-skmeans-signature_compare

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

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

An example of the output of tb is:

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

The columns in tb are:

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

UMAP plot which shows how samples are separated.

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

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

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

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

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

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

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

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

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

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

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk CV-skmeans-collect-classes

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

test_to_known_factors(res)
#>              n genotype/variation(p) k
#> CV:skmeans 101                 0.482 2
#> CV:skmeans  93                 0.910 3
#> CV:skmeans  76                 0.831 4
#> CV:skmeans  43                 0.981 5
#> CV:skmeans  36                 0.623 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 31589 rows and 108 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 3.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

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

collect_plots(res)

plot of chunk CV-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.506           0.880       0.853         0.3175 0.732   0.732
#> 3 3 0.484           0.727       0.873         0.8581 0.669   0.548
#> 4 4 0.488           0.635       0.797         0.2016 0.734   0.442
#> 5 5 0.480           0.520       0.716         0.0597 0.962   0.872
#> 6 6 0.510           0.520       0.721         0.0443 0.906   0.669

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

suggest_best_k(res)
#> [1] 3

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

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

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>           class entropy silhouette    p1    p2
#> GSM955002     2  0.7674     0.8468 0.224 0.776
#> GSM955008     2  0.4562     0.9061 0.096 0.904
#> GSM955016     2  0.8713     0.7731 0.292 0.708
#> GSM955019     2  0.0000     0.8919 0.000 1.000
#> GSM955022     2  0.4690     0.9057 0.100 0.900
#> GSM955023     2  0.4022     0.9069 0.080 0.920
#> GSM955027     2  0.0000     0.8919 0.000 1.000
#> GSM955043     2  0.3274     0.9058 0.060 0.940
#> GSM955048     1  0.0000     0.9579 1.000 0.000
#> GSM955049     2  0.5178     0.9028 0.116 0.884
#> GSM955054     2  0.2043     0.9019 0.032 0.968
#> GSM955064     2  0.1843     0.9010 0.028 0.972
#> GSM955072     2  0.0000     0.8919 0.000 1.000
#> GSM955075     2  0.0000     0.8919 0.000 1.000
#> GSM955079     2  0.6048     0.8935 0.148 0.852
#> GSM955087     1  0.0000     0.9579 1.000 0.000
#> GSM955088     2  0.6531     0.8860 0.168 0.832
#> GSM955089     1  0.0000     0.9579 1.000 0.000
#> GSM955095     2  0.0376     0.8920 0.004 0.996
#> GSM955097     2  0.0376     0.8920 0.004 0.996
#> GSM955101     2  0.0938     0.8958 0.012 0.988
#> GSM954999     2  0.8661     0.7783 0.288 0.712
#> GSM955001     2  0.0000     0.8919 0.000 1.000
#> GSM955003     2  0.0000     0.8919 0.000 1.000
#> GSM955004     2  0.0000     0.8919 0.000 1.000
#> GSM955005     2  0.6343     0.8897 0.160 0.840
#> GSM955009     2  0.0000     0.8919 0.000 1.000
#> GSM955011     2  0.8713     0.7731 0.292 0.708
#> GSM955012     2  0.5842     0.8959 0.140 0.860
#> GSM955013     2  0.5408     0.9028 0.124 0.876
#> GSM955015     2  0.0000     0.8919 0.000 1.000
#> GSM955017     2  0.8955     0.7452 0.312 0.688
#> GSM955021     2  0.0000     0.8919 0.000 1.000
#> GSM955025     2  0.5842     0.8962 0.140 0.860
#> GSM955028     1  0.0000     0.9579 1.000 0.000
#> GSM955029     2  0.0000     0.8919 0.000 1.000
#> GSM955030     2  0.8661     0.7783 0.288 0.712
#> GSM955032     2  0.6531     0.8854 0.168 0.832
#> GSM955033     2  0.7219     0.8661 0.200 0.800
#> GSM955034     1  0.0000     0.9579 1.000 0.000
#> GSM955035     2  0.0000     0.8919 0.000 1.000
#> GSM955036     2  0.7745     0.8434 0.228 0.772
#> GSM955037     2  0.9710     0.5828 0.400 0.600
#> GSM955039     2  0.5946     0.8946 0.144 0.856
#> GSM955041     2  0.2948     0.9051 0.052 0.948
#> GSM955042     2  0.8016     0.8285 0.244 0.756
#> GSM955045     2  0.0000     0.8919 0.000 1.000
#> GSM955046     2  0.5946     0.8946 0.144 0.856
#> GSM955047     1  0.0376     0.9545 0.996 0.004
#> GSM955050     2  0.1843     0.8932 0.028 0.972
#> GSM955052     2  0.5946     0.8946 0.144 0.856
#> GSM955053     1  0.0000     0.9579 1.000 0.000
#> GSM955056     2  0.5946     0.8946 0.144 0.856
#> GSM955058     2  0.0000     0.8919 0.000 1.000
#> GSM955059     2  0.6048     0.8935 0.148 0.852
#> GSM955060     1  0.0000     0.9579 1.000 0.000
#> GSM955061     2  0.4562     0.9055 0.096 0.904
#> GSM955065     1  0.0000     0.9579 1.000 0.000
#> GSM955066     2  0.7950     0.8324 0.240 0.760
#> GSM955067     1  0.0672     0.9506 0.992 0.008
#> GSM955073     2  0.3431     0.9060 0.064 0.936
#> GSM955074     2  0.8443     0.7982 0.272 0.728
#> GSM955076     2  0.0000     0.8919 0.000 1.000
#> GSM955078     2  0.0376     0.8936 0.004 0.996
#> GSM955083     2  0.7602     0.8509 0.220 0.780
#> GSM955084     2  0.0000     0.8919 0.000 1.000
#> GSM955086     2  0.6712     0.8818 0.176 0.824
#> GSM955091     2  0.4939     0.9048 0.108 0.892
#> GSM955092     2  0.2778     0.9046 0.048 0.952
#> GSM955093     2  0.5842     0.8964 0.140 0.860
#> GSM955098     2  0.1184     0.8974 0.016 0.984
#> GSM955099     2  0.1633     0.9001 0.024 0.976
#> GSM955100     2  0.8608     0.7834 0.284 0.716
#> GSM955103     2  0.1843     0.9006 0.028 0.972
#> GSM955104     2  0.7139     0.8689 0.196 0.804
#> GSM955106     2  0.2778     0.9045 0.048 0.952
#> GSM955000     1  0.9732     0.0277 0.596 0.404
#> GSM955006     1  0.5842     0.8176 0.860 0.140
#> GSM955007     2  0.0376     0.8935 0.004 0.996
#> GSM955010     2  0.5629     0.8987 0.132 0.868
#> GSM955014     1  0.0000     0.9579 1.000 0.000
#> GSM955018     2  0.6801     0.8794 0.180 0.820
#> GSM955020     1  0.0000     0.9579 1.000 0.000
#> GSM955024     2  0.0376     0.8936 0.004 0.996
#> GSM955026     2  0.4939     0.9045 0.108 0.892
#> GSM955031     2  0.0376     0.8935 0.004 0.996
#> GSM955038     2  0.4939     0.9049 0.108 0.892
#> GSM955040     2  0.3584     0.8835 0.068 0.932
#> GSM955044     2  0.0000     0.8919 0.000 1.000
#> GSM955051     1  0.0000     0.9579 1.000 0.000
#> GSM955055     2  0.0000     0.8919 0.000 1.000
#> GSM955057     1  0.0000     0.9579 1.000 0.000
#> GSM955062     2  0.0000     0.8919 0.000 1.000
#> GSM955063     2  0.6148     0.8923 0.152 0.848
#> GSM955068     2  0.5842     0.8963 0.140 0.860
#> GSM955069     2  0.6343     0.8902 0.160 0.840
#> GSM955070     2  0.1414     0.8989 0.020 0.980
#> GSM955071     2  0.7674     0.8471 0.224 0.776
#> GSM955077     2  0.7376     0.8593 0.208 0.792
#> GSM955080     2  0.0000     0.8919 0.000 1.000
#> GSM955081     2  0.4161     0.9061 0.084 0.916
#> GSM955082     2  0.5519     0.8997 0.128 0.872
#> GSM955085     2  0.0000     0.8919 0.000 1.000
#> GSM955090     1  0.0000     0.9579 1.000 0.000
#> GSM955094     2  0.5519     0.8994 0.128 0.872
#> GSM955096     2  0.5946     0.8946 0.144 0.856
#> GSM955102     2  0.8144     0.8201 0.252 0.748
#> GSM955105     2  0.6712     0.8825 0.176 0.824

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1    p2    p3
#> GSM955002     3  0.0592     0.8323 0.000 0.012 0.988
#> GSM955008     3  0.2625     0.8109 0.000 0.084 0.916
#> GSM955016     3  0.0000     0.8331 0.000 0.000 1.000
#> GSM955019     2  0.3941     0.8088 0.000 0.844 0.156
#> GSM955022     3  0.2878     0.8015 0.000 0.096 0.904
#> GSM955023     3  0.4235     0.7418 0.000 0.176 0.824
#> GSM955027     2  0.0592     0.7858 0.000 0.988 0.012
#> GSM955043     3  0.6308     0.1182 0.000 0.492 0.508
#> GSM955048     1  0.0000     0.9454 1.000 0.000 0.000
#> GSM955049     3  0.6305    -0.0952 0.000 0.484 0.516
#> GSM955054     3  0.5327     0.6127 0.000 0.272 0.728
#> GSM955064     2  0.1411     0.7825 0.000 0.964 0.036
#> GSM955072     2  0.4121     0.8069 0.000 0.832 0.168
#> GSM955075     2  0.0000     0.7835 0.000 1.000 0.000
#> GSM955079     3  0.0000     0.8331 0.000 0.000 1.000
#> GSM955087     1  0.0000     0.9454 1.000 0.000 0.000
#> GSM955088     3  0.2537     0.8147 0.000 0.080 0.920
#> GSM955089     1  0.0000     0.9454 1.000 0.000 0.000
#> GSM955095     2  0.0000     0.7835 0.000 1.000 0.000
#> GSM955097     2  0.0592     0.7811 0.000 0.988 0.012
#> GSM955101     3  0.6280     0.0805 0.000 0.460 0.540
#> GSM954999     3  0.0000     0.8331 0.000 0.000 1.000
#> GSM955001     2  0.4062     0.8071 0.000 0.836 0.164
#> GSM955003     2  0.3879     0.8091 0.000 0.848 0.152
#> GSM955004     2  0.0000     0.7835 0.000 1.000 0.000
#> GSM955005     3  0.0000     0.8331 0.000 0.000 1.000
#> GSM955009     2  0.4062     0.8071 0.000 0.836 0.164
#> GSM955011     3  0.0237     0.8331 0.004 0.000 0.996
#> GSM955012     3  0.6308     0.0375 0.000 0.492 0.508
#> GSM955013     3  0.5650     0.5070 0.000 0.312 0.688
#> GSM955015     2  0.6235     0.3006 0.000 0.564 0.436
#> GSM955017     3  0.1289     0.8242 0.032 0.000 0.968
#> GSM955021     2  0.4062     0.8071 0.000 0.836 0.164
#> GSM955025     3  0.0237     0.8337 0.000 0.004 0.996
#> GSM955028     1  0.0000     0.9454 1.000 0.000 0.000
#> GSM955029     2  0.0424     0.7824 0.000 0.992 0.008
#> GSM955030     3  0.0000     0.8331 0.000 0.000 1.000
#> GSM955032     3  0.0592     0.8338 0.000 0.012 0.988
#> GSM955033     3  0.1031     0.8326 0.000 0.024 0.976
#> GSM955034     1  0.0000     0.9454 1.000 0.000 0.000
#> GSM955035     2  0.4121     0.8060 0.000 0.832 0.168
#> GSM955036     3  0.0592     0.8301 0.000 0.012 0.988
#> GSM955037     3  0.5988     0.4575 0.368 0.000 0.632
#> GSM955039     3  0.1163     0.8325 0.000 0.028 0.972
#> GSM955041     3  0.6307     0.1127 0.000 0.488 0.512
#> GSM955042     3  0.0000     0.8331 0.000 0.000 1.000
#> GSM955045     2  0.4178     0.8048 0.000 0.828 0.172
#> GSM955046     3  0.0000     0.8331 0.000 0.000 1.000
#> GSM955047     1  0.3192     0.8455 0.888 0.000 0.112
#> GSM955050     3  0.6062     0.3471 0.000 0.384 0.616
#> GSM955052     3  0.0592     0.8323 0.000 0.012 0.988
#> GSM955053     1  0.0000     0.9454 1.000 0.000 0.000
#> GSM955056     3  0.1163     0.8315 0.000 0.028 0.972
#> GSM955058     2  0.0000     0.7835 0.000 1.000 0.000
#> GSM955059     3  0.0237     0.8338 0.000 0.004 0.996
#> GSM955060     1  0.0000     0.9454 1.000 0.000 0.000
#> GSM955061     2  0.4654     0.6528 0.000 0.792 0.208
#> GSM955065     1  0.0000     0.9454 1.000 0.000 0.000
#> GSM955066     3  0.0000     0.8331 0.000 0.000 1.000
#> GSM955067     1  0.4178     0.7786 0.828 0.000 0.172
#> GSM955073     3  0.5138     0.6501 0.000 0.252 0.748
#> GSM955074     3  0.0000     0.8331 0.000 0.000 1.000
#> GSM955076     2  0.5882     0.5390 0.000 0.652 0.348
#> GSM955078     2  0.0237     0.7842 0.000 0.996 0.004
#> GSM955083     3  0.0237     0.8338 0.000 0.004 0.996
#> GSM955084     2  0.0000     0.7835 0.000 1.000 0.000
#> GSM955086     3  0.5138     0.6148 0.000 0.252 0.748
#> GSM955091     3  0.5948     0.4222 0.000 0.360 0.640
#> GSM955092     2  0.4931     0.7560 0.000 0.768 0.232
#> GSM955093     3  0.1860     0.8266 0.000 0.052 0.948
#> GSM955098     3  0.4842     0.6767 0.000 0.224 0.776
#> GSM955099     2  0.4399     0.7947 0.000 0.812 0.188
#> GSM955100     3  0.0000     0.8331 0.000 0.000 1.000
#> GSM955103     2  0.6095     0.4729 0.000 0.608 0.392
#> GSM955104     3  0.0000     0.8331 0.000 0.000 1.000
#> GSM955106     2  0.5835     0.4380 0.000 0.660 0.340
#> GSM955000     1  0.6154     0.1772 0.592 0.000 0.408
#> GSM955006     1  0.0000     0.9454 1.000 0.000 0.000
#> GSM955007     2  0.6295     0.1898 0.000 0.528 0.472
#> GSM955010     3  0.4233     0.7536 0.004 0.160 0.836
#> GSM955014     1  0.0000     0.9454 1.000 0.000 0.000
#> GSM955018     3  0.0000     0.8331 0.000 0.000 1.000
#> GSM955020     1  0.0000     0.9454 1.000 0.000 0.000
#> GSM955024     2  0.5926     0.5361 0.000 0.644 0.356
#> GSM955026     3  0.4887     0.6771 0.000 0.228 0.772
#> GSM955031     3  0.6244     0.1813 0.000 0.440 0.560
#> GSM955038     3  0.2537     0.8115 0.000 0.080 0.920
#> GSM955040     3  0.5397     0.5856 0.000 0.280 0.720
#> GSM955044     2  0.2711     0.7751 0.000 0.912 0.088
#> GSM955051     1  0.0000     0.9454 1.000 0.000 0.000
#> GSM955055     2  0.4178     0.8058 0.000 0.828 0.172
#> GSM955057     1  0.0000     0.9454 1.000 0.000 0.000
#> GSM955062     2  0.4062     0.8071 0.000 0.836 0.164
#> GSM955063     3  0.0592     0.8323 0.000 0.012 0.988
#> GSM955068     3  0.5678     0.4317 0.000 0.316 0.684
#> GSM955069     3  0.1643     0.8279 0.000 0.044 0.956
#> GSM955070     2  0.5497     0.6739 0.000 0.708 0.292
#> GSM955071     3  0.0000     0.8331 0.000 0.000 1.000
#> GSM955077     3  0.0424     0.8343 0.000 0.008 0.992
#> GSM955080     2  0.0000     0.7835 0.000 1.000 0.000
#> GSM955081     3  0.3816     0.7644 0.000 0.148 0.852
#> GSM955082     3  0.5291     0.5912 0.000 0.268 0.732
#> GSM955085     2  0.4452     0.7883 0.000 0.808 0.192
#> GSM955090     1  0.0424     0.9395 0.992 0.000 0.008
#> GSM955094     3  0.3267     0.7884 0.000 0.116 0.884
#> GSM955096     3  0.0000     0.8331 0.000 0.000 1.000
#> GSM955102     3  0.1753     0.8172 0.048 0.000 0.952
#> GSM955105     3  0.3038     0.7968 0.000 0.104 0.896

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM955002     3  0.5693    -0.1119 0.000 0.472 0.504 0.024
#> GSM955008     2  0.4422     0.6200 0.000 0.736 0.256 0.008
#> GSM955016     3  0.0000     0.7964 0.000 0.000 1.000 0.000
#> GSM955019     2  0.2081     0.6446 0.000 0.916 0.000 0.084
#> GSM955022     3  0.3653     0.7306 0.000 0.028 0.844 0.128
#> GSM955023     2  0.4175     0.6682 0.000 0.784 0.200 0.016
#> GSM955027     2  0.5345     0.0413 0.000 0.560 0.012 0.428
#> GSM955043     4  0.6521     0.5841 0.000 0.124 0.256 0.620
#> GSM955048     1  0.0000     0.9243 1.000 0.000 0.000 0.000
#> GSM955049     2  0.5188     0.6527 0.000 0.756 0.148 0.096
#> GSM955054     2  0.3032     0.6758 0.000 0.868 0.124 0.008
#> GSM955064     2  0.4980     0.4567 0.000 0.680 0.016 0.304
#> GSM955072     2  0.6616     0.4721 0.000 0.624 0.156 0.220
#> GSM955075     4  0.3801     0.7517 0.000 0.220 0.000 0.780
#> GSM955079     3  0.0000     0.7964 0.000 0.000 1.000 0.000
#> GSM955087     1  0.2011     0.9016 0.920 0.000 0.000 0.080
#> GSM955088     3  0.5517     0.0998 0.000 0.412 0.568 0.020
#> GSM955089     1  0.0000     0.9243 1.000 0.000 0.000 0.000
#> GSM955095     4  0.3837     0.7478 0.000 0.224 0.000 0.776
#> GSM955097     4  0.3764     0.7544 0.000 0.216 0.000 0.784
#> GSM955101     2  0.4547     0.6820 0.000 0.804 0.104 0.092
#> GSM954999     3  0.1389     0.7856 0.000 0.000 0.952 0.048
#> GSM955001     2  0.6010     0.5341 0.000 0.676 0.104 0.220
#> GSM955003     2  0.0188     0.6503 0.000 0.996 0.000 0.004
#> GSM955004     4  0.3688     0.7559 0.000 0.208 0.000 0.792
#> GSM955005     3  0.0000     0.7964 0.000 0.000 1.000 0.000
#> GSM955009     2  0.5530     0.5560 0.000 0.712 0.076 0.212
#> GSM955011     3  0.0469     0.7967 0.012 0.000 0.988 0.000
#> GSM955012     4  0.4927     0.5575 0.000 0.024 0.264 0.712
#> GSM955013     3  0.5878     0.4490 0.000 0.312 0.632 0.056
#> GSM955015     2  0.4706     0.6362 0.000 0.788 0.072 0.140
#> GSM955017     3  0.1022     0.7908 0.032 0.000 0.968 0.000
#> GSM955021     2  0.1902     0.6512 0.000 0.932 0.004 0.064
#> GSM955025     3  0.0188     0.7970 0.000 0.000 0.996 0.004
#> GSM955028     1  0.2011     0.9016 0.920 0.000 0.000 0.080
#> GSM955029     4  0.2345     0.7705 0.000 0.100 0.000 0.900
#> GSM955030     3  0.0000     0.7964 0.000 0.000 1.000 0.000
#> GSM955032     3  0.4356     0.5257 0.000 0.292 0.708 0.000
#> GSM955033     3  0.2124     0.7833 0.000 0.040 0.932 0.028
#> GSM955034     1  0.0336     0.9233 0.992 0.000 0.000 0.008
#> GSM955035     2  0.3751     0.5849 0.000 0.800 0.004 0.196
#> GSM955036     3  0.3569     0.6671 0.000 0.000 0.804 0.196
#> GSM955037     3  0.6222     0.3949 0.304 0.000 0.616 0.080
#> GSM955039     3  0.4730     0.3702 0.000 0.364 0.636 0.000
#> GSM955041     4  0.6871     0.5873 0.000 0.240 0.168 0.592
#> GSM955042     3  0.1356     0.7916 0.008 0.032 0.960 0.000
#> GSM955045     3  0.7416     0.1845 0.000 0.240 0.516 0.244
#> GSM955046     3  0.0000     0.7964 0.000 0.000 1.000 0.000
#> GSM955047     1  0.2530     0.8266 0.888 0.000 0.112 0.000
#> GSM955050     3  0.6646     0.4086 0.000 0.204 0.624 0.172
#> GSM955052     2  0.5047     0.5655 0.000 0.668 0.316 0.016
#> GSM955053     1  0.2011     0.9016 0.920 0.000 0.000 0.080
#> GSM955056     2  0.4898     0.4314 0.000 0.584 0.416 0.000
#> GSM955058     4  0.2345     0.7705 0.000 0.100 0.000 0.900
#> GSM955059     3  0.0188     0.7970 0.000 0.000 0.996 0.004
#> GSM955060     1  0.0000     0.9243 1.000 0.000 0.000 0.000
#> GSM955061     4  0.4415     0.6964 0.000 0.056 0.140 0.804
#> GSM955065     1  0.2011     0.9016 0.920 0.000 0.000 0.080
#> GSM955066     3  0.0000     0.7964 0.000 0.000 1.000 0.000
#> GSM955067     1  0.3219     0.7582 0.836 0.000 0.164 0.000
#> GSM955073     2  0.4093     0.6821 0.000 0.832 0.096 0.072
#> GSM955074     3  0.0000     0.7964 0.000 0.000 1.000 0.000
#> GSM955076     2  0.0707     0.6516 0.000 0.980 0.000 0.020
#> GSM955078     4  0.4277     0.6629 0.000 0.280 0.000 0.720
#> GSM955083     3  0.0524     0.7975 0.004 0.000 0.988 0.008
#> GSM955084     4  0.3486     0.7658 0.000 0.188 0.000 0.812
#> GSM955086     2  0.5957     0.4118 0.000 0.540 0.420 0.040
#> GSM955091     3  0.7795    -0.0291 0.000 0.312 0.420 0.268
#> GSM955092     2  0.4022     0.6620 0.000 0.836 0.068 0.096
#> GSM955093     2  0.4936     0.5808 0.000 0.672 0.316 0.012
#> GSM955098     2  0.3708     0.6534 0.000 0.832 0.148 0.020
#> GSM955099     2  0.4057     0.6339 0.000 0.816 0.032 0.152
#> GSM955100     3  0.0336     0.7965 0.008 0.000 0.992 0.000
#> GSM955103     4  0.7530     0.2676 0.000 0.212 0.308 0.480
#> GSM955104     3  0.0000     0.7964 0.000 0.000 1.000 0.000
#> GSM955106     4  0.3796     0.7476 0.000 0.096 0.056 0.848
#> GSM955000     1  0.4898     0.2168 0.584 0.000 0.416 0.000
#> GSM955006     1  0.0000     0.9243 1.000 0.000 0.000 0.000
#> GSM955007     3  0.7006     0.3183 0.000 0.216 0.580 0.204
#> GSM955010     3  0.6379     0.4068 0.012 0.288 0.632 0.068
#> GSM955014     1  0.0336     0.9215 0.992 0.000 0.008 0.000
#> GSM955018     3  0.0817     0.7937 0.000 0.024 0.976 0.000
#> GSM955020     1  0.0188     0.9234 0.996 0.000 0.004 0.000
#> GSM955024     2  0.7262     0.3854 0.000 0.540 0.252 0.208
#> GSM955026     2  0.4507     0.6291 0.000 0.756 0.224 0.020
#> GSM955031     2  0.4465     0.6428 0.000 0.800 0.056 0.144
#> GSM955038     3  0.2751     0.7677 0.000 0.056 0.904 0.040
#> GSM955040     3  0.5998     0.5712 0.004 0.192 0.696 0.108
#> GSM955044     2  0.4999    -0.2383 0.000 0.508 0.000 0.492
#> GSM955051     1  0.0000     0.9243 1.000 0.000 0.000 0.000
#> GSM955055     2  0.6167     0.5152 0.000 0.664 0.116 0.220
#> GSM955057     1  0.0000     0.9243 1.000 0.000 0.000 0.000
#> GSM955062     2  0.4307     0.5943 0.000 0.784 0.024 0.192
#> GSM955063     2  0.4382     0.5831 0.000 0.704 0.296 0.000
#> GSM955068     3  0.3505     0.7300 0.000 0.088 0.864 0.048
#> GSM955069     3  0.1520     0.7896 0.000 0.024 0.956 0.020
#> GSM955070     2  0.1820     0.6675 0.000 0.944 0.036 0.020
#> GSM955071     3  0.0592     0.7969 0.000 0.016 0.984 0.000
#> GSM955077     3  0.1443     0.7941 0.008 0.028 0.960 0.004
#> GSM955080     4  0.2973     0.7744 0.000 0.144 0.000 0.856
#> GSM955081     2  0.4567     0.5861 0.000 0.716 0.276 0.008
#> GSM955082     2  0.5650     0.3586 0.000 0.544 0.432 0.024
#> GSM955085     2  0.6844     0.0665 0.000 0.500 0.396 0.104
#> GSM955090     1  0.0188     0.9234 0.996 0.000 0.004 0.000
#> GSM955094     3  0.5488    -0.0592 0.000 0.452 0.532 0.016
#> GSM955096     3  0.3569     0.6579 0.000 0.196 0.804 0.000
#> GSM955102     3  0.2586     0.7674 0.040 0.000 0.912 0.048
#> GSM955105     2  0.4585     0.5704 0.000 0.668 0.332 0.000

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM955002     3  0.5806     0.1191 0.000 0.012 0.464 0.464 0.060
#> GSM955008     3  0.3826     0.5874 0.000 0.004 0.752 0.236 0.008
#> GSM955016     4  0.5513     0.5663 0.188 0.144 0.000 0.664 0.004
#> GSM955019     3  0.2580     0.6048 0.000 0.044 0.892 0.000 0.064
#> GSM955022     4  0.3441     0.6789 0.000 0.004 0.028 0.828 0.140
#> GSM955023     3  0.3938     0.6322 0.000 0.016 0.796 0.164 0.024
#> GSM955027     3  0.5797     0.0779 0.000 0.064 0.528 0.012 0.396
#> GSM955043     5  0.6048     0.5362 0.000 0.032 0.108 0.224 0.636
#> GSM955048     1  0.2970     0.4155 0.828 0.168 0.000 0.004 0.000
#> GSM955049     3  0.4593     0.5993 0.000 0.000 0.748 0.128 0.124
#> GSM955054     3  0.2392     0.6352 0.000 0.004 0.888 0.104 0.004
#> GSM955064     3  0.6172     0.3907 0.000 0.172 0.600 0.012 0.216
#> GSM955072     3  0.6940     0.2876 0.000 0.324 0.496 0.040 0.140
#> GSM955075     5  0.4581     0.6223 0.000 0.072 0.196 0.000 0.732
#> GSM955079     4  0.0000     0.7256 0.000 0.000 0.000 1.000 0.000
#> GSM955087     2  0.4305     0.6542 0.488 0.512 0.000 0.000 0.000
#> GSM955088     4  0.5103     0.0742 0.008 0.004 0.428 0.544 0.016
#> GSM955089     1  0.2280     0.6564 0.880 0.120 0.000 0.000 0.000
#> GSM955095     5  0.6433     0.5004 0.000 0.312 0.200 0.000 0.488
#> GSM955097     5  0.6243     0.5379 0.000 0.284 0.184 0.000 0.532
#> GSM955101     3  0.4128     0.6405 0.000 0.032 0.816 0.092 0.060
#> GSM954999     4  0.2069     0.7173 0.012 0.000 0.000 0.912 0.076
#> GSM955001     3  0.6809     0.2964 0.000 0.324 0.504 0.032 0.140
#> GSM955003     3  0.0671     0.6135 0.000 0.016 0.980 0.000 0.004
#> GSM955004     5  0.6358     0.5051 0.000 0.328 0.180 0.000 0.492
#> GSM955005     4  0.0000     0.7256 0.000 0.000 0.000 1.000 0.000
#> GSM955009     3  0.6864     0.3020 0.000 0.320 0.508 0.040 0.132
#> GSM955011     4  0.3481     0.7010 0.100 0.056 0.000 0.840 0.004
#> GSM955012     5  0.2886     0.5548 0.000 0.000 0.008 0.148 0.844
#> GSM955013     4  0.5922     0.4136 0.000 0.064 0.272 0.624 0.040
#> GSM955015     3  0.5519     0.5734 0.000 0.108 0.720 0.056 0.116
#> GSM955017     4  0.2484     0.7186 0.068 0.028 0.000 0.900 0.004
#> GSM955021     3  0.2149     0.6118 0.000 0.036 0.916 0.000 0.048
#> GSM955025     4  0.0162     0.7263 0.000 0.000 0.000 0.996 0.004
#> GSM955028     2  0.4305     0.6542 0.488 0.512 0.000 0.000 0.000
#> GSM955029     5  0.0963     0.6621 0.000 0.000 0.036 0.000 0.964
#> GSM955030     4  0.0324     0.7263 0.000 0.004 0.000 0.992 0.004
#> GSM955032     4  0.3796     0.4943 0.000 0.000 0.300 0.700 0.000
#> GSM955033     4  0.4591     0.7017 0.084 0.040 0.032 0.808 0.036
#> GSM955034     1  0.3424     0.2198 0.760 0.240 0.000 0.000 0.000
#> GSM955035     3  0.5451     0.4732 0.000 0.212 0.664 0.004 0.120
#> GSM955036     4  0.4134     0.5660 0.008 0.008 0.000 0.720 0.264
#> GSM955037     2  0.5685     0.0901 0.084 0.520 0.000 0.396 0.000
#> GSM955039     4  0.4088     0.3467 0.000 0.000 0.368 0.632 0.000
#> GSM955041     5  0.4845     0.5774 0.000 0.000 0.148 0.128 0.724
#> GSM955042     4  0.6272     0.5386 0.216 0.132 0.020 0.624 0.008
#> GSM955045     4  0.8339    -0.2198 0.000 0.316 0.208 0.324 0.152
#> GSM955046     4  0.0000     0.7256 0.000 0.000 0.000 1.000 0.000
#> GSM955047     1  0.3620     0.6019 0.824 0.068 0.000 0.108 0.000
#> GSM955050     4  0.6728     0.4021 0.000 0.092 0.168 0.612 0.128
#> GSM955052     3  0.4750     0.5610 0.000 0.004 0.692 0.260 0.044
#> GSM955053     2  0.4304     0.6508 0.484 0.516 0.000 0.000 0.000
#> GSM955056     3  0.4341     0.3891 0.000 0.004 0.592 0.404 0.000
#> GSM955058     5  0.0880     0.6599 0.000 0.000 0.032 0.000 0.968
#> GSM955059     4  0.0162     0.7263 0.000 0.000 0.000 0.996 0.004
#> GSM955060     1  0.1851     0.6730 0.912 0.088 0.000 0.000 0.000
#> GSM955061     5  0.1952     0.6208 0.000 0.000 0.004 0.084 0.912
#> GSM955065     2  0.4306     0.6480 0.492 0.508 0.000 0.000 0.000
#> GSM955066     4  0.0000     0.7256 0.000 0.000 0.000 1.000 0.000
#> GSM955067     1  0.2561     0.5541 0.856 0.000 0.000 0.144 0.000
#> GSM955073     3  0.4091     0.6358 0.000 0.012 0.808 0.084 0.096
#> GSM955074     4  0.5135     0.6082 0.172 0.120 0.000 0.704 0.004
#> GSM955076     3  0.0807     0.6155 0.000 0.012 0.976 0.000 0.012
#> GSM955078     5  0.4270     0.6073 0.000 0.048 0.204 0.000 0.748
#> GSM955083     4  0.4911     0.6133 0.160 0.100 0.000 0.732 0.008
#> GSM955084     5  0.6162     0.5414 0.000 0.308 0.160 0.000 0.532
#> GSM955086     3  0.6350     0.3799 0.016 0.060 0.516 0.388 0.020
#> GSM955091     4  0.7666    -0.0870 0.000 0.048 0.276 0.352 0.324
#> GSM955092     3  0.5742     0.4440 0.000 0.284 0.628 0.040 0.048
#> GSM955093     3  0.4152     0.5473 0.000 0.000 0.692 0.296 0.012
#> GSM955098     3  0.3554     0.6130 0.000 0.020 0.836 0.120 0.024
#> GSM955099     3  0.5190     0.5675 0.000 0.112 0.736 0.032 0.120
#> GSM955100     4  0.5743     0.5353 0.220 0.144 0.000 0.632 0.004
#> GSM955103     5  0.7992     0.2729 0.000 0.144 0.164 0.256 0.436
#> GSM955104     4  0.0162     0.7263 0.000 0.000 0.000 0.996 0.004
#> GSM955106     5  0.1739     0.6413 0.000 0.004 0.024 0.032 0.940
#> GSM955000     1  0.4287     0.0528 0.540 0.000 0.000 0.460 0.000
#> GSM955006     1  0.2719     0.6327 0.852 0.144 0.000 0.000 0.004
#> GSM955007     4  0.7765     0.1307 0.000 0.184 0.192 0.488 0.136
#> GSM955010     4  0.6063     0.4207 0.032 0.024 0.276 0.628 0.040
#> GSM955014     1  0.0963     0.6775 0.964 0.000 0.000 0.036 0.000
#> GSM955018     4  0.0703     0.7245 0.000 0.000 0.024 0.976 0.000
#> GSM955020     1  0.3002     0.5280 0.856 0.116 0.000 0.028 0.000
#> GSM955024     3  0.7803     0.3275 0.000 0.192 0.480 0.196 0.132
#> GSM955026     3  0.4474     0.5900 0.000 0.016 0.740 0.216 0.028
#> GSM955031     3  0.4407     0.6029 0.000 0.040 0.796 0.052 0.112
#> GSM955038     4  0.2673     0.7122 0.000 0.024 0.048 0.900 0.028
#> GSM955040     4  0.9086     0.3239 0.196 0.160 0.148 0.416 0.080
#> GSM955044     5  0.4088     0.3421 0.000 0.000 0.368 0.000 0.632
#> GSM955051     1  0.1153     0.6877 0.964 0.024 0.000 0.008 0.004
#> GSM955055     3  0.6876     0.2920 0.000 0.324 0.500 0.036 0.140
#> GSM955057     1  0.0000     0.6820 1.000 0.000 0.000 0.000 0.000
#> GSM955062     3  0.5512     0.5088 0.000 0.168 0.692 0.020 0.120
#> GSM955063     3  0.3684     0.5461 0.000 0.000 0.720 0.280 0.000
#> GSM955068     4  0.5105     0.5557 0.000 0.188 0.080 0.716 0.016
#> GSM955069     4  0.2653     0.7257 0.016 0.040 0.016 0.908 0.020
#> GSM955070     3  0.2444     0.6303 0.000 0.028 0.912 0.036 0.024
#> GSM955071     4  0.3920     0.6939 0.096 0.056 0.016 0.828 0.004
#> GSM955077     4  0.1834     0.7297 0.032 0.004 0.016 0.940 0.008
#> GSM955080     5  0.4852     0.6474 0.000 0.184 0.100 0.000 0.716
#> GSM955081     3  0.4153     0.5734 0.000 0.016 0.740 0.236 0.008
#> GSM955082     3  0.5456     0.3105 0.000 0.032 0.524 0.428 0.016
#> GSM955085     3  0.7830     0.0458 0.000 0.260 0.380 0.292 0.068
#> GSM955090     1  0.0324     0.6868 0.992 0.004 0.000 0.004 0.000
#> GSM955094     4  0.5399    -0.0169 0.000 0.020 0.432 0.524 0.024
#> GSM955096     4  0.3109     0.6251 0.000 0.000 0.200 0.800 0.000
#> GSM955102     4  0.3419     0.6270 0.016 0.180 0.000 0.804 0.000
#> GSM955105     3  0.4832     0.5322 0.000 0.032 0.668 0.292 0.008

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM955002     2  0.5312     0.3349 0.000 0.524 0.364 0.000 0.112 0.000
#> GSM955008     2  0.3023     0.6719 0.000 0.784 0.212 0.004 0.000 0.000
#> GSM955016     3  0.7612     0.3583 0.152 0.020 0.484 0.180 0.012 0.152
#> GSM955019     2  0.3314     0.5340 0.000 0.740 0.000 0.256 0.004 0.000
#> GSM955022     3  0.3693     0.6426 0.000 0.016 0.800 0.048 0.136 0.000
#> GSM955023     2  0.3501     0.6857 0.000 0.816 0.128 0.044 0.004 0.008
#> GSM955027     2  0.6153    -0.0412 0.000 0.420 0.004 0.304 0.272 0.000
#> GSM955043     5  0.6027     0.4166 0.000 0.036 0.220 0.176 0.568 0.000
#> GSM955048     1  0.2462     0.5855 0.860 0.000 0.004 0.000 0.004 0.132
#> GSM955049     2  0.5320     0.6421 0.000 0.692 0.112 0.084 0.112 0.000
#> GSM955054     2  0.2856     0.6775 0.000 0.856 0.076 0.068 0.000 0.000
#> GSM955064     4  0.5913     0.3017 0.000 0.356 0.012 0.480 0.152 0.000
#> GSM955072     4  0.3314     0.5413 0.000 0.256 0.004 0.740 0.000 0.000
#> GSM955075     5  0.4219     0.2541 0.000 0.020 0.000 0.388 0.592 0.000
#> GSM955079     3  0.0000     0.7222 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM955087     6  0.2378     0.9197 0.152 0.000 0.000 0.000 0.000 0.848
#> GSM955088     3  0.5098    -0.0784 0.012 0.424 0.512 0.052 0.000 0.000
#> GSM955089     1  0.4624     0.6272 0.712 0.012 0.000 0.180 0.000 0.096
#> GSM955095     4  0.3424     0.4331 0.000 0.024 0.000 0.772 0.204 0.000
#> GSM955097     4  0.3853     0.3135 0.000 0.016 0.000 0.680 0.304 0.000
#> GSM955101     2  0.4373     0.6251 0.000 0.720 0.084 0.192 0.004 0.000
#> GSM954999     3  0.2214     0.7006 0.016 0.000 0.888 0.000 0.096 0.000
#> GSM955001     4  0.3078     0.5937 0.000 0.192 0.012 0.796 0.000 0.000
#> GSM955003     2  0.1204     0.6405 0.000 0.944 0.000 0.056 0.000 0.000
#> GSM955004     4  0.3168     0.4307 0.000 0.016 0.000 0.792 0.192 0.000
#> GSM955005     3  0.0000     0.7222 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM955009     4  0.3315     0.5934 0.000 0.200 0.020 0.780 0.000 0.000
#> GSM955011     3  0.5717     0.6164 0.132 0.020 0.688 0.032 0.016 0.112
#> GSM955012     5  0.1155     0.6522 0.000 0.004 0.036 0.004 0.956 0.000
#> GSM955013     3  0.5111     0.4004 0.000 0.152 0.624 0.224 0.000 0.000
#> GSM955015     2  0.4706     0.3639 0.000 0.624 0.048 0.320 0.008 0.000
#> GSM955017     3  0.3396     0.7055 0.056 0.020 0.848 0.012 0.000 0.064
#> GSM955021     2  0.3240     0.5493 0.000 0.752 0.000 0.244 0.004 0.000
#> GSM955025     3  0.0146     0.7227 0.000 0.000 0.996 0.004 0.000 0.000
#> GSM955028     6  0.2378     0.9197 0.152 0.000 0.000 0.000 0.000 0.848
#> GSM955029     5  0.1075     0.6691 0.000 0.000 0.000 0.048 0.952 0.000
#> GSM955030     3  0.0405     0.7236 0.000 0.008 0.988 0.000 0.000 0.004
#> GSM955032     3  0.3772     0.4540 0.004 0.320 0.672 0.000 0.004 0.000
#> GSM955033     3  0.6039     0.6277 0.088 0.080 0.688 0.088 0.016 0.040
#> GSM955034     1  0.3996    -0.1863 0.512 0.000 0.000 0.000 0.004 0.484
#> GSM955035     4  0.4088     0.1754 0.000 0.436 0.004 0.556 0.004 0.000
#> GSM955036     3  0.3971     0.4363 0.004 0.004 0.652 0.000 0.336 0.004
#> GSM955037     6  0.2302     0.6988 0.008 0.000 0.120 0.000 0.000 0.872
#> GSM955039     3  0.3717     0.2742 0.000 0.384 0.616 0.000 0.000 0.000
#> GSM955041     5  0.4298     0.6101 0.000 0.096 0.116 0.024 0.764 0.000
#> GSM955042     3  0.8161     0.2949 0.192 0.036 0.432 0.176 0.020 0.144
#> GSM955045     4  0.3558     0.4857 0.000 0.032 0.184 0.780 0.004 0.000
#> GSM955046     3  0.0000     0.7222 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM955047     1  0.4743     0.6548 0.740 0.000 0.104 0.116 0.004 0.036
#> GSM955050     3  0.5547     0.3085 0.000 0.044 0.580 0.320 0.004 0.052
#> GSM955052     2  0.4331     0.6598 0.000 0.704 0.220 0.000 0.076 0.000
#> GSM955053     6  0.2378     0.9197 0.152 0.000 0.000 0.000 0.000 0.848
#> GSM955056     2  0.3872     0.5050 0.000 0.604 0.392 0.004 0.000 0.000
#> GSM955058     5  0.1007     0.6667 0.000 0.000 0.000 0.044 0.956 0.000
#> GSM955059     3  0.0146     0.7227 0.000 0.000 0.996 0.004 0.000 0.000
#> GSM955060     1  0.3683     0.6679 0.784 0.000 0.000 0.160 0.004 0.052
#> GSM955061     5  0.1074     0.6659 0.000 0.000 0.012 0.028 0.960 0.000
#> GSM955065     6  0.2454     0.9124 0.160 0.000 0.000 0.000 0.000 0.840
#> GSM955066     3  0.0000     0.7222 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM955067     1  0.2278     0.6592 0.868 0.000 0.128 0.000 0.004 0.000
#> GSM955073     2  0.4838     0.6509 0.000 0.732 0.064 0.120 0.084 0.000
#> GSM955074     3  0.7454     0.4157 0.168 0.020 0.516 0.132 0.016 0.148
#> GSM955076     2  0.1957     0.6342 0.000 0.888 0.000 0.112 0.000 0.000
#> GSM955078     5  0.4877     0.5177 0.000 0.148 0.000 0.192 0.660 0.000
#> GSM955083     3  0.6070     0.4898 0.124 0.000 0.620 0.164 0.004 0.088
#> GSM955084     4  0.3558     0.3666 0.000 0.016 0.000 0.736 0.248 0.000
#> GSM955086     2  0.6183     0.4391 0.032 0.476 0.368 0.120 0.000 0.004
#> GSM955091     5  0.7288     0.2089 0.000 0.184 0.312 0.128 0.376 0.000
#> GSM955092     4  0.4264     0.4540 0.000 0.332 0.032 0.636 0.000 0.000
#> GSM955093     2  0.3717     0.6496 0.000 0.708 0.276 0.016 0.000 0.000
#> GSM955098     2  0.2001     0.6547 0.000 0.920 0.044 0.020 0.016 0.000
#> GSM955099     2  0.4578     0.2921 0.000 0.568 0.032 0.396 0.004 0.000
#> GSM955100     3  0.7929     0.2921 0.196 0.020 0.436 0.180 0.016 0.152
#> GSM955103     5  0.7284     0.1694 0.000 0.112 0.228 0.276 0.384 0.000
#> GSM955104     3  0.0146     0.7228 0.000 0.000 0.996 0.000 0.004 0.000
#> GSM955106     5  0.0858     0.6638 0.000 0.000 0.004 0.028 0.968 0.000
#> GSM955000     1  0.4124     0.1214 0.516 0.000 0.476 0.000 0.004 0.004
#> GSM955006     1  0.5745     0.5699 0.632 0.020 0.000 0.180 0.016 0.152
#> GSM955007     4  0.4399     0.1241 0.000 0.024 0.460 0.516 0.000 0.000
#> GSM955010     3  0.6082     0.4311 0.044 0.204 0.616 0.120 0.004 0.012
#> GSM955014     1  0.1226     0.7077 0.952 0.000 0.040 0.000 0.004 0.004
#> GSM955018     3  0.0858     0.7200 0.000 0.028 0.968 0.000 0.004 0.000
#> GSM955020     1  0.2065     0.6781 0.912 0.000 0.032 0.000 0.004 0.052
#> GSM955024     4  0.5583     0.3385 0.000 0.284 0.180 0.536 0.000 0.000
#> GSM955026     2  0.4327     0.5980 0.000 0.748 0.156 0.080 0.016 0.000
#> GSM955031     2  0.4476     0.4669 0.000 0.640 0.052 0.308 0.000 0.000
#> GSM955038     3  0.2492     0.7057 0.000 0.036 0.888 0.068 0.008 0.000
#> GSM955040     4  0.8496    -0.1995 0.164 0.132 0.280 0.332 0.004 0.088
#> GSM955044     5  0.3314     0.5112 0.000 0.256 0.000 0.004 0.740 0.000
#> GSM955051     1  0.2195     0.7063 0.916 0.020 0.012 0.004 0.004 0.044
#> GSM955055     4  0.2933     0.5880 0.000 0.200 0.004 0.796 0.000 0.000
#> GSM955057     1  0.0260     0.7113 0.992 0.000 0.000 0.000 0.008 0.000
#> GSM955062     4  0.4486     0.0891 0.000 0.464 0.016 0.512 0.008 0.000
#> GSM955063     2  0.3151     0.6568 0.000 0.748 0.252 0.000 0.000 0.000
#> GSM955068     3  0.4979     0.4003 0.000 0.056 0.612 0.316 0.016 0.000
#> GSM955069     3  0.3541     0.7073 0.020 0.020 0.852 0.036 0.012 0.060
#> GSM955070     2  0.2163     0.6389 0.000 0.892 0.008 0.096 0.004 0.000
#> GSM955071     3  0.4878     0.6670 0.048 0.012 0.764 0.088 0.016 0.072
#> GSM955077     3  0.2678     0.7173 0.048 0.048 0.888 0.008 0.004 0.004
#> GSM955080     5  0.4264     0.1592 0.000 0.016 0.000 0.484 0.500 0.000
#> GSM955081     2  0.2980     0.6466 0.000 0.808 0.180 0.012 0.000 0.000
#> GSM955082     2  0.5375     0.4062 0.000 0.484 0.416 0.096 0.004 0.000
#> GSM955085     4  0.5643     0.4083 0.000 0.248 0.192 0.556 0.004 0.000
#> GSM955090     1  0.0551     0.7141 0.984 0.000 0.004 0.000 0.008 0.004
#> GSM955094     3  0.5137    -0.0866 0.000 0.416 0.508 0.072 0.004 0.000
#> GSM955096     3  0.2883     0.6044 0.000 0.212 0.788 0.000 0.000 0.000
#> GSM955102     3  0.3023     0.6197 0.004 0.000 0.784 0.000 0.000 0.212
#> GSM955105     2  0.4512     0.6325 0.000 0.696 0.248 0.020 0.004 0.032

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

consensus_heatmap(res, k = 2)

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

consensus_heatmap(res, k = 3)

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

consensus_heatmap(res, k = 4)

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

consensus_heatmap(res, k = 5)

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

consensus_heatmap(res, k = 6)

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

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

membership_heatmap(res, k = 2)

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

membership_heatmap(res, k = 3)

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

membership_heatmap(res, k = 4)

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

membership_heatmap(res, k = 5)

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

membership_heatmap(res, k = 6)

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

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

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

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

get_signatures(res, k = 3)

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

get_signatures(res, k = 4)

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

get_signatures(res, k = 5)

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

get_signatures(res, k = 6)

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

Signature heatmaps where rows are not scaled:

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

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

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

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

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

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

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

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

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

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

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk CV-pam-signature_compare

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

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

An example of the output of tb is:

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

The columns in tb are:

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

UMAP plot which shows how samples are separated.

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

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

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

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

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

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

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

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

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

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

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk CV-pam-collect-classes

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

test_to_known_factors(res)
#>          n genotype/variation(p) k
#> CV:pam 107                 0.707 2
#> CV:pam  93                 0.852 3
#> CV:pam  86                 0.458 4
#> CV:pam  77                 0.140 5
#> CV:pam  67                 0.200 6

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


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

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

collect_plots(res)

plot of chunk CV-mclust-collect-plots

The plots are:

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

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

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

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

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.980           0.962       0.983          0.315 0.695   0.695
#> 3 3 0.414           0.716       0.818          0.877 0.648   0.503
#> 4 4 0.304           0.586       0.752          0.128 0.858   0.647
#> 5 5 0.452           0.524       0.688          0.104 0.909   0.720
#> 6 6 0.473           0.432       0.624          0.057 0.820   0.438

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
#> GSM955002     2  0.0000      0.984 0.000 1.000
#> GSM955008     2  0.0000      0.984 0.000 1.000
#> GSM955016     2  0.6887      0.771 0.184 0.816
#> GSM955019     2  0.0000      0.984 0.000 1.000
#> GSM955022     2  0.0000      0.984 0.000 1.000
#> GSM955023     2  0.0000      0.984 0.000 1.000
#> GSM955027     2  0.0000      0.984 0.000 1.000
#> GSM955043     2  0.0000      0.984 0.000 1.000
#> GSM955048     1  0.0000      0.975 1.000 0.000
#> GSM955049     2  0.0000      0.984 0.000 1.000
#> GSM955054     2  0.0000      0.984 0.000 1.000
#> GSM955064     2  0.0000      0.984 0.000 1.000
#> GSM955072     2  0.0000      0.984 0.000 1.000
#> GSM955075     2  0.0000      0.984 0.000 1.000
#> GSM955079     2  0.0000      0.984 0.000 1.000
#> GSM955087     1  0.0000      0.975 1.000 0.000
#> GSM955088     2  0.0000      0.984 0.000 1.000
#> GSM955089     1  0.0000      0.975 1.000 0.000
#> GSM955095     2  0.0000      0.984 0.000 1.000
#> GSM955097     2  0.0000      0.984 0.000 1.000
#> GSM955101     2  0.0000      0.984 0.000 1.000
#> GSM954999     2  0.0000      0.984 0.000 1.000
#> GSM955001     2  0.0000      0.984 0.000 1.000
#> GSM955003     2  0.0000      0.984 0.000 1.000
#> GSM955004     2  0.0000      0.984 0.000 1.000
#> GSM955005     2  0.0000      0.984 0.000 1.000
#> GSM955009     2  0.0000      0.984 0.000 1.000
#> GSM955011     2  0.8207      0.662 0.256 0.744
#> GSM955012     2  0.0000      0.984 0.000 1.000
#> GSM955013     2  0.0000      0.984 0.000 1.000
#> GSM955015     2  0.0000      0.984 0.000 1.000
#> GSM955017     1  0.0000      0.975 1.000 0.000
#> GSM955021     2  0.0000      0.984 0.000 1.000
#> GSM955025     2  0.0000      0.984 0.000 1.000
#> GSM955028     1  0.0000      0.975 1.000 0.000
#> GSM955029     2  0.0000      0.984 0.000 1.000
#> GSM955030     2  0.0000      0.984 0.000 1.000
#> GSM955032     2  0.0000      0.984 0.000 1.000
#> GSM955033     2  0.0000      0.984 0.000 1.000
#> GSM955034     1  0.0000      0.975 1.000 0.000
#> GSM955035     2  0.0000      0.984 0.000 1.000
#> GSM955036     2  0.0000      0.984 0.000 1.000
#> GSM955037     1  0.0000      0.975 1.000 0.000
#> GSM955039     2  0.0000      0.984 0.000 1.000
#> GSM955041     2  0.0000      0.984 0.000 1.000
#> GSM955042     2  0.9087      0.518 0.324 0.676
#> GSM955045     2  0.0000      0.984 0.000 1.000
#> GSM955046     2  0.0000      0.984 0.000 1.000
#> GSM955047     1  0.3879      0.911 0.924 0.076
#> GSM955050     2  0.0000      0.984 0.000 1.000
#> GSM955052     2  0.0000      0.984 0.000 1.000
#> GSM955053     1  0.0000      0.975 1.000 0.000
#> GSM955056     2  0.0000      0.984 0.000 1.000
#> GSM955058     2  0.0000      0.984 0.000 1.000
#> GSM955059     2  0.0000      0.984 0.000 1.000
#> GSM955060     1  0.0000      0.975 1.000 0.000
#> GSM955061     2  0.0000      0.984 0.000 1.000
#> GSM955065     1  0.0000      0.975 1.000 0.000
#> GSM955066     2  0.0000      0.984 0.000 1.000
#> GSM955067     1  0.8081      0.682 0.752 0.248
#> GSM955073     2  0.0000      0.984 0.000 1.000
#> GSM955074     1  0.5842      0.839 0.860 0.140
#> GSM955076     2  0.0000      0.984 0.000 1.000
#> GSM955078     2  0.0000      0.984 0.000 1.000
#> GSM955083     2  0.0000      0.984 0.000 1.000
#> GSM955084     2  0.0000      0.984 0.000 1.000
#> GSM955086     2  0.0000      0.984 0.000 1.000
#> GSM955091     2  0.0000      0.984 0.000 1.000
#> GSM955092     2  0.0000      0.984 0.000 1.000
#> GSM955093     2  0.0000      0.984 0.000 1.000
#> GSM955098     2  0.0000      0.984 0.000 1.000
#> GSM955099     2  0.0000      0.984 0.000 1.000
#> GSM955100     2  0.8608      0.612 0.284 0.716
#> GSM955103     2  0.0000      0.984 0.000 1.000
#> GSM955104     2  0.0000      0.984 0.000 1.000
#> GSM955106     2  0.0000      0.984 0.000 1.000
#> GSM955000     1  0.0000      0.975 1.000 0.000
#> GSM955006     1  0.0376      0.972 0.996 0.004
#> GSM955007     2  0.0000      0.984 0.000 1.000
#> GSM955010     2  0.2236      0.950 0.036 0.964
#> GSM955014     1  0.0000      0.975 1.000 0.000
#> GSM955018     2  0.0000      0.984 0.000 1.000
#> GSM955020     1  0.0000      0.975 1.000 0.000
#> GSM955024     2  0.0000      0.984 0.000 1.000
#> GSM955026     2  0.0000      0.984 0.000 1.000
#> GSM955031     2  0.0000      0.984 0.000 1.000
#> GSM955038     2  0.0000      0.984 0.000 1.000
#> GSM955040     2  0.0376      0.981 0.004 0.996
#> GSM955044     2  0.0000      0.984 0.000 1.000
#> GSM955051     1  0.0000      0.975 1.000 0.000
#> GSM955055     2  0.0000      0.984 0.000 1.000
#> GSM955057     1  0.0000      0.975 1.000 0.000
#> GSM955062     2  0.0000      0.984 0.000 1.000
#> GSM955063     2  0.0000      0.984 0.000 1.000
#> GSM955068     2  0.0000      0.984 0.000 1.000
#> GSM955069     2  0.0000      0.984 0.000 1.000
#> GSM955070     2  0.0000      0.984 0.000 1.000
#> GSM955071     2  0.0376      0.981 0.004 0.996
#> GSM955077     2  0.0000      0.984 0.000 1.000
#> GSM955080     2  0.0000      0.984 0.000 1.000
#> GSM955081     2  0.0000      0.984 0.000 1.000
#> GSM955082     2  0.0000      0.984 0.000 1.000
#> GSM955085     2  0.0000      0.984 0.000 1.000
#> GSM955090     1  0.0000      0.975 1.000 0.000
#> GSM955094     2  0.0000      0.984 0.000 1.000
#> GSM955096     2  0.0000      0.984 0.000 1.000
#> GSM955102     2  0.8016      0.680 0.244 0.756
#> GSM955105     2  0.0000      0.984 0.000 1.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1    p2    p3
#> GSM955002     2  0.5058     0.7114 0.000 0.756 0.244
#> GSM955008     3  0.5016     0.7447 0.000 0.240 0.760
#> GSM955016     1  0.7319     0.6215 0.708 0.164 0.128
#> GSM955019     2  0.3412     0.7542 0.000 0.876 0.124
#> GSM955022     3  0.6180     0.3134 0.000 0.416 0.584
#> GSM955023     2  0.6154     0.5131 0.000 0.592 0.408
#> GSM955027     2  0.2878     0.7568 0.000 0.904 0.096
#> GSM955043     2  0.2711     0.7593 0.000 0.912 0.088
#> GSM955048     1  0.0000     0.9232 1.000 0.000 0.000
#> GSM955049     2  0.5529     0.6728 0.000 0.704 0.296
#> GSM955054     2  0.6168     0.4528 0.000 0.588 0.412
#> GSM955064     2  0.5098     0.7230 0.000 0.752 0.248
#> GSM955072     2  0.1753     0.7432 0.000 0.952 0.048
#> GSM955075     2  0.3816     0.6918 0.000 0.852 0.148
#> GSM955079     3  0.3816     0.8419 0.000 0.148 0.852
#> GSM955087     1  0.0424     0.9223 0.992 0.000 0.008
#> GSM955088     3  0.3116     0.8517 0.000 0.108 0.892
#> GSM955089     1  0.0424     0.9226 0.992 0.000 0.008
#> GSM955095     2  0.5016     0.6952 0.000 0.760 0.240
#> GSM955097     2  0.5681     0.6569 0.016 0.748 0.236
#> GSM955101     3  0.4121     0.8299 0.000 0.168 0.832
#> GSM954999     2  0.7074     0.1889 0.020 0.500 0.480
#> GSM955001     2  0.5098     0.7253 0.000 0.752 0.248
#> GSM955003     2  0.6295     0.2504 0.000 0.528 0.472
#> GSM955004     2  0.1636     0.7171 0.016 0.964 0.020
#> GSM955005     3  0.5016     0.7235 0.000 0.240 0.760
#> GSM955009     2  0.2261     0.7483 0.000 0.932 0.068
#> GSM955011     1  0.6621     0.4918 0.684 0.032 0.284
#> GSM955012     2  0.5138     0.6699 0.000 0.748 0.252
#> GSM955013     2  0.6291     0.2460 0.000 0.532 0.468
#> GSM955015     2  0.6062     0.5088 0.000 0.616 0.384
#> GSM955017     1  0.0237     0.9233 0.996 0.000 0.004
#> GSM955021     2  0.5254     0.6912 0.000 0.736 0.264
#> GSM955025     2  0.2356     0.7466 0.000 0.928 0.072
#> GSM955028     1  0.0424     0.9223 0.992 0.000 0.008
#> GSM955029     2  0.3619     0.6835 0.000 0.864 0.136
#> GSM955030     3  0.3267     0.8415 0.000 0.116 0.884
#> GSM955032     3  0.3192     0.8525 0.000 0.112 0.888
#> GSM955033     2  0.4002     0.7545 0.000 0.840 0.160
#> GSM955034     1  0.0424     0.9223 0.992 0.000 0.008
#> GSM955035     2  0.4750     0.7294 0.000 0.784 0.216
#> GSM955036     3  0.4349     0.8081 0.020 0.128 0.852
#> GSM955037     1  0.2165     0.8895 0.936 0.000 0.064
#> GSM955039     3  0.5882     0.5566 0.000 0.348 0.652
#> GSM955041     2  0.5810     0.6200 0.000 0.664 0.336
#> GSM955042     1  0.6546     0.6977 0.756 0.096 0.148
#> GSM955045     2  0.5905     0.6078 0.000 0.648 0.352
#> GSM955046     3  0.4195     0.8192 0.012 0.136 0.852
#> GSM955047     1  0.0475     0.9223 0.992 0.004 0.004
#> GSM955050     2  0.5327     0.6972 0.000 0.728 0.272
#> GSM955052     3  0.3879     0.8402 0.000 0.152 0.848
#> GSM955053     1  0.0592     0.9228 0.988 0.000 0.012
#> GSM955056     3  0.6079     0.3457 0.000 0.388 0.612
#> GSM955058     2  0.4121     0.6948 0.000 0.832 0.168
#> GSM955059     3  0.2959     0.8497 0.000 0.100 0.900
#> GSM955060     1  0.0000     0.9232 1.000 0.000 0.000
#> GSM955061     2  0.4291     0.6930 0.000 0.820 0.180
#> GSM955065     1  0.0424     0.9223 0.992 0.000 0.008
#> GSM955066     3  0.3551     0.8307 0.000 0.132 0.868
#> GSM955067     1  0.5060     0.7569 0.816 0.156 0.028
#> GSM955073     3  0.3412     0.8475 0.000 0.124 0.876
#> GSM955074     1  0.1015     0.9157 0.980 0.012 0.008
#> GSM955076     2  0.4452     0.7291 0.000 0.808 0.192
#> GSM955078     2  0.0424     0.7319 0.000 0.992 0.008
#> GSM955083     2  0.6753     0.4991 0.016 0.596 0.388
#> GSM955084     2  0.1636     0.7171 0.016 0.964 0.020
#> GSM955086     3  0.3116     0.8524 0.000 0.108 0.892
#> GSM955091     2  0.2356     0.7498 0.000 0.928 0.072
#> GSM955092     2  0.6111     0.5113 0.000 0.604 0.396
#> GSM955093     3  0.3412     0.8475 0.000 0.124 0.876
#> GSM955098     2  0.2804     0.7394 0.016 0.924 0.060
#> GSM955099     2  0.2165     0.7472 0.000 0.936 0.064
#> GSM955100     1  0.7299     0.1871 0.556 0.032 0.412
#> GSM955103     3  0.6062     0.4615 0.000 0.384 0.616
#> GSM955104     3  0.3116     0.8519 0.000 0.108 0.892
#> GSM955106     2  0.3192     0.7476 0.000 0.888 0.112
#> GSM955000     1  0.0237     0.9233 0.996 0.000 0.004
#> GSM955006     1  0.0237     0.9233 0.996 0.000 0.004
#> GSM955007     3  0.4002     0.8288 0.000 0.160 0.840
#> GSM955010     3  0.3918     0.8346 0.012 0.120 0.868
#> GSM955014     1  0.0000     0.9232 1.000 0.000 0.000
#> GSM955018     3  0.3340     0.8476 0.000 0.120 0.880
#> GSM955020     1  0.0000     0.9232 1.000 0.000 0.000
#> GSM955024     2  0.6235     0.4229 0.000 0.564 0.436
#> GSM955026     2  0.2261     0.7480 0.000 0.932 0.068
#> GSM955031     2  0.6952     0.1941 0.016 0.504 0.480
#> GSM955038     2  0.3359     0.7493 0.016 0.900 0.084
#> GSM955040     2  0.6501     0.6421 0.020 0.664 0.316
#> GSM955044     2  0.0592     0.7362 0.000 0.988 0.012
#> GSM955051     1  0.0424     0.9226 0.992 0.000 0.008
#> GSM955055     2  0.4750     0.7347 0.000 0.784 0.216
#> GSM955057     1  0.0000     0.9232 1.000 0.000 0.000
#> GSM955062     2  0.5497     0.6720 0.000 0.708 0.292
#> GSM955063     3  0.3267     0.8502 0.000 0.116 0.884
#> GSM955068     2  0.0747     0.7378 0.000 0.984 0.016
#> GSM955069     3  0.3207     0.8416 0.012 0.084 0.904
#> GSM955070     2  0.3192     0.7621 0.000 0.888 0.112
#> GSM955071     3  0.5650     0.5971 0.000 0.312 0.688
#> GSM955077     2  0.4002     0.7485 0.000 0.840 0.160
#> GSM955080     2  0.5178     0.6730 0.000 0.744 0.256
#> GSM955081     2  0.6111     0.5040 0.000 0.604 0.396
#> GSM955082     3  0.6302    -0.0992 0.000 0.480 0.520
#> GSM955085     2  0.2625     0.7534 0.000 0.916 0.084
#> GSM955090     1  0.0424     0.9226 0.992 0.000 0.008
#> GSM955094     2  0.3879     0.7541 0.000 0.848 0.152
#> GSM955096     3  0.4062     0.8330 0.000 0.164 0.836
#> GSM955102     3  0.6266     0.6842 0.156 0.076 0.768
#> GSM955105     3  0.3192     0.8527 0.000 0.112 0.888

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM955002     2  0.5775     0.5319 0.000 0.696 0.212 0.092
#> GSM955008     3  0.3356     0.6030 0.000 0.176 0.824 0.000
#> GSM955016     1  0.5319     0.7252 0.764 0.024 0.048 0.164
#> GSM955019     2  0.2846     0.5488 0.028 0.908 0.052 0.012
#> GSM955022     3  0.7591     0.5082 0.072 0.088 0.600 0.240
#> GSM955023     2  0.5815     0.2756 0.000 0.540 0.428 0.032
#> GSM955027     2  0.4548     0.5819 0.008 0.804 0.144 0.044
#> GSM955043     2  0.7374     0.4799 0.052 0.628 0.120 0.200
#> GSM955048     1  0.0188     0.9195 0.996 0.000 0.000 0.004
#> GSM955049     2  0.5339     0.5280 0.000 0.688 0.272 0.040
#> GSM955054     2  0.5155     0.3716 0.000 0.528 0.468 0.004
#> GSM955064     2  0.7926     0.4689 0.056 0.540 0.292 0.112
#> GSM955072     2  0.4952     0.5212 0.080 0.804 0.024 0.092
#> GSM955075     4  0.4054     0.6420 0.000 0.188 0.016 0.796
#> GSM955079     3  0.3648     0.7328 0.076 0.056 0.864 0.004
#> GSM955087     1  0.2530     0.8892 0.888 0.000 0.000 0.112
#> GSM955088     3  0.1209     0.6854 0.000 0.032 0.964 0.004
#> GSM955089     1  0.1821     0.9150 0.948 0.012 0.008 0.032
#> GSM955095     4  0.9043     0.0819 0.060 0.288 0.288 0.364
#> GSM955097     4  0.9340     0.2598 0.308 0.104 0.212 0.376
#> GSM955101     3  0.2593     0.7003 0.016 0.080 0.904 0.000
#> GSM954999     3  0.9149     0.2073 0.264 0.104 0.436 0.196
#> GSM955001     2  0.5522     0.5424 0.000 0.716 0.204 0.080
#> GSM955003     3  0.5137    -0.1804 0.000 0.452 0.544 0.004
#> GSM955004     2  0.7175     0.3357 0.116 0.612 0.028 0.244
#> GSM955005     3  0.4640     0.7254 0.092 0.068 0.820 0.020
#> GSM955009     2  0.5027     0.5506 0.116 0.796 0.064 0.024
#> GSM955011     1  0.2989     0.8579 0.884 0.012 0.100 0.004
#> GSM955012     4  0.4370     0.6377 0.000 0.156 0.044 0.800
#> GSM955013     3  0.8696     0.3036 0.080 0.180 0.492 0.248
#> GSM955015     2  0.7075     0.2444 0.000 0.488 0.384 0.128
#> GSM955017     1  0.0000     0.9196 1.000 0.000 0.000 0.000
#> GSM955021     2  0.5594     0.5798 0.040 0.672 0.284 0.004
#> GSM955025     2  0.4740     0.5377 0.116 0.808 0.060 0.016
#> GSM955028     1  0.2530     0.8892 0.888 0.000 0.000 0.112
#> GSM955029     4  0.4776     0.6045 0.000 0.244 0.024 0.732
#> GSM955030     3  0.3551     0.7194 0.096 0.020 0.868 0.016
#> GSM955032     3  0.1489     0.6913 0.000 0.044 0.952 0.004
#> GSM955033     2  0.9166     0.0508 0.096 0.396 0.188 0.320
#> GSM955034     1  0.2469     0.8902 0.892 0.000 0.000 0.108
#> GSM955035     2  0.4212     0.5772 0.000 0.772 0.216 0.012
#> GSM955036     3  0.8264     0.1946 0.252 0.024 0.460 0.264
#> GSM955037     1  0.5024     0.8205 0.780 0.004 0.112 0.104
#> GSM955039     3  0.7345     0.6007 0.076 0.100 0.644 0.180
#> GSM955041     2  0.8482     0.2308 0.072 0.416 0.392 0.120
#> GSM955042     1  0.3641     0.8676 0.868 0.008 0.072 0.052
#> GSM955045     2  0.7351     0.3385 0.012 0.520 0.344 0.124
#> GSM955046     3  0.5695     0.6733 0.104 0.032 0.760 0.104
#> GSM955047     1  0.0657     0.9198 0.984 0.012 0.004 0.000
#> GSM955050     2  0.8523     0.4243 0.120 0.516 0.260 0.104
#> GSM955052     3  0.1940     0.6852 0.000 0.076 0.924 0.000
#> GSM955053     1  0.2530     0.8892 0.888 0.000 0.000 0.112
#> GSM955056     3  0.4483     0.4395 0.000 0.284 0.712 0.004
#> GSM955058     4  0.4472     0.6331 0.000 0.220 0.020 0.760
#> GSM955059     3  0.3215     0.7316 0.092 0.032 0.876 0.000
#> GSM955060     1  0.0000     0.9196 1.000 0.000 0.000 0.000
#> GSM955061     4  0.4307     0.6454 0.000 0.192 0.024 0.784
#> GSM955065     1  0.2530     0.8892 0.888 0.000 0.000 0.112
#> GSM955066     3  0.4457     0.7102 0.092 0.016 0.828 0.064
#> GSM955067     1  0.3504     0.8707 0.876 0.020 0.024 0.080
#> GSM955073     3  0.3366     0.7316 0.096 0.028 0.872 0.004
#> GSM955074     1  0.2667     0.8959 0.912 0.008 0.020 0.060
#> GSM955076     2  0.5154     0.5580 0.120 0.788 0.068 0.024
#> GSM955078     2  0.5302     0.5310 0.100 0.784 0.028 0.088
#> GSM955083     3  0.9728    -0.0291 0.232 0.160 0.352 0.256
#> GSM955084     2  0.6816     0.3918 0.116 0.652 0.024 0.208
#> GSM955086     3  0.1209     0.6919 0.000 0.032 0.964 0.004
#> GSM955091     2  0.2716     0.5280 0.008 0.912 0.052 0.028
#> GSM955092     3  0.5250    -0.1290 0.000 0.440 0.552 0.008
#> GSM955093     3  0.3182     0.7309 0.096 0.028 0.876 0.000
#> GSM955098     2  0.5208     0.5286 0.132 0.784 0.052 0.032
#> GSM955099     2  0.2111     0.5165 0.000 0.932 0.044 0.024
#> GSM955100     1  0.3946     0.7630 0.812 0.012 0.172 0.004
#> GSM955103     3  0.7502     0.5892 0.076 0.128 0.636 0.160
#> GSM955104     3  0.4174     0.7107 0.116 0.024 0.836 0.024
#> GSM955106     4  0.7321     0.4161 0.012 0.312 0.132 0.544
#> GSM955000     1  0.0817     0.9199 0.976 0.000 0.024 0.000
#> GSM955006     1  0.1516     0.9155 0.960 0.008 0.016 0.016
#> GSM955007     3  0.6515     0.6381 0.084 0.048 0.700 0.168
#> GSM955010     3  0.4673     0.6785 0.156 0.016 0.796 0.032
#> GSM955014     1  0.0524     0.9201 0.988 0.008 0.000 0.004
#> GSM955018     3  0.3051     0.7317 0.088 0.028 0.884 0.000
#> GSM955020     1  0.0592     0.9201 0.984 0.000 0.000 0.016
#> GSM955024     3  0.7675     0.1287 0.024 0.376 0.480 0.120
#> GSM955026     2  0.5147     0.5265 0.116 0.792 0.060 0.032
#> GSM955031     2  0.7854     0.4196 0.216 0.512 0.256 0.016
#> GSM955038     2  0.7390     0.4574 0.124 0.652 0.132 0.092
#> GSM955040     2  0.8541     0.3938 0.136 0.460 0.332 0.072
#> GSM955044     2  0.7158     0.5092 0.092 0.660 0.076 0.172
#> GSM955051     1  0.0469     0.9200 0.988 0.012 0.000 0.000
#> GSM955055     2  0.3852     0.5854 0.000 0.800 0.192 0.008
#> GSM955057     1  0.0188     0.9195 0.996 0.000 0.000 0.004
#> GSM955062     2  0.4927     0.5443 0.000 0.712 0.264 0.024
#> GSM955063     3  0.3107     0.7322 0.080 0.036 0.884 0.000
#> GSM955068     2  0.5254     0.5486 0.100 0.792 0.044 0.064
#> GSM955069     3  0.2926     0.7247 0.096 0.012 0.888 0.004
#> GSM955070     2  0.5280     0.5517 0.000 0.748 0.156 0.096
#> GSM955071     3  0.6139     0.6321 0.120 0.164 0.704 0.012
#> GSM955077     2  0.5990     0.5247 0.132 0.724 0.128 0.016
#> GSM955080     4  0.7608     0.2522 0.000 0.328 0.216 0.456
#> GSM955081     2  0.7034     0.3371 0.076 0.496 0.412 0.016
#> GSM955082     3  0.5479     0.4996 0.024 0.264 0.696 0.016
#> GSM955085     2  0.3463     0.5628 0.004 0.868 0.096 0.032
#> GSM955090     1  0.1786     0.9124 0.948 0.008 0.008 0.036
#> GSM955094     2  0.6869     0.4326 0.016 0.636 0.132 0.216
#> GSM955096     3  0.2281     0.6806 0.000 0.096 0.904 0.000
#> GSM955102     3  0.6001     0.5487 0.248 0.008 0.676 0.068
#> GSM955105     3  0.1697     0.7045 0.016 0.028 0.952 0.004

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3 p4    p5
#> GSM955002     2  0.4797     0.5172 0.000 0.724 0.172 NA 0.104
#> GSM955008     3  0.3878     0.5824 0.000 0.236 0.748 NA 0.000
#> GSM955016     1  0.5221     0.6888 0.720 0.012 0.004 NA 0.160
#> GSM955019     2  0.2721     0.5786 0.000 0.896 0.052 NA 0.016
#> GSM955022     3  0.6958     0.0139 0.012 0.188 0.432 NA 0.364
#> GSM955023     2  0.4286     0.4778 0.000 0.716 0.260 NA 0.020
#> GSM955027     2  0.3800     0.5622 0.000 0.812 0.108 NA 0.080
#> GSM955043     2  0.5956     0.0324 0.020 0.496 0.060 NA 0.424
#> GSM955048     1  0.1732     0.8189 0.920 0.000 0.000 NA 0.000
#> GSM955049     2  0.4267     0.5421 0.000 0.772 0.180 NA 0.020
#> GSM955054     3  0.4973    -0.0277 0.000 0.480 0.496 NA 0.004
#> GSM955064     2  0.5800     0.4643 0.008 0.640 0.196 NA 0.156
#> GSM955072     2  0.5956     0.4682 0.020 0.672 0.012 NA 0.120
#> GSM955075     5  0.2389     0.6088 0.000 0.116 0.000 NA 0.880
#> GSM955079     3  0.2338     0.7042 0.024 0.048 0.916 NA 0.004
#> GSM955087     1  0.4278     0.6390 0.548 0.000 0.000 NA 0.000
#> GSM955088     3  0.1106     0.7020 0.000 0.024 0.964 NA 0.000
#> GSM955089     1  0.2445     0.8089 0.884 0.000 0.004 NA 0.004
#> GSM955095     5  0.6351     0.5607 0.024 0.216 0.144 NA 0.612
#> GSM955097     5  0.6460     0.5845 0.144 0.056 0.124 NA 0.660
#> GSM955101     3  0.3106     0.6776 0.000 0.140 0.840 NA 0.000
#> GSM954999     5  0.8660     0.3329 0.152 0.084 0.312 NA 0.392
#> GSM955001     2  0.4596     0.5496 0.000 0.780 0.116 NA 0.076
#> GSM955003     3  0.4738     0.0549 0.000 0.464 0.520 NA 0.000
#> GSM955004     5  0.7112    -0.1051 0.048 0.368 0.000 NA 0.448
#> GSM955005     3  0.3351     0.6883 0.028 0.084 0.864 NA 0.016
#> GSM955009     2  0.6837     0.4626 0.040 0.604 0.056 NA 0.056
#> GSM955011     1  0.3483     0.7678 0.848 0.000 0.088 NA 0.012
#> GSM955012     5  0.2497     0.6099 0.000 0.112 0.004 NA 0.880
#> GSM955013     5  0.6850     0.1596 0.024 0.148 0.408 NA 0.420
#> GSM955015     2  0.6130     0.3447 0.000 0.556 0.264 NA 0.180
#> GSM955017     1  0.0609     0.8262 0.980 0.000 0.000 NA 0.000
#> GSM955021     2  0.5189     0.3173 0.012 0.584 0.380 NA 0.004
#> GSM955025     2  0.6612     0.4554 0.044 0.616 0.040 NA 0.052
#> GSM955028     1  0.4278     0.6390 0.548 0.000 0.000 NA 0.000
#> GSM955029     5  0.3167     0.5661 0.000 0.172 0.004 NA 0.820
#> GSM955030     3  0.2363     0.6854 0.024 0.000 0.912 NA 0.012
#> GSM955032     3  0.1525     0.7033 0.000 0.036 0.948 NA 0.004
#> GSM955033     5  0.6978     0.5608 0.032 0.176 0.216 NA 0.564
#> GSM955034     1  0.4273     0.6405 0.552 0.000 0.000 NA 0.000
#> GSM955035     2  0.3519     0.5669 0.000 0.828 0.136 NA 0.008
#> GSM955036     5  0.6444     0.4233 0.096 0.008 0.328 NA 0.548
#> GSM955037     1  0.6000     0.5336 0.452 0.000 0.096 NA 0.004
#> GSM955039     3  0.6507     0.3657 0.012 0.156 0.588 NA 0.232
#> GSM955041     2  0.6904     0.1188 0.012 0.464 0.256 NA 0.268
#> GSM955042     1  0.3883     0.7878 0.820 0.000 0.012 NA 0.060
#> GSM955045     2  0.6365     0.2069 0.000 0.520 0.228 NA 0.252
#> GSM955046     3  0.5936     0.5062 0.008 0.028 0.680 NA 0.144
#> GSM955047     1  0.0609     0.8262 0.980 0.000 0.000 NA 0.000
#> GSM955050     2  0.8781     0.2495 0.072 0.384 0.316 NA 0.096
#> GSM955052     3  0.2563     0.6881 0.000 0.120 0.872 NA 0.000
#> GSM955053     1  0.4278     0.6390 0.548 0.000 0.000 NA 0.000
#> GSM955056     3  0.5120     0.4219 0.000 0.328 0.628 NA 0.016
#> GSM955058     5  0.2964     0.5882 0.000 0.152 0.004 NA 0.840
#> GSM955059     3  0.2084     0.6859 0.004 0.008 0.920 NA 0.004
#> GSM955060     1  0.0609     0.8262 0.980 0.000 0.000 NA 0.000
#> GSM955061     5  0.2597     0.6089 0.000 0.120 0.004 NA 0.872
#> GSM955065     1  0.4278     0.6390 0.548 0.000 0.000 NA 0.000
#> GSM955066     3  0.2721     0.6881 0.020 0.008 0.904 NA 0.032
#> GSM955067     1  0.2166     0.8155 0.912 0.000 0.004 NA 0.012
#> GSM955073     3  0.4102     0.6616 0.004 0.080 0.796 NA 0.000
#> GSM955074     1  0.3299     0.7992 0.848 0.004 0.000 NA 0.040
#> GSM955076     2  0.6790     0.4727 0.040 0.612 0.056 NA 0.056
#> GSM955078     2  0.6721     0.3918 0.044 0.580 0.000 NA 0.192
#> GSM955083     5  0.7601     0.5378 0.104 0.112 0.236 NA 0.532
#> GSM955084     2  0.7137     0.1230 0.048 0.412 0.000 NA 0.404
#> GSM955086     3  0.1356     0.7025 0.000 0.028 0.956 NA 0.004
#> GSM955091     2  0.2521     0.5796 0.000 0.900 0.068 NA 0.008
#> GSM955092     2  0.5092     0.1349 0.000 0.524 0.440 NA 0.000
#> GSM955093     3  0.3449     0.6332 0.004 0.016 0.832 NA 0.008
#> GSM955098     2  0.6559     0.4493 0.044 0.612 0.028 NA 0.060
#> GSM955099     2  0.2381     0.5668 0.000 0.908 0.036 NA 0.004
#> GSM955100     1  0.3944     0.7282 0.812 0.000 0.124 NA 0.012
#> GSM955103     3  0.6755     0.2116 0.012 0.208 0.492 NA 0.288
#> GSM955104     3  0.2863     0.6926 0.032 0.024 0.900 NA 0.016
#> GSM955106     5  0.5955     0.5931 0.016 0.196 0.084 NA 0.676
#> GSM955000     1  0.2300     0.8133 0.908 0.000 0.052 NA 0.000
#> GSM955006     1  0.1872     0.8164 0.928 0.000 0.020 NA 0.000
#> GSM955007     3  0.6602     0.3164 0.000 0.144 0.552 NA 0.276
#> GSM955010     3  0.3708     0.6431 0.056 0.000 0.836 NA 0.016
#> GSM955014     1  0.1478     0.8234 0.936 0.000 0.000 NA 0.000
#> GSM955018     3  0.2464     0.6705 0.004 0.012 0.892 NA 0.000
#> GSM955020     1  0.2230     0.8260 0.884 0.000 0.000 NA 0.000
#> GSM955024     3  0.6740     0.0465 0.000 0.380 0.404 NA 0.212
#> GSM955026     2  0.6514     0.4498 0.040 0.612 0.028 NA 0.060
#> GSM955031     2  0.7723     0.1818 0.172 0.408 0.356 NA 0.012
#> GSM955038     2  0.8626     0.3124 0.124 0.480 0.096 NA 0.100
#> GSM955040     3  0.8464    -0.0156 0.172 0.288 0.420 NA 0.052
#> GSM955044     2  0.6051     0.0895 0.020 0.500 0.016 NA 0.428
#> GSM955051     1  0.0324     0.8266 0.992 0.000 0.004 NA 0.000
#> GSM955055     2  0.3160     0.5715 0.000 0.852 0.116 NA 0.004
#> GSM955057     1  0.1732     0.8189 0.920 0.000 0.000 NA 0.000
#> GSM955062     2  0.3965     0.5461 0.000 0.784 0.180 NA 0.008
#> GSM955063     3  0.3110     0.6916 0.000 0.080 0.860 NA 0.000
#> GSM955068     2  0.6540     0.4637 0.044 0.624 0.016 NA 0.092
#> GSM955069     3  0.3067     0.6256 0.004 0.000 0.844 NA 0.012
#> GSM955070     2  0.4401     0.5269 0.000 0.764 0.104 NA 0.132
#> GSM955071     3  0.4911     0.6383 0.072 0.152 0.752 NA 0.004
#> GSM955077     2  0.7348     0.3830 0.052 0.544 0.140 NA 0.020
#> GSM955080     5  0.5585     0.5607 0.004 0.232 0.120 NA 0.644
#> GSM955081     3  0.5153     0.0793 0.012 0.452 0.520 NA 0.008
#> GSM955082     3  0.4240     0.5239 0.004 0.304 0.684 NA 0.000
#> GSM955085     2  0.2396     0.5787 0.000 0.904 0.068 NA 0.024
#> GSM955090     1  0.2573     0.8074 0.880 0.000 0.000 NA 0.016
#> GSM955094     2  0.5426     0.3255 0.004 0.636 0.084 NA 0.276
#> GSM955096     3  0.2464     0.6973 0.000 0.096 0.888 NA 0.000
#> GSM955102     3  0.4991     0.5000 0.032 0.000 0.668 NA 0.016
#> GSM955105     3  0.1461     0.7027 0.000 0.028 0.952 NA 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
#> GSM955002     2  0.2834     0.5272 0.000 0.852 0.020 0.008 0.120 0.000
#> GSM955008     2  0.4779    -0.0661 0.040 0.488 0.468 0.004 0.000 0.000
#> GSM955016     1  0.5756     0.6008 0.580 0.000 0.000 0.036 0.108 0.276
#> GSM955019     2  0.3489     0.3064 0.000 0.708 0.004 0.288 0.000 0.000
#> GSM955022     2  0.5960    -0.1717 0.008 0.424 0.144 0.004 0.420 0.000
#> GSM955023     2  0.1616     0.5869 0.000 0.932 0.048 0.000 0.020 0.000
#> GSM955027     2  0.1719     0.5694 0.000 0.928 0.008 0.008 0.056 0.000
#> GSM955043     2  0.4151    -0.0618 0.000 0.576 0.008 0.004 0.412 0.000
#> GSM955048     6  0.4120    -0.5295 0.468 0.000 0.004 0.004 0.000 0.524
#> GSM955049     2  0.0405     0.5806 0.000 0.988 0.004 0.000 0.008 0.000
#> GSM955054     2  0.4998     0.1680 0.056 0.552 0.384 0.008 0.000 0.000
#> GSM955064     2  0.2487     0.5582 0.000 0.876 0.032 0.000 0.092 0.000
#> GSM955072     4  0.5168     0.5310 0.008 0.324 0.000 0.584 0.084 0.000
#> GSM955075     5  0.1972     0.5819 0.024 0.056 0.000 0.004 0.916 0.000
#> GSM955079     3  0.3101     0.5807 0.000 0.244 0.756 0.000 0.000 0.000
#> GSM955087     6  0.0000     0.5407 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM955088     3  0.3370     0.6024 0.012 0.212 0.772 0.004 0.000 0.000
#> GSM955089     1  0.4742     0.7141 0.636 0.000 0.004 0.032 0.016 0.312
#> GSM955095     5  0.5073     0.5411 0.028 0.284 0.056 0.000 0.632 0.000
#> GSM955097     5  0.5727     0.5358 0.044 0.028 0.088 0.016 0.700 0.124
#> GSM955101     3  0.4226     0.3032 0.012 0.404 0.580 0.004 0.000 0.000
#> GSM954999     5  0.8798     0.3754 0.156 0.224 0.128 0.016 0.356 0.120
#> GSM955001     2  0.1219     0.5692 0.000 0.948 0.004 0.000 0.048 0.000
#> GSM955003     2  0.5064     0.1320 0.060 0.540 0.392 0.008 0.000 0.000
#> GSM955004     4  0.6609     0.5260 0.036 0.060 0.004 0.532 0.304 0.064
#> GSM955005     3  0.3938     0.4785 0.012 0.312 0.672 0.000 0.004 0.000
#> GSM955009     4  0.3352     0.7323 0.016 0.144 0.024 0.816 0.000 0.000
#> GSM955011     1  0.6316     0.6247 0.544 0.028 0.036 0.092 0.000 0.300
#> GSM955012     5  0.2271     0.5801 0.032 0.056 0.004 0.004 0.904 0.000
#> GSM955013     5  0.6117     0.2733 0.016 0.372 0.148 0.000 0.460 0.004
#> GSM955015     2  0.4805     0.4749 0.012 0.696 0.116 0.000 0.176 0.000
#> GSM955017     1  0.3995     0.5664 0.516 0.000 0.000 0.004 0.000 0.480
#> GSM955021     2  0.5530     0.2541 0.032 0.580 0.308 0.080 0.000 0.000
#> GSM955025     4  0.3338     0.7415 0.012 0.152 0.024 0.812 0.000 0.000
#> GSM955028     6  0.0000     0.5407 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM955029     5  0.3531     0.5356 0.032 0.152 0.004 0.008 0.804 0.000
#> GSM955030     3  0.4497     0.6577 0.104 0.124 0.752 0.004 0.004 0.012
#> GSM955032     3  0.3648     0.5739 0.016 0.240 0.740 0.004 0.000 0.000
#> GSM955033     5  0.6282     0.5209 0.036 0.272 0.100 0.020 0.568 0.004
#> GSM955034     6  0.0508     0.5370 0.012 0.000 0.000 0.004 0.000 0.984
#> GSM955035     2  0.0291     0.5809 0.000 0.992 0.004 0.000 0.004 0.000
#> GSM955036     5  0.6133     0.4638 0.044 0.004 0.240 0.012 0.596 0.104
#> GSM955037     6  0.5321     0.2646 0.092 0.000 0.248 0.020 0.004 0.636
#> GSM955039     2  0.6165     0.0580 0.008 0.452 0.272 0.000 0.268 0.000
#> GSM955041     2  0.3867     0.4325 0.000 0.748 0.052 0.000 0.200 0.000
#> GSM955042     1  0.4914     0.7062 0.648 0.000 0.004 0.036 0.028 0.284
#> GSM955045     2  0.3440     0.4702 0.000 0.776 0.028 0.000 0.196 0.000
#> GSM955046     3  0.6646     0.3205 0.188 0.124 0.560 0.008 0.120 0.000
#> GSM955047     1  0.4310     0.5714 0.512 0.000 0.004 0.012 0.000 0.472
#> GSM955050     2  0.8940    -0.0996 0.072 0.324 0.096 0.296 0.144 0.068
#> GSM955052     3  0.4310     0.3061 0.016 0.404 0.576 0.004 0.000 0.000
#> GSM955053     6  0.0508     0.5349 0.012 0.000 0.000 0.004 0.000 0.984
#> GSM955056     2  0.4957     0.0762 0.048 0.520 0.424 0.008 0.000 0.000
#> GSM955058     5  0.2981     0.5739 0.032 0.100 0.004 0.008 0.856 0.000
#> GSM955059     3  0.4102     0.6535 0.164 0.080 0.752 0.000 0.004 0.000
#> GSM955060     1  0.3993     0.5723 0.520 0.000 0.000 0.004 0.000 0.476
#> GSM955061     5  0.2781     0.5786 0.032 0.084 0.004 0.008 0.872 0.000
#> GSM955065     6  0.0000     0.5407 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM955066     3  0.5064     0.6340 0.076 0.168 0.708 0.008 0.040 0.000
#> GSM955067     1  0.5108     0.7180 0.596 0.000 0.004 0.040 0.024 0.336
#> GSM955073     3  0.4321     0.5973 0.192 0.064 0.732 0.000 0.012 0.000
#> GSM955074     1  0.4979     0.6947 0.636 0.000 0.000 0.048 0.028 0.288
#> GSM955076     4  0.4795     0.7276 0.024 0.156 0.016 0.740 0.004 0.060
#> GSM955078     4  0.4819     0.6757 0.008 0.180 0.000 0.688 0.124 0.000
#> GSM955083     5  0.7831     0.4484 0.048 0.240 0.100 0.016 0.468 0.128
#> GSM955084     4  0.6315     0.5675 0.032 0.060 0.000 0.568 0.276 0.064
#> GSM955086     3  0.3329     0.5980 0.008 0.220 0.768 0.004 0.000 0.000
#> GSM955091     2  0.3306     0.4467 0.008 0.796 0.008 0.184 0.004 0.000
#> GSM955092     2  0.4302     0.3208 0.036 0.668 0.292 0.004 0.000 0.000
#> GSM955093     3  0.3473     0.5911 0.192 0.004 0.780 0.000 0.024 0.000
#> GSM955098     4  0.3454     0.7166 0.024 0.064 0.016 0.852 0.004 0.040
#> GSM955099     2  0.3830     0.2419 0.008 0.704 0.004 0.280 0.004 0.000
#> GSM955100     1  0.6594     0.5582 0.536 0.032 0.076 0.068 0.000 0.288
#> GSM955103     2  0.6007    -0.1078 0.004 0.444 0.208 0.000 0.344 0.000
#> GSM955104     3  0.6893     0.5344 0.092 0.200 0.580 0.012 0.040 0.076
#> GSM955106     5  0.4886     0.6091 0.032 0.144 0.016 0.008 0.744 0.056
#> GSM955000     6  0.5258    -0.4281 0.412 0.000 0.084 0.004 0.000 0.500
#> GSM955006     1  0.5411     0.6694 0.540 0.000 0.004 0.096 0.004 0.356
#> GSM955007     5  0.7609     0.1471 0.136 0.284 0.252 0.004 0.324 0.000
#> GSM955010     3  0.5630     0.6109 0.096 0.072 0.708 0.004 0.036 0.084
#> GSM955014     6  0.4468    -0.5794 0.484 0.000 0.004 0.020 0.000 0.492
#> GSM955018     3  0.3529     0.6402 0.172 0.036 0.788 0.000 0.004 0.000
#> GSM955020     1  0.5125     0.6603 0.540 0.000 0.004 0.076 0.000 0.380
#> GSM955024     2  0.3717     0.4994 0.000 0.776 0.064 0.000 0.160 0.000
#> GSM955026     4  0.2757     0.7347 0.016 0.104 0.016 0.864 0.000 0.000
#> GSM955031     2  0.7699     0.1488 0.044 0.436 0.176 0.080 0.004 0.260
#> GSM955038     4  0.7965     0.5659 0.172 0.104 0.052 0.516 0.060 0.096
#> GSM955040     2  0.9258    -0.0155 0.228 0.296 0.124 0.164 0.036 0.152
#> GSM955044     5  0.6035     0.2592 0.000 0.308 0.008 0.208 0.476 0.000
#> GSM955051     1  0.4315     0.5927 0.524 0.000 0.008 0.008 0.000 0.460
#> GSM955055     2  0.0363     0.5831 0.000 0.988 0.012 0.000 0.000 0.000
#> GSM955057     6  0.4120    -0.5295 0.468 0.000 0.004 0.004 0.000 0.524
#> GSM955062     2  0.0622     0.5811 0.000 0.980 0.008 0.000 0.012 0.000
#> GSM955063     3  0.4745     0.6248 0.188 0.136 0.676 0.000 0.000 0.000
#> GSM955068     4  0.4197     0.6934 0.012 0.196 0.004 0.744 0.044 0.000
#> GSM955069     3  0.3689     0.5841 0.192 0.004 0.772 0.004 0.028 0.000
#> GSM955070     2  0.2313     0.5435 0.000 0.884 0.012 0.004 0.100 0.000
#> GSM955071     2  0.6167    -0.1500 0.048 0.452 0.432 0.020 0.004 0.044
#> GSM955077     4  0.6628     0.5685 0.048 0.244 0.076 0.580 0.016 0.036
#> GSM955080     5  0.4516     0.5907 0.016 0.240 0.040 0.004 0.700 0.000
#> GSM955081     2  0.4267     0.1189 0.008 0.564 0.420 0.008 0.000 0.000
#> GSM955082     2  0.3923     0.0908 0.004 0.580 0.416 0.000 0.000 0.000
#> GSM955085     2  0.2730     0.5085 0.004 0.856 0.004 0.124 0.012 0.000
#> GSM955090     1  0.4973     0.7052 0.620 0.000 0.000 0.052 0.020 0.308
#> GSM955094     2  0.3926     0.3121 0.000 0.708 0.012 0.012 0.268 0.000
#> GSM955096     3  0.4562     0.3146 0.032 0.388 0.576 0.004 0.000 0.000
#> GSM955102     3  0.5572     0.4924 0.200 0.000 0.644 0.008 0.028 0.120
#> GSM955105     3  0.3329     0.5980 0.008 0.220 0.768 0.004 0.000 0.000

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

consensus_heatmap(res, k = 2)

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

consensus_heatmap(res, k = 3)

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

consensus_heatmap(res, k = 4)

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

consensus_heatmap(res, k = 5)

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

consensus_heatmap(res, k = 6)

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

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

membership_heatmap(res, k = 2)

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

membership_heatmap(res, k = 3)

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

membership_heatmap(res, k = 4)

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

membership_heatmap(res, k = 5)

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

membership_heatmap(res, k = 6)

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

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

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

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

get_signatures(res, k = 3)

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

get_signatures(res, k = 4)

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

get_signatures(res, k = 5)

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

get_signatures(res, k = 6)

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

Signature heatmaps where rows are not scaled:

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

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

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

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

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

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

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

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

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

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

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk CV-mclust-signature_compare

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

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

An example of the output of tb is:

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

The columns in tb are:

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

UMAP plot which shows how samples are separated.

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

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

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

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

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

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

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

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

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

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

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk CV-mclust-collect-classes

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

test_to_known_factors(res)
#>             n genotype/variation(p) k
#> CV:mclust 108                 0.782 2
#> CV:mclust  95                 0.929 3
#> CV:mclust  79                 0.797 4
#> CV:mclust  70                 0.616 5
#> CV:mclust  67                 0.296 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 31589 rows and 108 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'CV' method.
#>   Subgroups are detected by 'NMF' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 2.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

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

collect_plots(res)

plot of chunk CV-NMF-collect-plots

The plots are:

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

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

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

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

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.813           0.883       0.952         0.4590 0.551   0.551
#> 3 3 0.592           0.737       0.876         0.2960 0.797   0.655
#> 4 4 0.591           0.699       0.858         0.1790 0.778   0.529
#> 5 5 0.536           0.553       0.747         0.0962 0.866   0.588
#> 6 6 0.551           0.457       0.676         0.0550 0.925   0.692

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

suggest_best_k(res)
#> [1] 2

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

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

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>           class entropy silhouette    p1    p2
#> GSM955002     2  0.0000     0.9457 0.000 1.000
#> GSM955008     2  0.0000     0.9457 0.000 1.000
#> GSM955016     1  0.0000     0.9513 1.000 0.000
#> GSM955019     2  0.0000     0.9457 0.000 1.000
#> GSM955022     2  0.0672     0.9395 0.008 0.992
#> GSM955023     2  0.0000     0.9457 0.000 1.000
#> GSM955027     2  0.0000     0.9457 0.000 1.000
#> GSM955043     2  0.0000     0.9457 0.000 1.000
#> GSM955048     1  0.0000     0.9513 1.000 0.000
#> GSM955049     2  0.0000     0.9457 0.000 1.000
#> GSM955054     2  0.0000     0.9457 0.000 1.000
#> GSM955064     2  0.0000     0.9457 0.000 1.000
#> GSM955072     2  0.0000     0.9457 0.000 1.000
#> GSM955075     2  0.0000     0.9457 0.000 1.000
#> GSM955079     2  0.0000     0.9457 0.000 1.000
#> GSM955087     1  0.0000     0.9513 1.000 0.000
#> GSM955088     2  0.9635     0.4082 0.388 0.612
#> GSM955089     1  0.0000     0.9513 1.000 0.000
#> GSM955095     2  0.0000     0.9457 0.000 1.000
#> GSM955097     2  0.9661     0.3981 0.392 0.608
#> GSM955101     2  0.0000     0.9457 0.000 1.000
#> GSM954999     1  0.2043     0.9280 0.968 0.032
#> GSM955001     2  0.0000     0.9457 0.000 1.000
#> GSM955003     2  0.0000     0.9457 0.000 1.000
#> GSM955004     2  0.0000     0.9457 0.000 1.000
#> GSM955005     2  0.4431     0.8667 0.092 0.908
#> GSM955009     2  0.0000     0.9457 0.000 1.000
#> GSM955011     1  0.0000     0.9513 1.000 0.000
#> GSM955012     2  0.0000     0.9457 0.000 1.000
#> GSM955013     2  0.7056     0.7538 0.192 0.808
#> GSM955015     2  0.0000     0.9457 0.000 1.000
#> GSM955017     1  0.0000     0.9513 1.000 0.000
#> GSM955021     2  0.0000     0.9457 0.000 1.000
#> GSM955025     2  0.0000     0.9457 0.000 1.000
#> GSM955028     1  0.0000     0.9513 1.000 0.000
#> GSM955029     2  0.0000     0.9457 0.000 1.000
#> GSM955030     1  0.0000     0.9513 1.000 0.000
#> GSM955032     2  0.6247     0.7974 0.156 0.844
#> GSM955033     2  0.8081     0.6762 0.248 0.752
#> GSM955034     1  0.0000     0.9513 1.000 0.000
#> GSM955035     2  0.0000     0.9457 0.000 1.000
#> GSM955036     2  0.9209     0.5216 0.336 0.664
#> GSM955037     1  0.0000     0.9513 1.000 0.000
#> GSM955039     2  0.0000     0.9457 0.000 1.000
#> GSM955041     2  0.0000     0.9457 0.000 1.000
#> GSM955042     1  0.0000     0.9513 1.000 0.000
#> GSM955045     2  0.0000     0.9457 0.000 1.000
#> GSM955046     2  0.0000     0.9457 0.000 1.000
#> GSM955047     1  0.0000     0.9513 1.000 0.000
#> GSM955050     1  0.0672     0.9463 0.992 0.008
#> GSM955052     2  0.0000     0.9457 0.000 1.000
#> GSM955053     1  0.0000     0.9513 1.000 0.000
#> GSM955056     2  0.0000     0.9457 0.000 1.000
#> GSM955058     2  0.0000     0.9457 0.000 1.000
#> GSM955059     2  0.8207     0.6644 0.256 0.744
#> GSM955060     1  0.0000     0.9513 1.000 0.000
#> GSM955061     2  0.0000     0.9457 0.000 1.000
#> GSM955065     1  0.0000     0.9513 1.000 0.000
#> GSM955066     1  0.3584     0.8947 0.932 0.068
#> GSM955067     1  0.0000     0.9513 1.000 0.000
#> GSM955073     2  0.0000     0.9457 0.000 1.000
#> GSM955074     1  0.0000     0.9513 1.000 0.000
#> GSM955076     2  0.0000     0.9457 0.000 1.000
#> GSM955078     2  0.0000     0.9457 0.000 1.000
#> GSM955083     1  0.7674     0.7121 0.776 0.224
#> GSM955084     2  0.0000     0.9457 0.000 1.000
#> GSM955086     2  0.9732     0.3690 0.404 0.596
#> GSM955091     2  0.0000     0.9457 0.000 1.000
#> GSM955092     2  0.0000     0.9457 0.000 1.000
#> GSM955093     2  0.0000     0.9457 0.000 1.000
#> GSM955098     2  0.0000     0.9457 0.000 1.000
#> GSM955099     2  0.0000     0.9457 0.000 1.000
#> GSM955100     1  0.0000     0.9513 1.000 0.000
#> GSM955103     2  0.0000     0.9457 0.000 1.000
#> GSM955104     2  0.7883     0.6949 0.236 0.764
#> GSM955106     2  0.0000     0.9457 0.000 1.000
#> GSM955000     1  0.0000     0.9513 1.000 0.000
#> GSM955006     1  0.0000     0.9513 1.000 0.000
#> GSM955007     2  0.0000     0.9457 0.000 1.000
#> GSM955010     1  0.0000     0.9513 1.000 0.000
#> GSM955014     1  0.0000     0.9513 1.000 0.000
#> GSM955018     2  0.0000     0.9457 0.000 1.000
#> GSM955020     1  0.0000     0.9513 1.000 0.000
#> GSM955024     2  0.0000     0.9457 0.000 1.000
#> GSM955026     2  0.0000     0.9457 0.000 1.000
#> GSM955031     1  0.9954     0.1798 0.540 0.460
#> GSM955038     1  0.9896     0.2438 0.560 0.440
#> GSM955040     1  0.0000     0.9513 1.000 0.000
#> GSM955044     2  0.0000     0.9457 0.000 1.000
#> GSM955051     1  0.0000     0.9513 1.000 0.000
#> GSM955055     2  0.0000     0.9457 0.000 1.000
#> GSM955057     1  0.0000     0.9513 1.000 0.000
#> GSM955062     2  0.0000     0.9457 0.000 1.000
#> GSM955063     2  0.0000     0.9457 0.000 1.000
#> GSM955068     2  0.0000     0.9457 0.000 1.000
#> GSM955069     2  0.9732     0.3688 0.404 0.596
#> GSM955070     2  0.0000     0.9457 0.000 1.000
#> GSM955071     1  0.8016     0.6798 0.756 0.244
#> GSM955077     2  0.9988     0.0229 0.480 0.520
#> GSM955080     2  0.0000     0.9457 0.000 1.000
#> GSM955081     2  0.0000     0.9457 0.000 1.000
#> GSM955082     2  0.0000     0.9457 0.000 1.000
#> GSM955085     2  0.0000     0.9457 0.000 1.000
#> GSM955090     1  0.0000     0.9513 1.000 0.000
#> GSM955094     2  0.0376     0.9426 0.004 0.996
#> GSM955096     2  0.0000     0.9457 0.000 1.000
#> GSM955102     1  0.0938     0.9432 0.988 0.012
#> GSM955105     1  0.5059     0.8478 0.888 0.112

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1    p2    p3
#> GSM955002     3  0.2796     0.8124 0.000 0.092 0.908
#> GSM955008     3  0.0892     0.8304 0.000 0.020 0.980
#> GSM955016     1  0.0000     0.9295 1.000 0.000 0.000
#> GSM955019     3  0.5397     0.6212 0.000 0.280 0.720
#> GSM955022     3  0.1163     0.8263 0.000 0.028 0.972
#> GSM955023     3  0.0892     0.8283 0.000 0.020 0.980
#> GSM955027     3  0.1860     0.8289 0.000 0.052 0.948
#> GSM955043     3  0.4842     0.6858 0.000 0.224 0.776
#> GSM955048     1  0.0000     0.9295 1.000 0.000 0.000
#> GSM955049     3  0.1860     0.8280 0.000 0.052 0.948
#> GSM955054     3  0.0000     0.8310 0.000 0.000 1.000
#> GSM955064     3  0.0424     0.8316 0.000 0.008 0.992
#> GSM955072     3  0.6062     0.2927 0.000 0.384 0.616
#> GSM955075     2  0.6252     0.3481 0.000 0.556 0.444
#> GSM955079     3  0.2031     0.8250 0.032 0.016 0.952
#> GSM955087     1  0.0475     0.9266 0.992 0.004 0.004
#> GSM955088     3  0.1878     0.8201 0.044 0.004 0.952
#> GSM955089     1  0.0000     0.9295 1.000 0.000 0.000
#> GSM955095     3  0.2878     0.7969 0.000 0.096 0.904
#> GSM955097     2  0.7983     0.5449 0.228 0.648 0.124
#> GSM955101     3  0.3192     0.7877 0.000 0.112 0.888
#> GSM954999     1  0.0000     0.9295 1.000 0.000 0.000
#> GSM955001     3  0.1964     0.8240 0.000 0.056 0.944
#> GSM955003     3  0.3482     0.7770 0.000 0.128 0.872
#> GSM955004     2  0.3412     0.7125 0.000 0.876 0.124
#> GSM955005     3  0.4228     0.7228 0.148 0.008 0.844
#> GSM955009     3  0.6045     0.4225 0.000 0.380 0.620
#> GSM955011     1  0.0000     0.9295 1.000 0.000 0.000
#> GSM955012     3  0.5465     0.5368 0.000 0.288 0.712
#> GSM955013     3  0.2550     0.8142 0.040 0.024 0.936
#> GSM955015     3  0.0892     0.8283 0.000 0.020 0.980
#> GSM955017     1  0.0475     0.9266 0.992 0.004 0.004
#> GSM955021     3  0.3686     0.7740 0.000 0.140 0.860
#> GSM955025     2  0.1529     0.7189 0.000 0.960 0.040
#> GSM955028     1  0.0237     0.9282 0.996 0.004 0.000
#> GSM955029     3  0.6307    -0.1824 0.000 0.488 0.512
#> GSM955030     1  0.5845     0.4817 0.688 0.004 0.308
#> GSM955032     3  0.1267     0.8260 0.024 0.004 0.972
#> GSM955033     2  0.7692     0.6655 0.108 0.668 0.224
#> GSM955034     1  0.0000     0.9295 1.000 0.000 0.000
#> GSM955035     3  0.4555     0.7240 0.000 0.200 0.800
#> GSM955036     3  0.4744     0.6985 0.136 0.028 0.836
#> GSM955037     1  0.0475     0.9266 0.992 0.004 0.004
#> GSM955039     3  0.2301     0.8266 0.004 0.060 0.936
#> GSM955041     3  0.1529     0.8312 0.000 0.040 0.960
#> GSM955042     1  0.0000     0.9295 1.000 0.000 0.000
#> GSM955045     3  0.0892     0.8283 0.000 0.020 0.980
#> GSM955046     3  0.1031     0.8279 0.000 0.024 0.976
#> GSM955047     1  0.0000     0.9295 1.000 0.000 0.000
#> GSM955050     1  0.1170     0.9101 0.976 0.008 0.016
#> GSM955052     3  0.1289     0.8294 0.000 0.032 0.968
#> GSM955053     1  0.0000     0.9295 1.000 0.000 0.000
#> GSM955056     3  0.0424     0.8305 0.000 0.008 0.992
#> GSM955058     3  0.6192     0.1435 0.000 0.420 0.580
#> GSM955059     3  0.1453     0.8253 0.024 0.008 0.968
#> GSM955060     1  0.0000     0.9295 1.000 0.000 0.000
#> GSM955061     2  0.6095     0.4550 0.000 0.608 0.392
#> GSM955065     1  0.0475     0.9266 0.992 0.004 0.004
#> GSM955066     3  0.6398     0.2832 0.372 0.008 0.620
#> GSM955067     1  0.0424     0.9248 0.992 0.008 0.000
#> GSM955073     3  0.0237     0.8310 0.000 0.004 0.996
#> GSM955074     1  0.0000     0.9295 1.000 0.000 0.000
#> GSM955076     3  0.5810     0.5189 0.000 0.336 0.664
#> GSM955078     2  0.1163     0.7256 0.000 0.972 0.028
#> GSM955083     1  0.4209     0.8010 0.860 0.120 0.020
#> GSM955084     2  0.2066     0.7260 0.000 0.940 0.060
#> GSM955086     3  0.1878     0.8156 0.044 0.004 0.952
#> GSM955091     3  0.5968     0.4637 0.000 0.364 0.636
#> GSM955092     3  0.2796     0.8048 0.000 0.092 0.908
#> GSM955093     3  0.1129     0.8309 0.004 0.020 0.976
#> GSM955098     2  0.4504     0.6623 0.000 0.804 0.196
#> GSM955099     3  0.5363     0.6050 0.000 0.276 0.724
#> GSM955100     1  0.0475     0.9266 0.992 0.004 0.004
#> GSM955103     3  0.0592     0.8322 0.000 0.012 0.988
#> GSM955104     3  0.5201     0.5942 0.236 0.004 0.760
#> GSM955106     2  0.6215     0.4015 0.000 0.572 0.428
#> GSM955000     1  0.0475     0.9266 0.992 0.004 0.004
#> GSM955006     1  0.0000     0.9295 1.000 0.000 0.000
#> GSM955007     3  0.0892     0.8283 0.000 0.020 0.980
#> GSM955010     1  0.3715     0.7833 0.868 0.004 0.128
#> GSM955014     1  0.0000     0.9295 1.000 0.000 0.000
#> GSM955018     3  0.1620     0.8300 0.012 0.024 0.964
#> GSM955020     1  0.0000     0.9295 1.000 0.000 0.000
#> GSM955024     3  0.0892     0.8283 0.000 0.020 0.980
#> GSM955026     2  0.5016     0.6181 0.000 0.760 0.240
#> GSM955031     3  0.8987     0.1375 0.340 0.144 0.516
#> GSM955038     2  0.5201     0.5093 0.236 0.760 0.004
#> GSM955040     1  0.0000     0.9295 1.000 0.000 0.000
#> GSM955044     2  0.6291     0.0896 0.000 0.532 0.468
#> GSM955051     1  0.0000     0.9295 1.000 0.000 0.000
#> GSM955055     3  0.2261     0.8218 0.000 0.068 0.932
#> GSM955057     1  0.0000     0.9295 1.000 0.000 0.000
#> GSM955062     3  0.3619     0.7836 0.000 0.136 0.864
#> GSM955063     3  0.0424     0.8309 0.000 0.008 0.992
#> GSM955068     2  0.0892     0.7144 0.000 0.980 0.020
#> GSM955069     3  0.2301     0.8035 0.060 0.004 0.936
#> GSM955070     3  0.1289     0.8277 0.000 0.032 0.968
#> GSM955071     1  0.6276     0.5724 0.736 0.040 0.224
#> GSM955077     1  0.6890     0.4297 0.632 0.340 0.028
#> GSM955080     3  0.5254     0.5801 0.000 0.264 0.736
#> GSM955081     3  0.3551     0.7868 0.000 0.132 0.868
#> GSM955082     3  0.0747     0.8308 0.000 0.016 0.984
#> GSM955085     3  0.5926     0.4805 0.000 0.356 0.644
#> GSM955090     1  0.0237     0.9275 0.996 0.004 0.000
#> GSM955094     3  0.2878     0.7983 0.000 0.096 0.904
#> GSM955096     3  0.1753     0.8245 0.000 0.048 0.952
#> GSM955102     1  0.6500     0.0872 0.532 0.004 0.464
#> GSM955105     3  0.3644     0.7359 0.124 0.004 0.872

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM955002     3  0.5188     0.6583 0.000 0.148 0.756 0.096
#> GSM955008     3  0.2647     0.7318 0.000 0.120 0.880 0.000
#> GSM955016     1  0.2760     0.8615 0.872 0.000 0.000 0.128
#> GSM955019     2  0.1211     0.7699 0.000 0.960 0.040 0.000
#> GSM955022     3  0.0592     0.7505 0.000 0.000 0.984 0.016
#> GSM955023     3  0.1807     0.7547 0.000 0.052 0.940 0.008
#> GSM955027     2  0.4948     0.2336 0.000 0.560 0.440 0.000
#> GSM955043     3  0.6504     0.4233 0.000 0.148 0.636 0.216
#> GSM955048     1  0.0188     0.9627 0.996 0.000 0.004 0.000
#> GSM955049     3  0.4632     0.5444 0.000 0.308 0.688 0.004
#> GSM955054     3  0.5257     0.1967 0.000 0.444 0.548 0.008
#> GSM955064     3  0.1716     0.7552 0.000 0.064 0.936 0.000
#> GSM955072     2  0.6966     0.3154 0.000 0.532 0.128 0.340
#> GSM955075     4  0.3569     0.7487 0.000 0.000 0.196 0.804
#> GSM955079     3  0.6570     0.3695 0.100 0.320 0.580 0.000
#> GSM955087     1  0.0469     0.9605 0.988 0.000 0.012 0.000
#> GSM955088     3  0.0469     0.7569 0.000 0.012 0.988 0.000
#> GSM955089     1  0.0188     0.9621 0.996 0.000 0.004 0.000
#> GSM955095     3  0.4643     0.3102 0.000 0.000 0.656 0.344
#> GSM955097     4  0.0000     0.6784 0.000 0.000 0.000 1.000
#> GSM955101     3  0.4790     0.3978 0.000 0.380 0.620 0.000
#> GSM954999     1  0.0927     0.9523 0.976 0.000 0.016 0.008
#> GSM955001     3  0.5466     0.2156 0.000 0.436 0.548 0.016
#> GSM955003     2  0.3801     0.7021 0.000 0.780 0.220 0.000
#> GSM955004     4  0.0188     0.6769 0.000 0.004 0.000 0.996
#> GSM955005     3  0.5933     0.2496 0.408 0.040 0.552 0.000
#> GSM955009     2  0.0592     0.7643 0.000 0.984 0.016 0.000
#> GSM955011     1  0.0000     0.9622 1.000 0.000 0.000 0.000
#> GSM955012     3  0.4989    -0.1496 0.000 0.000 0.528 0.472
#> GSM955013     3  0.1488     0.7387 0.012 0.000 0.956 0.032
#> GSM955015     3  0.3479     0.7108 0.000 0.148 0.840 0.012
#> GSM955017     1  0.0188     0.9627 0.996 0.000 0.004 0.000
#> GSM955021     2  0.2530     0.7578 0.000 0.888 0.112 0.000
#> GSM955025     2  0.0336     0.7557 0.008 0.992 0.000 0.000
#> GSM955028     1  0.0469     0.9605 0.988 0.000 0.012 0.000
#> GSM955029     4  0.6130     0.4172 0.000 0.052 0.400 0.548
#> GSM955030     3  0.2868     0.6390 0.136 0.000 0.864 0.000
#> GSM955032     3  0.3975     0.6334 0.000 0.240 0.760 0.000
#> GSM955033     4  0.4328     0.6421 0.008 0.000 0.244 0.748
#> GSM955034     1  0.0188     0.9627 0.996 0.000 0.004 0.000
#> GSM955035     2  0.3688     0.7056 0.000 0.792 0.208 0.000
#> GSM955036     3  0.1798     0.7256 0.016 0.000 0.944 0.040
#> GSM955037     1  0.3400     0.7646 0.820 0.000 0.180 0.000
#> GSM955039     3  0.2528     0.7308 0.008 0.080 0.908 0.004
#> GSM955041     3  0.1302     0.7582 0.000 0.044 0.956 0.000
#> GSM955042     1  0.0188     0.9627 0.996 0.000 0.004 0.000
#> GSM955045     3  0.1767     0.7561 0.000 0.044 0.944 0.012
#> GSM955046     3  0.0188     0.7521 0.000 0.000 0.996 0.004
#> GSM955047     1  0.0524     0.9617 0.988 0.008 0.004 0.000
#> GSM955050     1  0.3570     0.8601 0.860 0.048 0.000 0.092
#> GSM955052     3  0.1474     0.7572 0.000 0.052 0.948 0.000
#> GSM955053     1  0.0188     0.9627 0.996 0.000 0.004 0.000
#> GSM955056     3  0.4746     0.5363 0.000 0.304 0.688 0.008
#> GSM955058     4  0.4804     0.5137 0.000 0.000 0.384 0.616
#> GSM955059     3  0.0000     0.7533 0.000 0.000 1.000 0.000
#> GSM955060     1  0.0188     0.9627 0.996 0.000 0.004 0.000
#> GSM955061     4  0.4008     0.7207 0.000 0.000 0.244 0.756
#> GSM955065     1  0.0469     0.9605 0.988 0.000 0.012 0.000
#> GSM955066     3  0.2530     0.6876 0.100 0.004 0.896 0.000
#> GSM955067     1  0.0921     0.9508 0.972 0.028 0.000 0.000
#> GSM955073     3  0.0469     0.7567 0.000 0.012 0.988 0.000
#> GSM955074     1  0.0188     0.9620 0.996 0.000 0.000 0.004
#> GSM955076     2  0.0469     0.7628 0.000 0.988 0.012 0.000
#> GSM955078     2  0.4011     0.6365 0.000 0.784 0.008 0.208
#> GSM955083     1  0.4103     0.7014 0.744 0.000 0.000 0.256
#> GSM955084     4  0.0336     0.6761 0.000 0.008 0.000 0.992
#> GSM955086     3  0.5130     0.4754 0.016 0.332 0.652 0.000
#> GSM955091     2  0.1211     0.7699 0.000 0.960 0.040 0.000
#> GSM955092     2  0.4164     0.6488 0.000 0.736 0.264 0.000
#> GSM955093     3  0.0188     0.7547 0.000 0.004 0.996 0.000
#> GSM955098     2  0.0000     0.7571 0.000 1.000 0.000 0.000
#> GSM955099     2  0.3569     0.7166 0.000 0.804 0.196 0.000
#> GSM955100     1  0.0336     0.9618 0.992 0.000 0.008 0.000
#> GSM955103     3  0.0524     0.7537 0.000 0.004 0.988 0.008
#> GSM955104     3  0.4304     0.4277 0.284 0.000 0.716 0.000
#> GSM955106     4  0.3311     0.7548 0.000 0.000 0.172 0.828
#> GSM955000     1  0.0469     0.9597 0.988 0.000 0.012 0.000
#> GSM955006     1  0.0000     0.9622 1.000 0.000 0.000 0.000
#> GSM955007     3  0.0657     0.7534 0.000 0.004 0.984 0.012
#> GSM955010     3  0.4830     0.2387 0.392 0.000 0.608 0.000
#> GSM955014     1  0.0469     0.9596 0.988 0.012 0.000 0.000
#> GSM955018     3  0.0469     0.7575 0.000 0.012 0.988 0.000
#> GSM955020     1  0.0188     0.9619 0.996 0.004 0.000 0.000
#> GSM955024     3  0.0927     0.7569 0.000 0.016 0.976 0.008
#> GSM955026     2  0.0000     0.7571 0.000 1.000 0.000 0.000
#> GSM955031     2  0.1256     0.7504 0.028 0.964 0.008 0.000
#> GSM955038     2  0.7627    -0.0102 0.388 0.408 0.000 0.204
#> GSM955040     1  0.0469     0.9600 0.988 0.012 0.000 0.000
#> GSM955044     4  0.7031     0.4378 0.000 0.224 0.200 0.576
#> GSM955051     1  0.0469     0.9596 0.988 0.012 0.000 0.000
#> GSM955055     2  0.4250     0.6248 0.000 0.724 0.276 0.000
#> GSM955057     1  0.0592     0.9579 0.984 0.016 0.000 0.000
#> GSM955062     2  0.4761     0.4956 0.000 0.664 0.332 0.004
#> GSM955063     3  0.0336     0.7557 0.000 0.008 0.992 0.000
#> GSM955068     2  0.0707     0.7513 0.000 0.980 0.000 0.020
#> GSM955069     3  0.0336     0.7500 0.008 0.000 0.992 0.000
#> GSM955070     3  0.1706     0.7506 0.000 0.016 0.948 0.036
#> GSM955071     1  0.3286     0.8587 0.876 0.080 0.044 0.000
#> GSM955077     2  0.2973     0.6328 0.144 0.856 0.000 0.000
#> GSM955080     4  0.4748     0.6973 0.000 0.016 0.268 0.716
#> GSM955081     2  0.4222     0.6277 0.000 0.728 0.272 0.000
#> GSM955082     3  0.2814     0.7244 0.000 0.132 0.868 0.000
#> GSM955085     2  0.1637     0.7689 0.000 0.940 0.060 0.000
#> GSM955090     1  0.0524     0.9602 0.988 0.008 0.000 0.004
#> GSM955094     3  0.4706     0.6644 0.000 0.072 0.788 0.140
#> GSM955096     3  0.4981     0.1198 0.000 0.464 0.536 0.000
#> GSM955102     3  0.2760     0.6531 0.128 0.000 0.872 0.000
#> GSM955105     3  0.5528     0.5290 0.236 0.064 0.700 0.000

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM955002     3  0.7448    0.36943 0.000 0.176 0.532 0.172 0.120
#> GSM955008     3  0.4577    0.64211 0.000 0.144 0.748 0.108 0.000
#> GSM955016     1  0.4102    0.62492 0.692 0.004 0.004 0.000 0.300
#> GSM955019     4  0.3636    0.49374 0.000 0.272 0.000 0.728 0.000
#> GSM955022     3  0.2753    0.69979 0.000 0.104 0.876 0.008 0.012
#> GSM955023     3  0.4235    0.49285 0.000 0.336 0.656 0.008 0.000
#> GSM955027     2  0.5493    0.41844 0.000 0.628 0.108 0.264 0.000
#> GSM955043     3  0.7833   -0.00896 0.000 0.088 0.412 0.196 0.304
#> GSM955048     1  0.0404    0.89418 0.988 0.000 0.000 0.012 0.000
#> GSM955049     3  0.6411   -0.08651 0.000 0.408 0.440 0.148 0.004
#> GSM955054     2  0.6424    0.28613 0.000 0.508 0.240 0.252 0.000
#> GSM955064     3  0.4573    0.62681 0.000 0.092 0.744 0.164 0.000
#> GSM955072     2  0.6597    0.29907 0.000 0.576 0.088 0.272 0.064
#> GSM955075     5  0.4465    0.59055 0.000 0.204 0.060 0.000 0.736
#> GSM955079     3  0.8002   -0.03286 0.104 0.264 0.408 0.224 0.000
#> GSM955087     1  0.1869    0.88406 0.936 0.012 0.036 0.016 0.000
#> GSM955088     2  0.4798    0.15313 0.000 0.580 0.396 0.024 0.000
#> GSM955089     1  0.1503    0.89069 0.952 0.008 0.020 0.020 0.000
#> GSM955095     5  0.6949    0.09843 0.000 0.304 0.340 0.004 0.352
#> GSM955097     5  0.0404    0.62330 0.000 0.012 0.000 0.000 0.988
#> GSM955101     4  0.5834    0.27668 0.000 0.108 0.348 0.544 0.000
#> GSM954999     1  0.3583    0.84033 0.860 0.020 0.068 0.036 0.016
#> GSM955001     2  0.4088    0.57293 0.000 0.780 0.176 0.036 0.008
#> GSM955003     4  0.5392    0.46361 0.000 0.192 0.144 0.664 0.000
#> GSM955004     5  0.2424    0.62806 0.000 0.132 0.000 0.000 0.868
#> GSM955005     3  0.6940    0.19866 0.372 0.036 0.456 0.136 0.000
#> GSM955009     2  0.2732    0.43824 0.000 0.840 0.000 0.160 0.000
#> GSM955011     1  0.1186    0.89632 0.964 0.020 0.008 0.008 0.000
#> GSM955012     5  0.5465    0.38074 0.000 0.056 0.348 0.008 0.588
#> GSM955013     3  0.2522    0.70957 0.004 0.040 0.908 0.008 0.040
#> GSM955015     3  0.5543    0.53987 0.000 0.160 0.672 0.160 0.008
#> GSM955017     1  0.1413    0.89494 0.956 0.012 0.012 0.020 0.000
#> GSM955021     2  0.4571    0.49879 0.000 0.736 0.076 0.188 0.000
#> GSM955025     4  0.5726    0.38079 0.080 0.368 0.000 0.548 0.004
#> GSM955028     1  0.2277    0.87415 0.916 0.016 0.052 0.016 0.000
#> GSM955029     2  0.6829    0.16712 0.000 0.512 0.088 0.064 0.336
#> GSM955030     3  0.2141    0.69206 0.064 0.016 0.916 0.004 0.000
#> GSM955032     2  0.5671    0.37040 0.004 0.568 0.348 0.080 0.000
#> GSM955033     5  0.6419    0.40103 0.004 0.024 0.268 0.120 0.584
#> GSM955034     1  0.0854    0.89460 0.976 0.008 0.004 0.012 0.000
#> GSM955035     4  0.4450    0.55188 0.000 0.108 0.132 0.760 0.000
#> GSM955036     3  0.2422    0.68807 0.004 0.024 0.916 0.020 0.036
#> GSM955037     1  0.3955    0.77668 0.804 0.028 0.148 0.020 0.000
#> GSM955039     3  0.4533    0.62690 0.020 0.020 0.780 0.156 0.024
#> GSM955041     3  0.4696    0.64425 0.000 0.068 0.748 0.172 0.012
#> GSM955042     1  0.1565    0.89165 0.952 0.020 0.016 0.008 0.004
#> GSM955045     2  0.3816    0.48498 0.000 0.696 0.304 0.000 0.000
#> GSM955046     3  0.1074    0.70285 0.000 0.012 0.968 0.004 0.016
#> GSM955047     1  0.1106    0.89375 0.964 0.012 0.000 0.024 0.000
#> GSM955050     1  0.8269    0.13166 0.416 0.244 0.064 0.248 0.028
#> GSM955052     3  0.4010    0.63869 0.000 0.208 0.760 0.032 0.000
#> GSM955053     1  0.0854    0.89403 0.976 0.012 0.004 0.008 0.000
#> GSM955056     2  0.4237    0.56656 0.000 0.752 0.200 0.048 0.000
#> GSM955058     5  0.6926    0.46851 0.000 0.116 0.128 0.160 0.596
#> GSM955059     3  0.2513    0.70057 0.000 0.116 0.876 0.008 0.000
#> GSM955060     1  0.0771    0.89386 0.976 0.004 0.000 0.020 0.000
#> GSM955061     5  0.4891    0.60901 0.000 0.080 0.076 0.072 0.772
#> GSM955065     1  0.1893    0.88645 0.936 0.012 0.028 0.024 0.000
#> GSM955066     3  0.2897    0.69429 0.052 0.040 0.888 0.020 0.000
#> GSM955067     1  0.2439    0.84439 0.876 0.004 0.000 0.120 0.000
#> GSM955073     3  0.2249    0.70469 0.000 0.096 0.896 0.008 0.000
#> GSM955074     1  0.1492    0.88837 0.948 0.008 0.000 0.004 0.040
#> GSM955076     4  0.3462    0.55596 0.000 0.196 0.012 0.792 0.000
#> GSM955078     2  0.5740    0.31683 0.000 0.620 0.000 0.164 0.216
#> GSM955083     1  0.4654    0.52315 0.632 0.012 0.008 0.000 0.348
#> GSM955084     5  0.0992    0.62164 0.000 0.024 0.000 0.008 0.968
#> GSM955086     2  0.3860    0.56410 0.016 0.808 0.148 0.028 0.000
#> GSM955091     4  0.3752    0.46989 0.000 0.292 0.000 0.708 0.000
#> GSM955092     2  0.5331    0.17485 0.000 0.568 0.060 0.372 0.000
#> GSM955093     3  0.1928    0.70558 0.004 0.072 0.920 0.004 0.000
#> GSM955098     4  0.2392    0.57737 0.004 0.104 0.004 0.888 0.000
#> GSM955099     2  0.4817    0.16315 0.000 0.572 0.024 0.404 0.000
#> GSM955100     1  0.1815    0.89122 0.940 0.020 0.016 0.024 0.000
#> GSM955103     3  0.3712    0.67333 0.000 0.132 0.820 0.040 0.008
#> GSM955104     3  0.4923    0.57247 0.176 0.068 0.736 0.020 0.000
#> GSM955106     5  0.1956    0.65568 0.000 0.008 0.076 0.000 0.916
#> GSM955000     1  0.1299    0.89335 0.960 0.012 0.020 0.008 0.000
#> GSM955006     1  0.0854    0.89612 0.976 0.004 0.008 0.012 0.000
#> GSM955007     3  0.2570    0.70393 0.000 0.108 0.880 0.004 0.008
#> GSM955010     3  0.4345    0.56502 0.156 0.020 0.780 0.044 0.000
#> GSM955014     1  0.1282    0.88861 0.952 0.004 0.000 0.044 0.000
#> GSM955018     3  0.4207    0.53546 0.008 0.276 0.708 0.008 0.000
#> GSM955020     1  0.0324    0.89451 0.992 0.004 0.000 0.004 0.000
#> GSM955024     3  0.3205    0.67082 0.000 0.176 0.816 0.004 0.004
#> GSM955026     4  0.3496    0.57497 0.012 0.200 0.000 0.788 0.000
#> GSM955031     4  0.6759    0.18613 0.276 0.328 0.000 0.396 0.000
#> GSM955038     4  0.6264    0.22533 0.176 0.008 0.000 0.572 0.244
#> GSM955040     1  0.5537    0.71499 0.736 0.072 0.080 0.104 0.008
#> GSM955044     4  0.6799    0.20591 0.000 0.016 0.200 0.496 0.288
#> GSM955051     1  0.1106    0.89265 0.964 0.012 0.000 0.024 0.000
#> GSM955055     2  0.3239    0.54364 0.000 0.852 0.068 0.080 0.000
#> GSM955057     1  0.1211    0.89389 0.960 0.016 0.000 0.024 0.000
#> GSM955062     2  0.5843    0.35340 0.000 0.572 0.124 0.304 0.000
#> GSM955063     3  0.2763    0.68727 0.000 0.148 0.848 0.004 0.000
#> GSM955068     4  0.3482    0.58473 0.000 0.096 0.008 0.844 0.052
#> GSM955069     3  0.3166    0.70116 0.012 0.112 0.856 0.020 0.000
#> GSM955070     3  0.5282    0.58067 0.000 0.212 0.700 0.056 0.032
#> GSM955071     1  0.6436    0.45674 0.592 0.028 0.120 0.256 0.004
#> GSM955077     2  0.5967    0.03021 0.308 0.556 0.000 0.136 0.000
#> GSM955080     5  0.6011    0.27146 0.000 0.344 0.128 0.000 0.528
#> GSM955081     4  0.6309    0.19667 0.000 0.340 0.168 0.492 0.000
#> GSM955082     2  0.5499    0.26463 0.000 0.532 0.400 0.068 0.000
#> GSM955085     2  0.4491    0.16520 0.000 0.624 0.008 0.364 0.004
#> GSM955090     1  0.1306    0.89211 0.960 0.016 0.000 0.016 0.008
#> GSM955094     3  0.7001    0.08191 0.000 0.400 0.440 0.100 0.060
#> GSM955096     2  0.5304    0.50779 0.000 0.640 0.272 0.088 0.000
#> GSM955102     3  0.3925    0.64980 0.124 0.040 0.816 0.020 0.000
#> GSM955105     2  0.6373    0.33183 0.184 0.532 0.280 0.004 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM955002     4  0.5924     0.5941 0.000 0.044 0.224 0.632 0.056 0.044
#> GSM955008     3  0.5319     0.5146 0.000 0.084 0.656 0.044 0.000 0.216
#> GSM955016     1  0.4460     0.6773 0.700 0.000 0.000 0.040 0.240 0.020
#> GSM955019     6  0.3554     0.5382 0.000 0.112 0.040 0.028 0.000 0.820
#> GSM955022     3  0.4891     0.4838 0.000 0.128 0.688 0.172 0.012 0.000
#> GSM955023     3  0.5489     0.3765 0.000 0.316 0.556 0.120 0.000 0.008
#> GSM955027     2  0.5784     0.0358 0.000 0.432 0.152 0.000 0.004 0.412
#> GSM955043     5  0.8401     0.0236 0.000 0.060 0.200 0.176 0.320 0.244
#> GSM955048     1  0.1320     0.8402 0.948 0.000 0.000 0.036 0.000 0.016
#> GSM955049     3  0.6062     0.0228 0.000 0.276 0.404 0.000 0.000 0.320
#> GSM955054     2  0.7053    -0.0465 0.000 0.388 0.144 0.352 0.000 0.116
#> GSM955064     3  0.5678     0.2667 0.000 0.028 0.516 0.084 0.000 0.372
#> GSM955072     2  0.5632     0.3795 0.000 0.668 0.012 0.120 0.048 0.152
#> GSM955075     5  0.4541     0.5564 0.000 0.236 0.012 0.036 0.704 0.012
#> GSM955079     3  0.7029     0.1058 0.100 0.116 0.444 0.012 0.000 0.328
#> GSM955087     1  0.1321     0.8385 0.952 0.000 0.020 0.024 0.000 0.004
#> GSM955088     2  0.7601     0.0907 0.020 0.368 0.260 0.264 0.000 0.088
#> GSM955089     1  0.1149     0.8426 0.960 0.000 0.008 0.024 0.000 0.008
#> GSM955095     5  0.6505     0.2917 0.000 0.308 0.168 0.040 0.480 0.004
#> GSM955097     5  0.0520     0.6469 0.000 0.008 0.000 0.008 0.984 0.000
#> GSM955101     6  0.4636     0.4292 0.000 0.020 0.272 0.040 0.000 0.668
#> GSM954999     1  0.3805     0.7956 0.832 0.000 0.056 0.044 0.032 0.036
#> GSM955001     2  0.3767     0.5115 0.000 0.792 0.152 0.012 0.004 0.040
#> GSM955003     6  0.6336     0.4677 0.000 0.096 0.156 0.172 0.000 0.576
#> GSM955004     5  0.3129     0.6205 0.000 0.152 0.000 0.024 0.820 0.004
#> GSM955005     3  0.7015     0.1174 0.312 0.020 0.464 0.076 0.000 0.128
#> GSM955009     2  0.4107     0.3701 0.000 0.756 0.004 0.092 0.000 0.148
#> GSM955011     1  0.1682     0.8425 0.928 0.000 0.000 0.052 0.000 0.020
#> GSM955012     5  0.4934     0.4147 0.000 0.020 0.344 0.004 0.600 0.032
#> GSM955013     3  0.5392     0.4055 0.000 0.044 0.672 0.208 0.060 0.016
#> GSM955015     4  0.7074     0.1737 0.000 0.160 0.368 0.396 0.020 0.056
#> GSM955017     1  0.3851     0.7170 0.740 0.012 0.012 0.232 0.000 0.004
#> GSM955021     2  0.4753     0.4527 0.000 0.732 0.068 0.056 0.000 0.144
#> GSM955025     6  0.6652     0.3377 0.064 0.180 0.004 0.240 0.000 0.512
#> GSM955028     1  0.1672     0.8298 0.932 0.000 0.048 0.016 0.000 0.004
#> GSM955029     2  0.6890     0.1215 0.000 0.456 0.116 0.004 0.316 0.108
#> GSM955030     3  0.4382     0.3966 0.076 0.008 0.724 0.192 0.000 0.000
#> GSM955032     2  0.5705     0.3539 0.000 0.560 0.316 0.036 0.000 0.088
#> GSM955033     4  0.5642     0.5460 0.004 0.004 0.152 0.616 0.212 0.012
#> GSM955034     1  0.0547     0.8403 0.980 0.000 0.000 0.020 0.000 0.000
#> GSM955035     6  0.5553     0.5315 0.000 0.076 0.088 0.180 0.000 0.656
#> GSM955036     3  0.4990     0.2335 0.008 0.000 0.648 0.260 0.080 0.004
#> GSM955037     1  0.3850     0.6199 0.716 0.000 0.260 0.020 0.000 0.004
#> GSM955039     3  0.5768    -0.0371 0.012 0.000 0.540 0.348 0.020 0.080
#> GSM955041     3  0.4569     0.4675 0.000 0.016 0.652 0.024 0.004 0.304
#> GSM955042     1  0.1793     0.8414 0.932 0.000 0.004 0.040 0.008 0.016
#> GSM955045     2  0.5384     0.4529 0.000 0.632 0.268 0.048 0.008 0.044
#> GSM955046     3  0.3719     0.3443 0.000 0.000 0.728 0.248 0.024 0.000
#> GSM955047     1  0.3771     0.7750 0.780 0.024 0.000 0.172 0.000 0.024
#> GSM955050     4  0.4582     0.4080 0.108 0.080 0.004 0.764 0.004 0.040
#> GSM955052     3  0.4185     0.5482 0.000 0.168 0.744 0.004 0.000 0.084
#> GSM955053     1  0.0603     0.8398 0.980 0.000 0.000 0.016 0.000 0.004
#> GSM955056     2  0.3910     0.5117 0.000 0.784 0.148 0.044 0.000 0.024
#> GSM955058     5  0.5595     0.4432 0.000 0.024 0.116 0.004 0.616 0.240
#> GSM955059     3  0.3520     0.5598 0.000 0.100 0.804 0.096 0.000 0.000
#> GSM955060     1  0.1555     0.8389 0.932 0.004 0.000 0.060 0.000 0.004
#> GSM955061     5  0.3571     0.6212 0.000 0.020 0.048 0.000 0.816 0.116
#> GSM955065     1  0.1514     0.8387 0.944 0.004 0.012 0.036 0.000 0.004
#> GSM955066     3  0.5808    -0.0804 0.080 0.032 0.524 0.360 0.000 0.004
#> GSM955067     1  0.4008     0.7646 0.768 0.000 0.000 0.128 0.004 0.100
#> GSM955073     3  0.1863     0.5946 0.000 0.044 0.920 0.000 0.000 0.036
#> GSM955074     1  0.2917     0.8245 0.872 0.008 0.000 0.040 0.068 0.012
#> GSM955076     6  0.4443     0.3485 0.000 0.300 0.000 0.052 0.000 0.648
#> GSM955078     2  0.5358     0.3351 0.000 0.616 0.000 0.008 0.220 0.156
#> GSM955083     1  0.5386     0.4316 0.568 0.004 0.012 0.080 0.336 0.000
#> GSM955084     5  0.0665     0.6464 0.000 0.008 0.000 0.004 0.980 0.008
#> GSM955086     2  0.4281     0.5084 0.004 0.760 0.160 0.052 0.000 0.024
#> GSM955091     6  0.3238     0.5332 0.000 0.120 0.036 0.012 0.000 0.832
#> GSM955092     6  0.5960    -0.0455 0.000 0.396 0.140 0.016 0.000 0.448
#> GSM955093     3  0.1679     0.5775 0.000 0.016 0.936 0.036 0.000 0.012
#> GSM955098     6  0.4700     0.4477 0.000 0.060 0.000 0.340 0.000 0.600
#> GSM955099     6  0.5315     0.2018 0.000 0.360 0.076 0.008 0.004 0.552
#> GSM955100     1  0.4494     0.7222 0.748 0.048 0.012 0.168 0.000 0.024
#> GSM955103     3  0.2933     0.5792 0.000 0.032 0.852 0.008 0.000 0.108
#> GSM955104     3  0.4629     0.4348 0.196 0.008 0.724 0.028 0.000 0.044
#> GSM955106     5  0.1036     0.6466 0.000 0.004 0.024 0.008 0.964 0.000
#> GSM955000     1  0.1636     0.8439 0.936 0.000 0.004 0.036 0.000 0.024
#> GSM955006     1  0.2569     0.8187 0.880 0.004 0.012 0.092 0.000 0.012
#> GSM955007     3  0.4468     0.5457 0.000 0.180 0.724 0.088 0.004 0.004
#> GSM955010     4  0.5554     0.3458 0.088 0.000 0.404 0.492 0.000 0.016
#> GSM955014     1  0.2586     0.8284 0.868 0.000 0.000 0.100 0.000 0.032
#> GSM955018     3  0.5230     0.4752 0.052 0.156 0.708 0.016 0.000 0.068
#> GSM955020     1  0.0146     0.8399 0.996 0.000 0.000 0.004 0.000 0.000
#> GSM955024     3  0.4136     0.5511 0.000 0.168 0.748 0.080 0.004 0.000
#> GSM955026     6  0.5108     0.4824 0.004 0.088 0.000 0.324 0.000 0.584
#> GSM955031     2  0.7537    -0.0838 0.208 0.320 0.000 0.164 0.000 0.308
#> GSM955038     1  0.8308    -0.1196 0.280 0.028 0.004 0.252 0.200 0.236
#> GSM955040     4  0.4615     0.3891 0.240 0.020 0.020 0.700 0.000 0.020
#> GSM955044     6  0.7552    -0.0457 0.000 0.012 0.100 0.316 0.232 0.340
#> GSM955051     1  0.2344     0.8352 0.892 0.004 0.000 0.076 0.000 0.028
#> GSM955055     2  0.3094     0.4891 0.000 0.860 0.060 0.032 0.000 0.048
#> GSM955057     1  0.1989     0.8410 0.916 0.028 0.000 0.052 0.000 0.004
#> GSM955062     2  0.5808     0.0422 0.000 0.464 0.108 0.020 0.000 0.408
#> GSM955063     3  0.2833     0.5887 0.000 0.088 0.864 0.040 0.000 0.008
#> GSM955068     6  0.5141     0.4504 0.000 0.148 0.000 0.108 0.048 0.696
#> GSM955069     3  0.3054     0.5880 0.020 0.068 0.868 0.032 0.000 0.012
#> GSM955070     4  0.5963     0.5508 0.000 0.072 0.280 0.588 0.032 0.028
#> GSM955071     1  0.7485    -0.1861 0.340 0.008 0.104 0.324 0.000 0.224
#> GSM955077     2  0.7291     0.0910 0.212 0.440 0.004 0.216 0.000 0.128
#> GSM955080     5  0.5791     0.1387 0.000 0.400 0.092 0.020 0.484 0.004
#> GSM955081     6  0.5530     0.4528 0.000 0.160 0.132 0.052 0.000 0.656
#> GSM955082     3  0.6642    -0.0826 0.000 0.356 0.428 0.044 0.004 0.168
#> GSM955085     2  0.6132     0.0223 0.000 0.476 0.012 0.136 0.012 0.364
#> GSM955090     1  0.2919     0.8322 0.876 0.008 0.000 0.060 0.032 0.024
#> GSM955094     4  0.5698     0.5844 0.000 0.164 0.148 0.644 0.036 0.008
#> GSM955096     2  0.6049     0.3064 0.000 0.468 0.340 0.012 0.000 0.180
#> GSM955102     3  0.3850     0.5230 0.080 0.036 0.808 0.076 0.000 0.000
#> GSM955105     2  0.6463     0.2458 0.128 0.488 0.336 0.028 0.000 0.020

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

consensus_heatmap(res, k = 2)

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

consensus_heatmap(res, k = 3)

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

consensus_heatmap(res, k = 4)

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

consensus_heatmap(res, k = 5)

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

consensus_heatmap(res, k = 6)

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

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

membership_heatmap(res, k = 2)

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

membership_heatmap(res, k = 3)

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

membership_heatmap(res, k = 4)

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

membership_heatmap(res, k = 5)

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

membership_heatmap(res, k = 6)

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

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

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

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

get_signatures(res, k = 3)

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

get_signatures(res, k = 4)

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

get_signatures(res, k = 5)

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

get_signatures(res, k = 6)

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

Signature heatmaps where rows are not scaled:

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

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

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

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

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

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

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

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

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

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

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk CV-NMF-signature_compare

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

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

An example of the output of tb is:

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

The columns in tb are:

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

UMAP plot which shows how samples are separated.

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

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

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

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

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

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

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

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

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

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

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk CV-NMF-collect-classes

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

test_to_known_factors(res)
#>          n genotype/variation(p) k
#> CV:NMF 101                 0.299 2
#> CV:NMF  93                 0.581 3
#> CV:NMF  90                 0.653 4
#> CV:NMF  68                 0.696 5
#> CV:NMF  52                 0.439 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 31589 rows and 108 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'MAD' method.
#>   Subgroups are detected by 'hclust' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 3.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

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

collect_plots(res)

plot of chunk MAD-hclust-collect-plots

The plots are:

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

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

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

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

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.719           0.849       0.934         0.3346 0.707   0.707
#> 3 3 0.302           0.638       0.791         0.8344 0.641   0.497
#> 4 4 0.348           0.533       0.712         0.1398 0.918   0.783
#> 5 5 0.419           0.486       0.668         0.0875 0.890   0.668
#> 6 6 0.490           0.435       0.645         0.0531 0.927   0.718

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

suggest_best_k(res)
#> [1] 3

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

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

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>           class entropy silhouette    p1    p2
#> GSM955002     2  0.3431     0.8919 0.064 0.936
#> GSM955008     2  0.0000     0.9290 0.000 1.000
#> GSM955016     1  0.9732     0.2980 0.596 0.404
#> GSM955019     2  0.0000     0.9290 0.000 1.000
#> GSM955022     2  0.0000     0.9290 0.000 1.000
#> GSM955023     2  0.0000     0.9290 0.000 1.000
#> GSM955027     2  0.0000     0.9290 0.000 1.000
#> GSM955043     2  0.0000     0.9290 0.000 1.000
#> GSM955048     1  0.0000     0.9129 1.000 0.000
#> GSM955049     2  0.0000     0.9290 0.000 1.000
#> GSM955054     2  0.0000     0.9290 0.000 1.000
#> GSM955064     2  0.0000     0.9290 0.000 1.000
#> GSM955072     2  0.0000     0.9290 0.000 1.000
#> GSM955075     2  0.0376     0.9279 0.004 0.996
#> GSM955079     2  0.1184     0.9238 0.016 0.984
#> GSM955087     1  0.0000     0.9129 1.000 0.000
#> GSM955088     2  0.2043     0.9159 0.032 0.968
#> GSM955089     1  0.0000     0.9129 1.000 0.000
#> GSM955095     2  0.0672     0.9272 0.008 0.992
#> GSM955097     2  0.1184     0.9242 0.016 0.984
#> GSM955101     2  0.0000     0.9290 0.000 1.000
#> GSM954999     2  0.9977     0.1343 0.472 0.528
#> GSM955001     2  0.0376     0.9279 0.004 0.996
#> GSM955003     2  0.0000     0.9290 0.000 1.000
#> GSM955004     2  0.0376     0.9282 0.004 0.996
#> GSM955005     2  0.7453     0.7366 0.212 0.788
#> GSM955009     2  0.0000     0.9290 0.000 1.000
#> GSM955011     2  0.9815     0.3151 0.420 0.580
#> GSM955012     2  0.0000     0.9290 0.000 1.000
#> GSM955013     2  0.3431     0.8944 0.064 0.936
#> GSM955015     2  0.0000     0.9290 0.000 1.000
#> GSM955017     1  0.6048     0.8038 0.852 0.148
#> GSM955021     2  0.0000     0.9290 0.000 1.000
#> GSM955025     2  0.1184     0.9244 0.016 0.984
#> GSM955028     1  0.0000     0.9129 1.000 0.000
#> GSM955029     2  0.0000     0.9290 0.000 1.000
#> GSM955030     2  0.8327     0.6594 0.264 0.736
#> GSM955032     2  0.0938     0.9254 0.012 0.988
#> GSM955033     2  0.5629     0.8297 0.132 0.868
#> GSM955034     1  0.0000     0.9129 1.000 0.000
#> GSM955035     2  0.0000     0.9290 0.000 1.000
#> GSM955036     2  0.1184     0.9239 0.016 0.984
#> GSM955037     2  0.9000     0.5579 0.316 0.684
#> GSM955039     2  0.3274     0.8957 0.060 0.940
#> GSM955041     2  0.0000     0.9290 0.000 1.000
#> GSM955042     2  0.9996     0.0702 0.488 0.512
#> GSM955045     2  0.0000     0.9290 0.000 1.000
#> GSM955046     2  0.1184     0.9239 0.016 0.984
#> GSM955047     1  0.1414     0.9080 0.980 0.020
#> GSM955050     2  0.8608     0.6289 0.284 0.716
#> GSM955052     2  0.0000     0.9290 0.000 1.000
#> GSM955053     1  0.0000     0.9129 1.000 0.000
#> GSM955056     2  0.0000     0.9290 0.000 1.000
#> GSM955058     2  0.0000     0.9290 0.000 1.000
#> GSM955059     2  0.0000     0.9290 0.000 1.000
#> GSM955060     1  0.5408     0.8287 0.876 0.124
#> GSM955061     2  0.0000     0.9290 0.000 1.000
#> GSM955065     1  0.0000     0.9129 1.000 0.000
#> GSM955066     2  0.4431     0.8724 0.092 0.908
#> GSM955067     1  0.0938     0.9116 0.988 0.012
#> GSM955073     2  0.0000     0.9290 0.000 1.000
#> GSM955074     1  0.7883     0.6826 0.764 0.236
#> GSM955076     2  0.0000     0.9290 0.000 1.000
#> GSM955078     2  0.0000     0.9290 0.000 1.000
#> GSM955083     2  0.8555     0.6349 0.280 0.720
#> GSM955084     2  0.0000     0.9290 0.000 1.000
#> GSM955086     2  0.3584     0.8910 0.068 0.932
#> GSM955091     2  0.0000     0.9290 0.000 1.000
#> GSM955092     2  0.0000     0.9290 0.000 1.000
#> GSM955093     2  0.0000     0.9290 0.000 1.000
#> GSM955098     2  0.0000     0.9290 0.000 1.000
#> GSM955099     2  0.0000     0.9290 0.000 1.000
#> GSM955100     2  0.9170     0.5400 0.332 0.668
#> GSM955103     2  0.0376     0.9282 0.004 0.996
#> GSM955104     2  0.2948     0.9042 0.052 0.948
#> GSM955106     2  0.0938     0.9261 0.012 0.988
#> GSM955000     2  0.9686     0.3637 0.396 0.604
#> GSM955006     1  0.9775     0.2658 0.588 0.412
#> GSM955007     2  0.0376     0.9280 0.004 0.996
#> GSM955010     2  0.7528     0.7349 0.216 0.784
#> GSM955014     1  0.0672     0.9126 0.992 0.008
#> GSM955018     2  0.1184     0.9238 0.016 0.984
#> GSM955020     1  0.1414     0.9081 0.980 0.020
#> GSM955024     2  0.0000     0.9290 0.000 1.000
#> GSM955026     2  0.0000     0.9290 0.000 1.000
#> GSM955031     2  0.8555     0.6375 0.280 0.720
#> GSM955038     2  0.9209     0.5206 0.336 0.664
#> GSM955040     2  0.8661     0.6222 0.288 0.712
#> GSM955044     2  0.0000     0.9290 0.000 1.000
#> GSM955051     1  0.0672     0.9125 0.992 0.008
#> GSM955055     2  0.0000     0.9290 0.000 1.000
#> GSM955057     1  0.0000     0.9129 1.000 0.000
#> GSM955062     2  0.0000     0.9290 0.000 1.000
#> GSM955063     2  0.0000     0.9290 0.000 1.000
#> GSM955068     2  0.0000     0.9290 0.000 1.000
#> GSM955069     2  0.2236     0.9135 0.036 0.964
#> GSM955070     2  0.1184     0.9238 0.016 0.984
#> GSM955071     2  0.8081     0.6858 0.248 0.752
#> GSM955077     2  0.4431     0.8660 0.092 0.908
#> GSM955080     2  0.0938     0.9257 0.012 0.988
#> GSM955081     2  0.0376     0.9281 0.004 0.996
#> GSM955082     2  0.0000     0.9290 0.000 1.000
#> GSM955085     2  0.0000     0.9290 0.000 1.000
#> GSM955090     1  0.0376     0.9130 0.996 0.004
#> GSM955094     2  0.1184     0.9242 0.016 0.984
#> GSM955096     2  0.0000     0.9290 0.000 1.000
#> GSM955102     2  0.2423     0.9108 0.040 0.960
#> GSM955105     2  0.1184     0.9238 0.016 0.984

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1    p2    p3
#> GSM955002     2  0.7945     0.0785 0.064 0.548 0.388
#> GSM955008     3  0.4178     0.7074 0.000 0.172 0.828
#> GSM955016     1  0.8915     0.3953 0.572 0.216 0.212
#> GSM955019     2  0.3412     0.7742 0.000 0.876 0.124
#> GSM955022     3  0.5058     0.6812 0.000 0.244 0.756
#> GSM955023     3  0.5058     0.6812 0.000 0.244 0.756
#> GSM955027     2  0.2261     0.8106 0.000 0.932 0.068
#> GSM955043     2  0.1964     0.8113 0.000 0.944 0.056
#> GSM955048     1  0.0237     0.8565 0.996 0.000 0.004
#> GSM955049     3  0.6126     0.4769 0.000 0.400 0.600
#> GSM955054     3  0.6260     0.3452 0.000 0.448 0.552
#> GSM955064     3  0.6154     0.4294 0.000 0.408 0.592
#> GSM955072     2  0.1529     0.8075 0.000 0.960 0.040
#> GSM955075     2  0.2356     0.8079 0.000 0.928 0.072
#> GSM955079     3  0.3771     0.7157 0.012 0.112 0.876
#> GSM955087     1  0.0237     0.8569 0.996 0.000 0.004
#> GSM955088     3  0.5455     0.7031 0.020 0.204 0.776
#> GSM955089     1  0.0237     0.8569 0.996 0.000 0.004
#> GSM955095     2  0.5588     0.5541 0.004 0.720 0.276
#> GSM955097     2  0.2229     0.8074 0.012 0.944 0.044
#> GSM955101     3  0.6095     0.4575 0.000 0.392 0.608
#> GSM954999     1  0.9734     0.1100 0.448 0.292 0.260
#> GSM955001     2  0.5016     0.6363 0.000 0.760 0.240
#> GSM955003     3  0.6126     0.4749 0.000 0.400 0.600
#> GSM955004     2  0.0237     0.7988 0.000 0.996 0.004
#> GSM955005     3  0.7495     0.6355 0.188 0.120 0.692
#> GSM955009     2  0.0424     0.8022 0.000 0.992 0.008
#> GSM955011     3  0.9433     0.1717 0.404 0.176 0.420
#> GSM955012     2  0.1163     0.8123 0.000 0.972 0.028
#> GSM955013     3  0.7794     0.5126 0.060 0.368 0.572
#> GSM955015     3  0.5882     0.5465 0.000 0.348 0.652
#> GSM955017     1  0.4663     0.7489 0.828 0.016 0.156
#> GSM955021     2  0.5497     0.5378 0.000 0.708 0.292
#> GSM955025     2  0.4059     0.7657 0.012 0.860 0.128
#> GSM955028     1  0.0237     0.8569 0.996 0.000 0.004
#> GSM955029     2  0.1163     0.8123 0.000 0.972 0.028
#> GSM955030     3  0.7421     0.5596 0.240 0.084 0.676
#> GSM955032     3  0.4963     0.7087 0.008 0.200 0.792
#> GSM955033     3  0.8915     0.3303 0.124 0.404 0.472
#> GSM955034     1  0.0237     0.8569 0.996 0.000 0.004
#> GSM955035     2  0.6299    -0.0739 0.000 0.524 0.476
#> GSM955036     3  0.2537     0.7090 0.000 0.080 0.920
#> GSM955037     3  0.6229     0.4489 0.280 0.020 0.700
#> GSM955039     3  0.6836     0.6657 0.056 0.240 0.704
#> GSM955041     3  0.6008     0.5055 0.000 0.372 0.628
#> GSM955042     1  0.9663     0.1536 0.464 0.280 0.256
#> GSM955045     2  0.6244     0.0126 0.000 0.560 0.440
#> GSM955046     3  0.2537     0.7090 0.000 0.080 0.920
#> GSM955047     1  0.1482     0.8509 0.968 0.012 0.020
#> GSM955050     3  0.9775     0.3795 0.272 0.288 0.440
#> GSM955052     3  0.4178     0.7074 0.000 0.172 0.828
#> GSM955053     1  0.0237     0.8569 0.996 0.000 0.004
#> GSM955056     3  0.4887     0.6916 0.000 0.228 0.772
#> GSM955058     2  0.1163     0.8123 0.000 0.972 0.028
#> GSM955059     3  0.4887     0.6914 0.000 0.228 0.772
#> GSM955060     1  0.4277     0.7707 0.852 0.016 0.132
#> GSM955061     2  0.1163     0.8123 0.000 0.972 0.028
#> GSM955065     1  0.0237     0.8569 0.996 0.000 0.004
#> GSM955066     3  0.4887     0.7069 0.060 0.096 0.844
#> GSM955067     1  0.1015     0.8557 0.980 0.012 0.008
#> GSM955073     3  0.1753     0.6977 0.000 0.048 0.952
#> GSM955074     1  0.6719     0.6652 0.744 0.160 0.096
#> GSM955076     2  0.1411     0.8050 0.000 0.964 0.036
#> GSM955078     2  0.1163     0.8119 0.000 0.972 0.028
#> GSM955083     2  0.9647     0.0391 0.264 0.468 0.268
#> GSM955084     2  0.0000     0.8008 0.000 1.000 0.000
#> GSM955086     3  0.6062     0.7140 0.064 0.160 0.776
#> GSM955091     2  0.3340     0.7777 0.000 0.880 0.120
#> GSM955092     3  0.5905     0.5685 0.000 0.352 0.648
#> GSM955093     3  0.2066     0.7010 0.000 0.060 0.940
#> GSM955098     2  0.1163     0.8014 0.000 0.972 0.028
#> GSM955099     2  0.1860     0.8113 0.000 0.948 0.052
#> GSM955100     3  0.9502     0.3831 0.308 0.212 0.480
#> GSM955103     3  0.5070     0.7024 0.004 0.224 0.772
#> GSM955104     3  0.4489     0.7179 0.036 0.108 0.856
#> GSM955106     2  0.4963     0.6914 0.008 0.792 0.200
#> GSM955000     3  0.7209     0.2899 0.360 0.036 0.604
#> GSM955006     1  0.8674     0.3113 0.568 0.136 0.296
#> GSM955007     3  0.3551     0.7148 0.000 0.132 0.868
#> GSM955010     3  0.8907     0.5442 0.200 0.228 0.572
#> GSM955014     1  0.0848     0.8564 0.984 0.008 0.008
#> GSM955018     3  0.3989     0.7182 0.012 0.124 0.864
#> GSM955020     1  0.1337     0.8541 0.972 0.012 0.016
#> GSM955024     3  0.6154     0.4610 0.000 0.408 0.592
#> GSM955026     2  0.1163     0.8014 0.000 0.972 0.028
#> GSM955031     3  0.9796     0.3712 0.264 0.304 0.432
#> GSM955038     2  0.8134     0.3399 0.328 0.584 0.088
#> GSM955040     3  0.9772     0.3650 0.268 0.292 0.440
#> GSM955044     2  0.1860     0.8136 0.000 0.948 0.052
#> GSM955051     1  0.0747     0.8550 0.984 0.000 0.016
#> GSM955055     2  0.2448     0.8051 0.000 0.924 0.076
#> GSM955057     1  0.0000     0.8564 1.000 0.000 0.000
#> GSM955062     2  0.5254     0.5947 0.000 0.736 0.264
#> GSM955063     3  0.2066     0.7035 0.000 0.060 0.940
#> GSM955068     2  0.1031     0.8008 0.000 0.976 0.024
#> GSM955069     3  0.3207     0.7134 0.012 0.084 0.904
#> GSM955070     2  0.5956     0.5518 0.016 0.720 0.264
#> GSM955071     3  0.9474     0.4604 0.232 0.272 0.496
#> GSM955077     2  0.4725     0.7460 0.088 0.852 0.060
#> GSM955080     2  0.3213     0.7994 0.008 0.900 0.092
#> GSM955081     3  0.6209     0.5496 0.004 0.368 0.628
#> GSM955082     3  0.5733     0.6085 0.000 0.324 0.676
#> GSM955085     2  0.2625     0.8028 0.000 0.916 0.084
#> GSM955090     1  0.0661     0.8556 0.988 0.004 0.008
#> GSM955094     2  0.5884     0.5381 0.012 0.716 0.272
#> GSM955096     3  0.4750     0.6976 0.000 0.216 0.784
#> GSM955102     3  0.1399     0.6865 0.004 0.028 0.968
#> GSM955105     3  0.3918     0.7175 0.012 0.120 0.868

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM955002     2  0.8678    -0.1298 0.032 0.352 0.304 0.312
#> GSM955008     3  0.3278     0.6491 0.000 0.116 0.864 0.020
#> GSM955016     4  0.8128     0.2128 0.400 0.060 0.100 0.440
#> GSM955019     2  0.4773     0.7054 0.000 0.788 0.120 0.092
#> GSM955022     3  0.4937     0.6370 0.000 0.172 0.764 0.064
#> GSM955023     3  0.4937     0.6370 0.000 0.172 0.764 0.064
#> GSM955027     2  0.3621     0.7298 0.000 0.860 0.068 0.072
#> GSM955043     2  0.3706     0.7237 0.000 0.848 0.040 0.112
#> GSM955048     1  0.1902     0.8032 0.932 0.000 0.004 0.064
#> GSM955049     3  0.5614     0.4690 0.000 0.336 0.628 0.036
#> GSM955054     3  0.6663     0.3876 0.000 0.344 0.556 0.100
#> GSM955064     3  0.6351     0.4237 0.000 0.332 0.588 0.080
#> GSM955072     2  0.5713     0.6082 0.000 0.620 0.040 0.340
#> GSM955075     2  0.4144     0.7068 0.000 0.828 0.068 0.104
#> GSM955079     3  0.3266     0.6176 0.004 0.032 0.880 0.084
#> GSM955087     1  0.0188     0.8077 0.996 0.000 0.000 0.004
#> GSM955088     3  0.5707     0.6056 0.004 0.144 0.728 0.124
#> GSM955089     1  0.0469     0.8080 0.988 0.000 0.000 0.012
#> GSM955095     2  0.6269     0.5085 0.000 0.632 0.272 0.096
#> GSM955097     2  0.3962     0.6740 0.000 0.820 0.028 0.152
#> GSM955101     3  0.6179     0.4526 0.000 0.320 0.608 0.072
#> GSM954999     4  0.8517     0.5193 0.260 0.100 0.124 0.516
#> GSM955001     2  0.5998     0.5834 0.000 0.668 0.240 0.092
#> GSM955003     3  0.6194     0.5150 0.000 0.288 0.628 0.084
#> GSM955004     2  0.2868     0.6891 0.000 0.864 0.000 0.136
#> GSM955005     3  0.7842     0.2952 0.148 0.056 0.584 0.212
#> GSM955009     2  0.3443     0.7026 0.000 0.848 0.016 0.136
#> GSM955011     1  0.8927    -0.5262 0.336 0.048 0.304 0.312
#> GSM955012     2  0.3037     0.7068 0.000 0.880 0.020 0.100
#> GSM955013     3  0.7606     0.3999 0.012 0.260 0.536 0.192
#> GSM955015     3  0.5859     0.5336 0.000 0.284 0.652 0.064
#> GSM955017     1  0.5186     0.6104 0.752 0.000 0.084 0.164
#> GSM955021     2  0.6319     0.4532 0.000 0.604 0.312 0.084
#> GSM955025     2  0.5964     0.6485 0.000 0.676 0.096 0.228
#> GSM955028     1  0.0188     0.8077 0.996 0.000 0.000 0.004
#> GSM955029     2  0.3037     0.7068 0.000 0.880 0.020 0.100
#> GSM955030     3  0.7575     0.1663 0.192 0.016 0.556 0.236
#> GSM955032     3  0.4790     0.6355 0.004 0.104 0.796 0.096
#> GSM955033     4  0.8694     0.2405 0.052 0.196 0.340 0.412
#> GSM955034     1  0.0188     0.8077 0.996 0.000 0.000 0.004
#> GSM955035     3  0.6653     0.0966 0.000 0.436 0.480 0.084
#> GSM955036     3  0.4098     0.5685 0.000 0.012 0.784 0.204
#> GSM955037     3  0.6833     0.1576 0.272 0.000 0.584 0.144
#> GSM955039     3  0.6654     0.4680 0.032 0.088 0.668 0.212
#> GSM955041     3  0.6121     0.4853 0.000 0.308 0.620 0.072
#> GSM955042     4  0.8478     0.4973 0.272 0.092 0.124 0.512
#> GSM955045     2  0.6393    -0.0555 0.000 0.480 0.456 0.064
#> GSM955046     3  0.4059     0.5702 0.000 0.012 0.788 0.200
#> GSM955047     1  0.2593     0.7830 0.892 0.000 0.004 0.104
#> GSM955050     4  0.9239     0.5071 0.180 0.112 0.300 0.408
#> GSM955052     3  0.3278     0.6491 0.000 0.116 0.864 0.020
#> GSM955053     1  0.0188     0.8077 0.996 0.000 0.000 0.004
#> GSM955056     3  0.4322     0.6471 0.000 0.152 0.804 0.044
#> GSM955058     2  0.3037     0.7068 0.000 0.880 0.020 0.100
#> GSM955059     3  0.5011     0.6411 0.000 0.160 0.764 0.076
#> GSM955060     1  0.4731     0.6552 0.780 0.000 0.060 0.160
#> GSM955061     2  0.3037     0.7068 0.000 0.880 0.020 0.100
#> GSM955065     1  0.0188     0.8077 0.996 0.000 0.000 0.004
#> GSM955066     3  0.5750     0.4651 0.024 0.028 0.688 0.260
#> GSM955067     1  0.3257     0.7662 0.844 0.000 0.004 0.152
#> GSM955073     3  0.1706     0.6237 0.000 0.016 0.948 0.036
#> GSM955074     1  0.6662     0.3813 0.608 0.060 0.024 0.308
#> GSM955076     2  0.5882     0.5934 0.000 0.608 0.048 0.344
#> GSM955078     2  0.3307     0.7241 0.000 0.868 0.028 0.104
#> GSM955083     4  0.8987     0.4010 0.100 0.300 0.160 0.440
#> GSM955084     2  0.2647     0.7073 0.000 0.880 0.000 0.120
#> GSM955086     3  0.5439     0.5832 0.028 0.064 0.768 0.140
#> GSM955091     2  0.4780     0.7077 0.000 0.788 0.116 0.096
#> GSM955092     3  0.5498     0.5739 0.000 0.272 0.680 0.048
#> GSM955093     3  0.1888     0.6228 0.000 0.016 0.940 0.044
#> GSM955098     2  0.5839     0.5778 0.000 0.604 0.044 0.352
#> GSM955099     2  0.3463     0.7255 0.000 0.864 0.040 0.096
#> GSM955100     4  0.8951     0.4769 0.216 0.064 0.336 0.384
#> GSM955103     3  0.4624     0.6436 0.000 0.164 0.784 0.052
#> GSM955104     3  0.4569     0.5961 0.016 0.036 0.808 0.140
#> GSM955106     2  0.5889     0.6330 0.000 0.696 0.188 0.116
#> GSM955000     3  0.7449    -0.0977 0.332 0.000 0.480 0.188
#> GSM955006     1  0.8117    -0.2032 0.512 0.036 0.180 0.272
#> GSM955007     3  0.4168     0.6381 0.000 0.080 0.828 0.092
#> GSM955010     3  0.8355    -0.2807 0.112 0.068 0.428 0.392
#> GSM955014     1  0.3157     0.7699 0.852 0.000 0.004 0.144
#> GSM955018     3  0.3382     0.6243 0.004 0.040 0.876 0.080
#> GSM955020     1  0.2589     0.7874 0.884 0.000 0.000 0.116
#> GSM955024     3  0.6156     0.4392 0.000 0.344 0.592 0.064
#> GSM955026     2  0.5790     0.5884 0.000 0.616 0.044 0.340
#> GSM955031     3  0.9504    -0.2877 0.188 0.140 0.376 0.296
#> GSM955038     4  0.7858     0.3730 0.152 0.240 0.044 0.564
#> GSM955040     4  0.9227     0.5175 0.172 0.116 0.300 0.412
#> GSM955044     2  0.4152     0.7160 0.000 0.808 0.032 0.160
#> GSM955051     1  0.2401     0.7969 0.904 0.000 0.004 0.092
#> GSM955055     2  0.4359     0.7199 0.000 0.816 0.084 0.100
#> GSM955057     1  0.0592     0.8076 0.984 0.000 0.000 0.016
#> GSM955062     2  0.6138     0.5463 0.000 0.648 0.260 0.092
#> GSM955063     3  0.2197     0.6277 0.000 0.024 0.928 0.048
#> GSM955068     2  0.5677     0.5983 0.000 0.628 0.040 0.332
#> GSM955069     3  0.4233     0.6256 0.008 0.044 0.828 0.120
#> GSM955070     2  0.7170     0.4238 0.000 0.548 0.184 0.268
#> GSM955071     3  0.9224    -0.3954 0.160 0.116 0.368 0.356
#> GSM955077     2  0.6772     0.6059 0.076 0.676 0.056 0.192
#> GSM955080     2  0.4656     0.6865 0.000 0.784 0.056 0.160
#> GSM955081     3  0.5791     0.5585 0.000 0.284 0.656 0.060
#> GSM955082     3  0.5143     0.5920 0.000 0.256 0.708 0.036
#> GSM955085     2  0.5110     0.7059 0.000 0.764 0.104 0.132
#> GSM955090     1  0.2469     0.7819 0.892 0.000 0.000 0.108
#> GSM955094     2  0.7001     0.4468 0.000 0.576 0.180 0.244
#> GSM955096     3  0.3913     0.6450 0.000 0.148 0.824 0.028
#> GSM955102     3  0.3610     0.5382 0.000 0.000 0.800 0.200
#> GSM955105     3  0.3556     0.6152 0.004 0.036 0.864 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
#> GSM955002     4  0.8441     0.1360 0.004 0.184 0.184 0.380 0.248
#> GSM955008     3  0.3201     0.6344 0.000 0.060 0.872 0.024 0.044
#> GSM955016     4  0.6163     0.2995 0.268 0.072 0.012 0.620 0.028
#> GSM955019     5  0.6231     0.3739 0.000 0.292 0.132 0.012 0.564
#> GSM955022     3  0.5702     0.6267 0.000 0.072 0.708 0.096 0.124
#> GSM955023     3  0.5702     0.6267 0.000 0.072 0.708 0.096 0.124
#> GSM955027     5  0.5074     0.4255 0.000 0.268 0.072 0.000 0.660
#> GSM955043     5  0.4915     0.5092 0.000 0.192 0.048 0.028 0.732
#> GSM955048     1  0.2848     0.8498 0.868 0.028 0.000 0.104 0.000
#> GSM955049     3  0.6248     0.5146 0.000 0.120 0.620 0.036 0.224
#> GSM955054     3  0.6968     0.4038 0.000 0.188 0.540 0.044 0.228
#> GSM955064     3  0.6279     0.4213 0.000 0.108 0.596 0.032 0.264
#> GSM955072     2  0.5287     0.5506 0.000 0.648 0.028 0.032 0.292
#> GSM955075     5  0.3165     0.5544 0.000 0.044 0.048 0.032 0.876
#> GSM955079     3  0.3873     0.5733 0.004 0.024 0.808 0.152 0.012
#> GSM955087     1  0.0290     0.8592 0.992 0.000 0.000 0.008 0.000
#> GSM955088     3  0.6793     0.5119 0.004 0.104 0.588 0.236 0.068
#> GSM955089     1  0.0451     0.8593 0.988 0.008 0.000 0.004 0.000
#> GSM955095     5  0.6180     0.3963 0.000 0.052 0.228 0.088 0.632
#> GSM955097     5  0.2459     0.4940 0.000 0.040 0.004 0.052 0.904
#> GSM955101     3  0.6221     0.4427 0.000 0.100 0.608 0.036 0.256
#> GSM954999     4  0.6287     0.4916 0.124 0.124 0.020 0.680 0.052
#> GSM955001     5  0.7098     0.2815 0.000 0.236 0.240 0.032 0.492
#> GSM955003     3  0.6020     0.5394 0.000 0.160 0.644 0.024 0.172
#> GSM955004     5  0.2388     0.5069 0.000 0.072 0.000 0.028 0.900
#> GSM955005     3  0.7774    -0.1206 0.136 0.048 0.396 0.392 0.028
#> GSM955009     2  0.4746     0.1474 0.000 0.504 0.016 0.000 0.480
#> GSM955011     4  0.7369     0.5545 0.236 0.064 0.128 0.552 0.020
#> GSM955012     5  0.0613     0.5507 0.000 0.004 0.008 0.004 0.984
#> GSM955013     3  0.7872     0.3018 0.008 0.068 0.444 0.240 0.240
#> GSM955015     3  0.6279     0.5204 0.000 0.120 0.628 0.044 0.208
#> GSM955017     1  0.4887     0.6474 0.692 0.048 0.008 0.252 0.000
#> GSM955021     5  0.7027     0.1024 0.000 0.300 0.312 0.008 0.380
#> GSM955025     2  0.7165     0.2527 0.000 0.432 0.060 0.120 0.388
#> GSM955028     1  0.0290     0.8592 0.992 0.000 0.000 0.008 0.000
#> GSM955029     5  0.0613     0.5507 0.000 0.004 0.008 0.004 0.984
#> GSM955030     4  0.7303     0.1714 0.176 0.044 0.360 0.420 0.000
#> GSM955032     3  0.5330     0.6066 0.004 0.088 0.744 0.108 0.056
#> GSM955033     4  0.7155     0.4449 0.004 0.116 0.152 0.584 0.144
#> GSM955034     1  0.0290     0.8592 0.992 0.000 0.000 0.008 0.000
#> GSM955035     3  0.7017     0.0962 0.000 0.144 0.472 0.040 0.344
#> GSM955036     3  0.5579     0.3604 0.000 0.064 0.580 0.348 0.008
#> GSM955037     3  0.7363    -0.1316 0.272 0.028 0.388 0.312 0.000
#> GSM955039     3  0.6757     0.2550 0.004 0.060 0.520 0.344 0.072
#> GSM955041     3  0.5987     0.4684 0.000 0.088 0.628 0.032 0.252
#> GSM955042     4  0.6260     0.4766 0.136 0.116 0.020 0.680 0.048
#> GSM955045     3  0.6475     0.0792 0.000 0.092 0.444 0.028 0.436
#> GSM955046     3  0.5566     0.3627 0.000 0.064 0.584 0.344 0.008
#> GSM955047     1  0.3438     0.7973 0.808 0.020 0.000 0.172 0.000
#> GSM955050     4  0.6936     0.5968 0.076 0.100 0.116 0.652 0.056
#> GSM955052     3  0.3201     0.6344 0.000 0.060 0.872 0.024 0.044
#> GSM955053     1  0.0000     0.8580 1.000 0.000 0.000 0.000 0.000
#> GSM955056     3  0.4420     0.6378 0.000 0.080 0.800 0.040 0.080
#> GSM955058     5  0.0613     0.5507 0.000 0.004 0.008 0.004 0.984
#> GSM955059     3  0.5758     0.6269 0.000 0.072 0.704 0.116 0.108
#> GSM955060     1  0.4441     0.6913 0.720 0.044 0.000 0.236 0.000
#> GSM955061     5  0.0613     0.5507 0.000 0.004 0.008 0.004 0.984
#> GSM955065     1  0.0290     0.8592 0.992 0.000 0.000 0.008 0.000
#> GSM955066     3  0.6347     0.1207 0.024 0.064 0.464 0.440 0.008
#> GSM955067     1  0.4294     0.8041 0.768 0.080 0.000 0.152 0.000
#> GSM955073     3  0.1954     0.6072 0.000 0.032 0.932 0.028 0.008
#> GSM955074     1  0.6152     0.4008 0.548 0.068 0.000 0.352 0.032
#> GSM955076     2  0.4411     0.6275 0.000 0.756 0.024 0.024 0.196
#> GSM955078     5  0.4890     0.3678 0.000 0.332 0.040 0.000 0.628
#> GSM955083     4  0.8525     0.2921 0.056 0.144 0.092 0.444 0.264
#> GSM955084     5  0.3300     0.4244 0.000 0.204 0.000 0.004 0.792
#> GSM955086     3  0.5827     0.5120 0.020 0.068 0.688 0.196 0.028
#> GSM955091     5  0.6194     0.3803 0.000 0.292 0.128 0.012 0.568
#> GSM955092     3  0.5957     0.5927 0.000 0.132 0.668 0.040 0.160
#> GSM955093     3  0.2694     0.6060 0.000 0.032 0.888 0.076 0.004
#> GSM955098     2  0.4235     0.6341 0.000 0.776 0.024 0.024 0.176
#> GSM955099     5  0.5228     0.4512 0.000 0.260 0.048 0.020 0.672
#> GSM955100     4  0.6355     0.6020 0.104 0.052 0.136 0.680 0.028
#> GSM955103     3  0.5143     0.6306 0.000 0.036 0.740 0.088 0.136
#> GSM955104     3  0.5077     0.5012 0.012 0.020 0.688 0.260 0.020
#> GSM955106     5  0.5514     0.4705 0.000 0.052 0.156 0.080 0.712
#> GSM955000     4  0.7629     0.2799 0.332 0.044 0.284 0.340 0.000
#> GSM955006     4  0.7043     0.2558 0.424 0.048 0.076 0.436 0.016
#> GSM955007     3  0.4871     0.6049 0.000 0.052 0.764 0.128 0.056
#> GSM955010     4  0.6308     0.4980 0.048 0.048 0.192 0.668 0.044
#> GSM955014     1  0.4197     0.8092 0.776 0.076 0.000 0.148 0.000
#> GSM955018     3  0.3912     0.5794 0.004 0.032 0.812 0.140 0.012
#> GSM955020     1  0.2853     0.8412 0.876 0.072 0.000 0.052 0.000
#> GSM955024     3  0.6073     0.4646 0.000 0.068 0.588 0.036 0.308
#> GSM955026     2  0.4684     0.6291 0.000 0.740 0.024 0.036 0.200
#> GSM955031     4  0.8653     0.3141 0.096 0.240 0.284 0.352 0.028
#> GSM955038     2  0.6761    -0.2092 0.032 0.444 0.016 0.436 0.072
#> GSM955040     4  0.6833     0.5974 0.068 0.092 0.120 0.660 0.060
#> GSM955044     5  0.5062     0.4425 0.000 0.244 0.044 0.020 0.692
#> GSM955051     1  0.3037     0.8496 0.860 0.040 0.000 0.100 0.000
#> GSM955055     5  0.5737     0.1341 0.000 0.396 0.076 0.004 0.524
#> GSM955057     1  0.1341     0.8568 0.944 0.000 0.000 0.056 0.000
#> GSM955062     5  0.7080     0.2654 0.000 0.236 0.252 0.028 0.484
#> GSM955063     3  0.2788     0.6115 0.000 0.040 0.888 0.064 0.008
#> GSM955068     2  0.4208     0.6325 0.000 0.760 0.016 0.020 0.204
#> GSM955069     3  0.4844     0.5543 0.004 0.036 0.720 0.224 0.016
#> GSM955070     5  0.8025     0.1245 0.000 0.220 0.116 0.244 0.420
#> GSM955071     4  0.7916     0.5241 0.068 0.092 0.208 0.544 0.088
#> GSM955077     2  0.7424     0.3818 0.024 0.452 0.036 0.124 0.364
#> GSM955080     5  0.4143     0.5432 0.000 0.060 0.048 0.072 0.820
#> GSM955081     3  0.6295     0.5753 0.000 0.104 0.644 0.068 0.184
#> GSM955082     3  0.5542     0.6035 0.000 0.104 0.704 0.036 0.156
#> GSM955085     5  0.6347    -0.0403 0.000 0.408 0.088 0.024 0.480
#> GSM955090     1  0.2974     0.8301 0.868 0.052 0.000 0.080 0.000
#> GSM955094     5  0.7560     0.2592 0.000 0.192 0.088 0.228 0.492
#> GSM955096     3  0.4498     0.6281 0.000 0.092 0.796 0.056 0.056
#> GSM955102     3  0.5314     0.3066 0.004 0.044 0.548 0.404 0.000
#> GSM955105     3  0.4009     0.5700 0.004 0.028 0.792 0.168 0.008

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM955002     4  0.8792     0.1803 0.000 0.196 0.116 0.268 0.188 0.232
#> GSM955008     3  0.2959     0.5741 0.000 0.060 0.872 0.004 0.036 0.028
#> GSM955016     4  0.4804     0.3726 0.184 0.008 0.004 0.712 0.008 0.084
#> GSM955019     5  0.6370     0.1856 0.000 0.372 0.116 0.008 0.464 0.040
#> GSM955022     3  0.5600     0.5495 0.000 0.056 0.676 0.012 0.112 0.144
#> GSM955023     3  0.5600     0.5495 0.000 0.056 0.676 0.012 0.112 0.144
#> GSM955027     5  0.5607     0.3351 0.000 0.300 0.060 0.016 0.596 0.028
#> GSM955043     5  0.5055     0.4897 0.000 0.212 0.032 0.016 0.692 0.048
#> GSM955048     1  0.3457     0.7843 0.808 0.004 0.000 0.136 0.000 0.052
#> GSM955049     3  0.5865     0.5035 0.000 0.132 0.620 0.004 0.196 0.048
#> GSM955054     3  0.7186     0.4185 0.000 0.188 0.492 0.020 0.208 0.092
#> GSM955064     3  0.6576     0.4548 0.000 0.144 0.548 0.008 0.224 0.076
#> GSM955072     2  0.4832     0.5157 0.000 0.696 0.028 0.032 0.228 0.016
#> GSM955075     5  0.3172     0.5660 0.000 0.032 0.044 0.020 0.868 0.036
#> GSM955079     3  0.4042     0.4260 0.004 0.004 0.760 0.060 0.000 0.172
#> GSM955087     1  0.0508     0.8037 0.984 0.000 0.000 0.012 0.000 0.004
#> GSM955088     3  0.6557     0.2477 0.000 0.064 0.492 0.040 0.052 0.352
#> GSM955089     1  0.0622     0.8031 0.980 0.000 0.000 0.012 0.000 0.008
#> GSM955095     5  0.6298     0.3789 0.000 0.064 0.204 0.036 0.612 0.084
#> GSM955097     5  0.2547     0.5294 0.000 0.020 0.004 0.064 0.892 0.020
#> GSM955101     3  0.6548     0.4731 0.000 0.140 0.556 0.008 0.216 0.080
#> GSM954999     4  0.3887     0.4342 0.040 0.012 0.004 0.812 0.020 0.112
#> GSM955001     5  0.7123     0.1312 0.000 0.280 0.208 0.020 0.440 0.052
#> GSM955003     3  0.5846     0.5362 0.000 0.176 0.628 0.012 0.152 0.032
#> GSM955004     5  0.3150     0.5174 0.000 0.088 0.000 0.060 0.844 0.008
#> GSM955005     6  0.7547     0.4306 0.116 0.024 0.280 0.112 0.012 0.456
#> GSM955009     2  0.4984     0.4250 0.000 0.624 0.020 0.020 0.316 0.020
#> GSM955011     4  0.7505     0.2255 0.180 0.020 0.080 0.384 0.004 0.332
#> GSM955012     5  0.0870     0.5705 0.000 0.012 0.004 0.012 0.972 0.000
#> GSM955013     3  0.8169     0.1387 0.000 0.056 0.388 0.168 0.208 0.180
#> GSM955015     3  0.6804     0.4876 0.000 0.116 0.556 0.020 0.196 0.112
#> GSM955017     1  0.5223     0.6234 0.648 0.008 0.004 0.132 0.000 0.208
#> GSM955021     2  0.7034     0.1189 0.000 0.384 0.296 0.020 0.272 0.028
#> GSM955025     2  0.7215     0.3834 0.000 0.488 0.036 0.096 0.268 0.112
#> GSM955028     1  0.0508     0.8037 0.984 0.000 0.000 0.012 0.000 0.004
#> GSM955029     5  0.0870     0.5705 0.000 0.012 0.004 0.012 0.972 0.000
#> GSM955030     6  0.6999     0.4177 0.156 0.000 0.240 0.132 0.000 0.472
#> GSM955032     3  0.5541     0.4980 0.004 0.056 0.704 0.044 0.048 0.144
#> GSM955033     4  0.7472     0.2692 0.000 0.088 0.048 0.400 0.112 0.352
#> GSM955034     1  0.0508     0.8037 0.984 0.000 0.000 0.012 0.000 0.004
#> GSM955035     3  0.7111     0.1761 0.000 0.160 0.424 0.008 0.320 0.088
#> GSM955036     6  0.5043     0.3725 0.000 0.008 0.332 0.052 0.008 0.600
#> GSM955037     6  0.6931     0.4080 0.268 0.008 0.204 0.060 0.000 0.460
#> GSM955039     3  0.7456    -0.1453 0.000 0.048 0.412 0.216 0.044 0.280
#> GSM955041     3  0.6499     0.4852 0.000 0.104 0.568 0.012 0.224 0.092
#> GSM955042     4  0.3989     0.4332 0.052 0.012 0.004 0.808 0.020 0.104
#> GSM955045     3  0.6320     0.1491 0.000 0.088 0.428 0.004 0.420 0.060
#> GSM955046     6  0.5056     0.3726 0.000 0.008 0.336 0.052 0.008 0.596
#> GSM955047     1  0.4519     0.7270 0.736 0.020 0.000 0.152 0.000 0.092
#> GSM955050     4  0.6893     0.3989 0.016 0.088 0.052 0.468 0.020 0.356
#> GSM955052     3  0.2959     0.5741 0.000 0.060 0.872 0.004 0.036 0.028
#> GSM955053     1  0.0291     0.8029 0.992 0.000 0.000 0.004 0.000 0.004
#> GSM955056     3  0.4072     0.5728 0.000 0.080 0.800 0.004 0.044 0.072
#> GSM955058     5  0.0870     0.5705 0.000 0.012 0.004 0.012 0.972 0.000
#> GSM955059     3  0.5566     0.5344 0.000 0.056 0.668 0.008 0.096 0.172
#> GSM955060     1  0.4915     0.6585 0.676 0.008 0.000 0.128 0.000 0.188
#> GSM955061     5  0.0870     0.5705 0.000 0.012 0.004 0.012 0.972 0.000
#> GSM955065     1  0.0508     0.8037 0.984 0.000 0.000 0.012 0.000 0.004
#> GSM955066     6  0.5479     0.4509 0.016 0.008 0.296 0.084 0.000 0.596
#> GSM955067     1  0.4400     0.7400 0.708 0.012 0.000 0.228 0.000 0.052
#> GSM955073     3  0.2845     0.4929 0.000 0.000 0.836 0.008 0.008 0.148
#> GSM955074     1  0.5433     0.2548 0.464 0.012 0.000 0.460 0.012 0.052
#> GSM955076     2  0.3184     0.6014 0.000 0.856 0.016 0.032 0.084 0.012
#> GSM955078     5  0.5286     0.2946 0.000 0.372 0.020 0.016 0.560 0.032
#> GSM955083     4  0.7083     0.2820 0.020 0.032 0.032 0.520 0.244 0.152
#> GSM955084     5  0.4106     0.2834 0.000 0.312 0.000 0.020 0.664 0.004
#> GSM955086     3  0.5818     0.3149 0.012 0.048 0.644 0.120 0.000 0.176
#> GSM955091     5  0.6306     0.2075 0.000 0.372 0.108 0.008 0.472 0.040
#> GSM955092     3  0.5695     0.5457 0.000 0.132 0.660 0.004 0.132 0.072
#> GSM955093     3  0.3073     0.4828 0.000 0.000 0.816 0.016 0.004 0.164
#> GSM955098     2  0.2635     0.5982 0.000 0.892 0.016 0.036 0.048 0.008
#> GSM955099     5  0.5523     0.4074 0.000 0.292 0.028 0.016 0.608 0.056
#> GSM955100     4  0.6343     0.3367 0.036 0.024 0.068 0.464 0.004 0.404
#> GSM955103     3  0.5616     0.5367 0.000 0.028 0.684 0.040 0.120 0.128
#> GSM955104     3  0.5535     0.0880 0.004 0.000 0.580 0.108 0.012 0.296
#> GSM955106     5  0.5473     0.4787 0.000 0.048 0.152 0.044 0.700 0.056
#> GSM955000     6  0.6729     0.3370 0.320 0.000 0.152 0.076 0.000 0.452
#> GSM955006     1  0.7272    -0.2568 0.380 0.020 0.044 0.336 0.004 0.216
#> GSM955007     3  0.5613     0.4176 0.000 0.024 0.632 0.032 0.060 0.252
#> GSM955010     6  0.6554    -0.2792 0.020 0.016 0.088 0.412 0.024 0.440
#> GSM955014     1  0.4348     0.7448 0.716 0.012 0.000 0.220 0.000 0.052
#> GSM955018     3  0.4034     0.4354 0.004 0.008 0.764 0.052 0.000 0.172
#> GSM955020     1  0.2699     0.7787 0.856 0.008 0.000 0.124 0.000 0.012
#> GSM955024     3  0.6158     0.4934 0.000 0.072 0.564 0.008 0.280 0.076
#> GSM955026     2  0.3262     0.5939 0.000 0.852 0.016 0.052 0.072 0.008
#> GSM955031     6  0.7957    -0.0448 0.016 0.168 0.248 0.268 0.000 0.300
#> GSM955038     4  0.4694     0.3089 0.000 0.352 0.008 0.608 0.016 0.016
#> GSM955040     4  0.6607     0.3910 0.008 0.064 0.060 0.472 0.020 0.376
#> GSM955044     5  0.5210     0.4307 0.000 0.256 0.016 0.020 0.652 0.056
#> GSM955051     1  0.3416     0.7921 0.820 0.012 0.000 0.124 0.000 0.044
#> GSM955055     2  0.6215     0.1446 0.000 0.468 0.068 0.024 0.404 0.036
#> GSM955057     1  0.1924     0.7996 0.920 0.004 0.000 0.048 0.000 0.028
#> GSM955062     5  0.7078     0.1104 0.000 0.284 0.212 0.016 0.436 0.052
#> GSM955063     3  0.3448     0.4854 0.000 0.008 0.788 0.008 0.008 0.188
#> GSM955068     2  0.3003     0.6053 0.000 0.868 0.016 0.028 0.076 0.012
#> GSM955069     3  0.5301     0.2207 0.000 0.024 0.620 0.044 0.016 0.296
#> GSM955070     5  0.8263     0.0724 0.000 0.256 0.052 0.168 0.340 0.184
#> GSM955071     4  0.7675     0.3004 0.016 0.060 0.136 0.412 0.044 0.332
#> GSM955077     2  0.6856     0.4770 0.000 0.556 0.032 0.108 0.208 0.096
#> GSM955080     5  0.4070     0.5612 0.000 0.052 0.032 0.052 0.816 0.048
#> GSM955081     3  0.6209     0.5282 0.000 0.120 0.632 0.024 0.148 0.076
#> GSM955082     3  0.5172     0.5538 0.000 0.108 0.704 0.004 0.136 0.048
#> GSM955085     2  0.6561     0.1516 0.000 0.436 0.080 0.028 0.408 0.048
#> GSM955090     1  0.3209     0.7553 0.816 0.012 0.000 0.156 0.000 0.016
#> GSM955094     5  0.7409     0.2591 0.000 0.184 0.032 0.076 0.448 0.260
#> GSM955096     3  0.4166     0.5578 0.000 0.072 0.796 0.008 0.040 0.084
#> GSM955102     6  0.4952     0.4581 0.004 0.008 0.320 0.056 0.000 0.612
#> GSM955105     3  0.3943     0.4383 0.004 0.000 0.756 0.056 0.000 0.184

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

consensus_heatmap(res, k = 2)

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

consensus_heatmap(res, k = 3)

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

consensus_heatmap(res, k = 4)

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

consensus_heatmap(res, k = 5)

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

consensus_heatmap(res, k = 6)

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

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

membership_heatmap(res, k = 2)

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

membership_heatmap(res, k = 3)

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

membership_heatmap(res, k = 4)

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

membership_heatmap(res, k = 5)

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

membership_heatmap(res, k = 6)

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

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

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

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

get_signatures(res, k = 3)

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

get_signatures(res, k = 4)

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

get_signatures(res, k = 5)

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

get_signatures(res, k = 6)

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

Signature heatmaps where rows are not scaled:

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

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

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

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

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

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

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

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

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

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

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk MAD-hclust-signature_compare

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

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

An example of the output of tb is:

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

The columns in tb are:

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

UMAP plot which shows how samples are separated.

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

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

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

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

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

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

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

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

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

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

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk MAD-hclust-collect-classes

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

test_to_known_factors(res)
#>              n genotype/variation(p) k
#> MAD:hclust 102                 0.973 2
#> MAD:hclust  84                 0.965 3
#> MAD:hclust  77                 0.978 4
#> MAD:hclust  60                 0.939 5
#> MAD:hclust  42                 0.920 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 31589 rows and 108 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.923           0.936       0.970         0.3780 0.651   0.651
#> 3 3 0.783           0.915       0.938         0.7202 0.695   0.531
#> 4 4 0.586           0.615       0.795         0.1375 0.892   0.702
#> 5 5 0.599           0.529       0.711         0.0699 0.889   0.619
#> 6 6 0.614           0.480       0.676         0.0443 0.907   0.602

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
#> GSM955002     2  0.0000      0.961 0.000 1.000
#> GSM955008     2  0.0000      0.961 0.000 1.000
#> GSM955016     1  0.0000      1.000 1.000 0.000
#> GSM955019     2  0.0000      0.961 0.000 1.000
#> GSM955022     2  0.0000      0.961 0.000 1.000
#> GSM955023     2  0.0000      0.961 0.000 1.000
#> GSM955027     2  0.0000      0.961 0.000 1.000
#> GSM955043     2  0.0000      0.961 0.000 1.000
#> GSM955048     1  0.0000      1.000 1.000 0.000
#> GSM955049     2  0.0000      0.961 0.000 1.000
#> GSM955054     2  0.0000      0.961 0.000 1.000
#> GSM955064     2  0.0000      0.961 0.000 1.000
#> GSM955072     2  0.0000      0.961 0.000 1.000
#> GSM955075     2  0.0000      0.961 0.000 1.000
#> GSM955079     2  0.0000      0.961 0.000 1.000
#> GSM955087     1  0.0000      1.000 1.000 0.000
#> GSM955088     2  0.0376      0.958 0.004 0.996
#> GSM955089     1  0.0000      1.000 1.000 0.000
#> GSM955095     2  0.0000      0.961 0.000 1.000
#> GSM955097     2  0.0000      0.961 0.000 1.000
#> GSM955101     2  0.0000      0.961 0.000 1.000
#> GSM954999     2  0.7674      0.736 0.224 0.776
#> GSM955001     2  0.0000      0.961 0.000 1.000
#> GSM955003     2  0.0000      0.961 0.000 1.000
#> GSM955004     2  0.0000      0.961 0.000 1.000
#> GSM955005     2  0.0000      0.961 0.000 1.000
#> GSM955009     2  0.0000      0.961 0.000 1.000
#> GSM955011     1  0.0000      1.000 1.000 0.000
#> GSM955012     2  0.0000      0.961 0.000 1.000
#> GSM955013     2  0.0000      0.961 0.000 1.000
#> GSM955015     2  0.0000      0.961 0.000 1.000
#> GSM955017     1  0.0000      1.000 1.000 0.000
#> GSM955021     2  0.0000      0.961 0.000 1.000
#> GSM955025     2  0.0000      0.961 0.000 1.000
#> GSM955028     1  0.0000      1.000 1.000 0.000
#> GSM955029     2  0.0000      0.961 0.000 1.000
#> GSM955030     2  0.9209      0.555 0.336 0.664
#> GSM955032     2  0.0000      0.961 0.000 1.000
#> GSM955033     2  0.3879      0.900 0.076 0.924
#> GSM955034     1  0.0000      1.000 1.000 0.000
#> GSM955035     2  0.0000      0.961 0.000 1.000
#> GSM955036     2  0.7299      0.761 0.204 0.796
#> GSM955037     1  0.0000      1.000 1.000 0.000
#> GSM955039     2  0.0000      0.961 0.000 1.000
#> GSM955041     2  0.0000      0.961 0.000 1.000
#> GSM955042     1  0.0000      1.000 1.000 0.000
#> GSM955045     2  0.0000      0.961 0.000 1.000
#> GSM955046     2  0.0000      0.961 0.000 1.000
#> GSM955047     1  0.0000      1.000 1.000 0.000
#> GSM955050     2  0.8608      0.648 0.284 0.716
#> GSM955052     2  0.0000      0.961 0.000 1.000
#> GSM955053     1  0.0000      1.000 1.000 0.000
#> GSM955056     2  0.0000      0.961 0.000 1.000
#> GSM955058     2  0.0000      0.961 0.000 1.000
#> GSM955059     2  0.0672      0.955 0.008 0.992
#> GSM955060     1  0.0000      1.000 1.000 0.000
#> GSM955061     2  0.0000      0.961 0.000 1.000
#> GSM955065     1  0.0000      1.000 1.000 0.000
#> GSM955066     2  0.8861      0.614 0.304 0.696
#> GSM955067     1  0.0000      1.000 1.000 0.000
#> GSM955073     2  0.0000      0.961 0.000 1.000
#> GSM955074     1  0.0000      1.000 1.000 0.000
#> GSM955076     2  0.0000      0.961 0.000 1.000
#> GSM955078     2  0.0000      0.961 0.000 1.000
#> GSM955083     2  0.3879      0.900 0.076 0.924
#> GSM955084     2  0.0000      0.961 0.000 1.000
#> GSM955086     2  0.0376      0.958 0.004 0.996
#> GSM955091     2  0.0000      0.961 0.000 1.000
#> GSM955092     2  0.0000      0.961 0.000 1.000
#> GSM955093     2  0.0000      0.961 0.000 1.000
#> GSM955098     2  0.0000      0.961 0.000 1.000
#> GSM955099     2  0.0000      0.961 0.000 1.000
#> GSM955100     1  0.0000      1.000 1.000 0.000
#> GSM955103     2  0.0000      0.961 0.000 1.000
#> GSM955104     2  0.3274      0.915 0.060 0.940
#> GSM955106     2  0.0000      0.961 0.000 1.000
#> GSM955000     1  0.0000      1.000 1.000 0.000
#> GSM955006     1  0.0000      1.000 1.000 0.000
#> GSM955007     2  0.0000      0.961 0.000 1.000
#> GSM955010     2  0.9209      0.555 0.336 0.664
#> GSM955014     1  0.0000      1.000 1.000 0.000
#> GSM955018     2  0.0000      0.961 0.000 1.000
#> GSM955020     1  0.0000      1.000 1.000 0.000
#> GSM955024     2  0.0000      0.961 0.000 1.000
#> GSM955026     2  0.0000      0.961 0.000 1.000
#> GSM955031     2  0.2423      0.931 0.040 0.960
#> GSM955038     2  0.8327      0.658 0.264 0.736
#> GSM955040     2  0.8763      0.628 0.296 0.704
#> GSM955044     2  0.0000      0.961 0.000 1.000
#> GSM955051     1  0.0000      1.000 1.000 0.000
#> GSM955055     2  0.0000      0.961 0.000 1.000
#> GSM955057     1  0.0000      1.000 1.000 0.000
#> GSM955062     2  0.0000      0.961 0.000 1.000
#> GSM955063     2  0.0000      0.961 0.000 1.000
#> GSM955068     2  0.0000      0.961 0.000 1.000
#> GSM955069     2  0.1843      0.941 0.028 0.972
#> GSM955070     2  0.0000      0.961 0.000 1.000
#> GSM955071     2  0.8267      0.685 0.260 0.740
#> GSM955077     2  0.0000      0.961 0.000 1.000
#> GSM955080     2  0.0000      0.961 0.000 1.000
#> GSM955081     2  0.0000      0.961 0.000 1.000
#> GSM955082     2  0.0000      0.961 0.000 1.000
#> GSM955085     2  0.0000      0.961 0.000 1.000
#> GSM955090     1  0.0000      1.000 1.000 0.000
#> GSM955094     2  0.0000      0.961 0.000 1.000
#> GSM955096     2  0.0000      0.961 0.000 1.000
#> GSM955102     2  0.9795      0.371 0.416 0.584
#> GSM955105     2  0.0672      0.955 0.008 0.992

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1    p2    p3
#> GSM955002     3  0.5327      0.748 0.000 0.272 0.728
#> GSM955008     3  0.4062      0.871 0.000 0.164 0.836
#> GSM955016     1  0.2866      0.939 0.916 0.008 0.076
#> GSM955019     2  0.0747      0.945 0.000 0.984 0.016
#> GSM955022     3  0.2261      0.920 0.000 0.068 0.932
#> GSM955023     3  0.3038      0.907 0.000 0.104 0.896
#> GSM955027     2  0.0892      0.945 0.000 0.980 0.020
#> GSM955043     2  0.1163      0.945 0.000 0.972 0.028
#> GSM955048     1  0.0000      0.978 1.000 0.000 0.000
#> GSM955049     2  0.1289      0.944 0.000 0.968 0.032
#> GSM955054     3  0.3941      0.884 0.000 0.156 0.844
#> GSM955064     2  0.1964      0.940 0.000 0.944 0.056
#> GSM955072     2  0.0237      0.943 0.000 0.996 0.004
#> GSM955075     2  0.1411      0.942 0.000 0.964 0.036
#> GSM955079     3  0.1529      0.922 0.000 0.040 0.960
#> GSM955087     1  0.0237      0.978 0.996 0.000 0.004
#> GSM955088     3  0.1163      0.922 0.000 0.028 0.972
#> GSM955089     1  0.0000      0.978 1.000 0.000 0.000
#> GSM955095     2  0.3879      0.845 0.000 0.848 0.152
#> GSM955097     2  0.2959      0.903 0.000 0.900 0.100
#> GSM955101     3  0.4178      0.866 0.000 0.172 0.828
#> GSM954999     3  0.1774      0.906 0.024 0.016 0.960
#> GSM955001     2  0.0747      0.945 0.000 0.984 0.016
#> GSM955003     3  0.4504      0.850 0.000 0.196 0.804
#> GSM955004     2  0.0592      0.941 0.000 0.988 0.012
#> GSM955005     3  0.0424      0.917 0.000 0.008 0.992
#> GSM955009     2  0.0747      0.945 0.000 0.984 0.016
#> GSM955011     1  0.2625      0.937 0.916 0.000 0.084
#> GSM955012     2  0.1753      0.939 0.000 0.952 0.048
#> GSM955013     3  0.0892      0.914 0.000 0.020 0.980
#> GSM955015     3  0.4291      0.868 0.000 0.180 0.820
#> GSM955017     1  0.1163      0.970 0.972 0.000 0.028
#> GSM955021     2  0.0747      0.945 0.000 0.984 0.016
#> GSM955025     2  0.0983      0.941 0.004 0.980 0.016
#> GSM955028     1  0.0237      0.978 0.996 0.000 0.004
#> GSM955029     2  0.1289      0.944 0.000 0.968 0.032
#> GSM955030     3  0.1170      0.908 0.016 0.008 0.976
#> GSM955032     3  0.2356      0.920 0.000 0.072 0.928
#> GSM955033     3  0.4629      0.808 0.004 0.188 0.808
#> GSM955034     1  0.0237      0.978 0.996 0.000 0.004
#> GSM955035     2  0.1289      0.943 0.000 0.968 0.032
#> GSM955036     3  0.0747      0.912 0.000 0.016 0.984
#> GSM955037     1  0.2878      0.930 0.904 0.000 0.096
#> GSM955039     3  0.1964      0.914 0.000 0.056 0.944
#> GSM955041     2  0.4750      0.738 0.000 0.784 0.216
#> GSM955042     1  0.2866      0.939 0.916 0.008 0.076
#> GSM955045     2  0.2356      0.923 0.000 0.928 0.072
#> GSM955046     3  0.0747      0.917 0.000 0.016 0.984
#> GSM955047     1  0.0000      0.978 1.000 0.000 0.000
#> GSM955050     3  0.4925      0.853 0.076 0.080 0.844
#> GSM955052     3  0.2711      0.911 0.000 0.088 0.912
#> GSM955053     1  0.0237      0.978 0.996 0.000 0.004
#> GSM955056     3  0.3116      0.906 0.000 0.108 0.892
#> GSM955058     2  0.1529      0.942 0.000 0.960 0.040
#> GSM955059     3  0.0592      0.917 0.000 0.012 0.988
#> GSM955060     1  0.0000      0.978 1.000 0.000 0.000
#> GSM955061     2  0.1529      0.942 0.000 0.960 0.040
#> GSM955065     1  0.0237      0.978 0.996 0.000 0.004
#> GSM955066     3  0.0983      0.912 0.016 0.004 0.980
#> GSM955067     1  0.0237      0.977 0.996 0.000 0.004
#> GSM955073     3  0.2537      0.915 0.000 0.080 0.920
#> GSM955074     1  0.1989      0.958 0.948 0.004 0.048
#> GSM955076     2  0.2711      0.895 0.000 0.912 0.088
#> GSM955078     2  0.0424      0.946 0.000 0.992 0.008
#> GSM955083     3  0.4473      0.826 0.008 0.164 0.828
#> GSM955084     2  0.0592      0.941 0.000 0.988 0.012
#> GSM955086     3  0.1411      0.921 0.000 0.036 0.964
#> GSM955091     2  0.0747      0.945 0.000 0.984 0.016
#> GSM955092     2  0.1753      0.937 0.000 0.952 0.048
#> GSM955093     3  0.0747      0.919 0.000 0.016 0.984
#> GSM955098     2  0.0747      0.943 0.000 0.984 0.016
#> GSM955099     2  0.0424      0.946 0.000 0.992 0.008
#> GSM955100     1  0.2625      0.937 0.916 0.000 0.084
#> GSM955103     3  0.4504      0.836 0.000 0.196 0.804
#> GSM955104     3  0.0592      0.914 0.000 0.012 0.988
#> GSM955106     2  0.2165      0.925 0.000 0.936 0.064
#> GSM955000     1  0.1411      0.967 0.964 0.000 0.036
#> GSM955006     1  0.0000      0.978 1.000 0.000 0.000
#> GSM955007     3  0.2711      0.913 0.000 0.088 0.912
#> GSM955010     3  0.1950      0.899 0.040 0.008 0.952
#> GSM955014     1  0.0000      0.978 1.000 0.000 0.000
#> GSM955018     3  0.0747      0.919 0.000 0.016 0.984
#> GSM955020     1  0.0000      0.978 1.000 0.000 0.000
#> GSM955024     3  0.3192      0.902 0.000 0.112 0.888
#> GSM955026     2  0.0747      0.943 0.000 0.984 0.016
#> GSM955031     3  0.3112      0.904 0.004 0.096 0.900
#> GSM955038     2  0.8261      0.314 0.340 0.568 0.092
#> GSM955040     3  0.5085      0.841 0.092 0.072 0.836
#> GSM955044     2  0.0424      0.944 0.000 0.992 0.008
#> GSM955051     1  0.0000      0.978 1.000 0.000 0.000
#> GSM955055     2  0.0747      0.945 0.000 0.984 0.016
#> GSM955057     1  0.0000      0.978 1.000 0.000 0.000
#> GSM955062     2  0.0892      0.945 0.000 0.980 0.020
#> GSM955063     3  0.2537      0.915 0.000 0.080 0.920
#> GSM955068     2  0.0424      0.942 0.000 0.992 0.008
#> GSM955069     3  0.0424      0.917 0.000 0.008 0.992
#> GSM955070     2  0.1529      0.936 0.000 0.960 0.040
#> GSM955071     3  0.2383      0.899 0.044 0.016 0.940
#> GSM955077     2  0.2200      0.912 0.004 0.940 0.056
#> GSM955080     2  0.1964      0.932 0.000 0.944 0.056
#> GSM955081     3  0.4452      0.849 0.000 0.192 0.808
#> GSM955082     2  0.5621      0.586 0.000 0.692 0.308
#> GSM955085     2  0.0424      0.946 0.000 0.992 0.008
#> GSM955090     1  0.0000      0.978 1.000 0.000 0.000
#> GSM955094     2  0.3116      0.886 0.000 0.892 0.108
#> GSM955096     3  0.3038      0.908 0.000 0.104 0.896
#> GSM955102     3  0.0983      0.913 0.016 0.004 0.980
#> GSM955105     3  0.1289      0.921 0.000 0.032 0.968

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM955002     4  0.6834    0.31993 0.000 0.164 0.240 0.596
#> GSM955008     3  0.2335    0.72900 0.000 0.060 0.920 0.020
#> GSM955016     4  0.5016    0.15513 0.396 0.000 0.004 0.600
#> GSM955019     2  0.5184    0.70239 0.000 0.732 0.056 0.212
#> GSM955022     3  0.3377    0.68308 0.000 0.012 0.848 0.140
#> GSM955023     3  0.2224    0.74201 0.000 0.032 0.928 0.040
#> GSM955027     2  0.2021    0.76582 0.000 0.936 0.040 0.024
#> GSM955043     2  0.1510    0.75896 0.000 0.956 0.016 0.028
#> GSM955048     1  0.0336    0.89899 0.992 0.000 0.000 0.008
#> GSM955049     2  0.6400    0.62687 0.000 0.632 0.252 0.116
#> GSM955054     3  0.5494    0.56385 0.000 0.076 0.716 0.208
#> GSM955064     2  0.6366    0.63665 0.000 0.640 0.240 0.120
#> GSM955072     2  0.4507    0.70969 0.000 0.756 0.020 0.224
#> GSM955075     2  0.2227    0.75529 0.000 0.928 0.036 0.036
#> GSM955079     3  0.1488    0.74087 0.000 0.012 0.956 0.032
#> GSM955087     1  0.0000    0.89910 1.000 0.000 0.000 0.000
#> GSM955088     3  0.1576    0.73325 0.000 0.004 0.948 0.048
#> GSM955089     1  0.0000    0.89910 1.000 0.000 0.000 0.000
#> GSM955095     2  0.4782    0.67062 0.000 0.780 0.068 0.152
#> GSM955097     2  0.4914    0.50520 0.000 0.676 0.012 0.312
#> GSM955101     3  0.3621    0.69968 0.000 0.068 0.860 0.072
#> GSM954999     4  0.4634    0.49949 0.004 0.004 0.280 0.712
#> GSM955001     2  0.2385    0.76802 0.000 0.920 0.028 0.052
#> GSM955003     3  0.5750    0.54261 0.000 0.088 0.696 0.216
#> GSM955004     2  0.1940    0.74399 0.000 0.924 0.000 0.076
#> GSM955005     3  0.4643    0.34966 0.000 0.000 0.656 0.344
#> GSM955009     2  0.3450    0.74522 0.000 0.836 0.008 0.156
#> GSM955011     1  0.5408    0.34069 0.576 0.000 0.016 0.408
#> GSM955012     2  0.2032    0.75684 0.000 0.936 0.036 0.028
#> GSM955013     4  0.5097    0.27369 0.000 0.004 0.428 0.568
#> GSM955015     3  0.5167    0.63385 0.000 0.108 0.760 0.132
#> GSM955017     1  0.2255    0.87568 0.920 0.000 0.012 0.068
#> GSM955021     2  0.7399    0.50341 0.000 0.512 0.280 0.208
#> GSM955025     2  0.5097    0.50794 0.000 0.568 0.004 0.428
#> GSM955028     1  0.0000    0.89910 1.000 0.000 0.000 0.000
#> GSM955029     2  0.2032    0.75684 0.000 0.936 0.036 0.028
#> GSM955030     3  0.4948    0.07190 0.000 0.000 0.560 0.440
#> GSM955032     3  0.1584    0.73884 0.000 0.012 0.952 0.036
#> GSM955033     4  0.2813    0.60530 0.000 0.024 0.080 0.896
#> GSM955034     1  0.0000    0.89910 1.000 0.000 0.000 0.000
#> GSM955035     2  0.7122    0.56949 0.000 0.560 0.248 0.192
#> GSM955036     4  0.5112    0.35829 0.000 0.008 0.384 0.608
#> GSM955037     1  0.5182    0.50357 0.684 0.000 0.028 0.288
#> GSM955039     4  0.5127    0.39715 0.000 0.012 0.356 0.632
#> GSM955041     2  0.6211    0.15003 0.000 0.488 0.460 0.052
#> GSM955042     4  0.4955    0.00723 0.444 0.000 0.000 0.556
#> GSM955045     2  0.3581    0.72690 0.000 0.852 0.116 0.032
#> GSM955046     3  0.4500    0.42797 0.000 0.000 0.684 0.316
#> GSM955047     1  0.1557    0.89250 0.944 0.000 0.000 0.056
#> GSM955050     4  0.2111    0.59355 0.000 0.024 0.044 0.932
#> GSM955052     3  0.1151    0.74272 0.000 0.024 0.968 0.008
#> GSM955053     1  0.0000    0.89910 1.000 0.000 0.000 0.000
#> GSM955056     3  0.2300    0.73186 0.000 0.028 0.924 0.048
#> GSM955058     2  0.2032    0.75684 0.000 0.936 0.036 0.028
#> GSM955059     3  0.1867    0.72382 0.000 0.000 0.928 0.072
#> GSM955060     1  0.0592    0.89902 0.984 0.000 0.000 0.016
#> GSM955061     2  0.2032    0.75684 0.000 0.936 0.036 0.028
#> GSM955065     1  0.0000    0.89910 1.000 0.000 0.000 0.000
#> GSM955066     3  0.4477    0.42622 0.000 0.000 0.688 0.312
#> GSM955067     1  0.2408    0.86275 0.896 0.000 0.000 0.104
#> GSM955073     3  0.1297    0.74317 0.000 0.020 0.964 0.016
#> GSM955074     4  0.5080    0.08857 0.420 0.000 0.004 0.576
#> GSM955076     2  0.7551    0.47844 0.000 0.488 0.240 0.272
#> GSM955078     2  0.1109    0.76399 0.000 0.968 0.004 0.028
#> GSM955083     4  0.4139    0.57652 0.000 0.024 0.176 0.800
#> GSM955084     2  0.2530    0.74129 0.000 0.896 0.004 0.100
#> GSM955086     3  0.1635    0.73900 0.000 0.008 0.948 0.044
#> GSM955091     2  0.2611    0.76468 0.000 0.896 0.008 0.096
#> GSM955092     2  0.5636    0.61748 0.000 0.680 0.260 0.060
#> GSM955093     3  0.1398    0.73697 0.000 0.004 0.956 0.040
#> GSM955098     2  0.6276    0.54698 0.000 0.556 0.064 0.380
#> GSM955099     2  0.2676    0.76708 0.000 0.896 0.012 0.092
#> GSM955100     1  0.5511    0.12699 0.500 0.000 0.016 0.484
#> GSM955103     3  0.6350    0.41063 0.000 0.296 0.612 0.092
#> GSM955104     3  0.4972   -0.02298 0.000 0.000 0.544 0.456
#> GSM955106     2  0.3877    0.71696 0.000 0.840 0.048 0.112
#> GSM955000     1  0.2089    0.87165 0.932 0.000 0.020 0.048
#> GSM955006     1  0.1637    0.89127 0.940 0.000 0.000 0.060
#> GSM955007     3  0.2871    0.72667 0.000 0.032 0.896 0.072
#> GSM955010     4  0.5039    0.33472 0.004 0.000 0.404 0.592
#> GSM955014     1  0.1867    0.88691 0.928 0.000 0.000 0.072
#> GSM955018     3  0.1209    0.73800 0.000 0.004 0.964 0.032
#> GSM955020     1  0.0707    0.89760 0.980 0.000 0.000 0.020
#> GSM955024     3  0.4307    0.66122 0.000 0.144 0.808 0.048
#> GSM955026     2  0.6315    0.52559 0.000 0.540 0.064 0.396
#> GSM955031     3  0.6163    0.26308 0.000 0.052 0.532 0.416
#> GSM955038     4  0.3415    0.48155 0.008 0.128 0.008 0.856
#> GSM955040     4  0.2521    0.60352 0.000 0.024 0.064 0.912
#> GSM955044     2  0.3342    0.76638 0.000 0.868 0.032 0.100
#> GSM955051     1  0.1716    0.89033 0.936 0.000 0.000 0.064
#> GSM955055     2  0.2730    0.76679 0.000 0.896 0.016 0.088
#> GSM955057     1  0.0469    0.89851 0.988 0.000 0.000 0.012
#> GSM955062     2  0.6296    0.62785 0.000 0.644 0.244 0.112
#> GSM955063     3  0.1411    0.74339 0.000 0.020 0.960 0.020
#> GSM955068     2  0.5213    0.62987 0.000 0.652 0.020 0.328
#> GSM955069     3  0.3801    0.55738 0.000 0.000 0.780 0.220
#> GSM955070     2  0.6347    0.50154 0.000 0.524 0.064 0.412
#> GSM955071     4  0.4034    0.57961 0.004 0.012 0.180 0.804
#> GSM955077     4  0.5937   -0.41951 0.000 0.472 0.036 0.492
#> GSM955080     2  0.3308    0.73729 0.000 0.872 0.036 0.092
#> GSM955081     3  0.5923    0.53661 0.000 0.100 0.684 0.216
#> GSM955082     3  0.5607   -0.10464 0.000 0.488 0.492 0.020
#> GSM955085     2  0.1302    0.76630 0.000 0.956 0.000 0.044
#> GSM955090     1  0.1637    0.88837 0.940 0.000 0.000 0.060
#> GSM955094     2  0.6064    0.44107 0.000 0.512 0.044 0.444
#> GSM955096     3  0.2224    0.73793 0.000 0.032 0.928 0.040
#> GSM955102     3  0.4820    0.44360 0.012 0.000 0.692 0.296
#> GSM955105     3  0.1635    0.73900 0.000 0.008 0.948 0.044

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM955002     2  0.6483     0.2312 0.000 0.548 0.128 0.300 0.024
#> GSM955008     3  0.3730     0.6694 0.000 0.120 0.828 0.028 0.024
#> GSM955016     4  0.5405     0.5404 0.204 0.136 0.000 0.660 0.000
#> GSM955019     2  0.5251     0.4070 0.000 0.576 0.044 0.004 0.376
#> GSM955022     3  0.5704     0.4887 0.000 0.012 0.616 0.288 0.084
#> GSM955023     3  0.4473     0.6783 0.000 0.096 0.796 0.064 0.044
#> GSM955027     5  0.3769     0.5296 0.000 0.180 0.032 0.000 0.788
#> GSM955043     5  0.0955     0.6349 0.000 0.028 0.000 0.004 0.968
#> GSM955048     1  0.0404     0.8749 0.988 0.012 0.000 0.000 0.000
#> GSM955049     2  0.7016     0.2812 0.000 0.388 0.304 0.008 0.300
#> GSM955054     3  0.5080     0.2935 0.000 0.396 0.572 0.020 0.012
#> GSM955064     5  0.7355    -0.1107 0.000 0.224 0.320 0.036 0.420
#> GSM955072     2  0.4830     0.3216 0.000 0.560 0.016 0.004 0.420
#> GSM955075     5  0.1299     0.6277 0.000 0.012 0.008 0.020 0.960
#> GSM955079     3  0.2912     0.7071 0.000 0.088 0.876 0.028 0.008
#> GSM955087     1  0.0963     0.8707 0.964 0.036 0.000 0.000 0.000
#> GSM955088     3  0.4113     0.6451 0.000 0.076 0.784 0.140 0.000
#> GSM955089     1  0.1399     0.8751 0.952 0.028 0.000 0.020 0.000
#> GSM955095     5  0.3507     0.5509 0.000 0.024 0.032 0.096 0.848
#> GSM955097     5  0.3946     0.4973 0.000 0.048 0.008 0.140 0.804
#> GSM955101     3  0.4552     0.6203 0.000 0.176 0.760 0.040 0.024
#> GSM954999     4  0.2990     0.6942 0.000 0.100 0.024 0.868 0.008
#> GSM955001     5  0.4323     0.4639 0.000 0.240 0.028 0.004 0.728
#> GSM955003     3  0.5094     0.2712 0.000 0.412 0.556 0.008 0.024
#> GSM955004     5  0.2929     0.5548 0.000 0.180 0.000 0.000 0.820
#> GSM955005     4  0.5234    -0.0460 0.000 0.044 0.460 0.496 0.000
#> GSM955009     2  0.5161     0.1186 0.000 0.484 0.024 0.008 0.484
#> GSM955011     4  0.5695     0.3147 0.356 0.080 0.004 0.560 0.000
#> GSM955012     5  0.0451     0.6363 0.000 0.008 0.004 0.000 0.988
#> GSM955013     4  0.5045     0.5807 0.000 0.044 0.180 0.732 0.044
#> GSM955015     3  0.6812     0.3457 0.000 0.288 0.544 0.112 0.056
#> GSM955017     1  0.4028     0.7837 0.808 0.080 0.008 0.104 0.000
#> GSM955021     2  0.6578     0.4218 0.000 0.500 0.268 0.004 0.228
#> GSM955025     2  0.5438     0.4990 0.000 0.660 0.012 0.080 0.248
#> GSM955028     1  0.0963     0.8707 0.964 0.036 0.000 0.000 0.000
#> GSM955029     5  0.0671     0.6362 0.000 0.016 0.004 0.000 0.980
#> GSM955030     4  0.4594     0.4321 0.000 0.036 0.284 0.680 0.000
#> GSM955032     3  0.2813     0.7060 0.000 0.108 0.868 0.024 0.000
#> GSM955033     4  0.3873     0.6743 0.000 0.140 0.024 0.812 0.024
#> GSM955034     1  0.0963     0.8707 0.964 0.036 0.000 0.000 0.000
#> GSM955035     2  0.7218     0.3945 0.000 0.448 0.260 0.028 0.264
#> GSM955036     4  0.3450     0.6390 0.000 0.012 0.096 0.848 0.044
#> GSM955037     1  0.6585    -0.1107 0.452 0.060 0.060 0.428 0.000
#> GSM955039     4  0.5080     0.6071 0.000 0.080 0.156 0.736 0.028
#> GSM955041     5  0.6966    -0.0755 0.000 0.136 0.408 0.036 0.420
#> GSM955042     4  0.5607     0.5041 0.228 0.140 0.000 0.632 0.000
#> GSM955045     5  0.3155     0.5720 0.000 0.020 0.096 0.020 0.864
#> GSM955046     3  0.5754     0.1736 0.000 0.044 0.480 0.456 0.020
#> GSM955047     1  0.2928     0.8545 0.872 0.064 0.000 0.064 0.000
#> GSM955050     4  0.4101     0.5728 0.000 0.332 0.004 0.664 0.000
#> GSM955052     3  0.2243     0.7083 0.000 0.056 0.916 0.016 0.012
#> GSM955053     1  0.0963     0.8707 0.964 0.036 0.000 0.000 0.000
#> GSM955056     3  0.2295     0.6996 0.000 0.088 0.900 0.008 0.004
#> GSM955058     5  0.0566     0.6369 0.000 0.012 0.004 0.000 0.984
#> GSM955059     3  0.4054     0.5879 0.000 0.036 0.760 0.204 0.000
#> GSM955060     1  0.1205     0.8736 0.956 0.040 0.000 0.004 0.000
#> GSM955061     5  0.0451     0.6370 0.000 0.008 0.004 0.000 0.988
#> GSM955065     1  0.0963     0.8707 0.964 0.036 0.000 0.000 0.000
#> GSM955066     3  0.5296     0.0664 0.000 0.048 0.484 0.468 0.000
#> GSM955067     1  0.4123     0.8011 0.788 0.108 0.000 0.104 0.000
#> GSM955073     3  0.2774     0.7081 0.000 0.048 0.892 0.048 0.012
#> GSM955074     4  0.5740     0.4639 0.244 0.144 0.000 0.612 0.000
#> GSM955076     2  0.5268     0.5257 0.000 0.668 0.112 0.000 0.220
#> GSM955078     5  0.3766     0.4448 0.000 0.268 0.004 0.000 0.728
#> GSM955083     4  0.3745     0.6848 0.000 0.132 0.012 0.820 0.036
#> GSM955084     5  0.3661     0.4374 0.000 0.276 0.000 0.000 0.724
#> GSM955086     3  0.3075     0.7015 0.000 0.092 0.860 0.048 0.000
#> GSM955091     5  0.4686     0.1280 0.000 0.384 0.020 0.000 0.596
#> GSM955092     5  0.6783    -0.0456 0.000 0.232 0.340 0.004 0.424
#> GSM955093     3  0.2536     0.7075 0.000 0.044 0.900 0.052 0.004
#> GSM955098     2  0.4747     0.5419 0.000 0.716 0.016 0.036 0.232
#> GSM955099     5  0.4599     0.2092 0.000 0.356 0.020 0.000 0.624
#> GSM955100     4  0.5301     0.4998 0.272 0.076 0.004 0.648 0.000
#> GSM955103     3  0.6659     0.3380 0.000 0.076 0.520 0.060 0.344
#> GSM955104     4  0.4907     0.4330 0.000 0.052 0.292 0.656 0.000
#> GSM955106     5  0.2347     0.6022 0.000 0.016 0.016 0.056 0.912
#> GSM955000     1  0.4103     0.7641 0.812 0.068 0.020 0.100 0.000
#> GSM955006     1  0.3110     0.8485 0.860 0.060 0.000 0.080 0.000
#> GSM955007     3  0.4942     0.6383 0.000 0.032 0.744 0.164 0.060
#> GSM955010     4  0.2824     0.6569 0.000 0.032 0.096 0.872 0.000
#> GSM955014     1  0.3476     0.8357 0.836 0.076 0.000 0.088 0.000
#> GSM955018     3  0.2813     0.7004 0.000 0.064 0.884 0.048 0.004
#> GSM955020     1  0.2659     0.8576 0.888 0.052 0.000 0.060 0.000
#> GSM955024     3  0.5315     0.5963 0.000 0.052 0.716 0.052 0.180
#> GSM955026     2  0.4753     0.5471 0.000 0.736 0.016 0.052 0.196
#> GSM955031     2  0.5282     0.3509 0.004 0.676 0.220 0.100 0.000
#> GSM955038     4  0.5267     0.3676 0.004 0.472 0.004 0.492 0.028
#> GSM955040     4  0.3741     0.6331 0.000 0.264 0.004 0.732 0.000
#> GSM955044     5  0.4870     0.3479 0.000 0.276 0.016 0.028 0.680
#> GSM955051     1  0.3535     0.8350 0.832 0.080 0.000 0.088 0.000
#> GSM955055     5  0.4972     0.2447 0.000 0.352 0.032 0.004 0.612
#> GSM955057     1  0.0404     0.8735 0.988 0.012 0.000 0.000 0.000
#> GSM955062     2  0.7018     0.3304 0.000 0.408 0.244 0.012 0.336
#> GSM955063     3  0.2569     0.7048 0.000 0.032 0.896 0.068 0.004
#> GSM955068     2  0.4483     0.4810 0.000 0.672 0.012 0.008 0.308
#> GSM955069     3  0.4731     0.3984 0.000 0.032 0.640 0.328 0.000
#> GSM955070     2  0.7095     0.4298 0.000 0.520 0.056 0.152 0.272
#> GSM955071     4  0.4457     0.6680 0.004 0.208 0.048 0.740 0.000
#> GSM955077     2  0.5802     0.4778 0.000 0.684 0.040 0.124 0.152
#> GSM955080     5  0.1731     0.6186 0.000 0.012 0.008 0.040 0.940
#> GSM955081     3  0.5809     0.2903 0.000 0.380 0.548 0.044 0.028
#> GSM955082     3  0.6071     0.2120 0.000 0.088 0.512 0.012 0.388
#> GSM955085     5  0.4219     0.4541 0.000 0.264 0.016 0.004 0.716
#> GSM955090     1  0.3648     0.8282 0.824 0.084 0.000 0.092 0.000
#> GSM955094     2  0.7165     0.2582 0.000 0.380 0.016 0.268 0.336
#> GSM955096     3  0.2967     0.6922 0.000 0.104 0.868 0.016 0.012
#> GSM955102     3  0.5314     0.1880 0.000 0.052 0.528 0.420 0.000
#> GSM955105     3  0.2889     0.7014 0.000 0.084 0.872 0.044 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
#> GSM955002     2  0.8016    0.09141 0.000 0.404 0.128 0.208 0.052 0.208
#> GSM955008     3  0.1982    0.54889 0.000 0.068 0.912 0.000 0.004 0.016
#> GSM955016     4  0.1802    0.58328 0.072 0.000 0.000 0.916 0.000 0.012
#> GSM955019     2  0.3877    0.53825 0.000 0.792 0.056 0.008 0.136 0.008
#> GSM955022     6  0.6340    0.31518 0.000 0.012 0.336 0.028 0.132 0.492
#> GSM955023     3  0.5238    0.49325 0.000 0.100 0.704 0.004 0.064 0.128
#> GSM955027     5  0.5946    0.22774 0.000 0.312 0.096 0.000 0.544 0.048
#> GSM955043     5  0.3352    0.67717 0.000 0.108 0.020 0.004 0.836 0.032
#> GSM955048     1  0.1644    0.79757 0.932 0.004 0.000 0.052 0.000 0.012
#> GSM955049     3  0.6865   -0.03309 0.000 0.300 0.416 0.000 0.224 0.060
#> GSM955054     3  0.4819    0.36157 0.000 0.300 0.636 0.004 0.008 0.052
#> GSM955064     3  0.6641    0.09053 0.000 0.192 0.456 0.000 0.300 0.052
#> GSM955072     2  0.4560    0.47276 0.000 0.708 0.012 0.008 0.224 0.048
#> GSM955075     5  0.1129    0.73002 0.000 0.012 0.004 0.008 0.964 0.012
#> GSM955079     3  0.3455    0.49550 0.000 0.020 0.776 0.004 0.000 0.200
#> GSM955087     1  0.2224    0.78763 0.912 0.036 0.004 0.000 0.012 0.036
#> GSM955088     3  0.4931   -0.00281 0.000 0.044 0.484 0.008 0.000 0.464
#> GSM955089     1  0.2918    0.79700 0.868 0.028 0.000 0.084 0.012 0.008
#> GSM955095     5  0.3515    0.66570 0.000 0.024 0.016 0.036 0.840 0.084
#> GSM955097     5  0.2765    0.64609 0.000 0.004 0.000 0.132 0.848 0.016
#> GSM955101     3  0.2476    0.54561 0.000 0.092 0.880 0.000 0.004 0.024
#> GSM954999     4  0.2482    0.58814 0.000 0.000 0.000 0.848 0.004 0.148
#> GSM955001     5  0.5711    0.05703 0.000 0.408 0.052 0.000 0.488 0.052
#> GSM955003     3  0.3886    0.42185 0.000 0.264 0.708 0.000 0.000 0.028
#> GSM955004     5  0.4193    0.46504 0.000 0.276 0.000 0.008 0.688 0.028
#> GSM955005     6  0.4841    0.66488 0.000 0.004 0.156 0.160 0.000 0.680
#> GSM955009     2  0.4309    0.47587 0.000 0.752 0.036 0.004 0.176 0.032
#> GSM955011     4  0.5616    0.42600 0.268 0.016 0.000 0.580 0.000 0.136
#> GSM955012     5  0.1699    0.73284 0.000 0.040 0.012 0.004 0.936 0.008
#> GSM955013     4  0.6943    0.14709 0.000 0.016 0.092 0.400 0.096 0.396
#> GSM955015     3  0.6088    0.31692 0.000 0.252 0.568 0.004 0.040 0.136
#> GSM955017     1  0.4500    0.67964 0.740 0.016 0.004 0.080 0.000 0.160
#> GSM955021     2  0.5847    0.35173 0.000 0.532 0.344 0.000 0.064 0.060
#> GSM955025     2  0.4746    0.52223 0.000 0.764 0.024 0.096 0.060 0.056
#> GSM955028     1  0.2224    0.78763 0.912 0.036 0.004 0.000 0.012 0.036
#> GSM955029     5  0.1820    0.72260 0.000 0.056 0.012 0.000 0.924 0.008
#> GSM955030     6  0.4742    0.41404 0.000 0.004 0.076 0.268 0.000 0.652
#> GSM955032     3  0.3727    0.49244 0.000 0.040 0.768 0.004 0.000 0.188
#> GSM955033     4  0.5134    0.56775 0.000 0.056 0.004 0.644 0.028 0.268
#> GSM955034     1  0.2224    0.78763 0.912 0.036 0.004 0.000 0.012 0.036
#> GSM955035     2  0.6444    0.24650 0.000 0.432 0.384 0.000 0.128 0.056
#> GSM955036     4  0.5144    0.29321 0.000 0.004 0.012 0.488 0.044 0.452
#> GSM955037     1  0.7048   -0.06203 0.392 0.032 0.012 0.184 0.012 0.368
#> GSM955039     4  0.6917    0.34464 0.000 0.048 0.116 0.460 0.036 0.340
#> GSM955041     3  0.6335    0.21363 0.000 0.128 0.500 0.000 0.316 0.056
#> GSM955042     4  0.1858    0.57564 0.092 0.000 0.000 0.904 0.000 0.004
#> GSM955045     5  0.3924    0.63970 0.000 0.032 0.072 0.008 0.812 0.076
#> GSM955046     6  0.5408    0.65050 0.000 0.004 0.236 0.124 0.012 0.624
#> GSM955047     1  0.3663    0.76381 0.792 0.012 0.000 0.156 0.000 0.040
#> GSM955050     4  0.5372    0.57791 0.000 0.160 0.000 0.600 0.004 0.236
#> GSM955052     3  0.2288    0.52554 0.000 0.004 0.876 0.000 0.004 0.116
#> GSM955053     1  0.1930    0.78956 0.924 0.036 0.000 0.000 0.012 0.028
#> GSM955056     3  0.3839    0.50797 0.000 0.032 0.768 0.008 0.004 0.188
#> GSM955058     5  0.1555    0.73293 0.000 0.040 0.012 0.000 0.940 0.008
#> GSM955059     6  0.3819    0.42634 0.000 0.000 0.372 0.004 0.000 0.624
#> GSM955060     1  0.2588    0.79152 0.888 0.008 0.004 0.060 0.000 0.040
#> GSM955061     5  0.1699    0.73321 0.000 0.040 0.012 0.004 0.936 0.008
#> GSM955065     1  0.2224    0.78763 0.912 0.036 0.004 0.000 0.012 0.036
#> GSM955066     6  0.4316    0.67656 0.000 0.000 0.144 0.128 0.000 0.728
#> GSM955067     1  0.4450    0.66884 0.652 0.016 0.000 0.308 0.000 0.024
#> GSM955073     3  0.2700    0.47729 0.000 0.004 0.836 0.000 0.004 0.156
#> GSM955074     4  0.2196    0.56331 0.108 0.004 0.000 0.884 0.000 0.004
#> GSM955076     2  0.3667    0.55999 0.000 0.824 0.092 0.004 0.048 0.032
#> GSM955078     2  0.4390   -0.03585 0.000 0.508 0.004 0.000 0.472 0.016
#> GSM955083     4  0.3796    0.59661 0.000 0.012 0.000 0.768 0.032 0.188
#> GSM955084     5  0.4561    0.22605 0.000 0.404 0.000 0.008 0.564 0.024
#> GSM955086     3  0.4193    0.42819 0.000 0.028 0.688 0.008 0.000 0.276
#> GSM955091     2  0.5376    0.31126 0.000 0.576 0.080 0.000 0.324 0.020
#> GSM955092     3  0.7175    0.14551 0.000 0.148 0.408 0.004 0.324 0.116
#> GSM955093     3  0.2823    0.44367 0.000 0.000 0.796 0.000 0.000 0.204
#> GSM955098     2  0.3426    0.56067 0.000 0.852 0.016 0.048 0.048 0.036
#> GSM955099     2  0.5476    0.22909 0.000 0.536 0.072 0.000 0.368 0.024
#> GSM955100     4  0.5918    0.52588 0.176 0.016 0.000 0.536 0.000 0.272
#> GSM955103     3  0.6313    0.28071 0.000 0.044 0.476 0.012 0.376 0.092
#> GSM955104     6  0.5307    0.41539 0.000 0.004 0.128 0.276 0.000 0.592
#> GSM955106     5  0.1938    0.72052 0.000 0.016 0.004 0.024 0.928 0.028
#> GSM955000     1  0.4591    0.61554 0.700 0.016 0.004 0.048 0.000 0.232
#> GSM955006     1  0.3724    0.74970 0.772 0.012 0.000 0.188 0.000 0.028
#> GSM955007     3  0.4865    0.13910 0.000 0.008 0.572 0.000 0.048 0.372
#> GSM955010     4  0.4653    0.29094 0.000 0.012 0.020 0.488 0.000 0.480
#> GSM955014     1  0.4239    0.70601 0.696 0.016 0.000 0.264 0.000 0.024
#> GSM955018     3  0.3878    0.36370 0.000 0.004 0.668 0.008 0.000 0.320
#> GSM955020     1  0.4019    0.74363 0.740 0.028 0.000 0.216 0.000 0.016
#> GSM955024     3  0.5646    0.44235 0.000 0.048 0.616 0.000 0.240 0.096
#> GSM955026     2  0.3516    0.55923 0.000 0.848 0.020 0.048 0.044 0.040
#> GSM955031     2  0.7351    0.25887 0.020 0.464 0.168 0.108 0.000 0.240
#> GSM955038     4  0.4089    0.47832 0.000 0.264 0.000 0.696 0.000 0.040
#> GSM955040     4  0.5156    0.58469 0.000 0.144 0.000 0.612 0.000 0.244
#> GSM955044     2  0.6323    0.12391 0.000 0.444 0.100 0.008 0.404 0.044
#> GSM955051     1  0.4130    0.71325 0.704 0.012 0.000 0.260 0.000 0.024
#> GSM955055     2  0.5497    0.24202 0.000 0.556 0.052 0.000 0.348 0.044
#> GSM955057     1  0.0665    0.79805 0.980 0.008 0.000 0.008 0.000 0.004
#> GSM955062     2  0.6544    0.34297 0.000 0.452 0.320 0.000 0.184 0.044
#> GSM955063     3  0.3214    0.44543 0.000 0.004 0.788 0.004 0.004 0.200
#> GSM955068     2  0.3425    0.55589 0.000 0.844 0.008 0.032 0.080 0.036
#> GSM955069     6  0.4652    0.60575 0.000 0.000 0.288 0.072 0.000 0.640
#> GSM955070     2  0.8090    0.38918 0.000 0.444 0.144 0.100 0.156 0.156
#> GSM955071     4  0.5261    0.57861 0.000 0.092 0.016 0.612 0.000 0.280
#> GSM955077     2  0.6441    0.39518 0.000 0.596 0.032 0.160 0.048 0.164
#> GSM955080     5  0.1074    0.72409 0.000 0.000 0.000 0.028 0.960 0.012
#> GSM955081     3  0.6059    0.33951 0.000 0.268 0.524 0.008 0.008 0.192
#> GSM955082     3  0.6638    0.26167 0.000 0.068 0.468 0.004 0.332 0.128
#> GSM955085     5  0.5436    0.05360 0.000 0.448 0.040 0.004 0.476 0.032
#> GSM955090     1  0.4019    0.66792 0.652 0.004 0.000 0.332 0.000 0.012
#> GSM955094     2  0.8127    0.26890 0.000 0.368 0.052 0.128 0.212 0.240
#> GSM955096     3  0.4080    0.46421 0.000 0.036 0.724 0.008 0.000 0.232
#> GSM955102     6  0.5089    0.69134 0.008 0.004 0.208 0.104 0.004 0.672
#> GSM955105     3  0.4130    0.43735 0.000 0.028 0.700 0.008 0.000 0.264

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

consensus_heatmap(res, k = 2)

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

consensus_heatmap(res, k = 3)

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

consensus_heatmap(res, k = 4)

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

consensus_heatmap(res, k = 5)

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

consensus_heatmap(res, k = 6)

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

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

membership_heatmap(res, k = 2)

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

membership_heatmap(res, k = 3)

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

membership_heatmap(res, k = 4)

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

membership_heatmap(res, k = 5)

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

membership_heatmap(res, k = 6)

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

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

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

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

get_signatures(res, k = 3)

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

get_signatures(res, k = 4)

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

get_signatures(res, k = 5)

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

get_signatures(res, k = 6)

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

Signature heatmaps where rows are not scaled:

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

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

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

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

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

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

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

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

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

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

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk MAD-kmeans-signature_compare

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

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

An example of the output of tb is:

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

The columns in tb are:

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

UMAP plot which shows how samples are separated.

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

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

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

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

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

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

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

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

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

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

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk MAD-kmeans-collect-classes

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

test_to_known_factors(res)
#>              n genotype/variation(p) k
#> MAD:kmeans 107                 0.912 2
#> MAD:kmeans 107                 0.982 3
#> MAD:kmeans  83                 0.673 4
#> MAD:kmeans  63                 0.520 5
#> MAD:kmeans  54                 0.466 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 31589 rows and 108 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 2.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

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

collect_plots(res)

plot of chunk MAD-skmeans-collect-plots

The plots are:

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

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

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

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

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.923           0.940       0.975         0.4895 0.516   0.516
#> 3 3 0.811           0.871       0.940         0.3598 0.771   0.575
#> 4 4 0.588           0.536       0.739         0.1181 0.940   0.825
#> 5 5 0.596           0.468       0.704         0.0616 0.854   0.552
#> 6 6 0.609           0.403       0.654         0.0400 0.898   0.591

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
#> GSM955002     2  0.0000      0.964 0.000 1.000
#> GSM955008     2  0.0000      0.964 0.000 1.000
#> GSM955016     1  0.0000      0.989 1.000 0.000
#> GSM955019     2  0.0000      0.964 0.000 1.000
#> GSM955022     2  0.0000      0.964 0.000 1.000
#> GSM955023     2  0.0000      0.964 0.000 1.000
#> GSM955027     2  0.0000      0.964 0.000 1.000
#> GSM955043     2  0.0000      0.964 0.000 1.000
#> GSM955048     1  0.0000      0.989 1.000 0.000
#> GSM955049     2  0.0000      0.964 0.000 1.000
#> GSM955054     2  0.0000      0.964 0.000 1.000
#> GSM955064     2  0.0000      0.964 0.000 1.000
#> GSM955072     2  0.0000      0.964 0.000 1.000
#> GSM955075     2  0.0000      0.964 0.000 1.000
#> GSM955079     2  0.5737      0.832 0.136 0.864
#> GSM955087     1  0.0000      0.989 1.000 0.000
#> GSM955088     2  0.9323      0.497 0.348 0.652
#> GSM955089     1  0.0000      0.989 1.000 0.000
#> GSM955095     2  0.0000      0.964 0.000 1.000
#> GSM955097     2  0.9608      0.413 0.384 0.616
#> GSM955101     2  0.0000      0.964 0.000 1.000
#> GSM954999     1  0.0000      0.989 1.000 0.000
#> GSM955001     2  0.0000      0.964 0.000 1.000
#> GSM955003     2  0.0000      0.964 0.000 1.000
#> GSM955004     2  0.0000      0.964 0.000 1.000
#> GSM955005     1  0.0000      0.989 1.000 0.000
#> GSM955009     2  0.0000      0.964 0.000 1.000
#> GSM955011     1  0.0000      0.989 1.000 0.000
#> GSM955012     2  0.0000      0.964 0.000 1.000
#> GSM955013     2  0.9896      0.261 0.440 0.560
#> GSM955015     2  0.0000      0.964 0.000 1.000
#> GSM955017     1  0.0000      0.989 1.000 0.000
#> GSM955021     2  0.0000      0.964 0.000 1.000
#> GSM955025     2  0.0376      0.960 0.004 0.996
#> GSM955028     1  0.0000      0.989 1.000 0.000
#> GSM955029     2  0.0000      0.964 0.000 1.000
#> GSM955030     1  0.0000      0.989 1.000 0.000
#> GSM955032     2  0.0000      0.964 0.000 1.000
#> GSM955033     1  0.0000      0.989 1.000 0.000
#> GSM955034     1  0.0000      0.989 1.000 0.000
#> GSM955035     2  0.0000      0.964 0.000 1.000
#> GSM955036     1  0.0000      0.989 1.000 0.000
#> GSM955037     1  0.0000      0.989 1.000 0.000
#> GSM955039     2  0.4690      0.870 0.100 0.900
#> GSM955041     2  0.0000      0.964 0.000 1.000
#> GSM955042     1  0.0000      0.989 1.000 0.000
#> GSM955045     2  0.0000      0.964 0.000 1.000
#> GSM955046     2  0.9248      0.514 0.340 0.660
#> GSM955047     1  0.0000      0.989 1.000 0.000
#> GSM955050     1  0.0000      0.989 1.000 0.000
#> GSM955052     2  0.0000      0.964 0.000 1.000
#> GSM955053     1  0.0000      0.989 1.000 0.000
#> GSM955056     2  0.0000      0.964 0.000 1.000
#> GSM955058     2  0.0000      0.964 0.000 1.000
#> GSM955059     2  0.9393      0.480 0.356 0.644
#> GSM955060     1  0.0000      0.989 1.000 0.000
#> GSM955061     2  0.0000      0.964 0.000 1.000
#> GSM955065     1  0.0000      0.989 1.000 0.000
#> GSM955066     1  0.0000      0.989 1.000 0.000
#> GSM955067     1  0.0000      0.989 1.000 0.000
#> GSM955073     2  0.0000      0.964 0.000 1.000
#> GSM955074     1  0.0000      0.989 1.000 0.000
#> GSM955076     2  0.0000      0.964 0.000 1.000
#> GSM955078     2  0.0000      0.964 0.000 1.000
#> GSM955083     1  0.0000      0.989 1.000 0.000
#> GSM955084     2  0.0000      0.964 0.000 1.000
#> GSM955086     1  0.8861      0.531 0.696 0.304
#> GSM955091     2  0.0000      0.964 0.000 1.000
#> GSM955092     2  0.0000      0.964 0.000 1.000
#> GSM955093     2  0.1414      0.948 0.020 0.980
#> GSM955098     2  0.0000      0.964 0.000 1.000
#> GSM955099     2  0.0000      0.964 0.000 1.000
#> GSM955100     1  0.0000      0.989 1.000 0.000
#> GSM955103     2  0.0000      0.964 0.000 1.000
#> GSM955104     1  0.0000      0.989 1.000 0.000
#> GSM955106     2  0.0000      0.964 0.000 1.000
#> GSM955000     1  0.0000      0.989 1.000 0.000
#> GSM955006     1  0.0000      0.989 1.000 0.000
#> GSM955007     2  0.0000      0.964 0.000 1.000
#> GSM955010     1  0.0000      0.989 1.000 0.000
#> GSM955014     1  0.0000      0.989 1.000 0.000
#> GSM955018     2  0.5946      0.824 0.144 0.856
#> GSM955020     1  0.0000      0.989 1.000 0.000
#> GSM955024     2  0.0000      0.964 0.000 1.000
#> GSM955026     2  0.0000      0.964 0.000 1.000
#> GSM955031     1  0.0000      0.989 1.000 0.000
#> GSM955038     1  0.5294      0.854 0.880 0.120
#> GSM955040     1  0.0000      0.989 1.000 0.000
#> GSM955044     2  0.0000      0.964 0.000 1.000
#> GSM955051     1  0.0000      0.989 1.000 0.000
#> GSM955055     2  0.0000      0.964 0.000 1.000
#> GSM955057     1  0.0000      0.989 1.000 0.000
#> GSM955062     2  0.0000      0.964 0.000 1.000
#> GSM955063     2  0.0000      0.964 0.000 1.000
#> GSM955068     2  0.0000      0.964 0.000 1.000
#> GSM955069     1  0.0376      0.985 0.996 0.004
#> GSM955070     2  0.0000      0.964 0.000 1.000
#> GSM955071     1  0.0000      0.989 1.000 0.000
#> GSM955077     1  0.0376      0.985 0.996 0.004
#> GSM955080     2  0.0000      0.964 0.000 1.000
#> GSM955081     2  0.0000      0.964 0.000 1.000
#> GSM955082     2  0.0000      0.964 0.000 1.000
#> GSM955085     2  0.0000      0.964 0.000 1.000
#> GSM955090     1  0.0000      0.989 1.000 0.000
#> GSM955094     2  0.0000      0.964 0.000 1.000
#> GSM955096     2  0.0000      0.964 0.000 1.000
#> GSM955102     1  0.0000      0.989 1.000 0.000
#> GSM955105     1  0.1184      0.973 0.984 0.016

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1    p2    p3
#> GSM955002     2  0.5178      0.658 0.000 0.744 0.256
#> GSM955008     3  0.2448      0.878 0.000 0.076 0.924
#> GSM955016     1  0.0000      0.945 1.000 0.000 0.000
#> GSM955019     2  0.0237      0.940 0.000 0.996 0.004
#> GSM955022     3  0.0237      0.910 0.000 0.004 0.996
#> GSM955023     3  0.2625      0.875 0.000 0.084 0.916
#> GSM955027     2  0.0237      0.940 0.000 0.996 0.004
#> GSM955043     2  0.0237      0.940 0.000 0.996 0.004
#> GSM955048     1  0.0000      0.945 1.000 0.000 0.000
#> GSM955049     2  0.1289      0.929 0.000 0.968 0.032
#> GSM955054     3  0.4654      0.750 0.000 0.208 0.792
#> GSM955064     2  0.2537      0.898 0.000 0.920 0.080
#> GSM955072     2  0.0000      0.941 0.000 1.000 0.000
#> GSM955075     2  0.0424      0.939 0.000 0.992 0.008
#> GSM955079     3  0.0000      0.911 0.000 0.000 1.000
#> GSM955087     1  0.0000      0.945 1.000 0.000 0.000
#> GSM955088     3  0.0237      0.910 0.004 0.000 0.996
#> GSM955089     1  0.0000      0.945 1.000 0.000 0.000
#> GSM955095     2  0.1289      0.929 0.000 0.968 0.032
#> GSM955097     2  0.3193      0.851 0.100 0.896 0.004
#> GSM955101     3  0.3267      0.850 0.000 0.116 0.884
#> GSM954999     1  0.0000      0.945 1.000 0.000 0.000
#> GSM955001     2  0.0237      0.940 0.000 0.996 0.004
#> GSM955003     3  0.5138      0.687 0.000 0.252 0.748
#> GSM955004     2  0.0000      0.941 0.000 1.000 0.000
#> GSM955005     3  0.4887      0.686 0.228 0.000 0.772
#> GSM955009     2  0.0000      0.941 0.000 1.000 0.000
#> GSM955011     1  0.0000      0.945 1.000 0.000 0.000
#> GSM955012     2  0.0424      0.939 0.000 0.992 0.008
#> GSM955013     3  0.4097      0.863 0.060 0.060 0.880
#> GSM955015     3  0.5733      0.561 0.000 0.324 0.676
#> GSM955017     1  0.0000      0.945 1.000 0.000 0.000
#> GSM955021     2  0.2448      0.898 0.000 0.924 0.076
#> GSM955025     2  0.0237      0.940 0.004 0.996 0.000
#> GSM955028     1  0.0000      0.945 1.000 0.000 0.000
#> GSM955029     2  0.0237      0.940 0.000 0.996 0.004
#> GSM955030     1  0.6225      0.231 0.568 0.000 0.432
#> GSM955032     3  0.0237      0.911 0.000 0.004 0.996
#> GSM955033     1  0.0747      0.934 0.984 0.016 0.000
#> GSM955034     1  0.0000      0.945 1.000 0.000 0.000
#> GSM955035     2  0.2711      0.888 0.000 0.912 0.088
#> GSM955036     1  0.5058      0.667 0.756 0.000 0.244
#> GSM955037     1  0.1411      0.920 0.964 0.000 0.036
#> GSM955039     3  0.4682      0.770 0.004 0.192 0.804
#> GSM955041     2  0.4974      0.710 0.000 0.764 0.236
#> GSM955042     1  0.0000      0.945 1.000 0.000 0.000
#> GSM955045     2  0.1964      0.917 0.000 0.944 0.056
#> GSM955046     3  0.0000      0.911 0.000 0.000 1.000
#> GSM955047     1  0.0000      0.945 1.000 0.000 0.000
#> GSM955050     1  0.0000      0.945 1.000 0.000 0.000
#> GSM955052     3  0.0000      0.911 0.000 0.000 1.000
#> GSM955053     1  0.0000      0.945 1.000 0.000 0.000
#> GSM955056     3  0.1163      0.903 0.000 0.028 0.972
#> GSM955058     2  0.0237      0.940 0.000 0.996 0.004
#> GSM955059     3  0.0000      0.911 0.000 0.000 1.000
#> GSM955060     1  0.0000      0.945 1.000 0.000 0.000
#> GSM955061     2  0.0237      0.940 0.000 0.996 0.004
#> GSM955065     1  0.0000      0.945 1.000 0.000 0.000
#> GSM955066     3  0.5178      0.647 0.256 0.000 0.744
#> GSM955067     1  0.0000      0.945 1.000 0.000 0.000
#> GSM955073     3  0.0000      0.911 0.000 0.000 1.000
#> GSM955074     1  0.0000      0.945 1.000 0.000 0.000
#> GSM955076     2  0.3412      0.850 0.000 0.876 0.124
#> GSM955078     2  0.0000      0.941 0.000 1.000 0.000
#> GSM955083     1  0.0424      0.940 0.992 0.008 0.000
#> GSM955084     2  0.0000      0.941 0.000 1.000 0.000
#> GSM955086     3  0.0424      0.909 0.008 0.000 0.992
#> GSM955091     2  0.0237      0.940 0.000 0.996 0.004
#> GSM955092     2  0.1964      0.915 0.000 0.944 0.056
#> GSM955093     3  0.0000      0.911 0.000 0.000 1.000
#> GSM955098     2  0.0000      0.941 0.000 1.000 0.000
#> GSM955099     2  0.0000      0.941 0.000 1.000 0.000
#> GSM955100     1  0.0000      0.945 1.000 0.000 0.000
#> GSM955103     2  0.5560      0.603 0.000 0.700 0.300
#> GSM955104     1  0.6299      0.129 0.524 0.000 0.476
#> GSM955106     2  0.1031      0.933 0.000 0.976 0.024
#> GSM955000     1  0.0892      0.932 0.980 0.000 0.020
#> GSM955006     1  0.0000      0.945 1.000 0.000 0.000
#> GSM955007     3  0.0592      0.909 0.000 0.012 0.988
#> GSM955010     1  0.0747      0.935 0.984 0.000 0.016
#> GSM955014     1  0.0000      0.945 1.000 0.000 0.000
#> GSM955018     3  0.0000      0.911 0.000 0.000 1.000
#> GSM955020     1  0.0000      0.945 1.000 0.000 0.000
#> GSM955024     3  0.5016      0.698 0.000 0.240 0.760
#> GSM955026     2  0.0000      0.941 0.000 1.000 0.000
#> GSM955031     1  0.1950      0.910 0.952 0.008 0.040
#> GSM955038     1  0.4235      0.758 0.824 0.176 0.000
#> GSM955040     1  0.0000      0.945 1.000 0.000 0.000
#> GSM955044     2  0.0000      0.941 0.000 1.000 0.000
#> GSM955051     1  0.0000      0.945 1.000 0.000 0.000
#> GSM955055     2  0.0237      0.940 0.000 0.996 0.004
#> GSM955057     1  0.0000      0.945 1.000 0.000 0.000
#> GSM955062     2  0.1529      0.925 0.000 0.960 0.040
#> GSM955063     3  0.0000      0.911 0.000 0.000 1.000
#> GSM955068     2  0.0000      0.941 0.000 1.000 0.000
#> GSM955069     3  0.0237      0.910 0.004 0.000 0.996
#> GSM955070     2  0.0000      0.941 0.000 1.000 0.000
#> GSM955071     1  0.0000      0.945 1.000 0.000 0.000
#> GSM955077     1  0.5968      0.427 0.636 0.364 0.000
#> GSM955080     2  0.0424      0.939 0.000 0.992 0.008
#> GSM955081     2  0.6140      0.325 0.000 0.596 0.404
#> GSM955082     2  0.5650      0.584 0.000 0.688 0.312
#> GSM955085     2  0.0000      0.941 0.000 1.000 0.000
#> GSM955090     1  0.0000      0.945 1.000 0.000 0.000
#> GSM955094     2  0.0000      0.941 0.000 1.000 0.000
#> GSM955096     3  0.0237      0.911 0.000 0.004 0.996
#> GSM955102     3  0.4235      0.763 0.176 0.000 0.824
#> GSM955105     3  0.0592      0.907 0.012 0.000 0.988

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM955002     4  0.6764   -0.10387 0.000 0.404 0.096 0.500
#> GSM955008     3  0.4411    0.54677 0.000 0.108 0.812 0.080
#> GSM955016     1  0.0707    0.88578 0.980 0.000 0.000 0.020
#> GSM955019     2  0.3612    0.58141 0.000 0.856 0.044 0.100
#> GSM955022     4  0.5250    0.18481 0.000 0.024 0.316 0.660
#> GSM955023     3  0.6745    0.33660 0.000 0.152 0.604 0.244
#> GSM955027     2  0.2197    0.61691 0.000 0.928 0.024 0.048
#> GSM955043     2  0.4382    0.50052 0.000 0.704 0.000 0.296
#> GSM955048     1  0.0000    0.89406 1.000 0.000 0.000 0.000
#> GSM955049     2  0.5507    0.53520 0.000 0.732 0.156 0.112
#> GSM955054     3  0.7357    0.20946 0.000 0.296 0.512 0.192
#> GSM955064     2  0.6617    0.43094 0.000 0.608 0.128 0.264
#> GSM955072     2  0.4716    0.57458 0.000 0.764 0.040 0.196
#> GSM955075     2  0.5004    0.39676 0.000 0.604 0.004 0.392
#> GSM955079     3  0.1733    0.63315 0.000 0.024 0.948 0.028
#> GSM955087     1  0.0000    0.89406 1.000 0.000 0.000 0.000
#> GSM955088     3  0.3768    0.59331 0.000 0.008 0.808 0.184
#> GSM955089     1  0.0000    0.89406 1.000 0.000 0.000 0.000
#> GSM955095     2  0.5137    0.30086 0.000 0.544 0.004 0.452
#> GSM955097     2  0.5273    0.28488 0.008 0.536 0.000 0.456
#> GSM955101     3  0.6142    0.42104 0.000 0.184 0.676 0.140
#> GSM954999     1  0.2345    0.83194 0.900 0.000 0.000 0.100
#> GSM955001     2  0.2670    0.61778 0.000 0.904 0.024 0.072
#> GSM955003     3  0.7386    0.17267 0.000 0.320 0.496 0.184
#> GSM955004     2  0.3219    0.58196 0.000 0.836 0.000 0.164
#> GSM955005     3  0.7252    0.29676 0.180 0.000 0.528 0.292
#> GSM955009     2  0.2882    0.59321 0.000 0.892 0.024 0.084
#> GSM955011     1  0.0000    0.89406 1.000 0.000 0.000 0.000
#> GSM955012     2  0.4819    0.44251 0.000 0.652 0.004 0.344
#> GSM955013     4  0.4821    0.42717 0.008 0.048 0.160 0.784
#> GSM955015     3  0.7669    0.08765 0.000 0.312 0.452 0.236
#> GSM955017     1  0.0188    0.89260 0.996 0.000 0.000 0.004
#> GSM955021     2  0.6731    0.34098 0.000 0.604 0.248 0.148
#> GSM955025     2  0.4153    0.53683 0.004 0.784 0.008 0.204
#> GSM955028     1  0.0000    0.89406 1.000 0.000 0.000 0.000
#> GSM955029     2  0.4483    0.50241 0.000 0.712 0.004 0.284
#> GSM955030     1  0.7863   -0.11762 0.396 0.000 0.304 0.300
#> GSM955032     3  0.1820    0.63814 0.000 0.020 0.944 0.036
#> GSM955033     4  0.5444    0.38139 0.264 0.048 0.000 0.688
#> GSM955034     1  0.0000    0.89406 1.000 0.000 0.000 0.000
#> GSM955035     2  0.6508    0.40544 0.000 0.640 0.192 0.168
#> GSM955036     4  0.6037    0.35871 0.140 0.004 0.156 0.700
#> GSM955037     1  0.3894    0.77003 0.844 0.000 0.068 0.088
#> GSM955039     4  0.5918    0.32757 0.004 0.092 0.208 0.696
#> GSM955041     2  0.7412    0.26215 0.000 0.504 0.200 0.296
#> GSM955042     1  0.0188    0.89266 0.996 0.000 0.000 0.004
#> GSM955045     2  0.6215    0.40046 0.000 0.600 0.072 0.328
#> GSM955046     3  0.4989    0.25217 0.000 0.000 0.528 0.472
#> GSM955047     1  0.0000    0.89406 1.000 0.000 0.000 0.000
#> GSM955050     1  0.3047    0.81236 0.872 0.012 0.000 0.116
#> GSM955052     3  0.1975    0.64041 0.000 0.016 0.936 0.048
#> GSM955053     1  0.0000    0.89406 1.000 0.000 0.000 0.000
#> GSM955056     3  0.3533    0.59254 0.000 0.056 0.864 0.080
#> GSM955058     2  0.4608    0.48643 0.000 0.692 0.004 0.304
#> GSM955059     3  0.3801    0.55721 0.000 0.000 0.780 0.220
#> GSM955060     1  0.0000    0.89406 1.000 0.000 0.000 0.000
#> GSM955061     2  0.4608    0.48605 0.000 0.692 0.004 0.304
#> GSM955065     1  0.0000    0.89406 1.000 0.000 0.000 0.000
#> GSM955066     3  0.7251    0.30650 0.192 0.000 0.536 0.272
#> GSM955067     1  0.0000    0.89406 1.000 0.000 0.000 0.000
#> GSM955073     3  0.2216    0.63372 0.000 0.000 0.908 0.092
#> GSM955074     1  0.0336    0.89072 0.992 0.000 0.000 0.008
#> GSM955076     2  0.7122    0.29452 0.000 0.560 0.248 0.192
#> GSM955078     2  0.1743    0.61657 0.000 0.940 0.004 0.056
#> GSM955083     1  0.4914    0.52116 0.676 0.012 0.000 0.312
#> GSM955084     2  0.3219    0.59566 0.000 0.836 0.000 0.164
#> GSM955086     3  0.2131    0.63741 0.016 0.008 0.936 0.040
#> GSM955091     2  0.2623    0.61765 0.000 0.908 0.028 0.064
#> GSM955092     2  0.6083    0.47028 0.000 0.672 0.216 0.112
#> GSM955093     3  0.2530    0.62716 0.000 0.000 0.888 0.112
#> GSM955098     2  0.5968    0.44661 0.000 0.672 0.092 0.236
#> GSM955099     2  0.2730    0.61898 0.000 0.896 0.016 0.088
#> GSM955100     1  0.0188    0.89257 0.996 0.000 0.000 0.004
#> GSM955103     4  0.7368   -0.06943 0.000 0.376 0.164 0.460
#> GSM955104     3  0.7890    0.05009 0.308 0.000 0.380 0.312
#> GSM955106     2  0.5112    0.33082 0.000 0.560 0.004 0.436
#> GSM955000     1  0.1284    0.87343 0.964 0.000 0.024 0.012
#> GSM955006     1  0.0000    0.89406 1.000 0.000 0.000 0.000
#> GSM955007     3  0.5078    0.47149 0.000 0.028 0.700 0.272
#> GSM955010     1  0.5359    0.54884 0.676 0.000 0.036 0.288
#> GSM955014     1  0.0000    0.89406 1.000 0.000 0.000 0.000
#> GSM955018     3  0.2125    0.63323 0.000 0.004 0.920 0.076
#> GSM955020     1  0.0000    0.89406 1.000 0.000 0.000 0.000
#> GSM955024     3  0.7581   -0.17739 0.000 0.196 0.424 0.380
#> GSM955026     2  0.5851    0.45347 0.000 0.680 0.084 0.236
#> GSM955031     1  0.8024    0.40800 0.600 0.136 0.128 0.136
#> GSM955038     1  0.6259    0.47240 0.652 0.232 0.000 0.116
#> GSM955040     1  0.2125    0.85067 0.920 0.004 0.000 0.076
#> GSM955044     2  0.4826    0.55339 0.000 0.716 0.020 0.264
#> GSM955051     1  0.0000    0.89406 1.000 0.000 0.000 0.000
#> GSM955055     2  0.2214    0.61169 0.000 0.928 0.028 0.044
#> GSM955057     1  0.0000    0.89406 1.000 0.000 0.000 0.000
#> GSM955062     2  0.4864    0.52839 0.000 0.768 0.172 0.060
#> GSM955063     3  0.2216    0.63291 0.000 0.000 0.908 0.092
#> GSM955068     2  0.4956    0.52022 0.000 0.756 0.056 0.188
#> GSM955069     3  0.4401    0.50406 0.004 0.000 0.724 0.272
#> GSM955070     2  0.5355    0.44583 0.000 0.620 0.020 0.360
#> GSM955071     1  0.2814    0.81019 0.868 0.000 0.000 0.132
#> GSM955077     1  0.7834    0.12916 0.496 0.340 0.028 0.136
#> GSM955080     2  0.5088    0.34854 0.000 0.572 0.004 0.424
#> GSM955081     2  0.7663    0.00532 0.000 0.408 0.380 0.212
#> GSM955082     2  0.7302    0.17359 0.000 0.500 0.332 0.168
#> GSM955085     2  0.1637    0.61583 0.000 0.940 0.000 0.060
#> GSM955090     1  0.0000    0.89406 1.000 0.000 0.000 0.000
#> GSM955094     4  0.5372   -0.22313 0.000 0.444 0.012 0.544
#> GSM955096     3  0.2197    0.63361 0.000 0.024 0.928 0.048
#> GSM955102     3  0.6641    0.38482 0.124 0.000 0.600 0.276
#> GSM955105     3  0.2686    0.63377 0.032 0.012 0.916 0.040

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM955002     2  0.6228    0.37549 0.000 0.624 0.068 0.240 0.068
#> GSM955008     3  0.4211    0.61488 0.000 0.156 0.788 0.028 0.028
#> GSM955016     1  0.2970    0.76392 0.828 0.004 0.000 0.168 0.000
#> GSM955019     2  0.5687    0.27860 0.000 0.580 0.052 0.020 0.348
#> GSM955022     4  0.6761    0.31276 0.000 0.012 0.220 0.496 0.272
#> GSM955023     3  0.7617    0.32152 0.000 0.224 0.500 0.120 0.156
#> GSM955027     5  0.5767    0.29874 0.000 0.292 0.080 0.016 0.612
#> GSM955043     5  0.3134    0.53918 0.000 0.120 0.000 0.032 0.848
#> GSM955048     1  0.0162    0.85402 0.996 0.000 0.000 0.004 0.000
#> GSM955049     5  0.7034    0.00211 0.000 0.328 0.228 0.016 0.428
#> GSM955054     2  0.6036   -0.10593 0.000 0.464 0.456 0.044 0.036
#> GSM955064     5  0.7527    0.18802 0.000 0.248 0.172 0.088 0.492
#> GSM955072     2  0.4536    0.27240 0.000 0.640 0.008 0.008 0.344
#> GSM955075     5  0.1741    0.56020 0.000 0.024 0.000 0.040 0.936
#> GSM955079     3  0.4059    0.65659 0.008 0.116 0.816 0.048 0.012
#> GSM955087     1  0.0404    0.85224 0.988 0.000 0.000 0.012 0.000
#> GSM955088     3  0.5605    0.44228 0.000 0.076 0.660 0.240 0.024
#> GSM955089     1  0.0000    0.85397 1.000 0.000 0.000 0.000 0.000
#> GSM955095     5  0.2520    0.54400 0.000 0.012 0.004 0.096 0.888
#> GSM955097     5  0.2623    0.53976 0.004 0.016 0.000 0.096 0.884
#> GSM955101     3  0.5949    0.47137 0.000 0.236 0.644 0.076 0.044
#> GSM954999     1  0.4944    0.53228 0.652 0.020 0.004 0.312 0.012
#> GSM955001     5  0.5087    0.29969 0.000 0.344 0.028 0.012 0.616
#> GSM955003     3  0.5564    0.14216 0.000 0.444 0.504 0.024 0.028
#> GSM955004     5  0.4380    0.38055 0.000 0.304 0.000 0.020 0.676
#> GSM955005     4  0.6694    0.41933 0.168 0.020 0.292 0.520 0.000
#> GSM955009     2  0.5256    0.22075 0.000 0.592 0.024 0.020 0.364
#> GSM955011     1  0.0162    0.85369 0.996 0.000 0.000 0.004 0.000
#> GSM955012     5  0.1153    0.56659 0.000 0.024 0.004 0.008 0.964
#> GSM955013     4  0.7230    0.35340 0.008 0.060 0.120 0.516 0.296
#> GSM955015     2  0.7548    0.08014 0.000 0.428 0.332 0.172 0.068
#> GSM955017     1  0.1043    0.84250 0.960 0.000 0.000 0.040 0.000
#> GSM955021     2  0.6037    0.43215 0.000 0.612 0.232 0.012 0.144
#> GSM955025     2  0.5539    0.40816 0.004 0.692 0.020 0.092 0.192
#> GSM955028     1  0.0510    0.85100 0.984 0.000 0.000 0.016 0.000
#> GSM955029     5  0.1410    0.56199 0.000 0.060 0.000 0.000 0.940
#> GSM955030     4  0.6408    0.45277 0.344 0.004 0.160 0.492 0.000
#> GSM955032     3  0.4203    0.64432 0.000 0.128 0.780 0.092 0.000
#> GSM955033     4  0.6569    0.39344 0.076 0.192 0.004 0.628 0.100
#> GSM955034     1  0.0162    0.85369 0.996 0.000 0.000 0.004 0.000
#> GSM955035     2  0.6676    0.39248 0.000 0.568 0.188 0.032 0.212
#> GSM955036     4  0.4579    0.51090 0.040 0.012 0.028 0.788 0.132
#> GSM955037     1  0.3621    0.64934 0.788 0.000 0.020 0.192 0.000
#> GSM955039     4  0.6472    0.38772 0.000 0.156 0.144 0.632 0.068
#> GSM955041     5  0.7404    0.18655 0.000 0.192 0.244 0.068 0.496
#> GSM955042     1  0.2068    0.82059 0.904 0.004 0.000 0.092 0.000
#> GSM955045     5  0.3542    0.55062 0.000 0.048 0.052 0.044 0.856
#> GSM955046     4  0.4881    0.39104 0.004 0.004 0.268 0.684 0.040
#> GSM955047     1  0.0404    0.85396 0.988 0.000 0.000 0.012 0.000
#> GSM955050     1  0.5308    0.60742 0.688 0.168 0.000 0.140 0.004
#> GSM955052     3  0.2026    0.65879 0.000 0.056 0.924 0.012 0.008
#> GSM955053     1  0.0000    0.85397 1.000 0.000 0.000 0.000 0.000
#> GSM955056     3  0.4706    0.64255 0.000 0.148 0.764 0.060 0.028
#> GSM955058     5  0.1443    0.56559 0.000 0.044 0.004 0.004 0.948
#> GSM955059     3  0.4516    0.15757 0.000 0.004 0.576 0.416 0.004
#> GSM955060     1  0.0290    0.85321 0.992 0.000 0.000 0.008 0.000
#> GSM955061     5  0.1569    0.56604 0.000 0.044 0.004 0.008 0.944
#> GSM955065     1  0.0609    0.84969 0.980 0.000 0.000 0.020 0.000
#> GSM955066     4  0.6198    0.39758 0.128 0.008 0.320 0.544 0.000
#> GSM955067     1  0.1701    0.83926 0.936 0.016 0.000 0.048 0.000
#> GSM955073     3  0.2540    0.63527 0.000 0.024 0.888 0.088 0.000
#> GSM955074     1  0.1638    0.83669 0.932 0.004 0.000 0.064 0.000
#> GSM955076     2  0.4176    0.50622 0.000 0.792 0.108 0.004 0.096
#> GSM955078     5  0.4480    0.22121 0.000 0.400 0.004 0.004 0.592
#> GSM955083     1  0.6903    0.09210 0.460 0.056 0.000 0.388 0.096
#> GSM955084     5  0.4781    0.16613 0.000 0.428 0.000 0.020 0.552
#> GSM955086     3  0.4689    0.61873 0.024 0.096 0.772 0.108 0.000
#> GSM955091     2  0.4974   -0.05682 0.000 0.488 0.020 0.004 0.488
#> GSM955092     5  0.7265    0.08748 0.000 0.236 0.316 0.028 0.420
#> GSM955093     3  0.3163    0.58716 0.000 0.012 0.824 0.164 0.000
#> GSM955098     2  0.2267    0.51278 0.000 0.916 0.008 0.028 0.048
#> GSM955099     5  0.5120    0.11405 0.000 0.428 0.008 0.024 0.540
#> GSM955100     1  0.1041    0.84661 0.964 0.004 0.000 0.032 0.000
#> GSM955103     5  0.6494    0.32928 0.000 0.052 0.228 0.116 0.604
#> GSM955104     4  0.7205    0.44878 0.240 0.004 0.228 0.496 0.032
#> GSM955106     5  0.2720    0.53892 0.000 0.020 0.004 0.096 0.880
#> GSM955000     1  0.2470    0.78173 0.884 0.000 0.012 0.104 0.000
#> GSM955006     1  0.0162    0.85436 0.996 0.000 0.000 0.004 0.000
#> GSM955007     3  0.6993    0.23986 0.000 0.040 0.512 0.284 0.164
#> GSM955010     4  0.5338    0.05629 0.456 0.024 0.016 0.504 0.000
#> GSM955014     1  0.1251    0.84561 0.956 0.008 0.000 0.036 0.000
#> GSM955018     3  0.2612    0.61163 0.000 0.008 0.868 0.124 0.000
#> GSM955020     1  0.0671    0.85227 0.980 0.004 0.000 0.016 0.000
#> GSM955024     5  0.7103    0.21518 0.000 0.064 0.288 0.132 0.516
#> GSM955026     2  0.2227    0.50693 0.000 0.916 0.004 0.032 0.048
#> GSM955031     1  0.7412    0.04432 0.420 0.372 0.136 0.072 0.000
#> GSM955038     1  0.6500    0.21130 0.460 0.384 0.000 0.148 0.008
#> GSM955040     1  0.5510    0.56201 0.652 0.164 0.000 0.184 0.000
#> GSM955044     5  0.5937    0.10780 0.000 0.408 0.020 0.060 0.512
#> GSM955051     1  0.0671    0.85227 0.980 0.004 0.000 0.016 0.000
#> GSM955055     5  0.5639    0.03378 0.000 0.448 0.048 0.012 0.492
#> GSM955057     1  0.0290    0.85423 0.992 0.000 0.000 0.008 0.000
#> GSM955062     2  0.7003    0.14279 0.000 0.444 0.144 0.036 0.376
#> GSM955063     3  0.3523    0.61369 0.000 0.032 0.824 0.140 0.004
#> GSM955068     2  0.3812    0.46448 0.000 0.780 0.004 0.020 0.196
#> GSM955069     3  0.5471   -0.05504 0.028 0.004 0.492 0.464 0.012
#> GSM955070     2  0.6340    0.31788 0.000 0.596 0.032 0.120 0.252
#> GSM955071     1  0.4985    0.60275 0.708 0.088 0.004 0.200 0.000
#> GSM955077     2  0.8227    0.16235 0.284 0.468 0.056 0.092 0.100
#> GSM955080     5  0.2331    0.54888 0.000 0.020 0.000 0.080 0.900
#> GSM955081     3  0.7371   -0.02541 0.000 0.376 0.420 0.068 0.136
#> GSM955082     5  0.6550    0.26098 0.000 0.084 0.332 0.048 0.536
#> GSM955085     5  0.4874    0.25958 0.000 0.388 0.008 0.016 0.588
#> GSM955090     1  0.1251    0.84607 0.956 0.008 0.000 0.036 0.000
#> GSM955094     5  0.6942    0.09420 0.000 0.296 0.012 0.244 0.448
#> GSM955096     3  0.3465    0.64283 0.000 0.104 0.840 0.052 0.004
#> GSM955102     4  0.5882    0.29734 0.092 0.004 0.376 0.528 0.000
#> GSM955105     3  0.4254    0.62340 0.024 0.076 0.812 0.084 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
#> GSM955002     6  0.6660   -0.04102 0.000 0.396 0.036 0.084 0.044 0.440
#> GSM955008     4  0.4719    0.48771 0.000 0.124 0.080 0.748 0.008 0.040
#> GSM955016     1  0.4086    0.64926 0.708 0.000 0.028 0.000 0.008 0.256
#> GSM955019     2  0.4893    0.43802 0.000 0.704 0.000 0.072 0.184 0.040
#> GSM955022     3  0.7080    0.22552 0.000 0.004 0.472 0.168 0.240 0.116
#> GSM955023     4  0.8002    0.32098 0.000 0.208 0.228 0.404 0.084 0.076
#> GSM955027     5  0.6538    0.10071 0.000 0.332 0.004 0.140 0.472 0.052
#> GSM955043     5  0.5164    0.52710 0.000 0.176 0.024 0.028 0.704 0.068
#> GSM955048     1  0.0458    0.83852 0.984 0.000 0.000 0.000 0.000 0.016
#> GSM955049     2  0.7491    0.15386 0.000 0.348 0.020 0.276 0.288 0.068
#> GSM955054     2  0.5809   -0.12227 0.000 0.456 0.052 0.440 0.004 0.048
#> GSM955064     4  0.7926   -0.12200 0.000 0.212 0.024 0.320 0.304 0.140
#> GSM955072     2  0.4926    0.41401 0.000 0.680 0.004 0.040 0.236 0.040
#> GSM955075     5  0.0837    0.62330 0.000 0.004 0.000 0.004 0.972 0.020
#> GSM955079     4  0.5035    0.44944 0.004 0.072 0.152 0.720 0.004 0.048
#> GSM955087     1  0.0935    0.83370 0.964 0.000 0.032 0.000 0.000 0.004
#> GSM955088     3  0.6764    0.09131 0.004 0.044 0.476 0.336 0.020 0.120
#> GSM955089     1  0.0891    0.83937 0.968 0.000 0.008 0.000 0.000 0.024
#> GSM955095     5  0.3478    0.59493 0.000 0.024 0.032 0.020 0.844 0.080
#> GSM955097     5  0.2683    0.59287 0.000 0.004 0.020 0.004 0.868 0.104
#> GSM955101     4  0.5213    0.44293 0.000 0.172 0.048 0.700 0.012 0.068
#> GSM954999     1  0.6247    0.26651 0.512 0.008 0.128 0.000 0.032 0.320
#> GSM955001     5  0.6025    0.06643 0.000 0.368 0.004 0.116 0.488 0.024
#> GSM955003     4  0.5075    0.20048 0.000 0.392 0.012 0.548 0.004 0.044
#> GSM955004     5  0.4686    0.40039 0.000 0.280 0.008 0.012 0.664 0.036
#> GSM955005     3  0.5295    0.52465 0.116 0.012 0.712 0.084 0.000 0.076
#> GSM955009     2  0.5389    0.36662 0.000 0.652 0.012 0.032 0.236 0.068
#> GSM955011     1  0.1088    0.83943 0.960 0.000 0.016 0.000 0.000 0.024
#> GSM955012     5  0.1922    0.63011 0.000 0.040 0.000 0.024 0.924 0.012
#> GSM955013     6  0.8134    0.05068 0.012 0.032 0.272 0.092 0.292 0.300
#> GSM955015     4  0.7804    0.19209 0.000 0.272 0.124 0.420 0.052 0.132
#> GSM955017     1  0.1657    0.82200 0.928 0.000 0.056 0.000 0.000 0.016
#> GSM955021     2  0.5955    0.27594 0.000 0.568 0.020 0.308 0.064 0.040
#> GSM955025     2  0.5919    0.35998 0.004 0.596 0.016 0.020 0.104 0.260
#> GSM955028     1  0.0713    0.83415 0.972 0.000 0.028 0.000 0.000 0.000
#> GSM955029     5  0.2365    0.61919 0.000 0.084 0.004 0.012 0.892 0.008
#> GSM955030     3  0.5742    0.25292 0.292 0.000 0.572 0.036 0.000 0.100
#> GSM955032     4  0.5324    0.40996 0.000 0.100 0.244 0.632 0.000 0.024
#> GSM955033     6  0.5752    0.29616 0.032 0.060 0.180 0.004 0.052 0.672
#> GSM955034     1  0.0632    0.83516 0.976 0.000 0.024 0.000 0.000 0.000
#> GSM955035     2  0.6251    0.34811 0.000 0.544 0.000 0.272 0.112 0.072
#> GSM955036     3  0.5390    0.03854 0.000 0.000 0.508 0.016 0.072 0.404
#> GSM955037     1  0.4078    0.48320 0.656 0.000 0.320 0.000 0.000 0.024
#> GSM955039     6  0.7342    0.05427 0.000 0.052 0.276 0.204 0.036 0.432
#> GSM955041     5  0.7692    0.00534 0.000 0.180 0.048 0.336 0.364 0.072
#> GSM955042     1  0.3154    0.75086 0.800 0.004 0.012 0.000 0.000 0.184
#> GSM955045     5  0.5134    0.53472 0.000 0.064 0.028 0.104 0.736 0.068
#> GSM955046     3  0.4517    0.48029 0.000 0.000 0.732 0.096 0.016 0.156
#> GSM955047     1  0.1082    0.83684 0.956 0.000 0.004 0.000 0.000 0.040
#> GSM955050     1  0.5272    0.47435 0.596 0.084 0.016 0.000 0.000 0.304
#> GSM955052     4  0.4759    0.45338 0.000 0.040 0.192 0.716 0.004 0.048
#> GSM955053     1  0.0547    0.83601 0.980 0.000 0.020 0.000 0.000 0.000
#> GSM955056     4  0.6359    0.45831 0.000 0.176 0.140 0.604 0.028 0.052
#> GSM955058     5  0.2365    0.62382 0.000 0.068 0.000 0.024 0.896 0.012
#> GSM955059     3  0.3163    0.45493 0.000 0.004 0.780 0.212 0.000 0.004
#> GSM955060     1  0.0725    0.83870 0.976 0.000 0.012 0.000 0.000 0.012
#> GSM955061     5  0.1872    0.62656 0.000 0.064 0.004 0.008 0.920 0.004
#> GSM955065     1  0.0713    0.83415 0.972 0.000 0.028 0.000 0.000 0.000
#> GSM955066     3  0.4012    0.54801 0.072 0.000 0.800 0.056 0.000 0.072
#> GSM955067     1  0.1806    0.82247 0.908 0.004 0.000 0.000 0.000 0.088
#> GSM955073     4  0.3977    0.38539 0.000 0.008 0.240 0.728 0.004 0.020
#> GSM955074     1  0.2890    0.79441 0.852 0.004 0.016 0.000 0.008 0.120
#> GSM955076     2  0.3565    0.48063 0.000 0.812 0.004 0.136 0.032 0.016
#> GSM955078     2  0.4874   -0.07967 0.000 0.484 0.000 0.020 0.472 0.024
#> GSM955083     6  0.6776    0.13573 0.348 0.004 0.096 0.004 0.092 0.456
#> GSM955084     5  0.4717    0.07406 0.000 0.456 0.004 0.000 0.504 0.036
#> GSM955086     4  0.6745    0.34960 0.032 0.092 0.220 0.576 0.008 0.072
#> GSM955091     2  0.5499    0.16145 0.000 0.536 0.004 0.068 0.372 0.020
#> GSM955092     4  0.7778   -0.12270 0.000 0.184 0.040 0.344 0.340 0.092
#> GSM955093     4  0.4617    0.29691 0.000 0.012 0.304 0.644 0.000 0.040
#> GSM955098     2  0.3544    0.46255 0.000 0.828 0.008 0.024 0.032 0.108
#> GSM955099     2  0.5790   -0.02528 0.000 0.484 0.004 0.044 0.412 0.056
#> GSM955100     1  0.2433    0.80739 0.884 0.000 0.044 0.000 0.000 0.072
#> GSM955103     5  0.6849    0.30242 0.000 0.040 0.068 0.220 0.552 0.120
#> GSM955104     3  0.7160    0.28942 0.200 0.008 0.532 0.128 0.020 0.112
#> GSM955106     5  0.2578    0.60590 0.000 0.012 0.008 0.012 0.884 0.084
#> GSM955000     1  0.3089    0.70306 0.800 0.000 0.188 0.004 0.000 0.008
#> GSM955006     1  0.0972    0.83960 0.964 0.000 0.008 0.000 0.000 0.028
#> GSM955007     3  0.7115    0.06005 0.000 0.028 0.440 0.328 0.144 0.060
#> GSM955010     6  0.6762    0.02099 0.324 0.008 0.308 0.020 0.000 0.340
#> GSM955014     1  0.1700    0.82460 0.916 0.004 0.000 0.000 0.000 0.080
#> GSM955018     4  0.5105    0.19303 0.000 0.008 0.388 0.540 0.000 0.064
#> GSM955020     1  0.1411    0.83035 0.936 0.004 0.000 0.000 0.000 0.060
#> GSM955024     4  0.8063    0.17708 0.000 0.076 0.140 0.344 0.332 0.108
#> GSM955026     2  0.3921    0.43976 0.000 0.792 0.008 0.028 0.028 0.144
#> GSM955031     2  0.7945   -0.05368 0.312 0.364 0.048 0.136 0.000 0.140
#> GSM955038     1  0.6586   -0.07367 0.384 0.284 0.012 0.000 0.008 0.312
#> GSM955040     1  0.5433    0.33466 0.540 0.056 0.024 0.000 0.004 0.376
#> GSM955044     5  0.7468   -0.06186 0.000 0.348 0.020 0.096 0.368 0.168
#> GSM955051     1  0.0790    0.83810 0.968 0.000 0.000 0.000 0.000 0.032
#> GSM955055     2  0.6535    0.23062 0.000 0.484 0.008 0.144 0.320 0.044
#> GSM955057     1  0.0363    0.83823 0.988 0.000 0.000 0.000 0.000 0.012
#> GSM955062     2  0.7283    0.24729 0.000 0.428 0.020 0.204 0.280 0.068
#> GSM955063     4  0.4526    0.33116 0.000 0.020 0.312 0.648 0.004 0.016
#> GSM955068     2  0.4258    0.48608 0.000 0.780 0.008 0.028 0.120 0.064
#> GSM955069     3  0.4857    0.50263 0.028 0.004 0.720 0.184 0.008 0.056
#> GSM955070     2  0.7497    0.12570 0.000 0.372 0.020 0.096 0.176 0.336
#> GSM955071     1  0.5643    0.49492 0.608 0.036 0.072 0.004 0.004 0.276
#> GSM955077     2  0.8350    0.10533 0.168 0.404 0.052 0.036 0.084 0.256
#> GSM955080     5  0.2854    0.61205 0.000 0.024 0.020 0.004 0.872 0.080
#> GSM955081     4  0.8114    0.13844 0.000 0.288 0.088 0.368 0.088 0.168
#> GSM955082     4  0.7875    0.02573 0.000 0.092 0.080 0.364 0.344 0.120
#> GSM955085     5  0.5835    0.14446 0.000 0.396 0.012 0.032 0.500 0.060
#> GSM955090     1  0.1897    0.82051 0.908 0.004 0.004 0.000 0.000 0.084
#> GSM955094     6  0.7674    0.09736 0.000 0.216 0.108 0.020 0.284 0.372
#> GSM955096     4  0.6015    0.38734 0.000 0.108 0.220 0.596 0.000 0.076
#> GSM955102     3  0.3788    0.56985 0.056 0.000 0.812 0.092 0.000 0.040
#> GSM955105     4  0.5883    0.34280 0.012 0.052 0.256 0.612 0.004 0.064

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

consensus_heatmap(res, k = 2)

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

consensus_heatmap(res, k = 3)

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

consensus_heatmap(res, k = 4)

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

consensus_heatmap(res, k = 5)

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

consensus_heatmap(res, k = 6)

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

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

membership_heatmap(res, k = 2)

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

membership_heatmap(res, k = 3)

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

membership_heatmap(res, k = 4)

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

membership_heatmap(res, k = 5)

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

membership_heatmap(res, k = 6)

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

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

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

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

get_signatures(res, k = 3)

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

get_signatures(res, k = 4)

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

get_signatures(res, k = 5)

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

get_signatures(res, k = 6)

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

Signature heatmaps where rows are not scaled:

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

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

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

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

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

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

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

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

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

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

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk MAD-skmeans-signature_compare

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

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

An example of the output of tb is:

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

The columns in tb are:

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

UMAP plot which shows how samples are separated.

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

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

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

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

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

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

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

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

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

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

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk MAD-skmeans-collect-classes

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

test_to_known_factors(res)
#>               n genotype/variation(p) k
#> MAD:skmeans 104                 0.116 2
#> MAD:skmeans 104                 0.621 3
#> MAD:skmeans  64                 0.844 4
#> MAD:skmeans  55                 0.699 5
#> MAD:skmeans  38                 0.346 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 31589 rows and 108 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'MAD' method.
#>   Subgroups are detected by 'pam' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 2.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

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

collect_plots(res)

plot of chunk MAD-pam-collect-plots

The plots are:

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

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

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

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

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.642           0.893       0.927         0.4476 0.551   0.551
#> 3 3 0.514           0.774       0.857         0.3721 0.714   0.534
#> 4 4 0.678           0.772       0.883         0.1680 0.861   0.663
#> 5 5 0.631           0.609       0.789         0.0515 0.907   0.710
#> 6 6 0.711           0.735       0.861         0.0521 0.929   0.734

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
#> GSM955002     2  0.6048      0.873 0.148 0.852
#> GSM955008     2  0.4161      0.911 0.084 0.916
#> GSM955016     1  0.3584      0.946 0.932 0.068
#> GSM955019     2  0.0000      0.912 0.000 1.000
#> GSM955022     2  0.8144      0.766 0.252 0.748
#> GSM955023     2  0.5059      0.898 0.112 0.888
#> GSM955027     2  0.0000      0.912 0.000 1.000
#> GSM955043     2  0.1633      0.917 0.024 0.976
#> GSM955048     1  0.0000      0.943 1.000 0.000
#> GSM955049     2  0.3879      0.914 0.076 0.924
#> GSM955054     2  0.2603      0.917 0.044 0.956
#> GSM955064     2  0.0000      0.912 0.000 1.000
#> GSM955072     2  0.0000      0.912 0.000 1.000
#> GSM955075     2  0.0000      0.912 0.000 1.000
#> GSM955079     2  0.4298      0.911 0.088 0.912
#> GSM955087     1  0.0000      0.943 1.000 0.000
#> GSM955088     2  0.4161      0.912 0.084 0.916
#> GSM955089     1  0.0000      0.943 1.000 0.000
#> GSM955095     2  0.5946      0.825 0.144 0.856
#> GSM955097     1  0.7528      0.813 0.784 0.216
#> GSM955101     2  0.0000      0.912 0.000 1.000
#> GSM954999     1  0.3733      0.943 0.928 0.072
#> GSM955001     2  0.0000      0.912 0.000 1.000
#> GSM955003     2  0.0000      0.912 0.000 1.000
#> GSM955004     2  0.5629      0.838 0.132 0.868
#> GSM955005     2  0.8386      0.744 0.268 0.732
#> GSM955009     2  0.0000      0.912 0.000 1.000
#> GSM955011     1  0.3584      0.946 0.932 0.068
#> GSM955012     2  0.2043      0.917 0.032 0.968
#> GSM955013     2  0.8016      0.776 0.244 0.756
#> GSM955015     2  0.1184      0.916 0.016 0.984
#> GSM955017     1  0.3584      0.946 0.932 0.068
#> GSM955021     2  0.0000      0.912 0.000 1.000
#> GSM955025     2  0.9000      0.615 0.316 0.684
#> GSM955028     1  0.0000      0.943 1.000 0.000
#> GSM955029     2  0.0000      0.912 0.000 1.000
#> GSM955030     1  0.3584      0.946 0.932 0.068
#> GSM955032     2  0.4431      0.908 0.092 0.908
#> GSM955033     1  0.4690      0.923 0.900 0.100
#> GSM955034     1  0.0000      0.943 1.000 0.000
#> GSM955035     2  0.0000      0.912 0.000 1.000
#> GSM955036     1  0.3584      0.946 0.932 0.068
#> GSM955037     1  0.3584      0.946 0.932 0.068
#> GSM955039     2  0.5294      0.893 0.120 0.880
#> GSM955041     2  0.3733      0.914 0.072 0.928
#> GSM955042     1  0.3584      0.946 0.932 0.068
#> GSM955045     2  0.0000      0.912 0.000 1.000
#> GSM955046     2  0.7745      0.797 0.228 0.772
#> GSM955047     1  0.0000      0.943 1.000 0.000
#> GSM955050     1  0.4298      0.936 0.912 0.088
#> GSM955052     2  0.4298      0.910 0.088 0.912
#> GSM955053     1  0.0000      0.943 1.000 0.000
#> GSM955056     2  0.4161      0.911 0.084 0.916
#> GSM955058     2  0.0000      0.912 0.000 1.000
#> GSM955059     2  0.6887      0.843 0.184 0.816
#> GSM955060     1  0.0000      0.943 1.000 0.000
#> GSM955061     2  0.0000      0.912 0.000 1.000
#> GSM955065     1  0.0000      0.943 1.000 0.000
#> GSM955066     1  0.3584      0.946 0.932 0.068
#> GSM955067     1  0.0000      0.943 1.000 0.000
#> GSM955073     2  0.4161      0.911 0.084 0.916
#> GSM955074     1  0.3584      0.946 0.932 0.068
#> GSM955076     2  0.3274      0.916 0.060 0.940
#> GSM955078     2  0.0000      0.912 0.000 1.000
#> GSM955083     1  0.5629      0.891 0.868 0.132
#> GSM955084     2  0.0672      0.912 0.008 0.992
#> GSM955086     2  0.5629      0.885 0.132 0.868
#> GSM955091     2  0.1414      0.916 0.020 0.980
#> GSM955092     2  0.0000      0.912 0.000 1.000
#> GSM955093     2  0.4562      0.907 0.096 0.904
#> GSM955098     2  0.4431      0.909 0.092 0.908
#> GSM955099     2  0.0000      0.912 0.000 1.000
#> GSM955100     1  0.3584      0.946 0.932 0.068
#> GSM955103     2  0.0672      0.914 0.008 0.992
#> GSM955104     2  0.9323      0.604 0.348 0.652
#> GSM955106     2  0.4939      0.902 0.108 0.892
#> GSM955000     1  0.3584      0.946 0.932 0.068
#> GSM955006     1  0.0000      0.943 1.000 0.000
#> GSM955007     2  0.3584      0.915 0.068 0.932
#> GSM955010     2  1.0000      0.140 0.496 0.504
#> GSM955014     1  0.0000      0.943 1.000 0.000
#> GSM955018     2  0.5842      0.878 0.140 0.860
#> GSM955020     1  0.0000      0.943 1.000 0.000
#> GSM955024     2  0.1843      0.917 0.028 0.972
#> GSM955026     2  0.3879      0.913 0.076 0.924
#> GSM955031     2  0.4161      0.912 0.084 0.916
#> GSM955038     2  0.7883      0.787 0.236 0.764
#> GSM955040     1  0.5737      0.883 0.864 0.136
#> GSM955044     2  0.1184      0.916 0.016 0.984
#> GSM955051     1  0.0000      0.943 1.000 0.000
#> GSM955055     2  0.0000      0.912 0.000 1.000
#> GSM955057     1  0.0000      0.943 1.000 0.000
#> GSM955062     2  0.0000      0.912 0.000 1.000
#> GSM955063     2  0.4298      0.910 0.088 0.912
#> GSM955068     2  0.2778      0.917 0.048 0.952
#> GSM955069     2  0.9286      0.612 0.344 0.656
#> GSM955070     2  0.0000      0.912 0.000 1.000
#> GSM955071     1  0.4022      0.938 0.920 0.080
#> GSM955077     1  0.6343      0.852 0.840 0.160
#> GSM955080     2  0.1633      0.910 0.024 0.976
#> GSM955081     2  0.4161      0.911 0.084 0.916
#> GSM955082     2  0.2236      0.918 0.036 0.964
#> GSM955085     2  0.0000      0.912 0.000 1.000
#> GSM955090     1  0.0000      0.943 1.000 0.000
#> GSM955094     2  0.5294      0.895 0.120 0.880
#> GSM955096     2  0.4161      0.911 0.084 0.916
#> GSM955102     1  0.3733      0.943 0.928 0.072
#> GSM955105     2  0.7602      0.806 0.220 0.780

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1    p2    p3
#> GSM955002     2  0.5926      0.628 0.000 0.644 0.356
#> GSM955008     2  0.5785      0.655 0.000 0.668 0.332
#> GSM955016     3  0.4178      0.816 0.172 0.000 0.828
#> GSM955019     2  0.0892      0.813 0.000 0.980 0.020
#> GSM955022     3  0.2152      0.831 0.016 0.036 0.948
#> GSM955023     2  0.6235      0.539 0.000 0.564 0.436
#> GSM955027     2  0.1289      0.804 0.000 0.968 0.032
#> GSM955043     3  0.6140      0.218 0.000 0.404 0.596
#> GSM955048     1  0.0000      0.999 1.000 0.000 0.000
#> GSM955049     2  0.5291      0.718 0.000 0.732 0.268
#> GSM955054     2  0.3192      0.800 0.000 0.888 0.112
#> GSM955064     2  0.0424      0.813 0.000 0.992 0.008
#> GSM955072     2  0.1289      0.806 0.000 0.968 0.032
#> GSM955075     2  0.3116      0.771 0.000 0.892 0.108
#> GSM955079     3  0.3340      0.794 0.000 0.120 0.880
#> GSM955087     1  0.0000      0.999 1.000 0.000 0.000
#> GSM955088     2  0.6062      0.552 0.000 0.616 0.384
#> GSM955089     1  0.0000      0.999 1.000 0.000 0.000
#> GSM955095     2  0.3412      0.764 0.000 0.876 0.124
#> GSM955097     3  0.5785      0.457 0.000 0.332 0.668
#> GSM955101     2  0.0892      0.813 0.000 0.980 0.020
#> GSM954999     3  0.3340      0.836 0.120 0.000 0.880
#> GSM955001     2  0.0747      0.809 0.000 0.984 0.016
#> GSM955003     2  0.0892      0.813 0.000 0.980 0.020
#> GSM955004     2  0.3116      0.771 0.000 0.892 0.108
#> GSM955005     3  0.2681      0.837 0.028 0.040 0.932
#> GSM955009     2  0.0747      0.809 0.000 0.984 0.016
#> GSM955011     3  0.4121      0.819 0.168 0.000 0.832
#> GSM955012     3  0.3879      0.714 0.000 0.152 0.848
#> GSM955013     3  0.2384      0.824 0.008 0.056 0.936
#> GSM955015     2  0.1860      0.816 0.000 0.948 0.052
#> GSM955017     3  0.4002      0.824 0.160 0.000 0.840
#> GSM955021     2  0.0592      0.813 0.000 0.988 0.012
#> GSM955025     3  0.3921      0.826 0.036 0.080 0.884
#> GSM955028     1  0.0000      0.999 1.000 0.000 0.000
#> GSM955029     2  0.3267      0.768 0.000 0.884 0.116
#> GSM955030     3  0.2878      0.840 0.096 0.000 0.904
#> GSM955032     3  0.6299     -0.140 0.000 0.476 0.524
#> GSM955033     3  0.4062      0.821 0.164 0.000 0.836
#> GSM955034     1  0.0000      0.999 1.000 0.000 0.000
#> GSM955035     2  0.0747      0.813 0.000 0.984 0.016
#> GSM955036     3  0.2261      0.839 0.068 0.000 0.932
#> GSM955037     3  0.4002      0.824 0.160 0.000 0.840
#> GSM955039     3  0.5905      0.303 0.000 0.352 0.648
#> GSM955041     2  0.5254      0.743 0.000 0.736 0.264
#> GSM955042     3  0.4178      0.816 0.172 0.000 0.828
#> GSM955045     2  0.4931      0.636 0.000 0.768 0.232
#> GSM955046     3  0.1170      0.828 0.008 0.016 0.976
#> GSM955047     1  0.0000      0.999 1.000 0.000 0.000
#> GSM955050     3  0.6529      0.775 0.152 0.092 0.756
#> GSM955052     2  0.5785      0.655 0.000 0.668 0.332
#> GSM955053     1  0.0000      0.999 1.000 0.000 0.000
#> GSM955056     2  0.5785      0.655 0.000 0.668 0.332
#> GSM955058     2  0.2165      0.792 0.000 0.936 0.064
#> GSM955059     3  0.1753      0.820 0.000 0.048 0.952
#> GSM955060     1  0.0000      0.999 1.000 0.000 0.000
#> GSM955061     3  0.5785      0.457 0.000 0.332 0.668
#> GSM955065     1  0.0000      0.999 1.000 0.000 0.000
#> GSM955066     3  0.3116      0.839 0.108 0.000 0.892
#> GSM955067     1  0.0237      0.994 0.996 0.000 0.004
#> GSM955073     2  0.5785      0.655 0.000 0.668 0.332
#> GSM955074     3  0.3879      0.828 0.152 0.000 0.848
#> GSM955076     2  0.3267      0.799 0.000 0.884 0.116
#> GSM955078     2  0.0892      0.808 0.000 0.980 0.020
#> GSM955083     3  0.4485      0.833 0.136 0.020 0.844
#> GSM955084     2  0.2165      0.792 0.000 0.936 0.064
#> GSM955086     2  0.5219      0.748 0.016 0.788 0.196
#> GSM955091     2  0.3038      0.803 0.000 0.896 0.104
#> GSM955092     2  0.0592      0.812 0.000 0.988 0.012
#> GSM955093     2  0.5785      0.655 0.000 0.668 0.332
#> GSM955098     2  0.5760      0.659 0.000 0.672 0.328
#> GSM955099     2  0.0592      0.812 0.000 0.988 0.012
#> GSM955100     3  0.4178      0.816 0.172 0.000 0.828
#> GSM955103     2  0.1289      0.816 0.000 0.968 0.032
#> GSM955104     3  0.2689      0.838 0.036 0.032 0.932
#> GSM955106     2  0.6154      0.522 0.000 0.592 0.408
#> GSM955000     3  0.3752      0.831 0.144 0.000 0.856
#> GSM955006     1  0.0000      0.999 1.000 0.000 0.000
#> GSM955007     3  0.4346      0.719 0.000 0.184 0.816
#> GSM955010     3  0.8242      0.298 0.092 0.336 0.572
#> GSM955014     1  0.0000      0.999 1.000 0.000 0.000
#> GSM955018     3  0.3116      0.793 0.000 0.108 0.892
#> GSM955020     1  0.0424      0.990 0.992 0.000 0.008
#> GSM955024     2  0.3619      0.792 0.000 0.864 0.136
#> GSM955026     2  0.4702      0.754 0.000 0.788 0.212
#> GSM955031     2  0.5365      0.725 0.004 0.744 0.252
#> GSM955038     3  0.4121      0.811 0.024 0.108 0.868
#> GSM955040     3  0.4172      0.825 0.156 0.004 0.840
#> GSM955044     2  0.2356      0.815 0.000 0.928 0.072
#> GSM955051     1  0.0000      0.999 1.000 0.000 0.000
#> GSM955055     2  0.0747      0.809 0.000 0.984 0.016
#> GSM955057     1  0.0000      0.999 1.000 0.000 0.000
#> GSM955062     2  0.0592      0.812 0.000 0.988 0.012
#> GSM955063     2  0.5785      0.655 0.000 0.668 0.332
#> GSM955068     2  0.5678      0.661 0.000 0.684 0.316
#> GSM955069     3  0.3039      0.839 0.036 0.044 0.920
#> GSM955070     2  0.0747      0.813 0.000 0.984 0.016
#> GSM955071     3  0.4586      0.839 0.096 0.048 0.856
#> GSM955077     3  0.4059      0.836 0.128 0.012 0.860
#> GSM955080     2  0.3116      0.771 0.000 0.892 0.108
#> GSM955081     2  0.5905      0.630 0.000 0.648 0.352
#> GSM955082     2  0.4796      0.764 0.000 0.780 0.220
#> GSM955085     2  0.0592      0.812 0.000 0.988 0.012
#> GSM955090     1  0.0000      0.999 1.000 0.000 0.000
#> GSM955094     2  0.6045      0.633 0.000 0.620 0.380
#> GSM955096     2  0.6126      0.546 0.000 0.600 0.400
#> GSM955102     3  0.2625      0.840 0.084 0.000 0.916
#> GSM955105     2  0.6773      0.633 0.024 0.636 0.340

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM955002     2  0.3311     0.7216 0.000 0.828 0.172 0.000
#> GSM955008     2  0.0188     0.7974 0.000 0.996 0.004 0.000
#> GSM955016     3  0.2921     0.8792 0.140 0.000 0.860 0.000
#> GSM955019     2  0.0188     0.7978 0.000 0.996 0.000 0.004
#> GSM955022     3  0.0336     0.9080 0.000 0.000 0.992 0.008
#> GSM955023     2  0.2859     0.7579 0.000 0.880 0.112 0.008
#> GSM955027     4  0.4713     0.3308 0.000 0.360 0.000 0.640
#> GSM955043     4  0.4054     0.6927 0.000 0.016 0.188 0.796
#> GSM955048     1  0.0188     0.9941 0.996 0.000 0.000 0.004
#> GSM955049     2  0.0188     0.7974 0.000 0.996 0.004 0.000
#> GSM955054     2  0.0000     0.7969 0.000 1.000 0.000 0.000
#> GSM955064     2  0.2149     0.7800 0.000 0.912 0.000 0.088
#> GSM955072     2  0.4948     0.3707 0.000 0.560 0.000 0.440
#> GSM955075     4  0.0376     0.8099 0.000 0.004 0.004 0.992
#> GSM955079     3  0.1610     0.9040 0.000 0.016 0.952 0.032
#> GSM955087     1  0.0188     0.9941 0.996 0.000 0.000 0.004
#> GSM955088     2  0.4194     0.6309 0.000 0.764 0.228 0.008
#> GSM955089     1  0.0188     0.9953 0.996 0.000 0.004 0.000
#> GSM955095     4  0.3808     0.6570 0.000 0.176 0.012 0.812
#> GSM955097     4  0.0376     0.8099 0.000 0.004 0.004 0.992
#> GSM955101     2  0.1557     0.7911 0.000 0.944 0.000 0.056
#> GSM954999     3  0.0817     0.9141 0.024 0.000 0.976 0.000
#> GSM955001     2  0.4948     0.3692 0.000 0.560 0.000 0.440
#> GSM955003     2  0.0000     0.7969 0.000 1.000 0.000 0.000
#> GSM955004     4  0.0188     0.8108 0.000 0.004 0.000 0.996
#> GSM955005     3  0.0000     0.9098 0.000 0.000 1.000 0.000
#> GSM955009     2  0.4948     0.3692 0.000 0.560 0.000 0.440
#> GSM955011     3  0.2760     0.8869 0.128 0.000 0.872 0.000
#> GSM955012     4  0.4382     0.5492 0.000 0.000 0.296 0.704
#> GSM955013     3  0.0804     0.9056 0.000 0.012 0.980 0.008
#> GSM955015     2  0.3400     0.7274 0.000 0.820 0.000 0.180
#> GSM955017     3  0.1940     0.9088 0.076 0.000 0.924 0.000
#> GSM955021     2  0.2647     0.7671 0.000 0.880 0.000 0.120
#> GSM955025     3  0.1520     0.9050 0.000 0.024 0.956 0.020
#> GSM955028     1  0.0188     0.9941 0.996 0.000 0.000 0.004
#> GSM955029     4  0.0188     0.8108 0.000 0.004 0.000 0.996
#> GSM955030     3  0.0707     0.9149 0.020 0.000 0.980 0.000
#> GSM955032     2  0.4522     0.4846 0.000 0.680 0.320 0.000
#> GSM955033     3  0.3380     0.8785 0.136 0.008 0.852 0.004
#> GSM955034     1  0.0188     0.9941 0.996 0.000 0.000 0.004
#> GSM955035     2  0.0817     0.7979 0.000 0.976 0.000 0.024
#> GSM955036     3  0.1151     0.9129 0.024 0.000 0.968 0.008
#> GSM955037     3  0.2593     0.8993 0.104 0.000 0.892 0.004
#> GSM955039     3  0.4941     0.1636 0.000 0.436 0.564 0.000
#> GSM955041     2  0.4804     0.2164 0.000 0.616 0.000 0.384
#> GSM955042     3  0.2973     0.8762 0.144 0.000 0.856 0.000
#> GSM955045     4  0.7301    -0.0205 0.000 0.396 0.152 0.452
#> GSM955046     3  0.0188     0.9087 0.000 0.000 0.996 0.004
#> GSM955047     1  0.0188     0.9953 0.996 0.000 0.004 0.000
#> GSM955050     3  0.4428     0.8125 0.068 0.000 0.808 0.124
#> GSM955052     2  0.0188     0.7974 0.000 0.996 0.004 0.000
#> GSM955053     1  0.0188     0.9941 0.996 0.000 0.000 0.004
#> GSM955056     2  0.0188     0.7974 0.000 0.996 0.004 0.000
#> GSM955058     4  0.0469     0.8086 0.000 0.012 0.000 0.988
#> GSM955059     3  0.0336     0.9080 0.000 0.000 0.992 0.008
#> GSM955060     1  0.0188     0.9953 0.996 0.000 0.004 0.000
#> GSM955061     4  0.0188     0.8108 0.000 0.004 0.000 0.996
#> GSM955065     1  0.0188     0.9941 0.996 0.000 0.000 0.004
#> GSM955066     3  0.0817     0.9142 0.024 0.000 0.976 0.000
#> GSM955067     1  0.0336     0.9925 0.992 0.000 0.008 0.000
#> GSM955073     2  0.0469     0.7984 0.000 0.988 0.012 0.000
#> GSM955074     3  0.2266     0.9059 0.084 0.000 0.912 0.004
#> GSM955076     2  0.0000     0.7969 0.000 1.000 0.000 0.000
#> GSM955078     2  0.4855     0.4202 0.000 0.600 0.000 0.400
#> GSM955083     3  0.2867     0.8961 0.104 0.000 0.884 0.012
#> GSM955084     4  0.0336     0.8101 0.000 0.008 0.000 0.992
#> GSM955086     2  0.5993     0.6552 0.008 0.712 0.144 0.136
#> GSM955091     2  0.1209     0.7956 0.000 0.964 0.004 0.032
#> GSM955092     2  0.4406     0.5881 0.000 0.700 0.000 0.300
#> GSM955093     2  0.0188     0.7974 0.000 0.996 0.004 0.000
#> GSM955098     2  0.0188     0.7974 0.000 0.996 0.004 0.000
#> GSM955099     2  0.3486     0.7170 0.000 0.812 0.000 0.188
#> GSM955100     3  0.2973     0.8762 0.144 0.000 0.856 0.000
#> GSM955103     2  0.3569     0.7164 0.000 0.804 0.000 0.196
#> GSM955104     3  0.0000     0.9098 0.000 0.000 1.000 0.000
#> GSM955106     4  0.5384     0.6592 0.000 0.076 0.196 0.728
#> GSM955000     3  0.1474     0.9138 0.052 0.000 0.948 0.000
#> GSM955006     1  0.0188     0.9953 0.996 0.000 0.004 0.000
#> GSM955007     3  0.3751     0.7157 0.000 0.004 0.800 0.196
#> GSM955010     2  0.7044     0.0209 0.092 0.460 0.440 0.008
#> GSM955014     1  0.0188     0.9953 0.996 0.000 0.004 0.000
#> GSM955018     3  0.2589     0.8446 0.000 0.116 0.884 0.000
#> GSM955020     1  0.0469     0.9840 0.988 0.000 0.012 0.000
#> GSM955024     2  0.5464     0.6516 0.000 0.708 0.064 0.228
#> GSM955026     2  0.2197     0.7893 0.000 0.928 0.048 0.024
#> GSM955031     2  0.0707     0.7982 0.000 0.980 0.020 0.000
#> GSM955038     3  0.1520     0.9049 0.000 0.024 0.956 0.020
#> GSM955040     3  0.2814     0.8828 0.132 0.000 0.868 0.000
#> GSM955044     4  0.4855     0.2743 0.000 0.400 0.000 0.600
#> GSM955051     1  0.0188     0.9953 0.996 0.000 0.004 0.000
#> GSM955055     2  0.4948     0.3692 0.000 0.560 0.000 0.440
#> GSM955057     1  0.0188     0.9953 0.996 0.000 0.004 0.000
#> GSM955062     2  0.4477     0.5877 0.000 0.688 0.000 0.312
#> GSM955063     2  0.0188     0.7974 0.000 0.996 0.004 0.000
#> GSM955068     2  0.5619     0.5194 0.000 0.640 0.320 0.040
#> GSM955069     3  0.0336     0.9120 0.008 0.000 0.992 0.000
#> GSM955070     2  0.0921     0.7974 0.000 0.972 0.000 0.028
#> GSM955071     3  0.3400     0.8814 0.064 0.064 0.872 0.000
#> GSM955077     3  0.1474     0.9135 0.052 0.000 0.948 0.000
#> GSM955080     4  0.0188     0.8108 0.000 0.004 0.000 0.996
#> GSM955081     2  0.1118     0.7926 0.000 0.964 0.036 0.000
#> GSM955082     2  0.1902     0.7901 0.000 0.932 0.064 0.004
#> GSM955085     2  0.4477     0.5690 0.000 0.688 0.000 0.312
#> GSM955090     1  0.0188     0.9953 0.996 0.000 0.004 0.000
#> GSM955094     2  0.4468     0.6654 0.000 0.752 0.232 0.016
#> GSM955096     2  0.3873     0.6483 0.000 0.772 0.228 0.000
#> GSM955102     3  0.0188     0.9095 0.004 0.000 0.996 0.000
#> GSM955105     2  0.1042     0.7981 0.008 0.972 0.020 0.000

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM955002     3  0.2732     0.7412 0.000 0.000 0.840 0.160 0.000
#> GSM955008     3  0.0000     0.8099 0.000 0.000 1.000 0.000 0.000
#> GSM955016     1  0.4350     0.2200 0.588 0.004 0.000 0.408 0.000
#> GSM955019     3  0.0162     0.8098 0.000 0.000 0.996 0.000 0.004
#> GSM955022     4  0.0794     0.7952 0.000 0.028 0.000 0.972 0.000
#> GSM955023     3  0.3238     0.7419 0.000 0.028 0.836 0.136 0.000
#> GSM955027     5  0.4642     0.4337 0.000 0.032 0.308 0.000 0.660
#> GSM955043     5  0.6767     0.4650 0.000 0.336 0.020 0.160 0.484
#> GSM955048     2  0.4138     0.9542 0.384 0.616 0.000 0.000 0.000
#> GSM955049     3  0.0000     0.8099 0.000 0.000 1.000 0.000 0.000
#> GSM955054     3  0.0000     0.8099 0.000 0.000 1.000 0.000 0.000
#> GSM955064     3  0.2020     0.7789 0.000 0.000 0.900 0.000 0.100
#> GSM955072     5  0.4192     0.1439 0.000 0.000 0.404 0.000 0.596
#> GSM955075     5  0.4108     0.5756 0.000 0.308 0.000 0.008 0.684
#> GSM955079     4  0.1997     0.7983 0.000 0.000 0.036 0.924 0.040
#> GSM955087     2  0.4350     0.9109 0.408 0.588 0.000 0.004 0.000
#> GSM955088     3  0.3612     0.6350 0.000 0.000 0.764 0.228 0.008
#> GSM955089     1  0.1282     0.5086 0.952 0.044 0.000 0.004 0.000
#> GSM955095     5  0.2866     0.6025 0.000 0.020 0.076 0.020 0.884
#> GSM955097     5  0.0290     0.6038 0.000 0.000 0.000 0.008 0.992
#> GSM955101     3  0.1410     0.7986 0.000 0.000 0.940 0.000 0.060
#> GSM954999     4  0.1365     0.8088 0.040 0.004 0.004 0.952 0.000
#> GSM955001     5  0.4138     0.1965 0.000 0.000 0.384 0.000 0.616
#> GSM955003     3  0.0000     0.8099 0.000 0.000 1.000 0.000 0.000
#> GSM955004     5  0.0000     0.6039 0.000 0.000 0.000 0.000 1.000
#> GSM955005     4  0.1041     0.8085 0.032 0.004 0.000 0.964 0.000
#> GSM955009     5  0.4138     0.1965 0.000 0.000 0.384 0.000 0.616
#> GSM955011     4  0.3928     0.5930 0.296 0.004 0.000 0.700 0.000
#> GSM955012     5  0.6638     0.3895 0.000 0.364 0.000 0.224 0.412
#> GSM955013     4  0.1082     0.7949 0.000 0.028 0.008 0.964 0.000
#> GSM955015     3  0.3003     0.7111 0.000 0.000 0.812 0.000 0.188
#> GSM955017     4  0.3366     0.7120 0.212 0.004 0.000 0.784 0.000
#> GSM955021     3  0.2732     0.7435 0.000 0.000 0.840 0.000 0.160
#> GSM955025     4  0.1907     0.7979 0.000 0.000 0.044 0.928 0.028
#> GSM955028     2  0.4074     0.9635 0.364 0.636 0.000 0.000 0.000
#> GSM955029     5  0.3966     0.5684 0.000 0.336 0.000 0.000 0.664
#> GSM955030     4  0.1697     0.8081 0.060 0.008 0.000 0.932 0.000
#> GSM955032     3  0.3876     0.4930 0.000 0.000 0.684 0.316 0.000
#> GSM955033     1  0.4807     0.1663 0.532 0.020 0.000 0.448 0.000
#> GSM955034     2  0.4088     0.9629 0.368 0.632 0.000 0.000 0.000
#> GSM955035     3  0.0703     0.8093 0.000 0.000 0.976 0.000 0.024
#> GSM955036     4  0.2795     0.7530 0.100 0.028 0.000 0.872 0.000
#> GSM955037     4  0.5261     0.3420 0.048 0.424 0.000 0.528 0.000
#> GSM955039     4  0.4268     0.1826 0.000 0.000 0.444 0.556 0.000
#> GSM955041     3  0.6554    -0.1022 0.000 0.272 0.476 0.000 0.252
#> GSM955042     1  0.4138     0.2794 0.616 0.000 0.000 0.384 0.000
#> GSM955045     5  0.6062     0.3850 0.000 0.008 0.248 0.148 0.596
#> GSM955046     4  0.0162     0.8015 0.000 0.004 0.000 0.996 0.000
#> GSM955047     1  0.1701     0.5225 0.936 0.048 0.000 0.016 0.000
#> GSM955050     4  0.3645     0.7410 0.168 0.004 0.000 0.804 0.024
#> GSM955052     3  0.0000     0.8099 0.000 0.000 1.000 0.000 0.000
#> GSM955053     2  0.4126     0.9623 0.380 0.620 0.000 0.000 0.000
#> GSM955056     3  0.0000     0.8099 0.000 0.000 1.000 0.000 0.000
#> GSM955058     5  0.3966     0.5684 0.000 0.336 0.000 0.000 0.664
#> GSM955059     4  0.0794     0.7952 0.000 0.028 0.000 0.972 0.000
#> GSM955060     1  0.1197     0.5261 0.952 0.048 0.000 0.000 0.000
#> GSM955061     5  0.3966     0.5684 0.000 0.336 0.000 0.000 0.664
#> GSM955065     2  0.4171     0.9445 0.396 0.604 0.000 0.000 0.000
#> GSM955066     4  0.0963     0.8088 0.036 0.000 0.000 0.964 0.000
#> GSM955067     1  0.2616     0.4842 0.888 0.076 0.000 0.036 0.000
#> GSM955073     3  0.0404     0.8103 0.000 0.000 0.988 0.012 0.000
#> GSM955074     4  0.3318     0.7402 0.180 0.012 0.000 0.808 0.000
#> GSM955076     3  0.0000     0.8099 0.000 0.000 1.000 0.000 0.000
#> GSM955078     3  0.6383     0.1773 0.000 0.228 0.516 0.000 0.256
#> GSM955083     4  0.4121     0.5748 0.264 0.004 0.000 0.720 0.012
#> GSM955084     5  0.0000     0.6039 0.000 0.000 0.000 0.000 1.000
#> GSM955086     3  0.5584     0.6254 0.028 0.000 0.696 0.144 0.132
#> GSM955091     3  0.2103     0.7922 0.000 0.056 0.920 0.004 0.020
#> GSM955092     3  0.4294     0.1614 0.000 0.000 0.532 0.000 0.468
#> GSM955093     3  0.0000     0.8099 0.000 0.000 1.000 0.000 0.000
#> GSM955098     3  0.0000     0.8099 0.000 0.000 1.000 0.000 0.000
#> GSM955099     3  0.3074     0.6981 0.000 0.000 0.804 0.000 0.196
#> GSM955100     1  0.4276     0.2800 0.616 0.004 0.000 0.380 0.000
#> GSM955103     3  0.3109     0.7000 0.000 0.000 0.800 0.000 0.200
#> GSM955104     4  0.1041     0.8085 0.032 0.004 0.000 0.964 0.000
#> GSM955106     5  0.6732     0.4789 0.000 0.364 0.028 0.128 0.480
#> GSM955000     4  0.2077     0.8000 0.084 0.008 0.000 0.908 0.000
#> GSM955006     1  0.0162     0.5426 0.996 0.000 0.000 0.004 0.000
#> GSM955007     4  0.3745     0.6403 0.000 0.024 0.000 0.780 0.196
#> GSM955010     4  0.7113     0.1334 0.184 0.028 0.376 0.412 0.000
#> GSM955014     1  0.1671     0.5077 0.924 0.076 0.000 0.000 0.000
#> GSM955018     4  0.2439     0.7563 0.004 0.000 0.120 0.876 0.000
#> GSM955020     1  0.3913    -0.2715 0.676 0.324 0.000 0.000 0.000
#> GSM955024     3  0.5615     0.5996 0.000 0.028 0.680 0.092 0.200
#> GSM955026     3  0.1893     0.7998 0.000 0.000 0.928 0.048 0.024
#> GSM955031     3  0.0609     0.8093 0.000 0.000 0.980 0.020 0.000
#> GSM955038     4  0.2246     0.8079 0.028 0.004 0.028 0.924 0.016
#> GSM955040     1  0.4743     0.1095 0.512 0.000 0.016 0.472 0.000
#> GSM955044     5  0.6610     0.4632 0.000 0.280 0.260 0.000 0.460
#> GSM955051     1  0.1041     0.5345 0.964 0.032 0.000 0.004 0.000
#> GSM955055     5  0.4138     0.1965 0.000 0.000 0.384 0.000 0.616
#> GSM955057     1  0.1197     0.5308 0.952 0.048 0.000 0.000 0.000
#> GSM955062     3  0.4171     0.3735 0.000 0.000 0.604 0.000 0.396
#> GSM955063     3  0.0000     0.8099 0.000 0.000 1.000 0.000 0.000
#> GSM955068     3  0.5480     0.4910 0.000 0.000 0.616 0.288 0.096
#> GSM955069     4  0.2915     0.7795 0.116 0.024 0.000 0.860 0.000
#> GSM955070     3  0.0794     0.8083 0.000 0.000 0.972 0.000 0.028
#> GSM955071     4  0.5380     0.0289 0.464 0.004 0.044 0.488 0.000
#> GSM955077     4  0.2511     0.7941 0.080 0.000 0.028 0.892 0.000
#> GSM955080     5  0.0451     0.6033 0.000 0.004 0.000 0.008 0.988
#> GSM955081     3  0.0880     0.8049 0.000 0.000 0.968 0.032 0.000
#> GSM955082     3  0.2054     0.7956 0.000 0.008 0.916 0.072 0.004
#> GSM955085     3  0.4300     0.1366 0.000 0.000 0.524 0.000 0.476
#> GSM955090     1  0.1410     0.5239 0.940 0.060 0.000 0.000 0.000
#> GSM955094     3  0.4415     0.6483 0.000 0.028 0.728 0.236 0.008
#> GSM955096     3  0.3305     0.6515 0.000 0.000 0.776 0.224 0.000
#> GSM955102     4  0.1331     0.8045 0.008 0.040 0.000 0.952 0.000
#> GSM955105     3  0.2589     0.7731 0.092 0.008 0.888 0.012 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM955002     2  0.2697      0.758 0.000 0.812 0.188 0.000 0.000 0.000
#> GSM955008     2  0.0000      0.841 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM955016     1  0.1957      0.799 0.888 0.000 0.112 0.000 0.000 0.000
#> GSM955019     2  0.0146      0.841 0.000 0.996 0.000 0.000 0.000 0.004
#> GSM955022     3  0.2219      0.801 0.000 0.000 0.864 0.000 0.136 0.000
#> GSM955023     2  0.3707      0.743 0.000 0.784 0.080 0.000 0.136 0.000
#> GSM955027     6  0.5939      0.096 0.000 0.276 0.000 0.000 0.264 0.460
#> GSM955043     5  0.2726      0.728 0.000 0.000 0.112 0.000 0.856 0.032
#> GSM955048     4  0.0865      0.900 0.036 0.000 0.000 0.964 0.000 0.000
#> GSM955049     2  0.0000      0.841 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM955054     2  0.0000      0.841 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM955064     2  0.1814      0.810 0.000 0.900 0.000 0.000 0.000 0.100
#> GSM955072     6  0.3126      0.565 0.000 0.248 0.000 0.000 0.000 0.752
#> GSM955075     5  0.3244      0.644 0.000 0.000 0.000 0.000 0.732 0.268
#> GSM955079     3  0.1092      0.832 0.000 0.020 0.960 0.000 0.000 0.020
#> GSM955087     4  0.1501      0.875 0.076 0.000 0.000 0.924 0.000 0.000
#> GSM955088     2  0.3245      0.680 0.000 0.764 0.228 0.000 0.000 0.008
#> GSM955089     1  0.1075      0.844 0.952 0.000 0.000 0.048 0.000 0.000
#> GSM955095     6  0.1444      0.755 0.000 0.000 0.000 0.000 0.072 0.928
#> GSM955097     6  0.0146      0.793 0.000 0.000 0.000 0.000 0.004 0.996
#> GSM955101     2  0.1267      0.829 0.000 0.940 0.000 0.000 0.000 0.060
#> GSM954999     3  0.0405      0.834 0.004 0.000 0.988 0.000 0.008 0.000
#> GSM955001     6  0.0000      0.794 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM955003     2  0.0000      0.841 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM955004     6  0.0000      0.794 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM955005     3  0.0146      0.834 0.004 0.000 0.996 0.000 0.000 0.000
#> GSM955009     6  0.0000      0.794 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM955011     3  0.3823      0.400 0.436 0.000 0.564 0.000 0.000 0.000
#> GSM955012     5  0.0000      0.743 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM955013     3  0.2473      0.800 0.000 0.008 0.856 0.000 0.136 0.000
#> GSM955015     2  0.2697      0.746 0.000 0.812 0.000 0.000 0.000 0.188
#> GSM955017     3  0.3446      0.653 0.308 0.000 0.692 0.000 0.000 0.000
#> GSM955021     2  0.2562      0.761 0.000 0.828 0.000 0.000 0.000 0.172
#> GSM955025     3  0.0870      0.835 0.004 0.012 0.972 0.000 0.000 0.012
#> GSM955028     4  0.0000      0.916 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM955029     5  0.2219      0.786 0.000 0.000 0.000 0.000 0.864 0.136
#> GSM955030     3  0.1644      0.834 0.040 0.000 0.932 0.000 0.028 0.000
#> GSM955032     2  0.3482      0.523 0.000 0.684 0.316 0.000 0.000 0.000
#> GSM955033     1  0.3168      0.795 0.828 0.000 0.116 0.000 0.056 0.000
#> GSM955034     4  0.0146      0.916 0.004 0.000 0.000 0.996 0.000 0.000
#> GSM955035     2  0.0632      0.839 0.000 0.976 0.000 0.000 0.000 0.024
#> GSM955036     3  0.4716      0.671 0.184 0.000 0.680 0.000 0.136 0.000
#> GSM955037     4  0.4046      0.691 0.084 0.000 0.168 0.748 0.000 0.000
#> GSM955039     3  0.4051      0.157 0.000 0.432 0.560 0.000 0.008 0.000
#> GSM955041     5  0.3620      0.469 0.000 0.352 0.000 0.000 0.648 0.000
#> GSM955042     1  0.1141      0.845 0.948 0.000 0.052 0.000 0.000 0.000
#> GSM955045     6  0.1471      0.758 0.000 0.000 0.004 0.000 0.064 0.932
#> GSM955046     3  0.0146      0.833 0.000 0.000 0.996 0.000 0.004 0.000
#> GSM955047     1  0.2230      0.845 0.892 0.000 0.024 0.084 0.000 0.000
#> GSM955050     3  0.3290      0.752 0.208 0.000 0.776 0.000 0.000 0.016
#> GSM955052     2  0.0000      0.841 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM955053     4  0.0363      0.917 0.012 0.000 0.000 0.988 0.000 0.000
#> GSM955056     2  0.0146      0.841 0.000 0.996 0.000 0.000 0.004 0.000
#> GSM955058     5  0.2219      0.786 0.000 0.000 0.000 0.000 0.864 0.136
#> GSM955059     3  0.2135      0.805 0.000 0.000 0.872 0.000 0.128 0.000
#> GSM955060     1  0.1663      0.847 0.912 0.000 0.000 0.088 0.000 0.000
#> GSM955061     5  0.2219      0.786 0.000 0.000 0.000 0.000 0.864 0.136
#> GSM955065     4  0.0790      0.905 0.032 0.000 0.000 0.968 0.000 0.000
#> GSM955066     3  0.0000      0.834 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM955067     1  0.2979      0.826 0.840 0.000 0.044 0.116 0.000 0.000
#> GSM955073     2  0.0508      0.841 0.000 0.984 0.012 0.000 0.004 0.000
#> GSM955074     3  0.3518      0.713 0.256 0.000 0.732 0.000 0.012 0.000
#> GSM955076     2  0.0000      0.841 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM955078     2  0.5181      0.045 0.000 0.484 0.000 0.000 0.428 0.088
#> GSM955083     3  0.4245      0.507 0.328 0.000 0.644 0.000 0.024 0.004
#> GSM955084     6  0.0000      0.794 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM955086     2  0.5016      0.666 0.028 0.696 0.144 0.000 0.000 0.132
#> GSM955091     2  0.2488      0.784 0.000 0.864 0.004 0.000 0.124 0.008
#> GSM955092     6  0.2378      0.697 0.000 0.152 0.000 0.000 0.000 0.848
#> GSM955093     2  0.0000      0.841 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM955098     2  0.0000      0.841 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM955099     2  0.2793      0.732 0.000 0.800 0.000 0.000 0.000 0.200
#> GSM955100     1  0.0937      0.842 0.960 0.000 0.040 0.000 0.000 0.000
#> GSM955103     2  0.2854      0.723 0.000 0.792 0.000 0.000 0.000 0.208
#> GSM955104     3  0.0146      0.834 0.004 0.000 0.996 0.000 0.000 0.000
#> GSM955106     5  0.0146      0.742 0.000 0.000 0.004 0.000 0.996 0.000
#> GSM955000     3  0.1124      0.834 0.036 0.000 0.956 0.008 0.000 0.000
#> GSM955006     1  0.0000      0.849 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM955007     3  0.5346      0.423 0.000 0.000 0.548 0.000 0.128 0.324
#> GSM955010     2  0.7401     -0.173 0.288 0.304 0.296 0.000 0.112 0.000
#> GSM955014     1  0.2003      0.839 0.884 0.000 0.000 0.116 0.000 0.000
#> GSM955018     3  0.1958      0.793 0.004 0.100 0.896 0.000 0.000 0.000
#> GSM955020     1  0.3810      0.383 0.572 0.000 0.000 0.428 0.000 0.000
#> GSM955024     2  0.5219      0.654 0.000 0.684 0.040 0.000 0.136 0.140
#> GSM955026     2  0.1700      0.832 0.000 0.928 0.048 0.000 0.000 0.024
#> GSM955031     2  0.0547      0.840 0.000 0.980 0.020 0.000 0.000 0.000
#> GSM955038     3  0.1003      0.835 0.020 0.016 0.964 0.000 0.000 0.000
#> GSM955040     1  0.2730      0.766 0.808 0.000 0.192 0.000 0.000 0.000
#> GSM955044     5  0.5040      0.568 0.000 0.212 0.000 0.000 0.636 0.152
#> GSM955051     1  0.1082      0.851 0.956 0.000 0.004 0.040 0.000 0.000
#> GSM955055     6  0.0000      0.794 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM955057     1  0.1588      0.853 0.924 0.000 0.004 0.072 0.000 0.000
#> GSM955062     6  0.3737      0.342 0.000 0.392 0.000 0.000 0.000 0.608
#> GSM955063     2  0.0000      0.841 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM955068     2  0.5583      0.353 0.000 0.508 0.336 0.000 0.000 0.156
#> GSM955069     3  0.3202      0.790 0.144 0.000 0.816 0.000 0.040 0.000
#> GSM955070     2  0.0713      0.839 0.000 0.972 0.000 0.000 0.000 0.028
#> GSM955071     1  0.3835      0.472 0.668 0.012 0.320 0.000 0.000 0.000
#> GSM955077     3  0.2135      0.789 0.128 0.000 0.872 0.000 0.000 0.000
#> GSM955080     6  0.0858      0.784 0.000 0.000 0.004 0.000 0.028 0.968
#> GSM955081     2  0.0790      0.837 0.000 0.968 0.032 0.000 0.000 0.000
#> GSM955082     2  0.2272      0.823 0.000 0.900 0.040 0.000 0.056 0.004
#> GSM955085     6  0.3309      0.577 0.000 0.280 0.000 0.000 0.000 0.720
#> GSM955090     1  0.1814      0.847 0.900 0.000 0.000 0.100 0.000 0.000
#> GSM955094     2  0.4527      0.696 0.000 0.724 0.132 0.000 0.136 0.008
#> GSM955096     2  0.2969      0.698 0.000 0.776 0.224 0.000 0.000 0.000
#> GSM955102     3  0.0146      0.833 0.000 0.000 0.996 0.004 0.000 0.000
#> GSM955105     2  0.2651      0.802 0.088 0.872 0.004 0.000 0.036 0.000

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

consensus_heatmap(res, k = 2)

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

consensus_heatmap(res, k = 3)

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

consensus_heatmap(res, k = 4)

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

consensus_heatmap(res, k = 5)

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

consensus_heatmap(res, k = 6)

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

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

membership_heatmap(res, k = 2)

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

membership_heatmap(res, k = 3)

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

membership_heatmap(res, k = 4)

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

membership_heatmap(res, k = 5)

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

membership_heatmap(res, k = 6)

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

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

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

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

get_signatures(res, k = 3)

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

get_signatures(res, k = 4)

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

get_signatures(res, k = 5)

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

get_signatures(res, k = 6)

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

Signature heatmaps where rows are not scaled:

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

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

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

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

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

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

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

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

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

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

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk MAD-pam-signature_compare

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

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

An example of the output of tb is:

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

The columns in tb are:

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

UMAP plot which shows how samples are separated.

dimension_reduction(res, k = 2, method = "UMAP")

plot of chunk tab-MAD-pam-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-MAD-pam-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-MAD-pam-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-MAD-pam-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-MAD-pam-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk MAD-pam-collect-classes

Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.

test_to_known_factors(res)
#>           n genotype/variation(p) k
#> MAD:pam 107                 0.566 2
#> MAD:pam 102                 0.421 3
#> MAD:pam  96                 0.290 4
#> MAD:pam  80                 0.143 5
#> MAD:pam  97                 0.584 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 31589 rows and 108 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'MAD' method.
#>   Subgroups are detected by 'mclust' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 2.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

collect_plots() function collects all the plots made from res for all k (number of partitions) into one single page to provide an easy and fast comparison between different k.

collect_plots(res)

plot of chunk MAD-mclust-collect-plots

The plots are:

All the plots in panels can be made by individual functions and they are plotted later in this section.

select_partition_number() produces several plots showing different statistics for choosing “optimized” k. There are following statistics:

The detailed explanations of these statistics can be found in the cola vignette.

Generally speaking, lower PAC score, higher mean silhouette score or higher concordance corresponds to better partition. Rand index and Jaccard index measure how similar the current partition is compared to partition with k-1. If they are too similar, we won't accept k is better than k-1.

select_partition_number(res)

plot of chunk MAD-mclust-select-partition-number

The numeric values for all these statistics can be obtained by get_stats().

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 1.000           0.989       0.995         0.3485 0.651   0.651
#> 3 3 0.598           0.799       0.847         0.6686 0.709   0.553
#> 4 4 0.639           0.761       0.877         0.1847 0.896   0.733
#> 5 5 0.613           0.693       0.798         0.0690 0.845   0.570
#> 6 6 0.558           0.565       0.755         0.0514 0.917   0.695

suggest_best_k() suggests the best \(k\) based on these statistics. The rules are as follows:

suggest_best_k(res)
#> [1] 2

Following shows the table of the partitions (You need to click the show/hide code output link to see it). The membership matrix (columns with name p*) is inferred by clue::cl_consensus() function with the SE method. Basically the value in the membership matrix represents the probability to belong to a certain group. The finall class label for an item is determined with the group with highest probability it belongs to.

In get_classes() function, the entropy is calculated from the membership matrix and the silhouette score is calculated from the consensus matrix.

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>           class entropy silhouette    p1    p2
#> GSM955002     2  0.0000      0.998 0.000 1.000
#> GSM955008     2  0.0000      0.998 0.000 1.000
#> GSM955016     1  0.0376      0.984 0.996 0.004
#> GSM955019     2  0.0000      0.998 0.000 1.000
#> GSM955022     2  0.0000      0.998 0.000 1.000
#> GSM955023     2  0.0000      0.998 0.000 1.000
#> GSM955027     2  0.0000      0.998 0.000 1.000
#> GSM955043     2  0.0000      0.998 0.000 1.000
#> GSM955048     1  0.0000      0.987 1.000 0.000
#> GSM955049     2  0.0000      0.998 0.000 1.000
#> GSM955054     2  0.0000      0.998 0.000 1.000
#> GSM955064     2  0.0000      0.998 0.000 1.000
#> GSM955072     2  0.0000      0.998 0.000 1.000
#> GSM955075     2  0.0000      0.998 0.000 1.000
#> GSM955079     2  0.0000      0.998 0.000 1.000
#> GSM955087     1  0.0000      0.987 1.000 0.000
#> GSM955088     2  0.0000      0.998 0.000 1.000
#> GSM955089     1  0.0000      0.987 1.000 0.000
#> GSM955095     2  0.0000      0.998 0.000 1.000
#> GSM955097     2  0.0000      0.998 0.000 1.000
#> GSM955101     2  0.0000      0.998 0.000 1.000
#> GSM954999     2  0.0000      0.998 0.000 1.000
#> GSM955001     2  0.0000      0.998 0.000 1.000
#> GSM955003     2  0.0000      0.998 0.000 1.000
#> GSM955004     2  0.0000      0.998 0.000 1.000
#> GSM955005     2  0.0000      0.998 0.000 1.000
#> GSM955009     2  0.0000      0.998 0.000 1.000
#> GSM955011     1  0.0000      0.987 1.000 0.000
#> GSM955012     2  0.0000      0.998 0.000 1.000
#> GSM955013     2  0.0000      0.998 0.000 1.000
#> GSM955015     2  0.0000      0.998 0.000 1.000
#> GSM955017     1  0.0000      0.987 1.000 0.000
#> GSM955021     2  0.0000      0.998 0.000 1.000
#> GSM955025     2  0.0000      0.998 0.000 1.000
#> GSM955028     1  0.0000      0.987 1.000 0.000
#> GSM955029     2  0.0000      0.998 0.000 1.000
#> GSM955030     2  0.0000      0.998 0.000 1.000
#> GSM955032     2  0.0000      0.998 0.000 1.000
#> GSM955033     2  0.0000      0.998 0.000 1.000
#> GSM955034     1  0.0000      0.987 1.000 0.000
#> GSM955035     2  0.0000      0.998 0.000 1.000
#> GSM955036     2  0.0000      0.998 0.000 1.000
#> GSM955037     1  0.0000      0.987 1.000 0.000
#> GSM955039     2  0.0000      0.998 0.000 1.000
#> GSM955041     2  0.0000      0.998 0.000 1.000
#> GSM955042     1  0.8661      0.598 0.712 0.288
#> GSM955045     2  0.0000      0.998 0.000 1.000
#> GSM955046     2  0.0000      0.998 0.000 1.000
#> GSM955047     1  0.0000      0.987 1.000 0.000
#> GSM955050     2  0.0000      0.998 0.000 1.000
#> GSM955052     2  0.0000      0.998 0.000 1.000
#> GSM955053     1  0.0000      0.987 1.000 0.000
#> GSM955056     2  0.0000      0.998 0.000 1.000
#> GSM955058     2  0.0000      0.998 0.000 1.000
#> GSM955059     2  0.0000      0.998 0.000 1.000
#> GSM955060     1  0.0000      0.987 1.000 0.000
#> GSM955061     2  0.0000      0.998 0.000 1.000
#> GSM955065     1  0.0000      0.987 1.000 0.000
#> GSM955066     2  0.0000      0.998 0.000 1.000
#> GSM955067     1  0.0000      0.987 1.000 0.000
#> GSM955073     2  0.0000      0.998 0.000 1.000
#> GSM955074     1  0.0376      0.984 0.996 0.004
#> GSM955076     2  0.0000      0.998 0.000 1.000
#> GSM955078     2  0.0000      0.998 0.000 1.000
#> GSM955083     2  0.0000      0.998 0.000 1.000
#> GSM955084     2  0.0000      0.998 0.000 1.000
#> GSM955086     2  0.0000      0.998 0.000 1.000
#> GSM955091     2  0.0000      0.998 0.000 1.000
#> GSM955092     2  0.0000      0.998 0.000 1.000
#> GSM955093     2  0.0000      0.998 0.000 1.000
#> GSM955098     2  0.0000      0.998 0.000 1.000
#> GSM955099     2  0.0000      0.998 0.000 1.000
#> GSM955100     1  0.0376      0.984 0.996 0.004
#> GSM955103     2  0.0000      0.998 0.000 1.000
#> GSM955104     2  0.0000      0.998 0.000 1.000
#> GSM955106     2  0.0000      0.998 0.000 1.000
#> GSM955000     1  0.0000      0.987 1.000 0.000
#> GSM955006     1  0.0000      0.987 1.000 0.000
#> GSM955007     2  0.0000      0.998 0.000 1.000
#> GSM955010     2  0.4161      0.908 0.084 0.916
#> GSM955014     1  0.0000      0.987 1.000 0.000
#> GSM955018     2  0.0000      0.998 0.000 1.000
#> GSM955020     1  0.0000      0.987 1.000 0.000
#> GSM955024     2  0.0000      0.998 0.000 1.000
#> GSM955026     2  0.0000      0.998 0.000 1.000
#> GSM955031     2  0.0000      0.998 0.000 1.000
#> GSM955038     2  0.0000      0.998 0.000 1.000
#> GSM955040     2  0.0000      0.998 0.000 1.000
#> GSM955044     2  0.0000      0.998 0.000 1.000
#> GSM955051     1  0.0000      0.987 1.000 0.000
#> GSM955055     2  0.0000      0.998 0.000 1.000
#> GSM955057     1  0.0000      0.987 1.000 0.000
#> GSM955062     2  0.0000      0.998 0.000 1.000
#> GSM955063     2  0.0000      0.998 0.000 1.000
#> GSM955068     2  0.0000      0.998 0.000 1.000
#> GSM955069     2  0.0000      0.998 0.000 1.000
#> GSM955070     2  0.0000      0.998 0.000 1.000
#> GSM955071     2  0.0000      0.998 0.000 1.000
#> GSM955077     2  0.0000      0.998 0.000 1.000
#> GSM955080     2  0.0000      0.998 0.000 1.000
#> GSM955081     2  0.0000      0.998 0.000 1.000
#> GSM955082     2  0.0000      0.998 0.000 1.000
#> GSM955085     2  0.0000      0.998 0.000 1.000
#> GSM955090     1  0.0000      0.987 1.000 0.000
#> GSM955094     2  0.0000      0.998 0.000 1.000
#> GSM955096     2  0.0000      0.998 0.000 1.000
#> GSM955102     2  0.5178      0.869 0.116 0.884
#> GSM955105     2  0.0000      0.998 0.000 1.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1    p2    p3
#> GSM955002     2  0.5678     0.8072 0.000 0.684 0.316
#> GSM955008     3  0.4974     0.5772 0.000 0.236 0.764
#> GSM955016     1  0.0000     0.9943 1.000 0.000 0.000
#> GSM955019     2  0.4796     0.8704 0.000 0.780 0.220
#> GSM955022     3  0.3192     0.7718 0.000 0.112 0.888
#> GSM955023     3  0.6309    -0.4297 0.000 0.496 0.504
#> GSM955027     2  0.4605     0.8680 0.000 0.796 0.204
#> GSM955043     2  0.4702     0.8696 0.000 0.788 0.212
#> GSM955048     1  0.0000     0.9943 1.000 0.000 0.000
#> GSM955049     2  0.5178     0.8560 0.000 0.744 0.256
#> GSM955054     2  0.6235     0.6037 0.000 0.564 0.436
#> GSM955064     2  0.5397     0.8403 0.000 0.720 0.280
#> GSM955072     2  0.4399     0.8620 0.000 0.812 0.188
#> GSM955075     2  0.1289     0.6841 0.000 0.968 0.032
#> GSM955079     3  0.1964     0.8211 0.000 0.056 0.944
#> GSM955087     1  0.0424     0.9922 0.992 0.008 0.000
#> GSM955088     3  0.0424     0.8440 0.000 0.008 0.992
#> GSM955089     1  0.0000     0.9943 1.000 0.000 0.000
#> GSM955095     2  0.5621     0.8174 0.000 0.692 0.308
#> GSM955097     2  0.4931     0.8680 0.000 0.768 0.232
#> GSM955101     3  0.4346     0.6755 0.000 0.184 0.816
#> GSM954999     3  0.6140    -0.0239 0.000 0.404 0.596
#> GSM955001     2  0.4796     0.8704 0.000 0.780 0.220
#> GSM955003     2  0.6295     0.5055 0.000 0.528 0.472
#> GSM955004     2  0.4399     0.8620 0.000 0.812 0.188
#> GSM955005     3  0.0892     0.8423 0.000 0.020 0.980
#> GSM955009     2  0.4399     0.8620 0.000 0.812 0.188
#> GSM955011     1  0.0000     0.9943 1.000 0.000 0.000
#> GSM955012     2  0.1529     0.6869 0.000 0.960 0.040
#> GSM955013     3  0.5882     0.2379 0.000 0.348 0.652
#> GSM955015     2  0.6192     0.6393 0.000 0.580 0.420
#> GSM955017     1  0.0000     0.9943 1.000 0.000 0.000
#> GSM955021     2  0.4974     0.8663 0.000 0.764 0.236
#> GSM955025     2  0.4452     0.8641 0.000 0.808 0.192
#> GSM955028     1  0.0424     0.9922 0.992 0.008 0.000
#> GSM955029     2  0.1031     0.6769 0.000 0.976 0.024
#> GSM955030     3  0.0000     0.8433 0.000 0.000 1.000
#> GSM955032     3  0.1031     0.8408 0.000 0.024 0.976
#> GSM955033     2  0.5529     0.8286 0.000 0.704 0.296
#> GSM955034     1  0.0424     0.9922 0.992 0.008 0.000
#> GSM955035     2  0.4931     0.8677 0.000 0.768 0.232
#> GSM955036     3  0.0000     0.8433 0.000 0.000 1.000
#> GSM955037     1  0.3295     0.9034 0.896 0.008 0.096
#> GSM955039     3  0.5678     0.3669 0.000 0.316 0.684
#> GSM955041     2  0.6026     0.7222 0.000 0.624 0.376
#> GSM955042     1  0.0475     0.9871 0.992 0.004 0.004
#> GSM955045     2  0.5678     0.8077 0.000 0.684 0.316
#> GSM955046     3  0.0000     0.8433 0.000 0.000 1.000
#> GSM955047     1  0.0000     0.9943 1.000 0.000 0.000
#> GSM955050     2  0.5956     0.7960 0.004 0.672 0.324
#> GSM955052     3  0.0424     0.8440 0.000 0.008 0.992
#> GSM955053     1  0.0424     0.9922 0.992 0.008 0.000
#> GSM955056     3  0.3412     0.7587 0.000 0.124 0.876
#> GSM955058     2  0.1163     0.6794 0.000 0.972 0.028
#> GSM955059     3  0.0000     0.8433 0.000 0.000 1.000
#> GSM955060     1  0.0000     0.9943 1.000 0.000 0.000
#> GSM955061     2  0.1411     0.6862 0.000 0.964 0.036
#> GSM955065     1  0.0424     0.9922 0.992 0.008 0.000
#> GSM955066     3  0.0000     0.8433 0.000 0.000 1.000
#> GSM955067     1  0.0000     0.9943 1.000 0.000 0.000
#> GSM955073     3  0.0000     0.8433 0.000 0.000 1.000
#> GSM955074     1  0.0000     0.9943 1.000 0.000 0.000
#> GSM955076     2  0.4887     0.8658 0.000 0.772 0.228
#> GSM955078     2  0.4399     0.8620 0.000 0.812 0.188
#> GSM955083     2  0.6026     0.7224 0.000 0.624 0.376
#> GSM955084     2  0.4399     0.8620 0.000 0.812 0.188
#> GSM955086     3  0.0892     0.8422 0.000 0.020 0.980
#> GSM955091     2  0.4654     0.8689 0.000 0.792 0.208
#> GSM955092     2  0.5678     0.8078 0.000 0.684 0.316
#> GSM955093     3  0.0000     0.8433 0.000 0.000 1.000
#> GSM955098     2  0.4399     0.8620 0.000 0.812 0.188
#> GSM955099     2  0.4504     0.8656 0.000 0.804 0.196
#> GSM955100     1  0.0000     0.9943 1.000 0.000 0.000
#> GSM955103     2  0.6299     0.4962 0.000 0.524 0.476
#> GSM955104     3  0.0000     0.8433 0.000 0.000 1.000
#> GSM955106     2  0.4750     0.8703 0.000 0.784 0.216
#> GSM955000     1  0.0424     0.9922 0.992 0.008 0.000
#> GSM955006     1  0.0000     0.9943 1.000 0.000 0.000
#> GSM955007     3  0.1163     0.8390 0.000 0.028 0.972
#> GSM955010     3  0.1289     0.8267 0.032 0.000 0.968
#> GSM955014     1  0.0000     0.9943 1.000 0.000 0.000
#> GSM955018     3  0.0000     0.8433 0.000 0.000 1.000
#> GSM955020     1  0.0000     0.9943 1.000 0.000 0.000
#> GSM955024     2  0.6267     0.5678 0.000 0.548 0.452
#> GSM955026     2  0.4399     0.8620 0.000 0.812 0.188
#> GSM955031     3  0.5905     0.2393 0.000 0.352 0.648
#> GSM955038     2  0.4842     0.8693 0.000 0.776 0.224
#> GSM955040     2  0.6587     0.6208 0.008 0.568 0.424
#> GSM955044     2  0.4452     0.8640 0.000 0.808 0.192
#> GSM955051     1  0.0000     0.9943 1.000 0.000 0.000
#> GSM955055     2  0.4750     0.8703 0.000 0.784 0.216
#> GSM955057     1  0.0000     0.9943 1.000 0.000 0.000
#> GSM955062     2  0.5560     0.8236 0.000 0.700 0.300
#> GSM955063     3  0.0000     0.8433 0.000 0.000 1.000
#> GSM955068     2  0.4399     0.8620 0.000 0.812 0.188
#> GSM955069     3  0.0000     0.8433 0.000 0.000 1.000
#> GSM955070     2  0.4796     0.8704 0.000 0.780 0.220
#> GSM955071     3  0.4002     0.7120 0.000 0.160 0.840
#> GSM955077     2  0.4974     0.8666 0.000 0.764 0.236
#> GSM955080     2  0.4750     0.8703 0.000 0.784 0.216
#> GSM955081     2  0.6299     0.4932 0.000 0.524 0.476
#> GSM955082     3  0.6260    -0.2417 0.000 0.448 0.552
#> GSM955085     2  0.4654     0.8689 0.000 0.792 0.208
#> GSM955090     1  0.0000     0.9943 1.000 0.000 0.000
#> GSM955094     2  0.4796     0.8704 0.000 0.780 0.220
#> GSM955096     3  0.1411     0.8346 0.000 0.036 0.964
#> GSM955102     3  0.0237     0.8393 0.004 0.000 0.996
#> GSM955105     3  0.0592     0.8437 0.000 0.012 0.988

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM955002     2  0.3583     0.6955 0.000 0.816 0.180 0.004
#> GSM955008     3  0.3311     0.7799 0.000 0.172 0.828 0.000
#> GSM955016     1  0.0000     0.9869 1.000 0.000 0.000 0.000
#> GSM955019     2  0.0524     0.7619 0.000 0.988 0.008 0.004
#> GSM955022     3  0.3143     0.8331 0.008 0.024 0.888 0.080
#> GSM955023     3  0.4522     0.6416 0.004 0.264 0.728 0.004
#> GSM955027     2  0.0927     0.7647 0.000 0.976 0.016 0.008
#> GSM955043     2  0.4335     0.6598 0.008 0.792 0.016 0.184
#> GSM955048     1  0.0000     0.9869 1.000 0.000 0.000 0.000
#> GSM955049     2  0.4284     0.6616 0.000 0.764 0.224 0.012
#> GSM955054     2  0.4936     0.4340 0.000 0.624 0.372 0.004
#> GSM955064     2  0.5513     0.3800 0.004 0.596 0.384 0.016
#> GSM955072     2  0.0524     0.7615 0.008 0.988 0.000 0.004
#> GSM955075     4  0.1302     0.9720 0.000 0.044 0.000 0.956
#> GSM955079     3  0.1209     0.8606 0.004 0.032 0.964 0.000
#> GSM955087     1  0.1022     0.9726 0.968 0.000 0.000 0.032
#> GSM955088     3  0.0000     0.8571 0.000 0.000 1.000 0.000
#> GSM955089     1  0.0000     0.9869 1.000 0.000 0.000 0.000
#> GSM955095     2  0.7913     0.2885 0.012 0.448 0.348 0.192
#> GSM955097     2  0.8724     0.0619 0.180 0.416 0.060 0.344
#> GSM955101     3  0.2760     0.8198 0.000 0.128 0.872 0.000
#> GSM954999     3  0.8335     0.5015 0.168 0.132 0.568 0.132
#> GSM955001     2  0.1174     0.7651 0.000 0.968 0.020 0.012
#> GSM955003     2  0.5190     0.3709 0.004 0.596 0.396 0.004
#> GSM955004     2  0.3900     0.6418 0.020 0.816 0.000 0.164
#> GSM955005     3  0.0657     0.8615 0.004 0.012 0.984 0.000
#> GSM955009     2  0.0657     0.7622 0.012 0.984 0.000 0.004
#> GSM955011     1  0.0000     0.9869 1.000 0.000 0.000 0.000
#> GSM955012     4  0.1302     0.9720 0.000 0.044 0.000 0.956
#> GSM955013     3  0.4073     0.8208 0.012 0.064 0.848 0.076
#> GSM955015     2  0.5168     0.0397 0.000 0.504 0.492 0.004
#> GSM955017     1  0.0000     0.9869 1.000 0.000 0.000 0.000
#> GSM955021     2  0.1492     0.7657 0.004 0.956 0.036 0.004
#> GSM955025     2  0.0895     0.7613 0.020 0.976 0.000 0.004
#> GSM955028     1  0.1022     0.9726 0.968 0.000 0.000 0.032
#> GSM955029     4  0.2149     0.9493 0.000 0.088 0.000 0.912
#> GSM955030     3  0.0707     0.8559 0.020 0.000 0.980 0.000
#> GSM955032     3  0.0817     0.8611 0.000 0.024 0.976 0.000
#> GSM955033     2  0.7287     0.5804 0.040 0.632 0.180 0.148
#> GSM955034     1  0.1022     0.9726 0.968 0.000 0.000 0.032
#> GSM955035     2  0.1576     0.7617 0.000 0.948 0.048 0.004
#> GSM955036     3  0.5287     0.6840 0.156 0.008 0.760 0.076
#> GSM955037     1  0.3342     0.8525 0.868 0.000 0.100 0.032
#> GSM955039     3  0.4567     0.7374 0.008 0.196 0.776 0.020
#> GSM955041     3  0.6252     0.4705 0.004 0.312 0.616 0.068
#> GSM955042     1  0.0000     0.9869 1.000 0.000 0.000 0.000
#> GSM955045     2  0.6958     0.1552 0.004 0.472 0.428 0.096
#> GSM955046     3  0.0336     0.8592 0.008 0.000 0.992 0.000
#> GSM955047     1  0.0000     0.9869 1.000 0.000 0.000 0.000
#> GSM955050     2  0.4616     0.6126 0.216 0.760 0.020 0.004
#> GSM955052     3  0.0188     0.8590 0.000 0.004 0.996 0.000
#> GSM955053     1  0.1022     0.9726 0.968 0.000 0.000 0.032
#> GSM955056     3  0.2921     0.8063 0.000 0.140 0.860 0.000
#> GSM955058     4  0.1867     0.9664 0.000 0.072 0.000 0.928
#> GSM955059     3  0.0188     0.8595 0.004 0.000 0.996 0.000
#> GSM955060     1  0.0000     0.9869 1.000 0.000 0.000 0.000
#> GSM955061     4  0.1474     0.9744 0.000 0.052 0.000 0.948
#> GSM955065     1  0.1022     0.9726 0.968 0.000 0.000 0.032
#> GSM955066     3  0.0188     0.8595 0.004 0.000 0.996 0.000
#> GSM955067     1  0.0000     0.9869 1.000 0.000 0.000 0.000
#> GSM955073     3  0.0188     0.8595 0.004 0.000 0.996 0.000
#> GSM955074     1  0.0000     0.9869 1.000 0.000 0.000 0.000
#> GSM955076     2  0.0524     0.7609 0.008 0.988 0.000 0.004
#> GSM955078     2  0.0672     0.7613 0.008 0.984 0.000 0.008
#> GSM955083     2  0.9442     0.2603 0.148 0.392 0.292 0.168
#> GSM955084     2  0.2843     0.7144 0.020 0.892 0.000 0.088
#> GSM955086     3  0.0817     0.8615 0.000 0.024 0.976 0.000
#> GSM955091     2  0.0657     0.7630 0.000 0.984 0.012 0.004
#> GSM955092     2  0.4584     0.5633 0.000 0.696 0.300 0.004
#> GSM955093     3  0.0188     0.8595 0.004 0.000 0.996 0.000
#> GSM955098     2  0.0895     0.7613 0.020 0.976 0.000 0.004
#> GSM955099     2  0.0188     0.7572 0.000 0.996 0.000 0.004
#> GSM955100     1  0.0000     0.9869 1.000 0.000 0.000 0.000
#> GSM955103     3  0.5801     0.7278 0.008 0.128 0.728 0.136
#> GSM955104     3  0.0469     0.8587 0.012 0.000 0.988 0.000
#> GSM955106     2  0.6438     0.1876 0.000 0.496 0.068 0.436
#> GSM955000     1  0.0707     0.9783 0.980 0.000 0.000 0.020
#> GSM955006     1  0.0000     0.9869 1.000 0.000 0.000 0.000
#> GSM955007     3  0.0188     0.8595 0.004 0.000 0.996 0.000
#> GSM955010     3  0.2469     0.8050 0.108 0.000 0.892 0.000
#> GSM955014     1  0.0000     0.9869 1.000 0.000 0.000 0.000
#> GSM955018     3  0.0188     0.8595 0.004 0.000 0.996 0.000
#> GSM955020     1  0.0000     0.9869 1.000 0.000 0.000 0.000
#> GSM955024     3  0.5099     0.7107 0.004 0.200 0.748 0.048
#> GSM955026     2  0.0779     0.7619 0.016 0.980 0.000 0.004
#> GSM955031     2  0.5486     0.6197 0.200 0.720 0.080 0.000
#> GSM955038     2  0.1398     0.7567 0.040 0.956 0.000 0.004
#> GSM955040     2  0.6832     0.4739 0.296 0.572 0.132 0.000
#> GSM955044     2  0.1909     0.7544 0.008 0.940 0.004 0.048
#> GSM955051     1  0.0000     0.9869 1.000 0.000 0.000 0.000
#> GSM955055     2  0.0895     0.7645 0.000 0.976 0.020 0.004
#> GSM955057     1  0.0000     0.9869 1.000 0.000 0.000 0.000
#> GSM955062     2  0.4535     0.5708 0.000 0.704 0.292 0.004
#> GSM955063     3  0.0188     0.8595 0.004 0.000 0.996 0.000
#> GSM955068     2  0.0657     0.7622 0.012 0.984 0.000 0.004
#> GSM955069     3  0.0188     0.8595 0.004 0.000 0.996 0.000
#> GSM955070     2  0.1211     0.7642 0.000 0.960 0.040 0.000
#> GSM955071     3  0.4224     0.8100 0.076 0.100 0.824 0.000
#> GSM955077     2  0.1229     0.7644 0.020 0.968 0.008 0.004
#> GSM955080     2  0.6310     0.2144 0.000 0.512 0.060 0.428
#> GSM955081     3  0.5143     0.1239 0.004 0.456 0.540 0.000
#> GSM955082     3  0.4220     0.6593 0.004 0.248 0.748 0.000
#> GSM955085     2  0.0804     0.7638 0.000 0.980 0.012 0.008
#> GSM955090     1  0.0000     0.9869 1.000 0.000 0.000 0.000
#> GSM955094     2  0.2676     0.7581 0.012 0.916 0.028 0.044
#> GSM955096     3  0.2081     0.8423 0.000 0.084 0.916 0.000
#> GSM955102     3  0.3123     0.7363 0.156 0.000 0.844 0.000
#> GSM955105     3  0.0707     0.8615 0.000 0.020 0.980 0.000

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM955002     2  0.4473      0.171 0.000 0.580 0.412 0.008 0.000
#> GSM955008     3  0.4375      0.762 0.000 0.116 0.776 0.104 0.004
#> GSM955016     1  0.2362      0.839 0.916 0.024 0.000 0.032 0.028
#> GSM955019     2  0.0609      0.720 0.000 0.980 0.000 0.020 0.000
#> GSM955022     3  0.3615      0.796 0.004 0.080 0.844 0.008 0.064
#> GSM955023     3  0.5123      0.524 0.004 0.336 0.616 0.044 0.000
#> GSM955027     2  0.1716      0.718 0.000 0.944 0.016 0.016 0.024
#> GSM955043     2  0.6363      0.266 0.004 0.560 0.080 0.032 0.324
#> GSM955048     1  0.0451      0.855 0.988 0.000 0.000 0.008 0.004
#> GSM955049     2  0.0290      0.732 0.000 0.992 0.008 0.000 0.000
#> GSM955054     3  0.6028      0.281 0.000 0.372 0.524 0.096 0.008
#> GSM955064     2  0.4047      0.616 0.004 0.788 0.172 0.008 0.028
#> GSM955072     4  0.4375      0.747 0.004 0.420 0.000 0.576 0.000
#> GSM955075     5  0.0865      0.706 0.000 0.024 0.000 0.004 0.972
#> GSM955079     3  0.1525      0.819 0.004 0.036 0.948 0.012 0.000
#> GSM955087     1  0.2416      0.827 0.888 0.000 0.000 0.100 0.012
#> GSM955088     3  0.0404      0.814 0.000 0.012 0.988 0.000 0.000
#> GSM955089     1  0.2171      0.847 0.912 0.000 0.000 0.064 0.024
#> GSM955095     3  0.6900      0.520 0.008 0.212 0.576 0.040 0.164
#> GSM955097     5  0.9452      0.152 0.212 0.060 0.220 0.216 0.292
#> GSM955101     3  0.3062      0.806 0.000 0.080 0.868 0.048 0.004
#> GSM954999     3  0.7393      0.483 0.188 0.072 0.588 0.040 0.112
#> GSM955001     2  0.0451      0.729 0.000 0.988 0.004 0.008 0.000
#> GSM955003     3  0.5797      0.508 0.000 0.280 0.608 0.104 0.008
#> GSM955004     4  0.5829      0.760 0.008 0.200 0.000 0.636 0.156
#> GSM955005     3  0.0854      0.815 0.004 0.012 0.976 0.008 0.000
#> GSM955009     4  0.4101      0.852 0.004 0.332 0.000 0.664 0.000
#> GSM955011     1  0.1522      0.842 0.944 0.000 0.044 0.012 0.000
#> GSM955012     5  0.0865      0.706 0.000 0.024 0.000 0.004 0.972
#> GSM955013     3  0.3541      0.797 0.012 0.072 0.852 0.004 0.060
#> GSM955015     2  0.5764      0.215 0.000 0.548 0.364 0.084 0.004
#> GSM955017     1  0.0000      0.855 1.000 0.000 0.000 0.000 0.000
#> GSM955021     2  0.5479      0.446 0.000 0.660 0.216 0.120 0.004
#> GSM955025     4  0.4547      0.868 0.024 0.252 0.012 0.712 0.000
#> GSM955028     1  0.2416      0.827 0.888 0.000 0.000 0.100 0.012
#> GSM955029     5  0.1041      0.703 0.000 0.032 0.000 0.004 0.964
#> GSM955030     3  0.0798      0.806 0.008 0.000 0.976 0.016 0.000
#> GSM955032     3  0.1818      0.816 0.000 0.044 0.932 0.024 0.000
#> GSM955033     3  0.8878      0.265 0.156 0.204 0.444 0.088 0.108
#> GSM955034     1  0.2130      0.831 0.908 0.000 0.000 0.080 0.012
#> GSM955035     2  0.0807      0.732 0.000 0.976 0.012 0.012 0.000
#> GSM955036     3  0.6519      0.511 0.188 0.020 0.636 0.032 0.124
#> GSM955037     1  0.4777      0.711 0.748 0.000 0.128 0.116 0.008
#> GSM955039     3  0.3002      0.805 0.004 0.092 0.872 0.004 0.028
#> GSM955041     3  0.5550      0.684 0.004 0.212 0.680 0.016 0.088
#> GSM955042     1  0.2124      0.844 0.916 0.000 0.000 0.056 0.028
#> GSM955045     2  0.6064      0.335 0.004 0.568 0.328 0.012 0.088
#> GSM955046     3  0.1978      0.808 0.000 0.044 0.928 0.024 0.004
#> GSM955047     1  0.0000      0.855 1.000 0.000 0.000 0.000 0.000
#> GSM955050     1  0.8399     -0.234 0.324 0.172 0.200 0.304 0.000
#> GSM955052     3  0.2867      0.808 0.000 0.072 0.880 0.044 0.004
#> GSM955053     1  0.2416      0.827 0.888 0.000 0.000 0.100 0.012
#> GSM955056     3  0.4228      0.771 0.000 0.108 0.788 0.100 0.004
#> GSM955058     5  0.0955      0.706 0.000 0.028 0.000 0.004 0.968
#> GSM955059     3  0.0510      0.807 0.000 0.000 0.984 0.016 0.000
#> GSM955060     1  0.0000      0.855 1.000 0.000 0.000 0.000 0.000
#> GSM955061     5  0.0955      0.706 0.000 0.028 0.000 0.004 0.968
#> GSM955065     1  0.2416      0.827 0.888 0.000 0.000 0.100 0.012
#> GSM955066     3  0.0566      0.808 0.004 0.000 0.984 0.012 0.000
#> GSM955067     1  0.1357      0.849 0.948 0.000 0.000 0.048 0.004
#> GSM955073     3  0.1281      0.815 0.000 0.032 0.956 0.012 0.000
#> GSM955074     1  0.2302      0.844 0.916 0.016 0.000 0.048 0.020
#> GSM955076     4  0.4310      0.787 0.004 0.392 0.000 0.604 0.000
#> GSM955078     4  0.5152      0.846 0.004 0.312 0.000 0.632 0.052
#> GSM955083     3  0.8791      0.249 0.204 0.128 0.456 0.080 0.132
#> GSM955084     4  0.5537      0.819 0.008 0.220 0.000 0.660 0.112
#> GSM955086     3  0.1173      0.817 0.004 0.020 0.964 0.012 0.000
#> GSM955091     2  0.0290      0.725 0.000 0.992 0.000 0.008 0.000
#> GSM955092     2  0.2104      0.708 0.000 0.916 0.060 0.024 0.000
#> GSM955093     3  0.0404      0.807 0.000 0.000 0.988 0.012 0.000
#> GSM955098     4  0.3910      0.874 0.008 0.272 0.000 0.720 0.000
#> GSM955099     2  0.0404      0.723 0.000 0.988 0.000 0.012 0.000
#> GSM955100     1  0.1205      0.846 0.956 0.000 0.040 0.004 0.000
#> GSM955103     3  0.4643      0.755 0.004 0.124 0.768 0.008 0.096
#> GSM955104     3  0.1517      0.813 0.004 0.028 0.952 0.012 0.004
#> GSM955106     5  0.7445      0.379 0.000 0.116 0.276 0.112 0.496
#> GSM955000     1  0.1357      0.845 0.948 0.000 0.000 0.048 0.004
#> GSM955006     1  0.1787      0.850 0.936 0.000 0.004 0.044 0.016
#> GSM955007     3  0.2568      0.810 0.004 0.096 0.888 0.004 0.008
#> GSM955010     3  0.2669      0.748 0.104 0.000 0.876 0.020 0.000
#> GSM955014     1  0.0613      0.856 0.984 0.000 0.004 0.008 0.004
#> GSM955018     3  0.0290      0.808 0.000 0.000 0.992 0.008 0.000
#> GSM955020     1  0.1830      0.851 0.924 0.000 0.000 0.068 0.008
#> GSM955024     3  0.4809      0.684 0.004 0.244 0.708 0.012 0.032
#> GSM955026     4  0.4132      0.872 0.020 0.260 0.000 0.720 0.000
#> GSM955031     1  0.8603     -0.333 0.268 0.228 0.252 0.252 0.000
#> GSM955038     4  0.5123      0.833 0.056 0.224 0.020 0.700 0.000
#> GSM955040     1  0.8078     -0.142 0.352 0.140 0.352 0.156 0.000
#> GSM955044     2  0.5818      0.390 0.004 0.684 0.028 0.144 0.140
#> GSM955051     1  0.0451      0.855 0.988 0.000 0.004 0.008 0.000
#> GSM955055     2  0.0451      0.729 0.000 0.988 0.004 0.008 0.000
#> GSM955057     1  0.0324      0.855 0.992 0.000 0.000 0.004 0.004
#> GSM955062     2  0.1579      0.724 0.000 0.944 0.032 0.024 0.000
#> GSM955063     3  0.1522      0.817 0.000 0.044 0.944 0.012 0.000
#> GSM955068     4  0.4046      0.869 0.008 0.296 0.000 0.696 0.000
#> GSM955069     3  0.0703      0.804 0.000 0.000 0.976 0.024 0.000
#> GSM955070     2  0.0807      0.730 0.000 0.976 0.012 0.012 0.000
#> GSM955071     3  0.3369      0.770 0.092 0.028 0.856 0.024 0.000
#> GSM955077     4  0.5714      0.796 0.024 0.268 0.072 0.636 0.000
#> GSM955080     5  0.7520      0.327 0.000 0.232 0.224 0.068 0.476
#> GSM955081     3  0.3562      0.737 0.000 0.196 0.788 0.016 0.000
#> GSM955082     3  0.4323      0.742 0.004 0.200 0.752 0.044 0.000
#> GSM955085     2  0.0290      0.725 0.000 0.992 0.000 0.008 0.000
#> GSM955090     1  0.2166      0.848 0.912 0.004 0.000 0.072 0.012
#> GSM955094     2  0.4610      0.596 0.008 0.772 0.160 0.028 0.032
#> GSM955096     3  0.3081      0.805 0.000 0.072 0.868 0.056 0.004
#> GSM955102     3  0.2915      0.727 0.116 0.000 0.860 0.024 0.000
#> GSM955105     3  0.0566      0.814 0.000 0.012 0.984 0.004 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM955002     2  0.4591    0.14515 0.000 0.588 0.376 0.024 0.012 0.000
#> GSM955008     6  0.6236    0.83124 0.000 0.280 0.288 0.008 0.000 0.424
#> GSM955016     1  0.3906    0.79291 0.780 0.004 0.000 0.068 0.004 0.144
#> GSM955019     2  0.0748    0.59221 0.000 0.976 0.004 0.016 0.004 0.000
#> GSM955022     3  0.5189    0.47876 0.000 0.276 0.612 0.008 0.104 0.000
#> GSM955023     2  0.4620   -0.04713 0.000 0.500 0.472 0.008 0.004 0.016
#> GSM955027     2  0.3003    0.54188 0.000 0.860 0.028 0.028 0.084 0.000
#> GSM955043     2  0.5401   -0.09757 0.000 0.476 0.052 0.028 0.444 0.000
#> GSM955048     1  0.1663    0.82236 0.912 0.000 0.000 0.000 0.000 0.088
#> GSM955049     2  0.0632    0.59367 0.000 0.976 0.024 0.000 0.000 0.000
#> GSM955054     6  0.5772    0.82335 0.000 0.348 0.184 0.000 0.000 0.468
#> GSM955064     2  0.2934    0.53829 0.000 0.844 0.112 0.000 0.044 0.000
#> GSM955072     4  0.3934    0.56078 0.000 0.376 0.000 0.616 0.008 0.000
#> GSM955075     5  0.0146    0.73207 0.000 0.004 0.000 0.000 0.996 0.000
#> GSM955079     3  0.2154    0.69291 0.000 0.064 0.908 0.004 0.004 0.020
#> GSM955087     1  0.3371    0.73710 0.708 0.000 0.000 0.000 0.000 0.292
#> GSM955088     3  0.1218    0.70243 0.000 0.028 0.956 0.004 0.000 0.012
#> GSM955089     1  0.3772    0.80797 0.772 0.000 0.000 0.068 0.000 0.160
#> GSM955095     2  0.6839    0.00587 0.000 0.348 0.336 0.044 0.272 0.000
#> GSM955097     5  0.7291    0.20956 0.088 0.000 0.260 0.208 0.432 0.012
#> GSM955101     3  0.5358    0.17443 0.000 0.272 0.596 0.008 0.000 0.124
#> GSM954999     3  0.7454    0.45550 0.120 0.128 0.536 0.044 0.160 0.012
#> GSM955001     2  0.0260    0.59431 0.000 0.992 0.008 0.000 0.000 0.000
#> GSM955003     6  0.5823    0.84809 0.000 0.332 0.200 0.000 0.000 0.468
#> GSM955004     4  0.4127    0.48026 0.000 0.028 0.000 0.684 0.284 0.004
#> GSM955005     3  0.1749    0.70216 0.000 0.044 0.932 0.004 0.004 0.016
#> GSM955009     4  0.3788    0.65809 0.000 0.280 0.012 0.704 0.004 0.000
#> GSM955011     1  0.2780    0.81646 0.868 0.000 0.016 0.092 0.000 0.024
#> GSM955012     5  0.0260    0.73236 0.000 0.008 0.000 0.000 0.992 0.000
#> GSM955013     3  0.5210    0.57200 0.004 0.160 0.664 0.012 0.160 0.000
#> GSM955015     2  0.5368   -0.47566 0.000 0.508 0.116 0.000 0.000 0.376
#> GSM955017     1  0.0603    0.83215 0.980 0.000 0.000 0.004 0.000 0.016
#> GSM955021     2  0.6649   -0.53761 0.000 0.484 0.160 0.072 0.000 0.284
#> GSM955025     4  0.3449    0.69135 0.000 0.116 0.076 0.808 0.000 0.000
#> GSM955028     1  0.3371    0.73710 0.708 0.000 0.000 0.000 0.000 0.292
#> GSM955029     5  0.0363    0.73223 0.000 0.012 0.000 0.000 0.988 0.000
#> GSM955030     3  0.0767    0.69753 0.004 0.000 0.976 0.008 0.000 0.012
#> GSM955032     3  0.4348    0.49310 0.000 0.160 0.732 0.004 0.000 0.104
#> GSM955033     3  0.8183    0.34302 0.080 0.156 0.456 0.072 0.208 0.028
#> GSM955034     1  0.3371    0.73710 0.708 0.000 0.000 0.000 0.000 0.292
#> GSM955035     2  0.0405    0.59538 0.000 0.988 0.008 0.000 0.000 0.004
#> GSM955036     3  0.6473    0.41815 0.100 0.028 0.580 0.020 0.248 0.024
#> GSM955037     1  0.5530    0.68806 0.628 0.004 0.132 0.020 0.000 0.216
#> GSM955039     3  0.4496    0.52839 0.000 0.272 0.672 0.008 0.048 0.000
#> GSM955041     2  0.5152    0.17537 0.000 0.532 0.376 0.000 0.092 0.000
#> GSM955042     1  0.3908    0.79677 0.784 0.008 0.000 0.104 0.000 0.104
#> GSM955045     2  0.4548    0.45407 0.000 0.720 0.156 0.008 0.116 0.000
#> GSM955046     3  0.2723    0.66873 0.000 0.128 0.852 0.004 0.000 0.016
#> GSM955047     1  0.0146    0.83171 0.996 0.000 0.000 0.000 0.000 0.004
#> GSM955050     4  0.7047    0.25961 0.288 0.072 0.212 0.424 0.004 0.000
#> GSM955052     3  0.4430    0.51340 0.000 0.152 0.732 0.008 0.000 0.108
#> GSM955053     1  0.3371    0.73710 0.708 0.000 0.000 0.000 0.000 0.292
#> GSM955056     6  0.6260    0.82853 0.000 0.280 0.300 0.008 0.000 0.412
#> GSM955058     5  0.0363    0.73223 0.000 0.012 0.000 0.000 0.988 0.000
#> GSM955059     3  0.0622    0.70001 0.000 0.008 0.980 0.000 0.000 0.012
#> GSM955060     1  0.0000    0.83191 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM955061     5  0.0146    0.73207 0.000 0.004 0.000 0.000 0.996 0.000
#> GSM955065     1  0.3371    0.73710 0.708 0.000 0.000 0.000 0.000 0.292
#> GSM955066     3  0.0653    0.70066 0.000 0.004 0.980 0.004 0.000 0.012
#> GSM955067     1  0.2474    0.82079 0.880 0.000 0.000 0.080 0.000 0.040
#> GSM955073     3  0.2658    0.65528 0.000 0.080 0.876 0.008 0.000 0.036
#> GSM955074     1  0.3602    0.79897 0.792 0.000 0.000 0.072 0.000 0.136
#> GSM955076     4  0.4988    0.44012 0.000 0.380 0.064 0.552 0.004 0.000
#> GSM955078     4  0.4791    0.64683 0.000 0.244 0.000 0.652 0.104 0.000
#> GSM955083     3  0.8279    0.31958 0.092 0.136 0.448 0.100 0.204 0.020
#> GSM955084     4  0.4248    0.54394 0.000 0.052 0.000 0.708 0.236 0.004
#> GSM955086     3  0.1988    0.70021 0.000 0.048 0.920 0.004 0.004 0.024
#> GSM955091     2  0.0291    0.59234 0.000 0.992 0.000 0.004 0.004 0.000
#> GSM955092     2  0.2129    0.54590 0.000 0.904 0.056 0.000 0.000 0.040
#> GSM955093     3  0.0692    0.69737 0.000 0.004 0.976 0.000 0.000 0.020
#> GSM955098     4  0.2163    0.67288 0.000 0.092 0.016 0.892 0.000 0.000
#> GSM955099     2  0.0458    0.58591 0.000 0.984 0.000 0.016 0.000 0.000
#> GSM955100     1  0.2772    0.81752 0.876 0.000 0.036 0.068 0.000 0.020
#> GSM955103     3  0.6052    0.37897 0.000 0.260 0.516 0.016 0.208 0.000
#> GSM955104     3  0.2623    0.68623 0.008 0.092 0.880 0.008 0.004 0.008
#> GSM955106     5  0.6741    0.41685 0.000 0.212 0.164 0.084 0.532 0.008
#> GSM955000     1  0.2163    0.81236 0.892 0.000 0.008 0.004 0.000 0.096
#> GSM955006     1  0.2605    0.81449 0.864 0.000 0.000 0.108 0.000 0.028
#> GSM955007     3  0.3759    0.57137 0.000 0.248 0.732 0.008 0.004 0.008
#> GSM955010     3  0.2624    0.65709 0.080 0.000 0.880 0.024 0.000 0.016
#> GSM955014     1  0.2034    0.83113 0.912 0.000 0.004 0.024 0.000 0.060
#> GSM955018     3  0.0405    0.69964 0.000 0.004 0.988 0.000 0.000 0.008
#> GSM955020     1  0.3914    0.81108 0.768 0.000 0.000 0.104 0.000 0.128
#> GSM955024     2  0.5043    0.20934 0.000 0.568 0.360 0.008 0.064 0.000
#> GSM955026     4  0.2527    0.69876 0.000 0.168 0.000 0.832 0.000 0.000
#> GSM955031     4  0.7843    0.17024 0.228 0.212 0.224 0.328 0.000 0.008
#> GSM955038     4  0.3940    0.66509 0.020 0.076 0.080 0.812 0.004 0.008
#> GSM955040     1  0.6935   -0.11698 0.344 0.040 0.312 0.300 0.000 0.004
#> GSM955044     2  0.5111    0.22170 0.000 0.596 0.016 0.064 0.324 0.000
#> GSM955051     1  0.1232    0.83145 0.956 0.000 0.004 0.024 0.000 0.016
#> GSM955055     2  0.0260    0.59582 0.000 0.992 0.008 0.000 0.000 0.000
#> GSM955057     1  0.1327    0.82707 0.936 0.000 0.000 0.000 0.000 0.064
#> GSM955062     2  0.1151    0.58755 0.000 0.956 0.032 0.000 0.000 0.012
#> GSM955063     3  0.2658    0.65324 0.000 0.080 0.876 0.008 0.000 0.036
#> GSM955068     4  0.3151    0.68122 0.000 0.252 0.000 0.748 0.000 0.000
#> GSM955069     3  0.1370    0.70298 0.000 0.036 0.948 0.004 0.000 0.012
#> GSM955070     2  0.0984    0.59792 0.000 0.968 0.012 0.008 0.012 0.000
#> GSM955071     3  0.4531    0.62981 0.104 0.056 0.776 0.040 0.000 0.024
#> GSM955077     4  0.3908    0.67225 0.008 0.104 0.104 0.784 0.000 0.000
#> GSM955080     5  0.6240    0.30652 0.000 0.316 0.116 0.056 0.512 0.000
#> GSM955081     3  0.4426    0.34414 0.000 0.296 0.664 0.008 0.004 0.028
#> GSM955082     2  0.4221    0.17341 0.000 0.588 0.396 0.008 0.000 0.008
#> GSM955085     2  0.0291    0.59234 0.000 0.992 0.000 0.004 0.004 0.000
#> GSM955090     1  0.3626    0.80235 0.788 0.000 0.000 0.068 0.000 0.144
#> GSM955094     2  0.3575    0.54251 0.000 0.824 0.080 0.024 0.072 0.000
#> GSM955096     3  0.5770    0.04516 0.000 0.212 0.564 0.012 0.000 0.212
#> GSM955102     3  0.2089    0.66666 0.072 0.004 0.908 0.004 0.000 0.012
#> GSM955105     3  0.1605    0.70104 0.000 0.044 0.936 0.004 0.000 0.016

Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.

consensus_heatmap(res, k = 2)

plot of chunk tab-MAD-mclust-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-MAD-mclust-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-MAD-mclust-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-MAD-mclust-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-MAD-mclust-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-MAD-mclust-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-MAD-mclust-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-MAD-mclust-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-MAD-mclust-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-MAD-mclust-membership-heatmap-5

As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

plot of chunk tab-MAD-mclust-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-MAD-mclust-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-MAD-mclust-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-MAD-mclust-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-MAD-mclust-get-signatures-5

Signature heatmaps where rows are not scaled:

get_signatures(res, k = 2, scale_rows = FALSE)

plot of chunk tab-MAD-mclust-get-signatures-no-scale-1

get_signatures(res, k = 3, scale_rows = FALSE)

plot of chunk tab-MAD-mclust-get-signatures-no-scale-2

get_signatures(res, k = 4, scale_rows = FALSE)

plot of chunk tab-MAD-mclust-get-signatures-no-scale-3

get_signatures(res, k = 5, scale_rows = FALSE)

plot of chunk tab-MAD-mclust-get-signatures-no-scale-4

get_signatures(res, k = 6, scale_rows = FALSE)

plot of chunk tab-MAD-mclust-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk MAD-mclust-signature_compare

get_signature() returns a data frame invisibly. TO get the list of signatures, the function call should be assigned to a variable explicitly. In following code, if plot argument is set to FALSE, no heatmap is plotted while only the differential analysis is performed.

# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)

An example of the output of tb is:

#>   which_row         fdr    mean_1    mean_2 scaled_mean_1 scaled_mean_2 km
#> 1        38 0.042760348  8.373488  9.131774    -0.5533452     0.5164555  1
#> 2        40 0.018707592  7.106213  8.469186    -0.6173731     0.5762149  1
#> 3        55 0.019134737 10.221463 11.207825    -0.6159697     0.5749050  1
#> 4        59 0.006059896  5.921854  7.869574    -0.6899429     0.6439467  1
#> 5        60 0.018055526  8.928898 10.211722    -0.6204761     0.5791110  1
#> 6        98 0.009384629 15.714769 14.887706     0.6635654    -0.6193277  2
...

The columns in tb are:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. km: Row groups if k-means clustering is applied to rows.

UMAP plot which shows how samples are separated.

dimension_reduction(res, k = 2, method = "UMAP")

plot of chunk tab-MAD-mclust-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-MAD-mclust-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-MAD-mclust-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-MAD-mclust-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-MAD-mclust-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk MAD-mclust-collect-classes

Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.

test_to_known_factors(res)
#>              n genotype/variation(p) k
#> MAD:mclust 108                 0.910 2
#> MAD:mclust 100                 0.954 3
#> MAD:mclust  95                 0.840 4
#> MAD:mclust  92                 0.767 5
#> MAD:mclust  79                 0.481 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 31589 rows and 108 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'MAD' method.
#>   Subgroups are detected by 'NMF' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 2.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

collect_plots() function collects all the plots made from res for all k (number of partitions) into one single page to provide an easy and fast comparison between different k.

collect_plots(res)

plot of chunk MAD-NMF-collect-plots

The plots are:

All the plots in panels can be made by individual functions and they are plotted later in this section.

select_partition_number() produces several plots showing different statistics for choosing “optimized” k. There are following statistics:

The detailed explanations of these statistics can be found in the cola vignette.

Generally speaking, lower PAC score, higher mean silhouette score or higher concordance corresponds to better partition. Rand index and Jaccard index measure how similar the current partition is compared to partition with k-1. If they are too similar, we won't accept k is better than k-1.

select_partition_number(res)

plot of chunk MAD-NMF-select-partition-number

The numeric values for all these statistics can be obtained by get_stats().

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.867           0.918       0.965         0.4625 0.534   0.534
#> 3 3 0.749           0.795       0.914         0.2788 0.802   0.658
#> 4 4 0.589           0.660       0.846         0.1716 0.776   0.528
#> 5 5 0.550           0.559       0.756         0.0920 0.862   0.605
#> 6 6 0.545           0.425       0.679         0.0592 0.877   0.580

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
#> GSM955002     2  0.0000      0.974 0.000 1.000
#> GSM955008     2  0.0000      0.974 0.000 1.000
#> GSM955016     1  0.0000      0.942 1.000 0.000
#> GSM955019     2  0.0000      0.974 0.000 1.000
#> GSM955022     2  0.0000      0.974 0.000 1.000
#> GSM955023     2  0.0000      0.974 0.000 1.000
#> GSM955027     2  0.0000      0.974 0.000 1.000
#> GSM955043     2  0.0000      0.974 0.000 1.000
#> GSM955048     1  0.0000      0.942 1.000 0.000
#> GSM955049     2  0.0000      0.974 0.000 1.000
#> GSM955054     2  0.0000      0.974 0.000 1.000
#> GSM955064     2  0.0000      0.974 0.000 1.000
#> GSM955072     2  0.0000      0.974 0.000 1.000
#> GSM955075     2  0.0000      0.974 0.000 1.000
#> GSM955079     2  0.0376      0.970 0.004 0.996
#> GSM955087     1  0.0000      0.942 1.000 0.000
#> GSM955088     2  0.7056      0.757 0.192 0.808
#> GSM955089     1  0.0000      0.942 1.000 0.000
#> GSM955095     2  0.0000      0.974 0.000 1.000
#> GSM955097     2  0.0938      0.963 0.012 0.988
#> GSM955101     2  0.0000      0.974 0.000 1.000
#> GSM954999     1  0.3114      0.905 0.944 0.056
#> GSM955001     2  0.0000      0.974 0.000 1.000
#> GSM955003     2  0.0000      0.974 0.000 1.000
#> GSM955004     2  0.0000      0.974 0.000 1.000
#> GSM955005     1  0.9933      0.248 0.548 0.452
#> GSM955009     2  0.0000      0.974 0.000 1.000
#> GSM955011     1  0.0000      0.942 1.000 0.000
#> GSM955012     2  0.0000      0.974 0.000 1.000
#> GSM955013     2  0.4298      0.888 0.088 0.912
#> GSM955015     2  0.0000      0.974 0.000 1.000
#> GSM955017     1  0.0000      0.942 1.000 0.000
#> GSM955021     2  0.0000      0.974 0.000 1.000
#> GSM955025     2  0.0000      0.974 0.000 1.000
#> GSM955028     1  0.0000      0.942 1.000 0.000
#> GSM955029     2  0.0000      0.974 0.000 1.000
#> GSM955030     1  0.0000      0.942 1.000 0.000
#> GSM955032     2  0.0000      0.974 0.000 1.000
#> GSM955033     2  0.9087      0.524 0.324 0.676
#> GSM955034     1  0.0000      0.942 1.000 0.000
#> GSM955035     2  0.0000      0.974 0.000 1.000
#> GSM955036     2  0.8267      0.650 0.260 0.740
#> GSM955037     1  0.0000      0.942 1.000 0.000
#> GSM955039     2  0.0000      0.974 0.000 1.000
#> GSM955041     2  0.0000      0.974 0.000 1.000
#> GSM955042     1  0.0000      0.942 1.000 0.000
#> GSM955045     2  0.0000      0.974 0.000 1.000
#> GSM955046     2  0.0000      0.974 0.000 1.000
#> GSM955047     1  0.0000      0.942 1.000 0.000
#> GSM955050     1  0.0000      0.942 1.000 0.000
#> GSM955052     2  0.0000      0.974 0.000 1.000
#> GSM955053     1  0.0000      0.942 1.000 0.000
#> GSM955056     2  0.0000      0.974 0.000 1.000
#> GSM955058     2  0.0000      0.974 0.000 1.000
#> GSM955059     2  0.5294      0.851 0.120 0.880
#> GSM955060     1  0.0000      0.942 1.000 0.000
#> GSM955061     2  0.0000      0.974 0.000 1.000
#> GSM955065     1  0.0000      0.942 1.000 0.000
#> GSM955066     1  0.5737      0.827 0.864 0.136
#> GSM955067     1  0.0000      0.942 1.000 0.000
#> GSM955073     2  0.0000      0.974 0.000 1.000
#> GSM955074     1  0.0000      0.942 1.000 0.000
#> GSM955076     2  0.0000      0.974 0.000 1.000
#> GSM955078     2  0.0000      0.974 0.000 1.000
#> GSM955083     1  0.9775      0.351 0.588 0.412
#> GSM955084     2  0.0000      0.974 0.000 1.000
#> GSM955086     2  0.9393      0.449 0.356 0.644
#> GSM955091     2  0.0000      0.974 0.000 1.000
#> GSM955092     2  0.0000      0.974 0.000 1.000
#> GSM955093     2  0.0000      0.974 0.000 1.000
#> GSM955098     2  0.0000      0.974 0.000 1.000
#> GSM955099     2  0.0000      0.974 0.000 1.000
#> GSM955100     1  0.0000      0.942 1.000 0.000
#> GSM955103     2  0.0000      0.974 0.000 1.000
#> GSM955104     1  0.7299      0.755 0.796 0.204
#> GSM955106     2  0.0000      0.974 0.000 1.000
#> GSM955000     1  0.0000      0.942 1.000 0.000
#> GSM955006     1  0.0000      0.942 1.000 0.000
#> GSM955007     2  0.0000      0.974 0.000 1.000
#> GSM955010     1  0.0000      0.942 1.000 0.000
#> GSM955014     1  0.0000      0.942 1.000 0.000
#> GSM955018     2  0.0000      0.974 0.000 1.000
#> GSM955020     1  0.0000      0.942 1.000 0.000
#> GSM955024     2  0.0000      0.974 0.000 1.000
#> GSM955026     2  0.0000      0.974 0.000 1.000
#> GSM955031     1  0.2043      0.922 0.968 0.032
#> GSM955038     1  0.7219      0.757 0.800 0.200
#> GSM955040     1  0.0000      0.942 1.000 0.000
#> GSM955044     2  0.0000      0.974 0.000 1.000
#> GSM955051     1  0.0000      0.942 1.000 0.000
#> GSM955055     2  0.0000      0.974 0.000 1.000
#> GSM955057     1  0.0000      0.942 1.000 0.000
#> GSM955062     2  0.0000      0.974 0.000 1.000
#> GSM955063     2  0.0000      0.974 0.000 1.000
#> GSM955068     2  0.0000      0.974 0.000 1.000
#> GSM955069     2  0.8861      0.567 0.304 0.696
#> GSM955070     2  0.0000      0.974 0.000 1.000
#> GSM955071     1  0.0000      0.942 1.000 0.000
#> GSM955077     1  0.5737      0.835 0.864 0.136
#> GSM955080     2  0.0000      0.974 0.000 1.000
#> GSM955081     2  0.0000      0.974 0.000 1.000
#> GSM955082     2  0.0000      0.974 0.000 1.000
#> GSM955085     2  0.0000      0.974 0.000 1.000
#> GSM955090     1  0.0000      0.942 1.000 0.000
#> GSM955094     2  0.0000      0.974 0.000 1.000
#> GSM955096     2  0.0000      0.974 0.000 1.000
#> GSM955102     1  0.4562      0.868 0.904 0.096
#> GSM955105     1  0.9775      0.314 0.588 0.412

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1    p2    p3
#> GSM955002     3  0.1163     0.8807 0.000 0.028 0.972
#> GSM955008     3  0.0000     0.8869 0.000 0.000 1.000
#> GSM955016     1  0.0000     0.9630 1.000 0.000 0.000
#> GSM955019     3  0.2959     0.8418 0.000 0.100 0.900
#> GSM955022     3  0.0000     0.8869 0.000 0.000 1.000
#> GSM955023     3  0.0000     0.8869 0.000 0.000 1.000
#> GSM955027     3  0.1753     0.8725 0.000 0.048 0.952
#> GSM955043     3  0.3752     0.8009 0.000 0.144 0.856
#> GSM955048     1  0.0000     0.9630 1.000 0.000 0.000
#> GSM955049     3  0.1031     0.8820 0.000 0.024 0.976
#> GSM955054     3  0.0000     0.8869 0.000 0.000 1.000
#> GSM955064     3  0.0592     0.8851 0.000 0.012 0.988
#> GSM955072     2  0.6045     0.3198 0.000 0.620 0.380
#> GSM955075     3  0.6309     0.0132 0.000 0.496 0.504
#> GSM955079     3  0.0000     0.8869 0.000 0.000 1.000
#> GSM955087     1  0.0000     0.9630 1.000 0.000 0.000
#> GSM955088     3  0.0424     0.8836 0.008 0.000 0.992
#> GSM955089     1  0.0000     0.9630 1.000 0.000 0.000
#> GSM955095     3  0.3038     0.8308 0.000 0.104 0.896
#> GSM955097     2  0.1585     0.7572 0.028 0.964 0.008
#> GSM955101     3  0.0237     0.8865 0.000 0.004 0.996
#> GSM954999     1  0.0424     0.9570 0.992 0.008 0.000
#> GSM955001     3  0.2448     0.8559 0.000 0.076 0.924
#> GSM955003     3  0.0000     0.8869 0.000 0.000 1.000
#> GSM955004     2  0.0000     0.7654 0.000 1.000 0.000
#> GSM955005     3  0.2448     0.8297 0.076 0.000 0.924
#> GSM955009     2  0.6308    -0.0876 0.000 0.508 0.492
#> GSM955011     1  0.0000     0.9630 1.000 0.000 0.000
#> GSM955012     3  0.3340     0.8191 0.000 0.120 0.880
#> GSM955013     3  0.1031     0.8746 0.024 0.000 0.976
#> GSM955015     3  0.0000     0.8869 0.000 0.000 1.000
#> GSM955017     1  0.0000     0.9630 1.000 0.000 0.000
#> GSM955021     3  0.1031     0.8823 0.000 0.024 0.976
#> GSM955025     2  0.0000     0.7654 0.000 1.000 0.000
#> GSM955028     1  0.0000     0.9630 1.000 0.000 0.000
#> GSM955029     3  0.6154     0.3433 0.000 0.408 0.592
#> GSM955030     1  0.4002     0.7417 0.840 0.000 0.160
#> GSM955032     3  0.0000     0.8869 0.000 0.000 1.000
#> GSM955033     2  0.8998     0.2739 0.396 0.472 0.132
#> GSM955034     1  0.0000     0.9630 1.000 0.000 0.000
#> GSM955035     3  0.2066     0.8664 0.000 0.060 0.940
#> GSM955036     3  0.4750     0.6322 0.216 0.000 0.784
#> GSM955037     1  0.0000     0.9630 1.000 0.000 0.000
#> GSM955039     3  0.1529     0.8756 0.000 0.040 0.960
#> GSM955041     3  0.0000     0.8869 0.000 0.000 1.000
#> GSM955042     1  0.0237     0.9601 0.996 0.004 0.000
#> GSM955045     3  0.0000     0.8869 0.000 0.000 1.000
#> GSM955046     3  0.0000     0.8869 0.000 0.000 1.000
#> GSM955047     1  0.0000     0.9630 1.000 0.000 0.000
#> GSM955050     1  0.0000     0.9630 1.000 0.000 0.000
#> GSM955052     3  0.0000     0.8869 0.000 0.000 1.000
#> GSM955053     1  0.0000     0.9630 1.000 0.000 0.000
#> GSM955056     3  0.0000     0.8869 0.000 0.000 1.000
#> GSM955058     3  0.5760     0.5328 0.000 0.328 0.672
#> GSM955059     3  0.0000     0.8869 0.000 0.000 1.000
#> GSM955060     1  0.0000     0.9630 1.000 0.000 0.000
#> GSM955061     2  0.5948     0.3558 0.000 0.640 0.360
#> GSM955065     1  0.0000     0.9630 1.000 0.000 0.000
#> GSM955066     3  0.6286     0.1222 0.464 0.000 0.536
#> GSM955067     1  0.0237     0.9603 0.996 0.004 0.000
#> GSM955073     3  0.0000     0.8869 0.000 0.000 1.000
#> GSM955074     1  0.0000     0.9630 1.000 0.000 0.000
#> GSM955076     3  0.2711     0.8500 0.000 0.088 0.912
#> GSM955078     2  0.2537     0.7521 0.000 0.920 0.080
#> GSM955083     2  0.6513     0.0607 0.476 0.520 0.004
#> GSM955084     2  0.0000     0.7654 0.000 1.000 0.000
#> GSM955086     3  0.2796     0.8084 0.092 0.000 0.908
#> GSM955091     3  0.4555     0.7401 0.000 0.200 0.800
#> GSM955092     3  0.0424     0.8860 0.000 0.008 0.992
#> GSM955093     3  0.0000     0.8869 0.000 0.000 1.000
#> GSM955098     2  0.1289     0.7686 0.000 0.968 0.032
#> GSM955099     3  0.5178     0.6629 0.000 0.256 0.744
#> GSM955100     1  0.0000     0.9630 1.000 0.000 0.000
#> GSM955103     3  0.0424     0.8862 0.000 0.008 0.992
#> GSM955104     1  0.5926     0.3410 0.644 0.000 0.356
#> GSM955106     3  0.5397     0.6082 0.000 0.280 0.720
#> GSM955000     1  0.0000     0.9630 1.000 0.000 0.000
#> GSM955006     1  0.0000     0.9630 1.000 0.000 0.000
#> GSM955007     3  0.0000     0.8869 0.000 0.000 1.000
#> GSM955010     1  0.0747     0.9465 0.984 0.000 0.016
#> GSM955014     1  0.0000     0.9630 1.000 0.000 0.000
#> GSM955018     3  0.0000     0.8869 0.000 0.000 1.000
#> GSM955020     1  0.0000     0.9630 1.000 0.000 0.000
#> GSM955024     3  0.0000     0.8869 0.000 0.000 1.000
#> GSM955026     2  0.1411     0.7685 0.000 0.964 0.036
#> GSM955031     1  0.2796     0.8441 0.908 0.000 0.092
#> GSM955038     2  0.5431     0.4928 0.284 0.716 0.000
#> GSM955040     1  0.0000     0.9630 1.000 0.000 0.000
#> GSM955044     3  0.5988     0.4515 0.000 0.368 0.632
#> GSM955051     1  0.0000     0.9630 1.000 0.000 0.000
#> GSM955055     3  0.2711     0.8496 0.000 0.088 0.912
#> GSM955057     1  0.0000     0.9630 1.000 0.000 0.000
#> GSM955062     3  0.0424     0.8860 0.000 0.008 0.992
#> GSM955063     3  0.0000     0.8869 0.000 0.000 1.000
#> GSM955068     2  0.0000     0.7654 0.000 1.000 0.000
#> GSM955069     3  0.0424     0.8835 0.008 0.000 0.992
#> GSM955070     3  0.1753     0.8715 0.000 0.048 0.952
#> GSM955071     1  0.0237     0.9590 0.996 0.000 0.004
#> GSM955077     1  0.4842     0.6829 0.776 0.224 0.000
#> GSM955080     3  0.6280     0.1556 0.000 0.460 0.540
#> GSM955081     3  0.0237     0.8865 0.000 0.004 0.996
#> GSM955082     3  0.0000     0.8869 0.000 0.000 1.000
#> GSM955085     3  0.5591     0.5920 0.000 0.304 0.696
#> GSM955090     1  0.0237     0.9602 0.996 0.004 0.000
#> GSM955094     3  0.3851     0.8038 0.004 0.136 0.860
#> GSM955096     3  0.0000     0.8869 0.000 0.000 1.000
#> GSM955102     3  0.6192     0.2418 0.420 0.000 0.580
#> GSM955105     3  0.2356     0.8311 0.072 0.000 0.928

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM955002     3  0.2408     0.7298 0.000 0.104 0.896 0.000
#> GSM955008     3  0.1302     0.7555 0.000 0.044 0.956 0.000
#> GSM955016     1  0.2011     0.9011 0.920 0.000 0.000 0.080
#> GSM955019     2  0.3172     0.7131 0.000 0.840 0.160 0.000
#> GSM955022     3  0.0564     0.7527 0.004 0.004 0.988 0.004
#> GSM955023     3  0.0592     0.7589 0.000 0.016 0.984 0.000
#> GSM955027     2  0.4955     0.3545 0.000 0.556 0.444 0.000
#> GSM955043     3  0.2918     0.6954 0.000 0.008 0.876 0.116
#> GSM955048     1  0.0336     0.9483 0.992 0.008 0.000 0.000
#> GSM955049     3  0.4679     0.2965 0.000 0.352 0.648 0.000
#> GSM955054     3  0.5000    -0.2345 0.000 0.500 0.500 0.000
#> GSM955064     3  0.2011     0.7367 0.000 0.080 0.920 0.000
#> GSM955072     2  0.5977     0.5449 0.000 0.688 0.120 0.192
#> GSM955075     4  0.4204     0.7380 0.000 0.020 0.192 0.788
#> GSM955079     3  0.5557     0.3738 0.040 0.308 0.652 0.000
#> GSM955087     1  0.0188     0.9494 0.996 0.000 0.000 0.004
#> GSM955088     3  0.0895     0.7591 0.004 0.020 0.976 0.000
#> GSM955089     1  0.0188     0.9494 0.996 0.000 0.000 0.004
#> GSM955095     3  0.4546     0.4921 0.000 0.012 0.732 0.256
#> GSM955097     4  0.0524     0.7000 0.000 0.008 0.004 0.988
#> GSM955101     3  0.4776     0.2798 0.000 0.376 0.624 0.000
#> GSM954999     1  0.2987     0.8378 0.880 0.000 0.104 0.016
#> GSM955001     2  0.4925     0.3912 0.000 0.572 0.428 0.000
#> GSM955003     2  0.3873     0.6981 0.000 0.772 0.228 0.000
#> GSM955004     4  0.0336     0.6985 0.000 0.008 0.000 0.992
#> GSM955005     3  0.5105     0.2465 0.432 0.004 0.564 0.000
#> GSM955009     2  0.1488     0.6736 0.000 0.956 0.032 0.012
#> GSM955011     1  0.0000     0.9497 1.000 0.000 0.000 0.000
#> GSM955012     3  0.4012     0.6181 0.000 0.016 0.800 0.184
#> GSM955013     3  0.2408     0.7117 0.060 0.004 0.920 0.016
#> GSM955015     3  0.1302     0.7559 0.000 0.044 0.956 0.000
#> GSM955017     1  0.0000     0.9497 1.000 0.000 0.000 0.000
#> GSM955021     2  0.3610     0.7105 0.000 0.800 0.200 0.000
#> GSM955025     2  0.1302     0.6388 0.000 0.956 0.000 0.044
#> GSM955028     1  0.0000     0.9497 1.000 0.000 0.000 0.000
#> GSM955029     4  0.6141     0.5615 0.000 0.072 0.312 0.616
#> GSM955030     3  0.4920     0.2772 0.368 0.004 0.628 0.000
#> GSM955032     3  0.4072     0.5321 0.000 0.252 0.748 0.000
#> GSM955033     4  0.7758     0.3165 0.164 0.012 0.368 0.456
#> GSM955034     1  0.0000     0.9497 1.000 0.000 0.000 0.000
#> GSM955035     2  0.4889     0.5344 0.000 0.636 0.360 0.004
#> GSM955036     3  0.3496     0.6681 0.072 0.004 0.872 0.052
#> GSM955037     1  0.2334     0.8679 0.908 0.000 0.088 0.004
#> GSM955039     3  0.2593     0.7090 0.004 0.104 0.892 0.000
#> GSM955041     3  0.0336     0.7572 0.000 0.008 0.992 0.000
#> GSM955042     1  0.0376     0.9494 0.992 0.004 0.000 0.004
#> GSM955045     3  0.1305     0.7573 0.000 0.036 0.960 0.004
#> GSM955046     3  0.0657     0.7510 0.012 0.004 0.984 0.000
#> GSM955047     1  0.0469     0.9468 0.988 0.012 0.000 0.000
#> GSM955050     1  0.2197     0.9004 0.916 0.080 0.004 0.000
#> GSM955052     3  0.1118     0.7566 0.000 0.036 0.964 0.000
#> GSM955053     1  0.0188     0.9494 0.996 0.000 0.000 0.004
#> GSM955056     3  0.4679     0.3006 0.000 0.352 0.648 0.000
#> GSM955058     4  0.5478     0.5398 0.000 0.028 0.344 0.628
#> GSM955059     3  0.0376     0.7562 0.004 0.004 0.992 0.000
#> GSM955060     1  0.0000     0.9497 1.000 0.000 0.000 0.000
#> GSM955061     4  0.3501     0.7436 0.000 0.020 0.132 0.848
#> GSM955065     1  0.0188     0.9494 0.996 0.000 0.000 0.004
#> GSM955066     3  0.3982     0.5420 0.220 0.004 0.776 0.000
#> GSM955067     1  0.1792     0.9107 0.932 0.068 0.000 0.000
#> GSM955073     3  0.0469     0.7575 0.000 0.012 0.988 0.000
#> GSM955074     1  0.0592     0.9460 0.984 0.000 0.000 0.016
#> GSM955076     2  0.1118     0.6768 0.000 0.964 0.036 0.000
#> GSM955078     2  0.4706     0.6449 0.000 0.788 0.072 0.140
#> GSM955083     1  0.4832     0.5725 0.680 0.004 0.004 0.312
#> GSM955084     4  0.1211     0.6854 0.000 0.040 0.000 0.960
#> GSM955086     3  0.7677    -0.2039 0.216 0.372 0.412 0.000
#> GSM955091     2  0.3751     0.7099 0.000 0.800 0.196 0.004
#> GSM955092     2  0.4907     0.4134 0.000 0.580 0.420 0.000
#> GSM955093     3  0.0469     0.7575 0.000 0.012 0.988 0.000
#> GSM955098     2  0.0707     0.6458 0.000 0.980 0.000 0.020
#> GSM955099     2  0.4391     0.6731 0.000 0.740 0.252 0.008
#> GSM955100     1  0.0188     0.9494 0.996 0.000 0.000 0.004
#> GSM955103     3  0.0592     0.7579 0.000 0.016 0.984 0.000
#> GSM955104     3  0.4401     0.4546 0.272 0.000 0.724 0.004
#> GSM955106     3  0.5158    -0.1744 0.000 0.004 0.524 0.472
#> GSM955000     1  0.0000     0.9497 1.000 0.000 0.000 0.000
#> GSM955006     1  0.0188     0.9494 0.996 0.000 0.000 0.004
#> GSM955007     3  0.0000     0.7557 0.000 0.000 1.000 0.000
#> GSM955010     1  0.4699     0.4785 0.676 0.004 0.320 0.000
#> GSM955014     1  0.1118     0.9351 0.964 0.036 0.000 0.000
#> GSM955018     3  0.1211     0.7556 0.000 0.040 0.960 0.000
#> GSM955020     1  0.0376     0.9494 0.992 0.004 0.000 0.004
#> GSM955024     3  0.0000     0.7557 0.000 0.000 1.000 0.000
#> GSM955026     2  0.0707     0.6460 0.000 0.980 0.000 0.020
#> GSM955031     2  0.2266     0.6105 0.084 0.912 0.004 0.000
#> GSM955038     2  0.5760    -0.0939 0.448 0.524 0.000 0.028
#> GSM955040     1  0.1059     0.9409 0.972 0.016 0.012 0.000
#> GSM955044     3  0.6747     0.3204 0.000 0.140 0.596 0.264
#> GSM955051     1  0.0921     0.9394 0.972 0.028 0.000 0.000
#> GSM955055     2  0.3486     0.7131 0.000 0.812 0.188 0.000
#> GSM955057     1  0.0817     0.9414 0.976 0.024 0.000 0.000
#> GSM955062     3  0.4985    -0.1087 0.000 0.468 0.532 0.000
#> GSM955063     3  0.0336     0.7572 0.000 0.008 0.992 0.000
#> GSM955068     2  0.1004     0.6484 0.000 0.972 0.004 0.024
#> GSM955069     3  0.1890     0.7327 0.056 0.008 0.936 0.000
#> GSM955070     3  0.1059     0.7541 0.000 0.012 0.972 0.016
#> GSM955071     1  0.1624     0.9262 0.952 0.020 0.028 0.000
#> GSM955077     2  0.4647     0.3745 0.288 0.704 0.000 0.008
#> GSM955080     4  0.4990     0.7185 0.000 0.060 0.184 0.756
#> GSM955081     2  0.4817     0.4700 0.000 0.612 0.388 0.000
#> GSM955082     3  0.2271     0.7424 0.000 0.076 0.916 0.008
#> GSM955085     2  0.4332     0.7067 0.000 0.800 0.160 0.040
#> GSM955090     1  0.0524     0.9480 0.988 0.008 0.000 0.004
#> GSM955094     3  0.4371     0.6760 0.004 0.064 0.820 0.112
#> GSM955096     2  0.4996     0.2326 0.000 0.516 0.484 0.000
#> GSM955102     3  0.3074     0.6313 0.152 0.000 0.848 0.000
#> GSM955105     3  0.6955     0.3052 0.296 0.144 0.560 0.000

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM955002     3  0.4846     0.3959 0.000 0.028 0.588 0.384 0.000
#> GSM955008     3  0.3694     0.6489 0.000 0.172 0.796 0.032 0.000
#> GSM955016     1  0.3070     0.8121 0.860 0.000 0.012 0.016 0.112
#> GSM955019     2  0.4165     0.3586 0.000 0.672 0.008 0.320 0.000
#> GSM955022     3  0.1364     0.7020 0.000 0.036 0.952 0.012 0.000
#> GSM955023     3  0.2570     0.6986 0.000 0.084 0.888 0.028 0.000
#> GSM955027     2  0.3688     0.6053 0.000 0.816 0.124 0.060 0.000
#> GSM955043     3  0.4252     0.6306 0.000 0.028 0.788 0.032 0.152
#> GSM955048     1  0.0404     0.8820 0.988 0.000 0.000 0.012 0.000
#> GSM955049     2  0.5092     0.1591 0.000 0.524 0.440 0.036 0.000
#> GSM955054     3  0.6776    -0.0580 0.000 0.292 0.392 0.316 0.000
#> GSM955064     3  0.4049     0.6787 0.000 0.084 0.792 0.124 0.000
#> GSM955072     2  0.6679    -0.2592 0.000 0.472 0.048 0.396 0.084
#> GSM955075     5  0.4847     0.6256 0.000 0.240 0.068 0.000 0.692
#> GSM955079     3  0.6887     0.1233 0.048 0.372 0.472 0.108 0.000
#> GSM955087     1  0.0579     0.8793 0.984 0.000 0.008 0.008 0.000
#> GSM955088     2  0.5260     0.2036 0.016 0.508 0.456 0.020 0.000
#> GSM955089     1  0.0451     0.8804 0.988 0.000 0.008 0.004 0.000
#> GSM955095     2  0.6771    -0.0619 0.000 0.368 0.360 0.000 0.272
#> GSM955097     5  0.0451     0.6316 0.000 0.008 0.004 0.000 0.988
#> GSM955101     3  0.6265     0.3532 0.000 0.240 0.540 0.220 0.000
#> GSM954999     1  0.5085     0.5948 0.704 0.004 0.232 0.028 0.032
#> GSM955001     2  0.2535     0.5889 0.000 0.892 0.076 0.032 0.000
#> GSM955003     2  0.6552    -0.1474 0.000 0.412 0.200 0.388 0.000
#> GSM955004     5  0.2629     0.6379 0.000 0.136 0.000 0.004 0.860
#> GSM955005     3  0.4928     0.5336 0.264 0.012 0.684 0.040 0.000
#> GSM955009     2  0.2077     0.5172 0.000 0.908 0.008 0.084 0.000
#> GSM955011     1  0.0671     0.8815 0.980 0.004 0.000 0.016 0.000
#> GSM955012     3  0.6252     0.3124 0.000 0.148 0.556 0.008 0.288
#> GSM955013     3  0.2348     0.6989 0.024 0.024 0.920 0.028 0.004
#> GSM955015     3  0.4969     0.4930 0.000 0.056 0.652 0.292 0.000
#> GSM955017     1  0.1251     0.8767 0.956 0.000 0.008 0.036 0.000
#> GSM955021     2  0.4649     0.4148 0.000 0.720 0.068 0.212 0.000
#> GSM955025     2  0.5463     0.1646 0.052 0.636 0.000 0.292 0.020
#> GSM955028     1  0.0579     0.8793 0.984 0.000 0.008 0.008 0.000
#> GSM955029     2  0.5183     0.4574 0.000 0.692 0.104 0.004 0.200
#> GSM955030     3  0.3692     0.6391 0.136 0.000 0.812 0.052 0.000
#> GSM955032     3  0.5681     0.3883 0.000 0.268 0.608 0.124 0.000
#> GSM955033     3  0.8075    -0.0438 0.076 0.020 0.376 0.372 0.156
#> GSM955034     1  0.0162     0.8821 0.996 0.000 0.000 0.004 0.000
#> GSM955035     4  0.6138     0.3679 0.000 0.176 0.272 0.552 0.000
#> GSM955036     3  0.2590     0.6830 0.028 0.000 0.900 0.060 0.012
#> GSM955037     1  0.2208     0.8316 0.908 0.000 0.072 0.020 0.000
#> GSM955039     3  0.4776     0.5348 0.008 0.028 0.668 0.296 0.000
#> GSM955041     3  0.2879     0.6914 0.000 0.100 0.868 0.032 0.000
#> GSM955042     1  0.0324     0.8813 0.992 0.000 0.004 0.004 0.000
#> GSM955045     2  0.4539     0.4821 0.000 0.660 0.320 0.012 0.008
#> GSM955046     3  0.1788     0.6882 0.008 0.004 0.932 0.056 0.000
#> GSM955047     1  0.0865     0.8815 0.972 0.004 0.000 0.024 0.000
#> GSM955050     1  0.5567     0.2428 0.480 0.020 0.032 0.468 0.000
#> GSM955052     3  0.3491     0.5807 0.000 0.228 0.768 0.004 0.000
#> GSM955053     1  0.0162     0.8821 0.996 0.000 0.000 0.004 0.000
#> GSM955056     2  0.4491     0.5128 0.000 0.652 0.328 0.020 0.000
#> GSM955058     5  0.6288     0.3141 0.000 0.304 0.180 0.000 0.516
#> GSM955059     3  0.1717     0.7025 0.004 0.052 0.936 0.008 0.000
#> GSM955060     1  0.0955     0.8805 0.968 0.004 0.000 0.028 0.000
#> GSM955061     5  0.3170     0.6636 0.000 0.124 0.024 0.004 0.848
#> GSM955065     1  0.1012     0.8765 0.968 0.000 0.012 0.020 0.000
#> GSM955066     3  0.3642     0.6523 0.124 0.004 0.824 0.048 0.000
#> GSM955067     1  0.4081     0.6361 0.696 0.004 0.000 0.296 0.004
#> GSM955073     3  0.2448     0.6918 0.000 0.088 0.892 0.020 0.000
#> GSM955074     1  0.0833     0.8814 0.976 0.004 0.000 0.004 0.016
#> GSM955076     4  0.3932     0.5462 0.000 0.328 0.000 0.672 0.000
#> GSM955078     2  0.4557     0.5110 0.000 0.760 0.004 0.132 0.104
#> GSM955083     1  0.5639     0.5385 0.628 0.000 0.048 0.032 0.292
#> GSM955084     5  0.1493     0.6190 0.000 0.024 0.000 0.028 0.948
#> GSM955086     2  0.5750     0.4836 0.144 0.696 0.108 0.052 0.000
#> GSM955091     2  0.4577     0.3944 0.000 0.676 0.024 0.296 0.004
#> GSM955092     2  0.2825     0.6085 0.000 0.860 0.124 0.016 0.000
#> GSM955093     3  0.2775     0.6883 0.004 0.100 0.876 0.020 0.000
#> GSM955098     4  0.2463     0.6987 0.004 0.100 0.008 0.888 0.000
#> GSM955099     2  0.4129     0.5221 0.000 0.756 0.040 0.204 0.000
#> GSM955100     1  0.0794     0.8803 0.972 0.000 0.000 0.028 0.000
#> GSM955103     3  0.3750     0.5623 0.000 0.232 0.756 0.012 0.000
#> GSM955104     3  0.5096     0.4488 0.320 0.024 0.636 0.020 0.000
#> GSM955106     5  0.4904     0.4476 0.000 0.036 0.316 0.004 0.644
#> GSM955000     1  0.0451     0.8825 0.988 0.000 0.004 0.008 0.000
#> GSM955006     1  0.0703     0.8810 0.976 0.000 0.000 0.024 0.000
#> GSM955007     3  0.0955     0.7024 0.000 0.028 0.968 0.004 0.000
#> GSM955010     3  0.5823     0.4152 0.268 0.008 0.612 0.112 0.000
#> GSM955014     1  0.1571     0.8658 0.936 0.004 0.000 0.060 0.000
#> GSM955018     3  0.5312     0.1889 0.016 0.388 0.568 0.028 0.000
#> GSM955020     1  0.0162     0.8816 0.996 0.000 0.000 0.004 0.000
#> GSM955024     3  0.2136     0.6917 0.000 0.088 0.904 0.008 0.000
#> GSM955026     4  0.4338     0.6640 0.008 0.300 0.000 0.684 0.008
#> GSM955031     2  0.6742    -0.1344 0.296 0.412 0.000 0.292 0.000
#> GSM955038     4  0.3614     0.5790 0.108 0.036 0.004 0.840 0.012
#> GSM955040     1  0.4973     0.6726 0.712 0.004 0.092 0.192 0.000
#> GSM955044     3  0.6988     0.0989 0.000 0.044 0.440 0.392 0.124
#> GSM955051     1  0.1571     0.8648 0.936 0.004 0.000 0.060 0.000
#> GSM955055     2  0.2153     0.5646 0.000 0.916 0.040 0.044 0.000
#> GSM955057     1  0.1168     0.8774 0.960 0.008 0.000 0.032 0.000
#> GSM955062     2  0.3565     0.6005 0.000 0.800 0.176 0.024 0.000
#> GSM955063     3  0.1502     0.7008 0.000 0.056 0.940 0.004 0.000
#> GSM955068     4  0.3700     0.6980 0.000 0.240 0.000 0.752 0.008
#> GSM955069     3  0.3956     0.6652 0.068 0.096 0.820 0.016 0.000
#> GSM955070     3  0.5269     0.5494 0.000 0.120 0.688 0.188 0.004
#> GSM955071     1  0.5391     0.6244 0.688 0.008 0.140 0.164 0.000
#> GSM955077     2  0.5372     0.2505 0.284 0.640 0.000 0.068 0.008
#> GSM955080     5  0.5556     0.3014 0.000 0.404 0.072 0.000 0.524
#> GSM955081     2  0.5150     0.5329 0.000 0.692 0.136 0.172 0.000
#> GSM955082     2  0.4420     0.5281 0.000 0.712 0.260 0.016 0.012
#> GSM955085     2  0.2956     0.5434 0.000 0.872 0.020 0.096 0.012
#> GSM955090     1  0.0854     0.8815 0.976 0.004 0.000 0.008 0.012
#> GSM955094     3  0.5548     0.5301 0.000 0.084 0.668 0.228 0.020
#> GSM955096     2  0.3757     0.5837 0.000 0.772 0.208 0.020 0.000
#> GSM955102     3  0.3463     0.6321 0.156 0.008 0.820 0.016 0.000
#> GSM955105     1  0.7365    -0.1561 0.416 0.284 0.268 0.032 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
#> GSM955002     4  0.4582     0.6620 0.000 0.008 0.256 0.676 0.000 0.060
#> GSM955008     3  0.4164     0.4336 0.000 0.040 0.756 0.028 0.000 0.176
#> GSM955016     1  0.3097     0.8047 0.852 0.000 0.016 0.020 0.104 0.008
#> GSM955019     6  0.5406     0.3534 0.000 0.260 0.136 0.008 0.000 0.596
#> GSM955022     3  0.3023     0.3402 0.000 0.000 0.768 0.232 0.000 0.000
#> GSM955023     3  0.3564     0.4745 0.000 0.040 0.808 0.136 0.000 0.016
#> GSM955027     2  0.5771     0.2202 0.000 0.508 0.248 0.000 0.000 0.244
#> GSM955043     3  0.6028    -0.1879 0.000 0.012 0.472 0.340 0.176 0.000
#> GSM955048     1  0.1889     0.8455 0.920 0.004 0.000 0.056 0.000 0.020
#> GSM955049     3  0.5927    -0.1081 0.000 0.192 0.464 0.004 0.000 0.340
#> GSM955054     3  0.7518    -0.1402 0.000 0.148 0.336 0.240 0.000 0.276
#> GSM955064     3  0.6258     0.2233 0.000 0.032 0.512 0.192 0.000 0.264
#> GSM955072     2  0.5188     0.2104 0.000 0.528 0.020 0.032 0.008 0.412
#> GSM955075     5  0.4891     0.3737 0.000 0.360 0.060 0.004 0.576 0.000
#> GSM955079     3  0.7118    -0.0317 0.112 0.084 0.460 0.020 0.004 0.320
#> GSM955087     1  0.1381     0.8411 0.952 0.000 0.020 0.020 0.004 0.004
#> GSM955088     2  0.6336     0.2268 0.024 0.572 0.228 0.144 0.000 0.032
#> GSM955089     1  0.1686     0.8436 0.940 0.000 0.016 0.024 0.004 0.016
#> GSM955095     2  0.6193     0.0859 0.004 0.504 0.172 0.020 0.300 0.000
#> GSM955097     5  0.0291     0.6516 0.004 0.004 0.000 0.000 0.992 0.000
#> GSM955101     6  0.5253     0.1081 0.000 0.032 0.456 0.036 0.000 0.476
#> GSM954999     1  0.3943     0.7836 0.824 0.004 0.072 0.048 0.024 0.028
#> GSM955001     2  0.4700     0.4998 0.000 0.716 0.144 0.008 0.004 0.128
#> GSM955003     6  0.6621     0.3558 0.000 0.140 0.256 0.092 0.000 0.512
#> GSM955004     5  0.3482     0.5139 0.000 0.316 0.000 0.000 0.684 0.000
#> GSM955005     3  0.6239     0.0665 0.340 0.000 0.480 0.144 0.000 0.036
#> GSM955009     2  0.1624     0.4465 0.000 0.936 0.004 0.040 0.000 0.020
#> GSM955011     1  0.1464     0.8479 0.944 0.004 0.000 0.036 0.000 0.016
#> GSM955012     3  0.5666     0.1625 0.000 0.020 0.560 0.008 0.328 0.084
#> GSM955013     3  0.2988     0.4581 0.016 0.000 0.836 0.140 0.004 0.004
#> GSM955015     4  0.5559     0.5233 0.000 0.028 0.376 0.524 0.000 0.072
#> GSM955017     1  0.2785     0.8222 0.852 0.008 0.004 0.128 0.000 0.008
#> GSM955021     2  0.5924     0.3411 0.000 0.568 0.088 0.060 0.000 0.284
#> GSM955025     2  0.6757     0.0556 0.124 0.508 0.000 0.260 0.004 0.104
#> GSM955028     1  0.1232     0.8436 0.956 0.000 0.016 0.024 0.004 0.000
#> GSM955029     2  0.6137     0.2661 0.000 0.528 0.160 0.004 0.284 0.024
#> GSM955030     3  0.5169     0.0182 0.120 0.000 0.588 0.292 0.000 0.000
#> GSM955032     3  0.6331    -0.1702 0.000 0.304 0.464 0.024 0.000 0.208
#> GSM955033     4  0.3879     0.6566 0.004 0.008 0.176 0.772 0.000 0.040
#> GSM955034     1  0.1015     0.8483 0.968 0.004 0.012 0.012 0.000 0.004
#> GSM955035     6  0.5250     0.4028 0.000 0.008 0.172 0.184 0.000 0.636
#> GSM955036     3  0.4908    -0.2010 0.028 0.000 0.528 0.424 0.020 0.000
#> GSM955037     1  0.2980     0.7816 0.848 0.000 0.116 0.028 0.004 0.004
#> GSM955039     4  0.5308     0.5583 0.004 0.000 0.352 0.544 0.000 0.100
#> GSM955041     3  0.3025     0.4942 0.000 0.000 0.820 0.024 0.000 0.156
#> GSM955042     1  0.0767     0.8506 0.976 0.000 0.000 0.012 0.004 0.008
#> GSM955045     2  0.3805     0.4773 0.004 0.664 0.328 0.000 0.004 0.000
#> GSM955046     3  0.4169     0.0385 0.008 0.004 0.620 0.364 0.000 0.004
#> GSM955047     1  0.3576     0.7996 0.820 0.044 0.000 0.108 0.000 0.028
#> GSM955050     4  0.5579     0.1507 0.228 0.016 0.000 0.600 0.000 0.156
#> GSM955052     3  0.3515     0.4948 0.000 0.064 0.828 0.024 0.000 0.084
#> GSM955053     1  0.1059     0.8434 0.964 0.000 0.016 0.016 0.004 0.000
#> GSM955056     2  0.5706     0.3693 0.000 0.480 0.392 0.012 0.000 0.116
#> GSM955058     5  0.6538     0.3763 0.000 0.080 0.248 0.004 0.536 0.132
#> GSM955059     3  0.3163     0.4218 0.008 0.012 0.808 0.172 0.000 0.000
#> GSM955060     1  0.1806     0.8379 0.908 0.004 0.000 0.088 0.000 0.000
#> GSM955061     5  0.3411     0.6599 0.000 0.016 0.092 0.004 0.836 0.052
#> GSM955065     1  0.1528     0.8445 0.944 0.000 0.016 0.028 0.000 0.012
#> GSM955066     3  0.6349    -0.3169 0.140 0.016 0.424 0.404 0.000 0.016
#> GSM955067     1  0.5333     0.6032 0.612 0.004 0.000 0.180 0.000 0.204
#> GSM955073     3  0.1643     0.5315 0.000 0.000 0.924 0.008 0.000 0.068
#> GSM955074     1  0.2781     0.8185 0.872 0.004 0.000 0.032 0.084 0.008
#> GSM955076     6  0.3182     0.4138 0.000 0.124 0.008 0.036 0.000 0.832
#> GSM955078     2  0.6289     0.3412 0.000 0.532 0.064 0.008 0.088 0.308
#> GSM955083     1  0.6360     0.0801 0.416 0.008 0.008 0.144 0.412 0.012
#> GSM955084     5  0.1719     0.6512 0.000 0.032 0.000 0.004 0.932 0.032
#> GSM955086     2  0.6725     0.4070 0.080 0.524 0.268 0.016 0.000 0.112
#> GSM955091     6  0.5278     0.3452 0.000 0.192 0.204 0.000 0.000 0.604
#> GSM955092     2  0.4599     0.4545 0.000 0.684 0.212 0.000 0.000 0.104
#> GSM955093     3  0.2546     0.5267 0.012 0.000 0.888 0.040 0.000 0.060
#> GSM955098     6  0.4153     0.3252 0.000 0.024 0.000 0.340 0.000 0.636
#> GSM955099     6  0.5810     0.1466 0.000 0.380 0.160 0.004 0.000 0.456
#> GSM955100     1  0.3690     0.7880 0.808 0.024 0.008 0.136 0.000 0.024
#> GSM955103     3  0.4965     0.3856 0.012 0.084 0.724 0.016 0.008 0.156
#> GSM955104     3  0.4622     0.2438 0.404 0.000 0.564 0.020 0.004 0.008
#> GSM955106     5  0.3918     0.5771 0.000 0.020 0.248 0.004 0.724 0.004
#> GSM955000     1  0.1699     0.8496 0.936 0.000 0.016 0.032 0.000 0.016
#> GSM955006     1  0.2703     0.8238 0.860 0.008 0.000 0.116 0.000 0.016
#> GSM955007     3  0.3232     0.4340 0.000 0.020 0.812 0.160 0.000 0.008
#> GSM955010     4  0.4895     0.5698 0.068 0.000 0.328 0.600 0.000 0.004
#> GSM955014     1  0.3334     0.8088 0.820 0.004 0.000 0.124 0.000 0.052
#> GSM955018     3  0.5700     0.3416 0.136 0.124 0.672 0.020 0.000 0.048
#> GSM955020     1  0.0551     0.8492 0.984 0.000 0.000 0.008 0.004 0.004
#> GSM955024     3  0.2257     0.5185 0.000 0.040 0.904 0.048 0.000 0.008
#> GSM955026     6  0.5671     0.4004 0.012 0.172 0.000 0.240 0.000 0.576
#> GSM955031     1  0.7691    -0.1383 0.300 0.256 0.000 0.216 0.000 0.228
#> GSM955038     6  0.5942     0.1619 0.140 0.008 0.000 0.340 0.008 0.504
#> GSM955040     4  0.4742     0.3335 0.236 0.020 0.020 0.696 0.000 0.028
#> GSM955044     4  0.7174     0.3376 0.000 0.008 0.168 0.444 0.100 0.280
#> GSM955051     1  0.2784     0.8324 0.872 0.004 0.000 0.048 0.004 0.072
#> GSM955055     2  0.2908     0.4958 0.000 0.864 0.048 0.012 0.000 0.076
#> GSM955057     1  0.2058     0.8441 0.908 0.008 0.000 0.072 0.000 0.012
#> GSM955062     2  0.4734     0.4889 0.000 0.692 0.224 0.024 0.000 0.060
#> GSM955063     3  0.2100     0.4693 0.000 0.004 0.884 0.112 0.000 0.000
#> GSM955068     6  0.4102     0.4134 0.000 0.080 0.000 0.164 0.004 0.752
#> GSM955069     3  0.4460     0.4808 0.128 0.040 0.756 0.076 0.000 0.000
#> GSM955070     4  0.5200     0.6470 0.000 0.048 0.280 0.628 0.000 0.044
#> GSM955071     1  0.6239     0.0918 0.448 0.000 0.076 0.400 0.000 0.076
#> GSM955077     2  0.6050     0.1072 0.292 0.540 0.000 0.128 0.000 0.040
#> GSM955080     2  0.6168     0.1021 0.000 0.528 0.068 0.024 0.340 0.040
#> GSM955081     6  0.6565     0.1990 0.000 0.356 0.168 0.048 0.000 0.428
#> GSM955082     3  0.6464    -0.2063 0.024 0.412 0.432 0.020 0.004 0.108
#> GSM955085     2  0.2992     0.4285 0.000 0.852 0.016 0.016 0.004 0.112
#> GSM955090     1  0.2594     0.8402 0.892 0.004 0.000 0.040 0.048 0.016
#> GSM955094     4  0.4189     0.6652 0.000 0.016 0.232 0.724 0.004 0.024
#> GSM955096     2  0.5910     0.2914 0.004 0.460 0.376 0.004 0.000 0.156
#> GSM955102     3  0.4686     0.3744 0.092 0.012 0.716 0.176 0.000 0.004
#> GSM955105     3  0.7364    -0.0489 0.228 0.220 0.452 0.016 0.004 0.080

Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.

consensus_heatmap(res, k = 2)

plot of chunk tab-MAD-NMF-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-MAD-NMF-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-MAD-NMF-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-MAD-NMF-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-MAD-NMF-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-MAD-NMF-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-MAD-NMF-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-MAD-NMF-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-MAD-NMF-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-MAD-NMF-membership-heatmap-5

As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

plot of chunk tab-MAD-NMF-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-MAD-NMF-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-MAD-NMF-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-MAD-NMF-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-MAD-NMF-get-signatures-5

Signature heatmaps where rows are not scaled:

get_signatures(res, k = 2, scale_rows = FALSE)

plot of chunk tab-MAD-NMF-get-signatures-no-scale-1

get_signatures(res, k = 3, scale_rows = FALSE)

plot of chunk tab-MAD-NMF-get-signatures-no-scale-2

get_signatures(res, k = 4, scale_rows = FALSE)

plot of chunk tab-MAD-NMF-get-signatures-no-scale-3

get_signatures(res, k = 5, scale_rows = FALSE)

plot of chunk tab-MAD-NMF-get-signatures-no-scale-4

get_signatures(res, k = 6, scale_rows = FALSE)

plot of chunk tab-MAD-NMF-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk MAD-NMF-signature_compare

get_signature() returns a data frame invisibly. TO get the list of signatures, the function call should be assigned to a variable explicitly. In following code, if plot argument is set to FALSE, no heatmap is plotted while only the differential analysis is performed.

# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)

An example of the output of tb is:

#>   which_row         fdr    mean_1    mean_2 scaled_mean_1 scaled_mean_2 km
#> 1        38 0.042760348  8.373488  9.131774    -0.5533452     0.5164555  1
#> 2        40 0.018707592  7.106213  8.469186    -0.6173731     0.5762149  1
#> 3        55 0.019134737 10.221463 11.207825    -0.6159697     0.5749050  1
#> 4        59 0.006059896  5.921854  7.869574    -0.6899429     0.6439467  1
#> 5        60 0.018055526  8.928898 10.211722    -0.6204761     0.5791110  1
#> 6        98 0.009384629 15.714769 14.887706     0.6635654    -0.6193277  2
...

The columns in tb are:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. km: Row groups if k-means clustering is applied to rows.

UMAP plot which shows how samples are separated.

dimension_reduction(res, k = 2, method = "UMAP")

plot of chunk tab-MAD-NMF-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-MAD-NMF-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-MAD-NMF-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-MAD-NMF-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-MAD-NMF-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk MAD-NMF-collect-classes

Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.

test_to_known_factors(res)
#>           n genotype/variation(p) k
#> MAD:NMF 104                 0.152 2
#> MAD:NMF  95                 0.517 3
#> MAD:NMF  85                 0.878 4
#> MAD:NMF  76                 0.489 5
#> MAD:NMF  40                 0.767 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 31589 rows and 108 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'ATC' method.
#>   Subgroups are detected by 'hclust' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 2.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

collect_plots() function collects all the plots made from res for all k (number of partitions) into one single page to provide an easy and fast comparison between different k.

collect_plots(res)

plot of chunk ATC-hclust-collect-plots

The plots are:

All the plots in panels can be made by individual functions and they are plotted later in this section.

select_partition_number() produces several plots showing different statistics for choosing “optimized” k. There are following statistics:

The detailed explanations of these statistics can be found in the cola vignette.

Generally speaking, lower PAC score, higher mean silhouette score or higher concordance corresponds to better partition. Rand index and Jaccard index measure how similar the current partition is compared to partition with k-1. If they are too similar, we won't accept k is better than k-1.

select_partition_number(res)

plot of chunk ATC-hclust-select-partition-number

The numeric values for all these statistics can be obtained by get_stats().

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.978           0.949       0.974         0.3412 0.684   0.684
#> 3 3 0.432           0.726       0.821         0.6255 0.760   0.649
#> 4 4 0.471           0.660       0.784         0.1730 0.971   0.935
#> 5 5 0.463           0.419       0.615         0.0772 0.783   0.516
#> 6 6 0.547           0.589       0.748         0.0704 0.876   0.592

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
#> GSM955002     2  0.0000      0.969 0.000 1.000
#> GSM955008     2  0.0000      0.969 0.000 1.000
#> GSM955016     2  0.9460      0.493 0.364 0.636
#> GSM955019     2  0.0000      0.969 0.000 1.000
#> GSM955022     2  0.0000      0.969 0.000 1.000
#> GSM955023     2  0.0000      0.969 0.000 1.000
#> GSM955027     2  0.0000      0.969 0.000 1.000
#> GSM955043     2  0.0000      0.969 0.000 1.000
#> GSM955048     1  0.0000      0.995 1.000 0.000
#> GSM955049     2  0.0000      0.969 0.000 1.000
#> GSM955054     2  0.0000      0.969 0.000 1.000
#> GSM955064     2  0.0000      0.969 0.000 1.000
#> GSM955072     2  0.0000      0.969 0.000 1.000
#> GSM955075     2  0.0000      0.969 0.000 1.000
#> GSM955079     2  0.0938      0.963 0.012 0.988
#> GSM955087     1  0.0000      0.995 1.000 0.000
#> GSM955088     2  0.0000      0.969 0.000 1.000
#> GSM955089     1  0.0000      0.995 1.000 0.000
#> GSM955095     2  0.0000      0.969 0.000 1.000
#> GSM955097     2  0.0000      0.969 0.000 1.000
#> GSM955101     2  0.0000      0.969 0.000 1.000
#> GSM954999     2  0.3879      0.920 0.076 0.924
#> GSM955001     2  0.0000      0.969 0.000 1.000
#> GSM955003     2  0.0000      0.969 0.000 1.000
#> GSM955004     2  0.0000      0.969 0.000 1.000
#> GSM955005     2  0.3114      0.935 0.056 0.944
#> GSM955009     2  0.0000      0.969 0.000 1.000
#> GSM955011     1  0.3114      0.939 0.944 0.056
#> GSM955012     2  0.0000      0.969 0.000 1.000
#> GSM955013     2  0.2778      0.940 0.048 0.952
#> GSM955015     2  0.0000      0.969 0.000 1.000
#> GSM955017     1  0.0938      0.987 0.988 0.012
#> GSM955021     2  0.0000      0.969 0.000 1.000
#> GSM955025     2  0.0000      0.969 0.000 1.000
#> GSM955028     1  0.0000      0.995 1.000 0.000
#> GSM955029     2  0.0000      0.969 0.000 1.000
#> GSM955030     2  0.4161      0.913 0.084 0.916
#> GSM955032     2  0.0000      0.969 0.000 1.000
#> GSM955033     2  0.3114      0.935 0.056 0.944
#> GSM955034     1  0.0000      0.995 1.000 0.000
#> GSM955035     2  0.0000      0.969 0.000 1.000
#> GSM955036     2  0.2236      0.949 0.036 0.964
#> GSM955037     1  0.0938      0.987 0.988 0.012
#> GSM955039     2  0.3114      0.935 0.056 0.944
#> GSM955041     2  0.0000      0.969 0.000 1.000
#> GSM955042     2  0.9460      0.493 0.364 0.636
#> GSM955045     2  0.0000      0.969 0.000 1.000
#> GSM955046     2  0.0000      0.969 0.000 1.000
#> GSM955047     1  0.0000      0.995 1.000 0.000
#> GSM955050     2  0.4431      0.905 0.092 0.908
#> GSM955052     2  0.0000      0.969 0.000 1.000
#> GSM955053     1  0.0000      0.995 1.000 0.000
#> GSM955056     2  0.0000      0.969 0.000 1.000
#> GSM955058     2  0.0000      0.969 0.000 1.000
#> GSM955059     2  0.0000      0.969 0.000 1.000
#> GSM955060     1  0.0376      0.993 0.996 0.004
#> GSM955061     2  0.0000      0.969 0.000 1.000
#> GSM955065     1  0.0000      0.995 1.000 0.000
#> GSM955066     2  0.0000      0.969 0.000 1.000
#> GSM955067     1  0.0000      0.995 1.000 0.000
#> GSM955073     2  0.0000      0.969 0.000 1.000
#> GSM955074     1  0.0376      0.993 0.996 0.004
#> GSM955076     2  0.0000      0.969 0.000 1.000
#> GSM955078     2  0.0000      0.969 0.000 1.000
#> GSM955083     2  0.3114      0.935 0.056 0.944
#> GSM955084     2  0.0000      0.969 0.000 1.000
#> GSM955086     2  0.0938      0.963 0.012 0.988
#> GSM955091     2  0.0000      0.969 0.000 1.000
#> GSM955092     2  0.0000      0.969 0.000 1.000
#> GSM955093     2  0.0000      0.969 0.000 1.000
#> GSM955098     2  0.0000      0.969 0.000 1.000
#> GSM955099     2  0.0000      0.969 0.000 1.000
#> GSM955100     2  0.9209      0.554 0.336 0.664
#> GSM955103     2  0.0000      0.969 0.000 1.000
#> GSM955104     2  0.5946      0.852 0.144 0.856
#> GSM955106     2  0.0000      0.969 0.000 1.000
#> GSM955000     1  0.0938      0.987 0.988 0.012
#> GSM955006     1  0.0000      0.995 1.000 0.000
#> GSM955007     2  0.0000      0.969 0.000 1.000
#> GSM955010     2  0.3584      0.926 0.068 0.932
#> GSM955014     1  0.0000      0.995 1.000 0.000
#> GSM955018     2  0.0000      0.969 0.000 1.000
#> GSM955020     1  0.0000      0.995 1.000 0.000
#> GSM955024     2  0.0000      0.969 0.000 1.000
#> GSM955026     2  0.0000      0.969 0.000 1.000
#> GSM955031     2  0.4431      0.905 0.092 0.908
#> GSM955038     2  0.7602      0.754 0.220 0.780
#> GSM955040     2  0.7950      0.724 0.240 0.760
#> GSM955044     2  0.0000      0.969 0.000 1.000
#> GSM955051     1  0.0000      0.995 1.000 0.000
#> GSM955055     2  0.0000      0.969 0.000 1.000
#> GSM955057     1  0.0000      0.995 1.000 0.000
#> GSM955062     2  0.0000      0.969 0.000 1.000
#> GSM955063     2  0.0000      0.969 0.000 1.000
#> GSM955068     2  0.0000      0.969 0.000 1.000
#> GSM955069     2  0.2778      0.940 0.048 0.952
#> GSM955070     2  0.0000      0.969 0.000 1.000
#> GSM955071     2  0.4815      0.894 0.104 0.896
#> GSM955077     2  0.4431      0.905 0.092 0.908
#> GSM955080     2  0.0000      0.969 0.000 1.000
#> GSM955081     2  0.0000      0.969 0.000 1.000
#> GSM955082     2  0.0000      0.969 0.000 1.000
#> GSM955085     2  0.0000      0.969 0.000 1.000
#> GSM955090     1  0.0000      0.995 1.000 0.000
#> GSM955094     2  0.0000      0.969 0.000 1.000
#> GSM955096     2  0.0000      0.969 0.000 1.000
#> GSM955102     2  0.1414      0.958 0.020 0.980
#> GSM955105     2  0.1414      0.959 0.020 0.980

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1    p2    p3
#> GSM955002     2  0.5733      0.578 0.000 0.676 0.324
#> GSM955008     2  0.3412      0.762 0.000 0.876 0.124
#> GSM955016     3  0.7458      0.564 0.244 0.084 0.672
#> GSM955019     2  0.2625      0.764 0.000 0.916 0.084
#> GSM955022     2  0.4842      0.702 0.000 0.776 0.224
#> GSM955023     2  0.4842      0.702 0.000 0.776 0.224
#> GSM955027     2  0.0000      0.761 0.000 1.000 0.000
#> GSM955043     2  0.0000      0.761 0.000 1.000 0.000
#> GSM955048     1  0.0000      0.969 1.000 0.000 0.000
#> GSM955049     2  0.3412      0.763 0.000 0.876 0.124
#> GSM955054     2  0.3412      0.762 0.000 0.876 0.124
#> GSM955064     2  0.3412      0.756 0.000 0.876 0.124
#> GSM955072     2  0.5216      0.653 0.000 0.740 0.260
#> GSM955075     2  0.0000      0.761 0.000 1.000 0.000
#> GSM955079     2  0.5926      0.523 0.000 0.644 0.356
#> GSM955087     1  0.0000      0.969 1.000 0.000 0.000
#> GSM955088     2  0.1643      0.770 0.000 0.956 0.044
#> GSM955089     1  0.0892      0.968 0.980 0.000 0.020
#> GSM955095     2  0.4062      0.734 0.000 0.836 0.164
#> GSM955097     2  0.5785      0.538 0.000 0.668 0.332
#> GSM955101     2  0.5733      0.579 0.000 0.676 0.324
#> GSM954999     3  0.6252      0.762 0.024 0.268 0.708
#> GSM955001     2  0.0237      0.763 0.000 0.996 0.004
#> GSM955003     2  0.3412      0.762 0.000 0.876 0.124
#> GSM955004     2  0.3879      0.609 0.000 0.848 0.152
#> GSM955005     3  0.5884      0.755 0.012 0.272 0.716
#> GSM955009     2  0.3879      0.609 0.000 0.848 0.152
#> GSM955011     1  0.3816      0.890 0.852 0.000 0.148
#> GSM955012     2  0.0424      0.765 0.000 0.992 0.008
#> GSM955013     3  0.6404      0.627 0.012 0.344 0.644
#> GSM955015     2  0.4931      0.683 0.000 0.768 0.232
#> GSM955017     1  0.2878      0.936 0.904 0.000 0.096
#> GSM955021     2  0.0237      0.763 0.000 0.996 0.004
#> GSM955025     2  0.5016      0.594 0.000 0.760 0.240
#> GSM955028     1  0.0000      0.969 1.000 0.000 0.000
#> GSM955029     2  0.0000      0.761 0.000 1.000 0.000
#> GSM955030     3  0.5414      0.782 0.016 0.212 0.772
#> GSM955032     2  0.6045      0.464 0.000 0.620 0.380
#> GSM955033     3  0.5848      0.763 0.012 0.268 0.720
#> GSM955034     1  0.0000      0.969 1.000 0.000 0.000
#> GSM955035     2  0.4399      0.721 0.000 0.812 0.188
#> GSM955036     3  0.5431      0.739 0.000 0.284 0.716
#> GSM955037     1  0.2878      0.936 0.904 0.000 0.096
#> GSM955039     3  0.5953      0.747 0.012 0.280 0.708
#> GSM955041     2  0.4399      0.721 0.000 0.812 0.188
#> GSM955042     3  0.7458      0.564 0.244 0.084 0.672
#> GSM955045     2  0.1289      0.770 0.000 0.968 0.032
#> GSM955046     2  0.6260      0.236 0.000 0.552 0.448
#> GSM955047     1  0.1529      0.962 0.960 0.000 0.040
#> GSM955050     3  0.5363      0.706 0.000 0.276 0.724
#> GSM955052     2  0.3412      0.762 0.000 0.876 0.124
#> GSM955053     1  0.0000      0.969 1.000 0.000 0.000
#> GSM955056     2  0.5529      0.616 0.000 0.704 0.296
#> GSM955058     2  0.0424      0.765 0.000 0.992 0.008
#> GSM955059     2  0.5529      0.616 0.000 0.704 0.296
#> GSM955060     1  0.2448      0.948 0.924 0.000 0.076
#> GSM955061     2  0.0424      0.765 0.000 0.992 0.008
#> GSM955065     1  0.0000      0.969 1.000 0.000 0.000
#> GSM955066     2  0.5988      0.467 0.000 0.632 0.368
#> GSM955067     1  0.0000      0.969 1.000 0.000 0.000
#> GSM955073     2  0.5016      0.673 0.000 0.760 0.240
#> GSM955074     1  0.2625      0.943 0.916 0.000 0.084
#> GSM955076     2  0.6126      0.408 0.000 0.600 0.400
#> GSM955078     2  0.0892      0.768 0.000 0.980 0.020
#> GSM955083     3  0.5919      0.756 0.012 0.276 0.712
#> GSM955084     2  0.3879      0.609 0.000 0.848 0.152
#> GSM955086     2  0.5926      0.523 0.000 0.644 0.356
#> GSM955091     2  0.1289      0.770 0.000 0.968 0.032
#> GSM955092     2  0.0424      0.765 0.000 0.992 0.008
#> GSM955093     2  0.6235      0.293 0.000 0.564 0.436
#> GSM955098     2  0.3879      0.609 0.000 0.848 0.152
#> GSM955099     2  0.0237      0.759 0.000 0.996 0.004
#> GSM955100     3  0.7610      0.633 0.216 0.108 0.676
#> GSM955103     2  0.6215      0.319 0.000 0.572 0.428
#> GSM955104     3  0.5659      0.766 0.052 0.152 0.796
#> GSM955106     2  0.5835      0.546 0.000 0.660 0.340
#> GSM955000     1  0.2878      0.936 0.904 0.000 0.096
#> GSM955006     1  0.1860      0.959 0.948 0.000 0.052
#> GSM955007     2  0.4399      0.721 0.000 0.812 0.188
#> GSM955010     3  0.5406      0.779 0.012 0.224 0.764
#> GSM955014     1  0.0000      0.969 1.000 0.000 0.000
#> GSM955018     2  0.6111      0.428 0.000 0.604 0.396
#> GSM955020     1  0.0424      0.969 0.992 0.000 0.008
#> GSM955024     2  0.3686      0.758 0.000 0.860 0.140
#> GSM955026     2  0.5650      0.597 0.000 0.688 0.312
#> GSM955031     3  0.5363      0.706 0.000 0.276 0.724
#> GSM955038     3  0.5892      0.726 0.100 0.104 0.796
#> GSM955040     3  0.6634      0.709 0.144 0.104 0.752
#> GSM955044     2  0.1163      0.769 0.000 0.972 0.028
#> GSM955051     1  0.1031      0.966 0.976 0.000 0.024
#> GSM955055     2  0.0000      0.761 0.000 1.000 0.000
#> GSM955057     1  0.0000      0.969 1.000 0.000 0.000
#> GSM955062     2  0.0424      0.765 0.000 0.992 0.008
#> GSM955063     2  0.4002      0.741 0.000 0.840 0.160
#> GSM955068     2  0.5216      0.653 0.000 0.740 0.260
#> GSM955069     3  0.6404      0.627 0.012 0.344 0.644
#> GSM955070     2  0.0892      0.765 0.000 0.980 0.020
#> GSM955071     3  0.5728      0.781 0.032 0.196 0.772
#> GSM955077     3  0.5363      0.706 0.000 0.276 0.724
#> GSM955080     2  0.5621      0.590 0.000 0.692 0.308
#> GSM955081     2  0.4178      0.729 0.000 0.828 0.172
#> GSM955082     2  0.0747      0.767 0.000 0.984 0.016
#> GSM955085     2  0.0424      0.765 0.000 0.992 0.008
#> GSM955090     1  0.0424      0.969 0.992 0.000 0.008
#> GSM955094     2  0.0237      0.759 0.000 0.996 0.004
#> GSM955096     2  0.3267      0.766 0.000 0.884 0.116
#> GSM955102     3  0.6225      0.319 0.000 0.432 0.568
#> GSM955105     2  0.6204      0.337 0.000 0.576 0.424

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM955002     2  0.7158     0.3275 0.000 0.512 0.340 0.148
#> GSM955008     2  0.3611     0.7365 0.000 0.860 0.060 0.080
#> GSM955016     3  0.5690     0.5272 0.060 0.000 0.672 0.268
#> GSM955019     2  0.3453     0.7338 0.000 0.868 0.080 0.052
#> GSM955022     2  0.5351     0.6791 0.000 0.744 0.152 0.104
#> GSM955023     2  0.5351     0.6791 0.000 0.744 0.152 0.104
#> GSM955027     2  0.1022     0.7375 0.000 0.968 0.000 0.032
#> GSM955043     2  0.1118     0.7366 0.000 0.964 0.000 0.036
#> GSM955048     1  0.0000     0.9057 1.000 0.000 0.000 0.000
#> GSM955049     2  0.3679     0.7366 0.000 0.856 0.060 0.084
#> GSM955054     2  0.3611     0.7365 0.000 0.860 0.060 0.080
#> GSM955064     2  0.3647     0.7313 0.000 0.852 0.040 0.108
#> GSM955072     2  0.6352     0.5533 0.000 0.632 0.260 0.108
#> GSM955075     2  0.1389     0.7335 0.000 0.952 0.000 0.048
#> GSM955079     2  0.6961     0.4460 0.000 0.548 0.316 0.136
#> GSM955087     1  0.0000     0.9057 1.000 0.000 0.000 0.000
#> GSM955088     2  0.2032     0.7446 0.000 0.936 0.028 0.036
#> GSM955089     1  0.1733     0.9048 0.948 0.000 0.028 0.024
#> GSM955095     2  0.4735     0.6906 0.000 0.784 0.148 0.068
#> GSM955097     2  0.6660     0.5092 0.000 0.592 0.288 0.120
#> GSM955101     2  0.6702     0.5659 0.000 0.616 0.216 0.168
#> GSM954999     3  0.4458     0.7350 0.000 0.116 0.808 0.076
#> GSM955001     2  0.0921     0.7404 0.000 0.972 0.000 0.028
#> GSM955003     2  0.3611     0.7365 0.000 0.860 0.060 0.080
#> GSM955004     2  0.5168     0.2551 0.000 0.500 0.004 0.496
#> GSM955005     3  0.3972     0.7347 0.000 0.080 0.840 0.080
#> GSM955009     2  0.5168     0.2551 0.000 0.500 0.004 0.496
#> GSM955011     1  0.5977     0.7979 0.680 0.000 0.104 0.216
#> GSM955012     2  0.0707     0.7407 0.000 0.980 0.000 0.020
#> GSM955013     3  0.5050     0.6723 0.000 0.152 0.764 0.084
#> GSM955015     2  0.5250     0.6668 0.000 0.736 0.068 0.196
#> GSM955017     1  0.5609     0.8279 0.712 0.000 0.088 0.200
#> GSM955021     2  0.0921     0.7386 0.000 0.972 0.000 0.028
#> GSM955025     2  0.6615     0.3261 0.000 0.512 0.084 0.404
#> GSM955028     1  0.0000     0.9057 1.000 0.000 0.000 0.000
#> GSM955029     2  0.1022     0.7375 0.000 0.968 0.000 0.032
#> GSM955030     3  0.2589     0.7424 0.000 0.044 0.912 0.044
#> GSM955032     2  0.7281     0.4497 0.000 0.532 0.272 0.196
#> GSM955033     3  0.4336     0.7137 0.000 0.128 0.812 0.060
#> GSM955034     1  0.0000     0.9057 1.000 0.000 0.000 0.000
#> GSM955035     2  0.4686     0.6987 0.000 0.788 0.068 0.144
#> GSM955036     3  0.6243     0.6180 0.000 0.160 0.668 0.172
#> GSM955037     1  0.5609     0.8279 0.712 0.000 0.088 0.200
#> GSM955039     3  0.4106     0.7314 0.000 0.084 0.832 0.084
#> GSM955041     2  0.4686     0.6987 0.000 0.788 0.068 0.144
#> GSM955042     3  0.5690     0.5272 0.060 0.000 0.672 0.268
#> GSM955045     2  0.1584     0.7473 0.000 0.952 0.012 0.036
#> GSM955046     2  0.7606     0.3136 0.000 0.468 0.304 0.228
#> GSM955047     1  0.3653     0.8903 0.844 0.000 0.028 0.128
#> GSM955050     3  0.5628     0.6971 0.000 0.132 0.724 0.144
#> GSM955052     2  0.3611     0.7365 0.000 0.860 0.060 0.080
#> GSM955053     1  0.0000     0.9057 1.000 0.000 0.000 0.000
#> GSM955056     2  0.6357     0.6115 0.000 0.656 0.160 0.184
#> GSM955058     2  0.0707     0.7407 0.000 0.980 0.000 0.020
#> GSM955059     2  0.6360     0.6103 0.000 0.656 0.164 0.180
#> GSM955060     1  0.4996     0.8518 0.752 0.000 0.056 0.192
#> GSM955061     2  0.0707     0.7407 0.000 0.980 0.000 0.020
#> GSM955065     1  0.0000     0.9057 1.000 0.000 0.000 0.000
#> GSM955066     2  0.7221     0.4517 0.000 0.540 0.272 0.188
#> GSM955067     1  0.0000     0.9057 1.000 0.000 0.000 0.000
#> GSM955073     2  0.5356     0.6595 0.000 0.728 0.072 0.200
#> GSM955074     1  0.5250     0.8430 0.736 0.000 0.068 0.196
#> GSM955076     2  0.7321     0.3733 0.000 0.500 0.328 0.172
#> GSM955078     2  0.1913     0.7438 0.000 0.940 0.020 0.040
#> GSM955083     3  0.4440     0.7078 0.000 0.136 0.804 0.060
#> GSM955084     2  0.5168     0.2551 0.000 0.500 0.004 0.496
#> GSM955086     2  0.6904     0.4570 0.000 0.556 0.312 0.132
#> GSM955091     2  0.1610     0.7475 0.000 0.952 0.016 0.032
#> GSM955092     2  0.1635     0.7421 0.000 0.948 0.008 0.044
#> GSM955093     2  0.7565     0.3163 0.000 0.472 0.312 0.216
#> GSM955098     2  0.5168     0.2551 0.000 0.500 0.004 0.496
#> GSM955099     2  0.1557     0.7295 0.000 0.944 0.000 0.056
#> GSM955100     3  0.5113     0.5544 0.032 0.000 0.704 0.264
#> GSM955103     3  0.7206    -0.0641 0.000 0.400 0.460 0.140
#> GSM955104     3  0.4431     0.7339 0.020 0.032 0.820 0.128
#> GSM955106     2  0.7033     0.2931 0.000 0.508 0.364 0.128
#> GSM955000     1  0.5609     0.8279 0.712 0.000 0.088 0.200
#> GSM955006     1  0.4010     0.8809 0.816 0.000 0.028 0.156
#> GSM955007     2  0.4686     0.6987 0.000 0.788 0.068 0.144
#> GSM955010     3  0.2670     0.7496 0.000 0.072 0.904 0.024
#> GSM955014     1  0.0000     0.9057 1.000 0.000 0.000 0.000
#> GSM955018     2  0.7385     0.4041 0.000 0.508 0.296 0.196
#> GSM955020     1  0.2973     0.8975 0.884 0.000 0.020 0.096
#> GSM955024     2  0.3858     0.7360 0.000 0.844 0.056 0.100
#> GSM955026     2  0.7164     0.3256 0.000 0.524 0.320 0.156
#> GSM955031     3  0.5628     0.6971 0.000 0.132 0.724 0.144
#> GSM955038     3  0.3625     0.6503 0.012 0.000 0.828 0.160
#> GSM955040     3  0.4245     0.6367 0.064 0.000 0.820 0.116
#> GSM955044     2  0.1211     0.7426 0.000 0.960 0.000 0.040
#> GSM955051     1  0.3307     0.8955 0.868 0.000 0.028 0.104
#> GSM955055     2  0.1022     0.7375 0.000 0.968 0.000 0.032
#> GSM955057     1  0.0000     0.9057 1.000 0.000 0.000 0.000
#> GSM955062     2  0.0921     0.7412 0.000 0.972 0.000 0.028
#> GSM955063     2  0.4336     0.7160 0.000 0.812 0.060 0.128
#> GSM955068     2  0.6352     0.5533 0.000 0.632 0.260 0.108
#> GSM955069     3  0.5050     0.6723 0.000 0.152 0.764 0.084
#> GSM955070     2  0.2048     0.7318 0.000 0.928 0.008 0.064
#> GSM955071     3  0.2466     0.7275 0.000 0.028 0.916 0.056
#> GSM955077     3  0.5628     0.6971 0.000 0.132 0.724 0.144
#> GSM955080     2  0.6432     0.5748 0.000 0.636 0.236 0.128
#> GSM955081     2  0.4898     0.6833 0.000 0.772 0.156 0.072
#> GSM955082     2  0.1584     0.7424 0.000 0.952 0.012 0.036
#> GSM955085     2  0.1489     0.7408 0.000 0.952 0.004 0.044
#> GSM955090     1  0.1042     0.9055 0.972 0.000 0.020 0.008
#> GSM955094     2  0.1474     0.7352 0.000 0.948 0.000 0.052
#> GSM955096     2  0.3679     0.7375 0.000 0.856 0.084 0.060
#> GSM955102     3  0.7641     0.0840 0.000 0.344 0.440 0.216
#> GSM955105     3  0.7113    -0.0292 0.000 0.416 0.456 0.128

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM955002     3   0.758    0.33735 0.000 0.332 0.404 0.208 0.056
#> GSM955008     2   0.499    0.36642 0.000 0.520 0.456 0.016 0.008
#> GSM955016     4   0.385    0.51735 0.004 0.000 0.016 0.768 0.212
#> GSM955019     2   0.513    0.38747 0.000 0.548 0.420 0.016 0.016
#> GSM955022     3   0.461    0.18456 0.000 0.360 0.620 0.020 0.000
#> GSM955023     3   0.461    0.18456 0.000 0.360 0.620 0.020 0.000
#> GSM955027     2   0.384    0.64222 0.000 0.716 0.280 0.000 0.004
#> GSM955043     2   0.381    0.64083 0.000 0.720 0.276 0.000 0.004
#> GSM955048     1   0.000    0.59537 1.000 0.000 0.000 0.000 0.000
#> GSM955049     2   0.489    0.34593 0.000 0.512 0.468 0.016 0.004
#> GSM955054     2   0.499    0.35903 0.000 0.516 0.460 0.016 0.008
#> GSM955064     2   0.463    0.43068 0.000 0.572 0.416 0.008 0.004
#> GSM955072     3   0.605    0.40925 0.000 0.300 0.592 0.080 0.028
#> GSM955075     2   0.394    0.62955 0.000 0.728 0.260 0.000 0.012
#> GSM955079     3   0.515    0.51255 0.000 0.196 0.696 0.104 0.004
#> GSM955087     1   0.000    0.59537 1.000 0.000 0.000 0.000 0.000
#> GSM955088     2   0.459    0.55989 0.000 0.624 0.360 0.008 0.008
#> GSM955089     1   0.491   -0.66554 0.560 0.000 0.000 0.028 0.412
#> GSM955095     3   0.564   -0.06673 0.000 0.448 0.496 0.032 0.024
#> GSM955097     3   0.464    0.49219 0.000 0.200 0.736 0.056 0.008
#> GSM955101     3   0.365    0.43416 0.000 0.228 0.764 0.004 0.004
#> GSM954999     4   0.457    0.68687 0.000 0.008 0.328 0.652 0.012
#> GSM955001     2   0.373    0.64287 0.000 0.712 0.288 0.000 0.000
#> GSM955003     2   0.488    0.37353 0.000 0.524 0.456 0.016 0.004
#> GSM955004     2   0.465    0.04141 0.000 0.632 0.012 0.008 0.348
#> GSM955005     4   0.423    0.66923 0.000 0.000 0.424 0.576 0.000
#> GSM955009     2   0.465    0.04141 0.000 0.632 0.012 0.008 0.348
#> GSM955011     1   0.642   -0.39418 0.420 0.000 0.000 0.172 0.408
#> GSM955012     2   0.373    0.64163 0.000 0.712 0.288 0.000 0.000
#> GSM955013     4   0.456    0.56373 0.000 0.008 0.488 0.504 0.000
#> GSM955015     3   0.479    0.00826 0.000 0.392 0.588 0.012 0.008
#> GSM955017     1   0.564    0.26704 0.632 0.000 0.000 0.152 0.216
#> GSM955021     2   0.386    0.64233 0.000 0.712 0.284 0.000 0.004
#> GSM955025     2   0.636   -0.07292 0.000 0.556 0.252 0.008 0.184
#> GSM955028     1   0.000    0.59537 1.000 0.000 0.000 0.000 0.000
#> GSM955029     2   0.384    0.64222 0.000 0.716 0.280 0.000 0.004
#> GSM955030     4   0.358    0.73144 0.000 0.000 0.240 0.756 0.004
#> GSM955032     3   0.351    0.53242 0.000 0.132 0.828 0.036 0.004
#> GSM955033     4   0.464    0.62091 0.000 0.004 0.424 0.564 0.008
#> GSM955034     1   0.000    0.59537 1.000 0.000 0.000 0.000 0.000
#> GSM955035     3   0.481   -0.20851 0.000 0.468 0.516 0.008 0.008
#> GSM955036     3   0.465   -0.49944 0.000 0.004 0.560 0.428 0.008
#> GSM955037     1   0.564    0.26704 0.632 0.000 0.000 0.152 0.216
#> GSM955039     4   0.425    0.66333 0.000 0.000 0.432 0.568 0.000
#> GSM955041     3   0.481   -0.20851 0.000 0.468 0.516 0.008 0.008
#> GSM955042     4   0.385    0.51735 0.004 0.000 0.016 0.768 0.212
#> GSM955045     2   0.428    0.54695 0.000 0.616 0.380 0.000 0.004
#> GSM955046     3   0.255    0.48939 0.000 0.036 0.904 0.048 0.012
#> GSM955047     5   0.497    0.85642 0.408 0.000 0.000 0.032 0.560
#> GSM955050     4   0.570    0.62811 0.000 0.156 0.100 0.696 0.048
#> GSM955052     2   0.488    0.37353 0.000 0.524 0.456 0.016 0.004
#> GSM955053     1   0.000    0.59537 1.000 0.000 0.000 0.000 0.000
#> GSM955056     3   0.394    0.38066 0.000 0.260 0.728 0.012 0.000
#> GSM955058     2   0.373    0.64163 0.000 0.712 0.288 0.000 0.000
#> GSM955059     3   0.394    0.38582 0.000 0.260 0.728 0.012 0.000
#> GSM955060     1   0.594   -0.40076 0.492 0.000 0.000 0.108 0.400
#> GSM955061     2   0.373    0.64163 0.000 0.712 0.288 0.000 0.000
#> GSM955065     1   0.000    0.59537 1.000 0.000 0.000 0.000 0.000
#> GSM955066     3   0.421    0.51255 0.000 0.140 0.788 0.064 0.008
#> GSM955067     1   0.000    0.59537 1.000 0.000 0.000 0.000 0.000
#> GSM955073     3   0.477    0.02457 0.000 0.384 0.596 0.012 0.008
#> GSM955074     1   0.541    0.28074 0.656 0.000 0.000 0.128 0.216
#> GSM955076     3   0.380    0.53907 0.000 0.100 0.820 0.076 0.004
#> GSM955078     2   0.462    0.58182 0.000 0.636 0.344 0.004 0.016
#> GSM955083     4   0.466    0.61080 0.000 0.004 0.436 0.552 0.008
#> GSM955084     2   0.465    0.04141 0.000 0.632 0.012 0.008 0.348
#> GSM955086     3   0.514    0.51007 0.000 0.200 0.696 0.100 0.004
#> GSM955091     2   0.430    0.59654 0.000 0.640 0.352 0.000 0.008
#> GSM955092     2   0.430    0.61726 0.000 0.672 0.316 0.004 0.008
#> GSM955093     3   0.215    0.51211 0.000 0.032 0.920 0.044 0.004
#> GSM955098     2   0.465    0.04141 0.000 0.632 0.012 0.008 0.348
#> GSM955099     2   0.401    0.62271 0.000 0.728 0.256 0.000 0.016
#> GSM955100     4   0.398    0.55618 0.016 0.000 0.024 0.792 0.168
#> GSM955103     3   0.420    0.35925 0.000 0.044 0.752 0.204 0.000
#> GSM955104     4   0.458    0.71306 0.000 0.000 0.268 0.692 0.040
#> GSM955106     3   0.716    0.36691 0.000 0.324 0.440 0.208 0.028
#> GSM955000     1   0.564    0.26704 0.632 0.000 0.000 0.152 0.216
#> GSM955006     5   0.532    0.81474 0.428 0.000 0.000 0.052 0.520
#> GSM955007     3   0.481   -0.20851 0.000 0.468 0.516 0.008 0.008
#> GSM955010     4   0.412    0.71217 0.000 0.000 0.336 0.660 0.004
#> GSM955014     1   0.000    0.59537 1.000 0.000 0.000 0.000 0.000
#> GSM955018     3   0.314    0.53621 0.000 0.096 0.860 0.040 0.004
#> GSM955020     5   0.474    0.86362 0.472 0.000 0.000 0.016 0.512
#> GSM955024     2   0.489    0.28349 0.000 0.492 0.488 0.016 0.004
#> GSM955026     3   0.766    0.30320 0.000 0.352 0.384 0.200 0.064
#> GSM955031     4   0.570    0.62811 0.000 0.156 0.100 0.696 0.048
#> GSM955038     4   0.226    0.63196 0.000 0.000 0.028 0.908 0.064
#> GSM955040     4   0.361    0.64246 0.004 0.000 0.064 0.832 0.100
#> GSM955044     2   0.397    0.62946 0.000 0.692 0.304 0.000 0.004
#> GSM955051     5   0.496    0.88405 0.452 0.000 0.000 0.028 0.520
#> GSM955055     2   0.384    0.64222 0.000 0.716 0.280 0.000 0.004
#> GSM955057     1   0.000    0.59537 1.000 0.000 0.000 0.000 0.000
#> GSM955062     2   0.375    0.64165 0.000 0.708 0.292 0.000 0.000
#> GSM955063     2   0.481    0.27251 0.000 0.504 0.480 0.008 0.008
#> GSM955068     3   0.605    0.40925 0.000 0.300 0.592 0.080 0.028
#> GSM955069     4   0.456    0.56373 0.000 0.008 0.488 0.504 0.000
#> GSM955070     2   0.434    0.61762 0.000 0.712 0.264 0.008 0.016
#> GSM955071     4   0.321    0.72212 0.000 0.000 0.180 0.812 0.008
#> GSM955077     4   0.570    0.62811 0.000 0.156 0.100 0.696 0.048
#> GSM955080     3   0.483    0.47334 0.000 0.220 0.720 0.040 0.020
#> GSM955081     3   0.562    0.02676 0.000 0.428 0.516 0.032 0.024
#> GSM955082     2   0.432    0.61775 0.000 0.668 0.320 0.004 0.008
#> GSM955085     2   0.428    0.61958 0.000 0.676 0.312 0.004 0.008
#> GSM955090     1   0.451   -0.65521 0.560 0.000 0.000 0.008 0.432
#> GSM955094     2   0.409    0.63355 0.000 0.704 0.284 0.000 0.012
#> GSM955096     2   0.505    0.28347 0.000 0.500 0.472 0.024 0.004
#> GSM955102     3   0.377    0.19856 0.000 0.016 0.788 0.188 0.008
#> GSM955105     3   0.698    0.30950 0.000 0.232 0.456 0.296 0.016

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM955002     3  0.7424     0.4295 0.000 0.320 0.344 0.156 0.180 0.000
#> GSM955008     2  0.3636     0.6452 0.000 0.764 0.208 0.012 0.016 0.000
#> GSM955016     4  0.3801     0.4797 0.000 0.000 0.012 0.740 0.016 0.232
#> GSM955019     2  0.4201     0.5503 0.000 0.732 0.196 0.004 0.068 0.000
#> GSM955022     2  0.4406    -0.0293 0.000 0.516 0.464 0.012 0.008 0.000
#> GSM955023     2  0.4406    -0.0293 0.000 0.516 0.464 0.012 0.008 0.000
#> GSM955027     2  0.0603     0.7548 0.000 0.980 0.004 0.000 0.016 0.000
#> GSM955043     2  0.0891     0.7526 0.000 0.968 0.008 0.000 0.024 0.000
#> GSM955048     1  0.0000     0.8127 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM955049     2  0.3712     0.6189 0.000 0.744 0.232 0.012 0.012 0.000
#> GSM955054     2  0.3665     0.6425 0.000 0.760 0.212 0.012 0.016 0.000
#> GSM955064     2  0.3279     0.6801 0.000 0.816 0.148 0.008 0.028 0.000
#> GSM955072     3  0.6200     0.5220 0.000 0.336 0.504 0.060 0.100 0.000
#> GSM955075     2  0.1007     0.7473 0.000 0.956 0.000 0.000 0.044 0.000
#> GSM955079     3  0.5643     0.5953 0.000 0.284 0.592 0.072 0.052 0.000
#> GSM955087     1  0.0000     0.8127 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM955088     2  0.2954     0.7094 0.000 0.852 0.096 0.004 0.048 0.000
#> GSM955089     6  0.3812     0.7162 0.264 0.000 0.000 0.024 0.000 0.712
#> GSM955095     2  0.5304     0.1836 0.000 0.588 0.316 0.020 0.076 0.000
#> GSM955097     3  0.5440     0.5946 0.000 0.248 0.640 0.064 0.040 0.008
#> GSM955101     3  0.4284     0.3427 0.000 0.392 0.588 0.004 0.016 0.000
#> GSM954999     4  0.3964     0.6391 0.000 0.008 0.308 0.676 0.004 0.004
#> GSM955001     2  0.0508     0.7564 0.000 0.984 0.004 0.000 0.012 0.000
#> GSM955003     2  0.3547     0.6479 0.000 0.768 0.208 0.012 0.012 0.000
#> GSM955004     5  0.2491     0.8742 0.000 0.164 0.000 0.000 0.836 0.000
#> GSM955005     4  0.3890     0.5796 0.000 0.004 0.400 0.596 0.000 0.000
#> GSM955009     5  0.2491     0.8742 0.000 0.164 0.000 0.000 0.836 0.000
#> GSM955011     6  0.5468     0.3796 0.292 0.000 0.000 0.140 0.004 0.564
#> GSM955012     2  0.0622     0.7565 0.000 0.980 0.012 0.000 0.008 0.000
#> GSM955013     4  0.4175     0.4685 0.000 0.012 0.464 0.524 0.000 0.000
#> GSM955015     2  0.4406     0.4261 0.000 0.640 0.324 0.008 0.028 0.000
#> GSM955017     1  0.5937     0.4334 0.584 0.000 0.020 0.108 0.020 0.268
#> GSM955021     2  0.0508     0.7554 0.000 0.984 0.004 0.000 0.012 0.000
#> GSM955025     5  0.5814     0.3950 0.000 0.248 0.224 0.004 0.524 0.000
#> GSM955028     1  0.0000     0.8127 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM955029     2  0.0603     0.7548 0.000 0.980 0.004 0.000 0.016 0.000
#> GSM955030     4  0.2823     0.6812 0.000 0.000 0.204 0.796 0.000 0.000
#> GSM955032     3  0.4035     0.6102 0.000 0.256 0.712 0.016 0.016 0.000
#> GSM955033     4  0.4409     0.5766 0.000 0.004 0.380 0.596 0.008 0.012
#> GSM955034     1  0.0000     0.8127 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM955035     2  0.4015     0.5685 0.000 0.720 0.244 0.008 0.028 0.000
#> GSM955036     3  0.4869    -0.4508 0.000 0.008 0.512 0.448 0.020 0.012
#> GSM955037     1  0.5937     0.4334 0.584 0.000 0.020 0.108 0.020 0.268
#> GSM955039     4  0.3907     0.5709 0.000 0.004 0.408 0.588 0.000 0.000
#> GSM955041     2  0.4015     0.5685 0.000 0.720 0.244 0.008 0.028 0.000
#> GSM955042     4  0.3801     0.4797 0.000 0.000 0.012 0.740 0.016 0.232
#> GSM955045     2  0.2346     0.7228 0.000 0.868 0.124 0.000 0.008 0.000
#> GSM955046     3  0.3748     0.4188 0.000 0.084 0.824 0.056 0.024 0.012
#> GSM955047     6  0.2265     0.7426 0.076 0.000 0.004 0.000 0.024 0.896
#> GSM955050     4  0.5678     0.4749 0.000 0.088 0.092 0.648 0.172 0.000
#> GSM955052     2  0.3547     0.6479 0.000 0.768 0.208 0.012 0.012 0.000
#> GSM955053     1  0.0000     0.8127 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM955056     3  0.3923     0.2751 0.000 0.416 0.580 0.004 0.000 0.000
#> GSM955058     2  0.0622     0.7565 0.000 0.980 0.012 0.000 0.008 0.000
#> GSM955059     3  0.4049     0.2891 0.000 0.412 0.580 0.004 0.004 0.000
#> GSM955060     6  0.4981     0.3590 0.340 0.000 0.000 0.072 0.004 0.584
#> GSM955061     2  0.0622     0.7565 0.000 0.980 0.012 0.000 0.008 0.000
#> GSM955065     1  0.0000     0.8127 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM955066     3  0.5047     0.5591 0.000 0.184 0.704 0.056 0.048 0.008
#> GSM955067     1  0.0000     0.8127 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM955073     2  0.4436     0.4100 0.000 0.632 0.332 0.008 0.028 0.000
#> GSM955074     1  0.5693     0.4573 0.608 0.000 0.020 0.084 0.020 0.268
#> GSM955076     3  0.3932     0.6083 0.000 0.156 0.780 0.048 0.012 0.004
#> GSM955078     2  0.2609     0.7203 0.000 0.868 0.096 0.000 0.036 0.000
#> GSM955083     4  0.4437     0.5655 0.000 0.004 0.392 0.584 0.008 0.012
#> GSM955084     5  0.2491     0.8742 0.000 0.164 0.000 0.000 0.836 0.000
#> GSM955086     3  0.5642     0.5861 0.000 0.296 0.584 0.068 0.052 0.000
#> GSM955091     2  0.2112     0.7438 0.000 0.896 0.088 0.000 0.016 0.000
#> GSM955092     2  0.1995     0.7454 0.000 0.912 0.052 0.000 0.036 0.000
#> GSM955093     3  0.2838     0.5440 0.000 0.116 0.852 0.028 0.004 0.000
#> GSM955098     5  0.2562     0.8688 0.000 0.172 0.000 0.000 0.828 0.000
#> GSM955099     2  0.1204     0.7417 0.000 0.944 0.000 0.000 0.056 0.000
#> GSM955100     4  0.4061     0.5206 0.016 0.000 0.020 0.764 0.016 0.184
#> GSM955103     3  0.4461     0.4217 0.000 0.104 0.704 0.192 0.000 0.000
#> GSM955104     4  0.4108     0.6608 0.000 0.000 0.260 0.704 0.028 0.008
#> GSM955106     3  0.7254     0.4404 0.000 0.336 0.368 0.152 0.144 0.000
#> GSM955000     1  0.5937     0.4334 0.584 0.000 0.020 0.108 0.020 0.268
#> GSM955006     6  0.2988     0.7455 0.144 0.000 0.000 0.028 0.000 0.828
#> GSM955007     2  0.4015     0.5685 0.000 0.720 0.244 0.008 0.028 0.000
#> GSM955010     4  0.3634     0.6552 0.000 0.000 0.296 0.696 0.000 0.008
#> GSM955014     1  0.0000     0.8127 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM955018     3  0.3564     0.6289 0.000 0.200 0.772 0.020 0.008 0.000
#> GSM955020     6  0.2859     0.7705 0.156 0.000 0.000 0.000 0.016 0.828
#> GSM955024     2  0.4056     0.5562 0.000 0.696 0.276 0.012 0.016 0.000
#> GSM955026     3  0.7459     0.3852 0.000 0.320 0.332 0.152 0.196 0.000
#> GSM955031     4  0.5678     0.4749 0.000 0.088 0.092 0.648 0.172 0.000
#> GSM955038     4  0.2972     0.5957 0.000 0.000 0.032 0.868 0.052 0.048
#> GSM955040     4  0.3427     0.6148 0.000 0.000 0.056 0.828 0.016 0.100
#> GSM955044     2  0.1480     0.7537 0.000 0.940 0.040 0.000 0.020 0.000
#> GSM955051     6  0.2623     0.7680 0.132 0.000 0.000 0.000 0.016 0.852
#> GSM955055     2  0.0603     0.7548 0.000 0.980 0.004 0.000 0.016 0.000
#> GSM955057     1  0.0000     0.8127 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM955062     2  0.0806     0.7589 0.000 0.972 0.020 0.000 0.008 0.000
#> GSM955063     2  0.3820     0.6231 0.000 0.756 0.204 0.008 0.032 0.000
#> GSM955068     3  0.6200     0.5220 0.000 0.336 0.504 0.060 0.100 0.000
#> GSM955069     4  0.4175     0.4685 0.000 0.012 0.464 0.524 0.000 0.000
#> GSM955070     2  0.1615     0.7406 0.000 0.928 0.004 0.004 0.064 0.000
#> GSM955071     4  0.2482     0.6866 0.000 0.000 0.148 0.848 0.000 0.004
#> GSM955077     4  0.5678     0.4749 0.000 0.088 0.092 0.648 0.172 0.000
#> GSM955080     3  0.4991     0.5846 0.000 0.276 0.652 0.020 0.040 0.012
#> GSM955081     2  0.5466     0.0769 0.000 0.556 0.340 0.020 0.084 0.000
#> GSM955082     2  0.1970     0.7445 0.000 0.912 0.060 0.000 0.028 0.000
#> GSM955085     2  0.1930     0.7453 0.000 0.916 0.048 0.000 0.036 0.000
#> GSM955090     6  0.3695     0.6876 0.272 0.000 0.000 0.000 0.016 0.712
#> GSM955094     2  0.1492     0.7489 0.000 0.940 0.024 0.000 0.036 0.000
#> GSM955096     2  0.4273     0.5266 0.000 0.696 0.260 0.012 0.032 0.000
#> GSM955102     3  0.4741     0.1342 0.000 0.048 0.716 0.200 0.024 0.012
#> GSM955105     3  0.7329     0.4480 0.000 0.244 0.396 0.232 0.128 0.000

Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.

consensus_heatmap(res, k = 2)

plot of chunk tab-ATC-hclust-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-ATC-hclust-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-ATC-hclust-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-ATC-hclust-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-ATC-hclust-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-ATC-hclust-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-ATC-hclust-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-ATC-hclust-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-ATC-hclust-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-ATC-hclust-membership-heatmap-5

As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

plot of chunk tab-ATC-hclust-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-ATC-hclust-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-ATC-hclust-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-ATC-hclust-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-ATC-hclust-get-signatures-5

Signature heatmaps where rows are not scaled:

get_signatures(res, k = 2, scale_rows = FALSE)

plot of chunk tab-ATC-hclust-get-signatures-no-scale-1

get_signatures(res, k = 3, scale_rows = FALSE)

plot of chunk tab-ATC-hclust-get-signatures-no-scale-2

get_signatures(res, k = 4, scale_rows = FALSE)

plot of chunk tab-ATC-hclust-get-signatures-no-scale-3

get_signatures(res, k = 5, scale_rows = FALSE)

plot of chunk tab-ATC-hclust-get-signatures-no-scale-4

get_signatures(res, k = 6, scale_rows = FALSE)

plot of chunk tab-ATC-hclust-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk ATC-hclust-signature_compare

get_signature() returns a data frame invisibly. TO get the list of signatures, the function call should be assigned to a variable explicitly. In following code, if plot argument is set to FALSE, no heatmap is plotted while only the differential analysis is performed.

# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)

An example of the output of tb is:

#>   which_row         fdr    mean_1    mean_2 scaled_mean_1 scaled_mean_2 km
#> 1        38 0.042760348  8.373488  9.131774    -0.5533452     0.5164555  1
#> 2        40 0.018707592  7.106213  8.469186    -0.6173731     0.5762149  1
#> 3        55 0.019134737 10.221463 11.207825    -0.6159697     0.5749050  1
#> 4        59 0.006059896  5.921854  7.869574    -0.6899429     0.6439467  1
#> 5        60 0.018055526  8.928898 10.211722    -0.6204761     0.5791110  1
#> 6        98 0.009384629 15.714769 14.887706     0.6635654    -0.6193277  2
...

The columns in tb are:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. km: Row groups if k-means clustering is applied to rows.

UMAP plot which shows how samples are separated.

dimension_reduction(res, k = 2, method = "UMAP")

plot of chunk tab-ATC-hclust-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-ATC-hclust-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-ATC-hclust-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-ATC-hclust-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-ATC-hclust-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk ATC-hclust-collect-classes

Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.

test_to_known_factors(res)
#>              n genotype/variation(p) k
#> ATC:hclust 106                 0.824 2
#> ATC:hclust  99                 0.195 3
#> ATC:hclust  89                 0.148 4
#> ATC:hclust  61                 0.550 5
#> ATC:hclust  77                 0.241 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 31589 rows and 108 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'ATC' method.
#>   Subgroups are detected by 'kmeans' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 2.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

collect_plots() function collects all the plots made from res for all k (number of partitions) into one single page to provide an easy and fast comparison between different k.

collect_plots(res)

plot of chunk ATC-kmeans-collect-plots

The plots are:

All the plots in panels can be made by individual functions and they are plotted later in this section.

select_partition_number() produces several plots showing different statistics for choosing “optimized” k. There are following statistics:

The detailed explanations of these statistics can be found in the cola vignette.

Generally speaking, lower PAC score, higher mean silhouette score or higher concordance corresponds to better partition. Rand index and Jaccard index measure how similar the current partition is compared to partition with k-1. If they are too similar, we won't accept k is better than k-1.

select_partition_number(res)

plot of chunk ATC-kmeans-select-partition-number

The numeric values for all these statistics can be obtained by get_stats().

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 1.000           0.986       0.994         0.3703 0.631   0.631
#> 3 3 0.866           0.889       0.952         0.7087 0.695   0.528
#> 4 4 0.594           0.608       0.766         0.1292 0.930   0.811
#> 5 5 0.627           0.600       0.754         0.0762 0.877   0.639
#> 6 6 0.656           0.473       0.658         0.0490 0.873   0.558

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
#> GSM955002     2   0.000      0.995 0.000 1.000
#> GSM955008     2   0.000      0.995 0.000 1.000
#> GSM955016     1   0.000      0.988 1.000 0.000
#> GSM955019     2   0.000      0.995 0.000 1.000
#> GSM955022     2   0.000      0.995 0.000 1.000
#> GSM955023     2   0.000      0.995 0.000 1.000
#> GSM955027     2   0.000      0.995 0.000 1.000
#> GSM955043     2   0.000      0.995 0.000 1.000
#> GSM955048     1   0.000      0.988 1.000 0.000
#> GSM955049     2   0.000      0.995 0.000 1.000
#> GSM955054     2   0.000      0.995 0.000 1.000
#> GSM955064     2   0.000      0.995 0.000 1.000
#> GSM955072     2   0.000      0.995 0.000 1.000
#> GSM955075     2   0.000      0.995 0.000 1.000
#> GSM955079     2   0.000      0.995 0.000 1.000
#> GSM955087     1   0.000      0.988 1.000 0.000
#> GSM955088     2   0.000      0.995 0.000 1.000
#> GSM955089     1   0.000      0.988 1.000 0.000
#> GSM955095     2   0.000      0.995 0.000 1.000
#> GSM955097     2   0.000      0.995 0.000 1.000
#> GSM955101     2   0.000      0.995 0.000 1.000
#> GSM954999     2   0.000      0.995 0.000 1.000
#> GSM955001     2   0.000      0.995 0.000 1.000
#> GSM955003     2   0.000      0.995 0.000 1.000
#> GSM955004     2   0.000      0.995 0.000 1.000
#> GSM955005     2   0.000      0.995 0.000 1.000
#> GSM955009     2   0.000      0.995 0.000 1.000
#> GSM955011     1   0.000      0.988 1.000 0.000
#> GSM955012     2   0.000      0.995 0.000 1.000
#> GSM955013     2   0.000      0.995 0.000 1.000
#> GSM955015     2   0.000      0.995 0.000 1.000
#> GSM955017     1   0.000      0.988 1.000 0.000
#> GSM955021     2   0.000      0.995 0.000 1.000
#> GSM955025     2   0.000      0.995 0.000 1.000
#> GSM955028     1   0.000      0.988 1.000 0.000
#> GSM955029     2   0.000      0.995 0.000 1.000
#> GSM955030     2   0.689      0.773 0.184 0.816
#> GSM955032     2   0.000      0.995 0.000 1.000
#> GSM955033     2   0.000      0.995 0.000 1.000
#> GSM955034     1   0.000      0.988 1.000 0.000
#> GSM955035     2   0.000      0.995 0.000 1.000
#> GSM955036     2   0.000      0.995 0.000 1.000
#> GSM955037     1   0.000      0.988 1.000 0.000
#> GSM955039     2   0.000      0.995 0.000 1.000
#> GSM955041     2   0.000      0.995 0.000 1.000
#> GSM955042     1   0.000      0.988 1.000 0.000
#> GSM955045     2   0.000      0.995 0.000 1.000
#> GSM955046     2   0.000      0.995 0.000 1.000
#> GSM955047     1   0.000      0.988 1.000 0.000
#> GSM955050     2   0.000      0.995 0.000 1.000
#> GSM955052     2   0.000      0.995 0.000 1.000
#> GSM955053     1   0.000      0.988 1.000 0.000
#> GSM955056     2   0.000      0.995 0.000 1.000
#> GSM955058     2   0.000      0.995 0.000 1.000
#> GSM955059     2   0.000      0.995 0.000 1.000
#> GSM955060     1   0.000      0.988 1.000 0.000
#> GSM955061     2   0.000      0.995 0.000 1.000
#> GSM955065     1   0.000      0.988 1.000 0.000
#> GSM955066     2   0.000      0.995 0.000 1.000
#> GSM955067     1   0.000      0.988 1.000 0.000
#> GSM955073     2   0.000      0.995 0.000 1.000
#> GSM955074     1   0.000      0.988 1.000 0.000
#> GSM955076     2   0.000      0.995 0.000 1.000
#> GSM955078     2   0.000      0.995 0.000 1.000
#> GSM955083     2   0.000      0.995 0.000 1.000
#> GSM955084     2   0.000      0.995 0.000 1.000
#> GSM955086     2   0.000      0.995 0.000 1.000
#> GSM955091     2   0.000      0.995 0.000 1.000
#> GSM955092     2   0.000      0.995 0.000 1.000
#> GSM955093     2   0.000      0.995 0.000 1.000
#> GSM955098     2   0.000      0.995 0.000 1.000
#> GSM955099     2   0.000      0.995 0.000 1.000
#> GSM955100     1   0.000      0.988 1.000 0.000
#> GSM955103     2   0.000      0.995 0.000 1.000
#> GSM955104     2   0.714      0.755 0.196 0.804
#> GSM955106     2   0.000      0.995 0.000 1.000
#> GSM955000     1   0.000      0.988 1.000 0.000
#> GSM955006     1   0.000      0.988 1.000 0.000
#> GSM955007     2   0.000      0.995 0.000 1.000
#> GSM955010     2   0.000      0.995 0.000 1.000
#> GSM955014     1   0.000      0.988 1.000 0.000
#> GSM955018     2   0.000      0.995 0.000 1.000
#> GSM955020     1   0.000      0.988 1.000 0.000
#> GSM955024     2   0.000      0.995 0.000 1.000
#> GSM955026     2   0.000      0.995 0.000 1.000
#> GSM955031     2   0.000      0.995 0.000 1.000
#> GSM955038     1   0.000      0.988 1.000 0.000
#> GSM955040     1   0.866      0.590 0.712 0.288
#> GSM955044     2   0.000      0.995 0.000 1.000
#> GSM955051     1   0.000      0.988 1.000 0.000
#> GSM955055     2   0.000      0.995 0.000 1.000
#> GSM955057     1   0.000      0.988 1.000 0.000
#> GSM955062     2   0.000      0.995 0.000 1.000
#> GSM955063     2   0.000      0.995 0.000 1.000
#> GSM955068     2   0.000      0.995 0.000 1.000
#> GSM955069     2   0.000      0.995 0.000 1.000
#> GSM955070     2   0.000      0.995 0.000 1.000
#> GSM955071     2   0.000      0.995 0.000 1.000
#> GSM955077     2   0.000      0.995 0.000 1.000
#> GSM955080     2   0.000      0.995 0.000 1.000
#> GSM955081     2   0.000      0.995 0.000 1.000
#> GSM955082     2   0.000      0.995 0.000 1.000
#> GSM955085     2   0.000      0.995 0.000 1.000
#> GSM955090     1   0.000      0.988 1.000 0.000
#> GSM955094     2   0.000      0.995 0.000 1.000
#> GSM955096     2   0.000      0.995 0.000 1.000
#> GSM955102     2   0.000      0.995 0.000 1.000
#> GSM955105     2   0.000      0.995 0.000 1.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1    p2    p3
#> GSM955002     3  0.2796     0.8420 0.000 0.092 0.908
#> GSM955008     2  0.0000     0.9779 0.000 1.000 0.000
#> GSM955016     1  0.5216     0.6921 0.740 0.000 0.260
#> GSM955019     2  0.0000     0.9779 0.000 1.000 0.000
#> GSM955022     3  0.6140     0.4170 0.000 0.404 0.596
#> GSM955023     2  0.0000     0.9779 0.000 1.000 0.000
#> GSM955027     2  0.0000     0.9779 0.000 1.000 0.000
#> GSM955043     2  0.0000     0.9779 0.000 1.000 0.000
#> GSM955048     1  0.0000     0.9526 1.000 0.000 0.000
#> GSM955049     2  0.0000     0.9779 0.000 1.000 0.000
#> GSM955054     2  0.0000     0.9779 0.000 1.000 0.000
#> GSM955064     2  0.0000     0.9779 0.000 1.000 0.000
#> GSM955072     2  0.0000     0.9779 0.000 1.000 0.000
#> GSM955075     2  0.0000     0.9779 0.000 1.000 0.000
#> GSM955079     3  0.4346     0.7796 0.000 0.184 0.816
#> GSM955087     1  0.0000     0.9526 1.000 0.000 0.000
#> GSM955088     2  0.0000     0.9779 0.000 1.000 0.000
#> GSM955089     1  0.0000     0.9526 1.000 0.000 0.000
#> GSM955095     2  0.0000     0.9779 0.000 1.000 0.000
#> GSM955097     3  0.4555     0.7687 0.000 0.200 0.800
#> GSM955101     3  0.6291     0.2308 0.000 0.468 0.532
#> GSM954999     3  0.0000     0.8814 0.000 0.000 1.000
#> GSM955001     2  0.0000     0.9779 0.000 1.000 0.000
#> GSM955003     2  0.0000     0.9779 0.000 1.000 0.000
#> GSM955004     2  0.0237     0.9750 0.000 0.996 0.004
#> GSM955005     3  0.0237     0.8831 0.000 0.004 0.996
#> GSM955009     2  0.0237     0.9750 0.000 0.996 0.004
#> GSM955011     1  0.6192     0.3714 0.580 0.000 0.420
#> GSM955012     2  0.0000     0.9779 0.000 1.000 0.000
#> GSM955013     3  0.0237     0.8831 0.000 0.004 0.996
#> GSM955015     2  0.0000     0.9779 0.000 1.000 0.000
#> GSM955017     1  0.0000     0.9526 1.000 0.000 0.000
#> GSM955021     2  0.0000     0.9779 0.000 1.000 0.000
#> GSM955025     2  0.0237     0.9750 0.000 0.996 0.004
#> GSM955028     1  0.0000     0.9526 1.000 0.000 0.000
#> GSM955029     2  0.0000     0.9779 0.000 1.000 0.000
#> GSM955030     3  0.0237     0.8831 0.000 0.004 0.996
#> GSM955032     3  0.5178     0.7053 0.000 0.256 0.744
#> GSM955033     3  0.0000     0.8814 0.000 0.000 1.000
#> GSM955034     1  0.0000     0.9526 1.000 0.000 0.000
#> GSM955035     2  0.0000     0.9779 0.000 1.000 0.000
#> GSM955036     3  0.0237     0.8831 0.000 0.004 0.996
#> GSM955037     1  0.2711     0.8850 0.912 0.000 0.088
#> GSM955039     3  0.0237     0.8831 0.000 0.004 0.996
#> GSM955041     2  0.0000     0.9779 0.000 1.000 0.000
#> GSM955042     3  0.6154     0.1595 0.408 0.000 0.592
#> GSM955045     2  0.0000     0.9779 0.000 1.000 0.000
#> GSM955046     3  0.0592     0.8804 0.000 0.012 0.988
#> GSM955047     1  0.0000     0.9526 1.000 0.000 0.000
#> GSM955050     3  0.0000     0.8814 0.000 0.000 1.000
#> GSM955052     2  0.0000     0.9779 0.000 1.000 0.000
#> GSM955053     1  0.0000     0.9526 1.000 0.000 0.000
#> GSM955056     2  0.5397     0.5620 0.000 0.720 0.280
#> GSM955058     2  0.0000     0.9779 0.000 1.000 0.000
#> GSM955059     3  0.5016     0.7280 0.000 0.240 0.760
#> GSM955060     1  0.0000     0.9526 1.000 0.000 0.000
#> GSM955061     2  0.0000     0.9779 0.000 1.000 0.000
#> GSM955065     1  0.0000     0.9526 1.000 0.000 0.000
#> GSM955066     3  0.5016     0.7280 0.000 0.240 0.760
#> GSM955067     1  0.0000     0.9526 1.000 0.000 0.000
#> GSM955073     2  0.3686     0.8095 0.000 0.860 0.140
#> GSM955074     1  0.0000     0.9526 1.000 0.000 0.000
#> GSM955076     3  0.0237     0.8831 0.000 0.004 0.996
#> GSM955078     2  0.0000     0.9779 0.000 1.000 0.000
#> GSM955083     3  0.0000     0.8814 0.000 0.000 1.000
#> GSM955084     2  0.0237     0.9750 0.000 0.996 0.004
#> GSM955086     3  0.2796     0.8430 0.000 0.092 0.908
#> GSM955091     2  0.0000     0.9779 0.000 1.000 0.000
#> GSM955092     2  0.0000     0.9779 0.000 1.000 0.000
#> GSM955093     3  0.0237     0.8831 0.000 0.004 0.996
#> GSM955098     2  0.0237     0.9750 0.000 0.996 0.004
#> GSM955099     2  0.0237     0.9750 0.000 0.996 0.004
#> GSM955100     1  0.5363     0.6684 0.724 0.000 0.276
#> GSM955103     3  0.0237     0.8831 0.000 0.004 0.996
#> GSM955104     3  0.0237     0.8831 0.000 0.004 0.996
#> GSM955106     2  0.0237     0.9750 0.000 0.996 0.004
#> GSM955000     1  0.0000     0.9526 1.000 0.000 0.000
#> GSM955006     1  0.0000     0.9526 1.000 0.000 0.000
#> GSM955007     2  0.0000     0.9779 0.000 1.000 0.000
#> GSM955010     3  0.0237     0.8831 0.000 0.004 0.996
#> GSM955014     1  0.0000     0.9526 1.000 0.000 0.000
#> GSM955018     3  0.0237     0.8831 0.000 0.004 0.996
#> GSM955020     1  0.0000     0.9526 1.000 0.000 0.000
#> GSM955024     2  0.0000     0.9779 0.000 1.000 0.000
#> GSM955026     2  0.2261     0.9062 0.000 0.932 0.068
#> GSM955031     3  0.0000     0.8814 0.000 0.000 1.000
#> GSM955038     3  0.0000     0.8814 0.000 0.000 1.000
#> GSM955040     3  0.0000     0.8814 0.000 0.000 1.000
#> GSM955044     2  0.0000     0.9779 0.000 1.000 0.000
#> GSM955051     1  0.0000     0.9526 1.000 0.000 0.000
#> GSM955055     2  0.0000     0.9779 0.000 1.000 0.000
#> GSM955057     1  0.0000     0.9526 1.000 0.000 0.000
#> GSM955062     2  0.0000     0.9779 0.000 1.000 0.000
#> GSM955063     2  0.0000     0.9779 0.000 1.000 0.000
#> GSM955068     2  0.6252     0.0586 0.000 0.556 0.444
#> GSM955069     3  0.0237     0.8831 0.000 0.004 0.996
#> GSM955070     2  0.0000     0.9779 0.000 1.000 0.000
#> GSM955071     3  0.0000     0.8814 0.000 0.000 1.000
#> GSM955077     3  0.4887     0.7289 0.000 0.228 0.772
#> GSM955080     2  0.0000     0.9779 0.000 1.000 0.000
#> GSM955081     3  0.4346     0.7796 0.000 0.184 0.816
#> GSM955082     2  0.0000     0.9779 0.000 1.000 0.000
#> GSM955085     2  0.0000     0.9779 0.000 1.000 0.000
#> GSM955090     1  0.0000     0.9526 1.000 0.000 0.000
#> GSM955094     2  0.0000     0.9779 0.000 1.000 0.000
#> GSM955096     2  0.0000     0.9779 0.000 1.000 0.000
#> GSM955102     3  0.0237     0.8831 0.000 0.004 0.996
#> GSM955105     3  0.2711     0.8437 0.000 0.088 0.912

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM955002     3  0.4856     0.4843 0.000 0.084 0.780 0.136
#> GSM955008     2  0.4008     0.7130 0.000 0.756 0.244 0.000
#> GSM955016     4  0.5434     0.6423 0.188 0.000 0.084 0.728
#> GSM955019     2  0.5174     0.7312 0.000 0.760 0.116 0.124
#> GSM955022     3  0.3123     0.5014 0.000 0.156 0.844 0.000
#> GSM955023     2  0.4605     0.6420 0.000 0.664 0.336 0.000
#> GSM955027     2  0.0000     0.8126 0.000 1.000 0.000 0.000
#> GSM955043     2  0.0188     0.8132 0.000 0.996 0.004 0.000
#> GSM955048     1  0.0000     0.8962 1.000 0.000 0.000 0.000
#> GSM955049     2  0.3801     0.7275 0.000 0.780 0.220 0.000
#> GSM955054     2  0.3975     0.7162 0.000 0.760 0.240 0.000
#> GSM955064     2  0.0817     0.8115 0.000 0.976 0.024 0.000
#> GSM955072     2  0.5747     0.7030 0.000 0.704 0.196 0.100
#> GSM955075     2  0.2928     0.7802 0.000 0.880 0.012 0.108
#> GSM955079     3  0.1576     0.5807 0.000 0.048 0.948 0.004
#> GSM955087     1  0.0000     0.8962 1.000 0.000 0.000 0.000
#> GSM955088     2  0.3051     0.7863 0.000 0.884 0.028 0.088
#> GSM955089     1  0.1118     0.8925 0.964 0.000 0.000 0.036
#> GSM955095     2  0.6770     0.5545 0.000 0.580 0.292 0.128
#> GSM955097     3  0.4539     0.3813 0.000 0.272 0.720 0.008
#> GSM955101     3  0.3688     0.4529 0.000 0.208 0.792 0.000
#> GSM954999     3  0.4992    -0.1071 0.000 0.000 0.524 0.476
#> GSM955001     2  0.0188     0.8132 0.000 0.996 0.004 0.000
#> GSM955003     2  0.3975     0.7162 0.000 0.760 0.240 0.000
#> GSM955004     2  0.4720     0.6830 0.000 0.720 0.016 0.264
#> GSM955005     3  0.4972    -0.0571 0.000 0.000 0.544 0.456
#> GSM955009     2  0.4606     0.6848 0.000 0.724 0.012 0.264
#> GSM955011     4  0.5470     0.6752 0.148 0.000 0.116 0.736
#> GSM955012     2  0.0592     0.8126 0.000 0.984 0.016 0.000
#> GSM955013     3  0.2281     0.5255 0.000 0.000 0.904 0.096
#> GSM955015     2  0.4454     0.6479 0.000 0.692 0.308 0.000
#> GSM955017     1  0.3123     0.8543 0.844 0.000 0.000 0.156
#> GSM955021     2  0.0707     0.8120 0.000 0.980 0.020 0.000
#> GSM955025     2  0.6402     0.6135 0.000 0.624 0.108 0.268
#> GSM955028     1  0.0000     0.8962 1.000 0.000 0.000 0.000
#> GSM955029     2  0.0188     0.8132 0.000 0.996 0.004 0.000
#> GSM955030     3  0.4994    -0.1348 0.000 0.000 0.520 0.480
#> GSM955032     3  0.2216     0.5549 0.000 0.092 0.908 0.000
#> GSM955033     3  0.4989    -0.0965 0.000 0.000 0.528 0.472
#> GSM955034     1  0.0000     0.8962 1.000 0.000 0.000 0.000
#> GSM955035     2  0.4304     0.6777 0.000 0.716 0.284 0.000
#> GSM955036     3  0.4855     0.0794 0.000 0.000 0.600 0.400
#> GSM955037     1  0.5816     0.4232 0.572 0.000 0.036 0.392
#> GSM955039     3  0.4817     0.1047 0.000 0.000 0.612 0.388
#> GSM955041     2  0.4040     0.7101 0.000 0.752 0.248 0.000
#> GSM955042     4  0.5440     0.6812 0.104 0.000 0.160 0.736
#> GSM955045     2  0.1474     0.8065 0.000 0.948 0.052 0.000
#> GSM955046     3  0.0895     0.5766 0.000 0.004 0.976 0.020
#> GSM955047     1  0.4103     0.7984 0.744 0.000 0.000 0.256
#> GSM955050     4  0.4830     0.4455 0.000 0.000 0.392 0.608
#> GSM955052     2  0.4008     0.7130 0.000 0.756 0.244 0.000
#> GSM955053     1  0.0000     0.8962 1.000 0.000 0.000 0.000
#> GSM955056     3  0.4933    -0.1552 0.000 0.432 0.568 0.000
#> GSM955058     2  0.0188     0.8132 0.000 0.996 0.004 0.000
#> GSM955059     3  0.1637     0.5758 0.000 0.060 0.940 0.000
#> GSM955060     1  0.3569     0.8400 0.804 0.000 0.000 0.196
#> GSM955061     2  0.0188     0.8132 0.000 0.996 0.004 0.000
#> GSM955065     1  0.0000     0.8962 1.000 0.000 0.000 0.000
#> GSM955066     3  0.1474     0.5778 0.000 0.052 0.948 0.000
#> GSM955067     1  0.0000     0.8962 1.000 0.000 0.000 0.000
#> GSM955073     2  0.4830     0.5038 0.000 0.608 0.392 0.000
#> GSM955074     1  0.3528     0.8416 0.808 0.000 0.000 0.192
#> GSM955076     3  0.0895     0.5770 0.000 0.004 0.976 0.020
#> GSM955078     2  0.2662     0.7923 0.000 0.900 0.016 0.084
#> GSM955083     3  0.4992    -0.1071 0.000 0.000 0.524 0.476
#> GSM955084     2  0.4720     0.6830 0.000 0.720 0.016 0.264
#> GSM955086     3  0.1388     0.5832 0.000 0.028 0.960 0.012
#> GSM955091     2  0.0188     0.8132 0.000 0.996 0.004 0.000
#> GSM955092     2  0.0188     0.8132 0.000 0.996 0.004 0.000
#> GSM955093     3  0.0895     0.5770 0.000 0.004 0.976 0.020
#> GSM955098     2  0.4748     0.6794 0.000 0.716 0.016 0.268
#> GSM955099     2  0.3764     0.7479 0.000 0.816 0.012 0.172
#> GSM955100     4  0.5434     0.6423 0.188 0.000 0.084 0.728
#> GSM955103     3  0.0895     0.5770 0.000 0.004 0.976 0.020
#> GSM955104     3  0.4998    -0.1620 0.000 0.000 0.512 0.488
#> GSM955106     2  0.5923     0.7051 0.000 0.696 0.176 0.128
#> GSM955000     1  0.3123     0.8543 0.844 0.000 0.000 0.156
#> GSM955006     1  0.4134     0.7946 0.740 0.000 0.000 0.260
#> GSM955007     2  0.4500     0.6372 0.000 0.684 0.316 0.000
#> GSM955010     3  0.4972    -0.0571 0.000 0.000 0.544 0.456
#> GSM955014     1  0.0000     0.8962 1.000 0.000 0.000 0.000
#> GSM955018     3  0.1406     0.5832 0.000 0.024 0.960 0.016
#> GSM955020     1  0.1637     0.8858 0.940 0.000 0.000 0.060
#> GSM955024     2  0.4193     0.6940 0.000 0.732 0.268 0.000
#> GSM955026     2  0.7445     0.4532 0.000 0.508 0.224 0.268
#> GSM955031     4  0.4933     0.3390 0.000 0.000 0.432 0.568
#> GSM955038     4  0.4250     0.6272 0.000 0.000 0.276 0.724
#> GSM955040     4  0.4406     0.6048 0.000 0.000 0.300 0.700
#> GSM955044     2  0.0188     0.8132 0.000 0.996 0.004 0.000
#> GSM955051     1  0.4072     0.8018 0.748 0.000 0.000 0.252
#> GSM955055     2  0.0188     0.8132 0.000 0.996 0.004 0.000
#> GSM955057     1  0.0000     0.8962 1.000 0.000 0.000 0.000
#> GSM955062     2  0.0921     0.8107 0.000 0.972 0.028 0.000
#> GSM955063     2  0.3726     0.7299 0.000 0.788 0.212 0.000
#> GSM955068     3  0.7806    -0.0736 0.000 0.324 0.412 0.264
#> GSM955069     3  0.4134     0.3207 0.000 0.000 0.740 0.260
#> GSM955070     2  0.0895     0.8094 0.000 0.976 0.004 0.020
#> GSM955071     3  0.4998    -0.1453 0.000 0.000 0.512 0.488
#> GSM955077     4  0.7049     0.2181 0.000 0.192 0.236 0.572
#> GSM955080     2  0.5857     0.5868 0.000 0.636 0.308 0.056
#> GSM955081     3  0.1854     0.5807 0.000 0.048 0.940 0.012
#> GSM955082     2  0.4499     0.7521 0.000 0.804 0.072 0.124
#> GSM955085     2  0.2480     0.7889 0.000 0.904 0.008 0.088
#> GSM955090     1  0.1118     0.8925 0.964 0.000 0.000 0.036
#> GSM955094     2  0.0657     0.8121 0.000 0.984 0.004 0.012
#> GSM955096     2  0.4624     0.6373 0.000 0.660 0.340 0.000
#> GSM955102     3  0.4730     0.1536 0.000 0.000 0.636 0.364
#> GSM955105     3  0.2131     0.5770 0.000 0.032 0.932 0.036

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM955002     3  0.5235     0.6473 0.000 0.032 0.732 0.112 0.124
#> GSM955008     2  0.4840     0.6319 0.000 0.688 0.248 0.000 0.064
#> GSM955016     4  0.3583     0.5993 0.012 0.000 0.004 0.792 0.192
#> GSM955019     2  0.5659     0.1573 0.000 0.632 0.164 0.000 0.204
#> GSM955022     3  0.1399     0.7052 0.000 0.020 0.952 0.000 0.028
#> GSM955023     2  0.5523     0.5069 0.000 0.572 0.348 0.000 0.080
#> GSM955027     2  0.1732     0.5877 0.000 0.920 0.000 0.000 0.080
#> GSM955043     2  0.1671     0.5903 0.000 0.924 0.000 0.000 0.076
#> GSM955048     1  0.0609     0.8568 0.980 0.000 0.000 0.000 0.020
#> GSM955049     2  0.4349     0.6560 0.000 0.756 0.176 0.000 0.068
#> GSM955054     2  0.4788     0.6351 0.000 0.696 0.240 0.000 0.064
#> GSM955064     2  0.3586     0.6474 0.000 0.828 0.076 0.000 0.096
#> GSM955072     2  0.6515    -0.1927 0.000 0.440 0.364 0.000 0.196
#> GSM955075     2  0.3143     0.3877 0.000 0.796 0.000 0.000 0.204
#> GSM955079     3  0.2141     0.7214 0.000 0.016 0.916 0.004 0.064
#> GSM955087     1  0.0290     0.8586 0.992 0.000 0.008 0.000 0.000
#> GSM955088     2  0.4010     0.4770 0.000 0.792 0.072 0.000 0.136
#> GSM955089     1  0.2393     0.8488 0.900 0.000 0.004 0.016 0.080
#> GSM955095     3  0.6422    -0.1175 0.000 0.360 0.460 0.000 0.180
#> GSM955097     3  0.5840     0.5745 0.000 0.200 0.672 0.072 0.056
#> GSM955101     3  0.2193     0.6825 0.000 0.028 0.912 0.000 0.060
#> GSM954999     4  0.3562     0.6760 0.000 0.000 0.196 0.788 0.016
#> GSM955001     2  0.1732     0.5877 0.000 0.920 0.000 0.000 0.080
#> GSM955003     2  0.4762     0.6366 0.000 0.700 0.236 0.000 0.064
#> GSM955004     5  0.4517     0.8469 0.000 0.388 0.012 0.000 0.600
#> GSM955005     4  0.3671     0.6562 0.000 0.000 0.236 0.756 0.008
#> GSM955009     5  0.4192     0.8216 0.000 0.404 0.000 0.000 0.596
#> GSM955011     4  0.3618     0.5968 0.012 0.000 0.004 0.788 0.196
#> GSM955012     2  0.3375     0.6622 0.000 0.840 0.104 0.000 0.056
#> GSM955013     3  0.3961     0.6035 0.000 0.000 0.760 0.212 0.028
#> GSM955015     2  0.4937     0.6218 0.000 0.672 0.264 0.000 0.064
#> GSM955017     1  0.4991     0.7784 0.728 0.000 0.008 0.120 0.144
#> GSM955021     2  0.3532     0.6468 0.000 0.832 0.076 0.000 0.092
#> GSM955025     5  0.5459     0.8153 0.000 0.316 0.084 0.000 0.600
#> GSM955028     1  0.0290     0.8586 0.992 0.000 0.008 0.000 0.000
#> GSM955029     2  0.1732     0.5877 0.000 0.920 0.000 0.000 0.080
#> GSM955030     4  0.3659     0.6685 0.000 0.000 0.220 0.768 0.012
#> GSM955032     3  0.1386     0.7051 0.000 0.016 0.952 0.000 0.032
#> GSM955033     4  0.3821     0.6637 0.000 0.000 0.216 0.764 0.020
#> GSM955034     1  0.0290     0.8586 0.992 0.000 0.008 0.000 0.000
#> GSM955035     2  0.4937     0.6218 0.000 0.672 0.264 0.000 0.064
#> GSM955036     4  0.4686     0.3886 0.000 0.000 0.384 0.596 0.020
#> GSM955037     4  0.6614    -0.2565 0.396 0.000 0.008 0.432 0.164
#> GSM955039     4  0.4811     0.2019 0.000 0.000 0.452 0.528 0.020
#> GSM955041     2  0.4914     0.6249 0.000 0.676 0.260 0.000 0.064
#> GSM955042     4  0.3474     0.6042 0.008 0.000 0.004 0.796 0.192
#> GSM955045     2  0.3692     0.6619 0.000 0.812 0.136 0.000 0.052
#> GSM955046     3  0.3615     0.6619 0.000 0.000 0.808 0.156 0.036
#> GSM955047     1  0.6101     0.7076 0.580 0.000 0.004 0.164 0.252
#> GSM955050     4  0.2962     0.6803 0.000 0.000 0.048 0.868 0.084
#> GSM955052     2  0.4840     0.6319 0.000 0.688 0.248 0.000 0.064
#> GSM955053     1  0.0000     0.8584 1.000 0.000 0.000 0.000 0.000
#> GSM955056     3  0.4878     0.3100 0.000 0.264 0.676 0.000 0.060
#> GSM955058     2  0.1732     0.5877 0.000 0.920 0.000 0.000 0.080
#> GSM955059     3  0.0693     0.7228 0.000 0.012 0.980 0.008 0.000
#> GSM955060     1  0.5787     0.7570 0.648 0.000 0.012 0.140 0.200
#> GSM955061     2  0.1732     0.5877 0.000 0.920 0.000 0.000 0.080
#> GSM955065     1  0.0290     0.8586 0.992 0.000 0.008 0.000 0.000
#> GSM955066     3  0.2417     0.7294 0.000 0.016 0.912 0.040 0.032
#> GSM955067     1  0.0290     0.8586 0.992 0.000 0.008 0.000 0.000
#> GSM955073     2  0.5087     0.5923 0.000 0.644 0.292 0.000 0.064
#> GSM955074     1  0.5703     0.7581 0.660 0.000 0.012 0.144 0.184
#> GSM955076     3  0.3236     0.6714 0.000 0.000 0.828 0.152 0.020
#> GSM955078     2  0.3035     0.5673 0.000 0.856 0.032 0.000 0.112
#> GSM955083     4  0.3353     0.6783 0.000 0.000 0.196 0.796 0.008
#> GSM955084     5  0.4517     0.8469 0.000 0.388 0.012 0.000 0.600
#> GSM955086     3  0.2661     0.7237 0.000 0.008 0.896 0.044 0.052
#> GSM955091     2  0.1836     0.6318 0.000 0.932 0.032 0.000 0.036
#> GSM955092     2  0.1331     0.6161 0.000 0.952 0.008 0.000 0.040
#> GSM955093     3  0.3573     0.6653 0.000 0.000 0.812 0.152 0.036
#> GSM955098     5  0.4639     0.8418 0.000 0.344 0.024 0.000 0.632
#> GSM955099     2  0.3336     0.3189 0.000 0.772 0.000 0.000 0.228
#> GSM955100     4  0.3355     0.6082 0.012 0.000 0.000 0.804 0.184
#> GSM955103     3  0.3449     0.6621 0.000 0.000 0.812 0.164 0.024
#> GSM955104     4  0.3551     0.6703 0.000 0.000 0.220 0.772 0.008
#> GSM955106     2  0.6083     0.0997 0.000 0.572 0.204 0.000 0.224
#> GSM955000     1  0.4991     0.7784 0.728 0.000 0.008 0.120 0.144
#> GSM955006     1  0.6228     0.6849 0.568 0.000 0.004 0.200 0.228
#> GSM955007     2  0.4937     0.6218 0.000 0.672 0.264 0.000 0.064
#> GSM955010     4  0.3779     0.6536 0.000 0.000 0.236 0.752 0.012
#> GSM955014     1  0.0880     0.8560 0.968 0.000 0.000 0.000 0.032
#> GSM955018     3  0.2597     0.7073 0.000 0.000 0.884 0.092 0.024
#> GSM955020     1  0.3142     0.8369 0.856 0.000 0.004 0.032 0.108
#> GSM955024     2  0.4878     0.6255 0.000 0.676 0.264 0.000 0.060
#> GSM955026     5  0.6319     0.5396 0.000 0.216 0.256 0.000 0.528
#> GSM955031     4  0.4139     0.6766 0.000 0.000 0.132 0.784 0.084
#> GSM955038     4  0.2230     0.6636 0.000 0.000 0.000 0.884 0.116
#> GSM955040     4  0.1357     0.6855 0.000 0.000 0.004 0.948 0.048
#> GSM955044     2  0.1544     0.5952 0.000 0.932 0.000 0.000 0.068
#> GSM955051     1  0.6089     0.7104 0.584 0.000 0.004 0.168 0.244
#> GSM955055     2  0.1732     0.5877 0.000 0.920 0.000 0.000 0.080
#> GSM955057     1  0.0162     0.8584 0.996 0.000 0.000 0.000 0.004
#> GSM955062     2  0.3375     0.6618 0.000 0.840 0.104 0.000 0.056
#> GSM955063     2  0.4762     0.6354 0.000 0.700 0.236 0.000 0.064
#> GSM955068     3  0.6275    -0.0615 0.000 0.156 0.480 0.000 0.364
#> GSM955069     3  0.4540     0.3642 0.000 0.000 0.640 0.340 0.020
#> GSM955070     2  0.2020     0.5665 0.000 0.900 0.000 0.000 0.100
#> GSM955071     4  0.3003     0.6822 0.000 0.000 0.188 0.812 0.000
#> GSM955077     4  0.6949     0.0782 0.000 0.068 0.084 0.428 0.420
#> GSM955080     3  0.5290     0.1491 0.000 0.392 0.560 0.004 0.044
#> GSM955081     3  0.2333     0.7289 0.000 0.016 0.916 0.028 0.040
#> GSM955082     2  0.5365     0.1687 0.000 0.664 0.132 0.000 0.204
#> GSM955085     2  0.2338     0.5365 0.000 0.884 0.004 0.000 0.112
#> GSM955090     1  0.2393     0.8488 0.900 0.000 0.004 0.016 0.080
#> GSM955094     2  0.1915     0.6270 0.000 0.928 0.032 0.000 0.040
#> GSM955096     2  0.5672     0.4669 0.000 0.544 0.368 0.000 0.088
#> GSM955102     3  0.4781     0.0955 0.000 0.000 0.552 0.428 0.020
#> GSM955105     3  0.3205     0.7128 0.000 0.008 0.864 0.072 0.056

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM955002     5  0.3881     0.4950 0.000 0.008 0.168 0.032 0.780 0.012
#> GSM955008     2  0.5034     0.5677 0.000 0.520 0.000 0.000 0.076 0.404
#> GSM955016     4  0.3239     0.6130 0.000 0.000 0.152 0.816 0.008 0.024
#> GSM955019     5  0.5368     0.0495 0.000 0.408 0.000 0.004 0.492 0.096
#> GSM955022     5  0.5571     0.3761 0.000 0.000 0.228 0.000 0.552 0.220
#> GSM955023     5  0.6131    -0.2645 0.000 0.336 0.000 0.000 0.336 0.328
#> GSM955027     2  0.0146     0.5881 0.000 0.996 0.000 0.004 0.000 0.000
#> GSM955043     2  0.0000     0.5900 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM955048     1  0.1542     0.7858 0.944 0.000 0.000 0.016 0.016 0.024
#> GSM955049     2  0.5082     0.5992 0.000 0.572 0.000 0.000 0.096 0.332
#> GSM955054     2  0.5195     0.5853 0.000 0.540 0.000 0.000 0.100 0.360
#> GSM955064     2  0.3284     0.6298 0.000 0.784 0.000 0.000 0.020 0.196
#> GSM955072     5  0.4839     0.2850 0.000 0.300 0.000 0.004 0.624 0.072
#> GSM955075     2  0.2594     0.4641 0.000 0.880 0.000 0.004 0.060 0.056
#> GSM955079     5  0.3485     0.5149 0.000 0.000 0.152 0.004 0.800 0.044
#> GSM955087     1  0.0000     0.7963 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM955088     2  0.5260     0.0921 0.000 0.552 0.000 0.004 0.348 0.096
#> GSM955089     1  0.3717     0.7328 0.808 0.000 0.000 0.092 0.016 0.084
#> GSM955095     5  0.3933     0.3863 0.000 0.220 0.008 0.000 0.740 0.032
#> GSM955097     5  0.6270     0.2505 0.000 0.184 0.336 0.004 0.460 0.016
#> GSM955101     5  0.5973     0.3598 0.000 0.008 0.204 0.000 0.496 0.292
#> GSM954999     3  0.3121     0.5471 0.000 0.000 0.804 0.180 0.004 0.012
#> GSM955001     2  0.0146     0.5881 0.000 0.996 0.000 0.004 0.000 0.000
#> GSM955003     2  0.5155     0.5933 0.000 0.556 0.000 0.000 0.100 0.344
#> GSM955004     6  0.6721     0.7005 0.000 0.356 0.000 0.092 0.120 0.432
#> GSM955005     3  0.2982     0.5742 0.000 0.000 0.820 0.164 0.012 0.004
#> GSM955009     6  0.6556     0.6857 0.000 0.380 0.000 0.092 0.096 0.432
#> GSM955011     4  0.2260     0.6150 0.000 0.000 0.140 0.860 0.000 0.000
#> GSM955012     2  0.3617     0.6369 0.000 0.736 0.000 0.000 0.020 0.244
#> GSM955013     3  0.4139     0.4279 0.000 0.000 0.644 0.008 0.336 0.012
#> GSM955015     2  0.5482     0.5215 0.000 0.468 0.008 0.000 0.096 0.428
#> GSM955017     1  0.4127     0.3747 0.588 0.000 0.000 0.400 0.004 0.008
#> GSM955021     2  0.3284     0.6294 0.000 0.784 0.000 0.000 0.020 0.196
#> GSM955025     6  0.7086     0.6370 0.000 0.260 0.000 0.100 0.208 0.432
#> GSM955028     1  0.0000     0.7963 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM955029     2  0.0291     0.5868 0.000 0.992 0.000 0.004 0.004 0.000
#> GSM955030     3  0.3230     0.5484 0.000 0.000 0.792 0.192 0.008 0.008
#> GSM955032     5  0.5852     0.3471 0.000 0.000 0.240 0.004 0.516 0.240
#> GSM955033     3  0.2100     0.5982 0.000 0.000 0.884 0.112 0.004 0.000
#> GSM955034     1  0.0000     0.7963 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM955035     2  0.5370     0.5353 0.000 0.480 0.008 0.000 0.084 0.428
#> GSM955036     3  0.1616     0.6410 0.000 0.000 0.940 0.028 0.020 0.012
#> GSM955037     4  0.5839     0.2420 0.316 0.000 0.148 0.524 0.004 0.008
#> GSM955039     3  0.1555     0.6517 0.000 0.000 0.932 0.004 0.060 0.004
#> GSM955041     2  0.5058     0.5526 0.000 0.500 0.000 0.000 0.076 0.424
#> GSM955042     4  0.3460     0.6086 0.000 0.000 0.168 0.796 0.008 0.028
#> GSM955045     2  0.4066     0.6336 0.000 0.692 0.000 0.000 0.036 0.272
#> GSM955046     3  0.4503     0.5132 0.000 0.000 0.696 0.000 0.204 0.100
#> GSM955047     4  0.5566    -0.0497 0.332 0.000 0.000 0.552 0.020 0.096
#> GSM955050     4  0.6218     0.2405 0.000 0.000 0.332 0.436 0.220 0.012
#> GSM955052     2  0.5034     0.5677 0.000 0.520 0.000 0.000 0.076 0.404
#> GSM955053     1  0.0508     0.7955 0.984 0.000 0.000 0.004 0.000 0.012
#> GSM955056     6  0.6844    -0.3022 0.000 0.136 0.096 0.000 0.340 0.428
#> GSM955058     2  0.0291     0.5868 0.000 0.992 0.000 0.004 0.004 0.000
#> GSM955059     5  0.5358     0.2568 0.000 0.000 0.328 0.000 0.544 0.128
#> GSM955060     1  0.4227     0.2594 0.496 0.000 0.000 0.492 0.008 0.004
#> GSM955061     2  0.0291     0.5868 0.000 0.992 0.000 0.004 0.004 0.000
#> GSM955065     1  0.0000     0.7963 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM955066     5  0.3653     0.4551 0.000 0.000 0.228 0.004 0.748 0.020
#> GSM955067     1  0.0000     0.7963 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM955073     2  0.5852     0.4903 0.000 0.444 0.024 0.000 0.104 0.428
#> GSM955074     1  0.4390     0.2677 0.508 0.000 0.000 0.472 0.004 0.016
#> GSM955076     3  0.5061     0.3105 0.000 0.000 0.568 0.004 0.352 0.076
#> GSM955078     2  0.4260     0.5281 0.000 0.744 0.000 0.004 0.136 0.116
#> GSM955083     3  0.3089     0.5377 0.000 0.000 0.800 0.188 0.004 0.008
#> GSM955084     6  0.6721     0.7005 0.000 0.356 0.000 0.092 0.120 0.432
#> GSM955086     5  0.3362     0.4914 0.000 0.000 0.184 0.012 0.792 0.012
#> GSM955091     2  0.3458     0.6025 0.000 0.808 0.000 0.000 0.080 0.112
#> GSM955092     2  0.2591     0.5956 0.000 0.880 0.000 0.004 0.052 0.064
#> GSM955093     3  0.4812     0.4456 0.000 0.000 0.640 0.000 0.264 0.096
#> GSM955098     6  0.7081     0.5782 0.000 0.204 0.000 0.100 0.264 0.432
#> GSM955099     2  0.2817     0.4491 0.000 0.868 0.000 0.008 0.072 0.052
#> GSM955100     4  0.2946     0.6005 0.000 0.000 0.184 0.808 0.004 0.004
#> GSM955103     3  0.4566     0.4568 0.000 0.000 0.652 0.000 0.280 0.068
#> GSM955104     3  0.3426     0.5447 0.000 0.000 0.784 0.192 0.012 0.012
#> GSM955106     5  0.5241     0.2412 0.000 0.288 0.000 0.008 0.600 0.104
#> GSM955000     1  0.4127     0.3747 0.588 0.000 0.000 0.400 0.004 0.008
#> GSM955006     4  0.4135     0.1594 0.292 0.000 0.000 0.680 0.012 0.016
#> GSM955007     2  0.5457     0.5316 0.000 0.476 0.012 0.000 0.084 0.428
#> GSM955010     3  0.2544     0.5880 0.000 0.000 0.852 0.140 0.004 0.004
#> GSM955014     1  0.1787     0.7829 0.932 0.000 0.000 0.020 0.016 0.032
#> GSM955018     3  0.5074     0.0648 0.000 0.000 0.472 0.000 0.452 0.076
#> GSM955020     1  0.4688     0.6589 0.720 0.000 0.000 0.156 0.020 0.104
#> GSM955024     2  0.5144     0.5826 0.000 0.536 0.000 0.000 0.092 0.372
#> GSM955026     5  0.4865     0.2228 0.000 0.088 0.000 0.040 0.716 0.156
#> GSM955031     4  0.6390     0.1405 0.000 0.000 0.336 0.368 0.284 0.012
#> GSM955038     4  0.4614     0.4602 0.000 0.000 0.332 0.624 0.028 0.016
#> GSM955040     4  0.4297     0.2777 0.000 0.000 0.452 0.532 0.004 0.012
#> GSM955044     2  0.0363     0.5958 0.000 0.988 0.000 0.000 0.000 0.012
#> GSM955051     4  0.5689    -0.0590 0.336 0.000 0.000 0.536 0.020 0.108
#> GSM955055     2  0.0000     0.5900 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM955057     1  0.0622     0.7952 0.980 0.000 0.000 0.008 0.000 0.012
#> GSM955062     2  0.3514     0.6357 0.000 0.752 0.000 0.000 0.020 0.228
#> GSM955063     2  0.4949     0.5787 0.000 0.548 0.000 0.000 0.072 0.380
#> GSM955068     5  0.3813     0.3457 0.000 0.084 0.000 0.012 0.796 0.108
#> GSM955069     3  0.3087     0.6078 0.000 0.000 0.808 0.004 0.176 0.012
#> GSM955070     2  0.0837     0.5797 0.000 0.972 0.000 0.004 0.020 0.004
#> GSM955071     3  0.3560     0.4410 0.000 0.000 0.732 0.256 0.008 0.004
#> GSM955077     5  0.7059     0.0540 0.000 0.008 0.152 0.220 0.496 0.124
#> GSM955080     2  0.6968    -0.3565 0.000 0.368 0.192 0.000 0.364 0.076
#> GSM955081     5  0.3071     0.4986 0.000 0.000 0.180 0.000 0.804 0.016
#> GSM955082     2  0.5451    -0.1295 0.000 0.468 0.000 0.004 0.424 0.104
#> GSM955085     2  0.3098     0.5351 0.000 0.844 0.000 0.004 0.064 0.088
#> GSM955090     1  0.3765     0.7302 0.804 0.000 0.000 0.096 0.016 0.084
#> GSM955094     2  0.3742     0.5921 0.000 0.792 0.000 0.004 0.088 0.116
#> GSM955096     5  0.5868     0.0920 0.000 0.224 0.000 0.000 0.472 0.304
#> GSM955102     3  0.2218     0.6505 0.000 0.000 0.884 0.000 0.104 0.012
#> GSM955105     5  0.3590     0.5149 0.000 0.000 0.136 0.032 0.808 0.024

Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.

consensus_heatmap(res, k = 2)

plot of chunk tab-ATC-kmeans-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-ATC-kmeans-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-ATC-kmeans-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-ATC-kmeans-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-ATC-kmeans-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-ATC-kmeans-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-ATC-kmeans-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-ATC-kmeans-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-ATC-kmeans-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-ATC-kmeans-membership-heatmap-5

As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

plot of chunk tab-ATC-kmeans-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-ATC-kmeans-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-ATC-kmeans-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-ATC-kmeans-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-ATC-kmeans-get-signatures-5

Signature heatmaps where rows are not scaled:

get_signatures(res, k = 2, scale_rows = FALSE)

plot of chunk tab-ATC-kmeans-get-signatures-no-scale-1

get_signatures(res, k = 3, scale_rows = FALSE)

plot of chunk tab-ATC-kmeans-get-signatures-no-scale-2

get_signatures(res, k = 4, scale_rows = FALSE)

plot of chunk tab-ATC-kmeans-get-signatures-no-scale-3

get_signatures(res, k = 5, scale_rows = FALSE)

plot of chunk tab-ATC-kmeans-get-signatures-no-scale-4

get_signatures(res, k = 6, scale_rows = FALSE)

plot of chunk tab-ATC-kmeans-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk ATC-kmeans-signature_compare

get_signature() returns a data frame invisibly. TO get the list of signatures, the function call should be assigned to a variable explicitly. In following code, if plot argument is set to FALSE, no heatmap is plotted while only the differential analysis is performed.

# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)

An example of the output of tb is:

#>   which_row         fdr    mean_1    mean_2 scaled_mean_1 scaled_mean_2 km
#> 1        38 0.042760348  8.373488  9.131774    -0.5533452     0.5164555  1
#> 2        40 0.018707592  7.106213  8.469186    -0.6173731     0.5762149  1
#> 3        55 0.019134737 10.221463 11.207825    -0.6159697     0.5749050  1
#> 4        59 0.006059896  5.921854  7.869574    -0.6899429     0.6439467  1
#> 5        60 0.018055526  8.928898 10.211722    -0.6204761     0.5791110  1
#> 6        98 0.009384629 15.714769 14.887706     0.6635654    -0.6193277  2
...

The columns in tb are:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. km: Row groups if k-means clustering is applied to rows.

UMAP plot which shows how samples are separated.

dimension_reduction(res, k = 2, method = "UMAP")

plot of chunk tab-ATC-kmeans-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-ATC-kmeans-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-ATC-kmeans-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-ATC-kmeans-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-ATC-kmeans-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk ATC-kmeans-collect-classes

Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.

test_to_known_factors(res)
#>              n genotype/variation(p) k
#> ATC:kmeans 108                 0.747 2
#> ATC:kmeans 103                 0.552 3
#> ATC:kmeans  86                 0.863 4
#> ATC:kmeans  90                 0.554 5
#> ATC:kmeans  65                 0.248 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 31589 rows and 108 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 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-skmeans-collect-plots

The plots are:

All the plots in panels can be made by individual functions and they are plotted later in this section.

select_partition_number() produces several plots showing different statistics for choosing “optimized” k. There are following statistics:

The detailed explanations of these statistics can be found in the cola vignette.

Generally speaking, lower PAC score, higher mean silhouette score or higher concordance corresponds to better partition. Rand index and Jaccard index measure how similar the current partition is compared to partition with k-1. If they are too similar, we won't accept k is better than k-1.

select_partition_number(res)

plot of chunk ATC-skmeans-select-partition-number

The numeric values for all these statistics can be obtained by get_stats().

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 1.000           0.999       0.999         0.4757 0.525   0.525
#> 3 3 0.896           0.886       0.952         0.2633 0.877   0.771
#> 4 4 0.757           0.836       0.894         0.1852 0.828   0.597
#> 5 5 0.745           0.746       0.848         0.0551 0.911   0.690
#> 6 6 0.725           0.669       0.772         0.0279 0.946   0.775

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
#> GSM955002     2  0.0000      1.000 0.000 1.000
#> GSM955008     2  0.0000      1.000 0.000 1.000
#> GSM955016     1  0.0000      0.999 1.000 0.000
#> GSM955019     2  0.0000      1.000 0.000 1.000
#> GSM955022     2  0.0000      1.000 0.000 1.000
#> GSM955023     2  0.0000      1.000 0.000 1.000
#> GSM955027     2  0.0000      1.000 0.000 1.000
#> GSM955043     2  0.0000      1.000 0.000 1.000
#> GSM955048     1  0.0000      0.999 1.000 0.000
#> GSM955049     2  0.0000      1.000 0.000 1.000
#> GSM955054     2  0.0000      1.000 0.000 1.000
#> GSM955064     2  0.0000      1.000 0.000 1.000
#> GSM955072     2  0.0000      1.000 0.000 1.000
#> GSM955075     2  0.0000      1.000 0.000 1.000
#> GSM955079     2  0.0000      1.000 0.000 1.000
#> GSM955087     1  0.0000      0.999 1.000 0.000
#> GSM955088     2  0.0000      1.000 0.000 1.000
#> GSM955089     1  0.0000      0.999 1.000 0.000
#> GSM955095     2  0.0000      1.000 0.000 1.000
#> GSM955097     2  0.0000      1.000 0.000 1.000
#> GSM955101     2  0.0000      1.000 0.000 1.000
#> GSM954999     1  0.0000      0.999 1.000 0.000
#> GSM955001     2  0.0000      1.000 0.000 1.000
#> GSM955003     2  0.0000      1.000 0.000 1.000
#> GSM955004     2  0.0000      1.000 0.000 1.000
#> GSM955005     1  0.0000      0.999 1.000 0.000
#> GSM955009     2  0.0000      1.000 0.000 1.000
#> GSM955011     1  0.0000      0.999 1.000 0.000
#> GSM955012     2  0.0000      1.000 0.000 1.000
#> GSM955013     2  0.0938      0.988 0.012 0.988
#> GSM955015     2  0.0000      1.000 0.000 1.000
#> GSM955017     1  0.0000      0.999 1.000 0.000
#> GSM955021     2  0.0000      1.000 0.000 1.000
#> GSM955025     2  0.0000      1.000 0.000 1.000
#> GSM955028     1  0.0000      0.999 1.000 0.000
#> GSM955029     2  0.0000      1.000 0.000 1.000
#> GSM955030     1  0.0000      0.999 1.000 0.000
#> GSM955032     2  0.0000      1.000 0.000 1.000
#> GSM955033     1  0.0000      0.999 1.000 0.000
#> GSM955034     1  0.0000      0.999 1.000 0.000
#> GSM955035     2  0.0000      1.000 0.000 1.000
#> GSM955036     1  0.0000      0.999 1.000 0.000
#> GSM955037     1  0.0000      0.999 1.000 0.000
#> GSM955039     1  0.0000      0.999 1.000 0.000
#> GSM955041     2  0.0000      1.000 0.000 1.000
#> GSM955042     1  0.0000      0.999 1.000 0.000
#> GSM955045     2  0.0000      1.000 0.000 1.000
#> GSM955046     2  0.0000      1.000 0.000 1.000
#> GSM955047     1  0.0000      0.999 1.000 0.000
#> GSM955050     1  0.0000      0.999 1.000 0.000
#> GSM955052     2  0.0000      1.000 0.000 1.000
#> GSM955053     1  0.0000      0.999 1.000 0.000
#> GSM955056     2  0.0000      1.000 0.000 1.000
#> GSM955058     2  0.0000      1.000 0.000 1.000
#> GSM955059     2  0.0000      1.000 0.000 1.000
#> GSM955060     1  0.0000      0.999 1.000 0.000
#> GSM955061     2  0.0000      1.000 0.000 1.000
#> GSM955065     1  0.0000      0.999 1.000 0.000
#> GSM955066     2  0.0000      1.000 0.000 1.000
#> GSM955067     1  0.0000      0.999 1.000 0.000
#> GSM955073     2  0.0000      1.000 0.000 1.000
#> GSM955074     1  0.0000      0.999 1.000 0.000
#> GSM955076     2  0.0000      1.000 0.000 1.000
#> GSM955078     2  0.0000      1.000 0.000 1.000
#> GSM955083     1  0.0000      0.999 1.000 0.000
#> GSM955084     2  0.0000      1.000 0.000 1.000
#> GSM955086     2  0.0000      1.000 0.000 1.000
#> GSM955091     2  0.0000      1.000 0.000 1.000
#> GSM955092     2  0.0000      1.000 0.000 1.000
#> GSM955093     2  0.0000      1.000 0.000 1.000
#> GSM955098     2  0.0000      1.000 0.000 1.000
#> GSM955099     2  0.0000      1.000 0.000 1.000
#> GSM955100     1  0.0000      0.999 1.000 0.000
#> GSM955103     2  0.0000      1.000 0.000 1.000
#> GSM955104     1  0.0000      0.999 1.000 0.000
#> GSM955106     2  0.0000      1.000 0.000 1.000
#> GSM955000     1  0.0000      0.999 1.000 0.000
#> GSM955006     1  0.0000      0.999 1.000 0.000
#> GSM955007     2  0.0000      1.000 0.000 1.000
#> GSM955010     1  0.0000      0.999 1.000 0.000
#> GSM955014     1  0.0000      0.999 1.000 0.000
#> GSM955018     2  0.0000      1.000 0.000 1.000
#> GSM955020     1  0.0000      0.999 1.000 0.000
#> GSM955024     2  0.0000      1.000 0.000 1.000
#> GSM955026     2  0.0000      1.000 0.000 1.000
#> GSM955031     1  0.0000      0.999 1.000 0.000
#> GSM955038     1  0.0000      0.999 1.000 0.000
#> GSM955040     1  0.0000      0.999 1.000 0.000
#> GSM955044     2  0.0000      1.000 0.000 1.000
#> GSM955051     1  0.0000      0.999 1.000 0.000
#> GSM955055     2  0.0000      1.000 0.000 1.000
#> GSM955057     1  0.0000      0.999 1.000 0.000
#> GSM955062     2  0.0000      1.000 0.000 1.000
#> GSM955063     2  0.0000      1.000 0.000 1.000
#> GSM955068     2  0.0000      1.000 0.000 1.000
#> GSM955069     1  0.3114      0.941 0.944 0.056
#> GSM955070     2  0.0000      1.000 0.000 1.000
#> GSM955071     1  0.0000      0.999 1.000 0.000
#> GSM955077     1  0.0000      0.999 1.000 0.000
#> GSM955080     2  0.0000      1.000 0.000 1.000
#> GSM955081     2  0.0000      1.000 0.000 1.000
#> GSM955082     2  0.0000      1.000 0.000 1.000
#> GSM955085     2  0.0000      1.000 0.000 1.000
#> GSM955090     1  0.0000      0.999 1.000 0.000
#> GSM955094     2  0.0000      1.000 0.000 1.000
#> GSM955096     2  0.0000      1.000 0.000 1.000
#> GSM955102     1  0.0000      0.999 1.000 0.000
#> GSM955105     2  0.0000      1.000 0.000 1.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1    p2    p3
#> GSM955002     2  0.0000      0.934 0.000 1.000 0.000
#> GSM955008     2  0.0424      0.930 0.000 0.992 0.008
#> GSM955016     1  0.0000      0.984 1.000 0.000 0.000
#> GSM955019     2  0.0000      0.934 0.000 1.000 0.000
#> GSM955022     2  0.6215      0.322 0.000 0.572 0.428
#> GSM955023     2  0.0000      0.934 0.000 1.000 0.000
#> GSM955027     2  0.0000      0.934 0.000 1.000 0.000
#> GSM955043     2  0.0000      0.934 0.000 1.000 0.000
#> GSM955048     1  0.0000      0.984 1.000 0.000 0.000
#> GSM955049     2  0.0000      0.934 0.000 1.000 0.000
#> GSM955054     2  0.0000      0.934 0.000 1.000 0.000
#> GSM955064     2  0.0000      0.934 0.000 1.000 0.000
#> GSM955072     2  0.0000      0.934 0.000 1.000 0.000
#> GSM955075     2  0.0000      0.934 0.000 1.000 0.000
#> GSM955079     2  0.6168      0.361 0.000 0.588 0.412
#> GSM955087     1  0.0000      0.984 1.000 0.000 0.000
#> GSM955088     2  0.0000      0.934 0.000 1.000 0.000
#> GSM955089     1  0.0000      0.984 1.000 0.000 0.000
#> GSM955095     2  0.0000      0.934 0.000 1.000 0.000
#> GSM955097     2  0.3482      0.814 0.000 0.872 0.128
#> GSM955101     2  0.6204      0.333 0.000 0.576 0.424
#> GSM954999     1  0.6026      0.367 0.624 0.000 0.376
#> GSM955001     2  0.0000      0.934 0.000 1.000 0.000
#> GSM955003     2  0.0000      0.934 0.000 1.000 0.000
#> GSM955004     2  0.0000      0.934 0.000 1.000 0.000
#> GSM955005     3  0.4887      0.755 0.228 0.000 0.772
#> GSM955009     2  0.0000      0.934 0.000 1.000 0.000
#> GSM955011     1  0.0000      0.984 1.000 0.000 0.000
#> GSM955012     2  0.0000      0.934 0.000 1.000 0.000
#> GSM955013     3  0.0000      0.917 0.000 0.000 1.000
#> GSM955015     2  0.0592      0.927 0.000 0.988 0.012
#> GSM955017     1  0.0000      0.984 1.000 0.000 0.000
#> GSM955021     2  0.0000      0.934 0.000 1.000 0.000
#> GSM955025     2  0.0000      0.934 0.000 1.000 0.000
#> GSM955028     1  0.0000      0.984 1.000 0.000 0.000
#> GSM955029     2  0.0000      0.934 0.000 1.000 0.000
#> GSM955030     3  0.4887      0.755 0.228 0.000 0.772
#> GSM955032     2  0.6225      0.312 0.000 0.568 0.432
#> GSM955033     3  0.0592      0.912 0.012 0.000 0.988
#> GSM955034     1  0.0000      0.984 1.000 0.000 0.000
#> GSM955035     2  0.0592      0.927 0.000 0.988 0.012
#> GSM955036     3  0.0000      0.917 0.000 0.000 1.000
#> GSM955037     1  0.0000      0.984 1.000 0.000 0.000
#> GSM955039     3  0.0000      0.917 0.000 0.000 1.000
#> GSM955041     2  0.0424      0.930 0.000 0.992 0.008
#> GSM955042     1  0.0000      0.984 1.000 0.000 0.000
#> GSM955045     2  0.0000      0.934 0.000 1.000 0.000
#> GSM955046     3  0.0000      0.917 0.000 0.000 1.000
#> GSM955047     1  0.0000      0.984 1.000 0.000 0.000
#> GSM955050     1  0.0000      0.984 1.000 0.000 0.000
#> GSM955052     2  0.0424      0.930 0.000 0.992 0.008
#> GSM955053     1  0.0000      0.984 1.000 0.000 0.000
#> GSM955056     2  0.6204      0.333 0.000 0.576 0.424
#> GSM955058     2  0.0000      0.934 0.000 1.000 0.000
#> GSM955059     2  0.6260      0.267 0.000 0.552 0.448
#> GSM955060     1  0.0000      0.984 1.000 0.000 0.000
#> GSM955061     2  0.0000      0.934 0.000 1.000 0.000
#> GSM955065     1  0.0000      0.984 1.000 0.000 0.000
#> GSM955066     2  0.0000      0.934 0.000 1.000 0.000
#> GSM955067     1  0.0000      0.984 1.000 0.000 0.000
#> GSM955073     2  0.6192      0.342 0.000 0.580 0.420
#> GSM955074     1  0.0000      0.984 1.000 0.000 0.000
#> GSM955076     3  0.0000      0.917 0.000 0.000 1.000
#> GSM955078     2  0.0000      0.934 0.000 1.000 0.000
#> GSM955083     1  0.2356      0.907 0.928 0.000 0.072
#> GSM955084     2  0.0000      0.934 0.000 1.000 0.000
#> GSM955086     2  0.5988      0.455 0.000 0.632 0.368
#> GSM955091     2  0.0000      0.934 0.000 1.000 0.000
#> GSM955092     2  0.0000      0.934 0.000 1.000 0.000
#> GSM955093     3  0.0000      0.917 0.000 0.000 1.000
#> GSM955098     2  0.0000      0.934 0.000 1.000 0.000
#> GSM955099     2  0.0000      0.934 0.000 1.000 0.000
#> GSM955100     1  0.0000      0.984 1.000 0.000 0.000
#> GSM955103     3  0.0000      0.917 0.000 0.000 1.000
#> GSM955104     3  0.5138      0.722 0.252 0.000 0.748
#> GSM955106     2  0.0000      0.934 0.000 1.000 0.000
#> GSM955000     1  0.0000      0.984 1.000 0.000 0.000
#> GSM955006     1  0.0000      0.984 1.000 0.000 0.000
#> GSM955007     2  0.0592      0.927 0.000 0.988 0.012
#> GSM955010     3  0.4399      0.794 0.188 0.000 0.812
#> GSM955014     1  0.0000      0.984 1.000 0.000 0.000
#> GSM955018     3  0.4062      0.744 0.000 0.164 0.836
#> GSM955020     1  0.0000      0.984 1.000 0.000 0.000
#> GSM955024     2  0.0237      0.932 0.000 0.996 0.004
#> GSM955026     2  0.0000      0.934 0.000 1.000 0.000
#> GSM955031     1  0.0000      0.984 1.000 0.000 0.000
#> GSM955038     1  0.0000      0.984 1.000 0.000 0.000
#> GSM955040     1  0.0000      0.984 1.000 0.000 0.000
#> GSM955044     2  0.0000      0.934 0.000 1.000 0.000
#> GSM955051     1  0.0000      0.984 1.000 0.000 0.000
#> GSM955055     2  0.0000      0.934 0.000 1.000 0.000
#> GSM955057     1  0.0000      0.984 1.000 0.000 0.000
#> GSM955062     2  0.0000      0.934 0.000 1.000 0.000
#> GSM955063     2  0.0424      0.930 0.000 0.992 0.008
#> GSM955068     2  0.0000      0.934 0.000 1.000 0.000
#> GSM955069     3  0.0000      0.917 0.000 0.000 1.000
#> GSM955070     2  0.0000      0.934 0.000 1.000 0.000
#> GSM955071     1  0.0000      0.984 1.000 0.000 0.000
#> GSM955077     1  0.0424      0.974 0.992 0.008 0.000
#> GSM955080     2  0.3340      0.823 0.000 0.880 0.120
#> GSM955081     2  0.0000      0.934 0.000 1.000 0.000
#> GSM955082     2  0.0000      0.934 0.000 1.000 0.000
#> GSM955085     2  0.0000      0.934 0.000 1.000 0.000
#> GSM955090     1  0.0000      0.984 1.000 0.000 0.000
#> GSM955094     2  0.0000      0.934 0.000 1.000 0.000
#> GSM955096     2  0.0000      0.934 0.000 1.000 0.000
#> GSM955102     3  0.0000      0.917 0.000 0.000 1.000
#> GSM955105     2  0.0237      0.932 0.000 0.996 0.004

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM955002     2  0.0000     0.8376 0.000 1.000 0.000 0.000
#> GSM955008     3  0.3266     0.8791 0.000 0.168 0.832 0.000
#> GSM955016     1  0.0000     0.9760 1.000 0.000 0.000 0.000
#> GSM955019     2  0.2281     0.8692 0.000 0.904 0.096 0.000
#> GSM955022     3  0.2737     0.8499 0.000 0.104 0.888 0.008
#> GSM955023     3  0.3356     0.8741 0.000 0.176 0.824 0.000
#> GSM955027     2  0.3123     0.8529 0.000 0.844 0.156 0.000
#> GSM955043     2  0.3172     0.8505 0.000 0.840 0.160 0.000
#> GSM955048     1  0.0000     0.9760 1.000 0.000 0.000 0.000
#> GSM955049     3  0.3569     0.8550 0.000 0.196 0.804 0.000
#> GSM955054     3  0.3311     0.8771 0.000 0.172 0.828 0.000
#> GSM955064     2  0.4998    -0.0431 0.000 0.512 0.488 0.000
#> GSM955072     2  0.2149     0.8633 0.000 0.912 0.088 0.000
#> GSM955075     2  0.0921     0.8523 0.000 0.972 0.028 0.000
#> GSM955079     3  0.0000     0.7724 0.000 0.000 1.000 0.000
#> GSM955087     1  0.0000     0.9760 1.000 0.000 0.000 0.000
#> GSM955088     2  0.2408     0.8680 0.000 0.896 0.104 0.000
#> GSM955089     1  0.0000     0.9760 1.000 0.000 0.000 0.000
#> GSM955095     2  0.2011     0.8688 0.000 0.920 0.080 0.000
#> GSM955097     2  0.3157     0.8546 0.000 0.852 0.144 0.004
#> GSM955101     3  0.2704     0.8648 0.000 0.124 0.876 0.000
#> GSM954999     4  0.4543     0.5837 0.324 0.000 0.000 0.676
#> GSM955001     2  0.3219     0.8477 0.000 0.836 0.164 0.000
#> GSM955003     3  0.3311     0.8771 0.000 0.172 0.828 0.000
#> GSM955004     2  0.0000     0.8376 0.000 1.000 0.000 0.000
#> GSM955005     4  0.3688     0.7794 0.208 0.000 0.000 0.792
#> GSM955009     2  0.0000     0.8376 0.000 1.000 0.000 0.000
#> GSM955011     1  0.0000     0.9760 1.000 0.000 0.000 0.000
#> GSM955012     3  0.4941     0.3206 0.000 0.436 0.564 0.000
#> GSM955013     4  0.3123     0.8534 0.000 0.000 0.156 0.844
#> GSM955015     3  0.3266     0.8791 0.000 0.168 0.832 0.000
#> GSM955017     1  0.0000     0.9760 1.000 0.000 0.000 0.000
#> GSM955021     2  0.4998    -0.0431 0.000 0.512 0.488 0.000
#> GSM955025     2  0.0000     0.8376 0.000 1.000 0.000 0.000
#> GSM955028     1  0.0000     0.9760 1.000 0.000 0.000 0.000
#> GSM955029     2  0.3172     0.8505 0.000 0.840 0.160 0.000
#> GSM955030     4  0.3837     0.7626 0.224 0.000 0.000 0.776
#> GSM955032     3  0.0336     0.7649 0.000 0.000 0.992 0.008
#> GSM955033     4  0.0000     0.8941 0.000 0.000 0.000 1.000
#> GSM955034     1  0.0000     0.9760 1.000 0.000 0.000 0.000
#> GSM955035     3  0.3266     0.8791 0.000 0.168 0.832 0.000
#> GSM955036     4  0.0000     0.8941 0.000 0.000 0.000 1.000
#> GSM955037     1  0.0000     0.9760 1.000 0.000 0.000 0.000
#> GSM955039     4  0.0000     0.8941 0.000 0.000 0.000 1.000
#> GSM955041     3  0.3266     0.8791 0.000 0.168 0.832 0.000
#> GSM955042     1  0.0000     0.9760 1.000 0.000 0.000 0.000
#> GSM955045     3  0.4985     0.1963 0.000 0.468 0.532 0.000
#> GSM955046     4  0.0188     0.8942 0.000 0.000 0.004 0.996
#> GSM955047     1  0.0000     0.9760 1.000 0.000 0.000 0.000
#> GSM955050     1  0.0000     0.9760 1.000 0.000 0.000 0.000
#> GSM955052     3  0.3266     0.8791 0.000 0.168 0.832 0.000
#> GSM955053     1  0.0000     0.9760 1.000 0.000 0.000 0.000
#> GSM955056     3  0.2976     0.8592 0.000 0.120 0.872 0.008
#> GSM955058     2  0.3219     0.8477 0.000 0.836 0.164 0.000
#> GSM955059     3  0.2676     0.8397 0.000 0.092 0.896 0.012
#> GSM955060     1  0.0000     0.9760 1.000 0.000 0.000 0.000
#> GSM955061     2  0.3219     0.8477 0.000 0.836 0.164 0.000
#> GSM955065     1  0.0000     0.9760 1.000 0.000 0.000 0.000
#> GSM955066     3  0.3726     0.8336 0.000 0.212 0.788 0.000
#> GSM955067     1  0.0000     0.9760 1.000 0.000 0.000 0.000
#> GSM955073     3  0.3257     0.8741 0.000 0.152 0.844 0.004
#> GSM955074     1  0.0000     0.9760 1.000 0.000 0.000 0.000
#> GSM955076     4  0.3726     0.8176 0.000 0.000 0.212 0.788
#> GSM955078     2  0.2216     0.8690 0.000 0.908 0.092 0.000
#> GSM955083     1  0.3873     0.6682 0.772 0.000 0.000 0.228
#> GSM955084     2  0.0000     0.8376 0.000 1.000 0.000 0.000
#> GSM955086     3  0.0817     0.7577 0.000 0.024 0.976 0.000
#> GSM955091     2  0.3219     0.8477 0.000 0.836 0.164 0.000
#> GSM955092     2  0.3123     0.8528 0.000 0.844 0.156 0.000
#> GSM955093     4  0.2011     0.8786 0.000 0.000 0.080 0.920
#> GSM955098     2  0.0000     0.8376 0.000 1.000 0.000 0.000
#> GSM955099     2  0.1022     0.8528 0.000 0.968 0.032 0.000
#> GSM955100     1  0.0000     0.9760 1.000 0.000 0.000 0.000
#> GSM955103     4  0.1661     0.8847 0.000 0.004 0.052 0.944
#> GSM955104     4  0.4193     0.7051 0.268 0.000 0.000 0.732
#> GSM955106     2  0.1211     0.8385 0.000 0.960 0.040 0.000
#> GSM955000     1  0.0000     0.9760 1.000 0.000 0.000 0.000
#> GSM955006     1  0.0000     0.9760 1.000 0.000 0.000 0.000
#> GSM955007     3  0.3266     0.8791 0.000 0.168 0.832 0.000
#> GSM955010     4  0.1389     0.8847 0.048 0.000 0.000 0.952
#> GSM955014     1  0.0000     0.9760 1.000 0.000 0.000 0.000
#> GSM955018     3  0.1716     0.7065 0.000 0.000 0.936 0.064
#> GSM955020     1  0.0000     0.9760 1.000 0.000 0.000 0.000
#> GSM955024     3  0.3266     0.8791 0.000 0.168 0.832 0.000
#> GSM955026     2  0.0188     0.8345 0.000 0.996 0.004 0.000
#> GSM955031     1  0.0000     0.9760 1.000 0.000 0.000 0.000
#> GSM955038     1  0.0000     0.9760 1.000 0.000 0.000 0.000
#> GSM955040     1  0.0000     0.9760 1.000 0.000 0.000 0.000
#> GSM955044     2  0.3219     0.8477 0.000 0.836 0.164 0.000
#> GSM955051     1  0.0000     0.9760 1.000 0.000 0.000 0.000
#> GSM955055     2  0.3219     0.8477 0.000 0.836 0.164 0.000
#> GSM955057     1  0.0000     0.9760 1.000 0.000 0.000 0.000
#> GSM955062     2  0.4998    -0.0431 0.000 0.512 0.488 0.000
#> GSM955063     3  0.3266     0.8791 0.000 0.168 0.832 0.000
#> GSM955068     2  0.1389     0.7915 0.000 0.952 0.048 0.000
#> GSM955069     4  0.0188     0.8942 0.000 0.000 0.004 0.996
#> GSM955070     2  0.1474     0.8611 0.000 0.948 0.052 0.000
#> GSM955071     1  0.0000     0.9760 1.000 0.000 0.000 0.000
#> GSM955077     1  0.4790     0.4179 0.620 0.380 0.000 0.000
#> GSM955080     2  0.2944     0.8610 0.000 0.868 0.128 0.004
#> GSM955081     3  0.4382     0.7081 0.000 0.296 0.704 0.000
#> GSM955082     2  0.1867     0.8655 0.000 0.928 0.072 0.000
#> GSM955085     2  0.2281     0.8686 0.000 0.904 0.096 0.000
#> GSM955090     1  0.0000     0.9760 1.000 0.000 0.000 0.000
#> GSM955094     2  0.2814     0.8630 0.000 0.868 0.132 0.000
#> GSM955096     3  0.3400     0.8707 0.000 0.180 0.820 0.000
#> GSM955102     4  0.0000     0.8941 0.000 0.000 0.000 1.000
#> GSM955105     3  0.2973     0.6316 0.000 0.144 0.856 0.000

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM955002     5  0.3399      0.823 0.000 0.172 0.012 0.004 0.812
#> GSM955008     3  0.4182      0.685 0.000 0.400 0.600 0.000 0.000
#> GSM955016     1  0.0000      0.984 1.000 0.000 0.000 0.000 0.000
#> GSM955019     2  0.1205      0.823 0.000 0.956 0.004 0.000 0.040
#> GSM955022     3  0.3585      0.684 0.000 0.220 0.772 0.004 0.004
#> GSM955023     3  0.4283      0.614 0.000 0.456 0.544 0.000 0.000
#> GSM955027     2  0.0162      0.833 0.000 0.996 0.004 0.000 0.000
#> GSM955043     2  0.0162      0.833 0.000 0.996 0.004 0.000 0.000
#> GSM955048     1  0.0000      0.984 1.000 0.000 0.000 0.000 0.000
#> GSM955049     2  0.4294     -0.447 0.000 0.532 0.468 0.000 0.000
#> GSM955054     3  0.4219      0.671 0.000 0.416 0.584 0.000 0.000
#> GSM955064     2  0.2127      0.739 0.000 0.892 0.108 0.000 0.000
#> GSM955072     2  0.3906      0.420 0.000 0.704 0.004 0.000 0.292
#> GSM955075     2  0.1732      0.799 0.000 0.920 0.000 0.000 0.080
#> GSM955079     3  0.2331      0.456 0.000 0.020 0.900 0.000 0.080
#> GSM955087     1  0.0000      0.984 1.000 0.000 0.000 0.000 0.000
#> GSM955088     2  0.1082      0.826 0.000 0.964 0.008 0.000 0.028
#> GSM955089     1  0.0000      0.984 1.000 0.000 0.000 0.000 0.000
#> GSM955095     2  0.2304      0.772 0.000 0.892 0.008 0.000 0.100
#> GSM955097     2  0.3702      0.697 0.000 0.840 0.036 0.032 0.092
#> GSM955101     3  0.3814      0.697 0.000 0.276 0.720 0.000 0.004
#> GSM954999     4  0.4937      0.261 0.428 0.000 0.000 0.544 0.028
#> GSM955001     2  0.0162      0.833 0.000 0.996 0.000 0.000 0.004
#> GSM955003     3  0.4268      0.635 0.000 0.444 0.556 0.000 0.000
#> GSM955004     5  0.3336      0.854 0.000 0.228 0.000 0.000 0.772
#> GSM955005     4  0.3430      0.686 0.220 0.000 0.000 0.776 0.004
#> GSM955009     5  0.3336      0.854 0.000 0.228 0.000 0.000 0.772
#> GSM955011     1  0.0000      0.984 1.000 0.000 0.000 0.000 0.000
#> GSM955012     2  0.2424      0.699 0.000 0.868 0.132 0.000 0.000
#> GSM955013     4  0.4661      0.664 0.000 0.000 0.312 0.656 0.032
#> GSM955015     3  0.4150      0.690 0.000 0.388 0.612 0.000 0.000
#> GSM955017     1  0.0000      0.984 1.000 0.000 0.000 0.000 0.000
#> GSM955021     2  0.2773      0.652 0.000 0.836 0.164 0.000 0.000
#> GSM955025     5  0.3210      0.857 0.000 0.212 0.000 0.000 0.788
#> GSM955028     1  0.0000      0.984 1.000 0.000 0.000 0.000 0.000
#> GSM955029     2  0.0000      0.833 0.000 1.000 0.000 0.000 0.000
#> GSM955030     4  0.3430      0.686 0.220 0.000 0.000 0.776 0.004
#> GSM955032     3  0.2103      0.478 0.000 0.020 0.920 0.004 0.056
#> GSM955033     4  0.0794      0.779 0.000 0.000 0.000 0.972 0.028
#> GSM955034     1  0.0000      0.984 1.000 0.000 0.000 0.000 0.000
#> GSM955035     3  0.4171      0.688 0.000 0.396 0.604 0.000 0.000
#> GSM955036     4  0.0794      0.779 0.000 0.000 0.000 0.972 0.028
#> GSM955037     1  0.0162      0.981 0.996 0.000 0.000 0.004 0.000
#> GSM955039     4  0.0404      0.783 0.000 0.000 0.012 0.988 0.000
#> GSM955041     3  0.4242      0.658 0.000 0.428 0.572 0.000 0.000
#> GSM955042     1  0.0000      0.984 1.000 0.000 0.000 0.000 0.000
#> GSM955045     2  0.1908      0.757 0.000 0.908 0.092 0.000 0.000
#> GSM955046     4  0.1195      0.783 0.000 0.000 0.028 0.960 0.012
#> GSM955047     1  0.0566      0.973 0.984 0.000 0.004 0.000 0.012
#> GSM955050     1  0.0865      0.963 0.972 0.000 0.004 0.000 0.024
#> GSM955052     3  0.4182      0.685 0.000 0.400 0.600 0.000 0.000
#> GSM955053     1  0.0000      0.984 1.000 0.000 0.000 0.000 0.000
#> GSM955056     3  0.3819      0.683 0.000 0.228 0.756 0.000 0.016
#> GSM955058     2  0.0162      0.832 0.000 0.996 0.004 0.000 0.000
#> GSM955059     3  0.3718      0.670 0.000 0.196 0.784 0.004 0.016
#> GSM955060     1  0.0000      0.984 1.000 0.000 0.000 0.000 0.000
#> GSM955061     2  0.0162      0.832 0.000 0.996 0.004 0.000 0.000
#> GSM955065     1  0.0000      0.984 1.000 0.000 0.000 0.000 0.000
#> GSM955066     2  0.4803     -0.354 0.000 0.536 0.444 0.000 0.020
#> GSM955067     1  0.0000      0.984 1.000 0.000 0.000 0.000 0.000
#> GSM955073     3  0.3730      0.698 0.000 0.288 0.712 0.000 0.000
#> GSM955074     1  0.0000      0.984 1.000 0.000 0.000 0.000 0.000
#> GSM955076     4  0.5447      0.537 0.000 0.000 0.440 0.500 0.060
#> GSM955078     2  0.1124      0.827 0.000 0.960 0.004 0.000 0.036
#> GSM955083     1  0.4503      0.460 0.664 0.000 0.000 0.312 0.024
#> GSM955084     5  0.3336      0.854 0.000 0.228 0.000 0.000 0.772
#> GSM955086     3  0.2824      0.421 0.000 0.020 0.864 0.000 0.116
#> GSM955091     2  0.0290      0.831 0.000 0.992 0.008 0.000 0.000
#> GSM955092     2  0.0000      0.833 0.000 1.000 0.000 0.000 0.000
#> GSM955093     4  0.4326      0.693 0.000 0.000 0.264 0.708 0.028
#> GSM955098     5  0.2516      0.842 0.000 0.140 0.000 0.000 0.860
#> GSM955099     2  0.4114      0.191 0.000 0.624 0.000 0.000 0.376
#> GSM955100     1  0.0000      0.984 1.000 0.000 0.000 0.000 0.000
#> GSM955103     4  0.4312      0.716 0.000 0.032 0.176 0.772 0.020
#> GSM955104     4  0.3895      0.592 0.320 0.000 0.000 0.680 0.000
#> GSM955106     5  0.5016      0.504 0.000 0.348 0.044 0.000 0.608
#> GSM955000     1  0.0000      0.984 1.000 0.000 0.000 0.000 0.000
#> GSM955006     1  0.0000      0.984 1.000 0.000 0.000 0.000 0.000
#> GSM955007     3  0.4278      0.618 0.000 0.452 0.548 0.000 0.000
#> GSM955010     4  0.1485      0.777 0.032 0.000 0.000 0.948 0.020
#> GSM955014     1  0.0000      0.984 1.000 0.000 0.000 0.000 0.000
#> GSM955018     3  0.2876      0.424 0.000 0.016 0.888 0.044 0.052
#> GSM955020     1  0.0000      0.984 1.000 0.000 0.000 0.000 0.000
#> GSM955024     3  0.4302      0.563 0.000 0.480 0.520 0.000 0.000
#> GSM955026     5  0.2516      0.842 0.000 0.140 0.000 0.000 0.860
#> GSM955031     1  0.0865      0.963 0.972 0.000 0.004 0.000 0.024
#> GSM955038     1  0.0000      0.984 1.000 0.000 0.000 0.000 0.000
#> GSM955040     1  0.0324      0.978 0.992 0.000 0.000 0.004 0.004
#> GSM955044     2  0.0404      0.830 0.000 0.988 0.012 0.000 0.000
#> GSM955051     1  0.0000      0.984 1.000 0.000 0.000 0.000 0.000
#> GSM955055     2  0.0162      0.833 0.000 0.996 0.004 0.000 0.000
#> GSM955057     1  0.0000      0.984 1.000 0.000 0.000 0.000 0.000
#> GSM955062     2  0.2074      0.743 0.000 0.896 0.104 0.000 0.000
#> GSM955063     3  0.4210      0.675 0.000 0.412 0.588 0.000 0.000
#> GSM955068     5  0.2971      0.844 0.000 0.156 0.008 0.000 0.836
#> GSM955069     4  0.1357      0.781 0.000 0.000 0.048 0.948 0.004
#> GSM955070     2  0.2563      0.764 0.000 0.872 0.008 0.000 0.120
#> GSM955071     1  0.0579      0.973 0.984 0.000 0.000 0.008 0.008
#> GSM955077     5  0.4668      0.432 0.276 0.028 0.008 0.000 0.688
#> GSM955080     2  0.2363      0.799 0.000 0.912 0.024 0.012 0.052
#> GSM955081     2  0.4768      0.258 0.000 0.656 0.304 0.000 0.040
#> GSM955082     2  0.1697      0.810 0.000 0.932 0.008 0.000 0.060
#> GSM955085     2  0.0880      0.828 0.000 0.968 0.000 0.000 0.032
#> GSM955090     1  0.0000      0.984 1.000 0.000 0.000 0.000 0.000
#> GSM955094     2  0.1399      0.826 0.000 0.952 0.020 0.000 0.028
#> GSM955096     3  0.4287      0.604 0.000 0.460 0.540 0.000 0.000
#> GSM955102     4  0.0798      0.783 0.000 0.000 0.008 0.976 0.016
#> GSM955105     3  0.4689     -0.120 0.000 0.016 0.560 0.000 0.424

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM955002     6  0.3560     0.7413 0.000 0.068 0.004 0.048 0.044 0.836
#> GSM955008     2  0.0632     0.6753 0.000 0.976 0.000 0.000 0.024 0.000
#> GSM955016     1  0.1578     0.9204 0.936 0.000 0.000 0.048 0.012 0.004
#> GSM955019     5  0.5098     0.7677 0.000 0.304 0.000 0.012 0.608 0.076
#> GSM955022     2  0.2941     0.2855 0.000 0.780 0.000 0.220 0.000 0.000
#> GSM955023     2  0.2431     0.5746 0.000 0.860 0.000 0.008 0.132 0.000
#> GSM955027     5  0.3756     0.8037 0.000 0.400 0.000 0.000 0.600 0.000
#> GSM955043     5  0.3915     0.7951 0.000 0.412 0.000 0.004 0.584 0.000
#> GSM955048     1  0.0000     0.9561 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM955049     2  0.2915     0.4620 0.000 0.808 0.000 0.008 0.184 0.000
#> GSM955054     2  0.1643     0.6503 0.000 0.924 0.000 0.008 0.068 0.000
#> GSM955064     2  0.3995    -0.6481 0.000 0.516 0.000 0.004 0.480 0.000
#> GSM955072     5  0.6149     0.4514 0.000 0.224 0.000 0.008 0.436 0.332
#> GSM955075     5  0.4928     0.7370 0.000 0.260 0.000 0.004 0.640 0.096
#> GSM955079     4  0.4322     0.6685 0.000 0.372 0.000 0.600 0.028 0.000
#> GSM955087     1  0.0000     0.9561 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM955088     5  0.4585     0.7775 0.000 0.324 0.000 0.028 0.632 0.016
#> GSM955089     1  0.0000     0.9561 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM955095     5  0.5665     0.6511 0.000 0.216 0.000 0.040 0.620 0.124
#> GSM955097     5  0.5755     0.4796 0.000 0.156 0.012 0.060 0.660 0.112
#> GSM955101     2  0.2593     0.4711 0.000 0.844 0.000 0.148 0.008 0.000
#> GSM954999     3  0.6960     0.2933 0.328 0.000 0.424 0.168 0.076 0.004
#> GSM955001     5  0.3717     0.8086 0.000 0.384 0.000 0.000 0.616 0.000
#> GSM955003     2  0.2261     0.6166 0.000 0.884 0.000 0.008 0.104 0.004
#> GSM955004     6  0.1957     0.8290 0.000 0.000 0.000 0.000 0.112 0.888
#> GSM955005     3  0.4035     0.6189 0.208 0.000 0.744 0.016 0.032 0.000
#> GSM955009     6  0.2003     0.8277 0.000 0.000 0.000 0.000 0.116 0.884
#> GSM955011     1  0.0000     0.9561 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM955012     5  0.3857     0.7198 0.000 0.468 0.000 0.000 0.532 0.000
#> GSM955013     3  0.5274     0.4395 0.000 0.008 0.596 0.312 0.076 0.008
#> GSM955015     2  0.0260     0.6743 0.000 0.992 0.000 0.000 0.008 0.000
#> GSM955017     1  0.0000     0.9561 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM955021     2  0.3937    -0.5012 0.000 0.572 0.000 0.004 0.424 0.000
#> GSM955025     6  0.1910     0.8295 0.000 0.000 0.000 0.000 0.108 0.892
#> GSM955028     1  0.0000     0.9561 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM955029     5  0.3727     0.8080 0.000 0.388 0.000 0.000 0.612 0.000
#> GSM955030     3  0.3915     0.5981 0.236 0.000 0.732 0.016 0.016 0.000
#> GSM955032     2  0.3997    -0.6002 0.000 0.508 0.000 0.488 0.004 0.000
#> GSM955033     3  0.2846     0.6737 0.000 0.000 0.856 0.084 0.060 0.000
#> GSM955034     1  0.0000     0.9561 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM955035     2  0.0692     0.6733 0.000 0.976 0.000 0.004 0.020 0.000
#> GSM955036     3  0.1995     0.6953 0.000 0.000 0.912 0.052 0.036 0.000
#> GSM955037     1  0.0291     0.9526 0.992 0.000 0.004 0.000 0.004 0.000
#> GSM955039     3  0.0692     0.7047 0.000 0.000 0.976 0.004 0.020 0.000
#> GSM955041     2  0.1471     0.6521 0.000 0.932 0.000 0.004 0.064 0.000
#> GSM955042     1  0.1511     0.9231 0.940 0.000 0.000 0.044 0.012 0.004
#> GSM955045     5  0.3955     0.7608 0.000 0.436 0.000 0.004 0.560 0.000
#> GSM955046     3  0.3209     0.6859 0.000 0.024 0.856 0.056 0.060 0.004
#> GSM955047     1  0.1577     0.9176 0.940 0.000 0.000 0.036 0.016 0.008
#> GSM955050     1  0.2958     0.8481 0.864 0.000 0.000 0.060 0.060 0.016
#> GSM955052     2  0.0777     0.6748 0.000 0.972 0.000 0.004 0.024 0.000
#> GSM955053     1  0.0000     0.9561 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM955056     2  0.3298     0.2385 0.000 0.756 0.000 0.236 0.008 0.000
#> GSM955058     5  0.3727     0.8080 0.000 0.388 0.000 0.000 0.612 0.000
#> GSM955059     2  0.3972    -0.0307 0.000 0.680 0.004 0.300 0.016 0.000
#> GSM955060     1  0.0000     0.9561 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM955061     5  0.3717     0.8086 0.000 0.384 0.000 0.000 0.616 0.000
#> GSM955065     1  0.0000     0.9561 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM955066     2  0.5686     0.3439 0.000 0.600 0.000 0.136 0.236 0.028
#> GSM955067     1  0.0000     0.9561 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM955073     2  0.1908     0.5520 0.000 0.900 0.000 0.096 0.004 0.000
#> GSM955074     1  0.0000     0.9561 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM955076     4  0.6105     0.0820 0.000 0.140 0.348 0.484 0.028 0.000
#> GSM955078     5  0.4699     0.8047 0.000 0.376 0.000 0.008 0.580 0.036
#> GSM955083     1  0.6840    -0.0347 0.456 0.000 0.308 0.160 0.072 0.004
#> GSM955084     6  0.2003     0.8277 0.000 0.000 0.000 0.000 0.116 0.884
#> GSM955086     4  0.4588     0.6808 0.000 0.320 0.000 0.632 0.040 0.008
#> GSM955091     5  0.4118     0.8069 0.000 0.396 0.000 0.004 0.592 0.008
#> GSM955092     5  0.3986     0.8095 0.000 0.384 0.000 0.004 0.608 0.004
#> GSM955093     3  0.5544     0.4188 0.000 0.076 0.620 0.260 0.040 0.004
#> GSM955098     6  0.1151     0.8063 0.000 0.000 0.000 0.012 0.032 0.956
#> GSM955099     5  0.6329     0.4129 0.000 0.300 0.000 0.008 0.356 0.336
#> GSM955100     1  0.0146     0.9544 0.996 0.000 0.000 0.000 0.004 0.000
#> GSM955103     3  0.5745     0.5375 0.000 0.060 0.652 0.172 0.108 0.008
#> GSM955104     3  0.4452     0.5355 0.292 0.000 0.664 0.016 0.028 0.000
#> GSM955106     6  0.6409     0.2730 0.000 0.248 0.000 0.060 0.164 0.528
#> GSM955000     1  0.0000     0.9561 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM955006     1  0.0000     0.9561 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM955007     2  0.2006     0.6178 0.000 0.892 0.000 0.004 0.104 0.000
#> GSM955010     3  0.2450     0.6997 0.016 0.000 0.896 0.040 0.048 0.000
#> GSM955014     1  0.0000     0.9561 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM955018     4  0.5522     0.6097 0.000 0.416 0.048 0.500 0.032 0.004
#> GSM955020     1  0.0146     0.9547 0.996 0.000 0.000 0.004 0.000 0.000
#> GSM955024     2  0.2597     0.5064 0.000 0.824 0.000 0.000 0.176 0.000
#> GSM955026     6  0.1225     0.8079 0.000 0.000 0.000 0.012 0.036 0.952
#> GSM955031     1  0.3405     0.8188 0.836 0.000 0.000 0.080 0.060 0.024
#> GSM955038     1  0.1477     0.9255 0.940 0.000 0.000 0.048 0.008 0.004
#> GSM955040     1  0.1793     0.9172 0.932 0.000 0.008 0.040 0.016 0.004
#> GSM955044     5  0.3961     0.7658 0.000 0.440 0.000 0.004 0.556 0.000
#> GSM955051     1  0.0146     0.9547 0.996 0.000 0.000 0.004 0.000 0.000
#> GSM955055     5  0.3737     0.8069 0.000 0.392 0.000 0.000 0.608 0.000
#> GSM955057     1  0.0000     0.9561 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM955062     5  0.3868     0.6755 0.000 0.492 0.000 0.000 0.508 0.000
#> GSM955063     2  0.0937     0.6712 0.000 0.960 0.000 0.000 0.040 0.000
#> GSM955068     6  0.2095     0.8222 0.000 0.004 0.000 0.016 0.076 0.904
#> GSM955069     3  0.3419     0.6718 0.000 0.000 0.824 0.072 0.096 0.008
#> GSM955070     5  0.5955     0.6542 0.000 0.392 0.000 0.012 0.444 0.152
#> GSM955071     1  0.2335     0.8915 0.904 0.000 0.028 0.044 0.024 0.000
#> GSM955077     6  0.5958     0.4320 0.176 0.000 0.000 0.108 0.096 0.620
#> GSM955080     5  0.5923     0.6723 0.000 0.328 0.012 0.060 0.552 0.048
#> GSM955081     2  0.6327     0.1134 0.000 0.468 0.000 0.188 0.316 0.028
#> GSM955082     5  0.5064     0.7395 0.000 0.276 0.000 0.016 0.632 0.076
#> GSM955085     5  0.4241     0.8007 0.000 0.348 0.000 0.004 0.628 0.020
#> GSM955090     1  0.0000     0.9561 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM955094     5  0.5241     0.7268 0.000 0.420 0.000 0.008 0.500 0.072
#> GSM955096     2  0.2838     0.5898 0.000 0.852 0.000 0.028 0.116 0.004
#> GSM955102     3  0.1682     0.7042 0.000 0.000 0.928 0.020 0.052 0.000
#> GSM955105     4  0.6771     0.4530 0.000 0.252 0.000 0.456 0.060 0.232

Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.

consensus_heatmap(res, k = 2)

plot of chunk tab-ATC-skmeans-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-ATC-skmeans-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-ATC-skmeans-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-ATC-skmeans-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-ATC-skmeans-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-ATC-skmeans-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-ATC-skmeans-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-ATC-skmeans-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-ATC-skmeans-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-ATC-skmeans-membership-heatmap-5

As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

plot of chunk tab-ATC-skmeans-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-ATC-skmeans-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-ATC-skmeans-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-ATC-skmeans-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-ATC-skmeans-get-signatures-5

Signature heatmaps where rows are not scaled:

get_signatures(res, k = 2, scale_rows = FALSE)

plot of chunk tab-ATC-skmeans-get-signatures-no-scale-1

get_signatures(res, k = 3, scale_rows = FALSE)

plot of chunk tab-ATC-skmeans-get-signatures-no-scale-2

get_signatures(res, k = 4, scale_rows = FALSE)

plot of chunk tab-ATC-skmeans-get-signatures-no-scale-3

get_signatures(res, k = 5, scale_rows = FALSE)

plot of chunk tab-ATC-skmeans-get-signatures-no-scale-4

get_signatures(res, k = 6, scale_rows = FALSE)

plot of chunk tab-ATC-skmeans-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk ATC-skmeans-signature_compare

get_signature() returns a data frame invisibly. TO get the list of signatures, the function call should be assigned to a variable explicitly. In following code, if plot argument is set to FALSE, no heatmap is plotted while only the differential analysis is performed.

# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)

An example of the output of tb is:

#>   which_row         fdr    mean_1    mean_2 scaled_mean_1 scaled_mean_2 km
#> 1        38 0.042760348  8.373488  9.131774    -0.5533452     0.5164555  1
#> 2        40 0.018707592  7.106213  8.469186    -0.6173731     0.5762149  1
#> 3        55 0.019134737 10.221463 11.207825    -0.6159697     0.5749050  1
#> 4        59 0.006059896  5.921854  7.869574    -0.6899429     0.6439467  1
#> 5        60 0.018055526  8.928898 10.211722    -0.6204761     0.5791110  1
#> 6        98 0.009384629 15.714769 14.887706     0.6635654    -0.6193277  2
...

The columns in tb are:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. km: Row groups if k-means clustering is applied to rows.

UMAP plot which shows how samples are separated.

dimension_reduction(res, k = 2, method = "UMAP")

plot of chunk tab-ATC-skmeans-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-ATC-skmeans-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-ATC-skmeans-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-ATC-skmeans-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-ATC-skmeans-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk ATC-skmeans-collect-classes

Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.

test_to_known_factors(res)
#>               n genotype/variation(p) k
#> ATC:skmeans 108                0.1127 2
#> ATC:skmeans  99                0.0945 3
#> ATC:skmeans 102                0.1379 4
#> ATC:skmeans  95                0.2010 5
#> ATC:skmeans  87                0.7594 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 31589 rows and 108 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 2.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

collect_plots() function collects all the plots made from res for all k (number of partitions) into one single page to provide an easy and fast comparison between different k.

collect_plots(res)

plot of chunk ATC-pam-collect-plots

The plots are:

All the plots in panels can be made by individual functions and they are plotted later in this section.

select_partition_number() produces several plots showing different statistics for choosing “optimized” k. There are following statistics:

The detailed explanations of these statistics can be found in the cola vignette.

Generally speaking, lower PAC score, higher mean silhouette score or higher concordance corresponds to better partition. Rand index and Jaccard index measure how similar the current partition is compared to partition with k-1. If they are too similar, we won't accept k is better than k-1.

select_partition_number(res)

plot of chunk ATC-pam-select-partition-number

The numeric values for all these statistics can be obtained by get_stats().

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 1.000           0.972       0.989         0.3843 0.612   0.612
#> 3 3 0.899           0.925       0.969         0.5387 0.745   0.603
#> 4 4 0.718           0.790       0.841         0.0973 0.958   0.902
#> 5 5 0.701           0.707       0.858         0.1372 0.862   0.655
#> 6 6 0.799           0.730       0.877         0.0701 0.864   0.549

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
#> GSM955002     2  0.0000      0.994 0.000 1.000
#> GSM955008     2  0.0000      0.994 0.000 1.000
#> GSM955016     1  0.0000      0.970 1.000 0.000
#> GSM955019     2  0.0000      0.994 0.000 1.000
#> GSM955022     2  0.0000      0.994 0.000 1.000
#> GSM955023     2  0.0000      0.994 0.000 1.000
#> GSM955027     2  0.0000      0.994 0.000 1.000
#> GSM955043     2  0.0000      0.994 0.000 1.000
#> GSM955048     1  0.0000      0.970 1.000 0.000
#> GSM955049     2  0.0000      0.994 0.000 1.000
#> GSM955054     2  0.0000      0.994 0.000 1.000
#> GSM955064     2  0.0000      0.994 0.000 1.000
#> GSM955072     2  0.0000      0.994 0.000 1.000
#> GSM955075     2  0.0000      0.994 0.000 1.000
#> GSM955079     2  0.0000      0.994 0.000 1.000
#> GSM955087     1  0.0000      0.970 1.000 0.000
#> GSM955088     2  0.0000      0.994 0.000 1.000
#> GSM955089     1  0.0000      0.970 1.000 0.000
#> GSM955095     2  0.0000      0.994 0.000 1.000
#> GSM955097     2  0.0000      0.994 0.000 1.000
#> GSM955101     2  0.0000      0.994 0.000 1.000
#> GSM954999     2  0.0000      0.994 0.000 1.000
#> GSM955001     2  0.0000      0.994 0.000 1.000
#> GSM955003     2  0.0000      0.994 0.000 1.000
#> GSM955004     2  0.0000      0.994 0.000 1.000
#> GSM955005     2  0.0000      0.994 0.000 1.000
#> GSM955009     2  0.0000      0.994 0.000 1.000
#> GSM955011     1  0.0000      0.970 1.000 0.000
#> GSM955012     2  0.0000      0.994 0.000 1.000
#> GSM955013     2  0.0000      0.994 0.000 1.000
#> GSM955015     2  0.0000      0.994 0.000 1.000
#> GSM955017     1  0.0000      0.970 1.000 0.000
#> GSM955021     2  0.0000      0.994 0.000 1.000
#> GSM955025     2  0.0000      0.994 0.000 1.000
#> GSM955028     1  0.0000      0.970 1.000 0.000
#> GSM955029     2  0.0000      0.994 0.000 1.000
#> GSM955030     1  0.5842      0.843 0.860 0.140
#> GSM955032     2  0.0000      0.994 0.000 1.000
#> GSM955033     2  0.0000      0.994 0.000 1.000
#> GSM955034     1  0.0000      0.970 1.000 0.000
#> GSM955035     2  0.0000      0.994 0.000 1.000
#> GSM955036     2  0.0000      0.994 0.000 1.000
#> GSM955037     1  0.0000      0.970 1.000 0.000
#> GSM955039     2  0.0000      0.994 0.000 1.000
#> GSM955041     2  0.0000      0.994 0.000 1.000
#> GSM955042     1  0.0376      0.967 0.996 0.004
#> GSM955045     2  0.0000      0.994 0.000 1.000
#> GSM955046     2  0.0000      0.994 0.000 1.000
#> GSM955047     1  0.0000      0.970 1.000 0.000
#> GSM955050     1  0.9608      0.402 0.616 0.384
#> GSM955052     2  0.0000      0.994 0.000 1.000
#> GSM955053     1  0.0000      0.970 1.000 0.000
#> GSM955056     2  0.0000      0.994 0.000 1.000
#> GSM955058     2  0.0000      0.994 0.000 1.000
#> GSM955059     2  0.0000      0.994 0.000 1.000
#> GSM955060     1  0.0000      0.970 1.000 0.000
#> GSM955061     2  0.0000      0.994 0.000 1.000
#> GSM955065     1  0.0000      0.970 1.000 0.000
#> GSM955066     2  0.0000      0.994 0.000 1.000
#> GSM955067     1  0.0000      0.970 1.000 0.000
#> GSM955073     2  0.0000      0.994 0.000 1.000
#> GSM955074     1  0.0000      0.970 1.000 0.000
#> GSM955076     2  0.0000      0.994 0.000 1.000
#> GSM955078     2  0.0000      0.994 0.000 1.000
#> GSM955083     2  0.0000      0.994 0.000 1.000
#> GSM955084     2  0.0000      0.994 0.000 1.000
#> GSM955086     2  0.0000      0.994 0.000 1.000
#> GSM955091     2  0.0000      0.994 0.000 1.000
#> GSM955092     2  0.0000      0.994 0.000 1.000
#> GSM955093     2  0.0000      0.994 0.000 1.000
#> GSM955098     2  0.0000      0.994 0.000 1.000
#> GSM955099     2  0.0000      0.994 0.000 1.000
#> GSM955100     1  0.0000      0.970 1.000 0.000
#> GSM955103     2  0.0000      0.994 0.000 1.000
#> GSM955104     2  0.9775      0.253 0.412 0.588
#> GSM955106     2  0.0000      0.994 0.000 1.000
#> GSM955000     1  0.0000      0.970 1.000 0.000
#> GSM955006     1  0.0000      0.970 1.000 0.000
#> GSM955007     2  0.0000      0.994 0.000 1.000
#> GSM955010     2  0.0000      0.994 0.000 1.000
#> GSM955014     1  0.0000      0.970 1.000 0.000
#> GSM955018     2  0.0000      0.994 0.000 1.000
#> GSM955020     1  0.0000      0.970 1.000 0.000
#> GSM955024     2  0.0000      0.994 0.000 1.000
#> GSM955026     2  0.0000      0.994 0.000 1.000
#> GSM955031     2  0.0000      0.994 0.000 1.000
#> GSM955038     1  0.5842      0.843 0.860 0.140
#> GSM955040     1  0.5842      0.843 0.860 0.140
#> GSM955044     2  0.0000      0.994 0.000 1.000
#> GSM955051     1  0.0000      0.970 1.000 0.000
#> GSM955055     2  0.0000      0.994 0.000 1.000
#> GSM955057     1  0.0000      0.970 1.000 0.000
#> GSM955062     2  0.0000      0.994 0.000 1.000
#> GSM955063     2  0.0000      0.994 0.000 1.000
#> GSM955068     2  0.0000      0.994 0.000 1.000
#> GSM955069     2  0.0000      0.994 0.000 1.000
#> GSM955070     2  0.0000      0.994 0.000 1.000
#> GSM955071     2  0.0376      0.990 0.004 0.996
#> GSM955077     2  0.0000      0.994 0.000 1.000
#> GSM955080     2  0.0000      0.994 0.000 1.000
#> GSM955081     2  0.0000      0.994 0.000 1.000
#> GSM955082     2  0.0000      0.994 0.000 1.000
#> GSM955085     2  0.0000      0.994 0.000 1.000
#> GSM955090     1  0.0000      0.970 1.000 0.000
#> GSM955094     2  0.0000      0.994 0.000 1.000
#> GSM955096     2  0.0000      0.994 0.000 1.000
#> GSM955102     2  0.0000      0.994 0.000 1.000
#> GSM955105     2  0.0000      0.994 0.000 1.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1    p2    p3
#> GSM955002     2  0.5810      0.546 0.000 0.664 0.336
#> GSM955008     2  0.0000      0.961 0.000 1.000 0.000
#> GSM955016     3  0.0000      0.982 0.000 0.000 1.000
#> GSM955019     2  0.0000      0.961 0.000 1.000 0.000
#> GSM955022     2  0.0000      0.961 0.000 1.000 0.000
#> GSM955023     2  0.0000      0.961 0.000 1.000 0.000
#> GSM955027     2  0.0000      0.961 0.000 1.000 0.000
#> GSM955043     2  0.0000      0.961 0.000 1.000 0.000
#> GSM955048     1  0.0000      0.959 1.000 0.000 0.000
#> GSM955049     2  0.0000      0.961 0.000 1.000 0.000
#> GSM955054     2  0.0000      0.961 0.000 1.000 0.000
#> GSM955064     2  0.0000      0.961 0.000 1.000 0.000
#> GSM955072     2  0.0000      0.961 0.000 1.000 0.000
#> GSM955075     2  0.0000      0.961 0.000 1.000 0.000
#> GSM955079     2  0.5810      0.546 0.000 0.664 0.336
#> GSM955087     1  0.0000      0.959 1.000 0.000 0.000
#> GSM955088     2  0.0000      0.961 0.000 1.000 0.000
#> GSM955089     1  0.0000      0.959 1.000 0.000 0.000
#> GSM955095     2  0.0000      0.961 0.000 1.000 0.000
#> GSM955097     2  0.3267      0.857 0.000 0.884 0.116
#> GSM955101     2  0.0000      0.961 0.000 1.000 0.000
#> GSM954999     3  0.0000      0.982 0.000 0.000 1.000
#> GSM955001     2  0.0000      0.961 0.000 1.000 0.000
#> GSM955003     2  0.0000      0.961 0.000 1.000 0.000
#> GSM955004     2  0.0000      0.961 0.000 1.000 0.000
#> GSM955005     3  0.0000      0.982 0.000 0.000 1.000
#> GSM955009     2  0.0000      0.961 0.000 1.000 0.000
#> GSM955011     3  0.0000      0.982 0.000 0.000 1.000
#> GSM955012     2  0.0000      0.961 0.000 1.000 0.000
#> GSM955013     3  0.0000      0.982 0.000 0.000 1.000
#> GSM955015     2  0.0000      0.961 0.000 1.000 0.000
#> GSM955017     1  0.6180      0.315 0.584 0.000 0.416
#> GSM955021     2  0.0000      0.961 0.000 1.000 0.000
#> GSM955025     2  0.0000      0.961 0.000 1.000 0.000
#> GSM955028     1  0.0000      0.959 1.000 0.000 0.000
#> GSM955029     2  0.0000      0.961 0.000 1.000 0.000
#> GSM955030     3  0.0000      0.982 0.000 0.000 1.000
#> GSM955032     2  0.4654      0.749 0.000 0.792 0.208
#> GSM955033     3  0.0000      0.982 0.000 0.000 1.000
#> GSM955034     1  0.0000      0.959 1.000 0.000 0.000
#> GSM955035     2  0.0000      0.961 0.000 1.000 0.000
#> GSM955036     3  0.0000      0.982 0.000 0.000 1.000
#> GSM955037     3  0.0000      0.982 0.000 0.000 1.000
#> GSM955039     3  0.0000      0.982 0.000 0.000 1.000
#> GSM955041     2  0.0000      0.961 0.000 1.000 0.000
#> GSM955042     3  0.0000      0.982 0.000 0.000 1.000
#> GSM955045     2  0.0000      0.961 0.000 1.000 0.000
#> GSM955046     3  0.0424      0.972 0.000 0.008 0.992
#> GSM955047     1  0.0000      0.959 1.000 0.000 0.000
#> GSM955050     3  0.0000      0.982 0.000 0.000 1.000
#> GSM955052     2  0.0000      0.961 0.000 1.000 0.000
#> GSM955053     1  0.0000      0.959 1.000 0.000 0.000
#> GSM955056     2  0.0000      0.961 0.000 1.000 0.000
#> GSM955058     2  0.0000      0.961 0.000 1.000 0.000
#> GSM955059     2  0.0747      0.948 0.000 0.984 0.016
#> GSM955060     1  0.0000      0.959 1.000 0.000 0.000
#> GSM955061     2  0.0000      0.961 0.000 1.000 0.000
#> GSM955065     1  0.0000      0.959 1.000 0.000 0.000
#> GSM955066     2  0.3116      0.865 0.000 0.892 0.108
#> GSM955067     1  0.0000      0.959 1.000 0.000 0.000
#> GSM955073     2  0.0000      0.961 0.000 1.000 0.000
#> GSM955074     1  0.4654      0.737 0.792 0.000 0.208
#> GSM955076     3  0.0000      0.982 0.000 0.000 1.000
#> GSM955078     2  0.0000      0.961 0.000 1.000 0.000
#> GSM955083     3  0.0000      0.982 0.000 0.000 1.000
#> GSM955084     2  0.0000      0.961 0.000 1.000 0.000
#> GSM955086     2  0.5810      0.546 0.000 0.664 0.336
#> GSM955091     2  0.0000      0.961 0.000 1.000 0.000
#> GSM955092     2  0.0000      0.961 0.000 1.000 0.000
#> GSM955093     3  0.0000      0.982 0.000 0.000 1.000
#> GSM955098     2  0.0000      0.961 0.000 1.000 0.000
#> GSM955099     2  0.0000      0.961 0.000 1.000 0.000
#> GSM955100     3  0.0000      0.982 0.000 0.000 1.000
#> GSM955103     3  0.0000      0.982 0.000 0.000 1.000
#> GSM955104     3  0.0000      0.982 0.000 0.000 1.000
#> GSM955106     2  0.0000      0.961 0.000 1.000 0.000
#> GSM955000     3  0.6126      0.243 0.400 0.000 0.600
#> GSM955006     1  0.2066      0.909 0.940 0.000 0.060
#> GSM955007     2  0.0000      0.961 0.000 1.000 0.000
#> GSM955010     3  0.0000      0.982 0.000 0.000 1.000
#> GSM955014     1  0.0000      0.959 1.000 0.000 0.000
#> GSM955018     3  0.1163      0.944 0.000 0.028 0.972
#> GSM955020     1  0.0000      0.959 1.000 0.000 0.000
#> GSM955024     2  0.0000      0.961 0.000 1.000 0.000
#> GSM955026     2  0.0000      0.961 0.000 1.000 0.000
#> GSM955031     3  0.0000      0.982 0.000 0.000 1.000
#> GSM955038     3  0.0000      0.982 0.000 0.000 1.000
#> GSM955040     3  0.0000      0.982 0.000 0.000 1.000
#> GSM955044     2  0.0000      0.961 0.000 1.000 0.000
#> GSM955051     1  0.0000      0.959 1.000 0.000 0.000
#> GSM955055     2  0.0000      0.961 0.000 1.000 0.000
#> GSM955057     1  0.0000      0.959 1.000 0.000 0.000
#> GSM955062     2  0.0000      0.961 0.000 1.000 0.000
#> GSM955063     2  0.0000      0.961 0.000 1.000 0.000
#> GSM955068     2  0.0237      0.958 0.000 0.996 0.004
#> GSM955069     3  0.0000      0.982 0.000 0.000 1.000
#> GSM955070     2  0.0000      0.961 0.000 1.000 0.000
#> GSM955071     3  0.0000      0.982 0.000 0.000 1.000
#> GSM955077     2  0.6111      0.415 0.000 0.604 0.396
#> GSM955080     2  0.0000      0.961 0.000 1.000 0.000
#> GSM955081     2  0.1289      0.935 0.000 0.968 0.032
#> GSM955082     2  0.0000      0.961 0.000 1.000 0.000
#> GSM955085     2  0.0000      0.961 0.000 1.000 0.000
#> GSM955090     1  0.0000      0.959 1.000 0.000 0.000
#> GSM955094     2  0.0000      0.961 0.000 1.000 0.000
#> GSM955096     2  0.0000      0.961 0.000 1.000 0.000
#> GSM955102     3  0.0000      0.982 0.000 0.000 1.000
#> GSM955105     2  0.5835      0.538 0.000 0.660 0.340

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM955002     2  0.2401     0.7800 0.000 0.904 0.092 0.004
#> GSM955008     2  0.4164     0.8564 0.000 0.736 0.000 0.264
#> GSM955016     1  0.4933     0.3122 0.568 0.000 0.432 0.000
#> GSM955019     2  0.2216     0.8519 0.000 0.908 0.000 0.092
#> GSM955022     2  0.1209     0.8243 0.000 0.964 0.032 0.004
#> GSM955023     2  0.1209     0.8243 0.000 0.964 0.032 0.004
#> GSM955027     2  0.4164     0.8564 0.000 0.736 0.000 0.264
#> GSM955043     2  0.4164     0.8564 0.000 0.736 0.000 0.264
#> GSM955048     4  0.4250     1.0000 0.276 0.000 0.000 0.724
#> GSM955049     2  0.0000     0.8364 0.000 1.000 0.000 0.000
#> GSM955054     2  0.0000     0.8364 0.000 1.000 0.000 0.000
#> GSM955064     2  0.4164     0.8564 0.000 0.736 0.000 0.264
#> GSM955072     2  0.3873     0.8598 0.000 0.772 0.000 0.228
#> GSM955075     2  0.4164     0.8564 0.000 0.736 0.000 0.264
#> GSM955079     2  0.2401     0.7800 0.000 0.904 0.092 0.004
#> GSM955087     4  0.4250     1.0000 0.276 0.000 0.000 0.724
#> GSM955088     2  0.3837     0.8597 0.000 0.776 0.000 0.224
#> GSM955089     1  0.2149     0.4541 0.912 0.000 0.000 0.088
#> GSM955095     2  0.1209     0.8243 0.000 0.964 0.032 0.004
#> GSM955097     2  0.1398     0.8199 0.000 0.956 0.040 0.004
#> GSM955101     2  0.1209     0.8243 0.000 0.964 0.032 0.004
#> GSM954999     3  0.0000     0.9078 0.000 0.000 1.000 0.000
#> GSM955001     2  0.4164     0.8564 0.000 0.736 0.000 0.264
#> GSM955003     2  0.0000     0.8364 0.000 1.000 0.000 0.000
#> GSM955004     2  0.4222     0.8530 0.000 0.728 0.000 0.272
#> GSM955005     3  0.0000     0.9078 0.000 0.000 1.000 0.000
#> GSM955009     2  0.4222     0.8530 0.000 0.728 0.000 0.272
#> GSM955011     1  0.4250     0.5239 0.724 0.000 0.276 0.000
#> GSM955012     2  0.4164     0.8564 0.000 0.736 0.000 0.264
#> GSM955013     3  0.0779     0.8925 0.000 0.016 0.980 0.004
#> GSM955015     2  0.4164     0.8564 0.000 0.736 0.000 0.264
#> GSM955017     1  0.4817     0.3840 0.612 0.000 0.388 0.000
#> GSM955021     2  0.4164     0.8564 0.000 0.736 0.000 0.264
#> GSM955025     2  0.0336     0.8354 0.000 0.992 0.000 0.008
#> GSM955028     4  0.4250     1.0000 0.276 0.000 0.000 0.724
#> GSM955029     2  0.4164     0.8564 0.000 0.736 0.000 0.264
#> GSM955030     3  0.1022     0.8906 0.032 0.000 0.968 0.000
#> GSM955032     2  0.2401     0.7809 0.000 0.904 0.092 0.004
#> GSM955033     3  0.0000     0.9078 0.000 0.000 1.000 0.000
#> GSM955034     4  0.4250     1.0000 0.276 0.000 0.000 0.724
#> GSM955035     2  0.4164     0.8564 0.000 0.736 0.000 0.264
#> GSM955036     3  0.0000     0.9078 0.000 0.000 1.000 0.000
#> GSM955037     3  0.4250     0.5169 0.276 0.000 0.724 0.000
#> GSM955039     3  0.0000     0.9078 0.000 0.000 1.000 0.000
#> GSM955041     2  0.4164     0.8564 0.000 0.736 0.000 0.264
#> GSM955042     1  0.4933     0.3122 0.568 0.000 0.432 0.000
#> GSM955045     2  0.4164     0.8564 0.000 0.736 0.000 0.264
#> GSM955046     3  0.3157     0.7167 0.000 0.144 0.852 0.004
#> GSM955047     1  0.0000     0.5493 1.000 0.000 0.000 0.000
#> GSM955050     3  0.1022     0.8906 0.032 0.000 0.968 0.000
#> GSM955052     2  0.3649     0.8589 0.000 0.796 0.000 0.204
#> GSM955053     4  0.4250     1.0000 0.276 0.000 0.000 0.724
#> GSM955056     2  0.1356     0.8261 0.000 0.960 0.032 0.008
#> GSM955058     2  0.4164     0.8564 0.000 0.736 0.000 0.264
#> GSM955059     2  0.1576     0.8162 0.000 0.948 0.048 0.004
#> GSM955060     1  0.0000     0.5493 1.000 0.000 0.000 0.000
#> GSM955061     2  0.4164     0.8564 0.000 0.736 0.000 0.264
#> GSM955065     4  0.4250     1.0000 0.276 0.000 0.000 0.724
#> GSM955066     2  0.1978     0.8005 0.000 0.928 0.068 0.004
#> GSM955067     4  0.4250     1.0000 0.276 0.000 0.000 0.724
#> GSM955073     2  0.4164     0.8564 0.000 0.736 0.000 0.264
#> GSM955074     1  0.4679     0.4335 0.648 0.000 0.352 0.000
#> GSM955076     3  0.0376     0.9030 0.000 0.004 0.992 0.004
#> GSM955078     2  0.4072     0.8579 0.000 0.748 0.000 0.252
#> GSM955083     3  0.0000     0.9078 0.000 0.000 1.000 0.000
#> GSM955084     2  0.4164     0.8556 0.000 0.736 0.000 0.264
#> GSM955086     2  0.2401     0.7800 0.000 0.904 0.092 0.004
#> GSM955091     2  0.0000     0.8364 0.000 1.000 0.000 0.000
#> GSM955092     2  0.2345     0.8545 0.000 0.900 0.000 0.100
#> GSM955093     3  0.0188     0.9056 0.000 0.000 0.996 0.004
#> GSM955098     2  0.0188     0.8360 0.000 0.996 0.000 0.004
#> GSM955099     2  0.2973     0.8567 0.000 0.856 0.000 0.144
#> GSM955100     3  0.4989    -0.1234 0.472 0.000 0.528 0.000
#> GSM955103     3  0.1576     0.8556 0.000 0.048 0.948 0.004
#> GSM955104     3  0.1022     0.8906 0.032 0.000 0.968 0.000
#> GSM955106     2  0.1209     0.8243 0.000 0.964 0.032 0.004
#> GSM955000     1  0.4855     0.3612 0.600 0.000 0.400 0.000
#> GSM955006     1  0.0188     0.5516 0.996 0.000 0.004 0.000
#> GSM955007     2  0.4164     0.8564 0.000 0.736 0.000 0.264
#> GSM955010     3  0.0000     0.9078 0.000 0.000 1.000 0.000
#> GSM955014     4  0.4250     1.0000 0.276 0.000 0.000 0.724
#> GSM955018     3  0.3870     0.6087 0.000 0.208 0.788 0.004
#> GSM955020     1  0.1022     0.5144 0.968 0.000 0.000 0.032
#> GSM955024     2  0.0000     0.8364 0.000 1.000 0.000 0.000
#> GSM955026     2  0.1209     0.8243 0.000 0.964 0.032 0.004
#> GSM955031     3  0.1022     0.8906 0.032 0.000 0.968 0.000
#> GSM955038     3  0.1022     0.8906 0.032 0.000 0.968 0.000
#> GSM955040     1  0.4933     0.3122 0.568 0.000 0.432 0.000
#> GSM955044     2  0.4164     0.8564 0.000 0.736 0.000 0.264
#> GSM955051     1  0.0000     0.5493 1.000 0.000 0.000 0.000
#> GSM955055     2  0.4164     0.8564 0.000 0.736 0.000 0.264
#> GSM955057     4  0.4250     1.0000 0.276 0.000 0.000 0.724
#> GSM955062     2  0.4164     0.8564 0.000 0.736 0.000 0.264
#> GSM955063     2  0.4134     0.8570 0.000 0.740 0.000 0.260
#> GSM955068     2  0.1209     0.8243 0.000 0.964 0.032 0.004
#> GSM955069     3  0.0000     0.9078 0.000 0.000 1.000 0.000
#> GSM955070     2  0.4164     0.8564 0.000 0.736 0.000 0.264
#> GSM955071     3  0.1022     0.8906 0.032 0.000 0.968 0.000
#> GSM955077     2  0.4843     0.4985 0.000 0.604 0.396 0.000
#> GSM955080     2  0.4164     0.8564 0.000 0.736 0.000 0.264
#> GSM955081     2  0.1209     0.8243 0.000 0.964 0.032 0.004
#> GSM955082     2  0.0336     0.8343 0.000 0.992 0.008 0.000
#> GSM955085     2  0.3311     0.8596 0.000 0.828 0.000 0.172
#> GSM955090     1  0.4164     0.0331 0.736 0.000 0.000 0.264
#> GSM955094     2  0.2281     0.8535 0.000 0.904 0.000 0.096
#> GSM955096     2  0.1209     0.8243 0.000 0.964 0.032 0.004
#> GSM955102     3  0.0000     0.9078 0.000 0.000 1.000 0.000
#> GSM955105     2  0.2999     0.7638 0.000 0.864 0.132 0.004

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM955002     3  0.2020      0.689 0.000 0.000 0.900 0.100 0.000
#> GSM955008     3  0.4273      0.310 0.000 0.000 0.552 0.000 0.448
#> GSM955016     1  0.3508      0.634 0.748 0.000 0.000 0.252 0.000
#> GSM955019     3  0.3395      0.600 0.000 0.000 0.764 0.000 0.236
#> GSM955022     3  0.0000      0.738 0.000 0.000 1.000 0.000 0.000
#> GSM955023     3  0.0000      0.738 0.000 0.000 1.000 0.000 0.000
#> GSM955027     5  0.2852      0.924 0.000 0.000 0.172 0.000 0.828
#> GSM955043     5  0.2852      0.924 0.000 0.000 0.172 0.000 0.828
#> GSM955048     2  0.0000      0.943 0.000 1.000 0.000 0.000 0.000
#> GSM955049     3  0.0162      0.738 0.000 0.000 0.996 0.000 0.004
#> GSM955054     3  0.0162      0.738 0.000 0.000 0.996 0.000 0.004
#> GSM955064     5  0.2852      0.924 0.000 0.000 0.172 0.000 0.828
#> GSM955072     3  0.4150      0.418 0.000 0.000 0.612 0.000 0.388
#> GSM955075     5  0.2852      0.924 0.000 0.000 0.172 0.000 0.828
#> GSM955079     3  0.0000      0.738 0.000 0.000 1.000 0.000 0.000
#> GSM955087     2  0.0162      0.943 0.004 0.996 0.000 0.000 0.000
#> GSM955088     3  0.4192      0.391 0.000 0.000 0.596 0.000 0.404
#> GSM955089     1  0.3932      0.263 0.672 0.328 0.000 0.000 0.000
#> GSM955095     3  0.0000      0.738 0.000 0.000 1.000 0.000 0.000
#> GSM955097     3  0.4192      0.034 0.000 0.000 0.596 0.000 0.404
#> GSM955101     3  0.0000      0.738 0.000 0.000 1.000 0.000 0.000
#> GSM954999     4  0.0000      0.967 0.000 0.000 0.000 1.000 0.000
#> GSM955001     5  0.2852      0.924 0.000 0.000 0.172 0.000 0.828
#> GSM955003     3  0.0162      0.738 0.000 0.000 0.996 0.000 0.004
#> GSM955004     5  0.0000      0.754 0.000 0.000 0.000 0.000 1.000
#> GSM955005     4  0.0000      0.967 0.000 0.000 0.000 1.000 0.000
#> GSM955009     5  0.0510      0.755 0.000 0.000 0.016 0.000 0.984
#> GSM955011     1  0.0162      0.673 0.996 0.000 0.000 0.004 0.000
#> GSM955012     5  0.3039      0.902 0.000 0.000 0.192 0.000 0.808
#> GSM955013     4  0.0404      0.956 0.000 0.000 0.012 0.988 0.000
#> GSM955015     3  0.4273      0.310 0.000 0.000 0.552 0.000 0.448
#> GSM955017     1  0.4138      0.478 0.616 0.000 0.000 0.384 0.000
#> GSM955021     3  0.4278      0.299 0.000 0.000 0.548 0.000 0.452
#> GSM955025     3  0.2891      0.587 0.000 0.000 0.824 0.000 0.176
#> GSM955028     2  0.0162      0.943 0.004 0.996 0.000 0.000 0.000
#> GSM955029     5  0.2852      0.924 0.000 0.000 0.172 0.000 0.828
#> GSM955030     4  0.0000      0.967 0.000 0.000 0.000 1.000 0.000
#> GSM955032     3  0.0290      0.734 0.000 0.000 0.992 0.008 0.000
#> GSM955033     4  0.0000      0.967 0.000 0.000 0.000 1.000 0.000
#> GSM955034     2  0.0162      0.943 0.004 0.996 0.000 0.000 0.000
#> GSM955035     3  0.4273      0.310 0.000 0.000 0.552 0.000 0.448
#> GSM955036     4  0.0000      0.967 0.000 0.000 0.000 1.000 0.000
#> GSM955037     1  0.4278      0.337 0.548 0.000 0.000 0.452 0.000
#> GSM955039     4  0.0000      0.967 0.000 0.000 0.000 1.000 0.000
#> GSM955041     3  0.4273      0.310 0.000 0.000 0.552 0.000 0.448
#> GSM955042     1  0.4015      0.533 0.652 0.000 0.000 0.348 0.000
#> GSM955045     3  0.4273      0.310 0.000 0.000 0.552 0.000 0.448
#> GSM955046     4  0.1792      0.853 0.000 0.000 0.084 0.916 0.000
#> GSM955047     1  0.0162      0.672 0.996 0.004 0.000 0.000 0.000
#> GSM955050     4  0.0000      0.967 0.000 0.000 0.000 1.000 0.000
#> GSM955052     3  0.3636      0.566 0.000 0.000 0.728 0.000 0.272
#> GSM955053     2  0.0162      0.943 0.004 0.996 0.000 0.000 0.000
#> GSM955056     3  0.1121      0.725 0.000 0.000 0.956 0.000 0.044
#> GSM955058     5  0.2852      0.924 0.000 0.000 0.172 0.000 0.828
#> GSM955059     3  0.0510      0.729 0.000 0.000 0.984 0.016 0.000
#> GSM955060     1  0.0000      0.672 1.000 0.000 0.000 0.000 0.000
#> GSM955061     5  0.2852      0.924 0.000 0.000 0.172 0.000 0.828
#> GSM955065     2  0.0162      0.943 0.004 0.996 0.000 0.000 0.000
#> GSM955066     3  0.0000      0.738 0.000 0.000 1.000 0.000 0.000
#> GSM955067     2  0.0000      0.943 0.000 1.000 0.000 0.000 0.000
#> GSM955073     3  0.4273      0.310 0.000 0.000 0.552 0.000 0.448
#> GSM955074     1  0.3999      0.535 0.656 0.000 0.000 0.344 0.000
#> GSM955076     4  0.0162      0.964 0.000 0.000 0.004 0.996 0.000
#> GSM955078     3  0.4256      0.333 0.000 0.000 0.564 0.000 0.436
#> GSM955083     4  0.0000      0.967 0.000 0.000 0.000 1.000 0.000
#> GSM955084     5  0.1341      0.739 0.000 0.000 0.056 0.000 0.944
#> GSM955086     3  0.0000      0.738 0.000 0.000 1.000 0.000 0.000
#> GSM955091     3  0.0162      0.738 0.000 0.000 0.996 0.000 0.004
#> GSM955092     3  0.3816      0.502 0.000 0.000 0.696 0.000 0.304
#> GSM955093     4  0.0162      0.964 0.000 0.000 0.004 0.996 0.000
#> GSM955098     3  0.2329      0.643 0.000 0.000 0.876 0.000 0.124
#> GSM955099     3  0.2852      0.656 0.000 0.000 0.828 0.000 0.172
#> GSM955100     1  0.3999      0.566 0.656 0.000 0.000 0.344 0.000
#> GSM955103     4  0.0963      0.925 0.000 0.000 0.036 0.964 0.000
#> GSM955104     4  0.0000      0.967 0.000 0.000 0.000 1.000 0.000
#> GSM955106     3  0.0000      0.738 0.000 0.000 1.000 0.000 0.000
#> GSM955000     1  0.4161      0.464 0.608 0.000 0.000 0.392 0.000
#> GSM955006     1  0.0000      0.672 1.000 0.000 0.000 0.000 0.000
#> GSM955007     3  0.4297      0.235 0.000 0.000 0.528 0.000 0.472
#> GSM955010     4  0.0000      0.967 0.000 0.000 0.000 1.000 0.000
#> GSM955014     2  0.0000      0.943 0.000 1.000 0.000 0.000 0.000
#> GSM955018     4  0.3612      0.528 0.000 0.000 0.268 0.732 0.000
#> GSM955020     1  0.0162      0.672 0.996 0.004 0.000 0.000 0.000
#> GSM955024     3  0.0162      0.738 0.000 0.000 0.996 0.000 0.004
#> GSM955026     3  0.0000      0.738 0.000 0.000 1.000 0.000 0.000
#> GSM955031     4  0.0000      0.967 0.000 0.000 0.000 1.000 0.000
#> GSM955038     4  0.0000      0.967 0.000 0.000 0.000 1.000 0.000
#> GSM955040     1  0.4273      0.349 0.552 0.000 0.000 0.448 0.000
#> GSM955044     5  0.3305      0.855 0.000 0.000 0.224 0.000 0.776
#> GSM955051     1  0.0162      0.672 0.996 0.004 0.000 0.000 0.000
#> GSM955055     5  0.2852      0.924 0.000 0.000 0.172 0.000 0.828
#> GSM955057     2  0.0000      0.943 0.000 1.000 0.000 0.000 0.000
#> GSM955062     3  0.4306      0.162 0.000 0.000 0.508 0.000 0.492
#> GSM955063     3  0.4150      0.406 0.000 0.000 0.612 0.000 0.388
#> GSM955068     3  0.0000      0.738 0.000 0.000 1.000 0.000 0.000
#> GSM955069     4  0.0000      0.967 0.000 0.000 0.000 1.000 0.000
#> GSM955070     3  0.4273      0.310 0.000 0.000 0.552 0.000 0.448
#> GSM955071     4  0.0000      0.967 0.000 0.000 0.000 1.000 0.000
#> GSM955077     3  0.5434      0.375 0.000 0.000 0.588 0.336 0.076
#> GSM955080     5  0.2852      0.924 0.000 0.000 0.172 0.000 0.828
#> GSM955081     3  0.0000      0.738 0.000 0.000 1.000 0.000 0.000
#> GSM955082     3  0.0162      0.738 0.000 0.000 0.996 0.000 0.004
#> GSM955085     3  0.3561      0.582 0.000 0.000 0.740 0.000 0.260
#> GSM955090     2  0.4291      0.211 0.464 0.536 0.000 0.000 0.000
#> GSM955094     3  0.2230      0.693 0.000 0.000 0.884 0.000 0.116
#> GSM955096     3  0.0000      0.738 0.000 0.000 1.000 0.000 0.000
#> GSM955102     4  0.0000      0.967 0.000 0.000 0.000 1.000 0.000
#> GSM955105     3  0.1965      0.692 0.000 0.000 0.904 0.096 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM955002     2  0.3094   0.688100 0.000 0.824 0.140 0.000 0.000 0.036
#> GSM955008     5  0.2020   0.839666 0.000 0.096 0.000 0.000 0.896 0.008
#> GSM955016     1  0.4813   0.553368 0.648 0.000 0.248 0.000 0.000 0.104
#> GSM955019     5  0.4045   0.343101 0.000 0.428 0.000 0.000 0.564 0.008
#> GSM955022     2  0.0000   0.824254 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM955023     2  0.0000   0.824254 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM955027     5  0.0000   0.827172 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM955043     5  0.0146   0.828885 0.000 0.004 0.000 0.000 0.996 0.000
#> GSM955048     4  0.0146   0.938100 0.004 0.000 0.000 0.996 0.000 0.000
#> GSM955049     2  0.0000   0.824254 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM955054     2  0.0000   0.824254 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM955064     5  0.0000   0.827172 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM955072     5  0.3817   0.637588 0.000 0.252 0.000 0.000 0.720 0.028
#> GSM955075     5  0.0000   0.827172 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM955079     2  0.0632   0.820659 0.000 0.976 0.000 0.000 0.000 0.024
#> GSM955087     4  0.0000   0.938531 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM955088     5  0.2178   0.811901 0.000 0.132 0.000 0.000 0.868 0.000
#> GSM955089     1  0.3515   0.259871 0.676 0.000 0.000 0.324 0.000 0.000
#> GSM955095     2  0.0632   0.821558 0.000 0.976 0.000 0.000 0.000 0.024
#> GSM955097     2  0.4494   0.190244 0.000 0.544 0.000 0.000 0.424 0.032
#> GSM955101     2  0.0914   0.818175 0.000 0.968 0.000 0.000 0.016 0.016
#> GSM954999     3  0.2092   0.860874 0.000 0.000 0.876 0.000 0.000 0.124
#> GSM955001     5  0.0000   0.827172 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM955003     2  0.0000   0.824254 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM955004     6  0.2996   0.714755 0.000 0.000 0.000 0.000 0.228 0.772
#> GSM955005     3  0.0790   0.947257 0.000 0.000 0.968 0.000 0.000 0.032
#> GSM955009     6  0.3175   0.694035 0.000 0.000 0.000 0.000 0.256 0.744
#> GSM955011     1  0.0146   0.633946 0.996 0.000 0.004 0.000 0.000 0.000
#> GSM955012     5  0.3847  -0.000551 0.000 0.456 0.000 0.000 0.544 0.000
#> GSM955013     3  0.0858   0.943492 0.000 0.004 0.968 0.000 0.000 0.028
#> GSM955015     5  0.1918   0.843368 0.000 0.088 0.000 0.000 0.904 0.008
#> GSM955017     1  0.4845   0.407657 0.560 0.000 0.384 0.004 0.000 0.052
#> GSM955021     5  0.1610   0.845213 0.000 0.084 0.000 0.000 0.916 0.000
#> GSM955025     6  0.2941   0.588326 0.000 0.220 0.000 0.000 0.000 0.780
#> GSM955028     4  0.0000   0.938531 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM955029     5  0.0000   0.827172 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM955030     3  0.0790   0.947257 0.000 0.000 0.968 0.000 0.000 0.032
#> GSM955032     2  0.1124   0.815108 0.000 0.956 0.008 0.000 0.000 0.036
#> GSM955033     3  0.0000   0.947661 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM955034     4  0.0000   0.938531 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM955035     5  0.1866   0.844539 0.000 0.084 0.000 0.000 0.908 0.008
#> GSM955036     3  0.0000   0.947661 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM955037     1  0.4921   0.295022 0.508 0.000 0.436 0.004 0.000 0.052
#> GSM955039     3  0.0000   0.947661 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM955041     5  0.1866   0.844539 0.000 0.084 0.000 0.000 0.908 0.008
#> GSM955042     1  0.5333   0.495988 0.564 0.000 0.300 0.000 0.000 0.136
#> GSM955045     5  0.1714   0.842464 0.000 0.092 0.000 0.000 0.908 0.000
#> GSM955046     3  0.1334   0.915247 0.000 0.020 0.948 0.000 0.000 0.032
#> GSM955047     1  0.0000   0.632400 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM955050     3  0.0000   0.947661 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM955052     2  0.3266   0.544079 0.000 0.728 0.000 0.000 0.272 0.000
#> GSM955053     4  0.0000   0.938531 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM955056     2  0.4179  -0.065099 0.000 0.516 0.000 0.000 0.472 0.012
#> GSM955058     5  0.0000   0.827172 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM955059     2  0.0914   0.815487 0.000 0.968 0.016 0.000 0.000 0.016
#> GSM955060     1  0.0405   0.630881 0.988 0.000 0.000 0.004 0.000 0.008
#> GSM955061     5  0.0000   0.827172 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM955065     4  0.0000   0.938531 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM955066     2  0.0458   0.822339 0.000 0.984 0.000 0.000 0.000 0.016
#> GSM955067     4  0.0146   0.938100 0.004 0.000 0.000 0.996 0.000 0.000
#> GSM955073     5  0.2706   0.777933 0.000 0.160 0.000 0.000 0.832 0.008
#> GSM955074     1  0.4741   0.470728 0.600 0.000 0.344 0.004 0.000 0.052
#> GSM955076     3  0.1075   0.920435 0.000 0.000 0.952 0.000 0.000 0.048
#> GSM955078     5  0.2613   0.801277 0.000 0.140 0.000 0.000 0.848 0.012
#> GSM955083     3  0.0937   0.943614 0.000 0.000 0.960 0.000 0.000 0.040
#> GSM955084     6  0.2941   0.714537 0.000 0.000 0.000 0.000 0.220 0.780
#> GSM955086     2  0.0458   0.822339 0.000 0.984 0.000 0.000 0.000 0.016
#> GSM955091     2  0.0000   0.824254 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM955092     5  0.3828   0.281814 0.000 0.440 0.000 0.000 0.560 0.000
#> GSM955093     3  0.0713   0.935663 0.000 0.000 0.972 0.000 0.000 0.028
#> GSM955098     6  0.3833   0.262716 0.000 0.444 0.000 0.000 0.000 0.556
#> GSM955099     2  0.2527   0.677830 0.000 0.832 0.000 0.000 0.168 0.000
#> GSM955100     1  0.4799   0.509208 0.592 0.000 0.340 0.000 0.000 0.068
#> GSM955103     3  0.0717   0.937192 0.000 0.008 0.976 0.000 0.000 0.016
#> GSM955104     3  0.0790   0.947257 0.000 0.000 0.968 0.000 0.000 0.032
#> GSM955106     2  0.0000   0.824254 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM955000     1  0.4853   0.400249 0.556 0.000 0.388 0.004 0.000 0.052
#> GSM955006     1  0.0146   0.632334 0.996 0.000 0.000 0.004 0.000 0.000
#> GSM955007     5  0.1812   0.845427 0.000 0.080 0.000 0.000 0.912 0.008
#> GSM955010     3  0.0790   0.947257 0.000 0.000 0.968 0.000 0.000 0.032
#> GSM955014     4  0.0146   0.938100 0.004 0.000 0.000 0.996 0.000 0.000
#> GSM955018     3  0.3794   0.550333 0.000 0.248 0.724 0.000 0.000 0.028
#> GSM955020     1  0.0000   0.632400 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM955024     2  0.0000   0.824254 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM955026     2  0.0865   0.809609 0.000 0.964 0.000 0.000 0.000 0.036
#> GSM955031     3  0.0790   0.947257 0.000 0.000 0.968 0.000 0.000 0.032
#> GSM955038     3  0.0865   0.945882 0.000 0.000 0.964 0.000 0.000 0.036
#> GSM955040     1  0.3838   0.355165 0.552 0.000 0.448 0.000 0.000 0.000
#> GSM955044     2  0.3862   0.179530 0.000 0.524 0.000 0.000 0.476 0.000
#> GSM955051     1  0.1327   0.617898 0.936 0.000 0.000 0.000 0.000 0.064
#> GSM955055     5  0.0000   0.827172 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM955057     4  0.0146   0.938100 0.004 0.000 0.000 0.996 0.000 0.000
#> GSM955062     5  0.1444   0.844924 0.000 0.072 0.000 0.000 0.928 0.000
#> GSM955063     2  0.3852   0.331532 0.000 0.612 0.000 0.000 0.384 0.004
#> GSM955068     2  0.1267   0.807502 0.000 0.940 0.000 0.000 0.000 0.060
#> GSM955069     3  0.0000   0.947661 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM955070     5  0.1663   0.844371 0.000 0.088 0.000 0.000 0.912 0.000
#> GSM955071     3  0.0146   0.948139 0.000 0.000 0.996 0.000 0.000 0.004
#> GSM955077     2  0.5348   0.259646 0.000 0.576 0.272 0.000 0.000 0.152
#> GSM955080     5  0.0547   0.821781 0.000 0.000 0.000 0.000 0.980 0.020
#> GSM955081     2  0.0458   0.822339 0.000 0.984 0.000 0.000 0.000 0.016
#> GSM955082     2  0.0000   0.824254 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM955085     2  0.3823   0.153637 0.000 0.564 0.000 0.000 0.436 0.000
#> GSM955090     4  0.3857   0.189951 0.468 0.000 0.000 0.532 0.000 0.000
#> GSM955094     2  0.1910   0.743351 0.000 0.892 0.000 0.000 0.108 0.000
#> GSM955096     2  0.0000   0.824254 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM955102     3  0.0790   0.947257 0.000 0.000 0.968 0.000 0.000 0.032
#> GSM955105     2  0.2432   0.739642 0.000 0.876 0.100 0.000 0.000 0.024

Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.

consensus_heatmap(res, k = 2)

plot of chunk tab-ATC-pam-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-ATC-pam-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-ATC-pam-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-ATC-pam-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-ATC-pam-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-ATC-pam-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-ATC-pam-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-ATC-pam-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-ATC-pam-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-ATC-pam-membership-heatmap-5

As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

plot of chunk tab-ATC-pam-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-ATC-pam-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-ATC-pam-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-ATC-pam-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-ATC-pam-get-signatures-5

Signature heatmaps where rows are not scaled:

get_signatures(res, k = 2, scale_rows = FALSE)

plot of chunk tab-ATC-pam-get-signatures-no-scale-1

get_signatures(res, k = 3, scale_rows = FALSE)

plot of chunk tab-ATC-pam-get-signatures-no-scale-2

get_signatures(res, k = 4, scale_rows = FALSE)

plot of chunk tab-ATC-pam-get-signatures-no-scale-3

get_signatures(res, k = 5, scale_rows = FALSE)

plot of chunk tab-ATC-pam-get-signatures-no-scale-4

get_signatures(res, k = 6, scale_rows = FALSE)

plot of chunk tab-ATC-pam-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk ATC-pam-signature_compare

get_signature() returns a data frame invisibly. TO get the list of signatures, the function call should be assigned to a variable explicitly. In following code, if plot argument is set to FALSE, no heatmap is plotted while only the differential analysis is performed.

# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)

An example of the output of tb is:

#>   which_row         fdr    mean_1    mean_2 scaled_mean_1 scaled_mean_2 km
#> 1        38 0.042760348  8.373488  9.131774    -0.5533452     0.5164555  1
#> 2        40 0.018707592  7.106213  8.469186    -0.6173731     0.5762149  1
#> 3        55 0.019134737 10.221463 11.207825    -0.6159697     0.5749050  1
#> 4        59 0.006059896  5.921854  7.869574    -0.6899429     0.6439467  1
#> 5        60 0.018055526  8.928898 10.211722    -0.6204761     0.5791110  1
#> 6        98 0.009384629 15.714769 14.887706     0.6635654    -0.6193277  2
...

The columns in tb are:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. km: Row groups if k-means clustering is applied to rows.

UMAP plot which shows how samples are separated.

dimension_reduction(res, k = 2, method = "UMAP")

plot of chunk tab-ATC-pam-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-ATC-pam-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-ATC-pam-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-ATC-pam-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-ATC-pam-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk ATC-pam-collect-classes

Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.

test_to_known_factors(res)
#>           n genotype/variation(p) k
#> ATC:pam 106                 0.741 2
#> ATC:pam 105                 0.109 3
#> ATC:pam  98                 0.102 4
#> ATC:pam  86                 0.348 5
#> ATC:pam  90                 0.154 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 31589 rows and 108 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'ATC' method.
#>   Subgroups are detected by 'mclust' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 2.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

collect_plots() function collects all the plots made from res for all k (number of partitions) into one single page to provide an easy and fast comparison between different k.

collect_plots(res)

plot of chunk ATC-mclust-collect-plots

The plots are:

All the plots in panels can be made by individual functions and they are plotted later in this section.

select_partition_number() produces several plots showing different statistics for choosing “optimized” k. There are following statistics:

The detailed explanations of these statistics can be found in the cola vignette.

Generally speaking, lower PAC score, higher mean silhouette score or higher concordance corresponds to better partition. Rand index and Jaccard index measure how similar the current partition is compared to partition with k-1. If they are too similar, we won't accept k is better than k-1.

select_partition_number(res)

plot of chunk ATC-mclust-select-partition-number

The numeric values for all these statistics can be obtained by get_stats().

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 1.000           0.990       0.993         0.3539 0.651   0.651
#> 3 3 0.470           0.629       0.803         0.7445 0.695   0.531
#> 4 4 0.585           0.674       0.805         0.1036 0.811   0.543
#> 5 5 0.587           0.664       0.768         0.0610 0.768   0.453
#> 6 6 0.611           0.660       0.789         0.0275 0.923   0.765

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
#> GSM955002     2  0.0000      0.991 0.000 1.000
#> GSM955008     2  0.0000      0.991 0.000 1.000
#> GSM955016     1  0.0000      1.000 1.000 0.000
#> GSM955019     2  0.0000      0.991 0.000 1.000
#> GSM955022     2  0.0000      0.991 0.000 1.000
#> GSM955023     2  0.0000      0.991 0.000 1.000
#> GSM955027     2  0.0000      0.991 0.000 1.000
#> GSM955043     2  0.0000      0.991 0.000 1.000
#> GSM955048     1  0.0000      1.000 1.000 0.000
#> GSM955049     2  0.0000      0.991 0.000 1.000
#> GSM955054     2  0.0000      0.991 0.000 1.000
#> GSM955064     2  0.0000      0.991 0.000 1.000
#> GSM955072     2  0.0000      0.991 0.000 1.000
#> GSM955075     2  0.0000      0.991 0.000 1.000
#> GSM955079     2  0.0376      0.990 0.004 0.996
#> GSM955087     1  0.0000      1.000 1.000 0.000
#> GSM955088     2  0.0000      0.991 0.000 1.000
#> GSM955089     1  0.0000      1.000 1.000 0.000
#> GSM955095     2  0.0000      0.991 0.000 1.000
#> GSM955097     2  0.1414      0.986 0.020 0.980
#> GSM955101     2  0.0000      0.991 0.000 1.000
#> GSM954999     2  0.1414      0.986 0.020 0.980
#> GSM955001     2  0.0000      0.991 0.000 1.000
#> GSM955003     2  0.0000      0.991 0.000 1.000
#> GSM955004     2  0.1414      0.986 0.020 0.980
#> GSM955005     2  0.1414      0.986 0.020 0.980
#> GSM955009     2  0.1414      0.986 0.020 0.980
#> GSM955011     1  0.0000      1.000 1.000 0.000
#> GSM955012     2  0.0000      0.991 0.000 1.000
#> GSM955013     2  0.1184      0.987 0.016 0.984
#> GSM955015     2  0.0000      0.991 0.000 1.000
#> GSM955017     1  0.0000      1.000 1.000 0.000
#> GSM955021     2  0.0000      0.991 0.000 1.000
#> GSM955025     2  0.1414      0.986 0.020 0.980
#> GSM955028     1  0.0000      1.000 1.000 0.000
#> GSM955029     2  0.0000      0.991 0.000 1.000
#> GSM955030     2  0.1414      0.986 0.020 0.980
#> GSM955032     2  0.0000      0.991 0.000 1.000
#> GSM955033     2  0.1414      0.986 0.020 0.980
#> GSM955034     1  0.0000      1.000 1.000 0.000
#> GSM955035     2  0.0000      0.991 0.000 1.000
#> GSM955036     2  0.1414      0.986 0.020 0.980
#> GSM955037     1  0.0000      1.000 1.000 0.000
#> GSM955039     2  0.1414      0.986 0.020 0.980
#> GSM955041     2  0.0000      0.991 0.000 1.000
#> GSM955042     1  0.0000      1.000 1.000 0.000
#> GSM955045     2  0.0000      0.991 0.000 1.000
#> GSM955046     2  0.1414      0.986 0.020 0.980
#> GSM955047     1  0.0000      1.000 1.000 0.000
#> GSM955050     2  0.1414      0.986 0.020 0.980
#> GSM955052     2  0.0000      0.991 0.000 1.000
#> GSM955053     1  0.0000      1.000 1.000 0.000
#> GSM955056     2  0.0000      0.991 0.000 1.000
#> GSM955058     2  0.0000      0.991 0.000 1.000
#> GSM955059     2  0.0000      0.991 0.000 1.000
#> GSM955060     1  0.0000      1.000 1.000 0.000
#> GSM955061     2  0.0000      0.991 0.000 1.000
#> GSM955065     1  0.0000      1.000 1.000 0.000
#> GSM955066     2  0.0000      0.991 0.000 1.000
#> GSM955067     1  0.0000      1.000 1.000 0.000
#> GSM955073     2  0.1414      0.986 0.020 0.980
#> GSM955074     1  0.0000      1.000 1.000 0.000
#> GSM955076     2  0.0672      0.989 0.008 0.992
#> GSM955078     2  0.0000      0.991 0.000 1.000
#> GSM955083     2  0.1414      0.986 0.020 0.980
#> GSM955084     2  0.1414      0.986 0.020 0.980
#> GSM955086     2  0.0376      0.990 0.004 0.996
#> GSM955091     2  0.0000      0.991 0.000 1.000
#> GSM955092     2  0.0000      0.991 0.000 1.000
#> GSM955093     2  0.1414      0.986 0.020 0.980
#> GSM955098     2  0.1414      0.986 0.020 0.980
#> GSM955099     2  0.0000      0.991 0.000 1.000
#> GSM955100     1  0.0000      1.000 1.000 0.000
#> GSM955103     2  0.0938      0.988 0.012 0.988
#> GSM955104     2  0.1414      0.986 0.020 0.980
#> GSM955106     2  0.0000      0.991 0.000 1.000
#> GSM955000     1  0.0000      1.000 1.000 0.000
#> GSM955006     1  0.0000      1.000 1.000 0.000
#> GSM955007     2  0.0000      0.991 0.000 1.000
#> GSM955010     2  0.1414      0.986 0.020 0.980
#> GSM955014     1  0.0000      1.000 1.000 0.000
#> GSM955018     2  0.1414      0.986 0.020 0.980
#> GSM955020     1  0.0000      1.000 1.000 0.000
#> GSM955024     2  0.0000      0.991 0.000 1.000
#> GSM955026     2  0.1414      0.986 0.020 0.980
#> GSM955031     2  0.1414      0.986 0.020 0.980
#> GSM955038     2  0.6247      0.832 0.156 0.844
#> GSM955040     2  0.1414      0.986 0.020 0.980
#> GSM955044     2  0.0000      0.991 0.000 1.000
#> GSM955051     1  0.0000      1.000 1.000 0.000
#> GSM955055     2  0.0000      0.991 0.000 1.000
#> GSM955057     1  0.0000      1.000 1.000 0.000
#> GSM955062     2  0.0000      0.991 0.000 1.000
#> GSM955063     2  0.0000      0.991 0.000 1.000
#> GSM955068     2  0.0000      0.991 0.000 1.000
#> GSM955069     2  0.1414      0.986 0.020 0.980
#> GSM955070     2  0.0000      0.991 0.000 1.000
#> GSM955071     2  0.1414      0.986 0.020 0.980
#> GSM955077     2  0.1414      0.986 0.020 0.980
#> GSM955080     2  0.1184      0.987 0.016 0.984
#> GSM955081     2  0.0000      0.991 0.000 1.000
#> GSM955082     2  0.0000      0.991 0.000 1.000
#> GSM955085     2  0.0000      0.991 0.000 1.000
#> GSM955090     1  0.0000      1.000 1.000 0.000
#> GSM955094     2  0.0000      0.991 0.000 1.000
#> GSM955096     2  0.0000      0.991 0.000 1.000
#> GSM955102     2  0.1414      0.986 0.020 0.980
#> GSM955105     2  0.1414      0.986 0.020 0.980

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1    p2    p3
#> GSM955002     3  0.5591    0.55148 0.000 0.304 0.696
#> GSM955008     3  0.6180    0.37878 0.000 0.416 0.584
#> GSM955016     1  0.4291    0.83308 0.820 0.000 0.180
#> GSM955019     2  0.4062    0.67542 0.000 0.836 0.164
#> GSM955022     3  0.5363    0.55524 0.000 0.276 0.724
#> GSM955023     3  0.5785    0.48551 0.000 0.332 0.668
#> GSM955027     2  0.0000    0.74345 0.000 1.000 0.000
#> GSM955043     2  0.0000    0.74345 0.000 1.000 0.000
#> GSM955048     1  0.0000    0.96999 1.000 0.000 0.000
#> GSM955049     3  0.5968    0.42627 0.000 0.364 0.636
#> GSM955054     3  0.5835    0.47316 0.000 0.340 0.660
#> GSM955064     2  0.0237    0.74435 0.000 0.996 0.004
#> GSM955072     2  0.6126    0.19409 0.000 0.600 0.400
#> GSM955075     2  0.0000    0.74345 0.000 1.000 0.000
#> GSM955079     3  0.4504    0.61107 0.000 0.196 0.804
#> GSM955087     1  0.0000    0.96999 1.000 0.000 0.000
#> GSM955088     2  0.0892    0.74562 0.000 0.980 0.020
#> GSM955089     1  0.0000    0.96999 1.000 0.000 0.000
#> GSM955095     2  0.5016    0.54811 0.000 0.760 0.240
#> GSM955097     2  0.6829    0.50154 0.096 0.736 0.168
#> GSM955101     2  0.6373    0.16787 0.004 0.588 0.408
#> GSM954999     3  0.8132    0.35984 0.096 0.304 0.600
#> GSM955001     2  0.0237    0.74377 0.000 0.996 0.004
#> GSM955003     3  0.5785    0.48720 0.000 0.332 0.668
#> GSM955004     2  0.3295    0.68348 0.096 0.896 0.008
#> GSM955005     3  0.3722    0.61678 0.088 0.024 0.888
#> GSM955009     2  0.3295    0.68348 0.096 0.896 0.008
#> GSM955011     1  0.4178    0.83883 0.828 0.000 0.172
#> GSM955012     2  0.0747    0.74516 0.000 0.984 0.016
#> GSM955013     3  0.2945    0.62098 0.004 0.088 0.908
#> GSM955015     3  0.6140    0.40939 0.000 0.404 0.596
#> GSM955017     1  0.0000    0.96999 1.000 0.000 0.000
#> GSM955021     2  0.5465    0.45253 0.000 0.712 0.288
#> GSM955025     2  0.3295    0.68348 0.096 0.896 0.008
#> GSM955028     1  0.0000    0.96999 1.000 0.000 0.000
#> GSM955029     2  0.0000    0.74345 0.000 1.000 0.000
#> GSM955030     3  0.4586    0.59648 0.096 0.048 0.856
#> GSM955032     3  0.4555    0.60927 0.000 0.200 0.800
#> GSM955033     3  0.7911    0.39950 0.096 0.272 0.632
#> GSM955034     1  0.0000    0.96999 1.000 0.000 0.000
#> GSM955035     2  0.5905    0.33511 0.000 0.648 0.352
#> GSM955036     3  0.8288    0.31333 0.096 0.332 0.572
#> GSM955037     1  0.0000    0.96999 1.000 0.000 0.000
#> GSM955039     3  0.3587    0.61536 0.088 0.020 0.892
#> GSM955041     2  0.4605    0.60756 0.000 0.796 0.204
#> GSM955042     1  0.4504    0.81759 0.804 0.000 0.196
#> GSM955045     2  0.1753    0.74140 0.000 0.952 0.048
#> GSM955046     3  0.8452    0.28302 0.096 0.372 0.532
#> GSM955047     1  0.0000    0.96999 1.000 0.000 0.000
#> GSM955050     3  0.3886    0.61456 0.096 0.024 0.880
#> GSM955052     3  0.6079    0.43275 0.000 0.388 0.612
#> GSM955053     1  0.0000    0.96999 1.000 0.000 0.000
#> GSM955056     3  0.5591    0.52423 0.000 0.304 0.696
#> GSM955058     2  0.0000    0.74345 0.000 1.000 0.000
#> GSM955059     3  0.4796    0.60009 0.000 0.220 0.780
#> GSM955060     1  0.0000    0.96999 1.000 0.000 0.000
#> GSM955061     2  0.0000    0.74345 0.000 1.000 0.000
#> GSM955065     1  0.0000    0.96999 1.000 0.000 0.000
#> GSM955066     2  0.6192    0.14203 0.000 0.580 0.420
#> GSM955067     1  0.0000    0.96999 1.000 0.000 0.000
#> GSM955073     3  0.7995    0.53028 0.088 0.304 0.608
#> GSM955074     1  0.0000    0.96999 1.000 0.000 0.000
#> GSM955076     3  0.3941    0.62055 0.000 0.156 0.844
#> GSM955078     2  0.5497    0.46502 0.000 0.708 0.292
#> GSM955083     3  0.8157    0.35372 0.096 0.308 0.596
#> GSM955084     2  0.3295    0.68348 0.096 0.896 0.008
#> GSM955086     3  0.4504    0.61107 0.000 0.196 0.804
#> GSM955091     2  0.4002    0.67957 0.000 0.840 0.160
#> GSM955092     2  0.1163    0.74554 0.000 0.972 0.028
#> GSM955093     3  0.4689    0.62197 0.096 0.052 0.852
#> GSM955098     2  0.8527   -0.05473 0.096 0.504 0.400
#> GSM955099     2  0.5098    0.48633 0.000 0.752 0.248
#> GSM955100     1  0.4235    0.83594 0.824 0.000 0.176
#> GSM955103     3  0.7591    0.46141 0.068 0.300 0.632
#> GSM955104     3  0.3886    0.61456 0.096 0.024 0.880
#> GSM955106     3  0.6357    0.48541 0.012 0.336 0.652
#> GSM955000     1  0.0000    0.96999 1.000 0.000 0.000
#> GSM955006     1  0.0000    0.96999 1.000 0.000 0.000
#> GSM955007     2  0.6853    0.49664 0.064 0.712 0.224
#> GSM955010     3  0.3295    0.60465 0.096 0.008 0.896
#> GSM955014     1  0.0000    0.96999 1.000 0.000 0.000
#> GSM955018     2  0.8440   -0.10972 0.088 0.492 0.420
#> GSM955020     1  0.0000    0.96999 1.000 0.000 0.000
#> GSM955024     2  0.5058    0.55055 0.000 0.756 0.244
#> GSM955026     3  0.8425    0.43623 0.096 0.364 0.540
#> GSM955031     3  0.3886    0.61456 0.096 0.024 0.880
#> GSM955038     3  0.3832    0.61223 0.100 0.020 0.880
#> GSM955040     3  0.8226    0.33384 0.096 0.320 0.584
#> GSM955044     2  0.0000    0.74345 0.000 1.000 0.000
#> GSM955051     1  0.0000    0.96999 1.000 0.000 0.000
#> GSM955055     2  0.0000    0.74345 0.000 1.000 0.000
#> GSM955057     1  0.0000    0.96999 1.000 0.000 0.000
#> GSM955062     2  0.2448    0.73276 0.000 0.924 0.076
#> GSM955063     2  0.5431    0.50978 0.000 0.716 0.284
#> GSM955068     3  0.7864    0.50946 0.072 0.332 0.596
#> GSM955069     3  0.8068    0.36322 0.088 0.316 0.596
#> GSM955070     2  0.4399    0.63247 0.000 0.812 0.188
#> GSM955071     3  0.8157    0.35372 0.096 0.308 0.596
#> GSM955077     3  0.6829    0.62059 0.096 0.168 0.736
#> GSM955080     2  0.5165    0.66346 0.096 0.832 0.072
#> GSM955081     2  0.6291   -0.00465 0.000 0.532 0.468
#> GSM955082     2  0.3031    0.73508 0.012 0.912 0.076
#> GSM955085     2  0.0000    0.74345 0.000 1.000 0.000
#> GSM955090     1  0.0000    0.96999 1.000 0.000 0.000
#> GSM955094     2  0.3752    0.69121 0.000 0.856 0.144
#> GSM955096     3  0.5621    0.51946 0.000 0.308 0.692
#> GSM955102     3  0.8157    0.35372 0.096 0.308 0.596
#> GSM955105     3  0.4504    0.61107 0.000 0.196 0.804

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM955002     3  0.3610     0.6573 0.000 0.200 0.800 0.000
#> GSM955008     2  0.5060     0.3037 0.000 0.584 0.412 0.004
#> GSM955016     1  0.4632     0.6994 0.688 0.000 0.004 0.308
#> GSM955019     2  0.2647     0.7448 0.000 0.880 0.120 0.000
#> GSM955022     3  0.2831     0.6899 0.000 0.120 0.876 0.004
#> GSM955023     2  0.5167     0.0973 0.000 0.508 0.488 0.004
#> GSM955027     2  0.0000     0.7745 0.000 1.000 0.000 0.000
#> GSM955043     2  0.0336     0.7738 0.000 0.992 0.000 0.008
#> GSM955048     1  0.0000     0.9343 1.000 0.000 0.000 0.000
#> GSM955049     2  0.5147     0.1784 0.000 0.536 0.460 0.004
#> GSM955054     2  0.5147     0.1784 0.000 0.536 0.460 0.004
#> GSM955064     2  0.0188     0.7742 0.000 0.996 0.000 0.004
#> GSM955072     2  0.4222     0.5832 0.000 0.728 0.272 0.000
#> GSM955075     2  0.0524     0.7740 0.000 0.988 0.008 0.004
#> GSM955079     3  0.2197     0.6864 0.000 0.080 0.916 0.004
#> GSM955087     1  0.0000     0.9343 1.000 0.000 0.000 0.000
#> GSM955088     2  0.0469     0.7749 0.000 0.988 0.012 0.000
#> GSM955089     1  0.0000     0.9343 1.000 0.000 0.000 0.000
#> GSM955095     2  0.2888     0.7336 0.000 0.872 0.124 0.004
#> GSM955097     4  0.5980     0.9476 0.008 0.024 0.456 0.512
#> GSM955101     3  0.4699     0.5427 0.000 0.320 0.676 0.004
#> GSM954999     4  0.5277     0.9805 0.008 0.000 0.460 0.532
#> GSM955001     2  0.0336     0.7738 0.000 0.992 0.000 0.008
#> GSM955003     2  0.5151     0.1669 0.000 0.532 0.464 0.004
#> GSM955004     2  0.5524     0.4518 0.008 0.560 0.008 0.424
#> GSM955005     3  0.2384     0.6727 0.004 0.072 0.916 0.008
#> GSM955009     2  0.5524     0.4518 0.008 0.560 0.008 0.424
#> GSM955011     1  0.3198     0.9128 0.880 0.000 0.080 0.040
#> GSM955012     2  0.0188     0.7752 0.000 0.996 0.004 0.000
#> GSM955013     3  0.1940     0.6834 0.000 0.076 0.924 0.000
#> GSM955015     2  0.5168    -0.0059 0.000 0.500 0.496 0.004
#> GSM955017     1  0.3056     0.9164 0.888 0.000 0.072 0.040
#> GSM955021     2  0.3444     0.6841 0.000 0.816 0.184 0.000
#> GSM955025     2  0.5640     0.4470 0.008 0.556 0.012 0.424
#> GSM955028     1  0.0000     0.9343 1.000 0.000 0.000 0.000
#> GSM955029     2  0.0336     0.7738 0.000 0.992 0.000 0.008
#> GSM955030     4  0.5296     0.9435 0.008 0.000 0.492 0.500
#> GSM955032     3  0.2081     0.6888 0.000 0.084 0.916 0.000
#> GSM955033     4  0.5292     0.9523 0.008 0.000 0.480 0.512
#> GSM955034     1  0.0000     0.9343 1.000 0.000 0.000 0.000
#> GSM955035     2  0.3668     0.6917 0.000 0.808 0.188 0.004
#> GSM955036     4  0.5277     0.9805 0.008 0.000 0.460 0.532
#> GSM955037     1  0.4122     0.7881 0.760 0.000 0.004 0.236
#> GSM955039     3  0.2871     0.6581 0.000 0.072 0.896 0.032
#> GSM955041     2  0.2480     0.7546 0.000 0.904 0.088 0.008
#> GSM955042     1  0.5360     0.4709 0.552 0.000 0.012 0.436
#> GSM955045     2  0.0188     0.7752 0.000 0.996 0.004 0.000
#> GSM955046     4  0.5277     0.9805 0.008 0.000 0.460 0.532
#> GSM955047     1  0.3056     0.9164 0.888 0.000 0.072 0.040
#> GSM955050     3  0.1139     0.5393 0.008 0.008 0.972 0.012
#> GSM955052     2  0.5126     0.2207 0.000 0.552 0.444 0.004
#> GSM955053     1  0.0000     0.9343 1.000 0.000 0.000 0.000
#> GSM955056     3  0.3942     0.6364 0.000 0.236 0.764 0.000
#> GSM955058     2  0.0336     0.7738 0.000 0.992 0.000 0.008
#> GSM955059     3  0.2831     0.6906 0.000 0.120 0.876 0.004
#> GSM955060     1  0.3056     0.9164 0.888 0.000 0.072 0.040
#> GSM955061     2  0.1902     0.7654 0.000 0.932 0.064 0.004
#> GSM955065     1  0.0000     0.9343 1.000 0.000 0.000 0.000
#> GSM955066     3  0.5080     0.3750 0.000 0.420 0.576 0.004
#> GSM955067     1  0.0336     0.9342 0.992 0.000 0.008 0.000
#> GSM955073     3  0.4011     0.6580 0.000 0.208 0.784 0.008
#> GSM955074     1  0.2983     0.9176 0.892 0.000 0.068 0.040
#> GSM955076     3  0.1940     0.6834 0.000 0.076 0.924 0.000
#> GSM955078     2  0.4193     0.5878 0.000 0.732 0.268 0.000
#> GSM955083     4  0.5277     0.9805 0.008 0.000 0.460 0.532
#> GSM955084     2  0.5524     0.4518 0.008 0.560 0.008 0.424
#> GSM955086     3  0.2197     0.6864 0.000 0.080 0.916 0.004
#> GSM955091     2  0.1211     0.7732 0.000 0.960 0.040 0.000
#> GSM955092     2  0.0188     0.7752 0.000 0.996 0.004 0.000
#> GSM955093     3  0.2522     0.6764 0.000 0.076 0.908 0.016
#> GSM955098     3  0.7888     0.3213 0.008 0.208 0.440 0.344
#> GSM955099     2  0.3539     0.6981 0.000 0.820 0.176 0.004
#> GSM955100     1  0.3156     0.9148 0.884 0.000 0.068 0.048
#> GSM955103     3  0.4057     0.6570 0.000 0.152 0.816 0.032
#> GSM955104     3  0.2530     0.6708 0.008 0.072 0.912 0.008
#> GSM955106     3  0.5132     0.0298 0.004 0.448 0.548 0.000
#> GSM955000     1  0.3056     0.9164 0.888 0.000 0.072 0.040
#> GSM955006     1  0.1211     0.9307 0.960 0.000 0.000 0.040
#> GSM955007     2  0.4086     0.6158 0.000 0.776 0.216 0.008
#> GSM955010     3  0.3975     0.0904 0.000 0.000 0.760 0.240
#> GSM955014     1  0.0000     0.9343 1.000 0.000 0.000 0.000
#> GSM955018     3  0.7310    -0.1521 0.000 0.212 0.532 0.256
#> GSM955020     1  0.0188     0.9341 0.996 0.000 0.000 0.004
#> GSM955024     2  0.2334     0.7562 0.000 0.908 0.088 0.004
#> GSM955026     3  0.4475     0.6372 0.008 0.240 0.748 0.004
#> GSM955031     3  0.2530     0.6708 0.008 0.072 0.912 0.008
#> GSM955038     3  0.1913     0.4965 0.020 0.000 0.940 0.040
#> GSM955040     4  0.5273     0.9768 0.008 0.000 0.456 0.536
#> GSM955044     2  0.0336     0.7738 0.000 0.992 0.000 0.008
#> GSM955051     1  0.1398     0.9302 0.956 0.000 0.004 0.040
#> GSM955055     2  0.0336     0.7738 0.000 0.992 0.000 0.008
#> GSM955057     1  0.0000     0.9343 1.000 0.000 0.000 0.000
#> GSM955062     2  0.0000     0.7745 0.000 1.000 0.000 0.000
#> GSM955063     2  0.3208     0.7264 0.000 0.848 0.148 0.004
#> GSM955068     3  0.3528     0.6707 0.000 0.192 0.808 0.000
#> GSM955069     3  0.6504    -0.7612 0.000 0.072 0.476 0.452
#> GSM955070     2  0.1867     0.7630 0.000 0.928 0.072 0.000
#> GSM955071     4  0.5277     0.9805 0.008 0.000 0.460 0.532
#> GSM955077     3  0.4364     0.6446 0.008 0.080 0.828 0.084
#> GSM955080     2  0.6818     0.4592 0.008 0.632 0.192 0.168
#> GSM955081     3  0.4936     0.4231 0.000 0.372 0.624 0.004
#> GSM955082     2  0.2081     0.7653 0.000 0.916 0.084 0.000
#> GSM955085     2  0.0188     0.7752 0.000 0.996 0.004 0.000
#> GSM955090     1  0.0188     0.9341 0.996 0.000 0.000 0.004
#> GSM955094     2  0.1716     0.7652 0.000 0.936 0.064 0.000
#> GSM955096     3  0.5168    -0.1122 0.000 0.496 0.500 0.004
#> GSM955102     4  0.4981     0.9704 0.000 0.000 0.464 0.536
#> GSM955105     3  0.2197     0.6864 0.000 0.080 0.916 0.004

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM955002     3  0.5385      0.459 0.000 0.120 0.700 0.164 0.016
#> GSM955008     3  0.1772      0.683 0.000 0.020 0.940 0.032 0.008
#> GSM955016     1  0.2377      0.804 0.872 0.000 0.000 0.128 0.000
#> GSM955019     3  0.1399      0.691 0.000 0.028 0.952 0.000 0.020
#> GSM955022     3  0.4750      0.542 0.000 0.132 0.764 0.024 0.080
#> GSM955023     3  0.2754      0.639 0.000 0.040 0.880 0.000 0.080
#> GSM955027     3  0.5200      0.617 0.000 0.160 0.688 0.000 0.152
#> GSM955043     3  0.5237      0.614 0.000 0.160 0.684 0.000 0.156
#> GSM955048     5  0.3857      0.982 0.312 0.000 0.000 0.000 0.688
#> GSM955049     3  0.2124      0.658 0.000 0.028 0.916 0.000 0.056
#> GSM955054     3  0.2209      0.656 0.000 0.032 0.912 0.000 0.056
#> GSM955064     3  0.5237      0.614 0.000 0.160 0.684 0.000 0.156
#> GSM955072     3  0.1012      0.683 0.000 0.020 0.968 0.000 0.012
#> GSM955075     3  0.5237      0.614 0.000 0.160 0.684 0.000 0.156
#> GSM955079     3  0.7246      0.218 0.000 0.132 0.548 0.212 0.108
#> GSM955087     5  0.3837      0.982 0.308 0.000 0.000 0.000 0.692
#> GSM955088     3  0.4734      0.640 0.000 0.160 0.732 0.000 0.108
#> GSM955089     5  0.3983      0.957 0.340 0.000 0.000 0.000 0.660
#> GSM955095     3  0.3164      0.682 0.000 0.076 0.868 0.044 0.012
#> GSM955097     4  0.3852      0.491 0.000 0.020 0.220 0.760 0.000
#> GSM955101     3  0.3911      0.606 0.000 0.072 0.816 0.104 0.008
#> GSM954999     4  0.0404      0.775 0.000 0.012 0.000 0.988 0.000
#> GSM955001     3  0.5237      0.614 0.000 0.160 0.684 0.000 0.156
#> GSM955003     3  0.2370      0.652 0.000 0.040 0.904 0.000 0.056
#> GSM955004     2  0.2719      0.766 0.000 0.852 0.144 0.004 0.000
#> GSM955005     4  0.4405      0.748 0.000 0.036 0.124 0.792 0.048
#> GSM955009     2  0.2719      0.766 0.000 0.852 0.144 0.004 0.000
#> GSM955011     1  0.2305      0.817 0.896 0.000 0.000 0.092 0.012
#> GSM955012     3  0.4781      0.638 0.000 0.160 0.728 0.000 0.112
#> GSM955013     4  0.5957      0.661 0.000 0.084 0.148 0.684 0.084
#> GSM955015     3  0.1728      0.672 0.000 0.020 0.940 0.036 0.004
#> GSM955017     1  0.0609      0.869 0.980 0.000 0.000 0.000 0.020
#> GSM955021     3  0.3691      0.681 0.000 0.076 0.820 0.000 0.104
#> GSM955025     2  0.2953      0.763 0.000 0.844 0.144 0.012 0.000
#> GSM955028     5  0.3837      0.982 0.308 0.000 0.000 0.000 0.692
#> GSM955029     3  0.5237      0.614 0.000 0.160 0.684 0.000 0.156
#> GSM955030     4  0.0727      0.776 0.004 0.012 0.000 0.980 0.004
#> GSM955032     3  0.7490     -0.196 0.000 0.132 0.432 0.352 0.084
#> GSM955033     4  0.0609      0.785 0.000 0.000 0.020 0.980 0.000
#> GSM955034     5  0.3837      0.982 0.308 0.000 0.000 0.000 0.692
#> GSM955035     3  0.2376      0.687 0.000 0.052 0.904 0.044 0.000
#> GSM955036     4  0.0162      0.778 0.000 0.004 0.000 0.996 0.000
#> GSM955037     1  0.0963      0.868 0.964 0.000 0.000 0.036 0.000
#> GSM955039     4  0.3753      0.759 0.000 0.020 0.116 0.828 0.036
#> GSM955041     3  0.4669      0.669 0.000 0.156 0.764 0.048 0.032
#> GSM955042     1  0.3596      0.705 0.776 0.012 0.000 0.212 0.000
#> GSM955045     3  0.4496      0.649 0.000 0.156 0.752 0.000 0.092
#> GSM955046     4  0.0671      0.778 0.000 0.016 0.004 0.980 0.000
#> GSM955047     1  0.0451      0.869 0.988 0.004 0.000 0.000 0.008
#> GSM955050     4  0.7718      0.487 0.276 0.052 0.100 0.516 0.056
#> GSM955052     3  0.1820      0.670 0.000 0.020 0.940 0.020 0.020
#> GSM955053     5  0.3837      0.982 0.308 0.000 0.000 0.000 0.692
#> GSM955056     3  0.3040      0.638 0.000 0.044 0.876 0.012 0.068
#> GSM955058     3  0.5237      0.614 0.000 0.160 0.684 0.000 0.156
#> GSM955059     3  0.7384     -0.232 0.000 0.132 0.424 0.372 0.072
#> GSM955060     1  0.0510      0.868 0.984 0.000 0.000 0.000 0.016
#> GSM955061     3  0.5500      0.614 0.000 0.160 0.684 0.012 0.144
#> GSM955065     5  0.3837      0.982 0.308 0.000 0.000 0.000 0.692
#> GSM955066     3  0.5408      0.465 0.000 0.116 0.668 0.212 0.004
#> GSM955067     5  0.3837      0.982 0.308 0.000 0.000 0.000 0.692
#> GSM955073     3  0.3234      0.626 0.000 0.012 0.836 0.144 0.008
#> GSM955074     1  0.0510      0.868 0.984 0.000 0.000 0.000 0.016
#> GSM955076     4  0.7216      0.437 0.000 0.132 0.256 0.528 0.084
#> GSM955078     3  0.1408      0.690 0.000 0.044 0.948 0.000 0.008
#> GSM955083     4  0.0404      0.775 0.000 0.012 0.000 0.988 0.000
#> GSM955084     2  0.2719      0.766 0.000 0.852 0.144 0.004 0.000
#> GSM955086     3  0.7746     -0.227 0.000 0.132 0.400 0.356 0.112
#> GSM955091     3  0.2193      0.693 0.000 0.060 0.912 0.000 0.028
#> GSM955092     3  0.4559      0.648 0.000 0.152 0.748 0.000 0.100
#> GSM955093     4  0.4675      0.671 0.000 0.060 0.196 0.736 0.008
#> GSM955098     2  0.6081      0.491 0.016 0.628 0.272 0.044 0.040
#> GSM955099     3  0.2984      0.689 0.000 0.108 0.860 0.000 0.032
#> GSM955100     1  0.1281      0.867 0.956 0.000 0.000 0.032 0.012
#> GSM955103     4  0.3973      0.726 0.000 0.036 0.164 0.792 0.008
#> GSM955104     4  0.5706      0.725 0.072 0.036 0.096 0.740 0.056
#> GSM955106     3  0.4395      0.561 0.000 0.116 0.780 0.008 0.096
#> GSM955000     1  0.0609      0.869 0.980 0.000 0.000 0.000 0.020
#> GSM955006     1  0.0865      0.864 0.972 0.000 0.000 0.004 0.024
#> GSM955007     3  0.5597      0.570 0.000 0.160 0.640 0.200 0.000
#> GSM955010     4  0.2416      0.778 0.000 0.012 0.100 0.888 0.000
#> GSM955014     5  0.3876      0.979 0.316 0.000 0.000 0.000 0.684
#> GSM955018     4  0.2720      0.768 0.000 0.020 0.096 0.880 0.004
#> GSM955020     5  0.4299      0.879 0.388 0.000 0.000 0.004 0.608
#> GSM955024     3  0.4287      0.675 0.000 0.128 0.792 0.016 0.064
#> GSM955026     3  0.4497      0.566 0.000 0.136 0.776 0.072 0.016
#> GSM955031     4  0.7664      0.597 0.128 0.116 0.084 0.592 0.080
#> GSM955038     1  0.6294      0.547 0.676 0.020 0.060 0.160 0.084
#> GSM955040     4  0.4457      0.364 0.328 0.012 0.000 0.656 0.004
#> GSM955044     3  0.5237      0.614 0.000 0.160 0.684 0.000 0.156
#> GSM955051     1  0.0404      0.869 0.988 0.000 0.000 0.000 0.012
#> GSM955055     3  0.5237      0.614 0.000 0.160 0.684 0.000 0.156
#> GSM955057     5  0.3857      0.982 0.312 0.000 0.000 0.000 0.688
#> GSM955062     3  0.4926      0.638 0.000 0.132 0.716 0.000 0.152
#> GSM955063     3  0.3115      0.687 0.000 0.112 0.852 0.036 0.000
#> GSM955068     3  0.4250      0.568 0.000 0.140 0.792 0.048 0.020
#> GSM955069     4  0.1211      0.781 0.000 0.016 0.024 0.960 0.000
#> GSM955070     3  0.3868      0.673 0.000 0.060 0.800 0.000 0.140
#> GSM955071     4  0.0404      0.775 0.000 0.012 0.000 0.988 0.000
#> GSM955077     2  0.7928     -0.216 0.036 0.440 0.112 0.344 0.068
#> GSM955080     3  0.6088      0.428 0.000 0.156 0.548 0.296 0.000
#> GSM955081     3  0.6185      0.285 0.000 0.128 0.548 0.316 0.008
#> GSM955082     3  0.2625      0.691 0.000 0.108 0.876 0.000 0.016
#> GSM955085     3  0.4872      0.635 0.000 0.160 0.720 0.000 0.120
#> GSM955090     5  0.3913      0.974 0.324 0.000 0.000 0.000 0.676
#> GSM955094     3  0.3844      0.675 0.000 0.064 0.804 0.000 0.132
#> GSM955096     3  0.3590      0.600 0.000 0.092 0.828 0.000 0.080
#> GSM955102     4  0.0000      0.777 0.000 0.000 0.000 1.000 0.000
#> GSM955105     3  0.7513      0.189 0.000 0.132 0.516 0.220 0.132

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM955002     4  0.5101     0.0866 0.000 0.424 0.068 0.504 0.000 0.004
#> GSM955008     2  0.4354     0.7126 0.000 0.732 0.032 0.200 0.000 0.036
#> GSM955016     1  0.0935     0.8973 0.964 0.000 0.032 0.000 0.004 0.000
#> GSM955019     2  0.3023     0.7351 0.000 0.808 0.008 0.180 0.000 0.004
#> GSM955022     2  0.5004     0.1815 0.000 0.492 0.028 0.456 0.000 0.024
#> GSM955023     2  0.3736     0.6902 0.000 0.716 0.008 0.268 0.000 0.008
#> GSM955027     2  0.0291     0.7529 0.004 0.992 0.000 0.004 0.000 0.000
#> GSM955043     2  0.0858     0.7412 0.004 0.968 0.000 0.028 0.000 0.000
#> GSM955048     6  0.2482     0.9485 0.148 0.000 0.000 0.004 0.000 0.848
#> GSM955049     2  0.3596     0.7188 0.000 0.740 0.008 0.244 0.000 0.008
#> GSM955054     2  0.3911     0.7054 0.000 0.720 0.008 0.252 0.000 0.020
#> GSM955064     2  0.0551     0.7519 0.004 0.984 0.004 0.008 0.000 0.000
#> GSM955072     2  0.3381     0.7323 0.000 0.772 0.008 0.212 0.000 0.008
#> GSM955075     2  0.0653     0.7548 0.004 0.980 0.012 0.004 0.000 0.000
#> GSM955079     4  0.5171     0.0911 0.000 0.416 0.088 0.496 0.000 0.000
#> GSM955087     6  0.2454     0.9433 0.160 0.000 0.000 0.000 0.000 0.840
#> GSM955088     2  0.0622     0.7599 0.000 0.980 0.008 0.012 0.000 0.000
#> GSM955089     6  0.4228     0.8738 0.212 0.000 0.000 0.072 0.000 0.716
#> GSM955095     2  0.3725     0.4984 0.000 0.676 0.008 0.316 0.000 0.000
#> GSM955097     3  0.5038     0.4366 0.008 0.180 0.696 0.096 0.000 0.020
#> GSM955101     2  0.5188     0.4570 0.000 0.592 0.080 0.316 0.000 0.012
#> GSM954999     3  0.0951     0.7588 0.008 0.004 0.968 0.000 0.000 0.020
#> GSM955001     2  0.0692     0.7456 0.004 0.976 0.000 0.020 0.000 0.000
#> GSM955003     2  0.3934     0.7022 0.000 0.716 0.008 0.256 0.000 0.020
#> GSM955004     5  0.2003     0.9018 0.000 0.116 0.000 0.000 0.884 0.000
#> GSM955005     3  0.4330     0.6867 0.000 0.004 0.748 0.156 0.084 0.008
#> GSM955009     5  0.2048     0.8989 0.000 0.120 0.000 0.000 0.880 0.000
#> GSM955011     1  0.0964     0.9028 0.968 0.000 0.012 0.000 0.004 0.016
#> GSM955012     2  0.0146     0.7571 0.000 0.996 0.000 0.004 0.000 0.000
#> GSM955013     3  0.5431     0.5170 0.000 0.036 0.588 0.324 0.044 0.008
#> GSM955015     2  0.4516     0.7074 0.000 0.724 0.032 0.196 0.000 0.048
#> GSM955017     1  0.1245     0.9057 0.952 0.000 0.000 0.016 0.000 0.032
#> GSM955021     2  0.2878     0.7605 0.004 0.828 0.004 0.160 0.000 0.004
#> GSM955025     5  0.2003     0.9018 0.000 0.116 0.000 0.000 0.884 0.000
#> GSM955028     6  0.2340     0.9487 0.148 0.000 0.000 0.000 0.000 0.852
#> GSM955029     2  0.1116     0.7406 0.004 0.960 0.008 0.028 0.000 0.000
#> GSM955030     3  0.1109     0.7636 0.012 0.004 0.964 0.004 0.016 0.000
#> GSM955032     4  0.6188     0.3094 0.000 0.208 0.344 0.436 0.000 0.012
#> GSM955033     3  0.1313     0.7653 0.000 0.004 0.952 0.016 0.000 0.028
#> GSM955034     6  0.2340     0.9487 0.148 0.000 0.000 0.000 0.000 0.852
#> GSM955035     2  0.4330     0.7241 0.000 0.748 0.032 0.172 0.000 0.048
#> GSM955036     3  0.1425     0.7577 0.008 0.012 0.952 0.008 0.000 0.020
#> GSM955037     1  0.1514     0.9047 0.948 0.000 0.016 0.016 0.004 0.016
#> GSM955039     3  0.3184     0.7362 0.000 0.004 0.828 0.140 0.020 0.008
#> GSM955041     2  0.2851     0.7460 0.000 0.876 0.040 0.044 0.000 0.040
#> GSM955042     1  0.3103     0.7910 0.836 0.000 0.132 0.004 0.008 0.020
#> GSM955045     2  0.0363     0.7595 0.000 0.988 0.000 0.012 0.000 0.000
#> GSM955046     3  0.2317     0.7449 0.008 0.008 0.892 0.088 0.000 0.004
#> GSM955047     1  0.2395     0.8498 0.892 0.000 0.000 0.076 0.012 0.020
#> GSM955050     4  0.8141    -0.1151 0.180 0.000 0.224 0.400 0.124 0.072
#> GSM955052     2  0.4397     0.7038 0.000 0.720 0.032 0.216 0.000 0.032
#> GSM955053     6  0.2340     0.9487 0.148 0.000 0.000 0.000 0.000 0.852
#> GSM955056     2  0.4334     0.6905 0.000 0.708 0.028 0.240 0.000 0.024
#> GSM955058     2  0.1116     0.7406 0.004 0.960 0.008 0.028 0.000 0.000
#> GSM955059     4  0.6140     0.3108 0.000 0.216 0.348 0.428 0.000 0.008
#> GSM955060     1  0.0790     0.9085 0.968 0.000 0.000 0.000 0.000 0.032
#> GSM955061     2  0.1003     0.7515 0.004 0.964 0.028 0.004 0.000 0.000
#> GSM955065     6  0.2454     0.9433 0.160 0.000 0.000 0.000 0.000 0.840
#> GSM955066     2  0.5290    -0.0348 0.000 0.472 0.100 0.428 0.000 0.000
#> GSM955067     6  0.2340     0.9487 0.148 0.000 0.000 0.000 0.000 0.852
#> GSM955073     2  0.4600     0.6876 0.000 0.708 0.056 0.212 0.000 0.024
#> GSM955074     1  0.0790     0.9085 0.968 0.000 0.000 0.000 0.000 0.032
#> GSM955076     3  0.5820     0.1110 0.000 0.092 0.480 0.404 0.016 0.008
#> GSM955078     2  0.3166     0.7488 0.000 0.800 0.008 0.184 0.000 0.008
#> GSM955083     3  0.0951     0.7588 0.008 0.004 0.968 0.000 0.000 0.020
#> GSM955084     5  0.2003     0.9018 0.000 0.116 0.000 0.000 0.884 0.000
#> GSM955086     4  0.5321     0.2853 0.000 0.136 0.264 0.596 0.004 0.000
#> GSM955091     2  0.2512     0.7671 0.000 0.868 0.008 0.116 0.000 0.008
#> GSM955092     2  0.0622     0.7607 0.000 0.980 0.008 0.012 0.000 0.000
#> GSM955093     3  0.4817     0.4555 0.000 0.056 0.616 0.320 0.000 0.008
#> GSM955098     5  0.6606     0.4909 0.032 0.128 0.000 0.180 0.588 0.072
#> GSM955099     2  0.3196     0.7590 0.000 0.816 0.008 0.156 0.000 0.020
#> GSM955100     1  0.0777     0.9089 0.972 0.000 0.004 0.000 0.000 0.024
#> GSM955103     3  0.3589     0.6846 0.000 0.012 0.752 0.228 0.000 0.008
#> GSM955104     3  0.5796     0.6360 0.024 0.004 0.668 0.160 0.104 0.040
#> GSM955106     2  0.4630     0.3640 0.000 0.560 0.008 0.404 0.000 0.028
#> GSM955000     1  0.1245     0.9057 0.952 0.000 0.000 0.016 0.000 0.032
#> GSM955006     1  0.0935     0.9084 0.964 0.000 0.000 0.000 0.004 0.032
#> GSM955007     2  0.2755     0.7034 0.000 0.844 0.140 0.004 0.000 0.012
#> GSM955010     3  0.3414     0.7322 0.000 0.004 0.832 0.080 0.076 0.008
#> GSM955014     6  0.3432     0.9294 0.148 0.000 0.000 0.052 0.000 0.800
#> GSM955018     3  0.3071     0.7209 0.000 0.016 0.804 0.180 0.000 0.000
#> GSM955020     6  0.4694     0.7960 0.268 0.000 0.000 0.072 0.004 0.656
#> GSM955024     2  0.1718     0.7695 0.000 0.932 0.016 0.044 0.000 0.008
#> GSM955026     2  0.5267     0.0413 0.000 0.484 0.008 0.452 0.016 0.040
#> GSM955031     4  0.7678    -0.0735 0.124 0.000 0.188 0.488 0.128 0.072
#> GSM955038     1  0.7002     0.4416 0.572 0.000 0.088 0.160 0.112 0.068
#> GSM955040     3  0.4689    -0.0497 0.460 0.000 0.508 0.008 0.004 0.020
#> GSM955044     2  0.0858     0.7412 0.004 0.968 0.000 0.028 0.000 0.000
#> GSM955051     1  0.2501     0.8518 0.888 0.000 0.000 0.072 0.012 0.028
#> GSM955055     2  0.0858     0.7412 0.004 0.968 0.000 0.028 0.000 0.000
#> GSM955057     6  0.2482     0.9485 0.148 0.000 0.000 0.004 0.000 0.848
#> GSM955062     2  0.0291     0.7572 0.004 0.992 0.000 0.004 0.000 0.000
#> GSM955063     2  0.3622     0.7469 0.000 0.820 0.032 0.100 0.000 0.048
#> GSM955068     4  0.4874    -0.0628 0.000 0.456 0.008 0.504 0.012 0.020
#> GSM955069     3  0.2191     0.7455 0.000 0.004 0.876 0.120 0.000 0.000
#> GSM955070     2  0.2884     0.7648 0.004 0.848 0.008 0.128 0.000 0.012
#> GSM955071     3  0.0951     0.7588 0.008 0.004 0.968 0.000 0.000 0.020
#> GSM955077     4  0.7216    -0.1693 0.072 0.000 0.108 0.524 0.224 0.072
#> GSM955080     2  0.4682     0.4015 0.000 0.692 0.228 0.060 0.000 0.020
#> GSM955081     4  0.5800     0.2061 0.000 0.396 0.180 0.424 0.000 0.000
#> GSM955082     2  0.2308     0.7690 0.000 0.880 0.008 0.108 0.000 0.004
#> GSM955085     2  0.0520     0.7579 0.000 0.984 0.008 0.008 0.000 0.000
#> GSM955090     6  0.4228     0.8738 0.212 0.000 0.000 0.072 0.000 0.716
#> GSM955094     2  0.2654     0.7666 0.004 0.864 0.008 0.116 0.000 0.008
#> GSM955096     2  0.4114     0.5547 0.000 0.628 0.008 0.356 0.000 0.008
#> GSM955102     3  0.0964     0.7629 0.004 0.012 0.968 0.016 0.000 0.000
#> GSM955105     4  0.5784     0.3941 0.000 0.288 0.076 0.584 0.004 0.048

Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.

consensus_heatmap(res, k = 2)

plot of chunk tab-ATC-mclust-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-ATC-mclust-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-ATC-mclust-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-ATC-mclust-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-ATC-mclust-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-ATC-mclust-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-ATC-mclust-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-ATC-mclust-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-ATC-mclust-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-ATC-mclust-membership-heatmap-5

As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

plot of chunk tab-ATC-mclust-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-ATC-mclust-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-ATC-mclust-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-ATC-mclust-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-ATC-mclust-get-signatures-5

Signature heatmaps where rows are not scaled:

get_signatures(res, k = 2, scale_rows = FALSE)

plot of chunk tab-ATC-mclust-get-signatures-no-scale-1

get_signatures(res, k = 3, scale_rows = FALSE)

plot of chunk tab-ATC-mclust-get-signatures-no-scale-2

get_signatures(res, k = 4, scale_rows = FALSE)

plot of chunk tab-ATC-mclust-get-signatures-no-scale-3

get_signatures(res, k = 5, scale_rows = FALSE)

plot of chunk tab-ATC-mclust-get-signatures-no-scale-4

get_signatures(res, k = 6, scale_rows = FALSE)

plot of chunk tab-ATC-mclust-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk ATC-mclust-signature_compare

get_signature() returns a data frame invisibly. TO get the list of signatures, the function call should be assigned to a variable explicitly. In following code, if plot argument is set to FALSE, no heatmap is plotted while only the differential analysis is performed.

# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)

An example of the output of tb is:

#>   which_row         fdr    mean_1    mean_2 scaled_mean_1 scaled_mean_2 km
#> 1        38 0.042760348  8.373488  9.131774    -0.5533452     0.5164555  1
#> 2        40 0.018707592  7.106213  8.469186    -0.6173731     0.5762149  1
#> 3        55 0.019134737 10.221463 11.207825    -0.6159697     0.5749050  1
#> 4        59 0.006059896  5.921854  7.869574    -0.6899429     0.6439467  1
#> 5        60 0.018055526  8.928898 10.211722    -0.6204761     0.5791110  1
#> 6        98 0.009384629 15.714769 14.887706     0.6635654    -0.6193277  2
...

The columns in tb are:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. km: Row groups if k-means clustering is applied to rows.

UMAP plot which shows how samples are separated.

dimension_reduction(res, k = 2, method = "UMAP")

plot of chunk tab-ATC-mclust-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-ATC-mclust-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-ATC-mclust-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-ATC-mclust-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-ATC-mclust-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk ATC-mclust-collect-classes

Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.

test_to_known_factors(res)
#>              n genotype/variation(p) k
#> ATC:mclust 108                0.9101 2
#> ATC:mclust  78                0.7427 3
#> ATC:mclust  86                0.8660 4
#> ATC:mclust  93                0.0901 5
#> ATC:mclust  84                0.1791 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 31589 rows and 108 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'ATC' method.
#>   Subgroups are detected by 'NMF' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 2.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

collect_plots() function collects all the plots made from res for all k (number of partitions) into one single page to provide an easy and fast comparison between different k.

collect_plots(res)

plot of chunk ATC-NMF-collect-plots

The plots are:

All the plots in panels can be made by individual functions and they are plotted later in this section.

select_partition_number() produces several plots showing different statistics for choosing “optimized” k. There are following statistics:

The detailed explanations of these statistics can be found in the cola vignette.

Generally speaking, lower PAC score, higher mean silhouette score or higher concordance corresponds to better partition. Rand index and Jaccard index measure how similar the current partition is compared to partition with k-1. If they are too similar, we won't accept k is better than k-1.

select_partition_number(res)

plot of chunk ATC-NMF-select-partition-number

The numeric values for all these statistics can be obtained by get_stats().

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 1.000           0.970       0.987         0.4470 0.558   0.558
#> 3 3 0.657           0.748       0.887         0.3921 0.747   0.566
#> 4 4 0.491           0.435       0.687         0.1376 0.868   0.664
#> 5 5 0.532           0.506       0.715         0.0659 0.774   0.431
#> 6 6 0.572           0.476       0.705         0.0352 0.876   0.611

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
#> GSM955002     2  0.0000      0.984 0.000 1.000
#> GSM955008     2  0.0000      0.984 0.000 1.000
#> GSM955016     1  0.0000      0.990 1.000 0.000
#> GSM955019     2  0.0000      0.984 0.000 1.000
#> GSM955022     2  0.0000      0.984 0.000 1.000
#> GSM955023     2  0.0000      0.984 0.000 1.000
#> GSM955027     2  0.0000      0.984 0.000 1.000
#> GSM955043     2  0.0000      0.984 0.000 1.000
#> GSM955048     1  0.0000      0.990 1.000 0.000
#> GSM955049     2  0.0000      0.984 0.000 1.000
#> GSM955054     2  0.0000      0.984 0.000 1.000
#> GSM955064     2  0.0000      0.984 0.000 1.000
#> GSM955072     2  0.0000      0.984 0.000 1.000
#> GSM955075     2  0.0000      0.984 0.000 1.000
#> GSM955079     2  0.0000      0.984 0.000 1.000
#> GSM955087     1  0.0000      0.990 1.000 0.000
#> GSM955088     2  0.0000      0.984 0.000 1.000
#> GSM955089     1  0.0000      0.990 1.000 0.000
#> GSM955095     2  0.0000      0.984 0.000 1.000
#> GSM955097     2  0.0000      0.984 0.000 1.000
#> GSM955101     2  0.0000      0.984 0.000 1.000
#> GSM954999     1  0.4022      0.919 0.920 0.080
#> GSM955001     2  0.0000      0.984 0.000 1.000
#> GSM955003     2  0.0000      0.984 0.000 1.000
#> GSM955004     2  0.0000      0.984 0.000 1.000
#> GSM955005     1  0.4161      0.914 0.916 0.084
#> GSM955009     2  0.0000      0.984 0.000 1.000
#> GSM955011     1  0.0000      0.990 1.000 0.000
#> GSM955012     2  0.0000      0.984 0.000 1.000
#> GSM955013     2  0.0000      0.984 0.000 1.000
#> GSM955015     2  0.0000      0.984 0.000 1.000
#> GSM955017     1  0.0000      0.990 1.000 0.000
#> GSM955021     2  0.0000      0.984 0.000 1.000
#> GSM955025     2  0.0000      0.984 0.000 1.000
#> GSM955028     1  0.0000      0.990 1.000 0.000
#> GSM955029     2  0.0000      0.984 0.000 1.000
#> GSM955030     1  0.0000      0.990 1.000 0.000
#> GSM955032     2  0.0000      0.984 0.000 1.000
#> GSM955033     2  0.7602      0.723 0.220 0.780
#> GSM955034     1  0.0000      0.990 1.000 0.000
#> GSM955035     2  0.0000      0.984 0.000 1.000
#> GSM955036     2  0.6531      0.798 0.168 0.832
#> GSM955037     1  0.0000      0.990 1.000 0.000
#> GSM955039     2  0.8207      0.663 0.256 0.744
#> GSM955041     2  0.0000      0.984 0.000 1.000
#> GSM955042     1  0.0000      0.990 1.000 0.000
#> GSM955045     2  0.0000      0.984 0.000 1.000
#> GSM955046     2  0.0000      0.984 0.000 1.000
#> GSM955047     1  0.0000      0.990 1.000 0.000
#> GSM955050     1  0.0000      0.990 1.000 0.000
#> GSM955052     2  0.0000      0.984 0.000 1.000
#> GSM955053     1  0.0000      0.990 1.000 0.000
#> GSM955056     2  0.0000      0.984 0.000 1.000
#> GSM955058     2  0.0000      0.984 0.000 1.000
#> GSM955059     2  0.0000      0.984 0.000 1.000
#> GSM955060     1  0.0000      0.990 1.000 0.000
#> GSM955061     2  0.0000      0.984 0.000 1.000
#> GSM955065     1  0.0000      0.990 1.000 0.000
#> GSM955066     2  0.0000      0.984 0.000 1.000
#> GSM955067     1  0.0000      0.990 1.000 0.000
#> GSM955073     2  0.0000      0.984 0.000 1.000
#> GSM955074     1  0.0000      0.990 1.000 0.000
#> GSM955076     2  0.0000      0.984 0.000 1.000
#> GSM955078     2  0.0000      0.984 0.000 1.000
#> GSM955083     1  0.3733      0.928 0.928 0.072
#> GSM955084     2  0.0000      0.984 0.000 1.000
#> GSM955086     2  0.0000      0.984 0.000 1.000
#> GSM955091     2  0.0000      0.984 0.000 1.000
#> GSM955092     2  0.0000      0.984 0.000 1.000
#> GSM955093     2  0.0000      0.984 0.000 1.000
#> GSM955098     2  0.0000      0.984 0.000 1.000
#> GSM955099     2  0.0000      0.984 0.000 1.000
#> GSM955100     1  0.0000      0.990 1.000 0.000
#> GSM955103     2  0.0000      0.984 0.000 1.000
#> GSM955104     1  0.0000      0.990 1.000 0.000
#> GSM955106     2  0.0000      0.984 0.000 1.000
#> GSM955000     1  0.0000      0.990 1.000 0.000
#> GSM955006     1  0.0000      0.990 1.000 0.000
#> GSM955007     2  0.0000      0.984 0.000 1.000
#> GSM955010     1  0.2948      0.947 0.948 0.052
#> GSM955014     1  0.0000      0.990 1.000 0.000
#> GSM955018     2  0.0000      0.984 0.000 1.000
#> GSM955020     1  0.0000      0.990 1.000 0.000
#> GSM955024     2  0.0000      0.984 0.000 1.000
#> GSM955026     2  0.0000      0.984 0.000 1.000
#> GSM955031     1  0.0000      0.990 1.000 0.000
#> GSM955038     1  0.0000      0.990 1.000 0.000
#> GSM955040     1  0.0000      0.990 1.000 0.000
#> GSM955044     2  0.0000      0.984 0.000 1.000
#> GSM955051     1  0.0000      0.990 1.000 0.000
#> GSM955055     2  0.0000      0.984 0.000 1.000
#> GSM955057     1  0.0000      0.990 1.000 0.000
#> GSM955062     2  0.0000      0.984 0.000 1.000
#> GSM955063     2  0.0000      0.984 0.000 1.000
#> GSM955068     2  0.0000      0.984 0.000 1.000
#> GSM955069     2  0.0672      0.977 0.008 0.992
#> GSM955070     2  0.0000      0.984 0.000 1.000
#> GSM955071     1  0.2423      0.958 0.960 0.040
#> GSM955077     2  0.9661      0.367 0.392 0.608
#> GSM955080     2  0.0000      0.984 0.000 1.000
#> GSM955081     2  0.0000      0.984 0.000 1.000
#> GSM955082     2  0.0000      0.984 0.000 1.000
#> GSM955085     2  0.0000      0.984 0.000 1.000
#> GSM955090     1  0.0000      0.990 1.000 0.000
#> GSM955094     2  0.0000      0.984 0.000 1.000
#> GSM955096     2  0.0000      0.984 0.000 1.000
#> GSM955102     2  0.3733      0.914 0.072 0.928
#> GSM955105     2  0.0000      0.984 0.000 1.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1    p2    p3
#> GSM955002     3  0.6045      0.145 0.000 0.380 0.620
#> GSM955008     3  0.0424      0.841 0.000 0.008 0.992
#> GSM955016     1  0.0237      0.956 0.996 0.004 0.000
#> GSM955019     2  0.5591      0.667 0.000 0.696 0.304
#> GSM955022     3  0.0424      0.841 0.000 0.008 0.992
#> GSM955023     3  0.5733      0.454 0.000 0.324 0.676
#> GSM955027     2  0.5216      0.698 0.000 0.740 0.260
#> GSM955043     2  0.6286      0.345 0.000 0.536 0.464
#> GSM955048     1  0.0000      0.956 1.000 0.000 0.000
#> GSM955049     3  0.5465      0.542 0.000 0.288 0.712
#> GSM955054     3  0.4002      0.749 0.000 0.160 0.840
#> GSM955064     3  0.3116      0.796 0.000 0.108 0.892
#> GSM955072     2  0.6299      0.300 0.000 0.524 0.476
#> GSM955075     2  0.1753      0.741 0.000 0.952 0.048
#> GSM955079     3  0.3941      0.754 0.000 0.156 0.844
#> GSM955087     1  0.0237      0.956 0.996 0.004 0.000
#> GSM955088     2  0.5431      0.683 0.000 0.716 0.284
#> GSM955089     1  0.0000      0.956 1.000 0.000 0.000
#> GSM955095     3  0.5882      0.383 0.000 0.348 0.652
#> GSM955097     3  0.2878      0.805 0.000 0.096 0.904
#> GSM955101     3  0.0000      0.841 0.000 0.000 1.000
#> GSM954999     1  0.6189      0.471 0.632 0.004 0.364
#> GSM955001     2  0.5650      0.657 0.000 0.688 0.312
#> GSM955003     3  0.2261      0.820 0.000 0.068 0.932
#> GSM955004     2  0.0237      0.732 0.000 0.996 0.004
#> GSM955005     3  0.5443      0.551 0.260 0.004 0.736
#> GSM955009     2  0.0237      0.732 0.000 0.996 0.004
#> GSM955011     1  0.0000      0.956 1.000 0.000 0.000
#> GSM955012     3  0.2165      0.822 0.000 0.064 0.936
#> GSM955013     3  0.0424      0.841 0.000 0.008 0.992
#> GSM955015     3  0.0237      0.841 0.000 0.004 0.996
#> GSM955017     1  0.0000      0.956 1.000 0.000 0.000
#> GSM955021     3  0.6140      0.190 0.000 0.404 0.596
#> GSM955025     2  0.0237      0.732 0.000 0.996 0.004
#> GSM955028     1  0.0237      0.956 0.996 0.004 0.000
#> GSM955029     2  0.5905      0.606 0.000 0.648 0.352
#> GSM955030     3  0.6228      0.301 0.372 0.004 0.624
#> GSM955032     3  0.0237      0.841 0.000 0.004 0.996
#> GSM955033     3  0.1399      0.818 0.028 0.004 0.968
#> GSM955034     1  0.0237      0.956 0.996 0.004 0.000
#> GSM955035     3  0.0237      0.841 0.000 0.004 0.996
#> GSM955036     3  0.0237      0.838 0.000 0.004 0.996
#> GSM955037     1  0.0475      0.954 0.992 0.004 0.004
#> GSM955039     3  0.0475      0.835 0.004 0.004 0.992
#> GSM955041     3  0.0237      0.841 0.000 0.004 0.996
#> GSM955042     1  0.0237      0.956 0.996 0.004 0.000
#> GSM955045     3  0.3267      0.789 0.000 0.116 0.884
#> GSM955046     3  0.0000      0.841 0.000 0.000 1.000
#> GSM955047     1  0.1411      0.932 0.964 0.036 0.000
#> GSM955050     1  0.0892      0.943 0.980 0.020 0.000
#> GSM955052     3  0.0892      0.839 0.000 0.020 0.980
#> GSM955053     1  0.0237      0.956 0.996 0.004 0.000
#> GSM955056     3  0.0237      0.841 0.000 0.004 0.996
#> GSM955058     3  0.6308     -0.217 0.000 0.492 0.508
#> GSM955059     3  0.0747      0.840 0.000 0.016 0.984
#> GSM955060     1  0.0000      0.956 1.000 0.000 0.000
#> GSM955061     3  0.4178      0.737 0.000 0.172 0.828
#> GSM955065     1  0.0237      0.956 0.996 0.004 0.000
#> GSM955066     3  0.4399      0.717 0.000 0.188 0.812
#> GSM955067     1  0.0000      0.956 1.000 0.000 0.000
#> GSM955073     3  0.0000      0.841 0.000 0.000 1.000
#> GSM955074     1  0.0000      0.956 1.000 0.000 0.000
#> GSM955076     3  0.0000      0.841 0.000 0.000 1.000
#> GSM955078     2  0.5327      0.692 0.000 0.728 0.272
#> GSM955083     1  0.5656      0.611 0.712 0.004 0.284
#> GSM955084     2  0.0237      0.732 0.000 0.996 0.004
#> GSM955086     3  0.4413      0.746 0.008 0.160 0.832
#> GSM955091     2  0.6008      0.570 0.000 0.628 0.372
#> GSM955092     2  0.6180      0.483 0.000 0.584 0.416
#> GSM955093     3  0.0000      0.841 0.000 0.000 1.000
#> GSM955098     2  0.0237      0.732 0.000 0.996 0.004
#> GSM955099     2  0.0892      0.737 0.000 0.980 0.020
#> GSM955100     1  0.0237      0.956 0.996 0.004 0.000
#> GSM955103     3  0.0000      0.841 0.000 0.000 1.000
#> GSM955104     1  0.6468      0.206 0.552 0.004 0.444
#> GSM955106     2  0.4504      0.721 0.000 0.804 0.196
#> GSM955000     1  0.0237      0.956 0.996 0.004 0.000
#> GSM955006     1  0.0000      0.956 1.000 0.000 0.000
#> GSM955007     3  0.0000      0.841 0.000 0.000 1.000
#> GSM955010     3  0.2096      0.788 0.052 0.004 0.944
#> GSM955014     1  0.0000      0.956 1.000 0.000 0.000
#> GSM955018     3  0.0000      0.841 0.000 0.000 1.000
#> GSM955020     1  0.0000      0.956 1.000 0.000 0.000
#> GSM955024     3  0.0424      0.841 0.000 0.008 0.992
#> GSM955026     2  0.0237      0.732 0.000 0.996 0.004
#> GSM955031     1  0.0000      0.956 1.000 0.000 0.000
#> GSM955038     1  0.0000      0.956 1.000 0.000 0.000
#> GSM955040     1  0.0237      0.956 0.996 0.004 0.000
#> GSM955044     3  0.6302     -0.169 0.000 0.480 0.520
#> GSM955051     1  0.0237      0.954 0.996 0.004 0.000
#> GSM955055     2  0.6168      0.491 0.000 0.588 0.412
#> GSM955057     1  0.0000      0.956 1.000 0.000 0.000
#> GSM955062     3  0.4555      0.700 0.000 0.200 0.800
#> GSM955063     3  0.0424      0.841 0.000 0.008 0.992
#> GSM955068     2  0.0747      0.737 0.000 0.984 0.016
#> GSM955069     3  0.0000      0.841 0.000 0.000 1.000
#> GSM955070     2  0.5785      0.634 0.000 0.668 0.332
#> GSM955071     1  0.0424      0.950 0.992 0.000 0.008
#> GSM955077     2  0.2878      0.650 0.096 0.904 0.000
#> GSM955080     3  0.0000      0.841 0.000 0.000 1.000
#> GSM955081     3  0.2959      0.802 0.000 0.100 0.900
#> GSM955082     2  0.1643      0.741 0.000 0.956 0.044
#> GSM955085     2  0.3267      0.737 0.000 0.884 0.116
#> GSM955090     1  0.0000      0.956 1.000 0.000 0.000
#> GSM955094     2  0.6280      0.356 0.000 0.540 0.460
#> GSM955096     3  0.5465      0.534 0.000 0.288 0.712
#> GSM955102     3  0.0237      0.838 0.000 0.004 0.996
#> GSM955105     3  0.5506      0.648 0.016 0.220 0.764

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM955002     4  0.7258    0.07463 0.000 0.164 0.328 0.508
#> GSM955008     3  0.2408    0.53907 0.000 0.036 0.920 0.044
#> GSM955016     1  0.4103    0.64315 0.744 0.000 0.000 0.256
#> GSM955019     2  0.5220    0.52733 0.000 0.568 0.424 0.008
#> GSM955022     3  0.2761    0.53633 0.000 0.048 0.904 0.048
#> GSM955023     3  0.6262    0.15539 0.000 0.280 0.628 0.092
#> GSM955027     2  0.4936    0.59268 0.000 0.624 0.372 0.004
#> GSM955043     2  0.5057    0.60290 0.000 0.648 0.340 0.012
#> GSM955048     1  0.0336    0.83044 0.992 0.000 0.000 0.008
#> GSM955049     3  0.6690    0.26017 0.000 0.192 0.620 0.188
#> GSM955054     3  0.6075    0.36440 0.000 0.148 0.684 0.168
#> GSM955064     3  0.5249    0.31313 0.000 0.248 0.708 0.044
#> GSM955072     3  0.6936    0.12197 0.000 0.284 0.568 0.148
#> GSM955075     2  0.2489    0.57943 0.000 0.912 0.068 0.020
#> GSM955079     3  0.6797    0.27904 0.004 0.148 0.616 0.232
#> GSM955087     1  0.0592    0.82985 0.984 0.000 0.000 0.016
#> GSM955088     2  0.4507    0.61220 0.000 0.756 0.224 0.020
#> GSM955089     1  0.1022    0.82612 0.968 0.000 0.000 0.032
#> GSM955095     3  0.4992   -0.36205 0.000 0.476 0.524 0.000
#> GSM955097     3  0.8046    0.08072 0.004 0.324 0.376 0.296
#> GSM955101     3  0.1867    0.53275 0.000 0.000 0.928 0.072
#> GSM954999     4  0.7292   -0.01090 0.388 0.000 0.152 0.460
#> GSM955001     2  0.4991    0.57959 0.000 0.608 0.388 0.004
#> GSM955003     3  0.6296    0.31107 0.000 0.112 0.644 0.244
#> GSM955004     2  0.1767    0.51944 0.000 0.944 0.012 0.044
#> GSM955005     1  0.5263    0.06858 0.544 0.000 0.448 0.008
#> GSM955009     2  0.1833    0.55317 0.000 0.944 0.032 0.024
#> GSM955011     1  0.0707    0.82642 0.980 0.000 0.000 0.020
#> GSM955012     3  0.4964    0.30432 0.000 0.256 0.716 0.028
#> GSM955013     3  0.2573    0.54200 0.024 0.012 0.920 0.044
#> GSM955015     3  0.3024    0.49320 0.000 0.000 0.852 0.148
#> GSM955017     1  0.0469    0.82841 0.988 0.000 0.000 0.012
#> GSM955021     3  0.5659   -0.06522 0.000 0.368 0.600 0.032
#> GSM955025     2  0.2334    0.46621 0.000 0.908 0.004 0.088
#> GSM955028     1  0.0592    0.82985 0.984 0.000 0.000 0.016
#> GSM955029     2  0.4746    0.60058 0.000 0.632 0.368 0.000
#> GSM955030     1  0.7732   -0.17066 0.392 0.000 0.380 0.228
#> GSM955032     3  0.4467    0.45155 0.000 0.040 0.788 0.172
#> GSM955033     4  0.6755   -0.16884 0.092 0.000 0.452 0.456
#> GSM955034     1  0.0592    0.82985 0.984 0.000 0.000 0.016
#> GSM955035     3  0.3688    0.45340 0.000 0.000 0.792 0.208
#> GSM955036     3  0.5670    0.23078 0.020 0.004 0.572 0.404
#> GSM955037     1  0.3448    0.70031 0.828 0.000 0.004 0.168
#> GSM955039     3  0.4697    0.31077 0.000 0.000 0.644 0.356
#> GSM955041     3  0.4511    0.40249 0.000 0.008 0.724 0.268
#> GSM955042     1  0.3048    0.78930 0.876 0.016 0.000 0.108
#> GSM955045     3  0.4797    0.29288 0.000 0.260 0.720 0.020
#> GSM955046     3  0.4978    0.28432 0.000 0.004 0.612 0.384
#> GSM955047     1  0.3539    0.73046 0.820 0.004 0.000 0.176
#> GSM955050     1  0.3172    0.72921 0.840 0.000 0.000 0.160
#> GSM955052     3  0.3820    0.52292 0.000 0.088 0.848 0.064
#> GSM955053     1  0.0921    0.82774 0.972 0.000 0.000 0.028
#> GSM955056     3  0.2385    0.53894 0.000 0.028 0.920 0.052
#> GSM955058     2  0.5435    0.52527 0.000 0.564 0.420 0.016
#> GSM955059     3  0.1388    0.55267 0.000 0.028 0.960 0.012
#> GSM955060     1  0.0000    0.83009 1.000 0.000 0.000 0.000
#> GSM955061     2  0.7720    0.03907 0.000 0.412 0.360 0.228
#> GSM955065     1  0.0592    0.82985 0.984 0.000 0.000 0.016
#> GSM955066     3  0.6946    0.31072 0.000 0.252 0.580 0.168
#> GSM955067     1  0.0592    0.82889 0.984 0.000 0.000 0.016
#> GSM955073     3  0.2868    0.50592 0.000 0.000 0.864 0.136
#> GSM955074     1  0.1118    0.82826 0.964 0.000 0.000 0.036
#> GSM955076     3  0.4936    0.30430 0.000 0.012 0.672 0.316
#> GSM955078     3  0.6889   -0.21015 0.000 0.396 0.496 0.108
#> GSM955083     4  0.7009   -0.11942 0.440 0.000 0.116 0.444
#> GSM955084     2  0.1833    0.54102 0.000 0.944 0.024 0.032
#> GSM955086     3  0.6528    0.33335 0.008 0.140 0.660 0.192
#> GSM955091     2  0.5378    0.48943 0.000 0.540 0.448 0.012
#> GSM955092     2  0.5105    0.52913 0.000 0.564 0.432 0.004
#> GSM955093     3  0.4543    0.34631 0.000 0.000 0.676 0.324
#> GSM955098     2  0.5671    0.15557 0.000 0.572 0.028 0.400
#> GSM955099     2  0.5397    0.62560 0.000 0.720 0.212 0.068
#> GSM955100     1  0.0336    0.83072 0.992 0.000 0.000 0.008
#> GSM955103     3  0.3400    0.47703 0.000 0.000 0.820 0.180
#> GSM955104     1  0.6714    0.29988 0.612 0.000 0.228 0.160
#> GSM955106     4  0.7493   -0.03763 0.000 0.200 0.320 0.480
#> GSM955000     1  0.0469    0.82841 0.988 0.000 0.000 0.012
#> GSM955006     1  0.1557    0.81890 0.944 0.000 0.000 0.056
#> GSM955007     3  0.5040    0.30532 0.000 0.008 0.628 0.364
#> GSM955010     3  0.6306    0.17568 0.064 0.000 0.544 0.392
#> GSM955014     1  0.0921    0.82855 0.972 0.000 0.000 0.028
#> GSM955018     3  0.4711    0.43794 0.000 0.024 0.740 0.236
#> GSM955020     1  0.2345    0.80590 0.900 0.000 0.000 0.100
#> GSM955024     3  0.2983    0.55208 0.000 0.068 0.892 0.040
#> GSM955026     2  0.7580    0.36646 0.000 0.476 0.228 0.296
#> GSM955031     1  0.6282    0.25332 0.552 0.008 0.044 0.396
#> GSM955038     4  0.5648   -0.20184 0.444 0.016 0.004 0.536
#> GSM955040     1  0.5576    0.19570 0.496 0.012 0.004 0.488
#> GSM955044     2  0.5466    0.49595 0.000 0.548 0.436 0.016
#> GSM955051     1  0.3271    0.77850 0.856 0.012 0.000 0.132
#> GSM955055     2  0.4679    0.61430 0.000 0.648 0.352 0.000
#> GSM955057     1  0.0000    0.83009 1.000 0.000 0.000 0.000
#> GSM955062     3  0.4406    0.18502 0.000 0.300 0.700 0.000
#> GSM955063     3  0.2644    0.54764 0.000 0.032 0.908 0.060
#> GSM955068     4  0.7912   -0.18841 0.004 0.248 0.324 0.424
#> GSM955069     3  0.4944    0.42597 0.032 0.004 0.744 0.220
#> GSM955070     2  0.6878    0.44923 0.000 0.556 0.316 0.128
#> GSM955071     1  0.5713    0.38797 0.620 0.000 0.040 0.340
#> GSM955077     2  0.5976    0.27716 0.076 0.708 0.016 0.200
#> GSM955080     3  0.6583    0.21604 0.000 0.084 0.528 0.388
#> GSM955081     3  0.5172    0.28075 0.000 0.260 0.704 0.036
#> GSM955082     2  0.4999    0.61736 0.000 0.660 0.328 0.012
#> GSM955085     2  0.3583    0.64202 0.000 0.816 0.180 0.004
#> GSM955090     1  0.1557    0.82319 0.944 0.000 0.000 0.056
#> GSM955094     2  0.6507    0.34564 0.000 0.520 0.404 0.076
#> GSM955096     3  0.6373    0.22069 0.000 0.248 0.636 0.116
#> GSM955102     3  0.5733    0.31117 0.028 0.008 0.632 0.332
#> GSM955105     4  0.6837   -0.00625 0.000 0.100 0.428 0.472

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM955002     2  0.7486     0.3341 0.000 0.436 0.048 0.280 0.236
#> GSM955008     3  0.6100     0.4108 0.000 0.308 0.540 0.152 0.000
#> GSM955016     1  0.6126     0.1635 0.500 0.012 0.000 0.396 0.092
#> GSM955019     3  0.2751     0.5512 0.000 0.044 0.896 0.020 0.040
#> GSM955022     3  0.6295     0.4251 0.000 0.308 0.540 0.144 0.008
#> GSM955023     3  0.4752     0.5131 0.000 0.272 0.684 0.040 0.004
#> GSM955027     3  0.3779     0.3886 0.000 0.048 0.812 0.004 0.136
#> GSM955043     3  0.4713     0.2049 0.000 0.028 0.724 0.024 0.224
#> GSM955048     1  0.0854     0.8720 0.976 0.008 0.000 0.004 0.012
#> GSM955049     3  0.5073     0.4721 0.000 0.312 0.640 0.040 0.008
#> GSM955054     3  0.5469     0.3724 0.000 0.392 0.548 0.056 0.004
#> GSM955064     3  0.5144     0.5450 0.000 0.052 0.744 0.136 0.068
#> GSM955072     2  0.7051     0.0641 0.000 0.416 0.412 0.048 0.124
#> GSM955075     3  0.4911    -0.5639 0.000 0.012 0.504 0.008 0.476
#> GSM955079     3  0.6150     0.4423 0.008 0.316 0.588 0.044 0.044
#> GSM955087     1  0.0854     0.8704 0.976 0.004 0.000 0.008 0.012
#> GSM955088     3  0.4479     0.1661 0.000 0.000 0.700 0.036 0.264
#> GSM955089     1  0.1673     0.8699 0.944 0.016 0.000 0.008 0.032
#> GSM955095     3  0.2597     0.5464 0.000 0.004 0.896 0.060 0.040
#> GSM955097     3  0.6214     0.2602 0.024 0.004 0.632 0.144 0.196
#> GSM955101     3  0.6157     0.3056 0.000 0.140 0.496 0.364 0.000
#> GSM954999     4  0.4499     0.5734 0.136 0.012 0.016 0.788 0.048
#> GSM955001     3  0.2907     0.4753 0.000 0.008 0.864 0.012 0.116
#> GSM955003     2  0.4575     0.5286 0.000 0.744 0.184 0.068 0.004
#> GSM955004     5  0.4171     0.6650 0.000 0.000 0.396 0.000 0.604
#> GSM955005     1  0.6753     0.3464 0.592 0.084 0.104 0.220 0.000
#> GSM955009     5  0.4736     0.6603 0.000 0.020 0.404 0.000 0.576
#> GSM955011     1  0.1299     0.8696 0.960 0.008 0.000 0.012 0.020
#> GSM955012     3  0.2052     0.5691 0.000 0.004 0.912 0.080 0.004
#> GSM955013     3  0.7316     0.4040 0.032 0.280 0.512 0.156 0.020
#> GSM955015     2  0.6660     0.1399 0.000 0.444 0.268 0.288 0.000
#> GSM955017     1  0.1377     0.8693 0.956 0.020 0.000 0.004 0.020
#> GSM955021     3  0.5385     0.4670 0.000 0.248 0.660 0.008 0.084
#> GSM955025     5  0.3491     0.5905 0.000 0.004 0.228 0.000 0.768
#> GSM955028     1  0.0854     0.8704 0.976 0.004 0.000 0.008 0.012
#> GSM955029     3  0.3488     0.3166 0.000 0.008 0.804 0.008 0.180
#> GSM955030     4  0.5477     0.3991 0.352 0.004 0.064 0.580 0.000
#> GSM955032     3  0.6426     0.2710 0.000 0.416 0.468 0.088 0.028
#> GSM955033     4  0.3199     0.6241 0.048 0.056 0.008 0.876 0.012
#> GSM955034     1  0.0968     0.8694 0.972 0.004 0.000 0.012 0.012
#> GSM955035     4  0.6258     0.1086 0.000 0.140 0.344 0.512 0.004
#> GSM955036     4  0.1441     0.6537 0.004 0.008 0.024 0.956 0.008
#> GSM955037     1  0.2349     0.8347 0.900 0.004 0.000 0.084 0.012
#> GSM955039     4  0.2681     0.6481 0.004 0.052 0.052 0.892 0.000
#> GSM955041     4  0.4800     0.2665 0.000 0.028 0.368 0.604 0.000
#> GSM955042     1  0.4642     0.7433 0.736 0.016 0.000 0.040 0.208
#> GSM955045     3  0.2177     0.5701 0.000 0.004 0.908 0.080 0.008
#> GSM955046     4  0.2054     0.6542 0.000 0.008 0.072 0.916 0.004
#> GSM955047     1  0.5474     0.6814 0.656 0.072 0.000 0.016 0.256
#> GSM955050     1  0.4602     0.7653 0.776 0.100 0.000 0.020 0.104
#> GSM955052     3  0.6207     0.4265 0.000 0.312 0.548 0.132 0.008
#> GSM955053     1  0.1299     0.8675 0.960 0.012 0.000 0.008 0.020
#> GSM955056     3  0.6266     0.4240 0.000 0.300 0.548 0.144 0.008
#> GSM955058     3  0.2953     0.3845 0.000 0.000 0.844 0.012 0.144
#> GSM955059     3  0.5999     0.4992 0.000 0.160 0.612 0.220 0.008
#> GSM955060     1  0.1200     0.8703 0.964 0.012 0.000 0.008 0.016
#> GSM955061     3  0.5091     0.2744 0.000 0.000 0.692 0.112 0.196
#> GSM955065     1  0.0968     0.8694 0.972 0.004 0.000 0.012 0.012
#> GSM955066     3  0.4958     0.5150 0.000 0.012 0.728 0.176 0.084
#> GSM955067     1  0.1403     0.8694 0.952 0.024 0.000 0.000 0.024
#> GSM955073     3  0.6564     0.2819 0.000 0.212 0.444 0.344 0.000
#> GSM955074     1  0.1800     0.8640 0.932 0.020 0.000 0.000 0.048
#> GSM955076     2  0.5433     0.5314 0.004 0.720 0.108 0.140 0.028
#> GSM955078     3  0.6413     0.2563 0.000 0.336 0.532 0.024 0.108
#> GSM955083     4  0.4783     0.5336 0.224 0.004 0.008 0.720 0.044
#> GSM955084     5  0.4171     0.6529 0.000 0.000 0.396 0.000 0.604
#> GSM955086     3  0.6408     0.4694 0.028 0.288 0.600 0.044 0.040
#> GSM955091     3  0.2872     0.5269 0.000 0.048 0.884 0.008 0.060
#> GSM955092     3  0.1300     0.5305 0.000 0.016 0.956 0.000 0.028
#> GSM955093     4  0.3683     0.6171 0.000 0.096 0.072 0.828 0.004
#> GSM955098     2  0.5697     0.1783 0.000 0.512 0.084 0.000 0.404
#> GSM955099     5  0.6633     0.3559 0.000 0.220 0.384 0.000 0.396
#> GSM955100     1  0.2178     0.8627 0.920 0.008 0.000 0.048 0.024
#> GSM955103     4  0.5594     0.0769 0.000 0.064 0.400 0.532 0.004
#> GSM955104     1  0.6528     0.5494 0.636 0.224 0.056 0.040 0.044
#> GSM955106     2  0.3506     0.5614 0.000 0.852 0.076 0.020 0.052
#> GSM955000     1  0.1173     0.8703 0.964 0.012 0.000 0.004 0.020
#> GSM955006     1  0.3361     0.8301 0.840 0.020 0.000 0.012 0.128
#> GSM955007     4  0.2956     0.6273 0.000 0.008 0.140 0.848 0.004
#> GSM955010     4  0.3321     0.6246 0.032 0.092 0.012 0.860 0.004
#> GSM955014     1  0.1280     0.8712 0.960 0.008 0.000 0.008 0.024
#> GSM955018     3  0.5028     0.4616 0.004 0.024 0.648 0.312 0.012
#> GSM955020     1  0.3223     0.8332 0.852 0.016 0.000 0.016 0.116
#> GSM955024     3  0.4039     0.5704 0.000 0.036 0.776 0.184 0.004
#> GSM955026     2  0.5993     0.2613 0.000 0.580 0.172 0.000 0.248
#> GSM955031     1  0.6566     0.4441 0.560 0.308 0.016 0.020 0.096
#> GSM955038     2  0.4938     0.4086 0.176 0.740 0.000 0.044 0.040
#> GSM955040     4  0.5780     0.4680 0.228 0.012 0.000 0.640 0.120
#> GSM955044     3  0.4037     0.3296 0.000 0.012 0.784 0.028 0.176
#> GSM955051     1  0.4660     0.7691 0.752 0.044 0.000 0.024 0.180
#> GSM955055     3  0.3631     0.2809 0.000 0.008 0.788 0.008 0.196
#> GSM955057     1  0.0324     0.8717 0.992 0.004 0.000 0.000 0.004
#> GSM955062     3  0.4010     0.5477 0.000 0.044 0.828 0.060 0.068
#> GSM955063     3  0.6124     0.4450 0.000 0.200 0.564 0.236 0.000
#> GSM955068     2  0.4665     0.4791 0.000 0.752 0.156 0.008 0.084
#> GSM955069     3  0.5819     0.1420 0.024 0.028 0.496 0.444 0.008
#> GSM955070     2  0.6970     0.0634 0.000 0.480 0.228 0.020 0.272
#> GSM955071     4  0.5747     0.2080 0.404 0.008 0.016 0.536 0.036
#> GSM955077     5  0.6344     0.2846 0.052 0.152 0.112 0.016 0.668
#> GSM955080     4  0.2765     0.6252 0.000 0.036 0.044 0.896 0.024
#> GSM955081     3  0.4900     0.5690 0.000 0.068 0.764 0.120 0.048
#> GSM955082     3  0.3031     0.4595 0.000 0.020 0.856 0.004 0.120
#> GSM955085     3  0.4194     0.0213 0.000 0.012 0.708 0.004 0.276
#> GSM955090     1  0.1461     0.8703 0.952 0.004 0.000 0.016 0.028
#> GSM955094     5  0.7913     0.2878 0.000 0.176 0.276 0.116 0.432
#> GSM955096     3  0.5335     0.4763 0.000 0.300 0.632 0.060 0.008
#> GSM955102     4  0.3490     0.6091 0.008 0.008 0.164 0.816 0.004
#> GSM955105     2  0.3514     0.5709 0.000 0.852 0.072 0.056 0.020

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM955002     4  0.6848     0.0702 0.000 0.036 0.312 0.376 0.004 0.272
#> GSM955008     2  0.3296     0.5896 0.000 0.860 0.040 0.052 0.028 0.020
#> GSM955016     1  0.6237    -0.0258 0.452 0.000 0.404 0.040 0.008 0.096
#> GSM955019     2  0.3136     0.4931 0.000 0.768 0.000 0.000 0.228 0.004
#> GSM955022     2  0.3065     0.5852 0.000 0.864 0.020 0.080 0.024 0.012
#> GSM955023     2  0.2252     0.5862 0.000 0.900 0.000 0.012 0.072 0.016
#> GSM955027     2  0.4331    -0.0413 0.000 0.540 0.004 0.004 0.444 0.008
#> GSM955043     5  0.4760     0.4574 0.000 0.372 0.008 0.004 0.584 0.032
#> GSM955048     1  0.0458     0.8397 0.984 0.000 0.000 0.000 0.000 0.016
#> GSM955049     2  0.2976     0.5842 0.000 0.872 0.004 0.048 0.048 0.028
#> GSM955054     2  0.3479     0.5736 0.000 0.836 0.004 0.088 0.044 0.028
#> GSM955064     2  0.4694     0.3577 0.000 0.636 0.044 0.000 0.308 0.012
#> GSM955072     4  0.7093     0.1719 0.000 0.100 0.020 0.456 0.316 0.108
#> GSM955075     5  0.4102     0.5283 0.000 0.164 0.004 0.000 0.752 0.080
#> GSM955079     2  0.2121     0.5938 0.000 0.916 0.004 0.032 0.040 0.008
#> GSM955087     1  0.0622     0.8378 0.980 0.000 0.008 0.000 0.000 0.012
#> GSM955088     2  0.5138     0.0179 0.000 0.520 0.020 0.000 0.416 0.044
#> GSM955089     1  0.1296     0.8381 0.948 0.000 0.004 0.004 0.000 0.044
#> GSM955095     2  0.4323     0.2273 0.000 0.600 0.020 0.004 0.376 0.000
#> GSM955097     5  0.6224     0.3658 0.016 0.144 0.048 0.028 0.652 0.112
#> GSM955101     2  0.3000     0.5771 0.000 0.824 0.156 0.004 0.016 0.000
#> GSM954999     3  0.4790     0.6237 0.116 0.004 0.752 0.044 0.008 0.076
#> GSM955001     5  0.4763     0.4284 0.000 0.388 0.004 0.016 0.572 0.020
#> GSM955003     2  0.5504     0.0532 0.000 0.536 0.016 0.384 0.024 0.040
#> GSM955004     5  0.3290     0.3752 0.000 0.044 0.000 0.004 0.820 0.132
#> GSM955005     1  0.7159     0.2012 0.488 0.224 0.188 0.084 0.012 0.004
#> GSM955009     5  0.3946     0.3851 0.000 0.076 0.000 0.004 0.768 0.152
#> GSM955011     1  0.1075     0.8352 0.952 0.000 0.000 0.000 0.000 0.048
#> GSM955012     2  0.3975     0.1529 0.000 0.600 0.000 0.000 0.392 0.008
#> GSM955013     2  0.5462     0.4836 0.008 0.708 0.024 0.140 0.080 0.040
#> GSM955015     2  0.5769     0.3793 0.000 0.616 0.148 0.204 0.008 0.024
#> GSM955017     1  0.1480     0.8324 0.940 0.000 0.000 0.020 0.000 0.040
#> GSM955021     2  0.4954     0.3470 0.000 0.644 0.004 0.072 0.272 0.008
#> GSM955025     5  0.4871    -0.2667 0.000 0.024 0.008 0.012 0.560 0.396
#> GSM955028     1  0.0363     0.8379 0.988 0.000 0.000 0.000 0.000 0.012
#> GSM955029     5  0.3899     0.4655 0.000 0.404 0.004 0.000 0.592 0.000
#> GSM955030     3  0.5576     0.2135 0.416 0.076 0.488 0.004 0.000 0.016
#> GSM955032     2  0.4753     0.4822 0.000 0.716 0.012 0.200 0.028 0.044
#> GSM955033     3  0.1994     0.6998 0.008 0.004 0.920 0.052 0.000 0.016
#> GSM955034     1  0.0405     0.8379 0.988 0.000 0.004 0.000 0.000 0.008
#> GSM955035     2  0.5781     0.3056 0.000 0.536 0.332 0.104 0.028 0.000
#> GSM955036     3  0.1067     0.7070 0.000 0.024 0.964 0.004 0.004 0.004
#> GSM955037     1  0.1926     0.8162 0.912 0.000 0.068 0.000 0.000 0.020
#> GSM955039     3  0.3024     0.7047 0.004 0.048 0.868 0.064 0.004 0.012
#> GSM955041     2  0.4076     0.3959 0.000 0.620 0.364 0.000 0.016 0.000
#> GSM955042     1  0.4189     0.7486 0.780 0.000 0.056 0.024 0.008 0.132
#> GSM955045     2  0.3452     0.4553 0.000 0.736 0.004 0.000 0.256 0.004
#> GSM955046     3  0.2115     0.7049 0.000 0.052 0.916 0.012 0.012 0.008
#> GSM955047     1  0.4260     0.3763 0.512 0.000 0.000 0.016 0.000 0.472
#> GSM955050     1  0.5528     0.5002 0.572 0.008 0.000 0.100 0.008 0.312
#> GSM955052     2  0.3384     0.5865 0.000 0.852 0.020 0.044 0.064 0.020
#> GSM955053     1  0.1477     0.8310 0.940 0.000 0.008 0.004 0.000 0.048
#> GSM955056     2  0.3660     0.5689 0.000 0.824 0.008 0.080 0.072 0.016
#> GSM955058     5  0.3699     0.5578 0.000 0.336 0.000 0.000 0.660 0.004
#> GSM955059     2  0.5138     0.5182 0.000 0.728 0.084 0.044 0.120 0.024
#> GSM955060     1  0.0937     0.8354 0.960 0.000 0.000 0.000 0.000 0.040
#> GSM955061     5  0.4035     0.5843 0.000 0.272 0.016 0.000 0.700 0.012
#> GSM955065     1  0.0000     0.8379 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM955066     2  0.7043     0.1984 0.000 0.456 0.152 0.016 0.304 0.072
#> GSM955067     1  0.1644     0.8317 0.932 0.000 0.000 0.028 0.000 0.040
#> GSM955073     2  0.3634     0.5564 0.000 0.792 0.168 0.024 0.008 0.008
#> GSM955074     1  0.3093     0.8013 0.852 0.000 0.004 0.044 0.008 0.092
#> GSM955076     4  0.5659     0.3720 0.000 0.100 0.052 0.696 0.044 0.108
#> GSM955078     2  0.6418    -0.0299 0.000 0.436 0.004 0.224 0.320 0.016
#> GSM955083     3  0.5623     0.5094 0.236 0.004 0.640 0.032 0.012 0.076
#> GSM955084     5  0.3679     0.3445 0.000 0.036 0.004 0.024 0.812 0.124
#> GSM955086     2  0.2557     0.5936 0.000 0.892 0.012 0.036 0.056 0.004
#> GSM955091     2  0.3390     0.3868 0.000 0.704 0.000 0.000 0.296 0.000
#> GSM955092     2  0.3351     0.4197 0.000 0.712 0.000 0.000 0.288 0.000
#> GSM955093     3  0.4354     0.6318 0.000 0.112 0.752 0.120 0.000 0.016
#> GSM955098     4  0.5840     0.0584 0.000 0.012 0.000 0.472 0.136 0.380
#> GSM955099     2  0.6825    -0.1127 0.000 0.416 0.004 0.060 0.352 0.168
#> GSM955100     1  0.2149     0.8179 0.900 0.000 0.080 0.004 0.000 0.016
#> GSM955103     2  0.4322     0.3610 0.000 0.600 0.372 0.000 0.028 0.000
#> GSM955104     1  0.6307     0.5608 0.640 0.116 0.012 0.132 0.016 0.084
#> GSM955106     4  0.5819     0.2665 0.000 0.268 0.004 0.560 0.012 0.156
#> GSM955000     1  0.1116     0.8371 0.960 0.000 0.004 0.008 0.000 0.028
#> GSM955006     1  0.3058     0.7971 0.836 0.000 0.016 0.008 0.004 0.136
#> GSM955007     3  0.3860     0.6108 0.000 0.152 0.784 0.008 0.052 0.004
#> GSM955010     3  0.2231     0.7049 0.008 0.020 0.912 0.048 0.000 0.012
#> GSM955014     1  0.1471     0.8380 0.932 0.000 0.004 0.000 0.000 0.064
#> GSM955018     2  0.4882     0.5378 0.012 0.732 0.100 0.012 0.136 0.008
#> GSM955020     1  0.3300     0.7858 0.816 0.000 0.008 0.020 0.004 0.152
#> GSM955024     2  0.4655     0.4575 0.000 0.688 0.032 0.016 0.252 0.012
#> GSM955026     4  0.7623    -0.1845 0.000 0.168 0.000 0.296 0.268 0.268
#> GSM955031     1  0.7233     0.2812 0.464 0.104 0.000 0.180 0.012 0.240
#> GSM955038     4  0.2799     0.3901 0.016 0.032 0.028 0.888 0.000 0.036
#> GSM955040     3  0.3357     0.6655 0.060 0.000 0.848 0.020 0.008 0.064
#> GSM955044     5  0.4031     0.5574 0.000 0.332 0.008 0.008 0.652 0.000
#> GSM955051     1  0.3593     0.7381 0.756 0.000 0.004 0.012 0.004 0.224
#> GSM955055     5  0.4146     0.5964 0.000 0.304 0.004 0.012 0.672 0.008
#> GSM955057     1  0.0000     0.8379 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM955062     2  0.3728     0.3036 0.000 0.652 0.004 0.000 0.344 0.000
#> GSM955063     2  0.3482     0.5918 0.000 0.832 0.088 0.004 0.060 0.016
#> GSM955068     4  0.5877     0.3227 0.000 0.040 0.008 0.624 0.180 0.148
#> GSM955069     2  0.7344     0.2416 0.060 0.488 0.284 0.028 0.116 0.024
#> GSM955070     2  0.8394    -0.4764 0.000 0.260 0.044 0.220 0.244 0.232
#> GSM955071     3  0.5387     0.1843 0.400 0.004 0.520 0.008 0.004 0.064
#> GSM955077     6  0.6087     0.1695 0.056 0.052 0.000 0.040 0.244 0.608
#> GSM955080     3  0.5017     0.6058 0.000 0.020 0.732 0.088 0.124 0.036
#> GSM955081     2  0.4821     0.4828 0.000 0.700 0.072 0.004 0.204 0.020
#> GSM955082     2  0.3853     0.3939 0.000 0.680 0.000 0.000 0.304 0.016
#> GSM955085     5  0.4291     0.5141 0.000 0.356 0.008 0.000 0.620 0.016
#> GSM955090     1  0.2118     0.8278 0.888 0.000 0.008 0.000 0.000 0.104
#> GSM955094     6  0.8583     0.1833 0.000 0.232 0.184 0.076 0.220 0.288
#> GSM955096     2  0.2555     0.5871 0.000 0.888 0.000 0.016 0.064 0.032
#> GSM955102     3  0.5132     0.5149 0.004 0.200 0.692 0.012 0.072 0.020
#> GSM955105     4  0.5805     0.2831 0.000 0.296 0.024 0.576 0.012 0.092

Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.

consensus_heatmap(res, k = 2)

plot of chunk tab-ATC-NMF-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-ATC-NMF-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-ATC-NMF-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-ATC-NMF-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-ATC-NMF-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-ATC-NMF-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-ATC-NMF-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-ATC-NMF-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-ATC-NMF-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-ATC-NMF-membership-heatmap-5

As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

plot of chunk tab-ATC-NMF-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-ATC-NMF-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-ATC-NMF-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-ATC-NMF-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-ATC-NMF-get-signatures-5

Signature heatmaps where rows are not scaled:

get_signatures(res, k = 2, scale_rows = FALSE)

plot of chunk tab-ATC-NMF-get-signatures-no-scale-1

get_signatures(res, k = 3, scale_rows = FALSE)

plot of chunk tab-ATC-NMF-get-signatures-no-scale-2

get_signatures(res, k = 4, scale_rows = FALSE)

plot of chunk tab-ATC-NMF-get-signatures-no-scale-3

get_signatures(res, k = 5, scale_rows = FALSE)

plot of chunk tab-ATC-NMF-get-signatures-no-scale-4

get_signatures(res, k = 6, scale_rows = FALSE)

plot of chunk tab-ATC-NMF-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk ATC-NMF-signature_compare

get_signature() returns a data frame invisibly. TO get the list of signatures, the function call should be assigned to a variable explicitly. In following code, if plot argument is set to FALSE, no heatmap is plotted while only the differential analysis is performed.

# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)

An example of the output of tb is:

#>   which_row         fdr    mean_1    mean_2 scaled_mean_1 scaled_mean_2 km
#> 1        38 0.042760348  8.373488  9.131774    -0.5533452     0.5164555  1
#> 2        40 0.018707592  7.106213  8.469186    -0.6173731     0.5762149  1
#> 3        55 0.019134737 10.221463 11.207825    -0.6159697     0.5749050  1
#> 4        59 0.006059896  5.921854  7.869574    -0.6899429     0.6439467  1
#> 5        60 0.018055526  8.928898 10.211722    -0.6204761     0.5791110  1
#> 6        98 0.009384629 15.714769 14.887706     0.6635654    -0.6193277  2
...

The columns in tb are:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. km: Row groups if k-means clustering is applied to rows.

UMAP plot which shows how samples are separated.

dimension_reduction(res, k = 2, method = "UMAP")

plot of chunk tab-ATC-NMF-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-ATC-NMF-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-ATC-NMF-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-ATC-NMF-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-ATC-NMF-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk ATC-NMF-collect-classes

Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.

test_to_known_factors(res)
#>           n genotype/variation(p) k
#> ATC:NMF 107                 0.305 2
#> ATC:NMF  94                 0.927 3
#> ATC:NMF  51                 0.792 4
#> ATC:NMF  56                 0.271 5
#> ATC:NMF  57                 0.059 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