cola Report for GDS3257

Date: 2019-12-25 20:40:24 CET, cola version: 1.3.2

Document is loading...


Summary

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

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

The call of run_all_consensus_partition_methods() was:

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

Dimension of the input matrix:

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

Density distribution

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

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

plot of chunk density-heatmap

Suggest the best k

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

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

suggest_best_k(res_list)
The best k 1-PAC Mean silhouette Concordance Optional k
SD:hclust 2 1.000 0.969 0.987 **
SD:kmeans 2 1.000 0.997 0.999 **
SD:skmeans 2 1.000 0.991 0.996 **
SD:pam 2 1.000 0.994 0.997 **
SD:mclust 2 1.000 0.995 0.998 **
SD:NMF 2 1.000 0.971 0.988 **
CV:hclust 2 1.000 0.971 0.988 **
CV:kmeans 2 1.000 0.995 0.998 **
CV:skmeans 2 1.000 0.991 0.996 **
CV:mclust 2 1.000 0.996 0.998 **
CV:NMF 2 1.000 0.972 0.988 **
MAD:hclust 2 1.000 0.976 0.988 **
MAD:kmeans 2 1.000 0.995 0.998 **
MAD:skmeans 2 1.000 0.987 0.994 **
MAD:pam 2 1.000 0.995 0.998 **
MAD:mclust 2 1.000 1.000 1.000 **
MAD:NMF 2 1.000 0.975 0.989 **
ATC:kmeans 2 1.000 0.975 0.990 **
ATC:NMF 2 1.000 0.989 0.996 **
ATC:mclust 6 0.988 0.945 0.970 **
ATC:skmeans 4 0.981 0.922 0.939 ** 2,3
ATC:pam 6 0.971 0.909 0.953 ** 2
CV:pam 3 0.919 0.932 0.967 * 2
ATC:hclust 4 0.832 0.872 0.924

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

CDF of consensus matrices

Cumulative distribution function curves of consensus matrix for all methods.

collect_plots(res_list, fun = plot_ecdf)

plot of chunk collect-plots

Consensus heatmap

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

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

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

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

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

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

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

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

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

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

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

Membership heatmap

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

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

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

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

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

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

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

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

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

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

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

Signature heatmap

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

Note in following heatmaps, rows are scaled.

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

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

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

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

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

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

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

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

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

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

Statistics table

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

get_stats(res_list, k = 2)
#>             k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> SD:NMF      2 1.000           0.971       0.988          0.504 0.497   0.497
#> CV:NMF      2 1.000           0.972       0.988          0.504 0.497   0.497
#> MAD:NMF     2 1.000           0.975       0.989          0.503 0.497   0.497
#> ATC:NMF     2 1.000           0.989       0.996          0.504 0.496   0.496
#> SD:skmeans  2 1.000           0.991       0.996          0.503 0.497   0.497
#> CV:skmeans  2 1.000           0.991       0.996          0.503 0.497   0.497
#> MAD:skmeans 2 1.000           0.987       0.994          0.502 0.499   0.499
#> ATC:skmeans 2 1.000           0.987       0.995          0.504 0.496   0.496
#> SD:mclust   2 1.000           0.995       0.998          0.496 0.505   0.505
#> CV:mclust   2 1.000           0.996       0.998          0.496 0.505   0.505
#> MAD:mclust  2 1.000           1.000       1.000          0.495 0.505   0.505
#> ATC:mclust  2 0.340           0.372       0.641          0.394 0.556   0.556
#> SD:kmeans   2 1.000           0.997       0.999          0.498 0.503   0.503
#> CV:kmeans   2 1.000           0.995       0.998          0.498 0.503   0.503
#> MAD:kmeans  2 1.000           0.995       0.998          0.498 0.503   0.503
#> ATC:kmeans  2 1.000           0.975       0.990          0.503 0.497   0.497
#> SD:pam      2 1.000           0.994       0.997          0.498 0.503   0.503
#> CV:pam      2 1.000           0.991       0.996          0.499 0.503   0.503
#> MAD:pam     2 1.000           0.995       0.998          0.498 0.503   0.503
#> ATC:pam     2 1.000           0.987       0.994          0.502 0.499   0.499
#> SD:hclust   2 1.000           0.969       0.987          0.498 0.501   0.501
#> CV:hclust   2 1.000           0.971       0.988          0.498 0.505   0.505
#> MAD:hclust  2 1.000           0.976       0.988          0.500 0.501   0.501
#> ATC:hclust  2 0.239           0.629       0.808          0.383 0.730   0.730
get_stats(res_list, k = 3)
#>             k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> SD:NMF      3 0.587           0.615       0.795          0.233 0.938   0.876
#> CV:NMF      3 0.601           0.632       0.811          0.239 0.935   0.871
#> MAD:NMF     3 0.618           0.632       0.804          0.229 0.962   0.924
#> ATC:NMF     3 0.887           0.898       0.955          0.318 0.759   0.549
#> SD:skmeans  3 0.844           0.909       0.944          0.261 0.857   0.716
#> CV:skmeans  3 0.819           0.842       0.889          0.270 0.862   0.725
#> MAD:skmeans 3 0.809           0.776       0.865          0.252 0.846   0.698
#> ATC:skmeans 3 0.990           0.960       0.978          0.299 0.810   0.631
#> SD:mclust   3 0.715           0.850       0.900          0.296 0.849   0.701
#> CV:mclust   3 0.781           0.847       0.918          0.300 0.846   0.695
#> MAD:mclust  3 0.755           0.828       0.896          0.267 0.859   0.721
#> ATC:mclust  3 0.698           0.873       0.864          0.637 0.591   0.371
#> SD:kmeans   3 0.692           0.873       0.863          0.286 0.835   0.675
#> CV:kmeans   3 0.646           0.694       0.759          0.282 0.828   0.662
#> MAD:kmeans  3 0.706           0.878       0.854          0.283 0.833   0.671
#> ATC:kmeans  3 0.716           0.743       0.812          0.266 0.816   0.646
#> SD:pam      3 0.900           0.898       0.957          0.280 0.855   0.714
#> CV:pam      3 0.919           0.932       0.967          0.272 0.860   0.723
#> MAD:pam     3 0.691           0.875       0.901          0.272 0.860   0.723
#> ATC:pam     3 0.698           0.876       0.930          0.239 0.886   0.773
#> SD:hclust   3 0.728           0.687       0.866          0.266 0.856   0.713
#> CV:hclust   3 0.655           0.757       0.843          0.265 0.849   0.701
#> MAD:hclust  3 0.620           0.618       0.794          0.232 0.928   0.856
#> ATC:hclust  3 0.637           0.768       0.882          0.610 0.621   0.501
get_stats(res_list, k = 4)
#>             k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> SD:NMF      4 0.653           0.603       0.793         0.1420 0.809   0.586
#> CV:NMF      4 0.670           0.703       0.835         0.1397 0.822   0.608
#> MAD:NMF     4 0.626           0.735       0.843         0.1343 0.813   0.609
#> ATC:NMF     4 0.586           0.563       0.765         0.1144 0.794   0.489
#> SD:skmeans  4 0.699           0.752       0.779         0.1159 0.892   0.709
#> CV:skmeans  4 0.684           0.779       0.798         0.1217 0.882   0.688
#> MAD:skmeans 4 0.648           0.554       0.738         0.1266 0.878   0.688
#> ATC:skmeans 4 0.981           0.922       0.939         0.1473 0.870   0.639
#> SD:mclust   4 0.602           0.363       0.695         0.0794 0.886   0.717
#> CV:mclust   4 0.577           0.545       0.769         0.0889 0.974   0.927
#> MAD:mclust  4 0.650           0.571       0.773         0.1174 0.930   0.817
#> ATC:mclust  4 0.702           0.758       0.806         0.0764 0.763   0.466
#> SD:kmeans   4 0.649           0.515       0.710         0.1263 0.972   0.921
#> CV:kmeans   4 0.622           0.544       0.742         0.1312 0.856   0.629
#> MAD:kmeans  4 0.613           0.579       0.785         0.1298 0.920   0.776
#> ATC:kmeans  4 0.811           0.850       0.911         0.1491 0.888   0.696
#> SD:pam      4 0.761           0.820       0.898         0.1379 0.893   0.712
#> CV:pam      4 0.783           0.859       0.917         0.1450 0.891   0.711
#> MAD:pam     4 0.717           0.795       0.891         0.1589 0.882   0.690
#> ATC:pam     4 0.882           0.885       0.952         0.1439 0.863   0.667
#> SD:hclust   4 0.586           0.599       0.746         0.1015 0.891   0.726
#> CV:hclust   4 0.613           0.640       0.731         0.1289 0.898   0.729
#> MAD:hclust  4 0.569           0.520       0.753         0.1384 0.822   0.603
#> ATC:hclust  4 0.832           0.872       0.924         0.1296 0.905   0.767
get_stats(res_list, k = 5)
#>             k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> SD:NMF      5 0.716           0.690       0.833         0.0496 0.904   0.714
#> CV:NMF      5 0.735           0.719       0.850         0.0502 0.921   0.753
#> MAD:NMF     5 0.675           0.647       0.763         0.0665 0.838   0.562
#> ATC:NMF     5 0.715           0.690       0.841         0.0469 0.888   0.632
#> SD:skmeans  5 0.669           0.555       0.739         0.0785 0.868   0.572
#> CV:skmeans  5 0.679           0.736       0.811         0.0817 0.868   0.563
#> MAD:skmeans 5 0.666           0.588       0.760         0.0765 0.867   0.586
#> ATC:skmeans 5 0.843           0.837       0.906         0.0581 0.899   0.632
#> SD:mclust   5 0.714           0.801       0.867         0.0829 0.813   0.515
#> CV:mclust   5 0.801           0.808       0.885         0.0898 0.888   0.674
#> MAD:mclust  5 0.624           0.454       0.747         0.0859 0.919   0.762
#> ATC:mclust  5 0.740           0.634       0.768         0.0757 0.877   0.640
#> SD:kmeans   5 0.642           0.560       0.709         0.0736 0.823   0.496
#> CV:kmeans   5 0.623           0.664       0.725         0.0741 0.840   0.504
#> MAD:kmeans  5 0.652           0.584       0.745         0.0719 0.894   0.652
#> ATC:kmeans  5 0.746           0.613       0.757         0.0753 0.958   0.847
#> SD:pam      5 0.767           0.729       0.871         0.0409 0.975   0.909
#> CV:pam      5 0.770           0.785       0.887         0.0371 0.977   0.919
#> MAD:pam     5 0.726           0.740       0.850         0.0403 0.970   0.892
#> ATC:pam     5 0.826           0.863       0.914         0.0618 0.910   0.723
#> SD:hclust   5 0.610           0.593       0.704         0.0654 0.969   0.908
#> CV:hclust   5 0.614           0.394       0.636         0.0622 0.825   0.501
#> MAD:hclust  5 0.591           0.527       0.720         0.0770 0.889   0.638
#> ATC:hclust  5 0.800           0.789       0.859         0.1063 0.913   0.722
get_stats(res_list, k = 6)
#>             k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> SD:NMF      6 0.746           0.675       0.826         0.0400 0.959   0.858
#> CV:NMF      6 0.740           0.681       0.829         0.0385 0.968   0.886
#> MAD:NMF     6 0.705           0.629       0.801         0.0463 0.929   0.748
#> ATC:NMF     6 0.643           0.446       0.683         0.0413 0.891   0.587
#> SD:skmeans  6 0.660           0.597       0.756         0.0512 0.922   0.674
#> CV:skmeans  6 0.687           0.663       0.782         0.0410 0.926   0.678
#> MAD:skmeans 6 0.651           0.641       0.771         0.0491 0.941   0.741
#> ATC:skmeans 6 0.818           0.772       0.883         0.0285 0.968   0.846
#> SD:mclust   6 0.715           0.715       0.800         0.0521 0.958   0.829
#> CV:mclust   6 0.703           0.683       0.793         0.0335 0.975   0.895
#> MAD:mclust  6 0.661           0.478       0.734         0.0437 0.877   0.580
#> ATC:mclust  6 0.988           0.945       0.970         0.1121 0.831   0.424
#> SD:kmeans   6 0.645           0.526       0.729         0.0425 0.917   0.672
#> CV:kmeans   6 0.640           0.552       0.716         0.0444 0.943   0.744
#> MAD:kmeans  6 0.641           0.489       0.701         0.0498 0.934   0.727
#> ATC:kmeans  6 0.771           0.755       0.796         0.0475 0.889   0.583
#> SD:pam      6 0.674           0.523       0.736         0.0561 0.953   0.819
#> CV:pam      6 0.685           0.486       0.724         0.0563 0.934   0.755
#> MAD:pam     6 0.701           0.581       0.760         0.0445 0.952   0.813
#> ATC:pam     6 0.971           0.909       0.953         0.0763 0.920   0.696
#> SD:hclust   6 0.632           0.473       0.687         0.0514 0.919   0.755
#> CV:hclust   6 0.673           0.503       0.699         0.0424 0.885   0.559
#> MAD:hclust  6 0.635           0.577       0.721         0.0427 0.925   0.692
#> ATC:hclust  6 0.785           0.748       0.837         0.0413 0.985   0.935

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

collect_stats(res_list, k = 2)

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

collect_stats(res_list, k = 3)

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

collect_stats(res_list, k = 4)

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

collect_stats(res_list, k = 5)

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

collect_stats(res_list, k = 6)

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

Partition from all methods

Collect partitions from all methods:

collect_classes(res_list, k = 2)

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

collect_classes(res_list, k = 3)

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

collect_classes(res_list, k = 4)

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

collect_classes(res_list, k = 5)

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

collect_classes(res_list, k = 6)

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

Top rows overlap

Overlap of top rows from different top-row methods:

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Heatmaps of the top rows:

top_rows_heatmap(res_list, top_n = 1000)

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

top_rows_heatmap(res_list, top_n = 2000)

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

top_rows_heatmap(res_list, top_n = 3000)

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

top_rows_heatmap(res_list, top_n = 4000)

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

top_rows_heatmap(res_list, top_n = 5000)

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

Test to known annotations

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

test_to_known_factors(res_list, k = 2)
#>               n tissue(p) individual(p) disease.state(p) gender(p) other(p) k
#> SD:NMF      106  3.87e-23         0.515            0.690     0.697    1.000 2
#> CV:NMF      106  3.87e-23         0.515            0.690     0.697    1.000 2
#> MAD:NMF     107  2.35e-23         0.555            0.665     0.611    0.958 2
#> ATC:NMF     106  1.55e-21         0.413            0.571     0.751    0.997 2
#> SD:skmeans  107  2.35e-23         0.555            0.665     0.611    0.958 2
#> CV:skmeans  107  2.35e-23         0.555            0.665     0.611    0.958 2
#> MAD:skmeans 107  3.34e-24         0.644            0.777     0.441    1.000 2
#> ATC:skmeans 106  2.52e-22         0.413            0.571     0.595    0.997 2
#> SD:mclust   107  1.00e-21         0.640            0.454     0.733    0.961 2
#> CV:mclust   107  1.00e-21         0.640            0.454     0.733    0.961 2
#> MAD:mclust  107  1.00e-21         0.640            0.454     0.733    0.961 2
#> ATC:mclust    0        NA            NA               NA        NA       NA 2
#> SD:kmeans   107  1.59e-22         0.777            0.577     0.628    0.872 2
#> CV:kmeans   107  1.59e-22         0.777            0.577     0.628    0.872 2
#> MAD:kmeans  107  1.59e-22         0.777            0.577     0.628    0.872 2
#> ATC:kmeans  106  1.78e-21         0.453            0.489     0.697    0.730 2
#> SD:pam      107  1.59e-22         0.777            0.577     0.628    0.872 2
#> CV:pam      107  1.59e-22         0.777            0.577     0.628    0.872 2
#> MAD:pam     107  1.59e-22         0.777            0.577     0.628    0.872 2
#> ATC:pam     106  3.92e-23         0.588            0.614     0.401    0.814 2
#> SD:hclust   105  6.63e-23         0.681            0.534     0.639    1.000 2
#> CV:hclust   105  6.63e-23         0.681            0.534     0.639    1.000 2
#> MAD:hclust  106  5.55e-24         0.696            0.705     0.487    1.000 2
#> ATC:hclust   97  2.04e-04         0.335            0.382     0.351    0.902 2
test_to_known_factors(res_list, k = 3)
#>               n tissue(p) individual(p) disease.state(p) gender(p) other(p) k
#> SD:NMF       84  4.25e-18       0.24703           0.6084   0.75527    0.753 3
#> CV:NMF       87  8.02e-20       0.18268           0.6543   0.93957    1.000 3
#> MAD:NMF      87  8.02e-20       0.24627           0.7842   0.71288    1.000 3
#> ATC:NMF     103  1.53e-17       0.27787           0.4130   0.51953    0.119 3
#> SD:skmeans  105  1.05e-22       0.00281           0.6365   0.00518    0.930 3
#> CV:skmeans  104  1.74e-22       0.00150           0.6831   0.00907    0.947 3
#> MAD:skmeans 100  1.93e-22       0.00147           0.4031   0.01113    0.653 3
#> ATC:skmeans 106  2.97e-21       0.12316           0.3880   0.85428    0.416 3
#> SD:mclust   100  3.17e-20       0.02926           0.4981   0.05616    0.846 3
#> CV:mclust    99  1.14e-20       0.00566           0.5108   0.03398    0.779 3
#> MAD:mclust  103  6.81e-21       0.01678           0.5750   0.37052    0.962 3
#> ATC:mclust  104  4.76e-20       0.02886           0.9024   0.62535    0.934 3
#> SD:kmeans   105  6.36e-22       0.00199           0.5418   0.10573    0.892 3
#> CV:kmeans    98  2.05e-20       0.00176           0.5573   0.11778    0.628 3
#> MAD:kmeans  105  6.36e-22       0.00199           0.5418   0.10573    0.892 3
#> ATC:kmeans   95  1.67e-20       0.24226           0.7880   0.74800    0.912 3
#> SD:pam       99  1.41e-20       0.00669           0.1502   0.34863    0.175 3
#> CV:pam      106  2.95e-21       0.01026           0.0912   0.55101    0.237 3
#> MAD:pam     104  1.20e-21       0.03217           0.3190   0.44097    0.191 3
#> ATC:pam     101  5.30e-21       0.10018           0.7065   0.16016    0.524 3
#> SD:hclust    80  3.07e-17       0.17418           0.2800   0.36470    0.229 3
#> CV:hclust    96  9.84e-21       0.44144           0.6636   0.53269    1.000 3
#> MAD:hclust   88  7.78e-20       0.63507           0.3720   0.36788    0.239 3
#> ATC:hclust   89  4.72e-20       0.52829           0.6632   0.28636    0.875 3
test_to_known_factors(res_list, k = 4)
#>               n tissue(p) individual(p) disease.state(p) gender(p) other(p) k
#> SD:NMF       77  1.90e-17      0.050079            0.405   0.35719   0.1803 4
#> CV:NMF       86  4.26e-18      0.031503            0.471   0.18106   0.1032 4
#> MAD:NMF      95  1.10e-19      0.656859            0.596   0.45585   0.8984 4
#> ATC:NMF      77  1.91e-12      0.041585            0.760   0.86172   0.4877 4
#> SD:skmeans   98  4.18e-21      0.006039            0.814   0.01322   0.9776 4
#> CV:skmeans  100  1.55e-21      0.018320            0.790   0.03269   0.9747 4
#> MAD:skmeans  84  4.25e-18      0.005616            0.763   0.00814   0.9944 4
#> ATC:skmeans 102  9.68e-19      0.228909            0.837   0.97481   0.9254 4
#> SD:mclust    64  1.62e-13      0.135147            0.486   0.02788   1.0000 4
#> CV:mclust    81  1.13e-15      0.006318            0.683   0.24848   0.7787 4
#> MAD:mclust   91  2.36e-17      0.020502            0.603   0.34462   0.7308 4
#> ATC:mclust  103  1.07e-19      0.055709            0.855   0.58302   0.7853 4
#> SD:kmeans    58  3.26e-01      0.000295            0.397   0.10403   1.0000 4
#> CV:kmeans    88  2.46e-17      0.010846            0.852   0.22383   0.9812 4
#> MAD:kmeans   83  3.11e-16      0.002148            0.925   0.16486   0.9220 4
#> ATC:kmeans   98  2.86e-20      0.179829            0.766   0.33008   0.9842 4
#> SD:pam       99  1.75e-20      0.002891            0.437   0.19003   0.5229 4
#> CV:pam      103  2.47e-21      0.011583            0.393   0.29101   0.6122 4
#> MAD:pam     104  9.35e-21      0.011851            0.557   0.22580   0.4115 4
#> ATC:pam     105  2.38e-19      0.137330            0.820   0.66636   0.8179 4
#> SD:hclust    74  4.48e-15      0.235779            0.157   0.09348   0.0368 4
#> CV:hclust    93  4.97e-20      0.035926            0.655   0.06588   0.7549 4
#> MAD:hclust   77  1.35e-16      0.601905            0.483   0.53356   0.3495 4
#> ATC:hclust  101  9.47e-22      0.245262            0.798   0.35947   0.8840 4
test_to_known_factors(res_list, k = 5)
#>               n tissue(p) individual(p) disease.state(p) gender(p) other(p) k
#> SD:NMF       89  3.59e-19       0.01234           0.2022  0.217422   0.0452 5
#> CV:NMF       92  4.95e-19       0.04683           0.1887  0.210627   0.0426 5
#> MAD:NMF      84  2.47e-17       0.00724           0.6168  0.023880   0.5171 5
#> ATC:NMF      96  1.01e-13       0.02181           0.5691  0.621644   0.4389 5
#> SD:skmeans   71  2.61e-15       0.00587           0.6660  0.001926   0.9276 5
#> CV:skmeans   95  1.14e-19       0.00388           0.8053  0.011618   0.9630 5
#> MAD:skmeans  80  1.74e-16       0.01080           0.6031  0.000863   0.5815 5
#> ATC:skmeans 103  4.58e-19       0.29641           0.7362  0.438062   0.5036 5
#> SD:mclust   101  1.01e-18       0.02609           0.6612  0.402826   0.4632 5
#> CV:mclust    99  2.89e-18       0.00570           0.6342  0.247974   0.4468 5
#> MAD:mclust   50  5.13e-09       0.45487           0.8123  0.580092   0.8671 5
#> ATC:mclust   84  1.59e-16       0.00674           0.9627  0.994172   0.9575 5
#> SD:kmeans    71  4.63e-13       0.02933           0.3506  0.215170   0.2947 5
#> CV:kmeans    89  7.24e-17       0.06638           0.3153  0.093737   0.3110 5
#> MAD:kmeans   80  6.50e-15       0.00493           0.5000  0.104329   0.5658 5
#> ATC:kmeans   81  1.07e-16       0.23307           0.6389  0.213487   0.9708 5
#> SD:pam       95  7.61e-19       0.01689           0.6627  0.199015   0.4411 5
#> CV:pam       98  1.77e-19       0.11249           0.8318  0.202478   0.5107 5
#> MAD:pam     101  2.46e-19       0.06629           0.7365  0.204403   0.3037 5
#> ATC:pam     104  2.85e-19       0.10669           0.5816  0.478786   0.6017 5
#> SD:hclust    74  4.28e-15       0.26381           0.0754  0.066574   0.0200 5
#> CV:hclust    50  3.61e-10       0.02833           0.8340  0.035004   0.6843 5
#> MAD:hclust   63  6.79e-13       0.02725           0.7794  0.898083   0.5140 5
#> ATC:hclust   99  1.61e-20       0.07531           0.7759  0.089036   0.7177 5
test_to_known_factors(res_list, k = 6)
#>               n tissue(p) individual(p) disease.state(p) gender(p) other(p) k
#> SD:NMF       84  4.25e-18       0.01192            0.267    0.1488   0.0634 6
#> CV:NMF       84  4.25e-18       0.01583            0.135    0.0943   0.0222 6
#> MAD:NMF      77  1.35e-16       0.00210            0.407    0.0513   0.1415 6
#> ATC:NMF      55  5.42e-10       0.03289            0.609    0.1322   0.5642 6
#> SD:skmeans   80  8.39e-16       0.08953            0.294    0.1093   0.3797 6
#> CV:skmeans   88  1.77e-17       0.00815            0.708    0.0490   0.9425 6
#> MAD:skmeans  90  6.72e-18       0.01369            0.697    0.1038   0.8189 6
#> ATC:skmeans  94  2.87e-17       0.13218            0.525    0.2666   0.5972 6
#> SD:mclust    95  2.62e-17       0.00567            0.706    0.4174   0.5024 6
#> CV:mclust    92  4.88e-17       0.03193            0.913    0.2926   0.5595 6
#> MAD:mclust   69  3.14e-12       0.26325            0.491    0.4200   0.6933 6
#> ATC:mclust  106  1.18e-19       0.01011            0.851    0.8348   0.6523 6
#> SD:kmeans    75  8.90e-14       0.00304            0.252    0.0854   0.2004 6
#> CV:kmeans    78  6.98e-14       0.02658            0.352    0.2971   0.2461 6
#> MAD:kmeans   72  3.80e-13       0.00516            0.298    0.0750   0.2621 6
#> ATC:kmeans  100  1.54e-18       0.14248            0.604    0.1540   0.6607 6
#> SD:pam       78  3.07e-15       0.00155            0.835    0.3500   0.6915 6
#> CV:pam       59  3.31e-11       0.00860            0.925    0.3955   0.6820 6
#> MAD:pam      79  7.62e-14       0.09848            0.652    0.2252   0.3449 6
#> ATC:pam     103  3.20e-18       0.18254            0.318    0.4733   0.8667 6
#> SD:hclust    52  3.58e-11       0.08475            0.639    0.0237   0.3586 6
#> CV:hclust    70  6.25e-13       0.07229            0.768    0.0666   0.7165 6
#> MAD:hclust   74  1.50e-14       0.03700            0.705    0.1793   0.6864 6
#> ATC:hclust   97  4.28e-20       0.09839            0.768    0.0864   0.7717 6

Results for each method


SD:hclust**

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

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

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

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

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

collect_plots(res)

plot of chunk SD-hclust-collect-plots

The plots are:

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

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

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

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

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 1.000           0.969       0.987         0.4979 0.501   0.501
#> 3 3 0.728           0.687       0.866         0.2665 0.856   0.713
#> 4 4 0.586           0.599       0.746         0.1015 0.891   0.726
#> 5 5 0.610           0.593       0.704         0.0654 0.969   0.908
#> 6 6 0.632           0.473       0.687         0.0514 0.919   0.755

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
#> GSM254629     1  0.0672      0.989 0.992 0.008
#> GSM254648     1  0.1184      0.983 0.984 0.016
#> GSM254694     1  0.0938      0.987 0.988 0.012
#> GSM254701     1  0.0672      0.989 0.992 0.008
#> GSM254728     1  0.0672      0.989 0.992 0.008
#> GSM254726     1  0.1414      0.980 0.980 0.020
#> GSM254639     1  0.0672      0.989 0.992 0.008
#> GSM254652     1  0.0672      0.989 0.992 0.008
#> GSM254700     1  0.0000      0.991 1.000 0.000
#> GSM254625     1  0.0938      0.987 0.988 0.012
#> GSM254636     1  0.0000      0.991 1.000 0.000
#> GSM254659     1  0.0672      0.989 0.992 0.008
#> GSM254680     1  0.0000      0.991 1.000 0.000
#> GSM254686     1  0.0672      0.989 0.992 0.008
#> GSM254718     1  0.0938      0.987 0.988 0.012
#> GSM254674     1  0.0000      0.991 1.000 0.000
#> GSM254668     1  0.0000      0.991 1.000 0.000
#> GSM254697     1  0.0000      0.991 1.000 0.000
#> GSM254704     1  0.0000      0.991 1.000 0.000
#> GSM254707     1  0.0000      0.991 1.000 0.000
#> GSM254714     1  0.0000      0.991 1.000 0.000
#> GSM254722     1  0.0000      0.991 1.000 0.000
#> GSM254627     1  0.0000      0.991 1.000 0.000
#> GSM254630     1  0.0672      0.989 0.992 0.008
#> GSM254633     1  0.0000      0.991 1.000 0.000
#> GSM254670     1  0.0672      0.989 0.992 0.008
#> GSM254716     1  0.0672      0.989 0.992 0.008
#> GSM254720     1  0.0376      0.990 0.996 0.004
#> GSM254729     1  0.0938      0.987 0.988 0.012
#> GSM254654     1  0.0938      0.987 0.988 0.012
#> GSM254656     1  0.6623      0.796 0.828 0.172
#> GSM254631     1  0.0000      0.991 1.000 0.000
#> GSM254657     1  0.0672      0.989 0.992 0.008
#> GSM254664     1  0.0000      0.991 1.000 0.000
#> GSM254672     1  0.0000      0.991 1.000 0.000
#> GSM254692     1  0.0000      0.991 1.000 0.000
#> GSM254645     1  0.0672      0.989 0.992 0.008
#> GSM254666     1  0.0672      0.989 0.992 0.008
#> GSM254675     1  0.0000      0.991 1.000 0.000
#> GSM254678     1  0.0000      0.991 1.000 0.000
#> GSM254688     1  0.0000      0.991 1.000 0.000
#> GSM254690     1  0.0000      0.991 1.000 0.000
#> GSM254696     1  0.0000      0.991 1.000 0.000
#> GSM254705     1  0.0000      0.991 1.000 0.000
#> GSM254642     1  0.0000      0.991 1.000 0.000
#> GSM254661     1  0.0672      0.989 0.992 0.008
#> GSM254698     1  0.0000      0.991 1.000 0.000
#> GSM254641     1  0.0000      0.991 1.000 0.000
#> GSM254647     1  0.0000      0.991 1.000 0.000
#> GSM254663     1  0.0000      0.991 1.000 0.000
#> GSM254682     1  0.0000      0.991 1.000 0.000
#> GSM254709     1  0.0376      0.990 0.996 0.004
#> GSM254721     1  0.0000      0.991 1.000 0.000
#> GSM254724     1  0.0000      0.991 1.000 0.000
#> GSM254650     1  0.0000      0.991 1.000 0.000
#> GSM254687     1  0.0000      0.991 1.000 0.000
#> GSM254637     1  0.0000      0.991 1.000 0.000
#> GSM254684     1  0.0000      0.991 1.000 0.000
#> GSM254649     2  0.0000      0.980 0.000 1.000
#> GSM254660     2  0.0000      0.980 0.000 1.000
#> GSM254693     2  0.0000      0.980 0.000 1.000
#> GSM254695     2  0.2423      0.942 0.040 0.960
#> GSM254702     2  0.0000      0.980 0.000 1.000
#> GSM254643     2  0.0000      0.980 0.000 1.000
#> GSM254727     2  0.0000      0.980 0.000 1.000
#> GSM254640     2  0.0000      0.980 0.000 1.000
#> GSM254626     2  0.0000      0.980 0.000 1.000
#> GSM254635     2  0.0000      0.980 0.000 1.000
#> GSM254653     2  0.0000      0.980 0.000 1.000
#> GSM254658     2  0.0000      0.980 0.000 1.000
#> GSM254681     2  0.0000      0.980 0.000 1.000
#> GSM254719     2  0.0000      0.980 0.000 1.000
#> GSM254673     2  0.0000      0.980 0.000 1.000
#> GSM254655     2  0.0000      0.980 0.000 1.000
#> GSM254669     2  0.0000      0.980 0.000 1.000
#> GSM254699     2  0.0000      0.980 0.000 1.000
#> GSM254703     2  0.0000      0.980 0.000 1.000
#> GSM254708     2  0.0000      0.980 0.000 1.000
#> GSM254715     2  0.0000      0.980 0.000 1.000
#> GSM254628     2  0.0000      0.980 0.000 1.000
#> GSM254634     2  0.0000      0.980 0.000 1.000
#> GSM254646     2  0.0000      0.980 0.000 1.000
#> GSM254671     2  0.0000      0.980 0.000 1.000
#> GSM254711     2  0.0000      0.980 0.000 1.000
#> GSM254717     2  0.0000      0.980 0.000 1.000
#> GSM254723     1  0.5737      0.846 0.864 0.136
#> GSM254730     2  0.0000      0.980 0.000 1.000
#> GSM254731     2  0.0000      0.980 0.000 1.000
#> GSM254632     2  0.9815      0.276 0.420 0.580
#> GSM254662     2  0.0000      0.980 0.000 1.000
#> GSM254677     2  0.0000      0.980 0.000 1.000
#> GSM254665     2  0.0000      0.980 0.000 1.000
#> GSM254691     2  0.0000      0.980 0.000 1.000
#> GSM254644     2  0.0000      0.980 0.000 1.000
#> GSM254667     2  0.1414      0.962 0.020 0.980
#> GSM254676     2  0.0000      0.980 0.000 1.000
#> GSM254679     2  0.0000      0.980 0.000 1.000
#> GSM254689     2  0.0000      0.980 0.000 1.000
#> GSM254706     2  0.0000      0.980 0.000 1.000
#> GSM254712     2  0.0000      0.980 0.000 1.000
#> GSM254713     2  0.0000      0.980 0.000 1.000
#> GSM254683     2  0.0000      0.980 0.000 1.000
#> GSM254710     2  0.9815      0.276 0.420 0.580
#> GSM254725     2  0.0000      0.980 0.000 1.000
#> GSM254651     2  0.0000      0.980 0.000 1.000
#> GSM254638     2  0.0000      0.980 0.000 1.000
#> GSM254685     2  0.0000      0.980 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
#> GSM254629     3  0.1289   0.701331 0.032 0.000 0.968
#> GSM254648     3  0.1711   0.701786 0.032 0.008 0.960
#> GSM254694     3  0.2200   0.698980 0.056 0.004 0.940
#> GSM254701     3  0.1289   0.701331 0.032 0.000 0.968
#> GSM254728     3  0.2625   0.700065 0.084 0.000 0.916
#> GSM254726     3  0.2339   0.700373 0.048 0.012 0.940
#> GSM254639     3  0.4887   0.565119 0.228 0.000 0.772
#> GSM254652     3  0.1753   0.705201 0.048 0.000 0.952
#> GSM254700     1  0.0747   0.618480 0.984 0.000 0.016
#> GSM254625     3  0.1267   0.695144 0.024 0.004 0.972
#> GSM254636     1  0.6305   0.161769 0.516 0.000 0.484
#> GSM254659     3  0.2796   0.686711 0.092 0.000 0.908
#> GSM254680     1  0.6308   0.172571 0.508 0.000 0.492
#> GSM254686     3  0.0424   0.692359 0.008 0.000 0.992
#> GSM254718     3  0.3030   0.700997 0.092 0.004 0.904
#> GSM254674     3  0.5968   0.315408 0.364 0.000 0.636
#> GSM254668     3  0.5733   0.361944 0.324 0.000 0.676
#> GSM254697     1  0.0747   0.620601 0.984 0.000 0.016
#> GSM254704     1  0.0747   0.618480 0.984 0.000 0.016
#> GSM254707     3  0.4750   0.563001 0.216 0.000 0.784
#> GSM254714     1  0.5621   0.499809 0.692 0.000 0.308
#> GSM254722     1  0.4702   0.598676 0.788 0.000 0.212
#> GSM254627     1  0.0747   0.620601 0.984 0.000 0.016
#> GSM254630     3  0.2165   0.699778 0.064 0.000 0.936
#> GSM254633     3  0.6291  -0.078099 0.468 0.000 0.532
#> GSM254670     3  0.4887   0.565119 0.228 0.000 0.772
#> GSM254716     3  0.0424   0.692359 0.008 0.000 0.992
#> GSM254720     3  0.6267   0.058942 0.452 0.000 0.548
#> GSM254729     3  0.2301   0.697718 0.060 0.004 0.936
#> GSM254654     3  0.1525   0.701795 0.032 0.004 0.964
#> GSM254656     3  0.8026   0.390417 0.180 0.164 0.656
#> GSM254631     1  0.6308   0.172571 0.508 0.000 0.492
#> GSM254657     3  0.3551   0.673583 0.132 0.000 0.868
#> GSM254664     1  0.6308   0.172571 0.508 0.000 0.492
#> GSM254672     1  0.3752   0.616430 0.856 0.000 0.144
#> GSM254692     1  0.5058   0.488647 0.756 0.000 0.244
#> GSM254645     3  0.4750   0.582234 0.216 0.000 0.784
#> GSM254666     3  0.2165   0.695841 0.064 0.000 0.936
#> GSM254675     1  0.5926   0.440278 0.644 0.000 0.356
#> GSM254678     1  0.6008   0.434739 0.628 0.000 0.372
#> GSM254688     3  0.5138   0.519241 0.252 0.000 0.748
#> GSM254690     1  0.6252   0.291481 0.556 0.000 0.444
#> GSM254696     3  0.6307  -0.113550 0.488 0.000 0.512
#> GSM254705     3  0.6299  -0.014690 0.476 0.000 0.524
#> GSM254642     1  0.0747   0.620601 0.984 0.000 0.016
#> GSM254661     3  0.1643   0.703354 0.044 0.000 0.956
#> GSM254698     1  0.4702   0.598676 0.788 0.000 0.212
#> GSM254641     3  0.5591   0.438972 0.304 0.000 0.696
#> GSM254647     1  0.6126   0.357385 0.600 0.000 0.400
#> GSM254663     3  0.5650   0.424471 0.312 0.000 0.688
#> GSM254682     3  0.5591   0.430718 0.304 0.000 0.696
#> GSM254709     3  0.6192   0.196784 0.420 0.000 0.580
#> GSM254721     1  0.0892   0.620772 0.980 0.000 0.020
#> GSM254724     1  0.0747   0.618480 0.984 0.000 0.016
#> GSM254650     3  0.6180   0.176102 0.416 0.000 0.584
#> GSM254687     3  0.6295   0.000619 0.472 0.000 0.528
#> GSM254637     1  0.6308   0.172571 0.508 0.000 0.492
#> GSM254684     1  0.6307   0.134112 0.512 0.000 0.488
#> GSM254649     2  0.0000   0.976963 0.000 1.000 0.000
#> GSM254660     2  0.0000   0.976963 0.000 1.000 0.000
#> GSM254693     2  0.0000   0.976963 0.000 1.000 0.000
#> GSM254695     2  0.2173   0.931461 0.008 0.944 0.048
#> GSM254702     2  0.0000   0.976963 0.000 1.000 0.000
#> GSM254643     2  0.0000   0.976963 0.000 1.000 0.000
#> GSM254727     2  0.0000   0.976963 0.000 1.000 0.000
#> GSM254640     2  0.0424   0.974745 0.008 0.992 0.000
#> GSM254626     2  0.0000   0.976963 0.000 1.000 0.000
#> GSM254635     2  0.0424   0.974745 0.008 0.992 0.000
#> GSM254653     2  0.0000   0.976963 0.000 1.000 0.000
#> GSM254658     2  0.0000   0.976963 0.000 1.000 0.000
#> GSM254681     2  0.0000   0.976963 0.000 1.000 0.000
#> GSM254719     2  0.0000   0.976963 0.000 1.000 0.000
#> GSM254673     2  0.0000   0.976963 0.000 1.000 0.000
#> GSM254655     2  0.0000   0.976963 0.000 1.000 0.000
#> GSM254669     2  0.0000   0.976963 0.000 1.000 0.000
#> GSM254699     2  0.0000   0.976963 0.000 1.000 0.000
#> GSM254703     2  0.0424   0.974745 0.008 0.992 0.000
#> GSM254708     2  0.0000   0.976963 0.000 1.000 0.000
#> GSM254715     2  0.0424   0.974745 0.008 0.992 0.000
#> GSM254628     2  0.0000   0.976963 0.000 1.000 0.000
#> GSM254634     2  0.0424   0.974745 0.008 0.992 0.000
#> GSM254646     2  0.0000   0.976963 0.000 1.000 0.000
#> GSM254671     2  0.0424   0.974745 0.008 0.992 0.000
#> GSM254711     2  0.0424   0.974745 0.008 0.992 0.000
#> GSM254717     2  0.0000   0.976963 0.000 1.000 0.000
#> GSM254723     3  0.3896   0.554131 0.008 0.128 0.864
#> GSM254730     2  0.0000   0.976963 0.000 1.000 0.000
#> GSM254731     2  0.0000   0.976963 0.000 1.000 0.000
#> GSM254632     2  0.6215   0.275774 0.000 0.572 0.428
#> GSM254662     2  0.0000   0.976963 0.000 1.000 0.000
#> GSM254677     2  0.0424   0.974745 0.008 0.992 0.000
#> GSM254665     2  0.0000   0.976963 0.000 1.000 0.000
#> GSM254691     2  0.0000   0.976963 0.000 1.000 0.000
#> GSM254644     2  0.0424   0.974745 0.008 0.992 0.000
#> GSM254667     2  0.1163   0.952908 0.000 0.972 0.028
#> GSM254676     2  0.0000   0.976963 0.000 1.000 0.000
#> GSM254679     2  0.0424   0.974745 0.008 0.992 0.000
#> GSM254689     2  0.0000   0.976963 0.000 1.000 0.000
#> GSM254706     2  0.0000   0.976963 0.000 1.000 0.000
#> GSM254712     2  0.0424   0.974745 0.008 0.992 0.000
#> GSM254713     2  0.0424   0.974745 0.008 0.992 0.000
#> GSM254683     2  0.0000   0.976963 0.000 1.000 0.000
#> GSM254710     2  0.6215   0.275774 0.000 0.572 0.428
#> GSM254725     2  0.0424   0.974745 0.008 0.992 0.000
#> GSM254651     2  0.0000   0.976963 0.000 1.000 0.000
#> GSM254638     2  0.0424   0.974745 0.008 0.992 0.000
#> GSM254685     2  0.0000   0.976963 0.000 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM254629     3  0.1724     0.7191 0.020 0.000 0.948 0.032
#> GSM254648     3  0.2057     0.7177 0.020 0.008 0.940 0.032
#> GSM254694     3  0.2597     0.7256 0.040 0.004 0.916 0.040
#> GSM254701     3  0.1724     0.7191 0.020 0.000 0.948 0.032
#> GSM254728     3  0.3367     0.7168 0.108 0.000 0.864 0.028
#> GSM254726     3  0.3493     0.7323 0.052 0.008 0.876 0.064
#> GSM254639     3  0.5088     0.5283 0.288 0.000 0.688 0.024
#> GSM254652     3  0.3793     0.7002 0.112 0.000 0.844 0.044
#> GSM254700     1  0.5508    -0.6962 0.508 0.000 0.016 0.476
#> GSM254625     3  0.6571     0.4050 0.264 0.000 0.612 0.124
#> GSM254636     1  0.5200     0.4844 0.700 0.000 0.264 0.036
#> GSM254659     3  0.4467     0.6736 0.172 0.000 0.788 0.040
#> GSM254680     1  0.4391     0.5240 0.740 0.000 0.252 0.008
#> GSM254686     3  0.5689     0.5713 0.184 0.000 0.712 0.104
#> GSM254718     3  0.3439     0.7252 0.084 0.000 0.868 0.048
#> GSM254674     1  0.6123     0.3443 0.572 0.000 0.372 0.056
#> GSM254668     1  0.6079     0.3629 0.568 0.000 0.380 0.052
#> GSM254697     1  0.5038    -0.4164 0.652 0.000 0.012 0.336
#> GSM254704     4  0.5435     0.7861 0.420 0.000 0.016 0.564
#> GSM254707     1  0.6843     0.1659 0.460 0.000 0.440 0.100
#> GSM254714     4  0.7732     0.1828 0.268 0.000 0.288 0.444
#> GSM254722     1  0.5267     0.0236 0.740 0.000 0.076 0.184
#> GSM254627     1  0.5038    -0.4164 0.652 0.000 0.012 0.336
#> GSM254630     3  0.5180     0.5864 0.196 0.000 0.740 0.064
#> GSM254633     1  0.4908     0.4982 0.692 0.000 0.292 0.016
#> GSM254670     3  0.4988     0.5280 0.288 0.000 0.692 0.020
#> GSM254716     3  0.5766     0.5601 0.192 0.000 0.704 0.104
#> GSM254720     3  0.7176     0.0328 0.252 0.000 0.552 0.196
#> GSM254729     3  0.3198     0.7284 0.080 0.000 0.880 0.040
#> GSM254654     3  0.1911     0.7187 0.020 0.004 0.944 0.032
#> GSM254656     3  0.8182     0.3612 0.232 0.156 0.548 0.064
#> GSM254631     1  0.4422     0.5238 0.736 0.000 0.256 0.008
#> GSM254657     3  0.3647     0.6892 0.152 0.000 0.832 0.016
#> GSM254664     1  0.4422     0.5238 0.736 0.000 0.256 0.008
#> GSM254672     1  0.6546    -0.4734 0.524 0.000 0.080 0.396
#> GSM254692     1  0.7497    -0.2519 0.424 0.000 0.180 0.396
#> GSM254645     3  0.4903     0.5713 0.248 0.000 0.724 0.028
#> GSM254666     3  0.6054     0.4552 0.256 0.000 0.656 0.088
#> GSM254675     1  0.6714     0.1972 0.616 0.000 0.176 0.208
#> GSM254678     1  0.5728     0.3890 0.708 0.000 0.188 0.104
#> GSM254688     1  0.6857     0.2442 0.492 0.000 0.404 0.104
#> GSM254690     1  0.4137     0.5087 0.780 0.000 0.208 0.012
#> GSM254696     1  0.5577     0.4089 0.636 0.000 0.328 0.036
#> GSM254705     1  0.7278     0.4540 0.528 0.000 0.284 0.188
#> GSM254642     1  0.5038    -0.4164 0.652 0.000 0.012 0.336
#> GSM254661     3  0.3587     0.6986 0.104 0.000 0.856 0.040
#> GSM254698     1  0.5267     0.0236 0.740 0.000 0.076 0.184
#> GSM254641     1  0.7210     0.2544 0.456 0.000 0.404 0.140
#> GSM254647     1  0.6170     0.4563 0.672 0.000 0.192 0.136
#> GSM254663     1  0.7202     0.2726 0.464 0.000 0.396 0.140
#> GSM254682     1  0.6738     0.3386 0.544 0.000 0.352 0.104
#> GSM254709     1  0.7352     0.3283 0.496 0.000 0.328 0.176
#> GSM254721     4  0.5716     0.7788 0.420 0.000 0.028 0.552
#> GSM254724     4  0.5435     0.7861 0.420 0.000 0.016 0.564
#> GSM254650     1  0.7285     0.4154 0.516 0.000 0.308 0.176
#> GSM254687     1  0.7295     0.4522 0.524 0.000 0.288 0.188
#> GSM254637     1  0.4422     0.5238 0.736 0.000 0.256 0.008
#> GSM254684     1  0.6258     0.3259 0.600 0.000 0.324 0.076
#> GSM254649     2  0.0336     0.8892 0.000 0.992 0.000 0.008
#> GSM254660     2  0.2345     0.8857 0.000 0.900 0.000 0.100
#> GSM254693     2  0.0336     0.8892 0.000 0.992 0.000 0.008
#> GSM254695     2  0.4964     0.8164 0.000 0.716 0.028 0.256
#> GSM254702     2  0.2281     0.8863 0.000 0.904 0.000 0.096
#> GSM254643     2  0.3074     0.8752 0.000 0.848 0.000 0.152
#> GSM254727     2  0.0336     0.8911 0.000 0.992 0.000 0.008
#> GSM254640     2  0.3873     0.8519 0.000 0.772 0.000 0.228
#> GSM254626     2  0.0336     0.8892 0.000 0.992 0.000 0.008
#> GSM254635     2  0.3942     0.8481 0.000 0.764 0.000 0.236
#> GSM254653     2  0.0188     0.8915 0.000 0.996 0.000 0.004
#> GSM254658     2  0.0336     0.8892 0.000 0.992 0.000 0.008
#> GSM254681     2  0.0336     0.8892 0.000 0.992 0.000 0.008
#> GSM254719     2  0.0188     0.8915 0.000 0.996 0.000 0.004
#> GSM254673     2  0.0000     0.8911 0.000 1.000 0.000 0.000
#> GSM254655     2  0.2216     0.8867 0.000 0.908 0.000 0.092
#> GSM254669     2  0.0000     0.8911 0.000 1.000 0.000 0.000
#> GSM254699     2  0.2281     0.8863 0.000 0.904 0.000 0.096
#> GSM254703     2  0.3907     0.8504 0.000 0.768 0.000 0.232
#> GSM254708     2  0.0000     0.8911 0.000 1.000 0.000 0.000
#> GSM254715     2  0.3942     0.8481 0.000 0.764 0.000 0.236
#> GSM254628     2  0.0336     0.8892 0.000 0.992 0.000 0.008
#> GSM254634     2  0.3907     0.8502 0.000 0.768 0.000 0.232
#> GSM254646     2  0.0336     0.8892 0.000 0.992 0.000 0.008
#> GSM254671     2  0.3907     0.8502 0.000 0.768 0.000 0.232
#> GSM254711     2  0.3907     0.8502 0.000 0.768 0.000 0.232
#> GSM254717     2  0.0336     0.8911 0.000 0.992 0.000 0.008
#> GSM254723     3  0.5154     0.6008 0.024 0.120 0.788 0.068
#> GSM254730     2  0.2345     0.8857 0.000 0.900 0.000 0.100
#> GSM254731     2  0.2281     0.8863 0.000 0.904 0.000 0.096
#> GSM254632     2  0.7231     0.2524 0.020 0.560 0.316 0.104
#> GSM254662     2  0.0000     0.8911 0.000 1.000 0.000 0.000
#> GSM254677     2  0.3975     0.8460 0.000 0.760 0.000 0.240
#> GSM254665     2  0.0592     0.8919 0.000 0.984 0.000 0.016
#> GSM254691     2  0.0707     0.8915 0.000 0.980 0.000 0.020
#> GSM254644     2  0.3873     0.8519 0.000 0.772 0.000 0.228
#> GSM254667     2  0.1388     0.8731 0.000 0.960 0.012 0.028
#> GSM254676     2  0.0707     0.8915 0.000 0.980 0.000 0.020
#> GSM254679     2  0.3907     0.8502 0.000 0.768 0.000 0.232
#> GSM254689     2  0.0336     0.8892 0.000 0.992 0.000 0.008
#> GSM254706     2  0.0336     0.8892 0.000 0.992 0.000 0.008
#> GSM254712     2  0.3942     0.8481 0.000 0.764 0.000 0.236
#> GSM254713     2  0.3942     0.8481 0.000 0.764 0.000 0.236
#> GSM254683     2  0.0336     0.8892 0.000 0.992 0.000 0.008
#> GSM254710     2  0.7231     0.2524 0.020 0.560 0.316 0.104
#> GSM254725     2  0.3907     0.8502 0.000 0.768 0.000 0.232
#> GSM254651     2  0.0336     0.8892 0.000 0.992 0.000 0.008
#> GSM254638     2  0.3942     0.8481 0.000 0.764 0.000 0.236
#> GSM254685     2  0.3356     0.8688 0.000 0.824 0.000 0.176

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3 p4    p5
#> GSM254629     3  0.2850     0.6442 0.000 0.000 0.872 NA 0.036
#> GSM254648     3  0.2871     0.6456 0.000 0.004 0.876 NA 0.032
#> GSM254694     3  0.2927     0.6520 0.000 0.000 0.868 NA 0.040
#> GSM254701     3  0.2850     0.6442 0.000 0.000 0.872 NA 0.036
#> GSM254728     3  0.3389     0.6372 0.000 0.000 0.836 NA 0.116
#> GSM254726     3  0.3392     0.6592 0.000 0.004 0.848 NA 0.064
#> GSM254639     3  0.5360     0.4465 0.012 0.000 0.636 NA 0.296
#> GSM254652     3  0.3921     0.6001 0.000 0.000 0.784 NA 0.172
#> GSM254700     1  0.4016     0.6632 0.796 0.000 0.000 NA 0.112
#> GSM254625     3  0.6088     0.1220 0.000 0.000 0.492 NA 0.380
#> GSM254636     5  0.5727     0.5240 0.080 0.000 0.188 NA 0.684
#> GSM254659     3  0.5022     0.5770 0.028 0.000 0.736 NA 0.168
#> GSM254680     5  0.5377     0.5806 0.108 0.000 0.168 NA 0.704
#> GSM254686     3  0.5816     0.3647 0.000 0.000 0.588 NA 0.280
#> GSM254718     3  0.3558     0.6519 0.000 0.000 0.828 NA 0.064
#> GSM254674     5  0.6177     0.4720 0.056 0.000 0.284 NA 0.600
#> GSM254668     5  0.5162     0.4880 0.020 0.000 0.300 NA 0.648
#> GSM254697     1  0.6085     0.5759 0.556 0.000 0.000 NA 0.280
#> GSM254704     1  0.0898     0.6626 0.972 0.000 0.000 NA 0.020
#> GSM254707     5  0.5671     0.3678 0.000 0.000 0.336 NA 0.568
#> GSM254714     1  0.5840     0.2981 0.624 0.000 0.252 NA 0.112
#> GSM254722     5  0.6631    -0.1363 0.240 0.000 0.020 NA 0.548
#> GSM254627     1  0.6085     0.5759 0.556 0.000 0.000 NA 0.280
#> GSM254630     3  0.5140     0.4206 0.004 0.000 0.652 NA 0.284
#> GSM254633     5  0.5503     0.5637 0.088 0.000 0.192 NA 0.692
#> GSM254670     3  0.5379     0.4458 0.012 0.000 0.632 NA 0.300
#> GSM254716     3  0.5851     0.3486 0.000 0.000 0.580 NA 0.288
#> GSM254720     3  0.7314     0.1147 0.272 0.000 0.488 NA 0.184
#> GSM254729     3  0.3338     0.6550 0.004 0.000 0.852 NA 0.076
#> GSM254654     3  0.2769     0.6452 0.000 0.000 0.876 NA 0.032
#> GSM254656     3  0.7983     0.3187 0.012 0.116 0.476 NA 0.248
#> GSM254631     5  0.5321     0.5797 0.108 0.000 0.172 NA 0.704
#> GSM254657     3  0.3914     0.5986 0.000 0.000 0.788 NA 0.164
#> GSM254664     5  0.5321     0.5797 0.108 0.000 0.172 NA 0.704
#> GSM254672     1  0.6354     0.4969 0.580 0.000 0.040 NA 0.288
#> GSM254692     1  0.7666     0.2817 0.484 0.000 0.160 NA 0.244
#> GSM254645     3  0.4977     0.4985 0.016 0.000 0.680 NA 0.268
#> GSM254666     3  0.5874     0.1834 0.000 0.000 0.528 NA 0.364
#> GSM254675     5  0.7296     0.0137 0.348 0.000 0.100 NA 0.460
#> GSM254678     5  0.6126     0.3630 0.152 0.000 0.124 NA 0.664
#> GSM254688     5  0.5745     0.4113 0.004 0.000 0.304 NA 0.592
#> GSM254690     5  0.5209     0.5486 0.124 0.000 0.124 NA 0.728
#> GSM254696     5  0.6284     0.4254 0.080 0.000 0.252 NA 0.612
#> GSM254705     5  0.7321     0.4833 0.156 0.000 0.220 NA 0.532
#> GSM254642     1  0.6085     0.5759 0.556 0.000 0.000 NA 0.280
#> GSM254661     3  0.3616     0.5989 0.000 0.000 0.804 NA 0.164
#> GSM254698     5  0.6631    -0.1363 0.240 0.000 0.020 NA 0.548
#> GSM254641     5  0.7088     0.3895 0.092 0.000 0.312 NA 0.508
#> GSM254647     5  0.6779     0.4811 0.196 0.000 0.132 NA 0.596
#> GSM254663     5  0.7161     0.3978 0.096 0.000 0.308 NA 0.504
#> GSM254682     5  0.5622     0.4690 0.004 0.000 0.260 NA 0.628
#> GSM254709     5  0.7733     0.3715 0.200 0.000 0.272 NA 0.444
#> GSM254721     1  0.1393     0.6605 0.956 0.000 0.012 NA 0.024
#> GSM254724     1  0.0609     0.6650 0.980 0.000 0.000 NA 0.020
#> GSM254650     5  0.7231     0.4801 0.116 0.000 0.244 NA 0.536
#> GSM254687     5  0.7342     0.4870 0.156 0.000 0.224 NA 0.528
#> GSM254637     5  0.5321     0.5797 0.108 0.000 0.172 NA 0.704
#> GSM254684     5  0.7074     0.2706 0.088 0.000 0.264 NA 0.540
#> GSM254649     2  0.0162     0.8060 0.000 0.996 0.000 NA 0.000
#> GSM254660     2  0.2929     0.8010 0.000 0.820 0.000 NA 0.000
#> GSM254693     2  0.0162     0.8060 0.000 0.996 0.000 NA 0.000
#> GSM254695     2  0.4648     0.6624 0.000 0.524 0.012 NA 0.000
#> GSM254702     2  0.2773     0.8034 0.000 0.836 0.000 NA 0.000
#> GSM254643     2  0.3508     0.7836 0.000 0.748 0.000 NA 0.000
#> GSM254727     2  0.0290     0.8084 0.000 0.992 0.000 NA 0.000
#> GSM254640     2  0.4088     0.7442 0.000 0.632 0.000 NA 0.000
#> GSM254626     2  0.0162     0.8060 0.000 0.996 0.000 NA 0.000
#> GSM254635     2  0.4138     0.7355 0.000 0.616 0.000 NA 0.000
#> GSM254653     2  0.0404     0.8088 0.000 0.988 0.000 NA 0.000
#> GSM254658     2  0.1544     0.7824 0.000 0.932 0.000 NA 0.000
#> GSM254681     2  0.1544     0.7824 0.000 0.932 0.000 NA 0.000
#> GSM254719     2  0.0510     0.8094 0.000 0.984 0.000 NA 0.000
#> GSM254673     2  0.0162     0.8077 0.000 0.996 0.000 NA 0.000
#> GSM254655     2  0.2561     0.8058 0.000 0.856 0.000 NA 0.000
#> GSM254669     2  0.0162     0.8077 0.000 0.996 0.000 NA 0.000
#> GSM254699     2  0.2773     0.8034 0.000 0.836 0.000 NA 0.000
#> GSM254703     2  0.4138     0.7376 0.000 0.616 0.000 NA 0.000
#> GSM254708     2  0.1043     0.8018 0.000 0.960 0.000 NA 0.000
#> GSM254715     2  0.4138     0.7355 0.000 0.616 0.000 NA 0.000
#> GSM254628     2  0.0162     0.8060 0.000 0.996 0.000 NA 0.000
#> GSM254634     2  0.4138     0.7372 0.000 0.616 0.000 NA 0.000
#> GSM254646     2  0.1544     0.7824 0.000 0.932 0.000 NA 0.000
#> GSM254671     2  0.4088     0.7437 0.000 0.632 0.000 NA 0.000
#> GSM254711     2  0.4138     0.7372 0.000 0.616 0.000 NA 0.000
#> GSM254717     2  0.1043     0.8114 0.000 0.960 0.000 NA 0.000
#> GSM254723     3  0.5461     0.5538 0.000 0.092 0.716 NA 0.044
#> GSM254730     2  0.2929     0.8010 0.000 0.820 0.000 NA 0.000
#> GSM254731     2  0.2773     0.8034 0.000 0.836 0.000 NA 0.000
#> GSM254632     2  0.7455     0.1205 0.000 0.476 0.240 NA 0.060
#> GSM254662     2  0.0162     0.8077 0.000 0.996 0.000 NA 0.000
#> GSM254677     2  0.4171     0.7283 0.000 0.604 0.000 NA 0.000
#> GSM254665     2  0.1197     0.8107 0.000 0.952 0.000 NA 0.000
#> GSM254691     2  0.1732     0.7882 0.000 0.920 0.000 NA 0.000
#> GSM254644     2  0.4088     0.7442 0.000 0.632 0.000 NA 0.000
#> GSM254667     2  0.2488     0.7505 0.000 0.872 0.004 NA 0.000
#> GSM254676     2  0.1732     0.7882 0.000 0.920 0.000 NA 0.000
#> GSM254679     2  0.4088     0.7437 0.000 0.632 0.000 NA 0.000
#> GSM254689     2  0.1544     0.7824 0.000 0.932 0.000 NA 0.000
#> GSM254706     2  0.1608     0.7811 0.000 0.928 0.000 NA 0.000
#> GSM254712     2  0.4138     0.7355 0.000 0.616 0.000 NA 0.000
#> GSM254713     2  0.4138     0.7355 0.000 0.616 0.000 NA 0.000
#> GSM254683     2  0.1608     0.7811 0.000 0.928 0.000 NA 0.000
#> GSM254710     2  0.7455     0.1205 0.000 0.476 0.240 NA 0.060
#> GSM254725     2  0.4138     0.7372 0.000 0.616 0.000 NA 0.000
#> GSM254651     2  0.1608     0.7811 0.000 0.928 0.000 NA 0.000
#> GSM254638     2  0.4138     0.7355 0.000 0.616 0.000 NA 0.000
#> GSM254685     2  0.3661     0.7764 0.000 0.724 0.000 NA 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
#> GSM254629     3  0.2866     0.6981 0.000 0.000 0.868 0.060 0.012 0.060
#> GSM254648     3  0.2762     0.7011 0.000 0.004 0.880 0.048 0.012 0.056
#> GSM254694     3  0.1850     0.7148 0.000 0.000 0.924 0.052 0.008 0.016
#> GSM254701     3  0.2866     0.6981 0.000 0.000 0.868 0.060 0.012 0.060
#> GSM254728     3  0.4511     0.6771 0.000 0.000 0.752 0.060 0.136 0.052
#> GSM254726     3  0.3083     0.7233 0.000 0.004 0.864 0.060 0.048 0.024
#> GSM254639     3  0.5557     0.5538 0.000 0.000 0.600 0.032 0.096 0.272
#> GSM254652     3  0.5028     0.4959 0.000 0.000 0.628 0.040 0.296 0.036
#> GSM254700     1  0.4120     0.2784 0.724 0.000 0.000 0.008 0.040 0.228
#> GSM254625     5  0.4569     0.4529 0.000 0.000 0.200 0.096 0.700 0.004
#> GSM254636     5  0.6667     0.3366 0.044 0.000 0.148 0.016 0.496 0.296
#> GSM254659     3  0.5327     0.6207 0.008 0.000 0.700 0.084 0.140 0.068
#> GSM254680     5  0.6906     0.4667 0.076 0.000 0.108 0.036 0.532 0.248
#> GSM254686     5  0.5338     0.2878 0.000 0.000 0.284 0.116 0.592 0.008
#> GSM254718     3  0.3291     0.7171 0.000 0.000 0.848 0.056 0.060 0.036
#> GSM254674     5  0.5981     0.4908 0.028 0.000 0.168 0.012 0.604 0.188
#> GSM254668     5  0.3908     0.5739 0.008 0.000 0.052 0.028 0.808 0.104
#> GSM254697     6  0.4619     0.3120 0.388 0.000 0.000 0.012 0.024 0.576
#> GSM254704     1  0.0291     0.4857 0.992 0.000 0.000 0.004 0.000 0.004
#> GSM254707     5  0.1801     0.5748 0.000 0.000 0.056 0.016 0.924 0.004
#> GSM254714     1  0.4998     0.2942 0.644 0.000 0.272 0.004 0.012 0.068
#> GSM254722     6  0.3576     0.3784 0.076 0.000 0.024 0.000 0.076 0.824
#> GSM254627     6  0.4619     0.3120 0.388 0.000 0.000 0.012 0.024 0.576
#> GSM254630     5  0.5554     0.1927 0.008 0.000 0.352 0.068 0.552 0.020
#> GSM254633     5  0.6706     0.4570 0.052 0.000 0.132 0.032 0.548 0.236
#> GSM254670     3  0.5598     0.5521 0.000 0.000 0.596 0.032 0.100 0.272
#> GSM254716     5  0.5304     0.3046 0.000 0.000 0.276 0.116 0.600 0.008
#> GSM254720     3  0.7578     0.1479 0.264 0.000 0.456 0.060 0.084 0.136
#> GSM254729     3  0.2911     0.7233 0.004 0.000 0.876 0.052 0.036 0.032
#> GSM254654     3  0.2683     0.7008 0.000 0.000 0.880 0.052 0.012 0.056
#> GSM254656     3  0.7115     0.3664 0.000 0.036 0.436 0.252 0.028 0.248
#> GSM254631     5  0.6941     0.4666 0.076 0.000 0.112 0.036 0.528 0.248
#> GSM254657     3  0.4567     0.6789 0.000 0.000 0.744 0.032 0.096 0.128
#> GSM254664     5  0.6941     0.4666 0.076 0.000 0.112 0.036 0.528 0.248
#> GSM254672     1  0.5925     0.1321 0.488 0.000 0.060 0.004 0.052 0.396
#> GSM254692     1  0.6578     0.0622 0.376 0.000 0.004 0.016 0.316 0.288
#> GSM254645     3  0.5607     0.5991 0.004 0.000 0.636 0.048 0.088 0.224
#> GSM254666     5  0.4836     0.4134 0.004 0.000 0.232 0.080 0.676 0.008
#> GSM254675     1  0.7880    -0.0432 0.296 0.000 0.104 0.028 0.288 0.284
#> GSM254678     5  0.7015     0.0905 0.092 0.000 0.116 0.012 0.392 0.388
#> GSM254688     5  0.1794     0.5694 0.000 0.000 0.028 0.016 0.932 0.024
#> GSM254690     5  0.6419     0.4312 0.084 0.000 0.048 0.028 0.536 0.304
#> GSM254696     5  0.7030     0.2270 0.040 0.000 0.220 0.016 0.400 0.324
#> GSM254705     5  0.5088     0.4485 0.136 0.000 0.012 0.016 0.700 0.136
#> GSM254642     6  0.4619     0.3120 0.388 0.000 0.000 0.012 0.024 0.576
#> GSM254661     3  0.4347     0.5299 0.000 0.000 0.672 0.028 0.288 0.012
#> GSM254698     6  0.3576     0.3784 0.076 0.000 0.024 0.000 0.076 0.824
#> GSM254641     5  0.4973     0.5347 0.092 0.000 0.060 0.036 0.752 0.060
#> GSM254647     5  0.6563     0.3833 0.160 0.000 0.032 0.024 0.532 0.252
#> GSM254663     5  0.5026     0.5317 0.092 0.000 0.056 0.036 0.748 0.068
#> GSM254682     5  0.2308     0.5525 0.000 0.000 0.012 0.016 0.896 0.076
#> GSM254709     5  0.6550     0.3799 0.164 0.000 0.072 0.040 0.604 0.120
#> GSM254721     1  0.0551     0.4870 0.984 0.000 0.008 0.004 0.004 0.000
#> GSM254724     1  0.0632     0.4824 0.976 0.000 0.000 0.000 0.000 0.024
#> GSM254650     5  0.4213     0.4883 0.084 0.000 0.004 0.016 0.772 0.124
#> GSM254687     5  0.5051     0.4528 0.136 0.000 0.012 0.016 0.704 0.132
#> GSM254637     5  0.6941     0.4666 0.076 0.000 0.112 0.036 0.528 0.248
#> GSM254684     6  0.7114    -0.1000 0.020 0.000 0.224 0.044 0.292 0.420
#> GSM254649     2  0.0713     0.6073 0.000 0.972 0.000 0.028 0.000 0.000
#> GSM254660     2  0.2823     0.6005 0.000 0.796 0.000 0.204 0.000 0.000
#> GSM254693     2  0.0713     0.6073 0.000 0.972 0.000 0.028 0.000 0.000
#> GSM254695     4  0.3747    -0.3521 0.000 0.396 0.000 0.604 0.000 0.000
#> GSM254702     2  0.2697     0.6072 0.000 0.812 0.000 0.188 0.000 0.000
#> GSM254643     2  0.3309     0.5538 0.000 0.720 0.000 0.280 0.000 0.000
#> GSM254727     2  0.0713     0.6204 0.000 0.972 0.000 0.028 0.000 0.000
#> GSM254640     2  0.3797     0.4618 0.000 0.580 0.000 0.420 0.000 0.000
#> GSM254626     2  0.0363     0.6152 0.000 0.988 0.000 0.012 0.000 0.000
#> GSM254635     2  0.3851     0.4229 0.000 0.540 0.000 0.460 0.000 0.000
#> GSM254653     2  0.0713     0.6218 0.000 0.972 0.000 0.028 0.000 0.000
#> GSM254658     2  0.2260     0.5100 0.000 0.860 0.000 0.140 0.000 0.000
#> GSM254681     2  0.2260     0.5100 0.000 0.860 0.000 0.140 0.000 0.000
#> GSM254719     2  0.0632     0.6238 0.000 0.976 0.000 0.024 0.000 0.000
#> GSM254673     2  0.0363     0.6185 0.000 0.988 0.000 0.012 0.000 0.000
#> GSM254655     2  0.2378     0.6153 0.000 0.848 0.000 0.152 0.000 0.000
#> GSM254669     2  0.0363     0.6185 0.000 0.988 0.000 0.012 0.000 0.000
#> GSM254699     2  0.2697     0.6072 0.000 0.812 0.000 0.188 0.000 0.000
#> GSM254703     2  0.3833     0.4433 0.000 0.556 0.000 0.444 0.000 0.000
#> GSM254708     2  0.2048     0.5560 0.000 0.880 0.000 0.120 0.000 0.000
#> GSM254715     2  0.3843     0.4300 0.000 0.548 0.000 0.452 0.000 0.000
#> GSM254628     2  0.0713     0.6115 0.000 0.972 0.000 0.028 0.000 0.000
#> GSM254634     2  0.3854     0.4185 0.000 0.536 0.000 0.464 0.000 0.000
#> GSM254646     2  0.2260     0.5100 0.000 0.860 0.000 0.140 0.000 0.000
#> GSM254671     2  0.3789     0.4616 0.000 0.584 0.000 0.416 0.000 0.000
#> GSM254711     2  0.3843     0.4337 0.000 0.548 0.000 0.452 0.000 0.000
#> GSM254717     2  0.1714     0.6174 0.000 0.908 0.000 0.092 0.000 0.000
#> GSM254723     3  0.5723     0.5792 0.000 0.080 0.676 0.152 0.068 0.024
#> GSM254730     2  0.2854     0.6005 0.000 0.792 0.000 0.208 0.000 0.000
#> GSM254731     2  0.2697     0.6072 0.000 0.812 0.000 0.188 0.000 0.000
#> GSM254632     4  0.6990     0.4828 0.000 0.348 0.060 0.380 0.208 0.004
#> GSM254662     2  0.0363     0.6185 0.000 0.988 0.000 0.012 0.000 0.000
#> GSM254677     2  0.3857     0.4077 0.000 0.532 0.000 0.468 0.000 0.000
#> GSM254665     2  0.1501     0.6211 0.000 0.924 0.000 0.076 0.000 0.000
#> GSM254691     2  0.2378     0.5257 0.000 0.848 0.000 0.152 0.000 0.000
#> GSM254644     2  0.3817     0.4545 0.000 0.568 0.000 0.432 0.000 0.000
#> GSM254667     2  0.3265     0.2960 0.000 0.748 0.004 0.248 0.000 0.000
#> GSM254676     2  0.2378     0.5257 0.000 0.848 0.000 0.152 0.000 0.000
#> GSM254679     2  0.3804     0.4572 0.000 0.576 0.000 0.424 0.000 0.000
#> GSM254689     2  0.2260     0.5100 0.000 0.860 0.000 0.140 0.000 0.000
#> GSM254706     2  0.2300     0.5063 0.000 0.856 0.000 0.144 0.000 0.000
#> GSM254712     2  0.3843     0.4300 0.000 0.548 0.000 0.452 0.000 0.000
#> GSM254713     2  0.3843     0.4300 0.000 0.548 0.000 0.452 0.000 0.000
#> GSM254683     2  0.2300     0.5136 0.000 0.856 0.000 0.144 0.000 0.000
#> GSM254710     4  0.6990     0.4828 0.000 0.348 0.060 0.380 0.208 0.004
#> GSM254725     2  0.3854     0.4185 0.000 0.536 0.000 0.464 0.000 0.000
#> GSM254651     2  0.2300     0.5063 0.000 0.856 0.000 0.144 0.000 0.000
#> GSM254638     2  0.3851     0.4229 0.000 0.540 0.000 0.460 0.000 0.000
#> GSM254685     2  0.3446     0.5360 0.000 0.692 0.000 0.308 0.000 0.000

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

consensus_heatmap(res, k = 2)

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

consensus_heatmap(res, k = 3)

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

consensus_heatmap(res, k = 4)

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

consensus_heatmap(res, k = 5)

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

consensus_heatmap(res, k = 6)

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

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

membership_heatmap(res, k = 2)

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

membership_heatmap(res, k = 3)

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

membership_heatmap(res, k = 4)

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

membership_heatmap(res, k = 5)

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

membership_heatmap(res, k = 6)

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

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

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

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

get_signatures(res, k = 3)

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

get_signatures(res, k = 4)

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

get_signatures(res, k = 5)

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

get_signatures(res, k = 6)

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

Signature heatmaps where rows are not scaled:

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

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

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

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

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

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

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

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

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

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

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk SD-hclust-signature_compare

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

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

An example of the output of tb is:

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

The columns in tb are:

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

UMAP plot which shows how samples are separated.

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

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

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

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

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

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

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

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

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

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

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk SD-hclust-collect-classes

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

test_to_known_factors(res)
#>             n tissue(p) individual(p) disease.state(p) gender(p) other(p) k
#> SD:hclust 105  6.63e-23        0.6809           0.5344    0.6385   1.0000 2
#> SD:hclust  80  3.07e-17        0.1742           0.2800    0.3647   0.2287 3
#> SD:hclust  74  4.48e-15        0.2358           0.1567    0.0935   0.0368 4
#> SD:hclust  74  4.28e-15        0.2638           0.0754    0.0666   0.0200 5
#> SD:hclust  52  3.58e-11        0.0847           0.6394    0.0237   0.3586 6

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


SD:kmeans**

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

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

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

res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#>   On a matrix with 21168 rows and 107 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.997       0.999         0.4981 0.503   0.503
#> 3 3 0.692           0.873       0.863         0.2861 0.835   0.675
#> 4 4 0.649           0.515       0.710         0.1263 0.972   0.921
#> 5 5 0.642           0.560       0.709         0.0736 0.823   0.496
#> 6 6 0.645           0.526       0.729         0.0425 0.917   0.672

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

suggest_best_k(res)
#> [1] 2

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

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

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>           class entropy silhouette    p1    p2
#> GSM254629     1   0.000      0.998 1.000 0.000
#> GSM254648     1   0.000      0.998 1.000 0.000
#> GSM254694     1   0.000      0.998 1.000 0.000
#> GSM254701     1   0.000      0.998 1.000 0.000
#> GSM254728     1   0.000      0.998 1.000 0.000
#> GSM254726     1   0.000      0.998 1.000 0.000
#> GSM254639     1   0.000      0.998 1.000 0.000
#> GSM254652     1   0.000      0.998 1.000 0.000
#> GSM254700     1   0.000      0.998 1.000 0.000
#> GSM254625     1   0.000      0.998 1.000 0.000
#> GSM254636     1   0.000      0.998 1.000 0.000
#> GSM254659     1   0.000      0.998 1.000 0.000
#> GSM254680     1   0.000      0.998 1.000 0.000
#> GSM254686     1   0.000      0.998 1.000 0.000
#> GSM254718     1   0.000      0.998 1.000 0.000
#> GSM254674     1   0.000      0.998 1.000 0.000
#> GSM254668     1   0.000      0.998 1.000 0.000
#> GSM254697     1   0.000      0.998 1.000 0.000
#> GSM254704     1   0.000      0.998 1.000 0.000
#> GSM254707     1   0.000      0.998 1.000 0.000
#> GSM254714     1   0.000      0.998 1.000 0.000
#> GSM254722     1   0.000      0.998 1.000 0.000
#> GSM254627     1   0.000      0.998 1.000 0.000
#> GSM254630     1   0.000      0.998 1.000 0.000
#> GSM254633     1   0.000      0.998 1.000 0.000
#> GSM254670     1   0.000      0.998 1.000 0.000
#> GSM254716     1   0.000      0.998 1.000 0.000
#> GSM254720     1   0.000      0.998 1.000 0.000
#> GSM254729     1   0.000      0.998 1.000 0.000
#> GSM254654     1   0.000      0.998 1.000 0.000
#> GSM254656     1   0.000      0.998 1.000 0.000
#> GSM254631     1   0.000      0.998 1.000 0.000
#> GSM254657     1   0.000      0.998 1.000 0.000
#> GSM254664     1   0.000      0.998 1.000 0.000
#> GSM254672     1   0.000      0.998 1.000 0.000
#> GSM254692     1   0.000      0.998 1.000 0.000
#> GSM254645     1   0.000      0.998 1.000 0.000
#> GSM254666     1   0.000      0.998 1.000 0.000
#> GSM254675     1   0.000      0.998 1.000 0.000
#> GSM254678     1   0.000      0.998 1.000 0.000
#> GSM254688     1   0.000      0.998 1.000 0.000
#> GSM254690     1   0.000      0.998 1.000 0.000
#> GSM254696     1   0.000      0.998 1.000 0.000
#> GSM254705     1   0.000      0.998 1.000 0.000
#> GSM254642     1   0.000      0.998 1.000 0.000
#> GSM254661     1   0.000      0.998 1.000 0.000
#> GSM254698     1   0.000      0.998 1.000 0.000
#> GSM254641     1   0.000      0.998 1.000 0.000
#> GSM254647     1   0.000      0.998 1.000 0.000
#> GSM254663     1   0.000      0.998 1.000 0.000
#> GSM254682     1   0.000      0.998 1.000 0.000
#> GSM254709     1   0.000      0.998 1.000 0.000
#> GSM254721     1   0.000      0.998 1.000 0.000
#> GSM254724     1   0.000      0.998 1.000 0.000
#> GSM254650     1   0.000      0.998 1.000 0.000
#> GSM254687     1   0.000      0.998 1.000 0.000
#> GSM254637     1   0.000      0.998 1.000 0.000
#> GSM254684     1   0.000      0.998 1.000 0.000
#> GSM254649     2   0.000      1.000 0.000 1.000
#> GSM254660     2   0.000      1.000 0.000 1.000
#> GSM254693     2   0.000      1.000 0.000 1.000
#> GSM254695     2   0.000      1.000 0.000 1.000
#> GSM254702     2   0.000      1.000 0.000 1.000
#> GSM254643     2   0.000      1.000 0.000 1.000
#> GSM254727     2   0.000      1.000 0.000 1.000
#> GSM254640     2   0.000      1.000 0.000 1.000
#> GSM254626     2   0.000      1.000 0.000 1.000
#> GSM254635     2   0.000      1.000 0.000 1.000
#> GSM254653     2   0.000      1.000 0.000 1.000
#> GSM254658     2   0.000      1.000 0.000 1.000
#> GSM254681     2   0.000      1.000 0.000 1.000
#> GSM254719     2   0.000      1.000 0.000 1.000
#> GSM254673     2   0.000      1.000 0.000 1.000
#> GSM254655     2   0.000      1.000 0.000 1.000
#> GSM254669     2   0.000      1.000 0.000 1.000
#> GSM254699     2   0.000      1.000 0.000 1.000
#> GSM254703     2   0.000      1.000 0.000 1.000
#> GSM254708     2   0.000      1.000 0.000 1.000
#> GSM254715     2   0.000      1.000 0.000 1.000
#> GSM254628     2   0.000      1.000 0.000 1.000
#> GSM254634     2   0.000      1.000 0.000 1.000
#> GSM254646     2   0.000      1.000 0.000 1.000
#> GSM254671     2   0.000      1.000 0.000 1.000
#> GSM254711     2   0.000      1.000 0.000 1.000
#> GSM254717     2   0.000      1.000 0.000 1.000
#> GSM254723     1   0.574      0.843 0.864 0.136
#> GSM254730     2   0.000      1.000 0.000 1.000
#> GSM254731     2   0.000      1.000 0.000 1.000
#> GSM254632     1   0.000      0.998 1.000 0.000
#> GSM254662     2   0.000      1.000 0.000 1.000
#> GSM254677     2   0.000      1.000 0.000 1.000
#> GSM254665     2   0.000      1.000 0.000 1.000
#> GSM254691     2   0.000      1.000 0.000 1.000
#> GSM254644     2   0.000      1.000 0.000 1.000
#> GSM254667     2   0.000      1.000 0.000 1.000
#> GSM254676     2   0.000      1.000 0.000 1.000
#> GSM254679     2   0.000      1.000 0.000 1.000
#> GSM254689     2   0.000      1.000 0.000 1.000
#> GSM254706     2   0.000      1.000 0.000 1.000
#> GSM254712     2   0.000      1.000 0.000 1.000
#> GSM254713     2   0.000      1.000 0.000 1.000
#> GSM254683     2   0.000      1.000 0.000 1.000
#> GSM254710     2   0.000      1.000 0.000 1.000
#> GSM254725     2   0.000      1.000 0.000 1.000
#> GSM254651     2   0.000      1.000 0.000 1.000
#> GSM254638     2   0.000      1.000 0.000 1.000
#> GSM254685     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
#> GSM254629     3  0.5016      0.900 0.240 0.000 0.760
#> GSM254648     3  0.4452      0.876 0.192 0.000 0.808
#> GSM254694     3  0.5216      0.904 0.260 0.000 0.740
#> GSM254701     3  0.5216      0.904 0.260 0.000 0.740
#> GSM254728     3  0.5216      0.904 0.260 0.000 0.740
#> GSM254726     3  0.4452      0.876 0.192 0.000 0.808
#> GSM254639     3  0.5254      0.903 0.264 0.000 0.736
#> GSM254652     3  0.5016      0.900 0.240 0.000 0.760
#> GSM254700     1  0.0000      0.877 1.000 0.000 0.000
#> GSM254625     3  0.5431      0.828 0.284 0.000 0.716
#> GSM254636     1  0.4062      0.825 0.836 0.000 0.164
#> GSM254659     3  0.5216      0.904 0.260 0.000 0.740
#> GSM254680     1  0.3816      0.840 0.852 0.000 0.148
#> GSM254686     3  0.5529      0.843 0.296 0.000 0.704
#> GSM254718     3  0.5216      0.904 0.260 0.000 0.740
#> GSM254674     1  0.3752      0.839 0.856 0.000 0.144
#> GSM254668     1  0.4346      0.833 0.816 0.000 0.184
#> GSM254697     1  0.0000      0.877 1.000 0.000 0.000
#> GSM254704     1  0.1031      0.875 0.976 0.000 0.024
#> GSM254707     1  0.4346      0.833 0.816 0.000 0.184
#> GSM254714     3  0.5291      0.899 0.268 0.000 0.732
#> GSM254722     1  0.0000      0.877 1.000 0.000 0.000
#> GSM254627     1  0.0000      0.877 1.000 0.000 0.000
#> GSM254630     1  0.5948      0.345 0.640 0.000 0.360
#> GSM254633     1  0.4178      0.816 0.828 0.000 0.172
#> GSM254670     3  0.5254      0.903 0.264 0.000 0.736
#> GSM254716     3  0.5431      0.828 0.284 0.000 0.716
#> GSM254720     1  0.3941      0.772 0.844 0.000 0.156
#> GSM254729     3  0.5254      0.903 0.264 0.000 0.736
#> GSM254654     3  0.4750      0.881 0.216 0.000 0.784
#> GSM254656     3  0.3192      0.754 0.112 0.000 0.888
#> GSM254631     1  0.3941      0.832 0.844 0.000 0.156
#> GSM254657     3  0.5254      0.903 0.264 0.000 0.736
#> GSM254664     1  0.3551      0.847 0.868 0.000 0.132
#> GSM254672     1  0.1411      0.872 0.964 0.000 0.036
#> GSM254692     1  0.1643      0.860 0.956 0.000 0.044
#> GSM254645     3  0.5254      0.903 0.264 0.000 0.736
#> GSM254666     3  0.5098      0.869 0.248 0.000 0.752
#> GSM254675     1  0.1411      0.883 0.964 0.000 0.036
#> GSM254678     1  0.1964      0.872 0.944 0.000 0.056
#> GSM254688     1  0.2959      0.870 0.900 0.000 0.100
#> GSM254690     1  0.0747      0.882 0.984 0.000 0.016
#> GSM254696     1  0.4062      0.825 0.836 0.000 0.164
#> GSM254705     1  0.2261      0.870 0.932 0.000 0.068
#> GSM254642     1  0.0892      0.868 0.980 0.000 0.020
#> GSM254661     3  0.5016      0.900 0.240 0.000 0.760
#> GSM254698     1  0.1411      0.872 0.964 0.000 0.036
#> GSM254641     1  0.4346      0.820 0.816 0.000 0.184
#> GSM254647     1  0.0000      0.877 1.000 0.000 0.000
#> GSM254663     1  0.1753      0.862 0.952 0.000 0.048
#> GSM254682     1  0.2537      0.871 0.920 0.000 0.080
#> GSM254709     1  0.5431      0.605 0.716 0.000 0.284
#> GSM254721     1  0.0000      0.877 1.000 0.000 0.000
#> GSM254724     1  0.0000      0.877 1.000 0.000 0.000
#> GSM254650     1  0.2959      0.870 0.900 0.000 0.100
#> GSM254687     1  0.2959      0.870 0.900 0.000 0.100
#> GSM254637     1  0.4178      0.816 0.828 0.000 0.172
#> GSM254684     1  0.3816      0.840 0.852 0.000 0.148
#> GSM254649     2  0.0237      0.929 0.000 0.996 0.004
#> GSM254660     2  0.2066      0.923 0.000 0.940 0.060
#> GSM254693     2  0.0424      0.929 0.000 0.992 0.008
#> GSM254695     2  0.4702      0.884 0.000 0.788 0.212
#> GSM254702     2  0.4121      0.900 0.000 0.832 0.168
#> GSM254643     2  0.0237      0.930 0.000 0.996 0.004
#> GSM254727     2  0.0237      0.929 0.000 0.996 0.004
#> GSM254640     2  0.4062      0.900 0.000 0.836 0.164
#> GSM254626     2  0.0237      0.930 0.000 0.996 0.004
#> GSM254635     2  0.4702      0.884 0.000 0.788 0.212
#> GSM254653     2  0.0237      0.929 0.000 0.996 0.004
#> GSM254658     2  0.0237      0.929 0.000 0.996 0.004
#> GSM254681     2  0.0424      0.928 0.000 0.992 0.008
#> GSM254719     2  0.0237      0.930 0.000 0.996 0.004
#> GSM254673     2  0.0237      0.930 0.000 0.996 0.004
#> GSM254655     2  0.0592      0.930 0.000 0.988 0.012
#> GSM254669     2  0.0237      0.930 0.000 0.996 0.004
#> GSM254699     2  0.0237      0.930 0.000 0.996 0.004
#> GSM254703     2  0.4654      0.885 0.000 0.792 0.208
#> GSM254708     2  0.0747      0.928 0.000 0.984 0.016
#> GSM254715     2  0.4605      0.887 0.000 0.796 0.204
#> GSM254628     2  0.0237      0.929 0.000 0.996 0.004
#> GSM254634     2  0.4654      0.885 0.000 0.792 0.208
#> GSM254646     2  0.0237      0.929 0.000 0.996 0.004
#> GSM254671     2  0.4121      0.900 0.000 0.832 0.168
#> GSM254711     2  0.4654      0.885 0.000 0.792 0.208
#> GSM254717     2  0.0237      0.929 0.000 0.996 0.004
#> GSM254723     3  0.3359      0.734 0.084 0.016 0.900
#> GSM254730     2  0.1753      0.925 0.000 0.952 0.048
#> GSM254731     2  0.4121      0.900 0.000 0.832 0.168
#> GSM254632     3  0.4399      0.874 0.188 0.000 0.812
#> GSM254662     2  0.0237      0.930 0.000 0.996 0.004
#> GSM254677     2  0.4654      0.885 0.000 0.792 0.208
#> GSM254665     2  0.0424      0.930 0.000 0.992 0.008
#> GSM254691     2  0.0237      0.930 0.000 0.996 0.004
#> GSM254644     2  0.4062      0.900 0.000 0.836 0.164
#> GSM254667     2  0.0747      0.928 0.000 0.984 0.016
#> GSM254676     2  0.0237      0.930 0.000 0.996 0.004
#> GSM254679     2  0.4654      0.885 0.000 0.792 0.208
#> GSM254689     2  0.0424      0.928 0.000 0.992 0.008
#> GSM254706     2  0.0424      0.928 0.000 0.992 0.008
#> GSM254712     2  0.4702      0.884 0.000 0.788 0.212
#> GSM254713     2  0.4702      0.884 0.000 0.788 0.212
#> GSM254683     2  0.0424      0.928 0.000 0.992 0.008
#> GSM254710     3  0.6045      0.345 0.000 0.380 0.620
#> GSM254725     2  0.4654      0.885 0.000 0.792 0.208
#> GSM254651     2  0.0424      0.928 0.000 0.992 0.008
#> GSM254638     2  0.4702      0.884 0.000 0.788 0.212
#> GSM254685     2  0.4605      0.887 0.000 0.796 0.204

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM254629     3  0.2222     0.8878 0.060 0.000 0.924 0.016
#> GSM254648     3  0.1820     0.8771 0.020 0.000 0.944 0.036
#> GSM254694     3  0.2227     0.8808 0.036 0.000 0.928 0.036
#> GSM254701     3  0.2489     0.8876 0.068 0.000 0.912 0.020
#> GSM254728     3  0.1902     0.8891 0.064 0.000 0.932 0.004
#> GSM254726     3  0.1510     0.8776 0.016 0.000 0.956 0.028
#> GSM254639     3  0.3286     0.8786 0.080 0.000 0.876 0.044
#> GSM254652     3  0.2021     0.8878 0.056 0.000 0.932 0.012
#> GSM254700     1  0.4500     0.7220 0.684 0.000 0.000 0.316
#> GSM254625     3  0.6037     0.5509 0.304 0.000 0.628 0.068
#> GSM254636     1  0.5062     0.6868 0.752 0.000 0.184 0.064
#> GSM254659     3  0.1978     0.8887 0.068 0.000 0.928 0.004
#> GSM254680     1  0.3547     0.7239 0.840 0.000 0.144 0.016
#> GSM254686     3  0.5649     0.5889 0.284 0.000 0.664 0.052
#> GSM254718     3  0.2255     0.8893 0.068 0.000 0.920 0.012
#> GSM254674     1  0.4731     0.7040 0.780 0.000 0.160 0.060
#> GSM254668     1  0.4638     0.7036 0.788 0.000 0.152 0.060
#> GSM254697     1  0.4454     0.7260 0.692 0.000 0.000 0.308
#> GSM254704     1  0.5173     0.7152 0.660 0.000 0.020 0.320
#> GSM254707     1  0.4829     0.7005 0.776 0.000 0.156 0.068
#> GSM254714     3  0.3966     0.8456 0.088 0.000 0.840 0.072
#> GSM254722     1  0.4522     0.7237 0.680 0.000 0.000 0.320
#> GSM254627     1  0.4454     0.7260 0.692 0.000 0.000 0.308
#> GSM254630     1  0.6394     0.4164 0.596 0.000 0.316 0.088
#> GSM254633     1  0.4364     0.6821 0.764 0.000 0.220 0.016
#> GSM254670     3  0.3634     0.8712 0.096 0.000 0.856 0.048
#> GSM254716     3  0.6016     0.5583 0.300 0.000 0.632 0.068
#> GSM254720     1  0.7707     0.4678 0.452 0.000 0.276 0.272
#> GSM254729     3  0.2500     0.8828 0.044 0.000 0.916 0.040
#> GSM254654     3  0.2032     0.8779 0.028 0.000 0.936 0.036
#> GSM254656     3  0.3256     0.8434 0.020 0.020 0.888 0.072
#> GSM254631     1  0.4095     0.7007 0.792 0.000 0.192 0.016
#> GSM254657     3  0.3505     0.8732 0.088 0.000 0.864 0.048
#> GSM254664     1  0.3695     0.7248 0.828 0.000 0.156 0.016
#> GSM254672     1  0.5970     0.7012 0.600 0.000 0.052 0.348
#> GSM254692     1  0.4914     0.7272 0.676 0.000 0.012 0.312
#> GSM254645     3  0.3286     0.8786 0.080 0.000 0.876 0.044
#> GSM254666     3  0.5627     0.6665 0.240 0.000 0.692 0.068
#> GSM254675     1  0.4356     0.7655 0.804 0.000 0.048 0.148
#> GSM254678     1  0.5265     0.7395 0.748 0.000 0.092 0.160
#> GSM254688     1  0.3679     0.7440 0.856 0.000 0.060 0.084
#> GSM254690     1  0.2844     0.7651 0.900 0.000 0.052 0.048
#> GSM254696     1  0.5307     0.6846 0.736 0.000 0.188 0.076
#> GSM254705     1  0.3160     0.7519 0.872 0.000 0.020 0.108
#> GSM254642     1  0.4454     0.7260 0.692 0.000 0.000 0.308
#> GSM254661     3  0.2021     0.8878 0.056 0.000 0.932 0.012
#> GSM254698     1  0.5712     0.7132 0.644 0.000 0.048 0.308
#> GSM254641     1  0.4881     0.6872 0.756 0.000 0.196 0.048
#> GSM254647     1  0.4356     0.7323 0.708 0.000 0.000 0.292
#> GSM254663     1  0.3554     0.7584 0.844 0.000 0.020 0.136
#> GSM254682     1  0.3652     0.7464 0.856 0.000 0.052 0.092
#> GSM254709     1  0.5669     0.6352 0.708 0.000 0.200 0.092
#> GSM254721     1  0.4522     0.7215 0.680 0.000 0.000 0.320
#> GSM254724     1  0.4500     0.7218 0.684 0.000 0.000 0.316
#> GSM254650     1  0.3439     0.7487 0.868 0.000 0.048 0.084
#> GSM254687     1  0.3679     0.7456 0.856 0.000 0.060 0.084
#> GSM254637     1  0.4501     0.6837 0.764 0.000 0.212 0.024
#> GSM254684     1  0.5291     0.6907 0.740 0.000 0.180 0.080
#> GSM254649     2  0.4955     0.0316 0.000 0.556 0.000 0.444
#> GSM254660     2  0.2589     0.4492 0.000 0.884 0.000 0.116
#> GSM254693     2  0.4898     0.0860 0.000 0.584 0.000 0.416
#> GSM254695     2  0.3907     0.3811 0.000 0.836 0.044 0.120
#> GSM254702     2  0.1716     0.4693 0.000 0.936 0.000 0.064
#> GSM254643     2  0.4877     0.1045 0.000 0.592 0.000 0.408
#> GSM254727     2  0.4925     0.0638 0.000 0.572 0.000 0.428
#> GSM254640     2  0.2473     0.4713 0.000 0.908 0.012 0.080
#> GSM254626     2  0.4877     0.1045 0.000 0.592 0.000 0.408
#> GSM254635     2  0.2222     0.4455 0.000 0.924 0.016 0.060
#> GSM254653     2  0.4925     0.0638 0.000 0.572 0.000 0.428
#> GSM254658     2  0.4955     0.0316 0.000 0.556 0.000 0.444
#> GSM254681     2  0.4955     0.0316 0.000 0.556 0.000 0.444
#> GSM254719     2  0.4866     0.1086 0.000 0.596 0.000 0.404
#> GSM254673     2  0.4877     0.1045 0.000 0.592 0.000 0.408
#> GSM254655     2  0.4564     0.2134 0.000 0.672 0.000 0.328
#> GSM254669     2  0.4877     0.1045 0.000 0.592 0.000 0.408
#> GSM254699     2  0.4679     0.1780 0.000 0.648 0.000 0.352
#> GSM254703     2  0.2909     0.4345 0.000 0.888 0.020 0.092
#> GSM254708     2  0.4989    -0.1972 0.000 0.528 0.000 0.472
#> GSM254715     2  0.0592     0.4678 0.000 0.984 0.016 0.000
#> GSM254628     2  0.4955     0.0316 0.000 0.556 0.000 0.444
#> GSM254634     2  0.2741     0.4346 0.000 0.892 0.012 0.096
#> GSM254646     2  0.4941     0.0508 0.000 0.564 0.000 0.436
#> GSM254671     2  0.1302     0.4726 0.000 0.956 0.000 0.044
#> GSM254711     2  0.2741     0.4346 0.000 0.892 0.012 0.096
#> GSM254717     2  0.4925     0.0638 0.000 0.572 0.000 0.428
#> GSM254723     3  0.2099     0.8569 0.004 0.020 0.936 0.040
#> GSM254730     2  0.3024     0.4402 0.000 0.852 0.000 0.148
#> GSM254731     2  0.1716     0.4693 0.000 0.936 0.000 0.064
#> GSM254632     3  0.2376     0.8668 0.016 0.000 0.916 0.068
#> GSM254662     2  0.4877     0.1045 0.000 0.592 0.000 0.408
#> GSM254677     2  0.3367     0.4207 0.000 0.864 0.028 0.108
#> GSM254665     2  0.4761     0.0619 0.000 0.628 0.000 0.372
#> GSM254691     2  0.4985    -0.1952 0.000 0.532 0.000 0.468
#> GSM254644     2  0.2542     0.4696 0.000 0.904 0.012 0.084
#> GSM254667     2  0.4994    -0.2061 0.000 0.520 0.000 0.480
#> GSM254676     2  0.4985    -0.1952 0.000 0.532 0.000 0.468
#> GSM254679     2  0.2741     0.4346 0.000 0.892 0.012 0.096
#> GSM254689     2  0.4941     0.0508 0.000 0.564 0.000 0.436
#> GSM254706     4  0.4992     0.0988 0.000 0.476 0.000 0.524
#> GSM254712     2  0.0817     0.4661 0.000 0.976 0.024 0.000
#> GSM254713     2  0.0817     0.4661 0.000 0.976 0.024 0.000
#> GSM254683     4  0.4994     0.0977 0.000 0.480 0.000 0.520
#> GSM254710     4  0.6708    -0.1171 0.040 0.028 0.396 0.536
#> GSM254725     2  0.2805     0.4316 0.000 0.888 0.012 0.100
#> GSM254651     4  0.4994     0.0977 0.000 0.480 0.000 0.520
#> GSM254638     2  0.2915     0.4249 0.000 0.892 0.028 0.080
#> GSM254685     2  0.0592     0.4678 0.000 0.984 0.016 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
#> GSM254629     3  0.0740     0.9179 0.004 0.008 0.980 0.000 0.008
#> GSM254648     3  0.0854     0.9171 0.008 0.012 0.976 0.000 0.004
#> GSM254694     3  0.0854     0.9171 0.008 0.012 0.976 0.000 0.004
#> GSM254701     3  0.0740     0.9179 0.004 0.008 0.980 0.000 0.008
#> GSM254728     3  0.1588     0.9112 0.008 0.016 0.948 0.000 0.028
#> GSM254726     3  0.0854     0.9173 0.012 0.008 0.976 0.000 0.004
#> GSM254639     3  0.3761     0.8615 0.064 0.068 0.840 0.000 0.028
#> GSM254652     3  0.1393     0.9131 0.008 0.012 0.956 0.000 0.024
#> GSM254700     1  0.4403     0.7982 0.608 0.008 0.000 0.000 0.384
#> GSM254625     5  0.5198     0.2315 0.016 0.020 0.408 0.000 0.556
#> GSM254636     5  0.7031     0.3570 0.160 0.144 0.112 0.000 0.584
#> GSM254659     3  0.0867     0.9179 0.008 0.008 0.976 0.000 0.008
#> GSM254680     5  0.4261     0.5390 0.032 0.088 0.072 0.000 0.808
#> GSM254686     5  0.5292     0.1851 0.008 0.032 0.452 0.000 0.508
#> GSM254718     3  0.0613     0.9182 0.004 0.004 0.984 0.000 0.008
#> GSM254674     5  0.3928     0.5605 0.008 0.092 0.084 0.000 0.816
#> GSM254668     5  0.2694     0.5614 0.004 0.032 0.076 0.000 0.888
#> GSM254697     1  0.5044     0.7992 0.556 0.036 0.000 0.000 0.408
#> GSM254704     1  0.4998     0.7691 0.632 0.008 0.032 0.000 0.328
#> GSM254707     5  0.1956     0.5638 0.000 0.008 0.076 0.000 0.916
#> GSM254714     3  0.3291     0.8378 0.100 0.016 0.856 0.000 0.028
#> GSM254722     1  0.5195     0.7910 0.564 0.048 0.000 0.000 0.388
#> GSM254627     1  0.5044     0.7992 0.556 0.036 0.000 0.000 0.408
#> GSM254630     5  0.4703     0.4444 0.040 0.020 0.204 0.000 0.736
#> GSM254633     5  0.6696     0.4147 0.128 0.104 0.148 0.000 0.620
#> GSM254670     3  0.5106     0.7758 0.064 0.132 0.748 0.000 0.056
#> GSM254716     5  0.5205     0.2213 0.016 0.020 0.412 0.000 0.552
#> GSM254720     1  0.6883     0.4540 0.488 0.016 0.252 0.000 0.244
#> GSM254729     3  0.1377     0.9120 0.020 0.020 0.956 0.000 0.004
#> GSM254654     3  0.0854     0.9171 0.008 0.012 0.976 0.000 0.004
#> GSM254656     3  0.4255     0.8513 0.096 0.076 0.808 0.008 0.012
#> GSM254631     5  0.6571     0.4046 0.140 0.096 0.132 0.000 0.632
#> GSM254657     3  0.4406     0.8364 0.068 0.072 0.804 0.000 0.056
#> GSM254664     5  0.5781     0.4508 0.116 0.092 0.088 0.000 0.704
#> GSM254672     1  0.4880     0.7394 0.660 0.004 0.040 0.000 0.296
#> GSM254692     5  0.4380    -0.4188 0.376 0.008 0.000 0.000 0.616
#> GSM254645     3  0.3736     0.8624 0.064 0.072 0.840 0.000 0.024
#> GSM254666     5  0.5069     0.1166 0.008 0.020 0.452 0.000 0.520
#> GSM254675     5  0.4954    -0.1359 0.352 0.020 0.012 0.000 0.616
#> GSM254678     5  0.7156     0.1128 0.276 0.144 0.064 0.000 0.516
#> GSM254688     5  0.1087     0.5266 0.016 0.008 0.008 0.000 0.968
#> GSM254690     5  0.4545     0.3448 0.132 0.116 0.000 0.000 0.752
#> GSM254696     5  0.7131     0.3551 0.156 0.160 0.112 0.000 0.572
#> GSM254705     5  0.2141     0.4906 0.064 0.016 0.004 0.000 0.916
#> GSM254642     1  0.5044     0.7992 0.556 0.036 0.000 0.000 0.408
#> GSM254661     3  0.1186     0.9160 0.008 0.008 0.964 0.000 0.020
#> GSM254698     1  0.7049     0.5886 0.476 0.152 0.040 0.000 0.332
#> GSM254641     5  0.3558     0.5616 0.004 0.036 0.136 0.000 0.824
#> GSM254647     1  0.5232     0.7428 0.500 0.044 0.000 0.000 0.456
#> GSM254663     5  0.2077     0.4431 0.084 0.008 0.000 0.000 0.908
#> GSM254682     5  0.1179     0.5224 0.016 0.016 0.004 0.000 0.964
#> GSM254709     5  0.4118     0.4683 0.032 0.008 0.188 0.000 0.772
#> GSM254721     1  0.4403     0.7982 0.608 0.008 0.000 0.000 0.384
#> GSM254724     1  0.4403     0.7982 0.608 0.008 0.000 0.000 0.384
#> GSM254650     5  0.1644     0.4991 0.048 0.004 0.008 0.000 0.940
#> GSM254687     5  0.1695     0.5044 0.044 0.008 0.008 0.000 0.940
#> GSM254637     5  0.6684     0.4098 0.140 0.096 0.144 0.000 0.620
#> GSM254684     5  0.7090     0.3511 0.156 0.160 0.108 0.000 0.576
#> GSM254649     2  0.4701     0.7719 0.060 0.704 0.000 0.236 0.000
#> GSM254660     4  0.4982     0.2039 0.032 0.412 0.000 0.556 0.000
#> GSM254693     2  0.3551     0.7841 0.008 0.772 0.000 0.220 0.000
#> GSM254695     4  0.2608     0.5443 0.088 0.020 0.004 0.888 0.000
#> GSM254702     4  0.4898     0.3079 0.032 0.376 0.000 0.592 0.000
#> GSM254643     2  0.4806     0.7560 0.060 0.688 0.000 0.252 0.000
#> GSM254727     2  0.3728     0.7814 0.008 0.748 0.000 0.244 0.000
#> GSM254640     4  0.4360     0.4340 0.020 0.300 0.000 0.680 0.000
#> GSM254626     2  0.4451     0.7670 0.040 0.712 0.000 0.248 0.000
#> GSM254635     4  0.2790     0.5841 0.068 0.052 0.000 0.880 0.000
#> GSM254653     2  0.3756     0.7807 0.008 0.744 0.000 0.248 0.000
#> GSM254658     2  0.4762     0.7703 0.064 0.700 0.000 0.236 0.000
#> GSM254681     2  0.5237     0.7433 0.100 0.664 0.000 0.236 0.000
#> GSM254719     2  0.4276     0.7610 0.028 0.716 0.000 0.256 0.000
#> GSM254673     2  0.4378     0.7653 0.036 0.716 0.000 0.248 0.000
#> GSM254655     2  0.4546     0.6849 0.028 0.668 0.000 0.304 0.000
#> GSM254669     2  0.4352     0.7680 0.036 0.720 0.000 0.244 0.000
#> GSM254699     2  0.4442     0.7234 0.028 0.688 0.000 0.284 0.000
#> GSM254703     4  0.1281     0.5903 0.032 0.012 0.000 0.956 0.000
#> GSM254708     4  0.6257    -0.2684 0.148 0.392 0.000 0.460 0.000
#> GSM254715     4  0.4179     0.5510 0.072 0.152 0.000 0.776 0.000
#> GSM254628     2  0.4701     0.7722 0.060 0.704 0.000 0.236 0.000
#> GSM254634     4  0.0703     0.5861 0.024 0.000 0.000 0.976 0.000
#> GSM254646     2  0.4906     0.7656 0.076 0.692 0.000 0.232 0.000
#> GSM254671     4  0.4836     0.3409 0.032 0.356 0.000 0.612 0.000
#> GSM254711     4  0.1018     0.5891 0.016 0.016 0.000 0.968 0.000
#> GSM254717     2  0.3728     0.7820 0.008 0.748 0.000 0.244 0.000
#> GSM254723     3  0.1729     0.9091 0.032 0.012 0.944 0.004 0.008
#> GSM254730     4  0.4410     0.1405 0.004 0.440 0.000 0.556 0.000
#> GSM254731     4  0.4824     0.3081 0.028 0.376 0.000 0.596 0.000
#> GSM254632     3  0.4513     0.7547 0.096 0.012 0.784 0.104 0.004
#> GSM254662     2  0.4404     0.7633 0.036 0.712 0.000 0.252 0.000
#> GSM254677     4  0.1282     0.5886 0.044 0.004 0.000 0.952 0.000
#> GSM254665     2  0.5864     0.6149 0.120 0.560 0.000 0.320 0.000
#> GSM254691     4  0.5996    -0.2453 0.116 0.388 0.000 0.496 0.000
#> GSM254644     4  0.4503     0.4208 0.024 0.312 0.000 0.664 0.000
#> GSM254667     4  0.6405    -0.2456 0.176 0.364 0.000 0.460 0.000
#> GSM254676     4  0.6007    -0.2585 0.116 0.396 0.000 0.488 0.000
#> GSM254679     4  0.0798     0.5875 0.016 0.008 0.000 0.976 0.000
#> GSM254689     2  0.5258     0.7458 0.104 0.664 0.000 0.232 0.000
#> GSM254706     4  0.6395    -0.3374 0.168 0.408 0.000 0.424 0.000
#> GSM254712     4  0.4212     0.5523 0.080 0.144 0.000 0.776 0.000
#> GSM254713     4  0.4197     0.5516 0.076 0.148 0.000 0.776 0.000
#> GSM254683     2  0.6325     0.3175 0.156 0.428 0.000 0.416 0.000
#> GSM254710     2  0.9439     0.0693 0.184 0.364 0.120 0.208 0.124
#> GSM254725     4  0.0609     0.5871 0.020 0.000 0.000 0.980 0.000
#> GSM254651     2  0.6312     0.3548 0.156 0.452 0.000 0.392 0.000
#> GSM254638     4  0.1943     0.5864 0.056 0.020 0.000 0.924 0.000
#> GSM254685     4  0.4197     0.5516 0.076 0.148 0.000 0.776 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
#> GSM254629     3  0.2034    0.84467 0.008 0.000 0.924 0.024 0.012 0.032
#> GSM254648     3  0.2189    0.83993 0.008 0.000 0.912 0.032 0.004 0.044
#> GSM254694     3  0.1899    0.84273 0.008 0.000 0.928 0.028 0.004 0.032
#> GSM254701     3  0.1785    0.84434 0.008 0.000 0.936 0.016 0.012 0.028
#> GSM254728     3  0.1732    0.84653 0.000 0.000 0.920 0.004 0.004 0.072
#> GSM254726     3  0.1078    0.84717 0.008 0.000 0.964 0.012 0.000 0.016
#> GSM254639     3  0.4056    0.77493 0.020 0.000 0.748 0.016 0.008 0.208
#> GSM254652     3  0.2174    0.84570 0.000 0.000 0.896 0.008 0.008 0.088
#> GSM254700     1  0.2454    0.77662 0.840 0.000 0.000 0.000 0.160 0.000
#> GSM254625     5  0.4947    0.46851 0.004 0.000 0.272 0.012 0.648 0.064
#> GSM254636     5  0.6296    0.42524 0.104 0.000 0.048 0.008 0.512 0.328
#> GSM254659     3  0.1442    0.85088 0.000 0.000 0.944 0.004 0.012 0.040
#> GSM254680     5  0.4922    0.59062 0.036 0.000 0.044 0.016 0.712 0.192
#> GSM254686     5  0.4880    0.40151 0.000 0.000 0.344 0.012 0.596 0.048
#> GSM254718     3  0.0551    0.85156 0.004 0.000 0.984 0.000 0.008 0.004
#> GSM254674     5  0.3963    0.61135 0.000 0.000 0.040 0.012 0.756 0.192
#> GSM254668     5  0.2384    0.63289 0.000 0.000 0.040 0.016 0.900 0.044
#> GSM254697     1  0.5753    0.75896 0.628 0.000 0.000 0.072 0.204 0.096
#> GSM254704     1  0.2624    0.77501 0.844 0.000 0.004 0.000 0.148 0.004
#> GSM254707     5  0.1737    0.63351 0.000 0.000 0.040 0.008 0.932 0.020
#> GSM254714     3  0.3914    0.69842 0.228 0.000 0.740 0.004 0.012 0.016
#> GSM254722     1  0.5984    0.74741 0.608 0.000 0.000 0.076 0.196 0.120
#> GSM254627     1  0.5753    0.75896 0.628 0.000 0.000 0.072 0.204 0.096
#> GSM254630     5  0.4989    0.52187 0.016 0.000 0.168 0.020 0.712 0.084
#> GSM254633     5  0.6410    0.51313 0.104 0.000 0.084 0.016 0.588 0.208
#> GSM254670     3  0.5483    0.59131 0.020 0.000 0.576 0.016 0.052 0.336
#> GSM254716     5  0.5092    0.42836 0.004 0.000 0.292 0.008 0.620 0.076
#> GSM254720     1  0.5409    0.55876 0.644 0.000 0.216 0.008 0.116 0.016
#> GSM254729     3  0.1909    0.85003 0.004 0.000 0.920 0.024 0.000 0.052
#> GSM254654     3  0.1973    0.84172 0.008 0.000 0.924 0.028 0.004 0.036
#> GSM254656     3  0.5269    0.71200 0.032 0.000 0.640 0.064 0.004 0.260
#> GSM254631     5  0.6320    0.51463 0.104 0.000 0.076 0.016 0.596 0.208
#> GSM254657     3  0.4945    0.73701 0.020 0.000 0.692 0.016 0.052 0.220
#> GSM254664     5  0.5956    0.53475 0.100 0.000 0.056 0.016 0.632 0.196
#> GSM254672     1  0.3224    0.76060 0.824 0.000 0.004 0.000 0.132 0.040
#> GSM254692     5  0.4864   -0.33609 0.448 0.000 0.000 0.024 0.508 0.020
#> GSM254645     3  0.4028    0.77737 0.020 0.000 0.752 0.016 0.008 0.204
#> GSM254666     5  0.5076    0.41865 0.000 0.000 0.288 0.008 0.616 0.088
#> GSM254675     1  0.4456    0.21636 0.520 0.000 0.020 0.000 0.456 0.004
#> GSM254678     5  0.6557    0.13723 0.304 0.000 0.016 0.004 0.392 0.284
#> GSM254688     5  0.1116    0.61565 0.008 0.000 0.000 0.004 0.960 0.028
#> GSM254690     5  0.5297    0.51185 0.100 0.000 0.008 0.016 0.652 0.224
#> GSM254696     5  0.6379    0.40125 0.096 0.000 0.064 0.004 0.480 0.356
#> GSM254705     5  0.2471    0.59046 0.044 0.000 0.000 0.020 0.896 0.040
#> GSM254642     1  0.5801    0.75799 0.624 0.000 0.000 0.076 0.204 0.096
#> GSM254661     3  0.2110    0.84515 0.000 0.000 0.900 0.012 0.004 0.084
#> GSM254698     1  0.6827    0.50929 0.404 0.000 0.004 0.056 0.176 0.360
#> GSM254641     5  0.3780    0.63307 0.004 0.000 0.096 0.020 0.812 0.068
#> GSM254647     1  0.5952    0.64869 0.544 0.000 0.000 0.036 0.300 0.120
#> GSM254663     5  0.2510    0.56095 0.060 0.000 0.000 0.024 0.892 0.024
#> GSM254682     5  0.1268    0.61590 0.008 0.000 0.000 0.004 0.952 0.036
#> GSM254709     5  0.4024    0.54355 0.012 0.000 0.192 0.012 0.760 0.024
#> GSM254721     1  0.2595    0.77622 0.836 0.000 0.000 0.004 0.160 0.000
#> GSM254724     1  0.2454    0.77662 0.840 0.000 0.000 0.000 0.160 0.000
#> GSM254650     5  0.1526    0.60330 0.036 0.000 0.004 0.008 0.944 0.008
#> GSM254687     5  0.1893    0.60279 0.036 0.000 0.004 0.008 0.928 0.024
#> GSM254637     5  0.6485    0.50893 0.112 0.000 0.084 0.016 0.580 0.208
#> GSM254684     5  0.6375    0.39894 0.100 0.000 0.060 0.004 0.476 0.360
#> GSM254649     2  0.3626    0.49334 0.020 0.800 0.000 0.032 0.000 0.148
#> GSM254660     2  0.3827    0.22777 0.008 0.680 0.000 0.308 0.000 0.004
#> GSM254693     2  0.1151    0.57865 0.012 0.956 0.000 0.000 0.000 0.032
#> GSM254695     4  0.5112    0.58641 0.012 0.136 0.008 0.684 0.000 0.160
#> GSM254702     2  0.4224    0.08877 0.008 0.640 0.000 0.336 0.000 0.016
#> GSM254643     2  0.2116    0.57590 0.024 0.916 0.000 0.024 0.000 0.036
#> GSM254727     2  0.1788    0.57412 0.004 0.928 0.000 0.040 0.000 0.028
#> GSM254640     2  0.6002   -0.37595 0.060 0.436 0.000 0.436 0.000 0.068
#> GSM254626     2  0.1346    0.58758 0.016 0.952 0.000 0.024 0.000 0.008
#> GSM254635     4  0.4046    0.78463 0.020 0.208 0.000 0.744 0.000 0.028
#> GSM254653     2  0.1624    0.57742 0.004 0.936 0.000 0.040 0.000 0.020
#> GSM254658     2  0.3626    0.49334 0.020 0.800 0.000 0.032 0.000 0.148
#> GSM254681     2  0.4146    0.42369 0.020 0.736 0.000 0.032 0.000 0.212
#> GSM254719     2  0.1080    0.58750 0.004 0.960 0.000 0.032 0.000 0.004
#> GSM254673     2  0.0777    0.58797 0.000 0.972 0.000 0.024 0.000 0.004
#> GSM254655     2  0.2261    0.57034 0.008 0.884 0.000 0.104 0.000 0.004
#> GSM254669     2  0.0891    0.58764 0.000 0.968 0.000 0.024 0.000 0.008
#> GSM254699     2  0.1787    0.58123 0.008 0.920 0.000 0.068 0.000 0.004
#> GSM254703     4  0.4745    0.78569 0.052 0.184 0.000 0.716 0.000 0.048
#> GSM254708     2  0.5956   -0.17625 0.004 0.488 0.000 0.272 0.000 0.236
#> GSM254715     4  0.6195    0.68485 0.084 0.308 0.000 0.528 0.000 0.080
#> GSM254628     2  0.3663    0.49115 0.020 0.796 0.000 0.032 0.000 0.152
#> GSM254634     4  0.3203    0.77785 0.004 0.160 0.000 0.812 0.000 0.024
#> GSM254646     2  0.3865    0.46202 0.020 0.768 0.000 0.028 0.000 0.184
#> GSM254671     2  0.4015   -0.03285 0.004 0.596 0.000 0.396 0.000 0.004
#> GSM254711     4  0.2980    0.77845 0.000 0.180 0.000 0.808 0.000 0.012
#> GSM254717     2  0.1829    0.57572 0.008 0.928 0.000 0.036 0.000 0.028
#> GSM254723     3  0.2677    0.81763 0.024 0.000 0.884 0.036 0.000 0.056
#> GSM254730     2  0.4159    0.30543 0.008 0.672 0.000 0.300 0.000 0.020
#> GSM254731     2  0.4074    0.08906 0.008 0.640 0.000 0.344 0.000 0.008
#> GSM254632     3  0.4838    0.60255 0.020 0.000 0.696 0.092 0.000 0.192
#> GSM254662     2  0.1049    0.58815 0.000 0.960 0.000 0.032 0.000 0.008
#> GSM254677     4  0.4949    0.76079 0.072 0.136 0.000 0.720 0.000 0.072
#> GSM254665     2  0.5107    0.41162 0.032 0.688 0.000 0.160 0.000 0.120
#> GSM254691     2  0.5799   -0.01788 0.004 0.500 0.000 0.320 0.000 0.176
#> GSM254644     2  0.6043   -0.34151 0.064 0.448 0.000 0.420 0.000 0.068
#> GSM254667     2  0.6121   -0.36680 0.004 0.420 0.000 0.244 0.000 0.332
#> GSM254676     2  0.5778   -0.00643 0.004 0.508 0.000 0.312 0.000 0.176
#> GSM254679     4  0.3053    0.77973 0.004 0.172 0.000 0.812 0.000 0.012
#> GSM254689     2  0.4146    0.43141 0.020 0.736 0.000 0.032 0.000 0.212
#> GSM254706     2  0.5828   -0.32134 0.004 0.480 0.000 0.172 0.000 0.344
#> GSM254712     4  0.6195    0.68485 0.084 0.308 0.000 0.528 0.000 0.080
#> GSM254713     4  0.6195    0.68485 0.084 0.308 0.000 0.528 0.000 0.080
#> GSM254683     2  0.5562   -0.15493 0.000 0.532 0.000 0.168 0.000 0.300
#> GSM254710     6  0.8197    0.00000 0.016 0.284 0.076 0.176 0.064 0.384
#> GSM254725     4  0.3139    0.77489 0.000 0.152 0.000 0.816 0.000 0.032
#> GSM254651     2  0.5684   -0.11978 0.008 0.536 0.000 0.148 0.000 0.308
#> GSM254638     4  0.4217    0.78930 0.024 0.184 0.000 0.748 0.000 0.044
#> GSM254685     4  0.6236    0.68412 0.088 0.308 0.000 0.524 0.000 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-SD-kmeans-consensus-heatmap-1

consensus_heatmap(res, k = 3)

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

consensus_heatmap(res, k = 4)

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

consensus_heatmap(res, k = 5)

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

consensus_heatmap(res, k = 6)

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

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

membership_heatmap(res, k = 2)

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

membership_heatmap(res, k = 3)

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

membership_heatmap(res, k = 4)

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

membership_heatmap(res, k = 5)

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

membership_heatmap(res, k = 6)

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

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

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

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

get_signatures(res, k = 3)

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

get_signatures(res, k = 4)

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

get_signatures(res, k = 5)

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

get_signatures(res, k = 6)

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

Signature heatmaps where rows are not scaled:

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

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

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

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

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

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

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

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

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

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

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk SD-kmeans-signature_compare

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

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

An example of the output of tb is:

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

The columns in tb are:

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

UMAP plot which shows how samples are separated.

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

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

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

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

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

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

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

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

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

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

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk SD-kmeans-collect-classes

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

test_to_known_factors(res)
#>             n tissue(p) individual(p) disease.state(p) gender(p) other(p) k
#> SD:kmeans 107  1.59e-22      0.776968            0.577    0.6277    0.872 2
#> SD:kmeans 105  6.36e-22      0.001993            0.542    0.1057    0.892 3
#> SD:kmeans  58  3.26e-01      0.000295            0.397    0.1040    1.000 4
#> SD:kmeans  71  4.63e-13      0.029332            0.351    0.2152    0.295 5
#> SD:kmeans  75  8.90e-14      0.003035            0.252    0.0854    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.


SD:skmeans**

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

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

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

res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#>   On a matrix with 21168 rows and 107 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.991       0.996         0.5027 0.497   0.497
#> 3 3 0.844           0.909       0.944         0.2612 0.857   0.716
#> 4 4 0.699           0.752       0.779         0.1159 0.892   0.709
#> 5 5 0.669           0.555       0.739         0.0785 0.868   0.572
#> 6 6 0.660           0.597       0.756         0.0512 0.922   0.674

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
#> GSM254629     1   0.000      0.998 1.000 0.000
#> GSM254648     2   0.518      0.868 0.116 0.884
#> GSM254694     1   0.000      0.998 1.000 0.000
#> GSM254701     1   0.000      0.998 1.000 0.000
#> GSM254728     1   0.000      0.998 1.000 0.000
#> GSM254726     1   0.416      0.908 0.916 0.084
#> GSM254639     1   0.000      0.998 1.000 0.000
#> GSM254652     1   0.000      0.998 1.000 0.000
#> GSM254700     1   0.000      0.998 1.000 0.000
#> GSM254625     1   0.000      0.998 1.000 0.000
#> GSM254636     1   0.000      0.998 1.000 0.000
#> GSM254659     1   0.000      0.998 1.000 0.000
#> GSM254680     1   0.000      0.998 1.000 0.000
#> GSM254686     1   0.000      0.998 1.000 0.000
#> GSM254718     1   0.000      0.998 1.000 0.000
#> GSM254674     1   0.000      0.998 1.000 0.000
#> GSM254668     1   0.000      0.998 1.000 0.000
#> GSM254697     1   0.000      0.998 1.000 0.000
#> GSM254704     1   0.000      0.998 1.000 0.000
#> GSM254707     1   0.000      0.998 1.000 0.000
#> GSM254714     1   0.000      0.998 1.000 0.000
#> GSM254722     1   0.000      0.998 1.000 0.000
#> GSM254627     1   0.000      0.998 1.000 0.000
#> GSM254630     1   0.000      0.998 1.000 0.000
#> GSM254633     1   0.000      0.998 1.000 0.000
#> GSM254670     1   0.000      0.998 1.000 0.000
#> GSM254716     1   0.000      0.998 1.000 0.000
#> GSM254720     1   0.000      0.998 1.000 0.000
#> GSM254729     1   0.000      0.998 1.000 0.000
#> GSM254654     1   0.000      0.998 1.000 0.000
#> GSM254656     1   0.184      0.970 0.972 0.028
#> GSM254631     1   0.000      0.998 1.000 0.000
#> GSM254657     1   0.000      0.998 1.000 0.000
#> GSM254664     1   0.000      0.998 1.000 0.000
#> GSM254672     1   0.000      0.998 1.000 0.000
#> GSM254692     1   0.000      0.998 1.000 0.000
#> GSM254645     1   0.000      0.998 1.000 0.000
#> GSM254666     1   0.000      0.998 1.000 0.000
#> GSM254675     1   0.000      0.998 1.000 0.000
#> GSM254678     1   0.000      0.998 1.000 0.000
#> GSM254688     1   0.000      0.998 1.000 0.000
#> GSM254690     1   0.000      0.998 1.000 0.000
#> GSM254696     1   0.000      0.998 1.000 0.000
#> GSM254705     1   0.000      0.998 1.000 0.000
#> GSM254642     1   0.000      0.998 1.000 0.000
#> GSM254661     1   0.000      0.998 1.000 0.000
#> GSM254698     1   0.000      0.998 1.000 0.000
#> GSM254641     1   0.000      0.998 1.000 0.000
#> GSM254647     1   0.000      0.998 1.000 0.000
#> GSM254663     1   0.000      0.998 1.000 0.000
#> GSM254682     1   0.000      0.998 1.000 0.000
#> GSM254709     1   0.000      0.998 1.000 0.000
#> GSM254721     1   0.000      0.998 1.000 0.000
#> GSM254724     1   0.000      0.998 1.000 0.000
#> GSM254650     1   0.000      0.998 1.000 0.000
#> GSM254687     1   0.000      0.998 1.000 0.000
#> GSM254637     1   0.000      0.998 1.000 0.000
#> GSM254684     1   0.000      0.998 1.000 0.000
#> GSM254649     2   0.000      0.993 0.000 1.000
#> GSM254660     2   0.000      0.993 0.000 1.000
#> GSM254693     2   0.000      0.993 0.000 1.000
#> GSM254695     2   0.000      0.993 0.000 1.000
#> GSM254702     2   0.000      0.993 0.000 1.000
#> GSM254643     2   0.000      0.993 0.000 1.000
#> GSM254727     2   0.000      0.993 0.000 1.000
#> GSM254640     2   0.000      0.993 0.000 1.000
#> GSM254626     2   0.000      0.993 0.000 1.000
#> GSM254635     2   0.000      0.993 0.000 1.000
#> GSM254653     2   0.000      0.993 0.000 1.000
#> GSM254658     2   0.000      0.993 0.000 1.000
#> GSM254681     2   0.000      0.993 0.000 1.000
#> GSM254719     2   0.000      0.993 0.000 1.000
#> GSM254673     2   0.000      0.993 0.000 1.000
#> GSM254655     2   0.000      0.993 0.000 1.000
#> GSM254669     2   0.000      0.993 0.000 1.000
#> GSM254699     2   0.000      0.993 0.000 1.000
#> GSM254703     2   0.000      0.993 0.000 1.000
#> GSM254708     2   0.000      0.993 0.000 1.000
#> GSM254715     2   0.000      0.993 0.000 1.000
#> GSM254628     2   0.000      0.993 0.000 1.000
#> GSM254634     2   0.000      0.993 0.000 1.000
#> GSM254646     2   0.000      0.993 0.000 1.000
#> GSM254671     2   0.000      0.993 0.000 1.000
#> GSM254711     2   0.000      0.993 0.000 1.000
#> GSM254717     2   0.000      0.993 0.000 1.000
#> GSM254723     2   0.722      0.751 0.200 0.800
#> GSM254730     2   0.000      0.993 0.000 1.000
#> GSM254731     2   0.000      0.993 0.000 1.000
#> GSM254632     2   0.000      0.993 0.000 1.000
#> GSM254662     2   0.000      0.993 0.000 1.000
#> GSM254677     2   0.000      0.993 0.000 1.000
#> GSM254665     2   0.000      0.993 0.000 1.000
#> GSM254691     2   0.000      0.993 0.000 1.000
#> GSM254644     2   0.000      0.993 0.000 1.000
#> GSM254667     2   0.000      0.993 0.000 1.000
#> GSM254676     2   0.000      0.993 0.000 1.000
#> GSM254679     2   0.000      0.993 0.000 1.000
#> GSM254689     2   0.000      0.993 0.000 1.000
#> GSM254706     2   0.000      0.993 0.000 1.000
#> GSM254712     2   0.000      0.993 0.000 1.000
#> GSM254713     2   0.000      0.993 0.000 1.000
#> GSM254683     2   0.000      0.993 0.000 1.000
#> GSM254710     2   0.000      0.993 0.000 1.000
#> GSM254725     2   0.000      0.993 0.000 1.000
#> GSM254651     2   0.000      0.993 0.000 1.000
#> GSM254638     2   0.000      0.993 0.000 1.000
#> GSM254685     2   0.000      0.993 0.000 1.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1    p2    p3
#> GSM254629     3  0.0424      0.845 0.008 0.000 0.992
#> GSM254648     3  0.0424      0.842 0.000 0.008 0.992
#> GSM254694     3  0.3038      0.877 0.104 0.000 0.896
#> GSM254701     3  0.3038      0.877 0.104 0.000 0.896
#> GSM254728     3  0.3267      0.877 0.116 0.000 0.884
#> GSM254726     3  0.0000      0.842 0.000 0.000 1.000
#> GSM254639     3  0.3340      0.876 0.120 0.000 0.880
#> GSM254652     3  0.0892      0.847 0.020 0.000 0.980
#> GSM254700     1  0.0000      0.919 1.000 0.000 0.000
#> GSM254625     1  0.5560      0.663 0.700 0.000 0.300
#> GSM254636     1  0.0424      0.916 0.992 0.000 0.008
#> GSM254659     3  0.3192      0.878 0.112 0.000 0.888
#> GSM254680     1  0.0592      0.916 0.988 0.000 0.012
#> GSM254686     1  0.6062      0.503 0.616 0.000 0.384
#> GSM254718     3  0.3038      0.877 0.104 0.000 0.896
#> GSM254674     1  0.0592      0.916 0.988 0.000 0.012
#> GSM254668     1  0.3192      0.883 0.888 0.000 0.112
#> GSM254697     1  0.0000      0.919 1.000 0.000 0.000
#> GSM254704     1  0.0237      0.918 0.996 0.000 0.004
#> GSM254707     1  0.3192      0.883 0.888 0.000 0.112
#> GSM254714     3  0.6291      0.388 0.468 0.000 0.532
#> GSM254722     1  0.0000      0.919 1.000 0.000 0.000
#> GSM254627     1  0.0000      0.919 1.000 0.000 0.000
#> GSM254630     1  0.2878      0.889 0.904 0.000 0.096
#> GSM254633     1  0.1031      0.910 0.976 0.000 0.024
#> GSM254670     3  0.5291      0.763 0.268 0.000 0.732
#> GSM254716     1  0.6045      0.511 0.620 0.000 0.380
#> GSM254720     1  0.3551      0.775 0.868 0.000 0.132
#> GSM254729     3  0.3267      0.877 0.116 0.000 0.884
#> GSM254654     3  0.3038      0.877 0.104 0.000 0.896
#> GSM254656     3  0.4796      0.811 0.220 0.000 0.780
#> GSM254631     1  0.0000      0.919 1.000 0.000 0.000
#> GSM254657     3  0.5138      0.783 0.252 0.000 0.748
#> GSM254664     1  0.0424      0.917 0.992 0.000 0.008
#> GSM254672     1  0.0237      0.918 0.996 0.000 0.004
#> GSM254692     1  0.2878      0.889 0.904 0.000 0.096
#> GSM254645     3  0.6302      0.360 0.480 0.000 0.520
#> GSM254666     1  0.5497      0.672 0.708 0.000 0.292
#> GSM254675     1  0.0000      0.919 1.000 0.000 0.000
#> GSM254678     1  0.0237      0.918 0.996 0.000 0.004
#> GSM254688     1  0.2878      0.889 0.904 0.000 0.096
#> GSM254690     1  0.0000      0.919 1.000 0.000 0.000
#> GSM254696     1  0.0424      0.916 0.992 0.000 0.008
#> GSM254705     1  0.2878      0.889 0.904 0.000 0.096
#> GSM254642     1  0.0000      0.919 1.000 0.000 0.000
#> GSM254661     3  0.0592      0.846 0.012 0.000 0.988
#> GSM254698     1  0.0237      0.918 0.996 0.000 0.004
#> GSM254641     1  0.3116      0.884 0.892 0.000 0.108
#> GSM254647     1  0.0000      0.919 1.000 0.000 0.000
#> GSM254663     1  0.2878      0.889 0.904 0.000 0.096
#> GSM254682     1  0.2878      0.889 0.904 0.000 0.096
#> GSM254709     1  0.3038      0.886 0.896 0.000 0.104
#> GSM254721     1  0.0000      0.919 1.000 0.000 0.000
#> GSM254724     1  0.0000      0.919 1.000 0.000 0.000
#> GSM254650     1  0.2878      0.889 0.904 0.000 0.096
#> GSM254687     1  0.2878      0.889 0.904 0.000 0.096
#> GSM254637     1  0.0237      0.918 0.996 0.000 0.004
#> GSM254684     1  0.0237      0.918 0.996 0.000 0.004
#> GSM254649     2  0.0000      0.992 0.000 1.000 0.000
#> GSM254660     2  0.0000      0.992 0.000 1.000 0.000
#> GSM254693     2  0.0000      0.992 0.000 1.000 0.000
#> GSM254695     2  0.0424      0.990 0.000 0.992 0.008
#> GSM254702     2  0.0424      0.990 0.000 0.992 0.008
#> GSM254643     2  0.0000      0.992 0.000 1.000 0.000
#> GSM254727     2  0.0000      0.992 0.000 1.000 0.000
#> GSM254640     2  0.0424      0.990 0.000 0.992 0.008
#> GSM254626     2  0.0000      0.992 0.000 1.000 0.000
#> GSM254635     2  0.0424      0.990 0.000 0.992 0.008
#> GSM254653     2  0.0000      0.992 0.000 1.000 0.000
#> GSM254658     2  0.0000      0.992 0.000 1.000 0.000
#> GSM254681     2  0.0000      0.992 0.000 1.000 0.000
#> GSM254719     2  0.0000      0.992 0.000 1.000 0.000
#> GSM254673     2  0.0000      0.992 0.000 1.000 0.000
#> GSM254655     2  0.0000      0.992 0.000 1.000 0.000
#> GSM254669     2  0.0000      0.992 0.000 1.000 0.000
#> GSM254699     2  0.0000      0.992 0.000 1.000 0.000
#> GSM254703     2  0.0424      0.990 0.000 0.992 0.008
#> GSM254708     2  0.0000      0.992 0.000 1.000 0.000
#> GSM254715     2  0.0424      0.990 0.000 0.992 0.008
#> GSM254628     2  0.0000      0.992 0.000 1.000 0.000
#> GSM254634     2  0.0424      0.990 0.000 0.992 0.008
#> GSM254646     2  0.0000      0.992 0.000 1.000 0.000
#> GSM254671     2  0.0424      0.990 0.000 0.992 0.008
#> GSM254711     2  0.0424      0.990 0.000 0.992 0.008
#> GSM254717     2  0.0000      0.992 0.000 1.000 0.000
#> GSM254723     3  0.4551      0.767 0.020 0.140 0.840
#> GSM254730     2  0.0000      0.992 0.000 1.000 0.000
#> GSM254731     2  0.0424      0.990 0.000 0.992 0.008
#> GSM254632     2  0.4128      0.838 0.012 0.856 0.132
#> GSM254662     2  0.0000      0.992 0.000 1.000 0.000
#> GSM254677     2  0.0424      0.990 0.000 0.992 0.008
#> GSM254665     2  0.0000      0.992 0.000 1.000 0.000
#> GSM254691     2  0.0000      0.992 0.000 1.000 0.000
#> GSM254644     2  0.0424      0.990 0.000 0.992 0.008
#> GSM254667     2  0.0000      0.992 0.000 1.000 0.000
#> GSM254676     2  0.0000      0.992 0.000 1.000 0.000
#> GSM254679     2  0.0424      0.990 0.000 0.992 0.008
#> GSM254689     2  0.0000      0.992 0.000 1.000 0.000
#> GSM254706     2  0.0000      0.992 0.000 1.000 0.000
#> GSM254712     2  0.0424      0.990 0.000 0.992 0.008
#> GSM254713     2  0.0424      0.990 0.000 0.992 0.008
#> GSM254683     2  0.0000      0.992 0.000 1.000 0.000
#> GSM254710     2  0.2878      0.891 0.000 0.904 0.096
#> GSM254725     2  0.0424      0.990 0.000 0.992 0.008
#> GSM254651     2  0.0000      0.992 0.000 1.000 0.000
#> GSM254638     2  0.0424      0.990 0.000 0.992 0.008
#> GSM254685     2  0.0424      0.990 0.000 0.992 0.008

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM254629     3  0.4283      0.798 0.004 0.256 0.740 0.000
#> GSM254648     3  0.4164      0.797 0.000 0.264 0.736 0.000
#> GSM254694     3  0.4767      0.802 0.020 0.256 0.724 0.000
#> GSM254701     3  0.4767      0.802 0.020 0.256 0.724 0.000
#> GSM254728     3  0.1724      0.810 0.032 0.020 0.948 0.000
#> GSM254726     3  0.4193      0.801 0.000 0.268 0.732 0.000
#> GSM254639     3  0.1151      0.811 0.024 0.008 0.968 0.000
#> GSM254652     3  0.0779      0.805 0.004 0.016 0.980 0.000
#> GSM254700     1  0.0000      0.852 1.000 0.000 0.000 0.000
#> GSM254625     1  0.7285      0.570 0.520 0.180 0.300 0.000
#> GSM254636     1  0.4050      0.813 0.808 0.024 0.168 0.000
#> GSM254659     3  0.1833      0.815 0.024 0.032 0.944 0.000
#> GSM254680     1  0.3616      0.840 0.852 0.036 0.112 0.000
#> GSM254686     1  0.6973      0.615 0.556 0.144 0.300 0.000
#> GSM254718     3  0.3659      0.817 0.024 0.136 0.840 0.000
#> GSM254674     1  0.3842      0.835 0.836 0.036 0.128 0.000
#> GSM254668     1  0.5483      0.806 0.736 0.128 0.136 0.000
#> GSM254697     1  0.0188      0.852 0.996 0.004 0.000 0.000
#> GSM254704     1  0.0000      0.852 1.000 0.000 0.000 0.000
#> GSM254707     1  0.5719      0.795 0.716 0.132 0.152 0.000
#> GSM254714     3  0.5161      0.304 0.476 0.004 0.520 0.000
#> GSM254722     1  0.0779      0.853 0.980 0.004 0.016 0.000
#> GSM254627     1  0.0188      0.852 0.996 0.004 0.000 0.000
#> GSM254630     1  0.4840      0.804 0.784 0.100 0.116 0.000
#> GSM254633     1  0.3907      0.829 0.828 0.032 0.140 0.000
#> GSM254670     3  0.4957      0.624 0.204 0.048 0.748 0.000
#> GSM254716     1  0.7359      0.543 0.504 0.184 0.312 0.000
#> GSM254720     1  0.3583      0.665 0.816 0.004 0.180 0.000
#> GSM254729     3  0.1305      0.811 0.036 0.004 0.960 0.000
#> GSM254654     3  0.4767      0.802 0.020 0.256 0.724 0.000
#> GSM254656     3  0.7605      0.424 0.032 0.104 0.516 0.348
#> GSM254631     1  0.2385      0.857 0.920 0.028 0.052 0.000
#> GSM254657     3  0.3667      0.753 0.088 0.056 0.856 0.000
#> GSM254664     1  0.2385      0.857 0.920 0.028 0.052 0.000
#> GSM254672     1  0.0707      0.848 0.980 0.000 0.020 0.000
#> GSM254692     1  0.2973      0.837 0.884 0.096 0.020 0.000
#> GSM254645     3  0.5080      0.393 0.420 0.004 0.576 0.000
#> GSM254666     1  0.7039      0.606 0.540 0.144 0.316 0.000
#> GSM254675     1  0.0000      0.852 1.000 0.000 0.000 0.000
#> GSM254678     1  0.1767      0.850 0.944 0.012 0.044 0.000
#> GSM254688     1  0.5676      0.801 0.720 0.136 0.144 0.000
#> GSM254690     1  0.2943      0.853 0.892 0.032 0.076 0.000
#> GSM254696     1  0.5021      0.746 0.724 0.036 0.240 0.000
#> GSM254705     1  0.3616      0.838 0.852 0.112 0.036 0.000
#> GSM254642     1  0.0188      0.852 0.996 0.004 0.000 0.000
#> GSM254661     3  0.1118      0.815 0.000 0.036 0.964 0.000
#> GSM254698     1  0.1890      0.843 0.936 0.008 0.056 0.000
#> GSM254641     1  0.3833      0.853 0.848 0.072 0.080 0.000
#> GSM254647     1  0.0000      0.852 1.000 0.000 0.000 0.000
#> GSM254663     1  0.2973      0.841 0.884 0.096 0.020 0.000
#> GSM254682     1  0.5897      0.787 0.700 0.136 0.164 0.000
#> GSM254709     1  0.3205      0.836 0.872 0.104 0.024 0.000
#> GSM254721     1  0.0000      0.852 1.000 0.000 0.000 0.000
#> GSM254724     1  0.0000      0.852 1.000 0.000 0.000 0.000
#> GSM254650     1  0.3278      0.837 0.864 0.116 0.020 0.000
#> GSM254687     1  0.3278      0.837 0.864 0.116 0.020 0.000
#> GSM254637     1  0.2300      0.857 0.924 0.028 0.048 0.000
#> GSM254684     1  0.4406      0.793 0.780 0.028 0.192 0.000
#> GSM254649     2  0.4998      0.933 0.000 0.512 0.000 0.488
#> GSM254660     4  0.4304     -0.111 0.000 0.284 0.000 0.716
#> GSM254693     2  0.4999      0.932 0.000 0.508 0.000 0.492
#> GSM254695     4  0.1557      0.731 0.000 0.056 0.000 0.944
#> GSM254702     4  0.1302      0.760 0.000 0.044 0.000 0.956
#> GSM254643     2  0.5000      0.930 0.000 0.504 0.000 0.496
#> GSM254727     2  0.4998      0.933 0.000 0.512 0.000 0.488
#> GSM254640     4  0.1716      0.738 0.000 0.064 0.000 0.936
#> GSM254626     2  0.5000      0.930 0.000 0.504 0.000 0.496
#> GSM254635     4  0.0000      0.792 0.000 0.000 0.000 1.000
#> GSM254653     2  0.4999      0.931 0.000 0.508 0.000 0.492
#> GSM254658     2  0.4998      0.933 0.000 0.512 0.000 0.488
#> GSM254681     2  0.4998      0.933 0.000 0.512 0.000 0.488
#> GSM254719     2  0.5000      0.930 0.000 0.504 0.000 0.496
#> GSM254673     2  0.5000      0.930 0.000 0.504 0.000 0.496
#> GSM254655     4  0.4843     -0.635 0.000 0.396 0.000 0.604
#> GSM254669     2  0.4999      0.932 0.000 0.508 0.000 0.492
#> GSM254699     4  0.4843     -0.635 0.000 0.396 0.000 0.604
#> GSM254703     4  0.0000      0.792 0.000 0.000 0.000 1.000
#> GSM254708     2  0.4998      0.933 0.000 0.512 0.000 0.488
#> GSM254715     4  0.0000      0.792 0.000 0.000 0.000 1.000
#> GSM254628     2  0.4998      0.933 0.000 0.512 0.000 0.488
#> GSM254634     4  0.0188      0.791 0.000 0.004 0.000 0.996
#> GSM254646     2  0.4999      0.932 0.000 0.508 0.000 0.492
#> GSM254671     4  0.1557      0.745 0.000 0.056 0.000 0.944
#> GSM254711     4  0.0336      0.791 0.000 0.008 0.000 0.992
#> GSM254717     2  0.4998      0.933 0.000 0.512 0.000 0.488
#> GSM254723     4  0.8057     -0.202 0.020 0.216 0.280 0.484
#> GSM254730     4  0.4356     -0.138 0.000 0.292 0.000 0.708
#> GSM254731     4  0.1557      0.745 0.000 0.056 0.000 0.944
#> GSM254632     2  0.5398      0.243 0.004 0.732 0.064 0.200
#> GSM254662     2  0.5000      0.930 0.000 0.504 0.000 0.496
#> GSM254677     4  0.0817      0.772 0.000 0.024 0.000 0.976
#> GSM254665     2  0.5000      0.930 0.000 0.504 0.000 0.496
#> GSM254691     2  0.4999      0.931 0.000 0.508 0.000 0.492
#> GSM254644     4  0.1389      0.760 0.000 0.048 0.000 0.952
#> GSM254667     2  0.4972      0.881 0.000 0.544 0.000 0.456
#> GSM254676     2  0.4999      0.931 0.000 0.508 0.000 0.492
#> GSM254679     4  0.0336      0.791 0.000 0.008 0.000 0.992
#> GSM254689     2  0.4999      0.932 0.000 0.508 0.000 0.492
#> GSM254706     2  0.4972      0.881 0.000 0.544 0.000 0.456
#> GSM254712     4  0.0000      0.792 0.000 0.000 0.000 1.000
#> GSM254713     4  0.0000      0.792 0.000 0.000 0.000 1.000
#> GSM254683     2  0.4998      0.933 0.000 0.512 0.000 0.488
#> GSM254710     2  0.4933      0.540 0.000 0.688 0.016 0.296
#> GSM254725     4  0.0336      0.789 0.000 0.008 0.000 0.992
#> GSM254651     2  0.4998      0.933 0.000 0.512 0.000 0.488
#> GSM254638     4  0.0000      0.792 0.000 0.000 0.000 1.000
#> GSM254685     4  0.0336      0.790 0.000 0.008 0.000 0.992

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM254629     3  0.0486     0.8081 0.004 0.000 0.988 0.004 0.004
#> GSM254648     3  0.0162     0.8085 0.004 0.000 0.996 0.000 0.000
#> GSM254694     3  0.0162     0.8085 0.004 0.000 0.996 0.000 0.000
#> GSM254701     3  0.0324     0.8087 0.004 0.000 0.992 0.000 0.004
#> GSM254728     3  0.5390     0.5109 0.004 0.000 0.536 0.048 0.412
#> GSM254726     3  0.1216     0.8013 0.000 0.000 0.960 0.020 0.020
#> GSM254639     5  0.6021    -0.4465 0.020 0.000 0.444 0.064 0.472
#> GSM254652     3  0.5125     0.5256 0.000 0.000 0.544 0.040 0.416
#> GSM254700     1  0.0000     0.6364 1.000 0.000 0.000 0.000 0.000
#> GSM254625     5  0.4109     0.4285 0.192 0.000 0.004 0.036 0.768
#> GSM254636     1  0.5107     0.1977 0.520 0.000 0.004 0.028 0.448
#> GSM254659     3  0.4920     0.6027 0.008 0.000 0.620 0.024 0.348
#> GSM254680     1  0.4470     0.2350 0.596 0.000 0.004 0.004 0.396
#> GSM254686     5  0.4116     0.4039 0.248 0.000 0.016 0.004 0.732
#> GSM254718     3  0.3914     0.7477 0.012 0.000 0.780 0.016 0.192
#> GSM254674     1  0.4758     0.1502 0.552 0.000 0.004 0.012 0.432
#> GSM254668     5  0.4318     0.2637 0.348 0.000 0.004 0.004 0.644
#> GSM254697     1  0.0000     0.6364 1.000 0.000 0.000 0.000 0.000
#> GSM254704     1  0.1341     0.6199 0.944 0.000 0.000 0.000 0.056
#> GSM254707     5  0.4335     0.3081 0.324 0.000 0.004 0.008 0.664
#> GSM254714     1  0.4597     0.3320 0.672 0.000 0.300 0.004 0.024
#> GSM254722     1  0.2170     0.6048 0.904 0.000 0.004 0.004 0.088
#> GSM254627     1  0.0000     0.6364 1.000 0.000 0.000 0.000 0.000
#> GSM254630     5  0.4748    -0.0386 0.492 0.000 0.000 0.016 0.492
#> GSM254633     1  0.4299     0.3810 0.672 0.000 0.004 0.008 0.316
#> GSM254670     5  0.6549     0.1700 0.272 0.000 0.084 0.064 0.580
#> GSM254716     5  0.4270     0.4303 0.188 0.000 0.008 0.040 0.764
#> GSM254720     1  0.2291     0.6020 0.908 0.000 0.036 0.000 0.056
#> GSM254729     5  0.6212    -0.4024 0.048 0.000 0.440 0.044 0.468
#> GSM254654     3  0.0162     0.8085 0.004 0.000 0.996 0.000 0.000
#> GSM254656     4  0.5875    -0.1459 0.036 0.000 0.048 0.584 0.332
#> GSM254631     1  0.3585     0.5158 0.772 0.000 0.004 0.004 0.220
#> GSM254657     5  0.6621    -0.1850 0.080 0.000 0.300 0.064 0.556
#> GSM254664     1  0.3317     0.5272 0.804 0.000 0.004 0.004 0.188
#> GSM254672     1  0.2848     0.5452 0.840 0.000 0.004 0.000 0.156
#> GSM254692     1  0.4074     0.2496 0.636 0.000 0.000 0.000 0.364
#> GSM254645     1  0.6205     0.2541 0.584 0.000 0.060 0.052 0.304
#> GSM254666     5  0.3724     0.4275 0.204 0.000 0.000 0.020 0.776
#> GSM254675     1  0.0510     0.6335 0.984 0.000 0.000 0.000 0.016
#> GSM254678     1  0.3783     0.5167 0.768 0.000 0.004 0.012 0.216
#> GSM254688     5  0.4288     0.3080 0.324 0.000 0.000 0.012 0.664
#> GSM254690     1  0.3579     0.4759 0.756 0.000 0.000 0.004 0.240
#> GSM254696     5  0.5428    -0.0219 0.400 0.000 0.004 0.052 0.544
#> GSM254705     1  0.4481     0.1703 0.576 0.000 0.000 0.008 0.416
#> GSM254642     1  0.0000     0.6364 1.000 0.000 0.000 0.000 0.000
#> GSM254661     3  0.4193     0.7320 0.000 0.000 0.748 0.040 0.212
#> GSM254698     1  0.4496     0.4558 0.724 0.000 0.004 0.040 0.232
#> GSM254641     1  0.4580     0.0971 0.532 0.000 0.004 0.004 0.460
#> GSM254647     1  0.0404     0.6345 0.988 0.000 0.000 0.000 0.012
#> GSM254663     1  0.4030     0.2803 0.648 0.000 0.000 0.000 0.352
#> GSM254682     5  0.4213     0.3382 0.308 0.000 0.000 0.012 0.680
#> GSM254709     1  0.4331     0.2004 0.596 0.000 0.004 0.000 0.400
#> GSM254721     1  0.0000     0.6364 1.000 0.000 0.000 0.000 0.000
#> GSM254724     1  0.0000     0.6364 1.000 0.000 0.000 0.000 0.000
#> GSM254650     1  0.4390     0.1590 0.568 0.000 0.000 0.004 0.428
#> GSM254687     1  0.4390     0.1563 0.568 0.000 0.000 0.004 0.428
#> GSM254637     1  0.3422     0.5337 0.792 0.000 0.004 0.004 0.200
#> GSM254684     5  0.5377    -0.1384 0.456 0.000 0.004 0.044 0.496
#> GSM254649     2  0.0000     0.8701 0.000 1.000 0.000 0.000 0.000
#> GSM254660     2  0.3857     0.1998 0.000 0.688 0.000 0.312 0.000
#> GSM254693     2  0.0703     0.8699 0.000 0.976 0.000 0.024 0.000
#> GSM254695     4  0.2377     0.5862 0.000 0.128 0.000 0.872 0.000
#> GSM254702     4  0.4235     0.7616 0.000 0.424 0.000 0.576 0.000
#> GSM254643     2  0.1197     0.8599 0.000 0.952 0.000 0.048 0.000
#> GSM254727     2  0.0162     0.8710 0.000 0.996 0.000 0.004 0.000
#> GSM254640     4  0.4287     0.7129 0.000 0.460 0.000 0.540 0.000
#> GSM254626     2  0.0963     0.8648 0.000 0.964 0.000 0.036 0.000
#> GSM254635     4  0.4045     0.8209 0.000 0.356 0.000 0.644 0.000
#> GSM254653     2  0.0703     0.8685 0.000 0.976 0.000 0.024 0.000
#> GSM254658     2  0.0000     0.8701 0.000 1.000 0.000 0.000 0.000
#> GSM254681     2  0.0290     0.8676 0.000 0.992 0.000 0.000 0.008
#> GSM254719     2  0.0963     0.8648 0.000 0.964 0.000 0.036 0.000
#> GSM254673     2  0.0880     0.8673 0.000 0.968 0.000 0.032 0.000
#> GSM254655     2  0.3274     0.5322 0.000 0.780 0.000 0.220 0.000
#> GSM254669     2  0.0880     0.8673 0.000 0.968 0.000 0.032 0.000
#> GSM254699     2  0.3039     0.6019 0.000 0.808 0.000 0.192 0.000
#> GSM254703     4  0.4074     0.8188 0.000 0.364 0.000 0.636 0.000
#> GSM254708     2  0.1124     0.8501 0.000 0.960 0.000 0.036 0.004
#> GSM254715     4  0.4045     0.8209 0.000 0.356 0.000 0.644 0.000
#> GSM254628     2  0.0000     0.8701 0.000 1.000 0.000 0.000 0.000
#> GSM254634     4  0.4060     0.8145 0.000 0.360 0.000 0.640 0.000
#> GSM254646     2  0.0290     0.8702 0.000 0.992 0.000 0.008 0.000
#> GSM254671     4  0.4256     0.7443 0.000 0.436 0.000 0.564 0.000
#> GSM254711     4  0.4114     0.8159 0.000 0.376 0.000 0.624 0.000
#> GSM254717     2  0.0290     0.8714 0.000 0.992 0.000 0.008 0.000
#> GSM254723     4  0.5777     0.0293 0.012 0.000 0.204 0.648 0.136
#> GSM254730     2  0.3661     0.3240 0.000 0.724 0.000 0.276 0.000
#> GSM254731     4  0.4273     0.7227 0.000 0.448 0.000 0.552 0.000
#> GSM254632     5  0.7276     0.1156 0.004 0.244 0.020 0.308 0.424
#> GSM254662     2  0.0880     0.8673 0.000 0.968 0.000 0.032 0.000
#> GSM254677     4  0.3534     0.7297 0.000 0.256 0.000 0.744 0.000
#> GSM254665     2  0.1282     0.8632 0.000 0.952 0.000 0.044 0.004
#> GSM254691     2  0.1041     0.8684 0.000 0.964 0.000 0.032 0.004
#> GSM254644     4  0.4262     0.7498 0.000 0.440 0.000 0.560 0.000
#> GSM254667     2  0.3013     0.6884 0.000 0.832 0.000 0.160 0.008
#> GSM254676     2  0.0955     0.8688 0.000 0.968 0.000 0.028 0.004
#> GSM254679     4  0.4088     0.8170 0.000 0.368 0.000 0.632 0.000
#> GSM254689     2  0.0579     0.8691 0.000 0.984 0.000 0.008 0.008
#> GSM254706     2  0.2660     0.7323 0.000 0.864 0.000 0.128 0.008
#> GSM254712     4  0.4045     0.8209 0.000 0.356 0.000 0.644 0.000
#> GSM254713     4  0.4045     0.8209 0.000 0.356 0.000 0.644 0.000
#> GSM254683     2  0.1082     0.8479 0.000 0.964 0.000 0.028 0.008
#> GSM254710     2  0.6586     0.1650 0.000 0.464 0.000 0.292 0.244
#> GSM254725     4  0.3876     0.7846 0.000 0.316 0.000 0.684 0.000
#> GSM254651     2  0.1697     0.8155 0.000 0.932 0.000 0.060 0.008
#> GSM254638     4  0.4045     0.8209 0.000 0.356 0.000 0.644 0.000
#> GSM254685     4  0.4074     0.8178 0.000 0.364 0.000 0.636 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
#> GSM254629     3  0.0458     0.7888 0.000 0.000 0.984 0.000 0.016 0.000
#> GSM254648     3  0.0000     0.7910 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM254694     3  0.0000     0.7910 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM254701     3  0.0363     0.7895 0.000 0.000 0.988 0.000 0.012 0.000
#> GSM254728     6  0.5871     0.2360 0.016 0.000 0.336 0.000 0.140 0.508
#> GSM254726     3  0.2257     0.7589 0.000 0.000 0.904 0.008 0.040 0.048
#> GSM254639     6  0.4551     0.5529 0.024 0.000 0.152 0.000 0.088 0.736
#> GSM254652     6  0.6143     0.2651 0.004 0.000 0.268 0.000 0.304 0.424
#> GSM254700     1  0.0146     0.7155 0.996 0.000 0.000 0.000 0.000 0.004
#> GSM254625     5  0.1624     0.5957 0.020 0.000 0.000 0.004 0.936 0.040
#> GSM254636     6  0.6196     0.2870 0.276 0.000 0.000 0.004 0.328 0.392
#> GSM254659     3  0.6545    -0.0825 0.020 0.000 0.428 0.004 0.264 0.284
#> GSM254680     5  0.4816     0.4090 0.264 0.000 0.000 0.004 0.648 0.084
#> GSM254686     5  0.3442     0.6060 0.076 0.000 0.016 0.004 0.836 0.068
#> GSM254718     3  0.5320     0.4960 0.032 0.000 0.652 0.000 0.104 0.212
#> GSM254674     5  0.4657     0.4799 0.220 0.000 0.000 0.004 0.684 0.092
#> GSM254668     5  0.2527     0.6374 0.108 0.000 0.000 0.000 0.868 0.024
#> GSM254697     1  0.1053     0.7156 0.964 0.000 0.000 0.004 0.020 0.012
#> GSM254704     1  0.0458     0.7153 0.984 0.000 0.000 0.000 0.000 0.016
#> GSM254707     5  0.1918     0.6446 0.088 0.000 0.000 0.000 0.904 0.008
#> GSM254714     1  0.2917     0.6258 0.852 0.000 0.104 0.000 0.004 0.040
#> GSM254722     1  0.2527     0.6878 0.880 0.000 0.000 0.004 0.032 0.084
#> GSM254627     1  0.1232     0.7143 0.956 0.000 0.000 0.004 0.024 0.016
#> GSM254630     5  0.5379     0.3717 0.420 0.000 0.000 0.004 0.480 0.096
#> GSM254633     1  0.5812     0.1327 0.444 0.000 0.004 0.004 0.412 0.136
#> GSM254670     6  0.4317     0.6358 0.084 0.000 0.024 0.000 0.132 0.760
#> GSM254716     5  0.2723     0.5495 0.020 0.000 0.000 0.004 0.856 0.120
#> GSM254720     1  0.1382     0.7152 0.948 0.000 0.008 0.000 0.008 0.036
#> GSM254729     6  0.5582     0.5474 0.024 0.000 0.172 0.000 0.184 0.620
#> GSM254654     3  0.0000     0.7910 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM254656     6  0.3374     0.4417 0.004 0.000 0.016 0.140 0.020 0.820
#> GSM254631     1  0.5258     0.2899 0.540 0.000 0.000 0.004 0.364 0.092
#> GSM254657     6  0.4420     0.6058 0.040 0.000 0.076 0.000 0.124 0.760
#> GSM254664     1  0.5061     0.3225 0.568 0.000 0.000 0.004 0.352 0.076
#> GSM254672     1  0.1501     0.6956 0.924 0.000 0.000 0.000 0.000 0.076
#> GSM254692     1  0.3966    -0.2837 0.552 0.000 0.000 0.000 0.444 0.004
#> GSM254645     6  0.4535     0.3999 0.332 0.000 0.004 0.004 0.032 0.628
#> GSM254666     5  0.3830     0.5019 0.044 0.000 0.000 0.000 0.744 0.212
#> GSM254675     1  0.0551     0.7149 0.984 0.000 0.000 0.004 0.008 0.004
#> GSM254678     1  0.4086     0.5396 0.728 0.000 0.000 0.004 0.048 0.220
#> GSM254688     5  0.2653     0.6516 0.100 0.000 0.000 0.004 0.868 0.028
#> GSM254690     1  0.5659     0.1727 0.472 0.000 0.000 0.008 0.400 0.120
#> GSM254696     6  0.5553     0.5697 0.172 0.000 0.000 0.004 0.256 0.568
#> GSM254705     5  0.4513     0.4029 0.440 0.000 0.000 0.004 0.532 0.024
#> GSM254642     1  0.1296     0.7120 0.952 0.000 0.000 0.004 0.032 0.012
#> GSM254661     3  0.4972     0.3143 0.000 0.000 0.568 0.000 0.080 0.352
#> GSM254698     1  0.4860     0.0459 0.516 0.000 0.000 0.008 0.040 0.436
#> GSM254641     5  0.4249     0.4478 0.328 0.000 0.000 0.000 0.640 0.032
#> GSM254647     1  0.1942     0.6902 0.916 0.000 0.000 0.008 0.064 0.012
#> GSM254663     5  0.4208     0.3953 0.452 0.000 0.000 0.004 0.536 0.008
#> GSM254682     5  0.3078     0.6472 0.108 0.000 0.000 0.000 0.836 0.056
#> GSM254709     5  0.4191     0.5066 0.388 0.000 0.012 0.000 0.596 0.004
#> GSM254721     1  0.0260     0.7154 0.992 0.000 0.000 0.000 0.000 0.008
#> GSM254724     1  0.0260     0.7154 0.992 0.000 0.000 0.000 0.000 0.008
#> GSM254650     5  0.3795     0.5338 0.364 0.000 0.000 0.004 0.632 0.000
#> GSM254687     5  0.3830     0.5212 0.376 0.000 0.000 0.004 0.620 0.000
#> GSM254637     1  0.5162     0.3456 0.576 0.000 0.000 0.004 0.328 0.092
#> GSM254684     6  0.5804     0.5226 0.220 0.000 0.000 0.008 0.228 0.544
#> GSM254649     2  0.0547     0.8103 0.000 0.980 0.000 0.000 0.000 0.020
#> GSM254660     2  0.3838    -0.1942 0.000 0.552 0.000 0.448 0.000 0.000
#> GSM254693     2  0.1204     0.8070 0.000 0.944 0.000 0.056 0.000 0.000
#> GSM254695     4  0.3307     0.5505 0.000 0.064 0.000 0.832 0.008 0.096
#> GSM254702     4  0.3717     0.6807 0.000 0.384 0.000 0.616 0.000 0.000
#> GSM254643     2  0.1765     0.7905 0.000 0.904 0.000 0.096 0.000 0.000
#> GSM254727     2  0.0458     0.8110 0.000 0.984 0.000 0.016 0.000 0.000
#> GSM254640     4  0.3923     0.6796 0.000 0.416 0.000 0.580 0.000 0.004
#> GSM254626     2  0.1714     0.7930 0.000 0.908 0.000 0.092 0.000 0.000
#> GSM254635     4  0.3081     0.8281 0.000 0.220 0.000 0.776 0.000 0.004
#> GSM254653     2  0.1007     0.8047 0.000 0.956 0.000 0.044 0.000 0.000
#> GSM254658     2  0.0547     0.8103 0.000 0.980 0.000 0.000 0.000 0.020
#> GSM254681     2  0.1461     0.7988 0.000 0.940 0.000 0.000 0.016 0.044
#> GSM254719     2  0.1814     0.7883 0.000 0.900 0.000 0.100 0.000 0.000
#> GSM254673     2  0.1714     0.7930 0.000 0.908 0.000 0.092 0.000 0.000
#> GSM254655     2  0.3309     0.4754 0.000 0.720 0.000 0.280 0.000 0.000
#> GSM254669     2  0.1556     0.7984 0.000 0.920 0.000 0.080 0.000 0.000
#> GSM254699     2  0.3076     0.5741 0.000 0.760 0.000 0.240 0.000 0.000
#> GSM254703     4  0.3398     0.8263 0.000 0.252 0.000 0.740 0.000 0.008
#> GSM254708     2  0.2349     0.7850 0.000 0.892 0.000 0.080 0.008 0.020
#> GSM254715     4  0.3245     0.8282 0.000 0.228 0.000 0.764 0.000 0.008
#> GSM254628     2  0.0603     0.8116 0.000 0.980 0.000 0.004 0.000 0.016
#> GSM254634     4  0.2562     0.8080 0.000 0.172 0.000 0.828 0.000 0.000
#> GSM254646     2  0.1528     0.8097 0.000 0.944 0.000 0.016 0.012 0.028
#> GSM254671     4  0.3756     0.6518 0.000 0.400 0.000 0.600 0.000 0.000
#> GSM254711     4  0.3198     0.8195 0.000 0.260 0.000 0.740 0.000 0.000
#> GSM254717     2  0.0603     0.8110 0.000 0.980 0.000 0.016 0.000 0.004
#> GSM254723     4  0.7526    -0.0464 0.036 0.004 0.204 0.452 0.068 0.236
#> GSM254730     2  0.3499     0.2359 0.000 0.680 0.000 0.320 0.000 0.000
#> GSM254731     4  0.3747     0.6603 0.000 0.396 0.000 0.604 0.000 0.000
#> GSM254632     5  0.7476     0.1537 0.000 0.148 0.012 0.184 0.440 0.216
#> GSM254662     2  0.1765     0.7912 0.000 0.904 0.000 0.096 0.000 0.000
#> GSM254677     4  0.3500     0.7903 0.000 0.204 0.000 0.768 0.000 0.028
#> GSM254665     2  0.2455     0.7913 0.000 0.872 0.000 0.112 0.004 0.012
#> GSM254691     2  0.2877     0.7869 0.000 0.848 0.000 0.124 0.008 0.020
#> GSM254644     4  0.3899     0.7028 0.000 0.404 0.000 0.592 0.000 0.004
#> GSM254667     2  0.4415     0.6368 0.000 0.740 0.000 0.172 0.024 0.064
#> GSM254676     2  0.2505     0.7930 0.000 0.880 0.000 0.092 0.008 0.020
#> GSM254679     4  0.2941     0.8104 0.000 0.220 0.000 0.780 0.000 0.000
#> GSM254689     2  0.2001     0.8025 0.000 0.920 0.000 0.020 0.016 0.044
#> GSM254706     2  0.4258     0.6528 0.000 0.756 0.000 0.160 0.024 0.060
#> GSM254712     4  0.3245     0.8282 0.000 0.228 0.000 0.764 0.000 0.008
#> GSM254713     4  0.3245     0.8282 0.000 0.228 0.000 0.764 0.000 0.008
#> GSM254683     2  0.3203     0.7412 0.000 0.848 0.000 0.080 0.020 0.052
#> GSM254710     2  0.7448     0.1469 0.000 0.388 0.000 0.184 0.244 0.184
#> GSM254725     4  0.2491     0.7908 0.000 0.164 0.000 0.836 0.000 0.000
#> GSM254651     2  0.3900     0.6892 0.000 0.792 0.000 0.128 0.024 0.056
#> GSM254638     4  0.2838     0.8222 0.000 0.188 0.000 0.808 0.000 0.004
#> GSM254685     4  0.3271     0.8268 0.000 0.232 0.000 0.760 0.000 0.008

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

consensus_heatmap(res, k = 2)

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

consensus_heatmap(res, k = 3)

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

consensus_heatmap(res, k = 4)

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

consensus_heatmap(res, k = 5)

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

consensus_heatmap(res, k = 6)

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

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

membership_heatmap(res, k = 2)

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

membership_heatmap(res, k = 3)

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

membership_heatmap(res, k = 4)

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

membership_heatmap(res, k = 5)

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

membership_heatmap(res, k = 6)

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

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

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

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

get_signatures(res, k = 3)

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

get_signatures(res, k = 4)

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

get_signatures(res, k = 5)

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

get_signatures(res, k = 6)

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

Signature heatmaps where rows are not scaled:

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

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

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

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

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

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

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

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

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

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

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk SD-skmeans-signature_compare

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

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

An example of the output of tb is:

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

The columns in tb are:

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

UMAP plot which shows how samples are separated.

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

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

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

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

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

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

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

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

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

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

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk SD-skmeans-collect-classes

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

test_to_known_factors(res)
#>              n tissue(p) individual(p) disease.state(p) gender(p) other(p) k
#> SD:skmeans 107  2.35e-23       0.55450            0.665   0.61079    0.958 2
#> SD:skmeans 105  1.05e-22       0.00281            0.637   0.00518    0.930 3
#> SD:skmeans  98  4.18e-21       0.00604            0.814   0.01322    0.978 4
#> SD:skmeans  71  2.61e-15       0.00587            0.666   0.00193    0.928 5
#> SD:skmeans  80  8.39e-16       0.08953            0.294   0.10927    0.380 6

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


SD:pam**

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

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

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

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

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

collect_plots(res)

plot of chunk SD-pam-collect-plots

The plots are:

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

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

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

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

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 1.000           0.994       0.997         0.4984 0.503   0.503
#> 3 3 0.900           0.898       0.957         0.2802 0.855   0.714
#> 4 4 0.761           0.820       0.898         0.1379 0.893   0.712
#> 5 5 0.767           0.729       0.871         0.0409 0.975   0.909
#> 6 6 0.674           0.523       0.736         0.0561 0.953   0.819

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
#> GSM254629     1  0.0000      0.995 1.000 0.000
#> GSM254648     1  0.4161      0.907 0.916 0.084
#> GSM254694     1  0.0000      0.995 1.000 0.000
#> GSM254701     1  0.0000      0.995 1.000 0.000
#> GSM254728     1  0.0000      0.995 1.000 0.000
#> GSM254726     1  0.0000      0.995 1.000 0.000
#> GSM254639     1  0.0000      0.995 1.000 0.000
#> GSM254652     1  0.0000      0.995 1.000 0.000
#> GSM254700     1  0.0000      0.995 1.000 0.000
#> GSM254625     1  0.0000      0.995 1.000 0.000
#> GSM254636     1  0.0000      0.995 1.000 0.000
#> GSM254659     1  0.0000      0.995 1.000 0.000
#> GSM254680     1  0.0000      0.995 1.000 0.000
#> GSM254686     1  0.0000      0.995 1.000 0.000
#> GSM254718     1  0.0000      0.995 1.000 0.000
#> GSM254674     1  0.0000      0.995 1.000 0.000
#> GSM254668     1  0.0000      0.995 1.000 0.000
#> GSM254697     1  0.0000      0.995 1.000 0.000
#> GSM254704     1  0.0000      0.995 1.000 0.000
#> GSM254707     1  0.0000      0.995 1.000 0.000
#> GSM254714     1  0.0000      0.995 1.000 0.000
#> GSM254722     1  0.0000      0.995 1.000 0.000
#> GSM254627     1  0.0000      0.995 1.000 0.000
#> GSM254630     1  0.0000      0.995 1.000 0.000
#> GSM254633     1  0.0000      0.995 1.000 0.000
#> GSM254670     1  0.0000      0.995 1.000 0.000
#> GSM254716     1  0.0000      0.995 1.000 0.000
#> GSM254720     1  0.0000      0.995 1.000 0.000
#> GSM254729     1  0.0000      0.995 1.000 0.000
#> GSM254654     1  0.0000      0.995 1.000 0.000
#> GSM254656     1  0.0000      0.995 1.000 0.000
#> GSM254631     1  0.0000      0.995 1.000 0.000
#> GSM254657     1  0.0000      0.995 1.000 0.000
#> GSM254664     1  0.0000      0.995 1.000 0.000
#> GSM254672     1  0.0000      0.995 1.000 0.000
#> GSM254692     1  0.0000      0.995 1.000 0.000
#> GSM254645     1  0.0000      0.995 1.000 0.000
#> GSM254666     1  0.0000      0.995 1.000 0.000
#> GSM254675     1  0.0000      0.995 1.000 0.000
#> GSM254678     1  0.0000      0.995 1.000 0.000
#> GSM254688     1  0.0000      0.995 1.000 0.000
#> GSM254690     1  0.0000      0.995 1.000 0.000
#> GSM254696     1  0.0000      0.995 1.000 0.000
#> GSM254705     1  0.0000      0.995 1.000 0.000
#> GSM254642     1  0.0000      0.995 1.000 0.000
#> GSM254661     1  0.0000      0.995 1.000 0.000
#> GSM254698     1  0.0000      0.995 1.000 0.000
#> GSM254641     1  0.0000      0.995 1.000 0.000
#> GSM254647     1  0.0000      0.995 1.000 0.000
#> GSM254663     1  0.0000      0.995 1.000 0.000
#> GSM254682     1  0.0000      0.995 1.000 0.000
#> GSM254709     1  0.0000      0.995 1.000 0.000
#> GSM254721     1  0.0000      0.995 1.000 0.000
#> GSM254724     1  0.0000      0.995 1.000 0.000
#> GSM254650     1  0.0000      0.995 1.000 0.000
#> GSM254687     1  0.0000      0.995 1.000 0.000
#> GSM254637     1  0.0000      0.995 1.000 0.000
#> GSM254684     1  0.0000      0.995 1.000 0.000
#> GSM254649     2  0.0000      1.000 0.000 1.000
#> GSM254660     2  0.0000      1.000 0.000 1.000
#> GSM254693     2  0.0000      1.000 0.000 1.000
#> GSM254695     2  0.0000      1.000 0.000 1.000
#> GSM254702     2  0.0000      1.000 0.000 1.000
#> GSM254643     2  0.0000      1.000 0.000 1.000
#> GSM254727     2  0.0000      1.000 0.000 1.000
#> GSM254640     2  0.0000      1.000 0.000 1.000
#> GSM254626     2  0.0000      1.000 0.000 1.000
#> GSM254635     2  0.0000      1.000 0.000 1.000
#> GSM254653     2  0.0000      1.000 0.000 1.000
#> GSM254658     2  0.0000      1.000 0.000 1.000
#> GSM254681     2  0.0000      1.000 0.000 1.000
#> GSM254719     2  0.0000      1.000 0.000 1.000
#> GSM254673     2  0.0000      1.000 0.000 1.000
#> GSM254655     2  0.0000      1.000 0.000 1.000
#> GSM254669     2  0.0000      1.000 0.000 1.000
#> GSM254699     2  0.0000      1.000 0.000 1.000
#> GSM254703     2  0.0000      1.000 0.000 1.000
#> GSM254708     2  0.0000      1.000 0.000 1.000
#> GSM254715     2  0.0000      1.000 0.000 1.000
#> GSM254628     2  0.0000      1.000 0.000 1.000
#> GSM254634     2  0.0000      1.000 0.000 1.000
#> GSM254646     2  0.0000      1.000 0.000 1.000
#> GSM254671     2  0.0000      1.000 0.000 1.000
#> GSM254711     2  0.0000      1.000 0.000 1.000
#> GSM254717     2  0.0000      1.000 0.000 1.000
#> GSM254723     1  0.0672      0.987 0.992 0.008
#> GSM254730     2  0.0000      1.000 0.000 1.000
#> GSM254731     2  0.0000      1.000 0.000 1.000
#> GSM254632     1  0.7602      0.721 0.780 0.220
#> GSM254662     2  0.0000      1.000 0.000 1.000
#> GSM254677     2  0.0000      1.000 0.000 1.000
#> GSM254665     2  0.0000      1.000 0.000 1.000
#> GSM254691     2  0.0000      1.000 0.000 1.000
#> GSM254644     2  0.0000      1.000 0.000 1.000
#> GSM254667     2  0.0000      1.000 0.000 1.000
#> GSM254676     2  0.0000      1.000 0.000 1.000
#> GSM254679     2  0.0000      1.000 0.000 1.000
#> GSM254689     2  0.0000      1.000 0.000 1.000
#> GSM254706     2  0.0000      1.000 0.000 1.000
#> GSM254712     2  0.0000      1.000 0.000 1.000
#> GSM254713     2  0.0000      1.000 0.000 1.000
#> GSM254683     2  0.0000      1.000 0.000 1.000
#> GSM254710     2  0.0000      1.000 0.000 1.000
#> GSM254725     2  0.0000      1.000 0.000 1.000
#> GSM254651     2  0.0000      1.000 0.000 1.000
#> GSM254638     2  0.0000      1.000 0.000 1.000
#> GSM254685     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
#> GSM254629     3  0.0000      0.915 0.000 0.000 1.000
#> GSM254648     3  0.3038      0.807 0.000 0.104 0.896
#> GSM254694     3  0.0000      0.915 0.000 0.000 1.000
#> GSM254701     3  0.0000      0.915 0.000 0.000 1.000
#> GSM254728     3  0.0000      0.915 0.000 0.000 1.000
#> GSM254726     3  0.0000      0.915 0.000 0.000 1.000
#> GSM254639     3  0.0000      0.915 0.000 0.000 1.000
#> GSM254652     3  0.0000      0.915 0.000 0.000 1.000
#> GSM254700     1  0.0000      0.901 1.000 0.000 0.000
#> GSM254625     1  0.5859      0.478 0.656 0.000 0.344
#> GSM254636     3  0.0000      0.915 0.000 0.000 1.000
#> GSM254659     3  0.0000      0.915 0.000 0.000 1.000
#> GSM254680     3  0.0000      0.915 0.000 0.000 1.000
#> GSM254686     3  0.0000      0.915 0.000 0.000 1.000
#> GSM254718     3  0.0000      0.915 0.000 0.000 1.000
#> GSM254674     3  0.0000      0.915 0.000 0.000 1.000
#> GSM254668     1  0.6062      0.390 0.616 0.000 0.384
#> GSM254697     3  0.5016      0.699 0.240 0.000 0.760
#> GSM254704     1  0.6192      0.158 0.580 0.000 0.420
#> GSM254707     1  0.0000      0.901 1.000 0.000 0.000
#> GSM254714     3  0.6235      0.301 0.436 0.000 0.564
#> GSM254722     3  0.5988      0.473 0.368 0.000 0.632
#> GSM254627     3  0.4555      0.751 0.200 0.000 0.800
#> GSM254630     1  0.0000      0.901 1.000 0.000 0.000
#> GSM254633     3  0.0000      0.915 0.000 0.000 1.000
#> GSM254670     3  0.0000      0.915 0.000 0.000 1.000
#> GSM254716     3  0.0747      0.906 0.016 0.000 0.984
#> GSM254720     3  0.0000      0.915 0.000 0.000 1.000
#> GSM254729     3  0.0000      0.915 0.000 0.000 1.000
#> GSM254654     3  0.0000      0.915 0.000 0.000 1.000
#> GSM254656     3  0.0000      0.915 0.000 0.000 1.000
#> GSM254631     3  0.0000      0.915 0.000 0.000 1.000
#> GSM254657     3  0.1031      0.904 0.024 0.000 0.976
#> GSM254664     3  0.0000      0.915 0.000 0.000 1.000
#> GSM254672     3  0.4504      0.755 0.196 0.000 0.804
#> GSM254692     1  0.0000      0.901 1.000 0.000 0.000
#> GSM254645     3  0.2356      0.872 0.072 0.000 0.928
#> GSM254666     3  0.6079      0.429 0.388 0.000 0.612
#> GSM254675     3  0.3412      0.828 0.124 0.000 0.876
#> GSM254678     3  0.6126      0.398 0.400 0.000 0.600
#> GSM254688     1  0.0000      0.901 1.000 0.000 0.000
#> GSM254690     3  0.1860      0.886 0.052 0.000 0.948
#> GSM254696     3  0.0000      0.915 0.000 0.000 1.000
#> GSM254705     1  0.0000      0.901 1.000 0.000 0.000
#> GSM254642     1  0.0000      0.901 1.000 0.000 0.000
#> GSM254661     3  0.0000      0.915 0.000 0.000 1.000
#> GSM254698     3  0.1643      0.891 0.044 0.000 0.956
#> GSM254641     3  0.0000      0.915 0.000 0.000 1.000
#> GSM254647     1  0.2165      0.848 0.936 0.000 0.064
#> GSM254663     1  0.0000      0.901 1.000 0.000 0.000
#> GSM254682     1  0.0000      0.901 1.000 0.000 0.000
#> GSM254709     1  0.0000      0.901 1.000 0.000 0.000
#> GSM254721     1  0.0000      0.901 1.000 0.000 0.000
#> GSM254724     1  0.0000      0.901 1.000 0.000 0.000
#> GSM254650     1  0.0000      0.901 1.000 0.000 0.000
#> GSM254687     1  0.0000      0.901 1.000 0.000 0.000
#> GSM254637     3  0.0000      0.915 0.000 0.000 1.000
#> GSM254684     3  0.4555      0.751 0.200 0.000 0.800
#> GSM254649     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254660     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254693     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254695     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254702     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254643     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254727     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254640     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254626     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254635     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254653     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254658     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254681     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254719     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254673     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254655     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254669     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254699     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254703     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254708     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254715     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254628     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254634     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254646     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254671     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254711     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254717     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254723     3  0.0424      0.909 0.000 0.008 0.992
#> GSM254730     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254731     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254632     3  0.4452      0.680 0.000 0.192 0.808
#> GSM254662     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254677     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254665     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254691     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254644     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254667     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254676     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254679     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254689     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254706     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254712     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254713     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254683     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254710     1  0.5859      0.456 0.656 0.344 0.000
#> GSM254725     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254651     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254638     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254685     2  0.0000      1.000 0.000 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM254629     3  0.0000      0.908 0.000 0.000 1.000 0.000
#> GSM254648     3  0.2843      0.818 0.000 0.088 0.892 0.020
#> GSM254694     3  0.0000      0.908 0.000 0.000 1.000 0.000
#> GSM254701     3  0.0000      0.908 0.000 0.000 1.000 0.000
#> GSM254728     3  0.0000      0.908 0.000 0.000 1.000 0.000
#> GSM254726     3  0.0000      0.908 0.000 0.000 1.000 0.000
#> GSM254639     3  0.0000      0.908 0.000 0.000 1.000 0.000
#> GSM254652     3  0.0000      0.908 0.000 0.000 1.000 0.000
#> GSM254700     1  0.0000      0.905 1.000 0.000 0.000 0.000
#> GSM254625     1  0.4643      0.496 0.656 0.000 0.344 0.000
#> GSM254636     3  0.0000      0.908 0.000 0.000 1.000 0.000
#> GSM254659     3  0.0000      0.908 0.000 0.000 1.000 0.000
#> GSM254680     3  0.0000      0.908 0.000 0.000 1.000 0.000
#> GSM254686     3  0.0000      0.908 0.000 0.000 1.000 0.000
#> GSM254718     3  0.0000      0.908 0.000 0.000 1.000 0.000
#> GSM254674     3  0.0000      0.908 0.000 0.000 1.000 0.000
#> GSM254668     1  0.4804      0.409 0.616 0.000 0.384 0.000
#> GSM254697     3  0.5096      0.729 0.156 0.000 0.760 0.084
#> GSM254704     1  0.4907      0.157 0.580 0.000 0.420 0.000
#> GSM254707     1  0.0000      0.905 1.000 0.000 0.000 0.000
#> GSM254714     3  0.4941      0.304 0.436 0.000 0.564 0.000
#> GSM254722     3  0.6172      0.522 0.284 0.000 0.632 0.084
#> GSM254627     3  0.4591      0.774 0.116 0.000 0.800 0.084
#> GSM254630     1  0.0000      0.905 1.000 0.000 0.000 0.000
#> GSM254633     3  0.0000      0.908 0.000 0.000 1.000 0.000
#> GSM254670     3  0.0000      0.908 0.000 0.000 1.000 0.000
#> GSM254716     3  0.0592      0.900 0.016 0.000 0.984 0.000
#> GSM254720     3  0.0000      0.908 0.000 0.000 1.000 0.000
#> GSM254729     3  0.0000      0.908 0.000 0.000 1.000 0.000
#> GSM254654     3  0.0000      0.908 0.000 0.000 1.000 0.000
#> GSM254656     4  0.4713      0.434 0.000 0.000 0.360 0.640
#> GSM254631     3  0.0000      0.908 0.000 0.000 1.000 0.000
#> GSM254657     3  0.0817      0.898 0.024 0.000 0.976 0.000
#> GSM254664     3  0.0000      0.908 0.000 0.000 1.000 0.000
#> GSM254672     3  0.3569      0.754 0.196 0.000 0.804 0.000
#> GSM254692     1  0.0000      0.905 1.000 0.000 0.000 0.000
#> GSM254645     3  0.1867      0.868 0.072 0.000 0.928 0.000
#> GSM254666     3  0.4817      0.423 0.388 0.000 0.612 0.000
#> GSM254675     3  0.2704      0.827 0.124 0.000 0.876 0.000
#> GSM254678     3  0.4855      0.399 0.400 0.000 0.600 0.000
#> GSM254688     1  0.0000      0.905 1.000 0.000 0.000 0.000
#> GSM254690     3  0.1474      0.880 0.052 0.000 0.948 0.000
#> GSM254696     3  0.0000      0.908 0.000 0.000 1.000 0.000
#> GSM254705     1  0.0000      0.905 1.000 0.000 0.000 0.000
#> GSM254642     1  0.2081      0.850 0.916 0.000 0.000 0.084
#> GSM254661     3  0.0000      0.908 0.000 0.000 1.000 0.000
#> GSM254698     3  0.2984      0.849 0.028 0.000 0.888 0.084
#> GSM254641     3  0.0000      0.908 0.000 0.000 1.000 0.000
#> GSM254647     1  0.1716      0.852 0.936 0.000 0.064 0.000
#> GSM254663     1  0.0000      0.905 1.000 0.000 0.000 0.000
#> GSM254682     1  0.0000      0.905 1.000 0.000 0.000 0.000
#> GSM254709     1  0.0000      0.905 1.000 0.000 0.000 0.000
#> GSM254721     1  0.0000      0.905 1.000 0.000 0.000 0.000
#> GSM254724     1  0.0000      0.905 1.000 0.000 0.000 0.000
#> GSM254650     1  0.0000      0.905 1.000 0.000 0.000 0.000
#> GSM254687     1  0.0000      0.905 1.000 0.000 0.000 0.000
#> GSM254637     3  0.0000      0.908 0.000 0.000 1.000 0.000
#> GSM254684     3  0.3610      0.750 0.200 0.000 0.800 0.000
#> GSM254649     2  0.0000      0.890 0.000 1.000 0.000 0.000
#> GSM254660     2  0.1022      0.886 0.000 0.968 0.000 0.032
#> GSM254693     2  0.0000      0.890 0.000 1.000 0.000 0.000
#> GSM254695     4  0.2081      0.844 0.000 0.084 0.000 0.916
#> GSM254702     2  0.4008      0.525 0.000 0.756 0.000 0.244
#> GSM254643     2  0.0817      0.886 0.000 0.976 0.000 0.024
#> GSM254727     2  0.0000      0.890 0.000 1.000 0.000 0.000
#> GSM254640     2  0.1940      0.864 0.000 0.924 0.000 0.076
#> GSM254626     2  0.0188      0.890 0.000 0.996 0.000 0.004
#> GSM254635     4  0.3610      0.833 0.000 0.200 0.000 0.800
#> GSM254653     2  0.0000      0.890 0.000 1.000 0.000 0.000
#> GSM254658     2  0.0000      0.890 0.000 1.000 0.000 0.000
#> GSM254681     2  0.2589      0.841 0.000 0.884 0.000 0.116
#> GSM254719     2  0.0817      0.886 0.000 0.976 0.000 0.024
#> GSM254673     2  0.0817      0.886 0.000 0.976 0.000 0.024
#> GSM254655     2  0.0817      0.886 0.000 0.976 0.000 0.024
#> GSM254669     2  0.0000      0.890 0.000 1.000 0.000 0.000
#> GSM254699     2  0.0817      0.886 0.000 0.976 0.000 0.024
#> GSM254703     4  0.2345      0.848 0.000 0.100 0.000 0.900
#> GSM254708     2  0.3528      0.797 0.000 0.808 0.000 0.192
#> GSM254715     4  0.4776      0.693 0.000 0.376 0.000 0.624
#> GSM254628     2  0.0000      0.890 0.000 1.000 0.000 0.000
#> GSM254634     4  0.2216      0.847 0.000 0.092 0.000 0.908
#> GSM254646     2  0.0000      0.890 0.000 1.000 0.000 0.000
#> GSM254671     4  0.4250      0.805 0.000 0.276 0.000 0.724
#> GSM254711     4  0.3311      0.846 0.000 0.172 0.000 0.828
#> GSM254717     2  0.0817      0.886 0.000 0.976 0.000 0.024
#> GSM254723     3  0.0336      0.903 0.000 0.008 0.992 0.000
#> GSM254730     2  0.2281      0.861 0.000 0.904 0.000 0.096
#> GSM254731     4  0.4804      0.680 0.000 0.384 0.000 0.616
#> GSM254632     3  0.7341      0.305 0.000 0.220 0.528 0.252
#> GSM254662     2  0.0817      0.886 0.000 0.976 0.000 0.024
#> GSM254677     4  0.3486      0.843 0.000 0.188 0.000 0.812
#> GSM254665     2  0.3610      0.793 0.000 0.800 0.000 0.200
#> GSM254691     2  0.4454      0.676 0.000 0.692 0.000 0.308
#> GSM254644     4  0.4331      0.797 0.000 0.288 0.000 0.712
#> GSM254667     4  0.2281      0.837 0.000 0.096 0.000 0.904
#> GSM254676     4  0.2081      0.844 0.000 0.084 0.000 0.916
#> GSM254679     4  0.2081      0.844 0.000 0.084 0.000 0.916
#> GSM254689     2  0.3528      0.797 0.000 0.808 0.000 0.192
#> GSM254706     2  0.3873      0.764 0.000 0.772 0.000 0.228
#> GSM254712     4  0.4356      0.794 0.000 0.292 0.000 0.708
#> GSM254713     4  0.4250      0.804 0.000 0.276 0.000 0.724
#> GSM254683     2  0.3610      0.790 0.000 0.800 0.000 0.200
#> GSM254710     2  0.5180      0.738 0.064 0.740 0.000 0.196
#> GSM254725     4  0.2081      0.844 0.000 0.084 0.000 0.916
#> GSM254651     2  0.3486      0.800 0.000 0.812 0.000 0.188
#> GSM254638     4  0.2081      0.844 0.000 0.084 0.000 0.916
#> GSM254685     4  0.3801      0.829 0.000 0.220 0.000 0.780

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM254629     3  0.0000     0.8780 0.000 0.000 1.000 0.000 0.000
#> GSM254648     3  0.2952     0.7583 0.004 0.088 0.872 0.036 0.000
#> GSM254694     3  0.0000     0.8780 0.000 0.000 1.000 0.000 0.000
#> GSM254701     3  0.0000     0.8780 0.000 0.000 1.000 0.000 0.000
#> GSM254728     3  0.0000     0.8780 0.000 0.000 1.000 0.000 0.000
#> GSM254726     3  0.0000     0.8780 0.000 0.000 1.000 0.000 0.000
#> GSM254639     3  0.0000     0.8780 0.000 0.000 1.000 0.000 0.000
#> GSM254652     3  0.0000     0.8780 0.000 0.000 1.000 0.000 0.000
#> GSM254700     1  0.4268     0.5106 0.556 0.000 0.000 0.000 0.444
#> GSM254625     5  0.3999     0.3048 0.000 0.000 0.344 0.000 0.656
#> GSM254636     3  0.0162     0.8771 0.004 0.000 0.996 0.000 0.000
#> GSM254659     3  0.0000     0.8780 0.000 0.000 1.000 0.000 0.000
#> GSM254680     3  0.0290     0.8762 0.008 0.000 0.992 0.000 0.000
#> GSM254686     3  0.0000     0.8780 0.000 0.000 1.000 0.000 0.000
#> GSM254718     3  0.0000     0.8780 0.000 0.000 1.000 0.000 0.000
#> GSM254674     3  0.0162     0.8771 0.004 0.000 0.996 0.000 0.000
#> GSM254668     5  0.4392     0.2507 0.008 0.000 0.380 0.000 0.612
#> GSM254697     1  0.0609     0.3702 0.980 0.000 0.020 0.000 0.000
#> GSM254704     1  0.4696     0.5115 0.556 0.000 0.016 0.000 0.428
#> GSM254707     5  0.0162     0.8040 0.004 0.000 0.000 0.000 0.996
#> GSM254714     3  0.4403     0.2186 0.004 0.000 0.560 0.000 0.436
#> GSM254722     3  0.4504     0.3020 0.428 0.000 0.564 0.000 0.008
#> GSM254627     1  0.4304    -0.2571 0.516 0.000 0.484 0.000 0.000
#> GSM254630     5  0.0000     0.8071 0.000 0.000 0.000 0.000 1.000
#> GSM254633     3  0.0000     0.8780 0.000 0.000 1.000 0.000 0.000
#> GSM254670     3  0.0000     0.8780 0.000 0.000 1.000 0.000 0.000
#> GSM254716     3  0.0510     0.8705 0.000 0.000 0.984 0.000 0.016
#> GSM254720     3  0.3730     0.5285 0.288 0.000 0.712 0.000 0.000
#> GSM254729     3  0.0000     0.8780 0.000 0.000 1.000 0.000 0.000
#> GSM254654     3  0.0000     0.8780 0.000 0.000 1.000 0.000 0.000
#> GSM254656     4  0.4211     0.3762 0.004 0.000 0.360 0.636 0.000
#> GSM254631     3  0.0290     0.8762 0.008 0.000 0.992 0.000 0.000
#> GSM254657     3  0.0703     0.8661 0.000 0.000 0.976 0.000 0.024
#> GSM254664     3  0.0290     0.8762 0.008 0.000 0.992 0.000 0.000
#> GSM254672     3  0.3231     0.6889 0.004 0.000 0.800 0.000 0.196
#> GSM254692     5  0.0000     0.8071 0.000 0.000 0.000 0.000 1.000
#> GSM254645     3  0.1608     0.8295 0.000 0.000 0.928 0.000 0.072
#> GSM254666     3  0.4150     0.3793 0.000 0.000 0.612 0.000 0.388
#> GSM254675     3  0.2329     0.7778 0.000 0.000 0.876 0.000 0.124
#> GSM254678     3  0.4331     0.3011 0.004 0.000 0.596 0.000 0.400
#> GSM254688     5  0.0000     0.8071 0.000 0.000 0.000 0.000 1.000
#> GSM254690     3  0.1557     0.8444 0.008 0.000 0.940 0.000 0.052
#> GSM254696     3  0.0000     0.8780 0.000 0.000 1.000 0.000 0.000
#> GSM254705     5  0.0000     0.8071 0.000 0.000 0.000 0.000 1.000
#> GSM254642     5  0.4242     0.2312 0.428 0.000 0.000 0.000 0.572
#> GSM254661     3  0.0000     0.8780 0.000 0.000 1.000 0.000 0.000
#> GSM254698     3  0.4242     0.3228 0.428 0.000 0.572 0.000 0.000
#> GSM254641     3  0.0162     0.8771 0.004 0.000 0.996 0.000 0.000
#> GSM254647     5  0.1764     0.6948 0.008 0.000 0.064 0.000 0.928
#> GSM254663     5  0.0162     0.8040 0.004 0.000 0.000 0.000 0.996
#> GSM254682     5  0.0000     0.8071 0.000 0.000 0.000 0.000 1.000
#> GSM254709     5  0.0000     0.8071 0.000 0.000 0.000 0.000 1.000
#> GSM254721     1  0.4278     0.5039 0.548 0.000 0.000 0.000 0.452
#> GSM254724     1  0.4273     0.5090 0.552 0.000 0.000 0.000 0.448
#> GSM254650     5  0.0000     0.8071 0.000 0.000 0.000 0.000 1.000
#> GSM254687     5  0.0000     0.8071 0.000 0.000 0.000 0.000 1.000
#> GSM254637     3  0.0290     0.8762 0.008 0.000 0.992 0.000 0.000
#> GSM254684     3  0.3266     0.6838 0.004 0.000 0.796 0.000 0.200
#> GSM254649     2  0.0000     0.8558 0.000 1.000 0.000 0.000 0.000
#> GSM254660     2  0.1597     0.8448 0.012 0.940 0.000 0.048 0.000
#> GSM254693     2  0.0000     0.8558 0.000 1.000 0.000 0.000 0.000
#> GSM254695     4  0.0000     0.7823 0.000 0.000 0.000 1.000 0.000
#> GSM254702     2  0.3835     0.5113 0.012 0.744 0.000 0.244 0.000
#> GSM254643     2  0.0865     0.8504 0.004 0.972 0.000 0.024 0.000
#> GSM254727     2  0.0162     0.8554 0.004 0.996 0.000 0.000 0.000
#> GSM254640     2  0.2771     0.8068 0.012 0.860 0.000 0.128 0.000
#> GSM254626     2  0.0162     0.8556 0.000 0.996 0.000 0.004 0.000
#> GSM254635     4  0.3462     0.7617 0.012 0.196 0.000 0.792 0.000
#> GSM254653     2  0.0000     0.8558 0.000 1.000 0.000 0.000 0.000
#> GSM254658     2  0.0000     0.8558 0.000 1.000 0.000 0.000 0.000
#> GSM254681     2  0.2424     0.8037 0.000 0.868 0.000 0.132 0.000
#> GSM254719     2  0.1195     0.8456 0.012 0.960 0.000 0.028 0.000
#> GSM254673     2  0.0703     0.8517 0.000 0.976 0.000 0.024 0.000
#> GSM254655     2  0.1195     0.8456 0.012 0.960 0.000 0.028 0.000
#> GSM254669     2  0.0000     0.8558 0.000 1.000 0.000 0.000 0.000
#> GSM254699     2  0.1195     0.8456 0.012 0.960 0.000 0.028 0.000
#> GSM254703     4  0.0671     0.7881 0.004 0.016 0.000 0.980 0.000
#> GSM254708     2  0.3814     0.7176 0.004 0.720 0.000 0.276 0.000
#> GSM254715     4  0.4482     0.6095 0.012 0.376 0.000 0.612 0.000
#> GSM254628     2  0.0000     0.8558 0.000 1.000 0.000 0.000 0.000
#> GSM254634     4  0.0671     0.7883 0.004 0.016 0.000 0.980 0.000
#> GSM254646     2  0.0000     0.8558 0.000 1.000 0.000 0.000 0.000
#> GSM254671     4  0.4040     0.7293 0.012 0.276 0.000 0.712 0.000
#> GSM254711     4  0.2522     0.7944 0.012 0.108 0.000 0.880 0.000
#> GSM254717     2  0.0703     0.8517 0.000 0.976 0.000 0.024 0.000
#> GSM254723     3  0.0740     0.8666 0.008 0.008 0.980 0.004 0.000
#> GSM254730     2  0.3039     0.8004 0.012 0.836 0.000 0.152 0.000
#> GSM254731     4  0.4505     0.5959 0.012 0.384 0.000 0.604 0.000
#> GSM254632     3  0.6741     0.0565 0.004 0.220 0.432 0.344 0.000
#> GSM254662     2  0.0703     0.8517 0.000 0.976 0.000 0.024 0.000
#> GSM254677     4  0.2522     0.7936 0.012 0.108 0.000 0.880 0.000
#> GSM254665     2  0.3906     0.7058 0.004 0.704 0.000 0.292 0.000
#> GSM254691     2  0.4341     0.5692 0.004 0.592 0.000 0.404 0.000
#> GSM254644     4  0.4086     0.7237 0.012 0.284 0.000 0.704 0.000
#> GSM254667     4  0.0566     0.7735 0.004 0.012 0.000 0.984 0.000
#> GSM254676     4  0.0162     0.7805 0.004 0.000 0.000 0.996 0.000
#> GSM254679     4  0.0000     0.7823 0.000 0.000 0.000 1.000 0.000
#> GSM254689     2  0.3561     0.7291 0.000 0.740 0.000 0.260 0.000
#> GSM254706     2  0.3857     0.6811 0.000 0.688 0.000 0.312 0.000
#> GSM254712     4  0.4130     0.7165 0.012 0.292 0.000 0.696 0.000
#> GSM254713     4  0.4040     0.7289 0.012 0.276 0.000 0.712 0.000
#> GSM254683     2  0.3928     0.6985 0.004 0.700 0.000 0.296 0.000
#> GSM254710     2  0.3684     0.7130 0.000 0.720 0.000 0.280 0.000
#> GSM254725     4  0.0290     0.7839 0.008 0.000 0.000 0.992 0.000
#> GSM254651     2  0.3636     0.7203 0.000 0.728 0.000 0.272 0.000
#> GSM254638     4  0.0162     0.7805 0.004 0.000 0.000 0.996 0.000
#> GSM254685     4  0.2848     0.7854 0.004 0.156 0.000 0.840 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
#> GSM254629     3  0.2454     0.7203 0.000 0.000 0.840 0.000 0.000 0.160
#> GSM254648     3  0.3565     0.5988 0.000 0.004 0.692 0.000 0.000 0.304
#> GSM254694     3  0.0000     0.7552 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM254701     3  0.0146     0.7553 0.000 0.000 0.996 0.000 0.000 0.004
#> GSM254728     3  0.0000     0.7552 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM254726     3  0.2527     0.7165 0.000 0.000 0.832 0.000 0.000 0.168
#> GSM254639     3  0.1556     0.7471 0.000 0.000 0.920 0.000 0.000 0.080
#> GSM254652     3  0.2340     0.7257 0.000 0.000 0.852 0.000 0.000 0.148
#> GSM254700     1  0.6027     0.4745 0.400 0.000 0.000 0.000 0.352 0.248
#> GSM254625     5  0.3592     0.3051 0.000 0.000 0.344 0.000 0.656 0.000
#> GSM254636     3  0.3464     0.6225 0.312 0.000 0.688 0.000 0.000 0.000
#> GSM254659     3  0.0000     0.7552 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM254680     3  0.3690     0.6190 0.308 0.000 0.684 0.000 0.000 0.008
#> GSM254686     3  0.0000     0.7552 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM254718     3  0.0000     0.7552 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM254674     3  0.2178     0.7282 0.132 0.000 0.868 0.000 0.000 0.000
#> GSM254668     5  0.6912     0.1612 0.308 0.000 0.200 0.000 0.420 0.072
#> GSM254697     1  0.4977     0.3739 0.636 0.000 0.000 0.236 0.000 0.128
#> GSM254704     1  0.6152     0.4751 0.396 0.000 0.004 0.000 0.352 0.248
#> GSM254707     5  0.3446     0.4366 0.308 0.000 0.000 0.000 0.692 0.000
#> GSM254714     5  0.5971    -0.0333 0.000 0.000 0.344 0.000 0.424 0.232
#> GSM254722     3  0.5969    -0.0116 0.332 0.000 0.432 0.236 0.000 0.000
#> GSM254627     1  0.5875     0.0993 0.476 0.000 0.288 0.236 0.000 0.000
#> GSM254630     5  0.0000     0.6538 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM254633     3  0.2527     0.7162 0.168 0.000 0.832 0.000 0.000 0.000
#> GSM254670     3  0.2632     0.7182 0.004 0.000 0.832 0.000 0.000 0.164
#> GSM254716     3  0.0458     0.7554 0.000 0.000 0.984 0.000 0.016 0.000
#> GSM254720     3  0.4475     0.4928 0.200 0.000 0.700 0.000 0.000 0.100
#> GSM254729     3  0.0000     0.7552 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM254654     3  0.2527     0.7165 0.000 0.000 0.832 0.000 0.000 0.168
#> GSM254656     4  0.5819    -0.0799 0.000 0.000 0.396 0.420 0.000 0.184
#> GSM254631     3  0.4736     0.5651 0.308 0.000 0.620 0.000 0.000 0.072
#> GSM254657     3  0.3274     0.7137 0.004 0.000 0.804 0.000 0.024 0.168
#> GSM254664     3  0.4736     0.5651 0.308 0.000 0.620 0.000 0.000 0.072
#> GSM254672     3  0.4253     0.6007 0.004 0.000 0.728 0.000 0.196 0.072
#> GSM254692     5  0.0000     0.6538 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM254645     3  0.3860     0.6985 0.000 0.000 0.764 0.000 0.072 0.164
#> GSM254666     3  0.5434     0.5008 0.000 0.000 0.564 0.000 0.272 0.164
#> GSM254675     3  0.2092     0.7151 0.000 0.000 0.876 0.000 0.124 0.000
#> GSM254678     3  0.5025     0.1784 0.004 0.000 0.532 0.000 0.400 0.064
#> GSM254688     5  0.0000     0.6538 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM254690     3  0.5387     0.5269 0.312 0.000 0.588 0.000 0.028 0.072
#> GSM254696     3  0.2664     0.7097 0.184 0.000 0.816 0.000 0.000 0.000
#> GSM254705     5  0.0000     0.6538 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM254642     5  0.5886     0.0617 0.292 0.000 0.000 0.236 0.472 0.000
#> GSM254661     3  0.2527     0.7165 0.000 0.000 0.832 0.000 0.000 0.168
#> GSM254698     3  0.5988     0.0222 0.348 0.000 0.416 0.236 0.000 0.000
#> GSM254641     3  0.4594     0.6823 0.092 0.000 0.676 0.000 0.000 0.232
#> GSM254647     5  0.4679     0.4308 0.136 0.000 0.056 0.000 0.740 0.068
#> GSM254663     5  0.2491     0.5553 0.164 0.000 0.000 0.000 0.836 0.000
#> GSM254682     5  0.0000     0.6538 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM254709     5  0.0000     0.6538 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM254721     5  0.5781    -0.4814 0.396 0.000 0.000 0.000 0.428 0.176
#> GSM254724     1  0.6029     0.4727 0.396 0.000 0.000 0.000 0.356 0.248
#> GSM254650     5  0.0000     0.6538 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM254687     5  0.0000     0.6538 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM254637     3  0.4736     0.5651 0.308 0.000 0.620 0.000 0.000 0.072
#> GSM254684     3  0.4617     0.6072 0.252 0.000 0.664 0.000 0.084 0.000
#> GSM254649     2  0.0000     0.7463 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM254660     2  0.4167     0.5144 0.000 0.632 0.000 0.344 0.000 0.024
#> GSM254693     2  0.0000     0.7463 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM254695     4  0.3847    -0.4390 0.000 0.000 0.000 0.544 0.000 0.456
#> GSM254702     4  0.3989     0.0123 0.000 0.468 0.000 0.528 0.000 0.004
#> GSM254643     2  0.2362     0.7069 0.000 0.860 0.000 0.136 0.000 0.004
#> GSM254727     2  0.2730     0.6501 0.000 0.808 0.000 0.192 0.000 0.000
#> GSM254640     2  0.4190     0.6678 0.000 0.740 0.000 0.112 0.000 0.148
#> GSM254626     2  0.0260     0.7463 0.000 0.992 0.000 0.008 0.000 0.000
#> GSM254635     4  0.4937     0.5381 0.000 0.196 0.000 0.652 0.000 0.152
#> GSM254653     2  0.2772     0.6613 0.000 0.816 0.000 0.180 0.000 0.004
#> GSM254658     2  0.0000     0.7463 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM254681     2  0.1663     0.7196 0.000 0.912 0.000 0.000 0.000 0.088
#> GSM254719     2  0.3215     0.6372 0.000 0.756 0.000 0.240 0.000 0.004
#> GSM254673     2  0.2234     0.7126 0.000 0.872 0.000 0.124 0.000 0.004
#> GSM254655     2  0.3728     0.5205 0.000 0.652 0.000 0.344 0.000 0.004
#> GSM254669     2  0.0508     0.7457 0.000 0.984 0.000 0.012 0.000 0.004
#> GSM254699     2  0.3728     0.5205 0.000 0.652 0.000 0.344 0.000 0.004
#> GSM254703     6  0.4136     0.5703 0.000 0.012 0.000 0.428 0.000 0.560
#> GSM254708     2  0.3446     0.5649 0.000 0.692 0.000 0.000 0.000 0.308
#> GSM254715     4  0.3566     0.6005 0.000 0.236 0.000 0.744 0.000 0.020
#> GSM254628     2  0.0000     0.7463 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM254634     6  0.4039     0.5873 0.000 0.008 0.000 0.424 0.000 0.568
#> GSM254646     2  0.0000     0.7463 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM254671     4  0.4764     0.5788 0.000 0.232 0.000 0.660 0.000 0.108
#> GSM254711     4  0.3852     0.4177 0.000 0.064 0.000 0.760 0.000 0.176
#> GSM254717     2  0.2003     0.7172 0.000 0.884 0.000 0.116 0.000 0.000
#> GSM254723     3  0.1477     0.7414 0.000 0.008 0.940 0.048 0.000 0.004
#> GSM254730     2  0.4729     0.6475 0.000 0.676 0.000 0.196 0.000 0.128
#> GSM254731     4  0.3215     0.5892 0.000 0.240 0.000 0.756 0.000 0.004
#> GSM254632     6  0.4749     0.1421 0.000 0.028 0.292 0.032 0.000 0.648
#> GSM254662     2  0.2191     0.7143 0.000 0.876 0.000 0.120 0.000 0.004
#> GSM254677     4  0.4495     0.3042 0.000 0.064 0.000 0.660 0.000 0.276
#> GSM254665     2  0.4179     0.3085 0.000 0.516 0.000 0.012 0.000 0.472
#> GSM254691     6  0.4116    -0.2181 0.000 0.416 0.000 0.012 0.000 0.572
#> GSM254644     4  0.3163     0.5947 0.000 0.232 0.000 0.764 0.000 0.004
#> GSM254667     6  0.3797     0.6024 0.000 0.000 0.000 0.420 0.000 0.580
#> GSM254676     6  0.3797     0.6024 0.000 0.000 0.000 0.420 0.000 0.580
#> GSM254679     6  0.3838     0.5537 0.000 0.000 0.000 0.448 0.000 0.552
#> GSM254689     2  0.2912     0.6287 0.000 0.784 0.000 0.000 0.000 0.216
#> GSM254706     2  0.3765     0.4225 0.000 0.596 0.000 0.000 0.000 0.404
#> GSM254712     4  0.4223     0.6006 0.000 0.236 0.000 0.704 0.000 0.060
#> GSM254713     4  0.4085     0.6033 0.000 0.232 0.000 0.716 0.000 0.052
#> GSM254683     2  0.3862     0.3036 0.000 0.524 0.000 0.000 0.000 0.476
#> GSM254710     2  0.3737     0.4399 0.000 0.608 0.000 0.000 0.000 0.392
#> GSM254725     4  0.3847    -0.3558 0.000 0.000 0.000 0.544 0.000 0.456
#> GSM254651     2  0.3309     0.5766 0.000 0.720 0.000 0.000 0.000 0.280
#> GSM254638     6  0.3797     0.6024 0.000 0.000 0.000 0.420 0.000 0.580
#> GSM254685     4  0.5037    -0.1529 0.000 0.080 0.000 0.540 0.000 0.380

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

consensus_heatmap(res, k = 2)

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

consensus_heatmap(res, k = 3)

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

consensus_heatmap(res, k = 4)

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

consensus_heatmap(res, k = 5)

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

consensus_heatmap(res, k = 6)

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

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

membership_heatmap(res, k = 2)

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

membership_heatmap(res, k = 3)

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

membership_heatmap(res, k = 4)

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

membership_heatmap(res, k = 5)

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

membership_heatmap(res, k = 6)

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

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

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

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

get_signatures(res, k = 3)

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

get_signatures(res, k = 4)

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

get_signatures(res, k = 5)

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

get_signatures(res, k = 6)

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

Signature heatmaps where rows are not scaled:

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

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

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

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

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

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

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

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

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

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

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk SD-pam-signature_compare

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

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

An example of the output of tb is:

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

The columns in tb are:

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

UMAP plot which shows how samples are separated.

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

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

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

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

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

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

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

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

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

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

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk SD-pam-collect-classes

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

test_to_known_factors(res)
#>          n tissue(p) individual(p) disease.state(p) gender(p) other(p) k
#> SD:pam 107  1.59e-22       0.77697            0.577     0.628    0.872 2
#> SD:pam  99  1.41e-20       0.00669            0.150     0.349    0.175 3
#> SD:pam  99  1.75e-20       0.00289            0.437     0.190    0.523 4
#> SD:pam  95  7.61e-19       0.01689            0.663     0.199    0.441 5
#> SD:pam  78  3.07e-15       0.00155            0.835     0.350    0.692 6

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


SD:mclust**

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

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

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

res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#>   On a matrix with 21168 rows and 107 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.4956 0.505   0.505
#> 3 3 0.715           0.850       0.900         0.2959 0.849   0.701
#> 4 4 0.602           0.363       0.695         0.0794 0.886   0.717
#> 5 5 0.714           0.801       0.867         0.0829 0.813   0.515
#> 6 6 0.715           0.715       0.800         0.0521 0.958   0.829

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
#> GSM254629     1   0.000      0.997 1.000 0.000
#> GSM254648     1   0.000      0.997 1.000 0.000
#> GSM254694     1   0.000      0.997 1.000 0.000
#> GSM254701     1   0.000      0.997 1.000 0.000
#> GSM254728     1   0.000      0.997 1.000 0.000
#> GSM254726     1   0.000      0.997 1.000 0.000
#> GSM254639     1   0.000      0.997 1.000 0.000
#> GSM254652     1   0.000      0.997 1.000 0.000
#> GSM254700     1   0.000      0.997 1.000 0.000
#> GSM254625     1   0.000      0.997 1.000 0.000
#> GSM254636     1   0.000      0.997 1.000 0.000
#> GSM254659     1   0.000      0.997 1.000 0.000
#> GSM254680     1   0.000      0.997 1.000 0.000
#> GSM254686     1   0.000      0.997 1.000 0.000
#> GSM254718     1   0.000      0.997 1.000 0.000
#> GSM254674     1   0.000      0.997 1.000 0.000
#> GSM254668     1   0.000      0.997 1.000 0.000
#> GSM254697     1   0.000      0.997 1.000 0.000
#> GSM254704     1   0.000      0.997 1.000 0.000
#> GSM254707     1   0.000      0.997 1.000 0.000
#> GSM254714     1   0.000      0.997 1.000 0.000
#> GSM254722     1   0.000      0.997 1.000 0.000
#> GSM254627     1   0.000      0.997 1.000 0.000
#> GSM254630     1   0.000      0.997 1.000 0.000
#> GSM254633     1   0.000      0.997 1.000 0.000
#> GSM254670     1   0.000      0.997 1.000 0.000
#> GSM254716     1   0.000      0.997 1.000 0.000
#> GSM254720     1   0.000      0.997 1.000 0.000
#> GSM254729     1   0.000      0.997 1.000 0.000
#> GSM254654     1   0.000      0.997 1.000 0.000
#> GSM254656     1   0.000      0.997 1.000 0.000
#> GSM254631     1   0.000      0.997 1.000 0.000
#> GSM254657     1   0.000      0.997 1.000 0.000
#> GSM254664     1   0.000      0.997 1.000 0.000
#> GSM254672     1   0.000      0.997 1.000 0.000
#> GSM254692     1   0.000      0.997 1.000 0.000
#> GSM254645     1   0.000      0.997 1.000 0.000
#> GSM254666     1   0.000      0.997 1.000 0.000
#> GSM254675     1   0.000      0.997 1.000 0.000
#> GSM254678     1   0.000      0.997 1.000 0.000
#> GSM254688     1   0.000      0.997 1.000 0.000
#> GSM254690     1   0.000      0.997 1.000 0.000
#> GSM254696     1   0.000      0.997 1.000 0.000
#> GSM254705     1   0.000      0.997 1.000 0.000
#> GSM254642     1   0.000      0.997 1.000 0.000
#> GSM254661     1   0.000      0.997 1.000 0.000
#> GSM254698     1   0.000      0.997 1.000 0.000
#> GSM254641     1   0.000      0.997 1.000 0.000
#> GSM254647     1   0.000      0.997 1.000 0.000
#> GSM254663     1   0.000      0.997 1.000 0.000
#> GSM254682     1   0.000      0.997 1.000 0.000
#> GSM254709     1   0.000      0.997 1.000 0.000
#> GSM254721     1   0.000      0.997 1.000 0.000
#> GSM254724     1   0.000      0.997 1.000 0.000
#> GSM254650     1   0.000      0.997 1.000 0.000
#> GSM254687     1   0.000      0.997 1.000 0.000
#> GSM254637     1   0.000      0.997 1.000 0.000
#> GSM254684     1   0.000      0.997 1.000 0.000
#> GSM254649     2   0.000      0.998 0.000 1.000
#> GSM254660     2   0.000      0.998 0.000 1.000
#> GSM254693     2   0.000      0.998 0.000 1.000
#> GSM254695     2   0.000      0.998 0.000 1.000
#> GSM254702     2   0.000      0.998 0.000 1.000
#> GSM254643     2   0.000      0.998 0.000 1.000
#> GSM254727     2   0.000      0.998 0.000 1.000
#> GSM254640     2   0.000      0.998 0.000 1.000
#> GSM254626     2   0.000      0.998 0.000 1.000
#> GSM254635     2   0.000      0.998 0.000 1.000
#> GSM254653     2   0.000      0.998 0.000 1.000
#> GSM254658     2   0.000      0.998 0.000 1.000
#> GSM254681     2   0.000      0.998 0.000 1.000
#> GSM254719     2   0.000      0.998 0.000 1.000
#> GSM254673     2   0.000      0.998 0.000 1.000
#> GSM254655     2   0.000      0.998 0.000 1.000
#> GSM254669     2   0.000      0.998 0.000 1.000
#> GSM254699     2   0.000      0.998 0.000 1.000
#> GSM254703     2   0.000      0.998 0.000 1.000
#> GSM254708     2   0.000      0.998 0.000 1.000
#> GSM254715     2   0.000      0.998 0.000 1.000
#> GSM254628     2   0.000      0.998 0.000 1.000
#> GSM254634     2   0.000      0.998 0.000 1.000
#> GSM254646     2   0.000      0.998 0.000 1.000
#> GSM254671     2   0.000      0.998 0.000 1.000
#> GSM254711     2   0.000      0.998 0.000 1.000
#> GSM254717     2   0.000      0.998 0.000 1.000
#> GSM254723     1   0.000      0.997 1.000 0.000
#> GSM254730     2   0.000      0.998 0.000 1.000
#> GSM254731     2   0.000      0.998 0.000 1.000
#> GSM254632     1   0.000      0.997 1.000 0.000
#> GSM254662     2   0.000      0.998 0.000 1.000
#> GSM254677     2   0.000      0.998 0.000 1.000
#> GSM254665     2   0.000      0.998 0.000 1.000
#> GSM254691     2   0.000      0.998 0.000 1.000
#> GSM254644     2   0.000      0.998 0.000 1.000
#> GSM254667     2   0.358      0.927 0.068 0.932
#> GSM254676     2   0.000      0.998 0.000 1.000
#> GSM254679     2   0.000      0.998 0.000 1.000
#> GSM254689     2   0.000      0.998 0.000 1.000
#> GSM254706     2   0.000      0.998 0.000 1.000
#> GSM254712     2   0.000      0.998 0.000 1.000
#> GSM254713     2   0.000      0.998 0.000 1.000
#> GSM254683     2   0.000      0.998 0.000 1.000
#> GSM254710     1   0.697      0.768 0.812 0.188
#> GSM254725     2   0.000      0.998 0.000 1.000
#> GSM254651     2   0.000      0.998 0.000 1.000
#> GSM254638     2   0.000      0.998 0.000 1.000
#> GSM254685     2   0.000      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
#> GSM254629     3  0.3038      0.860 0.104 0.000 0.896
#> GSM254648     3  0.3192      0.863 0.112 0.000 0.888
#> GSM254694     3  0.3192      0.863 0.112 0.000 0.888
#> GSM254701     3  0.3038      0.860 0.104 0.000 0.896
#> GSM254728     3  0.4452      0.848 0.192 0.000 0.808
#> GSM254726     3  0.3192      0.863 0.112 0.000 0.888
#> GSM254639     3  0.4702      0.840 0.212 0.000 0.788
#> GSM254652     3  0.4654      0.844 0.208 0.000 0.792
#> GSM254700     1  0.1289      0.842 0.968 0.000 0.032
#> GSM254625     3  0.6126      0.450 0.400 0.000 0.600
#> GSM254636     1  0.5621      0.617 0.692 0.000 0.308
#> GSM254659     3  0.4504      0.850 0.196 0.000 0.804
#> GSM254680     1  0.3686      0.820 0.860 0.000 0.140
#> GSM254686     1  0.3752      0.818 0.856 0.000 0.144
#> GSM254718     3  0.4121      0.856 0.168 0.000 0.832
#> GSM254674     1  0.3752      0.818 0.856 0.000 0.144
#> GSM254668     1  0.3879      0.818 0.848 0.000 0.152
#> GSM254697     1  0.1289      0.842 0.968 0.000 0.032
#> GSM254704     1  0.1643      0.838 0.956 0.000 0.044
#> GSM254707     1  0.3752      0.821 0.856 0.000 0.144
#> GSM254714     1  0.5835      0.452 0.660 0.000 0.340
#> GSM254722     1  0.0424      0.850 0.992 0.000 0.008
#> GSM254627     1  0.1163      0.844 0.972 0.000 0.028
#> GSM254630     1  0.0892      0.851 0.980 0.000 0.020
#> GSM254633     1  0.4235      0.798 0.824 0.000 0.176
#> GSM254670     3  0.4750      0.844 0.216 0.000 0.784
#> GSM254716     3  0.6215      0.388 0.428 0.000 0.572
#> GSM254720     1  0.4235      0.714 0.824 0.000 0.176
#> GSM254729     3  0.3192      0.863 0.112 0.000 0.888
#> GSM254654     3  0.3192      0.863 0.112 0.000 0.888
#> GSM254656     3  0.4702      0.812 0.212 0.000 0.788
#> GSM254631     1  0.3192      0.831 0.888 0.000 0.112
#> GSM254657     3  0.4931      0.839 0.232 0.000 0.768
#> GSM254664     1  0.3267      0.828 0.884 0.000 0.116
#> GSM254672     1  0.0424      0.849 0.992 0.000 0.008
#> GSM254692     1  0.0892      0.845 0.980 0.000 0.020
#> GSM254645     3  0.5291      0.798 0.268 0.000 0.732
#> GSM254666     1  0.6302     -0.145 0.520 0.000 0.480
#> GSM254675     1  0.1411      0.852 0.964 0.000 0.036
#> GSM254678     1  0.0592      0.850 0.988 0.000 0.012
#> GSM254688     1  0.3551      0.829 0.868 0.000 0.132
#> GSM254690     1  0.3482      0.828 0.872 0.000 0.128
#> GSM254696     1  0.6204      0.282 0.576 0.000 0.424
#> GSM254705     1  0.0424      0.848 0.992 0.000 0.008
#> GSM254642     1  0.1163      0.842 0.972 0.000 0.028
#> GSM254661     3  0.4452      0.852 0.192 0.000 0.808
#> GSM254698     1  0.4452      0.664 0.808 0.000 0.192
#> GSM254641     1  0.3412      0.824 0.876 0.000 0.124
#> GSM254647     1  0.0000      0.850 1.000 0.000 0.000
#> GSM254663     1  0.0892      0.852 0.980 0.000 0.020
#> GSM254682     1  0.1529      0.851 0.960 0.000 0.040
#> GSM254709     1  0.3192      0.832 0.888 0.000 0.112
#> GSM254721     1  0.1643      0.838 0.956 0.000 0.044
#> GSM254724     1  0.1643      0.838 0.956 0.000 0.044
#> GSM254650     1  0.0592      0.850 0.988 0.000 0.012
#> GSM254687     1  0.0892      0.852 0.980 0.000 0.020
#> GSM254637     1  0.6126      0.343 0.600 0.000 0.400
#> GSM254684     1  0.5591      0.404 0.696 0.000 0.304
#> GSM254649     2  0.0592      0.973 0.000 0.988 0.012
#> GSM254660     2  0.0747      0.973 0.000 0.984 0.016
#> GSM254693     2  0.0592      0.973 0.000 0.988 0.012
#> GSM254695     2  0.4346      0.843 0.000 0.816 0.184
#> GSM254702     2  0.0747      0.973 0.000 0.984 0.016
#> GSM254643     2  0.0592      0.973 0.000 0.988 0.012
#> GSM254727     2  0.0000      0.974 0.000 1.000 0.000
#> GSM254640     2  0.0592      0.973 0.000 0.988 0.012
#> GSM254626     2  0.0592      0.973 0.000 0.988 0.012
#> GSM254635     2  0.2448      0.942 0.000 0.924 0.076
#> GSM254653     2  0.0592      0.973 0.000 0.988 0.012
#> GSM254658     2  0.0592      0.973 0.000 0.988 0.012
#> GSM254681     2  0.0000      0.974 0.000 1.000 0.000
#> GSM254719     2  0.0592      0.973 0.000 0.988 0.012
#> GSM254673     2  0.0424      0.974 0.000 0.992 0.008
#> GSM254655     2  0.0592      0.973 0.000 0.988 0.012
#> GSM254669     2  0.0000      0.974 0.000 1.000 0.000
#> GSM254699     2  0.0592      0.973 0.000 0.988 0.012
#> GSM254703     2  0.3116      0.919 0.000 0.892 0.108
#> GSM254708     2  0.0424      0.972 0.000 0.992 0.008
#> GSM254715     2  0.2261      0.952 0.000 0.932 0.068
#> GSM254628     2  0.0592      0.973 0.000 0.988 0.012
#> GSM254634     2  0.1289      0.965 0.000 0.968 0.032
#> GSM254646     2  0.0000      0.974 0.000 1.000 0.000
#> GSM254671     2  0.0237      0.973 0.000 0.996 0.004
#> GSM254711     2  0.1964      0.952 0.000 0.944 0.056
#> GSM254717     2  0.0000      0.974 0.000 1.000 0.000
#> GSM254723     3  0.4702      0.812 0.212 0.000 0.788
#> GSM254730     2  0.0592      0.973 0.000 0.988 0.012
#> GSM254731     2  0.0747      0.973 0.000 0.984 0.016
#> GSM254632     3  0.4654      0.816 0.208 0.000 0.792
#> GSM254662     2  0.0000      0.974 0.000 1.000 0.000
#> GSM254677     2  0.3116      0.920 0.000 0.892 0.108
#> GSM254665     2  0.0000      0.974 0.000 1.000 0.000
#> GSM254691     2  0.0000      0.974 0.000 1.000 0.000
#> GSM254644     2  0.0592      0.973 0.000 0.988 0.012
#> GSM254667     2  0.3551      0.871 0.000 0.868 0.132
#> GSM254676     2  0.0000      0.974 0.000 1.000 0.000
#> GSM254679     2  0.0424      0.973 0.000 0.992 0.008
#> GSM254689     2  0.0000      0.974 0.000 1.000 0.000
#> GSM254706     2  0.0424      0.972 0.000 0.992 0.008
#> GSM254712     2  0.3116      0.919 0.000 0.892 0.108
#> GSM254713     2  0.2261      0.952 0.000 0.932 0.068
#> GSM254683     2  0.0000      0.974 0.000 1.000 0.000
#> GSM254710     3  0.8433      0.595 0.176 0.204 0.620
#> GSM254725     2  0.2165      0.949 0.000 0.936 0.064
#> GSM254651     2  0.0000      0.974 0.000 1.000 0.000
#> GSM254638     2  0.3879      0.880 0.000 0.848 0.152
#> GSM254685     2  0.2261      0.952 0.000 0.932 0.068

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM254629     3  0.0927     0.5638 0.016 0.000 0.976 0.008
#> GSM254648     3  0.2480     0.5527 0.008 0.000 0.904 0.088
#> GSM254694     3  0.2412     0.5548 0.008 0.000 0.908 0.084
#> GSM254701     3  0.2174     0.5568 0.020 0.000 0.928 0.052
#> GSM254728     3  0.2489     0.5474 0.068 0.000 0.912 0.020
#> GSM254726     3  0.3142     0.5502 0.008 0.000 0.860 0.132
#> GSM254639     3  0.2699     0.5542 0.068 0.000 0.904 0.028
#> GSM254652     3  0.1902     0.5544 0.064 0.000 0.932 0.004
#> GSM254700     1  0.0188     0.3080 0.996 0.000 0.000 0.004
#> GSM254625     3  0.4741     0.4721 0.028 0.000 0.744 0.228
#> GSM254636     3  0.7299    -0.4522 0.296 0.000 0.520 0.184
#> GSM254659     3  0.3219     0.5065 0.112 0.000 0.868 0.020
#> GSM254680     1  0.7421    -0.3544 0.432 0.000 0.400 0.168
#> GSM254686     1  0.7398    -0.3648 0.424 0.000 0.412 0.164
#> GSM254718     3  0.1888     0.5633 0.044 0.000 0.940 0.016
#> GSM254674     1  0.7412    -0.3480 0.444 0.000 0.388 0.168
#> GSM254668     3  0.7398    -0.6587 0.412 0.000 0.424 0.164
#> GSM254697     1  0.0188     0.3080 0.996 0.000 0.000 0.004
#> GSM254704     1  0.0336     0.3079 0.992 0.000 0.008 0.000
#> GSM254707     3  0.7811    -0.6626 0.336 0.000 0.404 0.260
#> GSM254714     3  0.7740    -0.4635 0.320 0.000 0.432 0.248
#> GSM254722     1  0.7459    -0.4167 0.508 0.000 0.248 0.244
#> GSM254627     1  0.1792     0.2883 0.932 0.000 0.068 0.000
#> GSM254630     1  0.7782    -0.6193 0.424 0.000 0.264 0.312
#> GSM254633     3  0.7272    -0.5673 0.344 0.000 0.496 0.160
#> GSM254670     3  0.2973     0.5463 0.020 0.000 0.884 0.096
#> GSM254716     3  0.5964     0.3791 0.096 0.000 0.676 0.228
#> GSM254720     3  0.7793    -0.5517 0.356 0.000 0.396 0.248
#> GSM254729     3  0.2408     0.5577 0.000 0.000 0.896 0.104
#> GSM254654     3  0.2412     0.5548 0.008 0.000 0.908 0.084
#> GSM254656     3  0.4889     0.5201 0.032 0.028 0.792 0.148
#> GSM254631     3  0.7761    -0.6080 0.340 0.000 0.416 0.244
#> GSM254657     3  0.3335     0.5349 0.020 0.000 0.860 0.120
#> GSM254664     1  0.7369    -0.2653 0.496 0.000 0.324 0.180
#> GSM254672     1  0.6523    -0.0759 0.636 0.000 0.208 0.156
#> GSM254692     1  0.2861     0.2667 0.888 0.000 0.096 0.016
#> GSM254645     3  0.4307     0.5150 0.048 0.000 0.808 0.144
#> GSM254666     3  0.6916    -0.2478 0.236 0.000 0.588 0.176
#> GSM254675     1  0.7500    -0.3586 0.500 0.000 0.252 0.248
#> GSM254678     3  0.7861    -0.7209 0.360 0.000 0.368 0.272
#> GSM254688     1  0.7780    -0.5538 0.428 0.000 0.300 0.272
#> GSM254690     1  0.7640    -0.4413 0.464 0.000 0.296 0.240
#> GSM254696     3  0.7402    -0.3734 0.264 0.000 0.516 0.220
#> GSM254705     1  0.7763    -0.5969 0.432 0.000 0.264 0.304
#> GSM254642     1  0.0000     0.3075 1.000 0.000 0.000 0.000
#> GSM254661     3  0.2483     0.5592 0.052 0.000 0.916 0.032
#> GSM254698     3  0.7756    -0.6257 0.348 0.000 0.412 0.240
#> GSM254641     1  0.7383    -0.3402 0.448 0.000 0.388 0.164
#> GSM254647     1  0.6449    -0.0581 0.644 0.000 0.204 0.152
#> GSM254663     1  0.7436    -0.3160 0.512 0.000 0.236 0.252
#> GSM254682     4  0.7871     0.0000 0.332 0.000 0.284 0.384
#> GSM254709     1  0.7489    -0.2977 0.492 0.000 0.296 0.212
#> GSM254721     1  0.0188     0.3080 0.996 0.000 0.000 0.004
#> GSM254724     1  0.0188     0.3080 0.996 0.000 0.000 0.004
#> GSM254650     1  0.7606    -0.4780 0.468 0.000 0.228 0.304
#> GSM254687     1  0.7593    -0.4605 0.472 0.000 0.228 0.300
#> GSM254637     3  0.7337    -0.3175 0.272 0.000 0.524 0.204
#> GSM254684     3  0.7529    -0.4031 0.224 0.000 0.488 0.288
#> GSM254649     2  0.4431     0.8552 0.000 0.696 0.000 0.304
#> GSM254660     2  0.2921     0.8448 0.000 0.860 0.000 0.140
#> GSM254693     2  0.4431     0.8552 0.000 0.696 0.000 0.304
#> GSM254695     2  0.4996     0.6946 0.000 0.752 0.056 0.192
#> GSM254702     2  0.2081     0.8165 0.000 0.916 0.000 0.084
#> GSM254643     2  0.4382     0.8582 0.000 0.704 0.000 0.296
#> GSM254727     2  0.4164     0.8591 0.000 0.736 0.000 0.264
#> GSM254640     2  0.4040     0.8576 0.000 0.752 0.000 0.248
#> GSM254626     2  0.4431     0.8552 0.000 0.696 0.000 0.304
#> GSM254635     2  0.2999     0.7723 0.000 0.864 0.004 0.132
#> GSM254653     2  0.4431     0.8552 0.000 0.696 0.000 0.304
#> GSM254658     2  0.4431     0.8552 0.000 0.696 0.000 0.304
#> GSM254681     2  0.4072     0.8591 0.000 0.748 0.000 0.252
#> GSM254719     2  0.4431     0.8552 0.000 0.696 0.000 0.304
#> GSM254673     2  0.4277     0.8580 0.000 0.720 0.000 0.280
#> GSM254655     2  0.4431     0.8552 0.000 0.696 0.000 0.304
#> GSM254669     2  0.4250     0.8584 0.000 0.724 0.000 0.276
#> GSM254699     2  0.4431     0.8552 0.000 0.696 0.000 0.304
#> GSM254703     2  0.2546     0.7870 0.000 0.900 0.008 0.092
#> GSM254708     2  0.4331     0.8275 0.000 0.712 0.000 0.288
#> GSM254715     2  0.2647     0.7983 0.000 0.880 0.000 0.120
#> GSM254628     2  0.4431     0.8552 0.000 0.696 0.000 0.304
#> GSM254634     2  0.3024     0.7663 0.000 0.852 0.000 0.148
#> GSM254646     2  0.4040     0.8594 0.000 0.752 0.000 0.248
#> GSM254671     2  0.1474     0.8145 0.000 0.948 0.000 0.052
#> GSM254711     2  0.2011     0.7954 0.000 0.920 0.000 0.080
#> GSM254717     2  0.4103     0.8589 0.000 0.744 0.000 0.256
#> GSM254723     3  0.5075     0.5157 0.032 0.028 0.776 0.164
#> GSM254730     2  0.4250     0.8583 0.000 0.724 0.000 0.276
#> GSM254731     2  0.1792     0.8215 0.000 0.932 0.000 0.068
#> GSM254632     3  0.5438     0.4955 0.024 0.028 0.728 0.220
#> GSM254662     2  0.4103     0.8589 0.000 0.744 0.000 0.256
#> GSM254677     2  0.3300     0.7622 0.000 0.848 0.008 0.144
#> GSM254665     2  0.4220     0.8599 0.000 0.748 0.004 0.248
#> GSM254691     2  0.4356     0.8529 0.000 0.708 0.000 0.292
#> GSM254644     2  0.2704     0.8383 0.000 0.876 0.000 0.124
#> GSM254667     2  0.6161     0.6399 0.008 0.592 0.044 0.356
#> GSM254676     2  0.4382     0.8537 0.000 0.704 0.000 0.296
#> GSM254679     2  0.1940     0.8007 0.000 0.924 0.000 0.076
#> GSM254689     2  0.4040     0.8592 0.000 0.752 0.000 0.248
#> GSM254706     2  0.4624     0.8400 0.000 0.660 0.000 0.340
#> GSM254712     2  0.2676     0.7854 0.000 0.896 0.012 0.092
#> GSM254713     2  0.2647     0.7983 0.000 0.880 0.000 0.120
#> GSM254683     2  0.4585     0.8437 0.000 0.668 0.000 0.332
#> GSM254710     3  0.6786     0.3786 0.020 0.064 0.572 0.344
#> GSM254725     2  0.2921     0.7704 0.000 0.860 0.000 0.140
#> GSM254651     2  0.4331     0.8540 0.000 0.712 0.000 0.288
#> GSM254638     2  0.5040     0.7019 0.008 0.764 0.048 0.180
#> GSM254685     2  0.2408     0.8040 0.000 0.896 0.000 0.104

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM254629     3  0.1894      0.881 0.000 0.000 0.920 0.008 0.072
#> GSM254648     3  0.3463      0.869 0.044 0.000 0.860 0.040 0.056
#> GSM254694     3  0.3221      0.873 0.044 0.000 0.872 0.028 0.056
#> GSM254701     3  0.4235      0.537 0.000 0.000 0.656 0.008 0.336
#> GSM254728     3  0.3003      0.818 0.000 0.000 0.812 0.000 0.188
#> GSM254726     3  0.3530      0.871 0.044 0.000 0.856 0.040 0.060
#> GSM254639     3  0.2127      0.882 0.000 0.000 0.892 0.000 0.108
#> GSM254652     3  0.1908      0.879 0.000 0.000 0.908 0.000 0.092
#> GSM254700     1  0.1410      0.998 0.940 0.000 0.000 0.000 0.060
#> GSM254625     3  0.1894      0.882 0.000 0.000 0.920 0.008 0.072
#> GSM254636     5  0.1831      0.910 0.000 0.000 0.076 0.004 0.920
#> GSM254659     3  0.4114      0.465 0.000 0.000 0.624 0.000 0.376
#> GSM254680     5  0.2445      0.898 0.004 0.000 0.108 0.004 0.884
#> GSM254686     5  0.2536      0.882 0.000 0.000 0.128 0.004 0.868
#> GSM254718     3  0.3305      0.776 0.000 0.000 0.776 0.000 0.224
#> GSM254674     5  0.2338      0.894 0.000 0.000 0.112 0.004 0.884
#> GSM254668     5  0.2497      0.895 0.004 0.000 0.112 0.004 0.880
#> GSM254697     1  0.1341      0.995 0.944 0.000 0.000 0.000 0.056
#> GSM254704     1  0.1410      0.998 0.940 0.000 0.000 0.000 0.060
#> GSM254707     5  0.2389      0.892 0.000 0.000 0.116 0.004 0.880
#> GSM254714     5  0.2179      0.873 0.004 0.000 0.100 0.000 0.896
#> GSM254722     5  0.2463      0.880 0.100 0.000 0.004 0.008 0.888
#> GSM254627     1  0.1410      0.998 0.940 0.000 0.000 0.000 0.060
#> GSM254630     5  0.0854      0.912 0.004 0.000 0.012 0.008 0.976
#> GSM254633     5  0.2497      0.895 0.004 0.000 0.112 0.004 0.880
#> GSM254670     3  0.2193      0.881 0.000 0.000 0.900 0.008 0.092
#> GSM254716     3  0.2462      0.869 0.000 0.000 0.880 0.008 0.112
#> GSM254720     5  0.0404      0.913 0.012 0.000 0.000 0.000 0.988
#> GSM254729     3  0.1914      0.880 0.000 0.000 0.924 0.016 0.060
#> GSM254654     3  0.3305      0.872 0.044 0.000 0.868 0.032 0.056
#> GSM254656     3  0.4654      0.843 0.044 0.004 0.788 0.056 0.108
#> GSM254631     5  0.0798      0.916 0.008 0.000 0.016 0.000 0.976
#> GSM254657     3  0.2723      0.872 0.000 0.000 0.864 0.012 0.124
#> GSM254664     5  0.2228      0.904 0.004 0.000 0.092 0.004 0.900
#> GSM254672     5  0.3074      0.777 0.196 0.000 0.000 0.000 0.804
#> GSM254692     1  0.1478      0.994 0.936 0.000 0.000 0.000 0.064
#> GSM254645     3  0.3282      0.835 0.000 0.000 0.804 0.008 0.188
#> GSM254666     5  0.4046      0.651 0.000 0.000 0.296 0.008 0.696
#> GSM254675     5  0.0404      0.913 0.012 0.000 0.000 0.000 0.988
#> GSM254678     5  0.0794      0.911 0.028 0.000 0.000 0.000 0.972
#> GSM254688     5  0.0798      0.915 0.016 0.000 0.008 0.000 0.976
#> GSM254690     5  0.0451      0.914 0.008 0.000 0.004 0.000 0.988
#> GSM254696     5  0.2770      0.862 0.008 0.000 0.124 0.004 0.864
#> GSM254705     5  0.0854      0.912 0.012 0.000 0.004 0.008 0.976
#> GSM254642     1  0.1341      0.995 0.944 0.000 0.000 0.000 0.056
#> GSM254661     3  0.1792      0.880 0.000 0.000 0.916 0.000 0.084
#> GSM254698     5  0.2408      0.884 0.096 0.000 0.004 0.008 0.892
#> GSM254641     5  0.2179      0.901 0.000 0.000 0.100 0.004 0.896
#> GSM254647     5  0.3143      0.763 0.204 0.000 0.000 0.000 0.796
#> GSM254663     5  0.0404      0.913 0.012 0.000 0.000 0.000 0.988
#> GSM254682     5  0.0867      0.912 0.008 0.000 0.008 0.008 0.976
#> GSM254709     5  0.1731      0.913 0.004 0.000 0.060 0.004 0.932
#> GSM254721     1  0.1410      0.998 0.940 0.000 0.000 0.000 0.060
#> GSM254724     1  0.1410      0.998 0.940 0.000 0.000 0.000 0.060
#> GSM254650     5  0.0740      0.911 0.008 0.000 0.004 0.008 0.980
#> GSM254687     5  0.0740      0.911 0.008 0.000 0.004 0.008 0.980
#> GSM254637     5  0.1704      0.912 0.004 0.000 0.068 0.000 0.928
#> GSM254684     5  0.2116      0.880 0.004 0.000 0.076 0.008 0.912
#> GSM254649     2  0.0162      0.827 0.004 0.996 0.000 0.000 0.000
#> GSM254660     2  0.2299      0.804 0.004 0.912 0.052 0.032 0.000
#> GSM254693     2  0.0000      0.827 0.000 1.000 0.000 0.000 0.000
#> GSM254695     4  0.1478      0.724 0.000 0.064 0.000 0.936 0.000
#> GSM254702     2  0.0609      0.822 0.000 0.980 0.000 0.020 0.000
#> GSM254643     2  0.3248      0.779 0.004 0.856 0.052 0.088 0.000
#> GSM254727     2  0.0000      0.827 0.000 1.000 0.000 0.000 0.000
#> GSM254640     2  0.0162      0.827 0.000 0.996 0.000 0.004 0.000
#> GSM254626     2  0.0000      0.827 0.000 1.000 0.000 0.000 0.000
#> GSM254635     4  0.2338      0.754 0.004 0.112 0.000 0.884 0.000
#> GSM254653     2  0.0000      0.827 0.000 1.000 0.000 0.000 0.000
#> GSM254658     2  0.0510      0.828 0.000 0.984 0.000 0.016 0.000
#> GSM254681     2  0.2806      0.760 0.004 0.844 0.000 0.152 0.000
#> GSM254719     2  0.0000      0.827 0.000 1.000 0.000 0.000 0.000
#> GSM254673     2  0.0000      0.827 0.000 1.000 0.000 0.000 0.000
#> GSM254655     2  0.0162      0.827 0.000 0.996 0.000 0.004 0.000
#> GSM254669     2  0.0162      0.829 0.000 0.996 0.000 0.004 0.000
#> GSM254699     2  0.0162      0.827 0.000 0.996 0.000 0.004 0.000
#> GSM254703     4  0.4314      0.644 0.004 0.280 0.016 0.700 0.000
#> GSM254708     4  0.3949      0.649 0.000 0.332 0.000 0.668 0.000
#> GSM254715     2  0.4644      0.618 0.004 0.720 0.052 0.224 0.000
#> GSM254628     2  0.0510      0.828 0.000 0.984 0.000 0.016 0.000
#> GSM254634     4  0.3661      0.714 0.000 0.276 0.000 0.724 0.000
#> GSM254646     2  0.2536      0.777 0.004 0.868 0.000 0.128 0.000
#> GSM254671     2  0.2773      0.759 0.000 0.836 0.000 0.164 0.000
#> GSM254711     2  0.4779      0.227 0.004 0.584 0.016 0.396 0.000
#> GSM254717     2  0.3039      0.727 0.000 0.808 0.000 0.192 0.000
#> GSM254723     3  0.4654      0.843 0.044 0.004 0.788 0.056 0.108
#> GSM254730     2  0.0290      0.829 0.000 0.992 0.000 0.008 0.000
#> GSM254731     2  0.0404      0.825 0.000 0.988 0.000 0.012 0.000
#> GSM254632     3  0.4346      0.852 0.044 0.004 0.812 0.060 0.080
#> GSM254662     2  0.0000      0.827 0.000 1.000 0.000 0.000 0.000
#> GSM254677     4  0.1478      0.724 0.000 0.064 0.000 0.936 0.000
#> GSM254665     2  0.4615      0.633 0.004 0.724 0.052 0.220 0.000
#> GSM254691     2  0.4182      0.258 0.000 0.600 0.000 0.400 0.000
#> GSM254644     2  0.0963      0.823 0.000 0.964 0.000 0.036 0.000
#> GSM254667     4  0.3730      0.709 0.000 0.288 0.000 0.712 0.000
#> GSM254676     2  0.3928      0.541 0.004 0.700 0.000 0.296 0.000
#> GSM254679     2  0.4242      0.143 0.000 0.572 0.000 0.428 0.000
#> GSM254689     2  0.2843      0.763 0.008 0.848 0.000 0.144 0.000
#> GSM254706     4  0.4443      0.254 0.004 0.472 0.000 0.524 0.000
#> GSM254712     4  0.5018      0.606 0.004 0.284 0.052 0.660 0.000
#> GSM254713     2  0.4673      0.611 0.004 0.716 0.052 0.228 0.000
#> GSM254683     2  0.4264      0.326 0.004 0.620 0.000 0.376 0.000
#> GSM254710     3  0.5702      0.760 0.044 0.020 0.720 0.148 0.068
#> GSM254725     4  0.3424      0.739 0.000 0.240 0.000 0.760 0.000
#> GSM254651     2  0.3906      0.563 0.004 0.704 0.000 0.292 0.000
#> GSM254638     4  0.1365      0.691 0.004 0.040 0.004 0.952 0.000
#> GSM254685     2  0.3465      0.772 0.004 0.840 0.052 0.104 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
#> GSM254629     3  0.1958     0.7392 0.000 0.000 0.896 0.000 0.004 0.100
#> GSM254648     6  0.3528     0.8019 0.004 0.000 0.296 0.000 0.000 0.700
#> GSM254694     6  0.3975     0.5460 0.004 0.000 0.452 0.000 0.000 0.544
#> GSM254701     3  0.1984     0.6876 0.000 0.000 0.912 0.000 0.056 0.032
#> GSM254728     3  0.1007     0.6990 0.000 0.000 0.956 0.000 0.044 0.000
#> GSM254726     6  0.3409     0.8005 0.000 0.000 0.300 0.000 0.000 0.700
#> GSM254639     3  0.3025     0.7457 0.000 0.000 0.820 0.000 0.024 0.156
#> GSM254652     3  0.2980     0.7367 0.000 0.000 0.808 0.000 0.012 0.180
#> GSM254700     1  0.0146     0.9913 0.996 0.000 0.000 0.000 0.004 0.000
#> GSM254625     3  0.3312     0.7269 0.000 0.000 0.792 0.000 0.028 0.180
#> GSM254636     5  0.3956     0.7666 0.000 0.000 0.292 0.000 0.684 0.024
#> GSM254659     3  0.2176     0.6661 0.000 0.000 0.896 0.000 0.080 0.024
#> GSM254680     5  0.2948     0.8139 0.000 0.000 0.188 0.000 0.804 0.008
#> GSM254686     5  0.3967     0.7125 0.000 0.000 0.356 0.000 0.632 0.012
#> GSM254718     3  0.1196     0.7085 0.000 0.000 0.952 0.000 0.040 0.008
#> GSM254674     5  0.3898     0.7383 0.000 0.000 0.336 0.000 0.652 0.012
#> GSM254668     5  0.2814     0.8153 0.000 0.000 0.172 0.000 0.820 0.008
#> GSM254697     1  0.0146     0.9913 0.996 0.000 0.000 0.000 0.004 0.000
#> GSM254704     1  0.0260     0.9890 0.992 0.000 0.000 0.000 0.008 0.000
#> GSM254707     5  0.3835     0.7445 0.000 0.000 0.320 0.000 0.668 0.012
#> GSM254714     5  0.3141     0.7105 0.012 0.000 0.200 0.000 0.788 0.000
#> GSM254722     5  0.2398     0.8204 0.088 0.000 0.016 0.004 0.888 0.004
#> GSM254627     1  0.0458     0.9804 0.984 0.000 0.000 0.000 0.016 0.000
#> GSM254630     5  0.0146     0.8379 0.000 0.000 0.004 0.000 0.996 0.000
#> GSM254633     5  0.3629     0.7820 0.000 0.000 0.276 0.000 0.712 0.012
#> GSM254670     3  0.3248     0.7411 0.000 0.000 0.804 0.000 0.032 0.164
#> GSM254716     3  0.3939     0.7331 0.000 0.000 0.752 0.000 0.068 0.180
#> GSM254720     5  0.1096     0.8396 0.008 0.000 0.020 0.004 0.964 0.004
#> GSM254729     3  0.3711     0.5849 0.000 0.000 0.720 0.000 0.020 0.260
#> GSM254654     6  0.3907     0.6576 0.004 0.000 0.408 0.000 0.000 0.588
#> GSM254656     6  0.4887     0.7972 0.000 0.000 0.236 0.020 0.072 0.672
#> GSM254631     5  0.1765     0.8455 0.000 0.000 0.096 0.000 0.904 0.000
#> GSM254657     3  0.3978     0.6900 0.000 0.000 0.756 0.000 0.084 0.160
#> GSM254664     5  0.2653     0.8273 0.012 0.000 0.144 0.000 0.844 0.000
#> GSM254672     5  0.2994     0.7456 0.208 0.000 0.004 0.000 0.788 0.000
#> GSM254692     1  0.0865     0.9648 0.964 0.000 0.000 0.000 0.036 0.000
#> GSM254645     3  0.2613     0.6132 0.000 0.000 0.848 0.000 0.140 0.012
#> GSM254666     5  0.4097     0.4756 0.000 0.000 0.492 0.000 0.500 0.008
#> GSM254675     5  0.0837     0.8389 0.000 0.000 0.020 0.004 0.972 0.004
#> GSM254678     5  0.1261     0.8417 0.008 0.000 0.028 0.004 0.956 0.004
#> GSM254688     5  0.1116     0.8422 0.000 0.000 0.028 0.004 0.960 0.008
#> GSM254690     5  0.0865     0.8429 0.000 0.000 0.036 0.000 0.964 0.000
#> GSM254696     5  0.3734     0.7759 0.000 0.000 0.264 0.000 0.716 0.020
#> GSM254705     5  0.0653     0.8337 0.004 0.000 0.000 0.004 0.980 0.012
#> GSM254642     1  0.0146     0.9913 0.996 0.000 0.000 0.000 0.004 0.000
#> GSM254661     3  0.3078     0.7253 0.000 0.000 0.796 0.000 0.012 0.192
#> GSM254698     5  0.4680     0.7824 0.084 0.000 0.176 0.004 0.720 0.016
#> GSM254641     5  0.2814     0.8196 0.000 0.000 0.172 0.000 0.820 0.008
#> GSM254647     5  0.3198     0.6606 0.260 0.000 0.000 0.000 0.740 0.000
#> GSM254663     5  0.0551     0.8355 0.000 0.000 0.004 0.004 0.984 0.008
#> GSM254682     5  0.2884     0.8060 0.000 0.000 0.164 0.004 0.824 0.008
#> GSM254709     5  0.2775     0.8300 0.000 0.000 0.104 0.000 0.856 0.040
#> GSM254721     1  0.0146     0.9913 0.996 0.000 0.000 0.000 0.004 0.000
#> GSM254724     1  0.0146     0.9913 0.996 0.000 0.000 0.000 0.004 0.000
#> GSM254650     5  0.1296     0.8254 0.000 0.000 0.004 0.004 0.948 0.044
#> GSM254687     5  0.1296     0.8254 0.000 0.000 0.004 0.004 0.948 0.044
#> GSM254637     5  0.2762     0.8279 0.000 0.000 0.196 0.000 0.804 0.000
#> GSM254684     5  0.3401     0.7857 0.000 0.000 0.204 0.004 0.776 0.016
#> GSM254649     2  0.0806     0.8002 0.000 0.972 0.000 0.020 0.000 0.008
#> GSM254660     2  0.2766     0.7285 0.000 0.852 0.004 0.020 0.000 0.124
#> GSM254693     2  0.0146     0.7996 0.000 0.996 0.000 0.000 0.000 0.004
#> GSM254695     4  0.0717     0.6502 0.000 0.008 0.000 0.976 0.000 0.016
#> GSM254702     2  0.1219     0.7850 0.000 0.948 0.000 0.048 0.000 0.004
#> GSM254643     2  0.2973     0.7212 0.000 0.836 0.004 0.024 0.000 0.136
#> GSM254727     2  0.0777     0.7990 0.000 0.972 0.000 0.024 0.000 0.004
#> GSM254640     2  0.0458     0.7992 0.000 0.984 0.000 0.016 0.000 0.000
#> GSM254626     2  0.0458     0.7985 0.000 0.984 0.000 0.000 0.000 0.016
#> GSM254635     4  0.4012     0.7239 0.000 0.176 0.000 0.748 0.000 0.076
#> GSM254653     2  0.0146     0.7996 0.000 0.996 0.000 0.000 0.000 0.004
#> GSM254658     2  0.0291     0.8010 0.000 0.992 0.000 0.004 0.000 0.004
#> GSM254681     2  0.4426     0.3767 0.000 0.652 0.000 0.296 0.000 0.052
#> GSM254719     2  0.0146     0.7996 0.000 0.996 0.000 0.000 0.000 0.004
#> GSM254673     2  0.0000     0.8001 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM254655     2  0.0291     0.8002 0.000 0.992 0.000 0.004 0.000 0.004
#> GSM254669     2  0.0520     0.8008 0.000 0.984 0.000 0.008 0.000 0.008
#> GSM254699     2  0.0146     0.8006 0.000 0.996 0.000 0.004 0.000 0.000
#> GSM254703     4  0.4048     0.6602 0.000 0.132 0.004 0.764 0.000 0.100
#> GSM254708     4  0.3740     0.7091 0.000 0.228 0.000 0.740 0.000 0.032
#> GSM254715     2  0.4520     0.5769 0.000 0.716 0.004 0.156 0.000 0.124
#> GSM254628     2  0.0914     0.8006 0.000 0.968 0.000 0.016 0.000 0.016
#> GSM254634     4  0.2631     0.7367 0.000 0.180 0.000 0.820 0.000 0.000
#> GSM254646     2  0.4033     0.5154 0.000 0.724 0.000 0.224 0.000 0.052
#> GSM254671     2  0.2003     0.7556 0.000 0.884 0.000 0.116 0.000 0.000
#> GSM254711     4  0.5354     0.1735 0.000 0.444 0.004 0.460 0.000 0.092
#> GSM254717     2  0.3508     0.4535 0.000 0.704 0.000 0.292 0.000 0.004
#> GSM254723     6  0.4859     0.8002 0.000 0.000 0.240 0.020 0.068 0.672
#> GSM254730     2  0.0777     0.8004 0.000 0.972 0.000 0.024 0.000 0.004
#> GSM254731     2  0.0937     0.7901 0.000 0.960 0.000 0.040 0.000 0.000
#> GSM254632     6  0.4574     0.8136 0.000 0.000 0.260 0.020 0.040 0.680
#> GSM254662     2  0.0692     0.7995 0.000 0.976 0.000 0.020 0.000 0.004
#> GSM254677     4  0.0363     0.6656 0.000 0.012 0.000 0.988 0.000 0.000
#> GSM254665     2  0.5432     0.0448 0.000 0.536 0.004 0.344 0.000 0.116
#> GSM254691     4  0.4269     0.4451 0.000 0.412 0.000 0.568 0.000 0.020
#> GSM254644     2  0.1500     0.7926 0.000 0.936 0.000 0.052 0.000 0.012
#> GSM254667     4  0.3558     0.7300 0.000 0.184 0.004 0.780 0.000 0.032
#> GSM254676     2  0.4574    -0.1438 0.000 0.524 0.000 0.440 0.000 0.036
#> GSM254679     2  0.3851     0.0048 0.000 0.540 0.000 0.460 0.000 0.000
#> GSM254689     2  0.4423     0.4029 0.000 0.668 0.000 0.272 0.000 0.060
#> GSM254706     4  0.4152     0.6341 0.000 0.304 0.000 0.664 0.000 0.032
#> GSM254712     4  0.4843     0.5616 0.000 0.216 0.004 0.668 0.000 0.112
#> GSM254713     2  0.4934     0.4944 0.000 0.660 0.004 0.212 0.000 0.124
#> GSM254683     4  0.4499     0.3903 0.000 0.428 0.000 0.540 0.000 0.032
#> GSM254710     6  0.5295     0.6641 0.000 0.000 0.148 0.152 0.032 0.668
#> GSM254725     4  0.2597     0.7374 0.000 0.176 0.000 0.824 0.000 0.000
#> GSM254651     2  0.4218     0.0210 0.000 0.556 0.000 0.428 0.000 0.016
#> GSM254638     4  0.2169     0.6484 0.000 0.012 0.008 0.900 0.000 0.080
#> GSM254685     2  0.3777     0.6812 0.000 0.788 0.004 0.084 0.000 0.124

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

consensus_heatmap(res, k = 2)

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

consensus_heatmap(res, k = 3)

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

consensus_heatmap(res, k = 4)

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

consensus_heatmap(res, k = 5)

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

consensus_heatmap(res, k = 6)

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

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

membership_heatmap(res, k = 2)

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

membership_heatmap(res, k = 3)

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

membership_heatmap(res, k = 4)

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

membership_heatmap(res, k = 5)

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

membership_heatmap(res, k = 6)

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

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

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

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

get_signatures(res, k = 3)

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

get_signatures(res, k = 4)

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

get_signatures(res, k = 5)

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

get_signatures(res, k = 6)

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

Signature heatmaps where rows are not scaled:

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

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

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

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

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

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

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

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

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

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

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk SD-mclust-signature_compare

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

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

An example of the output of tb is:

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

The columns in tb are:

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

UMAP plot which shows how samples are separated.

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

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

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

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

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

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

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

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

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

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

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk SD-mclust-collect-classes

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

test_to_known_factors(res)
#>             n tissue(p) individual(p) disease.state(p) gender(p) other(p) k
#> SD:mclust 107  1.00e-21       0.64037            0.454    0.7329    0.961 2
#> SD:mclust 100  3.17e-20       0.02926            0.498    0.0562    0.846 3
#> SD:mclust  64  1.62e-13       0.13515            0.486    0.0279    1.000 4
#> SD:mclust 101  1.01e-18       0.02609            0.661    0.4028    0.463 5
#> SD:mclust  95  2.62e-17       0.00567            0.706    0.4174    0.502 6

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


SD:NMF**

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

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

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

res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#>   On a matrix with 21168 rows and 107 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 1.000           0.971       0.988         0.5037 0.497   0.497
#> 3 3 0.587           0.615       0.795         0.2334 0.938   0.876
#> 4 4 0.653           0.603       0.793         0.1420 0.809   0.586
#> 5 5 0.716           0.690       0.833         0.0496 0.904   0.714
#> 6 6 0.746           0.675       0.826         0.0400 0.959   0.858

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

suggest_best_k(res)
#> [1] 2

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

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

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>           class entropy silhouette    p1    p2
#> GSM254629     1  0.0000      0.981 1.000 0.000
#> GSM254648     2  0.0938      0.984 0.012 0.988
#> GSM254694     1  0.6801      0.782 0.820 0.180
#> GSM254701     1  0.0000      0.981 1.000 0.000
#> GSM254728     1  0.0000      0.981 1.000 0.000
#> GSM254726     1  0.7745      0.707 0.772 0.228
#> GSM254639     1  0.0000      0.981 1.000 0.000
#> GSM254652     1  0.0000      0.981 1.000 0.000
#> GSM254700     1  0.0000      0.981 1.000 0.000
#> GSM254625     1  0.0000      0.981 1.000 0.000
#> GSM254636     1  0.0000      0.981 1.000 0.000
#> GSM254659     1  0.0000      0.981 1.000 0.000
#> GSM254680     1  0.0000      0.981 1.000 0.000
#> GSM254686     1  0.0000      0.981 1.000 0.000
#> GSM254718     1  0.0000      0.981 1.000 0.000
#> GSM254674     1  0.0000      0.981 1.000 0.000
#> GSM254668     1  0.0000      0.981 1.000 0.000
#> GSM254697     1  0.0000      0.981 1.000 0.000
#> GSM254704     1  0.0000      0.981 1.000 0.000
#> GSM254707     1  0.0000      0.981 1.000 0.000
#> GSM254714     1  0.0000      0.981 1.000 0.000
#> GSM254722     1  0.0000      0.981 1.000 0.000
#> GSM254627     1  0.0000      0.981 1.000 0.000
#> GSM254630     1  0.0000      0.981 1.000 0.000
#> GSM254633     1  0.0000      0.981 1.000 0.000
#> GSM254670     1  0.0000      0.981 1.000 0.000
#> GSM254716     1  0.0000      0.981 1.000 0.000
#> GSM254720     1  0.0000      0.981 1.000 0.000
#> GSM254729     1  0.0000      0.981 1.000 0.000
#> GSM254654     1  0.7139      0.760 0.804 0.196
#> GSM254656     1  0.9963      0.142 0.536 0.464
#> GSM254631     1  0.0000      0.981 1.000 0.000
#> GSM254657     1  0.0000      0.981 1.000 0.000
#> GSM254664     1  0.0000      0.981 1.000 0.000
#> GSM254672     1  0.0000      0.981 1.000 0.000
#> GSM254692     1  0.0000      0.981 1.000 0.000
#> GSM254645     1  0.0000      0.981 1.000 0.000
#> GSM254666     1  0.0000      0.981 1.000 0.000
#> GSM254675     1  0.0000      0.981 1.000 0.000
#> GSM254678     1  0.0000      0.981 1.000 0.000
#> GSM254688     1  0.0000      0.981 1.000 0.000
#> GSM254690     1  0.0000      0.981 1.000 0.000
#> GSM254696     1  0.0000      0.981 1.000 0.000
#> GSM254705     1  0.0000      0.981 1.000 0.000
#> GSM254642     1  0.0000      0.981 1.000 0.000
#> GSM254661     1  0.0000      0.981 1.000 0.000
#> GSM254698     1  0.0000      0.981 1.000 0.000
#> GSM254641     1  0.0000      0.981 1.000 0.000
#> GSM254647     1  0.0000      0.981 1.000 0.000
#> GSM254663     1  0.0000      0.981 1.000 0.000
#> GSM254682     1  0.0000      0.981 1.000 0.000
#> GSM254709     1  0.0000      0.981 1.000 0.000
#> GSM254721     1  0.0000      0.981 1.000 0.000
#> GSM254724     1  0.0000      0.981 1.000 0.000
#> GSM254650     1  0.0000      0.981 1.000 0.000
#> GSM254687     1  0.0000      0.981 1.000 0.000
#> GSM254637     1  0.0000      0.981 1.000 0.000
#> GSM254684     1  0.0000      0.981 1.000 0.000
#> GSM254649     2  0.0000      0.995 0.000 1.000
#> GSM254660     2  0.0000      0.995 0.000 1.000
#> GSM254693     2  0.0000      0.995 0.000 1.000
#> GSM254695     2  0.0000      0.995 0.000 1.000
#> GSM254702     2  0.0000      0.995 0.000 1.000
#> GSM254643     2  0.0000      0.995 0.000 1.000
#> GSM254727     2  0.0000      0.995 0.000 1.000
#> GSM254640     2  0.0000      0.995 0.000 1.000
#> GSM254626     2  0.0000      0.995 0.000 1.000
#> GSM254635     2  0.0000      0.995 0.000 1.000
#> GSM254653     2  0.0000      0.995 0.000 1.000
#> GSM254658     2  0.0000      0.995 0.000 1.000
#> GSM254681     2  0.0000      0.995 0.000 1.000
#> GSM254719     2  0.0000      0.995 0.000 1.000
#> GSM254673     2  0.0000      0.995 0.000 1.000
#> GSM254655     2  0.0000      0.995 0.000 1.000
#> GSM254669     2  0.0000      0.995 0.000 1.000
#> GSM254699     2  0.0000      0.995 0.000 1.000
#> GSM254703     2  0.0000      0.995 0.000 1.000
#> GSM254708     2  0.0000      0.995 0.000 1.000
#> GSM254715     2  0.0000      0.995 0.000 1.000
#> GSM254628     2  0.0000      0.995 0.000 1.000
#> GSM254634     2  0.0000      0.995 0.000 1.000
#> GSM254646     2  0.0000      0.995 0.000 1.000
#> GSM254671     2  0.0000      0.995 0.000 1.000
#> GSM254711     2  0.0000      0.995 0.000 1.000
#> GSM254717     2  0.0000      0.995 0.000 1.000
#> GSM254723     2  0.4690      0.888 0.100 0.900
#> GSM254730     2  0.0000      0.995 0.000 1.000
#> GSM254731     2  0.0000      0.995 0.000 1.000
#> GSM254632     2  0.5059      0.872 0.112 0.888
#> GSM254662     2  0.0000      0.995 0.000 1.000
#> GSM254677     2  0.0000      0.995 0.000 1.000
#> GSM254665     2  0.0000      0.995 0.000 1.000
#> GSM254691     2  0.0000      0.995 0.000 1.000
#> GSM254644     2  0.0000      0.995 0.000 1.000
#> GSM254667     2  0.0000      0.995 0.000 1.000
#> GSM254676     2  0.0000      0.995 0.000 1.000
#> GSM254679     2  0.0000      0.995 0.000 1.000
#> GSM254689     2  0.0000      0.995 0.000 1.000
#> GSM254706     2  0.0000      0.995 0.000 1.000
#> GSM254712     2  0.0000      0.995 0.000 1.000
#> GSM254713     2  0.0000      0.995 0.000 1.000
#> GSM254683     2  0.0000      0.995 0.000 1.000
#> GSM254710     2  0.0000      0.995 0.000 1.000
#> GSM254725     2  0.0000      0.995 0.000 1.000
#> GSM254651     2  0.0000      0.995 0.000 1.000
#> GSM254638     2  0.0000      0.995 0.000 1.000
#> GSM254685     2  0.0000      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
#> GSM254629     1  0.5760     0.4304 0.672 0.000 0.328
#> GSM254648     2  0.6865     0.5965 0.020 0.596 0.384
#> GSM254694     1  0.9379    -0.2899 0.504 0.208 0.288
#> GSM254701     1  0.4555     0.5647 0.800 0.000 0.200
#> GSM254728     1  0.6168     0.1098 0.588 0.000 0.412
#> GSM254726     3  0.9130     0.4462 0.356 0.152 0.492
#> GSM254639     3  0.6192     0.5200 0.420 0.000 0.580
#> GSM254652     1  0.6062     0.1913 0.616 0.000 0.384
#> GSM254700     1  0.0000     0.6648 1.000 0.000 0.000
#> GSM254625     1  0.6308     0.0861 0.508 0.000 0.492
#> GSM254636     1  0.6008     0.2207 0.628 0.000 0.372
#> GSM254659     1  0.5882     0.2662 0.652 0.000 0.348
#> GSM254680     1  0.2959     0.6527 0.900 0.000 0.100
#> GSM254686     1  0.3879     0.6232 0.848 0.000 0.152
#> GSM254718     1  0.6192    -0.1242 0.580 0.000 0.420
#> GSM254674     1  0.4062     0.6106 0.836 0.000 0.164
#> GSM254668     1  0.2959     0.6549 0.900 0.000 0.100
#> GSM254697     1  0.1031     0.6641 0.976 0.000 0.024
#> GSM254704     1  0.0237     0.6651 0.996 0.000 0.004
#> GSM254707     1  0.4796     0.5894 0.780 0.000 0.220
#> GSM254714     1  0.1031     0.6634 0.976 0.000 0.024
#> GSM254722     1  0.3879     0.6161 0.848 0.000 0.152
#> GSM254627     1  0.1031     0.6641 0.976 0.000 0.024
#> GSM254630     1  0.4178     0.6087 0.828 0.000 0.172
#> GSM254633     1  0.4346     0.5894 0.816 0.000 0.184
#> GSM254670     1  0.6308    -0.2916 0.508 0.000 0.492
#> GSM254716     3  0.6062     0.0494 0.384 0.000 0.616
#> GSM254720     1  0.0424     0.6651 0.992 0.000 0.008
#> GSM254729     3  0.6451     0.5060 0.436 0.004 0.560
#> GSM254654     1  0.9284    -0.2797 0.512 0.192 0.296
#> GSM254656     3  0.7847     0.2561 0.068 0.344 0.588
#> GSM254631     1  0.2066     0.6669 0.940 0.000 0.060
#> GSM254657     3  0.6215     0.5147 0.428 0.000 0.572
#> GSM254664     1  0.1289     0.6687 0.968 0.000 0.032
#> GSM254672     1  0.3412     0.5584 0.876 0.000 0.124
#> GSM254692     1  0.2448     0.6094 0.924 0.000 0.076
#> GSM254645     3  0.6274     0.4661 0.456 0.000 0.544
#> GSM254666     1  0.5810     0.3413 0.664 0.000 0.336
#> GSM254675     1  0.0237     0.6651 0.996 0.000 0.004
#> GSM254678     1  0.1411     0.6651 0.964 0.000 0.036
#> GSM254688     1  0.4504     0.5943 0.804 0.000 0.196
#> GSM254690     1  0.4002     0.6208 0.840 0.000 0.160
#> GSM254696     1  0.6180     0.0903 0.584 0.000 0.416
#> GSM254705     1  0.1964     0.6567 0.944 0.000 0.056
#> GSM254642     1  0.1289     0.6624 0.968 0.000 0.032
#> GSM254661     1  0.6095     0.1733 0.608 0.000 0.392
#> GSM254698     1  0.6079     0.1576 0.612 0.000 0.388
#> GSM254641     1  0.3116     0.6486 0.892 0.000 0.108
#> GSM254647     1  0.0000     0.6648 1.000 0.000 0.000
#> GSM254663     1  0.0592     0.6613 0.988 0.000 0.012
#> GSM254682     1  0.4842     0.5685 0.776 0.000 0.224
#> GSM254709     1  0.5882     0.2148 0.652 0.000 0.348
#> GSM254721     1  0.0000     0.6648 1.000 0.000 0.000
#> GSM254724     1  0.0000     0.6648 1.000 0.000 0.000
#> GSM254650     1  0.5327     0.3241 0.728 0.000 0.272
#> GSM254687     1  0.4399     0.4572 0.812 0.000 0.188
#> GSM254637     1  0.1643     0.6565 0.956 0.000 0.044
#> GSM254684     1  0.6095     0.1729 0.608 0.000 0.392
#> GSM254649     2  0.4346     0.8013 0.000 0.816 0.184
#> GSM254660     2  0.0592     0.8710 0.000 0.988 0.012
#> GSM254693     2  0.2066     0.8615 0.000 0.940 0.060
#> GSM254695     2  0.4452     0.7857 0.000 0.808 0.192
#> GSM254702     2  0.2066     0.8595 0.000 0.940 0.060
#> GSM254643     2  0.2261     0.8590 0.000 0.932 0.068
#> GSM254727     2  0.0592     0.8708 0.000 0.988 0.012
#> GSM254640     2  0.0424     0.8713 0.000 0.992 0.008
#> GSM254626     2  0.2066     0.8618 0.000 0.940 0.060
#> GSM254635     2  0.4605     0.7755 0.000 0.796 0.204
#> GSM254653     2  0.0747     0.8704 0.000 0.984 0.016
#> GSM254658     2  0.4702     0.7836 0.000 0.788 0.212
#> GSM254681     2  0.6126     0.6056 0.000 0.600 0.400
#> GSM254719     2  0.0237     0.8713 0.000 0.996 0.004
#> GSM254673     2  0.1643     0.8654 0.000 0.956 0.044
#> GSM254655     2  0.0424     0.8713 0.000 0.992 0.008
#> GSM254669     2  0.2165     0.8603 0.000 0.936 0.064
#> GSM254699     2  0.0424     0.8713 0.000 0.992 0.008
#> GSM254703     2  0.3340     0.8351 0.000 0.880 0.120
#> GSM254708     2  0.0000     0.8715 0.000 1.000 0.000
#> GSM254715     2  0.3551     0.8287 0.000 0.868 0.132
#> GSM254628     2  0.4062     0.8140 0.000 0.836 0.164
#> GSM254634     2  0.3482     0.8309 0.000 0.872 0.128
#> GSM254646     2  0.5948     0.6500 0.000 0.640 0.360
#> GSM254671     2  0.2537     0.8525 0.000 0.920 0.080
#> GSM254711     2  0.3340     0.8351 0.000 0.880 0.120
#> GSM254717     2  0.0592     0.8714 0.000 0.988 0.012
#> GSM254723     2  0.4912     0.7761 0.008 0.796 0.196
#> GSM254730     2  0.0747     0.8706 0.000 0.984 0.016
#> GSM254731     2  0.0747     0.8706 0.000 0.984 0.016
#> GSM254632     2  0.6398     0.6455 0.192 0.748 0.060
#> GSM254662     2  0.0424     0.8711 0.000 0.992 0.008
#> GSM254677     2  0.4974     0.7440 0.000 0.764 0.236
#> GSM254665     2  0.1643     0.8654 0.000 0.956 0.044
#> GSM254691     2  0.0000     0.8715 0.000 1.000 0.000
#> GSM254644     2  0.0747     0.8706 0.000 0.984 0.016
#> GSM254667     2  0.2165     0.8606 0.000 0.936 0.064
#> GSM254676     2  0.0000     0.8715 0.000 1.000 0.000
#> GSM254679     2  0.3752     0.8215 0.000 0.856 0.144
#> GSM254689     2  0.5835     0.6705 0.000 0.660 0.340
#> GSM254706     2  0.4346     0.8023 0.000 0.816 0.184
#> GSM254712     2  0.3551     0.8287 0.000 0.868 0.132
#> GSM254713     2  0.3686     0.8240 0.000 0.860 0.140
#> GSM254683     2  0.5621     0.7019 0.000 0.692 0.308
#> GSM254710     2  0.6680     0.4588 0.008 0.508 0.484
#> GSM254725     2  0.4796     0.7595 0.000 0.780 0.220
#> GSM254651     2  0.4931     0.7687 0.000 0.768 0.232
#> GSM254638     2  0.4796     0.7595 0.000 0.780 0.220
#> GSM254685     2  0.0747     0.8706 0.000 0.984 0.016

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM254629     4  0.6653    -0.0405 0.196 0.000 0.180 0.624
#> GSM254648     4  0.4050     0.3819 0.000 0.168 0.024 0.808
#> GSM254694     1  0.9234     0.0600 0.388 0.132 0.144 0.336
#> GSM254701     1  0.7785    -0.0460 0.428 0.000 0.284 0.288
#> GSM254728     3  0.5256     0.6715 0.040 0.000 0.700 0.260
#> GSM254726     3  0.6336     0.5729 0.004 0.076 0.616 0.304
#> GSM254639     3  0.3969     0.6712 0.016 0.000 0.804 0.180
#> GSM254652     3  0.4934     0.6730 0.028 0.000 0.720 0.252
#> GSM254700     1  0.0188     0.7703 0.996 0.000 0.000 0.004
#> GSM254625     4  0.5013     0.1761 0.056 0.004 0.176 0.764
#> GSM254636     3  0.4375     0.6778 0.032 0.000 0.788 0.180
#> GSM254659     3  0.5565     0.6669 0.056 0.000 0.684 0.260
#> GSM254680     3  0.7761     0.3707 0.340 0.000 0.416 0.244
#> GSM254686     3  0.7841     0.4326 0.284 0.000 0.404 0.312
#> GSM254718     3  0.7917     0.2572 0.344 0.000 0.344 0.312
#> GSM254674     3  0.7059     0.5997 0.184 0.000 0.568 0.248
#> GSM254668     1  0.7609     0.0562 0.464 0.000 0.224 0.312
#> GSM254697     1  0.0000     0.7701 1.000 0.000 0.000 0.000
#> GSM254704     1  0.0336     0.7699 0.992 0.000 0.000 0.008
#> GSM254707     4  0.6229     0.0172 0.132 0.000 0.204 0.664
#> GSM254714     1  0.2563     0.7447 0.908 0.000 0.020 0.072
#> GSM254722     1  0.3893     0.6662 0.796 0.000 0.196 0.008
#> GSM254627     1  0.0000     0.7701 1.000 0.000 0.000 0.000
#> GSM254630     1  0.3895     0.6729 0.804 0.000 0.184 0.012
#> GSM254633     3  0.7436     0.5473 0.236 0.000 0.512 0.252
#> GSM254670     3  0.0895     0.6259 0.020 0.000 0.976 0.004
#> GSM254716     4  0.4807     0.0733 0.024 0.000 0.248 0.728
#> GSM254720     1  0.0707     0.7679 0.980 0.000 0.000 0.020
#> GSM254729     3  0.4748     0.6692 0.016 0.000 0.716 0.268
#> GSM254654     4  0.9587    -0.0407 0.304 0.228 0.128 0.340
#> GSM254656     3  0.2131     0.5936 0.016 0.008 0.936 0.040
#> GSM254631     1  0.6819     0.3594 0.604 0.000 0.188 0.208
#> GSM254657     3  0.1406     0.6262 0.016 0.000 0.960 0.024
#> GSM254664     1  0.5106     0.5538 0.720 0.000 0.040 0.240
#> GSM254672     1  0.0592     0.7690 0.984 0.000 0.000 0.016
#> GSM254692     1  0.0921     0.7589 0.972 0.000 0.000 0.028
#> GSM254645     1  0.6737     0.2287 0.488 0.000 0.420 0.092
#> GSM254666     3  0.6684     0.5728 0.104 0.000 0.560 0.336
#> GSM254675     1  0.1302     0.7632 0.956 0.000 0.000 0.044
#> GSM254678     1  0.2011     0.7452 0.920 0.000 0.080 0.000
#> GSM254688     3  0.7808     0.1328 0.272 0.000 0.416 0.312
#> GSM254690     1  0.5296     0.1256 0.500 0.000 0.492 0.008
#> GSM254696     3  0.0707     0.6236 0.020 0.000 0.980 0.000
#> GSM254705     1  0.1305     0.7583 0.960 0.000 0.004 0.036
#> GSM254642     1  0.0000     0.7701 1.000 0.000 0.000 0.000
#> GSM254661     3  0.4868     0.6720 0.024 0.000 0.720 0.256
#> GSM254698     3  0.2799     0.5647 0.108 0.000 0.884 0.008
#> GSM254641     1  0.7220     0.2340 0.544 0.000 0.196 0.260
#> GSM254647     1  0.0336     0.7705 0.992 0.000 0.008 0.000
#> GSM254663     1  0.0657     0.7692 0.984 0.000 0.004 0.012
#> GSM254682     3  0.6637     0.3238 0.144 0.000 0.616 0.240
#> GSM254709     4  0.5250    -0.2296 0.440 0.000 0.008 0.552
#> GSM254721     1  0.0188     0.7703 0.996 0.000 0.000 0.004
#> GSM254724     1  0.0188     0.7703 0.996 0.000 0.000 0.004
#> GSM254650     1  0.4522     0.4435 0.680 0.000 0.000 0.320
#> GSM254687     1  0.4624     0.4193 0.660 0.000 0.000 0.340
#> GSM254637     1  0.3978     0.6602 0.796 0.000 0.012 0.192
#> GSM254684     3  0.1151     0.6187 0.024 0.000 0.968 0.008
#> GSM254649     2  0.4072     0.6652 0.000 0.748 0.000 0.252
#> GSM254660     2  0.0188     0.8637 0.000 0.996 0.000 0.004
#> GSM254693     2  0.2647     0.8176 0.000 0.880 0.000 0.120
#> GSM254695     2  0.2125     0.8434 0.000 0.920 0.004 0.076
#> GSM254702     2  0.0921     0.8596 0.000 0.972 0.000 0.028
#> GSM254643     2  0.1940     0.8470 0.000 0.924 0.000 0.076
#> GSM254727     2  0.1940     0.8487 0.000 0.924 0.000 0.076
#> GSM254640     2  0.0000     0.8639 0.000 1.000 0.000 0.000
#> GSM254626     2  0.2149     0.8402 0.000 0.912 0.000 0.088
#> GSM254635     2  0.1940     0.8405 0.000 0.924 0.000 0.076
#> GSM254653     2  0.1118     0.8602 0.000 0.964 0.000 0.036
#> GSM254658     2  0.3975     0.6863 0.000 0.760 0.000 0.240
#> GSM254681     4  0.4843     0.1558 0.000 0.396 0.000 0.604
#> GSM254719     2  0.0592     0.8631 0.000 0.984 0.000 0.016
#> GSM254673     2  0.2011     0.8448 0.000 0.920 0.000 0.080
#> GSM254655     2  0.0188     0.8639 0.000 0.996 0.000 0.004
#> GSM254669     2  0.2760     0.8108 0.000 0.872 0.000 0.128
#> GSM254699     2  0.0188     0.8639 0.000 0.996 0.000 0.004
#> GSM254703     2  0.2222     0.8412 0.000 0.924 0.016 0.060
#> GSM254708     2  0.2081     0.8428 0.000 0.916 0.000 0.084
#> GSM254715     2  0.1970     0.8453 0.000 0.932 0.008 0.060
#> GSM254628     2  0.3444     0.7569 0.000 0.816 0.000 0.184
#> GSM254634     2  0.1389     0.8535 0.000 0.952 0.000 0.048
#> GSM254646     2  0.4998     0.1078 0.000 0.512 0.000 0.488
#> GSM254671     2  0.0707     0.8619 0.000 0.980 0.000 0.020
#> GSM254711     2  0.1474     0.8519 0.000 0.948 0.000 0.052
#> GSM254717     2  0.1940     0.8499 0.000 0.924 0.000 0.076
#> GSM254723     2  0.3224     0.7955 0.000 0.864 0.016 0.120
#> GSM254730     2  0.0000     0.8639 0.000 1.000 0.000 0.000
#> GSM254731     2  0.0592     0.8624 0.000 0.984 0.000 0.016
#> GSM254632     4  0.7280     0.2146 0.004 0.384 0.132 0.480
#> GSM254662     2  0.1557     0.8542 0.000 0.944 0.000 0.056
#> GSM254677     2  0.3099     0.8086 0.000 0.876 0.020 0.104
#> GSM254665     2  0.1867     0.8491 0.000 0.928 0.000 0.072
#> GSM254691     2  0.1022     0.8611 0.000 0.968 0.000 0.032
#> GSM254644     2  0.0592     0.8638 0.000 0.984 0.000 0.016
#> GSM254667     2  0.4790     0.4315 0.000 0.620 0.000 0.380
#> GSM254676     2  0.1211     0.8591 0.000 0.960 0.000 0.040
#> GSM254679     2  0.1637     0.8489 0.000 0.940 0.000 0.060
#> GSM254689     4  0.4994    -0.0969 0.000 0.480 0.000 0.520
#> GSM254706     2  0.4933     0.2972 0.000 0.568 0.000 0.432
#> GSM254712     2  0.2522     0.8295 0.000 0.908 0.016 0.076
#> GSM254713     2  0.2300     0.8385 0.000 0.920 0.016 0.064
#> GSM254683     2  0.4996     0.1118 0.000 0.516 0.000 0.484
#> GSM254710     4  0.5213     0.2959 0.000 0.328 0.020 0.652
#> GSM254725     2  0.1902     0.8451 0.000 0.932 0.004 0.064
#> GSM254651     2  0.4776     0.4413 0.000 0.624 0.000 0.376
#> GSM254638     2  0.2861     0.8122 0.000 0.888 0.016 0.096
#> GSM254685     2  0.1388     0.8580 0.000 0.960 0.012 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
#> GSM254629     3  0.3280     0.6825 0.004 0.000 0.808 0.004 0.184
#> GSM254648     3  0.3422     0.6703 0.000 0.004 0.792 0.004 0.200
#> GSM254694     3  0.3461     0.6736 0.008 0.000 0.848 0.076 0.068
#> GSM254701     3  0.2353     0.7173 0.004 0.000 0.908 0.060 0.028
#> GSM254728     3  0.2079     0.7527 0.000 0.000 0.916 0.064 0.020
#> GSM254726     3  0.1579     0.7424 0.000 0.000 0.944 0.032 0.024
#> GSM254639     4  0.4961     0.3473 0.000 0.000 0.448 0.524 0.028
#> GSM254652     3  0.2464     0.7465 0.000 0.000 0.888 0.096 0.016
#> GSM254700     1  0.0000     0.8577 1.000 0.000 0.000 0.000 0.000
#> GSM254625     3  0.4706     0.0304 0.000 0.004 0.496 0.008 0.492
#> GSM254636     4  0.4508     0.5974 0.000 0.000 0.332 0.648 0.020
#> GSM254659     3  0.1430     0.7560 0.000 0.000 0.944 0.052 0.004
#> GSM254680     3  0.4352     0.7023 0.036 0.000 0.792 0.132 0.040
#> GSM254686     3  0.2488     0.7370 0.000 0.000 0.872 0.004 0.124
#> GSM254718     3  0.2654     0.7049 0.000 0.000 0.884 0.084 0.032
#> GSM254674     3  0.3940     0.6195 0.000 0.000 0.756 0.220 0.024
#> GSM254668     3  0.3848     0.6785 0.012 0.000 0.780 0.012 0.196
#> GSM254697     1  0.0566     0.8575 0.984 0.000 0.000 0.004 0.012
#> GSM254704     1  0.0000     0.8577 1.000 0.000 0.000 0.000 0.000
#> GSM254707     3  0.4359     0.3123 0.000 0.000 0.584 0.004 0.412
#> GSM254714     1  0.7222     0.1164 0.436 0.000 0.380 0.116 0.068
#> GSM254722     1  0.3427     0.7191 0.796 0.000 0.000 0.192 0.012
#> GSM254627     1  0.0566     0.8575 0.984 0.000 0.000 0.004 0.012
#> GSM254630     1  0.3601     0.7557 0.820 0.000 0.000 0.128 0.052
#> GSM254633     3  0.2800     0.7482 0.016 0.000 0.888 0.072 0.024
#> GSM254670     4  0.2516     0.7981 0.000 0.000 0.140 0.860 0.000
#> GSM254716     5  0.4392     0.0900 0.000 0.000 0.380 0.008 0.612
#> GSM254720     1  0.0579     0.8543 0.984 0.000 0.008 0.000 0.008
#> GSM254729     3  0.2674     0.7289 0.000 0.000 0.868 0.120 0.012
#> GSM254654     3  0.3876     0.6301 0.004 0.000 0.812 0.116 0.068
#> GSM254656     4  0.2722     0.7888 0.000 0.004 0.120 0.868 0.008
#> GSM254631     3  0.5153     0.5823 0.208 0.000 0.708 0.060 0.024
#> GSM254657     4  0.3809     0.7293 0.000 0.000 0.256 0.736 0.008
#> GSM254664     3  0.4527     0.5400 0.272 0.000 0.696 0.004 0.028
#> GSM254672     1  0.0162     0.8571 0.996 0.000 0.004 0.000 0.000
#> GSM254692     1  0.0510     0.8575 0.984 0.000 0.000 0.000 0.016
#> GSM254645     1  0.7774     0.0363 0.376 0.000 0.140 0.376 0.108
#> GSM254666     3  0.3882     0.6600 0.000 0.000 0.756 0.020 0.224
#> GSM254675     1  0.1544     0.8178 0.932 0.000 0.068 0.000 0.000
#> GSM254678     1  0.1836     0.8252 0.932 0.000 0.036 0.032 0.000
#> GSM254688     5  0.8330    -0.1967 0.144 0.000 0.220 0.312 0.324
#> GSM254690     1  0.6265     0.0948 0.488 0.000 0.088 0.404 0.020
#> GSM254696     4  0.2864     0.7986 0.000 0.000 0.136 0.852 0.012
#> GSM254705     1  0.0162     0.8578 0.996 0.000 0.000 0.004 0.000
#> GSM254642     1  0.0566     0.8575 0.984 0.000 0.000 0.004 0.012
#> GSM254661     3  0.2139     0.7553 0.000 0.000 0.916 0.032 0.052
#> GSM254698     4  0.3035     0.6825 0.112 0.000 0.032 0.856 0.000
#> GSM254641     3  0.2630     0.7493 0.012 0.000 0.892 0.016 0.080
#> GSM254647     1  0.0566     0.8575 0.984 0.000 0.000 0.004 0.012
#> GSM254663     1  0.1278     0.8499 0.960 0.000 0.020 0.004 0.016
#> GSM254682     4  0.6050     0.6687 0.124 0.000 0.132 0.676 0.068
#> GSM254709     5  0.5223    -0.1743 0.044 0.000 0.444 0.000 0.512
#> GSM254721     1  0.0000     0.8577 1.000 0.000 0.000 0.000 0.000
#> GSM254724     1  0.0000     0.8577 1.000 0.000 0.000 0.000 0.000
#> GSM254650     1  0.3039     0.7596 0.836 0.000 0.012 0.000 0.152
#> GSM254687     1  0.4547     0.3818 0.588 0.000 0.012 0.000 0.400
#> GSM254637     3  0.4965     0.3113 0.404 0.000 0.568 0.004 0.024
#> GSM254684     4  0.2818     0.7983 0.004 0.000 0.128 0.860 0.008
#> GSM254649     2  0.2377     0.8066 0.000 0.872 0.000 0.000 0.128
#> GSM254660     2  0.0404     0.8698 0.000 0.988 0.000 0.000 0.012
#> GSM254693     2  0.1341     0.8579 0.000 0.944 0.000 0.000 0.056
#> GSM254695     2  0.2408     0.8423 0.000 0.892 0.000 0.016 0.092
#> GSM254702     2  0.0963     0.8645 0.000 0.964 0.000 0.000 0.036
#> GSM254643     2  0.0510     0.8702 0.000 0.984 0.000 0.000 0.016
#> GSM254727     2  0.0963     0.8676 0.000 0.964 0.000 0.000 0.036
#> GSM254640     2  0.0671     0.8704 0.000 0.980 0.000 0.004 0.016
#> GSM254626     2  0.0963     0.8658 0.000 0.964 0.000 0.000 0.036
#> GSM254635     2  0.2408     0.8310 0.000 0.892 0.004 0.008 0.096
#> GSM254653     2  0.0794     0.8683 0.000 0.972 0.000 0.000 0.028
#> GSM254658     2  0.2179     0.8204 0.000 0.888 0.000 0.000 0.112
#> GSM254681     5  0.3999     0.3229 0.000 0.344 0.000 0.000 0.656
#> GSM254719     2  0.0404     0.8705 0.000 0.988 0.000 0.000 0.012
#> GSM254673     2  0.0963     0.8658 0.000 0.964 0.000 0.000 0.036
#> GSM254655     2  0.0162     0.8708 0.000 0.996 0.000 0.000 0.004
#> GSM254669     2  0.1410     0.8549 0.000 0.940 0.000 0.000 0.060
#> GSM254699     2  0.0162     0.8708 0.000 0.996 0.000 0.000 0.004
#> GSM254703     2  0.4377     0.7512 0.000 0.800 0.036 0.100 0.064
#> GSM254708     2  0.0963     0.8662 0.000 0.964 0.000 0.000 0.036
#> GSM254715     2  0.1981     0.8477 0.000 0.920 0.000 0.016 0.064
#> GSM254628     2  0.1671     0.8465 0.000 0.924 0.000 0.000 0.076
#> GSM254634     2  0.1282     0.8611 0.000 0.952 0.000 0.004 0.044
#> GSM254646     2  0.4060     0.4673 0.000 0.640 0.000 0.000 0.360
#> GSM254671     2  0.0880     0.8656 0.000 0.968 0.000 0.000 0.032
#> GSM254711     2  0.1430     0.8605 0.000 0.944 0.000 0.004 0.052
#> GSM254717     2  0.0963     0.8676 0.000 0.964 0.000 0.000 0.036
#> GSM254723     2  0.7757     0.2781 0.012 0.504 0.116 0.120 0.248
#> GSM254730     2  0.0404     0.8703 0.000 0.988 0.000 0.000 0.012
#> GSM254731     2  0.0963     0.8663 0.000 0.964 0.000 0.000 0.036
#> GSM254632     5  0.7508     0.3375 0.000 0.252 0.144 0.104 0.500
#> GSM254662     2  0.0703     0.8688 0.000 0.976 0.000 0.000 0.024
#> GSM254677     2  0.5801     0.6337 0.000 0.692 0.052 0.116 0.140
#> GSM254665     2  0.0510     0.8702 0.000 0.984 0.000 0.000 0.016
#> GSM254691     2  0.0404     0.8705 0.000 0.988 0.000 0.000 0.012
#> GSM254644     2  0.1082     0.8683 0.000 0.964 0.000 0.008 0.028
#> GSM254667     2  0.4497     0.6631 0.000 0.732 0.000 0.060 0.208
#> GSM254676     2  0.0609     0.8700 0.000 0.980 0.000 0.000 0.020
#> GSM254679     2  0.1357     0.8594 0.000 0.948 0.000 0.004 0.048
#> GSM254689     2  0.4297     0.1713 0.000 0.528 0.000 0.000 0.472
#> GSM254706     2  0.4088     0.4864 0.000 0.632 0.000 0.000 0.368
#> GSM254712     2  0.5067     0.6966 0.000 0.752 0.044 0.116 0.088
#> GSM254713     2  0.4308     0.7554 0.000 0.804 0.032 0.096 0.068
#> GSM254683     2  0.3837     0.5618 0.000 0.692 0.000 0.000 0.308
#> GSM254710     5  0.2970     0.4300 0.000 0.168 0.000 0.004 0.828
#> GSM254725     2  0.1697     0.8536 0.000 0.932 0.000 0.008 0.060
#> GSM254651     2  0.3895     0.5799 0.000 0.680 0.000 0.000 0.320
#> GSM254638     2  0.5430     0.6647 0.000 0.728 0.060 0.092 0.120
#> GSM254685     2  0.2304     0.8425 0.000 0.908 0.000 0.044 0.048

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM254629     3  0.2911     0.7719 0.000 0.000 0.832 0.144 0.024 0.000
#> GSM254648     3  0.3102     0.7660 0.000 0.000 0.816 0.156 0.028 0.000
#> GSM254694     3  0.2553     0.7762 0.000 0.000 0.848 0.144 0.008 0.000
#> GSM254701     3  0.2402     0.7768 0.000 0.000 0.856 0.140 0.004 0.000
#> GSM254728     3  0.3642     0.7151 0.000 0.000 0.760 0.204 0.036 0.000
#> GSM254726     3  0.3236     0.7512 0.000 0.000 0.796 0.180 0.024 0.000
#> GSM254639     6  0.4810     0.5940 0.000 0.000 0.140 0.160 0.008 0.692
#> GSM254652     3  0.1972     0.7932 0.000 0.000 0.916 0.056 0.004 0.024
#> GSM254700     1  0.1364     0.8454 0.944 0.000 0.004 0.048 0.004 0.000
#> GSM254625     3  0.4653    -0.0685 0.000 0.000 0.492 0.020 0.476 0.012
#> GSM254636     6  0.3903     0.4811 0.000 0.000 0.304 0.004 0.012 0.680
#> GSM254659     3  0.1528     0.7888 0.000 0.000 0.936 0.048 0.016 0.000
#> GSM254680     3  0.2332     0.7730 0.020 0.000 0.908 0.004 0.032 0.036
#> GSM254686     3  0.2506     0.7556 0.000 0.000 0.880 0.052 0.068 0.000
#> GSM254718     3  0.4449     0.5781 0.000 0.000 0.664 0.284 0.048 0.004
#> GSM254674     3  0.2169     0.7668 0.008 0.000 0.900 0.000 0.012 0.080
#> GSM254668     3  0.2822     0.7575 0.012 0.000 0.868 0.016 0.096 0.008
#> GSM254697     1  0.1426     0.8476 0.948 0.000 0.000 0.016 0.008 0.028
#> GSM254704     1  0.1429     0.8441 0.940 0.000 0.004 0.052 0.004 0.000
#> GSM254707     3  0.4570     0.2855 0.000 0.000 0.596 0.024 0.368 0.012
#> GSM254714     4  0.4644     0.2247 0.268 0.000 0.068 0.660 0.004 0.000
#> GSM254722     1  0.3268     0.7672 0.808 0.000 0.000 0.020 0.008 0.164
#> GSM254627     1  0.1503     0.8461 0.944 0.000 0.000 0.016 0.008 0.032
#> GSM254630     1  0.3920     0.7876 0.804 0.000 0.000 0.052 0.092 0.052
#> GSM254633     3  0.0767     0.7867 0.000 0.000 0.976 0.008 0.004 0.012
#> GSM254670     6  0.1225     0.7508 0.000 0.000 0.012 0.036 0.000 0.952
#> GSM254716     5  0.5422     0.4780 0.000 0.000 0.240 0.112 0.624 0.024
#> GSM254720     1  0.2239     0.8354 0.900 0.000 0.020 0.072 0.008 0.000
#> GSM254729     3  0.3130     0.7314 0.000 0.000 0.824 0.028 0.004 0.144
#> GSM254654     3  0.2772     0.7628 0.000 0.000 0.816 0.180 0.004 0.000
#> GSM254656     6  0.1285     0.7464 0.000 0.000 0.004 0.052 0.000 0.944
#> GSM254631     3  0.3571     0.7079 0.116 0.000 0.816 0.000 0.020 0.048
#> GSM254657     6  0.5874     0.3916 0.000 0.000 0.072 0.392 0.048 0.488
#> GSM254664     3  0.2076     0.7737 0.060 0.000 0.912 0.000 0.016 0.012
#> GSM254672     1  0.1732     0.8412 0.920 0.000 0.004 0.072 0.004 0.000
#> GSM254692     1  0.1405     0.8501 0.948 0.000 0.000 0.024 0.024 0.004
#> GSM254645     4  0.5110    -0.1593 0.072 0.000 0.000 0.528 0.004 0.396
#> GSM254666     5  0.6143     0.1782 0.000 0.000 0.396 0.120 0.448 0.036
#> GSM254675     1  0.3399     0.7878 0.832 0.000 0.064 0.088 0.016 0.000
#> GSM254678     1  0.4163     0.7078 0.748 0.000 0.008 0.052 0.004 0.188
#> GSM254688     5  0.7320     0.1674 0.072 0.000 0.168 0.028 0.436 0.296
#> GSM254690     1  0.6081     0.0198 0.448 0.000 0.136 0.008 0.012 0.396
#> GSM254696     6  0.1872     0.7434 0.008 0.000 0.064 0.004 0.004 0.920
#> GSM254705     1  0.1498     0.8524 0.940 0.000 0.000 0.032 0.000 0.028
#> GSM254642     1  0.1503     0.8465 0.944 0.000 0.000 0.016 0.008 0.032
#> GSM254661     3  0.3736     0.7565 0.000 0.000 0.784 0.168 0.024 0.024
#> GSM254698     6  0.1723     0.7291 0.048 0.000 0.004 0.012 0.004 0.932
#> GSM254641     3  0.2403     0.7889 0.012 0.000 0.904 0.044 0.032 0.008
#> GSM254647     1  0.1149     0.8489 0.960 0.000 0.000 0.008 0.008 0.024
#> GSM254663     1  0.2680     0.8279 0.892 0.000 0.048 0.016 0.016 0.028
#> GSM254682     6  0.5888     0.5402 0.064 0.000 0.088 0.044 0.128 0.676
#> GSM254709     3  0.5141     0.2619 0.032 0.000 0.536 0.032 0.400 0.000
#> GSM254721     1  0.1285     0.8442 0.944 0.000 0.000 0.052 0.004 0.000
#> GSM254724     1  0.1364     0.8454 0.944 0.000 0.004 0.048 0.004 0.000
#> GSM254650     1  0.3636     0.6956 0.764 0.000 0.012 0.000 0.208 0.016
#> GSM254687     1  0.4208     0.2512 0.536 0.000 0.000 0.004 0.452 0.008
#> GSM254637     3  0.3334     0.7244 0.120 0.000 0.832 0.024 0.020 0.004
#> GSM254684     6  0.1036     0.7480 0.024 0.000 0.008 0.004 0.000 0.964
#> GSM254649     2  0.1007     0.8560 0.000 0.956 0.000 0.000 0.044 0.000
#> GSM254660     2  0.0260     0.8674 0.000 0.992 0.000 0.008 0.000 0.000
#> GSM254693     2  0.0363     0.8665 0.000 0.988 0.000 0.000 0.012 0.000
#> GSM254695     2  0.4328     0.6478 0.000 0.724 0.000 0.164 0.112 0.000
#> GSM254702     2  0.1141     0.8562 0.000 0.948 0.000 0.052 0.000 0.000
#> GSM254643     2  0.0405     0.8679 0.000 0.988 0.000 0.004 0.008 0.000
#> GSM254727     2  0.0820     0.8635 0.000 0.972 0.000 0.012 0.016 0.000
#> GSM254640     2  0.2300     0.7837 0.000 0.856 0.000 0.144 0.000 0.000
#> GSM254626     2  0.0508     0.8671 0.000 0.984 0.000 0.004 0.012 0.000
#> GSM254635     2  0.2219     0.7999 0.000 0.864 0.000 0.136 0.000 0.000
#> GSM254653     2  0.0146     0.8671 0.000 0.996 0.000 0.000 0.004 0.000
#> GSM254658     2  0.1219     0.8516 0.000 0.948 0.000 0.004 0.048 0.000
#> GSM254681     5  0.3565     0.2063 0.000 0.304 0.000 0.004 0.692 0.000
#> GSM254719     2  0.0146     0.8675 0.000 0.996 0.000 0.004 0.000 0.000
#> GSM254673     2  0.0405     0.8679 0.000 0.988 0.000 0.004 0.008 0.000
#> GSM254655     2  0.0146     0.8675 0.000 0.996 0.000 0.004 0.000 0.000
#> GSM254669     2  0.0146     0.8671 0.000 0.996 0.000 0.000 0.004 0.000
#> GSM254699     2  0.0291     0.8681 0.000 0.992 0.000 0.004 0.004 0.000
#> GSM254703     2  0.3747     0.3564 0.000 0.604 0.000 0.396 0.000 0.000
#> GSM254708     2  0.0146     0.8671 0.000 0.996 0.000 0.000 0.004 0.000
#> GSM254715     2  0.3607     0.4776 0.000 0.652 0.000 0.348 0.000 0.000
#> GSM254628     2  0.1152     0.8589 0.000 0.952 0.000 0.004 0.044 0.000
#> GSM254634     2  0.0865     0.8612 0.000 0.964 0.000 0.036 0.000 0.000
#> GSM254646     2  0.2730     0.7321 0.000 0.808 0.000 0.000 0.192 0.000
#> GSM254671     2  0.0508     0.8667 0.000 0.984 0.000 0.012 0.004 0.000
#> GSM254711     2  0.1141     0.8547 0.000 0.948 0.000 0.052 0.000 0.000
#> GSM254717     2  0.1003     0.8649 0.000 0.964 0.000 0.016 0.020 0.000
#> GSM254723     4  0.4477     0.2439 0.012 0.032 0.056 0.780 0.112 0.008
#> GSM254730     2  0.0000     0.8674 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM254731     2  0.0363     0.8670 0.000 0.988 0.000 0.012 0.000 0.000
#> GSM254632     5  0.7187     0.3328 0.004 0.092 0.096 0.052 0.536 0.220
#> GSM254662     2  0.0291     0.8677 0.000 0.992 0.000 0.004 0.004 0.000
#> GSM254677     4  0.4640     0.3639 0.000 0.240 0.000 0.676 0.080 0.004
#> GSM254665     2  0.0717     0.8673 0.000 0.976 0.000 0.016 0.008 0.000
#> GSM254691     2  0.0363     0.8673 0.000 0.988 0.000 0.012 0.000 0.000
#> GSM254644     2  0.2823     0.7227 0.000 0.796 0.000 0.204 0.000 0.000
#> GSM254667     2  0.4901     0.5912 0.000 0.704 0.000 0.024 0.148 0.124
#> GSM254676     2  0.0260     0.8680 0.000 0.992 0.000 0.008 0.000 0.000
#> GSM254679     2  0.1141     0.8554 0.000 0.948 0.000 0.052 0.000 0.000
#> GSM254689     2  0.3868     0.1060 0.000 0.504 0.000 0.000 0.496 0.000
#> GSM254706     2  0.4482     0.4089 0.000 0.600 0.000 0.040 0.360 0.000
#> GSM254712     4  0.3851    -0.0161 0.000 0.460 0.000 0.540 0.000 0.000
#> GSM254713     2  0.3804     0.2675 0.000 0.576 0.000 0.424 0.000 0.000
#> GSM254683     2  0.2416     0.7710 0.000 0.844 0.000 0.000 0.156 0.000
#> GSM254710     5  0.1946     0.4284 0.000 0.072 0.000 0.012 0.912 0.004
#> GSM254725     2  0.1897     0.8310 0.000 0.908 0.000 0.084 0.004 0.004
#> GSM254651     2  0.3848     0.6311 0.000 0.736 0.000 0.040 0.224 0.000
#> GSM254638     2  0.3329     0.6979 0.000 0.768 0.004 0.220 0.008 0.000
#> GSM254685     2  0.3101     0.6697 0.000 0.756 0.000 0.244 0.000 0.000

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

consensus_heatmap(res, k = 2)

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

consensus_heatmap(res, k = 3)

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

consensus_heatmap(res, k = 4)

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

consensus_heatmap(res, k = 5)

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

consensus_heatmap(res, k = 6)

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

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

membership_heatmap(res, k = 2)

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

membership_heatmap(res, k = 3)

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

membership_heatmap(res, k = 4)

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

membership_heatmap(res, k = 5)

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

membership_heatmap(res, k = 6)

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

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

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

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

get_signatures(res, k = 3)

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

get_signatures(res, k = 4)

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

get_signatures(res, k = 5)

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

get_signatures(res, k = 6)

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

Signature heatmaps where rows are not scaled:

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

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

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

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

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

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

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

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

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

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

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk SD-NMF-signature_compare

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

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

An example of the output of tb is:

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

The columns in tb are:

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

UMAP plot which shows how samples are separated.

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

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

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

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

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

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

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

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

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

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

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk SD-NMF-collect-classes

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

test_to_known_factors(res)
#>          n tissue(p) individual(p) disease.state(p) gender(p) other(p) k
#> SD:NMF 106  3.87e-23        0.5154            0.690     0.697   1.0000 2
#> SD:NMF  84  4.25e-18        0.2470            0.608     0.755   0.7526 3
#> SD:NMF  77  1.90e-17        0.0501            0.405     0.357   0.1803 4
#> SD:NMF  89  3.59e-19        0.0123            0.202     0.217   0.0452 5
#> SD:NMF  84  4.25e-18        0.0119            0.267     0.149   0.0634 6

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


CV:hclust**

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

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

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

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

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

collect_plots(res)

plot of chunk CV-hclust-collect-plots

The plots are:

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

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

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

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

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 1.000           0.971       0.988         0.4976 0.505   0.505
#> 3 3 0.655           0.757       0.843         0.2652 0.849   0.701
#> 4 4 0.613           0.640       0.731         0.1289 0.898   0.729
#> 5 5 0.614           0.394       0.636         0.0622 0.825   0.501
#> 6 6 0.673           0.503       0.699         0.0424 0.885   0.559

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
#> GSM254629     1  0.0672      0.975 0.992 0.008
#> GSM254648     1  0.1414      0.966 0.980 0.020
#> GSM254694     1  0.1184      0.969 0.984 0.016
#> GSM254701     1  0.0672      0.975 0.992 0.008
#> GSM254728     1  0.0000      0.979 1.000 0.000
#> GSM254726     1  0.1633      0.963 0.976 0.024
#> GSM254639     1  0.0000      0.979 1.000 0.000
#> GSM254652     1  0.0000      0.979 1.000 0.000
#> GSM254700     1  0.0000      0.979 1.000 0.000
#> GSM254625     1  0.0672      0.975 0.992 0.008
#> GSM254636     1  0.0000      0.979 1.000 0.000
#> GSM254659     1  0.0672      0.975 0.992 0.008
#> GSM254680     1  0.0000      0.979 1.000 0.000
#> GSM254686     1  0.0672      0.975 0.992 0.008
#> GSM254718     1  0.0000      0.979 1.000 0.000
#> GSM254674     1  0.0000      0.979 1.000 0.000
#> GSM254668     1  0.0000      0.979 1.000 0.000
#> GSM254697     1  0.0000      0.979 1.000 0.000
#> GSM254704     1  0.0000      0.979 1.000 0.000
#> GSM254707     1  0.0000      0.979 1.000 0.000
#> GSM254714     1  0.0000      0.979 1.000 0.000
#> GSM254722     1  0.0000      0.979 1.000 0.000
#> GSM254627     1  0.0000      0.979 1.000 0.000
#> GSM254630     1  0.0000      0.979 1.000 0.000
#> GSM254633     1  0.0000      0.979 1.000 0.000
#> GSM254670     1  0.0000      0.979 1.000 0.000
#> GSM254716     1  0.0672      0.975 0.992 0.008
#> GSM254720     1  0.0000      0.979 1.000 0.000
#> GSM254729     1  0.0938      0.973 0.988 0.012
#> GSM254654     1  0.1414      0.966 0.980 0.020
#> GSM254656     1  0.4161      0.902 0.916 0.084
#> GSM254631     1  0.0000      0.979 1.000 0.000
#> GSM254657     1  0.0376      0.977 0.996 0.004
#> GSM254664     1  0.0000      0.979 1.000 0.000
#> GSM254672     1  0.0000      0.979 1.000 0.000
#> GSM254692     1  0.0000      0.979 1.000 0.000
#> GSM254645     1  0.0376      0.977 0.996 0.004
#> GSM254666     1  0.0000      0.979 1.000 0.000
#> GSM254675     1  0.0000      0.979 1.000 0.000
#> GSM254678     1  0.0000      0.979 1.000 0.000
#> GSM254688     1  0.0000      0.979 1.000 0.000
#> GSM254690     1  0.0000      0.979 1.000 0.000
#> GSM254696     1  0.0000      0.979 1.000 0.000
#> GSM254705     1  0.0000      0.979 1.000 0.000
#> GSM254642     1  0.0000      0.979 1.000 0.000
#> GSM254661     1  0.0376      0.977 0.996 0.004
#> GSM254698     1  0.0000      0.979 1.000 0.000
#> GSM254641     1  0.0000      0.979 1.000 0.000
#> GSM254647     1  0.0000      0.979 1.000 0.000
#> GSM254663     1  0.0000      0.979 1.000 0.000
#> GSM254682     1  0.0000      0.979 1.000 0.000
#> GSM254709     1  0.0000      0.979 1.000 0.000
#> GSM254721     1  0.0000      0.979 1.000 0.000
#> GSM254724     1  0.0000      0.979 1.000 0.000
#> GSM254650     1  0.0000      0.979 1.000 0.000
#> GSM254687     1  0.0000      0.979 1.000 0.000
#> GSM254637     1  0.0000      0.979 1.000 0.000
#> GSM254684     1  0.0000      0.979 1.000 0.000
#> GSM254649     2  0.0000      1.000 0.000 1.000
#> GSM254660     2  0.0000      1.000 0.000 1.000
#> GSM254693     2  0.0000      1.000 0.000 1.000
#> GSM254695     2  0.0938      0.988 0.012 0.988
#> GSM254702     2  0.0000      1.000 0.000 1.000
#> GSM254643     2  0.0000      1.000 0.000 1.000
#> GSM254727     2  0.0000      1.000 0.000 1.000
#> GSM254640     2  0.0000      1.000 0.000 1.000
#> GSM254626     2  0.0000      1.000 0.000 1.000
#> GSM254635     2  0.0000      1.000 0.000 1.000
#> GSM254653     2  0.0000      1.000 0.000 1.000
#> GSM254658     2  0.0000      1.000 0.000 1.000
#> GSM254681     2  0.0000      1.000 0.000 1.000
#> GSM254719     2  0.0000      1.000 0.000 1.000
#> GSM254673     2  0.0000      1.000 0.000 1.000
#> GSM254655     2  0.0000      1.000 0.000 1.000
#> GSM254669     2  0.0000      1.000 0.000 1.000
#> GSM254699     2  0.0000      1.000 0.000 1.000
#> GSM254703     2  0.0000      1.000 0.000 1.000
#> GSM254708     2  0.0000      1.000 0.000 1.000
#> GSM254715     2  0.0000      1.000 0.000 1.000
#> GSM254628     2  0.0000      1.000 0.000 1.000
#> GSM254634     2  0.0000      1.000 0.000 1.000
#> GSM254646     2  0.0000      1.000 0.000 1.000
#> GSM254671     2  0.0000      1.000 0.000 1.000
#> GSM254711     2  0.0000      1.000 0.000 1.000
#> GSM254717     2  0.0000      1.000 0.000 1.000
#> GSM254723     1  0.4690      0.885 0.900 0.100
#> GSM254730     2  0.0000      1.000 0.000 1.000
#> GSM254731     2  0.0000      1.000 0.000 1.000
#> GSM254632     1  0.9922      0.219 0.552 0.448
#> GSM254662     2  0.0000      1.000 0.000 1.000
#> GSM254677     2  0.0000      1.000 0.000 1.000
#> GSM254665     2  0.0000      1.000 0.000 1.000
#> GSM254691     2  0.0000      1.000 0.000 1.000
#> GSM254644     2  0.0000      1.000 0.000 1.000
#> GSM254667     2  0.0672      0.992 0.008 0.992
#> GSM254676     2  0.0000      1.000 0.000 1.000
#> GSM254679     2  0.0000      1.000 0.000 1.000
#> GSM254689     2  0.0000      1.000 0.000 1.000
#> GSM254706     2  0.0000      1.000 0.000 1.000
#> GSM254712     2  0.0000      1.000 0.000 1.000
#> GSM254713     2  0.0000      1.000 0.000 1.000
#> GSM254683     2  0.0000      1.000 0.000 1.000
#> GSM254710     1  0.9922      0.219 0.552 0.448
#> GSM254725     2  0.0000      1.000 0.000 1.000
#> GSM254651     2  0.0000      1.000 0.000 1.000
#> GSM254638     2  0.0000      1.000 0.000 1.000
#> GSM254685     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
#> GSM254629     3  0.2165      0.710 0.064 0.000 0.936
#> GSM254648     3  0.2550      0.710 0.056 0.012 0.932
#> GSM254694     3  0.2584      0.711 0.064 0.008 0.928
#> GSM254701     3  0.2165      0.710 0.064 0.000 0.936
#> GSM254728     3  0.4121      0.680 0.168 0.000 0.832
#> GSM254726     3  0.2703      0.709 0.056 0.016 0.928
#> GSM254639     3  0.5138      0.477 0.252 0.000 0.748
#> GSM254652     3  0.3192      0.696 0.112 0.000 0.888
#> GSM254700     1  0.3816      0.755 0.852 0.000 0.148
#> GSM254625     3  0.2400      0.707 0.064 0.004 0.932
#> GSM254636     1  0.6079      0.680 0.612 0.000 0.388
#> GSM254659     3  0.3816      0.687 0.148 0.000 0.852
#> GSM254680     1  0.6204      0.634 0.576 0.000 0.424
#> GSM254686     3  0.1964      0.704 0.056 0.000 0.944
#> GSM254718     3  0.2711      0.711 0.088 0.000 0.912
#> GSM254674     3  0.6308     -0.390 0.492 0.000 0.508
#> GSM254668     3  0.4887      0.567 0.228 0.000 0.772
#> GSM254697     1  0.4002      0.760 0.840 0.000 0.160
#> GSM254704     1  0.3816      0.755 0.852 0.000 0.148
#> GSM254707     3  0.4121      0.648 0.168 0.000 0.832
#> GSM254714     1  0.5465      0.677 0.712 0.000 0.288
#> GSM254722     1  0.5098      0.768 0.752 0.000 0.248
#> GSM254627     1  0.4002      0.760 0.840 0.000 0.160
#> GSM254630     3  0.2711      0.715 0.088 0.000 0.912
#> GSM254633     1  0.6126      0.665 0.600 0.000 0.400
#> GSM254670     3  0.5138      0.477 0.252 0.000 0.748
#> GSM254716     3  0.0237      0.694 0.004 0.000 0.996
#> GSM254720     3  0.6192      0.170 0.420 0.000 0.580
#> GSM254729     3  0.3295      0.714 0.096 0.008 0.896
#> GSM254654     3  0.2550      0.710 0.056 0.012 0.932
#> GSM254656     3  0.6407      0.563 0.160 0.080 0.760
#> GSM254631     1  0.6180      0.644 0.584 0.000 0.416
#> GSM254657     3  0.4409      0.629 0.172 0.004 0.824
#> GSM254664     1  0.6180      0.644 0.584 0.000 0.416
#> GSM254672     1  0.4178      0.763 0.828 0.000 0.172
#> GSM254692     3  0.6062      0.244 0.384 0.000 0.616
#> GSM254645     3  0.4733      0.623 0.196 0.004 0.800
#> GSM254666     3  0.2878      0.711 0.096 0.000 0.904
#> GSM254675     3  0.5733      0.416 0.324 0.000 0.676
#> GSM254678     1  0.5650      0.738 0.688 0.000 0.312
#> GSM254688     3  0.4399      0.628 0.188 0.000 0.812
#> GSM254690     1  0.5905      0.720 0.648 0.000 0.352
#> GSM254696     1  0.6267      0.540 0.548 0.000 0.452
#> GSM254705     3  0.5497      0.481 0.292 0.000 0.708
#> GSM254642     1  0.4002      0.760 0.840 0.000 0.160
#> GSM254661     3  0.2590      0.713 0.072 0.004 0.924
#> GSM254698     1  0.5098      0.768 0.752 0.000 0.248
#> GSM254641     3  0.4178      0.651 0.172 0.000 0.828
#> GSM254647     1  0.5905      0.705 0.648 0.000 0.352
#> GSM254663     3  0.4931      0.579 0.232 0.000 0.768
#> GSM254682     3  0.4121      0.651 0.168 0.000 0.832
#> GSM254709     3  0.4346      0.645 0.184 0.000 0.816
#> GSM254721     1  0.3879      0.757 0.848 0.000 0.152
#> GSM254724     1  0.3816      0.755 0.852 0.000 0.148
#> GSM254650     3  0.4974      0.575 0.236 0.000 0.764
#> GSM254687     3  0.5431      0.496 0.284 0.000 0.716
#> GSM254637     1  0.6192      0.638 0.580 0.000 0.420
#> GSM254684     1  0.6305      0.459 0.516 0.000 0.484
#> GSM254649     2  0.1289      0.953 0.032 0.968 0.000
#> GSM254660     2  0.0747      0.952 0.016 0.984 0.000
#> GSM254693     2  0.1289      0.953 0.032 0.968 0.000
#> GSM254695     2  0.4063      0.918 0.112 0.868 0.020
#> GSM254702     2  0.0747      0.952 0.016 0.984 0.000
#> GSM254643     2  0.1289      0.954 0.032 0.968 0.000
#> GSM254727     2  0.0000      0.953 0.000 1.000 0.000
#> GSM254640     2  0.3192      0.929 0.112 0.888 0.000
#> GSM254626     2  0.1289      0.953 0.032 0.968 0.000
#> GSM254635     2  0.3192      0.929 0.112 0.888 0.000
#> GSM254653     2  0.0000      0.953 0.000 1.000 0.000
#> GSM254658     2  0.1289      0.953 0.032 0.968 0.000
#> GSM254681     2  0.1289      0.953 0.032 0.968 0.000
#> GSM254719     2  0.1031      0.954 0.024 0.976 0.000
#> GSM254673     2  0.1163      0.953 0.028 0.972 0.000
#> GSM254655     2  0.0747      0.952 0.016 0.984 0.000
#> GSM254669     2  0.1163      0.953 0.028 0.972 0.000
#> GSM254699     2  0.0747      0.952 0.016 0.984 0.000
#> GSM254703     2  0.3192      0.929 0.112 0.888 0.000
#> GSM254708     2  0.1289      0.953 0.032 0.968 0.000
#> GSM254715     2  0.3192      0.929 0.112 0.888 0.000
#> GSM254628     2  0.1289      0.953 0.032 0.968 0.000
#> GSM254634     2  0.3192      0.929 0.112 0.888 0.000
#> GSM254646     2  0.1289      0.953 0.032 0.968 0.000
#> GSM254671     2  0.3116      0.930 0.108 0.892 0.000
#> GSM254711     2  0.3192      0.929 0.112 0.888 0.000
#> GSM254717     2  0.0592      0.954 0.012 0.988 0.000
#> GSM254723     3  0.4709      0.635 0.056 0.092 0.852
#> GSM254730     2  0.0747      0.952 0.016 0.984 0.000
#> GSM254731     2  0.0747      0.952 0.016 0.984 0.000
#> GSM254632     3  0.6869      0.208 0.016 0.424 0.560
#> GSM254662     2  0.1163      0.953 0.028 0.972 0.000
#> GSM254677     2  0.3425      0.927 0.112 0.884 0.004
#> GSM254665     2  0.1289      0.953 0.032 0.968 0.000
#> GSM254691     2  0.1289      0.953 0.032 0.968 0.000
#> GSM254644     2  0.3192      0.929 0.112 0.888 0.000
#> GSM254667     2  0.1877      0.948 0.032 0.956 0.012
#> GSM254676     2  0.1289      0.953 0.032 0.968 0.000
#> GSM254679     2  0.3116      0.930 0.108 0.892 0.000
#> GSM254689     2  0.1289      0.953 0.032 0.968 0.000
#> GSM254706     2  0.1289      0.953 0.032 0.968 0.000
#> GSM254712     2  0.3192      0.929 0.112 0.888 0.000
#> GSM254713     2  0.3192      0.929 0.112 0.888 0.000
#> GSM254683     2  0.1289      0.953 0.032 0.968 0.000
#> GSM254710     3  0.6869      0.208 0.016 0.424 0.560
#> GSM254725     2  0.3425      0.927 0.112 0.884 0.004
#> GSM254651     2  0.1289      0.953 0.032 0.968 0.000
#> GSM254638     2  0.3192      0.929 0.112 0.888 0.000
#> GSM254685     2  0.3116      0.930 0.108 0.892 0.000

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM254629     3  0.6638      0.693 0.420 0.000 0.496 0.084
#> GSM254648     3  0.6768      0.686 0.416 0.008 0.504 0.072
#> GSM254694     3  0.7006      0.699 0.400 0.008 0.500 0.092
#> GSM254701     3  0.6638      0.693 0.420 0.000 0.496 0.084
#> GSM254728     1  0.7393     -0.607 0.436 0.000 0.400 0.164
#> GSM254726     3  0.6931      0.684 0.412 0.012 0.500 0.076
#> GSM254639     3  0.7313      0.299 0.156 0.000 0.464 0.380
#> GSM254652     3  0.7119      0.655 0.428 0.000 0.444 0.128
#> GSM254700     4  0.1398      0.722 0.040 0.000 0.004 0.956
#> GSM254625     1  0.2466      0.576 0.900 0.004 0.096 0.000
#> GSM254636     4  0.5773      0.693 0.320 0.000 0.048 0.632
#> GSM254659     1  0.7304     -0.466 0.492 0.000 0.344 0.164
#> GSM254680     4  0.5911      0.659 0.372 0.000 0.044 0.584
#> GSM254686     1  0.5227      0.262 0.704 0.000 0.256 0.040
#> GSM254718     3  0.6881      0.696 0.428 0.000 0.468 0.104
#> GSM254674     4  0.6638      0.541 0.420 0.000 0.084 0.496
#> GSM254668     1  0.3037      0.617 0.880 0.000 0.020 0.100
#> GSM254697     4  0.2859      0.733 0.112 0.000 0.008 0.880
#> GSM254704     4  0.1004      0.695 0.004 0.000 0.024 0.972
#> GSM254707     1  0.1610      0.645 0.952 0.000 0.016 0.032
#> GSM254714     4  0.5109      0.468 0.212 0.000 0.052 0.736
#> GSM254722     4  0.4387      0.746 0.144 0.000 0.052 0.804
#> GSM254627     4  0.2859      0.733 0.112 0.000 0.008 0.880
#> GSM254630     1  0.5565      0.149 0.684 0.000 0.260 0.056
#> GSM254633     4  0.5730      0.681 0.344 0.000 0.040 0.616
#> GSM254670     3  0.7313      0.299 0.156 0.000 0.464 0.380
#> GSM254716     1  0.4072      0.333 0.748 0.000 0.252 0.000
#> GSM254720     4  0.7631     -0.262 0.320 0.000 0.224 0.456
#> GSM254729     3  0.7171      0.681 0.424 0.008 0.464 0.104
#> GSM254654     3  0.6768      0.686 0.416 0.008 0.504 0.072
#> GSM254656     3  0.8953      0.519 0.284 0.072 0.428 0.216
#> GSM254631     4  0.5835      0.661 0.372 0.000 0.040 0.588
#> GSM254657     3  0.7576      0.601 0.324 0.000 0.464 0.212
#> GSM254664     4  0.5835      0.661 0.372 0.000 0.040 0.588
#> GSM254672     4  0.2021      0.728 0.056 0.000 0.012 0.932
#> GSM254692     1  0.4252      0.546 0.744 0.000 0.004 0.252
#> GSM254645     3  0.7668      0.574 0.348 0.000 0.432 0.220
#> GSM254666     1  0.4139      0.472 0.816 0.000 0.144 0.040
#> GSM254675     1  0.6263      0.114 0.576 0.000 0.068 0.356
#> GSM254678     4  0.4864      0.734 0.172 0.000 0.060 0.768
#> GSM254688     1  0.1635      0.646 0.948 0.000 0.008 0.044
#> GSM254690     4  0.5322      0.708 0.312 0.000 0.028 0.660
#> GSM254696     4  0.6790      0.627 0.228 0.000 0.168 0.604
#> GSM254705     1  0.4050      0.604 0.808 0.000 0.024 0.168
#> GSM254642     4  0.2859      0.733 0.112 0.000 0.008 0.880
#> GSM254661     3  0.6661      0.664 0.456 0.000 0.460 0.084
#> GSM254698     4  0.4387      0.746 0.144 0.000 0.052 0.804
#> GSM254641     1  0.2919      0.626 0.896 0.000 0.044 0.060
#> GSM254647     4  0.5233      0.677 0.332 0.000 0.020 0.648
#> GSM254663     1  0.2799      0.644 0.884 0.000 0.008 0.108
#> GSM254682     1  0.1520      0.643 0.956 0.000 0.024 0.020
#> GSM254709     1  0.2565      0.644 0.912 0.000 0.032 0.056
#> GSM254721     4  0.1151      0.697 0.008 0.000 0.024 0.968
#> GSM254724     4  0.1004      0.695 0.004 0.000 0.024 0.972
#> GSM254650     1  0.2610      0.643 0.900 0.000 0.012 0.088
#> GSM254687     1  0.3806      0.613 0.824 0.000 0.020 0.156
#> GSM254637     4  0.5848      0.659 0.376 0.000 0.040 0.584
#> GSM254684     4  0.7122      0.555 0.248 0.000 0.192 0.560
#> GSM254649     2  0.0469      0.825 0.000 0.988 0.012 0.000
#> GSM254660     2  0.3123      0.830 0.000 0.844 0.156 0.000
#> GSM254693     2  0.0469      0.825 0.000 0.988 0.012 0.000
#> GSM254695     2  0.4916      0.746 0.000 0.576 0.424 0.000
#> GSM254702     2  0.3356      0.828 0.000 0.824 0.176 0.000
#> GSM254643     2  0.1867      0.836 0.000 0.928 0.072 0.000
#> GSM254727     2  0.1474      0.836 0.000 0.948 0.052 0.000
#> GSM254640     2  0.4790      0.770 0.000 0.620 0.380 0.000
#> GSM254626     2  0.0469      0.825 0.000 0.988 0.012 0.000
#> GSM254635     2  0.4866      0.759 0.000 0.596 0.404 0.000
#> GSM254653     2  0.1474      0.836 0.000 0.948 0.052 0.000
#> GSM254658     2  0.0707      0.823 0.000 0.980 0.020 0.000
#> GSM254681     2  0.0707      0.823 0.000 0.980 0.020 0.000
#> GSM254719     2  0.0707      0.832 0.000 0.980 0.020 0.000
#> GSM254673     2  0.0336      0.830 0.000 0.992 0.008 0.000
#> GSM254655     2  0.3356      0.828 0.000 0.824 0.176 0.000
#> GSM254669     2  0.0336      0.828 0.000 0.992 0.008 0.000
#> GSM254699     2  0.3356      0.828 0.000 0.824 0.176 0.000
#> GSM254703     2  0.4790      0.770 0.000 0.620 0.380 0.000
#> GSM254708     2  0.0707      0.823 0.000 0.980 0.020 0.000
#> GSM254715     2  0.4866      0.759 0.000 0.596 0.404 0.000
#> GSM254628     2  0.0592      0.827 0.000 0.984 0.016 0.000
#> GSM254634     2  0.4866      0.759 0.000 0.596 0.404 0.000
#> GSM254646     2  0.0707      0.823 0.000 0.980 0.020 0.000
#> GSM254671     2  0.4790      0.770 0.000 0.620 0.380 0.000
#> GSM254711     2  0.4866      0.759 0.000 0.596 0.404 0.000
#> GSM254717     2  0.2530      0.836 0.000 0.888 0.112 0.000
#> GSM254723     1  0.8108     -0.444 0.448 0.084 0.396 0.072
#> GSM254730     2  0.3400      0.828 0.000 0.820 0.180 0.000
#> GSM254731     2  0.3356      0.828 0.000 0.824 0.176 0.000
#> GSM254632     2  0.7617     -0.137 0.372 0.424 0.204 0.000
#> GSM254662     2  0.0336      0.830 0.000 0.992 0.008 0.000
#> GSM254677     2  0.4877      0.757 0.000 0.592 0.408 0.000
#> GSM254665     2  0.1474      0.836 0.000 0.948 0.052 0.000
#> GSM254691     2  0.1211      0.835 0.000 0.960 0.040 0.000
#> GSM254644     2  0.4830      0.765 0.000 0.608 0.392 0.000
#> GSM254667     2  0.1022      0.817 0.000 0.968 0.032 0.000
#> GSM254676     2  0.1211      0.835 0.000 0.960 0.040 0.000
#> GSM254679     2  0.4790      0.770 0.000 0.620 0.380 0.000
#> GSM254689     2  0.0707      0.823 0.000 0.980 0.020 0.000
#> GSM254706     2  0.0707      0.823 0.000 0.980 0.020 0.000
#> GSM254712     2  0.4866      0.759 0.000 0.596 0.404 0.000
#> GSM254713     2  0.4866      0.759 0.000 0.596 0.404 0.000
#> GSM254683     2  0.0707      0.823 0.000 0.980 0.020 0.000
#> GSM254710     2  0.7617     -0.137 0.372 0.424 0.204 0.000
#> GSM254725     2  0.4877      0.757 0.000 0.592 0.408 0.000
#> GSM254651     2  0.0707      0.823 0.000 0.980 0.020 0.000
#> GSM254638     2  0.4866      0.759 0.000 0.596 0.404 0.000
#> GSM254685     2  0.4406      0.795 0.000 0.700 0.300 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
#> GSM254629     3  0.0992     0.5277 0.008 0.024 0.968 0.000 0.000
#> GSM254648     3  0.1012     0.5255 0.000 0.020 0.968 0.012 0.000
#> GSM254694     3  0.1405     0.5273 0.016 0.020 0.956 0.008 0.000
#> GSM254701     3  0.0992     0.5277 0.008 0.024 0.968 0.000 0.000
#> GSM254728     3  0.4313     0.4878 0.100 0.036 0.804 0.000 0.060
#> GSM254726     3  0.1729     0.5253 0.004 0.032 0.944 0.012 0.008
#> GSM254639     3  0.6195     0.2789 0.204 0.008 0.588 0.000 0.200
#> GSM254652     3  0.3062     0.5138 0.080 0.004 0.868 0.000 0.048
#> GSM254700     1  0.4930     0.4804 0.580 0.032 0.000 0.000 0.388
#> GSM254625     3  0.7642    -0.3374 0.224 0.060 0.416 0.000 0.300
#> GSM254636     1  0.3702     0.4772 0.820 0.000 0.084 0.000 0.096
#> GSM254659     3  0.4452     0.4347 0.156 0.032 0.776 0.000 0.036
#> GSM254680     1  0.2517     0.4828 0.884 0.004 0.104 0.000 0.008
#> GSM254686     3  0.6318     0.1220 0.120 0.040 0.616 0.000 0.224
#> GSM254718     3  0.1492     0.5309 0.040 0.008 0.948 0.000 0.004
#> GSM254674     1  0.5716     0.2971 0.652 0.008 0.168 0.000 0.172
#> GSM254668     1  0.6795    -0.6355 0.400 0.004 0.368 0.000 0.228
#> GSM254697     1  0.6250     0.4734 0.540 0.204 0.000 0.000 0.256
#> GSM254704     1  0.5329     0.4540 0.516 0.052 0.000 0.000 0.432
#> GSM254707     3  0.7276    -0.4765 0.320 0.020 0.364 0.000 0.296
#> GSM254714     5  0.7695    -0.2687 0.292 0.052 0.284 0.000 0.372
#> GSM254722     1  0.7078     0.4504 0.524 0.164 0.052 0.000 0.260
#> GSM254627     1  0.6250     0.4734 0.540 0.204 0.000 0.000 0.256
#> GSM254630     3  0.6310     0.2095 0.140 0.036 0.620 0.000 0.204
#> GSM254633     1  0.3178     0.4910 0.860 0.004 0.088 0.000 0.048
#> GSM254670     3  0.6195     0.2789 0.204 0.008 0.588 0.000 0.200
#> GSM254716     3  0.6700     0.0280 0.104 0.060 0.568 0.000 0.268
#> GSM254720     3  0.6964     0.0217 0.224 0.036 0.528 0.000 0.212
#> GSM254729     3  0.2297     0.5270 0.060 0.020 0.912 0.008 0.000
#> GSM254654     3  0.1012     0.5255 0.000 0.020 0.968 0.012 0.000
#> GSM254656     3  0.6586     0.3919 0.104 0.056 0.680 0.064 0.096
#> GSM254631     1  0.2642     0.4814 0.880 0.008 0.104 0.000 0.008
#> GSM254657     3  0.4645     0.4485 0.124 0.012 0.772 0.004 0.088
#> GSM254664     1  0.2642     0.4814 0.880 0.008 0.104 0.000 0.008
#> GSM254672     1  0.5365     0.4928 0.572 0.032 0.016 0.000 0.380
#> GSM254692     5  0.7844     0.5465 0.308 0.064 0.280 0.000 0.348
#> GSM254645     3  0.5154     0.4459 0.140 0.032 0.744 0.004 0.080
#> GSM254666     3  0.6812    -0.0740 0.196 0.024 0.524 0.000 0.256
#> GSM254675     1  0.6707    -0.2758 0.492 0.008 0.232 0.000 0.268
#> GSM254678     1  0.6073     0.4564 0.532 0.008 0.104 0.000 0.356
#> GSM254688     3  0.7287    -0.5037 0.332 0.020 0.348 0.000 0.300
#> GSM254690     1  0.3736     0.5107 0.840 0.072 0.064 0.000 0.024
#> GSM254696     1  0.6773     0.3804 0.588 0.064 0.208 0.000 0.140
#> GSM254705     5  0.7767     0.5888 0.256 0.060 0.320 0.000 0.364
#> GSM254642     1  0.6250     0.4734 0.540 0.204 0.000 0.000 0.256
#> GSM254661     3  0.2120     0.5252 0.048 0.004 0.924 0.004 0.020
#> GSM254698     1  0.7078     0.4504 0.524 0.164 0.052 0.000 0.260
#> GSM254641     3  0.6842    -0.3843 0.300 0.004 0.424 0.000 0.272
#> GSM254647     1  0.4760     0.4582 0.772 0.052 0.052 0.000 0.124
#> GSM254663     3  0.7364    -0.5590 0.328 0.024 0.332 0.000 0.316
#> GSM254682     3  0.7417    -0.4975 0.308 0.028 0.352 0.000 0.312
#> GSM254709     3  0.7021    -0.4889 0.284 0.008 0.376 0.000 0.332
#> GSM254721     1  0.5334     0.4528 0.512 0.052 0.000 0.000 0.436
#> GSM254724     1  0.5329     0.4540 0.516 0.052 0.000 0.000 0.432
#> GSM254650     5  0.7479     0.5151 0.300 0.032 0.328 0.000 0.340
#> GSM254687     5  0.7555     0.5886 0.272 0.040 0.324 0.000 0.364
#> GSM254637     1  0.2629     0.4807 0.880 0.004 0.104 0.000 0.012
#> GSM254684     1  0.7276     0.2601 0.460 0.036 0.264 0.000 0.240
#> GSM254649     2  0.4150     0.8183 0.000 0.612 0.000 0.388 0.000
#> GSM254660     4  0.3932     0.2579 0.000 0.328 0.000 0.672 0.000
#> GSM254693     2  0.4150     0.8183 0.000 0.612 0.000 0.388 0.000
#> GSM254695     4  0.1281     0.6540 0.000 0.032 0.012 0.956 0.000
#> GSM254702     4  0.3876     0.2953 0.000 0.316 0.000 0.684 0.000
#> GSM254643     4  0.4161    -0.0659 0.000 0.392 0.000 0.608 0.000
#> GSM254727     2  0.4278     0.6925 0.000 0.548 0.000 0.452 0.000
#> GSM254640     4  0.1608     0.6649 0.000 0.072 0.000 0.928 0.000
#> GSM254626     2  0.4150     0.8183 0.000 0.612 0.000 0.388 0.000
#> GSM254635     4  0.0162     0.6862 0.000 0.004 0.000 0.996 0.000
#> GSM254653     2  0.4278     0.6925 0.000 0.548 0.000 0.452 0.000
#> GSM254658     2  0.4126     0.8209 0.000 0.620 0.000 0.380 0.000
#> GSM254681     2  0.4126     0.8209 0.000 0.620 0.000 0.380 0.000
#> GSM254719     2  0.4227     0.7727 0.000 0.580 0.000 0.420 0.000
#> GSM254673     2  0.4201     0.7945 0.000 0.592 0.000 0.408 0.000
#> GSM254655     4  0.4045     0.1371 0.000 0.356 0.000 0.644 0.000
#> GSM254669     2  0.4182     0.8058 0.000 0.600 0.000 0.400 0.000
#> GSM254699     4  0.3857     0.3079 0.000 0.312 0.000 0.688 0.000
#> GSM254703     4  0.0794     0.6868 0.000 0.028 0.000 0.972 0.000
#> GSM254708     2  0.4114     0.8160 0.000 0.624 0.000 0.376 0.000
#> GSM254715     4  0.0000     0.6879 0.000 0.000 0.000 1.000 0.000
#> GSM254628     2  0.4171     0.8109 0.000 0.604 0.000 0.396 0.000
#> GSM254634     4  0.0162     0.6862 0.000 0.004 0.000 0.996 0.000
#> GSM254646     2  0.4126     0.8209 0.000 0.620 0.000 0.380 0.000
#> GSM254671     4  0.0880     0.6863 0.000 0.032 0.000 0.968 0.000
#> GSM254711     4  0.0162     0.6883 0.000 0.004 0.000 0.996 0.000
#> GSM254717     4  0.4210    -0.1800 0.000 0.412 0.000 0.588 0.000
#> GSM254723     3  0.4739     0.4165 0.008 0.080 0.792 0.056 0.064
#> GSM254730     4  0.3796     0.3378 0.000 0.300 0.000 0.700 0.000
#> GSM254731     4  0.3857     0.3079 0.000 0.312 0.000 0.688 0.000
#> GSM254632     2  0.8559    -0.0960 0.012 0.336 0.324 0.168 0.160
#> GSM254662     2  0.4201     0.7945 0.000 0.592 0.000 0.408 0.000
#> GSM254677     4  0.0671     0.6733 0.000 0.016 0.004 0.980 0.000
#> GSM254665     4  0.4300    -0.4614 0.000 0.476 0.000 0.524 0.000
#> GSM254691     4  0.4307    -0.5285 0.000 0.496 0.000 0.504 0.000
#> GSM254644     4  0.1197     0.6786 0.000 0.048 0.000 0.952 0.000
#> GSM254667     2  0.4225     0.7961 0.000 0.632 0.004 0.364 0.000
#> GSM254676     4  0.4307    -0.5285 0.000 0.496 0.000 0.504 0.000
#> GSM254679     4  0.0880     0.6863 0.000 0.032 0.000 0.968 0.000
#> GSM254689     2  0.4126     0.8209 0.000 0.620 0.000 0.380 0.000
#> GSM254706     2  0.4126     0.8209 0.000 0.620 0.000 0.380 0.000
#> GSM254712     4  0.0000     0.6879 0.000 0.000 0.000 1.000 0.000
#> GSM254713     4  0.0000     0.6879 0.000 0.000 0.000 1.000 0.000
#> GSM254683     2  0.4126     0.8209 0.000 0.620 0.000 0.380 0.000
#> GSM254710     2  0.8559    -0.0960 0.012 0.336 0.324 0.168 0.160
#> GSM254725     4  0.0671     0.6733 0.000 0.016 0.004 0.980 0.000
#> GSM254651     2  0.4126     0.8209 0.000 0.620 0.000 0.380 0.000
#> GSM254638     4  0.0162     0.6862 0.000 0.004 0.000 0.996 0.000
#> GSM254685     4  0.2561     0.5954 0.000 0.144 0.000 0.856 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
#> GSM254629     3  0.0862     0.7875 0.000 0.016 0.972 0.000 0.004 0.008
#> GSM254648     3  0.0748     0.7846 0.000 0.016 0.976 0.004 0.004 0.000
#> GSM254694     3  0.1148     0.7871 0.000 0.016 0.960 0.004 0.000 0.020
#> GSM254701     3  0.0862     0.7875 0.000 0.016 0.972 0.000 0.004 0.008
#> GSM254728     3  0.4795     0.7194 0.004 0.032 0.732 0.000 0.104 0.128
#> GSM254726     3  0.1476     0.7864 0.000 0.028 0.948 0.004 0.012 0.008
#> GSM254639     3  0.5264     0.3685 0.004 0.016 0.500 0.000 0.048 0.432
#> GSM254652     3  0.3613     0.7570 0.000 0.016 0.816 0.000 0.092 0.076
#> GSM254700     1  0.3164     0.4718 0.832 0.004 0.000 0.000 0.044 0.120
#> GSM254625     5  0.2532     0.5931 0.000 0.052 0.060 0.000 0.884 0.004
#> GSM254636     6  0.6845     0.5051 0.220 0.012 0.036 0.000 0.292 0.440
#> GSM254659     3  0.5587     0.6505 0.044 0.056 0.700 0.000 0.128 0.072
#> GSM254680     5  0.7331    -0.4105 0.320 0.016 0.056 0.000 0.332 0.276
#> GSM254686     5  0.5928     0.4669 0.024 0.112 0.216 0.000 0.620 0.028
#> GSM254718     3  0.2115     0.7910 0.000 0.020 0.916 0.000 0.032 0.032
#> GSM254674     5  0.6999    -0.4590 0.148 0.004 0.088 0.000 0.384 0.376
#> GSM254668     5  0.3556     0.5739 0.048 0.008 0.044 0.000 0.840 0.060
#> GSM254697     1  0.5406     0.4339 0.496 0.044 0.000 0.000 0.036 0.424
#> GSM254704     1  0.0405     0.5507 0.988 0.004 0.000 0.000 0.000 0.008
#> GSM254707     5  0.1760     0.6080 0.020 0.004 0.028 0.000 0.936 0.012
#> GSM254714     1  0.5421     0.1712 0.604 0.004 0.264 0.000 0.008 0.120
#> GSM254722     6  0.3601     0.4384 0.084 0.016 0.004 0.000 0.072 0.824
#> GSM254627     1  0.5406     0.4339 0.496 0.044 0.000 0.000 0.036 0.424
#> GSM254630     5  0.5702     0.3182 0.008 0.044 0.320 0.000 0.572 0.056
#> GSM254633     6  0.7051     0.4320 0.276 0.016 0.032 0.000 0.316 0.360
#> GSM254670     3  0.5264     0.3685 0.004 0.016 0.500 0.000 0.048 0.432
#> GSM254716     5  0.4876     0.4856 0.000 0.124 0.164 0.000 0.696 0.016
#> GSM254720     3  0.5606     0.2425 0.392 0.024 0.524 0.000 0.024 0.036
#> GSM254729     3  0.2582     0.7858 0.004 0.016 0.896 0.004 0.028 0.052
#> GSM254654     3  0.0748     0.7846 0.000 0.016 0.976 0.004 0.004 0.000
#> GSM254656     3  0.5898     0.6131 0.000 0.128 0.616 0.016 0.028 0.212
#> GSM254631     5  0.7393    -0.4003 0.324 0.020 0.056 0.000 0.328 0.272
#> GSM254657     3  0.4606     0.6861 0.000 0.020 0.716 0.004 0.056 0.204
#> GSM254664     5  0.7393    -0.4003 0.324 0.020 0.056 0.000 0.328 0.272
#> GSM254672     1  0.4507     0.2504 0.668 0.004 0.004 0.000 0.044 0.280
#> GSM254692     5  0.4551     0.5202 0.088 0.024 0.000 0.000 0.736 0.152
#> GSM254645     3  0.5042     0.6689 0.004 0.040 0.692 0.000 0.064 0.200
#> GSM254666     5  0.4535     0.4970 0.004 0.032 0.216 0.000 0.716 0.032
#> GSM254675     5  0.6551     0.2400 0.264 0.008 0.088 0.000 0.536 0.104
#> GSM254678     6  0.6771     0.2478 0.392 0.008 0.068 0.000 0.124 0.408
#> GSM254688     5  0.1690     0.6077 0.020 0.004 0.020 0.000 0.940 0.016
#> GSM254690     6  0.6658     0.3589 0.304 0.008 0.020 0.000 0.256 0.412
#> GSM254696     6  0.6782     0.5183 0.132 0.012 0.140 0.000 0.160 0.556
#> GSM254705     5  0.4351     0.5587 0.084 0.036 0.012 0.000 0.784 0.084
#> GSM254642     1  0.5406     0.4339 0.496 0.044 0.000 0.000 0.036 0.424
#> GSM254661     3  0.2566     0.7812 0.000 0.020 0.888 0.000 0.064 0.028
#> GSM254698     6  0.3601     0.4384 0.084 0.016 0.004 0.000 0.072 0.824
#> GSM254641     5  0.3432     0.6006 0.032 0.008 0.092 0.000 0.840 0.028
#> GSM254647     1  0.6617    -0.3698 0.360 0.008 0.012 0.000 0.312 0.308
#> GSM254663     5  0.3120     0.5997 0.040 0.008 0.016 0.000 0.860 0.076
#> GSM254682     5  0.1350     0.6093 0.000 0.008 0.020 0.000 0.952 0.020
#> GSM254709     5  0.3085     0.6081 0.032 0.008 0.056 0.000 0.868 0.036
#> GSM254721     1  0.0508     0.5520 0.984 0.004 0.000 0.000 0.000 0.012
#> GSM254724     1  0.0777     0.5462 0.972 0.004 0.000 0.000 0.000 0.024
#> GSM254650     5  0.2607     0.5981 0.052 0.012 0.008 0.000 0.892 0.036
#> GSM254687     5  0.4001     0.5704 0.080 0.028 0.012 0.000 0.808 0.072
#> GSM254637     5  0.7323    -0.4016 0.324 0.016 0.056 0.000 0.336 0.268
#> GSM254684     6  0.6256     0.4529 0.048 0.016 0.188 0.000 0.152 0.596
#> GSM254649     2  0.3620     0.8141 0.000 0.648 0.000 0.352 0.000 0.000
#> GSM254660     4  0.3620     0.2001 0.000 0.352 0.000 0.648 0.000 0.000
#> GSM254693     2  0.3620     0.8141 0.000 0.648 0.000 0.352 0.000 0.000
#> GSM254695     4  0.1957     0.6302 0.000 0.112 0.000 0.888 0.000 0.000
#> GSM254702     4  0.3620     0.2018 0.000 0.352 0.000 0.648 0.000 0.000
#> GSM254643     4  0.3756    -0.0907 0.000 0.400 0.000 0.600 0.000 0.000
#> GSM254727     2  0.3789     0.7225 0.000 0.584 0.000 0.416 0.000 0.000
#> GSM254640     4  0.1814     0.6697 0.000 0.100 0.000 0.900 0.000 0.000
#> GSM254626     2  0.3620     0.8141 0.000 0.648 0.000 0.352 0.000 0.000
#> GSM254635     4  0.0260     0.7066 0.000 0.008 0.000 0.992 0.000 0.000
#> GSM254653     2  0.3789     0.7225 0.000 0.584 0.000 0.416 0.000 0.000
#> GSM254658     2  0.3563     0.8136 0.000 0.664 0.000 0.336 0.000 0.000
#> GSM254681     2  0.3563     0.8136 0.000 0.664 0.000 0.336 0.000 0.000
#> GSM254719     2  0.3717     0.7826 0.000 0.616 0.000 0.384 0.000 0.000
#> GSM254673     2  0.3684     0.7984 0.000 0.628 0.000 0.372 0.000 0.000
#> GSM254655     4  0.3737     0.0061 0.000 0.392 0.000 0.608 0.000 0.000
#> GSM254669     2  0.3659     0.8062 0.000 0.636 0.000 0.364 0.000 0.000
#> GSM254699     4  0.3607     0.2176 0.000 0.348 0.000 0.652 0.000 0.000
#> GSM254703     4  0.0790     0.7078 0.000 0.032 0.000 0.968 0.000 0.000
#> GSM254708     2  0.3547     0.8095 0.000 0.668 0.000 0.332 0.000 0.000
#> GSM254715     4  0.0000     0.7093 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM254628     2  0.3647     0.8101 0.000 0.640 0.000 0.360 0.000 0.000
#> GSM254634     4  0.0458     0.7062 0.000 0.016 0.000 0.984 0.000 0.000
#> GSM254646     2  0.3563     0.8136 0.000 0.664 0.000 0.336 0.000 0.000
#> GSM254671     4  0.1141     0.7042 0.000 0.052 0.000 0.948 0.000 0.000
#> GSM254711     4  0.0363     0.7098 0.000 0.012 0.000 0.988 0.000 0.000
#> GSM254717     4  0.3833    -0.2878 0.000 0.444 0.000 0.556 0.000 0.000
#> GSM254723     3  0.5061     0.6345 0.000 0.164 0.716 0.032 0.068 0.020
#> GSM254730     4  0.3531     0.2784 0.000 0.328 0.000 0.672 0.000 0.000
#> GSM254731     4  0.3607     0.2176 0.000 0.348 0.000 0.652 0.000 0.000
#> GSM254632     2  0.6077    -0.1778 0.000 0.540 0.064 0.056 0.328 0.012
#> GSM254662     2  0.3684     0.7984 0.000 0.628 0.000 0.372 0.000 0.000
#> GSM254677     4  0.1204     0.6657 0.000 0.056 0.000 0.944 0.000 0.000
#> GSM254665     4  0.3866    -0.4794 0.000 0.484 0.000 0.516 0.000 0.000
#> GSM254691     2  0.3860     0.5695 0.000 0.528 0.000 0.472 0.000 0.000
#> GSM254644     4  0.1444     0.6898 0.000 0.072 0.000 0.928 0.000 0.000
#> GSM254667     2  0.3409     0.7621 0.000 0.700 0.000 0.300 0.000 0.000
#> GSM254676     2  0.3860     0.5695 0.000 0.528 0.000 0.472 0.000 0.000
#> GSM254679     4  0.1204     0.7047 0.000 0.056 0.000 0.944 0.000 0.000
#> GSM254689     2  0.3563     0.8136 0.000 0.664 0.000 0.336 0.000 0.000
#> GSM254706     2  0.3563     0.8140 0.000 0.664 0.000 0.336 0.000 0.000
#> GSM254712     4  0.0000     0.7093 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM254713     4  0.0000     0.7093 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM254683     2  0.3578     0.8150 0.000 0.660 0.000 0.340 0.000 0.000
#> GSM254710     2  0.6077    -0.1778 0.000 0.540 0.064 0.056 0.328 0.012
#> GSM254725     4  0.1267     0.6699 0.000 0.060 0.000 0.940 0.000 0.000
#> GSM254651     2  0.3563     0.8140 0.000 0.664 0.000 0.336 0.000 0.000
#> GSM254638     4  0.0260     0.7066 0.000 0.008 0.000 0.992 0.000 0.000
#> GSM254685     4  0.2378     0.6081 0.000 0.152 0.000 0.848 0.000 0.000

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

consensus_heatmap(res, k = 2)

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

consensus_heatmap(res, k = 3)

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

consensus_heatmap(res, k = 4)

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

consensus_heatmap(res, k = 5)

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

consensus_heatmap(res, k = 6)

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

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

membership_heatmap(res, k = 2)

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

membership_heatmap(res, k = 3)

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

membership_heatmap(res, k = 4)

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

membership_heatmap(res, k = 5)

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

membership_heatmap(res, k = 6)

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

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

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

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

get_signatures(res, k = 3)

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

get_signatures(res, k = 4)

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

get_signatures(res, k = 5)

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

get_signatures(res, k = 6)

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

Signature heatmaps where rows are not scaled:

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

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

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

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

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

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

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

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

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

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

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk CV-hclust-signature_compare

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

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

An example of the output of tb is:

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

The columns in tb are:

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

UMAP plot which shows how samples are separated.

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

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

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

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

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

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

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

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

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

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

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk CV-hclust-collect-classes

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

test_to_known_factors(res)
#>             n tissue(p) individual(p) disease.state(p) gender(p) other(p) k
#> CV:hclust 105  6.63e-23        0.6809            0.534    0.6385    1.000 2
#> CV:hclust  96  9.84e-21        0.4414            0.664    0.5327    1.000 3
#> CV:hclust  93  4.97e-20        0.0359            0.655    0.0659    0.755 4
#> CV:hclust  50  3.61e-10        0.0283            0.834    0.0350    0.684 5
#> CV:hclust  70  6.25e-13        0.0723            0.768    0.0666    0.717 6

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


CV:kmeans**

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

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

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

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

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

collect_plots(res)

plot of chunk CV-kmeans-collect-plots

The plots are:

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

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

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

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

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 1.000           0.995       0.998         0.4983 0.503   0.503
#> 3 3 0.646           0.694       0.759         0.2820 0.828   0.662
#> 4 4 0.622           0.544       0.742         0.1312 0.856   0.629
#> 5 5 0.623           0.664       0.725         0.0741 0.840   0.504
#> 6 6 0.640           0.552       0.716         0.0444 0.943   0.744

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
#> GSM254629     1  0.0000      0.996 1.000 0.000
#> GSM254648     1  0.0000      0.996 1.000 0.000
#> GSM254694     1  0.0000      0.996 1.000 0.000
#> GSM254701     1  0.0000      0.996 1.000 0.000
#> GSM254728     1  0.0000      0.996 1.000 0.000
#> GSM254726     1  0.0000      0.996 1.000 0.000
#> GSM254639     1  0.0000      0.996 1.000 0.000
#> GSM254652     1  0.0000      0.996 1.000 0.000
#> GSM254700     1  0.0000      0.996 1.000 0.000
#> GSM254625     1  0.0000      0.996 1.000 0.000
#> GSM254636     1  0.0000      0.996 1.000 0.000
#> GSM254659     1  0.0000      0.996 1.000 0.000
#> GSM254680     1  0.0000      0.996 1.000 0.000
#> GSM254686     1  0.0000      0.996 1.000 0.000
#> GSM254718     1  0.0000      0.996 1.000 0.000
#> GSM254674     1  0.0000      0.996 1.000 0.000
#> GSM254668     1  0.0000      0.996 1.000 0.000
#> GSM254697     1  0.0000      0.996 1.000 0.000
#> GSM254704     1  0.0000      0.996 1.000 0.000
#> GSM254707     1  0.0000      0.996 1.000 0.000
#> GSM254714     1  0.0000      0.996 1.000 0.000
#> GSM254722     1  0.0000      0.996 1.000 0.000
#> GSM254627     1  0.0000      0.996 1.000 0.000
#> GSM254630     1  0.0000      0.996 1.000 0.000
#> GSM254633     1  0.0000      0.996 1.000 0.000
#> GSM254670     1  0.0000      0.996 1.000 0.000
#> GSM254716     1  0.0000      0.996 1.000 0.000
#> GSM254720     1  0.0000      0.996 1.000 0.000
#> GSM254729     1  0.0000      0.996 1.000 0.000
#> GSM254654     1  0.0000      0.996 1.000 0.000
#> GSM254656     1  0.0000      0.996 1.000 0.000
#> GSM254631     1  0.0000      0.996 1.000 0.000
#> GSM254657     1  0.0000      0.996 1.000 0.000
#> GSM254664     1  0.0000      0.996 1.000 0.000
#> GSM254672     1  0.0000      0.996 1.000 0.000
#> GSM254692     1  0.0000      0.996 1.000 0.000
#> GSM254645     1  0.0000      0.996 1.000 0.000
#> GSM254666     1  0.0000      0.996 1.000 0.000
#> GSM254675     1  0.0000      0.996 1.000 0.000
#> GSM254678     1  0.0000      0.996 1.000 0.000
#> GSM254688     1  0.0000      0.996 1.000 0.000
#> GSM254690     1  0.0000      0.996 1.000 0.000
#> GSM254696     1  0.0000      0.996 1.000 0.000
#> GSM254705     1  0.0000      0.996 1.000 0.000
#> GSM254642     1  0.0000      0.996 1.000 0.000
#> GSM254661     1  0.0000      0.996 1.000 0.000
#> GSM254698     1  0.0000      0.996 1.000 0.000
#> GSM254641     1  0.0000      0.996 1.000 0.000
#> GSM254647     1  0.0000      0.996 1.000 0.000
#> GSM254663     1  0.0000      0.996 1.000 0.000
#> GSM254682     1  0.0000      0.996 1.000 0.000
#> GSM254709     1  0.0000      0.996 1.000 0.000
#> GSM254721     1  0.0000      0.996 1.000 0.000
#> GSM254724     1  0.0000      0.996 1.000 0.000
#> GSM254650     1  0.0000      0.996 1.000 0.000
#> GSM254687     1  0.0000      0.996 1.000 0.000
#> GSM254637     1  0.0000      0.996 1.000 0.000
#> GSM254684     1  0.0000      0.996 1.000 0.000
#> GSM254649     2  0.0000      1.000 0.000 1.000
#> GSM254660     2  0.0000      1.000 0.000 1.000
#> GSM254693     2  0.0000      1.000 0.000 1.000
#> GSM254695     2  0.0000      1.000 0.000 1.000
#> GSM254702     2  0.0000      1.000 0.000 1.000
#> GSM254643     2  0.0000      1.000 0.000 1.000
#> GSM254727     2  0.0000      1.000 0.000 1.000
#> GSM254640     2  0.0000      1.000 0.000 1.000
#> GSM254626     2  0.0000      1.000 0.000 1.000
#> GSM254635     2  0.0000      1.000 0.000 1.000
#> GSM254653     2  0.0000      1.000 0.000 1.000
#> GSM254658     2  0.0000      1.000 0.000 1.000
#> GSM254681     2  0.0000      1.000 0.000 1.000
#> GSM254719     2  0.0000      1.000 0.000 1.000
#> GSM254673     2  0.0000      1.000 0.000 1.000
#> GSM254655     2  0.0000      1.000 0.000 1.000
#> GSM254669     2  0.0000      1.000 0.000 1.000
#> GSM254699     2  0.0000      1.000 0.000 1.000
#> GSM254703     2  0.0000      1.000 0.000 1.000
#> GSM254708     2  0.0000      1.000 0.000 1.000
#> GSM254715     2  0.0000      1.000 0.000 1.000
#> GSM254628     2  0.0000      1.000 0.000 1.000
#> GSM254634     2  0.0000      1.000 0.000 1.000
#> GSM254646     2  0.0000      1.000 0.000 1.000
#> GSM254671     2  0.0000      1.000 0.000 1.000
#> GSM254711     2  0.0000      1.000 0.000 1.000
#> GSM254717     2  0.0000      1.000 0.000 1.000
#> GSM254723     1  0.7883      0.691 0.764 0.236
#> GSM254730     2  0.0000      1.000 0.000 1.000
#> GSM254731     2  0.0000      1.000 0.000 1.000
#> GSM254632     1  0.0376      0.992 0.996 0.004
#> GSM254662     2  0.0000      1.000 0.000 1.000
#> GSM254677     2  0.0000      1.000 0.000 1.000
#> GSM254665     2  0.0000      1.000 0.000 1.000
#> GSM254691     2  0.0000      1.000 0.000 1.000
#> GSM254644     2  0.0000      1.000 0.000 1.000
#> GSM254667     2  0.0000      1.000 0.000 1.000
#> GSM254676     2  0.0000      1.000 0.000 1.000
#> GSM254679     2  0.0000      1.000 0.000 1.000
#> GSM254689     2  0.0000      1.000 0.000 1.000
#> GSM254706     2  0.0000      1.000 0.000 1.000
#> GSM254712     2  0.0000      1.000 0.000 1.000
#> GSM254713     2  0.0000      1.000 0.000 1.000
#> GSM254683     2  0.0000      1.000 0.000 1.000
#> GSM254710     2  0.0000      1.000 0.000 1.000
#> GSM254725     2  0.0000      1.000 0.000 1.000
#> GSM254651     2  0.0000      1.000 0.000 1.000
#> GSM254638     2  0.0000      1.000 0.000 1.000
#> GSM254685     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
#> GSM254629     3  0.1964      0.671 0.056 0.000 0.944
#> GSM254648     3  0.2878      0.661 0.096 0.000 0.904
#> GSM254694     3  0.1411      0.673 0.036 0.000 0.964
#> GSM254701     3  0.0237      0.680 0.004 0.000 0.996
#> GSM254728     3  0.0237      0.680 0.004 0.000 0.996
#> GSM254726     3  0.2878      0.661 0.096 0.000 0.904
#> GSM254639     3  0.0424      0.678 0.008 0.000 0.992
#> GSM254652     3  0.1964      0.671 0.056 0.000 0.944
#> GSM254700     1  0.5810      0.841 0.664 0.000 0.336
#> GSM254625     3  0.4654      0.533 0.208 0.000 0.792
#> GSM254636     3  0.6280     -0.562 0.460 0.000 0.540
#> GSM254659     3  0.0237      0.680 0.004 0.000 0.996
#> GSM254680     1  0.6305      0.662 0.516 0.000 0.484
#> GSM254686     3  0.3941      0.584 0.156 0.000 0.844
#> GSM254718     3  0.0237      0.680 0.004 0.000 0.996
#> GSM254674     1  0.6260      0.664 0.552 0.000 0.448
#> GSM254668     1  0.6140      0.674 0.596 0.000 0.404
#> GSM254697     1  0.5810      0.841 0.664 0.000 0.336
#> GSM254704     1  0.6095      0.798 0.608 0.000 0.392
#> GSM254707     1  0.6140      0.674 0.596 0.000 0.404
#> GSM254714     3  0.0424      0.679 0.008 0.000 0.992
#> GSM254722     1  0.5810      0.841 0.664 0.000 0.336
#> GSM254627     1  0.5810      0.841 0.664 0.000 0.336
#> GSM254630     3  0.6307     -0.265 0.488 0.000 0.512
#> GSM254633     3  0.6274     -0.554 0.456 0.000 0.544
#> GSM254670     3  0.0592      0.676 0.012 0.000 0.988
#> GSM254716     3  0.4654      0.533 0.208 0.000 0.792
#> GSM254720     3  0.6215     -0.466 0.428 0.000 0.572
#> GSM254729     3  0.1289      0.677 0.032 0.000 0.968
#> GSM254654     3  0.1643      0.669 0.044 0.000 0.956
#> GSM254656     3  0.4964      0.560 0.048 0.116 0.836
#> GSM254631     3  0.6295     -0.590 0.472 0.000 0.528
#> GSM254657     3  0.0237      0.680 0.004 0.000 0.996
#> GSM254664     1  0.6302      0.668 0.520 0.000 0.480
#> GSM254672     1  0.6140      0.789 0.596 0.000 0.404
#> GSM254692     1  0.5178      0.808 0.744 0.000 0.256
#> GSM254645     3  0.0592      0.676 0.012 0.000 0.988
#> GSM254666     3  0.2878      0.648 0.096 0.000 0.904
#> GSM254675     1  0.6111      0.803 0.604 0.000 0.396
#> GSM254678     1  0.6154      0.785 0.592 0.000 0.408
#> GSM254688     1  0.5254      0.809 0.736 0.000 0.264
#> GSM254690     1  0.5835      0.840 0.660 0.000 0.340
#> GSM254696     3  0.6286     -0.571 0.464 0.000 0.536
#> GSM254705     1  0.5178      0.808 0.744 0.000 0.256
#> GSM254642     1  0.5560      0.827 0.700 0.000 0.300
#> GSM254661     3  0.1964      0.671 0.056 0.000 0.944
#> GSM254698     1  0.6111      0.796 0.604 0.000 0.396
#> GSM254641     1  0.6299      0.576 0.524 0.000 0.476
#> GSM254647     1  0.5810      0.841 0.664 0.000 0.336
#> GSM254663     1  0.5178      0.808 0.744 0.000 0.256
#> GSM254682     1  0.5254      0.809 0.736 0.000 0.264
#> GSM254709     1  0.6225      0.509 0.568 0.000 0.432
#> GSM254721     1  0.5810      0.841 0.664 0.000 0.336
#> GSM254724     1  0.5810      0.841 0.664 0.000 0.336
#> GSM254650     1  0.5254      0.809 0.736 0.000 0.264
#> GSM254687     1  0.5254      0.809 0.736 0.000 0.264
#> GSM254637     3  0.6280     -0.564 0.460 0.000 0.540
#> GSM254684     3  0.6309     -0.645 0.496 0.000 0.504
#> GSM254649     2  0.4605      0.919 0.204 0.796 0.000
#> GSM254660     2  0.2711      0.909 0.088 0.912 0.000
#> GSM254693     2  0.4605      0.919 0.204 0.796 0.000
#> GSM254695     2  0.2096      0.872 0.052 0.944 0.004
#> GSM254702     2  0.0000      0.891 0.000 1.000 0.000
#> GSM254643     2  0.4504      0.920 0.196 0.804 0.000
#> GSM254727     2  0.4605      0.919 0.204 0.796 0.000
#> GSM254640     2  0.0000      0.891 0.000 1.000 0.000
#> GSM254626     2  0.4504      0.920 0.196 0.804 0.000
#> GSM254635     2  0.1525      0.878 0.032 0.964 0.004
#> GSM254653     2  0.4605      0.919 0.204 0.796 0.000
#> GSM254658     2  0.4605      0.919 0.204 0.796 0.000
#> GSM254681     2  0.4605      0.919 0.204 0.796 0.000
#> GSM254719     2  0.4504      0.920 0.196 0.804 0.000
#> GSM254673     2  0.4504      0.920 0.196 0.804 0.000
#> GSM254655     2  0.3038      0.912 0.104 0.896 0.000
#> GSM254669     2  0.4504      0.920 0.196 0.804 0.000
#> GSM254699     2  0.4062      0.919 0.164 0.836 0.000
#> GSM254703     2  0.0983      0.885 0.016 0.980 0.004
#> GSM254708     2  0.4750      0.915 0.216 0.784 0.000
#> GSM254715     2  0.0983      0.885 0.016 0.980 0.004
#> GSM254628     2  0.4605      0.919 0.204 0.796 0.000
#> GSM254634     2  0.1129      0.883 0.020 0.976 0.004
#> GSM254646     2  0.4605      0.919 0.204 0.796 0.000
#> GSM254671     2  0.0475      0.889 0.004 0.992 0.004
#> GSM254711     2  0.0983      0.885 0.016 0.980 0.004
#> GSM254717     2  0.4605      0.919 0.204 0.796 0.000
#> GSM254723     3  0.5852      0.510 0.044 0.180 0.776
#> GSM254730     2  0.3412      0.915 0.124 0.876 0.000
#> GSM254731     2  0.0000      0.891 0.000 1.000 0.000
#> GSM254632     3  0.3192      0.652 0.112 0.000 0.888
#> GSM254662     2  0.4504      0.920 0.196 0.804 0.000
#> GSM254677     2  0.1878      0.872 0.044 0.952 0.004
#> GSM254665     2  0.4504      0.920 0.196 0.804 0.000
#> GSM254691     2  0.4452      0.920 0.192 0.808 0.000
#> GSM254644     2  0.0000      0.891 0.000 1.000 0.000
#> GSM254667     2  0.4931      0.909 0.232 0.768 0.000
#> GSM254676     2  0.4452      0.920 0.192 0.808 0.000
#> GSM254679     2  0.0983      0.885 0.016 0.980 0.004
#> GSM254689     2  0.4605      0.919 0.204 0.796 0.000
#> GSM254706     2  0.4605      0.919 0.204 0.796 0.000
#> GSM254712     2  0.0983      0.885 0.016 0.980 0.004
#> GSM254713     2  0.0983      0.885 0.016 0.980 0.004
#> GSM254683     2  0.4605      0.919 0.204 0.796 0.000
#> GSM254710     3  0.9986     -0.198 0.320 0.320 0.360
#> GSM254725     2  0.1878      0.872 0.044 0.952 0.004
#> GSM254651     2  0.4605      0.919 0.204 0.796 0.000
#> GSM254638     2  0.1878      0.872 0.044 0.952 0.004
#> GSM254685     2  0.0424      0.889 0.008 0.992 0.000

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM254629     3  0.2048     0.8531 0.064 0.000 0.928 0.008
#> GSM254648     3  0.3245     0.8363 0.056 0.000 0.880 0.064
#> GSM254694     3  0.2313     0.8525 0.044 0.000 0.924 0.032
#> GSM254701     3  0.1854     0.8539 0.048 0.000 0.940 0.012
#> GSM254728     3  0.1389     0.8543 0.048 0.000 0.952 0.000
#> GSM254726     3  0.2926     0.8416 0.056 0.000 0.896 0.048
#> GSM254639     3  0.3245     0.8330 0.056 0.000 0.880 0.064
#> GSM254652     3  0.1716     0.8528 0.064 0.000 0.936 0.000
#> GSM254700     1  0.5344     0.7177 0.668 0.000 0.032 0.300
#> GSM254625     1  0.5296    -0.2432 0.500 0.000 0.492 0.008
#> GSM254636     1  0.7256     0.6027 0.540 0.000 0.256 0.204
#> GSM254659     3  0.1389     0.8543 0.048 0.000 0.952 0.000
#> GSM254680     1  0.5705     0.7006 0.712 0.000 0.180 0.108
#> GSM254686     3  0.4866     0.3839 0.404 0.000 0.596 0.000
#> GSM254718     3  0.1389     0.8543 0.048 0.000 0.952 0.000
#> GSM254674     1  0.3991     0.6613 0.808 0.000 0.172 0.020
#> GSM254668     1  0.3052     0.6575 0.860 0.000 0.136 0.004
#> GSM254697     1  0.5321     0.7189 0.672 0.000 0.032 0.296
#> GSM254704     1  0.6937     0.6580 0.532 0.000 0.124 0.344
#> GSM254707     1  0.3052     0.6575 0.860 0.000 0.136 0.004
#> GSM254714     3  0.3037     0.8343 0.076 0.000 0.888 0.036
#> GSM254722     1  0.5495     0.7092 0.624 0.000 0.028 0.348
#> GSM254627     1  0.5321     0.7189 0.672 0.000 0.032 0.296
#> GSM254630     1  0.4008     0.4677 0.756 0.000 0.244 0.000
#> GSM254633     1  0.7172     0.5895 0.532 0.000 0.304 0.164
#> GSM254670     3  0.3617     0.8238 0.076 0.000 0.860 0.064
#> GSM254716     3  0.5168     0.2103 0.492 0.000 0.504 0.004
#> GSM254720     3  0.7853    -0.3338 0.364 0.000 0.368 0.268
#> GSM254729     3  0.2586     0.8520 0.048 0.000 0.912 0.040
#> GSM254654     3  0.2675     0.8482 0.044 0.000 0.908 0.048
#> GSM254656     3  0.3498     0.7762 0.008 0.000 0.832 0.160
#> GSM254631     1  0.7079     0.6199 0.556 0.000 0.276 0.168
#> GSM254657     3  0.3542     0.8269 0.076 0.000 0.864 0.060
#> GSM254664     1  0.6330     0.6958 0.656 0.000 0.200 0.144
#> GSM254672     1  0.7120     0.6416 0.496 0.000 0.136 0.368
#> GSM254692     1  0.2345     0.7011 0.900 0.000 0.000 0.100
#> GSM254645     3  0.3245     0.8330 0.056 0.000 0.880 0.064
#> GSM254666     3  0.4697     0.5440 0.356 0.000 0.644 0.000
#> GSM254675     1  0.6274     0.7178 0.664 0.000 0.152 0.184
#> GSM254678     1  0.6993     0.6595 0.556 0.000 0.148 0.296
#> GSM254688     1  0.1388     0.7029 0.960 0.000 0.028 0.012
#> GSM254690     1  0.5332     0.7402 0.736 0.000 0.080 0.184
#> GSM254696     1  0.7336     0.6034 0.528 0.000 0.256 0.216
#> GSM254705     1  0.0000     0.7079 1.000 0.000 0.000 0.000
#> GSM254642     1  0.5038     0.7193 0.684 0.000 0.020 0.296
#> GSM254661     3  0.1716     0.8528 0.064 0.000 0.936 0.000
#> GSM254698     1  0.7091     0.6471 0.508 0.000 0.136 0.356
#> GSM254641     1  0.4574     0.6165 0.756 0.000 0.220 0.024
#> GSM254647     1  0.5207     0.7207 0.680 0.000 0.028 0.292
#> GSM254663     1  0.1302     0.7070 0.956 0.000 0.000 0.044
#> GSM254682     1  0.1411     0.7043 0.960 0.000 0.020 0.020
#> GSM254709     1  0.3479     0.6147 0.840 0.000 0.148 0.012
#> GSM254721     1  0.5367     0.7171 0.664 0.000 0.032 0.304
#> GSM254724     1  0.5367     0.7171 0.664 0.000 0.032 0.304
#> GSM254650     1  0.0672     0.7071 0.984 0.000 0.008 0.008
#> GSM254687     1  0.0657     0.7065 0.984 0.000 0.012 0.004
#> GSM254637     1  0.7189     0.5927 0.532 0.000 0.300 0.168
#> GSM254684     1  0.7293     0.6126 0.536 0.000 0.248 0.216
#> GSM254649     2  0.0336     0.6460 0.000 0.992 0.008 0.000
#> GSM254660     2  0.5174    -0.3772 0.000 0.620 0.012 0.368
#> GSM254693     2  0.0188     0.6466 0.000 0.996 0.000 0.004
#> GSM254695     4  0.5310     0.9233 0.000 0.412 0.012 0.576
#> GSM254702     2  0.5452    -0.5887 0.000 0.556 0.016 0.428
#> GSM254643     2  0.0657     0.6461 0.000 0.984 0.004 0.012
#> GSM254727     2  0.0937     0.6432 0.000 0.976 0.012 0.012
#> GSM254640     2  0.5257    -0.6477 0.000 0.548 0.008 0.444
#> GSM254626     2  0.0469     0.6462 0.000 0.988 0.000 0.012
#> GSM254635     4  0.5543     0.9326 0.000 0.424 0.020 0.556
#> GSM254653     2  0.0937     0.6432 0.000 0.976 0.012 0.012
#> GSM254658     2  0.0336     0.6460 0.000 0.992 0.008 0.000
#> GSM254681     2  0.0657     0.6437 0.000 0.984 0.012 0.004
#> GSM254719     2  0.1284     0.6382 0.000 0.964 0.012 0.024
#> GSM254673     2  0.0937     0.6439 0.000 0.976 0.012 0.012
#> GSM254655     2  0.4635     0.0836 0.000 0.720 0.012 0.268
#> GSM254669     2  0.0937     0.6439 0.000 0.976 0.012 0.012
#> GSM254699     2  0.3895     0.3677 0.000 0.804 0.012 0.184
#> GSM254703     4  0.5388     0.8959 0.000 0.456 0.012 0.532
#> GSM254708     2  0.2859     0.5560 0.000 0.880 0.008 0.112
#> GSM254715     2  0.5404    -0.7228 0.000 0.512 0.012 0.476
#> GSM254628     2  0.0336     0.6460 0.000 0.992 0.008 0.000
#> GSM254634     4  0.5345     0.9322 0.000 0.428 0.012 0.560
#> GSM254646     2  0.0336     0.6460 0.000 0.992 0.008 0.000
#> GSM254671     2  0.5493    -0.6645 0.000 0.528 0.016 0.456
#> GSM254711     4  0.5388     0.9012 0.000 0.456 0.012 0.532
#> GSM254717     2  0.0524     0.6464 0.000 0.988 0.004 0.008
#> GSM254723     3  0.2530     0.7879 0.000 0.000 0.888 0.112
#> GSM254730     2  0.4516     0.1387 0.000 0.736 0.012 0.252
#> GSM254731     2  0.5452    -0.5887 0.000 0.556 0.016 0.428
#> GSM254632     3  0.4301     0.7951 0.064 0.000 0.816 0.120
#> GSM254662     2  0.1174     0.6404 0.000 0.968 0.012 0.020
#> GSM254677     4  0.5408     0.9245 0.000 0.408 0.016 0.576
#> GSM254665     2  0.1388     0.6365 0.000 0.960 0.012 0.028
#> GSM254691     2  0.2799     0.5729 0.000 0.884 0.008 0.108
#> GSM254644     2  0.5126    -0.6340 0.000 0.552 0.004 0.444
#> GSM254667     2  0.3324     0.5254 0.000 0.852 0.012 0.136
#> GSM254676     2  0.2799     0.5729 0.000 0.884 0.008 0.108
#> GSM254679     4  0.5388     0.9012 0.000 0.456 0.012 0.532
#> GSM254689     2  0.0657     0.6437 0.000 0.984 0.012 0.004
#> GSM254706     2  0.2542     0.5812 0.000 0.904 0.012 0.084
#> GSM254712     2  0.5508    -0.7437 0.000 0.508 0.016 0.476
#> GSM254713     2  0.5506    -0.7316 0.000 0.512 0.016 0.472
#> GSM254683     2  0.2101     0.6044 0.000 0.928 0.012 0.060
#> GSM254710     2  0.8543     0.1558 0.184 0.544 0.148 0.124
#> GSM254725     4  0.5300     0.9267 0.000 0.408 0.012 0.580
#> GSM254651     2  0.2021     0.6062 0.000 0.932 0.012 0.056
#> GSM254638     4  0.5592     0.9216 0.000 0.404 0.024 0.572
#> GSM254685     2  0.5404    -0.7228 0.000 0.512 0.012 0.476

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM254629     3  0.1059     0.9143 0.004 0.008 0.968 0.000 0.020
#> GSM254648     3  0.1413     0.9089 0.000 0.012 0.956 0.020 0.012
#> GSM254694     3  0.1200     0.9144 0.012 0.008 0.964 0.016 0.000
#> GSM254701     3  0.1095     0.9157 0.012 0.008 0.968 0.000 0.012
#> GSM254728     3  0.1369     0.9149 0.008 0.008 0.956 0.000 0.028
#> GSM254726     3  0.1200     0.9089 0.000 0.008 0.964 0.016 0.012
#> GSM254639     3  0.3673     0.8702 0.060 0.040 0.848 0.000 0.052
#> GSM254652     3  0.1251     0.9135 0.000 0.008 0.956 0.000 0.036
#> GSM254700     1  0.1988     0.5933 0.928 0.016 0.008 0.000 0.048
#> GSM254625     5  0.5584     0.5731 0.072 0.016 0.276 0.000 0.636
#> GSM254636     1  0.7718     0.4136 0.472 0.100 0.192 0.000 0.236
#> GSM254659     3  0.1153     0.9158 0.008 0.004 0.964 0.000 0.024
#> GSM254680     5  0.7107     0.3204 0.364 0.072 0.100 0.000 0.464
#> GSM254686     5  0.6045     0.3622 0.060 0.024 0.440 0.000 0.476
#> GSM254718     3  0.0968     0.9160 0.012 0.004 0.972 0.000 0.012
#> GSM254674     5  0.6944     0.5601 0.260 0.072 0.116 0.000 0.552
#> GSM254668     5  0.5599     0.6748 0.244 0.020 0.080 0.000 0.656
#> GSM254697     1  0.3496     0.5884 0.844 0.056 0.008 0.000 0.092
#> GSM254704     1  0.1943     0.6105 0.924 0.020 0.056 0.000 0.000
#> GSM254707     5  0.5013     0.6844 0.240 0.000 0.080 0.000 0.680
#> GSM254714     3  0.2625     0.8552 0.108 0.016 0.876 0.000 0.000
#> GSM254722     1  0.3266     0.6050 0.860 0.076 0.008 0.000 0.056
#> GSM254627     1  0.3496     0.5884 0.844 0.056 0.008 0.000 0.092
#> GSM254630     5  0.5974     0.6491 0.188 0.016 0.160 0.000 0.636
#> GSM254633     1  0.7697     0.3508 0.448 0.076 0.244 0.000 0.232
#> GSM254670     3  0.4984     0.7924 0.060 0.088 0.764 0.000 0.088
#> GSM254716     5  0.5663     0.5593 0.072 0.016 0.292 0.000 0.620
#> GSM254720     1  0.4335     0.4648 0.708 0.020 0.268 0.000 0.004
#> GSM254729     3  0.1617     0.9162 0.020 0.012 0.948 0.000 0.020
#> GSM254654     3  0.1413     0.9125 0.012 0.012 0.956 0.020 0.000
#> GSM254656     3  0.4691     0.8406 0.048 0.044 0.808 0.052 0.048
#> GSM254631     1  0.7663     0.3532 0.456 0.076 0.224 0.000 0.244
#> GSM254657     3  0.4308     0.8408 0.056 0.048 0.808 0.000 0.088
#> GSM254664     1  0.7552     0.2202 0.464 0.076 0.176 0.000 0.284
#> GSM254672     1  0.2674     0.6095 0.896 0.032 0.060 0.000 0.012
#> GSM254692     5  0.5033     0.4159 0.448 0.024 0.004 0.000 0.524
#> GSM254645     3  0.3673     0.8702 0.060 0.040 0.848 0.000 0.052
#> GSM254666     5  0.4994     0.3896 0.012 0.016 0.396 0.000 0.576
#> GSM254675     1  0.6223     0.4769 0.636 0.044 0.120 0.000 0.200
#> GSM254678     1  0.6071     0.5690 0.680 0.120 0.096 0.000 0.104
#> GSM254688     5  0.4421     0.6747 0.268 0.004 0.024 0.000 0.704
#> GSM254690     1  0.6516     0.2669 0.528 0.096 0.036 0.000 0.340
#> GSM254696     1  0.7867     0.4174 0.452 0.116 0.184 0.000 0.248
#> GSM254705     5  0.4422     0.6449 0.320 0.012 0.004 0.000 0.664
#> GSM254642     1  0.3323     0.5797 0.844 0.056 0.000 0.000 0.100
#> GSM254661     3  0.1444     0.9136 0.000 0.012 0.948 0.000 0.040
#> GSM254698     1  0.5251     0.6026 0.736 0.140 0.056 0.000 0.068
#> GSM254641     5  0.6656     0.6115 0.228 0.032 0.172 0.000 0.568
#> GSM254647     1  0.3187     0.5892 0.860 0.036 0.008 0.000 0.096
#> GSM254663     5  0.4804     0.5718 0.364 0.016 0.008 0.000 0.612
#> GSM254682     5  0.4363     0.6692 0.268 0.008 0.016 0.000 0.708
#> GSM254709     5  0.5831     0.6686 0.212 0.004 0.160 0.000 0.624
#> GSM254721     1  0.1988     0.5933 0.928 0.016 0.008 0.000 0.048
#> GSM254724     1  0.1988     0.5933 0.928 0.016 0.008 0.000 0.048
#> GSM254650     5  0.4484     0.6678 0.308 0.000 0.024 0.000 0.668
#> GSM254687     5  0.4465     0.6696 0.304 0.000 0.024 0.000 0.672
#> GSM254637     1  0.7691     0.3520 0.456 0.080 0.240 0.000 0.224
#> GSM254684     1  0.7869     0.4146 0.452 0.120 0.176 0.000 0.252
#> GSM254649     2  0.4524     0.7967 0.000 0.736 0.004 0.208 0.052
#> GSM254660     4  0.4382     0.5241 0.000 0.288 0.000 0.688 0.024
#> GSM254693     2  0.3430     0.7930 0.000 0.776 0.000 0.220 0.004
#> GSM254695     4  0.2958     0.7102 0.000 0.024 0.020 0.880 0.076
#> GSM254702     4  0.3882     0.6471 0.000 0.224 0.000 0.756 0.020
#> GSM254643     2  0.4541     0.7545 0.000 0.680 0.000 0.288 0.032
#> GSM254727     2  0.4029     0.7797 0.000 0.744 0.000 0.232 0.024
#> GSM254640     4  0.4506     0.6887 0.004 0.244 0.000 0.716 0.036
#> GSM254626     2  0.4206     0.7581 0.000 0.696 0.000 0.288 0.016
#> GSM254635     4  0.1652     0.7536 0.004 0.008 0.004 0.944 0.040
#> GSM254653     2  0.3912     0.7787 0.000 0.752 0.000 0.228 0.020
#> GSM254658     2  0.4524     0.7967 0.000 0.736 0.004 0.208 0.052
#> GSM254681     2  0.5200     0.7917 0.004 0.696 0.004 0.208 0.088
#> GSM254719     2  0.4400     0.7347 0.000 0.672 0.000 0.308 0.020
#> GSM254673     2  0.4318     0.7498 0.000 0.688 0.000 0.292 0.020
#> GSM254655     4  0.4707     0.2253 0.000 0.392 0.000 0.588 0.020
#> GSM254669     2  0.4297     0.7529 0.000 0.692 0.000 0.288 0.020
#> GSM254699     4  0.4821    -0.1092 0.000 0.464 0.000 0.516 0.020
#> GSM254703     4  0.2940     0.7476 0.004 0.048 0.000 0.876 0.072
#> GSM254708     2  0.6318     0.6820 0.004 0.548 0.008 0.312 0.128
#> GSM254715     4  0.3073     0.7553 0.004 0.076 0.000 0.868 0.052
#> GSM254628     2  0.4457     0.7969 0.000 0.740 0.004 0.208 0.048
#> GSM254634     4  0.2178     0.7460 0.000 0.024 0.008 0.920 0.048
#> GSM254646     2  0.4984     0.7948 0.004 0.712 0.004 0.208 0.072
#> GSM254671     4  0.3556     0.6998 0.000 0.168 0.004 0.808 0.020
#> GSM254711     4  0.2308     0.7516 0.000 0.048 0.004 0.912 0.036
#> GSM254717     2  0.3727     0.7906 0.000 0.768 0.000 0.216 0.016
#> GSM254723     3  0.1883     0.8856 0.000 0.012 0.932 0.048 0.008
#> GSM254730     4  0.4904     0.0876 0.000 0.472 0.000 0.504 0.024
#> GSM254731     4  0.3882     0.6471 0.000 0.224 0.000 0.756 0.020
#> GSM254632     3  0.4431     0.7693 0.004 0.020 0.796 0.076 0.104
#> GSM254662     2  0.4400     0.7347 0.000 0.672 0.000 0.308 0.020
#> GSM254677     4  0.2945     0.7280 0.004 0.012 0.020 0.880 0.084
#> GSM254665     2  0.5337     0.7140 0.004 0.596 0.000 0.344 0.056
#> GSM254691     2  0.5909     0.6543 0.004 0.544 0.000 0.352 0.100
#> GSM254644     4  0.4482     0.6815 0.004 0.252 0.000 0.712 0.032
#> GSM254667     2  0.6885     0.6432 0.004 0.488 0.016 0.316 0.176
#> GSM254676     2  0.5898     0.6585 0.004 0.548 0.000 0.348 0.100
#> GSM254679     4  0.2308     0.7504 0.000 0.048 0.004 0.912 0.036
#> GSM254689     2  0.5200     0.7917 0.004 0.696 0.004 0.208 0.088
#> GSM254706     2  0.6333     0.7172 0.004 0.564 0.008 0.280 0.144
#> GSM254712     4  0.3012     0.7559 0.004 0.072 0.000 0.872 0.052
#> GSM254713     4  0.3012     0.7559 0.004 0.072 0.000 0.872 0.052
#> GSM254683     2  0.6129     0.7315 0.004 0.584 0.004 0.268 0.140
#> GSM254710     2  0.7221     0.4161 0.004 0.512 0.076 0.108 0.300
#> GSM254725     4  0.2198     0.7307 0.000 0.012 0.020 0.920 0.048
#> GSM254651     2  0.5960     0.7390 0.004 0.600 0.004 0.272 0.120
#> GSM254638     4  0.2393     0.7372 0.004 0.000 0.016 0.900 0.080
#> GSM254685     4  0.3202     0.7542 0.004 0.080 0.000 0.860 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
#> GSM254629     3  0.1007     0.8619 0.008 0.004 0.968 0.004 0.016 0.000
#> GSM254648     3  0.1408     0.8603 0.008 0.008 0.952 0.000 0.008 0.024
#> GSM254694     3  0.1266     0.8622 0.008 0.004 0.960 0.004 0.008 0.016
#> GSM254701     3  0.0862     0.8621 0.008 0.000 0.972 0.004 0.016 0.000
#> GSM254728     3  0.1829     0.8616 0.000 0.008 0.928 0.000 0.028 0.036
#> GSM254726     3  0.2093     0.8547 0.000 0.020 0.920 0.004 0.020 0.036
#> GSM254639     3  0.4806     0.7546 0.048 0.012 0.732 0.008 0.024 0.176
#> GSM254652     3  0.1921     0.8611 0.000 0.012 0.928 0.004 0.032 0.024
#> GSM254700     1  0.1663     0.6335 0.912 0.000 0.000 0.000 0.088 0.000
#> GSM254625     5  0.4506     0.4618 0.000 0.036 0.212 0.000 0.716 0.036
#> GSM254636     6  0.6955     0.9172 0.328 0.000 0.056 0.000 0.264 0.352
#> GSM254659     3  0.0964     0.8638 0.000 0.000 0.968 0.004 0.016 0.012
#> GSM254680     5  0.6888    -0.1647 0.212 0.016 0.052 0.004 0.516 0.200
#> GSM254686     5  0.5722     0.3174 0.000 0.032 0.384 0.004 0.512 0.068
#> GSM254718     3  0.0551     0.8662 0.000 0.000 0.984 0.004 0.008 0.004
#> GSM254674     5  0.6034     0.2363 0.108 0.016 0.048 0.004 0.632 0.192
#> GSM254668     5  0.4702     0.4863 0.092 0.024 0.040 0.004 0.772 0.068
#> GSM254697     1  0.4900     0.6124 0.724 0.052 0.000 0.000 0.112 0.112
#> GSM254704     1  0.1340     0.6144 0.948 0.000 0.008 0.000 0.040 0.004
#> GSM254707     5  0.2991     0.5459 0.084 0.008 0.044 0.000 0.860 0.004
#> GSM254714     3  0.3263     0.7564 0.176 0.004 0.800 0.000 0.020 0.000
#> GSM254722     1  0.5015     0.5449 0.700 0.052 0.000 0.000 0.072 0.176
#> GSM254627     1  0.4900     0.6124 0.724 0.052 0.000 0.000 0.112 0.112
#> GSM254630     5  0.4783     0.5104 0.068 0.008 0.140 0.000 0.740 0.044
#> GSM254633     5  0.7672    -0.6022 0.320 0.016 0.092 0.004 0.344 0.224
#> GSM254670     3  0.5752     0.6289 0.048 0.012 0.628 0.008 0.052 0.252
#> GSM254716     5  0.4780     0.4440 0.000 0.032 0.236 0.000 0.684 0.048
#> GSM254720     1  0.3312     0.4395 0.792 0.000 0.180 0.000 0.028 0.000
#> GSM254729     3  0.2239     0.8532 0.012 0.012 0.908 0.008 0.000 0.060
#> GSM254654     3  0.1266     0.8622 0.008 0.004 0.960 0.004 0.008 0.016
#> GSM254656     3  0.6192     0.6934 0.048 0.016 0.624 0.040 0.044 0.228
#> GSM254631     5  0.7665    -0.5977 0.328 0.016 0.092 0.004 0.340 0.220
#> GSM254657     3  0.5140     0.7445 0.048 0.012 0.720 0.008 0.052 0.160
#> GSM254664     5  0.7561    -0.5337 0.312 0.016 0.080 0.004 0.368 0.220
#> GSM254672     1  0.2186     0.5713 0.908 0.000 0.012 0.000 0.024 0.056
#> GSM254692     5  0.4428     0.3612 0.312 0.008 0.000 0.000 0.648 0.032
#> GSM254645     3  0.4848     0.7569 0.048 0.012 0.732 0.008 0.028 0.172
#> GSM254666     5  0.5099     0.4102 0.012 0.028 0.268 0.000 0.652 0.040
#> GSM254675     1  0.5995    -0.0775 0.592 0.016 0.044 0.004 0.276 0.068
#> GSM254678     1  0.5756    -0.4301 0.548 0.000 0.016 0.000 0.140 0.296
#> GSM254688     5  0.2313     0.5471 0.100 0.000 0.004 0.000 0.884 0.012
#> GSM254690     5  0.6870    -0.5583 0.320 0.024 0.008 0.004 0.388 0.256
#> GSM254696     6  0.7060     0.9495 0.312 0.004 0.056 0.000 0.260 0.368
#> GSM254705     5  0.3013     0.5393 0.140 0.004 0.000 0.000 0.832 0.024
#> GSM254642     1  0.4941     0.6107 0.720 0.052 0.000 0.000 0.116 0.112
#> GSM254661     3  0.1794     0.8620 0.000 0.016 0.932 0.000 0.024 0.028
#> GSM254698     1  0.5692     0.2099 0.556 0.036 0.012 0.000 0.052 0.344
#> GSM254641     5  0.6149     0.4269 0.088 0.028 0.124 0.004 0.656 0.100
#> GSM254647     1  0.4550     0.5889 0.740 0.032 0.000 0.000 0.152 0.076
#> GSM254663     5  0.3878     0.4804 0.212 0.008 0.000 0.000 0.748 0.032
#> GSM254682     5  0.2492     0.5456 0.100 0.000 0.004 0.000 0.876 0.020
#> GSM254709     5  0.4117     0.5410 0.100 0.008 0.128 0.000 0.764 0.000
#> GSM254721     1  0.1753     0.6340 0.912 0.000 0.000 0.000 0.084 0.004
#> GSM254724     1  0.1610     0.6334 0.916 0.000 0.000 0.000 0.084 0.000
#> GSM254650     5  0.2584     0.5473 0.144 0.004 0.004 0.000 0.848 0.000
#> GSM254687     5  0.2716     0.5488 0.132 0.004 0.004 0.000 0.852 0.008
#> GSM254637     1  0.7655    -0.6299 0.340 0.016 0.092 0.004 0.332 0.216
#> GSM254684     6  0.7113     0.9394 0.316 0.008 0.052 0.000 0.260 0.364
#> GSM254649     2  0.2048     0.7065 0.000 0.880 0.000 0.120 0.000 0.000
#> GSM254660     4  0.5801     0.2640 0.000 0.260 0.000 0.500 0.000 0.240
#> GSM254693     2  0.3953     0.7086 0.000 0.764 0.000 0.132 0.000 0.104
#> GSM254695     4  0.3968     0.6422 0.000 0.020 0.012 0.792 0.036 0.140
#> GSM254702     4  0.5579     0.4394 0.000 0.204 0.000 0.548 0.000 0.248
#> GSM254643     2  0.4942     0.6788 0.000 0.652 0.000 0.156 0.000 0.192
#> GSM254727     2  0.4410     0.6927 0.000 0.716 0.000 0.120 0.000 0.164
#> GSM254640     4  0.5527     0.6234 0.008 0.252 0.000 0.628 0.032 0.080
#> GSM254626     2  0.4828     0.6816 0.000 0.668 0.000 0.156 0.000 0.176
#> GSM254635     4  0.1594     0.7545 0.000 0.016 0.000 0.932 0.000 0.052
#> GSM254653     2  0.4474     0.6898 0.000 0.708 0.000 0.120 0.000 0.172
#> GSM254658     2  0.2048     0.7065 0.000 0.880 0.000 0.120 0.000 0.000
#> GSM254681     2  0.3272     0.6946 0.004 0.824 0.000 0.124 0.000 0.048
#> GSM254719     2  0.5156     0.6534 0.000 0.616 0.000 0.152 0.000 0.232
#> GSM254673     2  0.5088     0.6621 0.000 0.628 0.000 0.152 0.000 0.220
#> GSM254655     2  0.6012     0.2017 0.000 0.396 0.000 0.364 0.000 0.240
#> GSM254669     2  0.5040     0.6652 0.000 0.636 0.000 0.152 0.000 0.212
#> GSM254699     2  0.5930     0.3719 0.000 0.456 0.000 0.304 0.000 0.240
#> GSM254703     4  0.2443     0.7461 0.008 0.040 0.000 0.904 0.024 0.024
#> GSM254708     2  0.6262     0.5024 0.004 0.456 0.000 0.344 0.016 0.180
#> GSM254715     4  0.4747     0.7306 0.008 0.076 0.000 0.744 0.040 0.132
#> GSM254628     2  0.2092     0.7056 0.000 0.876 0.000 0.124 0.000 0.000
#> GSM254634     4  0.1485     0.7403 0.000 0.028 0.000 0.944 0.004 0.024
#> GSM254646     2  0.2804     0.7017 0.004 0.852 0.000 0.120 0.000 0.024
#> GSM254671     4  0.4932     0.5806 0.000 0.128 0.000 0.644 0.000 0.228
#> GSM254711     4  0.1549     0.7458 0.000 0.044 0.000 0.936 0.000 0.020
#> GSM254717     2  0.4124     0.7032 0.000 0.748 0.000 0.120 0.000 0.132
#> GSM254723     3  0.3556     0.8188 0.000 0.028 0.836 0.020 0.024 0.092
#> GSM254730     2  0.5724     0.3375 0.000 0.492 0.000 0.324 0.000 0.184
#> GSM254731     4  0.5561     0.4393 0.000 0.204 0.000 0.552 0.000 0.244
#> GSM254632     3  0.6463     0.6018 0.000 0.044 0.600 0.088 0.064 0.204
#> GSM254662     2  0.5156     0.6534 0.000 0.616 0.000 0.152 0.000 0.232
#> GSM254677     4  0.2912     0.7269 0.008 0.012 0.008 0.880 0.032 0.060
#> GSM254665     2  0.5624     0.6304 0.004 0.580 0.000 0.232 0.004 0.180
#> GSM254691     2  0.6001     0.4817 0.004 0.460 0.000 0.384 0.012 0.140
#> GSM254644     4  0.5757     0.5992 0.008 0.264 0.000 0.604 0.040 0.084
#> GSM254667     2  0.6461     0.4743 0.004 0.484 0.000 0.304 0.036 0.172
#> GSM254676     2  0.5974     0.4842 0.004 0.464 0.000 0.384 0.012 0.136
#> GSM254679     4  0.1480     0.7442 0.000 0.040 0.000 0.940 0.000 0.020
#> GSM254689     2  0.3272     0.6946 0.004 0.824 0.000 0.124 0.000 0.048
#> GSM254706     2  0.5503     0.5687 0.000 0.604 0.000 0.224 0.012 0.160
#> GSM254712     4  0.4456     0.7395 0.008 0.076 0.000 0.772 0.040 0.104
#> GSM254713     4  0.4456     0.7395 0.008 0.076 0.000 0.772 0.040 0.104
#> GSM254683     2  0.5317     0.5985 0.004 0.640 0.000 0.220 0.012 0.124
#> GSM254710     2  0.7123     0.3461 0.004 0.516 0.016 0.108 0.140 0.216
#> GSM254725     4  0.1565     0.7399 0.000 0.028 0.004 0.940 0.000 0.028
#> GSM254651     2  0.5037     0.6115 0.000 0.668 0.000 0.192 0.012 0.128
#> GSM254638     4  0.1584     0.7455 0.004 0.012 0.004 0.944 0.004 0.032
#> GSM254685     4  0.4747     0.7306 0.008 0.076 0.000 0.744 0.040 0.132

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

consensus_heatmap(res, k = 2)

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

consensus_heatmap(res, k = 3)

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

consensus_heatmap(res, k = 4)

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

consensus_heatmap(res, k = 5)

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

consensus_heatmap(res, k = 6)

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

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

membership_heatmap(res, k = 2)

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

membership_heatmap(res, k = 3)

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

membership_heatmap(res, k = 4)

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

membership_heatmap(res, k = 5)

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

membership_heatmap(res, k = 6)

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

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

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

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

get_signatures(res, k = 3)

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

get_signatures(res, k = 4)

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

get_signatures(res, k = 5)

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

get_signatures(res, k = 6)

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

Signature heatmaps where rows are not scaled:

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

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

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

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

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

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

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

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

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

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

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk CV-kmeans-signature_compare

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

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

An example of the output of tb is:

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

The columns in tb are:

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

UMAP plot which shows how samples are separated.

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

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

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

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

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

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

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

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

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

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

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk CV-kmeans-collect-classes

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

test_to_known_factors(res)
#>             n tissue(p) individual(p) disease.state(p) gender(p) other(p) k
#> CV:kmeans 107  1.59e-22       0.77697            0.577    0.6277    0.872 2
#> CV:kmeans  98  2.05e-20       0.00176            0.557    0.1178    0.628 3
#> CV:kmeans  88  2.46e-17       0.01085            0.852    0.2238    0.981 4
#> CV:kmeans  89  7.24e-17       0.06638            0.315    0.0937    0.311 5
#> CV:kmeans  78  6.98e-14       0.02658            0.352    0.2971    0.246 6

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


CV:skmeans**

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

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

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

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

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

collect_plots(res)

plot of chunk CV-skmeans-collect-plots

The plots are:

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

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

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

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

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 1.000           0.991       0.996         0.5026 0.497   0.497
#> 3 3 0.819           0.842       0.889         0.2700 0.862   0.725
#> 4 4 0.684           0.779       0.798         0.1217 0.882   0.688
#> 5 5 0.679           0.736       0.811         0.0817 0.868   0.563
#> 6 6 0.687           0.663       0.782         0.0410 0.926   0.678

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
#> GSM254629     1  0.0000      0.999 1.000 0.000
#> GSM254648     2  0.6887      0.777 0.184 0.816
#> GSM254694     1  0.0000      0.999 1.000 0.000
#> GSM254701     1  0.0000      0.999 1.000 0.000
#> GSM254728     1  0.0000      0.999 1.000 0.000
#> GSM254726     1  0.2778      0.949 0.952 0.048
#> GSM254639     1  0.0000      0.999 1.000 0.000
#> GSM254652     1  0.0000      0.999 1.000 0.000
#> GSM254700     1  0.0000      0.999 1.000 0.000
#> GSM254625     1  0.0000      0.999 1.000 0.000
#> GSM254636     1  0.0000      0.999 1.000 0.000
#> GSM254659     1  0.0000      0.999 1.000 0.000
#> GSM254680     1  0.0000      0.999 1.000 0.000
#> GSM254686     1  0.0000      0.999 1.000 0.000
#> GSM254718     1  0.0000      0.999 1.000 0.000
#> GSM254674     1  0.0000      0.999 1.000 0.000
#> GSM254668     1  0.0000      0.999 1.000 0.000
#> GSM254697     1  0.0000      0.999 1.000 0.000
#> GSM254704     1  0.0000      0.999 1.000 0.000
#> GSM254707     1  0.0000      0.999 1.000 0.000
#> GSM254714     1  0.0000      0.999 1.000 0.000
#> GSM254722     1  0.0000      0.999 1.000 0.000
#> GSM254627     1  0.0000      0.999 1.000 0.000
#> GSM254630     1  0.0000      0.999 1.000 0.000
#> GSM254633     1  0.0000      0.999 1.000 0.000
#> GSM254670     1  0.0000      0.999 1.000 0.000
#> GSM254716     1  0.0000      0.999 1.000 0.000
#> GSM254720     1  0.0000      0.999 1.000 0.000
#> GSM254729     1  0.0000      0.999 1.000 0.000
#> GSM254654     1  0.0000      0.999 1.000 0.000
#> GSM254656     1  0.0672      0.991 0.992 0.008
#> GSM254631     1  0.0000      0.999 1.000 0.000
#> GSM254657     1  0.0000      0.999 1.000 0.000
#> GSM254664     1  0.0000      0.999 1.000 0.000
#> GSM254672     1  0.0000      0.999 1.000 0.000
#> GSM254692     1  0.0000      0.999 1.000 0.000
#> GSM254645     1  0.0000      0.999 1.000 0.000
#> GSM254666     1  0.0000      0.999 1.000 0.000
#> GSM254675     1  0.0000      0.999 1.000 0.000
#> GSM254678     1  0.0000      0.999 1.000 0.000
#> GSM254688     1  0.0000      0.999 1.000 0.000
#> GSM254690     1  0.0000      0.999 1.000 0.000
#> GSM254696     1  0.0000      0.999 1.000 0.000
#> GSM254705     1  0.0000      0.999 1.000 0.000
#> GSM254642     1  0.0000      0.999 1.000 0.000
#> GSM254661     1  0.0000      0.999 1.000 0.000
#> GSM254698     1  0.0000      0.999 1.000 0.000
#> GSM254641     1  0.0000      0.999 1.000 0.000
#> GSM254647     1  0.0000      0.999 1.000 0.000
#> GSM254663     1  0.0000      0.999 1.000 0.000
#> GSM254682     1  0.0000      0.999 1.000 0.000
#> GSM254709     1  0.0000      0.999 1.000 0.000
#> GSM254721     1  0.0000      0.999 1.000 0.000
#> GSM254724     1  0.0000      0.999 1.000 0.000
#> GSM254650     1  0.0000      0.999 1.000 0.000
#> GSM254687     1  0.0000      0.999 1.000 0.000
#> GSM254637     1  0.0000      0.999 1.000 0.000
#> GSM254684     1  0.0000      0.999 1.000 0.000
#> GSM254649     2  0.0000      0.992 0.000 1.000
#> GSM254660     2  0.0000      0.992 0.000 1.000
#> GSM254693     2  0.0000      0.992 0.000 1.000
#> GSM254695     2  0.0000      0.992 0.000 1.000
#> GSM254702     2  0.0000      0.992 0.000 1.000
#> GSM254643     2  0.0000      0.992 0.000 1.000
#> GSM254727     2  0.0000      0.992 0.000 1.000
#> GSM254640     2  0.0000      0.992 0.000 1.000
#> GSM254626     2  0.0000      0.992 0.000 1.000
#> GSM254635     2  0.0000      0.992 0.000 1.000
#> GSM254653     2  0.0000      0.992 0.000 1.000
#> GSM254658     2  0.0000      0.992 0.000 1.000
#> GSM254681     2  0.0000      0.992 0.000 1.000
#> GSM254719     2  0.0000      0.992 0.000 1.000
#> GSM254673     2  0.0000      0.992 0.000 1.000
#> GSM254655     2  0.0000      0.992 0.000 1.000
#> GSM254669     2  0.0000      0.992 0.000 1.000
#> GSM254699     2  0.0000      0.992 0.000 1.000
#> GSM254703     2  0.0000      0.992 0.000 1.000
#> GSM254708     2  0.0000      0.992 0.000 1.000
#> GSM254715     2  0.0000      0.992 0.000 1.000
#> GSM254628     2  0.0000      0.992 0.000 1.000
#> GSM254634     2  0.0000      0.992 0.000 1.000
#> GSM254646     2  0.0000      0.992 0.000 1.000
#> GSM254671     2  0.0000      0.992 0.000 1.000
#> GSM254711     2  0.0000      0.992 0.000 1.000
#> GSM254717     2  0.0000      0.992 0.000 1.000
#> GSM254723     2  0.7219      0.752 0.200 0.800
#> GSM254730     2  0.0000      0.992 0.000 1.000
#> GSM254731     2  0.0000      0.992 0.000 1.000
#> GSM254632     2  0.0000      0.992 0.000 1.000
#> GSM254662     2  0.0000      0.992 0.000 1.000
#> GSM254677     2  0.0000      0.992 0.000 1.000
#> GSM254665     2  0.0000      0.992 0.000 1.000
#> GSM254691     2  0.0000      0.992 0.000 1.000
#> GSM254644     2  0.0000      0.992 0.000 1.000
#> GSM254667     2  0.0000      0.992 0.000 1.000
#> GSM254676     2  0.0000      0.992 0.000 1.000
#> GSM254679     2  0.0000      0.992 0.000 1.000
#> GSM254689     2  0.0000      0.992 0.000 1.000
#> GSM254706     2  0.0000      0.992 0.000 1.000
#> GSM254712     2  0.0000      0.992 0.000 1.000
#> GSM254713     2  0.0000      0.992 0.000 1.000
#> GSM254683     2  0.0000      0.992 0.000 1.000
#> GSM254710     2  0.0000      0.992 0.000 1.000
#> GSM254725     2  0.0000      0.992 0.000 1.000
#> GSM254651     2  0.0000      0.992 0.000 1.000
#> GSM254638     2  0.0000      0.992 0.000 1.000
#> GSM254685     2  0.0000      0.992 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
#> GSM254629     3  0.0747      0.710 0.016 0.000 0.984
#> GSM254648     3  0.0848      0.709 0.008 0.008 0.984
#> GSM254694     3  0.5254      0.832 0.264 0.000 0.736
#> GSM254701     3  0.5254      0.832 0.264 0.000 0.736
#> GSM254728     3  0.5254      0.831 0.264 0.000 0.736
#> GSM254726     3  0.0000      0.705 0.000 0.000 1.000
#> GSM254639     3  0.5216      0.833 0.260 0.000 0.740
#> GSM254652     3  0.1031      0.719 0.024 0.000 0.976
#> GSM254700     1  0.0000      0.814 1.000 0.000 0.000
#> GSM254625     1  0.6045      0.624 0.620 0.000 0.380
#> GSM254636     1  0.0424      0.812 0.992 0.000 0.008
#> GSM254659     3  0.5216      0.833 0.260 0.000 0.740
#> GSM254680     1  0.0237      0.814 0.996 0.000 0.004
#> GSM254686     1  0.6299      0.463 0.524 0.000 0.476
#> GSM254718     3  0.5254      0.832 0.264 0.000 0.736
#> GSM254674     1  0.3482      0.785 0.872 0.000 0.128
#> GSM254668     1  0.5138      0.745 0.748 0.000 0.252
#> GSM254697     1  0.0000      0.814 1.000 0.000 0.000
#> GSM254704     1  0.0237      0.812 0.996 0.000 0.004
#> GSM254707     1  0.5216      0.742 0.740 0.000 0.260
#> GSM254714     3  0.6302      0.505 0.480 0.000 0.520
#> GSM254722     1  0.0237      0.814 0.996 0.000 0.004
#> GSM254627     1  0.0000      0.814 1.000 0.000 0.000
#> GSM254630     1  0.5178      0.744 0.744 0.000 0.256
#> GSM254633     1  0.0237      0.812 0.996 0.000 0.004
#> GSM254670     3  0.5835      0.759 0.340 0.000 0.660
#> GSM254716     1  0.6299      0.469 0.524 0.000 0.476
#> GSM254720     1  0.4291      0.555 0.820 0.000 0.180
#> GSM254729     3  0.5216      0.833 0.260 0.000 0.740
#> GSM254654     3  0.5178      0.830 0.256 0.000 0.744
#> GSM254656     3  0.5363      0.822 0.276 0.000 0.724
#> GSM254631     1  0.0000      0.814 1.000 0.000 0.000
#> GSM254657     3  0.5760      0.774 0.328 0.000 0.672
#> GSM254664     1  0.0000      0.814 1.000 0.000 0.000
#> GSM254672     1  0.0237      0.812 0.996 0.000 0.004
#> GSM254692     1  0.5138      0.745 0.748 0.000 0.252
#> GSM254645     1  0.6309     -0.478 0.504 0.000 0.496
#> GSM254666     1  0.6111      0.601 0.604 0.000 0.396
#> GSM254675     1  0.0000      0.814 1.000 0.000 0.000
#> GSM254678     1  0.0424      0.812 0.992 0.000 0.008
#> GSM254688     1  0.5178      0.744 0.744 0.000 0.256
#> GSM254690     1  0.0237      0.814 0.996 0.000 0.004
#> GSM254696     1  0.0424      0.812 0.992 0.000 0.008
#> GSM254705     1  0.5178      0.744 0.744 0.000 0.256
#> GSM254642     1  0.0000      0.814 1.000 0.000 0.000
#> GSM254661     3  0.0592      0.710 0.012 0.000 0.988
#> GSM254698     1  0.0424      0.812 0.992 0.000 0.008
#> GSM254641     1  0.5098      0.746 0.752 0.000 0.248
#> GSM254647     1  0.0000      0.814 1.000 0.000 0.000
#> GSM254663     1  0.5138      0.745 0.748 0.000 0.252
#> GSM254682     1  0.5178      0.744 0.744 0.000 0.256
#> GSM254709     1  0.5138      0.745 0.748 0.000 0.252
#> GSM254721     1  0.0000      0.814 1.000 0.000 0.000
#> GSM254724     1  0.0000      0.814 1.000 0.000 0.000
#> GSM254650     1  0.5138      0.745 0.748 0.000 0.252
#> GSM254687     1  0.5178      0.744 0.744 0.000 0.256
#> GSM254637     1  0.0000      0.814 1.000 0.000 0.000
#> GSM254684     1  0.0424      0.812 0.992 0.000 0.008
#> GSM254649     2  0.0000      0.985 0.000 1.000 0.000
#> GSM254660     2  0.0000      0.985 0.000 1.000 0.000
#> GSM254693     2  0.0000      0.985 0.000 1.000 0.000
#> GSM254695     2  0.0424      0.983 0.000 0.992 0.008
#> GSM254702     2  0.0424      0.983 0.000 0.992 0.008
#> GSM254643     2  0.0000      0.985 0.000 1.000 0.000
#> GSM254727     2  0.0000      0.985 0.000 1.000 0.000
#> GSM254640     2  0.0424      0.983 0.000 0.992 0.008
#> GSM254626     2  0.0000      0.985 0.000 1.000 0.000
#> GSM254635     2  0.0424      0.983 0.000 0.992 0.008
#> GSM254653     2  0.0000      0.985 0.000 1.000 0.000
#> GSM254658     2  0.0000      0.985 0.000 1.000 0.000
#> GSM254681     2  0.0000      0.985 0.000 1.000 0.000
#> GSM254719     2  0.0000      0.985 0.000 1.000 0.000
#> GSM254673     2  0.0000      0.985 0.000 1.000 0.000
#> GSM254655     2  0.0000      0.985 0.000 1.000 0.000
#> GSM254669     2  0.0000      0.985 0.000 1.000 0.000
#> GSM254699     2  0.0000      0.985 0.000 1.000 0.000
#> GSM254703     2  0.0424      0.983 0.000 0.992 0.008
#> GSM254708     2  0.0000      0.985 0.000 1.000 0.000
#> GSM254715     2  0.0424      0.983 0.000 0.992 0.008
#> GSM254628     2  0.0000      0.985 0.000 1.000 0.000
#> GSM254634     2  0.0424      0.983 0.000 0.992 0.008
#> GSM254646     2  0.0000      0.985 0.000 1.000 0.000
#> GSM254671     2  0.0424      0.983 0.000 0.992 0.008
#> GSM254711     2  0.0424      0.983 0.000 0.992 0.008
#> GSM254717     2  0.0000      0.985 0.000 1.000 0.000
#> GSM254723     3  0.5138      0.603 0.000 0.252 0.748
#> GSM254730     2  0.0000      0.985 0.000 1.000 0.000
#> GSM254731     2  0.0424      0.983 0.000 0.992 0.008
#> GSM254632     2  0.6143      0.631 0.024 0.720 0.256
#> GSM254662     2  0.0000      0.985 0.000 1.000 0.000
#> GSM254677     2  0.0424      0.983 0.000 0.992 0.008
#> GSM254665     2  0.0000      0.985 0.000 1.000 0.000
#> GSM254691     2  0.0000      0.985 0.000 1.000 0.000
#> GSM254644     2  0.0424      0.983 0.000 0.992 0.008
#> GSM254667     2  0.0000      0.985 0.000 1.000 0.000
#> GSM254676     2  0.0000      0.985 0.000 1.000 0.000
#> GSM254679     2  0.0424      0.983 0.000 0.992 0.008
#> GSM254689     2  0.0000      0.985 0.000 1.000 0.000
#> GSM254706     2  0.0000      0.985 0.000 1.000 0.000
#> GSM254712     2  0.0424      0.983 0.000 0.992 0.008
#> GSM254713     2  0.0424      0.983 0.000 0.992 0.008
#> GSM254683     2  0.0000      0.985 0.000 1.000 0.000
#> GSM254710     2  0.5365      0.667 0.004 0.744 0.252
#> GSM254725     2  0.0424      0.983 0.000 0.992 0.008
#> GSM254651     2  0.0000      0.985 0.000 1.000 0.000
#> GSM254638     2  0.0424      0.983 0.000 0.992 0.008
#> GSM254685     2  0.0424      0.983 0.000 0.992 0.008

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM254629     3  0.3402     0.8003 0.004 0.164 0.832 0.000
#> GSM254648     3  0.3444     0.7981 0.000 0.184 0.816 0.000
#> GSM254694     3  0.5527     0.8308 0.104 0.168 0.728 0.000
#> GSM254701     3  0.5527     0.8308 0.104 0.168 0.728 0.000
#> GSM254728     3  0.2987     0.8374 0.104 0.016 0.880 0.000
#> GSM254726     3  0.3494     0.8009 0.000 0.172 0.824 0.004
#> GSM254639     3  0.2867     0.8383 0.104 0.012 0.884 0.000
#> GSM254652     3  0.0336     0.8091 0.008 0.000 0.992 0.000
#> GSM254700     1  0.0000     0.8277 1.000 0.000 0.000 0.000
#> GSM254625     1  0.7281     0.6165 0.532 0.196 0.272 0.000
#> GSM254636     1  0.2342     0.8068 0.912 0.008 0.080 0.000
#> GSM254659     3  0.2867     0.8415 0.104 0.012 0.884 0.000
#> GSM254680     1  0.1975     0.8268 0.936 0.016 0.048 0.000
#> GSM254686     1  0.7145     0.5576 0.508 0.144 0.348 0.000
#> GSM254718     3  0.4669     0.8416 0.104 0.100 0.796 0.000
#> GSM254674     1  0.3307     0.8191 0.868 0.028 0.104 0.000
#> GSM254668     1  0.6037     0.7566 0.688 0.156 0.156 0.000
#> GSM254697     1  0.0000     0.8277 1.000 0.000 0.000 0.000
#> GSM254704     1  0.0657     0.8215 0.984 0.004 0.012 0.000
#> GSM254707     1  0.6162     0.7512 0.676 0.156 0.168 0.000
#> GSM254714     3  0.5300     0.5493 0.408 0.012 0.580 0.000
#> GSM254722     1  0.0804     0.8264 0.980 0.012 0.008 0.000
#> GSM254627     1  0.0000     0.8277 1.000 0.000 0.000 0.000
#> GSM254630     1  0.6570     0.7135 0.632 0.164 0.204 0.000
#> GSM254633     1  0.2053     0.8155 0.924 0.004 0.072 0.000
#> GSM254670     3  0.4993     0.7146 0.260 0.028 0.712 0.000
#> GSM254716     1  0.7453     0.5618 0.496 0.204 0.300 0.000
#> GSM254720     1  0.4088     0.4929 0.764 0.004 0.232 0.000
#> GSM254729     3  0.3392     0.8389 0.124 0.020 0.856 0.000
#> GSM254654     3  0.5527     0.8308 0.104 0.168 0.728 0.000
#> GSM254656     3  0.7346     0.5601 0.068 0.060 0.592 0.280
#> GSM254631     1  0.0657     0.8289 0.984 0.004 0.012 0.000
#> GSM254657     3  0.4149     0.8013 0.168 0.028 0.804 0.000
#> GSM254664     1  0.0524     0.8288 0.988 0.004 0.008 0.000
#> GSM254672     1  0.0779     0.8201 0.980 0.004 0.016 0.000
#> GSM254692     1  0.5351     0.7675 0.744 0.152 0.104 0.000
#> GSM254645     3  0.5269     0.5819 0.364 0.016 0.620 0.000
#> GSM254666     1  0.7203     0.6202 0.536 0.176 0.288 0.000
#> GSM254675     1  0.0336     0.8290 0.992 0.008 0.000 0.000
#> GSM254678     1  0.1356     0.8211 0.960 0.008 0.032 0.000
#> GSM254688     1  0.6080     0.7554 0.684 0.160 0.156 0.000
#> GSM254690     1  0.1938     0.8203 0.936 0.012 0.052 0.000
#> GSM254696     1  0.3443     0.7612 0.848 0.016 0.136 0.000
#> GSM254705     1  0.5462     0.7677 0.736 0.152 0.112 0.000
#> GSM254642     1  0.0188     0.8287 0.996 0.000 0.004 0.000
#> GSM254661     3  0.0707     0.8031 0.000 0.020 0.980 0.000
#> GSM254698     1  0.1488     0.8170 0.956 0.012 0.032 0.000
#> GSM254641     1  0.4565     0.7985 0.796 0.064 0.140 0.000
#> GSM254647     1  0.0000     0.8277 1.000 0.000 0.000 0.000
#> GSM254663     1  0.5257     0.7712 0.752 0.144 0.104 0.000
#> GSM254682     1  0.6080     0.7554 0.684 0.160 0.156 0.000
#> GSM254709     1  0.5351     0.7675 0.744 0.152 0.104 0.000
#> GSM254721     1  0.0000     0.8277 1.000 0.000 0.000 0.000
#> GSM254724     1  0.0000     0.8277 1.000 0.000 0.000 0.000
#> GSM254650     1  0.5351     0.7675 0.744 0.152 0.104 0.000
#> GSM254687     1  0.5452     0.7669 0.736 0.156 0.108 0.000
#> GSM254637     1  0.0524     0.8288 0.988 0.004 0.008 0.000
#> GSM254684     1  0.2861     0.7924 0.888 0.016 0.096 0.000
#> GSM254649     2  0.4830     0.9438 0.000 0.608 0.000 0.392
#> GSM254660     4  0.4250     0.2071 0.000 0.276 0.000 0.724
#> GSM254693     2  0.4843     0.9428 0.000 0.604 0.000 0.396
#> GSM254695     4  0.0817     0.8339 0.000 0.024 0.000 0.976
#> GSM254702     4  0.0336     0.8502 0.000 0.008 0.000 0.992
#> GSM254643     2  0.4866     0.9375 0.000 0.596 0.000 0.404
#> GSM254727     2  0.4830     0.9438 0.000 0.608 0.000 0.392
#> GSM254640     4  0.0592     0.8414 0.000 0.016 0.000 0.984
#> GSM254626     2  0.4866     0.9375 0.000 0.596 0.000 0.404
#> GSM254635     4  0.0000     0.8544 0.000 0.000 0.000 1.000
#> GSM254653     2  0.4843     0.9428 0.000 0.604 0.000 0.396
#> GSM254658     2  0.4830     0.9438 0.000 0.608 0.000 0.392
#> GSM254681     2  0.4830     0.9438 0.000 0.608 0.000 0.392
#> GSM254719     2  0.4866     0.9375 0.000 0.596 0.000 0.404
#> GSM254673     2  0.4866     0.9375 0.000 0.596 0.000 0.404
#> GSM254655     4  0.4477     0.0338 0.000 0.312 0.000 0.688
#> GSM254669     2  0.4855     0.9408 0.000 0.600 0.000 0.400
#> GSM254699     4  0.4761    -0.2793 0.000 0.372 0.000 0.628
#> GSM254703     4  0.0000     0.8544 0.000 0.000 0.000 1.000
#> GSM254708     2  0.4830     0.9438 0.000 0.608 0.000 0.392
#> GSM254715     4  0.0000     0.8544 0.000 0.000 0.000 1.000
#> GSM254628     2  0.4830     0.9438 0.000 0.608 0.000 0.392
#> GSM254634     4  0.0000     0.8544 0.000 0.000 0.000 1.000
#> GSM254646     2  0.4830     0.9438 0.000 0.608 0.000 0.392
#> GSM254671     4  0.0336     0.8502 0.000 0.008 0.000 0.992
#> GSM254711     4  0.0000     0.8544 0.000 0.000 0.000 1.000
#> GSM254717     2  0.4830     0.9438 0.000 0.608 0.000 0.392
#> GSM254723     4  0.7203    -0.0702 0.004 0.136 0.336 0.524
#> GSM254730     4  0.4624    -0.1197 0.000 0.340 0.000 0.660
#> GSM254731     4  0.0336     0.8502 0.000 0.008 0.000 0.992
#> GSM254632     2  0.5633     0.3947 0.008 0.740 0.108 0.144
#> GSM254662     2  0.4866     0.9375 0.000 0.596 0.000 0.404
#> GSM254677     4  0.0469     0.8438 0.000 0.012 0.000 0.988
#> GSM254665     2  0.4866     0.9375 0.000 0.596 0.000 0.404
#> GSM254691     2  0.4855     0.9408 0.000 0.600 0.000 0.400
#> GSM254644     4  0.0336     0.8502 0.000 0.008 0.000 0.992
#> GSM254667     2  0.4790     0.9296 0.000 0.620 0.000 0.380
#> GSM254676     2  0.4855     0.9408 0.000 0.600 0.000 0.400
#> GSM254679     4  0.0000     0.8544 0.000 0.000 0.000 1.000
#> GSM254689     2  0.4830     0.9438 0.000 0.608 0.000 0.392
#> GSM254706     2  0.4790     0.9296 0.000 0.620 0.000 0.380
#> GSM254712     4  0.0000     0.8544 0.000 0.000 0.000 1.000
#> GSM254713     4  0.0000     0.8544 0.000 0.000 0.000 1.000
#> GSM254683     2  0.4830     0.9438 0.000 0.608 0.000 0.392
#> GSM254710     2  0.5421     0.5172 0.000 0.724 0.076 0.200
#> GSM254725     4  0.0336     0.8477 0.000 0.008 0.000 0.992
#> GSM254651     2  0.4830     0.9438 0.000 0.608 0.000 0.392
#> GSM254638     4  0.0000     0.8544 0.000 0.000 0.000 1.000
#> GSM254685     4  0.0000     0.8544 0.000 0.000 0.000 1.000

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM254629     3  0.0486     0.7989 0.004 0.000 0.988 0.004 0.004
#> GSM254648     3  0.0324     0.7967 0.000 0.004 0.992 0.004 0.000
#> GSM254694     3  0.0324     0.7979 0.004 0.000 0.992 0.004 0.000
#> GSM254701     3  0.0324     0.7979 0.004 0.000 0.992 0.004 0.000
#> GSM254728     3  0.5804     0.7669 0.056 0.000 0.648 0.048 0.248
#> GSM254726     3  0.0898     0.7967 0.000 0.000 0.972 0.008 0.020
#> GSM254639     3  0.7330     0.6809 0.180 0.000 0.520 0.076 0.224
#> GSM254652     3  0.5535     0.7666 0.024 0.000 0.656 0.064 0.256
#> GSM254700     1  0.2497     0.7605 0.880 0.000 0.004 0.004 0.112
#> GSM254625     5  0.1331     0.7489 0.040 0.000 0.000 0.008 0.952
#> GSM254636     1  0.3569     0.7028 0.816 0.000 0.004 0.028 0.152
#> GSM254659     3  0.4993     0.7842 0.048 0.000 0.708 0.020 0.224
#> GSM254680     1  0.4507     0.4143 0.580 0.000 0.004 0.004 0.412
#> GSM254686     5  0.2701     0.7253 0.048 0.000 0.044 0.012 0.896
#> GSM254718     3  0.3830     0.8041 0.040 0.000 0.820 0.016 0.124
#> GSM254674     1  0.4704     0.2125 0.508 0.000 0.004 0.008 0.480
#> GSM254668     5  0.2732     0.7909 0.160 0.000 0.000 0.000 0.840
#> GSM254697     1  0.2513     0.7586 0.876 0.000 0.008 0.000 0.116
#> GSM254704     1  0.1412     0.7689 0.952 0.000 0.008 0.004 0.036
#> GSM254707     5  0.2648     0.7933 0.152 0.000 0.000 0.000 0.848
#> GSM254714     1  0.4822     0.1990 0.564 0.000 0.416 0.004 0.016
#> GSM254722     1  0.0992     0.7657 0.968 0.000 0.000 0.008 0.024
#> GSM254627     1  0.2230     0.7601 0.884 0.000 0.000 0.000 0.116
#> GSM254630     5  0.3487     0.7790 0.212 0.000 0.000 0.008 0.780
#> GSM254633     1  0.3554     0.7226 0.776 0.000 0.004 0.004 0.216
#> GSM254670     1  0.7008     0.2722 0.556 0.000 0.128 0.076 0.240
#> GSM254716     5  0.1329     0.7359 0.032 0.000 0.004 0.008 0.956
#> GSM254720     1  0.1630     0.7627 0.944 0.000 0.036 0.004 0.016
#> GSM254729     3  0.7240     0.6498 0.212 0.000 0.524 0.064 0.200
#> GSM254654     3  0.0324     0.7979 0.004 0.000 0.992 0.004 0.000
#> GSM254656     4  0.7387    -0.0960 0.184 0.000 0.100 0.532 0.184
#> GSM254631     1  0.3243     0.7522 0.812 0.000 0.004 0.004 0.180
#> GSM254657     3  0.7847     0.5042 0.280 0.000 0.400 0.076 0.244
#> GSM254664     1  0.3706     0.7147 0.756 0.000 0.004 0.004 0.236
#> GSM254672     1  0.0451     0.7606 0.988 0.000 0.008 0.004 0.000
#> GSM254692     5  0.3837     0.7467 0.308 0.000 0.000 0.000 0.692
#> GSM254645     1  0.5791     0.5136 0.700 0.000 0.112 0.068 0.120
#> GSM254666     5  0.1739     0.7197 0.032 0.000 0.004 0.024 0.940
#> GSM254675     1  0.2976     0.7510 0.852 0.000 0.012 0.004 0.132
#> GSM254678     1  0.0912     0.7588 0.972 0.000 0.000 0.016 0.012
#> GSM254688     5  0.2690     0.7940 0.156 0.000 0.000 0.000 0.844
#> GSM254690     1  0.3689     0.7135 0.740 0.000 0.000 0.004 0.256
#> GSM254696     1  0.4468     0.6243 0.728 0.000 0.004 0.040 0.228
#> GSM254705     5  0.3774     0.7582 0.296 0.000 0.000 0.000 0.704
#> GSM254642     1  0.2605     0.7363 0.852 0.000 0.000 0.000 0.148
#> GSM254661     3  0.4709     0.7856 0.004 0.000 0.716 0.056 0.224
#> GSM254698     1  0.2157     0.7361 0.920 0.000 0.004 0.040 0.036
#> GSM254641     5  0.4333     0.4988 0.352 0.000 0.004 0.004 0.640
#> GSM254647     1  0.2377     0.7540 0.872 0.000 0.000 0.000 0.128
#> GSM254663     5  0.3774     0.7568 0.296 0.000 0.000 0.000 0.704
#> GSM254682     5  0.2690     0.7961 0.156 0.000 0.000 0.000 0.844
#> GSM254709     5  0.3707     0.7672 0.284 0.000 0.000 0.000 0.716
#> GSM254721     1  0.2672     0.7576 0.872 0.000 0.008 0.004 0.116
#> GSM254724     1  0.2621     0.7592 0.876 0.000 0.008 0.004 0.112
#> GSM254650     5  0.3661     0.7723 0.276 0.000 0.000 0.000 0.724
#> GSM254687     5  0.3612     0.7759 0.268 0.000 0.000 0.000 0.732
#> GSM254637     1  0.3205     0.7543 0.816 0.000 0.004 0.004 0.176
#> GSM254684     1  0.4077     0.6721 0.780 0.000 0.004 0.044 0.172
#> GSM254649     2  0.0162     0.8790 0.000 0.996 0.000 0.000 0.004
#> GSM254660     2  0.4060     0.2632 0.000 0.640 0.000 0.360 0.000
#> GSM254693     2  0.0609     0.8781 0.000 0.980 0.000 0.020 0.000
#> GSM254695     4  0.2230     0.7567 0.000 0.116 0.000 0.884 0.000
#> GSM254702     4  0.3684     0.8510 0.000 0.280 0.000 0.720 0.000
#> GSM254643     2  0.1341     0.8644 0.000 0.944 0.000 0.056 0.000
#> GSM254727     2  0.0000     0.8790 0.000 1.000 0.000 0.000 0.000
#> GSM254640     4  0.3913     0.8073 0.000 0.324 0.000 0.676 0.000
#> GSM254626     2  0.1043     0.8734 0.000 0.960 0.000 0.040 0.000
#> GSM254635     4  0.3395     0.8809 0.000 0.236 0.000 0.764 0.000
#> GSM254653     2  0.0510     0.8781 0.000 0.984 0.000 0.016 0.000
#> GSM254658     2  0.0162     0.8790 0.000 0.996 0.000 0.000 0.004
#> GSM254681     2  0.0324     0.8774 0.000 0.992 0.000 0.004 0.004
#> GSM254719     2  0.1270     0.8670 0.000 0.948 0.000 0.052 0.000
#> GSM254673     2  0.1043     0.8734 0.000 0.960 0.000 0.040 0.000
#> GSM254655     2  0.3932     0.3727 0.000 0.672 0.000 0.328 0.000
#> GSM254669     2  0.0963     0.8745 0.000 0.964 0.000 0.036 0.000
#> GSM254699     2  0.3480     0.5754 0.000 0.752 0.000 0.248 0.000
#> GSM254703     4  0.3452     0.8804 0.000 0.244 0.000 0.756 0.000
#> GSM254708     2  0.0703     0.8736 0.000 0.976 0.000 0.024 0.000
#> GSM254715     4  0.3395     0.8809 0.000 0.236 0.000 0.764 0.000
#> GSM254628     2  0.0162     0.8790 0.000 0.996 0.000 0.000 0.004
#> GSM254634     4  0.3274     0.8754 0.000 0.220 0.000 0.780 0.000
#> GSM254646     2  0.0162     0.8790 0.000 0.996 0.000 0.000 0.004
#> GSM254671     4  0.3661     0.8549 0.000 0.276 0.000 0.724 0.000
#> GSM254711     4  0.3452     0.8790 0.000 0.244 0.000 0.756 0.000
#> GSM254717     2  0.0162     0.8785 0.000 0.996 0.000 0.004 0.000
#> GSM254723     4  0.6147     0.0873 0.000 0.004 0.328 0.536 0.132
#> GSM254730     2  0.3730     0.4538 0.000 0.712 0.000 0.288 0.000
#> GSM254731     4  0.3684     0.8510 0.000 0.280 0.000 0.720 0.000
#> GSM254632     5  0.6385     0.3701 0.000 0.260 0.012 0.168 0.560
#> GSM254662     2  0.1043     0.8734 0.000 0.960 0.000 0.040 0.000
#> GSM254677     4  0.3109     0.8497 0.000 0.200 0.000 0.800 0.000
#> GSM254665     2  0.1478     0.8584 0.000 0.936 0.000 0.064 0.000
#> GSM254691     2  0.1341     0.8653 0.000 0.944 0.000 0.056 0.000
#> GSM254644     4  0.3774     0.8460 0.000 0.296 0.000 0.704 0.000
#> GSM254667     2  0.2753     0.7609 0.000 0.856 0.000 0.136 0.008
#> GSM254676     2  0.1270     0.8680 0.000 0.948 0.000 0.052 0.000
#> GSM254679     4  0.3424     0.8780 0.000 0.240 0.000 0.760 0.000
#> GSM254689     2  0.0162     0.8790 0.000 0.996 0.000 0.000 0.004
#> GSM254706     2  0.2563     0.7786 0.000 0.872 0.000 0.120 0.008
#> GSM254712     4  0.3395     0.8809 0.000 0.236 0.000 0.764 0.000
#> GSM254713     4  0.3395     0.8809 0.000 0.236 0.000 0.764 0.000
#> GSM254683     2  0.1251     0.8567 0.000 0.956 0.000 0.036 0.008
#> GSM254710     2  0.6186     0.2186 0.000 0.512 0.000 0.152 0.336
#> GSM254725     4  0.2891     0.8392 0.000 0.176 0.000 0.824 0.000
#> GSM254651     2  0.1894     0.8265 0.000 0.920 0.000 0.072 0.008
#> GSM254638     4  0.3366     0.8808 0.000 0.232 0.000 0.768 0.000
#> GSM254685     4  0.3424     0.8797 0.000 0.240 0.000 0.760 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
#> GSM254629     3  0.0862     0.8125 0.004 0.000 0.972 0.000 0.016 0.008
#> GSM254648     3  0.0291     0.8135 0.004 0.000 0.992 0.000 0.000 0.004
#> GSM254694     3  0.0665     0.8137 0.008 0.000 0.980 0.000 0.004 0.008
#> GSM254701     3  0.0551     0.8144 0.004 0.000 0.984 0.000 0.008 0.004
#> GSM254728     6  0.5699    -0.0232 0.008 0.012 0.400 0.000 0.088 0.492
#> GSM254726     3  0.2515     0.7765 0.000 0.016 0.892 0.000 0.040 0.052
#> GSM254639     6  0.4232     0.5749 0.044 0.000 0.132 0.000 0.052 0.772
#> GSM254652     6  0.6215    -0.0633 0.000 0.016 0.392 0.000 0.188 0.404
#> GSM254700     1  0.0547     0.7830 0.980 0.000 0.000 0.000 0.020 0.000
#> GSM254625     5  0.1801     0.6993 0.012 0.012 0.004 0.000 0.932 0.040
#> GSM254636     6  0.6346     0.2567 0.336 0.016 0.004 0.000 0.200 0.444
#> GSM254659     3  0.6100     0.3597 0.016 0.016 0.556 0.000 0.148 0.264
#> GSM254680     5  0.5468     0.2066 0.368 0.016 0.008 0.000 0.544 0.064
#> GSM254686     5  0.4432     0.6744 0.072 0.016 0.036 0.000 0.780 0.096
#> GSM254718     3  0.5065     0.5701 0.036 0.004 0.668 0.000 0.052 0.240
#> GSM254674     5  0.5158     0.4984 0.256 0.016 0.008 0.000 0.648 0.072
#> GSM254668     5  0.2757     0.7306 0.084 0.012 0.008 0.000 0.876 0.020
#> GSM254697     1  0.1418     0.7820 0.944 0.000 0.000 0.000 0.032 0.024
#> GSM254704     1  0.0363     0.7751 0.988 0.000 0.000 0.000 0.000 0.012
#> GSM254707     5  0.1982     0.7345 0.068 0.000 0.004 0.000 0.912 0.016
#> GSM254714     1  0.3485     0.5820 0.784 0.000 0.184 0.000 0.004 0.028
#> GSM254722     1  0.2581     0.7107 0.856 0.000 0.000 0.000 0.016 0.128
#> GSM254627     1  0.1408     0.7823 0.944 0.000 0.000 0.000 0.036 0.020
#> GSM254630     5  0.4855     0.6687 0.256 0.000 0.000 0.000 0.640 0.104
#> GSM254633     1  0.5870     0.4497 0.576 0.016 0.016 0.000 0.280 0.112
#> GSM254670     6  0.3878     0.6359 0.108 0.000 0.028 0.000 0.064 0.800
#> GSM254716     5  0.2983     0.6585 0.012 0.012 0.004 0.000 0.844 0.128
#> GSM254720     1  0.0935     0.7679 0.964 0.000 0.004 0.000 0.000 0.032
#> GSM254729     6  0.5459     0.5255 0.032 0.004 0.200 0.000 0.112 0.652
#> GSM254654     3  0.0291     0.8135 0.004 0.000 0.992 0.000 0.000 0.004
#> GSM254656     6  0.3863     0.4835 0.020 0.028 0.000 0.144 0.012 0.796
#> GSM254631     1  0.5072     0.5696 0.652 0.012 0.008 0.000 0.256 0.072
#> GSM254657     6  0.4327     0.6080 0.076 0.000 0.088 0.000 0.060 0.776
#> GSM254664     1  0.4992     0.5699 0.656 0.012 0.008 0.000 0.260 0.064
#> GSM254672     1  0.1556     0.7364 0.920 0.000 0.000 0.000 0.000 0.080
#> GSM254692     5  0.3992     0.6091 0.364 0.000 0.000 0.000 0.624 0.012
#> GSM254645     6  0.4551     0.5509 0.268 0.000 0.020 0.000 0.036 0.676
#> GSM254666     5  0.3627     0.6158 0.020 0.000 0.004 0.000 0.752 0.224
#> GSM254675     1  0.1049     0.7844 0.960 0.000 0.000 0.000 0.032 0.008
#> GSM254678     1  0.3778     0.4846 0.708 0.000 0.000 0.000 0.020 0.272
#> GSM254688     5  0.2432     0.7485 0.100 0.000 0.000 0.000 0.876 0.024
#> GSM254690     1  0.5445     0.5071 0.584 0.012 0.000 0.000 0.288 0.116
#> GSM254696     6  0.5536     0.5185 0.248 0.012 0.000 0.000 0.148 0.592
#> GSM254705     5  0.3990     0.6882 0.284 0.000 0.000 0.000 0.688 0.028
#> GSM254642     1  0.1845     0.7714 0.920 0.000 0.000 0.000 0.052 0.028
#> GSM254661     3  0.4736     0.3707 0.000 0.000 0.588 0.000 0.060 0.352
#> GSM254698     1  0.4177    -0.0158 0.520 0.000 0.000 0.000 0.012 0.468
#> GSM254641     5  0.4743     0.5783 0.260 0.012 0.012 0.000 0.676 0.040
#> GSM254647     1  0.1983     0.7649 0.908 0.000 0.000 0.000 0.072 0.020
#> GSM254663     5  0.3871     0.6750 0.308 0.000 0.000 0.000 0.676 0.016
#> GSM254682     5  0.2784     0.7533 0.124 0.000 0.000 0.000 0.848 0.028
#> GSM254709     5  0.3692     0.7239 0.244 0.000 0.008 0.000 0.736 0.012
#> GSM254721     1  0.0891     0.7807 0.968 0.000 0.000 0.000 0.024 0.008
#> GSM254724     1  0.0692     0.7821 0.976 0.000 0.000 0.000 0.020 0.004
#> GSM254650     5  0.3240     0.7274 0.244 0.000 0.000 0.000 0.752 0.004
#> GSM254687     5  0.3189     0.7312 0.236 0.000 0.000 0.000 0.760 0.004
#> GSM254637     1  0.4838     0.6028 0.688 0.012 0.008 0.000 0.224 0.068
#> GSM254684     6  0.5303     0.4365 0.312 0.004 0.000 0.000 0.112 0.572
#> GSM254649     2  0.2738     0.8846 0.000 0.820 0.000 0.176 0.000 0.004
#> GSM254660     4  0.4568     0.2318 0.000 0.344 0.004 0.612 0.000 0.040
#> GSM254693     2  0.2805     0.8850 0.000 0.812 0.004 0.184 0.000 0.000
#> GSM254695     4  0.3816     0.6509 0.000 0.160 0.000 0.784 0.024 0.032
#> GSM254702     4  0.2670     0.7765 0.000 0.084 0.004 0.872 0.000 0.040
#> GSM254643     2  0.3627     0.8685 0.000 0.752 0.004 0.224 0.000 0.020
#> GSM254727     2  0.3630     0.8781 0.000 0.780 0.004 0.176 0.000 0.040
#> GSM254640     4  0.2257     0.7797 0.000 0.116 0.000 0.876 0.000 0.008
#> GSM254626     2  0.3488     0.8727 0.000 0.764 0.004 0.216 0.000 0.016
#> GSM254635     4  0.0000     0.8319 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM254653     2  0.3695     0.8757 0.000 0.772 0.004 0.184 0.000 0.040
#> GSM254658     2  0.2738     0.8846 0.000 0.820 0.000 0.176 0.000 0.004
#> GSM254681     2  0.3343     0.8791 0.004 0.796 0.000 0.176 0.000 0.024
#> GSM254719     2  0.3960     0.8579 0.000 0.736 0.004 0.220 0.000 0.040
#> GSM254673     2  0.3933     0.8612 0.000 0.740 0.004 0.216 0.000 0.040
#> GSM254655     4  0.4746    -0.0971 0.000 0.424 0.004 0.532 0.000 0.040
#> GSM254669     2  0.3867     0.8636 0.000 0.744 0.004 0.216 0.000 0.036
#> GSM254699     2  0.4751     0.4247 0.000 0.528 0.004 0.428 0.000 0.040
#> GSM254703     4  0.0547     0.8315 0.000 0.020 0.000 0.980 0.000 0.000
#> GSM254708     2  0.2668     0.8812 0.000 0.828 0.000 0.168 0.000 0.004
#> GSM254715     4  0.0363     0.8319 0.000 0.012 0.000 0.988 0.000 0.000
#> GSM254628     2  0.2738     0.8846 0.000 0.820 0.000 0.176 0.000 0.004
#> GSM254634     4  0.0458     0.8288 0.000 0.016 0.000 0.984 0.000 0.000
#> GSM254646     2  0.3087     0.8825 0.004 0.808 0.000 0.176 0.000 0.012
#> GSM254671     4  0.2563     0.7829 0.000 0.076 0.004 0.880 0.000 0.040
#> GSM254711     4  0.0363     0.8313 0.000 0.012 0.000 0.988 0.000 0.000
#> GSM254717     2  0.3630     0.8781 0.000 0.780 0.004 0.176 0.000 0.040
#> GSM254723     4  0.7940    -0.2448 0.012 0.036 0.308 0.348 0.068 0.228
#> GSM254730     4  0.4780    -0.2508 0.000 0.476 0.004 0.480 0.000 0.040
#> GSM254731     4  0.2670     0.7765 0.000 0.084 0.004 0.872 0.000 0.040
#> GSM254632     5  0.6046     0.3560 0.004 0.272 0.020 0.008 0.564 0.132
#> GSM254662     2  0.3933     0.8612 0.000 0.740 0.004 0.216 0.000 0.040
#> GSM254677     4  0.1075     0.8105 0.000 0.048 0.000 0.952 0.000 0.000
#> GSM254665     2  0.3384     0.8741 0.004 0.760 0.000 0.228 0.000 0.008
#> GSM254691     2  0.3301     0.8703 0.004 0.772 0.000 0.216 0.000 0.008
#> GSM254644     4  0.2313     0.7900 0.000 0.100 0.004 0.884 0.000 0.012
#> GSM254667     2  0.3087     0.7118 0.004 0.864 0.000 0.052 0.024 0.056
#> GSM254676     2  0.3273     0.8737 0.004 0.776 0.000 0.212 0.000 0.008
#> GSM254679     4  0.0363     0.8310 0.000 0.012 0.000 0.988 0.000 0.000
#> GSM254689     2  0.3343     0.8791 0.004 0.796 0.000 0.176 0.000 0.024
#> GSM254706     2  0.3001     0.7391 0.004 0.868 0.000 0.060 0.020 0.048
#> GSM254712     4  0.0146     0.8322 0.000 0.004 0.000 0.996 0.000 0.000
#> GSM254713     4  0.0146     0.8322 0.000 0.004 0.000 0.996 0.000 0.000
#> GSM254683     2  0.3493     0.8535 0.004 0.808 0.000 0.148 0.008 0.032
#> GSM254710     2  0.5497     0.1549 0.004 0.584 0.004 0.004 0.292 0.112
#> GSM254725     4  0.1387     0.7939 0.000 0.068 0.000 0.932 0.000 0.000
#> GSM254651     2  0.3380     0.7885 0.004 0.836 0.000 0.100 0.016 0.044
#> GSM254638     4  0.0000     0.8319 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM254685     4  0.0508     0.8312 0.000 0.012 0.000 0.984 0.000 0.004

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

consensus_heatmap(res, k = 2)

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

consensus_heatmap(res, k = 3)

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

consensus_heatmap(res, k = 4)

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

consensus_heatmap(res, k = 5)

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

consensus_heatmap(res, k = 6)

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

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

membership_heatmap(res, k = 2)

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

membership_heatmap(res, k = 3)

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

membership_heatmap(res, k = 4)

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

membership_heatmap(res, k = 5)

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

membership_heatmap(res, k = 6)

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

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

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

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

get_signatures(res, k = 3)

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

get_signatures(res, k = 4)

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

get_signatures(res, k = 5)

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

get_signatures(res, k = 6)

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

Signature heatmaps where rows are not scaled:

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

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

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

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

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

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

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

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

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

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

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk CV-skmeans-signature_compare

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

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

An example of the output of tb is:

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

The columns in tb are:

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

UMAP plot which shows how samples are separated.

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

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

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

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

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

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

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

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

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

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

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk CV-skmeans-collect-classes

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

test_to_known_factors(res)
#>              n tissue(p) individual(p) disease.state(p) gender(p) other(p) k
#> CV:skmeans 107  2.35e-23       0.55450            0.665   0.61079    0.958 2
#> CV:skmeans 104  1.74e-22       0.00150            0.683   0.00907    0.947 3
#> CV:skmeans 100  1.55e-21       0.01832            0.790   0.03269    0.975 4
#> CV:skmeans  95  1.14e-19       0.00388            0.805   0.01162    0.963 5
#> CV:skmeans  88  1.77e-17       0.00815            0.708   0.04898    0.942 6

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


CV:pam*

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

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

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

res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#>   On a matrix with 21168 rows and 107 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 1.000           0.991       0.996         0.4986 0.503   0.503
#> 3 3 0.919           0.932       0.967         0.2717 0.860   0.723
#> 4 4 0.783           0.859       0.917         0.1450 0.891   0.711
#> 5 5 0.770           0.785       0.887         0.0371 0.977   0.919
#> 6 6 0.685           0.486       0.724         0.0563 0.934   0.755

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

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

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

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

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

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>           class entropy silhouette    p1    p2
#> GSM254629     1   0.000      0.992 1.000 0.000
#> GSM254648     1   0.808      0.676 0.752 0.248
#> GSM254694     1   0.000      0.992 1.000 0.000
#> GSM254701     1   0.000      0.992 1.000 0.000
#> GSM254728     1   0.000      0.992 1.000 0.000
#> GSM254726     1   0.000      0.992 1.000 0.000
#> GSM254639     1   0.000      0.992 1.000 0.000
#> GSM254652     1   0.000      0.992 1.000 0.000
#> GSM254700     1   0.000      0.992 1.000 0.000
#> GSM254625     1   0.000      0.992 1.000 0.000
#> GSM254636     1   0.000      0.992 1.000 0.000
#> GSM254659     1   0.000      0.992 1.000 0.000
#> GSM254680     1   0.000      0.992 1.000 0.000
#> GSM254686     1   0.000      0.992 1.000 0.000
#> GSM254718     1   0.000      0.992 1.000 0.000
#> GSM254674     1   0.000      0.992 1.000 0.000
#> GSM254668     1   0.000      0.992 1.000 0.000
#> GSM254697     1   0.000      0.992 1.000 0.000
#> GSM254704     1   0.000      0.992 1.000 0.000
#> GSM254707     1   0.000      0.992 1.000 0.000
#> GSM254714     1   0.000      0.992 1.000 0.000
#> GSM254722     1   0.000      0.992 1.000 0.000
#> GSM254627     1   0.000      0.992 1.000 0.000
#> GSM254630     1   0.000      0.992 1.000 0.000
#> GSM254633     1   0.000      0.992 1.000 0.000
#> GSM254670     1   0.000      0.992 1.000 0.000
#> GSM254716     1   0.000      0.992 1.000 0.000
#> GSM254720     1   0.000      0.992 1.000 0.000
#> GSM254729     1   0.000      0.992 1.000 0.000
#> GSM254654     1   0.000      0.992 1.000 0.000
#> GSM254656     1   0.000      0.992 1.000 0.000
#> GSM254631     1   0.000      0.992 1.000 0.000
#> GSM254657     1   0.000      0.992 1.000 0.000
#> GSM254664     1   0.000      0.992 1.000 0.000
#> GSM254672     1   0.000      0.992 1.000 0.000
#> GSM254692     1   0.000      0.992 1.000 0.000
#> GSM254645     1   0.000      0.992 1.000 0.000
#> GSM254666     1   0.000      0.992 1.000 0.000
#> GSM254675     1   0.000      0.992 1.000 0.000
#> GSM254678     1   0.000      0.992 1.000 0.000
#> GSM254688     1   0.000      0.992 1.000 0.000
#> GSM254690     1   0.000      0.992 1.000 0.000
#> GSM254696     1   0.000      0.992 1.000 0.000
#> GSM254705     1   0.000      0.992 1.000 0.000
#> GSM254642     1   0.000      0.992 1.000 0.000
#> GSM254661     1   0.000      0.992 1.000 0.000
#> GSM254698     1   0.000      0.992 1.000 0.000
#> GSM254641     1   0.000      0.992 1.000 0.000
#> GSM254647     1   0.000      0.992 1.000 0.000
#> GSM254663     1   0.000      0.992 1.000 0.000
#> GSM254682     1   0.000      0.992 1.000 0.000
#> GSM254709     1   0.000      0.992 1.000 0.000
#> GSM254721     1   0.000      0.992 1.000 0.000
#> GSM254724     1   0.000      0.992 1.000 0.000
#> GSM254650     1   0.000      0.992 1.000 0.000
#> GSM254687     1   0.000      0.992 1.000 0.000
#> GSM254637     1   0.000      0.992 1.000 0.000
#> GSM254684     1   0.000      0.992 1.000 0.000
#> GSM254649     2   0.000      1.000 0.000 1.000
#> GSM254660     2   0.000      1.000 0.000 1.000
#> GSM254693     2   0.000      1.000 0.000 1.000
#> GSM254695     2   0.000      1.000 0.000 1.000
#> GSM254702     2   0.000      1.000 0.000 1.000
#> GSM254643     2   0.000      1.000 0.000 1.000
#> GSM254727     2   0.000      1.000 0.000 1.000
#> GSM254640     2   0.000      1.000 0.000 1.000
#> GSM254626     2   0.000      1.000 0.000 1.000
#> GSM254635     2   0.000      1.000 0.000 1.000
#> GSM254653     2   0.000      1.000 0.000 1.000
#> GSM254658     2   0.000      1.000 0.000 1.000
#> GSM254681     2   0.000      1.000 0.000 1.000
#> GSM254719     2   0.000      1.000 0.000 1.000
#> GSM254673     2   0.000      1.000 0.000 1.000
#> GSM254655     2   0.000      1.000 0.000 1.000
#> GSM254669     2   0.000      1.000 0.000 1.000
#> GSM254699     2   0.000      1.000 0.000 1.000
#> GSM254703     2   0.000      1.000 0.000 1.000
#> GSM254708     2   0.000      1.000 0.000 1.000
#> GSM254715     2   0.000      1.000 0.000 1.000
#> GSM254628     2   0.000      1.000 0.000 1.000
#> GSM254634     2   0.000      1.000 0.000 1.000
#> GSM254646     2   0.000      1.000 0.000 1.000
#> GSM254671     2   0.000      1.000 0.000 1.000
#> GSM254711     2   0.000      1.000 0.000 1.000
#> GSM254717     2   0.000      1.000 0.000 1.000
#> GSM254723     1   0.000      0.992 1.000 0.000
#> GSM254730     2   0.000      1.000 0.000 1.000
#> GSM254731     2   0.000      1.000 0.000 1.000
#> GSM254632     1   0.714      0.759 0.804 0.196
#> GSM254662     2   0.000      1.000 0.000 1.000
#> GSM254677     2   0.000      1.000 0.000 1.000
#> GSM254665     2   0.000      1.000 0.000 1.000
#> GSM254691     2   0.000      1.000 0.000 1.000
#> GSM254644     2   0.000      1.000 0.000 1.000
#> GSM254667     2   0.000      1.000 0.000 1.000
#> GSM254676     2   0.000      1.000 0.000 1.000
#> GSM254679     2   0.000      1.000 0.000 1.000
#> GSM254689     2   0.000      1.000 0.000 1.000
#> GSM254706     2   0.000      1.000 0.000 1.000
#> GSM254712     2   0.000      1.000 0.000 1.000
#> GSM254713     2   0.000      1.000 0.000 1.000
#> GSM254683     2   0.000      1.000 0.000 1.000
#> GSM254710     2   0.000      1.000 0.000 1.000
#> GSM254725     2   0.000      1.000 0.000 1.000
#> GSM254651     2   0.000      1.000 0.000 1.000
#> GSM254638     2   0.000      1.000 0.000 1.000
#> GSM254685     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
#> GSM254629     3  0.0000      0.935 0.000 0.000 1.000
#> GSM254648     3  0.5098      0.621 0.000 0.248 0.752
#> GSM254694     3  0.0000      0.935 0.000 0.000 1.000
#> GSM254701     3  0.0000      0.935 0.000 0.000 1.000
#> GSM254728     3  0.0000      0.935 0.000 0.000 1.000
#> GSM254726     3  0.0000      0.935 0.000 0.000 1.000
#> GSM254639     3  0.0000      0.935 0.000 0.000 1.000
#> GSM254652     3  0.0000      0.935 0.000 0.000 1.000
#> GSM254700     1  0.0000      0.936 1.000 0.000 0.000
#> GSM254625     1  0.2448      0.887 0.924 0.000 0.076
#> GSM254636     3  0.1031      0.929 0.024 0.000 0.976
#> GSM254659     3  0.0000      0.935 0.000 0.000 1.000
#> GSM254680     3  0.1031      0.929 0.024 0.000 0.976
#> GSM254686     3  0.0000      0.935 0.000 0.000 1.000
#> GSM254718     3  0.0000      0.935 0.000 0.000 1.000
#> GSM254674     3  0.0747      0.932 0.016 0.000 0.984
#> GSM254668     1  0.6026      0.400 0.624 0.000 0.376
#> GSM254697     3  0.3340      0.861 0.120 0.000 0.880
#> GSM254704     3  0.5650      0.597 0.312 0.000 0.688
#> GSM254707     1  0.0000      0.936 1.000 0.000 0.000
#> GSM254714     3  0.4399      0.782 0.188 0.000 0.812
#> GSM254722     3  0.4750      0.760 0.216 0.000 0.784
#> GSM254627     3  0.4555      0.780 0.200 0.000 0.800
#> GSM254630     1  0.3038      0.863 0.896 0.000 0.104
#> GSM254633     3  0.0892      0.931 0.020 0.000 0.980
#> GSM254670     3  0.0000      0.935 0.000 0.000 1.000
#> GSM254716     3  0.4974      0.672 0.236 0.000 0.764
#> GSM254720     3  0.0000      0.935 0.000 0.000 1.000
#> GSM254729     3  0.0000      0.935 0.000 0.000 1.000
#> GSM254654     3  0.0000      0.935 0.000 0.000 1.000
#> GSM254656     3  0.0000      0.935 0.000 0.000 1.000
#> GSM254631     3  0.1031      0.929 0.024 0.000 0.976
#> GSM254657     3  0.0000      0.935 0.000 0.000 1.000
#> GSM254664     3  0.1031      0.929 0.024 0.000 0.976
#> GSM254672     3  0.1860      0.912 0.052 0.000 0.948
#> GSM254692     1  0.0000      0.936 1.000 0.000 0.000
#> GSM254645     3  0.0237      0.934 0.004 0.000 0.996
#> GSM254666     3  0.1031      0.927 0.024 0.000 0.976
#> GSM254675     3  0.0592      0.932 0.012 0.000 0.988
#> GSM254678     3  0.5291      0.666 0.268 0.000 0.732
#> GSM254688     1  0.0000      0.936 1.000 0.000 0.000
#> GSM254690     3  0.1289      0.926 0.032 0.000 0.968
#> GSM254696     3  0.0424      0.934 0.008 0.000 0.992
#> GSM254705     1  0.0237      0.933 0.996 0.000 0.004
#> GSM254642     1  0.0000      0.936 1.000 0.000 0.000
#> GSM254661     3  0.0000      0.935 0.000 0.000 1.000
#> GSM254698     3  0.0892      0.931 0.020 0.000 0.980
#> GSM254641     3  0.0592      0.933 0.012 0.000 0.988
#> GSM254647     1  0.4399      0.732 0.812 0.000 0.188
#> GSM254663     1  0.0000      0.936 1.000 0.000 0.000
#> GSM254682     1  0.0000      0.936 1.000 0.000 0.000
#> GSM254709     1  0.0000      0.936 1.000 0.000 0.000
#> GSM254721     1  0.0000      0.936 1.000 0.000 0.000
#> GSM254724     1  0.0000      0.936 1.000 0.000 0.000
#> GSM254650     1  0.0000      0.936 1.000 0.000 0.000
#> GSM254687     1  0.0000      0.936 1.000 0.000 0.000
#> GSM254637     3  0.1031      0.929 0.024 0.000 0.976
#> GSM254684     3  0.4235      0.807 0.176 0.000 0.824
#> GSM254649     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254660     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254693     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254695     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254702     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254643     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254727     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254640     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254626     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254635     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254653     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254658     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254681     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254719     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254673     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254655     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254669     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254699     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254703     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254708     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254715     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254628     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254634     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254646     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254671     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254711     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254717     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254723     3  0.0000      0.935 0.000 0.000 1.000
#> GSM254730     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254731     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254632     3  0.4504      0.702 0.000 0.196 0.804
#> GSM254662     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254677     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254665     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254691     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254644     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254667     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254676     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254679     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254689     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254706     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254712     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254713     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254683     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254710     1  0.5178      0.637 0.744 0.256 0.000
#> GSM254725     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254651     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254638     2  0.0000      1.000 0.000 1.000 0.000
#> GSM254685     2  0.0000      1.000 0.000 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM254629     3  0.0000      0.927 0.000 0.000 1.000 0.000
#> GSM254648     3  0.4415      0.745 0.000 0.140 0.804 0.056
#> GSM254694     3  0.0000      0.927 0.000 0.000 1.000 0.000
#> GSM254701     3  0.0000      0.927 0.000 0.000 1.000 0.000
#> GSM254728     3  0.0000      0.927 0.000 0.000 1.000 0.000
#> GSM254726     3  0.0000      0.927 0.000 0.000 1.000 0.000
#> GSM254639     3  0.0000      0.927 0.000 0.000 1.000 0.000
#> GSM254652     3  0.0000      0.927 0.000 0.000 1.000 0.000
#> GSM254700     1  0.0000      0.940 1.000 0.000 0.000 0.000
#> GSM254625     1  0.2011      0.883 0.920 0.000 0.080 0.000
#> GSM254636     3  0.0921      0.922 0.028 0.000 0.972 0.000
#> GSM254659     3  0.0000      0.927 0.000 0.000 1.000 0.000
#> GSM254680     3  0.0921      0.922 0.028 0.000 0.972 0.000
#> GSM254686     3  0.0000      0.927 0.000 0.000 1.000 0.000
#> GSM254718     3  0.0000      0.927 0.000 0.000 1.000 0.000
#> GSM254674     3  0.0707      0.924 0.020 0.000 0.980 0.000
#> GSM254668     1  0.4761      0.411 0.628 0.000 0.372 0.000
#> GSM254697     3  0.3367      0.853 0.108 0.000 0.864 0.028
#> GSM254704     3  0.4477      0.597 0.312 0.000 0.688 0.000
#> GSM254707     1  0.0000      0.940 1.000 0.000 0.000 0.000
#> GSM254714     3  0.3486      0.779 0.188 0.000 0.812 0.000
#> GSM254722     3  0.4406      0.766 0.192 0.000 0.780 0.028
#> GSM254627     3  0.4238      0.785 0.176 0.000 0.796 0.028
#> GSM254630     1  0.2469      0.859 0.892 0.000 0.108 0.000
#> GSM254633     3  0.0817      0.923 0.024 0.000 0.976 0.000
#> GSM254670     3  0.0000      0.927 0.000 0.000 1.000 0.000
#> GSM254716     3  0.3942      0.668 0.236 0.000 0.764 0.000
#> GSM254720     3  0.0000      0.927 0.000 0.000 1.000 0.000
#> GSM254729     3  0.0000      0.927 0.000 0.000 1.000 0.000
#> GSM254654     3  0.0000      0.927 0.000 0.000 1.000 0.000
#> GSM254656     4  0.4790      0.391 0.000 0.000 0.380 0.620
#> GSM254631     3  0.0921      0.922 0.028 0.000 0.972 0.000
#> GSM254657     3  0.0000      0.927 0.000 0.000 1.000 0.000
#> GSM254664     3  0.0921      0.922 0.028 0.000 0.972 0.000
#> GSM254672     3  0.1474      0.908 0.052 0.000 0.948 0.000
#> GSM254692     1  0.0000      0.940 1.000 0.000 0.000 0.000
#> GSM254645     3  0.0188      0.927 0.004 0.000 0.996 0.000
#> GSM254666     3  0.0817      0.920 0.024 0.000 0.976 0.000
#> GSM254675     3  0.0469      0.925 0.012 0.000 0.988 0.000
#> GSM254678     3  0.4164      0.670 0.264 0.000 0.736 0.000
#> GSM254688     1  0.0000      0.940 1.000 0.000 0.000 0.000
#> GSM254690     3  0.1118      0.919 0.036 0.000 0.964 0.000
#> GSM254696     3  0.0469      0.926 0.012 0.000 0.988 0.000
#> GSM254705     1  0.0188      0.937 0.996 0.000 0.004 0.000
#> GSM254642     1  0.0921      0.925 0.972 0.000 0.000 0.028
#> GSM254661     3  0.0000      0.927 0.000 0.000 1.000 0.000
#> GSM254698     3  0.1733      0.913 0.024 0.000 0.948 0.028
#> GSM254641     3  0.0592      0.925 0.016 0.000 0.984 0.000
#> GSM254647     1  0.3486      0.741 0.812 0.000 0.188 0.000
#> GSM254663     1  0.0000      0.940 1.000 0.000 0.000 0.000
#> GSM254682     1  0.0000      0.940 1.000 0.000 0.000 0.000
#> GSM254709     1  0.0000      0.940 1.000 0.000 0.000 0.000
#> GSM254721     1  0.0000      0.940 1.000 0.000 0.000 0.000
#> GSM254724     1  0.0000      0.940 1.000 0.000 0.000 0.000
#> GSM254650     1  0.0000      0.940 1.000 0.000 0.000 0.000
#> GSM254687     1  0.0000      0.940 1.000 0.000 0.000 0.000
#> GSM254637     3  0.0921      0.922 0.028 0.000 0.972 0.000
#> GSM254684     3  0.3400      0.803 0.180 0.000 0.820 0.000
#> GSM254649     2  0.0000      0.897 0.000 1.000 0.000 0.000
#> GSM254660     2  0.2814      0.857 0.000 0.868 0.000 0.132
#> GSM254693     2  0.0000      0.897 0.000 1.000 0.000 0.000
#> GSM254695     4  0.1022      0.865 0.000 0.032 0.000 0.968
#> GSM254702     4  0.4989      0.300 0.000 0.472 0.000 0.528
#> GSM254643     2  0.2011      0.882 0.000 0.920 0.000 0.080
#> GSM254727     2  0.0921      0.896 0.000 0.972 0.000 0.028
#> GSM254640     2  0.2530      0.886 0.000 0.888 0.000 0.112
#> GSM254626     2  0.0000      0.897 0.000 1.000 0.000 0.000
#> GSM254635     4  0.3569      0.834 0.000 0.196 0.000 0.804
#> GSM254653     2  0.1211      0.895 0.000 0.960 0.000 0.040
#> GSM254658     2  0.0000      0.897 0.000 1.000 0.000 0.000
#> GSM254681     2  0.2345      0.866 0.000 0.900 0.000 0.100
#> GSM254719     2  0.2149      0.877 0.000 0.912 0.000 0.088
#> GSM254673     2  0.1474      0.892 0.000 0.948 0.000 0.052
#> GSM254655     2  0.2408      0.866 0.000 0.896 0.000 0.104
#> GSM254669     2  0.0000      0.897 0.000 1.000 0.000 0.000
#> GSM254699     2  0.2408      0.866 0.000 0.896 0.000 0.104
#> GSM254703     4  0.0921      0.863 0.000 0.028 0.000 0.972
#> GSM254708     2  0.3123      0.854 0.000 0.844 0.000 0.156
#> GSM254715     4  0.3764      0.818 0.000 0.216 0.000 0.784
#> GSM254628     2  0.0000      0.897 0.000 1.000 0.000 0.000
#> GSM254634     4  0.1022      0.865 0.000 0.032 0.000 0.968
#> GSM254646     2  0.0000      0.897 0.000 1.000 0.000 0.000
#> GSM254671     4  0.3074      0.862 0.000 0.152 0.000 0.848
#> GSM254711     4  0.2469      0.873 0.000 0.108 0.000 0.892
#> GSM254717     2  0.1867      0.895 0.000 0.928 0.000 0.072
#> GSM254723     3  0.0000      0.927 0.000 0.000 1.000 0.000
#> GSM254730     2  0.2814      0.871 0.000 0.868 0.000 0.132
#> GSM254731     4  0.3726      0.821 0.000 0.212 0.000 0.788
#> GSM254632     3  0.7345      0.135 0.000 0.336 0.492 0.172
#> GSM254662     2  0.1474      0.892 0.000 0.948 0.000 0.052
#> GSM254677     4  0.2345      0.873 0.000 0.100 0.000 0.900
#> GSM254665     2  0.3610      0.831 0.000 0.800 0.000 0.200
#> GSM254691     2  0.4304      0.769 0.000 0.716 0.000 0.284
#> GSM254644     4  0.3024      0.864 0.000 0.148 0.000 0.852
#> GSM254667     4  0.1716      0.845 0.000 0.064 0.000 0.936
#> GSM254676     4  0.1474      0.851 0.000 0.052 0.000 0.948
#> GSM254679     4  0.0921      0.863 0.000 0.028 0.000 0.972
#> GSM254689     2  0.2868      0.852 0.000 0.864 0.000 0.136
#> GSM254706     2  0.3356      0.832 0.000 0.824 0.000 0.176
#> GSM254712     4  0.3219      0.856 0.000 0.164 0.000 0.836
#> GSM254713     4  0.3172      0.858 0.000 0.160 0.000 0.840
#> GSM254683     2  0.3356      0.832 0.000 0.824 0.000 0.176
#> GSM254710     2  0.3356      0.832 0.000 0.824 0.000 0.176
#> GSM254725     4  0.1022      0.865 0.000 0.032 0.000 0.968
#> GSM254651     2  0.3356      0.832 0.000 0.824 0.000 0.176
#> GSM254638     4  0.0921      0.863 0.000 0.028 0.000 0.972
#> GSM254685     4  0.2647      0.871 0.000 0.120 0.000 0.880

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM254629     3  0.0000      0.901 0.000 0.000 1.000 0.000 0.000
#> GSM254648     3  0.4319      0.683 0.012 0.140 0.784 0.064 0.000
#> GSM254694     3  0.0000      0.901 0.000 0.000 1.000 0.000 0.000
#> GSM254701     3  0.0000      0.901 0.000 0.000 1.000 0.000 0.000
#> GSM254728     3  0.0000      0.901 0.000 0.000 1.000 0.000 0.000
#> GSM254726     3  0.0000      0.901 0.000 0.000 1.000 0.000 0.000
#> GSM254639     3  0.0000      0.901 0.000 0.000 1.000 0.000 0.000
#> GSM254652     3  0.0000      0.901 0.000 0.000 1.000 0.000 0.000
#> GSM254700     1  0.4161      0.768 0.608 0.000 0.000 0.000 0.392
#> GSM254625     5  0.1478      0.751 0.000 0.000 0.064 0.000 0.936
#> GSM254636     3  0.0566      0.898 0.004 0.000 0.984 0.000 0.012
#> GSM254659     3  0.0000      0.901 0.000 0.000 1.000 0.000 0.000
#> GSM254680     3  0.0566      0.898 0.004 0.000 0.984 0.000 0.012
#> GSM254686     3  0.0000      0.901 0.000 0.000 1.000 0.000 0.000
#> GSM254718     3  0.0000      0.901 0.000 0.000 1.000 0.000 0.000
#> GSM254674     3  0.0324      0.900 0.004 0.000 0.992 0.000 0.004
#> GSM254668     5  0.4288      0.240 0.004 0.000 0.384 0.000 0.612
#> GSM254697     1  0.0912      0.520 0.972 0.000 0.016 0.000 0.012
#> GSM254704     1  0.5213      0.703 0.640 0.000 0.076 0.000 0.284
#> GSM254707     5  0.0162      0.810 0.004 0.000 0.000 0.000 0.996
#> GSM254714     3  0.3074      0.721 0.000 0.000 0.804 0.000 0.196
#> GSM254722     3  0.4588      0.474 0.380 0.000 0.604 0.000 0.016
#> GSM254627     3  0.4622      0.366 0.440 0.000 0.548 0.000 0.012
#> GSM254630     5  0.2020      0.699 0.000 0.000 0.100 0.000 0.900
#> GSM254633     3  0.0451      0.899 0.004 0.000 0.988 0.000 0.008
#> GSM254670     3  0.0000      0.901 0.000 0.000 1.000 0.000 0.000
#> GSM254716     3  0.3395      0.650 0.000 0.000 0.764 0.000 0.236
#> GSM254720     3  0.4201      0.314 0.408 0.000 0.592 0.000 0.000
#> GSM254729     3  0.0000      0.901 0.000 0.000 1.000 0.000 0.000
#> GSM254654     3  0.0000      0.901 0.000 0.000 1.000 0.000 0.000
#> GSM254656     4  0.4565      0.289 0.012 0.000 0.408 0.580 0.000
#> GSM254631     3  0.0566      0.898 0.004 0.000 0.984 0.000 0.012
#> GSM254657     3  0.0000      0.901 0.000 0.000 1.000 0.000 0.000
#> GSM254664     3  0.0566      0.898 0.004 0.000 0.984 0.000 0.012
#> GSM254672     3  0.1741      0.867 0.024 0.000 0.936 0.000 0.040
#> GSM254692     5  0.0162      0.810 0.004 0.000 0.000 0.000 0.996
#> GSM254645     3  0.0162      0.901 0.000 0.000 0.996 0.000 0.004
#> GSM254666     3  0.0703      0.891 0.000 0.000 0.976 0.000 0.024
#> GSM254675     3  0.0404      0.898 0.000 0.000 0.988 0.000 0.012
#> GSM254678     3  0.3661      0.598 0.000 0.000 0.724 0.000 0.276
#> GSM254688     5  0.0000      0.811 0.000 0.000 0.000 0.000 1.000
#> GSM254690     3  0.0771      0.895 0.004 0.000 0.976 0.000 0.020
#> GSM254696     3  0.0162      0.901 0.004 0.000 0.996 0.000 0.000
#> GSM254705     5  0.0000      0.811 0.000 0.000 0.000 0.000 1.000
#> GSM254642     5  0.4150      0.309 0.388 0.000 0.000 0.000 0.612
#> GSM254661     3  0.0000      0.901 0.000 0.000 1.000 0.000 0.000
#> GSM254698     3  0.4341      0.515 0.364 0.000 0.628 0.000 0.008
#> GSM254641     3  0.0324      0.900 0.004 0.000 0.992 0.000 0.004
#> GSM254647     5  0.3919      0.446 0.036 0.000 0.188 0.000 0.776
#> GSM254663     5  0.0880      0.791 0.032 0.000 0.000 0.000 0.968
#> GSM254682     5  0.0000      0.811 0.000 0.000 0.000 0.000 1.000
#> GSM254709     5  0.0000      0.811 0.000 0.000 0.000 0.000 1.000
#> GSM254721     1  0.4182      0.766 0.600 0.000 0.000 0.000 0.400
#> GSM254724     1  0.4182      0.766 0.600 0.000 0.000 0.000 0.400
#> GSM254650     5  0.0000      0.811 0.000 0.000 0.000 0.000 1.000
#> GSM254687     5  0.0000      0.811 0.000 0.000 0.000 0.000 1.000
#> GSM254637     3  0.0566      0.898 0.004 0.000 0.984 0.000 0.012
#> GSM254684     3  0.2930      0.765 0.004 0.000 0.832 0.000 0.164
#> GSM254649     2  0.0000      0.871 0.000 1.000 0.000 0.000 0.000
#> GSM254660     2  0.3010      0.811 0.004 0.824 0.000 0.172 0.000
#> GSM254693     2  0.0000      0.871 0.000 1.000 0.000 0.000 0.000
#> GSM254695     4  0.0162      0.824 0.000 0.004 0.000 0.996 0.000
#> GSM254702     4  0.4430      0.291 0.004 0.456 0.000 0.540 0.000
#> GSM254643     2  0.2074      0.849 0.000 0.896 0.000 0.104 0.000
#> GSM254727     2  0.1041      0.869 0.004 0.964 0.000 0.032 0.000
#> GSM254640     2  0.2763      0.847 0.004 0.848 0.000 0.148 0.000
#> GSM254626     2  0.0000      0.871 0.000 1.000 0.000 0.000 0.000
#> GSM254635     4  0.3231      0.796 0.004 0.196 0.000 0.800 0.000
#> GSM254653     2  0.1638      0.864 0.004 0.932 0.000 0.064 0.000
#> GSM254658     2  0.0000      0.871 0.000 1.000 0.000 0.000 0.000
#> GSM254681     2  0.2280      0.831 0.000 0.880 0.000 0.120 0.000
#> GSM254719     2  0.2488      0.835 0.004 0.872 0.000 0.124 0.000
#> GSM254673     2  0.1270      0.867 0.000 0.948 0.000 0.052 0.000
#> GSM254655     2  0.2674      0.823 0.004 0.856 0.000 0.140 0.000
#> GSM254669     2  0.0000      0.871 0.000 1.000 0.000 0.000 0.000
#> GSM254699     2  0.2674      0.823 0.004 0.856 0.000 0.140 0.000
#> GSM254703     4  0.0404      0.817 0.012 0.000 0.000 0.988 0.000
#> GSM254708     2  0.3496      0.813 0.012 0.788 0.000 0.200 0.000
#> GSM254715     4  0.3398      0.782 0.004 0.216 0.000 0.780 0.000
#> GSM254628     2  0.0000      0.871 0.000 1.000 0.000 0.000 0.000
#> GSM254634     4  0.0566      0.820 0.012 0.004 0.000 0.984 0.000
#> GSM254646     2  0.0000      0.871 0.000 1.000 0.000 0.000 0.000
#> GSM254671     4  0.2719      0.830 0.004 0.144 0.000 0.852 0.000
#> GSM254711     4  0.2124      0.841 0.004 0.096 0.000 0.900 0.000
#> GSM254717     2  0.1608      0.870 0.000 0.928 0.000 0.072 0.000
#> GSM254723     3  0.0290      0.898 0.000 0.000 0.992 0.008 0.000
#> GSM254730     2  0.2970      0.828 0.004 0.828 0.000 0.168 0.000
#> GSM254731     4  0.3333      0.788 0.004 0.208 0.000 0.788 0.000
#> GSM254632     3  0.6814      0.100 0.012 0.316 0.468 0.204 0.000
#> GSM254662     2  0.1478      0.864 0.000 0.936 0.000 0.064 0.000
#> GSM254677     4  0.1952      0.841 0.004 0.084 0.000 0.912 0.000
#> GSM254665     2  0.3890      0.779 0.012 0.736 0.000 0.252 0.000
#> GSM254691     2  0.4356      0.702 0.012 0.648 0.000 0.340 0.000
#> GSM254644     4  0.2674      0.831 0.004 0.140 0.000 0.856 0.000
#> GSM254667     4  0.1444      0.795 0.012 0.040 0.000 0.948 0.000
#> GSM254676     4  0.1106      0.805 0.012 0.024 0.000 0.964 0.000
#> GSM254679     4  0.0000      0.822 0.000 0.000 0.000 1.000 0.000
#> GSM254689     2  0.2690      0.817 0.000 0.844 0.000 0.156 0.000
#> GSM254706     2  0.3177      0.791 0.000 0.792 0.000 0.208 0.000
#> GSM254712     4  0.2848      0.823 0.004 0.156 0.000 0.840 0.000
#> GSM254713     4  0.2806      0.826 0.004 0.152 0.000 0.844 0.000
#> GSM254683     2  0.3563      0.785 0.012 0.780 0.000 0.208 0.000
#> GSM254710     2  0.3177      0.791 0.000 0.792 0.000 0.208 0.000
#> GSM254725     4  0.0162      0.824 0.000 0.004 0.000 0.996 0.000
#> GSM254651     2  0.3143      0.793 0.000 0.796 0.000 0.204 0.000
#> GSM254638     4  0.0404      0.817 0.012 0.000 0.000 0.988 0.000
#> GSM254685     4  0.2574      0.840 0.012 0.112 0.000 0.876 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
#> GSM254629     3  0.1204    0.73284 0.000 0.000 0.944 0.000 0.000 0.056
#> GSM254648     3  0.5626    0.37912 0.012 0.088 0.668 0.172 0.000 0.060
#> GSM254694     3  0.0000    0.74221 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM254701     3  0.0146    0.74240 0.000 0.000 0.996 0.000 0.000 0.004
#> GSM254728     3  0.0146    0.74240 0.000 0.000 0.996 0.000 0.000 0.004
#> GSM254726     3  0.1411    0.72994 0.000 0.000 0.936 0.004 0.000 0.060
#> GSM254639     3  0.0260    0.74262 0.000 0.000 0.992 0.000 0.000 0.008
#> GSM254652     3  0.1007    0.73713 0.000 0.000 0.956 0.000 0.000 0.044
#> GSM254700     1  0.5951    0.03939 0.456 0.000 0.000 0.000 0.276 0.268
#> GSM254625     5  0.1327    0.77261 0.000 0.000 0.064 0.000 0.936 0.000
#> GSM254636     3  0.5527    0.37296 0.152 0.000 0.596 0.000 0.012 0.240
#> GSM254659     3  0.0000    0.74221 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM254680     3  0.5271    0.43641 0.152 0.000 0.640 0.000 0.012 0.196
#> GSM254686     3  0.0000    0.74221 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM254718     3  0.0000    0.74221 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM254674     3  0.4788    0.49350 0.132 0.000 0.684 0.000 0.004 0.180
#> GSM254668     5  0.7354   -0.01880 0.152 0.000 0.248 0.000 0.404 0.196
#> GSM254697     6  0.3653    0.00181 0.300 0.000 0.000 0.000 0.008 0.692
#> GSM254704     1  0.6900    0.03924 0.392 0.000 0.056 0.000 0.248 0.304
#> GSM254707     5  0.4937    0.54041 0.152 0.000 0.000 0.000 0.652 0.196
#> GSM254714     3  0.4148    0.56024 0.012 0.000 0.748 0.000 0.184 0.056
#> GSM254722     6  0.4089    0.40267 0.000 0.000 0.468 0.000 0.008 0.524
#> GSM254627     6  0.3733    0.55014 0.004 0.000 0.288 0.000 0.008 0.700
#> GSM254630     5  0.1814    0.73980 0.000 0.000 0.100 0.000 0.900 0.000
#> GSM254633     3  0.2593    0.66448 0.148 0.000 0.844 0.000 0.008 0.000
#> GSM254670     3  0.1814    0.72039 0.000 0.000 0.900 0.000 0.000 0.100
#> GSM254716     3  0.3050    0.51942 0.000 0.000 0.764 0.000 0.236 0.000
#> GSM254720     3  0.5365    0.10878 0.256 0.000 0.580 0.000 0.000 0.164
#> GSM254729     3  0.0000    0.74221 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM254654     3  0.1267    0.73154 0.000 0.000 0.940 0.000 0.000 0.060
#> GSM254656     4  0.3782    0.04624 0.000 0.000 0.412 0.588 0.000 0.000
#> GSM254631     3  0.5271    0.43641 0.152 0.000 0.640 0.000 0.012 0.196
#> GSM254657     3  0.1387    0.73167 0.000 0.000 0.932 0.000 0.000 0.068
#> GSM254664     3  0.5271    0.43641 0.152 0.000 0.640 0.000 0.012 0.196
#> GSM254672     3  0.3444    0.66101 0.076 0.000 0.836 0.000 0.032 0.056
#> GSM254692     5  0.0146    0.80383 0.004 0.000 0.000 0.000 0.996 0.000
#> GSM254645     3  0.1349    0.73365 0.000 0.000 0.940 0.000 0.004 0.056
#> GSM254666     3  0.1829    0.72959 0.000 0.000 0.920 0.000 0.024 0.056
#> GSM254675     3  0.0363    0.74110 0.000 0.000 0.988 0.000 0.012 0.000
#> GSM254678     3  0.4214    0.33263 0.000 0.000 0.680 0.000 0.276 0.044
#> GSM254688     5  0.0000    0.80380 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM254690     3  0.5527    0.37296 0.152 0.000 0.596 0.000 0.012 0.240
#> GSM254696     3  0.3229    0.64929 0.140 0.000 0.816 0.000 0.000 0.044
#> GSM254705     5  0.0000    0.80380 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM254642     5  0.3828    0.38037 0.000 0.000 0.000 0.000 0.560 0.440
#> GSM254661     3  0.1267    0.73154 0.000 0.000 0.940 0.000 0.000 0.060
#> GSM254698     6  0.3950    0.41087 0.000 0.000 0.432 0.000 0.004 0.564
#> GSM254641     3  0.4293    0.62176 0.096 0.000 0.736 0.000 0.004 0.164
#> GSM254647     5  0.4767    0.46069 0.000 0.000 0.076 0.000 0.620 0.304
#> GSM254663     5  0.2942    0.72661 0.132 0.000 0.000 0.000 0.836 0.032
#> GSM254682     5  0.0000    0.80380 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM254709     5  0.0363    0.80242 0.012 0.000 0.000 0.000 0.988 0.000
#> GSM254721     1  0.6063    0.02018 0.388 0.000 0.000 0.000 0.348 0.264
#> GSM254724     1  0.6060    0.02560 0.392 0.000 0.000 0.000 0.344 0.264
#> GSM254650     5  0.0000    0.80380 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM254687     5  0.0000    0.80380 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM254637     3  0.5323    0.42787 0.152 0.000 0.632 0.000 0.012 0.204
#> GSM254684     3  0.6021    0.31817 0.152 0.000 0.568 0.000 0.040 0.240
#> GSM254649     2  0.0000    0.73667 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM254660     2  0.4526    0.43882 0.456 0.512 0.000 0.032 0.000 0.000
#> GSM254693     2  0.0000    0.73667 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM254695     4  0.2854    0.46569 0.208 0.000 0.000 0.792 0.000 0.000
#> GSM254702     1  0.5951   -0.09118 0.456 0.268 0.000 0.276 0.000 0.000
#> GSM254643     2  0.2320    0.71679 0.132 0.864 0.000 0.004 0.000 0.000
#> GSM254727     2  0.3601    0.57135 0.312 0.684 0.000 0.004 0.000 0.000
#> GSM254640     2  0.5044    0.53169 0.320 0.584 0.000 0.096 0.000 0.000
#> GSM254626     2  0.0146    0.73699 0.004 0.996 0.000 0.000 0.000 0.000
#> GSM254635     4  0.5702    0.14987 0.324 0.180 0.000 0.496 0.000 0.000
#> GSM254653     2  0.3023    0.66314 0.212 0.784 0.000 0.004 0.000 0.000
#> GSM254658     2  0.0000    0.73667 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM254681     2  0.1957    0.66186 0.000 0.888 0.000 0.112 0.000 0.000
#> GSM254719     2  0.3636    0.61260 0.320 0.676 0.000 0.004 0.000 0.000
#> GSM254673     2  0.2092    0.71914 0.124 0.876 0.000 0.000 0.000 0.000
#> GSM254655     2  0.3979    0.47215 0.456 0.540 0.000 0.004 0.000 0.000
#> GSM254669     2  0.0260    0.73710 0.008 0.992 0.000 0.000 0.000 0.000
#> GSM254699     2  0.3979    0.47215 0.456 0.540 0.000 0.004 0.000 0.000
#> GSM254703     4  0.0458    0.50003 0.016 0.000 0.000 0.984 0.000 0.000
#> GSM254708     2  0.3509    0.59184 0.016 0.744 0.000 0.240 0.000 0.000
#> GSM254715     1  0.5814   -0.12061 0.448 0.188 0.000 0.364 0.000 0.000
#> GSM254628     2  0.0000    0.73667 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM254634     4  0.0508    0.50091 0.012 0.004 0.000 0.984 0.000 0.000
#> GSM254646     2  0.0000    0.73667 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM254671     4  0.5390    0.21791 0.328 0.132 0.000 0.540 0.000 0.000
#> GSM254711     4  0.5227    0.14306 0.452 0.092 0.000 0.456 0.000 0.000
#> GSM254717     2  0.2581    0.72064 0.120 0.860 0.000 0.020 0.000 0.000
#> GSM254723     3  0.2006    0.64366 0.104 0.000 0.892 0.000 0.000 0.004
#> GSM254730     2  0.4002    0.65465 0.260 0.704 0.000 0.036 0.000 0.000
#> GSM254731     1  0.5804   -0.11383 0.456 0.188 0.000 0.356 0.000 0.000
#> GSM254632     4  0.6491    0.08172 0.000 0.180 0.244 0.516 0.000 0.060
#> GSM254662     2  0.2300    0.71455 0.144 0.856 0.000 0.000 0.000 0.000
#> GSM254677     4  0.4855    0.29262 0.328 0.076 0.000 0.596 0.000 0.000
#> GSM254665     4  0.4401   -0.22633 0.024 0.464 0.000 0.512 0.000 0.000
#> GSM254691     4  0.4105   -0.01076 0.020 0.348 0.000 0.632 0.000 0.000
#> GSM254644     1  0.5508   -0.22598 0.440 0.128 0.000 0.432 0.000 0.000
#> GSM254667     4  0.0000    0.49838 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM254676     4  0.0458    0.50003 0.016 0.000 0.000 0.984 0.000 0.000
#> GSM254679     4  0.2135    0.48232 0.128 0.000 0.000 0.872 0.000 0.000
#> GSM254689     2  0.2300    0.63858 0.000 0.856 0.000 0.144 0.000 0.000
#> GSM254706     2  0.3867    0.20730 0.000 0.512 0.000 0.488 0.000 0.000
#> GSM254712     4  0.5612    0.07301 0.428 0.144 0.000 0.428 0.000 0.000
#> GSM254713     4  0.5581    0.09847 0.408 0.140 0.000 0.452 0.000 0.000
#> GSM254683     4  0.3864   -0.22394 0.000 0.480 0.000 0.520 0.000 0.000
#> GSM254710     2  0.3833    0.28726 0.000 0.556 0.000 0.444 0.000 0.000
#> GSM254725     4  0.3446    0.38056 0.308 0.000 0.000 0.692 0.000 0.000
#> GSM254651     2  0.3684    0.39289 0.000 0.628 0.000 0.372 0.000 0.000
#> GSM254638     4  0.0000    0.49838 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM254685     4  0.4023    0.41827 0.144 0.100 0.000 0.756 0.000 0.000

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

consensus_heatmap(res, k = 2)

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

consensus_heatmap(res, k = 3)

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

consensus_heatmap(res, k = 4)

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

consensus_heatmap(res, k = 5)

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

consensus_heatmap(res, k = 6)

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

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

membership_heatmap(res, k = 2)

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

membership_heatmap(res, k = 3)

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

membership_heatmap(res, k = 4)

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

membership_heatmap(res, k = 5)

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

membership_heatmap(res, k = 6)

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

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

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

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

get_signatures(res, k = 3)

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

get_signatures(res, k = 4)

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

get_signatures(res, k = 5)

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

get_signatures(res, k = 6)

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

Signature heatmaps where rows are not scaled:

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

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

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

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

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

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

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

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

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

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

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk CV-pam-signature_compare

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

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

An example of the output of tb is:

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

The columns in tb are:

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

UMAP plot which shows how samples are separated.

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

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

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

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

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

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

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

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

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

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

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk CV-pam-collect-classes

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

test_to_known_factors(res)
#>          n tissue(p) individual(p) disease.state(p) gender(p) other(p) k
#> CV:pam 107  1.59e-22        0.7770           0.5773     0.628    0.872 2
#> CV:pam 106  2.95e-21        0.0103           0.0912     0.551    0.237 3
#> CV:pam 103  2.47e-21        0.0116           0.3929     0.291    0.612 4
#> CV:pam  98  1.77e-19        0.1125           0.8318     0.202    0.511 5
#> CV:pam  59  3.31e-11        0.0086           0.9253     0.395    0.682 6

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


CV:mclust**

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

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

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

res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#>   On a matrix with 21168 rows and 107 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 1.000           0.996       0.998         0.4956 0.505   0.505
#> 3 3 0.781           0.847       0.918         0.3002 0.846   0.695
#> 4 4 0.577           0.545       0.769         0.0889 0.974   0.927
#> 5 5 0.801           0.808       0.885         0.0898 0.888   0.674
#> 6 6 0.703           0.683       0.793         0.0335 0.975   0.895

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
#> GSM254629     1  0.0376      0.994 0.996 0.004
#> GSM254648     1  0.1184      0.985 0.984 0.016
#> GSM254694     1  0.1184      0.985 0.984 0.016
#> GSM254701     1  0.0000      0.996 1.000 0.000
#> GSM254728     1  0.0000      0.996 1.000 0.000
#> GSM254726     1  0.1184      0.985 0.984 0.016
#> GSM254639     1  0.0000      0.996 1.000 0.000
#> GSM254652     1  0.0000      0.996 1.000 0.000
#> GSM254700     1  0.0000      0.996 1.000 0.000
#> GSM254625     1  0.0376      0.994 0.996 0.004
#> GSM254636     1  0.0000      0.996 1.000 0.000
#> GSM254659     1  0.0000      0.996 1.000 0.000
#> GSM254680     1  0.0000      0.996 1.000 0.000
#> GSM254686     1  0.0000      0.996 1.000 0.000
#> GSM254718     1  0.0000      0.996 1.000 0.000
#> GSM254674     1  0.0000      0.996 1.000 0.000
#> GSM254668     1  0.0000      0.996 1.000 0.000
#> GSM254697     1  0.0000      0.996 1.000 0.000
#> GSM254704     1  0.0000      0.996 1.000 0.000
#> GSM254707     1  0.0000      0.996 1.000 0.000
#> GSM254714     1  0.0000      0.996 1.000 0.000
#> GSM254722     1  0.0000      0.996 1.000 0.000
#> GSM254627     1  0.0000      0.996 1.000 0.000
#> GSM254630     1  0.0000      0.996 1.000 0.000
#> GSM254633     1  0.0000      0.996 1.000 0.000
#> GSM254670     1  0.0000      0.996 1.000 0.000
#> GSM254716     1  0.0000      0.996 1.000 0.000
#> GSM254720     1  0.0000      0.996 1.000 0.000
#> GSM254729     1  0.1184      0.985 0.984 0.016
#> GSM254654     1  0.1184      0.985 0.984 0.016
#> GSM254656     1  0.1184      0.985 0.984 0.016
#> GSM254631     1  0.0000      0.996 1.000 0.000
#> GSM254657     1  0.0000      0.996 1.000 0.000
#> GSM254664     1  0.0000      0.996 1.000 0.000
#> GSM254672     1  0.0000      0.996 1.000 0.000
#> GSM254692     1  0.0000      0.996 1.000 0.000
#> GSM254645     1  0.0000      0.996 1.000 0.000
#> GSM254666     1  0.0000      0.996 1.000 0.000
#> GSM254675     1  0.0000      0.996 1.000 0.000
#> GSM254678     1  0.0000      0.996 1.000 0.000
#> GSM254688     1  0.0000      0.996 1.000 0.000
#> GSM254690     1  0.0000      0.996 1.000 0.000
#> GSM254696     1  0.0000      0.996 1.000 0.000
#> GSM254705     1  0.0000      0.996 1.000 0.000
#> GSM254642     1  0.0000      0.996 1.000 0.000
#> GSM254661     1  0.0000      0.996 1.000 0.000
#> GSM254698     1  0.0000      0.996 1.000 0.000
#> GSM254641     1  0.0000      0.996 1.000 0.000
#> GSM254647     1  0.0000      0.996 1.000 0.000
#> GSM254663     1  0.0000      0.996 1.000 0.000
#> GSM254682     1  0.0000      0.996 1.000 0.000
#> GSM254709     1  0.0000      0.996 1.000 0.000
#> GSM254721     1  0.0000      0.996 1.000 0.000
#> GSM254724     1  0.0000      0.996 1.000 0.000
#> GSM254650     1  0.0000      0.996 1.000 0.000
#> GSM254687     1  0.0000      0.996 1.000 0.000
#> GSM254637     1  0.0000      0.996 1.000 0.000
#> GSM254684     1  0.0000      0.996 1.000 0.000
#> GSM254649     2  0.0000      1.000 0.000 1.000
#> GSM254660     2  0.0000      1.000 0.000 1.000
#> GSM254693     2  0.0000      1.000 0.000 1.000
#> GSM254695     2  0.0000      1.000 0.000 1.000
#> GSM254702     2  0.0000      1.000 0.000 1.000
#> GSM254643     2  0.0000      1.000 0.000 1.000
#> GSM254727     2  0.0000      1.000 0.000 1.000
#> GSM254640     2  0.0000      1.000 0.000 1.000
#> GSM254626     2  0.0000      1.000 0.000 1.000
#> GSM254635     2  0.0000      1.000 0.000 1.000
#> GSM254653     2  0.0000      1.000 0.000 1.000
#> GSM254658     2  0.0000      1.000 0.000 1.000
#> GSM254681     2  0.0000      1.000 0.000 1.000
#> GSM254719     2  0.0000      1.000 0.000 1.000
#> GSM254673     2  0.0000      1.000 0.000 1.000
#> GSM254655     2  0.0000      1.000 0.000 1.000
#> GSM254669     2  0.0000      1.000 0.000 1.000
#> GSM254699     2  0.0000      1.000 0.000 1.000
#> GSM254703     2  0.0000      1.000 0.000 1.000
#> GSM254708     2  0.0000      1.000 0.000 1.000
#> GSM254715     2  0.0000      1.000 0.000 1.000
#> GSM254628     2  0.0000      1.000 0.000 1.000
#> GSM254634     2  0.0000      1.000 0.000 1.000
#> GSM254646     2  0.0000      1.000 0.000 1.000
#> GSM254671     2  0.0000      1.000 0.000 1.000
#> GSM254711     2  0.0000      1.000 0.000 1.000
#> GSM254717     2  0.0000      1.000 0.000 1.000
#> GSM254723     1  0.1184      0.985 0.984 0.016
#> GSM254730     2  0.0000      1.000 0.000 1.000
#> GSM254731     2  0.0000      1.000 0.000 1.000
#> GSM254632     1  0.1184      0.985 0.984 0.016
#> GSM254662     2  0.0000      1.000 0.000 1.000
#> GSM254677     2  0.0000      1.000 0.000 1.000
#> GSM254665     2  0.0000      1.000 0.000 1.000
#> GSM254691     2  0.0000      1.000 0.000 1.000
#> GSM254644     2  0.0000      1.000 0.000 1.000
#> GSM254667     2  0.0938      0.988 0.012 0.988
#> GSM254676     2  0.0000      1.000 0.000 1.000
#> GSM254679     2  0.0000      1.000 0.000 1.000
#> GSM254689     2  0.0000      1.000 0.000 1.000
#> GSM254706     2  0.0000      1.000 0.000 1.000
#> GSM254712     2  0.0000      1.000 0.000 1.000
#> GSM254713     2  0.0000      1.000 0.000 1.000
#> GSM254683     2  0.0000      1.000 0.000 1.000
#> GSM254710     1  0.4298      0.908 0.912 0.088
#> GSM254725     2  0.0000      1.000 0.000 1.000
#> GSM254651     2  0.0000      1.000 0.000 1.000
#> GSM254638     2  0.0000      1.000 0.000 1.000
#> GSM254685     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
#> GSM254629     3  0.3267     0.8405 0.116 0.000 0.884
#> GSM254648     3  0.1289     0.8100 0.032 0.000 0.968
#> GSM254694     3  0.1964     0.8284 0.056 0.000 0.944
#> GSM254701     3  0.4121     0.8377 0.168 0.000 0.832
#> GSM254728     3  0.4555     0.8241 0.200 0.000 0.800
#> GSM254726     3  0.1860     0.8252 0.052 0.000 0.948
#> GSM254639     3  0.4654     0.8173 0.208 0.000 0.792
#> GSM254652     3  0.4555     0.8241 0.200 0.000 0.800
#> GSM254700     1  0.0000     0.9019 1.000 0.000 0.000
#> GSM254625     3  0.6280     0.3088 0.460 0.000 0.540
#> GSM254636     1  0.5733     0.4364 0.676 0.000 0.324
#> GSM254659     3  0.4605     0.8214 0.204 0.000 0.796
#> GSM254680     1  0.0000     0.9019 1.000 0.000 0.000
#> GSM254686     1  0.2796     0.8246 0.908 0.000 0.092
#> GSM254718     3  0.4346     0.8311 0.184 0.000 0.816
#> GSM254674     1  0.0000     0.9019 1.000 0.000 0.000
#> GSM254668     1  0.0237     0.9017 0.996 0.000 0.004
#> GSM254697     1  0.0000     0.9019 1.000 0.000 0.000
#> GSM254704     1  0.0592     0.8983 0.988 0.000 0.012
#> GSM254707     1  0.0424     0.9006 0.992 0.000 0.008
#> GSM254714     1  0.6295    -0.0639 0.528 0.000 0.472
#> GSM254722     1  0.0592     0.8996 0.988 0.000 0.012
#> GSM254627     1  0.0000     0.9019 1.000 0.000 0.000
#> GSM254630     1  0.0747     0.8981 0.984 0.000 0.016
#> GSM254633     1  0.4555     0.6840 0.800 0.000 0.200
#> GSM254670     3  0.4504     0.8253 0.196 0.000 0.804
#> GSM254716     3  0.6305     0.2511 0.484 0.000 0.516
#> GSM254720     1  0.3267     0.8131 0.884 0.000 0.116
#> GSM254729     3  0.2796     0.8383 0.092 0.000 0.908
#> GSM254654     3  0.2066     0.8301 0.060 0.000 0.940
#> GSM254656     3  0.2165     0.8305 0.064 0.000 0.936
#> GSM254631     1  0.0747     0.8954 0.984 0.000 0.016
#> GSM254657     3  0.4504     0.8246 0.196 0.000 0.804
#> GSM254664     1  0.0237     0.9016 0.996 0.000 0.004
#> GSM254672     1  0.0237     0.9016 0.996 0.000 0.004
#> GSM254692     1  0.0237     0.9017 0.996 0.000 0.004
#> GSM254645     3  0.4062     0.8391 0.164 0.000 0.836
#> GSM254666     1  0.6204    -0.0205 0.576 0.000 0.424
#> GSM254675     1  0.0000     0.9019 1.000 0.000 0.000
#> GSM254678     1  0.1860     0.8699 0.948 0.000 0.052
#> GSM254688     1  0.0424     0.9006 0.992 0.000 0.008
#> GSM254690     1  0.2448     0.8456 0.924 0.000 0.076
#> GSM254696     1  0.6204     0.1369 0.576 0.000 0.424
#> GSM254705     1  0.0424     0.9006 0.992 0.000 0.008
#> GSM254642     1  0.0000     0.9019 1.000 0.000 0.000
#> GSM254661     3  0.3941     0.8407 0.156 0.000 0.844
#> GSM254698     1  0.5138     0.5962 0.748 0.000 0.252
#> GSM254641     1  0.0000     0.9019 1.000 0.000 0.000
#> GSM254647     1  0.0000     0.9019 1.000 0.000 0.000
#> GSM254663     1  0.0000     0.9019 1.000 0.000 0.000
#> GSM254682     1  0.0424     0.9006 0.992 0.000 0.008
#> GSM254709     1  0.0424     0.9006 0.992 0.000 0.008
#> GSM254721     1  0.0592     0.8983 0.988 0.000 0.012
#> GSM254724     1  0.0592     0.8983 0.988 0.000 0.012
#> GSM254650     1  0.0424     0.9006 0.992 0.000 0.008
#> GSM254687     1  0.0424     0.9006 0.992 0.000 0.008
#> GSM254637     1  0.5291     0.5668 0.732 0.000 0.268
#> GSM254684     3  0.6244     0.3606 0.440 0.000 0.560
#> GSM254649     2  0.0000     0.9672 0.000 1.000 0.000
#> GSM254660     2  0.0000     0.9672 0.000 1.000 0.000
#> GSM254693     2  0.0000     0.9672 0.000 1.000 0.000
#> GSM254695     2  0.4555     0.8373 0.000 0.800 0.200
#> GSM254702     2  0.0000     0.9672 0.000 1.000 0.000
#> GSM254643     2  0.0000     0.9672 0.000 1.000 0.000
#> GSM254727     2  0.0000     0.9672 0.000 1.000 0.000
#> GSM254640     2  0.0000     0.9672 0.000 1.000 0.000
#> GSM254626     2  0.0000     0.9672 0.000 1.000 0.000
#> GSM254635     2  0.4121     0.8706 0.000 0.832 0.168
#> GSM254653     2  0.0000     0.9672 0.000 1.000 0.000
#> GSM254658     2  0.0000     0.9672 0.000 1.000 0.000
#> GSM254681     2  0.0237     0.9669 0.000 0.996 0.004
#> GSM254719     2  0.0000     0.9672 0.000 1.000 0.000
#> GSM254673     2  0.0000     0.9672 0.000 1.000 0.000
#> GSM254655     2  0.0000     0.9672 0.000 1.000 0.000
#> GSM254669     2  0.0000     0.9672 0.000 1.000 0.000
#> GSM254699     2  0.0000     0.9672 0.000 1.000 0.000
#> GSM254703     2  0.1289     0.9610 0.000 0.968 0.032
#> GSM254708     2  0.3267     0.9088 0.000 0.884 0.116
#> GSM254715     2  0.0237     0.9665 0.000 0.996 0.004
#> GSM254628     2  0.0000     0.9672 0.000 1.000 0.000
#> GSM254634     2  0.2878     0.9227 0.000 0.904 0.096
#> GSM254646     2  0.0237     0.9669 0.000 0.996 0.004
#> GSM254671     2  0.1031     0.9629 0.000 0.976 0.024
#> GSM254711     2  0.1163     0.9621 0.000 0.972 0.028
#> GSM254717     2  0.1031     0.9629 0.000 0.976 0.024
#> GSM254723     3  0.1753     0.8225 0.048 0.000 0.952
#> GSM254730     2  0.0000     0.9672 0.000 1.000 0.000
#> GSM254731     2  0.0000     0.9672 0.000 1.000 0.000
#> GSM254632     3  0.1289     0.8100 0.032 0.000 0.968
#> GSM254662     2  0.0237     0.9669 0.000 0.996 0.004
#> GSM254677     2  0.4121     0.8706 0.000 0.832 0.168
#> GSM254665     2  0.1031     0.9629 0.000 0.976 0.024
#> GSM254691     2  0.1411     0.9586 0.000 0.964 0.036
#> GSM254644     2  0.0000     0.9672 0.000 1.000 0.000
#> GSM254667     2  0.4504     0.8397 0.000 0.804 0.196
#> GSM254676     2  0.1031     0.9629 0.000 0.976 0.024
#> GSM254679     2  0.1031     0.9629 0.000 0.976 0.024
#> GSM254689     2  0.0237     0.9669 0.000 0.996 0.004
#> GSM254706     2  0.3686     0.8917 0.000 0.860 0.140
#> GSM254712     2  0.1411     0.9595 0.000 0.964 0.036
#> GSM254713     2  0.0237     0.9665 0.000 0.996 0.004
#> GSM254683     2  0.1031     0.9629 0.000 0.976 0.024
#> GSM254710     3  0.6881     0.3891 0.032 0.320 0.648
#> GSM254725     2  0.4178     0.8669 0.000 0.828 0.172
#> GSM254651     2  0.1031     0.9629 0.000 0.976 0.024
#> GSM254638     2  0.4235     0.8633 0.000 0.824 0.176
#> GSM254685     2  0.0237     0.9665 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
#> GSM254629     3  0.4353     0.8353 0.232 0.000 0.756 0.012
#> GSM254648     3  0.4083     0.8012 0.100 0.000 0.832 0.068
#> GSM254694     3  0.3958     0.8148 0.112 0.000 0.836 0.052
#> GSM254701     3  0.4744     0.7889 0.284 0.000 0.704 0.012
#> GSM254728     3  0.4422     0.8203 0.256 0.000 0.736 0.008
#> GSM254726     3  0.4843     0.7879 0.104 0.000 0.784 0.112
#> GSM254639     3  0.4748     0.8256 0.268 0.000 0.716 0.016
#> GSM254652     3  0.4838     0.8260 0.252 0.000 0.724 0.024
#> GSM254700     1  0.6508     0.5961 0.600 0.000 0.104 0.296
#> GSM254625     3  0.7241     0.7247 0.264 0.000 0.540 0.196
#> GSM254636     1  0.3937     0.6179 0.800 0.000 0.188 0.012
#> GSM254659     3  0.4356     0.7792 0.292 0.000 0.708 0.000
#> GSM254680     1  0.1356     0.7454 0.960 0.000 0.032 0.008
#> GSM254686     1  0.4546     0.5142 0.732 0.000 0.256 0.012
#> GSM254718     3  0.4295     0.8289 0.240 0.000 0.752 0.008
#> GSM254674     1  0.2255     0.7331 0.920 0.000 0.068 0.012
#> GSM254668     1  0.1356     0.7452 0.960 0.000 0.032 0.008
#> GSM254697     1  0.6528     0.5946 0.596 0.000 0.104 0.300
#> GSM254704     1  0.6488     0.5971 0.604 0.000 0.104 0.292
#> GSM254707     1  0.3453     0.7176 0.868 0.000 0.052 0.080
#> GSM254714     1  0.6273     0.5658 0.636 0.000 0.264 0.100
#> GSM254722     1  0.1610     0.7539 0.952 0.000 0.016 0.032
#> GSM254627     1  0.6350     0.6037 0.612 0.000 0.092 0.296
#> GSM254630     1  0.3768     0.6376 0.808 0.000 0.184 0.008
#> GSM254633     1  0.2888     0.6904 0.872 0.000 0.124 0.004
#> GSM254670     3  0.4482     0.8223 0.264 0.000 0.728 0.008
#> GSM254716     3  0.7489     0.5534 0.364 0.000 0.452 0.184
#> GSM254720     1  0.5798     0.6308 0.696 0.000 0.208 0.096
#> GSM254729     3  0.3088     0.8263 0.128 0.000 0.864 0.008
#> GSM254654     3  0.4015     0.8164 0.116 0.000 0.832 0.052
#> GSM254656     3  0.3818     0.8132 0.108 0.000 0.844 0.048
#> GSM254631     1  0.3306     0.6593 0.840 0.000 0.156 0.004
#> GSM254657     3  0.4122     0.8314 0.236 0.000 0.760 0.004
#> GSM254664     1  0.2342     0.7483 0.912 0.000 0.008 0.080
#> GSM254672     1  0.3052     0.7329 0.860 0.000 0.004 0.136
#> GSM254692     1  0.5522     0.6570 0.668 0.000 0.044 0.288
#> GSM254645     3  0.4295     0.8289 0.240 0.000 0.752 0.008
#> GSM254666     1  0.6064    -0.1533 0.512 0.000 0.444 0.044
#> GSM254675     1  0.1576     0.7532 0.948 0.000 0.004 0.048
#> GSM254678     1  0.2987     0.7051 0.880 0.000 0.104 0.016
#> GSM254688     1  0.1488     0.7446 0.956 0.000 0.032 0.012
#> GSM254690     1  0.0657     0.7477 0.984 0.000 0.012 0.004
#> GSM254696     1  0.4770     0.4297 0.700 0.000 0.288 0.012
#> GSM254705     1  0.1936     0.7494 0.940 0.000 0.028 0.032
#> GSM254642     1  0.6466     0.5998 0.608 0.000 0.104 0.288
#> GSM254661     3  0.5851     0.8230 0.236 0.000 0.680 0.084
#> GSM254698     1  0.3791     0.6044 0.796 0.000 0.200 0.004
#> GSM254641     1  0.1716     0.7381 0.936 0.000 0.064 0.000
#> GSM254647     1  0.4008     0.6891 0.756 0.000 0.000 0.244
#> GSM254663     1  0.3910     0.7312 0.820 0.000 0.024 0.156
#> GSM254682     1  0.3383     0.7203 0.872 0.000 0.052 0.076
#> GSM254709     1  0.3143     0.7446 0.876 0.000 0.024 0.100
#> GSM254721     1  0.6508     0.5961 0.600 0.000 0.104 0.296
#> GSM254724     1  0.6508     0.5961 0.600 0.000 0.104 0.296
#> GSM254650     1  0.3205     0.7454 0.872 0.000 0.024 0.104
#> GSM254687     1  0.2949     0.7483 0.888 0.000 0.024 0.088
#> GSM254637     1  0.5055     0.5289 0.712 0.000 0.256 0.032
#> GSM254684     1  0.5057     0.2918 0.648 0.000 0.340 0.012
#> GSM254649     2  0.0592     0.6252 0.000 0.984 0.000 0.016
#> GSM254660     2  0.3486     0.4452 0.000 0.812 0.000 0.188
#> GSM254693     2  0.0817     0.6211 0.000 0.976 0.000 0.024
#> GSM254695     4  0.6337     0.5102 0.000 0.468 0.060 0.472
#> GSM254702     2  0.4250     0.2449 0.000 0.724 0.000 0.276
#> GSM254643     2  0.0707     0.6276 0.000 0.980 0.000 0.020
#> GSM254727     2  0.1118     0.6252 0.000 0.964 0.000 0.036
#> GSM254640     2  0.3123     0.4981 0.000 0.844 0.000 0.156
#> GSM254626     2  0.0592     0.6242 0.000 0.984 0.000 0.016
#> GSM254635     2  0.5800    -0.3316 0.000 0.548 0.032 0.420
#> GSM254653     2  0.0469     0.6251 0.000 0.988 0.000 0.012
#> GSM254658     2  0.0592     0.6252 0.000 0.984 0.000 0.016
#> GSM254681     2  0.1557     0.6167 0.000 0.944 0.000 0.056
#> GSM254719     2  0.0592     0.6259 0.000 0.984 0.000 0.016
#> GSM254673     2  0.0336     0.6258 0.000 0.992 0.000 0.008
#> GSM254655     2  0.0817     0.6270 0.000 0.976 0.000 0.024
#> GSM254669     2  0.0469     0.6268 0.000 0.988 0.000 0.012
#> GSM254699     2  0.0817     0.6270 0.000 0.976 0.000 0.024
#> GSM254703     2  0.5183    -0.1629 0.000 0.584 0.008 0.408
#> GSM254708     2  0.5254     0.0921 0.000 0.672 0.028 0.300
#> GSM254715     2  0.4356     0.2150 0.000 0.708 0.000 0.292
#> GSM254628     2  0.0592     0.6252 0.000 0.984 0.000 0.016
#> GSM254634     2  0.5337    -0.2598 0.000 0.564 0.012 0.424
#> GSM254646     2  0.1211     0.6232 0.000 0.960 0.000 0.040
#> GSM254671     2  0.4790    -0.0380 0.000 0.620 0.000 0.380
#> GSM254711     2  0.4866    -0.1119 0.000 0.596 0.000 0.404
#> GSM254717     2  0.2408     0.5819 0.000 0.896 0.000 0.104
#> GSM254723     3  0.4155     0.7980 0.100 0.000 0.828 0.072
#> GSM254730     2  0.0592     0.6267 0.000 0.984 0.000 0.016
#> GSM254731     2  0.4304     0.2450 0.000 0.716 0.000 0.284
#> GSM254632     3  0.5102     0.7709 0.100 0.000 0.764 0.136
#> GSM254662     2  0.1022     0.6283 0.000 0.968 0.000 0.032
#> GSM254677     2  0.5821    -0.3923 0.000 0.536 0.032 0.432
#> GSM254665     2  0.2345     0.5880 0.000 0.900 0.000 0.100
#> GSM254691     2  0.3583     0.4858 0.000 0.816 0.004 0.180
#> GSM254644     2  0.4040     0.3353 0.000 0.752 0.000 0.248
#> GSM254667     4  0.6264     0.6168 0.000 0.376 0.064 0.560
#> GSM254676     2  0.2973     0.5324 0.000 0.856 0.000 0.144
#> GSM254679     2  0.4843    -0.0873 0.000 0.604 0.000 0.396
#> GSM254689     2  0.1557     0.6167 0.000 0.944 0.000 0.056
#> GSM254706     2  0.4238     0.4153 0.000 0.796 0.028 0.176
#> GSM254712     2  0.5050    -0.1443 0.000 0.588 0.004 0.408
#> GSM254713     2  0.4356     0.2150 0.000 0.708 0.000 0.292
#> GSM254683     2  0.3266     0.4995 0.000 0.832 0.000 0.168
#> GSM254710     3  0.8700     0.4395 0.104 0.136 0.496 0.264
#> GSM254725     2  0.5792    -0.3156 0.000 0.552 0.032 0.416
#> GSM254651     2  0.2868     0.5452 0.000 0.864 0.000 0.136
#> GSM254638     2  0.5815    -0.3716 0.000 0.540 0.032 0.428
#> GSM254685     2  0.4331     0.2203 0.000 0.712 0.000 0.288

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM254629     3  0.0404     0.9233 0.000 0.000 0.988 0.000 0.012
#> GSM254648     3  0.0162     0.9215 0.000 0.000 0.996 0.004 0.000
#> GSM254694     3  0.0162     0.9215 0.000 0.000 0.996 0.004 0.000
#> GSM254701     3  0.1671     0.8770 0.000 0.000 0.924 0.000 0.076
#> GSM254728     3  0.3242     0.7191 0.000 0.000 0.784 0.000 0.216
#> GSM254726     3  0.0510     0.9179 0.000 0.000 0.984 0.016 0.000
#> GSM254639     3  0.0807     0.9231 0.000 0.000 0.976 0.012 0.012
#> GSM254652     3  0.0609     0.9213 0.000 0.000 0.980 0.000 0.020
#> GSM254700     1  0.0703     0.9857 0.976 0.000 0.000 0.000 0.024
#> GSM254625     3  0.2264     0.8906 0.024 0.000 0.912 0.004 0.060
#> GSM254636     5  0.1106     0.9267 0.012 0.000 0.024 0.000 0.964
#> GSM254659     3  0.3837     0.5584 0.000 0.000 0.692 0.000 0.308
#> GSM254680     5  0.0566     0.9316 0.012 0.000 0.004 0.000 0.984
#> GSM254686     5  0.3074     0.7697 0.000 0.000 0.196 0.000 0.804
#> GSM254718     3  0.0609     0.9212 0.000 0.000 0.980 0.000 0.020
#> GSM254674     5  0.0671     0.9315 0.004 0.000 0.016 0.000 0.980
#> GSM254668     5  0.0000     0.9296 0.000 0.000 0.000 0.000 1.000
#> GSM254697     1  0.0794     0.9827 0.972 0.000 0.000 0.000 0.028
#> GSM254704     1  0.0703     0.9857 0.976 0.000 0.000 0.000 0.024
#> GSM254707     5  0.0000     0.9296 0.000 0.000 0.000 0.000 1.000
#> GSM254714     5  0.4527     0.6065 0.036 0.000 0.272 0.000 0.692
#> GSM254722     5  0.1059     0.9314 0.020 0.000 0.008 0.004 0.968
#> GSM254627     1  0.0703     0.9857 0.976 0.000 0.000 0.000 0.024
#> GSM254630     5  0.2648     0.8072 0.000 0.000 0.152 0.000 0.848
#> GSM254633     5  0.0693     0.9315 0.012 0.000 0.008 0.000 0.980
#> GSM254670     3  0.0807     0.9231 0.000 0.000 0.976 0.012 0.012
#> GSM254716     3  0.4000     0.7083 0.024 0.000 0.748 0.000 0.228
#> GSM254720     5  0.0898     0.9309 0.020 0.000 0.008 0.000 0.972
#> GSM254729     3  0.0290     0.9232 0.000 0.000 0.992 0.000 0.008
#> GSM254654     3  0.0162     0.9215 0.000 0.000 0.996 0.004 0.000
#> GSM254656     3  0.1430     0.9028 0.000 0.000 0.944 0.052 0.004
#> GSM254631     5  0.0693     0.9315 0.012 0.000 0.008 0.000 0.980
#> GSM254657     3  0.0404     0.9233 0.000 0.000 0.988 0.000 0.012
#> GSM254664     5  0.0865     0.9285 0.024 0.000 0.004 0.000 0.972
#> GSM254672     5  0.1671     0.9018 0.076 0.000 0.000 0.000 0.924
#> GSM254692     1  0.2127     0.9111 0.892 0.000 0.000 0.000 0.108
#> GSM254645     3  0.0404     0.9233 0.000 0.000 0.988 0.000 0.012
#> GSM254666     5  0.4101     0.4398 0.000 0.000 0.372 0.000 0.628
#> GSM254675     5  0.0794     0.9281 0.028 0.000 0.000 0.000 0.972
#> GSM254678     5  0.0960     0.9319 0.016 0.000 0.008 0.004 0.972
#> GSM254688     5  0.0324     0.9293 0.004 0.000 0.000 0.004 0.992
#> GSM254690     5  0.0693     0.9315 0.012 0.000 0.008 0.000 0.980
#> GSM254696     5  0.1197     0.9146 0.000 0.000 0.048 0.000 0.952
#> GSM254705     5  0.0451     0.9288 0.008 0.000 0.000 0.004 0.988
#> GSM254642     1  0.0794     0.9835 0.972 0.000 0.000 0.000 0.028
#> GSM254661     3  0.0807     0.9231 0.000 0.000 0.976 0.012 0.012
#> GSM254698     5  0.1018     0.9311 0.016 0.000 0.016 0.000 0.968
#> GSM254641     5  0.0807     0.9313 0.012 0.000 0.012 0.000 0.976
#> GSM254647     5  0.3796     0.6157 0.300 0.000 0.000 0.000 0.700
#> GSM254663     5  0.1478     0.8985 0.064 0.000 0.000 0.000 0.936
#> GSM254682     5  0.0324     0.9293 0.004 0.000 0.000 0.004 0.992
#> GSM254709     5  0.0290     0.9291 0.008 0.000 0.000 0.000 0.992
#> GSM254721     1  0.0703     0.9857 0.976 0.000 0.000 0.000 0.024
#> GSM254724     1  0.0703     0.9857 0.976 0.000 0.000 0.000 0.024
#> GSM254650     5  0.0671     0.9275 0.016 0.000 0.000 0.004 0.980
#> GSM254687     5  0.0671     0.9275 0.016 0.000 0.000 0.004 0.980
#> GSM254637     5  0.1485     0.9219 0.020 0.000 0.032 0.000 0.948
#> GSM254684     5  0.2124     0.8778 0.004 0.000 0.096 0.000 0.900
#> GSM254649     2  0.0609     0.8058 0.000 0.980 0.000 0.020 0.000
#> GSM254660     2  0.2329     0.7755 0.000 0.876 0.000 0.124 0.000
#> GSM254693     2  0.0290     0.8050 0.000 0.992 0.000 0.008 0.000
#> GSM254695     4  0.1331     0.7913 0.000 0.040 0.008 0.952 0.000
#> GSM254702     2  0.1732     0.7624 0.000 0.920 0.000 0.080 0.000
#> GSM254643     2  0.2280     0.7746 0.000 0.880 0.000 0.120 0.000
#> GSM254727     2  0.0404     0.8032 0.000 0.988 0.000 0.012 0.000
#> GSM254640     2  0.0290     0.8052 0.000 0.992 0.000 0.008 0.000
#> GSM254626     2  0.0162     0.8062 0.000 0.996 0.000 0.004 0.000
#> GSM254635     4  0.2707     0.8345 0.000 0.132 0.008 0.860 0.000
#> GSM254653     2  0.0162     0.8062 0.000 0.996 0.000 0.004 0.000
#> GSM254658     2  0.1544     0.8001 0.000 0.932 0.000 0.068 0.000
#> GSM254681     2  0.3074     0.7280 0.000 0.804 0.000 0.196 0.000
#> GSM254719     2  0.0000     0.8065 0.000 1.000 0.000 0.000 0.000
#> GSM254673     2  0.0162     0.8079 0.000 0.996 0.000 0.004 0.000
#> GSM254655     2  0.0000     0.8065 0.000 1.000 0.000 0.000 0.000
#> GSM254669     2  0.0162     0.8077 0.000 0.996 0.000 0.004 0.000
#> GSM254699     2  0.0000     0.8065 0.000 1.000 0.000 0.000 0.000
#> GSM254703     4  0.3366     0.7766 0.000 0.232 0.000 0.768 0.000
#> GSM254708     4  0.3700     0.7455 0.000 0.240 0.008 0.752 0.000
#> GSM254715     2  0.4060     0.4485 0.000 0.640 0.000 0.360 0.000
#> GSM254628     2  0.1792     0.7953 0.000 0.916 0.000 0.084 0.000
#> GSM254634     4  0.2233     0.8344 0.000 0.104 0.004 0.892 0.000
#> GSM254646     2  0.2891     0.7446 0.000 0.824 0.000 0.176 0.000
#> GSM254671     2  0.4242     0.2718 0.000 0.572 0.000 0.428 0.000
#> GSM254711     4  0.3707     0.7124 0.000 0.284 0.000 0.716 0.000
#> GSM254717     2  0.3039     0.7324 0.000 0.808 0.000 0.192 0.000
#> GSM254723     3  0.0162     0.9215 0.000 0.000 0.996 0.004 0.000
#> GSM254730     2  0.0000     0.8065 0.000 1.000 0.000 0.000 0.000
#> GSM254731     2  0.1732     0.7624 0.000 0.920 0.000 0.080 0.000
#> GSM254632     3  0.0162     0.9215 0.000 0.000 0.996 0.004 0.000
#> GSM254662     2  0.0290     0.8080 0.000 0.992 0.000 0.008 0.000
#> GSM254677     4  0.1830     0.8171 0.000 0.068 0.008 0.924 0.000
#> GSM254665     2  0.3561     0.6354 0.000 0.740 0.000 0.260 0.000
#> GSM254691     2  0.4273     0.0974 0.000 0.552 0.000 0.448 0.000
#> GSM254644     2  0.1043     0.7938 0.000 0.960 0.000 0.040 0.000
#> GSM254667     4  0.3053     0.7760 0.000 0.164 0.008 0.828 0.000
#> GSM254676     2  0.4249     0.1651 0.000 0.568 0.000 0.432 0.000
#> GSM254679     4  0.3636     0.7352 0.000 0.272 0.000 0.728 0.000
#> GSM254689     2  0.3074     0.7280 0.000 0.804 0.000 0.196 0.000
#> GSM254706     4  0.4367     0.5062 0.000 0.372 0.008 0.620 0.000
#> GSM254712     4  0.3366     0.7766 0.000 0.232 0.000 0.768 0.000
#> GSM254713     2  0.4219     0.2856 0.000 0.584 0.000 0.416 0.000
#> GSM254683     2  0.4227     0.2455 0.000 0.580 0.000 0.420 0.000
#> GSM254710     3  0.4275     0.6667 0.024 0.008 0.740 0.228 0.000
#> GSM254725     4  0.2411     0.8355 0.000 0.108 0.008 0.884 0.000
#> GSM254651     2  0.3949     0.4995 0.000 0.668 0.000 0.332 0.000
#> GSM254638     4  0.2017     0.8247 0.000 0.080 0.008 0.912 0.000
#> GSM254685     2  0.3366     0.6852 0.000 0.768 0.000 0.232 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM254629     3  0.2020    0.68288 0.000 0.000 0.896 0.000 0.008 0.096
#> GSM254648     6  0.3607    0.91804 0.000 0.000 0.348 0.000 0.000 0.652
#> GSM254694     3  0.3797   -0.29501 0.000 0.000 0.580 0.000 0.000 0.420
#> GSM254701     3  0.1950    0.67320 0.000 0.000 0.912 0.000 0.064 0.024
#> GSM254728     3  0.0547    0.70677 0.000 0.000 0.980 0.000 0.020 0.000
#> GSM254726     6  0.3620    0.91519 0.000 0.000 0.352 0.000 0.000 0.648
#> GSM254639     3  0.1672    0.71658 0.000 0.000 0.932 0.004 0.016 0.048
#> GSM254652     3  0.1616    0.71765 0.000 0.000 0.932 0.000 0.020 0.048
#> GSM254700     1  0.0363    0.96516 0.988 0.000 0.000 0.000 0.012 0.000
#> GSM254625     3  0.4297    0.47739 0.000 0.000 0.724 0.000 0.176 0.100
#> GSM254636     5  0.3720    0.79846 0.000 0.000 0.236 0.000 0.736 0.028
#> GSM254659     3  0.1204    0.67396 0.000 0.000 0.944 0.000 0.056 0.000
#> GSM254680     5  0.2505    0.82173 0.008 0.000 0.092 0.000 0.880 0.020
#> GSM254686     5  0.4015    0.62297 0.000 0.000 0.372 0.000 0.616 0.012
#> GSM254718     3  0.1257    0.70935 0.000 0.000 0.952 0.000 0.020 0.028
#> GSM254674     5  0.3248    0.80944 0.004 0.000 0.224 0.000 0.768 0.004
#> GSM254668     5  0.1370    0.78132 0.000 0.000 0.012 0.004 0.948 0.036
#> GSM254697     1  0.0363    0.96516 0.988 0.000 0.000 0.000 0.012 0.000
#> GSM254704     1  0.0363    0.96158 0.988 0.000 0.000 0.000 0.012 0.000
#> GSM254707     5  0.2113    0.78261 0.000 0.000 0.060 0.004 0.908 0.028
#> GSM254714     5  0.4203    0.76559 0.056 0.000 0.220 0.000 0.720 0.004
#> GSM254722     5  0.3568    0.82581 0.008 0.000 0.172 0.000 0.788 0.032
#> GSM254627     1  0.0363    0.96516 0.988 0.000 0.000 0.000 0.012 0.000
#> GSM254630     5  0.3187    0.79233 0.004 0.000 0.188 0.000 0.796 0.012
#> GSM254633     5  0.3454    0.80847 0.004 0.000 0.224 0.000 0.760 0.012
#> GSM254670     3  0.1760    0.71719 0.000 0.000 0.928 0.004 0.020 0.048
#> GSM254716     3  0.4297    0.47739 0.000 0.000 0.724 0.000 0.176 0.100
#> GSM254720     5  0.3053    0.82645 0.024 0.000 0.144 0.000 0.828 0.004
#> GSM254729     3  0.3052    0.51495 0.000 0.000 0.780 0.000 0.004 0.216
#> GSM254654     3  0.3867   -0.53646 0.000 0.000 0.512 0.000 0.000 0.488
#> GSM254656     6  0.3984    0.90288 0.000 0.000 0.336 0.016 0.000 0.648
#> GSM254631     5  0.2841    0.82611 0.012 0.000 0.164 0.000 0.824 0.000
#> GSM254657     3  0.1812    0.69835 0.000 0.000 0.912 0.000 0.008 0.080
#> GSM254664     5  0.3564    0.82475 0.040 0.000 0.136 0.000 0.808 0.016
#> GSM254672     5  0.3875    0.78512 0.144 0.000 0.068 0.000 0.780 0.008
#> GSM254692     1  0.3189    0.78143 0.796 0.000 0.000 0.000 0.184 0.020
#> GSM254645     3  0.1124    0.71152 0.000 0.000 0.956 0.000 0.008 0.036
#> GSM254666     3  0.3819    0.00365 0.000 0.000 0.624 0.000 0.372 0.004
#> GSM254675     5  0.3580    0.82559 0.036 0.000 0.136 0.000 0.808 0.020
#> GSM254678     5  0.3268    0.82671 0.008 0.000 0.164 0.000 0.808 0.020
#> GSM254688     5  0.2596    0.75277 0.004 0.000 0.016 0.004 0.872 0.104
#> GSM254690     5  0.3018    0.82469 0.004 0.000 0.168 0.000 0.816 0.012
#> GSM254696     5  0.3617    0.79568 0.000 0.000 0.244 0.000 0.736 0.020
#> GSM254705     5  0.3074    0.67853 0.004 0.000 0.000 0.004 0.792 0.200
#> GSM254642     1  0.0458    0.96249 0.984 0.000 0.000 0.000 0.016 0.000
#> GSM254661     3  0.2191    0.65976 0.000 0.000 0.876 0.000 0.004 0.120
#> GSM254698     5  0.3888    0.80563 0.008 0.000 0.224 0.000 0.740 0.028
#> GSM254641     5  0.2737    0.82663 0.004 0.000 0.160 0.000 0.832 0.004
#> GSM254647     5  0.4394    0.16394 0.484 0.000 0.004 0.000 0.496 0.016
#> GSM254663     5  0.3907    0.66464 0.088 0.000 0.000 0.004 0.776 0.132
#> GSM254682     5  0.3386    0.75204 0.004 0.000 0.064 0.004 0.828 0.100
#> GSM254709     5  0.2320    0.72802 0.004 0.000 0.000 0.000 0.864 0.132
#> GSM254721     1  0.0146    0.96089 0.996 0.000 0.000 0.000 0.004 0.000
#> GSM254724     1  0.0146    0.96089 0.996 0.000 0.000 0.000 0.004 0.000
#> GSM254650     5  0.3248    0.65711 0.004 0.000 0.000 0.004 0.768 0.224
#> GSM254687     5  0.3248    0.65711 0.004 0.000 0.000 0.004 0.768 0.224
#> GSM254637     5  0.3122    0.82665 0.020 0.000 0.160 0.000 0.816 0.004
#> GSM254684     5  0.3859    0.75863 0.000 0.000 0.288 0.000 0.692 0.020
#> GSM254649     2  0.1116    0.77802 0.000 0.960 0.004 0.008 0.000 0.028
#> GSM254660     2  0.2778    0.69872 0.000 0.824 0.000 0.168 0.000 0.008
#> GSM254693     2  0.0363    0.78008 0.000 0.988 0.000 0.000 0.000 0.012
#> GSM254695     4  0.1391    0.75876 0.000 0.040 0.000 0.944 0.000 0.016
#> GSM254702     2  0.2823    0.64232 0.000 0.796 0.000 0.204 0.000 0.000
#> GSM254643     2  0.1434    0.77452 0.000 0.940 0.000 0.048 0.000 0.012
#> GSM254727     2  0.0603    0.77987 0.000 0.980 0.004 0.000 0.000 0.016
#> GSM254640     2  0.0632    0.77752 0.000 0.976 0.000 0.024 0.000 0.000
#> GSM254626     2  0.0260    0.78007 0.000 0.992 0.000 0.000 0.000 0.008
#> GSM254635     4  0.2513    0.80692 0.000 0.140 0.000 0.852 0.000 0.008
#> GSM254653     2  0.0000    0.78042 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM254658     2  0.1313    0.77705 0.000 0.952 0.004 0.016 0.000 0.028
#> GSM254681     2  0.4023    0.64164 0.004 0.756 0.004 0.184 0.000 0.052
#> GSM254719     2  0.0260    0.78109 0.000 0.992 0.000 0.008 0.000 0.000
#> GSM254673     2  0.0291    0.78120 0.000 0.992 0.000 0.004 0.000 0.004
#> GSM254655     2  0.0363    0.78055 0.000 0.988 0.000 0.012 0.000 0.000
#> GSM254669     2  0.0260    0.78183 0.000 0.992 0.000 0.008 0.000 0.000
#> GSM254699     2  0.0458    0.77999 0.000 0.984 0.000 0.016 0.000 0.000
#> GSM254703     4  0.2178    0.80142 0.000 0.132 0.000 0.868 0.000 0.000
#> GSM254708     4  0.4010    0.43397 0.000 0.408 0.000 0.584 0.000 0.008
#> GSM254715     2  0.3774    0.46190 0.000 0.664 0.000 0.328 0.000 0.008
#> GSM254628     2  0.1401    0.77613 0.000 0.948 0.004 0.020 0.000 0.028
#> GSM254634     4  0.2520    0.80175 0.000 0.152 0.000 0.844 0.000 0.004
#> GSM254646     2  0.3761    0.66949 0.004 0.784 0.004 0.160 0.000 0.048
#> GSM254671     2  0.3634    0.45414 0.000 0.644 0.000 0.356 0.000 0.000
#> GSM254711     4  0.3445    0.68315 0.000 0.260 0.000 0.732 0.000 0.008
#> GSM254717     2  0.3549    0.65096 0.004 0.784 0.004 0.184 0.000 0.024
#> GSM254723     6  0.3620    0.91519 0.000 0.000 0.352 0.000 0.000 0.648
#> GSM254730     2  0.0405    0.78089 0.000 0.988 0.000 0.008 0.000 0.004
#> GSM254731     2  0.2762    0.64751 0.000 0.804 0.000 0.196 0.000 0.000
#> GSM254632     6  0.3607    0.91804 0.000 0.000 0.348 0.000 0.000 0.652
#> GSM254662     2  0.0146    0.78064 0.000 0.996 0.000 0.004 0.000 0.000
#> GSM254677     4  0.1701    0.78890 0.000 0.072 0.000 0.920 0.000 0.008
#> GSM254665     2  0.3789    0.39704 0.000 0.660 0.000 0.332 0.000 0.008
#> GSM254691     2  0.3979   -0.06230 0.000 0.540 0.000 0.456 0.000 0.004
#> GSM254644     2  0.2100    0.72373 0.000 0.884 0.000 0.112 0.000 0.004
#> GSM254667     4  0.4121    0.65128 0.000 0.208 0.004 0.732 0.000 0.056
#> GSM254676     2  0.3823    0.02675 0.000 0.564 0.000 0.436 0.000 0.000
#> GSM254679     4  0.3288    0.66274 0.000 0.276 0.000 0.724 0.000 0.000
#> GSM254689     2  0.3962    0.64055 0.004 0.760 0.004 0.184 0.000 0.048
#> GSM254706     4  0.4338    0.16205 0.000 0.488 0.000 0.492 0.000 0.020
#> GSM254712     4  0.2234    0.80084 0.000 0.124 0.000 0.872 0.000 0.004
#> GSM254713     2  0.4039    0.26393 0.000 0.568 0.000 0.424 0.000 0.008
#> GSM254683     2  0.4918    0.02159 0.004 0.536 0.004 0.412 0.000 0.044
#> GSM254710     6  0.5201    0.69854 0.000 0.012 0.196 0.128 0.004 0.660
#> GSM254725     4  0.2613    0.80712 0.000 0.140 0.000 0.848 0.000 0.012
#> GSM254651     2  0.4117    0.53171 0.004 0.708 0.004 0.256 0.000 0.028
#> GSM254638     4  0.1802    0.78861 0.000 0.072 0.000 0.916 0.000 0.012
#> GSM254685     2  0.3575    0.57672 0.000 0.708 0.000 0.284 0.000 0.008

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

consensus_heatmap(res, k = 2)

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

consensus_heatmap(res, k = 3)

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

consensus_heatmap(res, k = 4)

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

consensus_heatmap(res, k = 5)

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

consensus_heatmap(res, k = 6)

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

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

membership_heatmap(res, k = 2)

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

membership_heatmap(res, k = 3)

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

membership_heatmap(res, k = 4)

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

membership_heatmap(res, k = 5)

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

membership_heatmap(res, k = 6)

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

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

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

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

get_signatures(res, k = 3)

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

get_signatures(res, k = 4)

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

get_signatures(res, k = 5)

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

get_signatures(res, k = 6)

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

Signature heatmaps where rows are not scaled:

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

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

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

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

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

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

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

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

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

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

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk CV-mclust-signature_compare

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

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

An example of the output of tb is:

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

The columns in tb are:

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

UMAP plot which shows how samples are separated.

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

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

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

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

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

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

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

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

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

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

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk CV-mclust-collect-classes

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

test_to_known_factors(res)
#>             n tissue(p) individual(p) disease.state(p) gender(p) other(p) k
#> CV:mclust 107  1.00e-21       0.64037            0.454     0.733    0.961 2
#> CV:mclust  99  1.14e-20       0.00566            0.511     0.034    0.779 3
#> CV:mclust  81  1.13e-15       0.00632            0.683     0.248    0.779 4
#> CV:mclust  99  2.89e-18       0.00570            0.634     0.248    0.447 5
#> CV:mclust  92  4.88e-17       0.03193            0.913     0.293    0.559 6

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


CV:NMF**

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

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

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

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

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

collect_plots(res)

plot of chunk CV-NMF-collect-plots

The plots are:

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

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

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

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

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 1.000           0.972       0.988         0.5036 0.497   0.497
#> 3 3 0.601           0.632       0.811         0.2388 0.935   0.871
#> 4 4 0.670           0.703       0.835         0.1397 0.822   0.608
#> 5 5 0.735           0.719       0.850         0.0502 0.921   0.753
#> 6 6 0.740           0.681       0.829         0.0385 0.968   0.886

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
#> GSM254629     1   0.000      0.982 1.000 0.000
#> GSM254648     2   0.141      0.976 0.020 0.980
#> GSM254694     1   0.689      0.776 0.816 0.184
#> GSM254701     1   0.000      0.982 1.000 0.000
#> GSM254728     1   0.000      0.982 1.000 0.000
#> GSM254726     1   0.595      0.828 0.856 0.144
#> GSM254639     1   0.000      0.982 1.000 0.000
#> GSM254652     1   0.000      0.982 1.000 0.000
#> GSM254700     1   0.000      0.982 1.000 0.000
#> GSM254625     1   0.000      0.982 1.000 0.000
#> GSM254636     1   0.000      0.982 1.000 0.000
#> GSM254659     1   0.000      0.982 1.000 0.000
#> GSM254680     1   0.000      0.982 1.000 0.000
#> GSM254686     1   0.000      0.982 1.000 0.000
#> GSM254718     1   0.000      0.982 1.000 0.000
#> GSM254674     1   0.000      0.982 1.000 0.000
#> GSM254668     1   0.000      0.982 1.000 0.000
#> GSM254697     1   0.000      0.982 1.000 0.000
#> GSM254704     1   0.000      0.982 1.000 0.000
#> GSM254707     1   0.000      0.982 1.000 0.000
#> GSM254714     1   0.000      0.982 1.000 0.000
#> GSM254722     1   0.000      0.982 1.000 0.000
#> GSM254627     1   0.000      0.982 1.000 0.000
#> GSM254630     1   0.000      0.982 1.000 0.000
#> GSM254633     1   0.000      0.982 1.000 0.000
#> GSM254670     1   0.000      0.982 1.000 0.000
#> GSM254716     1   0.000      0.982 1.000 0.000
#> GSM254720     1   0.000      0.982 1.000 0.000
#> GSM254729     1   0.000      0.982 1.000 0.000
#> GSM254654     1   0.714      0.759 0.804 0.196
#> GSM254656     1   0.996      0.136 0.536 0.464
#> GSM254631     1   0.000      0.982 1.000 0.000
#> GSM254657     1   0.000      0.982 1.000 0.000
#> GSM254664     1   0.000      0.982 1.000 0.000
#> GSM254672     1   0.000      0.982 1.000 0.000
#> GSM254692     1   0.000      0.982 1.000 0.000
#> GSM254645     1   0.000      0.982 1.000 0.000
#> GSM254666     1   0.000      0.982 1.000 0.000
#> GSM254675     1   0.000      0.982 1.000 0.000
#> GSM254678     1   0.000      0.982 1.000 0.000
#> GSM254688     1   0.000      0.982 1.000 0.000
#> GSM254690     1   0.000      0.982 1.000 0.000
#> GSM254696     1   0.000      0.982 1.000 0.000
#> GSM254705     1   0.000      0.982 1.000 0.000
#> GSM254642     1   0.000      0.982 1.000 0.000
#> GSM254661     1   0.000      0.982 1.000 0.000
#> GSM254698     1   0.000      0.982 1.000 0.000
#> GSM254641     1   0.000      0.982 1.000 0.000
#> GSM254647     1   0.000      0.982 1.000 0.000
#> GSM254663     1   0.000      0.982 1.000 0.000
#> GSM254682     1   0.000      0.982 1.000 0.000
#> GSM254709     1   0.000      0.982 1.000 0.000
#> GSM254721     1   0.000      0.982 1.000 0.000
#> GSM254724     1   0.000      0.982 1.000 0.000
#> GSM254650     1   0.000      0.982 1.000 0.000
#> GSM254687     1   0.000      0.982 1.000 0.000
#> GSM254637     1   0.000      0.982 1.000 0.000
#> GSM254684     1   0.000      0.982 1.000 0.000
#> GSM254649     2   0.000      0.995 0.000 1.000
#> GSM254660     2   0.000      0.995 0.000 1.000
#> GSM254693     2   0.000      0.995 0.000 1.000
#> GSM254695     2   0.000      0.995 0.000 1.000
#> GSM254702     2   0.000      0.995 0.000 1.000
#> GSM254643     2   0.000      0.995 0.000 1.000
#> GSM254727     2   0.000      0.995 0.000 1.000
#> GSM254640     2   0.000      0.995 0.000 1.000
#> GSM254626     2   0.000      0.995 0.000 1.000
#> GSM254635     2   0.000      0.995 0.000 1.000
#> GSM254653     2   0.000      0.995 0.000 1.000
#> GSM254658     2   0.000      0.995 0.000 1.000
#> GSM254681     2   0.000      0.995 0.000 1.000
#> GSM254719     2   0.000      0.995 0.000 1.000
#> GSM254673     2   0.000      0.995 0.000 1.000
#> GSM254655     2   0.000      0.995 0.000 1.000
#> GSM254669     2   0.000      0.995 0.000 1.000
#> GSM254699     2   0.000      0.995 0.000 1.000
#> GSM254703     2   0.000      0.995 0.000 1.000
#> GSM254708     2   0.000      0.995 0.000 1.000
#> GSM254715     2   0.000      0.995 0.000 1.000
#> GSM254628     2   0.000      0.995 0.000 1.000
#> GSM254634     2   0.000      0.995 0.000 1.000
#> GSM254646     2   0.000      0.995 0.000 1.000
#> GSM254671     2   0.000      0.995 0.000 1.000
#> GSM254711     2   0.000      0.995 0.000 1.000
#> GSM254717     2   0.000      0.995 0.000 1.000
#> GSM254723     2   0.358      0.925 0.068 0.932
#> GSM254730     2   0.000      0.995 0.000 1.000
#> GSM254731     2   0.000      0.995 0.000 1.000
#> GSM254632     2   0.634      0.806 0.160 0.840
#> GSM254662     2   0.000      0.995 0.000 1.000
#> GSM254677     2   0.000      0.995 0.000 1.000
#> GSM254665     2   0.000      0.995 0.000 1.000
#> GSM254691     2   0.000      0.995 0.000 1.000
#> GSM254644     2   0.000      0.995 0.000 1.000
#> GSM254667     2   0.000      0.995 0.000 1.000
#> GSM254676     2   0.000      0.995 0.000 1.000
#> GSM254679     2   0.000      0.995 0.000 1.000
#> GSM254689     2   0.000      0.995 0.000 1.000
#> GSM254706     2   0.000      0.995 0.000 1.000
#> GSM254712     2   0.000      0.995 0.000 1.000
#> GSM254713     2   0.000      0.995 0.000 1.000
#> GSM254683     2   0.000      0.995 0.000 1.000
#> GSM254710     2   0.000      0.995 0.000 1.000
#> GSM254725     2   0.000      0.995 0.000 1.000
#> GSM254651     2   0.000      0.995 0.000 1.000
#> GSM254638     2   0.000      0.995 0.000 1.000
#> GSM254685     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
#> GSM254629     3  0.6252    -0.1807 0.444 0.000 0.556
#> GSM254648     3  0.6521    -0.2524 0.004 0.496 0.500
#> GSM254694     1  0.9072     0.2113 0.532 0.168 0.300
#> GSM254701     1  0.5529     0.6443 0.704 0.000 0.296
#> GSM254728     1  0.5968     0.5915 0.636 0.000 0.364
#> GSM254726     3  0.8887    -0.2963 0.424 0.120 0.456
#> GSM254639     1  0.6302     0.4349 0.520 0.000 0.480
#> GSM254652     1  0.5785     0.6132 0.668 0.000 0.332
#> GSM254700     1  0.0424     0.7003 0.992 0.000 0.008
#> GSM254625     3  0.6026     0.0677 0.376 0.000 0.624
#> GSM254636     1  0.5733     0.6233 0.676 0.000 0.324
#> GSM254659     1  0.5905     0.6014 0.648 0.000 0.352
#> GSM254680     1  0.4121     0.6946 0.832 0.000 0.168
#> GSM254686     1  0.5016     0.6714 0.760 0.000 0.240
#> GSM254718     1  0.6168     0.5361 0.588 0.000 0.412
#> GSM254674     1  0.4062     0.6942 0.836 0.000 0.164
#> GSM254668     1  0.4504     0.6870 0.804 0.000 0.196
#> GSM254697     1  0.0747     0.6989 0.984 0.000 0.016
#> GSM254704     1  0.0892     0.7041 0.980 0.000 0.020
#> GSM254707     1  0.6274     0.2702 0.544 0.000 0.456
#> GSM254714     1  0.1643     0.7030 0.956 0.000 0.044
#> GSM254722     1  0.0747     0.7060 0.984 0.000 0.016
#> GSM254627     1  0.0747     0.6989 0.984 0.000 0.016
#> GSM254630     1  0.4178     0.6928 0.828 0.000 0.172
#> GSM254633     1  0.5254     0.6602 0.736 0.000 0.264
#> GSM254670     1  0.6180     0.5351 0.584 0.000 0.416
#> GSM254716     3  0.5098     0.1826 0.248 0.000 0.752
#> GSM254720     1  0.1031     0.7039 0.976 0.000 0.024
#> GSM254729     1  0.6516     0.4264 0.516 0.004 0.480
#> GSM254654     1  0.9424     0.0817 0.504 0.228 0.268
#> GSM254656     3  0.9268     0.2084 0.168 0.348 0.484
#> GSM254631     1  0.0747     0.7078 0.984 0.000 0.016
#> GSM254657     1  0.6291     0.4554 0.532 0.000 0.468
#> GSM254664     1  0.0747     0.7015 0.984 0.000 0.016
#> GSM254672     1  0.2165     0.6893 0.936 0.000 0.064
#> GSM254692     1  0.4399     0.5009 0.812 0.000 0.188
#> GSM254645     1  0.6140     0.5204 0.596 0.000 0.404
#> GSM254666     1  0.5905     0.6123 0.648 0.000 0.352
#> GSM254675     1  0.0237     0.7031 0.996 0.000 0.004
#> GSM254678     1  0.1031     0.7040 0.976 0.000 0.024
#> GSM254688     1  0.4346     0.6822 0.816 0.000 0.184
#> GSM254690     1  0.3038     0.7084 0.896 0.000 0.104
#> GSM254696     1  0.5859     0.6086 0.656 0.000 0.344
#> GSM254705     1  0.2165     0.6688 0.936 0.000 0.064
#> GSM254642     1  0.2165     0.6693 0.936 0.000 0.064
#> GSM254661     1  0.5835     0.6101 0.660 0.000 0.340
#> GSM254698     1  0.5327     0.6499 0.728 0.000 0.272
#> GSM254641     1  0.4452     0.6880 0.808 0.000 0.192
#> GSM254647     1  0.0424     0.7003 0.992 0.000 0.008
#> GSM254663     1  0.2356     0.6585 0.928 0.000 0.072
#> GSM254682     1  0.4504     0.6802 0.804 0.000 0.196
#> GSM254709     1  0.6291    -0.0768 0.532 0.000 0.468
#> GSM254721     1  0.0424     0.7003 0.992 0.000 0.008
#> GSM254724     1  0.0424     0.7003 0.992 0.000 0.008
#> GSM254650     1  0.6225    -0.0213 0.568 0.000 0.432
#> GSM254687     1  0.5926     0.1475 0.644 0.000 0.356
#> GSM254637     1  0.1289     0.7052 0.968 0.000 0.032
#> GSM254684     1  0.5706     0.6259 0.680 0.000 0.320
#> GSM254649     2  0.4654     0.7233 0.000 0.792 0.208
#> GSM254660     2  0.0000     0.8668 0.000 1.000 0.000
#> GSM254693     2  0.1860     0.8564 0.000 0.948 0.052
#> GSM254695     2  0.3551     0.8085 0.000 0.868 0.132
#> GSM254702     2  0.2165     0.8505 0.000 0.936 0.064
#> GSM254643     2  0.1860     0.8564 0.000 0.948 0.052
#> GSM254727     2  0.0892     0.8657 0.000 0.980 0.020
#> GSM254640     2  0.0237     0.8665 0.000 0.996 0.004
#> GSM254626     2  0.2066     0.8526 0.000 0.940 0.060
#> GSM254635     2  0.3686     0.8015 0.000 0.860 0.140
#> GSM254653     2  0.0892     0.8657 0.000 0.980 0.020
#> GSM254658     2  0.4235     0.7595 0.000 0.824 0.176
#> GSM254681     2  0.6291     0.2330 0.000 0.532 0.468
#> GSM254719     2  0.0592     0.8667 0.000 0.988 0.012
#> GSM254673     2  0.1529     0.8605 0.000 0.960 0.040
#> GSM254655     2  0.0000     0.8668 0.000 1.000 0.000
#> GSM254669     2  0.1860     0.8564 0.000 0.948 0.052
#> GSM254699     2  0.0000     0.8668 0.000 1.000 0.000
#> GSM254703     2  0.2711     0.8398 0.000 0.912 0.088
#> GSM254708     2  0.0892     0.8657 0.000 0.980 0.020
#> GSM254715     2  0.2796     0.8378 0.000 0.908 0.092
#> GSM254628     2  0.3686     0.7944 0.000 0.860 0.140
#> GSM254634     2  0.2796     0.8378 0.000 0.908 0.092
#> GSM254646     2  0.6180     0.3646 0.000 0.584 0.416
#> GSM254671     2  0.2448     0.8455 0.000 0.924 0.076
#> GSM254711     2  0.2796     0.8378 0.000 0.908 0.092
#> GSM254717     2  0.1031     0.8650 0.000 0.976 0.024
#> GSM254723     2  0.5201     0.6665 0.004 0.760 0.236
#> GSM254730     2  0.0237     0.8665 0.000 0.996 0.004
#> GSM254731     2  0.1163     0.8622 0.000 0.972 0.028
#> GSM254632     2  0.7097     0.5215 0.052 0.668 0.280
#> GSM254662     2  0.0747     0.8663 0.000 0.984 0.016
#> GSM254677     2  0.4002     0.7811 0.000 0.840 0.160
#> GSM254665     2  0.2066     0.8526 0.000 0.940 0.060
#> GSM254691     2  0.0747     0.8666 0.000 0.984 0.016
#> GSM254644     2  0.0747     0.8650 0.000 0.984 0.016
#> GSM254667     2  0.1860     0.8566 0.000 0.948 0.052
#> GSM254676     2  0.0592     0.8667 0.000 0.988 0.012
#> GSM254679     2  0.3116     0.8275 0.000 0.892 0.108
#> GSM254689     2  0.6244     0.3081 0.000 0.560 0.440
#> GSM254706     2  0.3879     0.7831 0.000 0.848 0.152
#> GSM254712     2  0.2959     0.8330 0.000 0.900 0.100
#> GSM254713     2  0.2959     0.8330 0.000 0.900 0.100
#> GSM254683     2  0.6008     0.4592 0.000 0.628 0.372
#> GSM254710     3  0.6654    -0.1552 0.008 0.456 0.536
#> GSM254725     2  0.3816     0.7937 0.000 0.852 0.148
#> GSM254651     2  0.4504     0.7375 0.000 0.804 0.196
#> GSM254638     2  0.3816     0.7937 0.000 0.852 0.148
#> GSM254685     2  0.0747     0.8650 0.000 0.984 0.016

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM254629     4  0.5920     0.1049 0.052 0.000 0.336 0.612
#> GSM254648     4  0.4265     0.5316 0.016 0.076 0.068 0.840
#> GSM254694     3  0.9284     0.4109 0.236 0.116 0.428 0.220
#> GSM254701     3  0.6944     0.6147 0.216 0.000 0.588 0.196
#> GSM254728     3  0.4289     0.7110 0.032 0.000 0.796 0.172
#> GSM254726     3  0.4845     0.6835 0.012 0.020 0.756 0.212
#> GSM254639     3  0.2742     0.6898 0.024 0.000 0.900 0.076
#> GSM254652     3  0.4323     0.7060 0.028 0.000 0.788 0.184
#> GSM254700     1  0.0376     0.8843 0.992 0.000 0.004 0.004
#> GSM254625     4  0.4520     0.4698 0.036 0.008 0.156 0.800
#> GSM254636     3  0.3749     0.7070 0.032 0.000 0.840 0.128
#> GSM254659     3  0.4590     0.7078 0.036 0.000 0.772 0.192
#> GSM254680     3  0.6723     0.6546 0.188 0.000 0.616 0.196
#> GSM254686     3  0.6317     0.6652 0.116 0.000 0.644 0.240
#> GSM254718     3  0.6754     0.6419 0.204 0.000 0.612 0.184
#> GSM254674     3  0.5672     0.7028 0.100 0.000 0.712 0.188
#> GSM254668     3  0.7830     0.3948 0.268 0.000 0.400 0.332
#> GSM254697     1  0.0376     0.8843 0.992 0.000 0.004 0.004
#> GSM254704     1  0.0524     0.8794 0.988 0.000 0.008 0.004
#> GSM254707     4  0.5011     0.4318 0.076 0.000 0.160 0.764
#> GSM254714     1  0.2586     0.8428 0.912 0.000 0.040 0.048
#> GSM254722     1  0.3088     0.8071 0.864 0.000 0.128 0.008
#> GSM254627     1  0.0376     0.8843 0.992 0.000 0.004 0.004
#> GSM254630     1  0.4012     0.7439 0.800 0.000 0.184 0.016
#> GSM254633     3  0.5744     0.7031 0.108 0.000 0.708 0.184
#> GSM254670     3  0.1004     0.6579 0.024 0.000 0.972 0.004
#> GSM254716     4  0.4485     0.3977 0.012 0.000 0.248 0.740
#> GSM254720     1  0.0336     0.8822 0.992 0.000 0.000 0.008
#> GSM254729     3  0.4149     0.7103 0.028 0.000 0.804 0.168
#> GSM254654     3  0.9634     0.2156 0.148 0.244 0.372 0.236
#> GSM254656     3  0.3017     0.6061 0.024 0.028 0.904 0.044
#> GSM254631     1  0.5716     0.5003 0.700 0.000 0.212 0.088
#> GSM254657     3  0.1151     0.6625 0.024 0.000 0.968 0.008
#> GSM254664     1  0.5267     0.5972 0.740 0.000 0.076 0.184
#> GSM254672     1  0.0524     0.8833 0.988 0.000 0.004 0.008
#> GSM254692     1  0.1118     0.8694 0.964 0.000 0.000 0.036
#> GSM254645     3  0.6394     0.2709 0.384 0.004 0.552 0.060
#> GSM254666     3  0.4888     0.6718 0.036 0.000 0.740 0.224
#> GSM254675     1  0.0469     0.8820 0.988 0.000 0.000 0.012
#> GSM254678     1  0.2011     0.8456 0.920 0.000 0.080 0.000
#> GSM254688     4  0.7531     0.2848 0.208 0.000 0.316 0.476
#> GSM254690     3  0.5290     0.0884 0.476 0.000 0.516 0.008
#> GSM254696     3  0.1452     0.6585 0.036 0.000 0.956 0.008
#> GSM254705     1  0.0895     0.8806 0.976 0.000 0.004 0.020
#> GSM254642     1  0.0524     0.8837 0.988 0.000 0.004 0.008
#> GSM254661     3  0.4365     0.7049 0.028 0.000 0.784 0.188
#> GSM254698     3  0.4535     0.4238 0.292 0.000 0.704 0.004
#> GSM254641     3  0.7668     0.4626 0.348 0.000 0.432 0.220
#> GSM254647     1  0.0524     0.8837 0.988 0.000 0.004 0.008
#> GSM254663     1  0.1489     0.8718 0.952 0.000 0.004 0.044
#> GSM254682     4  0.7540     0.2651 0.192 0.000 0.364 0.444
#> GSM254709     4  0.4933     0.3332 0.296 0.000 0.016 0.688
#> GSM254721     1  0.0000     0.8837 1.000 0.000 0.000 0.000
#> GSM254724     1  0.0188     0.8840 0.996 0.000 0.004 0.000
#> GSM254650     1  0.4679     0.4315 0.648 0.000 0.000 0.352
#> GSM254687     1  0.4981     0.1533 0.536 0.000 0.000 0.464
#> GSM254637     1  0.3279     0.7950 0.872 0.000 0.032 0.096
#> GSM254684     3  0.2198     0.6367 0.072 0.000 0.920 0.008
#> GSM254649     2  0.3688     0.7368 0.000 0.792 0.000 0.208
#> GSM254660     2  0.0188     0.8945 0.000 0.996 0.000 0.004
#> GSM254693     2  0.1792     0.8770 0.000 0.932 0.000 0.068
#> GSM254695     2  0.2174     0.8785 0.000 0.928 0.020 0.052
#> GSM254702     2  0.1211     0.8891 0.000 0.960 0.000 0.040
#> GSM254643     2  0.1474     0.8863 0.000 0.948 0.000 0.052
#> GSM254727     2  0.1211     0.8890 0.000 0.960 0.000 0.040
#> GSM254640     2  0.0336     0.8943 0.000 0.992 0.000 0.008
#> GSM254626     2  0.1716     0.8791 0.000 0.936 0.000 0.064
#> GSM254635     2  0.2335     0.8740 0.000 0.920 0.020 0.060
#> GSM254653     2  0.0921     0.8919 0.000 0.972 0.000 0.028
#> GSM254658     2  0.2760     0.8298 0.000 0.872 0.000 0.128
#> GSM254681     4  0.4477     0.4381 0.000 0.312 0.000 0.688
#> GSM254719     2  0.0592     0.8936 0.000 0.984 0.000 0.016
#> GSM254673     2  0.1557     0.8830 0.000 0.944 0.000 0.056
#> GSM254655     2  0.0188     0.8945 0.000 0.996 0.000 0.004
#> GSM254669     2  0.1867     0.8746 0.000 0.928 0.000 0.072
#> GSM254699     2  0.0188     0.8945 0.000 0.996 0.000 0.004
#> GSM254703     2  0.2363     0.8766 0.000 0.920 0.024 0.056
#> GSM254708     2  0.1557     0.8833 0.000 0.944 0.000 0.056
#> GSM254715     2  0.2335     0.8756 0.000 0.920 0.020 0.060
#> GSM254628     2  0.2408     0.8530 0.000 0.896 0.000 0.104
#> GSM254634     2  0.1743     0.8828 0.000 0.940 0.004 0.056
#> GSM254646     2  0.4996     0.0854 0.000 0.516 0.000 0.484
#> GSM254671     2  0.1489     0.8873 0.000 0.952 0.004 0.044
#> GSM254711     2  0.1743     0.8829 0.000 0.940 0.004 0.056
#> GSM254717     2  0.1118     0.8901 0.000 0.964 0.000 0.036
#> GSM254723     2  0.4337     0.7822 0.004 0.824 0.072 0.100
#> GSM254730     2  0.0000     0.8945 0.000 1.000 0.000 0.000
#> GSM254731     2  0.1022     0.8909 0.000 0.968 0.000 0.032
#> GSM254632     4  0.5605     0.4437 0.012 0.320 0.020 0.648
#> GSM254662     2  0.1118     0.8901 0.000 0.964 0.000 0.036
#> GSM254677     2  0.3104     0.8572 0.004 0.892 0.044 0.060
#> GSM254665     2  0.1637     0.8827 0.000 0.940 0.000 0.060
#> GSM254691     2  0.1022     0.8933 0.000 0.968 0.000 0.032
#> GSM254644     2  0.0921     0.8917 0.000 0.972 0.000 0.028
#> GSM254667     2  0.4072     0.6755 0.000 0.748 0.000 0.252
#> GSM254676     2  0.0707     0.8931 0.000 0.980 0.000 0.020
#> GSM254679     2  0.1824     0.8811 0.000 0.936 0.004 0.060
#> GSM254689     4  0.4941     0.1344 0.000 0.436 0.000 0.564
#> GSM254706     2  0.4500     0.5571 0.000 0.684 0.000 0.316
#> GSM254712     2  0.2546     0.8715 0.000 0.912 0.028 0.060
#> GSM254713     2  0.2443     0.8736 0.000 0.916 0.024 0.060
#> GSM254683     2  0.4996     0.0619 0.000 0.516 0.000 0.484
#> GSM254710     4  0.4122     0.5433 0.000 0.236 0.004 0.760
#> GSM254725     2  0.2466     0.8717 0.000 0.916 0.028 0.056
#> GSM254651     2  0.4103     0.6714 0.000 0.744 0.000 0.256
#> GSM254638     2  0.2996     0.8572 0.000 0.892 0.044 0.064
#> GSM254685     2  0.1284     0.8919 0.000 0.964 0.012 0.024

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM254629     3  0.2929     0.7446 0.004 0.000 0.856 0.012 0.128
#> GSM254648     3  0.3201     0.7358 0.000 0.008 0.844 0.016 0.132
#> GSM254694     3  0.2965     0.7461 0.008 0.004 0.884 0.052 0.052
#> GSM254701     3  0.1569     0.7801 0.008 0.000 0.944 0.044 0.004
#> GSM254728     3  0.1410     0.7847 0.000 0.000 0.940 0.060 0.000
#> GSM254726     3  0.1153     0.7846 0.000 0.008 0.964 0.024 0.004
#> GSM254639     4  0.4114     0.5103 0.000 0.000 0.376 0.624 0.000
#> GSM254652     3  0.2012     0.7865 0.000 0.000 0.920 0.060 0.020
#> GSM254700     1  0.0609     0.9084 0.980 0.000 0.000 0.000 0.020
#> GSM254625     5  0.4482     0.2776 0.000 0.000 0.376 0.012 0.612
#> GSM254636     4  0.4401     0.6133 0.004 0.000 0.296 0.684 0.016
#> GSM254659     3  0.1443     0.7897 0.004 0.000 0.948 0.044 0.004
#> GSM254680     3  0.3178     0.7736 0.036 0.000 0.872 0.068 0.024
#> GSM254686     3  0.2429     0.7862 0.008 0.000 0.904 0.020 0.068
#> GSM254718     3  0.1808     0.7772 0.008 0.000 0.936 0.044 0.012
#> GSM254674     3  0.3004     0.7592 0.008 0.000 0.864 0.108 0.020
#> GSM254668     3  0.3044     0.7414 0.008 0.000 0.840 0.004 0.148
#> GSM254697     1  0.0162     0.9075 0.996 0.000 0.000 0.004 0.000
#> GSM254704     1  0.0609     0.9084 0.980 0.000 0.000 0.000 0.020
#> GSM254707     3  0.4452    -0.0309 0.000 0.000 0.500 0.004 0.496
#> GSM254714     3  0.7091     0.1974 0.360 0.000 0.468 0.104 0.068
#> GSM254722     1  0.1965     0.8414 0.904 0.000 0.000 0.096 0.000
#> GSM254627     1  0.0000     0.9080 1.000 0.000 0.000 0.000 0.000
#> GSM254630     1  0.1894     0.8616 0.920 0.000 0.000 0.072 0.008
#> GSM254633     3  0.2131     0.7873 0.008 0.000 0.920 0.056 0.016
#> GSM254670     4  0.2127     0.7500 0.000 0.000 0.108 0.892 0.000
#> GSM254716     5  0.4046     0.4066 0.000 0.000 0.296 0.008 0.696
#> GSM254720     1  0.0771     0.9076 0.976 0.000 0.004 0.000 0.020
#> GSM254729     3  0.2416     0.7616 0.000 0.000 0.888 0.100 0.012
#> GSM254654     3  0.3276     0.7185 0.004 0.004 0.856 0.100 0.036
#> GSM254656     4  0.2074     0.7495 0.000 0.000 0.104 0.896 0.000
#> GSM254631     3  0.5552     0.2754 0.432 0.000 0.516 0.028 0.024
#> GSM254657     4  0.3884     0.6620 0.000 0.000 0.288 0.708 0.004
#> GSM254664     3  0.4001     0.6545 0.208 0.000 0.764 0.004 0.024
#> GSM254672     1  0.0609     0.9084 0.980 0.000 0.000 0.000 0.020
#> GSM254692     1  0.0000     0.9080 1.000 0.000 0.000 0.000 0.000
#> GSM254645     4  0.7165     0.2580 0.328 0.000 0.104 0.488 0.080
#> GSM254666     3  0.3861     0.7276 0.000 0.000 0.804 0.068 0.128
#> GSM254675     1  0.1800     0.8731 0.932 0.000 0.048 0.000 0.020
#> GSM254678     1  0.2002     0.8824 0.932 0.000 0.020 0.028 0.020
#> GSM254688     5  0.7964     0.0985 0.256 0.000 0.140 0.164 0.440
#> GSM254690     1  0.5336     0.3881 0.632 0.000 0.052 0.304 0.012
#> GSM254696     4  0.2389     0.7505 0.004 0.000 0.116 0.880 0.000
#> GSM254705     1  0.0404     0.9089 0.988 0.000 0.000 0.000 0.012
#> GSM254642     1  0.0162     0.9075 0.996 0.000 0.000 0.004 0.000
#> GSM254661     3  0.1701     0.7898 0.000 0.000 0.936 0.048 0.016
#> GSM254698     4  0.2583     0.6592 0.132 0.000 0.004 0.864 0.000
#> GSM254641     3  0.2474     0.7826 0.008 0.000 0.896 0.012 0.084
#> GSM254647     1  0.0000     0.9080 1.000 0.000 0.000 0.000 0.000
#> GSM254663     1  0.0912     0.8972 0.972 0.000 0.012 0.000 0.016
#> GSM254682     4  0.7189     0.4766 0.252 0.000 0.100 0.536 0.112
#> GSM254709     5  0.5714     0.0656 0.072 0.000 0.412 0.004 0.512
#> GSM254721     1  0.0609     0.9084 0.980 0.000 0.000 0.000 0.020
#> GSM254724     1  0.0609     0.9084 0.980 0.000 0.000 0.000 0.020
#> GSM254650     1  0.3700     0.6583 0.752 0.000 0.008 0.000 0.240
#> GSM254687     1  0.4882     0.1861 0.532 0.000 0.024 0.000 0.444
#> GSM254637     3  0.5305     0.2762 0.436 0.000 0.524 0.012 0.028
#> GSM254684     4  0.2249     0.7480 0.008 0.000 0.096 0.896 0.000
#> GSM254649     2  0.3395     0.7036 0.000 0.764 0.000 0.000 0.236
#> GSM254660     2  0.0000     0.8764 0.000 1.000 0.000 0.000 0.000
#> GSM254693     2  0.1671     0.8604 0.000 0.924 0.000 0.000 0.076
#> GSM254695     2  0.2011     0.8652 0.000 0.928 0.008 0.020 0.044
#> GSM254702     2  0.0771     0.8722 0.000 0.976 0.004 0.000 0.020
#> GSM254643     2  0.1043     0.8767 0.000 0.960 0.000 0.000 0.040
#> GSM254727     2  0.1557     0.8719 0.000 0.940 0.008 0.000 0.052
#> GSM254640     2  0.0740     0.8781 0.000 0.980 0.004 0.008 0.008
#> GSM254626     2  0.1270     0.8726 0.000 0.948 0.000 0.000 0.052
#> GSM254635     2  0.1768     0.8490 0.000 0.924 0.004 0.000 0.072
#> GSM254653     2  0.0880     0.8766 0.000 0.968 0.000 0.000 0.032
#> GSM254658     2  0.2648     0.8039 0.000 0.848 0.000 0.000 0.152
#> GSM254681     5  0.3143     0.5351 0.000 0.204 0.000 0.000 0.796
#> GSM254719     2  0.0703     0.8769 0.000 0.976 0.000 0.000 0.024
#> GSM254673     2  0.1121     0.8738 0.000 0.956 0.000 0.000 0.044
#> GSM254655     2  0.0162     0.8769 0.000 0.996 0.000 0.000 0.004
#> GSM254669     2  0.1908     0.8498 0.000 0.908 0.000 0.000 0.092
#> GSM254699     2  0.0162     0.8769 0.000 0.996 0.000 0.000 0.004
#> GSM254703     2  0.3856     0.7834 0.000 0.832 0.024 0.080 0.064
#> GSM254708     2  0.1270     0.8713 0.000 0.948 0.000 0.000 0.052
#> GSM254715     2  0.2576     0.8375 0.000 0.900 0.008 0.036 0.056
#> GSM254628     2  0.2377     0.8283 0.000 0.872 0.000 0.000 0.128
#> GSM254634     2  0.0609     0.8724 0.000 0.980 0.000 0.000 0.020
#> GSM254646     2  0.4304     0.1240 0.000 0.516 0.000 0.000 0.484
#> GSM254671     2  0.0162     0.8759 0.000 0.996 0.000 0.000 0.004
#> GSM254711     2  0.1282     0.8636 0.000 0.952 0.004 0.000 0.044
#> GSM254717     2  0.1628     0.8709 0.000 0.936 0.008 0.000 0.056
#> GSM254723     2  0.5930     0.6084 0.000 0.692 0.100 0.092 0.116
#> GSM254730     2  0.0404     0.8776 0.000 0.988 0.000 0.000 0.012
#> GSM254731     2  0.0451     0.8753 0.000 0.988 0.004 0.000 0.008
#> GSM254632     5  0.4175     0.5314 0.000 0.200 0.020 0.016 0.764
#> GSM254662     2  0.0963     0.8752 0.000 0.964 0.000 0.000 0.036
#> GSM254677     2  0.4453     0.7525 0.000 0.796 0.036 0.092 0.076
#> GSM254665     2  0.1197     0.8756 0.000 0.952 0.000 0.000 0.048
#> GSM254691     2  0.0963     0.8752 0.000 0.964 0.000 0.000 0.036
#> GSM254644     2  0.0579     0.8778 0.000 0.984 0.008 0.000 0.008
#> GSM254667     2  0.4636     0.5568 0.000 0.664 0.004 0.024 0.308
#> GSM254676     2  0.1121     0.8737 0.000 0.956 0.000 0.000 0.044
#> GSM254679     2  0.1041     0.8683 0.000 0.964 0.004 0.000 0.032
#> GSM254689     5  0.4114     0.2657 0.000 0.376 0.000 0.000 0.624
#> GSM254706     2  0.4333     0.5045 0.000 0.640 0.004 0.004 0.352
#> GSM254712     2  0.4462     0.7471 0.000 0.796 0.040 0.096 0.068
#> GSM254713     2  0.3860     0.7832 0.000 0.832 0.024 0.076 0.068
#> GSM254683     2  0.4294     0.1762 0.000 0.532 0.000 0.000 0.468
#> GSM254710     5  0.2548     0.5318 0.000 0.116 0.004 0.004 0.876
#> GSM254725     2  0.1638     0.8540 0.000 0.932 0.000 0.004 0.064
#> GSM254651     2  0.4066     0.5710 0.000 0.672 0.004 0.000 0.324
#> GSM254638     2  0.4098     0.7658 0.000 0.816 0.024 0.080 0.080
#> GSM254685     2  0.1978     0.8549 0.000 0.928 0.004 0.044 0.024

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM254629     3  0.2473     0.7995 0.000 0.000 0.856 0.136 0.008 0.000
#> GSM254648     3  0.2988     0.7945 0.000 0.000 0.828 0.144 0.028 0.000
#> GSM254694     3  0.2519     0.8064 0.000 0.004 0.864 0.124 0.004 0.004
#> GSM254701     3  0.2288     0.8054 0.000 0.000 0.876 0.116 0.004 0.004
#> GSM254728     3  0.3104     0.7715 0.000 0.000 0.800 0.184 0.000 0.016
#> GSM254726     3  0.2442     0.7977 0.000 0.000 0.852 0.144 0.000 0.004
#> GSM254639     6  0.4575     0.5413 0.000 0.000 0.180 0.124 0.000 0.696
#> GSM254652     3  0.2085     0.8200 0.000 0.000 0.912 0.056 0.008 0.024
#> GSM254700     1  0.1908     0.8533 0.900 0.000 0.000 0.096 0.004 0.000
#> GSM254625     3  0.4314     0.0632 0.000 0.000 0.500 0.004 0.484 0.012
#> GSM254636     6  0.4543     0.4743 0.012 0.000 0.332 0.008 0.016 0.632
#> GSM254659     3  0.1141     0.8181 0.000 0.000 0.948 0.052 0.000 0.000
#> GSM254680     3  0.1693     0.8010 0.000 0.000 0.932 0.004 0.020 0.044
#> GSM254686     3  0.1970     0.8137 0.000 0.000 0.912 0.060 0.028 0.000
#> GSM254718     3  0.3543     0.6914 0.000 0.000 0.720 0.272 0.004 0.004
#> GSM254674     3  0.1863     0.7999 0.004 0.000 0.920 0.000 0.016 0.060
#> GSM254668     3  0.1924     0.7988 0.000 0.000 0.920 0.004 0.048 0.028
#> GSM254697     1  0.0405     0.8543 0.988 0.000 0.000 0.004 0.000 0.008
#> GSM254704     1  0.2053     0.8502 0.888 0.000 0.000 0.108 0.004 0.000
#> GSM254707     3  0.4418     0.3571 0.000 0.000 0.604 0.012 0.368 0.016
#> GSM254714     4  0.4893     0.3327 0.200 0.000 0.128 0.668 0.004 0.000
#> GSM254722     1  0.2146     0.7872 0.880 0.000 0.000 0.004 0.000 0.116
#> GSM254627     1  0.0405     0.8543 0.988 0.000 0.000 0.004 0.000 0.008
#> GSM254630     1  0.2556     0.8139 0.888 0.000 0.000 0.012 0.052 0.048
#> GSM254633     3  0.1074     0.8092 0.000 0.000 0.960 0.000 0.012 0.028
#> GSM254670     6  0.0508     0.7287 0.000 0.000 0.004 0.012 0.000 0.984
#> GSM254716     5  0.4260     0.4056 0.000 0.000 0.248 0.048 0.700 0.004
#> GSM254720     1  0.2587     0.8437 0.864 0.000 0.008 0.120 0.004 0.004
#> GSM254729     3  0.2011     0.8114 0.000 0.000 0.912 0.020 0.004 0.064
#> GSM254654     3  0.2632     0.7890 0.000 0.000 0.832 0.164 0.004 0.000
#> GSM254656     6  0.1152     0.7194 0.000 0.000 0.004 0.044 0.000 0.952
#> GSM254631     3  0.4580     0.6303 0.180 0.000 0.732 0.004 0.028 0.056
#> GSM254657     6  0.5209     0.3418 0.000 0.000 0.088 0.360 0.004 0.548
#> GSM254664     3  0.2302     0.7880 0.060 0.000 0.900 0.008 0.032 0.000
#> GSM254672     1  0.2234     0.8463 0.872 0.000 0.000 0.124 0.004 0.000
#> GSM254692     1  0.0891     0.8600 0.968 0.000 0.000 0.024 0.008 0.000
#> GSM254645     4  0.5608    -0.0733 0.072 0.000 0.020 0.488 0.004 0.416
#> GSM254666     3  0.6495     0.0738 0.000 0.000 0.448 0.076 0.368 0.108
#> GSM254675     1  0.3482     0.7978 0.812 0.000 0.068 0.116 0.004 0.000
#> GSM254678     1  0.4647     0.7038 0.708 0.000 0.004 0.104 0.004 0.180
#> GSM254688     5  0.6968     0.1694 0.148 0.000 0.124 0.004 0.496 0.228
#> GSM254690     1  0.5851     0.0861 0.512 0.000 0.116 0.004 0.016 0.352
#> GSM254696     6  0.2067     0.7253 0.016 0.000 0.064 0.004 0.004 0.912
#> GSM254705     1  0.1471     0.8595 0.932 0.000 0.000 0.064 0.000 0.004
#> GSM254642     1  0.0405     0.8543 0.988 0.000 0.000 0.004 0.000 0.008
#> GSM254661     3  0.3542     0.7897 0.000 0.000 0.800 0.156 0.028 0.016
#> GSM254698     6  0.1814     0.6850 0.100 0.000 0.000 0.000 0.000 0.900
#> GSM254641     3  0.2008     0.8118 0.004 0.000 0.920 0.040 0.032 0.004
#> GSM254647     1  0.0551     0.8544 0.984 0.000 0.008 0.004 0.000 0.004
#> GSM254663     1  0.1452     0.8422 0.948 0.000 0.008 0.004 0.032 0.008
#> GSM254682     6  0.5868     0.5440 0.156 0.000 0.052 0.012 0.136 0.644
#> GSM254709     5  0.5319    -0.0185 0.048 0.000 0.408 0.028 0.516 0.000
#> GSM254721     1  0.2006     0.8509 0.892 0.000 0.000 0.104 0.004 0.000
#> GSM254724     1  0.2006     0.8509 0.892 0.000 0.000 0.104 0.004 0.000
#> GSM254650     1  0.4275     0.4244 0.652 0.000 0.020 0.004 0.320 0.004
#> GSM254687     5  0.4253    -0.0340 0.472 0.000 0.004 0.004 0.516 0.004
#> GSM254637     3  0.3537     0.6806 0.164 0.000 0.796 0.016 0.024 0.000
#> GSM254684     6  0.0508     0.7299 0.012 0.000 0.004 0.000 0.000 0.984
#> GSM254649     2  0.1663     0.8377 0.000 0.912 0.000 0.000 0.088 0.000
#> GSM254660     2  0.0146     0.8636 0.000 0.996 0.000 0.004 0.000 0.000
#> GSM254693     2  0.0777     0.8623 0.000 0.972 0.000 0.004 0.024 0.000
#> GSM254695     2  0.3601     0.7155 0.000 0.792 0.000 0.160 0.040 0.008
#> GSM254702     2  0.0000     0.8631 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM254643     2  0.1297     0.8584 0.000 0.948 0.000 0.012 0.040 0.000
#> GSM254727     2  0.0806     0.8617 0.000 0.972 0.000 0.020 0.008 0.000
#> GSM254640     2  0.2854     0.7204 0.000 0.792 0.000 0.208 0.000 0.000
#> GSM254626     2  0.1124     0.8606 0.000 0.956 0.000 0.008 0.036 0.000
#> GSM254635     2  0.1349     0.8435 0.000 0.940 0.000 0.056 0.004 0.000
#> GSM254653     2  0.0260     0.8635 0.000 0.992 0.000 0.000 0.008 0.000
#> GSM254658     2  0.1462     0.8510 0.000 0.936 0.000 0.008 0.056 0.000
#> GSM254681     5  0.2613     0.4269 0.000 0.140 0.000 0.012 0.848 0.000
#> GSM254719     2  0.0000     0.8631 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM254673     2  0.0458     0.8635 0.000 0.984 0.000 0.000 0.016 0.000
#> GSM254655     2  0.0000     0.8631 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM254669     2  0.0458     0.8639 0.000 0.984 0.000 0.000 0.016 0.000
#> GSM254699     2  0.0000     0.8631 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM254703     2  0.3765     0.3881 0.000 0.596 0.000 0.404 0.000 0.000
#> GSM254708     2  0.0622     0.8636 0.000 0.980 0.000 0.008 0.012 0.000
#> GSM254715     2  0.3464     0.5714 0.000 0.688 0.000 0.312 0.000 0.000
#> GSM254628     2  0.1714     0.8389 0.000 0.908 0.000 0.000 0.092 0.000
#> GSM254634     2  0.0713     0.8623 0.000 0.972 0.000 0.028 0.000 0.000
#> GSM254646     2  0.3547     0.6126 0.000 0.696 0.000 0.004 0.300 0.000
#> GSM254671     2  0.0000     0.8631 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM254711     2  0.0363     0.8627 0.000 0.988 0.000 0.012 0.000 0.000
#> GSM254717     2  0.1245     0.8620 0.000 0.952 0.000 0.016 0.032 0.000
#> GSM254723     4  0.5226     0.3971 0.000 0.112 0.120 0.712 0.040 0.016
#> GSM254730     2  0.0000     0.8631 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM254731     2  0.0146     0.8630 0.000 0.996 0.000 0.004 0.000 0.000
#> GSM254632     5  0.4197     0.4682 0.000 0.060 0.036 0.052 0.808 0.044
#> GSM254662     2  0.0260     0.8635 0.000 0.992 0.000 0.000 0.008 0.000
#> GSM254677     4  0.4058     0.2821 0.000 0.320 0.000 0.660 0.016 0.004
#> GSM254665     2  0.1921     0.8478 0.000 0.916 0.000 0.032 0.052 0.000
#> GSM254691     2  0.1176     0.8621 0.000 0.956 0.000 0.020 0.024 0.000
#> GSM254644     2  0.2854     0.7227 0.000 0.792 0.000 0.208 0.000 0.000
#> GSM254667     2  0.5809     0.5061 0.000 0.612 0.000 0.072 0.228 0.088
#> GSM254676     2  0.0717     0.8637 0.000 0.976 0.000 0.008 0.016 0.000
#> GSM254679     2  0.0547     0.8622 0.000 0.980 0.000 0.020 0.000 0.000
#> GSM254689     5  0.3872     0.1325 0.000 0.392 0.000 0.004 0.604 0.000
#> GSM254706     2  0.5035     0.3788 0.000 0.556 0.000 0.084 0.360 0.000
#> GSM254712     2  0.3843     0.2618 0.000 0.548 0.000 0.452 0.000 0.000
#> GSM254713     2  0.3737     0.4160 0.000 0.608 0.000 0.392 0.000 0.000
#> GSM254683     2  0.3645     0.6878 0.000 0.740 0.000 0.024 0.236 0.000
#> GSM254710     5  0.1168     0.4698 0.000 0.016 0.000 0.028 0.956 0.000
#> GSM254725     2  0.1010     0.8555 0.000 0.960 0.000 0.036 0.000 0.004
#> GSM254651     2  0.4441     0.6161 0.000 0.700 0.000 0.092 0.208 0.000
#> GSM254638     2  0.3302     0.6991 0.000 0.760 0.004 0.232 0.004 0.000
#> GSM254685     2  0.3499     0.5692 0.000 0.680 0.000 0.320 0.000 0.000

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

consensus_heatmap(res, k = 2)

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

consensus_heatmap(res, k = 3)

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

consensus_heatmap(res, k = 4)

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

consensus_heatmap(res, k = 5)

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

consensus_heatmap(res, k = 6)

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

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

membership_heatmap(res, k = 2)

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

membership_heatmap(res, k = 3)

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

membership_heatmap(res, k = 4)

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

membership_heatmap(res, k = 5)

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

membership_heatmap(res, k = 6)

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

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

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

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

get_signatures(res, k = 3)

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

get_signatures(res, k = 4)

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

get_signatures(res, k = 5)

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

get_signatures(res, k = 6)

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

Signature heatmaps where rows are not scaled:

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

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

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

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

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

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

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

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

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

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

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk CV-NMF-signature_compare

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

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

An example of the output of tb is:

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

The columns in tb are:

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

UMAP plot which shows how samples are separated.

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

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

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

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

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

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

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

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

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

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

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk CV-NMF-collect-classes

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

test_to_known_factors(res)
#>          n tissue(p) individual(p) disease.state(p) gender(p) other(p) k
#> CV:NMF 106  3.87e-23        0.5154            0.690    0.6973   1.0000 2
#> CV:NMF  87  8.02e-20        0.1827            0.654    0.9396   1.0000 3
#> CV:NMF  86  4.26e-18        0.0315            0.471    0.1811   0.1032 4
#> CV:NMF  92  4.95e-19        0.0468            0.189    0.2106   0.0426 5
#> CV:NMF  84  4.25e-18        0.0158            0.135    0.0943   0.0222 6

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


MAD:hclust**

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

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

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

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

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

collect_plots(res)

plot of chunk MAD-hclust-collect-plots

The plots are:

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

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

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

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

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 1.000           0.976       0.988         0.5000 0.501   0.501
#> 3 3 0.620           0.618       0.794         0.2318 0.928   0.856
#> 4 4 0.569           0.520       0.753         0.1384 0.822   0.603
#> 5 5 0.591           0.527       0.720         0.0770 0.889   0.638
#> 6 6 0.635           0.577       0.721         0.0427 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
#> GSM254629     1  0.1184      0.974 0.984 0.016
#> GSM254648     1  0.3733      0.927 0.928 0.072
#> GSM254694     1  0.3584      0.931 0.932 0.068
#> GSM254701     1  0.1184      0.974 0.984 0.016
#> GSM254728     1  0.0000      0.984 1.000 0.000
#> GSM254726     1  0.4815      0.892 0.896 0.104
#> GSM254639     1  0.0000      0.984 1.000 0.000
#> GSM254652     1  0.0000      0.984 1.000 0.000
#> GSM254700     1  0.0000      0.984 1.000 0.000
#> GSM254625     1  0.1414      0.971 0.980 0.020
#> GSM254636     1  0.0000      0.984 1.000 0.000
#> GSM254659     1  0.0000      0.984 1.000 0.000
#> GSM254680     1  0.0000      0.984 1.000 0.000
#> GSM254686     1  0.0000      0.984 1.000 0.000
#> GSM254718     1  0.0938      0.977 0.988 0.012
#> GSM254674     1  0.0000      0.984 1.000 0.000
#> GSM254668     1  0.0000      0.984 1.000 0.000
#> GSM254697     1  0.0000      0.984 1.000 0.000
#> GSM254704     1  0.0000      0.984 1.000 0.000
#> GSM254707     1  0.0000      0.984 1.000 0.000
#> GSM254714     1  0.0000      0.984 1.000 0.000
#> GSM254722     1  0.0000      0.984 1.000 0.000
#> GSM254627     1  0.0000      0.984 1.000 0.000
#> GSM254630     1  0.0938      0.977 0.988 0.012
#> GSM254633     1  0.0000      0.984 1.000 0.000
#> GSM254670     1  0.0000      0.984 1.000 0.000
#> GSM254716     1  0.1414      0.971 0.980 0.020
#> GSM254720     1  0.0000      0.984 1.000 0.000
#> GSM254729     1  0.3584      0.931 0.932 0.068
#> GSM254654     1  0.3584      0.931 0.932 0.068
#> GSM254656     1  0.3584      0.931 0.932 0.068
#> GSM254631     1  0.0000      0.984 1.000 0.000
#> GSM254657     1  0.0000      0.984 1.000 0.000
#> GSM254664     1  0.0000      0.984 1.000 0.000
#> GSM254672     1  0.0000      0.984 1.000 0.000
#> GSM254692     1  0.0000      0.984 1.000 0.000
#> GSM254645     1  0.1414      0.971 0.980 0.020
#> GSM254666     1  0.0000      0.984 1.000 0.000
#> GSM254675     1  0.0000      0.984 1.000 0.000
#> GSM254678     1  0.0000      0.984 1.000 0.000
#> GSM254688     1  0.0000      0.984 1.000 0.000
#> GSM254690     1  0.0000      0.984 1.000 0.000
#> GSM254696     1  0.0000      0.984 1.000 0.000
#> GSM254705     1  0.0000      0.984 1.000 0.000
#> GSM254642     1  0.0000      0.984 1.000 0.000
#> GSM254661     1  0.0000      0.984 1.000 0.000
#> GSM254698     1  0.0000      0.984 1.000 0.000
#> GSM254641     1  0.0000      0.984 1.000 0.000
#> GSM254647     1  0.0000      0.984 1.000 0.000
#> GSM254663     1  0.0000      0.984 1.000 0.000
#> GSM254682     1  0.0000      0.984 1.000 0.000
#> GSM254709     1  0.0000      0.984 1.000 0.000
#> GSM254721     1  0.0000      0.984 1.000 0.000
#> GSM254724     1  0.0000      0.984 1.000 0.000
#> GSM254650     1  0.0000      0.984 1.000 0.000
#> GSM254687     1  0.0000      0.984 1.000 0.000
#> GSM254637     1  0.0000      0.984 1.000 0.000
#> GSM254684     1  0.0000      0.984 1.000 0.000
#> GSM254649     2  0.0000      0.993 0.000 1.000
#> GSM254660     2  0.0000      0.993 0.000 1.000
#> GSM254693     2  0.0000      0.993 0.000 1.000
#> GSM254695     2  0.1843      0.967 0.028 0.972
#> GSM254702     2  0.0000      0.993 0.000 1.000
#> GSM254643     2  0.0000      0.993 0.000 1.000
#> GSM254727     2  0.0000      0.993 0.000 1.000
#> GSM254640     2  0.0000      0.993 0.000 1.000
#> GSM254626     2  0.0000      0.993 0.000 1.000
#> GSM254635     2  0.0000      0.993 0.000 1.000
#> GSM254653     2  0.0000      0.993 0.000 1.000
#> GSM254658     2  0.0000      0.993 0.000 1.000
#> GSM254681     2  0.0000      0.993 0.000 1.000
#> GSM254719     2  0.0000      0.993 0.000 1.000
#> GSM254673     2  0.0000      0.993 0.000 1.000
#> GSM254655     2  0.0000      0.993 0.000 1.000
#> GSM254669     2  0.0000      0.993 0.000 1.000
#> GSM254699     2  0.0000      0.993 0.000 1.000
#> GSM254703     2  0.0000      0.993 0.000 1.000
#> GSM254708     2  0.0376      0.990 0.004 0.996
#> GSM254715     2  0.0000      0.993 0.000 1.000
#> GSM254628     2  0.0000      0.993 0.000 1.000
#> GSM254634     2  0.0000      0.993 0.000 1.000
#> GSM254646     2  0.0000      0.993 0.000 1.000
#> GSM254671     2  0.0000      0.993 0.000 1.000
#> GSM254711     2  0.0000      0.993 0.000 1.000
#> GSM254717     2  0.0000      0.993 0.000 1.000
#> GSM254723     1  0.9522      0.425 0.628 0.372
#> GSM254730     2  0.0000      0.993 0.000 1.000
#> GSM254731     2  0.0000      0.993 0.000 1.000
#> GSM254632     2  0.5842      0.837 0.140 0.860
#> GSM254662     2  0.0000      0.993 0.000 1.000
#> GSM254677     2  0.0000      0.993 0.000 1.000
#> GSM254665     2  0.0000      0.993 0.000 1.000
#> GSM254691     2  0.0000      0.993 0.000 1.000
#> GSM254644     2  0.0000      0.993 0.000 1.000
#> GSM254667     2  0.0376      0.990 0.004 0.996
#> GSM254676     2  0.0000      0.993 0.000 1.000
#> GSM254679     2  0.0000      0.993 0.000 1.000
#> GSM254689     2  0.0000      0.993 0.000 1.000
#> GSM254706     2  0.0000      0.993 0.000 1.000
#> GSM254712     2  0.0000      0.993 0.000 1.000
#> GSM254713     2  0.0000      0.993 0.000 1.000
#> GSM254683     2  0.0376      0.990 0.004 0.996
#> GSM254710     2  0.5737      0.842 0.136 0.864
#> GSM254725     2  0.0000      0.993 0.000 1.000
#> GSM254651     2  0.0000      0.993 0.000 1.000
#> GSM254638     2  0.0000      0.993 0.000 1.000
#> GSM254685     2  0.0000      0.993 0.000 1.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1    p2    p3
#> GSM254629     3  0.2878    0.63334 0.096 0.000 0.904
#> GSM254648     3  0.4045    0.58280 0.104 0.024 0.872
#> GSM254694     3  0.3832    0.58669 0.100 0.020 0.880
#> GSM254701     3  0.2878    0.63334 0.096 0.000 0.904
#> GSM254728     3  0.1163    0.63821 0.028 0.000 0.972
#> GSM254726     3  0.4945    0.54875 0.104 0.056 0.840
#> GSM254639     3  0.2066    0.63540 0.060 0.000 0.940
#> GSM254652     3  0.1411    0.63717 0.036 0.000 0.964
#> GSM254700     1  0.6267    0.97376 0.548 0.000 0.452
#> GSM254625     3  0.1753    0.63522 0.048 0.000 0.952
#> GSM254636     3  0.5733   -0.03977 0.324 0.000 0.676
#> GSM254659     3  0.3116    0.63214 0.108 0.000 0.892
#> GSM254680     3  0.6062   -0.33209 0.384 0.000 0.616
#> GSM254686     3  0.3116    0.63445 0.108 0.000 0.892
#> GSM254718     3  0.2165    0.62786 0.064 0.000 0.936
#> GSM254674     3  0.4504    0.47063 0.196 0.000 0.804
#> GSM254668     3  0.5733    0.00354 0.324 0.000 0.676
#> GSM254697     1  0.6260    0.98002 0.552 0.000 0.448
#> GSM254704     1  0.6252    0.97512 0.556 0.000 0.444
#> GSM254707     3  0.2448    0.63032 0.076 0.000 0.924
#> GSM254714     3  0.6299   -0.75120 0.476 0.000 0.524
#> GSM254722     3  0.6045   -0.31894 0.380 0.000 0.620
#> GSM254627     1  0.6260    0.98002 0.552 0.000 0.448
#> GSM254630     3  0.2537    0.64131 0.080 0.000 0.920
#> GSM254633     3  0.5859   -0.19116 0.344 0.000 0.656
#> GSM254670     3  0.2878    0.61323 0.096 0.000 0.904
#> GSM254716     3  0.1964    0.63102 0.056 0.000 0.944
#> GSM254720     3  0.5650    0.12043 0.312 0.000 0.688
#> GSM254729     3  0.4063    0.58845 0.112 0.020 0.868
#> GSM254654     3  0.3832    0.58794 0.100 0.020 0.880
#> GSM254656     3  0.4209    0.58931 0.128 0.016 0.856
#> GSM254631     3  0.6126   -0.40386 0.400 0.000 0.600
#> GSM254657     3  0.1860    0.63789 0.052 0.000 0.948
#> GSM254664     3  0.6140   -0.42441 0.404 0.000 0.596
#> GSM254672     1  0.6305    0.89166 0.516 0.000 0.484
#> GSM254692     3  0.5760    0.04636 0.328 0.000 0.672
#> GSM254645     3  0.2959    0.62783 0.100 0.000 0.900
#> GSM254666     3  0.1964    0.63987 0.056 0.000 0.944
#> GSM254675     3  0.5363    0.26169 0.276 0.000 0.724
#> GSM254678     3  0.5706    0.02913 0.320 0.000 0.680
#> GSM254688     3  0.2625    0.62125 0.084 0.000 0.916
#> GSM254690     3  0.6140   -0.45614 0.404 0.000 0.596
#> GSM254696     3  0.4654    0.43066 0.208 0.000 0.792
#> GSM254705     3  0.2711    0.63157 0.088 0.000 0.912
#> GSM254642     1  0.6260    0.98002 0.552 0.000 0.448
#> GSM254661     3  0.1289    0.63778 0.032 0.000 0.968
#> GSM254698     3  0.6045   -0.31894 0.380 0.000 0.620
#> GSM254641     3  0.3879    0.55518 0.152 0.000 0.848
#> GSM254647     3  0.6154   -0.46840 0.408 0.000 0.592
#> GSM254663     3  0.3941    0.54886 0.156 0.000 0.844
#> GSM254682     3  0.2261    0.63144 0.068 0.000 0.932
#> GSM254709     3  0.4452    0.51463 0.192 0.000 0.808
#> GSM254721     1  0.6252    0.97512 0.556 0.000 0.444
#> GSM254724     1  0.6260    0.98002 0.552 0.000 0.448
#> GSM254650     3  0.3816    0.57061 0.148 0.000 0.852
#> GSM254687     3  0.2711    0.62210 0.088 0.000 0.912
#> GSM254637     3  0.6111   -0.38646 0.396 0.000 0.604
#> GSM254684     3  0.4002    0.55072 0.160 0.000 0.840
#> GSM254649     2  0.0000    0.89597 0.000 1.000 0.000
#> GSM254660     2  0.1643    0.89615 0.044 0.956 0.000
#> GSM254693     2  0.0000    0.89597 0.000 1.000 0.000
#> GSM254695     2  0.6587    0.78201 0.352 0.632 0.016
#> GSM254702     2  0.1643    0.89615 0.044 0.956 0.000
#> GSM254643     2  0.2959    0.88460 0.100 0.900 0.000
#> GSM254727     2  0.0892    0.89708 0.020 0.980 0.000
#> GSM254640     2  0.5560    0.82303 0.300 0.700 0.000
#> GSM254626     2  0.0000    0.89597 0.000 1.000 0.000
#> GSM254635     2  0.5621    0.81934 0.308 0.692 0.000
#> GSM254653     2  0.0892    0.89708 0.020 0.980 0.000
#> GSM254658     2  0.1163    0.89006 0.028 0.972 0.000
#> GSM254681     2  0.1163    0.89006 0.028 0.972 0.000
#> GSM254719     2  0.0892    0.89708 0.020 0.980 0.000
#> GSM254673     2  0.0000    0.89597 0.000 1.000 0.000
#> GSM254655     2  0.1643    0.89615 0.044 0.956 0.000
#> GSM254669     2  0.0000    0.89597 0.000 1.000 0.000
#> GSM254699     2  0.1643    0.89615 0.044 0.956 0.000
#> GSM254703     2  0.5560    0.82303 0.300 0.700 0.000
#> GSM254708     2  0.1411    0.89260 0.036 0.964 0.000
#> GSM254715     2  0.5621    0.81934 0.308 0.692 0.000
#> GSM254628     2  0.0000    0.89597 0.000 1.000 0.000
#> GSM254634     2  0.5621    0.81934 0.308 0.692 0.000
#> GSM254646     2  0.1163    0.89006 0.028 0.972 0.000
#> GSM254671     2  0.5497    0.82624 0.292 0.708 0.000
#> GSM254711     2  0.5621    0.81934 0.308 0.692 0.000
#> GSM254717     2  0.0892    0.89708 0.020 0.980 0.000
#> GSM254723     3  0.8286    0.15716 0.104 0.308 0.588
#> GSM254730     2  0.1643    0.89615 0.044 0.956 0.000
#> GSM254731     2  0.1643    0.89615 0.044 0.956 0.000
#> GSM254632     2  0.6184    0.73976 0.112 0.780 0.108
#> GSM254662     2  0.0000    0.89597 0.000 1.000 0.000
#> GSM254677     2  0.5733    0.81149 0.324 0.676 0.000
#> GSM254665     2  0.0424    0.89469 0.008 0.992 0.000
#> GSM254691     2  0.1031    0.89121 0.024 0.976 0.000
#> GSM254644     2  0.5621    0.81934 0.308 0.692 0.000
#> GSM254667     2  0.1643    0.89194 0.044 0.956 0.000
#> GSM254676     2  0.1031    0.89121 0.024 0.976 0.000
#> GSM254679     2  0.5497    0.82624 0.292 0.708 0.000
#> GSM254689     2  0.1163    0.89006 0.028 0.972 0.000
#> GSM254706     2  0.1163    0.89006 0.028 0.972 0.000
#> GSM254712     2  0.5621    0.81934 0.308 0.692 0.000
#> GSM254713     2  0.5621    0.81934 0.308 0.692 0.000
#> GSM254683     2  0.1289    0.88856 0.032 0.968 0.000
#> GSM254710     2  0.6111    0.74403 0.112 0.784 0.104
#> GSM254725     2  0.5621    0.81934 0.308 0.692 0.000
#> GSM254651     2  0.1163    0.89006 0.028 0.972 0.000
#> GSM254638     2  0.5621    0.81934 0.308 0.692 0.000
#> GSM254685     2  0.4555    0.85756 0.200 0.800 0.000

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM254629     3  0.6403     0.5935 0.128 0.000 0.640 0.232
#> GSM254648     3  0.6169     0.5922 0.068 0.004 0.632 0.296
#> GSM254694     3  0.6016     0.5926 0.068 0.000 0.632 0.300
#> GSM254701     3  0.6403     0.5935 0.128 0.000 0.640 0.232
#> GSM254728     3  0.4010     0.6650 0.064 0.000 0.836 0.100
#> GSM254726     3  0.6715     0.5803 0.064 0.028 0.620 0.288
#> GSM254639     3  0.5874     0.5375 0.192 0.000 0.696 0.112
#> GSM254652     3  0.3612     0.6713 0.044 0.000 0.856 0.100
#> GSM254700     1  0.2329     0.6184 0.916 0.000 0.072 0.012
#> GSM254625     3  0.2142     0.6615 0.016 0.000 0.928 0.056
#> GSM254636     1  0.5938     0.2425 0.488 0.000 0.476 0.036
#> GSM254659     3  0.4985     0.6429 0.152 0.000 0.768 0.080
#> GSM254680     1  0.5500     0.3602 0.520 0.000 0.464 0.016
#> GSM254686     3  0.3634     0.6472 0.096 0.000 0.856 0.048
#> GSM254718     3  0.5288     0.6404 0.068 0.000 0.732 0.200
#> GSM254674     3  0.5793     0.2435 0.324 0.000 0.628 0.048
#> GSM254668     3  0.5284     0.0553 0.368 0.000 0.616 0.016
#> GSM254697     1  0.2081     0.6214 0.916 0.000 0.084 0.000
#> GSM254704     1  0.1411     0.5896 0.960 0.000 0.020 0.020
#> GSM254707     3  0.2412     0.6290 0.084 0.000 0.908 0.008
#> GSM254714     1  0.4764     0.5814 0.748 0.000 0.220 0.032
#> GSM254722     1  0.5511     0.4569 0.636 0.000 0.332 0.032
#> GSM254627     1  0.2081     0.6214 0.916 0.000 0.084 0.000
#> GSM254630     3  0.3088     0.6711 0.060 0.000 0.888 0.052
#> GSM254633     3  0.5512    -0.3413 0.488 0.000 0.496 0.016
#> GSM254670     3  0.5631     0.4839 0.224 0.000 0.700 0.076
#> GSM254716     3  0.1824     0.6633 0.004 0.000 0.936 0.060
#> GSM254720     1  0.6627     0.1919 0.504 0.000 0.412 0.084
#> GSM254729     3  0.5590     0.6276 0.064 0.000 0.692 0.244
#> GSM254654     3  0.6079     0.5878 0.072 0.000 0.628 0.300
#> GSM254656     3  0.6157     0.5889 0.108 0.000 0.660 0.232
#> GSM254631     1  0.5466     0.4137 0.548 0.000 0.436 0.016
#> GSM254657     3  0.4957     0.6268 0.112 0.000 0.776 0.112
#> GSM254664     1  0.5452     0.4271 0.556 0.000 0.428 0.016
#> GSM254672     1  0.3377     0.6052 0.848 0.000 0.140 0.012
#> GSM254692     1  0.5155     0.2783 0.528 0.000 0.468 0.004
#> GSM254645     3  0.5569     0.6355 0.104 0.000 0.724 0.172
#> GSM254666     3  0.1706     0.6578 0.036 0.000 0.948 0.016
#> GSM254675     1  0.4933     0.3016 0.568 0.000 0.432 0.000
#> GSM254678     1  0.5937     0.2339 0.492 0.000 0.472 0.036
#> GSM254688     3  0.2741     0.6172 0.096 0.000 0.892 0.012
#> GSM254690     1  0.5060     0.4699 0.584 0.000 0.412 0.004
#> GSM254696     3  0.6079     0.1067 0.380 0.000 0.568 0.052
#> GSM254705     3  0.3404     0.6285 0.104 0.000 0.864 0.032
#> GSM254642     1  0.2081     0.6214 0.916 0.000 0.084 0.000
#> GSM254661     3  0.3367     0.6737 0.028 0.000 0.864 0.108
#> GSM254698     1  0.5530     0.4496 0.632 0.000 0.336 0.032
#> GSM254641     3  0.3710     0.5323 0.192 0.000 0.804 0.004
#> GSM254647     1  0.5050     0.4726 0.588 0.000 0.408 0.004
#> GSM254663     3  0.3751     0.5262 0.196 0.000 0.800 0.004
#> GSM254682     3  0.2402     0.6286 0.076 0.000 0.912 0.012
#> GSM254709     3  0.4964     0.1062 0.380 0.000 0.616 0.004
#> GSM254721     1  0.2174     0.6080 0.928 0.000 0.052 0.020
#> GSM254724     1  0.2179     0.6160 0.924 0.000 0.064 0.012
#> GSM254650     3  0.3764     0.5520 0.172 0.000 0.816 0.012
#> GSM254687     3  0.3108     0.6160 0.112 0.000 0.872 0.016
#> GSM254637     1  0.5472     0.4071 0.544 0.000 0.440 0.016
#> GSM254684     3  0.5966     0.3455 0.316 0.000 0.624 0.060
#> GSM254649     2  0.0188     0.7419 0.000 0.996 0.000 0.004
#> GSM254660     2  0.2704     0.6128 0.000 0.876 0.000 0.124
#> GSM254693     2  0.0188     0.7419 0.000 0.996 0.000 0.004
#> GSM254695     4  0.4830     0.7633 0.000 0.392 0.000 0.608
#> GSM254702     2  0.2011     0.6812 0.000 0.920 0.000 0.080
#> GSM254643     2  0.3726     0.3445 0.000 0.788 0.000 0.212
#> GSM254727     2  0.1022     0.7329 0.000 0.968 0.000 0.032
#> GSM254640     2  0.4972    -0.8143 0.000 0.544 0.000 0.456
#> GSM254626     2  0.0000     0.7415 0.000 1.000 0.000 0.000
#> GSM254635     4  0.4992     0.9250 0.000 0.476 0.000 0.524
#> GSM254653     2  0.1022     0.7280 0.000 0.968 0.000 0.032
#> GSM254658     2  0.1474     0.7288 0.000 0.948 0.000 0.052
#> GSM254681     2  0.1474     0.7288 0.000 0.948 0.000 0.052
#> GSM254719     2  0.1022     0.7280 0.000 0.968 0.000 0.032
#> GSM254673     2  0.0188     0.7408 0.000 0.996 0.000 0.004
#> GSM254655     2  0.2011     0.6812 0.000 0.920 0.000 0.080
#> GSM254669     2  0.0188     0.7408 0.000 0.996 0.000 0.004
#> GSM254699     2  0.2011     0.6812 0.000 0.920 0.000 0.080
#> GSM254703     2  0.4994    -0.8683 0.000 0.520 0.000 0.480
#> GSM254708     2  0.2408     0.7123 0.000 0.896 0.000 0.104
#> GSM254715     4  0.4996     0.9225 0.000 0.484 0.000 0.516
#> GSM254628     2  0.0188     0.7419 0.000 0.996 0.000 0.004
#> GSM254634     4  0.5000     0.9053 0.000 0.496 0.000 0.504
#> GSM254646     2  0.1474     0.7288 0.000 0.948 0.000 0.052
#> GSM254671     2  0.4981    -0.8330 0.000 0.536 0.000 0.464
#> GSM254711     4  0.5000     0.9032 0.000 0.496 0.000 0.504
#> GSM254717     2  0.1389     0.7271 0.000 0.952 0.000 0.048
#> GSM254723     3  0.8642     0.2370 0.040 0.232 0.408 0.320
#> GSM254730     2  0.2647     0.6201 0.000 0.880 0.000 0.120
#> GSM254731     2  0.2011     0.6812 0.000 0.920 0.000 0.080
#> GSM254632     2  0.5387     0.3830 0.000 0.696 0.048 0.256
#> GSM254662     2  0.0188     0.7408 0.000 0.996 0.000 0.004
#> GSM254677     4  0.5060     0.8345 0.004 0.412 0.000 0.584
#> GSM254665     2  0.2011     0.7008 0.000 0.920 0.000 0.080
#> GSM254691     2  0.1716     0.7289 0.000 0.936 0.000 0.064
#> GSM254644     2  0.4996    -0.8836 0.000 0.516 0.000 0.484
#> GSM254667     2  0.2469     0.7055 0.000 0.892 0.000 0.108
#> GSM254676     2  0.1716     0.7289 0.000 0.936 0.000 0.064
#> GSM254679     2  0.4985    -0.8374 0.000 0.532 0.000 0.468
#> GSM254689     2  0.1474     0.7288 0.000 0.948 0.000 0.052
#> GSM254706     2  0.1474     0.7288 0.000 0.948 0.000 0.052
#> GSM254712     4  0.4994     0.9249 0.000 0.480 0.000 0.520
#> GSM254713     4  0.4996     0.9225 0.000 0.484 0.000 0.516
#> GSM254683     2  0.1940     0.7191 0.000 0.924 0.000 0.076
#> GSM254710     2  0.5309     0.3889 0.000 0.700 0.044 0.256
#> GSM254725     4  0.4999     0.9088 0.000 0.492 0.000 0.508
#> GSM254651     2  0.1474     0.7288 0.000 0.948 0.000 0.052
#> GSM254638     4  0.4992     0.9250 0.000 0.476 0.000 0.524
#> GSM254685     2  0.4477    -0.1884 0.000 0.688 0.000 0.312

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM254629     3  0.5774    0.44883 0.044 0.000 0.532 0.024 0.400
#> GSM254648     3  0.5733    0.47823 0.004 0.004 0.532 0.064 0.396
#> GSM254694     3  0.5280    0.50983 0.004 0.000 0.584 0.048 0.364
#> GSM254701     3  0.5774    0.44883 0.044 0.000 0.532 0.024 0.400
#> GSM254728     5  0.4242   -0.31457 0.000 0.000 0.428 0.000 0.572
#> GSM254726     3  0.6233    0.50506 0.000 0.032 0.532 0.072 0.364
#> GSM254639     3  0.4687    0.36101 0.028 0.000 0.636 0.000 0.336
#> GSM254652     5  0.3913   -0.01327 0.000 0.000 0.324 0.000 0.676
#> GSM254700     1  0.1901    0.60515 0.928 0.000 0.004 0.012 0.056
#> GSM254625     5  0.2208    0.45336 0.000 0.000 0.072 0.020 0.908
#> GSM254636     5  0.6888   -0.21446 0.348 0.000 0.264 0.004 0.384
#> GSM254659     5  0.5619   -0.05588 0.080 0.000 0.332 0.004 0.584
#> GSM254680     5  0.5171   -0.17622 0.456 0.000 0.040 0.000 0.504
#> GSM254686     5  0.4368    0.41939 0.080 0.000 0.144 0.004 0.772
#> GSM254718     3  0.4637    0.44337 0.000 0.000 0.536 0.012 0.452
#> GSM254674     5  0.6393    0.16050 0.228 0.000 0.228 0.004 0.540
#> GSM254668     5  0.4484    0.29191 0.308 0.000 0.024 0.000 0.668
#> GSM254697     1  0.3277    0.59885 0.856 0.000 0.072 0.004 0.068
#> GSM254704     1  0.1106    0.59311 0.964 0.000 0.024 0.012 0.000
#> GSM254707     5  0.1082    0.53211 0.028 0.000 0.008 0.000 0.964
#> GSM254714     1  0.5029    0.50878 0.728 0.000 0.104 0.012 0.156
#> GSM254722     1  0.6707    0.37923 0.480 0.000 0.304 0.008 0.208
#> GSM254627     1  0.3277    0.59885 0.856 0.000 0.072 0.004 0.068
#> GSM254630     5  0.3852    0.38477 0.028 0.000 0.168 0.008 0.796
#> GSM254633     5  0.5425   -0.12705 0.420 0.000 0.060 0.000 0.520
#> GSM254670     3  0.5501    0.27160 0.064 0.000 0.572 0.004 0.360
#> GSM254716     5  0.2722    0.41424 0.000 0.000 0.108 0.020 0.872
#> GSM254720     1  0.7079    0.04434 0.452 0.000 0.248 0.020 0.280
#> GSM254729     3  0.5501    0.45993 0.000 0.000 0.492 0.064 0.444
#> GSM254654     3  0.5473    0.47675 0.008 0.000 0.548 0.048 0.396
#> GSM254656     3  0.5491    0.42550 0.000 0.000 0.600 0.088 0.312
#> GSM254631     1  0.5177    0.17870 0.488 0.000 0.040 0.000 0.472
#> GSM254657     3  0.4249    0.37371 0.000 0.000 0.568 0.000 0.432
#> GSM254664     1  0.5112    0.19092 0.496 0.000 0.036 0.000 0.468
#> GSM254672     1  0.4124    0.57414 0.796 0.000 0.140 0.012 0.052
#> GSM254692     1  0.5551    0.19729 0.488 0.000 0.068 0.000 0.444
#> GSM254645     3  0.5445    0.41032 0.016 0.000 0.564 0.036 0.384
#> GSM254666     5  0.2448    0.47340 0.020 0.000 0.088 0.000 0.892
#> GSM254675     1  0.5938    0.29019 0.512 0.000 0.112 0.000 0.376
#> GSM254678     1  0.6920    0.18685 0.368 0.000 0.280 0.004 0.348
#> GSM254688     5  0.1082    0.53412 0.028 0.000 0.008 0.000 0.964
#> GSM254690     1  0.5473    0.30308 0.520 0.000 0.064 0.000 0.416
#> GSM254696     5  0.6830   -0.05517 0.240 0.000 0.360 0.004 0.396
#> GSM254705     5  0.2654    0.52807 0.064 0.000 0.048 0.000 0.888
#> GSM254642     1  0.3277    0.59885 0.856 0.000 0.072 0.004 0.068
#> GSM254661     5  0.4127    0.00371 0.000 0.000 0.312 0.008 0.680
#> GSM254698     1  0.6729    0.37156 0.472 0.000 0.312 0.008 0.208
#> GSM254641     5  0.3051    0.52871 0.120 0.000 0.028 0.000 0.852
#> GSM254647     1  0.5414    0.31024 0.528 0.000 0.060 0.000 0.412
#> GSM254663     5  0.3099    0.52696 0.124 0.000 0.028 0.000 0.848
#> GSM254682     5  0.0579    0.52314 0.008 0.000 0.008 0.000 0.984
#> GSM254709     5  0.5584    0.14006 0.312 0.000 0.096 0.000 0.592
#> GSM254721     1  0.1393    0.59930 0.956 0.000 0.008 0.012 0.024
#> GSM254724     1  0.1605    0.60313 0.944 0.000 0.004 0.012 0.040
#> GSM254650     5  0.2377    0.53233 0.128 0.000 0.000 0.000 0.872
#> GSM254687     5  0.2236    0.53777 0.068 0.000 0.024 0.000 0.908
#> GSM254637     1  0.5177    0.17401 0.488 0.000 0.040 0.000 0.472
#> GSM254684     3  0.6113    0.14453 0.116 0.000 0.508 0.004 0.372
#> GSM254649     2  0.0290    0.81373 0.000 0.992 0.000 0.008 0.000
#> GSM254660     2  0.3177    0.57848 0.000 0.792 0.000 0.208 0.000
#> GSM254693     2  0.0290    0.81373 0.000 0.992 0.000 0.008 0.000
#> GSM254695     4  0.3882    0.73275 0.000 0.224 0.020 0.756 0.000
#> GSM254702     2  0.2329    0.72604 0.000 0.876 0.000 0.124 0.000
#> GSM254643     2  0.3508    0.40918 0.000 0.748 0.000 0.252 0.000
#> GSM254727     2  0.1270    0.80074 0.000 0.948 0.000 0.052 0.000
#> GSM254640     4  0.4278    0.79068 0.000 0.452 0.000 0.548 0.000
#> GSM254626     2  0.0404    0.81319 0.000 0.988 0.000 0.012 0.000
#> GSM254635     4  0.3949    0.89864 0.000 0.332 0.000 0.668 0.000
#> GSM254653     2  0.1478    0.78885 0.000 0.936 0.000 0.064 0.000
#> GSM254658     2  0.1671    0.79397 0.000 0.924 0.000 0.076 0.000
#> GSM254681     2  0.1671    0.79397 0.000 0.924 0.000 0.076 0.000
#> GSM254719     2  0.1478    0.78885 0.000 0.936 0.000 0.064 0.000
#> GSM254673     2  0.0510    0.81233 0.000 0.984 0.000 0.016 0.000
#> GSM254655     2  0.2329    0.72604 0.000 0.876 0.000 0.124 0.000
#> GSM254669     2  0.0510    0.81233 0.000 0.984 0.000 0.016 0.000
#> GSM254699     2  0.2329    0.72604 0.000 0.876 0.000 0.124 0.000
#> GSM254703     4  0.4182    0.87762 0.000 0.400 0.000 0.600 0.000
#> GSM254708     2  0.2890    0.75790 0.000 0.836 0.000 0.160 0.004
#> GSM254715     4  0.4060    0.89661 0.000 0.360 0.000 0.640 0.000
#> GSM254628     2  0.0510    0.81367 0.000 0.984 0.000 0.016 0.000
#> GSM254634     4  0.4045    0.90123 0.000 0.356 0.000 0.644 0.000
#> GSM254646     2  0.1671    0.79397 0.000 0.924 0.000 0.076 0.000
#> GSM254671     4  0.4227    0.85172 0.000 0.420 0.000 0.580 0.000
#> GSM254711     4  0.4045    0.90061 0.000 0.356 0.000 0.644 0.000
#> GSM254717     2  0.1608    0.79378 0.000 0.928 0.000 0.072 0.000
#> GSM254723     3  0.8474    0.28505 0.000 0.200 0.316 0.196 0.288
#> GSM254730     2  0.3177    0.59072 0.000 0.792 0.000 0.208 0.000
#> GSM254731     2  0.2329    0.72604 0.000 0.876 0.000 0.124 0.000
#> GSM254632     2  0.5724    0.43758 0.000 0.616 0.056 0.300 0.028
#> GSM254662     2  0.0510    0.81233 0.000 0.984 0.000 0.016 0.000
#> GSM254677     4  0.3521    0.78625 0.000 0.232 0.004 0.764 0.000
#> GSM254665     2  0.2280    0.75194 0.000 0.880 0.000 0.120 0.000
#> GSM254691     2  0.2329    0.78249 0.000 0.876 0.000 0.124 0.000
#> GSM254644     4  0.4182    0.87365 0.000 0.400 0.000 0.600 0.000
#> GSM254667     2  0.3010    0.74563 0.000 0.824 0.000 0.172 0.004
#> GSM254676     2  0.2329    0.78249 0.000 0.876 0.000 0.124 0.000
#> GSM254679     4  0.4210    0.85602 0.000 0.412 0.000 0.588 0.000
#> GSM254689     2  0.1671    0.79397 0.000 0.924 0.000 0.076 0.000
#> GSM254706     2  0.1792    0.79409 0.000 0.916 0.000 0.084 0.000
#> GSM254712     4  0.3999    0.90100 0.000 0.344 0.000 0.656 0.000
#> GSM254713     4  0.4060    0.89661 0.000 0.360 0.000 0.640 0.000
#> GSM254683     2  0.2536    0.77434 0.000 0.868 0.000 0.128 0.004
#> GSM254710     2  0.5681    0.43795 0.000 0.616 0.052 0.304 0.028
#> GSM254725     4  0.4030    0.90100 0.000 0.352 0.000 0.648 0.000
#> GSM254651     2  0.1792    0.79409 0.000 0.916 0.000 0.084 0.000
#> GSM254638     4  0.3949    0.89864 0.000 0.332 0.000 0.668 0.000
#> GSM254685     2  0.4030   -0.08159 0.000 0.648 0.000 0.352 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
#> GSM254629     3  0.3620     0.6219 0.008 0.000 0.836 0.048 0.060 0.048
#> GSM254648     3  0.3065     0.6399 0.008 0.004 0.872 0.028 0.060 0.028
#> GSM254694     3  0.2898     0.6460 0.000 0.000 0.868 0.020 0.072 0.040
#> GSM254701     3  0.3620     0.6219 0.008 0.000 0.836 0.048 0.060 0.048
#> GSM254728     3  0.4934     0.4976 0.000 0.000 0.632 0.000 0.256 0.112
#> GSM254726     3  0.4265     0.6375 0.000 0.032 0.800 0.036 0.080 0.052
#> GSM254639     6  0.5696     0.0934 0.000 0.000 0.372 0.000 0.164 0.464
#> GSM254652     5  0.4932     0.0383 0.000 0.000 0.372 0.000 0.556 0.072
#> GSM254700     1  0.2748     0.6986 0.848 0.000 0.000 0.000 0.024 0.128
#> GSM254625     5  0.2602     0.5512 0.000 0.000 0.052 0.020 0.888 0.040
#> GSM254636     6  0.6167     0.4639 0.160 0.000 0.040 0.000 0.260 0.540
#> GSM254659     3  0.6049     0.4108 0.064 0.000 0.552 0.004 0.304 0.076
#> GSM254680     5  0.6656     0.2647 0.336 0.000 0.076 0.000 0.452 0.136
#> GSM254686     5  0.4451     0.5301 0.064 0.000 0.136 0.004 0.760 0.036
#> GSM254718     3  0.4012     0.6092 0.000 0.000 0.752 0.000 0.164 0.084
#> GSM254674     5  0.6491    -0.3151 0.128 0.000 0.060 0.000 0.424 0.388
#> GSM254668     5  0.5037     0.4964 0.196 0.000 0.016 0.000 0.672 0.116
#> GSM254697     1  0.5227     0.6320 0.612 0.000 0.044 0.000 0.044 0.300
#> GSM254704     1  0.1082     0.6968 0.956 0.000 0.000 0.000 0.004 0.040
#> GSM254707     5  0.0891     0.5851 0.000 0.000 0.008 0.000 0.968 0.024
#> GSM254714     1  0.4431     0.4922 0.740 0.000 0.176 0.000 0.036 0.048
#> GSM254722     6  0.4012     0.4236 0.164 0.000 0.000 0.000 0.084 0.752
#> GSM254627     1  0.5227     0.6320 0.612 0.000 0.044 0.000 0.044 0.300
#> GSM254630     5  0.4378     0.4743 0.012 0.000 0.196 0.004 0.732 0.056
#> GSM254633     5  0.6678     0.2506 0.304 0.000 0.056 0.000 0.452 0.188
#> GSM254670     6  0.5559     0.3168 0.000 0.000 0.284 0.000 0.176 0.540
#> GSM254716     5  0.3243     0.5277 0.000 0.000 0.088 0.020 0.844 0.048
#> GSM254720     3  0.6591     0.0878 0.412 0.000 0.432 0.044 0.036 0.076
#> GSM254729     3  0.4733     0.6029 0.000 0.000 0.728 0.032 0.104 0.136
#> GSM254654     3  0.2572     0.6393 0.008 0.000 0.892 0.020 0.064 0.016
#> GSM254656     3  0.6340     0.0992 0.000 0.000 0.448 0.072 0.092 0.388
#> GSM254631     5  0.6840     0.2193 0.352 0.000 0.072 0.004 0.424 0.148
#> GSM254657     3  0.5965     0.0681 0.000 0.000 0.448 0.004 0.196 0.352
#> GSM254664     5  0.6824     0.2083 0.360 0.000 0.072 0.004 0.420 0.144
#> GSM254672     1  0.4041     0.5338 0.684 0.000 0.008 0.000 0.016 0.292
#> GSM254692     5  0.6071    -0.0874 0.416 0.000 0.044 0.000 0.444 0.096
#> GSM254645     3  0.6173     0.1917 0.008 0.000 0.484 0.024 0.124 0.360
#> GSM254666     5  0.2476     0.5558 0.008 0.000 0.072 0.000 0.888 0.032
#> GSM254675     1  0.6197     0.1519 0.464 0.000 0.028 0.000 0.356 0.152
#> GSM254678     6  0.6056     0.5160 0.184 0.000 0.036 0.000 0.216 0.564
#> GSM254688     5  0.0790     0.5838 0.000 0.000 0.000 0.000 0.968 0.032
#> GSM254690     5  0.6266     0.1094 0.340 0.000 0.008 0.000 0.392 0.260
#> GSM254696     6  0.6350     0.5944 0.108 0.000 0.100 0.000 0.236 0.556
#> GSM254705     5  0.2786     0.5887 0.036 0.000 0.036 0.004 0.884 0.040
#> GSM254642     1  0.5227     0.6320 0.612 0.000 0.044 0.000 0.044 0.300
#> GSM254661     5  0.4970     0.1873 0.000 0.000 0.320 0.008 0.604 0.068
#> GSM254698     6  0.3871     0.4446 0.148 0.000 0.000 0.000 0.084 0.768
#> GSM254641     5  0.2619     0.5891 0.048 0.000 0.012 0.000 0.884 0.056
#> GSM254647     5  0.6227     0.1172 0.356 0.000 0.008 0.000 0.396 0.240
#> GSM254663     5  0.2683     0.5883 0.052 0.000 0.012 0.000 0.880 0.056
#> GSM254682     5  0.0865     0.5776 0.000 0.000 0.000 0.000 0.964 0.036
#> GSM254709     5  0.5804     0.2874 0.264 0.000 0.064 0.000 0.592 0.080
#> GSM254721     1  0.0820     0.7019 0.972 0.000 0.000 0.000 0.016 0.012
#> GSM254724     1  0.1391     0.7027 0.944 0.000 0.000 0.000 0.016 0.040
#> GSM254650     5  0.2361     0.5915 0.088 0.000 0.000 0.000 0.884 0.028
#> GSM254687     5  0.2332     0.5924 0.032 0.000 0.020 0.004 0.908 0.036
#> GSM254637     5  0.6821     0.2206 0.356 0.000 0.072 0.004 0.424 0.144
#> GSM254684     6  0.5759     0.4754 0.012 0.000 0.232 0.000 0.192 0.564
#> GSM254649     2  0.0260     0.8121 0.000 0.992 0.000 0.008 0.000 0.000
#> GSM254660     2  0.2854     0.5802 0.000 0.792 0.000 0.208 0.000 0.000
#> GSM254693     2  0.0260     0.8121 0.000 0.992 0.000 0.008 0.000 0.000
#> GSM254695     4  0.3726     0.7372 0.000 0.216 0.028 0.752 0.000 0.004
#> GSM254702     2  0.2092     0.7257 0.000 0.876 0.000 0.124 0.000 0.000
#> GSM254643     2  0.3151     0.4177 0.000 0.748 0.000 0.252 0.000 0.000
#> GSM254727     2  0.1141     0.7992 0.000 0.948 0.000 0.052 0.000 0.000
#> GSM254640     4  0.3838     0.7851 0.000 0.448 0.000 0.552 0.000 0.000
#> GSM254626     2  0.0363     0.8116 0.000 0.988 0.000 0.012 0.000 0.000
#> GSM254635     4  0.3515     0.8990 0.000 0.324 0.000 0.676 0.000 0.000
#> GSM254653     2  0.1327     0.7873 0.000 0.936 0.000 0.064 0.000 0.000
#> GSM254658     2  0.1610     0.7918 0.000 0.916 0.000 0.084 0.000 0.000
#> GSM254681     2  0.1610     0.7918 0.000 0.916 0.000 0.084 0.000 0.000
#> GSM254719     2  0.1327     0.7873 0.000 0.936 0.000 0.064 0.000 0.000
#> GSM254673     2  0.0458     0.8107 0.000 0.984 0.000 0.016 0.000 0.000
#> GSM254655     2  0.2092     0.7257 0.000 0.876 0.000 0.124 0.000 0.000
#> GSM254669     2  0.0458     0.8107 0.000 0.984 0.000 0.016 0.000 0.000
#> GSM254699     2  0.2092     0.7257 0.000 0.876 0.000 0.124 0.000 0.000
#> GSM254703     4  0.3737     0.8777 0.000 0.392 0.000 0.608 0.000 0.000
#> GSM254708     2  0.2876     0.7607 0.000 0.836 0.004 0.148 0.004 0.008
#> GSM254715     4  0.3620     0.8984 0.000 0.352 0.000 0.648 0.000 0.000
#> GSM254628     2  0.0632     0.8119 0.000 0.976 0.000 0.024 0.000 0.000
#> GSM254634     4  0.3607     0.9020 0.000 0.348 0.000 0.652 0.000 0.000
#> GSM254646     2  0.1610     0.7918 0.000 0.916 0.000 0.084 0.000 0.000
#> GSM254671     4  0.3789     0.8482 0.000 0.416 0.000 0.584 0.000 0.000
#> GSM254711     4  0.3607     0.9014 0.000 0.348 0.000 0.652 0.000 0.000
#> GSM254717     2  0.1501     0.7902 0.000 0.924 0.000 0.076 0.000 0.000
#> GSM254723     3  0.7167     0.3604 0.000 0.196 0.524 0.164 0.052 0.064
#> GSM254730     2  0.2854     0.5922 0.000 0.792 0.000 0.208 0.000 0.000
#> GSM254731     2  0.2092     0.7257 0.000 0.876 0.000 0.124 0.000 0.000
#> GSM254632     2  0.5807     0.4473 0.000 0.612 0.056 0.264 0.024 0.044
#> GSM254662     2  0.0458     0.8107 0.000 0.984 0.000 0.016 0.000 0.000
#> GSM254677     4  0.3487     0.7883 0.000 0.224 0.020 0.756 0.000 0.000
#> GSM254665     2  0.2048     0.7524 0.000 0.880 0.000 0.120 0.000 0.000
#> GSM254691     2  0.2302     0.7823 0.000 0.872 0.000 0.120 0.000 0.008
#> GSM254644     4  0.3737     0.8749 0.000 0.392 0.000 0.608 0.000 0.000
#> GSM254667     2  0.3061     0.7438 0.000 0.816 0.004 0.168 0.004 0.008
#> GSM254676     2  0.2302     0.7823 0.000 0.872 0.000 0.120 0.000 0.008
#> GSM254679     4  0.3774     0.8527 0.000 0.408 0.000 0.592 0.000 0.000
#> GSM254689     2  0.1610     0.7918 0.000 0.916 0.000 0.084 0.000 0.000
#> GSM254706     2  0.1714     0.7919 0.000 0.908 0.000 0.092 0.000 0.000
#> GSM254712     4  0.3563     0.9014 0.000 0.336 0.000 0.664 0.000 0.000
#> GSM254713     4  0.3620     0.8984 0.000 0.352 0.000 0.648 0.000 0.000
#> GSM254683     2  0.2531     0.7716 0.000 0.860 0.000 0.128 0.004 0.008
#> GSM254710     2  0.5771     0.4475 0.000 0.612 0.052 0.268 0.024 0.044
#> GSM254725     4  0.3592     0.9017 0.000 0.344 0.000 0.656 0.000 0.000
#> GSM254651     2  0.1714     0.7919 0.000 0.908 0.000 0.092 0.000 0.000
#> GSM254638     4  0.3515     0.8990 0.000 0.324 0.000 0.676 0.000 0.000
#> GSM254685     2  0.3620    -0.0603 0.000 0.648 0.000 0.352 0.000 0.000

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

consensus_heatmap(res, k = 2)

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

consensus_heatmap(res, k = 3)

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

consensus_heatmap(res, k = 4)

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

consensus_heatmap(res, k = 5)

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

consensus_heatmap(res, k = 6)

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

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

membership_heatmap(res, k = 2)

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

membership_heatmap(res, k = 3)

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

membership_heatmap(res, k = 4)

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

membership_heatmap(res, k = 5)

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

membership_heatmap(res, k = 6)

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

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

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

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

get_signatures(res, k = 3)

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

get_signatures(res, k = 4)

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

get_signatures(res, k = 5)

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

get_signatures(res, k = 6)

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

Signature heatmaps where rows are not scaled:

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

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

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

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

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

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

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

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

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

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

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk MAD-hclust-signature_compare

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

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

An example of the output of tb is:

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

The columns in tb are:

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

UMAP plot which shows how samples are separated.

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

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

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

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

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

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

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

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

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

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

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk MAD-hclust-collect-classes

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

test_to_known_factors(res)
#>              n tissue(p) individual(p) disease.state(p) gender(p) other(p) k
#> MAD:hclust 106  5.55e-24        0.6963            0.705     0.487    1.000 2
#> MAD:hclust  88  7.78e-20        0.6351            0.372     0.368    0.239 3
#> MAD:hclust  77  1.35e-16        0.6019            0.483     0.534    0.349 4
#> MAD:hclust  63  6.79e-13        0.0273            0.779     0.898    0.514 5
#> MAD:hclust  74  1.50e-14        0.0370            0.705     0.179    0.686 6

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


MAD:kmeans**

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

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

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

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

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

collect_plots(res)

plot of chunk MAD-kmeans-collect-plots

The plots are:

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

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

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

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

select_partition_number(res)

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

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

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 1.000           0.995       0.998         0.4983 0.503   0.503
#> 3 3 0.706           0.878       0.854         0.2834 0.833   0.671
#> 4 4 0.613           0.579       0.785         0.1298 0.920   0.776
#> 5 5 0.652           0.584       0.745         0.0719 0.894   0.652
#> 6 6 0.641           0.489       0.701         0.0498 0.934   0.727

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
#> GSM254629     1   0.000      0.996 1.000 0.000
#> GSM254648     1   0.000      0.996 1.000 0.000
#> GSM254694     1   0.000      0.996 1.000 0.000
#> GSM254701     1   0.000      0.996 1.000 0.000
#> GSM254728     1   0.000      0.996 1.000 0.000
#> GSM254726     1   0.000      0.996 1.000 0.000
#> GSM254639     1   0.000      0.996 1.000 0.000
#> GSM254652     1   0.000      0.996 1.000 0.000
#> GSM254700     1   0.000      0.996 1.000 0.000
#> GSM254625     1   0.000      0.996 1.000 0.000
#> GSM254636     1   0.000      0.996 1.000 0.000
#> GSM254659     1   0.000      0.996 1.000 0.000
#> GSM254680     1   0.000      0.996 1.000 0.000
#> GSM254686     1   0.000      0.996 1.000 0.000
#> GSM254718     1   0.000      0.996 1.000 0.000
#> GSM254674     1   0.000      0.996 1.000 0.000
#> GSM254668     1   0.000      0.996 1.000 0.000
#> GSM254697     1   0.000      0.996 1.000 0.000
#> GSM254704     1   0.000      0.996 1.000 0.000
#> GSM254707     1   0.000      0.996 1.000 0.000
#> GSM254714     1   0.000      0.996 1.000 0.000
#> GSM254722     1   0.000      0.996 1.000 0.000
#> GSM254627     1   0.000      0.996 1.000 0.000
#> GSM254630     1   0.000      0.996 1.000 0.000
#> GSM254633     1   0.000      0.996 1.000 0.000
#> GSM254670     1   0.000      0.996 1.000 0.000
#> GSM254716     1   0.000      0.996 1.000 0.000
#> GSM254720     1   0.000      0.996 1.000 0.000
#> GSM254729     1   0.000      0.996 1.000 0.000
#> GSM254654     1   0.000      0.996 1.000 0.000
#> GSM254656     1   0.000      0.996 1.000 0.000
#> GSM254631     1   0.000      0.996 1.000 0.000
#> GSM254657     1   0.000      0.996 1.000 0.000
#> GSM254664     1   0.000      0.996 1.000 0.000
#> GSM254672     1   0.000      0.996 1.000 0.000
#> GSM254692     1   0.000      0.996 1.000 0.000
#> GSM254645     1   0.000      0.996 1.000 0.000
#> GSM254666     1   0.000      0.996 1.000 0.000
#> GSM254675     1   0.000      0.996 1.000 0.000
#> GSM254678     1   0.000      0.996 1.000 0.000
#> GSM254688     1   0.000      0.996 1.000 0.000
#> GSM254690     1   0.000      0.996 1.000 0.000
#> GSM254696     1   0.000      0.996 1.000 0.000
#> GSM254705     1   0.000      0.996 1.000 0.000
#> GSM254642     1   0.000      0.996 1.000 0.000
#> GSM254661     1   0.000      0.996 1.000 0.000
#> GSM254698     1   0.000      0.996 1.000 0.000
#> GSM254641     1   0.000      0.996 1.000 0.000
#> GSM254647     1   0.000      0.996 1.000 0.000
#> GSM254663     1   0.000      0.996 1.000 0.000
#> GSM254682     1   0.000      0.996 1.000 0.000
#> GSM254709     1   0.000      0.996 1.000 0.000
#> GSM254721     1   0.000      0.996 1.000 0.000
#> GSM254724     1   0.000      0.996 1.000 0.000
#> GSM254650     1   0.000      0.996 1.000 0.000
#> GSM254687     1   0.000      0.996 1.000 0.000
#> GSM254637     1   0.000      0.996 1.000 0.000
#> GSM254684     1   0.000      0.996 1.000 0.000
#> GSM254649     2   0.000      1.000 0.000 1.000
#> GSM254660     2   0.000      1.000 0.000 1.000
#> GSM254693     2   0.000      1.000 0.000 1.000
#> GSM254695     2   0.000      1.000 0.000 1.000
#> GSM254702     2   0.000      1.000 0.000 1.000
#> GSM254643     2   0.000      1.000 0.000 1.000
#> GSM254727     2   0.000      1.000 0.000 1.000
#> GSM254640     2   0.000      1.000 0.000 1.000
#> GSM254626     2   0.000      1.000 0.000 1.000
#> GSM254635     2   0.000      1.000 0.000 1.000
#> GSM254653     2   0.000      1.000 0.000 1.000
#> GSM254658     2   0.000      1.000 0.000 1.000
#> GSM254681     2   0.000      1.000 0.000 1.000
#> GSM254719     2   0.000      1.000 0.000 1.000
#> GSM254673     2   0.000      1.000 0.000 1.000
#> GSM254655     2   0.000      1.000 0.000 1.000
#> GSM254669     2   0.000      1.000 0.000 1.000
#> GSM254699     2   0.000      1.000 0.000 1.000
#> GSM254703     2   0.000      1.000 0.000 1.000
#> GSM254708     2   0.000      1.000 0.000 1.000
#> GSM254715     2   0.000      1.000 0.000 1.000
#> GSM254628     2   0.000      1.000 0.000 1.000
#> GSM254634     2   0.000      1.000 0.000 1.000
#> GSM254646     2   0.000      1.000 0.000 1.000
#> GSM254671     2   0.000      1.000 0.000 1.000
#> GSM254711     2   0.000      1.000 0.000 1.000
#> GSM254717     2   0.000      1.000 0.000 1.000
#> GSM254723     1   0.802      0.677 0.756 0.244
#> GSM254730     2   0.000      1.000 0.000 1.000
#> GSM254731     2   0.000      1.000 0.000 1.000
#> GSM254632     1   0.000      0.996 1.000 0.000
#> GSM254662     2   0.000      1.000 0.000 1.000
#> GSM254677     2   0.000      1.000 0.000 1.000
#> GSM254665     2   0.000      1.000 0.000 1.000
#> GSM254691     2   0.000      1.000 0.000 1.000
#> GSM254644     2   0.000      1.000 0.000 1.000
#> GSM254667     2   0.000      1.000 0.000 1.000
#> GSM254676     2   0.000      1.000 0.000 1.000
#> GSM254679     2   0.000      1.000 0.000 1.000
#> GSM254689     2   0.000      1.000 0.000 1.000
#> GSM254706     2   0.000      1.000 0.000 1.000
#> GSM254712     2   0.000      1.000 0.000 1.000
#> GSM254713     2   0.000      1.000 0.000 1.000
#> GSM254683     2   0.000      1.000 0.000 1.000
#> GSM254710     2   0.000      1.000 0.000 1.000
#> GSM254725     2   0.000      1.000 0.000 1.000
#> GSM254651     2   0.000      1.000 0.000 1.000
#> GSM254638     2   0.000      1.000 0.000 1.000
#> GSM254685     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
#> GSM254629     3  0.0592     0.8696 0.012 0.000 0.988
#> GSM254648     3  0.2261     0.8345 0.068 0.000 0.932
#> GSM254694     3  0.1031     0.8739 0.024 0.000 0.976
#> GSM254701     3  0.1411     0.8728 0.036 0.000 0.964
#> GSM254728     3  0.1643     0.8703 0.044 0.000 0.956
#> GSM254726     3  0.2356     0.8312 0.072 0.000 0.928
#> GSM254639     3  0.2066     0.8621 0.060 0.000 0.940
#> GSM254652     3  0.0892     0.8680 0.020 0.000 0.980
#> GSM254700     1  0.5291     0.9314 0.732 0.000 0.268
#> GSM254625     3  0.2796     0.8064 0.092 0.000 0.908
#> GSM254636     1  0.5785     0.9106 0.668 0.000 0.332
#> GSM254659     3  0.1411     0.8728 0.036 0.000 0.964
#> GSM254680     1  0.5397     0.9328 0.720 0.000 0.280
#> GSM254686     3  0.3192     0.7815 0.112 0.000 0.888
#> GSM254718     3  0.1163     0.8742 0.028 0.000 0.972
#> GSM254674     1  0.5529     0.9305 0.704 0.000 0.296
#> GSM254668     1  0.5650     0.9175 0.688 0.000 0.312
#> GSM254697     1  0.5291     0.9314 0.732 0.000 0.268
#> GSM254704     1  0.5760     0.9064 0.672 0.000 0.328
#> GSM254707     1  0.5706     0.9129 0.680 0.000 0.320
#> GSM254714     3  0.1753     0.8683 0.048 0.000 0.952
#> GSM254722     1  0.5291     0.9314 0.732 0.000 0.268
#> GSM254627     1  0.5291     0.9314 0.732 0.000 0.268
#> GSM254630     3  0.5905     0.0537 0.352 0.000 0.648
#> GSM254633     1  0.5785     0.9106 0.668 0.000 0.332
#> GSM254670     3  0.2066     0.8621 0.060 0.000 0.940
#> GSM254716     3  0.2959     0.8008 0.100 0.000 0.900
#> GSM254720     1  0.6267     0.6982 0.548 0.000 0.452
#> GSM254729     3  0.1289     0.8721 0.032 0.000 0.968
#> GSM254654     3  0.2356     0.8517 0.072 0.000 0.928
#> GSM254656     3  0.3816     0.7889 0.148 0.000 0.852
#> GSM254631     1  0.5785     0.9106 0.668 0.000 0.332
#> GSM254657     3  0.1860     0.8674 0.052 0.000 0.948
#> GSM254664     1  0.5397     0.9328 0.720 0.000 0.280
#> GSM254672     1  0.5760     0.9039 0.672 0.000 0.328
#> GSM254692     1  0.5560     0.9158 0.700 0.000 0.300
#> GSM254645     3  0.1753     0.8678 0.048 0.000 0.952
#> GSM254666     3  0.3192     0.7922 0.112 0.000 0.888
#> GSM254675     1  0.5327     0.9324 0.728 0.000 0.272
#> GSM254678     1  0.5785     0.9106 0.668 0.000 0.332
#> GSM254688     1  0.5650     0.9175 0.688 0.000 0.312
#> GSM254690     1  0.5397     0.9328 0.720 0.000 0.280
#> GSM254696     1  0.5835     0.9027 0.660 0.000 0.340
#> GSM254705     1  0.5678     0.9140 0.684 0.000 0.316
#> GSM254642     1  0.5216     0.9290 0.740 0.000 0.260
#> GSM254661     3  0.0000     0.8691 0.000 0.000 1.000
#> GSM254698     1  0.5706     0.9103 0.680 0.000 0.320
#> GSM254641     1  0.5706     0.9213 0.680 0.000 0.320
#> GSM254647     1  0.5291     0.9314 0.732 0.000 0.268
#> GSM254663     1  0.5621     0.9174 0.692 0.000 0.308
#> GSM254682     1  0.5650     0.9175 0.688 0.000 0.312
#> GSM254709     1  0.6307     0.6031 0.512 0.000 0.488
#> GSM254721     1  0.5363     0.9308 0.724 0.000 0.276
#> GSM254724     1  0.5363     0.9308 0.724 0.000 0.276
#> GSM254650     1  0.5650     0.9175 0.688 0.000 0.312
#> GSM254687     1  0.5706     0.9129 0.680 0.000 0.320
#> GSM254637     1  0.5835     0.9057 0.660 0.000 0.340
#> GSM254684     1  0.5785     0.9106 0.668 0.000 0.332
#> GSM254649     2  0.0592     0.9175 0.012 0.988 0.000
#> GSM254660     2  0.3038     0.9116 0.104 0.896 0.000
#> GSM254693     2  0.0424     0.9180 0.008 0.992 0.000
#> GSM254695     2  0.5698     0.8670 0.252 0.736 0.012
#> GSM254702     2  0.4002     0.9002 0.160 0.840 0.000
#> GSM254643     2  0.0424     0.9186 0.008 0.992 0.000
#> GSM254727     2  0.0592     0.9175 0.012 0.988 0.000
#> GSM254640     2  0.3941     0.9012 0.156 0.844 0.000
#> GSM254626     2  0.0000     0.9190 0.000 1.000 0.000
#> GSM254635     2  0.5098     0.8698 0.248 0.752 0.000
#> GSM254653     2  0.0000     0.9190 0.000 1.000 0.000
#> GSM254658     2  0.0592     0.9175 0.012 0.988 0.000
#> GSM254681     2  0.0592     0.9175 0.012 0.988 0.000
#> GSM254719     2  0.0000     0.9190 0.000 1.000 0.000
#> GSM254673     2  0.0000     0.9190 0.000 1.000 0.000
#> GSM254655     2  0.2878     0.9128 0.096 0.904 0.000
#> GSM254669     2  0.0000     0.9190 0.000 1.000 0.000
#> GSM254699     2  0.2537     0.9148 0.080 0.920 0.000
#> GSM254703     2  0.5016     0.8734 0.240 0.760 0.000
#> GSM254708     2  0.1529     0.9131 0.040 0.960 0.000
#> GSM254715     2  0.4796     0.8801 0.220 0.780 0.000
#> GSM254628     2  0.0592     0.9175 0.012 0.988 0.000
#> GSM254634     2  0.5016     0.8734 0.240 0.760 0.000
#> GSM254646     2  0.0592     0.9175 0.012 0.988 0.000
#> GSM254671     2  0.4062     0.8991 0.164 0.836 0.000
#> GSM254711     2  0.5016     0.8734 0.240 0.760 0.000
#> GSM254717     2  0.0592     0.9175 0.012 0.988 0.000
#> GSM254723     3  0.4953     0.7046 0.176 0.016 0.808
#> GSM254730     2  0.2878     0.9128 0.096 0.904 0.000
#> GSM254731     2  0.4002     0.9002 0.160 0.840 0.000
#> GSM254632     3  0.2537     0.8276 0.080 0.000 0.920
#> GSM254662     2  0.0000     0.9190 0.000 1.000 0.000
#> GSM254677     2  0.5016     0.8734 0.240 0.760 0.000
#> GSM254665     2  0.0424     0.9186 0.008 0.992 0.000
#> GSM254691     2  0.1031     0.9166 0.024 0.976 0.000
#> GSM254644     2  0.4002     0.9002 0.160 0.840 0.000
#> GSM254667     2  0.1529     0.9131 0.040 0.960 0.000
#> GSM254676     2  0.0424     0.9180 0.008 0.992 0.000
#> GSM254679     2  0.5016     0.8734 0.240 0.760 0.000
#> GSM254689     2  0.0592     0.9175 0.012 0.988 0.000
#> GSM254706     2  0.1163     0.9152 0.028 0.972 0.000
#> GSM254712     2  0.4931     0.8759 0.232 0.768 0.000
#> GSM254713     2  0.4931     0.8759 0.232 0.768 0.000
#> GSM254683     2  0.0592     0.9175 0.012 0.988 0.000
#> GSM254710     3  0.7181     0.4840 0.048 0.304 0.648
#> GSM254725     2  0.5016     0.8734 0.240 0.760 0.000
#> GSM254651     2  0.0592     0.9175 0.012 0.988 0.000
#> GSM254638     2  0.5098     0.8698 0.248 0.752 0.000
#> GSM254685     2  0.4654     0.8852 0.208 0.792 0.000

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM254629     3  0.1938     0.8611 0.052 0.000 0.936 0.012
#> GSM254648     3  0.3037     0.8456 0.036 0.000 0.888 0.076
#> GSM254694     3  0.3168     0.8543 0.060 0.000 0.884 0.056
#> GSM254701     3  0.2124     0.8613 0.068 0.000 0.924 0.008
#> GSM254728     3  0.2742     0.8558 0.076 0.000 0.900 0.024
#> GSM254726     3  0.3176     0.8435 0.036 0.000 0.880 0.084
#> GSM254639     3  0.3732     0.8407 0.092 0.000 0.852 0.056
#> GSM254652     3  0.2443     0.8544 0.060 0.000 0.916 0.024
#> GSM254700     1  0.3161     0.7645 0.864 0.000 0.012 0.124
#> GSM254625     3  0.7168     0.4202 0.256 0.000 0.552 0.192
#> GSM254636     1  0.4206     0.7589 0.816 0.000 0.136 0.048
#> GSM254659     3  0.1824     0.8629 0.060 0.000 0.936 0.004
#> GSM254680     1  0.2775     0.7898 0.896 0.000 0.084 0.020
#> GSM254686     3  0.6970     0.4319 0.256 0.000 0.576 0.168
#> GSM254718     3  0.1902     0.8628 0.064 0.000 0.932 0.004
#> GSM254674     1  0.5551     0.7365 0.728 0.000 0.112 0.160
#> GSM254668     1  0.5678     0.7254 0.716 0.000 0.112 0.172
#> GSM254697     1  0.2714     0.7703 0.884 0.000 0.004 0.112
#> GSM254704     1  0.4387     0.7404 0.804 0.000 0.052 0.144
#> GSM254707     1  0.6001     0.7083 0.688 0.000 0.128 0.184
#> GSM254714     3  0.2984     0.8522 0.084 0.000 0.888 0.028
#> GSM254722     1  0.2773     0.7733 0.880 0.000 0.004 0.116
#> GSM254627     1  0.2714     0.7703 0.884 0.000 0.004 0.112
#> GSM254630     1  0.7551     0.2439 0.448 0.000 0.356 0.196
#> GSM254633     1  0.3907     0.7632 0.828 0.000 0.140 0.032
#> GSM254670     3  0.4261     0.8223 0.112 0.000 0.820 0.068
#> GSM254716     3  0.7190     0.4074 0.260 0.000 0.548 0.192
#> GSM254720     1  0.6819     0.3585 0.564 0.000 0.312 0.124
#> GSM254729     3  0.3474     0.8543 0.068 0.000 0.868 0.064
#> GSM254654     3  0.3168     0.8543 0.060 0.000 0.884 0.056
#> GSM254656     3  0.4100     0.8239 0.036 0.000 0.816 0.148
#> GSM254631     1  0.3674     0.7748 0.848 0.000 0.116 0.036
#> GSM254657     3  0.3900     0.8418 0.084 0.000 0.844 0.072
#> GSM254664     1  0.2329     0.7945 0.916 0.000 0.072 0.012
#> GSM254672     1  0.4706     0.7278 0.788 0.000 0.072 0.140
#> GSM254692     1  0.4868     0.7404 0.720 0.000 0.024 0.256
#> GSM254645     3  0.3333     0.8478 0.088 0.000 0.872 0.040
#> GSM254666     3  0.7201     0.3947 0.268 0.000 0.544 0.188
#> GSM254675     1  0.3301     0.7965 0.876 0.000 0.076 0.048
#> GSM254678     1  0.3674     0.7649 0.852 0.000 0.104 0.044
#> GSM254688     1  0.5902     0.7152 0.696 0.000 0.120 0.184
#> GSM254690     1  0.1635     0.7957 0.948 0.000 0.044 0.008
#> GSM254696     1  0.4829     0.7455 0.776 0.000 0.156 0.068
#> GSM254705     1  0.5803     0.7242 0.700 0.000 0.104 0.196
#> GSM254642     1  0.2530     0.7706 0.888 0.000 0.000 0.112
#> GSM254661     3  0.1661     0.8603 0.052 0.000 0.944 0.004
#> GSM254698     1  0.4301     0.7431 0.816 0.000 0.064 0.120
#> GSM254641     1  0.5209     0.7494 0.756 0.000 0.104 0.140
#> GSM254647     1  0.2197     0.7791 0.916 0.000 0.004 0.080
#> GSM254663     1  0.4898     0.7549 0.772 0.000 0.072 0.156
#> GSM254682     1  0.5902     0.7152 0.696 0.000 0.120 0.184
#> GSM254709     1  0.6993     0.5676 0.572 0.000 0.260 0.168
#> GSM254721     1  0.3280     0.7631 0.860 0.000 0.016 0.124
#> GSM254724     1  0.3280     0.7631 0.860 0.000 0.016 0.124
#> GSM254650     1  0.5850     0.7216 0.700 0.000 0.116 0.184
#> GSM254687     1  0.6027     0.7127 0.684 0.000 0.124 0.192
#> GSM254637     1  0.4224     0.7592 0.812 0.000 0.144 0.044
#> GSM254684     1  0.4944     0.7416 0.768 0.000 0.160 0.072
#> GSM254649     2  0.0336     0.6183 0.000 0.992 0.008 0.000
#> GSM254660     2  0.5339    -0.3626 0.000 0.600 0.016 0.384
#> GSM254693     2  0.0336     0.6194 0.000 0.992 0.000 0.008
#> GSM254695     4  0.5040     0.8381 0.000 0.364 0.008 0.628
#> GSM254702     2  0.5364    -0.3907 0.000 0.592 0.016 0.392
#> GSM254643     2  0.1356     0.6175 0.000 0.960 0.008 0.032
#> GSM254727     2  0.0927     0.6187 0.000 0.976 0.016 0.008
#> GSM254640     2  0.5183    -0.4761 0.000 0.584 0.008 0.408
#> GSM254626     2  0.1356     0.6175 0.000 0.960 0.008 0.032
#> GSM254635     4  0.5097     0.8995 0.000 0.428 0.004 0.568
#> GSM254653     2  0.1610     0.6146 0.000 0.952 0.016 0.032
#> GSM254658     2  0.0336     0.6183 0.000 0.992 0.008 0.000
#> GSM254681     2  0.0469     0.6172 0.000 0.988 0.012 0.000
#> GSM254719     2  0.1798     0.6111 0.000 0.944 0.016 0.040
#> GSM254673     2  0.1452     0.6163 0.000 0.956 0.008 0.036
#> GSM254655     2  0.4599     0.1901 0.000 0.736 0.016 0.248
#> GSM254669     2  0.1256     0.6187 0.000 0.964 0.008 0.028
#> GSM254699     2  0.3969     0.3891 0.000 0.804 0.016 0.180
#> GSM254703     4  0.5236     0.9107 0.000 0.432 0.008 0.560
#> GSM254708     2  0.3355     0.4758 0.000 0.836 0.004 0.160
#> GSM254715     2  0.5399    -0.6231 0.000 0.520 0.012 0.468
#> GSM254628     2  0.0336     0.6183 0.000 0.992 0.008 0.000
#> GSM254634     4  0.5203     0.9223 0.000 0.416 0.008 0.576
#> GSM254646     2  0.0672     0.6186 0.000 0.984 0.008 0.008
#> GSM254671     2  0.5466    -0.5314 0.000 0.548 0.016 0.436
#> GSM254711     4  0.5236     0.9123 0.000 0.432 0.008 0.560
#> GSM254717     2  0.0657     0.6200 0.000 0.984 0.012 0.004
#> GSM254723     3  0.3249     0.8020 0.008 0.000 0.852 0.140
#> GSM254730     2  0.5047    -0.1540 0.000 0.668 0.016 0.316
#> GSM254731     2  0.5364    -0.3907 0.000 0.592 0.016 0.392
#> GSM254632     3  0.3372     0.8410 0.036 0.000 0.868 0.096
#> GSM254662     2  0.1798     0.6111 0.000 0.944 0.016 0.040
#> GSM254677     4  0.5125     0.8951 0.000 0.388 0.008 0.604
#> GSM254665     2  0.2342     0.5850 0.000 0.912 0.008 0.080
#> GSM254691     2  0.3355     0.4930 0.000 0.836 0.004 0.160
#> GSM254644     2  0.5161    -0.4506 0.000 0.592 0.008 0.400
#> GSM254667     2  0.3764     0.4528 0.000 0.816 0.012 0.172
#> GSM254676     2  0.3306     0.4990 0.000 0.840 0.004 0.156
#> GSM254679     4  0.5236     0.9123 0.000 0.432 0.008 0.560
#> GSM254689     2  0.0469     0.6172 0.000 0.988 0.012 0.000
#> GSM254706     2  0.2988     0.5199 0.000 0.876 0.012 0.112
#> GSM254712     2  0.5399    -0.6231 0.000 0.520 0.012 0.468
#> GSM254713     2  0.5399    -0.6231 0.000 0.520 0.012 0.468
#> GSM254683     2  0.2610     0.5465 0.000 0.900 0.012 0.088
#> GSM254710     2  0.8152    -0.0866 0.008 0.384 0.300 0.308
#> GSM254725     4  0.5193     0.9219 0.000 0.412 0.008 0.580
#> GSM254651     2  0.2610     0.5465 0.000 0.900 0.012 0.088
#> GSM254638     4  0.4950     0.8894 0.000 0.376 0.004 0.620
#> GSM254685     2  0.5399    -0.6231 0.000 0.520 0.012 0.468

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM254629     3  0.1914     0.9062 0.004 0.000 0.932 0.032 0.032
#> GSM254648     3  0.1630     0.9019 0.000 0.004 0.944 0.036 0.016
#> GSM254694     3  0.1461     0.9056 0.016 0.000 0.952 0.028 0.004
#> GSM254701     3  0.1904     0.9071 0.016 0.000 0.936 0.028 0.020
#> GSM254728     3  0.2492     0.8990 0.020 0.000 0.900 0.008 0.072
#> GSM254726     3  0.1630     0.9012 0.004 0.000 0.944 0.036 0.016
#> GSM254639     3  0.3921     0.8724 0.072 0.000 0.828 0.024 0.076
#> GSM254652     3  0.2407     0.8936 0.004 0.000 0.896 0.012 0.088
#> GSM254700     1  0.2116     0.6401 0.912 0.000 0.004 0.008 0.076
#> GSM254625     5  0.5539     0.5339 0.048 0.000 0.304 0.024 0.624
#> GSM254636     1  0.6786     0.4904 0.564 0.000 0.056 0.124 0.256
#> GSM254659     3  0.1701     0.9096 0.016 0.000 0.936 0.000 0.048
#> GSM254680     5  0.6180    -0.1489 0.432 0.000 0.008 0.104 0.456
#> GSM254686     5  0.5653     0.5302 0.048 0.000 0.332 0.024 0.596
#> GSM254718     3  0.1211     0.9112 0.016 0.000 0.960 0.000 0.024
#> GSM254674     5  0.5815     0.4691 0.272 0.000 0.012 0.100 0.616
#> GSM254668     5  0.4671     0.6512 0.232 0.000 0.016 0.032 0.720
#> GSM254697     1  0.2830     0.6396 0.876 0.000 0.000 0.044 0.080
#> GSM254704     1  0.1799     0.6398 0.940 0.000 0.028 0.012 0.020
#> GSM254707     5  0.4104     0.6788 0.220 0.000 0.032 0.000 0.748
#> GSM254714     3  0.2844     0.8825 0.064 0.000 0.888 0.032 0.016
#> GSM254722     1  0.2450     0.6450 0.900 0.000 0.000 0.052 0.048
#> GSM254627     1  0.2830     0.6396 0.876 0.000 0.000 0.044 0.080
#> GSM254630     5  0.5574     0.6037 0.132 0.000 0.212 0.004 0.652
#> GSM254633     1  0.6832     0.4873 0.552 0.000 0.064 0.108 0.276
#> GSM254670     3  0.5424     0.7796 0.072 0.000 0.732 0.096 0.100
#> GSM254716     5  0.5618     0.5280 0.048 0.000 0.304 0.028 0.620
#> GSM254720     1  0.4236     0.4271 0.728 0.000 0.248 0.016 0.008
#> GSM254729     3  0.2513     0.9032 0.060 0.000 0.904 0.016 0.020
#> GSM254654     3  0.1461     0.9056 0.016 0.000 0.952 0.028 0.004
#> GSM254656     3  0.4734     0.8448 0.052 0.000 0.780 0.096 0.072
#> GSM254631     1  0.6547     0.5205 0.588 0.000 0.052 0.108 0.252
#> GSM254657     3  0.4148     0.8601 0.072 0.000 0.812 0.024 0.092
#> GSM254664     1  0.6105     0.4451 0.552 0.000 0.012 0.104 0.332
#> GSM254672     1  0.1772     0.6340 0.940 0.000 0.032 0.020 0.008
#> GSM254692     1  0.4268    -0.1222 0.556 0.000 0.000 0.000 0.444
#> GSM254645     3  0.3736     0.8798 0.072 0.000 0.840 0.024 0.064
#> GSM254666     5  0.5205     0.5405 0.048 0.000 0.312 0.008 0.632
#> GSM254675     1  0.4935     0.4921 0.668 0.000 0.016 0.028 0.288
#> GSM254678     1  0.6474     0.5447 0.612 0.000 0.052 0.124 0.212
#> GSM254688     5  0.4004     0.6727 0.232 0.000 0.016 0.004 0.748
#> GSM254690     1  0.6086     0.4635 0.556 0.000 0.008 0.116 0.320
#> GSM254696     1  0.7123     0.3934 0.504 0.000 0.064 0.128 0.304
#> GSM254705     5  0.4169     0.6641 0.256 0.000 0.016 0.004 0.724
#> GSM254642     1  0.2946     0.6347 0.868 0.000 0.000 0.044 0.088
#> GSM254661     3  0.1970     0.9056 0.004 0.000 0.924 0.012 0.060
#> GSM254698     1  0.4044     0.6301 0.804 0.000 0.028 0.140 0.028
#> GSM254641     5  0.5324     0.5309 0.304 0.000 0.020 0.040 0.636
#> GSM254647     1  0.4926     0.6188 0.712 0.000 0.000 0.112 0.176
#> GSM254663     5  0.4742     0.5454 0.324 0.000 0.008 0.020 0.648
#> GSM254682     5  0.4004     0.6727 0.232 0.000 0.016 0.004 0.748
#> GSM254709     5  0.6222     0.5971 0.192 0.000 0.176 0.020 0.612
#> GSM254721     1  0.2414     0.6383 0.900 0.000 0.008 0.012 0.080
#> GSM254724     1  0.2414     0.6383 0.900 0.000 0.008 0.012 0.080
#> GSM254650     5  0.4132     0.6673 0.260 0.000 0.020 0.000 0.720
#> GSM254687     5  0.4141     0.6739 0.248 0.000 0.024 0.000 0.728
#> GSM254637     1  0.6731     0.5253 0.580 0.000 0.068 0.108 0.244
#> GSM254684     1  0.7101     0.3769 0.504 0.000 0.064 0.124 0.308
#> GSM254649     2  0.1764     0.6527 0.000 0.928 0.008 0.000 0.064
#> GSM254660     2  0.5096    -0.0744 0.016 0.616 0.004 0.348 0.016
#> GSM254693     2  0.0609     0.6556 0.000 0.980 0.000 0.000 0.020
#> GSM254695     4  0.5530     0.7123 0.004 0.204 0.020 0.688 0.084
#> GSM254702     2  0.5185    -0.2055 0.016 0.588 0.004 0.376 0.016
#> GSM254643     2  0.1018     0.6517 0.000 0.968 0.000 0.016 0.016
#> GSM254727     2  0.1917     0.6465 0.016 0.936 0.004 0.008 0.036
#> GSM254640     2  0.5576    -0.4947 0.004 0.496 0.004 0.448 0.048
#> GSM254626     2  0.0510     0.6525 0.000 0.984 0.000 0.016 0.000
#> GSM254635     4  0.4318     0.8134 0.000 0.292 0.000 0.688 0.020
#> GSM254653     2  0.1834     0.6454 0.016 0.940 0.004 0.008 0.032
#> GSM254658     2  0.1830     0.6520 0.000 0.924 0.008 0.000 0.068
#> GSM254681     2  0.2304     0.6428 0.000 0.892 0.008 0.000 0.100
#> GSM254719     2  0.1784     0.6381 0.016 0.944 0.004 0.020 0.016
#> GSM254673     2  0.1256     0.6471 0.012 0.964 0.004 0.012 0.008
#> GSM254655     2  0.4303     0.3601 0.016 0.756 0.004 0.208 0.016
#> GSM254669     2  0.1256     0.6471 0.012 0.964 0.004 0.012 0.008
#> GSM254699     2  0.3988     0.4390 0.016 0.792 0.004 0.172 0.016
#> GSM254703     4  0.4632     0.8139 0.004 0.264 0.004 0.700 0.028
#> GSM254708     2  0.5295     0.4239 0.000 0.664 0.000 0.224 0.112
#> GSM254715     4  0.5536     0.6720 0.004 0.412 0.004 0.532 0.048
#> GSM254628     2  0.1830     0.6520 0.000 0.924 0.008 0.000 0.068
#> GSM254634     4  0.4347     0.8200 0.004 0.256 0.000 0.716 0.024
#> GSM254646     2  0.2077     0.6481 0.000 0.908 0.008 0.000 0.084
#> GSM254671     2  0.5298    -0.3799 0.016 0.532 0.004 0.432 0.016
#> GSM254711     4  0.4268     0.8199 0.004 0.272 0.000 0.708 0.016
#> GSM254717     2  0.1041     0.6563 0.000 0.964 0.000 0.004 0.032
#> GSM254723     3  0.2616     0.8674 0.000 0.000 0.888 0.076 0.036
#> GSM254730     2  0.5100     0.1580 0.016 0.672 0.004 0.276 0.032
#> GSM254731     2  0.5185    -0.2055 0.016 0.588 0.004 0.376 0.016
#> GSM254632     3  0.3274     0.8525 0.000 0.004 0.856 0.064 0.076
#> GSM254662     2  0.1784     0.6381 0.016 0.944 0.004 0.020 0.016
#> GSM254677     4  0.4974     0.7952 0.004 0.232 0.008 0.704 0.052
#> GSM254665     2  0.3593     0.5703 0.000 0.824 0.000 0.116 0.060
#> GSM254691     2  0.5064     0.4094 0.000 0.672 0.000 0.248 0.080
#> GSM254644     2  0.5558    -0.4293 0.004 0.516 0.004 0.428 0.048
#> GSM254667     2  0.5848     0.4034 0.000 0.628 0.008 0.224 0.140
#> GSM254676     2  0.5039     0.4157 0.000 0.676 0.000 0.244 0.080
#> GSM254679     4  0.4268     0.8199 0.004 0.272 0.000 0.708 0.016
#> GSM254689     2  0.2304     0.6428 0.000 0.892 0.008 0.000 0.100
#> GSM254706     2  0.5481     0.4606 0.000 0.676 0.008 0.184 0.132
#> GSM254712     4  0.5574     0.6860 0.004 0.400 0.004 0.540 0.052
#> GSM254713     4  0.5574     0.6860 0.004 0.400 0.004 0.540 0.052
#> GSM254683     2  0.5145     0.4942 0.000 0.712 0.008 0.160 0.120
#> GSM254710     2  0.8150     0.1285 0.000 0.348 0.120 0.204 0.328
#> GSM254725     4  0.4347     0.8200 0.004 0.256 0.000 0.716 0.024
#> GSM254651     2  0.5163     0.5049 0.000 0.712 0.008 0.144 0.136
#> GSM254638     4  0.4506     0.8204 0.000 0.244 0.004 0.716 0.036
#> GSM254685     4  0.5582     0.6806 0.004 0.404 0.004 0.536 0.052

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM254629     3  0.1989    0.82703 0.024 0.000 0.928 0.016 0.020 0.012
#> GSM254648     3  0.2187    0.81913 0.012 0.000 0.916 0.028 0.008 0.036
#> GSM254694     3  0.2250    0.82441 0.020 0.000 0.916 0.016 0.020 0.028
#> GSM254701     3  0.1895    0.82658 0.024 0.000 0.932 0.012 0.020 0.012
#> GSM254728     3  0.2821    0.81973 0.004 0.000 0.860 0.000 0.096 0.040
#> GSM254726     3  0.2145    0.81665 0.004 0.000 0.912 0.020 0.008 0.056
#> GSM254639     3  0.5482    0.72090 0.052 0.000 0.652 0.000 0.100 0.196
#> GSM254652     3  0.3059    0.81695 0.004 0.000 0.848 0.004 0.104 0.040
#> GSM254700     1  0.2558    0.71108 0.840 0.000 0.000 0.004 0.156 0.000
#> GSM254625     5  0.3761    0.54295 0.004 0.000 0.160 0.004 0.784 0.048
#> GSM254636     5  0.7093   -0.14811 0.300 0.000 0.040 0.012 0.352 0.296
#> GSM254659     3  0.2002    0.83335 0.008 0.000 0.916 0.000 0.056 0.020
#> GSM254680     5  0.5645    0.35785 0.176 0.000 0.012 0.028 0.648 0.136
#> GSM254686     5  0.4314    0.54042 0.012 0.000 0.208 0.024 0.736 0.020
#> GSM254718     3  0.1078    0.83401 0.008 0.000 0.964 0.000 0.016 0.012
#> GSM254674     5  0.3687    0.54683 0.020 0.000 0.008 0.028 0.808 0.136
#> GSM254668     5  0.2637    0.59363 0.036 0.000 0.004 0.028 0.892 0.040
#> GSM254697     1  0.4733    0.70307 0.712 0.000 0.000 0.024 0.180 0.084
#> GSM254704     1  0.2261    0.71012 0.884 0.000 0.008 0.004 0.104 0.000
#> GSM254707     5  0.0603    0.61732 0.000 0.000 0.016 0.000 0.980 0.004
#> GSM254714     3  0.3649    0.77098 0.140 0.000 0.808 0.012 0.028 0.012
#> GSM254722     1  0.4766    0.69200 0.716 0.000 0.000 0.024 0.156 0.104
#> GSM254627     1  0.4733    0.70307 0.712 0.000 0.000 0.024 0.180 0.084
#> GSM254630     5  0.3525    0.56565 0.016 0.000 0.132 0.004 0.816 0.032
#> GSM254633     5  0.7109   -0.14423 0.368 0.000 0.048 0.028 0.396 0.160
#> GSM254670     3  0.6173    0.58989 0.052 0.000 0.540 0.000 0.128 0.280
#> GSM254716     5  0.3703    0.54007 0.004 0.000 0.176 0.004 0.780 0.036
#> GSM254720     1  0.4042    0.57754 0.760 0.000 0.172 0.004 0.060 0.004
#> GSM254729     3  0.3364    0.80403 0.036 0.000 0.820 0.000 0.012 0.132
#> GSM254654     3  0.2250    0.82441 0.020 0.000 0.916 0.016 0.020 0.028
#> GSM254656     3  0.5627    0.69897 0.040 0.000 0.620 0.028 0.040 0.272
#> GSM254631     5  0.6909   -0.16682 0.388 0.000 0.032 0.028 0.392 0.160
#> GSM254657     3  0.5404    0.72988 0.044 0.000 0.660 0.000 0.112 0.184
#> GSM254664     5  0.6426   -0.10610 0.372 0.000 0.012 0.028 0.452 0.136
#> GSM254672     1  0.4022    0.68138 0.788 0.000 0.024 0.000 0.104 0.084
#> GSM254692     5  0.4180    0.20536 0.348 0.000 0.000 0.008 0.632 0.012
#> GSM254645     3  0.5238    0.73983 0.052 0.000 0.680 0.000 0.088 0.180
#> GSM254666     5  0.3277    0.54088 0.000 0.000 0.188 0.004 0.792 0.016
#> GSM254675     1  0.5079    0.39206 0.572 0.000 0.016 0.020 0.372 0.020
#> GSM254678     1  0.6915    0.14529 0.352 0.000 0.032 0.008 0.324 0.284
#> GSM254688     5  0.0291    0.61684 0.000 0.000 0.004 0.000 0.992 0.004
#> GSM254690     5  0.6411   -0.09268 0.336 0.000 0.004 0.028 0.460 0.172
#> GSM254696     5  0.7017   -0.02091 0.228 0.000 0.060 0.004 0.400 0.308
#> GSM254705     5  0.1750    0.61056 0.016 0.000 0.012 0.000 0.932 0.040
#> GSM254642     1  0.4930    0.69434 0.696 0.000 0.000 0.028 0.184 0.092
#> GSM254661     3  0.2465    0.83040 0.004 0.000 0.892 0.004 0.064 0.036
#> GSM254698     1  0.6239    0.50294 0.492 0.000 0.020 0.008 0.152 0.328
#> GSM254641     5  0.4260    0.52855 0.124 0.000 0.016 0.032 0.784 0.044
#> GSM254647     1  0.5803    0.56101 0.568 0.000 0.000 0.028 0.276 0.128
#> GSM254663     5  0.3058    0.55780 0.104 0.000 0.000 0.012 0.848 0.036
#> GSM254682     5  0.0291    0.61684 0.000 0.000 0.004 0.000 0.992 0.004
#> GSM254709     5  0.4128    0.55920 0.060 0.000 0.128 0.008 0.784 0.020
#> GSM254721     1  0.2734    0.70873 0.840 0.000 0.000 0.004 0.148 0.008
#> GSM254724     1  0.2442    0.71129 0.852 0.000 0.000 0.004 0.144 0.000
#> GSM254650     5  0.1511    0.60653 0.044 0.000 0.004 0.000 0.940 0.012
#> GSM254687     5  0.1262    0.61227 0.020 0.000 0.008 0.000 0.956 0.016
#> GSM254637     1  0.7064    0.12859 0.408 0.000 0.040 0.032 0.360 0.160
#> GSM254684     5  0.6890   -0.00793 0.224 0.000 0.060 0.000 0.400 0.316
#> GSM254649     2  0.3219    0.49531 0.016 0.808 0.000 0.008 0.000 0.168
#> GSM254660     2  0.4076    0.11112 0.000 0.620 0.000 0.364 0.000 0.016
#> GSM254693     2  0.1889    0.56434 0.020 0.920 0.000 0.004 0.000 0.056
#> GSM254695     4  0.5018    0.58002 0.008 0.084 0.020 0.692 0.000 0.196
#> GSM254702     2  0.4219   -0.02489 0.000 0.592 0.000 0.388 0.000 0.020
#> GSM254643     2  0.2964    0.56385 0.036 0.868 0.000 0.036 0.000 0.060
#> GSM254727     2  0.1320    0.57143 0.000 0.948 0.000 0.016 0.000 0.036
#> GSM254640     4  0.5896    0.49639 0.036 0.360 0.000 0.508 0.000 0.096
#> GSM254626     2  0.2259    0.57746 0.020 0.908 0.000 0.032 0.000 0.040
#> GSM254635     4  0.3844    0.78263 0.012 0.136 0.016 0.800 0.000 0.036
#> GSM254653     2  0.1498    0.57850 0.000 0.940 0.000 0.028 0.000 0.032
#> GSM254658     2  0.3254    0.49279 0.016 0.804 0.000 0.008 0.000 0.172
#> GSM254681     2  0.3875    0.38728 0.016 0.716 0.000 0.008 0.000 0.260
#> GSM254719     2  0.1124    0.57980 0.000 0.956 0.000 0.036 0.000 0.008
#> GSM254673     2  0.0790    0.58099 0.000 0.968 0.000 0.032 0.000 0.000
#> GSM254655     2  0.3141    0.47141 0.000 0.788 0.000 0.200 0.000 0.012
#> GSM254669     2  0.0790    0.58099 0.000 0.968 0.000 0.032 0.000 0.000
#> GSM254699     2  0.2653    0.53813 0.000 0.844 0.000 0.144 0.000 0.012
#> GSM254703     4  0.3873    0.77951 0.020 0.104 0.004 0.804 0.000 0.068
#> GSM254708     2  0.6047   -0.21034 0.004 0.496 0.004 0.252 0.000 0.244
#> GSM254715     4  0.5525    0.73739 0.052 0.216 0.000 0.640 0.000 0.092
#> GSM254628     2  0.3321    0.48927 0.016 0.796 0.000 0.008 0.000 0.180
#> GSM254634     4  0.3186    0.76206 0.008 0.092 0.016 0.852 0.000 0.032
#> GSM254646     2  0.3401    0.46410 0.016 0.776 0.000 0.004 0.000 0.204
#> GSM254671     2  0.4315   -0.20667 0.000 0.524 0.008 0.460 0.000 0.008
#> GSM254711     4  0.3377    0.76778 0.008 0.108 0.016 0.836 0.000 0.032
#> GSM254717     2  0.1657    0.56667 0.000 0.928 0.000 0.016 0.000 0.056
#> GSM254723     3  0.2957    0.76748 0.004 0.000 0.844 0.032 0.000 0.120
#> GSM254730     2  0.4316    0.24279 0.000 0.648 0.000 0.312 0.000 0.040
#> GSM254731     2  0.4150   -0.02415 0.000 0.592 0.000 0.392 0.000 0.016
#> GSM254632     3  0.4096    0.70073 0.004 0.000 0.748 0.036 0.012 0.200
#> GSM254662     2  0.1124    0.57980 0.000 0.956 0.000 0.036 0.000 0.008
#> GSM254677     4  0.4405    0.75080 0.040 0.092 0.000 0.764 0.000 0.104
#> GSM254665     2  0.5694    0.34122 0.040 0.636 0.004 0.188 0.000 0.132
#> GSM254691     2  0.6030   -0.09346 0.004 0.492 0.004 0.288 0.000 0.212
#> GSM254644     4  0.5813    0.48580 0.032 0.368 0.000 0.508 0.000 0.092
#> GSM254667     2  0.6196   -0.40982 0.004 0.424 0.004 0.224 0.000 0.344
#> GSM254676     2  0.5999   -0.08594 0.004 0.500 0.004 0.284 0.000 0.208
#> GSM254679     4  0.3377    0.76778 0.008 0.108 0.016 0.836 0.000 0.032
#> GSM254689     2  0.3875    0.39478 0.016 0.716 0.000 0.008 0.000 0.260
#> GSM254706     2  0.5667   -0.36919 0.000 0.472 0.000 0.160 0.000 0.368
#> GSM254712     4  0.5543    0.73889 0.052 0.212 0.000 0.640 0.000 0.096
#> GSM254713     4  0.5543    0.73889 0.052 0.212 0.000 0.640 0.000 0.096
#> GSM254683     2  0.5509   -0.22056 0.000 0.524 0.000 0.148 0.000 0.328
#> GSM254710     6  0.7634    0.00000 0.004 0.284 0.036 0.136 0.104 0.436
#> GSM254725     4  0.3327    0.75799 0.008 0.092 0.016 0.844 0.000 0.040
#> GSM254651     2  0.5377   -0.17643 0.000 0.528 0.000 0.124 0.000 0.348
#> GSM254638     4  0.3493    0.77477 0.012 0.092 0.016 0.836 0.000 0.044
#> GSM254685     4  0.5640    0.73647 0.056 0.212 0.000 0.632 0.000 0.100

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

consensus_heatmap(res, k = 2)

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

consensus_heatmap(res, k = 3)

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

consensus_heatmap(res, k = 4)

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

consensus_heatmap(res, k = 5)

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

consensus_heatmap(res, k = 6)

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

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

membership_heatmap(res, k = 2)

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

membership_heatmap(res, k = 3)

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

membership_heatmap(res, k = 4)

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

membership_heatmap(res, k = 5)

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

membership_heatmap(res, k = 6)

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

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

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

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

get_signatures(res, k = 3)

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

get_signatures(res, k = 4)

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

get_signatures(res, k = 5)

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

get_signatures(res, k = 6)

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

Signature heatmaps where rows are not scaled:

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

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

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

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

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

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

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

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

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

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

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk MAD-kmeans-signature_compare

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

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

An example of the output of tb is:

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

The columns in tb are:

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

UMAP plot which shows how samples are separated.

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

plot of chunk tab-MAD-kmeans-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-MAD-kmeans-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-MAD-kmeans-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-MAD-kmeans-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-MAD-kmeans-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk MAD-kmeans-collect-classes

Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.

test_to_known_factors(res)
#>              n tissue(p) individual(p) disease.state(p) gender(p) other(p) k
#> MAD:kmeans 107  1.59e-22       0.77697            0.577     0.628    0.872 2
#> MAD:kmeans 105  6.36e-22       0.00199            0.542     0.106    0.892 3
#> MAD:kmeans  83  3.11e-16       0.00215            0.925     0.165    0.922 4
#> MAD:kmeans  80  6.50e-15       0.00493            0.500     0.104    0.566 5
#> MAD:kmeans  72  3.80e-13       0.00516            0.298     0.075    0.262 6

If matrix rows can be associated to genes, consider to use functional_enrichment(res, ...) to perform function enrichment for the signature genes. See this vignette for more detailed explanations.


MAD:skmeans**

The object with results only for a single top-value method and a single partition method can be extracted as:

res = res_list["MAD", "skmeans"]
# you can also extract it by
# res = res_list["MAD:skmeans"]

A summary of res and all the functions that can be applied to it:

res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#>   On a matrix with 21168 rows and 107 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 1.000           0.987       0.994         0.5021 0.499   0.499
#> 3 3 0.809           0.776       0.865         0.2523 0.846   0.698
#> 4 4 0.648           0.554       0.738         0.1266 0.878   0.688
#> 5 5 0.666           0.588       0.760         0.0765 0.867   0.586
#> 6 6 0.651           0.641       0.771         0.0491 0.941   0.741

suggest_best_k() suggests the best \(k\) based on these statistics. The rules are as follows:

suggest_best_k(res)
#> [1] 2

Following shows the table of the partitions (You need to click the show/hide code output link to see it). The membership matrix (columns with name p*) is inferred by clue::cl_consensus() function with the SE method. Basically the value in the membership matrix represents the probability to belong to a certain group. The finall class label for an item is determined with the group with highest probability it belongs to.

In get_classes() function, the entropy is calculated from the membership matrix and the silhouette score is calculated from the consensus matrix.

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>           class entropy silhouette    p1    p2
#> GSM254629     1   0.000      0.991 1.000 0.000
#> GSM254648     1   0.900      0.543 0.684 0.316
#> GSM254694     1   0.000      0.991 1.000 0.000
#> GSM254701     1   0.000      0.991 1.000 0.000
#> GSM254728     1   0.000      0.991 1.000 0.000
#> GSM254726     1   0.680      0.780 0.820 0.180
#> GSM254639     1   0.000      0.991 1.000 0.000
#> GSM254652     1   0.000      0.991 1.000 0.000
#> GSM254700     1   0.000      0.991 1.000 0.000
#> GSM254625     1   0.000      0.991 1.000 0.000
#> GSM254636     1   0.000      0.991 1.000 0.000
#> GSM254659     1   0.000      0.991 1.000 0.000
#> GSM254680     1   0.000      0.991 1.000 0.000
#> GSM254686     1   0.000      0.991 1.000 0.000
#> GSM254718     1   0.000      0.991 1.000 0.000
#> GSM254674     1   0.000      0.991 1.000 0.000
#> GSM254668     1   0.000      0.991 1.000 0.000
#> GSM254697     1   0.000      0.991 1.000 0.000
#> GSM254704     1   0.000      0.991 1.000 0.000
#> GSM254707     1   0.000      0.991 1.000 0.000
#> GSM254714     1   0.000      0.991 1.000 0.000
#> GSM254722     1   0.000      0.991 1.000 0.000
#> GSM254627     1   0.000      0.991 1.000 0.000
#> GSM254630     1   0.000      0.991 1.000 0.000
#> GSM254633     1   0.000      0.991 1.000 0.000
#> GSM254670     1   0.000      0.991 1.000 0.000
#> GSM254716     1   0.000      0.991 1.000 0.000
#> GSM254720     1   0.000      0.991 1.000 0.000
#> GSM254729     1   0.000      0.991 1.000 0.000
#> GSM254654     1   0.000      0.991 1.000 0.000
#> GSM254656     1   0.000      0.991 1.000 0.000
#> GSM254631     1   0.000      0.991 1.000 0.000
#> GSM254657     1   0.000      0.991 1.000 0.000
#> GSM254664     1   0.000      0.991 1.000 0.000
#> GSM254672     1   0.000      0.991 1.000 0.000
#> GSM254692     1   0.000      0.991 1.000 0.000
#> GSM254645     1   0.000      0.991 1.000 0.000
#> GSM254666     1   0.000      0.991 1.000 0.000
#> GSM254675     1   0.000      0.991 1.000 0.000
#> GSM254678     1   0.000      0.991 1.000 0.000
#> GSM254688     1   0.000      0.991 1.000 0.000
#> GSM254690     1   0.000      0.991 1.000 0.000
#> GSM254696     1   0.000      0.991 1.000 0.000
#> GSM254705     1   0.000      0.991 1.000 0.000
#> GSM254642     1   0.000      0.991 1.000 0.000
#> GSM254661     1   0.000      0.991 1.000 0.000
#> GSM254698     1   0.000      0.991 1.000 0.000
#> GSM254641     1   0.000      0.991 1.000 0.000
#> GSM254647     1   0.000      0.991 1.000 0.000
#> GSM254663     1   0.000      0.991 1.000 0.000
#> GSM254682     1   0.000      0.991 1.000 0.000
#> GSM254709     1   0.000      0.991 1.000 0.000
#> GSM254721     1   0.000      0.991 1.000 0.000
#> GSM254724     1   0.000      0.991 1.000 0.000
#> GSM254650     1   0.000      0.991 1.000 0.000
#> GSM254687     1   0.000      0.991 1.000 0.000
#> GSM254637     1   0.000      0.991 1.000 0.000
#> GSM254684     1   0.000      0.991 1.000 0.000
#> GSM254649     2   0.000      0.998 0.000 1.000
#> GSM254660     2   0.000      0.998 0.000 1.000
#> GSM254693     2   0.000      0.998 0.000 1.000
#> GSM254695     2   0.000      0.998 0.000 1.000
#> GSM254702     2   0.000      0.998 0.000 1.000
#> GSM254643     2   0.000      0.998 0.000 1.000
#> GSM254727     2   0.000      0.998 0.000 1.000
#> GSM254640     2   0.000      0.998 0.000 1.000
#> GSM254626     2   0.000      0.998 0.000 1.000
#> GSM254635     2   0.000      0.998 0.000 1.000
#> GSM254653     2   0.000      0.998 0.000 1.000
#> GSM254658     2   0.000      0.998 0.000 1.000
#> GSM254681     2   0.000      0.998 0.000 1.000
#> GSM254719     2   0.000      0.998 0.000 1.000
#> GSM254673     2   0.000      0.998 0.000 1.000
#> GSM254655     2   0.000      0.998 0.000 1.000
#> GSM254669     2   0.000      0.998 0.000 1.000
#> GSM254699     2   0.000      0.998 0.000 1.000
#> GSM254703     2   0.000      0.998 0.000 1.000
#> GSM254708     2   0.000      0.998 0.000 1.000
#> GSM254715     2   0.000      0.998 0.000 1.000
#> GSM254628     2   0.000      0.998 0.000 1.000
#> GSM254634     2   0.000      0.998 0.000 1.000
#> GSM254646     2   0.000      0.998 0.000 1.000
#> GSM254671     2   0.000      0.998 0.000 1.000
#> GSM254711     2   0.000      0.998 0.000 1.000
#> GSM254717     2   0.000      0.998 0.000 1.000
#> GSM254723     2   0.242      0.958 0.040 0.960
#> GSM254730     2   0.000      0.998 0.000 1.000
#> GSM254731     2   0.000      0.998 0.000 1.000
#> GSM254632     2   0.358      0.927 0.068 0.932
#> GSM254662     2   0.000      0.998 0.000 1.000
#> GSM254677     2   0.000      0.998 0.000 1.000
#> GSM254665     2   0.000      0.998 0.000 1.000
#> GSM254691     2   0.000      0.998 0.000 1.000
#> GSM254644     2   0.000      0.998 0.000 1.000
#> GSM254667     2   0.000      0.998 0.000 1.000
#> GSM254676     2   0.000      0.998 0.000 1.000
#> GSM254679     2   0.000      0.998 0.000 1.000
#> GSM254689     2   0.000      0.998 0.000 1.000
#> GSM254706     2   0.000      0.998 0.000 1.000
#> GSM254712     2   0.000      0.998 0.000 1.000
#> GSM254713     2   0.000      0.998 0.000 1.000
#> GSM254683     2   0.000      0.998 0.000 1.000
#> GSM254710     2   0.000      0.998 0.000 1.000
#> GSM254725     2   0.000      0.998 0.000 1.000
#> GSM254651     2   0.000      0.998 0.000 1.000
#> GSM254638     2   0.000      0.998 0.000 1.000
#> GSM254685     2   0.000      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
#> GSM254629     3  0.5988      0.512 0.368 0.000 0.632
#> GSM254648     3  0.6677      0.510 0.324 0.024 0.652
#> GSM254694     3  0.1411      0.651 0.036 0.000 0.964
#> GSM254701     3  0.1411      0.651 0.036 0.000 0.964
#> GSM254728     3  0.4235      0.633 0.176 0.000 0.824
#> GSM254726     3  0.5591      0.515 0.304 0.000 0.696
#> GSM254639     3  0.4235      0.633 0.176 0.000 0.824
#> GSM254652     3  0.6305      0.453 0.484 0.000 0.516
#> GSM254700     1  0.5591      0.725 0.696 0.000 0.304
#> GSM254625     1  0.1529      0.621 0.960 0.000 0.040
#> GSM254636     1  0.5733      0.705 0.676 0.000 0.324
#> GSM254659     3  0.4291      0.631 0.180 0.000 0.820
#> GSM254680     1  0.5560      0.726 0.700 0.000 0.300
#> GSM254686     1  0.1031      0.632 0.976 0.000 0.024
#> GSM254718     3  0.1031      0.654 0.024 0.000 0.976
#> GSM254674     1  0.5497      0.726 0.708 0.000 0.292
#> GSM254668     1  0.0000      0.646 1.000 0.000 0.000
#> GSM254697     1  0.5560      0.726 0.700 0.000 0.300
#> GSM254704     1  0.5785      0.706 0.668 0.000 0.332
#> GSM254707     1  0.1031      0.636 0.976 0.000 0.024
#> GSM254714     3  0.5216      0.510 0.260 0.000 0.740
#> GSM254722     1  0.5560      0.724 0.700 0.000 0.300
#> GSM254627     1  0.5560      0.726 0.700 0.000 0.300
#> GSM254630     1  0.1031      0.636 0.976 0.000 0.024
#> GSM254633     1  0.5760      0.705 0.672 0.000 0.328
#> GSM254670     3  0.5926      0.227 0.356 0.000 0.644
#> GSM254716     1  0.1753      0.611 0.952 0.000 0.048
#> GSM254720     1  0.6260      0.476 0.552 0.000 0.448
#> GSM254729     3  0.4178      0.633 0.172 0.000 0.828
#> GSM254654     3  0.1411      0.651 0.036 0.000 0.964
#> GSM254656     3  0.4654      0.593 0.208 0.000 0.792
#> GSM254631     1  0.5591      0.724 0.696 0.000 0.304
#> GSM254657     3  0.4605      0.603 0.204 0.000 0.796
#> GSM254664     1  0.5591      0.725 0.696 0.000 0.304
#> GSM254672     1  0.5760      0.705 0.672 0.000 0.328
#> GSM254692     1  0.0237      0.646 0.996 0.000 0.004
#> GSM254645     3  0.5859      0.287 0.344 0.000 0.656
#> GSM254666     1  0.1289      0.629 0.968 0.000 0.032
#> GSM254675     1  0.5591      0.724 0.696 0.000 0.304
#> GSM254678     1  0.5733      0.705 0.676 0.000 0.324
#> GSM254688     1  0.1031      0.636 0.976 0.000 0.024
#> GSM254690     1  0.5529      0.726 0.704 0.000 0.296
#> GSM254696     1  0.5882      0.691 0.652 0.000 0.348
#> GSM254705     1  0.1031      0.636 0.976 0.000 0.024
#> GSM254642     1  0.5560      0.726 0.700 0.000 0.300
#> GSM254661     3  0.6235      0.492 0.436 0.000 0.564
#> GSM254698     1  0.5733      0.705 0.676 0.000 0.324
#> GSM254641     1  0.0424      0.648 0.992 0.000 0.008
#> GSM254647     1  0.5560      0.726 0.700 0.000 0.300
#> GSM254663     1  0.0237      0.646 0.996 0.000 0.004
#> GSM254682     1  0.1031      0.636 0.976 0.000 0.024
#> GSM254709     1  0.0747      0.639 0.984 0.000 0.016
#> GSM254721     1  0.5650      0.720 0.688 0.000 0.312
#> GSM254724     1  0.5650      0.720 0.688 0.000 0.312
#> GSM254650     1  0.0237      0.646 0.996 0.000 0.004
#> GSM254687     1  0.0892      0.639 0.980 0.000 0.020
#> GSM254637     1  0.5706      0.715 0.680 0.000 0.320
#> GSM254684     1  0.5882      0.691 0.652 0.000 0.348
#> GSM254649     2  0.0000      0.987 0.000 1.000 0.000
#> GSM254660     2  0.0592      0.987 0.000 0.988 0.012
#> GSM254693     2  0.0000      0.987 0.000 1.000 0.000
#> GSM254695     2  0.0592      0.987 0.000 0.988 0.012
#> GSM254702     2  0.0592      0.987 0.000 0.988 0.012
#> GSM254643     2  0.0000      0.987 0.000 1.000 0.000
#> GSM254727     2  0.0000      0.987 0.000 1.000 0.000
#> GSM254640     2  0.0592      0.987 0.000 0.988 0.012
#> GSM254626     2  0.0000      0.987 0.000 1.000 0.000
#> GSM254635     2  0.0592      0.987 0.000 0.988 0.012
#> GSM254653     2  0.0000      0.987 0.000 1.000 0.000
#> GSM254658     2  0.0000      0.987 0.000 1.000 0.000
#> GSM254681     2  0.0000      0.987 0.000 1.000 0.000
#> GSM254719     2  0.0000      0.987 0.000 1.000 0.000
#> GSM254673     2  0.0000      0.987 0.000 1.000 0.000
#> GSM254655     2  0.0592      0.987 0.000 0.988 0.012
#> GSM254669     2  0.0000      0.987 0.000 1.000 0.000
#> GSM254699     2  0.0592      0.987 0.000 0.988 0.012
#> GSM254703     2  0.0592      0.987 0.000 0.988 0.012
#> GSM254708     2  0.0000      0.987 0.000 1.000 0.000
#> GSM254715     2  0.0592      0.987 0.000 0.988 0.012
#> GSM254628     2  0.0000      0.987 0.000 1.000 0.000
#> GSM254634     2  0.0592      0.987 0.000 0.988 0.012
#> GSM254646     2  0.0000      0.987 0.000 1.000 0.000
#> GSM254671     2  0.0592      0.987 0.000 0.988 0.012
#> GSM254711     2  0.0592      0.987 0.000 0.988 0.012
#> GSM254717     2  0.0000      0.987 0.000 1.000 0.000
#> GSM254723     3  0.6584      0.199 0.012 0.380 0.608
#> GSM254730     2  0.0592      0.987 0.000 0.988 0.012
#> GSM254731     2  0.0592      0.987 0.000 0.988 0.012
#> GSM254632     1  0.9305     -0.131 0.504 0.308 0.188
#> GSM254662     2  0.0000      0.987 0.000 1.000 0.000
#> GSM254677     2  0.0592      0.987 0.000 0.988 0.012
#> GSM254665     2  0.0000      0.987 0.000 1.000 0.000
#> GSM254691     2  0.0000      0.987 0.000 1.000 0.000
#> GSM254644     2  0.0592      0.987 0.000 0.988 0.012
#> GSM254667     2  0.0000      0.987 0.000 1.000 0.000
#> GSM254676     2  0.0000      0.987 0.000 1.000 0.000
#> GSM254679     2  0.0592      0.987 0.000 0.988 0.012
#> GSM254689     2  0.0000      0.987 0.000 1.000 0.000
#> GSM254706     2  0.0000      0.987 0.000 1.000 0.000
#> GSM254712     2  0.0592      0.987 0.000 0.988 0.012
#> GSM254713     2  0.0592      0.987 0.000 0.988 0.012
#> GSM254683     2  0.0000      0.987 0.000 1.000 0.000
#> GSM254710     2  0.5621      0.561 0.308 0.692 0.000
#> GSM254725     2  0.0592      0.987 0.000 0.988 0.012
#> GSM254651     2  0.0000      0.987 0.000 1.000 0.000
#> GSM254638     2  0.0592      0.987 0.000 0.988 0.012
#> GSM254685     2  0.0592      0.987 0.000 0.988 0.012

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM254629     3  0.4415     0.6570 0.056 0.000 0.804 0.140
#> GSM254648     3  0.4508     0.6580 0.012 0.032 0.804 0.152
#> GSM254694     3  0.6482     0.7230 0.208 0.000 0.640 0.152
#> GSM254701     3  0.6472     0.7221 0.212 0.000 0.640 0.148
#> GSM254728     3  0.4567     0.6922 0.276 0.000 0.716 0.008
#> GSM254726     3  0.3837     0.6653 0.000 0.000 0.776 0.224
#> GSM254639     3  0.4539     0.6985 0.272 0.000 0.720 0.008
#> GSM254652     3  0.2521     0.6401 0.064 0.000 0.912 0.024
#> GSM254700     1  0.0376     0.6980 0.992 0.000 0.004 0.004
#> GSM254625     1  0.7894     0.3116 0.364 0.000 0.344 0.292
#> GSM254636     1  0.2198     0.6658 0.920 0.000 0.072 0.008
#> GSM254659     3  0.4372     0.7131 0.268 0.000 0.728 0.004
#> GSM254680     1  0.1297     0.6983 0.964 0.000 0.020 0.016
#> GSM254686     1  0.6883     0.5461 0.584 0.000 0.260 0.156
#> GSM254718     3  0.5939     0.7306 0.248 0.000 0.668 0.084
#> GSM254674     1  0.2376     0.6862 0.916 0.000 0.068 0.016
#> GSM254668     1  0.6702     0.5632 0.616 0.000 0.216 0.168
#> GSM254697     1  0.0188     0.6987 0.996 0.000 0.000 0.004
#> GSM254704     1  0.1305     0.6858 0.960 0.000 0.036 0.004
#> GSM254707     1  0.7373     0.4870 0.500 0.000 0.316 0.184
#> GSM254714     1  0.5383    -0.2953 0.536 0.000 0.452 0.012
#> GSM254722     1  0.1284     0.6943 0.964 0.000 0.024 0.012
#> GSM254627     1  0.0188     0.6987 0.996 0.000 0.000 0.004
#> GSM254630     1  0.7344     0.4980 0.512 0.000 0.300 0.188
#> GSM254633     1  0.1302     0.6838 0.956 0.000 0.044 0.000
#> GSM254670     1  0.5378    -0.1718 0.540 0.000 0.448 0.012
#> GSM254716     1  0.7896     0.3043 0.360 0.000 0.348 0.292
#> GSM254720     1  0.4098     0.4320 0.784 0.000 0.204 0.012
#> GSM254729     3  0.5055     0.5796 0.368 0.000 0.624 0.008
#> GSM254654     3  0.6482     0.7230 0.208 0.000 0.640 0.152
#> GSM254656     3  0.7226     0.5026 0.144 0.000 0.468 0.388
#> GSM254631     1  0.0188     0.6982 0.996 0.000 0.004 0.000
#> GSM254657     3  0.5420     0.5811 0.352 0.000 0.624 0.024
#> GSM254664     1  0.0188     0.6986 0.996 0.000 0.004 0.000
#> GSM254672     1  0.1488     0.6794 0.956 0.000 0.032 0.012
#> GSM254692     1  0.6542     0.5693 0.636 0.000 0.196 0.168
#> GSM254645     1  0.5244    -0.0368 0.600 0.000 0.388 0.012
#> GSM254666     1  0.7460     0.4490 0.468 0.000 0.348 0.184
#> GSM254675     1  0.0336     0.6997 0.992 0.000 0.000 0.008
#> GSM254678     1  0.1545     0.6806 0.952 0.000 0.040 0.008
#> GSM254688     1  0.7373     0.4877 0.500 0.000 0.316 0.184
#> GSM254690     1  0.0336     0.6990 0.992 0.000 0.008 0.000
#> GSM254696     1  0.3978     0.5664 0.796 0.000 0.192 0.012
#> GSM254705     1  0.7221     0.5208 0.540 0.000 0.272 0.188
#> GSM254642     1  0.0376     0.6997 0.992 0.000 0.004 0.004
#> GSM254661     3  0.1452     0.6599 0.036 0.000 0.956 0.008
#> GSM254698     1  0.2124     0.6667 0.924 0.000 0.068 0.008
#> GSM254641     1  0.4406     0.6289 0.780 0.000 0.192 0.028
#> GSM254647     1  0.0000     0.6989 1.000 0.000 0.000 0.000
#> GSM254663     1  0.5911     0.5962 0.692 0.000 0.196 0.112
#> GSM254682     1  0.7398     0.4792 0.492 0.000 0.324 0.184
#> GSM254709     1  0.6709     0.5602 0.616 0.000 0.212 0.172
#> GSM254721     1  0.0779     0.6939 0.980 0.000 0.016 0.004
#> GSM254724     1  0.0779     0.6939 0.980 0.000 0.016 0.004
#> GSM254650     1  0.6756     0.5582 0.612 0.000 0.200 0.188
#> GSM254687     1  0.6936     0.5505 0.588 0.000 0.224 0.188
#> GSM254637     1  0.0817     0.6923 0.976 0.000 0.024 0.000
#> GSM254684     1  0.3852     0.5810 0.808 0.000 0.180 0.012
#> GSM254649     2  0.0000     0.7688 0.000 1.000 0.000 0.000
#> GSM254660     2  0.4222     0.1743 0.000 0.728 0.000 0.272
#> GSM254693     2  0.0188     0.7687 0.000 0.996 0.000 0.004
#> GSM254695     4  0.4981     0.7113 0.000 0.464 0.000 0.536
#> GSM254702     2  0.4998    -0.7229 0.000 0.512 0.000 0.488
#> GSM254643     2  0.0592     0.7659 0.000 0.984 0.000 0.016
#> GSM254727     2  0.0000     0.7688 0.000 1.000 0.000 0.000
#> GSM254640     2  0.4996    -0.7132 0.000 0.516 0.000 0.484
#> GSM254626     2  0.0592     0.7659 0.000 0.984 0.000 0.016
#> GSM254635     4  0.4998     0.7662 0.000 0.488 0.000 0.512
#> GSM254653     2  0.0592     0.7659 0.000 0.984 0.000 0.016
#> GSM254658     2  0.0000     0.7688 0.000 1.000 0.000 0.000
#> GSM254681     2  0.0000     0.7688 0.000 1.000 0.000 0.000
#> GSM254719     2  0.0592     0.7659 0.000 0.984 0.000 0.016
#> GSM254673     2  0.0469     0.7675 0.000 0.988 0.000 0.012
#> GSM254655     2  0.3801     0.3656 0.000 0.780 0.000 0.220
#> GSM254669     2  0.0469     0.7675 0.000 0.988 0.000 0.012
#> GSM254699     2  0.3837     0.3532 0.000 0.776 0.000 0.224
#> GSM254703     4  0.4998     0.7662 0.000 0.488 0.000 0.512
#> GSM254708     2  0.0000     0.7688 0.000 1.000 0.000 0.000
#> GSM254715     4  0.4998     0.7662 0.000 0.488 0.000 0.512
#> GSM254628     2  0.0000     0.7688 0.000 1.000 0.000 0.000
#> GSM254634     4  0.4998     0.7662 0.000 0.488 0.000 0.512
#> GSM254646     2  0.0000     0.7688 0.000 1.000 0.000 0.000
#> GSM254671     2  0.4998    -0.7229 0.000 0.512 0.000 0.488
#> GSM254711     4  0.4998     0.7662 0.000 0.488 0.000 0.512
#> GSM254717     2  0.0000     0.7688 0.000 1.000 0.000 0.000
#> GSM254723     4  0.4663    -0.0656 0.000 0.012 0.272 0.716
#> GSM254730     2  0.4103     0.2397 0.000 0.744 0.000 0.256
#> GSM254731     2  0.4998    -0.7229 0.000 0.512 0.000 0.488
#> GSM254632     4  0.8170    -0.2777 0.008 0.308 0.312 0.372
#> GSM254662     2  0.0469     0.7675 0.000 0.988 0.000 0.012
#> GSM254677     4  0.4994     0.7563 0.000 0.480 0.000 0.520
#> GSM254665     2  0.0592     0.7659 0.000 0.984 0.000 0.016
#> GSM254691     2  0.0592     0.7659 0.000 0.984 0.000 0.016
#> GSM254644     2  0.4996    -0.7132 0.000 0.516 0.000 0.484
#> GSM254667     2  0.0188     0.7650 0.000 0.996 0.000 0.004
#> GSM254676     2  0.0592     0.7659 0.000 0.984 0.000 0.016
#> GSM254679     4  0.4998     0.7662 0.000 0.488 0.000 0.512
#> GSM254689     2  0.0000     0.7688 0.000 1.000 0.000 0.000
#> GSM254706     2  0.0188     0.7650 0.000 0.996 0.000 0.004
#> GSM254712     4  0.4998     0.7662 0.000 0.488 0.000 0.512
#> GSM254713     4  0.4998     0.7662 0.000 0.488 0.000 0.512
#> GSM254683     2  0.0000     0.7688 0.000 1.000 0.000 0.000
#> GSM254710     2  0.7344     0.0812 0.000 0.504 0.180 0.316
#> GSM254725     4  0.4998     0.7662 0.000 0.488 0.000 0.512
#> GSM254651     2  0.0000     0.7688 0.000 1.000 0.000 0.000
#> GSM254638     4  0.4998     0.7662 0.000 0.488 0.000 0.512
#> GSM254685     4  0.4998     0.7662 0.000 0.488 0.000 0.512

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM254629     3  0.1310     0.7746 0.020 0.000 0.956 0.000 0.024
#> GSM254648     3  0.1200     0.7736 0.008 0.016 0.964 0.000 0.012
#> GSM254694     3  0.1041     0.7819 0.032 0.000 0.964 0.000 0.004
#> GSM254701     3  0.0794     0.7815 0.028 0.000 0.972 0.000 0.000
#> GSM254728     3  0.6526     0.5674 0.072 0.000 0.552 0.060 0.316
#> GSM254726     3  0.2790     0.7535 0.000 0.000 0.880 0.068 0.052
#> GSM254639     5  0.7269    -0.4376 0.100 0.000 0.408 0.084 0.408
#> GSM254652     3  0.6308     0.5537 0.044 0.000 0.536 0.064 0.356
#> GSM254700     1  0.0451     0.7032 0.988 0.000 0.004 0.000 0.008
#> GSM254625     5  0.3577     0.5339 0.160 0.000 0.000 0.032 0.808
#> GSM254636     1  0.5400     0.5439 0.660 0.000 0.024 0.052 0.264
#> GSM254659     3  0.6511     0.5896 0.108 0.000 0.568 0.040 0.284
#> GSM254680     1  0.3914     0.4696 0.760 0.000 0.004 0.016 0.220
#> GSM254686     5  0.4759     0.4325 0.388 0.000 0.016 0.004 0.592
#> GSM254718     3  0.4803     0.7304 0.084 0.000 0.756 0.020 0.140
#> GSM254674     1  0.4555     0.2908 0.636 0.000 0.000 0.020 0.344
#> GSM254668     5  0.4545     0.3800 0.432 0.000 0.004 0.004 0.560
#> GSM254697     1  0.0290     0.7059 0.992 0.000 0.000 0.000 0.008
#> GSM254704     1  0.1894     0.6959 0.920 0.000 0.008 0.000 0.072
#> GSM254707     5  0.3730     0.5389 0.288 0.000 0.000 0.000 0.712
#> GSM254714     1  0.4624     0.3613 0.636 0.000 0.340 0.000 0.024
#> GSM254722     1  0.3087     0.6584 0.836 0.000 0.008 0.004 0.152
#> GSM254627     1  0.0290     0.7059 0.992 0.000 0.000 0.000 0.008
#> GSM254630     5  0.3837     0.5322 0.308 0.000 0.000 0.000 0.692
#> GSM254633     1  0.2835     0.6884 0.868 0.000 0.004 0.016 0.112
#> GSM254670     5  0.7263    -0.1918 0.388 0.000 0.100 0.084 0.428
#> GSM254716     5  0.3577     0.5339 0.160 0.000 0.000 0.032 0.808
#> GSM254720     1  0.2946     0.6702 0.868 0.000 0.044 0.000 0.088
#> GSM254729     5  0.7740    -0.3086 0.176 0.000 0.332 0.084 0.408
#> GSM254654     3  0.0794     0.7815 0.028 0.000 0.972 0.000 0.000
#> GSM254656     5  0.7859    -0.1410 0.168 0.000 0.100 0.348 0.384
#> GSM254631     1  0.1862     0.7077 0.932 0.000 0.004 0.016 0.048
#> GSM254657     5  0.7676    -0.2903 0.172 0.000 0.308 0.084 0.436
#> GSM254664     1  0.1651     0.6979 0.944 0.000 0.012 0.008 0.036
#> GSM254672     1  0.3129     0.6436 0.832 0.000 0.008 0.004 0.156
#> GSM254692     1  0.4304    -0.3210 0.516 0.000 0.000 0.000 0.484
#> GSM254645     1  0.7022     0.2855 0.496 0.000 0.088 0.080 0.336
#> GSM254666     5  0.3521     0.5438 0.232 0.000 0.004 0.000 0.764
#> GSM254675     1  0.0609     0.7042 0.980 0.000 0.000 0.000 0.020
#> GSM254678     1  0.4501     0.6062 0.740 0.000 0.012 0.036 0.212
#> GSM254688     5  0.3707     0.5395 0.284 0.000 0.000 0.000 0.716
#> GSM254690     1  0.2448     0.6793 0.892 0.000 0.000 0.020 0.088
#> GSM254696     1  0.6356     0.2860 0.484 0.000 0.032 0.076 0.408
#> GSM254705     5  0.4015     0.4947 0.348 0.000 0.000 0.000 0.652
#> GSM254642     1  0.0880     0.6931 0.968 0.000 0.000 0.000 0.032
#> GSM254661     3  0.5197     0.6635 0.012 0.000 0.660 0.052 0.276
#> GSM254698     1  0.5254     0.5494 0.684 0.000 0.024 0.052 0.240
#> GSM254641     1  0.4029     0.1951 0.680 0.000 0.000 0.004 0.316
#> GSM254647     1  0.0992     0.7046 0.968 0.000 0.000 0.008 0.024
#> GSM254663     1  0.4410    -0.2083 0.556 0.000 0.000 0.004 0.440
#> GSM254682     5  0.3636     0.5424 0.272 0.000 0.000 0.000 0.728
#> GSM254709     5  0.4561     0.2865 0.488 0.000 0.008 0.000 0.504
#> GSM254721     1  0.0579     0.7022 0.984 0.000 0.008 0.000 0.008
#> GSM254724     1  0.0579     0.7022 0.984 0.000 0.008 0.000 0.008
#> GSM254650     5  0.4437     0.3399 0.464 0.000 0.000 0.004 0.532
#> GSM254687     5  0.4171     0.4455 0.396 0.000 0.000 0.000 0.604
#> GSM254637     1  0.2139     0.7070 0.920 0.000 0.012 0.012 0.056
#> GSM254684     1  0.6141     0.3113 0.500 0.000 0.028 0.064 0.408
#> GSM254649     2  0.0000     0.8439 0.000 1.000 0.000 0.000 0.000
#> GSM254660     2  0.4630    -0.3285 0.000 0.572 0.004 0.416 0.008
#> GSM254693     2  0.0703     0.8450 0.000 0.976 0.000 0.024 0.000
#> GSM254695     4  0.2561     0.6570 0.000 0.144 0.000 0.856 0.000
#> GSM254702     4  0.4595     0.8111 0.000 0.400 0.004 0.588 0.008
#> GSM254643     2  0.1197     0.8396 0.000 0.952 0.000 0.048 0.000
#> GSM254727     2  0.0854     0.8444 0.000 0.976 0.004 0.012 0.008
#> GSM254640     4  0.4219     0.7973 0.000 0.416 0.000 0.584 0.000
#> GSM254626     2  0.1121     0.8395 0.000 0.956 0.000 0.044 0.000
#> GSM254635     4  0.3966     0.8734 0.000 0.336 0.000 0.664 0.000
#> GSM254653     2  0.1569     0.8362 0.000 0.944 0.004 0.044 0.008
#> GSM254658     2  0.0000     0.8439 0.000 1.000 0.000 0.000 0.000
#> GSM254681     2  0.0162     0.8422 0.000 0.996 0.000 0.004 0.000
#> GSM254719     2  0.1644     0.8328 0.000 0.940 0.004 0.048 0.008
#> GSM254673     2  0.1569     0.8359 0.000 0.944 0.004 0.044 0.008
#> GSM254655     2  0.4199     0.2507 0.000 0.692 0.004 0.296 0.008
#> GSM254669     2  0.1492     0.8386 0.000 0.948 0.004 0.040 0.008
#> GSM254699     2  0.4220     0.2283 0.000 0.688 0.004 0.300 0.008
#> GSM254703     4  0.3983     0.8724 0.000 0.340 0.000 0.660 0.000
#> GSM254708     2  0.1121     0.8335 0.000 0.956 0.000 0.044 0.000
#> GSM254715     4  0.3966     0.8734 0.000 0.336 0.000 0.664 0.000
#> GSM254628     2  0.0000     0.8439 0.000 1.000 0.000 0.000 0.000
#> GSM254634     4  0.3816     0.8601 0.000 0.304 0.000 0.696 0.000
#> GSM254646     2  0.0000     0.8439 0.000 1.000 0.000 0.000 0.000
#> GSM254671     4  0.4621     0.7925 0.000 0.412 0.004 0.576 0.008
#> GSM254711     4  0.3949     0.8726 0.000 0.332 0.000 0.668 0.000
#> GSM254717     2  0.0960     0.8438 0.000 0.972 0.004 0.016 0.008
#> GSM254723     4  0.5265     0.0575 0.004 0.004 0.232 0.680 0.080
#> GSM254730     2  0.4530    -0.1480 0.000 0.612 0.004 0.376 0.008
#> GSM254731     4  0.4621     0.7924 0.000 0.412 0.004 0.576 0.008
#> GSM254632     5  0.6284     0.2359 0.004 0.180 0.004 0.236 0.576
#> GSM254662     2  0.1569     0.8359 0.000 0.944 0.004 0.044 0.008
#> GSM254677     4  0.3366     0.7784 0.000 0.232 0.000 0.768 0.000
#> GSM254665     2  0.1341     0.8331 0.000 0.944 0.000 0.056 0.000
#> GSM254691     2  0.1671     0.8308 0.000 0.924 0.000 0.076 0.000
#> GSM254644     4  0.4201     0.8094 0.000 0.408 0.000 0.592 0.000
#> GSM254667     2  0.1544     0.7933 0.000 0.932 0.000 0.068 0.000
#> GSM254676     2  0.1544     0.8346 0.000 0.932 0.000 0.068 0.000
#> GSM254679     4  0.3876     0.8669 0.000 0.316 0.000 0.684 0.000
#> GSM254689     2  0.0162     0.8422 0.000 0.996 0.000 0.004 0.000
#> GSM254706     2  0.1478     0.7978 0.000 0.936 0.000 0.064 0.000
#> GSM254712     4  0.3966     0.8734 0.000 0.336 0.000 0.664 0.000
#> GSM254713     4  0.3966     0.8734 0.000 0.336 0.000 0.664 0.000
#> GSM254683     2  0.0963     0.8243 0.000 0.964 0.000 0.036 0.000
#> GSM254710     2  0.6661    -0.0448 0.000 0.412 0.000 0.232 0.356
#> GSM254725     4  0.3837     0.8614 0.000 0.308 0.000 0.692 0.000
#> GSM254651     2  0.1121     0.8176 0.000 0.956 0.000 0.044 0.000
#> GSM254638     4  0.3876     0.8681 0.000 0.316 0.000 0.684 0.000
#> GSM254685     4  0.4030     0.8648 0.000 0.352 0.000 0.648 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
#> GSM254629     3  0.1078    0.75930 0.012 0.000 0.964 0.000 0.016 0.008
#> GSM254648     3  0.0520    0.75827 0.000 0.000 0.984 0.000 0.008 0.008
#> GSM254694     3  0.0717    0.76194 0.016 0.000 0.976 0.000 0.000 0.008
#> GSM254701     3  0.0767    0.76230 0.012 0.000 0.976 0.000 0.004 0.008
#> GSM254728     6  0.6225    0.34699 0.032 0.000 0.296 0.004 0.148 0.520
#> GSM254726     3  0.4177    0.67271 0.000 0.000 0.772 0.036 0.052 0.140
#> GSM254639     6  0.5073    0.63182 0.044 0.000 0.132 0.004 0.108 0.712
#> GSM254652     6  0.7029    0.19892 0.044 0.000 0.276 0.008 0.296 0.376
#> GSM254700     1  0.0363    0.80009 0.988 0.000 0.000 0.000 0.012 0.000
#> GSM254625     5  0.1906    0.70468 0.036 0.000 0.000 0.008 0.924 0.032
#> GSM254636     1  0.5677   -0.17052 0.440 0.000 0.004 0.004 0.116 0.436
#> GSM254659     3  0.7233   -0.12245 0.088 0.000 0.396 0.008 0.184 0.324
#> GSM254680     1  0.5062    0.20635 0.560 0.000 0.008 0.008 0.380 0.044
#> GSM254686     5  0.4427    0.73474 0.228 0.000 0.020 0.008 0.716 0.028
#> GSM254718     3  0.6181    0.42628 0.060 0.000 0.584 0.008 0.112 0.236
#> GSM254674     5  0.5740    0.08621 0.424 0.000 0.008 0.008 0.460 0.100
#> GSM254668     5  0.3674    0.74857 0.220 0.000 0.004 0.008 0.756 0.012
#> GSM254697     1  0.1088    0.80457 0.960 0.000 0.000 0.000 0.024 0.016
#> GSM254704     1  0.1167    0.79615 0.960 0.000 0.012 0.000 0.008 0.020
#> GSM254707     5  0.2257    0.76997 0.116 0.000 0.000 0.000 0.876 0.008
#> GSM254714     1  0.3875    0.62383 0.776 0.000 0.172 0.004 0.012 0.036
#> GSM254722     1  0.2901    0.73186 0.840 0.000 0.000 0.000 0.032 0.128
#> GSM254627     1  0.1168    0.80416 0.956 0.000 0.000 0.000 0.028 0.016
#> GSM254630     5  0.3746    0.75832 0.192 0.000 0.000 0.000 0.760 0.048
#> GSM254633     1  0.4819    0.66292 0.712 0.000 0.012 0.008 0.168 0.100
#> GSM254670     6  0.4914    0.70225 0.124 0.000 0.016 0.004 0.152 0.704
#> GSM254716     5  0.2147    0.69213 0.032 0.000 0.000 0.012 0.912 0.044
#> GSM254720     1  0.1708    0.78384 0.932 0.000 0.024 0.000 0.004 0.040
#> GSM254729     6  0.5670    0.66431 0.076 0.000 0.124 0.004 0.132 0.664
#> GSM254654     3  0.0520    0.76167 0.008 0.000 0.984 0.000 0.000 0.008
#> GSM254656     6  0.3630    0.54773 0.020 0.000 0.000 0.100 0.064 0.816
#> GSM254631     1  0.3393    0.77825 0.836 0.000 0.008 0.008 0.092 0.056
#> GSM254657     6  0.4925    0.64923 0.040 0.000 0.076 0.004 0.164 0.716
#> GSM254664     1  0.3069    0.77397 0.856 0.000 0.012 0.008 0.096 0.028
#> GSM254672     1  0.2389    0.72604 0.864 0.000 0.000 0.000 0.008 0.128
#> GSM254692     5  0.3789    0.58859 0.416 0.000 0.000 0.000 0.584 0.000
#> GSM254645     6  0.4973    0.65722 0.248 0.000 0.012 0.004 0.076 0.660
#> GSM254666     5  0.3123    0.73299 0.088 0.000 0.000 0.000 0.836 0.076
#> GSM254675     1  0.1371    0.79880 0.948 0.000 0.004 0.004 0.040 0.004
#> GSM254678     1  0.4294    0.53902 0.692 0.000 0.000 0.000 0.060 0.248
#> GSM254688     5  0.2558    0.76527 0.104 0.000 0.000 0.000 0.868 0.028
#> GSM254690     1  0.4106    0.73282 0.768 0.000 0.004 0.008 0.148 0.072
#> GSM254696     6  0.5113    0.68389 0.204 0.000 0.000 0.000 0.168 0.628
#> GSM254705     5  0.3771    0.76893 0.180 0.000 0.000 0.000 0.764 0.056
#> GSM254642     1  0.1528    0.79821 0.936 0.000 0.000 0.000 0.048 0.016
#> GSM254661     3  0.5732    0.30997 0.004 0.000 0.544 0.004 0.160 0.288
#> GSM254698     6  0.4833    0.24403 0.428 0.000 0.000 0.000 0.056 0.516
#> GSM254641     1  0.4877   -0.01793 0.544 0.000 0.008 0.008 0.412 0.028
#> GSM254647     1  0.1984    0.80025 0.912 0.000 0.000 0.000 0.056 0.032
#> GSM254663     5  0.4444    0.53717 0.396 0.000 0.000 0.004 0.576 0.024
#> GSM254682     5  0.2558    0.76527 0.104 0.000 0.000 0.000 0.868 0.028
#> GSM254709     5  0.3942    0.64519 0.368 0.000 0.004 0.000 0.624 0.004
#> GSM254721     1  0.0870    0.79523 0.972 0.000 0.012 0.000 0.012 0.004
#> GSM254724     1  0.0767    0.79680 0.976 0.000 0.012 0.000 0.008 0.004
#> GSM254650     5  0.3244    0.73934 0.268 0.000 0.000 0.000 0.732 0.000
#> GSM254687     5  0.2883    0.77337 0.212 0.000 0.000 0.000 0.788 0.000
#> GSM254637     1  0.3170    0.78573 0.856 0.000 0.012 0.008 0.072 0.052
#> GSM254684     6  0.5409    0.65449 0.232 0.000 0.000 0.004 0.168 0.596
#> GSM254649     2  0.0692    0.79122 0.000 0.976 0.000 0.000 0.004 0.020
#> GSM254660     2  0.4389   -0.34543 0.000 0.512 0.000 0.468 0.004 0.016
#> GSM254693     2  0.0790    0.79078 0.000 0.968 0.000 0.032 0.000 0.000
#> GSM254695     4  0.3172    0.59015 0.000 0.040 0.000 0.844 0.016 0.100
#> GSM254702     4  0.4223    0.70491 0.000 0.368 0.000 0.612 0.004 0.016
#> GSM254643     2  0.1700    0.77503 0.000 0.916 0.000 0.080 0.000 0.004
#> GSM254727     2  0.1148    0.78916 0.000 0.960 0.000 0.016 0.004 0.020
#> GSM254640     4  0.3737    0.69269 0.000 0.392 0.000 0.608 0.000 0.000
#> GSM254626     2  0.1588    0.77601 0.000 0.924 0.000 0.072 0.000 0.004
#> GSM254635     4  0.3163    0.83041 0.000 0.232 0.000 0.764 0.000 0.004
#> GSM254653     2  0.1738    0.77772 0.000 0.928 0.000 0.052 0.004 0.016
#> GSM254658     2  0.0858    0.78995 0.000 0.968 0.000 0.000 0.004 0.028
#> GSM254681     2  0.1461    0.78387 0.000 0.940 0.000 0.000 0.016 0.044
#> GSM254719     2  0.2039    0.76919 0.000 0.908 0.000 0.072 0.004 0.016
#> GSM254673     2  0.2039    0.76919 0.000 0.908 0.000 0.072 0.004 0.016
#> GSM254655     2  0.4223    0.07262 0.000 0.612 0.000 0.368 0.004 0.016
#> GSM254669     2  0.1738    0.78047 0.000 0.928 0.000 0.052 0.004 0.016
#> GSM254699     2  0.4090    0.22637 0.000 0.652 0.000 0.328 0.004 0.016
#> GSM254703     4  0.3265    0.82857 0.000 0.248 0.000 0.748 0.000 0.004
#> GSM254708     2  0.2757    0.75192 0.000 0.864 0.000 0.104 0.016 0.016
#> GSM254715     4  0.3189    0.82953 0.000 0.236 0.000 0.760 0.000 0.004
#> GSM254628     2  0.0603    0.79146 0.000 0.980 0.000 0.000 0.004 0.016
#> GSM254634     4  0.2416    0.80358 0.000 0.156 0.000 0.844 0.000 0.000
#> GSM254646     2  0.1074    0.78881 0.000 0.960 0.000 0.000 0.012 0.028
#> GSM254671     4  0.4223    0.70408 0.000 0.368 0.000 0.612 0.004 0.016
#> GSM254711     4  0.2969    0.82526 0.000 0.224 0.000 0.776 0.000 0.000
#> GSM254717     2  0.1262    0.78985 0.000 0.956 0.000 0.016 0.008 0.020
#> GSM254723     4  0.7237   -0.08807 0.000 0.004 0.176 0.440 0.124 0.256
#> GSM254730     2  0.4317   -0.15780 0.000 0.572 0.000 0.408 0.004 0.016
#> GSM254731     4  0.4223    0.70491 0.000 0.368 0.000 0.612 0.004 0.016
#> GSM254632     5  0.6115    0.32864 0.000 0.032 0.024 0.120 0.600 0.224
#> GSM254662     2  0.2039    0.76919 0.000 0.908 0.000 0.072 0.004 0.016
#> GSM254677     4  0.3490    0.78715 0.000 0.176 0.000 0.784 0.000 0.040
#> GSM254665     2  0.2734    0.76612 0.000 0.864 0.000 0.104 0.008 0.024
#> GSM254691     2  0.3375    0.74722 0.000 0.808 0.000 0.156 0.012 0.024
#> GSM254644     4  0.3647    0.74421 0.000 0.360 0.000 0.640 0.000 0.000
#> GSM254667     2  0.4010    0.67643 0.000 0.776 0.000 0.152 0.024 0.048
#> GSM254676     2  0.3300    0.74975 0.000 0.816 0.000 0.148 0.012 0.024
#> GSM254679     4  0.2562    0.80015 0.000 0.172 0.000 0.828 0.000 0.000
#> GSM254689     2  0.1461    0.78387 0.000 0.940 0.000 0.000 0.016 0.044
#> GSM254706     2  0.3935    0.68315 0.000 0.784 0.000 0.144 0.024 0.048
#> GSM254712     4  0.3163    0.83041 0.000 0.232 0.000 0.764 0.000 0.004
#> GSM254713     4  0.3163    0.83041 0.000 0.232 0.000 0.764 0.000 0.004
#> GSM254683     2  0.3239    0.72765 0.000 0.840 0.000 0.100 0.016 0.044
#> GSM254710     2  0.7577    0.00227 0.000 0.348 0.008 0.160 0.324 0.160
#> GSM254725     4  0.2300    0.79620 0.000 0.144 0.000 0.856 0.000 0.000
#> GSM254651     2  0.3550    0.70965 0.000 0.816 0.000 0.120 0.020 0.044
#> GSM254638     4  0.2527    0.81530 0.000 0.168 0.000 0.832 0.000 0.000
#> GSM254685     4  0.3175    0.82137 0.000 0.256 0.000 0.744 0.000 0.000

Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.

consensus_heatmap(res, k = 2)

plot of chunk tab-MAD-skmeans-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-MAD-skmeans-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-MAD-skmeans-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-MAD-skmeans-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-MAD-skmeans-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-MAD-skmeans-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-MAD-skmeans-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-MAD-skmeans-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-MAD-skmeans-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-MAD-skmeans-membership-heatmap-5

As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

plot of chunk tab-MAD-skmeans-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-MAD-skmeans-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-MAD-skmeans-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-MAD-skmeans-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-MAD-skmeans-get-signatures-5

Signature heatmaps where rows are not scaled:

get_signatures(res, k = 2, scale_rows = FALSE)

plot of chunk tab-MAD-skmeans-get-signatures-no-scale-1

get_signatures(res, k = 3, scale_rows = FALSE)

plot of chunk tab-MAD-skmeans-get-signatures-no-scale-2

get_signatures(res, k = 4, scale_rows = FALSE)

plot of chunk tab-MAD-skmeans-get-signatures-no-scale-3

get_signatures(res, k = 5, scale_rows = FALSE)

plot of chunk tab-MAD-skmeans-get-signatures-no-scale-4

get_signatures(res, k = 6, scale_rows = FALSE)

plot of chunk tab-MAD-skmeans-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk MAD-skmeans-signature_compare

get_signature() returns a data frame invisibly. TO get the list of signatures, the function call should be assigned to a variable explicitly. In following code, if plot argument is set to FALSE, no heatmap is plotted while only the differential analysis is performed.

# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)

An example of the output of tb is:

#>   which_row         fdr    mean_1    mean_2 scaled_mean_1 scaled_mean_2 km
#> 1        38 0.042760348  8.373488  9.131774    -0.5533452     0.5164555  1
#> 2        40 0.018707592  7.106213  8.469186    -0.6173731     0.5762149  1
#> 3        55 0.019134737 10.221463 11.207825    -0.6159697     0.5749050  1
#> 4        59 0.006059896  5.921854  7.869574    -0.6899429     0.6439467  1
#> 5        60 0.018055526  8.928898 10.211722    -0.6204761     0.5791110  1
#> 6        98 0.009384629 15.714769 14.887706     0.6635654    -0.6193277  2
...

The columns in tb are:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. km: Row groups if k-means clustering is applied to rows.

UMAP plot which shows how samples are separated.

dimension_reduction(res, k = 2, method = "UMAP")

plot of chunk tab-MAD-skmeans-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-MAD-skmeans-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-MAD-skmeans-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-MAD-skmeans-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-MAD-skmeans-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk MAD-skmeans-collect-classes

Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.

test_to_known_factors(res)
#>               n tissue(p) individual(p) disease.state(p) gender(p) other(p) k
#> MAD:skmeans 107  3.34e-24       0.64356            0.777  0.440630    1.000 2
#> MAD:skmeans 100  1.93e-22       0.00147            0.403  0.011132    0.653 3
#> MAD:skmeans  84  4.25e-18       0.00562            0.763  0.008144    0.994 4
#> MAD:skmeans  80  1.74e-16       0.01080            0.603  0.000863    0.581 5
#> MAD:skmeans  90  6.72e-18       0.01369            0.697  0.103826    0.819 6

If matrix rows can be associated to genes, consider to use functional_enrichment(res, ...) to perform function enrichment for the signature genes. See this vignette for more detailed explanations.


MAD:pam**

The object with results only for a single top-value method and a single partition method can be extracted as:

res = res_list["MAD", "pam"]
# you can also extract it by
# res = res_list["MAD:pam"]

A summary of res and all the functions that can be applied to it:

res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#>   On a matrix with 21168 rows and 107 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 1.000           0.995       0.998         0.4981 0.503   0.503
#> 3 3 0.691           0.875       0.901         0.2716 0.860   0.723
#> 4 4 0.717           0.795       0.891         0.1589 0.882   0.690
#> 5 5 0.726           0.740       0.850         0.0403 0.970   0.892
#> 6 6 0.701           0.581       0.760         0.0445 0.952   0.813

suggest_best_k() suggests the best \(k\) based on these statistics. The rules are as follows:

suggest_best_k(res)
#> [1] 2

Following shows the table of the partitions (You need to click the show/hide code output link to see it). The membership matrix (columns with name p*) is inferred by clue::cl_consensus() function with the SE method. Basically the value in the membership matrix represents the probability to belong to a certain group. The finall class label for an item is determined with the group with highest probability it belongs to.

In get_classes() function, the entropy is calculated from the membership matrix and the silhouette score is calculated from the consensus matrix.

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>           class entropy silhouette    p1    p2
#> GSM254629     1  0.0000      0.997 1.000 0.000
#> GSM254648     1  0.5519      0.855 0.872 0.128
#> GSM254694     1  0.0000      0.997 1.000 0.000
#> GSM254701     1  0.0000      0.997 1.000 0.000
#> GSM254728     1  0.0000      0.997 1.000 0.000
#> GSM254726     1  0.0000      0.997 1.000 0.000
#> GSM254639     1  0.0000      0.997 1.000 0.000
#> GSM254652     1  0.0000      0.997 1.000 0.000
#> GSM254700     1  0.0000      0.997 1.000 0.000
#> GSM254625     1  0.0000      0.997 1.000 0.000
#> GSM254636     1  0.0000      0.997 1.000 0.000
#> GSM254659     1  0.0000      0.997 1.000 0.000
#> GSM254680     1  0.0000      0.997 1.000 0.000
#> GSM254686     1  0.0000      0.997 1.000 0.000
#> GSM254718     1  0.0000      0.997 1.000 0.000
#> GSM254674     1  0.0000      0.997 1.000 0.000
#> GSM254668     1  0.0000      0.997 1.000 0.000
#> GSM254697     1  0.0000      0.997 1.000 0.000
#> GSM254704     1  0.0000      0.997 1.000 0.000
#> GSM254707     1  0.0000      0.997 1.000 0.000
#> GSM254714     1  0.0000      0.997 1.000 0.000
#> GSM254722     1  0.0000      0.997 1.000 0.000
#> GSM254627     1  0.0000      0.997 1.000 0.000
#> GSM254630     1  0.0000      0.997 1.000 0.000
#> GSM254633     1  0.0000      0.997 1.000 0.000
#> GSM254670     1  0.0000      0.997 1.000 0.000
#> GSM254716     1  0.0000      0.997 1.000 0.000
#> GSM254720     1  0.0000      0.997 1.000 0.000
#> GSM254729     1  0.0000      0.997 1.000 0.000
#> GSM254654     1  0.0000      0.997 1.000 0.000
#> GSM254656     1  0.0000      0.997 1.000 0.000
#> GSM254631     1  0.0000      0.997 1.000 0.000
#> GSM254657     1  0.0000      0.997 1.000 0.000
#> GSM254664     1  0.0000      0.997 1.000 0.000
#> GSM254672     1  0.0000      0.997 1.000 0.000
#> GSM254692     1  0.0000      0.997 1.000 0.000
#> GSM254645     1  0.0000      0.997 1.000 0.000
#> GSM254666     1  0.0000      0.997 1.000 0.000
#> GSM254675     1  0.0000      0.997 1.000 0.000
#> GSM254678     1  0.0000      0.997 1.000 0.000
#> GSM254688     1  0.0000      0.997 1.000 0.000
#> GSM254690     1  0.0000      0.997 1.000 0.000
#> GSM254696     1  0.0000      0.997 1.000 0.000
#> GSM254705     1  0.0000      0.997 1.000 0.000
#> GSM254642     1  0.0000      0.997 1.000 0.000
#> GSM254661     1  0.0000      0.997 1.000 0.000
#> GSM254698     1  0.0000      0.997 1.000 0.000
#> GSM254641     1  0.0000      0.997 1.000 0.000
#> GSM254647     1  0.0000      0.997 1.000 0.000
#> GSM254663     1  0.0000      0.997 1.000 0.000
#> GSM254682     1  0.0000      0.997 1.000 0.000
#> GSM254709     1  0.0000      0.997 1.000 0.000
#> GSM254721     1  0.0000      0.997 1.000 0.000
#> GSM254724     1  0.0000      0.997 1.000 0.000
#> GSM254650     1  0.0000      0.997 1.000 0.000
#> GSM254687     1  0.0000      0.997 1.000 0.000
#> GSM254637     1  0.0000      0.997 1.000 0.000
#> GSM254684     1  0.0000      0.997 1.000 0.000
#> GSM254649     2  0.0000      0.999 0.000 1.000
#> GSM254660     2  0.0000      0.999 0.000 1.000
#> GSM254693     2  0.0000      0.999 0.000 1.000
#> GSM254695     2  0.0000      0.999 0.000 1.000
#> GSM254702     2  0.0000      0.999 0.000 1.000
#> GSM254643     2  0.0000      0.999 0.000 1.000
#> GSM254727     2  0.0000      0.999 0.000 1.000
#> GSM254640     2  0.0000      0.999 0.000 1.000
#> GSM254626     2  0.0000      0.999 0.000 1.000
#> GSM254635     2  0.0000      0.999 0.000 1.000
#> GSM254653     2  0.0000      0.999 0.000 1.000
#> GSM254658     2  0.0000      0.999 0.000 1.000
#> GSM254681     2  0.0000      0.999 0.000 1.000
#> GSM254719     2  0.0000      0.999 0.000 1.000
#> GSM254673     2  0.0000      0.999 0.000 1.000
#> GSM254655     2  0.0000      0.999 0.000 1.000
#> GSM254669     2  0.0000      0.999 0.000 1.000
#> GSM254699     2  0.0000      0.999 0.000 1.000
#> GSM254703     2  0.0000      0.999 0.000 1.000
#> GSM254708     2  0.0000      0.999 0.000 1.000
#> GSM254715     2  0.0000      0.999 0.000 1.000
#> GSM254628     2  0.0000      0.999 0.000 1.000
#> GSM254634     2  0.0000      0.999 0.000 1.000
#> GSM254646     2  0.0000      0.999 0.000 1.000
#> GSM254671     2  0.0000      0.999 0.000 1.000
#> GSM254711     2  0.0000      0.999 0.000 1.000
#> GSM254717     2  0.0000      0.999 0.000 1.000
#> GSM254723     1  0.0672      0.989 0.992 0.008
#> GSM254730     2  0.0000      0.999 0.000 1.000
#> GSM254731     2  0.0000      0.999 0.000 1.000
#> GSM254632     1  0.3431      0.932 0.936 0.064
#> GSM254662     2  0.0000      0.999 0.000 1.000
#> GSM254677     2  0.0672      0.991 0.008 0.992
#> GSM254665     2  0.0000      0.999 0.000 1.000
#> GSM254691     2  0.0000      0.999 0.000 1.000
#> GSM254644     2  0.0000      0.999 0.000 1.000
#> GSM254667     2  0.0000      0.999 0.000 1.000
#> GSM254676     2  0.0000      0.999 0.000 1.000
#> GSM254679     2  0.0000      0.999 0.000 1.000
#> GSM254689     2  0.0000      0.999 0.000 1.000
#> GSM254706     2  0.0000      0.999 0.000 1.000
#> GSM254712     2  0.0000      0.999 0.000 1.000
#> GSM254713     2  0.0000      0.999 0.000 1.000
#> GSM254683     2  0.0000      0.999 0.000 1.000
#> GSM254710     2  0.2423      0.958 0.040 0.960
#> GSM254725     2  0.0000      0.999 0.000 1.000
#> GSM254651     2  0.0000      0.999 0.000 1.000
#> GSM254638     2  0.0000      0.999 0.000 1.000
#> GSM254685     2  0.0000      0.999 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
#> GSM254629     3  0.0000     0.8907 0.000 0.000 1.000
#> GSM254648     3  0.3116     0.7697 0.000 0.108 0.892
#> GSM254694     3  0.0000     0.8907 0.000 0.000 1.000
#> GSM254701     3  0.0000     0.8907 0.000 0.000 1.000
#> GSM254728     3  0.0000     0.8907 0.000 0.000 1.000
#> GSM254726     3  0.0000     0.8907 0.000 0.000 1.000
#> GSM254639     3  0.0000     0.8907 0.000 0.000 1.000
#> GSM254652     3  0.0000     0.8907 0.000 0.000 1.000
#> GSM254700     1  0.4002     0.9255 0.840 0.000 0.160
#> GSM254625     1  0.5291     0.8428 0.732 0.000 0.268
#> GSM254636     3  0.3116     0.8612 0.108 0.000 0.892
#> GSM254659     3  0.0000     0.8907 0.000 0.000 1.000
#> GSM254680     3  0.3116     0.8612 0.108 0.000 0.892
#> GSM254686     3  0.0000     0.8907 0.000 0.000 1.000
#> GSM254718     3  0.0000     0.8907 0.000 0.000 1.000
#> GSM254674     3  0.3116     0.8624 0.108 0.000 0.892
#> GSM254668     1  0.4235     0.9127 0.824 0.000 0.176
#> GSM254697     3  0.4504     0.7908 0.196 0.000 0.804
#> GSM254704     3  0.4842     0.7534 0.224 0.000 0.776
#> GSM254707     1  0.4002     0.9255 0.840 0.000 0.160
#> GSM254714     3  0.3482     0.8020 0.128 0.000 0.872
#> GSM254722     3  0.4504     0.7782 0.196 0.000 0.804
#> GSM254627     3  0.4062     0.8235 0.164 0.000 0.836
#> GSM254630     1  0.5291     0.8428 0.732 0.000 0.268
#> GSM254633     3  0.2796     0.8686 0.092 0.000 0.908
#> GSM254670     3  0.0000     0.8907 0.000 0.000 1.000
#> GSM254716     3  0.6062     0.0536 0.384 0.000 0.616
#> GSM254720     3  0.0000     0.8907 0.000 0.000 1.000
#> GSM254729     3  0.0000     0.8907 0.000 0.000 1.000
#> GSM254654     3  0.0000     0.8907 0.000 0.000 1.000
#> GSM254656     3  0.0000     0.8907 0.000 0.000 1.000
#> GSM254631     3  0.3116     0.8612 0.108 0.000 0.892
#> GSM254657     3  0.0237     0.8900 0.004 0.000 0.996
#> GSM254664     3  0.3116     0.8612 0.108 0.000 0.892
#> GSM254672     3  0.3038     0.8633 0.104 0.000 0.896
#> GSM254692     1  0.4002     0.9255 0.840 0.000 0.160
#> GSM254645     3  0.0237     0.8900 0.004 0.000 0.996
#> GSM254666     1  0.5291     0.8428 0.732 0.000 0.268
#> GSM254675     3  0.0000     0.8907 0.000 0.000 1.000
#> GSM254678     3  0.4452     0.7911 0.192 0.000 0.808
#> GSM254688     1  0.4002     0.9255 0.840 0.000 0.160
#> GSM254690     3  0.4235     0.8137 0.176 0.000 0.824
#> GSM254696     3  0.3116     0.8612 0.108 0.000 0.892
#> GSM254705     1  0.5291     0.8428 0.732 0.000 0.268
#> GSM254642     1  0.4002     0.9255 0.840 0.000 0.160
#> GSM254661     3  0.0000     0.8907 0.000 0.000 1.000
#> GSM254698     3  0.0237     0.8906 0.004 0.000 0.996
#> GSM254641     3  0.2711     0.8727 0.088 0.000 0.912
#> GSM254647     3  0.6274     0.1245 0.456 0.000 0.544
#> GSM254663     1  0.4002     0.9255 0.840 0.000 0.160
#> GSM254682     1  0.4002     0.9255 0.840 0.000 0.160
#> GSM254709     1  0.4235     0.9173 0.824 0.000 0.176
#> GSM254721     1  0.4002     0.9255 0.840 0.000 0.160
#> GSM254724     1  0.4002     0.9255 0.840 0.000 0.160
#> GSM254650     1  0.4002     0.9255 0.840 0.000 0.160
#> GSM254687     1  0.4062     0.9238 0.836 0.000 0.164
#> GSM254637     3  0.3551     0.8480 0.132 0.000 0.868
#> GSM254684     3  0.4504     0.7909 0.196 0.000 0.804
#> GSM254649     2  0.3267     0.9320 0.116 0.884 0.000
#> GSM254660     2  0.2711     0.9318 0.088 0.912 0.000
#> GSM254693     2  0.3412     0.9317 0.124 0.876 0.000
#> GSM254695     2  0.1643     0.9220 0.044 0.956 0.000
#> GSM254702     2  0.3267     0.9320 0.116 0.884 0.000
#> GSM254643     2  0.3267     0.9320 0.116 0.884 0.000
#> GSM254727     2  0.3267     0.9320 0.116 0.884 0.000
#> GSM254640     2  0.1289     0.9241 0.032 0.968 0.000
#> GSM254626     2  0.3267     0.9320 0.116 0.884 0.000
#> GSM254635     2  0.1289     0.9287 0.032 0.968 0.000
#> GSM254653     2  0.3267     0.9320 0.116 0.884 0.000
#> GSM254658     2  0.3267     0.9320 0.116 0.884 0.000
#> GSM254681     2  0.1411     0.9237 0.036 0.964 0.000
#> GSM254719     2  0.3267     0.9320 0.116 0.884 0.000
#> GSM254673     2  0.3267     0.9320 0.116 0.884 0.000
#> GSM254655     2  0.3267     0.9320 0.116 0.884 0.000
#> GSM254669     2  0.3267     0.9320 0.116 0.884 0.000
#> GSM254699     2  0.3267     0.9320 0.116 0.884 0.000
#> GSM254703     2  0.1643     0.9220 0.044 0.956 0.000
#> GSM254708     2  0.1529     0.9226 0.040 0.960 0.000
#> GSM254715     2  0.3267     0.9320 0.116 0.884 0.000
#> GSM254628     2  0.3267     0.9320 0.116 0.884 0.000
#> GSM254634     2  0.1643     0.9220 0.044 0.956 0.000
#> GSM254646     2  0.3267     0.9320 0.116 0.884 0.000
#> GSM254671     2  0.3340     0.9316 0.120 0.880 0.000
#> GSM254711     2  0.1411     0.9236 0.036 0.964 0.000
#> GSM254717     2  0.3267     0.9320 0.116 0.884 0.000
#> GSM254723     3  0.0592     0.8831 0.000 0.012 0.988
#> GSM254730     2  0.1289     0.9241 0.032 0.968 0.000
#> GSM254731     2  0.3267     0.9320 0.116 0.884 0.000
#> GSM254632     3  0.4615     0.7066 0.020 0.144 0.836
#> GSM254662     2  0.3267     0.9320 0.116 0.884 0.000
#> GSM254677     2  0.1832     0.9203 0.036 0.956 0.008
#> GSM254665     2  0.1529     0.9226 0.040 0.960 0.000
#> GSM254691     2  0.1643     0.9220 0.044 0.956 0.000
#> GSM254644     2  0.3340     0.9316 0.120 0.880 0.000
#> GSM254667     2  0.1643     0.9220 0.044 0.956 0.000
#> GSM254676     2  0.1643     0.9220 0.044 0.956 0.000
#> GSM254679     2  0.1643     0.9220 0.044 0.956 0.000
#> GSM254689     2  0.1529     0.9226 0.040 0.960 0.000
#> GSM254706     2  0.1529     0.9226 0.040 0.960 0.000
#> GSM254712     2  0.3340     0.9316 0.120 0.880 0.000
#> GSM254713     2  0.3340     0.9316 0.120 0.880 0.000
#> GSM254683     2  0.1643     0.9220 0.044 0.956 0.000
#> GSM254710     1  0.6865     0.3164 0.596 0.384 0.020
#> GSM254725     2  0.1643     0.9220 0.044 0.956 0.000
#> GSM254651     2  0.1529     0.9226 0.040 0.960 0.000
#> GSM254638     2  0.1643     0.9220 0.044 0.956 0.000
#> GSM254685     2  0.1643     0.9220 0.044 0.956 0.000

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM254629     3  0.0000      0.894 0.000 0.000 1.000 0.000
#> GSM254648     3  0.2868      0.776 0.000 0.136 0.864 0.000
#> GSM254694     3  0.0000      0.894 0.000 0.000 1.000 0.000
#> GSM254701     3  0.0000      0.894 0.000 0.000 1.000 0.000
#> GSM254728     3  0.0000      0.894 0.000 0.000 1.000 0.000
#> GSM254726     3  0.0000      0.894 0.000 0.000 1.000 0.000
#> GSM254639     3  0.0000      0.894 0.000 0.000 1.000 0.000
#> GSM254652     3  0.0000      0.894 0.000 0.000 1.000 0.000
#> GSM254700     1  0.0000      0.920 1.000 0.000 0.000 0.000
#> GSM254625     1  0.2814      0.830 0.868 0.000 0.132 0.000
#> GSM254636     3  0.2814      0.863 0.132 0.000 0.868 0.000
#> GSM254659     3  0.0000      0.894 0.000 0.000 1.000 0.000
#> GSM254680     3  0.2814      0.863 0.132 0.000 0.868 0.000
#> GSM254686     3  0.0000      0.894 0.000 0.000 1.000 0.000
#> GSM254718     3  0.0000      0.894 0.000 0.000 1.000 0.000
#> GSM254674     3  0.2760      0.866 0.128 0.000 0.872 0.000
#> GSM254668     1  0.1792      0.868 0.932 0.000 0.068 0.000
#> GSM254697     3  0.3569      0.822 0.196 0.000 0.804 0.000
#> GSM254704     3  0.4382      0.703 0.296 0.000 0.704 0.000
#> GSM254707     1  0.0000      0.920 1.000 0.000 0.000 0.000
#> GSM254714     3  0.3649      0.729 0.204 0.000 0.796 0.000
#> GSM254722     3  0.4431      0.662 0.304 0.000 0.696 0.000
#> GSM254627     3  0.3486      0.829 0.188 0.000 0.812 0.000
#> GSM254630     1  0.2814      0.830 0.868 0.000 0.132 0.000
#> GSM254633     3  0.2589      0.870 0.116 0.000 0.884 0.000
#> GSM254670     3  0.0000      0.894 0.000 0.000 1.000 0.000
#> GSM254716     3  0.4804      0.267 0.384 0.000 0.616 0.000
#> GSM254720     3  0.0000      0.894 0.000 0.000 1.000 0.000
#> GSM254729     3  0.0000      0.894 0.000 0.000 1.000 0.000
#> GSM254654     3  0.0000      0.894 0.000 0.000 1.000 0.000
#> GSM254656     4  0.4981      0.202 0.000 0.000 0.464 0.536
#> GSM254631     3  0.2814      0.863 0.132 0.000 0.868 0.000
#> GSM254657     3  0.0188      0.894 0.004 0.000 0.996 0.000
#> GSM254664     3  0.2814      0.863 0.132 0.000 0.868 0.000
#> GSM254672     3  0.2647      0.869 0.120 0.000 0.880 0.000
#> GSM254692     1  0.0000      0.920 1.000 0.000 0.000 0.000
#> GSM254645     3  0.0188      0.894 0.004 0.000 0.996 0.000
#> GSM254666     1  0.2973      0.823 0.856 0.000 0.144 0.000
#> GSM254675     3  0.0000      0.894 0.000 0.000 1.000 0.000
#> GSM254678     3  0.4040      0.760 0.248 0.000 0.752 0.000
#> GSM254688     1  0.0000      0.920 1.000 0.000 0.000 0.000
#> GSM254690     3  0.3528      0.827 0.192 0.000 0.808 0.000
#> GSM254696     3  0.2814      0.863 0.132 0.000 0.868 0.000
#> GSM254705     1  0.2814      0.830 0.868 0.000 0.132 0.000
#> GSM254642     1  0.0000      0.920 1.000 0.000 0.000 0.000
#> GSM254661     3  0.0000      0.894 0.000 0.000 1.000 0.000
#> GSM254698     3  0.0188      0.894 0.004 0.000 0.996 0.000
#> GSM254641     3  0.2469      0.875 0.108 0.000 0.892 0.000
#> GSM254647     1  0.4804      0.195 0.616 0.000 0.384 0.000
#> GSM254663     1  0.0000      0.920 1.000 0.000 0.000 0.000
#> GSM254682     1  0.0000      0.920 1.000 0.000 0.000 0.000
#> GSM254709     1  0.0707      0.911 0.980 0.000 0.020 0.000
#> GSM254721     1  0.0000      0.920 1.000 0.000 0.000 0.000
#> GSM254724     1  0.0000      0.920 1.000 0.000 0.000 0.000
#> GSM254650     1  0.0000      0.920 1.000 0.000 0.000 0.000
#> GSM254687     1  0.0188      0.919 0.996 0.000 0.004 0.000
#> GSM254637     3  0.3074      0.853 0.152 0.000 0.848 0.000
#> GSM254684     3  0.3610      0.819 0.200 0.000 0.800 0.000
#> GSM254649     2  0.0000      0.829 0.000 1.000 0.000 0.000
#> GSM254660     2  0.1940      0.805 0.000 0.924 0.000 0.076
#> GSM254693     2  0.0336      0.827 0.000 0.992 0.000 0.008
#> GSM254695     4  0.0000      0.793 0.000 0.000 0.000 1.000
#> GSM254702     2  0.3801      0.526 0.000 0.780 0.000 0.220
#> GSM254643     2  0.0000      0.829 0.000 1.000 0.000 0.000
#> GSM254727     2  0.0000      0.829 0.000 1.000 0.000 0.000
#> GSM254640     2  0.4040      0.720 0.000 0.752 0.000 0.248
#> GSM254626     2  0.0000      0.829 0.000 1.000 0.000 0.000
#> GSM254635     4  0.3688      0.718 0.000 0.208 0.000 0.792
#> GSM254653     2  0.0000      0.829 0.000 1.000 0.000 0.000
#> GSM254658     2  0.0000      0.829 0.000 1.000 0.000 0.000
#> GSM254681     2  0.3486      0.757 0.000 0.812 0.000 0.188
#> GSM254719     2  0.0000      0.829 0.000 1.000 0.000 0.000
#> GSM254673     2  0.0000      0.829 0.000 1.000 0.000 0.000
#> GSM254655     2  0.0469      0.822 0.000 0.988 0.000 0.012
#> GSM254669     2  0.0000      0.829 0.000 1.000 0.000 0.000
#> GSM254699     2  0.0000      0.829 0.000 1.000 0.000 0.000
#> GSM254703     4  0.0188      0.793 0.000 0.004 0.000 0.996
#> GSM254708     2  0.4564      0.665 0.000 0.672 0.000 0.328
#> GSM254715     4  0.4817      0.580 0.000 0.388 0.000 0.612
#> GSM254628     2  0.0000      0.829 0.000 1.000 0.000 0.000
#> GSM254634     4  0.0000      0.793 0.000 0.000 0.000 1.000
#> GSM254646     2  0.0000      0.829 0.000 1.000 0.000 0.000
#> GSM254671     4  0.4500      0.653 0.000 0.316 0.000 0.684
#> GSM254711     4  0.1022      0.791 0.000 0.032 0.000 0.968
#> GSM254717     2  0.0000      0.829 0.000 1.000 0.000 0.000
#> GSM254723     3  0.0336      0.891 0.000 0.008 0.992 0.000
#> GSM254730     2  0.4164      0.711 0.000 0.736 0.000 0.264
#> GSM254731     4  0.4804      0.586 0.000 0.384 0.000 0.616
#> GSM254632     3  0.4583      0.735 0.004 0.076 0.808 0.112
#> GSM254662     2  0.0000      0.829 0.000 1.000 0.000 0.000
#> GSM254677     4  0.1211      0.790 0.000 0.040 0.000 0.960
#> GSM254665     2  0.4500      0.673 0.000 0.684 0.000 0.316
#> GSM254691     2  0.4855      0.581 0.000 0.600 0.000 0.400
#> GSM254644     4  0.4713      0.618 0.000 0.360 0.000 0.640
#> GSM254667     4  0.0000      0.793 0.000 0.000 0.000 1.000
#> GSM254676     4  0.0000      0.793 0.000 0.000 0.000 1.000
#> GSM254679     4  0.0000      0.793 0.000 0.000 0.000 1.000
#> GSM254689     2  0.4304      0.698 0.000 0.716 0.000 0.284
#> GSM254706     2  0.4713      0.631 0.000 0.640 0.000 0.360
#> GSM254712     4  0.4713      0.615 0.000 0.360 0.000 0.640
#> GSM254713     4  0.4605      0.638 0.000 0.336 0.000 0.664
#> GSM254683     2  0.4746      0.622 0.000 0.632 0.000 0.368
#> GSM254710     2  0.6412      0.562 0.080 0.572 0.000 0.348
#> GSM254725     4  0.0000      0.793 0.000 0.000 0.000 1.000
#> GSM254651     2  0.4713      0.631 0.000 0.640 0.000 0.360
#> GSM254638     4  0.0000      0.793 0.000 0.000 0.000 1.000
#> GSM254685     4  0.1637      0.779 0.000 0.060 0.000 0.940

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM254629     3  0.0000     0.8722 0.000 0.000 1.000 0.000 0.000
#> GSM254648     3  0.2471     0.7301 0.000 0.136 0.864 0.000 0.000
#> GSM254694     3  0.0000     0.8722 0.000 0.000 1.000 0.000 0.000
#> GSM254701     3  0.0000     0.8722 0.000 0.000 1.000 0.000 0.000
#> GSM254728     3  0.0000     0.8722 0.000 0.000 1.000 0.000 0.000
#> GSM254726     3  0.0000     0.8722 0.000 0.000 1.000 0.000 0.000
#> GSM254639     3  0.0000     0.8722 0.000 0.000 1.000 0.000 0.000
#> GSM254652     3  0.0000     0.8722 0.000 0.000 1.000 0.000 0.000
#> GSM254700     1  0.3730     0.6764 0.712 0.000 0.000 0.000 0.288
#> GSM254625     5  0.1341     0.8244 0.000 0.000 0.056 0.000 0.944
#> GSM254636     3  0.2922     0.8385 0.072 0.000 0.872 0.000 0.056
#> GSM254659     3  0.0000     0.8722 0.000 0.000 1.000 0.000 0.000
#> GSM254680     3  0.2922     0.8385 0.072 0.000 0.872 0.000 0.056
#> GSM254686     3  0.0000     0.8722 0.000 0.000 1.000 0.000 0.000
#> GSM254718     3  0.0000     0.8722 0.000 0.000 1.000 0.000 0.000
#> GSM254674     3  0.2859     0.8416 0.068 0.000 0.876 0.000 0.056
#> GSM254668     5  0.3119     0.7119 0.072 0.000 0.068 0.000 0.860
#> GSM254697     1  0.2179     0.6379 0.888 0.000 0.112 0.000 0.000
#> GSM254704     1  0.5263     0.6986 0.660 0.000 0.100 0.000 0.240
#> GSM254707     5  0.1544     0.8005 0.068 0.000 0.000 0.000 0.932
#> GSM254714     3  0.3684     0.5853 0.000 0.000 0.720 0.000 0.280
#> GSM254722     3  0.5640     0.5171 0.176 0.000 0.636 0.000 0.188
#> GSM254627     3  0.4425     0.3238 0.452 0.000 0.544 0.000 0.004
#> GSM254630     5  0.1341     0.8244 0.000 0.000 0.056 0.000 0.944
#> GSM254633     3  0.2719     0.8445 0.068 0.000 0.884 0.000 0.048
#> GSM254670     3  0.0000     0.8722 0.000 0.000 1.000 0.000 0.000
#> GSM254716     3  0.4138     0.2671 0.000 0.000 0.616 0.000 0.384
#> GSM254720     1  0.4114     0.4788 0.624 0.000 0.376 0.000 0.000
#> GSM254729     3  0.0000     0.8722 0.000 0.000 1.000 0.000 0.000
#> GSM254654     3  0.0000     0.8722 0.000 0.000 1.000 0.000 0.000
#> GSM254656     4  0.4302     0.1365 0.000 0.000 0.480 0.520 0.000
#> GSM254631     3  0.2922     0.8385 0.072 0.000 0.872 0.000 0.056
#> GSM254657     3  0.0162     0.8713 0.000 0.000 0.996 0.000 0.004
#> GSM254664     3  0.2922     0.8385 0.072 0.000 0.872 0.000 0.056
#> GSM254672     3  0.2795     0.8424 0.064 0.000 0.880 0.000 0.056
#> GSM254692     5  0.0000     0.8499 0.000 0.000 0.000 0.000 1.000
#> GSM254645     3  0.0162     0.8713 0.000 0.000 0.996 0.000 0.004
#> GSM254666     5  0.1544     0.8166 0.000 0.000 0.068 0.000 0.932
#> GSM254675     3  0.0000     0.8722 0.000 0.000 1.000 0.000 0.000
#> GSM254678     3  0.3612     0.6564 0.000 0.000 0.732 0.000 0.268
#> GSM254688     5  0.0000     0.8499 0.000 0.000 0.000 0.000 1.000
#> GSM254690     3  0.3631     0.8046 0.072 0.000 0.824 0.000 0.104
#> GSM254696     3  0.2922     0.8385 0.072 0.000 0.872 0.000 0.056
#> GSM254705     5  0.1341     0.8244 0.000 0.000 0.056 0.000 0.944
#> GSM254642     5  0.3003     0.6749 0.188 0.000 0.000 0.000 0.812
#> GSM254661     3  0.0000     0.8722 0.000 0.000 1.000 0.000 0.000
#> GSM254698     3  0.2891     0.7633 0.176 0.000 0.824 0.000 0.000
#> GSM254641     3  0.2588     0.8498 0.048 0.000 0.892 0.000 0.060
#> GSM254647     5  0.5467     0.0493 0.068 0.000 0.384 0.000 0.548
#> GSM254663     5  0.1608     0.7962 0.072 0.000 0.000 0.000 0.928
#> GSM254682     5  0.0000     0.8499 0.000 0.000 0.000 0.000 1.000
#> GSM254709     5  0.0290     0.8501 0.000 0.000 0.008 0.000 0.992
#> GSM254721     1  0.4060     0.6364 0.640 0.000 0.000 0.000 0.360
#> GSM254724     1  0.3966     0.6637 0.664 0.000 0.000 0.000 0.336
#> GSM254650     5  0.0000     0.8499 0.000 0.000 0.000 0.000 1.000
#> GSM254687     5  0.0162     0.8505 0.000 0.000 0.004 0.000 0.996
#> GSM254637     3  0.3119     0.8318 0.072 0.000 0.860 0.000 0.068
#> GSM254684     3  0.3921     0.7777 0.072 0.000 0.800 0.000 0.128
#> GSM254649     2  0.0000     0.8134 0.000 1.000 0.000 0.000 0.000
#> GSM254660     2  0.3670     0.7625 0.112 0.820 0.000 0.068 0.000
#> GSM254693     2  0.0000     0.8134 0.000 1.000 0.000 0.000 0.000
#> GSM254695     4  0.0404     0.7470 0.012 0.000 0.000 0.988 0.000
#> GSM254702     2  0.5268     0.4188 0.112 0.668 0.000 0.220 0.000
#> GSM254643     2  0.0963     0.8059 0.036 0.964 0.000 0.000 0.000
#> GSM254727     2  0.1341     0.7993 0.056 0.944 0.000 0.000 0.000
#> GSM254640     2  0.4270     0.7286 0.048 0.748 0.000 0.204 0.000
#> GSM254626     2  0.0000     0.8134 0.000 1.000 0.000 0.000 0.000
#> GSM254635     4  0.4994     0.6884 0.112 0.184 0.000 0.704 0.000
#> GSM254653     2  0.1341     0.7993 0.056 0.944 0.000 0.000 0.000
#> GSM254658     2  0.0000     0.8134 0.000 1.000 0.000 0.000 0.000
#> GSM254681     2  0.2516     0.7711 0.000 0.860 0.000 0.140 0.000
#> GSM254719     2  0.2179     0.7728 0.112 0.888 0.000 0.000 0.000
#> GSM254673     2  0.0510     0.8111 0.016 0.984 0.000 0.000 0.000
#> GSM254655     2  0.2677     0.7630 0.112 0.872 0.000 0.016 0.000
#> GSM254669     2  0.0000     0.8134 0.000 1.000 0.000 0.000 0.000
#> GSM254699     2  0.2179     0.7728 0.112 0.888 0.000 0.000 0.000
#> GSM254703     4  0.0162     0.7458 0.000 0.004 0.000 0.996 0.000
#> GSM254708     2  0.3966     0.6505 0.000 0.664 0.000 0.336 0.000
#> GSM254715     4  0.5740     0.6041 0.112 0.308 0.000 0.580 0.000
#> GSM254628     2  0.0000     0.8134 0.000 1.000 0.000 0.000 0.000
#> GSM254634     4  0.0000     0.7443 0.000 0.000 0.000 1.000 0.000
#> GSM254646     2  0.0000     0.8134 0.000 1.000 0.000 0.000 0.000
#> GSM254671     4  0.5537     0.6409 0.112 0.264 0.000 0.624 0.000
#> GSM254711     4  0.2813     0.7409 0.108 0.024 0.000 0.868 0.000
#> GSM254717     2  0.0000     0.8134 0.000 1.000 0.000 0.000 0.000
#> GSM254723     3  0.0290     0.8680 0.000 0.008 0.992 0.000 0.000
#> GSM254730     2  0.5060     0.7022 0.092 0.684 0.000 0.224 0.000
#> GSM254731     4  0.5740     0.6041 0.112 0.308 0.000 0.580 0.000
#> GSM254632     3  0.4656     0.5818 0.000 0.076 0.740 0.180 0.004
#> GSM254662     2  0.0404     0.8121 0.012 0.988 0.000 0.000 0.000
#> GSM254677     4  0.3035     0.7390 0.112 0.032 0.000 0.856 0.000
#> GSM254665     2  0.4114     0.6191 0.000 0.624 0.000 0.376 0.000
#> GSM254691     2  0.4256     0.5461 0.000 0.564 0.000 0.436 0.000
#> GSM254644     4  0.5740     0.6049 0.112 0.308 0.000 0.580 0.000
#> GSM254667     4  0.0000     0.7443 0.000 0.000 0.000 1.000 0.000
#> GSM254676     4  0.0000     0.7443 0.000 0.000 0.000 1.000 0.000
#> GSM254679     4  0.0000     0.7443 0.000 0.000 0.000 1.000 0.000
#> GSM254689     2  0.3366     0.7155 0.000 0.768 0.000 0.232 0.000
#> GSM254706     2  0.4074     0.6188 0.000 0.636 0.000 0.364 0.000
#> GSM254712     4  0.5740     0.6041 0.112 0.308 0.000 0.580 0.000
#> GSM254713     4  0.5637     0.6270 0.112 0.284 0.000 0.604 0.000
#> GSM254683     2  0.4227     0.5660 0.000 0.580 0.000 0.420 0.000
#> GSM254710     2  0.5168     0.5830 0.000 0.592 0.000 0.356 0.052
#> GSM254725     4  0.0609     0.7478 0.020 0.000 0.000 0.980 0.000
#> GSM254651     2  0.3913     0.6482 0.000 0.676 0.000 0.324 0.000
#> GSM254638     4  0.0000     0.7443 0.000 0.000 0.000 1.000 0.000
#> GSM254685     4  0.1410     0.7420 0.000 0.060 0.000 0.940 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
#> GSM254629     3  0.1714     0.7823 0.000 0.000 0.908 0.000 0.000 0.092
#> GSM254648     3  0.3099     0.7509 0.000 0.044 0.848 0.012 0.000 0.096
#> GSM254694     3  0.0000     0.8040 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM254701     3  0.0146     0.8037 0.000 0.000 0.996 0.000 0.000 0.004
#> GSM254728     3  0.0146     0.8037 0.000 0.000 0.996 0.000 0.000 0.004
#> GSM254726     3  0.1908     0.7797 0.000 0.000 0.900 0.004 0.000 0.096
#> GSM254639     3  0.0000     0.8040 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM254652     3  0.1075     0.7967 0.000 0.000 0.952 0.000 0.000 0.048
#> GSM254700     1  0.3455     0.7615 0.800 0.000 0.000 0.000 0.056 0.144
#> GSM254625     5  0.0713     0.8243 0.000 0.000 0.028 0.000 0.972 0.000
#> GSM254636     3  0.3833     0.7316 0.004 0.000 0.736 0.000 0.028 0.232
#> GSM254659     3  0.0000     0.8040 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM254680     3  0.3419     0.7560 0.004 0.000 0.792 0.000 0.028 0.176
#> GSM254686     3  0.0000     0.8040 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM254718     3  0.0000     0.8040 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM254674     3  0.3316     0.7625 0.004 0.000 0.804 0.000 0.028 0.164
#> GSM254668     5  0.3936     0.6514 0.004 0.000 0.060 0.000 0.760 0.176
#> GSM254697     1  0.2378     0.6726 0.848 0.000 0.000 0.000 0.000 0.152
#> GSM254704     1  0.3557     0.8104 0.800 0.000 0.008 0.000 0.148 0.044
#> GSM254707     5  0.2482     0.7396 0.004 0.000 0.000 0.000 0.848 0.148
#> GSM254714     3  0.4960     0.5228 0.000 0.000 0.600 0.000 0.308 0.092
#> GSM254722     3  0.6323     0.4316 0.200 0.000 0.536 0.000 0.048 0.216
#> GSM254627     3  0.5791     0.1411 0.380 0.000 0.440 0.000 0.000 0.180
#> GSM254630     5  0.0713     0.8243 0.000 0.000 0.028 0.000 0.972 0.000
#> GSM254633     3  0.2890     0.7762 0.004 0.000 0.844 0.000 0.024 0.128
#> GSM254670     3  0.2300     0.7804 0.000 0.000 0.856 0.000 0.000 0.144
#> GSM254716     3  0.3717     0.3366 0.000 0.000 0.616 0.000 0.384 0.000
#> GSM254720     1  0.2969     0.6683 0.776 0.000 0.224 0.000 0.000 0.000
#> GSM254729     3  0.0000     0.8040 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM254654     3  0.1765     0.7810 0.000 0.000 0.904 0.000 0.000 0.096
#> GSM254656     3  0.3864     0.1372 0.000 0.000 0.520 0.480 0.000 0.000
#> GSM254631     3  0.3419     0.7560 0.004 0.000 0.792 0.000 0.028 0.176
#> GSM254657     3  0.2482     0.7774 0.000 0.000 0.848 0.000 0.004 0.148
#> GSM254664     3  0.3419     0.7560 0.004 0.000 0.792 0.000 0.028 0.176
#> GSM254672     3  0.3419     0.7635 0.004 0.000 0.792 0.000 0.028 0.176
#> GSM254692     5  0.0146     0.8342 0.000 0.000 0.000 0.000 0.996 0.004
#> GSM254645     3  0.1970     0.7832 0.000 0.000 0.900 0.000 0.008 0.092
#> GSM254666     5  0.2629     0.7395 0.000 0.000 0.040 0.000 0.868 0.092
#> GSM254675     3  0.0000     0.8040 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM254678     3  0.4360     0.6263 0.000 0.000 0.680 0.000 0.260 0.060
#> GSM254688     5  0.0000     0.8350 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM254690     3  0.4039     0.7241 0.004 0.000 0.724 0.000 0.040 0.232
#> GSM254696     3  0.3640     0.7484 0.004 0.000 0.764 0.000 0.028 0.204
#> GSM254705     5  0.0713     0.8243 0.000 0.000 0.028 0.000 0.972 0.000
#> GSM254642     5  0.5015     0.4889 0.208 0.000 0.000 0.000 0.640 0.152
#> GSM254661     3  0.1765     0.7810 0.000 0.000 0.904 0.000 0.000 0.096
#> GSM254698     3  0.5327     0.5305 0.196 0.000 0.596 0.000 0.000 0.208
#> GSM254641     3  0.3727     0.7752 0.004 0.000 0.768 0.000 0.040 0.188
#> GSM254647     5  0.6039     0.1227 0.004 0.000 0.324 0.000 0.448 0.224
#> GSM254663     5  0.2558     0.7322 0.004 0.000 0.000 0.000 0.840 0.156
#> GSM254682     5  0.0000     0.8350 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM254709     5  0.0260     0.8343 0.000 0.000 0.008 0.000 0.992 0.000
#> GSM254721     1  0.2823     0.7745 0.796 0.000 0.000 0.000 0.204 0.000
#> GSM254724     1  0.3354     0.8041 0.796 0.000 0.000 0.000 0.168 0.036
#> GSM254650     5  0.0000     0.8350 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM254687     5  0.0146     0.8350 0.000 0.000 0.004 0.000 0.996 0.000
#> GSM254637     3  0.3419     0.7560 0.004 0.000 0.792 0.000 0.028 0.176
#> GSM254684     3  0.4163     0.7186 0.004 0.000 0.716 0.000 0.048 0.232
#> GSM254649     2  0.0000     0.5649 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM254660     6  0.4996     0.6602 0.000 0.408 0.000 0.072 0.000 0.520
#> GSM254693     2  0.0000     0.5649 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM254695     4  0.3659     0.4129 0.000 0.000 0.000 0.636 0.000 0.364
#> GSM254702     6  0.5319     0.7384 0.000 0.368 0.000 0.112 0.000 0.520
#> GSM254643     2  0.2854     0.2583 0.000 0.792 0.000 0.000 0.000 0.208
#> GSM254727     2  0.3266     0.0313 0.000 0.728 0.000 0.000 0.000 0.272
#> GSM254640     2  0.4577     0.4881 0.000 0.656 0.000 0.272 0.000 0.072
#> GSM254626     2  0.0547     0.5538 0.000 0.980 0.000 0.000 0.000 0.020
#> GSM254635     4  0.5066     0.3522 0.000 0.176 0.000 0.636 0.000 0.188
#> GSM254653     2  0.3390    -0.0451 0.000 0.704 0.000 0.000 0.000 0.296
#> GSM254658     2  0.0000     0.5649 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM254681     2  0.2092     0.5810 0.000 0.876 0.000 0.124 0.000 0.000
#> GSM254719     6  0.3868     0.6355 0.000 0.492 0.000 0.000 0.000 0.508
#> GSM254673     2  0.3607    -0.2371 0.000 0.652 0.000 0.000 0.000 0.348
#> GSM254655     6  0.4328     0.6853 0.000 0.460 0.000 0.020 0.000 0.520
#> GSM254669     2  0.0547     0.5520 0.000 0.980 0.000 0.000 0.000 0.020
#> GSM254699     6  0.3867     0.6450 0.000 0.488 0.000 0.000 0.000 0.512
#> GSM254703     4  0.0603     0.6652 0.000 0.004 0.000 0.980 0.000 0.016
#> GSM254708     2  0.3765     0.4191 0.000 0.596 0.000 0.404 0.000 0.000
#> GSM254715     6  0.6065     0.4738 0.000 0.280 0.000 0.316 0.000 0.404
#> GSM254628     2  0.0146     0.5632 0.000 0.996 0.000 0.000 0.000 0.004
#> GSM254634     4  0.0363     0.6659 0.000 0.000 0.000 0.988 0.000 0.012
#> GSM254646     2  0.0000     0.5649 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM254671     4  0.5543     0.1489 0.000 0.240 0.000 0.556 0.000 0.204
#> GSM254711     4  0.4338     0.1627 0.000 0.020 0.000 0.492 0.000 0.488
#> GSM254717     2  0.3428    -0.1071 0.000 0.696 0.000 0.000 0.000 0.304
#> GSM254723     3  0.1700     0.7728 0.000 0.004 0.916 0.000 0.000 0.080
#> GSM254730     2  0.5605     0.3230 0.000 0.544 0.000 0.212 0.000 0.244
#> GSM254731     6  0.5684     0.6653 0.000 0.280 0.000 0.200 0.000 0.520
#> GSM254632     3  0.5352     0.5151 0.000 0.024 0.644 0.232 0.004 0.096
#> GSM254662     2  0.3634    -0.2705 0.000 0.644 0.000 0.000 0.000 0.356
#> GSM254677     4  0.3409     0.5684 0.000 0.028 0.000 0.780 0.000 0.192
#> GSM254665     2  0.3817     0.3926 0.000 0.568 0.000 0.432 0.000 0.000
#> GSM254691     4  0.3756     0.0127 0.000 0.352 0.000 0.644 0.000 0.004
#> GSM254644     6  0.5705     0.6621 0.000 0.280 0.000 0.204 0.000 0.516
#> GSM254667     4  0.0363     0.6638 0.000 0.012 0.000 0.988 0.000 0.000
#> GSM254676     4  0.0363     0.6638 0.000 0.012 0.000 0.988 0.000 0.000
#> GSM254679     4  0.0632     0.6666 0.000 0.000 0.000 0.976 0.000 0.024
#> GSM254689     2  0.2854     0.5676 0.000 0.792 0.000 0.208 0.000 0.000
#> GSM254706     2  0.3706     0.4516 0.000 0.620 0.000 0.380 0.000 0.000
#> GSM254712     4  0.6004    -0.2476 0.000 0.280 0.000 0.436 0.000 0.284
#> GSM254713     4  0.5983    -0.2232 0.000 0.256 0.000 0.440 0.000 0.304
#> GSM254683     2  0.3860     0.3190 0.000 0.528 0.000 0.472 0.000 0.000
#> GSM254710     2  0.4453     0.4374 0.000 0.592 0.000 0.372 0.036 0.000
#> GSM254725     4  0.1714     0.6506 0.000 0.000 0.000 0.908 0.000 0.092
#> GSM254651     2  0.3482     0.5113 0.000 0.684 0.000 0.316 0.000 0.000
#> GSM254638     4  0.0000     0.6645 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM254685     4  0.4476     0.3600 0.000 0.052 0.000 0.640 0.000 0.308

Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.

consensus_heatmap(res, k = 2)

plot of chunk tab-MAD-pam-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-MAD-pam-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-MAD-pam-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-MAD-pam-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-MAD-pam-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-MAD-pam-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-MAD-pam-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-MAD-pam-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-MAD-pam-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-MAD-pam-membership-heatmap-5

As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

plot of chunk tab-MAD-pam-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-MAD-pam-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-MAD-pam-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-MAD-pam-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-MAD-pam-get-signatures-5

Signature heatmaps where rows are not scaled:

get_signatures(res, k = 2, scale_rows = FALSE)

plot of chunk tab-MAD-pam-get-signatures-no-scale-1

get_signatures(res, k = 3, scale_rows = FALSE)

plot of chunk tab-MAD-pam-get-signatures-no-scale-2

get_signatures(res, k = 4, scale_rows = FALSE)

plot of chunk tab-MAD-pam-get-signatures-no-scale-3

get_signatures(res, k = 5, scale_rows = FALSE)

plot of chunk tab-MAD-pam-get-signatures-no-scale-4

get_signatures(res, k = 6, scale_rows = FALSE)

plot of chunk tab-MAD-pam-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk MAD-pam-signature_compare

get_signature() returns a data frame invisibly. TO get the list of signatures, the function call should be assigned to a variable explicitly. In following code, if plot argument is set to FALSE, no heatmap is plotted while only the differential analysis is performed.

# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)

An example of the output of tb is:

#>   which_row         fdr    mean_1    mean_2 scaled_mean_1 scaled_mean_2 km
#> 1        38 0.042760348  8.373488  9.131774    -0.5533452     0.5164555  1
#> 2        40 0.018707592  7.106213  8.469186    -0.6173731     0.5762149  1
#> 3        55 0.019134737 10.221463 11.207825    -0.6159697     0.5749050  1
#> 4        59 0.006059896  5.921854  7.869574    -0.6899429     0.6439467  1
#> 5        60 0.018055526  8.928898 10.211722    -0.6204761     0.5791110  1
#> 6        98 0.009384629 15.714769 14.887706     0.6635654    -0.6193277  2
...

The columns in tb are:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. km: Row groups if k-means clustering is applied to rows.

UMAP plot which shows how samples are separated.

dimension_reduction(res, k = 2, method = "UMAP")

plot of chunk tab-MAD-pam-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-MAD-pam-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-MAD-pam-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-MAD-pam-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-MAD-pam-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk MAD-pam-collect-classes

Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.

test_to_known_factors(res)
#>           n tissue(p) individual(p) disease.state(p) gender(p) other(p) k
#> MAD:pam 107  1.59e-22        0.7770            0.577     0.628    0.872 2
#> MAD:pam 104  1.20e-21        0.0322            0.319     0.441    0.191 3
#> MAD:pam 104  9.35e-21        0.0119            0.557     0.226    0.411 4
#> MAD:pam 101  2.46e-19        0.0663            0.737     0.204    0.304 5
#> MAD:pam  79  7.62e-14        0.0985            0.652     0.225    0.345 6

If matrix rows can be associated to genes, consider to use functional_enrichment(res, ...) to perform function enrichment for the signature genes. See this vignette for more detailed explanations.


MAD:mclust**

The object with results only for a single top-value method and a single partition method can be extracted as:

res = res_list["MAD", "mclust"]
# you can also extract it by
# res = res_list["MAD:mclust"]

A summary of res and all the functions that can be applied to it:

res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#>   On a matrix with 21168 rows and 107 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           1.000       1.000         0.4953 0.505   0.505
#> 3 3 0.755           0.828       0.896         0.2675 0.859   0.721
#> 4 4 0.650           0.571       0.773         0.1174 0.930   0.817
#> 5 5 0.624           0.454       0.747         0.0859 0.919   0.762
#> 6 6 0.661           0.478       0.734         0.0437 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
#> GSM254629     1  0.0000      1.000 1.000 0.000
#> GSM254648     1  0.0000      1.000 1.000 0.000
#> GSM254694     1  0.0000      1.000 1.000 0.000
#> GSM254701     1  0.0000      1.000 1.000 0.000
#> GSM254728     1  0.0000      1.000 1.000 0.000
#> GSM254726     1  0.0000      1.000 1.000 0.000
#> GSM254639     1  0.0000      1.000 1.000 0.000
#> GSM254652     1  0.0000      1.000 1.000 0.000
#> GSM254700     1  0.0000      1.000 1.000 0.000
#> GSM254625     1  0.0000      1.000 1.000 0.000
#> GSM254636     1  0.0000      1.000 1.000 0.000
#> GSM254659     1  0.0000      1.000 1.000 0.000
#> GSM254680     1  0.0000      1.000 1.000 0.000
#> GSM254686     1  0.0000      1.000 1.000 0.000
#> GSM254718     1  0.0000      1.000 1.000 0.000
#> GSM254674     1  0.0000      1.000 1.000 0.000
#> GSM254668     1  0.0000      1.000 1.000 0.000
#> GSM254697     1  0.0000      1.000 1.000 0.000
#> GSM254704     1  0.0000      1.000 1.000 0.000
#> GSM254707     1  0.0000      1.000 1.000 0.000
#> GSM254714     1  0.0000      1.000 1.000 0.000
#> GSM254722     1  0.0000      1.000 1.000 0.000
#> GSM254627     1  0.0000      1.000 1.000 0.000
#> GSM254630     1  0.0000      1.000 1.000 0.000
#> GSM254633     1  0.0000      1.000 1.000 0.000
#> GSM254670     1  0.0000      1.000 1.000 0.000
#> GSM254716     1  0.0000      1.000 1.000 0.000
#> GSM254720     1  0.0000      1.000 1.000 0.000
#> GSM254729     1  0.0000      1.000 1.000 0.000
#> GSM254654     1  0.0000      1.000 1.000 0.000
#> GSM254656     1  0.0000      1.000 1.000 0.000
#> GSM254631     1  0.0000      1.000 1.000 0.000
#> GSM254657     1  0.0000      1.000 1.000 0.000
#> GSM254664     1  0.0000      1.000 1.000 0.000
#> GSM254672     1  0.0000      1.000 1.000 0.000
#> GSM254692     1  0.0000      1.000 1.000 0.000
#> GSM254645     1  0.0000      1.000 1.000 0.000
#> GSM254666     1  0.0000      1.000 1.000 0.000
#> GSM254675     1  0.0000      1.000 1.000 0.000
#> GSM254678     1  0.0000      1.000 1.000 0.000
#> GSM254688     1  0.0000      1.000 1.000 0.000
#> GSM254690     1  0.0000      1.000 1.000 0.000
#> GSM254696     1  0.0000      1.000 1.000 0.000
#> GSM254705     1  0.0000      1.000 1.000 0.000
#> GSM254642     1  0.0000      1.000 1.000 0.000
#> GSM254661     1  0.0000      1.000 1.000 0.000
#> GSM254698     1  0.0000      1.000 1.000 0.000
#> GSM254641     1  0.0000      1.000 1.000 0.000
#> GSM254647     1  0.0000      1.000 1.000 0.000
#> GSM254663     1  0.0000      1.000 1.000 0.000
#> GSM254682     1  0.0000      1.000 1.000 0.000
#> GSM254709     1  0.0000      1.000 1.000 0.000
#> GSM254721     1  0.0000      1.000 1.000 0.000
#> GSM254724     1  0.0000      1.000 1.000 0.000
#> GSM254650     1  0.0000      1.000 1.000 0.000
#> GSM254687     1  0.0000      1.000 1.000 0.000
#> GSM254637     1  0.0000      1.000 1.000 0.000
#> GSM254684     1  0.0000      1.000 1.000 0.000
#> GSM254649     2  0.0000      1.000 0.000 1.000
#> GSM254660     2  0.0000      1.000 0.000 1.000
#> GSM254693     2  0.0000      1.000 0.000 1.000
#> GSM254695     2  0.0000      1.000 0.000 1.000
#> GSM254702     2  0.0000      1.000 0.000 1.000
#> GSM254643     2  0.0000      1.000 0.000 1.000
#> GSM254727     2  0.0000      1.000 0.000 1.000
#> GSM254640     2  0.0000      1.000 0.000 1.000
#> GSM254626     2  0.0000      1.000 0.000 1.000
#> GSM254635     2  0.0000      1.000 0.000 1.000
#> GSM254653     2  0.0000      1.000 0.000 1.000
#> GSM254658     2  0.0000      1.000 0.000 1.000
#> GSM254681     2  0.0000      1.000 0.000 1.000
#> GSM254719     2  0.0000      1.000 0.000 1.000
#> GSM254673     2  0.0000      1.000 0.000 1.000
#> GSM254655     2  0.0000      1.000 0.000 1.000
#> GSM254669     2  0.0000      1.000 0.000 1.000
#> GSM254699     2  0.0000      1.000 0.000 1.000
#> GSM254703     2  0.0000      1.000 0.000 1.000
#> GSM254708     2  0.0000      1.000 0.000 1.000
#> GSM254715     2  0.0000      1.000 0.000 1.000
#> GSM254628     2  0.0000      1.000 0.000 1.000
#> GSM254634     2  0.0000      1.000 0.000 1.000
#> GSM254646     2  0.0000      1.000 0.000 1.000
#> GSM254671     2  0.0000      1.000 0.000 1.000
#> GSM254711     2  0.0000      1.000 0.000 1.000
#> GSM254717     2  0.0000      1.000 0.000 1.000
#> GSM254723     1  0.0672      0.992 0.992 0.008
#> GSM254730     2  0.0000      1.000 0.000 1.000
#> GSM254731     2  0.0000      1.000 0.000 1.000
#> GSM254632     1  0.0000      1.000 1.000 0.000
#> GSM254662     2  0.0000      1.000 0.000 1.000
#> GSM254677     2  0.0000      1.000 0.000 1.000
#> GSM254665     2  0.0000      1.000 0.000 1.000
#> GSM254691     2  0.0000      1.000 0.000 1.000
#> GSM254644     2  0.0000      1.000 0.000 1.000
#> GSM254667     2  0.0672      0.992 0.008 0.992
#> GSM254676     2  0.0000      1.000 0.000 1.000
#> GSM254679     2  0.0000      1.000 0.000 1.000
#> GSM254689     2  0.0000      1.000 0.000 1.000
#> GSM254706     2  0.0000      1.000 0.000 1.000
#> GSM254712     2  0.0000      1.000 0.000 1.000
#> GSM254713     2  0.0000      1.000 0.000 1.000
#> GSM254683     2  0.0000      1.000 0.000 1.000
#> GSM254710     1  0.0672      0.992 0.992 0.008
#> GSM254725     2  0.0000      1.000 0.000 1.000
#> GSM254651     2  0.0000      1.000 0.000 1.000
#> GSM254638     2  0.0000      1.000 0.000 1.000
#> GSM254685     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
#> GSM254629     3  0.6168     0.6441 0.412 0.000 0.588
#> GSM254648     3  0.2959     0.7449 0.100 0.000 0.900
#> GSM254694     3  0.5058     0.7967 0.244 0.000 0.756
#> GSM254701     3  0.6192     0.6274 0.420 0.000 0.580
#> GSM254728     1  0.6260    -0.3839 0.552 0.000 0.448
#> GSM254726     3  0.2959     0.7449 0.100 0.000 0.900
#> GSM254639     3  0.6280     0.6137 0.460 0.000 0.540
#> GSM254652     1  0.6274    -0.4197 0.544 0.000 0.456
#> GSM254700     1  0.1643     0.8766 0.956 0.000 0.044
#> GSM254625     3  0.6180     0.6772 0.416 0.000 0.584
#> GSM254636     1  0.0747     0.8973 0.984 0.000 0.016
#> GSM254659     1  0.6062    -0.0376 0.616 0.000 0.384
#> GSM254680     1  0.0592     0.8973 0.988 0.000 0.012
#> GSM254686     1  0.0592     0.8973 0.988 0.000 0.012
#> GSM254718     3  0.5760     0.7639 0.328 0.000 0.672
#> GSM254674     1  0.0592     0.8973 0.988 0.000 0.012
#> GSM254668     1  0.0592     0.8973 0.988 0.000 0.012
#> GSM254697     1  0.1289     0.8843 0.968 0.000 0.032
#> GSM254704     1  0.3941     0.7418 0.844 0.000 0.156
#> GSM254707     1  0.0592     0.8973 0.988 0.000 0.012
#> GSM254714     1  0.6111     0.0323 0.604 0.000 0.396
#> GSM254722     1  0.0747     0.8973 0.984 0.000 0.016
#> GSM254627     1  0.1289     0.8843 0.968 0.000 0.032
#> GSM254630     1  0.0592     0.8973 0.988 0.000 0.012
#> GSM254633     1  0.0747     0.8973 0.984 0.000 0.016
#> GSM254670     3  0.6286     0.6006 0.464 0.000 0.536
#> GSM254716     3  0.6235     0.6514 0.436 0.000 0.564
#> GSM254720     1  0.4235     0.7066 0.824 0.000 0.176
#> GSM254729     3  0.5291     0.7960 0.268 0.000 0.732
#> GSM254654     3  0.5138     0.7973 0.252 0.000 0.748
#> GSM254656     3  0.3879     0.7690 0.152 0.000 0.848
#> GSM254631     1  0.1031     0.8937 0.976 0.000 0.024
#> GSM254657     3  0.5621     0.7861 0.308 0.000 0.692
#> GSM254664     1  0.1643     0.8741 0.956 0.000 0.044
#> GSM254672     1  0.2878     0.8131 0.904 0.000 0.096
#> GSM254692     1  0.0592     0.8881 0.988 0.000 0.012
#> GSM254645     3  0.5650     0.7779 0.312 0.000 0.688
#> GSM254666     1  0.0892     0.8934 0.980 0.000 0.020
#> GSM254675     1  0.0424     0.8907 0.992 0.000 0.008
#> GSM254678     1  0.0747     0.8973 0.984 0.000 0.016
#> GSM254688     1  0.0592     0.8973 0.988 0.000 0.012
#> GSM254690     1  0.0747     0.8973 0.984 0.000 0.016
#> GSM254696     1  0.0892     0.8961 0.980 0.000 0.020
#> GSM254705     1  0.0592     0.8973 0.988 0.000 0.012
#> GSM254642     1  0.1163     0.8849 0.972 0.000 0.028
#> GSM254661     3  0.5465     0.7911 0.288 0.000 0.712
#> GSM254698     1  0.0892     0.8961 0.980 0.000 0.020
#> GSM254641     1  0.0237     0.8963 0.996 0.000 0.004
#> GSM254647     1  0.0237     0.8963 0.996 0.000 0.004
#> GSM254663     1  0.0000     0.8950 1.000 0.000 0.000
#> GSM254682     1  0.0592     0.8973 0.988 0.000 0.012
#> GSM254709     1  0.0424     0.8907 0.992 0.000 0.008
#> GSM254721     1  0.3941     0.7418 0.844 0.000 0.156
#> GSM254724     1  0.2448     0.8466 0.924 0.000 0.076
#> GSM254650     1  0.0237     0.8931 0.996 0.000 0.004
#> GSM254687     1  0.0000     0.8950 1.000 0.000 0.000
#> GSM254637     1  0.4235     0.7073 0.824 0.000 0.176
#> GSM254684     1  0.0892     0.8961 0.980 0.000 0.020
#> GSM254649     2  0.0000     0.9483 0.000 1.000 0.000
#> GSM254660     2  0.2356     0.9361 0.000 0.928 0.072
#> GSM254693     2  0.0000     0.9483 0.000 1.000 0.000
#> GSM254695     2  0.5138     0.8235 0.000 0.748 0.252
#> GSM254702     2  0.2356     0.9361 0.000 0.928 0.072
#> GSM254643     2  0.0000     0.9483 0.000 1.000 0.000
#> GSM254727     2  0.0000     0.9483 0.000 1.000 0.000
#> GSM254640     2  0.0747     0.9468 0.000 0.984 0.016
#> GSM254626     2  0.0000     0.9483 0.000 1.000 0.000
#> GSM254635     2  0.4931     0.8407 0.000 0.768 0.232
#> GSM254653     2  0.0000     0.9483 0.000 1.000 0.000
#> GSM254658     2  0.0000     0.9483 0.000 1.000 0.000
#> GSM254681     2  0.0000     0.9483 0.000 1.000 0.000
#> GSM254719     2  0.0000     0.9483 0.000 1.000 0.000
#> GSM254673     2  0.0000     0.9483 0.000 1.000 0.000
#> GSM254655     2  0.0000     0.9483 0.000 1.000 0.000
#> GSM254669     2  0.0000     0.9483 0.000 1.000 0.000
#> GSM254699     2  0.0000     0.9483 0.000 1.000 0.000
#> GSM254703     2  0.2356     0.9361 0.000 0.928 0.072
#> GSM254708     2  0.3941     0.8599 0.000 0.844 0.156
#> GSM254715     2  0.2356     0.9361 0.000 0.928 0.072
#> GSM254628     2  0.0000     0.9483 0.000 1.000 0.000
#> GSM254634     2  0.3267     0.9194 0.000 0.884 0.116
#> GSM254646     2  0.0000     0.9483 0.000 1.000 0.000
#> GSM254671     2  0.2356     0.9361 0.000 0.928 0.072
#> GSM254711     2  0.2356     0.9361 0.000 0.928 0.072
#> GSM254717     2  0.0000     0.9483 0.000 1.000 0.000
#> GSM254723     3  0.2796     0.7388 0.092 0.000 0.908
#> GSM254730     2  0.1289     0.9444 0.000 0.968 0.032
#> GSM254731     2  0.2356     0.9361 0.000 0.928 0.072
#> GSM254632     3  0.2711     0.7352 0.088 0.000 0.912
#> GSM254662     2  0.0000     0.9483 0.000 1.000 0.000
#> GSM254677     2  0.4887     0.8441 0.000 0.772 0.228
#> GSM254665     2  0.0000     0.9483 0.000 1.000 0.000
#> GSM254691     2  0.0592     0.9459 0.000 0.988 0.012
#> GSM254644     2  0.2165     0.9380 0.000 0.936 0.064
#> GSM254667     2  0.5216     0.7506 0.000 0.740 0.260
#> GSM254676     2  0.0237     0.9477 0.000 0.996 0.004
#> GSM254679     2  0.2448     0.9353 0.000 0.924 0.076
#> GSM254689     2  0.0000     0.9483 0.000 1.000 0.000
#> GSM254706     2  0.4178     0.8469 0.000 0.828 0.172
#> GSM254712     2  0.2356     0.9361 0.000 0.928 0.072
#> GSM254713     2  0.2356     0.9361 0.000 0.928 0.072
#> GSM254683     2  0.0237     0.9477 0.000 0.996 0.004
#> GSM254710     3  0.4902     0.6936 0.092 0.064 0.844
#> GSM254725     2  0.5058     0.8305 0.000 0.756 0.244
#> GSM254651     2  0.0237     0.9477 0.000 0.996 0.004
#> GSM254638     2  0.5138     0.8235 0.000 0.748 0.252
#> GSM254685     2  0.2356     0.9361 0.000 0.928 0.072

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM254629     3  0.7080    0.58345 0.196 0.000 0.568 0.236
#> GSM254648     3  0.2198    0.71795 0.072 0.000 0.920 0.008
#> GSM254694     3  0.2011    0.71932 0.080 0.000 0.920 0.000
#> GSM254701     3  0.7093    0.49647 0.272 0.000 0.556 0.172
#> GSM254728     3  0.6454    0.63998 0.380 0.000 0.544 0.076
#> GSM254726     3  0.4852    0.68666 0.072 0.000 0.776 0.152
#> GSM254639     3  0.6831    0.67436 0.352 0.000 0.536 0.112
#> GSM254652     3  0.7541    0.63897 0.388 0.000 0.424 0.188
#> GSM254700     1  0.7121    0.66112 0.544 0.000 0.164 0.292
#> GSM254625     3  0.7598    0.67399 0.324 0.000 0.460 0.216
#> GSM254636     1  0.2473    0.68760 0.908 0.000 0.080 0.012
#> GSM254659     1  0.5817    0.26054 0.676 0.000 0.248 0.076
#> GSM254680     1  0.3486    0.75904 0.812 0.000 0.000 0.188
#> GSM254686     1  0.0469    0.72338 0.988 0.000 0.000 0.012
#> GSM254718     3  0.6396    0.65208 0.360 0.000 0.564 0.076
#> GSM254674     1  0.0469    0.70967 0.988 0.000 0.000 0.012
#> GSM254668     1  0.2530    0.75721 0.888 0.000 0.000 0.112
#> GSM254697     1  0.7155    0.65862 0.540 0.000 0.168 0.292
#> GSM254704     1  0.6488    0.68246 0.604 0.000 0.104 0.292
#> GSM254707     1  0.0188    0.71458 0.996 0.000 0.000 0.004
#> GSM254714     3  0.7782   -0.11974 0.360 0.000 0.396 0.244
#> GSM254722     1  0.4352    0.67673 0.816 0.000 0.080 0.104
#> GSM254627     1  0.6770    0.68630 0.580 0.000 0.128 0.292
#> GSM254630     1  0.1940    0.65522 0.924 0.000 0.000 0.076
#> GSM254633     1  0.4549    0.75784 0.776 0.000 0.036 0.188
#> GSM254670     3  0.6409    0.65830 0.364 0.000 0.560 0.076
#> GSM254716     1  0.7544   -0.56558 0.460 0.000 0.340 0.200
#> GSM254720     1  0.6545    0.68651 0.632 0.000 0.152 0.216
#> GSM254729     3  0.3335    0.72870 0.128 0.000 0.856 0.016
#> GSM254654     3  0.2011    0.71932 0.080 0.000 0.920 0.000
#> GSM254656     3  0.3144    0.71735 0.072 0.000 0.884 0.044
#> GSM254631     1  0.5500    0.74243 0.708 0.000 0.068 0.224
#> GSM254657     3  0.6508    0.67776 0.344 0.000 0.568 0.088
#> GSM254664     1  0.5078    0.73862 0.700 0.000 0.028 0.272
#> GSM254672     1  0.4399    0.75494 0.760 0.000 0.016 0.224
#> GSM254692     1  0.4483    0.73246 0.712 0.000 0.004 0.284
#> GSM254645     3  0.6369    0.66980 0.352 0.000 0.572 0.076
#> GSM254666     1  0.2011    0.65204 0.920 0.000 0.000 0.080
#> GSM254675     1  0.4808    0.75234 0.736 0.000 0.028 0.236
#> GSM254678     1  0.2255    0.70725 0.920 0.000 0.068 0.012
#> GSM254688     1  0.0469    0.70967 0.988 0.000 0.000 0.012
#> GSM254690     1  0.2466    0.74431 0.916 0.000 0.028 0.056
#> GSM254696     1  0.4872    0.52509 0.776 0.000 0.148 0.076
#> GSM254705     1  0.1940    0.68003 0.924 0.000 0.000 0.076
#> GSM254642     1  0.6488    0.67882 0.604 0.000 0.104 0.292
#> GSM254661     3  0.7634    0.67012 0.340 0.000 0.444 0.216
#> GSM254698     1  0.3764    0.62773 0.852 0.000 0.072 0.076
#> GSM254641     1  0.3311    0.76018 0.828 0.000 0.000 0.172
#> GSM254647     1  0.3975    0.74884 0.760 0.000 0.000 0.240
#> GSM254663     1  0.3907    0.75105 0.768 0.000 0.000 0.232
#> GSM254682     1  0.1022    0.69621 0.968 0.000 0.000 0.032
#> GSM254709     1  0.4250    0.73641 0.724 0.000 0.000 0.276
#> GSM254721     1  0.6896    0.67336 0.568 0.000 0.140 0.292
#> GSM254724     1  0.6896    0.67336 0.568 0.000 0.140 0.292
#> GSM254650     1  0.2647    0.75760 0.880 0.000 0.000 0.120
#> GSM254687     1  0.2589    0.75698 0.884 0.000 0.000 0.116
#> GSM254637     1  0.6724    0.67339 0.612 0.000 0.164 0.224
#> GSM254684     1  0.4401    0.56201 0.812 0.000 0.112 0.076
#> GSM254649     2  0.0000    0.75254 0.000 1.000 0.000 0.000
#> GSM254660     2  0.1867    0.68668 0.000 0.928 0.000 0.072
#> GSM254693     2  0.0000    0.75254 0.000 1.000 0.000 0.000
#> GSM254695     4  0.6013    0.63829 0.000 0.312 0.064 0.624
#> GSM254702     2  0.3649    0.41467 0.000 0.796 0.000 0.204
#> GSM254643     2  0.0000    0.75254 0.000 1.000 0.000 0.000
#> GSM254727     2  0.0000    0.75254 0.000 1.000 0.000 0.000
#> GSM254640     2  0.0188    0.75126 0.000 0.996 0.000 0.004
#> GSM254626     2  0.0000    0.75254 0.000 1.000 0.000 0.000
#> GSM254635     2  0.4998   -0.75428 0.000 0.512 0.000 0.488
#> GSM254653     2  0.0000    0.75254 0.000 1.000 0.000 0.000
#> GSM254658     2  0.0000    0.75254 0.000 1.000 0.000 0.000
#> GSM254681     2  0.0336    0.75015 0.000 0.992 0.000 0.008
#> GSM254719     2  0.0000    0.75254 0.000 1.000 0.000 0.000
#> GSM254673     2  0.0000    0.75254 0.000 1.000 0.000 0.000
#> GSM254655     2  0.0000    0.75254 0.000 1.000 0.000 0.000
#> GSM254669     2  0.0000    0.75254 0.000 1.000 0.000 0.000
#> GSM254699     2  0.0000    0.75254 0.000 1.000 0.000 0.000
#> GSM254703     2  0.4830   -0.38126 0.000 0.608 0.000 0.392
#> GSM254708     2  0.3356    0.52879 0.000 0.824 0.000 0.176
#> GSM254715     2  0.4790   -0.34231 0.000 0.620 0.000 0.380
#> GSM254628     2  0.0000    0.75254 0.000 1.000 0.000 0.000
#> GSM254634     4  0.5000    0.73025 0.000 0.496 0.000 0.504
#> GSM254646     2  0.0336    0.75015 0.000 0.992 0.000 0.008
#> GSM254671     2  0.4761   -0.30463 0.000 0.628 0.000 0.372
#> GSM254711     2  0.4817   -0.36897 0.000 0.612 0.000 0.388
#> GSM254717     2  0.0000    0.75254 0.000 1.000 0.000 0.000
#> GSM254723     3  0.3693    0.70832 0.072 0.000 0.856 0.072
#> GSM254730     2  0.0592    0.74401 0.000 0.984 0.000 0.016
#> GSM254731     2  0.2973    0.56391 0.000 0.856 0.000 0.144
#> GSM254632     3  0.4944    0.68378 0.072 0.000 0.768 0.160
#> GSM254662     2  0.0000    0.75254 0.000 1.000 0.000 0.000
#> GSM254677     4  0.4989    0.79443 0.000 0.472 0.000 0.528
#> GSM254665     2  0.0469    0.74816 0.000 0.988 0.000 0.012
#> GSM254691     2  0.2011    0.68491 0.000 0.920 0.000 0.080
#> GSM254644     2  0.1637    0.70158 0.000 0.940 0.000 0.060
#> GSM254667     2  0.5057   -0.00966 0.000 0.648 0.012 0.340
#> GSM254676     2  0.1637    0.70817 0.000 0.940 0.000 0.060
#> GSM254679     2  0.4830   -0.38126 0.000 0.608 0.000 0.392
#> GSM254689     2  0.0336    0.75015 0.000 0.992 0.000 0.008
#> GSM254706     2  0.2469    0.64472 0.000 0.892 0.000 0.108
#> GSM254712     2  0.4830   -0.38126 0.000 0.608 0.000 0.392
#> GSM254713     2  0.4804   -0.35541 0.000 0.616 0.000 0.384
#> GSM254683     2  0.1940    0.69162 0.000 0.924 0.000 0.076
#> GSM254710     3  0.5033    0.67988 0.072 0.000 0.760 0.168
#> GSM254725     2  0.4999   -0.76328 0.000 0.508 0.000 0.492
#> GSM254651     2  0.0707    0.74336 0.000 0.980 0.000 0.020
#> GSM254638     4  0.4967    0.80193 0.000 0.452 0.000 0.548
#> GSM254685     2  0.3569    0.43929 0.000 0.804 0.000 0.196

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM254629     3  0.5579     0.3847 0.300 0.000 0.600 0.000 0.100
#> GSM254648     3  0.1408     0.6510 0.000 0.000 0.948 0.008 0.044
#> GSM254694     3  0.1251     0.6529 0.000 0.000 0.956 0.008 0.036
#> GSM254701     3  0.5775     0.1386 0.440 0.000 0.472 0.000 0.088
#> GSM254728     3  0.5941     0.4804 0.188 0.000 0.612 0.004 0.196
#> GSM254726     3  0.2104     0.6336 0.000 0.000 0.916 0.060 0.024
#> GSM254639     3  0.5077     0.5986 0.088 0.000 0.696 0.004 0.212
#> GSM254652     3  0.5505     0.5652 0.128 0.000 0.660 0.004 0.208
#> GSM254700     1  0.4262     0.2696 0.560 0.000 0.000 0.000 0.440
#> GSM254625     5  0.7020     0.2584 0.132 0.000 0.364 0.044 0.460
#> GSM254636     1  0.5435     0.4394 0.672 0.000 0.188 0.004 0.136
#> GSM254659     1  0.6553     0.1319 0.472 0.000 0.340 0.004 0.184
#> GSM254680     1  0.1478     0.4648 0.936 0.000 0.000 0.000 0.064
#> GSM254686     1  0.2648     0.4420 0.848 0.000 0.000 0.000 0.152
#> GSM254718     3  0.5707     0.4801 0.216 0.000 0.624 0.000 0.160
#> GSM254674     1  0.4499     0.4711 0.764 0.000 0.096 0.004 0.136
#> GSM254668     1  0.3966     0.1982 0.664 0.000 0.000 0.000 0.336
#> GSM254697     1  0.4300     0.2563 0.524 0.000 0.000 0.000 0.476
#> GSM254704     1  0.4522     0.2646 0.552 0.000 0.008 0.000 0.440
#> GSM254707     1  0.4171     0.1323 0.604 0.000 0.000 0.000 0.396
#> GSM254714     1  0.6172     0.1490 0.544 0.000 0.280 0.000 0.176
#> GSM254722     1  0.5135     0.4489 0.704 0.000 0.120 0.004 0.172
#> GSM254627     1  0.4300     0.2563 0.524 0.000 0.000 0.000 0.476
#> GSM254630     1  0.4291     0.0129 0.536 0.000 0.000 0.000 0.464
#> GSM254633     1  0.2462     0.5096 0.880 0.000 0.112 0.000 0.008
#> GSM254670     3  0.5393     0.5729 0.120 0.000 0.672 0.004 0.204
#> GSM254716     5  0.6990     0.3875 0.248 0.000 0.236 0.024 0.492
#> GSM254720     1  0.4094     0.4910 0.788 0.000 0.084 0.000 0.128
#> GSM254729     3  0.0865     0.6619 0.004 0.000 0.972 0.000 0.024
#> GSM254654     3  0.1569     0.6524 0.004 0.000 0.944 0.008 0.044
#> GSM254656     3  0.1018     0.6566 0.000 0.000 0.968 0.016 0.016
#> GSM254631     1  0.2773     0.5087 0.868 0.000 0.112 0.000 0.020
#> GSM254657     3  0.4702     0.6184 0.072 0.000 0.732 0.004 0.192
#> GSM254664     1  0.3109     0.4555 0.800 0.000 0.000 0.000 0.200
#> GSM254672     1  0.2969     0.4983 0.852 0.000 0.020 0.000 0.128
#> GSM254692     5  0.4291    -0.1090 0.464 0.000 0.000 0.000 0.536
#> GSM254645     3  0.4641     0.6251 0.080 0.000 0.744 0.004 0.172
#> GSM254666     1  0.4130     0.3018 0.696 0.000 0.012 0.000 0.292
#> GSM254675     1  0.2074     0.4979 0.896 0.000 0.000 0.000 0.104
#> GSM254678     1  0.4779     0.4750 0.740 0.000 0.144 0.004 0.112
#> GSM254688     1  0.4150     0.1433 0.612 0.000 0.000 0.000 0.388
#> GSM254690     1  0.4375     0.4930 0.776 0.000 0.116 0.004 0.104
#> GSM254696     1  0.6417     0.2775 0.528 0.000 0.272 0.004 0.196
#> GSM254705     1  0.4437     0.0305 0.532 0.000 0.000 0.004 0.464
#> GSM254642     1  0.4300     0.2563 0.524 0.000 0.000 0.000 0.476
#> GSM254661     3  0.5410     0.6104 0.080 0.000 0.692 0.024 0.204
#> GSM254698     1  0.6130     0.3517 0.584 0.000 0.216 0.004 0.196
#> GSM254641     1  0.0671     0.4883 0.980 0.000 0.004 0.000 0.016
#> GSM254647     1  0.2471     0.4905 0.864 0.000 0.000 0.000 0.136
#> GSM254663     1  0.3480     0.2594 0.752 0.000 0.000 0.000 0.248
#> GSM254682     1  0.4375     0.0856 0.576 0.000 0.004 0.000 0.420
#> GSM254709     1  0.3752     0.2173 0.708 0.000 0.000 0.000 0.292
#> GSM254721     1  0.4262     0.2696 0.560 0.000 0.000 0.000 0.440
#> GSM254724     1  0.4262     0.2696 0.560 0.000 0.000 0.000 0.440
#> GSM254650     1  0.4126     0.1447 0.620 0.000 0.000 0.000 0.380
#> GSM254687     1  0.4138     0.1431 0.616 0.000 0.000 0.000 0.384
#> GSM254637     1  0.4159     0.4803 0.776 0.000 0.156 0.000 0.068
#> GSM254684     1  0.6442     0.2680 0.524 0.000 0.272 0.004 0.200
#> GSM254649     2  0.0162     0.7737 0.000 0.996 0.000 0.000 0.004
#> GSM254660     2  0.4238     0.0437 0.000 0.628 0.000 0.368 0.004
#> GSM254693     2  0.0000     0.7739 0.000 1.000 0.000 0.000 0.000
#> GSM254695     4  0.1168     0.5937 0.000 0.032 0.008 0.960 0.000
#> GSM254702     2  0.4114    -0.0078 0.000 0.624 0.000 0.376 0.000
#> GSM254643     2  0.1282     0.7628 0.000 0.952 0.000 0.044 0.004
#> GSM254727     2  0.0162     0.7737 0.000 0.996 0.000 0.000 0.004
#> GSM254640     2  0.1270     0.7381 0.000 0.948 0.000 0.052 0.000
#> GSM254626     2  0.0000     0.7739 0.000 1.000 0.000 0.000 0.000
#> GSM254635     4  0.2561     0.6755 0.000 0.144 0.000 0.856 0.000
#> GSM254653     2  0.0162     0.7737 0.000 0.996 0.000 0.000 0.004
#> GSM254658     2  0.0324     0.7721 0.000 0.992 0.000 0.004 0.004
#> GSM254681     2  0.2124     0.7348 0.000 0.900 0.000 0.096 0.004
#> GSM254719     2  0.0000     0.7739 0.000 1.000 0.000 0.000 0.000
#> GSM254673     2  0.0000     0.7739 0.000 1.000 0.000 0.000 0.000
#> GSM254655     2  0.0000     0.7739 0.000 1.000 0.000 0.000 0.000
#> GSM254669     2  0.0000     0.7739 0.000 1.000 0.000 0.000 0.000
#> GSM254699     2  0.0000     0.7739 0.000 1.000 0.000 0.000 0.000
#> GSM254703     4  0.4045     0.5565 0.000 0.356 0.000 0.644 0.000
#> GSM254708     2  0.4235     0.1321 0.000 0.576 0.000 0.424 0.000
#> GSM254715     2  0.4403    -0.1722 0.000 0.560 0.000 0.436 0.004
#> GSM254628     2  0.0324     0.7721 0.000 0.992 0.000 0.004 0.004
#> GSM254634     4  0.3003     0.6697 0.000 0.188 0.000 0.812 0.000
#> GSM254646     2  0.1952     0.7427 0.000 0.912 0.000 0.084 0.004
#> GSM254671     2  0.4294    -0.2490 0.000 0.532 0.000 0.468 0.000
#> GSM254711     4  0.4283     0.3860 0.000 0.456 0.000 0.544 0.000
#> GSM254717     2  0.0865     0.7693 0.000 0.972 0.000 0.024 0.004
#> GSM254723     3  0.1914     0.6381 0.000 0.000 0.924 0.060 0.016
#> GSM254730     2  0.0404     0.7700 0.000 0.988 0.000 0.012 0.000
#> GSM254731     2  0.4126    -0.0196 0.000 0.620 0.000 0.380 0.000
#> GSM254632     3  0.2171     0.6307 0.000 0.000 0.912 0.064 0.024
#> GSM254662     2  0.0162     0.7742 0.000 0.996 0.000 0.004 0.000
#> GSM254677     4  0.2127     0.6598 0.000 0.108 0.000 0.892 0.000
#> GSM254665     2  0.2536     0.7062 0.000 0.868 0.000 0.128 0.004
#> GSM254691     2  0.3074     0.6220 0.000 0.804 0.000 0.196 0.000
#> GSM254644     2  0.4047     0.1889 0.000 0.676 0.000 0.320 0.004
#> GSM254667     4  0.4306    -0.0335 0.000 0.492 0.000 0.508 0.000
#> GSM254676     2  0.2648     0.6772 0.000 0.848 0.000 0.152 0.000
#> GSM254679     4  0.4242     0.4395 0.000 0.428 0.000 0.572 0.000
#> GSM254689     2  0.2124     0.7348 0.000 0.900 0.000 0.096 0.004
#> GSM254706     2  0.3916     0.5119 0.000 0.732 0.000 0.256 0.012
#> GSM254712     4  0.4060     0.5512 0.000 0.360 0.000 0.640 0.000
#> GSM254713     4  0.4452     0.2959 0.000 0.496 0.000 0.500 0.004
#> GSM254683     2  0.2953     0.6801 0.000 0.844 0.000 0.144 0.012
#> GSM254710     3  0.6115     0.3196 0.000 0.156 0.668 0.104 0.072
#> GSM254725     4  0.3143     0.6685 0.000 0.204 0.000 0.796 0.000
#> GSM254651     2  0.2677     0.7098 0.000 0.872 0.000 0.112 0.016
#> GSM254638     4  0.1544     0.6461 0.000 0.068 0.000 0.932 0.000
#> GSM254685     2  0.4367    -0.1090 0.000 0.580 0.000 0.416 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
#> GSM254629     3  0.5516     0.2416 0.232 0.000 0.640 0.004 0.048 0.076
#> GSM254648     6  0.4039     0.9048 0.008 0.000 0.424 0.000 0.000 0.568
#> GSM254694     3  0.4118    -0.5932 0.008 0.000 0.592 0.004 0.000 0.396
#> GSM254701     3  0.6027     0.2904 0.260 0.000 0.560 0.004 0.148 0.028
#> GSM254728     3  0.3481     0.5931 0.000 0.000 0.804 0.000 0.124 0.072
#> GSM254726     6  0.3797     0.9131 0.000 0.000 0.420 0.000 0.000 0.580
#> GSM254639     3  0.3843     0.5795 0.004 0.000 0.784 0.000 0.104 0.108
#> GSM254652     3  0.2302     0.5937 0.000 0.000 0.872 0.000 0.120 0.008
#> GSM254700     1  0.1588     0.5948 0.924 0.000 0.004 0.000 0.072 0.000
#> GSM254625     5  0.4482    -0.1228 0.000 0.000 0.416 0.000 0.552 0.032
#> GSM254636     5  0.6997     0.2462 0.148 0.000 0.328 0.000 0.416 0.108
#> GSM254659     3  0.5136     0.5026 0.020 0.000 0.656 0.000 0.224 0.100
#> GSM254680     5  0.4326     0.1908 0.300 0.000 0.044 0.000 0.656 0.000
#> GSM254686     5  0.2794     0.5251 0.080 0.000 0.060 0.000 0.860 0.000
#> GSM254718     3  0.3830     0.5581 0.040 0.000 0.800 0.004 0.132 0.024
#> GSM254674     5  0.4740     0.4174 0.108 0.000 0.228 0.000 0.664 0.000
#> GSM254668     5  0.1219     0.5381 0.048 0.000 0.004 0.000 0.948 0.000
#> GSM254697     1  0.2318     0.5913 0.892 0.000 0.044 0.000 0.064 0.000
#> GSM254704     1  0.1982     0.5918 0.912 0.000 0.016 0.004 0.068 0.000
#> GSM254707     5  0.0260     0.5655 0.000 0.000 0.008 0.000 0.992 0.000
#> GSM254714     1  0.6201     0.2355 0.396 0.000 0.292 0.004 0.308 0.000
#> GSM254722     5  0.6056     0.1022 0.296 0.000 0.292 0.000 0.412 0.000
#> GSM254627     1  0.2318     0.5913 0.892 0.000 0.044 0.000 0.064 0.000
#> GSM254630     5  0.0935     0.5617 0.004 0.000 0.032 0.000 0.964 0.000
#> GSM254633     5  0.5871    -0.2565 0.408 0.000 0.168 0.000 0.420 0.004
#> GSM254670     3  0.3930     0.5799 0.004 0.000 0.776 0.000 0.116 0.104
#> GSM254716     5  0.4219    -0.0755 0.000 0.000 0.388 0.000 0.592 0.020
#> GSM254720     1  0.5319     0.3502 0.504 0.000 0.108 0.000 0.388 0.000
#> GSM254729     3  0.2980     0.1916 0.000 0.000 0.808 0.000 0.012 0.180
#> GSM254654     3  0.4144    -0.6230 0.008 0.000 0.580 0.004 0.000 0.408
#> GSM254656     6  0.4204     0.8660 0.008 0.000 0.448 0.000 0.004 0.540
#> GSM254631     1  0.5353     0.2905 0.472 0.000 0.108 0.000 0.420 0.000
#> GSM254657     3  0.2191     0.5896 0.000 0.000 0.876 0.000 0.120 0.004
#> GSM254664     1  0.4343     0.4226 0.592 0.000 0.028 0.000 0.380 0.000
#> GSM254672     1  0.5414     0.3008 0.468 0.000 0.116 0.000 0.416 0.000
#> GSM254692     1  0.3810     0.1787 0.572 0.000 0.000 0.000 0.428 0.000
#> GSM254645     3  0.3023     0.5711 0.000 0.000 0.836 0.000 0.120 0.044
#> GSM254666     5  0.1844     0.5645 0.024 0.000 0.048 0.000 0.924 0.004
#> GSM254675     1  0.4639     0.3190 0.512 0.000 0.040 0.000 0.448 0.000
#> GSM254678     5  0.6141     0.1622 0.244 0.000 0.292 0.000 0.456 0.008
#> GSM254688     5  0.0146     0.5641 0.000 0.000 0.004 0.000 0.996 0.000
#> GSM254690     5  0.6019     0.0800 0.300 0.000 0.232 0.000 0.464 0.004
#> GSM254696     3  0.6911    -0.2658 0.128 0.000 0.396 0.000 0.368 0.108
#> GSM254705     5  0.1327     0.5569 0.000 0.000 0.064 0.000 0.936 0.000
#> GSM254642     1  0.2318     0.5913 0.892 0.000 0.044 0.000 0.064 0.000
#> GSM254661     3  0.3285     0.5507 0.000 0.000 0.820 0.000 0.116 0.064
#> GSM254698     5  0.6981     0.2551 0.140 0.000 0.364 0.000 0.388 0.108
#> GSM254641     5  0.5007    -0.1884 0.416 0.000 0.072 0.000 0.512 0.000
#> GSM254647     1  0.4925     0.3427 0.512 0.000 0.064 0.000 0.424 0.000
#> GSM254663     5  0.3470     0.3557 0.200 0.000 0.028 0.000 0.772 0.000
#> GSM254682     5  0.0363     0.5642 0.000 0.000 0.012 0.000 0.988 0.000
#> GSM254709     5  0.3309     0.3758 0.192 0.000 0.016 0.004 0.788 0.000
#> GSM254721     1  0.2011     0.5892 0.912 0.000 0.020 0.004 0.064 0.000
#> GSM254724     1  0.2011     0.5892 0.912 0.000 0.020 0.004 0.064 0.000
#> GSM254650     5  0.0547     0.5558 0.020 0.000 0.000 0.000 0.980 0.000
#> GSM254687     5  0.0291     0.5644 0.004 0.000 0.004 0.000 0.992 0.000
#> GSM254637     1  0.5542     0.3315 0.492 0.000 0.120 0.004 0.384 0.000
#> GSM254684     5  0.6809     0.1507 0.112 0.000 0.388 0.000 0.392 0.108
#> GSM254649     2  0.0972     0.7815 0.008 0.964 0.000 0.000 0.000 0.028
#> GSM254660     2  0.4141     0.2432 0.008 0.676 0.000 0.296 0.000 0.020
#> GSM254693     2  0.0000     0.7833 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM254695     4  0.1858     0.5850 0.004 0.000 0.000 0.904 0.000 0.092
#> GSM254702     2  0.3955    -0.2359 0.000 0.560 0.000 0.436 0.000 0.004
#> GSM254643     2  0.1434     0.7749 0.008 0.948 0.000 0.024 0.000 0.020
#> GSM254727     2  0.1053     0.7817 0.012 0.964 0.000 0.004 0.000 0.020
#> GSM254640     2  0.1173     0.7788 0.008 0.960 0.000 0.016 0.000 0.016
#> GSM254626     2  0.0291     0.7836 0.000 0.992 0.000 0.004 0.000 0.004
#> GSM254635     4  0.1610     0.6999 0.000 0.084 0.000 0.916 0.000 0.000
#> GSM254653     2  0.0603     0.7829 0.004 0.980 0.000 0.000 0.000 0.016
#> GSM254658     2  0.1036     0.7812 0.008 0.964 0.000 0.004 0.000 0.024
#> GSM254681     2  0.4434     0.5867 0.008 0.684 0.000 0.048 0.000 0.260
#> GSM254719     2  0.0291     0.7827 0.000 0.992 0.000 0.004 0.000 0.004
#> GSM254673     2  0.0146     0.7830 0.000 0.996 0.000 0.004 0.000 0.000
#> GSM254655     2  0.0291     0.7827 0.000 0.992 0.000 0.004 0.000 0.004
#> GSM254669     2  0.0291     0.7832 0.004 0.992 0.000 0.004 0.000 0.000
#> GSM254699     2  0.0291     0.7827 0.000 0.992 0.000 0.004 0.000 0.004
#> GSM254703     4  0.2631     0.6910 0.000 0.180 0.000 0.820 0.000 0.000
#> GSM254708     2  0.4384     0.1748 0.004 0.520 0.000 0.460 0.000 0.016
#> GSM254715     4  0.4387     0.5440 0.004 0.404 0.000 0.572 0.000 0.020
#> GSM254628     2  0.1036     0.7812 0.008 0.964 0.000 0.004 0.000 0.024
#> GSM254634     4  0.1700     0.6975 0.004 0.080 0.000 0.916 0.000 0.000
#> GSM254646     2  0.4178     0.6007 0.008 0.700 0.000 0.032 0.000 0.260
#> GSM254671     4  0.3966     0.4782 0.004 0.444 0.000 0.552 0.000 0.000
#> GSM254711     4  0.3969     0.6106 0.004 0.344 0.000 0.644 0.000 0.008
#> GSM254717     2  0.1592     0.7746 0.008 0.940 0.000 0.032 0.000 0.020
#> GSM254723     6  0.3797     0.9131 0.000 0.000 0.420 0.000 0.000 0.580
#> GSM254730     2  0.0653     0.7803 0.004 0.980 0.000 0.012 0.000 0.004
#> GSM254731     2  0.3950    -0.2245 0.000 0.564 0.000 0.432 0.000 0.004
#> GSM254632     6  0.3797     0.9131 0.000 0.000 0.420 0.000 0.000 0.580
#> GSM254662     2  0.0405     0.7835 0.004 0.988 0.000 0.008 0.000 0.000
#> GSM254677     4  0.1584     0.6933 0.000 0.064 0.000 0.928 0.000 0.008
#> GSM254665     2  0.3212     0.6443 0.004 0.800 0.000 0.180 0.000 0.016
#> GSM254691     2  0.3969     0.4294 0.004 0.644 0.000 0.344 0.000 0.008
#> GSM254644     2  0.3313     0.6017 0.008 0.808 0.000 0.160 0.000 0.024
#> GSM254667     4  0.5656     0.0471 0.000 0.380 0.004 0.480 0.000 0.136
#> GSM254676     2  0.3672     0.5329 0.004 0.712 0.000 0.276 0.000 0.008
#> GSM254679     4  0.3756     0.6046 0.004 0.352 0.000 0.644 0.000 0.000
#> GSM254689     2  0.4373     0.5901 0.008 0.688 0.000 0.044 0.000 0.260
#> GSM254706     2  0.4732     0.3522 0.004 0.588 0.000 0.360 0.000 0.048
#> GSM254712     4  0.3673     0.6681 0.004 0.244 0.000 0.736 0.000 0.016
#> GSM254713     4  0.4446     0.5647 0.008 0.384 0.000 0.588 0.000 0.020
#> GSM254683     2  0.5287     0.3999 0.004 0.588 0.000 0.288 0.000 0.120
#> GSM254710     6  0.5034     0.6787 0.008 0.044 0.280 0.004 0.016 0.648
#> GSM254725     4  0.1644     0.6955 0.000 0.076 0.000 0.920 0.000 0.004
#> GSM254651     2  0.2288     0.7518 0.004 0.896 0.000 0.072 0.000 0.028
#> GSM254638     4  0.0603     0.6553 0.000 0.016 0.000 0.980 0.000 0.004
#> GSM254685     4  0.4516     0.5064 0.008 0.420 0.000 0.552 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-MAD-mclust-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-MAD-mclust-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-MAD-mclust-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-MAD-mclust-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-MAD-mclust-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-MAD-mclust-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-MAD-mclust-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-MAD-mclust-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-MAD-mclust-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-MAD-mclust-membership-heatmap-5

As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

plot of chunk tab-MAD-mclust-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-MAD-mclust-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-MAD-mclust-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-MAD-mclust-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-MAD-mclust-get-signatures-5

Signature heatmaps where rows are not scaled:

get_signatures(res, k = 2, scale_rows = FALSE)

plot of chunk tab-MAD-mclust-get-signatures-no-scale-1

get_signatures(res, k = 3, scale_rows = FALSE)

plot of chunk tab-MAD-mclust-get-signatures-no-scale-2

get_signatures(res, k = 4, scale_rows = FALSE)

plot of chunk tab-MAD-mclust-get-signatures-no-scale-3

get_signatures(res, k = 5, scale_rows = FALSE)

plot of chunk tab-MAD-mclust-get-signatures-no-scale-4

get_signatures(res, k = 6, scale_rows = FALSE)

plot of chunk tab-MAD-mclust-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk MAD-mclust-signature_compare

get_signature() returns a data frame invisibly. TO get the list of signatures, the function call should be assigned to a variable explicitly. In following code, if plot argument is set to FALSE, no heatmap is plotted while only the differential analysis is performed.

# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)

An example of the output of tb is:

#>   which_row         fdr    mean_1    mean_2 scaled_mean_1 scaled_mean_2 km
#> 1        38 0.042760348  8.373488  9.131774    -0.5533452     0.5164555  1
#> 2        40 0.018707592  7.106213  8.469186    -0.6173731     0.5762149  1
#> 3        55 0.019134737 10.221463 11.207825    -0.6159697     0.5749050  1
#> 4        59 0.006059896  5.921854  7.869574    -0.6899429     0.6439467  1
#> 5        60 0.018055526  8.928898 10.211722    -0.6204761     0.5791110  1
#> 6        98 0.009384629 15.714769 14.887706     0.6635654    -0.6193277  2
...

The columns in tb are:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. km: Row groups if k-means clustering is applied to rows.

UMAP plot which shows how samples are separated.

dimension_reduction(res, k = 2, method = "UMAP")

plot of chunk tab-MAD-mclust-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-MAD-mclust-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-MAD-mclust-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-MAD-mclust-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-MAD-mclust-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk MAD-mclust-collect-classes

Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.

test_to_known_factors(res)
#>              n tissue(p) individual(p) disease.state(p) gender(p) other(p) k
#> MAD:mclust 107  1.00e-21        0.6404            0.454     0.733    0.961 2
#> MAD:mclust 103  6.81e-21        0.0168            0.575     0.371    0.962 3
#> MAD:mclust  91  2.36e-17        0.0205            0.603     0.345    0.731 4
#> MAD:mclust  50  5.13e-09        0.4549            0.812     0.580    0.867 5
#> MAD:mclust  69  3.14e-12        0.2633            0.491     0.420    0.693 6

If matrix rows can be associated to genes, consider to use functional_enrichment(res, ...) to perform function enrichment for the signature genes. See this vignette for more detailed explanations.


MAD:NMF**

The object with results only for a single top-value method and a single partition method can be extracted as:

res = res_list["MAD", "NMF"]
# you can also extract it by
# res = res_list["MAD:NMF"]

A summary of res and all the functions that can be applied to it:

res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#>   On a matrix with 21168 rows and 107 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'MAD' method.
#>   Subgroups are detected by 'NMF' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 2.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

collect_plots() function collects all the plots made from res for all k (number of partitions) into one single page to provide an easy and fast comparison between different k.

collect_plots(res)

plot of chunk MAD-NMF-collect-plots

The plots are:

All the plots in panels can be made by individual functions and they are plotted later in this section.

select_partition_number() produces several plots showing different statistics for choosing “optimized” k. There are following statistics:

The detailed explanations of these statistics can be found in the cola vignette.

Generally speaking, lower PAC score, higher mean silhouette score or higher concordance corresponds to better partition. Rand index and Jaccard index measure how similar the current partition is compared to partition with k-1. If they are too similar, we won't accept k is better than k-1.

select_partition_number(res)

plot of chunk MAD-NMF-select-partition-number

The numeric values for all these statistics can be obtained by get_stats().

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 1.000           0.975       0.989         0.5034 0.497   0.497
#> 3 3 0.618           0.632       0.804         0.2293 0.962   0.924
#> 4 4 0.626           0.735       0.843         0.1343 0.813   0.609
#> 5 5 0.675           0.647       0.763         0.0665 0.838   0.562
#> 6 6 0.705           0.629       0.801         0.0463 0.929   0.748

suggest_best_k() suggests the best \(k\) based on these statistics. The rules are as follows:

suggest_best_k(res)
#> [1] 2

Following shows the table of the partitions (You need to click the show/hide code output link to see it). The membership matrix (columns with name p*) is inferred by clue::cl_consensus() function with the SE method. Basically the value in the membership matrix represents the probability to belong to a certain group. The finall class label for an item is determined with the group with highest probability it belongs to.

In get_classes() function, the entropy is calculated from the membership matrix and the silhouette score is calculated from the consensus matrix.

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>           class entropy silhouette    p1    p2
#> GSM254629     1  0.0000      0.984 1.000 0.000
#> GSM254648     2  0.0938      0.982 0.012 0.988
#> GSM254694     1  0.7299      0.748 0.796 0.204
#> GSM254701     1  0.0000      0.984 1.000 0.000
#> GSM254728     1  0.0000      0.984 1.000 0.000
#> GSM254726     1  0.7056      0.766 0.808 0.192
#> GSM254639     1  0.0000      0.984 1.000 0.000
#> GSM254652     1  0.0000      0.984 1.000 0.000
#> GSM254700     1  0.0000      0.984 1.000 0.000
#> GSM254625     1  0.0000      0.984 1.000 0.000
#> GSM254636     1  0.0000      0.984 1.000 0.000
#> GSM254659     1  0.0000      0.984 1.000 0.000
#> GSM254680     1  0.0000      0.984 1.000 0.000
#> GSM254686     1  0.0000      0.984 1.000 0.000
#> GSM254718     1  0.0000      0.984 1.000 0.000
#> GSM254674     1  0.0000      0.984 1.000 0.000
#> GSM254668     1  0.0000      0.984 1.000 0.000
#> GSM254697     1  0.0000      0.984 1.000 0.000
#> GSM254704     1  0.0000      0.984 1.000 0.000
#> GSM254707     1  0.0000      0.984 1.000 0.000
#> GSM254714     1  0.0000      0.984 1.000 0.000
#> GSM254722     1  0.0000      0.984 1.000 0.000
#> GSM254627     1  0.0000      0.984 1.000 0.000
#> GSM254630     1  0.0000      0.984 1.000 0.000
#> GSM254633     1  0.0000      0.984 1.000 0.000
#> GSM254670     1  0.0000      0.984 1.000 0.000
#> GSM254716     1  0.0000      0.984 1.000 0.000
#> GSM254720     1  0.0000      0.984 1.000 0.000
#> GSM254729     1  0.0000      0.984 1.000 0.000
#> GSM254654     1  0.6148      0.821 0.848 0.152
#> GSM254656     1  0.9000      0.545 0.684 0.316
#> GSM254631     1  0.0000      0.984 1.000 0.000
#> GSM254657     1  0.0000      0.984 1.000 0.000
#> GSM254664     1  0.0000      0.984 1.000 0.000
#> GSM254672     1  0.0000      0.984 1.000 0.000
#> GSM254692     1  0.0000      0.984 1.000 0.000
#> GSM254645     1  0.0000      0.984 1.000 0.000
#> GSM254666     1  0.0000      0.984 1.000 0.000
#> GSM254675     1  0.0000      0.984 1.000 0.000
#> GSM254678     1  0.0000      0.984 1.000 0.000
#> GSM254688     1  0.0000      0.984 1.000 0.000
#> GSM254690     1  0.0000      0.984 1.000 0.000
#> GSM254696     1  0.0000      0.984 1.000 0.000
#> GSM254705     1  0.0000      0.984 1.000 0.000
#> GSM254642     1  0.0000      0.984 1.000 0.000
#> GSM254661     1  0.0000      0.984 1.000 0.000
#> GSM254698     1  0.0000      0.984 1.000 0.000
#> GSM254641     1  0.0000      0.984 1.000 0.000
#> GSM254647     1  0.0000      0.984 1.000 0.000
#> GSM254663     1  0.0000      0.984 1.000 0.000
#> GSM254682     1  0.0000      0.984 1.000 0.000
#> GSM254709     1  0.0000      0.984 1.000 0.000
#> GSM254721     1  0.0000      0.984 1.000 0.000
#> GSM254724     1  0.0000      0.984 1.000 0.000
#> GSM254650     1  0.0000      0.984 1.000 0.000
#> GSM254687     1  0.0000      0.984 1.000 0.000
#> GSM254637     1  0.0000      0.984 1.000 0.000
#> GSM254684     1  0.0000      0.984 1.000 0.000
#> GSM254649     2  0.0000      0.993 0.000 1.000
#> GSM254660     2  0.0000      0.993 0.000 1.000
#> GSM254693     2  0.0000      0.993 0.000 1.000
#> GSM254695     2  0.0000      0.993 0.000 1.000
#> GSM254702     2  0.0000      0.993 0.000 1.000
#> GSM254643     2  0.0000      0.993 0.000 1.000
#> GSM254727     2  0.0000      0.993 0.000 1.000
#> GSM254640     2  0.0000      0.993 0.000 1.000
#> GSM254626     2  0.0000      0.993 0.000 1.000
#> GSM254635     2  0.0000      0.993 0.000 1.000
#> GSM254653     2  0.0000      0.993 0.000 1.000
#> GSM254658     2  0.0000      0.993 0.000 1.000
#> GSM254681     2  0.0000      0.993 0.000 1.000
#> GSM254719     2  0.0000      0.993 0.000 1.000
#> GSM254673     2  0.0000      0.993 0.000 1.000
#> GSM254655     2  0.0000      0.993 0.000 1.000
#> GSM254669     2  0.0000      0.993 0.000 1.000
#> GSM254699     2  0.0000      0.993 0.000 1.000
#> GSM254703     2  0.0000      0.993 0.000 1.000
#> GSM254708     2  0.0000      0.993 0.000 1.000
#> GSM254715     2  0.0000      0.993 0.000 1.000
#> GSM254628     2  0.0000      0.993 0.000 1.000
#> GSM254634     2  0.0000      0.993 0.000 1.000
#> GSM254646     2  0.0000      0.993 0.000 1.000
#> GSM254671     2  0.0000      0.993 0.000 1.000
#> GSM254711     2  0.0000      0.993 0.000 1.000
#> GSM254717     2  0.0000      0.993 0.000 1.000
#> GSM254723     2  0.0376      0.990 0.004 0.996
#> GSM254730     2  0.0000      0.993 0.000 1.000
#> GSM254731     2  0.0000      0.993 0.000 1.000
#> GSM254632     2  0.8555      0.599 0.280 0.720
#> GSM254662     2  0.0000      0.993 0.000 1.000
#> GSM254677     2  0.0000      0.993 0.000 1.000
#> GSM254665     2  0.0000      0.993 0.000 1.000
#> GSM254691     2  0.0000      0.993 0.000 1.000
#> GSM254644     2  0.0000      0.993 0.000 1.000
#> GSM254667     2  0.0000      0.993 0.000 1.000
#> GSM254676     2  0.0000      0.993 0.000 1.000
#> GSM254679     2  0.0000      0.993 0.000 1.000
#> GSM254689     2  0.0000      0.993 0.000 1.000
#> GSM254706     2  0.0000      0.993 0.000 1.000
#> GSM254712     2  0.0000      0.993 0.000 1.000
#> GSM254713     2  0.0000      0.993 0.000 1.000
#> GSM254683     2  0.0000      0.993 0.000 1.000
#> GSM254710     2  0.1414      0.974 0.020 0.980
#> GSM254725     2  0.0000      0.993 0.000 1.000
#> GSM254651     2  0.0000      0.993 0.000 1.000
#> GSM254638     2  0.0000      0.993 0.000 1.000
#> GSM254685     2  0.0000      0.993 0.000 1.000

show/hide code output

cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#>           class entropy silhouette    p1    p2    p3
#> GSM254629     1  0.4750     0.5557 0.784 0.000 0.216
#> GSM254648     2  0.6973     0.3232 0.020 0.564 0.416
#> GSM254694     1  0.8141     0.2297 0.624 0.116 0.260
#> GSM254701     1  0.1289     0.7694 0.968 0.000 0.032
#> GSM254728     1  0.5291     0.6447 0.732 0.000 0.268
#> GSM254726     1  0.9891    -0.2531 0.404 0.316 0.280
#> GSM254639     3  0.6302    -0.3609 0.480 0.000 0.520
#> GSM254652     1  0.5327     0.6250 0.728 0.000 0.272
#> GSM254700     1  0.0237     0.7725 0.996 0.000 0.004
#> GSM254625     1  0.5882     0.4506 0.652 0.000 0.348
#> GSM254636     1  0.5397     0.6279 0.720 0.000 0.280
#> GSM254659     1  0.2448     0.7650 0.924 0.000 0.076
#> GSM254680     1  0.0000     0.7730 1.000 0.000 0.000
#> GSM254686     1  0.0424     0.7717 0.992 0.000 0.008
#> GSM254718     1  0.4796     0.6112 0.780 0.000 0.220
#> GSM254674     1  0.1289     0.7743 0.968 0.000 0.032
#> GSM254668     1  0.0424     0.7717 0.992 0.000 0.008
#> GSM254697     1  0.1031     0.7746 0.976 0.000 0.024
#> GSM254704     1  0.0747     0.7729 0.984 0.000 0.016
#> GSM254707     1  0.3116     0.7448 0.892 0.000 0.108
#> GSM254714     1  0.0747     0.7729 0.984 0.000 0.016
#> GSM254722     1  0.4504     0.6968 0.804 0.000 0.196
#> GSM254627     1  0.0424     0.7734 0.992 0.000 0.008
#> GSM254630     1  0.4002     0.7236 0.840 0.000 0.160
#> GSM254633     1  0.0892     0.7733 0.980 0.000 0.020
#> GSM254670     1  0.6062     0.4853 0.616 0.000 0.384
#> GSM254716     3  0.6095    -0.1795 0.392 0.000 0.608
#> GSM254720     1  0.0892     0.7723 0.980 0.000 0.020
#> GSM254729     1  0.6483     0.2684 0.544 0.004 0.452
#> GSM254654     1  0.7295     0.3519 0.676 0.072 0.252
#> GSM254656     3  0.8295     0.0299 0.088 0.364 0.548
#> GSM254631     1  0.0592     0.7732 0.988 0.000 0.012
#> GSM254657     1  0.6302     0.2574 0.520 0.000 0.480
#> GSM254664     1  0.0000     0.7730 1.000 0.000 0.000
#> GSM254672     1  0.2796     0.7349 0.908 0.000 0.092
#> GSM254692     1  0.2448     0.7307 0.924 0.000 0.076
#> GSM254645     1  0.6235     0.3552 0.564 0.000 0.436
#> GSM254666     1  0.4796     0.6814 0.780 0.000 0.220
#> GSM254675     1  0.0592     0.7732 0.988 0.000 0.012
#> GSM254678     1  0.3192     0.7531 0.888 0.000 0.112
#> GSM254688     1  0.4452     0.7071 0.808 0.000 0.192
#> GSM254690     1  0.3267     0.7433 0.884 0.000 0.116
#> GSM254696     1  0.5785     0.5670 0.668 0.000 0.332
#> GSM254705     1  0.4654     0.7001 0.792 0.000 0.208
#> GSM254642     1  0.1031     0.7715 0.976 0.000 0.024
#> GSM254661     1  0.5327     0.6250 0.728 0.000 0.272
#> GSM254698     1  0.5621     0.5963 0.692 0.000 0.308
#> GSM254641     1  0.0000     0.7730 1.000 0.000 0.000
#> GSM254647     1  0.0747     0.7746 0.984 0.000 0.016
#> GSM254663     1  0.0747     0.7716 0.984 0.000 0.016
#> GSM254682     1  0.5178     0.6478 0.744 0.000 0.256
#> GSM254709     1  0.6079     0.2284 0.612 0.000 0.388
#> GSM254721     1  0.0237     0.7725 0.996 0.000 0.004
#> GSM254724     1  0.0237     0.7725 0.996 0.000 0.004
#> GSM254650     1  0.5810     0.3382 0.664 0.000 0.336
#> GSM254687     1  0.5016     0.5195 0.760 0.000 0.240
#> GSM254637     1  0.1031     0.7716 0.976 0.000 0.024
#> GSM254684     1  0.5560     0.6048 0.700 0.000 0.300
#> GSM254649     2  0.4887     0.6412 0.000 0.772 0.228
#> GSM254660     2  0.1289     0.8028 0.000 0.968 0.032
#> GSM254693     2  0.1753     0.7883 0.000 0.952 0.048
#> GSM254695     2  0.5138     0.6769 0.000 0.748 0.252
#> GSM254702     2  0.3482     0.7703 0.000 0.872 0.128
#> GSM254643     2  0.1860     0.7864 0.000 0.948 0.052
#> GSM254727     2  0.0237     0.8031 0.000 0.996 0.004
#> GSM254640     2  0.0747     0.8042 0.000 0.984 0.016
#> GSM254626     2  0.1411     0.7940 0.000 0.964 0.036
#> GSM254635     2  0.5098     0.6814 0.000 0.752 0.248
#> GSM254653     2  0.0237     0.8031 0.000 0.996 0.004
#> GSM254658     2  0.5216     0.6061 0.000 0.740 0.260
#> GSM254681     2  0.6225     0.3376 0.000 0.568 0.432
#> GSM254719     2  0.0237     0.8031 0.000 0.996 0.004
#> GSM254673     2  0.0592     0.8014 0.000 0.988 0.012
#> GSM254655     2  0.0892     0.8041 0.000 0.980 0.020
#> GSM254669     2  0.1289     0.7954 0.000 0.968 0.032
#> GSM254699     2  0.1411     0.8022 0.000 0.964 0.036
#> GSM254703     2  0.4121     0.7500 0.000 0.832 0.168
#> GSM254708     2  0.0237     0.8031 0.000 0.996 0.004
#> GSM254715     2  0.4504     0.7306 0.000 0.804 0.196
#> GSM254628     2  0.4974     0.6329 0.000 0.764 0.236
#> GSM254634     2  0.4399     0.7368 0.000 0.812 0.188
#> GSM254646     2  0.6154     0.3834 0.000 0.592 0.408
#> GSM254671     2  0.3941     0.7565 0.000 0.844 0.156
#> GSM254711     2  0.4121     0.7499 0.000 0.832 0.168
#> GSM254717     2  0.0424     0.8025 0.000 0.992 0.008
#> GSM254723     2  0.5138     0.6845 0.000 0.748 0.252
#> GSM254730     2  0.1411     0.8022 0.000 0.964 0.036
#> GSM254731     2  0.2356     0.7926 0.000 0.928 0.072
#> GSM254632     2  0.7820     0.1358 0.324 0.604 0.072
#> GSM254662     2  0.0237     0.8031 0.000 0.996 0.004
#> GSM254677     2  0.5291     0.6633 0.000 0.732 0.268
#> GSM254665     2  0.1289     0.7956 0.000 0.968 0.032
#> GSM254691     2  0.0424     0.8044 0.000 0.992 0.008
#> GSM254644     2  0.1031     0.8038 0.000 0.976 0.024
#> GSM254667     2  0.2165     0.7812 0.000 0.936 0.064
#> GSM254676     2  0.0000     0.8035 0.000 1.000 0.000
#> GSM254679     2  0.4504     0.7309 0.000 0.804 0.196
#> GSM254689     2  0.6192     0.3603 0.000 0.580 0.420
#> GSM254706     2  0.5327     0.5946 0.000 0.728 0.272
#> GSM254712     2  0.4291     0.7426 0.000 0.820 0.180
#> GSM254713     2  0.4555     0.7273 0.000 0.800 0.200
#> GSM254683     2  0.5905     0.4777 0.000 0.648 0.352
#> GSM254710     3  0.6823    -0.3520 0.012 0.484 0.504
#> GSM254725     2  0.5178     0.6723 0.000 0.744 0.256
#> GSM254651     2  0.5497     0.5704 0.000 0.708 0.292
#> GSM254638     2  0.5178     0.6723 0.000 0.744 0.256
#> GSM254685     2  0.1529     0.8015 0.000 0.960 0.040

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM254629     1  0.3718      0.792 0.820 0.000 0.012 0.168
#> GSM254648     4  0.6495      0.582 0.108 0.284 0.000 0.608
#> GSM254694     1  0.6092      0.666 0.724 0.136 0.024 0.116
#> GSM254701     1  0.3215      0.813 0.876 0.000 0.032 0.092
#> GSM254728     3  0.5941      0.588 0.276 0.000 0.652 0.072
#> GSM254726     2  0.7789      0.318 0.120 0.620 0.144 0.116
#> GSM254639     3  0.3156      0.878 0.048 0.000 0.884 0.068
#> GSM254652     3  0.4535      0.852 0.112 0.000 0.804 0.084
#> GSM254700     1  0.0188      0.836 0.996 0.000 0.004 0.000
#> GSM254625     4  0.5454      0.365 0.172 0.000 0.096 0.732
#> GSM254636     3  0.2271      0.887 0.076 0.000 0.916 0.008
#> GSM254659     1  0.5850      0.620 0.676 0.000 0.244 0.080
#> GSM254680     1  0.3548      0.814 0.864 0.000 0.068 0.068
#> GSM254686     1  0.2915      0.824 0.892 0.000 0.028 0.080
#> GSM254718     1  0.4449      0.793 0.824 0.012 0.060 0.104
#> GSM254674     1  0.4436      0.714 0.764 0.000 0.216 0.020
#> GSM254668     1  0.2660      0.831 0.908 0.000 0.036 0.056
#> GSM254697     1  0.1406      0.834 0.960 0.000 0.024 0.016
#> GSM254704     1  0.0524      0.835 0.988 0.000 0.008 0.004
#> GSM254707     4  0.6520     -0.080 0.384 0.000 0.080 0.536
#> GSM254714     1  0.2578      0.816 0.912 0.000 0.052 0.036
#> GSM254722     1  0.4767      0.657 0.724 0.000 0.256 0.020
#> GSM254627     1  0.1406      0.834 0.960 0.000 0.024 0.016
#> GSM254630     1  0.4728      0.776 0.792 0.000 0.104 0.104
#> GSM254633     1  0.3247      0.818 0.880 0.000 0.060 0.060
#> GSM254670     3  0.1576      0.887 0.048 0.000 0.948 0.004
#> GSM254716     4  0.5118      0.335 0.072 0.000 0.176 0.752
#> GSM254720     1  0.1004      0.836 0.972 0.000 0.004 0.024
#> GSM254729     3  0.4707      0.841 0.116 0.004 0.800 0.080
#> GSM254654     1  0.6178      0.693 0.736 0.092 0.056 0.116
#> GSM254656     3  0.2010      0.869 0.040 0.012 0.940 0.008
#> GSM254631     1  0.1209      0.837 0.964 0.000 0.032 0.004
#> GSM254657     3  0.2319      0.880 0.036 0.000 0.924 0.040
#> GSM254664     1  0.0000      0.836 1.000 0.000 0.000 0.000
#> GSM254672     1  0.1209      0.837 0.964 0.000 0.004 0.032
#> GSM254692     1  0.2081      0.822 0.916 0.000 0.000 0.084
#> GSM254645     1  0.5819      0.655 0.696 0.016 0.240 0.048
#> GSM254666     1  0.7515      0.100 0.448 0.000 0.364 0.188
#> GSM254675     1  0.1022      0.835 0.968 0.000 0.000 0.032
#> GSM254678     1  0.3529      0.777 0.836 0.000 0.152 0.012
#> GSM254688     1  0.7525      0.281 0.492 0.000 0.276 0.232
#> GSM254690     1  0.4095      0.739 0.792 0.000 0.192 0.016
#> GSM254696     3  0.1807      0.887 0.052 0.000 0.940 0.008
#> GSM254705     1  0.7142      0.370 0.524 0.000 0.152 0.324
#> GSM254642     1  0.1520      0.835 0.956 0.000 0.024 0.020
#> GSM254661     3  0.4424      0.860 0.100 0.000 0.812 0.088
#> GSM254698     3  0.2101      0.887 0.060 0.000 0.928 0.012
#> GSM254641     1  0.1902      0.828 0.932 0.000 0.004 0.064
#> GSM254647     1  0.2142      0.827 0.928 0.000 0.056 0.016
#> GSM254663     1  0.1624      0.837 0.952 0.000 0.020 0.028
#> GSM254682     3  0.5994      0.700 0.152 0.000 0.692 0.156
#> GSM254709     1  0.2921      0.808 0.860 0.000 0.000 0.140
#> GSM254721     1  0.0336      0.835 0.992 0.000 0.008 0.000
#> GSM254724     1  0.0000      0.836 1.000 0.000 0.000 0.000
#> GSM254650     1  0.5151      0.270 0.532 0.000 0.004 0.464
#> GSM254687     1  0.5203      0.403 0.576 0.000 0.008 0.416
#> GSM254637     1  0.0188      0.836 0.996 0.000 0.000 0.004
#> GSM254684     3  0.1661      0.888 0.052 0.000 0.944 0.004
#> GSM254649     2  0.4907      0.115 0.000 0.580 0.000 0.420
#> GSM254660     2  0.0707      0.858 0.000 0.980 0.000 0.020
#> GSM254693     2  0.3569      0.730 0.000 0.804 0.000 0.196
#> GSM254695     2  0.1716      0.835 0.000 0.936 0.000 0.064
#> GSM254702     2  0.0336      0.853 0.000 0.992 0.000 0.008
#> GSM254643     2  0.2345      0.843 0.000 0.900 0.000 0.100
#> GSM254727     2  0.2281      0.843 0.000 0.904 0.000 0.096
#> GSM254640     2  0.1743      0.858 0.000 0.940 0.004 0.056
#> GSM254626     2  0.2760      0.814 0.000 0.872 0.000 0.128
#> GSM254635     2  0.1305      0.841 0.000 0.960 0.004 0.036
#> GSM254653     2  0.2081      0.849 0.000 0.916 0.000 0.084
#> GSM254658     2  0.4866      0.200 0.000 0.596 0.000 0.404
#> GSM254681     4  0.4040      0.702 0.000 0.248 0.000 0.752
#> GSM254719     2  0.1792      0.853 0.000 0.932 0.000 0.068
#> GSM254673     2  0.2469      0.832 0.000 0.892 0.000 0.108
#> GSM254655     2  0.1474      0.857 0.000 0.948 0.000 0.052
#> GSM254669     2  0.3610      0.721 0.000 0.800 0.000 0.200
#> GSM254699     2  0.1389      0.858 0.000 0.952 0.000 0.048
#> GSM254703     2  0.2124      0.825 0.000 0.932 0.040 0.028
#> GSM254708     2  0.3074      0.790 0.000 0.848 0.000 0.152
#> GSM254715     2  0.1936      0.830 0.000 0.940 0.032 0.028
#> GSM254628     2  0.4761      0.336 0.000 0.628 0.000 0.372
#> GSM254634     2  0.0336      0.853 0.000 0.992 0.000 0.008
#> GSM254646     4  0.4624      0.633 0.000 0.340 0.000 0.660
#> GSM254671     2  0.0000      0.855 0.000 1.000 0.000 0.000
#> GSM254711     2  0.0707      0.849 0.000 0.980 0.000 0.020
#> GSM254717     2  0.2530      0.835 0.000 0.888 0.000 0.112
#> GSM254723     2  0.4959      0.612 0.000 0.752 0.052 0.196
#> GSM254730     2  0.1302      0.858 0.000 0.956 0.000 0.044
#> GSM254731     2  0.0336      0.856 0.000 0.992 0.000 0.008
#> GSM254632     4  0.7446      0.601 0.024 0.208 0.176 0.592
#> GSM254662     2  0.2081      0.846 0.000 0.916 0.000 0.084
#> GSM254677     2  0.4282      0.716 0.000 0.816 0.060 0.124
#> GSM254665     2  0.2345      0.847 0.000 0.900 0.000 0.100
#> GSM254691     2  0.2149      0.845 0.000 0.912 0.000 0.088
#> GSM254644     2  0.1389      0.859 0.000 0.952 0.000 0.048
#> GSM254667     4  0.4855      0.616 0.000 0.352 0.004 0.644
#> GSM254676     2  0.2081      0.846 0.000 0.916 0.000 0.084
#> GSM254679     2  0.0592      0.850 0.000 0.984 0.000 0.016
#> GSM254689     4  0.4304      0.688 0.000 0.284 0.000 0.716
#> GSM254706     4  0.4164      0.693 0.000 0.264 0.000 0.736
#> GSM254712     2  0.2300      0.819 0.000 0.924 0.048 0.028
#> GSM254713     2  0.2124      0.825 0.000 0.932 0.040 0.028
#> GSM254683     4  0.4661      0.633 0.000 0.348 0.000 0.652
#> GSM254710     4  0.3047      0.661 0.000 0.116 0.012 0.872
#> GSM254725     2  0.1356      0.841 0.000 0.960 0.008 0.032
#> GSM254651     4  0.4564      0.629 0.000 0.328 0.000 0.672
#> GSM254638     2  0.2483      0.811 0.000 0.916 0.032 0.052
#> GSM254685     2  0.1488      0.845 0.000 0.956 0.032 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
#> GSM254629     3  0.5959    0.43842 0.088 0.004 0.612 0.016 0.280
#> GSM254648     3  0.5799    0.32928 0.020 0.044 0.588 0.008 0.340
#> GSM254694     3  0.6870    0.52932 0.180 0.016 0.596 0.172 0.036
#> GSM254701     3  0.5933    0.55006 0.108 0.000 0.628 0.244 0.020
#> GSM254728     3  0.1914    0.54017 0.032 0.000 0.932 0.032 0.004
#> GSM254726     3  0.4290    0.57354 0.008 0.016 0.768 0.192 0.016
#> GSM254639     3  0.3779    0.09236 0.000 0.000 0.752 0.236 0.012
#> GSM254652     3  0.1913    0.51350 0.008 0.000 0.932 0.044 0.016
#> GSM254700     1  0.0000    0.86103 1.000 0.000 0.000 0.000 0.000
#> GSM254625     5  0.4575    0.41677 0.024 0.004 0.268 0.004 0.700
#> GSM254636     4  0.4736    0.73582 0.020 0.000 0.404 0.576 0.000
#> GSM254659     3  0.2050    0.57691 0.064 0.000 0.920 0.008 0.008
#> GSM254680     3  0.5039    0.38681 0.360 0.000 0.604 0.028 0.008
#> GSM254686     3  0.5354    0.50109 0.128 0.000 0.680 0.004 0.188
#> GSM254718     3  0.5524    0.53779 0.060 0.000 0.640 0.280 0.020
#> GSM254674     3  0.6259    0.10518 0.248 0.000 0.540 0.212 0.000
#> GSM254668     1  0.6296   -0.22873 0.440 0.000 0.408 0.000 0.152
#> GSM254697     1  0.0510    0.86092 0.984 0.000 0.000 0.016 0.000
#> GSM254704     1  0.0162    0.86184 0.996 0.000 0.004 0.000 0.000
#> GSM254707     5  0.5540    0.13287 0.060 0.000 0.400 0.004 0.536
#> GSM254714     3  0.7131    0.30080 0.340 0.000 0.352 0.296 0.012
#> GSM254722     1  0.3958    0.69274 0.780 0.000 0.044 0.176 0.000
#> GSM254627     1  0.0162    0.86171 0.996 0.000 0.000 0.004 0.000
#> GSM254630     1  0.5313    0.66376 0.716 0.000 0.048 0.056 0.180
#> GSM254633     3  0.3266    0.56292 0.200 0.000 0.796 0.004 0.000
#> GSM254670     4  0.4362    0.78936 0.004 0.000 0.360 0.632 0.004
#> GSM254716     5  0.3861    0.41850 0.000 0.000 0.264 0.008 0.728
#> GSM254720     1  0.0290    0.86173 0.992 0.000 0.008 0.000 0.000
#> GSM254729     3  0.2731    0.43044 0.004 0.000 0.876 0.104 0.016
#> GSM254654     3  0.6019    0.51433 0.072 0.004 0.600 0.300 0.024
#> GSM254656     4  0.4135    0.78435 0.004 0.000 0.340 0.656 0.000
#> GSM254631     1  0.2377    0.79588 0.872 0.000 0.128 0.000 0.000
#> GSM254657     3  0.5045   -0.10615 0.008 0.000 0.620 0.340 0.032
#> GSM254664     1  0.2471    0.76756 0.864 0.000 0.136 0.000 0.000
#> GSM254672     1  0.0566    0.86153 0.984 0.000 0.004 0.012 0.000
#> GSM254692     1  0.1310    0.85403 0.956 0.000 0.020 0.000 0.024
#> GSM254645     4  0.6546    0.00902 0.336 0.004 0.124 0.520 0.016
#> GSM254666     3  0.5100    0.26106 0.024 0.000 0.592 0.012 0.372
#> GSM254675     1  0.3010    0.71598 0.824 0.000 0.172 0.000 0.004
#> GSM254678     1  0.4059    0.68322 0.776 0.000 0.172 0.052 0.000
#> GSM254688     5  0.8361    0.17808 0.244 0.000 0.196 0.188 0.372
#> GSM254690     1  0.3003    0.79810 0.864 0.000 0.044 0.092 0.000
#> GSM254696     4  0.4478    0.79106 0.008 0.000 0.360 0.628 0.004
#> GSM254705     1  0.3339    0.79889 0.860 0.000 0.032 0.084 0.024
#> GSM254642     1  0.0703    0.85900 0.976 0.000 0.000 0.024 0.000
#> GSM254661     3  0.3209    0.56401 0.000 0.004 0.848 0.028 0.120
#> GSM254698     4  0.5620    0.73924 0.092 0.000 0.296 0.608 0.004
#> GSM254641     3  0.5131    0.35063 0.420 0.000 0.540 0.000 0.040
#> GSM254647     1  0.0451    0.86205 0.988 0.000 0.008 0.004 0.000
#> GSM254663     1  0.0693    0.86171 0.980 0.000 0.008 0.000 0.012
#> GSM254682     4  0.7246    0.64739 0.100 0.000 0.324 0.484 0.092
#> GSM254709     5  0.6396    0.21270 0.280 0.000 0.212 0.000 0.508
#> GSM254721     1  0.0290    0.86179 0.992 0.000 0.008 0.000 0.000
#> GSM254724     1  0.0162    0.86184 0.996 0.000 0.004 0.000 0.000
#> GSM254650     1  0.3928    0.52891 0.700 0.000 0.004 0.000 0.296
#> GSM254687     5  0.4779    0.37075 0.340 0.000 0.032 0.000 0.628
#> GSM254637     1  0.2574    0.78954 0.876 0.000 0.112 0.012 0.000
#> GSM254684     4  0.4552    0.79214 0.012 0.000 0.352 0.632 0.004
#> GSM254649     2  0.2179    0.82185 0.000 0.888 0.000 0.000 0.112
#> GSM254660     2  0.0794    0.86228 0.000 0.972 0.000 0.000 0.028
#> GSM254693     2  0.1270    0.85625 0.000 0.948 0.000 0.000 0.052
#> GSM254695     2  0.2795    0.83329 0.000 0.880 0.000 0.056 0.064
#> GSM254702     2  0.1399    0.85839 0.000 0.952 0.000 0.020 0.028
#> GSM254643     2  0.0963    0.86264 0.000 0.964 0.000 0.000 0.036
#> GSM254727     2  0.0955    0.86379 0.000 0.968 0.000 0.004 0.028
#> GSM254640     2  0.1331    0.86350 0.000 0.952 0.000 0.040 0.008
#> GSM254626     2  0.1282    0.86143 0.000 0.952 0.000 0.004 0.044
#> GSM254635     2  0.2054    0.84627 0.000 0.920 0.000 0.028 0.052
#> GSM254653     2  0.0609    0.86335 0.000 0.980 0.000 0.000 0.020
#> GSM254658     2  0.2074    0.82791 0.000 0.896 0.000 0.000 0.104
#> GSM254681     5  0.3586    0.45794 0.000 0.264 0.000 0.000 0.736
#> GSM254719     2  0.0566    0.86477 0.000 0.984 0.000 0.004 0.012
#> GSM254673     2  0.0865    0.86381 0.000 0.972 0.000 0.004 0.024
#> GSM254655     2  0.0162    0.86444 0.000 0.996 0.000 0.000 0.004
#> GSM254669     2  0.1121    0.85871 0.000 0.956 0.000 0.000 0.044
#> GSM254699     2  0.0451    0.86528 0.000 0.988 0.000 0.008 0.004
#> GSM254703     2  0.4597    0.66004 0.000 0.696 0.000 0.260 0.044
#> GSM254708     2  0.0963    0.86119 0.000 0.964 0.000 0.000 0.036
#> GSM254715     2  0.3639    0.77936 0.000 0.812 0.000 0.144 0.044
#> GSM254628     2  0.1792    0.84162 0.000 0.916 0.000 0.000 0.084
#> GSM254634     2  0.1211    0.86100 0.000 0.960 0.000 0.016 0.024
#> GSM254646     2  0.3983    0.52560 0.000 0.660 0.000 0.000 0.340
#> GSM254671     2  0.1082    0.86073 0.000 0.964 0.000 0.008 0.028
#> GSM254711     2  0.1568    0.85547 0.000 0.944 0.000 0.020 0.036
#> GSM254717     2  0.1626    0.86208 0.000 0.940 0.000 0.016 0.044
#> GSM254723     2  0.8380   -0.00318 0.004 0.396 0.164 0.232 0.204
#> GSM254730     2  0.0451    0.86405 0.000 0.988 0.000 0.004 0.008
#> GSM254731     2  0.1403    0.85948 0.000 0.952 0.000 0.024 0.024
#> GSM254632     5  0.7179    0.34577 0.004 0.112 0.256 0.084 0.544
#> GSM254662     2  0.0703    0.86293 0.000 0.976 0.000 0.000 0.024
#> GSM254677     2  0.5797    0.47522 0.000 0.560 0.008 0.352 0.080
#> GSM254665     2  0.1282    0.86205 0.000 0.952 0.000 0.004 0.044
#> GSM254691     2  0.0955    0.86373 0.000 0.968 0.000 0.004 0.028
#> GSM254644     2  0.1408    0.86249 0.000 0.948 0.000 0.044 0.008
#> GSM254667     2  0.4810    0.64106 0.000 0.712 0.000 0.084 0.204
#> GSM254676     2  0.0865    0.86458 0.000 0.972 0.000 0.004 0.024
#> GSM254679     2  0.1386    0.85784 0.000 0.952 0.000 0.016 0.032
#> GSM254689     5  0.4182    0.17199 0.000 0.400 0.000 0.000 0.600
#> GSM254706     2  0.4339    0.54188 0.000 0.652 0.000 0.012 0.336
#> GSM254712     2  0.5267    0.53539 0.000 0.604 0.008 0.344 0.044
#> GSM254713     2  0.4756    0.62715 0.000 0.668 0.000 0.288 0.044
#> GSM254683     2  0.3837    0.58029 0.000 0.692 0.000 0.000 0.308
#> GSM254710     5  0.1965    0.50086 0.000 0.096 0.000 0.000 0.904
#> GSM254725     2  0.2054    0.84715 0.000 0.920 0.000 0.028 0.052
#> GSM254651     2  0.4063    0.63885 0.000 0.708 0.000 0.012 0.280
#> GSM254638     2  0.5223    0.63207 0.000 0.680 0.012 0.240 0.068
#> GSM254685     2  0.3449    0.77042 0.000 0.812 0.000 0.164 0.024

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM254629     3  0.1511     0.7842 0.000 0.000 0.940 0.044 0.012 0.004
#> GSM254648     3  0.1906     0.7776 0.000 0.008 0.924 0.032 0.036 0.000
#> GSM254694     3  0.1411     0.7888 0.000 0.000 0.936 0.060 0.004 0.000
#> GSM254701     3  0.0935     0.7893 0.000 0.000 0.964 0.032 0.004 0.000
#> GSM254728     3  0.4330     0.7066 0.000 0.000 0.756 0.156 0.040 0.048
#> GSM254726     3  0.2728     0.7732 0.000 0.000 0.872 0.080 0.040 0.008
#> GSM254639     6  0.4835     0.3792 0.000 0.000 0.360 0.048 0.008 0.584
#> GSM254652     3  0.1951     0.7873 0.000 0.000 0.916 0.004 0.020 0.060
#> GSM254700     1  0.1176     0.8474 0.956 0.000 0.024 0.020 0.000 0.000
#> GSM254625     5  0.4823     0.4782 0.004 0.000 0.212 0.068 0.696 0.020
#> GSM254636     6  0.3560     0.7542 0.068 0.000 0.076 0.012 0.012 0.832
#> GSM254659     3  0.1749     0.7873 0.000 0.000 0.932 0.036 0.024 0.008
#> GSM254680     3  0.5056     0.6605 0.172 0.000 0.716 0.028 0.032 0.052
#> GSM254686     3  0.3579     0.7265 0.000 0.000 0.804 0.120 0.072 0.004
#> GSM254718     3  0.3886     0.7016 0.000 0.000 0.772 0.164 0.056 0.008
#> GSM254674     3  0.5709     0.4655 0.172 0.000 0.568 0.000 0.012 0.248
#> GSM254668     3  0.5504     0.6097 0.172 0.000 0.676 0.032 0.100 0.020
#> GSM254697     1  0.0551     0.8490 0.984 0.000 0.004 0.004 0.000 0.008
#> GSM254704     1  0.1341     0.8469 0.948 0.000 0.028 0.024 0.000 0.000
#> GSM254707     5  0.5608     0.1698 0.004 0.000 0.388 0.100 0.500 0.008
#> GSM254714     4  0.6043     0.0361 0.260 0.000 0.272 0.464 0.004 0.000
#> GSM254722     1  0.2402     0.7813 0.856 0.000 0.000 0.004 0.000 0.140
#> GSM254627     1  0.0551     0.8497 0.984 0.000 0.004 0.004 0.000 0.008
#> GSM254630     1  0.4751     0.6783 0.736 0.000 0.020 0.056 0.164 0.024
#> GSM254633     3  0.2101     0.7802 0.072 0.000 0.908 0.008 0.008 0.004
#> GSM254670     6  0.0405     0.7929 0.000 0.000 0.008 0.004 0.000 0.988
#> GSM254716     5  0.5243     0.4649 0.000 0.000 0.144 0.128 0.684 0.044
#> GSM254720     1  0.2106     0.8340 0.904 0.000 0.064 0.032 0.000 0.000
#> GSM254729     3  0.3852     0.5880 0.000 0.000 0.720 0.016 0.008 0.256
#> GSM254654     3  0.1267     0.7833 0.000 0.000 0.940 0.060 0.000 0.000
#> GSM254656     6  0.1818     0.7785 0.004 0.000 0.004 0.068 0.004 0.920
#> GSM254631     1  0.4934     0.4285 0.624 0.000 0.316 0.012 0.012 0.036
#> GSM254657     6  0.6136     0.4942 0.000 0.000 0.128 0.236 0.064 0.572
#> GSM254664     3  0.4397     0.1550 0.452 0.000 0.528 0.008 0.012 0.000
#> GSM254672     1  0.1408     0.8492 0.944 0.000 0.020 0.036 0.000 0.000
#> GSM254692     1  0.2959     0.8040 0.868 0.000 0.028 0.056 0.048 0.000
#> GSM254645     4  0.6364    -0.0864 0.192 0.000 0.028 0.456 0.000 0.324
#> GSM254666     5  0.6654     0.2519 0.000 0.000 0.328 0.144 0.456 0.072
#> GSM254675     1  0.4636     0.6806 0.732 0.000 0.160 0.072 0.036 0.000
#> GSM254678     1  0.3743     0.6750 0.756 0.000 0.012 0.012 0.004 0.216
#> GSM254688     5  0.7113     0.1555 0.144 0.000 0.052 0.044 0.488 0.272
#> GSM254690     1  0.2615     0.7835 0.852 0.000 0.004 0.000 0.008 0.136
#> GSM254696     6  0.1344     0.7976 0.012 0.000 0.008 0.012 0.012 0.956
#> GSM254705     1  0.1285     0.8393 0.944 0.000 0.000 0.004 0.000 0.052
#> GSM254642     1  0.0551     0.8490 0.984 0.000 0.004 0.004 0.000 0.008
#> GSM254661     3  0.2563     0.7717 0.000 0.000 0.892 0.028 0.044 0.036
#> GSM254698     6  0.1663     0.7617 0.088 0.000 0.000 0.000 0.000 0.912
#> GSM254641     3  0.3068     0.7371 0.124 0.000 0.840 0.020 0.016 0.000
#> GSM254647     1  0.0622     0.8489 0.980 0.000 0.000 0.000 0.012 0.008
#> GSM254663     1  0.0767     0.8509 0.976 0.000 0.008 0.004 0.012 0.000
#> GSM254682     6  0.5343     0.6629 0.088 0.000 0.032 0.056 0.104 0.720
#> GSM254709     5  0.5758    -0.0301 0.132 0.000 0.428 0.008 0.432 0.000
#> GSM254721     1  0.1418     0.8462 0.944 0.000 0.032 0.024 0.000 0.000
#> GSM254724     1  0.1257     0.8472 0.952 0.000 0.028 0.020 0.000 0.000
#> GSM254650     1  0.3534     0.5885 0.716 0.000 0.008 0.000 0.276 0.000
#> GSM254687     5  0.3758     0.3837 0.284 0.000 0.016 0.000 0.700 0.000
#> GSM254637     1  0.4662     0.1993 0.548 0.000 0.420 0.016 0.012 0.004
#> GSM254684     6  0.0622     0.7936 0.012 0.000 0.000 0.000 0.008 0.980
#> GSM254649     2  0.1387     0.8193 0.000 0.932 0.000 0.000 0.068 0.000
#> GSM254660     2  0.0891     0.8376 0.000 0.968 0.000 0.024 0.008 0.000
#> GSM254693     2  0.0692     0.8368 0.000 0.976 0.000 0.004 0.020 0.000
#> GSM254695     2  0.4999     0.4722 0.000 0.652 0.000 0.244 0.092 0.012
#> GSM254702     2  0.0935     0.8325 0.000 0.964 0.000 0.032 0.004 0.000
#> GSM254643     2  0.0622     0.8384 0.000 0.980 0.000 0.008 0.012 0.000
#> GSM254727     2  0.1492     0.8308 0.000 0.940 0.000 0.024 0.036 0.000
#> GSM254640     2  0.3265     0.5822 0.000 0.748 0.000 0.248 0.004 0.000
#> GSM254626     2  0.0820     0.8388 0.000 0.972 0.000 0.012 0.016 0.000
#> GSM254635     2  0.1643     0.8139 0.000 0.924 0.000 0.068 0.008 0.000
#> GSM254653     2  0.0622     0.8387 0.000 0.980 0.000 0.012 0.008 0.000
#> GSM254658     2  0.1802     0.8099 0.000 0.916 0.000 0.012 0.072 0.000
#> GSM254681     5  0.2964     0.3689 0.000 0.204 0.000 0.004 0.792 0.000
#> GSM254719     2  0.0363     0.8383 0.000 0.988 0.000 0.012 0.000 0.000
#> GSM254673     2  0.0603     0.8394 0.000 0.980 0.000 0.016 0.004 0.000
#> GSM254655     2  0.0363     0.8374 0.000 0.988 0.000 0.012 0.000 0.000
#> GSM254669     2  0.0891     0.8384 0.000 0.968 0.000 0.024 0.008 0.000
#> GSM254699     2  0.0790     0.8384 0.000 0.968 0.000 0.032 0.000 0.000
#> GSM254703     2  0.3838     0.0249 0.000 0.552 0.000 0.448 0.000 0.000
#> GSM254708     2  0.0972     0.8340 0.000 0.964 0.000 0.008 0.028 0.000
#> GSM254715     2  0.3823     0.0588 0.000 0.564 0.000 0.436 0.000 0.000
#> GSM254628     2  0.2340     0.7538 0.000 0.852 0.000 0.000 0.148 0.000
#> GSM254634     2  0.1268     0.8364 0.000 0.952 0.000 0.036 0.008 0.004
#> GSM254646     2  0.3426     0.5859 0.000 0.720 0.000 0.004 0.276 0.000
#> GSM254671     2  0.0972     0.8382 0.000 0.964 0.000 0.028 0.008 0.000
#> GSM254711     2  0.1367     0.8334 0.000 0.944 0.000 0.044 0.012 0.000
#> GSM254717     2  0.2263     0.8062 0.000 0.896 0.000 0.048 0.056 0.000
#> GSM254723     4  0.5797     0.1676 0.000 0.096 0.104 0.676 0.104 0.020
#> GSM254730     2  0.0717     0.8375 0.000 0.976 0.000 0.016 0.008 0.000
#> GSM254731     2  0.0891     0.8343 0.000 0.968 0.000 0.024 0.008 0.000
#> GSM254632     5  0.6844     0.1366 0.000 0.024 0.056 0.136 0.500 0.284
#> GSM254662     2  0.0692     0.8388 0.000 0.976 0.000 0.020 0.004 0.000
#> GSM254677     4  0.3853     0.4709 0.000 0.304 0.000 0.680 0.016 0.000
#> GSM254665     2  0.1418     0.8334 0.000 0.944 0.000 0.024 0.032 0.000
#> GSM254691     2  0.1003     0.8381 0.000 0.964 0.000 0.020 0.016 0.000
#> GSM254644     2  0.4371     0.1739 0.000 0.580 0.000 0.396 0.020 0.004
#> GSM254667     2  0.6921     0.0827 0.000 0.464 0.000 0.096 0.260 0.180
#> GSM254676     2  0.0914     0.8380 0.000 0.968 0.000 0.016 0.016 0.000
#> GSM254679     2  0.1049     0.8338 0.000 0.960 0.000 0.032 0.008 0.000
#> GSM254689     5  0.3695     0.1506 0.000 0.376 0.000 0.000 0.624 0.000
#> GSM254706     5  0.5089     0.0750 0.000 0.384 0.000 0.072 0.540 0.004
#> GSM254712     4  0.3765     0.3316 0.000 0.404 0.000 0.596 0.000 0.000
#> GSM254713     4  0.3864     0.1139 0.000 0.480 0.000 0.520 0.000 0.000
#> GSM254683     2  0.3934     0.5784 0.000 0.708 0.000 0.032 0.260 0.000
#> GSM254710     5  0.2197     0.4504 0.000 0.044 0.000 0.056 0.900 0.000
#> GSM254725     2  0.2267     0.8060 0.000 0.904 0.004 0.064 0.008 0.020
#> GSM254651     2  0.4682     0.5314 0.000 0.680 0.000 0.092 0.224 0.004
#> GSM254638     2  0.4025     0.5797 0.000 0.720 0.020 0.248 0.008 0.004
#> GSM254685     2  0.3592     0.3678 0.000 0.656 0.000 0.344 0.000 0.000

Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.

consensus_heatmap(res, k = 2)

plot of chunk tab-MAD-NMF-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-MAD-NMF-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-MAD-NMF-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-MAD-NMF-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-MAD-NMF-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-MAD-NMF-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-MAD-NMF-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-MAD-NMF-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-MAD-NMF-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-MAD-NMF-membership-heatmap-5

As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

plot of chunk tab-MAD-NMF-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-MAD-NMF-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-MAD-NMF-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-MAD-NMF-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-MAD-NMF-get-signatures-5

Signature heatmaps where rows are not scaled:

get_signatures(res, k = 2, scale_rows = FALSE)

plot of chunk tab-MAD-NMF-get-signatures-no-scale-1

get_signatures(res, k = 3, scale_rows = FALSE)

plot of chunk tab-MAD-NMF-get-signatures-no-scale-2

get_signatures(res, k = 4, scale_rows = FALSE)

plot of chunk tab-MAD-NMF-get-signatures-no-scale-3

get_signatures(res, k = 5, scale_rows = FALSE)

plot of chunk tab-MAD-NMF-get-signatures-no-scale-4

get_signatures(res, k = 6, scale_rows = FALSE)

plot of chunk tab-MAD-NMF-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk MAD-NMF-signature_compare

get_signature() returns a data frame invisibly. TO get the list of signatures, the function call should be assigned to a variable explicitly. In following code, if plot argument is set to FALSE, no heatmap is plotted while only the differential analysis is performed.

# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)

An example of the output of tb is:

#>   which_row         fdr    mean_1    mean_2 scaled_mean_1 scaled_mean_2 km
#> 1        38 0.042760348  8.373488  9.131774    -0.5533452     0.5164555  1
#> 2        40 0.018707592  7.106213  8.469186    -0.6173731     0.5762149  1
#> 3        55 0.019134737 10.221463 11.207825    -0.6159697     0.5749050  1
#> 4        59 0.006059896  5.921854  7.869574    -0.6899429     0.6439467  1
#> 5        60 0.018055526  8.928898 10.211722    -0.6204761     0.5791110  1
#> 6        98 0.009384629 15.714769 14.887706     0.6635654    -0.6193277  2
...

The columns in tb are:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. km: Row groups if k-means clustering is applied to rows.

UMAP plot which shows how samples are separated.

dimension_reduction(res, k = 2, method = "UMAP")

plot of chunk tab-MAD-NMF-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-MAD-NMF-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-MAD-NMF-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-MAD-NMF-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-MAD-NMF-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk MAD-NMF-collect-classes

Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.

test_to_known_factors(res)
#>           n tissue(p) individual(p) disease.state(p) gender(p) other(p) k
#> MAD:NMF 107  2.35e-23       0.55450            0.665    0.6108    0.958 2
#> MAD:NMF  87  8.02e-20       0.24627            0.784    0.7129    1.000 3
#> MAD:NMF  95  1.10e-19       0.65686            0.596    0.4558    0.898 4
#> MAD:NMF  84  2.47e-17       0.00724            0.617    0.0239    0.517 5
#> MAD:NMF  77  1.35e-16       0.00210            0.407    0.0513    0.142 6

If matrix rows can be associated to genes, consider to use functional_enrichment(res, ...) to perform function enrichment for the signature genes. See this vignette for more detailed explanations.


ATC:hclust

The object with results only for a single top-value method and a single partition method can be extracted as:

res = res_list["ATC", "hclust"]
# you can also extract it by
# res = res_list["ATC:hclust"]

A summary of res and all the functions that can be applied to it:

res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#>   On a matrix with 21168 rows and 107 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 4.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

collect_plots() function collects all the plots made from res for all k (number of partitions) into one single page to provide an easy and fast comparison between different k.

collect_plots(res)

plot of chunk ATC-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.239           0.629       0.808         0.3828 0.730   0.730
#> 3 3 0.637           0.768       0.882         0.6104 0.621   0.501
#> 4 4 0.832           0.872       0.924         0.1296 0.905   0.767
#> 5 5 0.800           0.789       0.859         0.1063 0.913   0.722
#> 6 6 0.785           0.748       0.837         0.0413 0.985   0.935

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
#> GSM254629     1   0.753    0.65466 0.784 0.216
#> GSM254648     1   0.753    0.65466 0.784 0.216
#> GSM254694     1   0.753    0.65466 0.784 0.216
#> GSM254701     1   0.753    0.65466 0.784 0.216
#> GSM254728     1   0.730    0.66167 0.796 0.204
#> GSM254726     1   0.827    0.65917 0.740 0.260
#> GSM254639     2   1.000   -0.03623 0.496 0.504
#> GSM254652     1   0.753    0.65466 0.784 0.216
#> GSM254700     1   0.662    0.67814 0.828 0.172
#> GSM254625     1   0.000    0.69198 1.000 0.000
#> GSM254636     1   0.871    0.56850 0.708 0.292
#> GSM254659     1   0.753    0.65466 0.784 0.216
#> GSM254680     1   0.662    0.67814 0.828 0.172
#> GSM254686     1   0.662    0.67814 0.828 0.172
#> GSM254718     1   0.861    0.58326 0.716 0.284
#> GSM254674     1   0.662    0.67814 0.828 0.172
#> GSM254668     1   0.000    0.69198 1.000 0.000
#> GSM254697     1   0.861    0.57973 0.716 0.284
#> GSM254704     1   0.952    0.41373 0.628 0.372
#> GSM254707     1   0.000    0.69198 1.000 0.000
#> GSM254714     1   0.866    0.57756 0.712 0.288
#> GSM254722     1   0.861    0.57973 0.716 0.284
#> GSM254627     1   0.871    0.56850 0.708 0.292
#> GSM254630     1   0.730    0.66167 0.796 0.204
#> GSM254633     1   0.921    0.49305 0.664 0.336
#> GSM254670     1   1.000    0.00238 0.504 0.496
#> GSM254716     1   0.000    0.69198 1.000 0.000
#> GSM254720     1   0.753    0.65466 0.784 0.216
#> GSM254729     1   0.871    0.57171 0.708 0.292
#> GSM254654     1   0.871    0.57171 0.708 0.292
#> GSM254656     2   0.996    0.09584 0.464 0.536
#> GSM254631     1   0.921    0.49305 0.664 0.336
#> GSM254657     2   0.996    0.09584 0.464 0.536
#> GSM254664     1   0.680    0.67497 0.820 0.180
#> GSM254672     1   0.952    0.41373 0.628 0.372
#> GSM254692     1   0.000    0.69198 1.000 0.000
#> GSM254645     1   0.991    0.19958 0.556 0.444
#> GSM254666     1   0.738    0.65972 0.792 0.208
#> GSM254675     1   0.680    0.67497 0.820 0.180
#> GSM254678     1   0.909    0.51586 0.676 0.324
#> GSM254688     1   0.000    0.69198 1.000 0.000
#> GSM254690     1   0.662    0.67814 0.828 0.172
#> GSM254696     1   0.871    0.56850 0.708 0.292
#> GSM254705     1   0.000    0.69198 1.000 0.000
#> GSM254642     1   0.662    0.67814 0.828 0.172
#> GSM254661     1   0.753    0.65466 0.784 0.216
#> GSM254698     1   0.871    0.56850 0.708 0.292
#> GSM254641     1   0.730    0.66167 0.796 0.204
#> GSM254647     1   0.662    0.67814 0.828 0.172
#> GSM254663     1   0.000    0.69198 1.000 0.000
#> GSM254682     1   0.000    0.69198 1.000 0.000
#> GSM254709     1   0.000    0.69198 1.000 0.000
#> GSM254721     1   0.662    0.67814 0.828 0.172
#> GSM254724     1   0.662    0.67814 0.828 0.172
#> GSM254650     1   0.000    0.69198 1.000 0.000
#> GSM254687     1   0.000    0.69198 1.000 0.000
#> GSM254637     1   0.689    0.67338 0.816 0.184
#> GSM254684     1   0.971    0.34508 0.600 0.400
#> GSM254649     1   0.753    0.63086 0.784 0.216
#> GSM254660     1   0.802    0.60896 0.756 0.244
#> GSM254693     1   0.753    0.63086 0.784 0.216
#> GSM254695     1   0.971    0.50346 0.600 0.400
#> GSM254702     1   0.802    0.60896 0.756 0.244
#> GSM254643     1   0.775    0.62047 0.772 0.228
#> GSM254727     1   0.753    0.63086 0.784 0.216
#> GSM254640     2   0.552    0.71846 0.128 0.872
#> GSM254626     1   0.753    0.63086 0.784 0.216
#> GSM254635     2   0.000    0.85737 0.000 1.000
#> GSM254653     1   0.753    0.63086 0.784 0.216
#> GSM254658     1   0.775    0.62047 0.772 0.228
#> GSM254681     1   0.714    0.64106 0.804 0.196
#> GSM254719     1   0.802    0.60896 0.756 0.244
#> GSM254673     1   0.753    0.63086 0.784 0.216
#> GSM254655     1   0.802    0.60896 0.756 0.244
#> GSM254669     1   0.753    0.63086 0.784 0.216
#> GSM254699     1   0.802    0.60896 0.756 0.244
#> GSM254703     1   0.839    0.60242 0.732 0.268
#> GSM254708     1   0.767    0.62442 0.776 0.224
#> GSM254715     2   0.000    0.85737 0.000 1.000
#> GSM254628     1   0.753    0.63086 0.784 0.216
#> GSM254634     2   0.000    0.85737 0.000 1.000
#> GSM254646     1   0.753    0.63086 0.784 0.216
#> GSM254671     2   0.000    0.85737 0.000 1.000
#> GSM254711     2   0.000    0.85737 0.000 1.000
#> GSM254717     1   0.767    0.62442 0.776 0.224
#> GSM254723     1   0.827    0.65917 0.740 0.260
#> GSM254730     1   0.802    0.60896 0.756 0.244
#> GSM254731     1   0.802    0.60896 0.756 0.244
#> GSM254632     1   0.839    0.65725 0.732 0.268
#> GSM254662     1   0.753    0.63086 0.784 0.216
#> GSM254677     2   0.000    0.85737 0.000 1.000
#> GSM254665     1   0.767    0.62442 0.776 0.224
#> GSM254691     1   0.767    0.62442 0.776 0.224
#> GSM254644     2   0.494    0.73522 0.108 0.892
#> GSM254667     1   0.615    0.66558 0.848 0.152
#> GSM254676     1   0.767    0.62442 0.776 0.224
#> GSM254679     2   0.000    0.85737 0.000 1.000
#> GSM254689     1   0.714    0.64106 0.804 0.196
#> GSM254706     1   0.767    0.62442 0.776 0.224
#> GSM254712     2   0.000    0.85737 0.000 1.000
#> GSM254713     2   0.000    0.85737 0.000 1.000
#> GSM254683     1   0.714    0.64106 0.804 0.196
#> GSM254710     1   0.714    0.64106 0.804 0.196
#> GSM254725     2   0.000    0.85737 0.000 1.000
#> GSM254651     1   0.767    0.62442 0.776 0.224
#> GSM254638     2   0.000    0.85737 0.000 1.000
#> GSM254685     2   0.000    0.85737 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
#> GSM254629     1  0.1643     0.8169 0.956 0.000 0.044
#> GSM254648     1  0.1643     0.8169 0.956 0.000 0.044
#> GSM254694     1  0.1643     0.8169 0.956 0.000 0.044
#> GSM254701     1  0.1643     0.8169 0.956 0.000 0.044
#> GSM254728     1  0.1289     0.8169 0.968 0.000 0.032
#> GSM254726     2  0.7581     0.1757 0.408 0.548 0.044
#> GSM254639     1  0.5810     0.5608 0.664 0.000 0.336
#> GSM254652     1  0.1643     0.8169 0.956 0.000 0.044
#> GSM254700     1  0.0000     0.8126 1.000 0.000 0.000
#> GSM254625     1  0.6717     0.4479 0.628 0.352 0.020
#> GSM254636     1  0.3340     0.7917 0.880 0.000 0.120
#> GSM254659     1  0.1643     0.8169 0.956 0.000 0.044
#> GSM254680     1  0.0000     0.8126 1.000 0.000 0.000
#> GSM254686     1  0.0000     0.8126 1.000 0.000 0.000
#> GSM254718     1  0.3192     0.7957 0.888 0.000 0.112
#> GSM254674     1  0.0000     0.8126 1.000 0.000 0.000
#> GSM254668     1  0.6717     0.4479 0.628 0.352 0.020
#> GSM254697     1  0.3192     0.7954 0.888 0.000 0.112
#> GSM254704     1  0.4555     0.7325 0.800 0.000 0.200
#> GSM254707     1  0.6717     0.4479 0.628 0.352 0.020
#> GSM254714     1  0.3267     0.7937 0.884 0.000 0.116
#> GSM254722     1  0.3192     0.7954 0.888 0.000 0.112
#> GSM254627     1  0.3340     0.7917 0.880 0.000 0.120
#> GSM254630     1  0.1289     0.8169 0.968 0.000 0.032
#> GSM254633     1  0.4062     0.7639 0.836 0.000 0.164
#> GSM254670     1  0.5760     0.5743 0.672 0.000 0.328
#> GSM254716     1  0.6717     0.4479 0.628 0.352 0.020
#> GSM254720     1  0.1643     0.8169 0.956 0.000 0.044
#> GSM254729     1  0.3340     0.7914 0.880 0.000 0.120
#> GSM254654     1  0.3340     0.7914 0.880 0.000 0.120
#> GSM254656     1  0.6215     0.4048 0.572 0.000 0.428
#> GSM254631     1  0.4062     0.7639 0.836 0.000 0.164
#> GSM254657     1  0.6215     0.4048 0.572 0.000 0.428
#> GSM254664     1  0.0424     0.8144 0.992 0.000 0.008
#> GSM254672     1  0.4555     0.7325 0.800 0.000 0.200
#> GSM254692     1  0.6717     0.4479 0.628 0.352 0.020
#> GSM254645     1  0.5363     0.6442 0.724 0.000 0.276
#> GSM254666     1  0.1411     0.8171 0.964 0.000 0.036
#> GSM254675     1  0.0424     0.8144 0.992 0.000 0.008
#> GSM254678     1  0.3879     0.7725 0.848 0.000 0.152
#> GSM254688     1  0.6717     0.4479 0.628 0.352 0.020
#> GSM254690     1  0.0000     0.8126 1.000 0.000 0.000
#> GSM254696     1  0.3340     0.7917 0.880 0.000 0.120
#> GSM254705     1  0.6717     0.4479 0.628 0.352 0.020
#> GSM254642     1  0.0000     0.8126 1.000 0.000 0.000
#> GSM254661     1  0.1643     0.8169 0.956 0.000 0.044
#> GSM254698     1  0.3340     0.7917 0.880 0.000 0.120
#> GSM254641     1  0.1289     0.8169 0.968 0.000 0.032
#> GSM254647     1  0.0000     0.8126 1.000 0.000 0.000
#> GSM254663     1  0.6717     0.4479 0.628 0.352 0.020
#> GSM254682     1  0.6717     0.4479 0.628 0.352 0.020
#> GSM254709     1  0.6717     0.4479 0.628 0.352 0.020
#> GSM254721     1  0.0000     0.8126 1.000 0.000 0.000
#> GSM254724     1  0.0000     0.8126 1.000 0.000 0.000
#> GSM254650     1  0.6717     0.4479 0.628 0.352 0.020
#> GSM254687     1  0.6717     0.4479 0.628 0.352 0.020
#> GSM254637     1  0.0592     0.8150 0.988 0.000 0.012
#> GSM254684     1  0.4887     0.7067 0.772 0.000 0.228
#> GSM254649     2  0.0000     0.9008 0.000 1.000 0.000
#> GSM254660     2  0.2356     0.8708 0.000 0.928 0.072
#> GSM254693     2  0.0000     0.9008 0.000 1.000 0.000
#> GSM254695     2  0.9468     0.2216 0.300 0.488 0.212
#> GSM254702     2  0.2537     0.8651 0.000 0.920 0.080
#> GSM254643     2  0.0592     0.8993 0.000 0.988 0.012
#> GSM254727     2  0.0000     0.9008 0.000 1.000 0.000
#> GSM254640     3  0.4605     0.7704 0.000 0.204 0.796
#> GSM254626     2  0.0000     0.9008 0.000 1.000 0.000
#> GSM254635     3  0.0892     0.9757 0.000 0.020 0.980
#> GSM254653     2  0.0000     0.9008 0.000 1.000 0.000
#> GSM254658     2  0.0592     0.8993 0.000 0.988 0.012
#> GSM254681     2  0.0892     0.8898 0.000 0.980 0.020
#> GSM254719     2  0.2356     0.8708 0.000 0.928 0.072
#> GSM254673     2  0.0000     0.9008 0.000 1.000 0.000
#> GSM254655     2  0.2356     0.8708 0.000 0.928 0.072
#> GSM254669     2  0.0000     0.9008 0.000 1.000 0.000
#> GSM254699     2  0.2356     0.8708 0.000 0.928 0.072
#> GSM254703     2  0.4399     0.7484 0.000 0.812 0.188
#> GSM254708     2  0.0424     0.9007 0.000 0.992 0.008
#> GSM254715     3  0.0892     0.9757 0.000 0.020 0.980
#> GSM254628     2  0.0000     0.9008 0.000 1.000 0.000
#> GSM254634     3  0.0892     0.9757 0.000 0.020 0.980
#> GSM254646     2  0.0000     0.9008 0.000 1.000 0.000
#> GSM254671     3  0.0892     0.9757 0.000 0.020 0.980
#> GSM254711     3  0.0892     0.9757 0.000 0.020 0.980
#> GSM254717     2  0.0424     0.9007 0.000 0.992 0.008
#> GSM254723     2  0.7581     0.1757 0.408 0.548 0.044
#> GSM254730     2  0.2356     0.8708 0.000 0.928 0.072
#> GSM254731     2  0.2537     0.8651 0.000 0.920 0.080
#> GSM254632     2  0.7665     0.0177 0.456 0.500 0.044
#> GSM254662     2  0.0000     0.9008 0.000 1.000 0.000
#> GSM254677     3  0.0892     0.9757 0.000 0.020 0.980
#> GSM254665     2  0.0424     0.9007 0.000 0.992 0.008
#> GSM254691     2  0.0424     0.9007 0.000 0.992 0.008
#> GSM254644     3  0.3482     0.8714 0.000 0.128 0.872
#> GSM254667     2  0.3826     0.7859 0.124 0.868 0.008
#> GSM254676     2  0.0424     0.9007 0.000 0.992 0.008
#> GSM254679     3  0.0892     0.9757 0.000 0.020 0.980
#> GSM254689     2  0.0892     0.8898 0.000 0.980 0.020
#> GSM254706     2  0.0424     0.9007 0.000 0.992 0.008
#> GSM254712     3  0.0892     0.9757 0.000 0.020 0.980
#> GSM254713     3  0.0892     0.9757 0.000 0.020 0.980
#> GSM254683     2  0.0892     0.8898 0.000 0.980 0.020
#> GSM254710     2  0.0892     0.8898 0.000 0.980 0.020
#> GSM254725     3  0.0892     0.9757 0.000 0.020 0.980
#> GSM254651     2  0.0424     0.9007 0.000 0.992 0.008
#> GSM254638     3  0.0892     0.9757 0.000 0.020 0.980
#> GSM254685     3  0.0892     0.9757 0.000 0.020 0.980

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM254629     3  0.0804     0.9099 0.012 0.000 0.980 0.008
#> GSM254648     3  0.0804     0.9099 0.012 0.000 0.980 0.008
#> GSM254694     3  0.0804     0.9099 0.012 0.000 0.980 0.008
#> GSM254701     3  0.0804     0.9099 0.012 0.000 0.980 0.008
#> GSM254728     3  0.0592     0.9086 0.016 0.000 0.984 0.000
#> GSM254726     2  0.5257     0.2335 0.000 0.548 0.444 0.008
#> GSM254639     3  0.5499     0.7252 0.072 0.000 0.712 0.216
#> GSM254652     3  0.0804     0.9099 0.012 0.000 0.980 0.008
#> GSM254700     3  0.1637     0.8959 0.060 0.000 0.940 0.000
#> GSM254625     1  0.1867     1.0000 0.928 0.000 0.072 0.000
#> GSM254636     3  0.1867     0.8911 0.072 0.000 0.928 0.000
#> GSM254659     3  0.0804     0.9099 0.012 0.000 0.980 0.008
#> GSM254680     3  0.1637     0.8959 0.060 0.000 0.940 0.000
#> GSM254686     3  0.1557     0.8977 0.056 0.000 0.944 0.000
#> GSM254718     3  0.1716     0.8957 0.000 0.000 0.936 0.064
#> GSM254674     3  0.1716     0.8934 0.064 0.000 0.936 0.000
#> GSM254668     1  0.1867     1.0000 0.928 0.000 0.072 0.000
#> GSM254697     3  0.1867     0.8939 0.072 0.000 0.928 0.000
#> GSM254704     3  0.3833     0.8576 0.072 0.000 0.848 0.080
#> GSM254707     1  0.1867     1.0000 0.928 0.000 0.072 0.000
#> GSM254714     3  0.1792     0.8940 0.000 0.000 0.932 0.068
#> GSM254722     3  0.1867     0.8939 0.072 0.000 0.928 0.000
#> GSM254627     3  0.1867     0.8911 0.072 0.000 0.928 0.000
#> GSM254630     3  0.0817     0.9079 0.024 0.000 0.976 0.000
#> GSM254633     3  0.3144     0.8779 0.072 0.000 0.884 0.044
#> GSM254670     3  0.5429     0.7348 0.072 0.000 0.720 0.208
#> GSM254716     1  0.1867     1.0000 0.928 0.000 0.072 0.000
#> GSM254720     3  0.0804     0.9099 0.012 0.000 0.980 0.008
#> GSM254729     3  0.1867     0.8919 0.000 0.000 0.928 0.072
#> GSM254654     3  0.1867     0.8919 0.000 0.000 0.928 0.072
#> GSM254656     3  0.4898     0.4395 0.000 0.000 0.584 0.416
#> GSM254631     3  0.3144     0.8779 0.072 0.000 0.884 0.044
#> GSM254657     3  0.4898     0.4395 0.000 0.000 0.584 0.416
#> GSM254664     3  0.1211     0.9039 0.040 0.000 0.960 0.000
#> GSM254672     3  0.3833     0.8576 0.072 0.000 0.848 0.080
#> GSM254692     1  0.1867     1.0000 0.928 0.000 0.072 0.000
#> GSM254645     3  0.4679     0.7804 0.044 0.000 0.772 0.184
#> GSM254666     3  0.0779     0.9093 0.016 0.000 0.980 0.004
#> GSM254675     3  0.1211     0.9039 0.040 0.000 0.960 0.000
#> GSM254678     3  0.2892     0.8833 0.068 0.000 0.896 0.036
#> GSM254688     1  0.1867     1.0000 0.928 0.000 0.072 0.000
#> GSM254690     3  0.1637     0.8959 0.060 0.000 0.940 0.000
#> GSM254696     3  0.1867     0.8911 0.072 0.000 0.928 0.000
#> GSM254705     1  0.1867     1.0000 0.928 0.000 0.072 0.000
#> GSM254642     3  0.1637     0.8959 0.060 0.000 0.940 0.000
#> GSM254661     3  0.0804     0.9099 0.012 0.000 0.980 0.008
#> GSM254698     3  0.1867     0.8911 0.072 0.000 0.928 0.000
#> GSM254641     3  0.0817     0.9079 0.024 0.000 0.976 0.000
#> GSM254647     3  0.1637     0.8959 0.060 0.000 0.940 0.000
#> GSM254663     1  0.1867     1.0000 0.928 0.000 0.072 0.000
#> GSM254682     1  0.1867     1.0000 0.928 0.000 0.072 0.000
#> GSM254709     1  0.1867     1.0000 0.928 0.000 0.072 0.000
#> GSM254721     3  0.1637     0.8959 0.060 0.000 0.940 0.000
#> GSM254724     3  0.1637     0.8959 0.060 0.000 0.940 0.000
#> GSM254650     1  0.1867     1.0000 0.928 0.000 0.072 0.000
#> GSM254687     1  0.1867     1.0000 0.928 0.000 0.072 0.000
#> GSM254637     3  0.1398     0.9048 0.040 0.000 0.956 0.004
#> GSM254684     3  0.4274     0.8403 0.072 0.000 0.820 0.108
#> GSM254649     2  0.0000     0.9015 0.000 1.000 0.000 0.000
#> GSM254660     2  0.1867     0.8726 0.000 0.928 0.000 0.072
#> GSM254693     2  0.0000     0.9015 0.000 1.000 0.000 0.000
#> GSM254695     2  0.7375     0.2768 0.000 0.488 0.336 0.176
#> GSM254702     2  0.2011     0.8667 0.000 0.920 0.000 0.080
#> GSM254643     2  0.0469     0.9008 0.000 0.988 0.000 0.012
#> GSM254727     2  0.0000     0.9015 0.000 1.000 0.000 0.000
#> GSM254640     4  0.3649     0.7321 0.000 0.204 0.000 0.796
#> GSM254626     2  0.0000     0.9015 0.000 1.000 0.000 0.000
#> GSM254635     4  0.0000     0.9663 0.000 0.000 0.000 1.000
#> GSM254653     2  0.0000     0.9015 0.000 1.000 0.000 0.000
#> GSM254658     2  0.0469     0.9008 0.000 0.988 0.000 0.012
#> GSM254681     2  0.0707     0.8932 0.020 0.980 0.000 0.000
#> GSM254719     2  0.1867     0.8726 0.000 0.928 0.000 0.072
#> GSM254673     2  0.0000     0.9015 0.000 1.000 0.000 0.000
#> GSM254655     2  0.1867     0.8726 0.000 0.928 0.000 0.072
#> GSM254669     2  0.0000     0.9015 0.000 1.000 0.000 0.000
#> GSM254699     2  0.1867     0.8726 0.000 0.928 0.000 0.072
#> GSM254703     2  0.3486     0.7492 0.000 0.812 0.000 0.188
#> GSM254708     2  0.0336     0.9018 0.000 0.992 0.000 0.008
#> GSM254715     4  0.0000     0.9663 0.000 0.000 0.000 1.000
#> GSM254628     2  0.0000     0.9015 0.000 1.000 0.000 0.000
#> GSM254634     4  0.0000     0.9663 0.000 0.000 0.000 1.000
#> GSM254646     2  0.0000     0.9015 0.000 1.000 0.000 0.000
#> GSM254671     4  0.0000     0.9663 0.000 0.000 0.000 1.000
#> GSM254711     4  0.0000     0.9663 0.000 0.000 0.000 1.000
#> GSM254717     2  0.0336     0.9018 0.000 0.992 0.000 0.008
#> GSM254723     2  0.5257     0.2335 0.000 0.548 0.444 0.008
#> GSM254730     2  0.1867     0.8726 0.000 0.928 0.000 0.072
#> GSM254731     2  0.2011     0.8667 0.000 0.920 0.000 0.080
#> GSM254632     2  0.5296     0.0898 0.000 0.500 0.492 0.008
#> GSM254662     2  0.0000     0.9015 0.000 1.000 0.000 0.000
#> GSM254677     4  0.0000     0.9663 0.000 0.000 0.000 1.000
#> GSM254665     2  0.0336     0.9018 0.000 0.992 0.000 0.008
#> GSM254691     2  0.0336     0.9018 0.000 0.992 0.000 0.008
#> GSM254644     4  0.2760     0.8291 0.000 0.128 0.000 0.872
#> GSM254667     2  0.3032     0.7874 0.000 0.868 0.124 0.008
#> GSM254676     2  0.0336     0.9018 0.000 0.992 0.000 0.008
#> GSM254679     4  0.0000     0.9663 0.000 0.000 0.000 1.000
#> GSM254689     2  0.0707     0.8932 0.020 0.980 0.000 0.000
#> GSM254706     2  0.0336     0.9018 0.000 0.992 0.000 0.008
#> GSM254712     4  0.0000     0.9663 0.000 0.000 0.000 1.000
#> GSM254713     4  0.0000     0.9663 0.000 0.000 0.000 1.000
#> GSM254683     2  0.0707     0.8932 0.020 0.980 0.000 0.000
#> GSM254710     2  0.0817     0.8909 0.024 0.976 0.000 0.000
#> GSM254725     4  0.0000     0.9663 0.000 0.000 0.000 1.000
#> GSM254651     2  0.0336     0.9018 0.000 0.992 0.000 0.008
#> GSM254638     4  0.0000     0.9663 0.000 0.000 0.000 1.000
#> GSM254685     4  0.0000     0.9663 0.000 0.000 0.000 1.000

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM254629     3  0.3508      0.724 0.252 0.000 0.748 0.000 0.000
#> GSM254648     3  0.3508      0.724 0.252 0.000 0.748 0.000 0.000
#> GSM254694     3  0.3774      0.691 0.296 0.000 0.704 0.000 0.000
#> GSM254701     3  0.3816      0.680 0.304 0.000 0.696 0.000 0.000
#> GSM254728     3  0.4029      0.659 0.316 0.000 0.680 0.000 0.004
#> GSM254726     2  0.5378      0.270 0.060 0.548 0.392 0.000 0.000
#> GSM254639     3  0.4289      0.517 0.176 0.000 0.760 0.064 0.000
#> GSM254652     3  0.3534      0.722 0.256 0.000 0.744 0.000 0.000
#> GSM254700     1  0.3794      0.750 0.800 0.000 0.152 0.000 0.048
#> GSM254625     5  0.0000      1.000 0.000 0.000 0.000 0.000 1.000
#> GSM254636     1  0.0794      0.740 0.972 0.000 0.028 0.000 0.000
#> GSM254659     3  0.3774      0.691 0.296 0.000 0.704 0.000 0.000
#> GSM254680     1  0.4394      0.722 0.732 0.000 0.220 0.000 0.048
#> GSM254686     1  0.4325      0.722 0.736 0.000 0.220 0.000 0.044
#> GSM254718     3  0.2848      0.726 0.156 0.000 0.840 0.004 0.000
#> GSM254674     1  0.4490      0.717 0.724 0.000 0.224 0.000 0.052
#> GSM254668     5  0.0000      1.000 0.000 0.000 0.000 0.000 1.000
#> GSM254697     1  0.0404      0.749 0.988 0.000 0.012 0.000 0.000
#> GSM254704     1  0.3480      0.581 0.752 0.000 0.248 0.000 0.000
#> GSM254707     5  0.0000      1.000 0.000 0.000 0.000 0.000 1.000
#> GSM254714     3  0.2806      0.724 0.152 0.000 0.844 0.004 0.000
#> GSM254722     1  0.0609      0.748 0.980 0.000 0.020 0.000 0.000
#> GSM254627     1  0.0404      0.745 0.988 0.000 0.012 0.000 0.000
#> GSM254630     1  0.4505      0.420 0.604 0.000 0.384 0.000 0.012
#> GSM254633     1  0.2732      0.672 0.840 0.000 0.160 0.000 0.000
#> GSM254670     3  0.4429      0.518 0.192 0.000 0.744 0.064 0.000
#> GSM254716     5  0.0000      1.000 0.000 0.000 0.000 0.000 1.000
#> GSM254720     3  0.4138      0.500 0.384 0.000 0.616 0.000 0.000
#> GSM254729     3  0.2719      0.723 0.144 0.000 0.852 0.004 0.000
#> GSM254654     3  0.2719      0.723 0.144 0.000 0.852 0.004 0.000
#> GSM254656     3  0.4348      0.361 0.016 0.000 0.668 0.316 0.000
#> GSM254631     1  0.2732      0.672 0.840 0.000 0.160 0.000 0.000
#> GSM254657     3  0.4348      0.361 0.016 0.000 0.668 0.316 0.000
#> GSM254664     1  0.3910      0.737 0.772 0.000 0.196 0.000 0.032
#> GSM254672     1  0.3480      0.581 0.752 0.000 0.248 0.000 0.000
#> GSM254692     5  0.0000      1.000 0.000 0.000 0.000 0.000 1.000
#> GSM254645     3  0.3657      0.622 0.116 0.000 0.820 0.064 0.000
#> GSM254666     3  0.3990      0.667 0.308 0.000 0.688 0.000 0.004
#> GSM254675     1  0.3977      0.733 0.764 0.000 0.204 0.000 0.032
#> GSM254678     1  0.2561      0.718 0.856 0.000 0.144 0.000 0.000
#> GSM254688     5  0.0000      1.000 0.000 0.000 0.000 0.000 1.000
#> GSM254690     1  0.4394      0.722 0.732 0.000 0.220 0.000 0.048
#> GSM254696     1  0.0510      0.745 0.984 0.000 0.016 0.000 0.000
#> GSM254705     5  0.0000      1.000 0.000 0.000 0.000 0.000 1.000
#> GSM254642     1  0.3794      0.750 0.800 0.000 0.152 0.000 0.048
#> GSM254661     3  0.3508      0.724 0.252 0.000 0.748 0.000 0.000
#> GSM254698     1  0.0510      0.743 0.984 0.000 0.016 0.000 0.000
#> GSM254641     1  0.4505      0.420 0.604 0.000 0.384 0.000 0.012
#> GSM254647     1  0.3794      0.750 0.800 0.000 0.152 0.000 0.048
#> GSM254663     5  0.0000      1.000 0.000 0.000 0.000 0.000 1.000
#> GSM254682     5  0.0000      1.000 0.000 0.000 0.000 0.000 1.000
#> GSM254709     5  0.0000      1.000 0.000 0.000 0.000 0.000 1.000
#> GSM254721     1  0.3794      0.750 0.800 0.000 0.152 0.000 0.048
#> GSM254724     1  0.3794      0.750 0.800 0.000 0.152 0.000 0.048
#> GSM254650     5  0.0000      1.000 0.000 0.000 0.000 0.000 1.000
#> GSM254687     5  0.0000      1.000 0.000 0.000 0.000 0.000 1.000
#> GSM254637     1  0.4073      0.726 0.752 0.000 0.216 0.000 0.032
#> GSM254684     1  0.3969      0.519 0.692 0.000 0.304 0.004 0.000
#> GSM254649     2  0.0880      0.901 0.000 0.968 0.032 0.000 0.000
#> GSM254660     2  0.1608      0.877 0.000 0.928 0.000 0.072 0.000
#> GSM254693     2  0.0880      0.901 0.000 0.968 0.032 0.000 0.000
#> GSM254695     2  0.6859      0.258 0.024 0.488 0.320 0.168 0.000
#> GSM254702     2  0.1732      0.872 0.000 0.920 0.000 0.080 0.000
#> GSM254643     2  0.0404      0.901 0.000 0.988 0.000 0.012 0.000
#> GSM254727     2  0.0880      0.901 0.000 0.968 0.032 0.000 0.000
#> GSM254640     4  0.3143      0.739 0.000 0.204 0.000 0.796 0.000
#> GSM254626     2  0.0880      0.901 0.000 0.968 0.032 0.000 0.000
#> GSM254635     4  0.0162      0.966 0.000 0.000 0.004 0.996 0.000
#> GSM254653     2  0.0880      0.901 0.000 0.968 0.032 0.000 0.000
#> GSM254658     2  0.0404      0.901 0.000 0.988 0.000 0.012 0.000
#> GSM254681     2  0.1648      0.890 0.000 0.940 0.040 0.000 0.020
#> GSM254719     2  0.1608      0.877 0.000 0.928 0.000 0.072 0.000
#> GSM254673     2  0.0880      0.901 0.000 0.968 0.032 0.000 0.000
#> GSM254655     2  0.1608      0.877 0.000 0.928 0.000 0.072 0.000
#> GSM254669     2  0.0880      0.901 0.000 0.968 0.032 0.000 0.000
#> GSM254699     2  0.1608      0.877 0.000 0.928 0.000 0.072 0.000
#> GSM254703     2  0.3003      0.759 0.000 0.812 0.000 0.188 0.000
#> GSM254708     2  0.0290      0.902 0.000 0.992 0.000 0.008 0.000
#> GSM254715     4  0.0162      0.966 0.000 0.000 0.004 0.996 0.000
#> GSM254628     2  0.0703      0.901 0.000 0.976 0.024 0.000 0.000
#> GSM254634     4  0.0162      0.966 0.000 0.000 0.004 0.996 0.000
#> GSM254646     2  0.0880      0.901 0.000 0.968 0.032 0.000 0.000
#> GSM254671     4  0.0000      0.966 0.000 0.000 0.000 1.000 0.000
#> GSM254711     4  0.0000      0.966 0.000 0.000 0.000 1.000 0.000
#> GSM254717     2  0.0290      0.902 0.000 0.992 0.000 0.008 0.000
#> GSM254723     2  0.5378      0.270 0.060 0.548 0.392 0.000 0.000
#> GSM254730     2  0.1608      0.877 0.000 0.928 0.000 0.072 0.000
#> GSM254731     2  0.1732      0.872 0.000 0.920 0.000 0.080 0.000
#> GSM254632     2  0.5542      0.117 0.068 0.500 0.432 0.000 0.000
#> GSM254662     2  0.0880      0.901 0.000 0.968 0.032 0.000 0.000
#> GSM254677     4  0.0162      0.966 0.000 0.000 0.004 0.996 0.000
#> GSM254665     2  0.0290      0.902 0.000 0.992 0.000 0.008 0.000
#> GSM254691     2  0.0290      0.902 0.000 0.992 0.000 0.008 0.000
#> GSM254644     4  0.2377      0.837 0.000 0.128 0.000 0.872 0.000
#> GSM254667     2  0.2612      0.824 0.000 0.868 0.124 0.008 0.000
#> GSM254676     2  0.0290      0.902 0.000 0.992 0.000 0.008 0.000
#> GSM254679     4  0.0000      0.966 0.000 0.000 0.000 1.000 0.000
#> GSM254689     2  0.1648      0.890 0.000 0.940 0.040 0.000 0.020
#> GSM254706     2  0.0290      0.902 0.000 0.992 0.000 0.008 0.000
#> GSM254712     4  0.0162      0.966 0.000 0.000 0.004 0.996 0.000
#> GSM254713     4  0.0162      0.966 0.000 0.000 0.004 0.996 0.000
#> GSM254683     2  0.1648      0.890 0.000 0.940 0.040 0.000 0.020
#> GSM254710     2  0.1741      0.888 0.000 0.936 0.040 0.000 0.024
#> GSM254725     4  0.0000      0.966 0.000 0.000 0.000 1.000 0.000
#> GSM254651     2  0.0290      0.902 0.000 0.992 0.000 0.008 0.000
#> GSM254638     4  0.0162      0.966 0.000 0.000 0.004 0.996 0.000
#> GSM254685     4  0.0000      0.966 0.000 0.000 0.000 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5 p6
#> GSM254629     3  0.1204      0.722 0.056 0.000 0.944 0.000 0.000 NA
#> GSM254648     3  0.1204      0.722 0.056 0.000 0.944 0.000 0.000 NA
#> GSM254694     3  0.1814      0.708 0.100 0.000 0.900 0.000 0.000 NA
#> GSM254701     3  0.1910      0.702 0.108 0.000 0.892 0.000 0.000 NA
#> GSM254728     3  0.2178      0.686 0.132 0.000 0.868 0.000 0.000 NA
#> GSM254726     2  0.4103      0.294 0.004 0.544 0.448 0.000 0.000 NA
#> GSM254639     3  0.4801      0.472 0.016 0.000 0.484 0.024 0.000 NA
#> GSM254652     3  0.1267      0.721 0.060 0.000 0.940 0.000 0.000 NA
#> GSM254700     1  0.3073      0.757 0.816 0.000 0.164 0.000 0.016 NA
#> GSM254625     5  0.0000      1.000 0.000 0.000 0.000 0.000 1.000 NA
#> GSM254636     1  0.1682      0.761 0.928 0.000 0.020 0.000 0.000 NA
#> GSM254659     3  0.1814      0.708 0.100 0.000 0.900 0.000 0.000 NA
#> GSM254680     1  0.3990      0.659 0.676 0.000 0.304 0.000 0.016 NA
#> GSM254686     1  0.3903      0.659 0.680 0.000 0.304 0.000 0.012 NA
#> GSM254718     3  0.2402      0.706 0.012 0.000 0.868 0.000 0.000 NA
#> GSM254674     1  0.4106      0.649 0.664 0.000 0.312 0.000 0.020 NA
#> GSM254668     5  0.0000      1.000 0.000 0.000 0.000 0.000 1.000 NA
#> GSM254697     1  0.1334      0.768 0.948 0.000 0.020 0.000 0.000 NA
#> GSM254704     1  0.4254      0.640 0.712 0.000 0.072 0.000 0.000 NA
#> GSM254707     5  0.0000      1.000 0.000 0.000 0.000 0.000 1.000 NA
#> GSM254714     3  0.2624      0.705 0.020 0.000 0.856 0.000 0.000 NA
#> GSM254722     1  0.1644      0.767 0.932 0.000 0.028 0.000 0.000 NA
#> GSM254627     1  0.1124      0.765 0.956 0.000 0.008 0.000 0.000 NA
#> GSM254630     3  0.4051     -0.109 0.432 0.000 0.560 0.000 0.008 NA
#> GSM254633     1  0.3470      0.711 0.796 0.000 0.052 0.000 0.000 NA
#> GSM254670     3  0.4874      0.472 0.020 0.000 0.484 0.024 0.000 NA
#> GSM254716     5  0.0000      1.000 0.000 0.000 0.000 0.000 1.000 NA
#> GSM254720     3  0.2871      0.599 0.192 0.000 0.804 0.000 0.000 NA
#> GSM254729     3  0.2489      0.703 0.012 0.000 0.860 0.000 0.000 NA
#> GSM254654     3  0.2489      0.703 0.012 0.000 0.860 0.000 0.000 NA
#> GSM254656     3  0.6082      0.317 0.008 0.000 0.476 0.276 0.000 NA
#> GSM254631     1  0.3470      0.711 0.796 0.000 0.052 0.000 0.000 NA
#> GSM254657     3  0.6082      0.317 0.008 0.000 0.476 0.276 0.000 NA
#> GSM254664     1  0.3404      0.718 0.744 0.000 0.248 0.000 0.004 NA
#> GSM254672     1  0.4254      0.640 0.712 0.000 0.072 0.000 0.000 NA
#> GSM254692     5  0.0000      1.000 0.000 0.000 0.000 0.000 1.000 NA
#> GSM254645     3  0.4499      0.571 0.012 0.000 0.620 0.024 0.000 NA
#> GSM254666     3  0.2178      0.686 0.132 0.000 0.868 0.000 0.000 NA
#> GSM254675     1  0.3560      0.711 0.732 0.000 0.256 0.000 0.004 NA
#> GSM254678     1  0.3341      0.744 0.816 0.000 0.068 0.000 0.000 NA
#> GSM254688     5  0.0000      1.000 0.000 0.000 0.000 0.000 1.000 NA
#> GSM254690     1  0.3990      0.659 0.676 0.000 0.304 0.000 0.016 NA
#> GSM254696     1  0.1398      0.764 0.940 0.000 0.008 0.000 0.000 NA
#> GSM254705     5  0.0000      1.000 0.000 0.000 0.000 0.000 1.000 NA
#> GSM254642     1  0.3073      0.757 0.816 0.000 0.164 0.000 0.016 NA
#> GSM254661     3  0.1204      0.722 0.056 0.000 0.944 0.000 0.000 NA
#> GSM254698     1  0.1461      0.764 0.940 0.000 0.016 0.000 0.000 NA
#> GSM254641     3  0.4051     -0.109 0.432 0.000 0.560 0.000 0.008 NA
#> GSM254647     1  0.3073      0.757 0.816 0.000 0.164 0.000 0.016 NA
#> GSM254663     5  0.0000      1.000 0.000 0.000 0.000 0.000 1.000 NA
#> GSM254682     5  0.0000      1.000 0.000 0.000 0.000 0.000 1.000 NA
#> GSM254709     5  0.0000      1.000 0.000 0.000 0.000 0.000 1.000 NA
#> GSM254721     1  0.3073      0.757 0.816 0.000 0.164 0.000 0.016 NA
#> GSM254724     1  0.3073      0.757 0.816 0.000 0.164 0.000 0.016 NA
#> GSM254650     5  0.0000      1.000 0.000 0.000 0.000 0.000 1.000 NA
#> GSM254687     5  0.0000      1.000 0.000 0.000 0.000 0.000 1.000 NA
#> GSM254637     1  0.3650      0.699 0.716 0.000 0.272 0.000 0.004 NA
#> GSM254684     1  0.5241      0.516 0.532 0.000 0.104 0.000 0.000 NA
#> GSM254649     2  0.2697      0.805 0.000 0.812 0.000 0.000 0.000 NA
#> GSM254660     2  0.1500      0.817 0.000 0.936 0.000 0.012 0.000 NA
#> GSM254693     2  0.2562      0.811 0.000 0.828 0.000 0.000 0.000 NA
#> GSM254695     2  0.6018      0.276 0.000 0.488 0.344 0.148 0.000 NA
#> GSM254702     2  0.1682      0.814 0.000 0.928 0.000 0.020 0.000 NA
#> GSM254643     2  0.0146      0.832 0.000 0.996 0.000 0.000 0.000 NA
#> GSM254727     2  0.2454      0.814 0.000 0.840 0.000 0.000 0.000 NA
#> GSM254640     4  0.3952      0.725 0.000 0.212 0.000 0.736 0.000 NA
#> GSM254626     2  0.2697      0.805 0.000 0.812 0.000 0.000 0.000 NA
#> GSM254635     4  0.0260      0.946 0.000 0.000 0.000 0.992 0.000 NA
#> GSM254653     2  0.2454      0.814 0.000 0.840 0.000 0.000 0.000 NA
#> GSM254658     2  0.0146      0.832 0.000 0.996 0.000 0.000 0.000 NA
#> GSM254681     2  0.3843      0.625 0.000 0.548 0.000 0.000 0.000 NA
#> GSM254719     2  0.1500      0.817 0.000 0.936 0.000 0.012 0.000 NA
#> GSM254673     2  0.2454      0.814 0.000 0.840 0.000 0.000 0.000 NA
#> GSM254655     2  0.1500      0.817 0.000 0.936 0.000 0.012 0.000 NA
#> GSM254669     2  0.2562      0.811 0.000 0.828 0.000 0.000 0.000 NA
#> GSM254699     2  0.1500      0.817 0.000 0.936 0.000 0.012 0.000 NA
#> GSM254703     2  0.3190      0.730 0.000 0.820 0.000 0.136 0.000 NA
#> GSM254708     2  0.0000      0.832 0.000 1.000 0.000 0.000 0.000 NA
#> GSM254715     4  0.0713      0.947 0.000 0.000 0.000 0.972 0.000 NA
#> GSM254628     2  0.2378      0.816 0.000 0.848 0.000 0.000 0.000 NA
#> GSM254634     4  0.0363      0.945 0.000 0.000 0.000 0.988 0.000 NA
#> GSM254646     2  0.2697      0.805 0.000 0.812 0.000 0.000 0.000 NA
#> GSM254671     4  0.1152      0.939 0.000 0.004 0.000 0.952 0.000 NA
#> GSM254711     4  0.1152      0.939 0.000 0.004 0.000 0.952 0.000 NA
#> GSM254717     2  0.0000      0.832 0.000 1.000 0.000 0.000 0.000 NA
#> GSM254723     2  0.4103      0.294 0.004 0.544 0.448 0.000 0.000 NA
#> GSM254730     2  0.1500      0.817 0.000 0.936 0.000 0.012 0.000 NA
#> GSM254731     2  0.1682      0.814 0.000 0.928 0.000 0.020 0.000 NA
#> GSM254632     2  0.4129      0.147 0.004 0.496 0.496 0.000 0.000 NA
#> GSM254662     2  0.2454      0.814 0.000 0.840 0.000 0.000 0.000 NA
#> GSM254677     4  0.0363      0.945 0.000 0.000 0.000 0.988 0.000 NA
#> GSM254665     2  0.0000      0.832 0.000 1.000 0.000 0.000 0.000 NA
#> GSM254691     2  0.0000      0.832 0.000 1.000 0.000 0.000 0.000 NA
#> GSM254644     4  0.3190      0.821 0.000 0.136 0.000 0.820 0.000 NA
#> GSM254667     2  0.2234      0.773 0.000 0.872 0.124 0.000 0.000 NA
#> GSM254676     2  0.0000      0.832 0.000 1.000 0.000 0.000 0.000 NA
#> GSM254679     4  0.0146      0.947 0.000 0.000 0.000 0.996 0.000 NA
#> GSM254689     2  0.3843      0.625 0.000 0.548 0.000 0.000 0.000 NA
#> GSM254706     2  0.0000      0.832 0.000 1.000 0.000 0.000 0.000 NA
#> GSM254712     4  0.0363      0.945 0.000 0.000 0.000 0.988 0.000 NA
#> GSM254713     4  0.0713      0.947 0.000 0.000 0.000 0.972 0.000 NA
#> GSM254683     2  0.3847      0.622 0.000 0.544 0.000 0.000 0.000 NA
#> GSM254710     2  0.3979      0.619 0.000 0.540 0.000 0.000 0.004 NA
#> GSM254725     4  0.0603      0.946 0.000 0.004 0.000 0.980 0.000 NA
#> GSM254651     2  0.0000      0.832 0.000 1.000 0.000 0.000 0.000 NA
#> GSM254638     4  0.0363      0.945 0.000 0.000 0.000 0.988 0.000 NA
#> GSM254685     4  0.0865      0.943 0.000 0.000 0.000 0.964 0.000 NA

Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.

consensus_heatmap(res, k = 2)

plot of chunk tab-ATC-hclust-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-ATC-hclust-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-ATC-hclust-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-ATC-hclust-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-ATC-hclust-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-ATC-hclust-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-ATC-hclust-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-ATC-hclust-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-ATC-hclust-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-ATC-hclust-membership-heatmap-5

As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

plot of chunk tab-ATC-hclust-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-ATC-hclust-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-ATC-hclust-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-ATC-hclust-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-ATC-hclust-get-signatures-5

Signature heatmaps where rows are not scaled:

get_signatures(res, k = 2, scale_rows = FALSE)

plot of chunk tab-ATC-hclust-get-signatures-no-scale-1

get_signatures(res, k = 3, scale_rows = FALSE)

plot of chunk tab-ATC-hclust-get-signatures-no-scale-2

get_signatures(res, k = 4, scale_rows = FALSE)

plot of chunk tab-ATC-hclust-get-signatures-no-scale-3

get_signatures(res, k = 5, scale_rows = FALSE)

plot of chunk tab-ATC-hclust-get-signatures-no-scale-4

get_signatures(res, k = 6, scale_rows = FALSE)

plot of chunk tab-ATC-hclust-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk ATC-hclust-signature_compare

get_signature() returns a data frame invisibly. TO get the list of signatures, the function call should be assigned to a variable explicitly. In following code, if plot argument is set to FALSE, no heatmap is plotted while only the differential analysis is performed.

# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)

An example of the output of tb is:

#>   which_row         fdr    mean_1    mean_2 scaled_mean_1 scaled_mean_2 km
#> 1        38 0.042760348  8.373488  9.131774    -0.5533452     0.5164555  1
#> 2        40 0.018707592  7.106213  8.469186    -0.6173731     0.5762149  1
#> 3        55 0.019134737 10.221463 11.207825    -0.6159697     0.5749050  1
#> 4        59 0.006059896  5.921854  7.869574    -0.6899429     0.6439467  1
#> 5        60 0.018055526  8.928898 10.211722    -0.6204761     0.5791110  1
#> 6        98 0.009384629 15.714769 14.887706     0.6635654    -0.6193277  2
...

The columns in tb are:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. km: Row groups if k-means clustering is applied to rows.

UMAP plot which shows how samples are separated.

dimension_reduction(res, k = 2, method = "UMAP")

plot of chunk tab-ATC-hclust-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-ATC-hclust-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-ATC-hclust-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-ATC-hclust-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-ATC-hclust-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk ATC-hclust-collect-classes

Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.

test_to_known_factors(res)
#>              n tissue(p) individual(p) disease.state(p) gender(p) other(p) k
#> ATC:hclust  97  2.04e-04        0.3347            0.382    0.3506    0.902 2
#> ATC:hclust  89  4.72e-20        0.5283            0.663    0.2864    0.875 3
#> ATC:hclust 101  9.47e-22        0.2453            0.798    0.3595    0.884 4
#> ATC:hclust  99  1.61e-20        0.0753            0.776    0.0890    0.718 5
#> ATC:hclust  97  4.28e-20        0.0984            0.768    0.0864    0.772 6

If matrix rows can be associated to genes, consider to use functional_enrichment(res, ...) to perform function enrichment for the signature genes. See this vignette for more detailed explanations.


ATC:kmeans**

The object with results only for a single top-value method and a single partition method can be extracted as:

res = res_list["ATC", "kmeans"]
# you can also extract it by
# res = res_list["ATC:kmeans"]

A summary of res and all the functions that can be applied to it:

res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#>   On a matrix with 21168 rows and 107 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.975       0.990         0.5028 0.497   0.497
#> 3 3 0.716           0.743       0.812         0.2663 0.816   0.646
#> 4 4 0.811           0.850       0.911         0.1491 0.888   0.696
#> 5 5 0.746           0.613       0.757         0.0753 0.958   0.847
#> 6 6 0.771           0.755       0.796         0.0475 0.889   0.583

suggest_best_k() suggests the best \(k\) based on these statistics. The rules are as follows:

suggest_best_k(res)
#> [1] 2

Following shows the table of the partitions (You need to click the show/hide code output link to see it). The membership matrix (columns with name p*) is inferred by clue::cl_consensus() function with the SE method. Basically the value in the membership matrix represents the probability to belong to a certain group. The finall class label for an item is determined with the group with highest probability it belongs to.

In get_classes() function, the entropy is calculated from the membership matrix and the silhouette score is calculated from the consensus matrix.

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>           class entropy silhouette    p1    p2
#> GSM254629     1  0.0000      0.990 1.000 0.000
#> GSM254648     2  0.9000      0.536 0.316 0.684
#> GSM254694     1  0.0000      0.990 1.000 0.000
#> GSM254701     1  0.0000      0.990 1.000 0.000
#> GSM254728     1  0.0000      0.990 1.000 0.000
#> GSM254726     2  0.7674      0.708 0.224 0.776
#> GSM254639     1  0.0000      0.990 1.000 0.000
#> GSM254652     1  0.0000      0.990 1.000 0.000
#> GSM254700     1  0.0000      0.990 1.000 0.000
#> GSM254625     1  0.0000      0.990 1.000 0.000
#> GSM254636     1  0.0000      0.990 1.000 0.000
#> GSM254659     1  0.0000      0.990 1.000 0.000
#> GSM254680     1  0.0000      0.990 1.000 0.000
#> GSM254686     1  0.0000      0.990 1.000 0.000
#> GSM254718     1  0.0000      0.990 1.000 0.000
#> GSM254674     1  0.0000      0.990 1.000 0.000
#> GSM254668     1  0.0000      0.990 1.000 0.000
#> GSM254697     1  0.0000      0.990 1.000 0.000
#> GSM254704     1  0.0000      0.990 1.000 0.000
#> GSM254707     1  0.0000      0.990 1.000 0.000
#> GSM254714     1  0.0000      0.990 1.000 0.000
#> GSM254722     1  0.0000      0.990 1.000 0.000
#> GSM254627     1  0.0000      0.990 1.000 0.000
#> GSM254630     1  0.0000      0.990 1.000 0.000
#> GSM254633     1  0.0000      0.990 1.000 0.000
#> GSM254670     1  0.0000      0.990 1.000 0.000
#> GSM254716     1  0.0000      0.990 1.000 0.000
#> GSM254720     1  0.0000      0.990 1.000 0.000
#> GSM254729     1  0.0000      0.990 1.000 0.000
#> GSM254654     1  0.0000      0.990 1.000 0.000
#> GSM254656     1  0.9286      0.468 0.656 0.344
#> GSM254631     1  0.0000      0.990 1.000 0.000
#> GSM254657     1  0.0000      0.990 1.000 0.000
#> GSM254664     1  0.0000      0.990 1.000 0.000
#> GSM254672     1  0.0000      0.990 1.000 0.000
#> GSM254692     1  0.0000      0.990 1.000 0.000
#> GSM254645     1  0.0000      0.990 1.000 0.000
#> GSM254666     1  0.0000      0.990 1.000 0.000
#> GSM254675     1  0.0000      0.990 1.000 0.000
#> GSM254678     1  0.0000      0.990 1.000 0.000
#> GSM254688     1  0.0000      0.990 1.000 0.000
#> GSM254690     1  0.0000      0.990 1.000 0.000
#> GSM254696     1  0.0000      0.990 1.000 0.000
#> GSM254705     1  0.0000      0.990 1.000 0.000
#> GSM254642     1  0.0000      0.990 1.000 0.000
#> GSM254661     1  0.0000      0.990 1.000 0.000
#> GSM254698     1  0.0000      0.990 1.000 0.000
#> GSM254641     1  0.0000      0.990 1.000 0.000
#> GSM254647     1  0.0000      0.990 1.000 0.000
#> GSM254663     1  0.0000      0.990 1.000 0.000
#> GSM254682     1  0.0000      0.990 1.000 0.000
#> GSM254709     1  0.0000      0.990 1.000 0.000
#> GSM254721     1  0.0000      0.990 1.000 0.000
#> GSM254724     1  0.0000      0.990 1.000 0.000
#> GSM254650     1  0.0000      0.990 1.000 0.000
#> GSM254687     1  0.0000      0.990 1.000 0.000
#> GSM254637     1  0.0000      0.990 1.000 0.000
#> GSM254684     1  0.0000      0.990 1.000 0.000
#> GSM254649     2  0.0000      0.989 0.000 1.000
#> GSM254660     2  0.0000      0.989 0.000 1.000
#> GSM254693     2  0.0000      0.989 0.000 1.000
#> GSM254695     2  0.0000      0.989 0.000 1.000
#> GSM254702     2  0.0000      0.989 0.000 1.000
#> GSM254643     2  0.0000      0.989 0.000 1.000
#> GSM254727     2  0.0000      0.989 0.000 1.000
#> GSM254640     2  0.0000      0.989 0.000 1.000
#> GSM254626     2  0.0000      0.989 0.000 1.000
#> GSM254635     2  0.0000      0.989 0.000 1.000
#> GSM254653     2  0.0000      0.989 0.000 1.000
#> GSM254658     2  0.0000      0.989 0.000 1.000
#> GSM254681     2  0.0000      0.989 0.000 1.000
#> GSM254719     2  0.0000      0.989 0.000 1.000
#> GSM254673     2  0.0000      0.989 0.000 1.000
#> GSM254655     2  0.0000      0.989 0.000 1.000
#> GSM254669     2  0.0000      0.989 0.000 1.000
#> GSM254699     2  0.0000      0.989 0.000 1.000
#> GSM254703     2  0.0000      0.989 0.000 1.000
#> GSM254708     2  0.0000      0.989 0.000 1.000
#> GSM254715     2  0.0000      0.989 0.000 1.000
#> GSM254628     2  0.0000      0.989 0.000 1.000
#> GSM254634     2  0.0000      0.989 0.000 1.000
#> GSM254646     2  0.0000      0.989 0.000 1.000
#> GSM254671     2  0.0000      0.989 0.000 1.000
#> GSM254711     2  0.0000      0.989 0.000 1.000
#> GSM254717     2  0.0000      0.989 0.000 1.000
#> GSM254723     2  0.0000      0.989 0.000 1.000
#> GSM254730     2  0.0000      0.989 0.000 1.000
#> GSM254731     2  0.0000      0.989 0.000 1.000
#> GSM254632     1  0.7528      0.720 0.784 0.216
#> GSM254662     2  0.0000      0.989 0.000 1.000
#> GSM254677     2  0.0000      0.989 0.000 1.000
#> GSM254665     2  0.0000      0.989 0.000 1.000
#> GSM254691     2  0.0000      0.989 0.000 1.000
#> GSM254644     2  0.0000      0.989 0.000 1.000
#> GSM254667     2  0.0000      0.989 0.000 1.000
#> GSM254676     2  0.0000      0.989 0.000 1.000
#> GSM254679     2  0.0000      0.989 0.000 1.000
#> GSM254689     2  0.0000      0.989 0.000 1.000
#> GSM254706     2  0.0000      0.989 0.000 1.000
#> GSM254712     2  0.0000      0.989 0.000 1.000
#> GSM254713     2  0.0000      0.989 0.000 1.000
#> GSM254683     2  0.0000      0.989 0.000 1.000
#> GSM254710     2  0.0376      0.985 0.004 0.996
#> GSM254725     2  0.0000      0.989 0.000 1.000
#> GSM254651     2  0.0000      0.989 0.000 1.000
#> GSM254638     2  0.0000      0.989 0.000 1.000
#> GSM254685     2  0.0000      0.989 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
#> GSM254629     3  0.0237      0.819 0.004 0.000 0.996
#> GSM254648     3  0.7065      0.258 0.032 0.352 0.616
#> GSM254694     3  0.0000      0.821 0.000 0.000 1.000
#> GSM254701     3  0.0000      0.821 0.000 0.000 1.000
#> GSM254728     3  0.4796      0.362 0.220 0.000 0.780
#> GSM254726     2  0.4452      0.692 0.000 0.808 0.192
#> GSM254639     3  0.5785      0.479 0.332 0.000 0.668
#> GSM254652     3  0.0237      0.819 0.004 0.000 0.996
#> GSM254700     3  0.6079     -0.361 0.388 0.000 0.612
#> GSM254625     1  0.6079      0.866 0.612 0.000 0.388
#> GSM254636     3  0.0237      0.821 0.004 0.000 0.996
#> GSM254659     3  0.0000      0.821 0.000 0.000 1.000
#> GSM254680     1  0.6252      0.807 0.556 0.000 0.444
#> GSM254686     1  0.6204      0.839 0.576 0.000 0.424
#> GSM254718     3  0.0237      0.821 0.004 0.000 0.996
#> GSM254674     1  0.6095      0.864 0.608 0.000 0.392
#> GSM254668     1  0.6079      0.866 0.612 0.000 0.388
#> GSM254697     3  0.0237      0.819 0.004 0.000 0.996
#> GSM254704     3  0.0237      0.821 0.004 0.000 0.996
#> GSM254707     1  0.6079      0.866 0.612 0.000 0.388
#> GSM254714     3  0.0237      0.821 0.004 0.000 0.996
#> GSM254722     3  0.0237      0.819 0.004 0.000 0.996
#> GSM254627     3  0.0237      0.819 0.004 0.000 0.996
#> GSM254630     1  0.6192      0.843 0.580 0.000 0.420
#> GSM254633     3  0.0237      0.821 0.004 0.000 0.996
#> GSM254670     3  0.2796      0.742 0.092 0.000 0.908
#> GSM254716     1  0.6079      0.866 0.612 0.000 0.388
#> GSM254720     3  0.0000      0.821 0.000 0.000 1.000
#> GSM254729     3  0.2796      0.742 0.092 0.000 0.908
#> GSM254654     3  0.5785      0.479 0.332 0.000 0.668
#> GSM254656     3  0.6079      0.421 0.388 0.000 0.612
#> GSM254631     3  0.0237      0.821 0.004 0.000 0.996
#> GSM254657     3  0.6079      0.421 0.388 0.000 0.612
#> GSM254664     3  0.0237      0.819 0.004 0.000 0.996
#> GSM254672     3  0.0892      0.809 0.020 0.000 0.980
#> GSM254692     1  0.6079      0.866 0.612 0.000 0.388
#> GSM254645     3  0.2796      0.742 0.092 0.000 0.908
#> GSM254666     3  0.0237      0.819 0.004 0.000 0.996
#> GSM254675     3  0.0237      0.819 0.004 0.000 0.996
#> GSM254678     3  0.0237      0.821 0.004 0.000 0.996
#> GSM254688     1  0.6079      0.866 0.612 0.000 0.388
#> GSM254690     1  0.6225      0.828 0.568 0.000 0.432
#> GSM254696     3  0.0000      0.821 0.000 0.000 1.000
#> GSM254705     1  0.6079      0.866 0.612 0.000 0.388
#> GSM254642     1  0.6204      0.839 0.576 0.000 0.424
#> GSM254661     3  0.0000      0.821 0.000 0.000 1.000
#> GSM254698     3  0.0237      0.821 0.004 0.000 0.996
#> GSM254641     3  0.6180     -0.459 0.416 0.000 0.584
#> GSM254647     1  0.6204      0.839 0.576 0.000 0.424
#> GSM254663     1  0.6079      0.866 0.612 0.000 0.388
#> GSM254682     1  0.6079      0.866 0.612 0.000 0.388
#> GSM254709     1  0.6079      0.866 0.612 0.000 0.388
#> GSM254721     1  0.6225      0.828 0.568 0.000 0.432
#> GSM254724     3  0.6079     -0.361 0.388 0.000 0.612
#> GSM254650     1  0.6079      0.866 0.612 0.000 0.388
#> GSM254687     1  0.6079      0.866 0.612 0.000 0.388
#> GSM254637     3  0.0000      0.821 0.000 0.000 1.000
#> GSM254684     3  0.0237      0.821 0.004 0.000 0.996
#> GSM254649     2  0.0000      0.866 0.000 1.000 0.000
#> GSM254660     2  0.0000      0.866 0.000 1.000 0.000
#> GSM254693     2  0.0000      0.866 0.000 1.000 0.000
#> GSM254695     2  0.6282      0.718 0.384 0.612 0.004
#> GSM254702     2  0.0424      0.865 0.008 0.992 0.000
#> GSM254643     2  0.0000      0.866 0.000 1.000 0.000
#> GSM254727     2  0.0000      0.866 0.000 1.000 0.000
#> GSM254640     2  0.6062      0.720 0.384 0.616 0.000
#> GSM254626     2  0.0000      0.866 0.000 1.000 0.000
#> GSM254635     2  0.6298      0.716 0.388 0.608 0.004
#> GSM254653     2  0.0000      0.866 0.000 1.000 0.000
#> GSM254658     2  0.0000      0.866 0.000 1.000 0.000
#> GSM254681     2  0.1411      0.845 0.036 0.964 0.000
#> GSM254719     2  0.0000      0.866 0.000 1.000 0.000
#> GSM254673     2  0.0000      0.866 0.000 1.000 0.000
#> GSM254655     2  0.0000      0.866 0.000 1.000 0.000
#> GSM254669     2  0.0000      0.866 0.000 1.000 0.000
#> GSM254699     2  0.0000      0.866 0.000 1.000 0.000
#> GSM254703     2  0.6008      0.726 0.372 0.628 0.000
#> GSM254708     2  0.0000      0.866 0.000 1.000 0.000
#> GSM254715     2  0.6298      0.716 0.388 0.608 0.004
#> GSM254628     2  0.0000      0.866 0.000 1.000 0.000
#> GSM254634     2  0.6298      0.716 0.388 0.608 0.004
#> GSM254646     2  0.0000      0.866 0.000 1.000 0.000
#> GSM254671     2  0.6282      0.718 0.384 0.612 0.004
#> GSM254711     2  0.6282      0.718 0.384 0.612 0.004
#> GSM254717     2  0.0000      0.866 0.000 1.000 0.000
#> GSM254723     2  0.0747      0.863 0.016 0.984 0.000
#> GSM254730     2  0.0000      0.866 0.000 1.000 0.000
#> GSM254731     2  0.0424      0.865 0.008 0.992 0.000
#> GSM254632     2  0.6359      0.393 0.008 0.628 0.364
#> GSM254662     2  0.0000      0.866 0.000 1.000 0.000
#> GSM254677     1  0.9793     -0.442 0.388 0.376 0.236
#> GSM254665     2  0.0000      0.866 0.000 1.000 0.000
#> GSM254691     2  0.0000      0.866 0.000 1.000 0.000
#> GSM254644     2  0.6062      0.720 0.384 0.616 0.000
#> GSM254667     2  0.0747      0.863 0.016 0.984 0.000
#> GSM254676     2  0.0000      0.866 0.000 1.000 0.000
#> GSM254679     2  0.6298      0.716 0.388 0.608 0.004
#> GSM254689     2  0.1411      0.845 0.036 0.964 0.000
#> GSM254706     2  0.0000      0.866 0.000 1.000 0.000
#> GSM254712     2  0.6298      0.716 0.388 0.608 0.004
#> GSM254713     2  0.6298      0.716 0.388 0.608 0.004
#> GSM254683     2  0.1411      0.845 0.036 0.964 0.000
#> GSM254710     1  0.6095      0.267 0.608 0.392 0.000
#> GSM254725     2  0.6298      0.716 0.388 0.608 0.004
#> GSM254651     2  0.0000      0.866 0.000 1.000 0.000
#> GSM254638     2  0.6298      0.716 0.388 0.608 0.004
#> GSM254685     2  0.6282      0.718 0.384 0.612 0.004

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM254629     3  0.1792     0.9002 0.000 0.000 0.932 0.068
#> GSM254648     3  0.2797     0.8854 0.000 0.032 0.900 0.068
#> GSM254694     3  0.1792     0.9002 0.000 0.000 0.932 0.068
#> GSM254701     3  0.1792     0.9002 0.000 0.000 0.932 0.068
#> GSM254728     3  0.2635     0.8886 0.020 0.000 0.904 0.076
#> GSM254726     2  0.4144     0.7605 0.000 0.828 0.104 0.068
#> GSM254639     3  0.1792     0.8979 0.000 0.000 0.932 0.068
#> GSM254652     3  0.1792     0.9002 0.000 0.000 0.932 0.068
#> GSM254700     3  0.5964     0.0419 0.424 0.000 0.536 0.040
#> GSM254625     1  0.0469     0.9037 0.988 0.000 0.012 0.000
#> GSM254636     3  0.1211     0.9014 0.000 0.000 0.960 0.040
#> GSM254659     3  0.1792     0.9002 0.000 0.000 0.932 0.068
#> GSM254680     1  0.5915     0.3808 0.560 0.000 0.400 0.040
#> GSM254686     1  0.3587     0.8555 0.856 0.000 0.104 0.040
#> GSM254718     3  0.1637     0.9011 0.000 0.000 0.940 0.060
#> GSM254674     1  0.2124     0.8871 0.932 0.000 0.040 0.028
#> GSM254668     1  0.0469     0.9037 0.988 0.000 0.012 0.000
#> GSM254697     3  0.1211     0.8943 0.000 0.000 0.960 0.040
#> GSM254704     3  0.0921     0.9036 0.000 0.000 0.972 0.028
#> GSM254707     1  0.0469     0.9037 0.988 0.000 0.012 0.000
#> GSM254714     3  0.1867     0.9014 0.000 0.000 0.928 0.072
#> GSM254722     3  0.0817     0.8982 0.000 0.000 0.976 0.024
#> GSM254627     3  0.0817     0.8982 0.000 0.000 0.976 0.024
#> GSM254630     1  0.3372     0.8616 0.868 0.000 0.096 0.036
#> GSM254633     3  0.0921     0.9036 0.000 0.000 0.972 0.028
#> GSM254670     3  0.1637     0.9011 0.000 0.000 0.940 0.060
#> GSM254716     1  0.0469     0.9037 0.988 0.000 0.012 0.000
#> GSM254720     3  0.1302     0.8982 0.000 0.000 0.956 0.044
#> GSM254729     3  0.1637     0.9011 0.000 0.000 0.940 0.060
#> GSM254654     3  0.2081     0.8984 0.000 0.000 0.916 0.084
#> GSM254656     4  0.4382     0.4727 0.000 0.000 0.296 0.704
#> GSM254631     3  0.0921     0.9036 0.000 0.000 0.972 0.028
#> GSM254657     3  0.4843     0.4009 0.000 0.000 0.604 0.396
#> GSM254664     3  0.1211     0.8943 0.000 0.000 0.960 0.040
#> GSM254672     3  0.0921     0.9036 0.000 0.000 0.972 0.028
#> GSM254692     1  0.0469     0.9037 0.988 0.000 0.012 0.000
#> GSM254645     3  0.1637     0.9011 0.000 0.000 0.940 0.060
#> GSM254666     3  0.1637     0.9012 0.000 0.000 0.940 0.060
#> GSM254675     3  0.1302     0.8940 0.000 0.000 0.956 0.044
#> GSM254678     3  0.0921     0.9036 0.000 0.000 0.972 0.028
#> GSM254688     1  0.0469     0.9037 0.988 0.000 0.012 0.000
#> GSM254690     1  0.5578     0.5800 0.648 0.000 0.312 0.040
#> GSM254696     3  0.0188     0.9048 0.000 0.000 0.996 0.004
#> GSM254705     1  0.0469     0.9037 0.988 0.000 0.012 0.000
#> GSM254642     1  0.3198     0.8701 0.880 0.000 0.080 0.040
#> GSM254661     3  0.1792     0.9002 0.000 0.000 0.932 0.068
#> GSM254698     3  0.1389     0.9000 0.000 0.000 0.952 0.048
#> GSM254641     3  0.6170     0.0424 0.420 0.000 0.528 0.052
#> GSM254647     1  0.3821     0.8448 0.840 0.000 0.120 0.040
#> GSM254663     1  0.0469     0.9037 0.988 0.000 0.012 0.000
#> GSM254682     1  0.0469     0.9037 0.988 0.000 0.012 0.000
#> GSM254709     1  0.0469     0.9037 0.988 0.000 0.012 0.000
#> GSM254721     1  0.5658     0.5557 0.632 0.000 0.328 0.040
#> GSM254724     3  0.5964     0.0419 0.424 0.000 0.536 0.040
#> GSM254650     1  0.0469     0.9037 0.988 0.000 0.012 0.000
#> GSM254687     1  0.0469     0.9037 0.988 0.000 0.012 0.000
#> GSM254637     3  0.0336     0.9048 0.000 0.000 0.992 0.008
#> GSM254684     3  0.0921     0.9036 0.000 0.000 0.972 0.028
#> GSM254649     2  0.0469     0.9342 0.012 0.988 0.000 0.000
#> GSM254660     2  0.0000     0.9342 0.000 1.000 0.000 0.000
#> GSM254693     2  0.0469     0.9342 0.012 0.988 0.000 0.000
#> GSM254695     4  0.2704     0.9571 0.000 0.124 0.000 0.876
#> GSM254702     2  0.4866     0.1873 0.000 0.596 0.000 0.404
#> GSM254643     2  0.0000     0.9342 0.000 1.000 0.000 0.000
#> GSM254727     2  0.0469     0.9342 0.012 0.988 0.000 0.000
#> GSM254640     4  0.2814     0.9583 0.000 0.132 0.000 0.868
#> GSM254626     2  0.0469     0.9342 0.012 0.988 0.000 0.000
#> GSM254635     4  0.2647     0.9648 0.000 0.120 0.000 0.880
#> GSM254653     2  0.0469     0.9342 0.012 0.988 0.000 0.000
#> GSM254658     2  0.0469     0.9342 0.012 0.988 0.000 0.000
#> GSM254681     2  0.0707     0.9298 0.020 0.980 0.000 0.000
#> GSM254719     2  0.0336     0.9344 0.008 0.992 0.000 0.000
#> GSM254673     2  0.0469     0.9342 0.012 0.988 0.000 0.000
#> GSM254655     2  0.0000     0.9342 0.000 1.000 0.000 0.000
#> GSM254669     2  0.0469     0.9342 0.012 0.988 0.000 0.000
#> GSM254699     2  0.0000     0.9342 0.000 1.000 0.000 0.000
#> GSM254703     4  0.2814     0.9583 0.000 0.132 0.000 0.868
#> GSM254708     2  0.0000     0.9342 0.000 1.000 0.000 0.000
#> GSM254715     4  0.2647     0.9648 0.000 0.120 0.000 0.880
#> GSM254628     2  0.0469     0.9342 0.012 0.988 0.000 0.000
#> GSM254634     4  0.2589     0.9623 0.000 0.116 0.000 0.884
#> GSM254646     2  0.0469     0.9342 0.012 0.988 0.000 0.000
#> GSM254671     4  0.2704     0.9634 0.000 0.124 0.000 0.876
#> GSM254711     4  0.2647     0.9648 0.000 0.120 0.000 0.880
#> GSM254717     2  0.0000     0.9342 0.000 1.000 0.000 0.000
#> GSM254723     2  0.1474     0.8888 0.000 0.948 0.000 0.052
#> GSM254730     2  0.0000     0.9342 0.000 1.000 0.000 0.000
#> GSM254731     2  0.4866     0.1873 0.000 0.596 0.000 0.404
#> GSM254632     2  0.4534     0.7263 0.000 0.800 0.132 0.068
#> GSM254662     2  0.0469     0.9342 0.012 0.988 0.000 0.000
#> GSM254677     4  0.2466     0.8975 0.000 0.056 0.028 0.916
#> GSM254665     2  0.0000     0.9342 0.000 1.000 0.000 0.000
#> GSM254691     2  0.0000     0.9342 0.000 1.000 0.000 0.000
#> GSM254644     4  0.2704     0.9634 0.000 0.124 0.000 0.876
#> GSM254667     2  0.0000     0.9342 0.000 1.000 0.000 0.000
#> GSM254676     2  0.0000     0.9342 0.000 1.000 0.000 0.000
#> GSM254679     4  0.2647     0.9648 0.000 0.120 0.000 0.880
#> GSM254689     2  0.0707     0.9298 0.020 0.980 0.000 0.000
#> GSM254706     2  0.0000     0.9342 0.000 1.000 0.000 0.000
#> GSM254712     4  0.2647     0.9648 0.000 0.120 0.000 0.880
#> GSM254713     4  0.2647     0.9648 0.000 0.120 0.000 0.880
#> GSM254683     2  0.0707     0.9298 0.020 0.980 0.000 0.000
#> GSM254710     2  0.4977     0.2398 0.460 0.540 0.000 0.000
#> GSM254725     4  0.2647     0.9648 0.000 0.120 0.000 0.880
#> GSM254651     2  0.0000     0.9342 0.000 1.000 0.000 0.000
#> GSM254638     4  0.2530     0.9593 0.000 0.112 0.000 0.888
#> GSM254685     4  0.2647     0.9648 0.000 0.120 0.000 0.880

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM254629     3  0.4756     0.5340 0.288 0.000 0.668 0.044 0.000
#> GSM254648     3  0.7352     0.2777 0.312 0.200 0.444 0.044 0.000
#> GSM254694     3  0.4735     0.5363 0.284 0.000 0.672 0.044 0.000
#> GSM254701     3  0.4735     0.5363 0.284 0.000 0.672 0.044 0.000
#> GSM254728     3  0.5713     0.3980 0.372 0.000 0.560 0.044 0.024
#> GSM254726     2  0.7479     0.1713 0.300 0.420 0.236 0.044 0.000
#> GSM254639     3  0.0000     0.5963 0.000 0.000 1.000 0.000 0.000
#> GSM254652     3  0.4735     0.5363 0.284 0.000 0.672 0.044 0.000
#> GSM254700     1  0.6493     0.7235 0.492 0.000 0.260 0.000 0.248
#> GSM254625     5  0.0290     0.7493 0.008 0.000 0.000 0.000 0.992
#> GSM254636     3  0.3366     0.5142 0.232 0.000 0.768 0.000 0.000
#> GSM254659     3  0.4713     0.5383 0.280 0.000 0.676 0.044 0.000
#> GSM254680     1  0.5747     0.6613 0.504 0.000 0.088 0.000 0.408
#> GSM254686     5  0.4481     0.2525 0.312 0.000 0.016 0.004 0.668
#> GSM254718     3  0.2389     0.5887 0.116 0.000 0.880 0.004 0.000
#> GSM254674     5  0.3838     0.3640 0.280 0.000 0.000 0.004 0.716
#> GSM254668     5  0.0000     0.7548 0.000 0.000 0.000 0.000 1.000
#> GSM254697     3  0.4302     0.1810 0.480 0.000 0.520 0.000 0.000
#> GSM254704     3  0.3242     0.5310 0.216 0.000 0.784 0.000 0.000
#> GSM254707     5  0.0000     0.7548 0.000 0.000 0.000 0.000 1.000
#> GSM254714     3  0.4201     0.5631 0.204 0.000 0.752 0.044 0.000
#> GSM254722     3  0.4242     0.2611 0.428 0.000 0.572 0.000 0.000
#> GSM254627     3  0.4249     0.2544 0.432 0.000 0.568 0.000 0.000
#> GSM254630     5  0.4422     0.2898 0.300 0.000 0.016 0.004 0.680
#> GSM254633     3  0.3242     0.5310 0.216 0.000 0.784 0.000 0.000
#> GSM254670     3  0.0000     0.5963 0.000 0.000 1.000 0.000 0.000
#> GSM254716     5  0.0290     0.7493 0.008 0.000 0.000 0.000 0.992
#> GSM254720     3  0.4760     0.4538 0.416 0.000 0.564 0.020 0.000
#> GSM254729     3  0.2439     0.5879 0.120 0.000 0.876 0.004 0.000
#> GSM254654     3  0.3691     0.5724 0.156 0.000 0.804 0.040 0.000
#> GSM254656     3  0.4971    -0.0369 0.028 0.000 0.512 0.460 0.000
#> GSM254631     3  0.3242     0.5310 0.216 0.000 0.784 0.000 0.000
#> GSM254657     3  0.4355     0.4450 0.044 0.000 0.732 0.224 0.000
#> GSM254664     3  0.4305     0.1673 0.488 0.000 0.512 0.000 0.000
#> GSM254672     3  0.3242     0.5310 0.216 0.000 0.784 0.000 0.000
#> GSM254692     5  0.0000     0.7548 0.000 0.000 0.000 0.000 1.000
#> GSM254645     3  0.0000     0.5963 0.000 0.000 1.000 0.000 0.000
#> GSM254666     3  0.4622     0.5458 0.264 0.000 0.692 0.044 0.000
#> GSM254675     3  0.4307     0.1511 0.500 0.000 0.500 0.000 0.000
#> GSM254678     3  0.3242     0.5310 0.216 0.000 0.784 0.000 0.000
#> GSM254688     5  0.0000     0.7548 0.000 0.000 0.000 0.000 1.000
#> GSM254690     5  0.4968    -0.4489 0.456 0.000 0.028 0.000 0.516
#> GSM254696     3  0.3730     0.4919 0.288 0.000 0.712 0.000 0.000
#> GSM254705     5  0.0000     0.7548 0.000 0.000 0.000 0.000 1.000
#> GSM254642     5  0.4538    -0.3540 0.452 0.000 0.008 0.000 0.540
#> GSM254661     3  0.4713     0.5383 0.280 0.000 0.676 0.044 0.000
#> GSM254698     3  0.3452     0.5039 0.244 0.000 0.756 0.000 0.000
#> GSM254641     1  0.6171     0.6990 0.552 0.000 0.148 0.004 0.296
#> GSM254647     5  0.4644    -0.3929 0.460 0.000 0.012 0.000 0.528
#> GSM254663     5  0.0000     0.7548 0.000 0.000 0.000 0.000 1.000
#> GSM254682     5  0.0000     0.7548 0.000 0.000 0.000 0.000 1.000
#> GSM254709     5  0.0000     0.7548 0.000 0.000 0.000 0.000 1.000
#> GSM254721     1  0.5047     0.4725 0.496 0.000 0.032 0.000 0.472
#> GSM254724     1  0.6493     0.7235 0.492 0.000 0.260 0.000 0.248
#> GSM254650     5  0.0000     0.7548 0.000 0.000 0.000 0.000 1.000
#> GSM254687     5  0.0000     0.7548 0.000 0.000 0.000 0.000 1.000
#> GSM254637     3  0.3752     0.4959 0.292 0.000 0.708 0.000 0.000
#> GSM254684     3  0.3242     0.5310 0.216 0.000 0.784 0.000 0.000
#> GSM254649     2  0.3534     0.7477 0.256 0.744 0.000 0.000 0.000
#> GSM254660     2  0.0963     0.8166 0.036 0.964 0.000 0.000 0.000
#> GSM254693     2  0.3003     0.7792 0.188 0.812 0.000 0.000 0.000
#> GSM254695     4  0.6439     0.4921 0.084 0.300 0.048 0.568 0.000
#> GSM254702     2  0.4921     0.2629 0.036 0.604 0.000 0.360 0.000
#> GSM254643     2  0.0000     0.8214 0.000 1.000 0.000 0.000 0.000
#> GSM254727     2  0.1965     0.8179 0.096 0.904 0.000 0.000 0.000
#> GSM254640     4  0.1270     0.9409 0.000 0.052 0.000 0.948 0.000
#> GSM254626     2  0.3534     0.7477 0.256 0.744 0.000 0.000 0.000
#> GSM254635     4  0.1282     0.9445 0.004 0.044 0.000 0.952 0.000
#> GSM254653     2  0.1965     0.8179 0.096 0.904 0.000 0.000 0.000
#> GSM254658     2  0.0880     0.8219 0.032 0.968 0.000 0.000 0.000
#> GSM254681     2  0.3910     0.7403 0.272 0.720 0.000 0.000 0.008
#> GSM254719     2  0.1197     0.8188 0.048 0.952 0.000 0.000 0.000
#> GSM254673     2  0.3336     0.7787 0.228 0.772 0.000 0.000 0.000
#> GSM254655     2  0.0963     0.8166 0.036 0.964 0.000 0.000 0.000
#> GSM254669     2  0.3003     0.7792 0.188 0.812 0.000 0.000 0.000
#> GSM254699     2  0.0963     0.8166 0.036 0.964 0.000 0.000 0.000
#> GSM254703     4  0.4526     0.6107 0.028 0.300 0.000 0.672 0.000
#> GSM254708     2  0.1121     0.8134 0.044 0.956 0.000 0.000 0.000
#> GSM254715     4  0.1121     0.9455 0.000 0.044 0.000 0.956 0.000
#> GSM254628     2  0.3480     0.7518 0.248 0.752 0.000 0.000 0.000
#> GSM254634     4  0.1522     0.9418 0.012 0.044 0.000 0.944 0.000
#> GSM254646     2  0.3534     0.7477 0.256 0.744 0.000 0.000 0.000
#> GSM254671     4  0.1121     0.9455 0.000 0.044 0.000 0.956 0.000
#> GSM254711     4  0.1121     0.9455 0.000 0.044 0.000 0.956 0.000
#> GSM254717     2  0.0000     0.8214 0.000 1.000 0.000 0.000 0.000
#> GSM254723     2  0.7304     0.2831 0.248 0.476 0.232 0.044 0.000
#> GSM254730     2  0.0963     0.8166 0.036 0.964 0.000 0.000 0.000
#> GSM254731     2  0.4921     0.2629 0.036 0.604 0.000 0.360 0.000
#> GSM254632     2  0.7397     0.1760 0.264 0.452 0.240 0.044 0.000
#> GSM254662     2  0.1478     0.8198 0.064 0.936 0.000 0.000 0.000
#> GSM254677     4  0.1651     0.8989 0.012 0.008 0.036 0.944 0.000
#> GSM254665     2  0.0703     0.8187 0.024 0.976 0.000 0.000 0.000
#> GSM254691     2  0.1043     0.8143 0.040 0.960 0.000 0.000 0.000
#> GSM254644     4  0.1121     0.9455 0.000 0.044 0.000 0.956 0.000
#> GSM254667     2  0.2260     0.7890 0.064 0.908 0.028 0.000 0.000
#> GSM254676     2  0.1121     0.8142 0.044 0.956 0.000 0.000 0.000
#> GSM254679     4  0.1121     0.9455 0.000 0.044 0.000 0.956 0.000
#> GSM254689     2  0.3910     0.7403 0.272 0.720 0.000 0.000 0.008
#> GSM254706     2  0.0609     0.8200 0.020 0.980 0.000 0.000 0.000
#> GSM254712     4  0.1522     0.9418 0.012 0.044 0.000 0.944 0.000
#> GSM254713     4  0.1121     0.9455 0.000 0.044 0.000 0.956 0.000
#> GSM254683     2  0.3910     0.7403 0.272 0.720 0.000 0.000 0.008
#> GSM254710     5  0.6006     0.2768 0.300 0.144 0.000 0.000 0.556
#> GSM254725     4  0.1121     0.9455 0.000 0.044 0.000 0.956 0.000
#> GSM254651     2  0.0000     0.8214 0.000 1.000 0.000 0.000 0.000
#> GSM254638     4  0.1522     0.9418 0.012 0.044 0.000 0.944 0.000
#> GSM254685     4  0.1121     0.9455 0.000 0.044 0.000 0.956 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
#> GSM254629     3  0.3991      0.790 0.088 0.000 0.756 0.000 0.000 0.156
#> GSM254648     3  0.4269      0.724 0.016 0.108 0.760 0.000 0.000 0.116
#> GSM254694     3  0.4431      0.784 0.096 0.000 0.704 0.000 0.000 0.200
#> GSM254701     3  0.4431      0.784 0.096 0.000 0.704 0.000 0.000 0.200
#> GSM254728     3  0.4624      0.689 0.208 0.000 0.700 0.004 0.004 0.084
#> GSM254726     3  0.3485      0.651 0.020 0.204 0.772 0.000 0.000 0.004
#> GSM254639     6  0.2573      0.739 0.008 0.000 0.132 0.004 0.000 0.856
#> GSM254652     3  0.4431      0.784 0.096 0.000 0.704 0.000 0.000 0.200
#> GSM254700     1  0.4313      0.749 0.668 0.000 0.000 0.000 0.048 0.284
#> GSM254625     5  0.0458      0.941 0.016 0.000 0.000 0.000 0.984 0.000
#> GSM254636     6  0.0363      0.806 0.012 0.000 0.000 0.000 0.000 0.988
#> GSM254659     3  0.4486      0.778 0.096 0.000 0.696 0.000 0.000 0.208
#> GSM254680     1  0.4809      0.777 0.668 0.000 0.000 0.000 0.192 0.140
#> GSM254686     1  0.5029      0.646 0.596 0.000 0.068 0.004 0.328 0.004
#> GSM254718     6  0.3330      0.506 0.000 0.000 0.284 0.000 0.000 0.716
#> GSM254674     1  0.4794      0.631 0.596 0.000 0.056 0.004 0.344 0.000
#> GSM254668     5  0.0000      0.953 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM254697     1  0.3563      0.708 0.664 0.000 0.000 0.000 0.000 0.336
#> GSM254704     6  0.0146      0.808 0.004 0.000 0.000 0.000 0.000 0.996
#> GSM254707     5  0.0000      0.953 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM254714     3  0.3390      0.693 0.000 0.000 0.704 0.000 0.000 0.296
#> GSM254722     1  0.3647      0.681 0.640 0.000 0.000 0.000 0.000 0.360
#> GSM254627     1  0.3620      0.691 0.648 0.000 0.000 0.000 0.000 0.352
#> GSM254630     1  0.4908      0.640 0.596 0.000 0.068 0.004 0.332 0.000
#> GSM254633     6  0.0260      0.808 0.008 0.000 0.000 0.000 0.000 0.992
#> GSM254670     6  0.2135      0.740 0.000 0.000 0.128 0.000 0.000 0.872
#> GSM254716     5  0.0458      0.941 0.016 0.000 0.000 0.000 0.984 0.000
#> GSM254720     6  0.6064     -0.182 0.220 0.000 0.352 0.004 0.000 0.424
#> GSM254729     6  0.3351      0.498 0.000 0.000 0.288 0.000 0.000 0.712
#> GSM254654     3  0.3647      0.579 0.000 0.000 0.640 0.000 0.000 0.360
#> GSM254656     6  0.5195      0.505 0.008 0.000 0.136 0.220 0.000 0.636
#> GSM254631     6  0.0260      0.808 0.008 0.000 0.000 0.000 0.000 0.992
#> GSM254657     6  0.4914      0.566 0.008 0.000 0.160 0.152 0.000 0.680
#> GSM254664     1  0.3563      0.708 0.664 0.000 0.000 0.000 0.000 0.336
#> GSM254672     6  0.0000      0.808 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM254692     5  0.0000      0.953 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM254645     6  0.2219      0.734 0.000 0.000 0.136 0.000 0.000 0.864
#> GSM254666     3  0.4549      0.759 0.088 0.000 0.680 0.000 0.000 0.232
#> GSM254675     1  0.3547      0.710 0.668 0.000 0.000 0.000 0.000 0.332
#> GSM254678     6  0.0260      0.808 0.008 0.000 0.000 0.000 0.000 0.992
#> GSM254688     5  0.0000      0.953 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM254690     1  0.4592      0.743 0.664 0.000 0.000 0.004 0.268 0.064
#> GSM254696     6  0.1814      0.728 0.100 0.000 0.000 0.000 0.000 0.900
#> GSM254705     5  0.0000      0.953 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM254642     1  0.4183      0.715 0.668 0.000 0.000 0.000 0.296 0.036
#> GSM254661     3  0.3912      0.788 0.076 0.000 0.760 0.000 0.000 0.164
#> GSM254698     6  0.0937      0.789 0.040 0.000 0.000 0.000 0.000 0.960
#> GSM254641     1  0.6272      0.730 0.604 0.000 0.124 0.004 0.140 0.128
#> GSM254647     1  0.4352      0.732 0.668 0.000 0.000 0.000 0.280 0.052
#> GSM254663     5  0.0146      0.950 0.004 0.000 0.000 0.000 0.996 0.000
#> GSM254682     5  0.0000      0.953 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM254709     5  0.0000      0.953 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM254721     1  0.4681      0.764 0.668 0.000 0.000 0.000 0.232 0.100
#> GSM254724     1  0.4313      0.749 0.668 0.000 0.000 0.000 0.048 0.284
#> GSM254650     5  0.0000      0.953 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM254687     5  0.0000      0.953 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM254637     6  0.1204      0.773 0.056 0.000 0.000 0.000 0.000 0.944
#> GSM254684     6  0.0000      0.808 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM254649     2  0.5504      0.657 0.252 0.560 0.188 0.000 0.000 0.000
#> GSM254660     2  0.1092      0.812 0.020 0.960 0.020 0.000 0.000 0.000
#> GSM254693     2  0.3735      0.779 0.092 0.784 0.124 0.000 0.000 0.000
#> GSM254695     4  0.6653      0.219 0.052 0.356 0.176 0.416 0.000 0.000
#> GSM254702     2  0.4531      0.418 0.036 0.668 0.016 0.280 0.000 0.000
#> GSM254643     2  0.0622      0.818 0.008 0.980 0.012 0.000 0.000 0.000
#> GSM254727     2  0.2221      0.815 0.032 0.896 0.072 0.000 0.000 0.000
#> GSM254640     4  0.1867      0.882 0.036 0.036 0.004 0.924 0.000 0.000
#> GSM254626     2  0.5504      0.657 0.252 0.560 0.188 0.000 0.000 0.000
#> GSM254635     4  0.0291      0.910 0.000 0.004 0.004 0.992 0.000 0.000
#> GSM254653     2  0.2277      0.814 0.032 0.892 0.076 0.000 0.000 0.000
#> GSM254658     2  0.1461      0.820 0.016 0.940 0.044 0.000 0.000 0.000
#> GSM254681     2  0.5587      0.646 0.272 0.540 0.188 0.000 0.000 0.000
#> GSM254719     2  0.1657      0.819 0.016 0.928 0.056 0.000 0.000 0.000
#> GSM254673     2  0.3707      0.781 0.080 0.784 0.136 0.000 0.000 0.000
#> GSM254655     2  0.1003      0.813 0.020 0.964 0.016 0.000 0.000 0.000
#> GSM254669     2  0.3637      0.780 0.084 0.792 0.124 0.000 0.000 0.000
#> GSM254699     2  0.1003      0.813 0.020 0.964 0.016 0.000 0.000 0.000
#> GSM254703     4  0.5830      0.264 0.048 0.392 0.068 0.492 0.000 0.000
#> GSM254708     2  0.1895      0.795 0.016 0.912 0.072 0.000 0.000 0.000
#> GSM254715     4  0.0291      0.910 0.000 0.004 0.004 0.992 0.000 0.000
#> GSM254628     2  0.4887      0.716 0.156 0.660 0.184 0.000 0.000 0.000
#> GSM254634     4  0.0665      0.906 0.008 0.004 0.008 0.980 0.000 0.000
#> GSM254646     2  0.5504      0.657 0.252 0.560 0.188 0.000 0.000 0.000
#> GSM254671     4  0.1268      0.899 0.036 0.008 0.004 0.952 0.000 0.000
#> GSM254711     4  0.1268      0.899 0.036 0.008 0.004 0.952 0.000 0.000
#> GSM254717     2  0.0508      0.817 0.004 0.984 0.012 0.000 0.000 0.000
#> GSM254723     3  0.3403      0.647 0.020 0.212 0.768 0.000 0.000 0.000
#> GSM254730     2  0.1003      0.813 0.020 0.964 0.016 0.000 0.000 0.000
#> GSM254731     2  0.4531      0.418 0.036 0.668 0.016 0.280 0.000 0.000
#> GSM254632     3  0.3599      0.649 0.020 0.220 0.756 0.000 0.000 0.004
#> GSM254662     2  0.1563      0.819 0.012 0.932 0.056 0.000 0.000 0.000
#> GSM254677     4  0.0862      0.899 0.008 0.000 0.016 0.972 0.000 0.004
#> GSM254665     2  0.1584      0.802 0.008 0.928 0.064 0.000 0.000 0.000
#> GSM254691     2  0.1895      0.795 0.016 0.912 0.072 0.000 0.000 0.000
#> GSM254644     4  0.1080      0.903 0.032 0.004 0.004 0.960 0.000 0.000
#> GSM254667     2  0.3319      0.700 0.036 0.800 0.164 0.000 0.000 0.000
#> GSM254676     2  0.2221      0.788 0.032 0.896 0.072 0.000 0.000 0.000
#> GSM254679     4  0.0146      0.910 0.000 0.004 0.000 0.996 0.000 0.000
#> GSM254689     2  0.5587      0.646 0.272 0.540 0.188 0.000 0.000 0.000
#> GSM254706     2  0.1151      0.816 0.012 0.956 0.032 0.000 0.000 0.000
#> GSM254712     4  0.0767      0.907 0.008 0.004 0.012 0.976 0.000 0.000
#> GSM254713     4  0.0291      0.910 0.000 0.004 0.004 0.992 0.000 0.000
#> GSM254683     2  0.5587      0.646 0.272 0.540 0.188 0.000 0.000 0.000
#> GSM254710     5  0.6041      0.467 0.272 0.036 0.144 0.000 0.548 0.000
#> GSM254725     4  0.0508      0.909 0.012 0.004 0.000 0.984 0.000 0.000
#> GSM254651     2  0.0508      0.818 0.004 0.984 0.012 0.000 0.000 0.000
#> GSM254638     4  0.0405      0.909 0.000 0.004 0.008 0.988 0.000 0.000
#> GSM254685     4  0.0291      0.910 0.000 0.004 0.004 0.992 0.000 0.000

Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.

consensus_heatmap(res, k = 2)

plot of chunk tab-ATC-kmeans-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-ATC-kmeans-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-ATC-kmeans-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-ATC-kmeans-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-ATC-kmeans-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-ATC-kmeans-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-ATC-kmeans-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-ATC-kmeans-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-ATC-kmeans-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-ATC-kmeans-membership-heatmap-5

As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

plot of chunk tab-ATC-kmeans-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-ATC-kmeans-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-ATC-kmeans-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-ATC-kmeans-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-ATC-kmeans-get-signatures-5

Signature heatmaps where rows are not scaled:

get_signatures(res, k = 2, scale_rows = FALSE)

plot of chunk tab-ATC-kmeans-get-signatures-no-scale-1

get_signatures(res, k = 3, scale_rows = FALSE)

plot of chunk tab-ATC-kmeans-get-signatures-no-scale-2

get_signatures(res, k = 4, scale_rows = FALSE)

plot of chunk tab-ATC-kmeans-get-signatures-no-scale-3

get_signatures(res, k = 5, scale_rows = FALSE)

plot of chunk tab-ATC-kmeans-get-signatures-no-scale-4

get_signatures(res, k = 6, scale_rows = FALSE)

plot of chunk tab-ATC-kmeans-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk ATC-kmeans-signature_compare

get_signature() returns a data frame invisibly. TO get the list of signatures, the function call should be assigned to a variable explicitly. In following code, if plot argument is set to FALSE, no heatmap is plotted while only the differential analysis is performed.

# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)

An example of the output of tb is:

#>   which_row         fdr    mean_1    mean_2 scaled_mean_1 scaled_mean_2 km
#> 1        38 0.042760348  8.373488  9.131774    -0.5533452     0.5164555  1
#> 2        40 0.018707592  7.106213  8.469186    -0.6173731     0.5762149  1
#> 3        55 0.019134737 10.221463 11.207825    -0.6159697     0.5749050  1
#> 4        59 0.006059896  5.921854  7.869574    -0.6899429     0.6439467  1
#> 5        60 0.018055526  8.928898 10.211722    -0.6204761     0.5791110  1
#> 6        98 0.009384629 15.714769 14.887706     0.6635654    -0.6193277  2
...

The columns in tb are:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. km: Row groups if k-means clustering is applied to rows.

UMAP plot which shows how samples are separated.

dimension_reduction(res, k = 2, method = "UMAP")

plot of chunk tab-ATC-kmeans-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-ATC-kmeans-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-ATC-kmeans-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-ATC-kmeans-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-ATC-kmeans-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk ATC-kmeans-collect-classes

Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.

test_to_known_factors(res)
#>              n tissue(p) individual(p) disease.state(p) gender(p) other(p) k
#> ATC:kmeans 106  1.78e-21         0.453            0.489     0.697    0.730 2
#> ATC:kmeans  95  1.67e-20         0.242            0.788     0.748    0.912 3
#> ATC:kmeans  98  2.86e-20         0.180            0.766     0.330    0.984 4
#> ATC:kmeans  81  1.07e-16         0.233            0.639     0.213    0.971 5
#> ATC:kmeans 100  1.54e-18         0.142            0.604     0.154    0.661 6

If matrix rows can be associated to genes, consider to use functional_enrichment(res, ...) to perform function enrichment for the signature genes. See this vignette for more detailed explanations.


ATC:skmeans**

The object with results only for a single top-value method and a single partition method can be extracted as:

res = res_list["ATC", "skmeans"]
# you can also extract it by
# res = res_list["ATC:skmeans"]

A summary of res and all the functions that can be applied to it:

res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#>   On a matrix with 21168 rows and 107 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'ATC' method.
#>   Subgroups are detected by 'skmeans' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 4.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

collect_plots() function collects all the plots made from res for all k (number of partitions) into one single page to provide an easy and fast comparison between different k.

collect_plots(res)

plot of chunk ATC-skmeans-collect-plots

The plots are:

All the plots in panels can be made by individual functions and they are plotted later in this section.

select_partition_number() produces several plots showing different statistics for choosing “optimized” k. There are following statistics:

The detailed explanations of these statistics can be found in the cola vignette.

Generally speaking, lower PAC score, higher mean silhouette score or higher concordance corresponds to better partition. Rand index and Jaccard index measure how similar the current partition is compared to partition with k-1. If they are too similar, we won't accept k is better than k-1.

select_partition_number(res)

plot of chunk ATC-skmeans-select-partition-number

The numeric values for all these statistics can be obtained by get_stats().

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 1.000           0.987       0.995         0.5043 0.496   0.496
#> 3 3 0.990           0.960       0.978         0.2985 0.810   0.631
#> 4 4 0.981           0.922       0.939         0.1473 0.870   0.639
#> 5 5 0.843           0.837       0.906         0.0581 0.899   0.632
#> 6 6 0.818           0.772       0.883         0.0285 0.968   0.846

suggest_best_k() suggests the best \(k\) based on these statistics. The rules are as follows:

suggest_best_k(res)
#> [1] 4
#> attr(,"optional")
#> [1] 2 3

There is also optional best \(k\) = 2 3 that is worth to check.

Following shows the table of the partitions (You need to click the show/hide code output link to see it). The membership matrix (columns with name p*) is inferred by clue::cl_consensus() function with the SE method. Basically the value in the membership matrix represents the probability to belong to a certain group. The finall class label for an item is determined with the group with highest probability it belongs to.

In get_classes() function, the entropy is calculated from the membership matrix and the silhouette score is calculated from the consensus matrix.

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>           class entropy silhouette    p1    p2
#> GSM254629     1   0.000      0.993 1.000 0.000
#> GSM254648     2   0.000      0.997 0.000 1.000
#> GSM254694     1   0.000      0.993 1.000 0.000
#> GSM254701     1   0.000      0.993 1.000 0.000
#> GSM254728     1   0.000      0.993 1.000 0.000
#> GSM254726     2   0.000      0.997 0.000 1.000
#> GSM254639     1   0.000      0.993 1.000 0.000
#> GSM254652     1   0.000      0.993 1.000 0.000
#> GSM254700     1   0.000      0.993 1.000 0.000
#> GSM254625     1   0.000      0.993 1.000 0.000
#> GSM254636     1   0.000      0.993 1.000 0.000
#> GSM254659     1   0.000      0.993 1.000 0.000
#> GSM254680     1   0.000      0.993 1.000 0.000
#> GSM254686     1   0.000      0.993 1.000 0.000
#> GSM254718     1   0.000      0.993 1.000 0.000
#> GSM254674     1   0.000      0.993 1.000 0.000
#> GSM254668     1   0.000      0.993 1.000 0.000
#> GSM254697     1   0.000      0.993 1.000 0.000
#> GSM254704     1   0.000      0.993 1.000 0.000
#> GSM254707     1   0.000      0.993 1.000 0.000
#> GSM254714     1   0.000      0.993 1.000 0.000
#> GSM254722     1   0.000      0.993 1.000 0.000
#> GSM254627     1   0.000      0.993 1.000 0.000
#> GSM254630     1   0.000      0.993 1.000 0.000
#> GSM254633     1   0.000      0.993 1.000 0.000
#> GSM254670     1   0.000      0.993 1.000 0.000
#> GSM254716     1   0.000      0.993 1.000 0.000
#> GSM254720     1   0.000      0.993 1.000 0.000
#> GSM254729     1   0.000      0.993 1.000 0.000
#> GSM254654     1   0.000      0.993 1.000 0.000
#> GSM254656     1   0.973      0.319 0.596 0.404
#> GSM254631     1   0.000      0.993 1.000 0.000
#> GSM254657     1   0.000      0.993 1.000 0.000
#> GSM254664     1   0.000      0.993 1.000 0.000
#> GSM254672     1   0.000      0.993 1.000 0.000
#> GSM254692     1   0.000      0.993 1.000 0.000
#> GSM254645     1   0.000      0.993 1.000 0.000
#> GSM254666     1   0.000      0.993 1.000 0.000
#> GSM254675     1   0.000      0.993 1.000 0.000
#> GSM254678     1   0.000      0.993 1.000 0.000
#> GSM254688     1   0.000      0.993 1.000 0.000
#> GSM254690     1   0.000      0.993 1.000 0.000
#> GSM254696     1   0.000      0.993 1.000 0.000
#> GSM254705     1   0.000      0.993 1.000 0.000
#> GSM254642     1   0.000      0.993 1.000 0.000
#> GSM254661     1   0.000      0.993 1.000 0.000
#> GSM254698     1   0.000      0.993 1.000 0.000
#> GSM254641     1   0.000      0.993 1.000 0.000
#> GSM254647     1   0.000      0.993 1.000 0.000
#> GSM254663     1   0.000      0.993 1.000 0.000
#> GSM254682     1   0.000      0.993 1.000 0.000
#> GSM254709     1   0.000      0.993 1.000 0.000
#> GSM254721     1   0.000      0.993 1.000 0.000
#> GSM254724     1   0.000      0.993 1.000 0.000
#> GSM254650     1   0.000      0.993 1.000 0.000
#> GSM254687     1   0.000      0.993 1.000 0.000
#> GSM254637     1   0.000      0.993 1.000 0.000
#> GSM254684     1   0.000      0.993 1.000 0.000
#> GSM254649     2   0.000      0.997 0.000 1.000
#> GSM254660     2   0.000      0.997 0.000 1.000
#> GSM254693     2   0.000      0.997 0.000 1.000
#> GSM254695     2   0.000      0.997 0.000 1.000
#> GSM254702     2   0.000      0.997 0.000 1.000
#> GSM254643     2   0.000      0.997 0.000 1.000
#> GSM254727     2   0.000      0.997 0.000 1.000
#> GSM254640     2   0.000      0.997 0.000 1.000
#> GSM254626     2   0.000      0.997 0.000 1.000
#> GSM254635     2   0.000      0.997 0.000 1.000
#> GSM254653     2   0.000      0.997 0.000 1.000
#> GSM254658     2   0.000      0.997 0.000 1.000
#> GSM254681     2   0.000      0.997 0.000 1.000
#> GSM254719     2   0.000      0.997 0.000 1.000
#> GSM254673     2   0.000      0.997 0.000 1.000
#> GSM254655     2   0.000      0.997 0.000 1.000
#> GSM254669     2   0.000      0.997 0.000 1.000
#> GSM254699     2   0.000      0.997 0.000 1.000
#> GSM254703     2   0.000      0.997 0.000 1.000
#> GSM254708     2   0.000      0.997 0.000 1.000
#> GSM254715     2   0.000      0.997 0.000 1.000
#> GSM254628     2   0.000      0.997 0.000 1.000
#> GSM254634     2   0.000      0.997 0.000 1.000
#> GSM254646     2   0.000      0.997 0.000 1.000
#> GSM254671     2   0.000      0.997 0.000 1.000
#> GSM254711     2   0.000      0.997 0.000 1.000
#> GSM254717     2   0.000      0.997 0.000 1.000
#> GSM254723     2   0.000      0.997 0.000 1.000
#> GSM254730     2   0.000      0.997 0.000 1.000
#> GSM254731     2   0.000      0.997 0.000 1.000
#> GSM254632     2   0.595      0.830 0.144 0.856
#> GSM254662     2   0.000      0.997 0.000 1.000
#> GSM254677     2   0.000      0.997 0.000 1.000
#> GSM254665     2   0.000      0.997 0.000 1.000
#> GSM254691     2   0.000      0.997 0.000 1.000
#> GSM254644     2   0.000      0.997 0.000 1.000
#> GSM254667     2   0.000      0.997 0.000 1.000
#> GSM254676     2   0.000      0.997 0.000 1.000
#> GSM254679     2   0.000      0.997 0.000 1.000
#> GSM254689     2   0.000      0.997 0.000 1.000
#> GSM254706     2   0.000      0.997 0.000 1.000
#> GSM254712     2   0.000      0.997 0.000 1.000
#> GSM254713     2   0.000      0.997 0.000 1.000
#> GSM254683     2   0.000      0.997 0.000 1.000
#> GSM254710     2   0.000      0.997 0.000 1.000
#> GSM254725     2   0.000      0.997 0.000 1.000
#> GSM254651     2   0.000      0.997 0.000 1.000
#> GSM254638     2   0.000      0.997 0.000 1.000
#> GSM254685     2   0.000      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
#> GSM254629     1  0.3816      0.825 0.852 0.000 0.148
#> GSM254648     2  0.5016      0.705 0.000 0.760 0.240
#> GSM254694     3  0.1031      0.977 0.024 0.000 0.976
#> GSM254701     3  0.1031      0.977 0.024 0.000 0.976
#> GSM254728     1  0.0000      0.966 1.000 0.000 0.000
#> GSM254726     1  0.3116      0.864 0.892 0.108 0.000
#> GSM254639     3  0.0000      0.965 0.000 0.000 1.000
#> GSM254652     1  0.3267      0.862 0.884 0.000 0.116
#> GSM254700     1  0.4931      0.706 0.768 0.000 0.232
#> GSM254625     1  0.0000      0.966 1.000 0.000 0.000
#> GSM254636     3  0.1031      0.977 0.024 0.000 0.976
#> GSM254659     3  0.1031      0.977 0.024 0.000 0.976
#> GSM254680     1  0.0000      0.966 1.000 0.000 0.000
#> GSM254686     1  0.0000      0.966 1.000 0.000 0.000
#> GSM254718     3  0.0424      0.970 0.008 0.000 0.992
#> GSM254674     1  0.0000      0.966 1.000 0.000 0.000
#> GSM254668     1  0.0000      0.966 1.000 0.000 0.000
#> GSM254697     3  0.1031      0.977 0.024 0.000 0.976
#> GSM254704     3  0.1031      0.977 0.024 0.000 0.976
#> GSM254707     1  0.0000      0.966 1.000 0.000 0.000
#> GSM254714     3  0.1031      0.977 0.024 0.000 0.976
#> GSM254722     3  0.1031      0.977 0.024 0.000 0.976
#> GSM254627     3  0.1031      0.977 0.024 0.000 0.976
#> GSM254630     1  0.0000      0.966 1.000 0.000 0.000
#> GSM254633     3  0.1031      0.977 0.024 0.000 0.976
#> GSM254670     3  0.0237      0.968 0.004 0.000 0.996
#> GSM254716     1  0.0000      0.966 1.000 0.000 0.000
#> GSM254720     3  0.1031      0.977 0.024 0.000 0.976
#> GSM254729     3  0.0237      0.968 0.004 0.000 0.996
#> GSM254654     3  0.0000      0.965 0.000 0.000 1.000
#> GSM254656     3  0.0000      0.965 0.000 0.000 1.000
#> GSM254631     3  0.1031      0.977 0.024 0.000 0.976
#> GSM254657     3  0.0000      0.965 0.000 0.000 1.000
#> GSM254664     3  0.1031      0.977 0.024 0.000 0.976
#> GSM254672     3  0.0424      0.970 0.008 0.000 0.992
#> GSM254692     1  0.0000      0.966 1.000 0.000 0.000
#> GSM254645     3  0.0237      0.968 0.004 0.000 0.996
#> GSM254666     3  0.1031      0.977 0.024 0.000 0.976
#> GSM254675     3  0.1031      0.977 0.024 0.000 0.976
#> GSM254678     3  0.1031      0.977 0.024 0.000 0.976
#> GSM254688     1  0.0000      0.966 1.000 0.000 0.000
#> GSM254690     1  0.0000      0.966 1.000 0.000 0.000
#> GSM254696     3  0.1031      0.977 0.024 0.000 0.976
#> GSM254705     1  0.0000      0.966 1.000 0.000 0.000
#> GSM254642     1  0.0000      0.966 1.000 0.000 0.000
#> GSM254661     3  0.1753      0.956 0.048 0.000 0.952
#> GSM254698     3  0.1031      0.977 0.024 0.000 0.976
#> GSM254641     1  0.0000      0.966 1.000 0.000 0.000
#> GSM254647     1  0.0000      0.966 1.000 0.000 0.000
#> GSM254663     1  0.0000      0.966 1.000 0.000 0.000
#> GSM254682     1  0.0000      0.966 1.000 0.000 0.000
#> GSM254709     1  0.0000      0.966 1.000 0.000 0.000
#> GSM254721     1  0.0000      0.966 1.000 0.000 0.000
#> GSM254724     1  0.4931      0.706 0.768 0.000 0.232
#> GSM254650     1  0.0000      0.966 1.000 0.000 0.000
#> GSM254687     1  0.0000      0.966 1.000 0.000 0.000
#> GSM254637     3  0.1031      0.977 0.024 0.000 0.976
#> GSM254684     3  0.1031      0.977 0.024 0.000 0.976
#> GSM254649     2  0.0000      0.988 0.000 1.000 0.000
#> GSM254660     2  0.0000      0.988 0.000 1.000 0.000
#> GSM254693     2  0.0000      0.988 0.000 1.000 0.000
#> GSM254695     2  0.1031      0.980 0.000 0.976 0.024
#> GSM254702     2  0.0000      0.988 0.000 1.000 0.000
#> GSM254643     2  0.0000      0.988 0.000 1.000 0.000
#> GSM254727     2  0.0000      0.988 0.000 1.000 0.000
#> GSM254640     2  0.1031      0.980 0.000 0.976 0.024
#> GSM254626     2  0.0000      0.988 0.000 1.000 0.000
#> GSM254635     2  0.1031      0.980 0.000 0.976 0.024
#> GSM254653     2  0.0000      0.988 0.000 1.000 0.000
#> GSM254658     2  0.0000      0.988 0.000 1.000 0.000
#> GSM254681     2  0.0000      0.988 0.000 1.000 0.000
#> GSM254719     2  0.0000      0.988 0.000 1.000 0.000
#> GSM254673     2  0.0000      0.988 0.000 1.000 0.000
#> GSM254655     2  0.0000      0.988 0.000 1.000 0.000
#> GSM254669     2  0.0000      0.988 0.000 1.000 0.000
#> GSM254699     2  0.0000      0.988 0.000 1.000 0.000
#> GSM254703     2  0.1031      0.980 0.000 0.976 0.024
#> GSM254708     2  0.0000      0.988 0.000 1.000 0.000
#> GSM254715     2  0.1031      0.980 0.000 0.976 0.024
#> GSM254628     2  0.0000      0.988 0.000 1.000 0.000
#> GSM254634     2  0.1031      0.980 0.000 0.976 0.024
#> GSM254646     2  0.0000      0.988 0.000 1.000 0.000
#> GSM254671     2  0.1031      0.980 0.000 0.976 0.024
#> GSM254711     2  0.1031      0.980 0.000 0.976 0.024
#> GSM254717     2  0.0000      0.988 0.000 1.000 0.000
#> GSM254723     2  0.0000      0.988 0.000 1.000 0.000
#> GSM254730     2  0.0000      0.988 0.000 1.000 0.000
#> GSM254731     2  0.0000      0.988 0.000 1.000 0.000
#> GSM254632     1  0.1031      0.946 0.976 0.024 0.000
#> GSM254662     2  0.0000      0.988 0.000 1.000 0.000
#> GSM254677     3  0.5926      0.416 0.000 0.356 0.644
#> GSM254665     2  0.0000      0.988 0.000 1.000 0.000
#> GSM254691     2  0.0000      0.988 0.000 1.000 0.000
#> GSM254644     2  0.1031      0.980 0.000 0.976 0.024
#> GSM254667     2  0.0000      0.988 0.000 1.000 0.000
#> GSM254676     2  0.0000      0.988 0.000 1.000 0.000
#> GSM254679     2  0.1031      0.980 0.000 0.976 0.024
#> GSM254689     2  0.0000      0.988 0.000 1.000 0.000
#> GSM254706     2  0.0000      0.988 0.000 1.000 0.000
#> GSM254712     2  0.1031      0.980 0.000 0.976 0.024
#> GSM254713     2  0.1031      0.980 0.000 0.976 0.024
#> GSM254683     2  0.0000      0.988 0.000 1.000 0.000
#> GSM254710     1  0.1031      0.946 0.976 0.024 0.000
#> GSM254725     2  0.1031      0.980 0.000 0.976 0.024
#> GSM254651     2  0.0000      0.988 0.000 1.000 0.000
#> GSM254638     2  0.1031      0.980 0.000 0.976 0.024
#> GSM254685     2  0.1031      0.980 0.000 0.976 0.024

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM254629     1  0.1637      0.896 0.940 0.000 0.060 0.000
#> GSM254648     4  0.0000      0.943 0.000 0.000 0.000 1.000
#> GSM254694     3  0.0000      0.987 0.000 0.000 1.000 0.000
#> GSM254701     3  0.0000      0.987 0.000 0.000 1.000 0.000
#> GSM254728     1  0.0000      0.946 1.000 0.000 0.000 0.000
#> GSM254726     2  0.0707      0.960 0.020 0.980 0.000 0.000
#> GSM254639     3  0.0000      0.987 0.000 0.000 1.000 0.000
#> GSM254652     1  0.1474      0.903 0.948 0.000 0.052 0.000
#> GSM254700     1  0.4907      0.302 0.580 0.000 0.420 0.000
#> GSM254625     1  0.0000      0.946 1.000 0.000 0.000 0.000
#> GSM254636     3  0.0000      0.987 0.000 0.000 1.000 0.000
#> GSM254659     3  0.0000      0.987 0.000 0.000 1.000 0.000
#> GSM254680     1  0.0000      0.946 1.000 0.000 0.000 0.000
#> GSM254686     1  0.0000      0.946 1.000 0.000 0.000 0.000
#> GSM254718     3  0.0000      0.987 0.000 0.000 1.000 0.000
#> GSM254674     1  0.0000      0.946 1.000 0.000 0.000 0.000
#> GSM254668     1  0.0000      0.946 1.000 0.000 0.000 0.000
#> GSM254697     3  0.0000      0.987 0.000 0.000 1.000 0.000
#> GSM254704     3  0.0000      0.987 0.000 0.000 1.000 0.000
#> GSM254707     1  0.0000      0.946 1.000 0.000 0.000 0.000
#> GSM254714     3  0.0000      0.987 0.000 0.000 1.000 0.000
#> GSM254722     3  0.0000      0.987 0.000 0.000 1.000 0.000
#> GSM254627     3  0.0000      0.987 0.000 0.000 1.000 0.000
#> GSM254630     1  0.0000      0.946 1.000 0.000 0.000 0.000
#> GSM254633     3  0.0000      0.987 0.000 0.000 1.000 0.000
#> GSM254670     3  0.0000      0.987 0.000 0.000 1.000 0.000
#> GSM254716     1  0.0000      0.946 1.000 0.000 0.000 0.000
#> GSM254720     3  0.0000      0.987 0.000 0.000 1.000 0.000
#> GSM254729     3  0.0000      0.987 0.000 0.000 1.000 0.000
#> GSM254654     3  0.0469      0.977 0.000 0.000 0.988 0.012
#> GSM254656     4  0.0188      0.940 0.000 0.000 0.004 0.996
#> GSM254631     3  0.0000      0.987 0.000 0.000 1.000 0.000
#> GSM254657     3  0.4164      0.640 0.000 0.000 0.736 0.264
#> GSM254664     3  0.0000      0.987 0.000 0.000 1.000 0.000
#> GSM254672     3  0.0000      0.987 0.000 0.000 1.000 0.000
#> GSM254692     1  0.0000      0.946 1.000 0.000 0.000 0.000
#> GSM254645     3  0.0000      0.987 0.000 0.000 1.000 0.000
#> GSM254666     3  0.0000      0.987 0.000 0.000 1.000 0.000
#> GSM254675     3  0.0000      0.987 0.000 0.000 1.000 0.000
#> GSM254678     3  0.0000      0.987 0.000 0.000 1.000 0.000
#> GSM254688     1  0.0000      0.946 1.000 0.000 0.000 0.000
#> GSM254690     1  0.0000      0.946 1.000 0.000 0.000 0.000
#> GSM254696     3  0.0000      0.987 0.000 0.000 1.000 0.000
#> GSM254705     1  0.0000      0.946 1.000 0.000 0.000 0.000
#> GSM254642     1  0.0000      0.946 1.000 0.000 0.000 0.000
#> GSM254661     3  0.1867      0.911 0.072 0.000 0.928 0.000
#> GSM254698     3  0.0000      0.987 0.000 0.000 1.000 0.000
#> GSM254641     1  0.0188      0.943 0.996 0.000 0.004 0.000
#> GSM254647     1  0.0000      0.946 1.000 0.000 0.000 0.000
#> GSM254663     1  0.0000      0.946 1.000 0.000 0.000 0.000
#> GSM254682     1  0.0000      0.946 1.000 0.000 0.000 0.000
#> GSM254709     1  0.0000      0.946 1.000 0.000 0.000 0.000
#> GSM254721     1  0.0000      0.946 1.000 0.000 0.000 0.000
#> GSM254724     1  0.4907      0.302 0.580 0.000 0.420 0.000
#> GSM254650     1  0.0000      0.946 1.000 0.000 0.000 0.000
#> GSM254687     1  0.0000      0.946 1.000 0.000 0.000 0.000
#> GSM254637     3  0.0000      0.987 0.000 0.000 1.000 0.000
#> GSM254684     3  0.0000      0.987 0.000 0.000 1.000 0.000
#> GSM254649     2  0.0000      0.980 0.000 1.000 0.000 0.000
#> GSM254660     2  0.0000      0.980 0.000 1.000 0.000 0.000
#> GSM254693     2  0.0000      0.980 0.000 1.000 0.000 0.000
#> GSM254695     4  0.0000      0.943 0.000 0.000 0.000 1.000
#> GSM254702     4  0.4989      0.157 0.000 0.472 0.000 0.528
#> GSM254643     2  0.0000      0.980 0.000 1.000 0.000 0.000
#> GSM254727     2  0.0000      0.980 0.000 1.000 0.000 0.000
#> GSM254640     4  0.0000      0.943 0.000 0.000 0.000 1.000
#> GSM254626     2  0.0000      0.980 0.000 1.000 0.000 0.000
#> GSM254635     4  0.0000      0.943 0.000 0.000 0.000 1.000
#> GSM254653     2  0.0000      0.980 0.000 1.000 0.000 0.000
#> GSM254658     2  0.0000      0.980 0.000 1.000 0.000 0.000
#> GSM254681     2  0.0000      0.980 0.000 1.000 0.000 0.000
#> GSM254719     2  0.0000      0.980 0.000 1.000 0.000 0.000
#> GSM254673     2  0.0000      0.980 0.000 1.000 0.000 0.000
#> GSM254655     2  0.0000      0.980 0.000 1.000 0.000 0.000
#> GSM254669     2  0.0000      0.980 0.000 1.000 0.000 0.000
#> GSM254699     2  0.0000      0.980 0.000 1.000 0.000 0.000
#> GSM254703     4  0.0000      0.943 0.000 0.000 0.000 1.000
#> GSM254708     2  0.0000      0.980 0.000 1.000 0.000 0.000
#> GSM254715     4  0.0000      0.943 0.000 0.000 0.000 1.000
#> GSM254628     2  0.0000      0.980 0.000 1.000 0.000 0.000
#> GSM254634     4  0.0000      0.943 0.000 0.000 0.000 1.000
#> GSM254646     2  0.0000      0.980 0.000 1.000 0.000 0.000
#> GSM254671     4  0.0000      0.943 0.000 0.000 0.000 1.000
#> GSM254711     4  0.0000      0.943 0.000 0.000 0.000 1.000
#> GSM254717     2  0.0000      0.980 0.000 1.000 0.000 0.000
#> GSM254723     2  0.2081      0.889 0.000 0.916 0.000 0.084
#> GSM254730     2  0.0000      0.980 0.000 1.000 0.000 0.000
#> GSM254731     4  0.4989      0.157 0.000 0.472 0.000 0.528
#> GSM254632     1  0.4406      0.542 0.700 0.300 0.000 0.000
#> GSM254662     2  0.0000      0.980 0.000 1.000 0.000 0.000
#> GSM254677     4  0.0000      0.943 0.000 0.000 0.000 1.000
#> GSM254665     2  0.0000      0.980 0.000 1.000 0.000 0.000
#> GSM254691     2  0.0000      0.980 0.000 1.000 0.000 0.000
#> GSM254644     4  0.0000      0.943 0.000 0.000 0.000 1.000
#> GSM254667     4  0.2530      0.843 0.000 0.112 0.000 0.888
#> GSM254676     2  0.0000      0.980 0.000 1.000 0.000 0.000
#> GSM254679     4  0.0000      0.943 0.000 0.000 0.000 1.000
#> GSM254689     2  0.0000      0.980 0.000 1.000 0.000 0.000
#> GSM254706     2  0.0000      0.980 0.000 1.000 0.000 0.000
#> GSM254712     4  0.0000      0.943 0.000 0.000 0.000 1.000
#> GSM254713     4  0.0000      0.943 0.000 0.000 0.000 1.000
#> GSM254683     2  0.0000      0.980 0.000 1.000 0.000 0.000
#> GSM254710     2  0.4898      0.268 0.416 0.584 0.000 0.000
#> GSM254725     4  0.0000      0.943 0.000 0.000 0.000 1.000
#> GSM254651     2  0.0000      0.980 0.000 1.000 0.000 0.000
#> GSM254638     4  0.0000      0.943 0.000 0.000 0.000 1.000
#> GSM254685     4  0.0000      0.943 0.000 0.000 0.000 1.000

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM254629     1  0.4787     0.5120 0.712 0.000 0.080 0.000 0.208
#> GSM254648     4  0.5718     0.6300 0.140 0.020 0.168 0.672 0.000
#> GSM254694     1  0.3730     0.6412 0.712 0.000 0.288 0.000 0.000
#> GSM254701     1  0.2179     0.7641 0.888 0.000 0.112 0.000 0.000
#> GSM254728     1  0.2230     0.7714 0.884 0.000 0.000 0.000 0.116
#> GSM254726     2  0.6162     0.0441 0.132 0.440 0.000 0.000 0.428
#> GSM254639     3  0.0000     0.8605 0.000 0.000 1.000 0.000 0.000
#> GSM254652     1  0.1671     0.7771 0.924 0.000 0.000 0.000 0.076
#> GSM254700     1  0.3485     0.7929 0.828 0.000 0.124 0.000 0.048
#> GSM254625     5  0.0000     0.9406 0.000 0.000 0.000 0.000 1.000
#> GSM254636     3  0.2230     0.8014 0.116 0.000 0.884 0.000 0.000
#> GSM254659     1  0.3983     0.6183 0.660 0.000 0.340 0.000 0.000
#> GSM254680     1  0.2852     0.7749 0.828 0.000 0.000 0.000 0.172
#> GSM254686     1  0.3143     0.7445 0.796 0.000 0.000 0.000 0.204
#> GSM254718     3  0.0162     0.8605 0.004 0.000 0.996 0.000 0.000
#> GSM254674     5  0.2852     0.8190 0.172 0.000 0.000 0.000 0.828
#> GSM254668     5  0.1043     0.9527 0.040 0.000 0.000 0.000 0.960
#> GSM254697     1  0.3242     0.7553 0.784 0.000 0.216 0.000 0.000
#> GSM254704     3  0.0794     0.8577 0.028 0.000 0.972 0.000 0.000
#> GSM254707     5  0.0880     0.9544 0.032 0.000 0.000 0.000 0.968
#> GSM254714     3  0.0794     0.8494 0.028 0.000 0.972 0.000 0.000
#> GSM254722     1  0.3661     0.7049 0.724 0.000 0.276 0.000 0.000
#> GSM254627     1  0.3395     0.7415 0.764 0.000 0.236 0.000 0.000
#> GSM254630     5  0.3039     0.7877 0.192 0.000 0.000 0.000 0.808
#> GSM254633     3  0.1341     0.8479 0.056 0.000 0.944 0.000 0.000
#> GSM254670     3  0.0000     0.8605 0.000 0.000 1.000 0.000 0.000
#> GSM254716     5  0.0000     0.9406 0.000 0.000 0.000 0.000 1.000
#> GSM254720     1  0.3895     0.6487 0.680 0.000 0.320 0.000 0.000
#> GSM254729     3  0.0000     0.8605 0.000 0.000 1.000 0.000 0.000
#> GSM254654     3  0.1331     0.8397 0.040 0.000 0.952 0.008 0.000
#> GSM254656     3  0.3707     0.5303 0.000 0.000 0.716 0.284 0.000
#> GSM254631     3  0.1851     0.8275 0.088 0.000 0.912 0.000 0.000
#> GSM254657     3  0.1830     0.8242 0.028 0.000 0.932 0.040 0.000
#> GSM254664     1  0.3274     0.7529 0.780 0.000 0.220 0.000 0.000
#> GSM254672     3  0.0290     0.8604 0.008 0.000 0.992 0.000 0.000
#> GSM254692     5  0.1043     0.9527 0.040 0.000 0.000 0.000 0.960
#> GSM254645     3  0.0000     0.8605 0.000 0.000 1.000 0.000 0.000
#> GSM254666     3  0.3895     0.5621 0.320 0.000 0.680 0.000 0.000
#> GSM254675     1  0.3242     0.7553 0.784 0.000 0.216 0.000 0.000
#> GSM254678     3  0.1851     0.8275 0.088 0.000 0.912 0.000 0.000
#> GSM254688     5  0.1043     0.9527 0.040 0.000 0.000 0.000 0.960
#> GSM254690     1  0.2929     0.7693 0.820 0.000 0.000 0.000 0.180
#> GSM254696     1  0.4192     0.4892 0.596 0.000 0.404 0.000 0.000
#> GSM254705     5  0.0880     0.9544 0.032 0.000 0.000 0.000 0.968
#> GSM254642     1  0.3039     0.7586 0.808 0.000 0.000 0.000 0.192
#> GSM254661     3  0.4232     0.5871 0.312 0.000 0.676 0.000 0.012
#> GSM254698     3  0.4300    -0.1829 0.476 0.000 0.524 0.000 0.000
#> GSM254641     1  0.2966     0.7666 0.816 0.000 0.000 0.000 0.184
#> GSM254647     1  0.2966     0.7661 0.816 0.000 0.000 0.000 0.184
#> GSM254663     5  0.1121     0.9505 0.044 0.000 0.000 0.000 0.956
#> GSM254682     5  0.0880     0.9544 0.032 0.000 0.000 0.000 0.968
#> GSM254709     5  0.0880     0.9544 0.032 0.000 0.000 0.000 0.968
#> GSM254721     1  0.2852     0.7749 0.828 0.000 0.000 0.000 0.172
#> GSM254724     1  0.3507     0.7937 0.828 0.000 0.120 0.000 0.052
#> GSM254650     5  0.0703     0.9526 0.024 0.000 0.000 0.000 0.976
#> GSM254687     5  0.0703     0.9526 0.024 0.000 0.000 0.000 0.976
#> GSM254637     3  0.3242     0.6718 0.216 0.000 0.784 0.000 0.000
#> GSM254684     3  0.1121     0.8530 0.044 0.000 0.956 0.000 0.000
#> GSM254649     2  0.0000     0.9632 0.000 1.000 0.000 0.000 0.000
#> GSM254660     2  0.0880     0.9556 0.032 0.968 0.000 0.000 0.000
#> GSM254693     2  0.0000     0.9632 0.000 1.000 0.000 0.000 0.000
#> GSM254695     4  0.0609     0.9173 0.020 0.000 0.000 0.980 0.000
#> GSM254702     4  0.4073     0.7031 0.032 0.216 0.000 0.752 0.000
#> GSM254643     2  0.0000     0.9632 0.000 1.000 0.000 0.000 0.000
#> GSM254727     2  0.0880     0.9556 0.032 0.968 0.000 0.000 0.000
#> GSM254640     4  0.0000     0.9298 0.000 0.000 0.000 1.000 0.000
#> GSM254626     2  0.0000     0.9632 0.000 1.000 0.000 0.000 0.000
#> GSM254635     4  0.0000     0.9298 0.000 0.000 0.000 1.000 0.000
#> GSM254653     2  0.0880     0.9556 0.032 0.968 0.000 0.000 0.000
#> GSM254658     2  0.0000     0.9632 0.000 1.000 0.000 0.000 0.000
#> GSM254681     2  0.0703     0.9514 0.000 0.976 0.000 0.000 0.024
#> GSM254719     2  0.0880     0.9556 0.032 0.968 0.000 0.000 0.000
#> GSM254673     2  0.0880     0.9556 0.032 0.968 0.000 0.000 0.000
#> GSM254655     2  0.0880     0.9556 0.032 0.968 0.000 0.000 0.000
#> GSM254669     2  0.0000     0.9632 0.000 1.000 0.000 0.000 0.000
#> GSM254699     2  0.0880     0.9556 0.032 0.968 0.000 0.000 0.000
#> GSM254703     4  0.0000     0.9298 0.000 0.000 0.000 1.000 0.000
#> GSM254708     2  0.0000     0.9632 0.000 1.000 0.000 0.000 0.000
#> GSM254715     4  0.0000     0.9298 0.000 0.000 0.000 1.000 0.000
#> GSM254628     2  0.0000     0.9632 0.000 1.000 0.000 0.000 0.000
#> GSM254634     4  0.0000     0.9298 0.000 0.000 0.000 1.000 0.000
#> GSM254646     2  0.0000     0.9632 0.000 1.000 0.000 0.000 0.000
#> GSM254671     4  0.0000     0.9298 0.000 0.000 0.000 1.000 0.000
#> GSM254711     4  0.0000     0.9298 0.000 0.000 0.000 1.000 0.000
#> GSM254717     2  0.0000     0.9632 0.000 1.000 0.000 0.000 0.000
#> GSM254723     2  0.3736     0.7849 0.052 0.808 0.000 0.140 0.000
#> GSM254730     2  0.0880     0.9556 0.032 0.968 0.000 0.000 0.000
#> GSM254731     4  0.4010     0.7144 0.032 0.208 0.000 0.760 0.000
#> GSM254632     5  0.1484     0.8952 0.008 0.048 0.000 0.000 0.944
#> GSM254662     2  0.0880     0.9556 0.032 0.968 0.000 0.000 0.000
#> GSM254677     4  0.0000     0.9298 0.000 0.000 0.000 1.000 0.000
#> GSM254665     2  0.0000     0.9632 0.000 1.000 0.000 0.000 0.000
#> GSM254691     2  0.0000     0.9632 0.000 1.000 0.000 0.000 0.000
#> GSM254644     4  0.0000     0.9298 0.000 0.000 0.000 1.000 0.000
#> GSM254667     4  0.4219     0.3390 0.000 0.416 0.000 0.584 0.000
#> GSM254676     2  0.0000     0.9632 0.000 1.000 0.000 0.000 0.000
#> GSM254679     4  0.0000     0.9298 0.000 0.000 0.000 1.000 0.000
#> GSM254689     2  0.0703     0.9514 0.000 0.976 0.000 0.000 0.024
#> GSM254706     2  0.0000     0.9632 0.000 1.000 0.000 0.000 0.000
#> GSM254712     4  0.0000     0.9298 0.000 0.000 0.000 1.000 0.000
#> GSM254713     4  0.0000     0.9298 0.000 0.000 0.000 1.000 0.000
#> GSM254683     2  0.0703     0.9514 0.000 0.976 0.000 0.000 0.024
#> GSM254710     5  0.1544     0.8780 0.000 0.068 0.000 0.000 0.932
#> GSM254725     4  0.0000     0.9298 0.000 0.000 0.000 1.000 0.000
#> GSM254651     2  0.0000     0.9632 0.000 1.000 0.000 0.000 0.000
#> GSM254638     4  0.0000     0.9298 0.000 0.000 0.000 1.000 0.000
#> GSM254685     4  0.0000     0.9298 0.000 0.000 0.000 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM254629     6  0.3827     0.6110 0.076 0.000 0.024 0.000 0.096 0.804
#> GSM254648     6  0.3569     0.6078 0.000 0.056 0.036 0.080 0.000 0.828
#> GSM254694     1  0.6017     0.1261 0.428 0.000 0.304 0.000 0.000 0.268
#> GSM254701     6  0.4804     0.0882 0.456 0.000 0.052 0.000 0.000 0.492
#> GSM254728     1  0.4766     0.1978 0.612 0.000 0.000 0.000 0.072 0.316
#> GSM254726     6  0.5731     0.4314 0.064 0.120 0.000 0.000 0.180 0.636
#> GSM254639     3  0.0363     0.8134 0.000 0.000 0.988 0.000 0.000 0.012
#> GSM254652     6  0.4650     0.0856 0.472 0.000 0.000 0.000 0.040 0.488
#> GSM254700     1  0.1524     0.7548 0.932 0.000 0.060 0.000 0.008 0.000
#> GSM254625     5  0.0405     0.9039 0.004 0.000 0.000 0.000 0.988 0.008
#> GSM254636     3  0.2416     0.7621 0.156 0.000 0.844 0.000 0.000 0.000
#> GSM254659     1  0.3634     0.4914 0.644 0.000 0.356 0.000 0.000 0.000
#> GSM254680     1  0.1556     0.7338 0.920 0.000 0.000 0.000 0.080 0.000
#> GSM254686     1  0.2996     0.5408 0.772 0.000 0.000 0.000 0.228 0.000
#> GSM254718     3  0.0405     0.8157 0.008 0.000 0.988 0.000 0.000 0.004
#> GSM254674     5  0.2912     0.7310 0.216 0.000 0.000 0.000 0.784 0.000
#> GSM254668     5  0.0865     0.9343 0.036 0.000 0.000 0.000 0.964 0.000
#> GSM254697     1  0.1957     0.7483 0.888 0.000 0.112 0.000 0.000 0.000
#> GSM254704     3  0.1267     0.8117 0.060 0.000 0.940 0.000 0.000 0.000
#> GSM254707     5  0.0865     0.9343 0.036 0.000 0.000 0.000 0.964 0.000
#> GSM254714     3  0.1075     0.7928 0.000 0.000 0.952 0.000 0.000 0.048
#> GSM254722     1  0.2491     0.7229 0.836 0.000 0.164 0.000 0.000 0.000
#> GSM254627     1  0.2260     0.7390 0.860 0.000 0.140 0.000 0.000 0.000
#> GSM254630     5  0.3101     0.6868 0.244 0.000 0.000 0.000 0.756 0.000
#> GSM254633     3  0.2092     0.7852 0.124 0.000 0.876 0.000 0.000 0.000
#> GSM254670     3  0.0260     0.8144 0.000 0.000 0.992 0.000 0.000 0.008
#> GSM254716     5  0.0260     0.9071 0.000 0.000 0.000 0.000 0.992 0.008
#> GSM254720     1  0.3244     0.6242 0.732 0.000 0.268 0.000 0.000 0.000
#> GSM254729     3  0.0260     0.8144 0.000 0.000 0.992 0.000 0.000 0.008
#> GSM254654     3  0.2070     0.7418 0.000 0.000 0.892 0.008 0.000 0.100
#> GSM254656     3  0.3136     0.5935 0.000 0.000 0.796 0.188 0.000 0.016
#> GSM254631     3  0.2340     0.7688 0.148 0.000 0.852 0.000 0.000 0.000
#> GSM254657     3  0.2058     0.7565 0.000 0.000 0.908 0.036 0.000 0.056
#> GSM254664     1  0.2219     0.7410 0.864 0.000 0.136 0.000 0.000 0.000
#> GSM254672     3  0.0363     0.8157 0.012 0.000 0.988 0.000 0.000 0.000
#> GSM254692     5  0.0865     0.9343 0.036 0.000 0.000 0.000 0.964 0.000
#> GSM254645     3  0.0363     0.8134 0.000 0.000 0.988 0.000 0.000 0.012
#> GSM254666     3  0.5990     0.1092 0.368 0.000 0.400 0.000 0.000 0.232
#> GSM254675     1  0.1910     0.7489 0.892 0.000 0.108 0.000 0.000 0.000
#> GSM254678     3  0.2178     0.7805 0.132 0.000 0.868 0.000 0.000 0.000
#> GSM254688     5  0.0865     0.9343 0.036 0.000 0.000 0.000 0.964 0.000
#> GSM254690     1  0.1663     0.7290 0.912 0.000 0.000 0.000 0.088 0.000
#> GSM254696     1  0.3706     0.4372 0.620 0.000 0.380 0.000 0.000 0.000
#> GSM254705     5  0.0865     0.9343 0.036 0.000 0.000 0.000 0.964 0.000
#> GSM254642     1  0.1910     0.7118 0.892 0.000 0.000 0.000 0.108 0.000
#> GSM254661     6  0.3570     0.4713 0.016 0.000 0.228 0.000 0.004 0.752
#> GSM254698     3  0.3866    -0.0521 0.484 0.000 0.516 0.000 0.000 0.000
#> GSM254641     1  0.2537     0.7042 0.872 0.000 0.000 0.000 0.096 0.032
#> GSM254647     1  0.1663     0.7290 0.912 0.000 0.000 0.000 0.088 0.000
#> GSM254663     5  0.1007     0.9289 0.044 0.000 0.000 0.000 0.956 0.000
#> GSM254682     5  0.0865     0.9343 0.036 0.000 0.000 0.000 0.964 0.000
#> GSM254709     5  0.0865     0.9343 0.036 0.000 0.000 0.000 0.964 0.000
#> GSM254721     1  0.1556     0.7338 0.920 0.000 0.000 0.000 0.080 0.000
#> GSM254724     1  0.1524     0.7548 0.932 0.000 0.060 0.000 0.008 0.000
#> GSM254650     5  0.0865     0.9343 0.036 0.000 0.000 0.000 0.964 0.000
#> GSM254687     5  0.0865     0.9343 0.036 0.000 0.000 0.000 0.964 0.000
#> GSM254637     3  0.3634     0.4485 0.356 0.000 0.644 0.000 0.000 0.000
#> GSM254684     3  0.1204     0.8127 0.056 0.000 0.944 0.000 0.000 0.000
#> GSM254649     2  0.0632     0.8991 0.000 0.976 0.000 0.000 0.000 0.024
#> GSM254660     2  0.2875     0.8582 0.052 0.852 0.000 0.000 0.000 0.096
#> GSM254693     2  0.0000     0.9049 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM254695     4  0.1261     0.9128 0.024 0.000 0.000 0.952 0.000 0.024
#> GSM254702     4  0.4963     0.6181 0.052 0.136 0.000 0.716 0.000 0.096
#> GSM254643     2  0.0000     0.9049 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM254727     2  0.2923     0.8578 0.052 0.848 0.000 0.000 0.000 0.100
#> GSM254640     4  0.0000     0.9563 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM254626     2  0.0632     0.8991 0.000 0.976 0.000 0.000 0.000 0.024
#> GSM254635     4  0.0000     0.9563 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM254653     2  0.2923     0.8578 0.052 0.848 0.000 0.000 0.000 0.100
#> GSM254658     2  0.0000     0.9049 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM254681     2  0.1464     0.8813 0.004 0.944 0.000 0.000 0.016 0.036
#> GSM254719     2  0.2923     0.8578 0.052 0.848 0.000 0.000 0.000 0.100
#> GSM254673     2  0.2875     0.8598 0.052 0.852 0.000 0.000 0.000 0.096
#> GSM254655     2  0.2923     0.8578 0.052 0.848 0.000 0.000 0.000 0.100
#> GSM254669     2  0.0508     0.9035 0.004 0.984 0.000 0.000 0.000 0.012
#> GSM254699     2  0.2923     0.8578 0.052 0.848 0.000 0.000 0.000 0.100
#> GSM254703     4  0.0000     0.9563 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM254708     2  0.0000     0.9049 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM254715     4  0.0000     0.9563 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM254628     2  0.0146     0.9040 0.000 0.996 0.000 0.000 0.000 0.004
#> GSM254634     4  0.0000     0.9563 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM254646     2  0.0632     0.8991 0.000 0.976 0.000 0.000 0.000 0.024
#> GSM254671     4  0.0000     0.9563 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM254711     4  0.0000     0.9563 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM254717     2  0.0000     0.9049 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM254723     2  0.6358     0.4340 0.064 0.540 0.000 0.152 0.000 0.244
#> GSM254730     2  0.2875     0.8582 0.052 0.852 0.000 0.000 0.000 0.096
#> GSM254731     4  0.4925     0.6247 0.052 0.132 0.000 0.720 0.000 0.096
#> GSM254632     5  0.2401     0.8107 0.004 0.060 0.000 0.000 0.892 0.044
#> GSM254662     2  0.2923     0.8578 0.052 0.848 0.000 0.000 0.000 0.100
#> GSM254677     4  0.0000     0.9563 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM254665     2  0.0000     0.9049 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM254691     2  0.0000     0.9049 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM254644     4  0.0000     0.9563 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM254667     2  0.3695     0.3555 0.000 0.624 0.000 0.376 0.000 0.000
#> GSM254676     2  0.0000     0.9049 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM254679     4  0.0000     0.9563 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM254689     2  0.1624     0.8764 0.004 0.936 0.000 0.000 0.020 0.040
#> GSM254706     2  0.0363     0.9018 0.000 0.988 0.000 0.000 0.000 0.012
#> GSM254712     4  0.0000     0.9563 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM254713     4  0.0000     0.9563 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM254683     2  0.1624     0.8764 0.004 0.936 0.000 0.000 0.020 0.040
#> GSM254710     5  0.2333     0.8134 0.004 0.060 0.000 0.000 0.896 0.040
#> GSM254725     4  0.0000     0.9563 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM254651     2  0.0000     0.9049 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM254638     4  0.0000     0.9563 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM254685     4  0.0000     0.9563 0.000 0.000 0.000 1.000 0.000 0.000

Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.

consensus_heatmap(res, k = 2)

plot of chunk tab-ATC-skmeans-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-ATC-skmeans-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-ATC-skmeans-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-ATC-skmeans-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-ATC-skmeans-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-ATC-skmeans-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-ATC-skmeans-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-ATC-skmeans-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-ATC-skmeans-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-ATC-skmeans-membership-heatmap-5

As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

plot of chunk tab-ATC-skmeans-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-ATC-skmeans-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-ATC-skmeans-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-ATC-skmeans-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-ATC-skmeans-get-signatures-5

Signature heatmaps where rows are not scaled:

get_signatures(res, k = 2, scale_rows = FALSE)

plot of chunk tab-ATC-skmeans-get-signatures-no-scale-1

get_signatures(res, k = 3, scale_rows = FALSE)

plot of chunk tab-ATC-skmeans-get-signatures-no-scale-2

get_signatures(res, k = 4, scale_rows = FALSE)

plot of chunk tab-ATC-skmeans-get-signatures-no-scale-3

get_signatures(res, k = 5, scale_rows = FALSE)

plot of chunk tab-ATC-skmeans-get-signatures-no-scale-4

get_signatures(res, k = 6, scale_rows = FALSE)

plot of chunk tab-ATC-skmeans-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk ATC-skmeans-signature_compare

get_signature() returns a data frame invisibly. TO get the list of signatures, the function call should be assigned to a variable explicitly. In following code, if plot argument is set to FALSE, no heatmap is plotted while only the differential analysis is performed.

# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)

An example of the output of tb is:

#>   which_row         fdr    mean_1    mean_2 scaled_mean_1 scaled_mean_2 km
#> 1        38 0.042760348  8.373488  9.131774    -0.5533452     0.5164555  1
#> 2        40 0.018707592  7.106213  8.469186    -0.6173731     0.5762149  1
#> 3        55 0.019134737 10.221463 11.207825    -0.6159697     0.5749050  1
#> 4        59 0.006059896  5.921854  7.869574    -0.6899429     0.6439467  1
#> 5        60 0.018055526  8.928898 10.211722    -0.6204761     0.5791110  1
#> 6        98 0.009384629 15.714769 14.887706     0.6635654    -0.6193277  2
...

The columns in tb are:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. km: Row groups if k-means clustering is applied to rows.

UMAP plot which shows how samples are separated.

dimension_reduction(res, k = 2, method = "UMAP")

plot of chunk tab-ATC-skmeans-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-ATC-skmeans-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-ATC-skmeans-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-ATC-skmeans-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-ATC-skmeans-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk ATC-skmeans-collect-classes

Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.

test_to_known_factors(res)
#>               n tissue(p) individual(p) disease.state(p) gender(p) other(p) k
#> ATC:skmeans 106  2.52e-22         0.413            0.571     0.595    0.997 2
#> ATC:skmeans 106  2.97e-21         0.123            0.388     0.854    0.416 3
#> ATC:skmeans 102  9.68e-19         0.229            0.837     0.975    0.925 4
#> ATC:skmeans 103  4.58e-19         0.296            0.736     0.438    0.504 5
#> ATC:skmeans  94  2.87e-17         0.132            0.525     0.267    0.597 6

If matrix rows can be associated to genes, consider to use functional_enrichment(res, ...) to perform function enrichment for the signature genes. See this vignette for more detailed explanations.


ATC:pam**

The object with results only for a single top-value method and a single partition method can be extracted as:

res = res_list["ATC", "pam"]
# you can also extract it by
# res = res_list["ATC:pam"]

A summary of res and all the functions that can be applied to it:

res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#>   On a matrix with 21168 rows and 107 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'ATC' method.
#>   Subgroups are detected by 'pam' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 6.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

collect_plots() function collects all the plots made from res for all k (number of partitions) into one single page to provide an easy and fast comparison between different k.

collect_plots(res)

plot of chunk ATC-pam-collect-plots

The plots are:

All the plots in panels can be made by individual functions and they are plotted later in this section.

select_partition_number() produces several plots showing different statistics for choosing “optimized” k. There are following statistics:

The detailed explanations of these statistics can be found in the cola vignette.

Generally speaking, lower PAC score, higher mean silhouette score or higher concordance corresponds to better partition. Rand index and Jaccard index measure how similar the current partition is compared to partition with k-1. If they are too similar, we won't accept k is better than k-1.

select_partition_number(res)

plot of chunk ATC-pam-select-partition-number

The numeric values for all these statistics can be obtained by get_stats().

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 1.000           0.987       0.994         0.5018 0.499   0.499
#> 3 3 0.698           0.876       0.930         0.2387 0.886   0.773
#> 4 4 0.882           0.885       0.952         0.1439 0.863   0.667
#> 5 5 0.826           0.863       0.914         0.0618 0.910   0.723
#> 6 6 0.971           0.909       0.953         0.0763 0.920   0.696

suggest_best_k() suggests the best \(k\) based on these statistics. The rules are as follows:

suggest_best_k(res)
#> [1] 6
#> attr(,"optional")
#> [1] 2

There is also optional best \(k\) = 2 that is worth to check.

Following shows the table of the partitions (You need to click the show/hide code output link to see it). The membership matrix (columns with name p*) is inferred by clue::cl_consensus() function with the SE method. Basically the value in the membership matrix represents the probability to belong to a certain group. The finall class label for an item is determined with the group with highest probability it belongs to.

In get_classes() function, the entropy is calculated from the membership matrix and the silhouette score is calculated from the consensus matrix.

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>           class entropy silhouette    p1    p2
#> GSM254629     1  0.0000      0.993 1.000 0.000
#> GSM254648     1  0.1414      0.974 0.980 0.020
#> GSM254694     1  0.0000      0.993 1.000 0.000
#> GSM254701     1  0.0000      0.993 1.000 0.000
#> GSM254728     1  0.0000      0.993 1.000 0.000
#> GSM254726     2  0.7376      0.734 0.208 0.792
#> GSM254639     1  0.0000      0.993 1.000 0.000
#> GSM254652     1  0.0000      0.993 1.000 0.000
#> GSM254700     1  0.0000      0.993 1.000 0.000
#> GSM254625     1  0.0000      0.993 1.000 0.000
#> GSM254636     1  0.0000      0.993 1.000 0.000
#> GSM254659     1  0.0000      0.993 1.000 0.000
#> GSM254680     1  0.0000      0.993 1.000 0.000
#> GSM254686     1  0.0000      0.993 1.000 0.000
#> GSM254718     1  0.0000      0.993 1.000 0.000
#> GSM254674     1  0.0000      0.993 1.000 0.000
#> GSM254668     1  0.0000      0.993 1.000 0.000
#> GSM254697     1  0.0000      0.993 1.000 0.000
#> GSM254704     1  0.0000      0.993 1.000 0.000
#> GSM254707     1  0.0000      0.993 1.000 0.000
#> GSM254714     1  0.0000      0.993 1.000 0.000
#> GSM254722     1  0.0000      0.993 1.000 0.000
#> GSM254627     1  0.0000      0.993 1.000 0.000
#> GSM254630     1  0.0000      0.993 1.000 0.000
#> GSM254633     1  0.0000      0.993 1.000 0.000
#> GSM254670     1  0.0000      0.993 1.000 0.000
#> GSM254716     1  0.0000      0.993 1.000 0.000
#> GSM254720     1  0.0000      0.993 1.000 0.000
#> GSM254729     1  0.0000      0.993 1.000 0.000
#> GSM254654     1  0.0000      0.993 1.000 0.000
#> GSM254656     1  0.1414      0.974 0.980 0.020
#> GSM254631     1  0.0000      0.993 1.000 0.000
#> GSM254657     1  0.0000      0.993 1.000 0.000
#> GSM254664     1  0.0000      0.993 1.000 0.000
#> GSM254672     1  0.0000      0.993 1.000 0.000
#> GSM254692     1  0.0000      0.993 1.000 0.000
#> GSM254645     1  0.0000      0.993 1.000 0.000
#> GSM254666     1  0.0000      0.993 1.000 0.000
#> GSM254675     1  0.0000      0.993 1.000 0.000
#> GSM254678     1  0.0000      0.993 1.000 0.000
#> GSM254688     1  0.0000      0.993 1.000 0.000
#> GSM254690     1  0.0000      0.993 1.000 0.000
#> GSM254696     1  0.0000      0.993 1.000 0.000
#> GSM254705     1  0.0000      0.993 1.000 0.000
#> GSM254642     1  0.0000      0.993 1.000 0.000
#> GSM254661     1  0.0000      0.993 1.000 0.000
#> GSM254698     1  0.0000      0.993 1.000 0.000
#> GSM254641     1  0.0000      0.993 1.000 0.000
#> GSM254647     1  0.0000      0.993 1.000 0.000
#> GSM254663     1  0.0000      0.993 1.000 0.000
#> GSM254682     1  0.0000      0.993 1.000 0.000
#> GSM254709     1  0.0000      0.993 1.000 0.000
#> GSM254721     1  0.0000      0.993 1.000 0.000
#> GSM254724     1  0.0000      0.993 1.000 0.000
#> GSM254650     1  0.0000      0.993 1.000 0.000
#> GSM254687     1  0.0000      0.993 1.000 0.000
#> GSM254637     1  0.0000      0.993 1.000 0.000
#> GSM254684     1  0.0000      0.993 1.000 0.000
#> GSM254649     2  0.0000      0.995 0.000 1.000
#> GSM254660     2  0.0000      0.995 0.000 1.000
#> GSM254693     2  0.0000      0.995 0.000 1.000
#> GSM254695     2  0.0000      0.995 0.000 1.000
#> GSM254702     2  0.0000      0.995 0.000 1.000
#> GSM254643     2  0.0000      0.995 0.000 1.000
#> GSM254727     2  0.0000      0.995 0.000 1.000
#> GSM254640     2  0.0000      0.995 0.000 1.000
#> GSM254626     2  0.0000      0.995 0.000 1.000
#> GSM254635     2  0.0000      0.995 0.000 1.000
#> GSM254653     2  0.0000      0.995 0.000 1.000
#> GSM254658     2  0.0000      0.995 0.000 1.000
#> GSM254681     2  0.0000      0.995 0.000 1.000
#> GSM254719     2  0.0000      0.995 0.000 1.000
#> GSM254673     2  0.0000      0.995 0.000 1.000
#> GSM254655     2  0.0000      0.995 0.000 1.000
#> GSM254669     2  0.0000      0.995 0.000 1.000
#> GSM254699     2  0.0000      0.995 0.000 1.000
#> GSM254703     2  0.0000      0.995 0.000 1.000
#> GSM254708     2  0.0000      0.995 0.000 1.000
#> GSM254715     2  0.0000      0.995 0.000 1.000
#> GSM254628     2  0.0000      0.995 0.000 1.000
#> GSM254634     2  0.0000      0.995 0.000 1.000
#> GSM254646     2  0.0000      0.995 0.000 1.000
#> GSM254671     2  0.0000      0.995 0.000 1.000
#> GSM254711     2  0.0000      0.995 0.000 1.000
#> GSM254717     2  0.0000      0.995 0.000 1.000
#> GSM254723     2  0.0938      0.984 0.012 0.988
#> GSM254730     2  0.0000      0.995 0.000 1.000
#> GSM254731     2  0.0000      0.995 0.000 1.000
#> GSM254632     1  0.9248      0.481 0.660 0.340
#> GSM254662     2  0.0000      0.995 0.000 1.000
#> GSM254677     2  0.0000      0.995 0.000 1.000
#> GSM254665     2  0.0000      0.995 0.000 1.000
#> GSM254691     2  0.0000      0.995 0.000 1.000
#> GSM254644     2  0.0000      0.995 0.000 1.000
#> GSM254667     2  0.0000      0.995 0.000 1.000
#> GSM254676     2  0.0000      0.995 0.000 1.000
#> GSM254679     2  0.0000      0.995 0.000 1.000
#> GSM254689     2  0.0000      0.995 0.000 1.000
#> GSM254706     2  0.0000      0.995 0.000 1.000
#> GSM254712     2  0.0000      0.995 0.000 1.000
#> GSM254713     2  0.0000      0.995 0.000 1.000
#> GSM254683     2  0.0000      0.995 0.000 1.000
#> GSM254710     2  0.0000      0.995 0.000 1.000
#> GSM254725     2  0.0000      0.995 0.000 1.000
#> GSM254651     2  0.0000      0.995 0.000 1.000
#> GSM254638     2  0.0000      0.995 0.000 1.000
#> GSM254685     2  0.0000      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
#> GSM254629     3  0.3116     0.8006 0.000 0.108 0.892
#> GSM254648     3  0.3192     0.7961 0.000 0.112 0.888
#> GSM254694     3  0.0000     0.8920 0.000 0.000 1.000
#> GSM254701     3  0.0000     0.8920 0.000 0.000 1.000
#> GSM254728     3  0.0000     0.8920 0.000 0.000 1.000
#> GSM254726     2  0.4887     0.6794 0.000 0.772 0.228
#> GSM254639     3  0.3192     0.8191 0.112 0.000 0.888
#> GSM254652     3  0.0000     0.8920 0.000 0.000 1.000
#> GSM254700     3  0.4555     0.7037 0.200 0.000 0.800
#> GSM254625     1  0.3192     0.9487 0.888 0.000 0.112
#> GSM254636     3  0.0000     0.8920 0.000 0.000 1.000
#> GSM254659     3  0.0000     0.8920 0.000 0.000 1.000
#> GSM254680     3  0.4555     0.7037 0.200 0.000 0.800
#> GSM254686     3  0.0000     0.8920 0.000 0.000 1.000
#> GSM254718     3  0.0000     0.8920 0.000 0.000 1.000
#> GSM254674     3  0.5859     0.4297 0.344 0.000 0.656
#> GSM254668     1  0.3192     0.9487 0.888 0.000 0.112
#> GSM254697     3  0.0000     0.8920 0.000 0.000 1.000
#> GSM254704     3  0.0000     0.8920 0.000 0.000 1.000
#> GSM254707     1  0.3192     0.9487 0.888 0.000 0.112
#> GSM254714     3  0.0000     0.8920 0.000 0.000 1.000
#> GSM254722     3  0.0000     0.8920 0.000 0.000 1.000
#> GSM254627     3  0.0000     0.8920 0.000 0.000 1.000
#> GSM254630     3  0.4654     0.6924 0.208 0.000 0.792
#> GSM254633     3  0.0000     0.8920 0.000 0.000 1.000
#> GSM254670     3  0.3192     0.8191 0.112 0.000 0.888
#> GSM254716     1  0.3192     0.9487 0.888 0.000 0.112
#> GSM254720     3  0.0000     0.8920 0.000 0.000 1.000
#> GSM254729     3  0.1860     0.8632 0.052 0.000 0.948
#> GSM254654     3  0.3192     0.8191 0.112 0.000 0.888
#> GSM254656     3  0.3192     0.8191 0.112 0.000 0.888
#> GSM254631     3  0.0000     0.8920 0.000 0.000 1.000
#> GSM254657     3  0.3192     0.8191 0.112 0.000 0.888
#> GSM254664     3  0.0000     0.8920 0.000 0.000 1.000
#> GSM254672     3  0.0000     0.8920 0.000 0.000 1.000
#> GSM254692     1  0.3192     0.9487 0.888 0.000 0.112
#> GSM254645     3  0.2625     0.8411 0.084 0.000 0.916
#> GSM254666     3  0.0000     0.8920 0.000 0.000 1.000
#> GSM254675     3  0.0000     0.8920 0.000 0.000 1.000
#> GSM254678     3  0.0000     0.8920 0.000 0.000 1.000
#> GSM254688     1  0.3192     0.9487 0.888 0.000 0.112
#> GSM254690     3  0.5810     0.4501 0.336 0.000 0.664
#> GSM254696     3  0.0000     0.8920 0.000 0.000 1.000
#> GSM254705     1  0.3192     0.9487 0.888 0.000 0.112
#> GSM254642     1  0.6309     0.0883 0.504 0.000 0.496
#> GSM254661     3  0.3116     0.8006 0.000 0.108 0.892
#> GSM254698     3  0.0000     0.8920 0.000 0.000 1.000
#> GSM254641     3  0.4121     0.7444 0.168 0.000 0.832
#> GSM254647     3  0.5810     0.4501 0.336 0.000 0.664
#> GSM254663     1  0.3192     0.9487 0.888 0.000 0.112
#> GSM254682     1  0.3192     0.9487 0.888 0.000 0.112
#> GSM254709     1  0.3192     0.9487 0.888 0.000 0.112
#> GSM254721     3  0.5810     0.4501 0.336 0.000 0.664
#> GSM254724     3  0.4346     0.7249 0.184 0.000 0.816
#> GSM254650     1  0.3192     0.9487 0.888 0.000 0.112
#> GSM254687     1  0.3192     0.9487 0.888 0.000 0.112
#> GSM254637     3  0.0000     0.8920 0.000 0.000 1.000
#> GSM254684     3  0.0000     0.8920 0.000 0.000 1.000
#> GSM254649     2  0.0000     0.9604 0.000 1.000 0.000
#> GSM254660     2  0.0000     0.9604 0.000 1.000 0.000
#> GSM254693     2  0.0000     0.9604 0.000 1.000 0.000
#> GSM254695     2  0.0237     0.9591 0.004 0.996 0.000
#> GSM254702     2  0.0000     0.9604 0.000 1.000 0.000
#> GSM254643     2  0.0000     0.9604 0.000 1.000 0.000
#> GSM254727     2  0.0000     0.9604 0.000 1.000 0.000
#> GSM254640     2  0.3192     0.9133 0.112 0.888 0.000
#> GSM254626     2  0.0000     0.9604 0.000 1.000 0.000
#> GSM254635     2  0.3192     0.9133 0.112 0.888 0.000
#> GSM254653     2  0.0000     0.9604 0.000 1.000 0.000
#> GSM254658     2  0.0000     0.9604 0.000 1.000 0.000
#> GSM254681     2  0.0000     0.9604 0.000 1.000 0.000
#> GSM254719     2  0.0000     0.9604 0.000 1.000 0.000
#> GSM254673     2  0.0000     0.9604 0.000 1.000 0.000
#> GSM254655     2  0.0000     0.9604 0.000 1.000 0.000
#> GSM254669     2  0.0000     0.9604 0.000 1.000 0.000
#> GSM254699     2  0.0000     0.9604 0.000 1.000 0.000
#> GSM254703     2  0.0237     0.9591 0.004 0.996 0.000
#> GSM254708     2  0.0000     0.9604 0.000 1.000 0.000
#> GSM254715     2  0.3192     0.9133 0.112 0.888 0.000
#> GSM254628     2  0.0000     0.9604 0.000 1.000 0.000
#> GSM254634     2  0.3192     0.9133 0.112 0.888 0.000
#> GSM254646     2  0.0000     0.9604 0.000 1.000 0.000
#> GSM254671     2  0.3192     0.9133 0.112 0.888 0.000
#> GSM254711     2  0.3192     0.9133 0.112 0.888 0.000
#> GSM254717     2  0.0000     0.9604 0.000 1.000 0.000
#> GSM254723     2  0.0747     0.9487 0.000 0.984 0.016
#> GSM254730     2  0.0000     0.9604 0.000 1.000 0.000
#> GSM254731     2  0.0000     0.9604 0.000 1.000 0.000
#> GSM254632     3  0.5835     0.4527 0.000 0.340 0.660
#> GSM254662     2  0.0000     0.9604 0.000 1.000 0.000
#> GSM254677     2  0.3192     0.9133 0.112 0.888 0.000
#> GSM254665     2  0.0000     0.9604 0.000 1.000 0.000
#> GSM254691     2  0.0000     0.9604 0.000 1.000 0.000
#> GSM254644     2  0.3192     0.9133 0.112 0.888 0.000
#> GSM254667     2  0.0000     0.9604 0.000 1.000 0.000
#> GSM254676     2  0.0000     0.9604 0.000 1.000 0.000
#> GSM254679     2  0.3192     0.9133 0.112 0.888 0.000
#> GSM254689     2  0.0000     0.9604 0.000 1.000 0.000
#> GSM254706     2  0.0000     0.9604 0.000 1.000 0.000
#> GSM254712     2  0.3192     0.9133 0.112 0.888 0.000
#> GSM254713     2  0.3192     0.9133 0.112 0.888 0.000
#> GSM254683     2  0.0000     0.9604 0.000 1.000 0.000
#> GSM254710     1  0.3192     0.8046 0.888 0.112 0.000
#> GSM254725     2  0.3192     0.9133 0.112 0.888 0.000
#> GSM254651     2  0.0000     0.9604 0.000 1.000 0.000
#> GSM254638     2  0.3192     0.9133 0.112 0.888 0.000
#> GSM254685     2  0.3192     0.9133 0.112 0.888 0.000

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM254629     3   0.000      0.925 0.000 0.000 1.000 0.000
#> GSM254648     3   0.000      0.925 0.000 0.000 1.000 0.000
#> GSM254694     3   0.000      0.925 0.000 0.000 1.000 0.000
#> GSM254701     3   0.000      0.925 0.000 0.000 1.000 0.000
#> GSM254728     3   0.000      0.925 0.000 0.000 1.000 0.000
#> GSM254726     3   0.380      0.680 0.000 0.220 0.780 0.000
#> GSM254639     3   0.156      0.881 0.000 0.000 0.944 0.056
#> GSM254652     3   0.000      0.925 0.000 0.000 1.000 0.000
#> GSM254700     3   0.361      0.756 0.200 0.000 0.800 0.000
#> GSM254625     1   0.000      0.920 1.000 0.000 0.000 0.000
#> GSM254636     3   0.000      0.925 0.000 0.000 1.000 0.000
#> GSM254659     3   0.000      0.925 0.000 0.000 1.000 0.000
#> GSM254680     3   0.361      0.756 0.200 0.000 0.800 0.000
#> GSM254686     3   0.000      0.925 0.000 0.000 1.000 0.000
#> GSM254718     3   0.000      0.925 0.000 0.000 1.000 0.000
#> GSM254674     3   0.468      0.522 0.352 0.000 0.648 0.000
#> GSM254668     1   0.000      0.920 1.000 0.000 0.000 0.000
#> GSM254697     3   0.000      0.925 0.000 0.000 1.000 0.000
#> GSM254704     3   0.000      0.925 0.000 0.000 1.000 0.000
#> GSM254707     1   0.000      0.920 1.000 0.000 0.000 0.000
#> GSM254714     3   0.000      0.925 0.000 0.000 1.000 0.000
#> GSM254722     3   0.000      0.925 0.000 0.000 1.000 0.000
#> GSM254627     3   0.000      0.925 0.000 0.000 1.000 0.000
#> GSM254630     3   0.373      0.741 0.212 0.000 0.788 0.000
#> GSM254633     3   0.000      0.925 0.000 0.000 1.000 0.000
#> GSM254670     3   0.000      0.925 0.000 0.000 1.000 0.000
#> GSM254716     1   0.000      0.920 1.000 0.000 0.000 0.000
#> GSM254720     3   0.000      0.925 0.000 0.000 1.000 0.000
#> GSM254729     3   0.000      0.925 0.000 0.000 1.000 0.000
#> GSM254654     3   0.000      0.925 0.000 0.000 1.000 0.000
#> GSM254656     4   0.000      0.917 0.000 0.000 0.000 1.000
#> GSM254631     3   0.000      0.925 0.000 0.000 1.000 0.000
#> GSM254657     4   0.460      0.497 0.000 0.000 0.336 0.664
#> GSM254664     3   0.000      0.925 0.000 0.000 1.000 0.000
#> GSM254672     3   0.000      0.925 0.000 0.000 1.000 0.000
#> GSM254692     1   0.000      0.920 1.000 0.000 0.000 0.000
#> GSM254645     3   0.000      0.925 0.000 0.000 1.000 0.000
#> GSM254666     3   0.000      0.925 0.000 0.000 1.000 0.000
#> GSM254675     3   0.000      0.925 0.000 0.000 1.000 0.000
#> GSM254678     3   0.000      0.925 0.000 0.000 1.000 0.000
#> GSM254688     1   0.000      0.920 1.000 0.000 0.000 0.000
#> GSM254690     3   0.464      0.538 0.344 0.000 0.656 0.000
#> GSM254696     3   0.000      0.925 0.000 0.000 1.000 0.000
#> GSM254705     1   0.000      0.920 1.000 0.000 0.000 0.000
#> GSM254642     1   0.500     -0.166 0.504 0.000 0.496 0.000
#> GSM254661     3   0.000      0.925 0.000 0.000 1.000 0.000
#> GSM254698     3   0.000      0.925 0.000 0.000 1.000 0.000
#> GSM254641     3   0.327      0.790 0.168 0.000 0.832 0.000
#> GSM254647     3   0.464      0.538 0.344 0.000 0.656 0.000
#> GSM254663     1   0.000      0.920 1.000 0.000 0.000 0.000
#> GSM254682     1   0.000      0.920 1.000 0.000 0.000 0.000
#> GSM254709     1   0.000      0.920 1.000 0.000 0.000 0.000
#> GSM254721     3   0.464      0.538 0.344 0.000 0.656 0.000
#> GSM254724     3   0.344      0.773 0.184 0.000 0.816 0.000
#> GSM254650     1   0.000      0.920 1.000 0.000 0.000 0.000
#> GSM254687     1   0.000      0.920 1.000 0.000 0.000 0.000
#> GSM254637     3   0.000      0.925 0.000 0.000 1.000 0.000
#> GSM254684     3   0.000      0.925 0.000 0.000 1.000 0.000
#> GSM254649     2   0.000      0.987 0.000 1.000 0.000 0.000
#> GSM254660     2   0.000      0.987 0.000 1.000 0.000 0.000
#> GSM254693     2   0.000      0.987 0.000 1.000 0.000 0.000
#> GSM254695     4   0.387      0.718 0.000 0.228 0.000 0.772
#> GSM254702     2   0.331      0.782 0.000 0.828 0.000 0.172
#> GSM254643     2   0.000      0.987 0.000 1.000 0.000 0.000
#> GSM254727     2   0.000      0.987 0.000 1.000 0.000 0.000
#> GSM254640     4   0.387      0.718 0.000 0.228 0.000 0.772
#> GSM254626     2   0.000      0.987 0.000 1.000 0.000 0.000
#> GSM254635     4   0.000      0.917 0.000 0.000 0.000 1.000
#> GSM254653     2   0.000      0.987 0.000 1.000 0.000 0.000
#> GSM254658     2   0.000      0.987 0.000 1.000 0.000 0.000
#> GSM254681     2   0.000      0.987 0.000 1.000 0.000 0.000
#> GSM254719     2   0.000      0.987 0.000 1.000 0.000 0.000
#> GSM254673     2   0.000      0.987 0.000 1.000 0.000 0.000
#> GSM254655     2   0.000      0.987 0.000 1.000 0.000 0.000
#> GSM254669     2   0.000      0.987 0.000 1.000 0.000 0.000
#> GSM254699     2   0.000      0.987 0.000 1.000 0.000 0.000
#> GSM254703     4   0.401      0.695 0.000 0.244 0.000 0.756
#> GSM254708     2   0.000      0.987 0.000 1.000 0.000 0.000
#> GSM254715     4   0.000      0.917 0.000 0.000 0.000 1.000
#> GSM254628     2   0.000      0.987 0.000 1.000 0.000 0.000
#> GSM254634     4   0.000      0.917 0.000 0.000 0.000 1.000
#> GSM254646     2   0.000      0.987 0.000 1.000 0.000 0.000
#> GSM254671     4   0.000      0.917 0.000 0.000 0.000 1.000
#> GSM254711     4   0.139      0.882 0.000 0.048 0.000 0.952
#> GSM254717     2   0.000      0.987 0.000 1.000 0.000 0.000
#> GSM254723     3   0.387      0.668 0.000 0.228 0.772 0.000
#> GSM254730     2   0.000      0.987 0.000 1.000 0.000 0.000
#> GSM254731     2   0.208      0.904 0.000 0.916 0.000 0.084
#> GSM254632     3   0.215      0.842 0.000 0.088 0.912 0.000
#> GSM254662     2   0.000      0.987 0.000 1.000 0.000 0.000
#> GSM254677     4   0.000      0.917 0.000 0.000 0.000 1.000
#> GSM254665     2   0.000      0.987 0.000 1.000 0.000 0.000
#> GSM254691     2   0.000      0.987 0.000 1.000 0.000 0.000
#> GSM254644     4   0.000      0.917 0.000 0.000 0.000 1.000
#> GSM254667     2   0.228      0.888 0.000 0.904 0.000 0.096
#> GSM254676     2   0.000      0.987 0.000 1.000 0.000 0.000
#> GSM254679     4   0.000      0.917 0.000 0.000 0.000 1.000
#> GSM254689     2   0.000      0.987 0.000 1.000 0.000 0.000
#> GSM254706     2   0.000      0.987 0.000 1.000 0.000 0.000
#> GSM254712     4   0.000      0.917 0.000 0.000 0.000 1.000
#> GSM254713     4   0.000      0.917 0.000 0.000 0.000 1.000
#> GSM254683     2   0.000      0.987 0.000 1.000 0.000 0.000
#> GSM254710     1   0.410      0.592 0.744 0.256 0.000 0.000
#> GSM254725     4   0.000      0.917 0.000 0.000 0.000 1.000
#> GSM254651     2   0.000      0.987 0.000 1.000 0.000 0.000
#> GSM254638     4   0.000      0.917 0.000 0.000 0.000 1.000
#> GSM254685     4   0.000      0.917 0.000 0.000 0.000 1.000

show/hide code output

cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#>           class entropy silhouette    p1    p2    p3    p4    p5
#> GSM254629     3  0.0000    0.88966 0.000 0.000 1.000 0.000 0.000
#> GSM254648     3  0.0162    0.88754 0.000 0.004 0.996 0.000 0.000
#> GSM254694     3  0.0000    0.88966 0.000 0.000 1.000 0.000 0.000
#> GSM254701     3  0.0000    0.88966 0.000 0.000 1.000 0.000 0.000
#> GSM254728     3  0.0000    0.88966 0.000 0.000 1.000 0.000 0.000
#> GSM254726     2  0.3336    0.64481 0.000 0.772 0.228 0.000 0.000
#> GSM254639     3  0.1341    0.85231 0.000 0.000 0.944 0.056 0.000
#> GSM254652     3  0.0000    0.88966 0.000 0.000 1.000 0.000 0.000
#> GSM254700     3  0.3266    0.82198 0.200 0.000 0.796 0.000 0.004
#> GSM254625     5  0.0000    0.98416 0.000 0.000 0.000 0.000 1.000
#> GSM254636     3  0.0162    0.88899 0.004 0.000 0.996 0.000 0.000
#> GSM254659     3  0.0000    0.88966 0.000 0.000 1.000 0.000 0.000
#> GSM254680     3  0.3109    0.82441 0.200 0.000 0.800 0.000 0.000
#> GSM254686     3  0.3109    0.82441 0.200 0.000 0.800 0.000 0.000
#> GSM254718     3  0.0000    0.88966 0.000 0.000 1.000 0.000 0.000
#> GSM254674     3  0.6146    0.54618 0.200 0.000 0.560 0.000 0.240
#> GSM254668     5  0.0000    0.98416 0.000 0.000 0.000 0.000 1.000
#> GSM254697     3  0.3109    0.82441 0.200 0.000 0.800 0.000 0.000
#> GSM254704     3  0.0000    0.88966 0.000 0.000 1.000 0.000 0.000
#> GSM254707     5  0.0000    0.98416 0.000 0.000 0.000 0.000 1.000
#> GSM254714     3  0.0000    0.88966 0.000 0.000 1.000 0.000 0.000
#> GSM254722     3  0.3109    0.82441 0.200 0.000 0.800 0.000 0.000
#> GSM254627     3  0.3109    0.82441 0.200 0.000 0.800 0.000 0.000
#> GSM254630     3  0.3863    0.80522 0.200 0.000 0.772 0.000 0.028
#> GSM254633     3  0.0000    0.88966 0.000 0.000 1.000 0.000 0.000
#> GSM254670     3  0.0000    0.88966 0.000 0.000 1.000 0.000 0.000
#> GSM254716     5  0.0000    0.98416 0.000 0.000 0.000 0.000 1.000
#> GSM254720     3  0.0000    0.88966 0.000 0.000 1.000 0.000 0.000
#> GSM254729     3  0.0000    0.88966 0.000 0.000 1.000 0.000 0.000
#> GSM254654     3  0.0000    0.88966 0.000 0.000 1.000 0.000 0.000
#> GSM254656     4  0.0000    0.95547 0.000 0.000 0.000 1.000 0.000
#> GSM254631     3  0.0000    0.88966 0.000 0.000 1.000 0.000 0.000
#> GSM254657     4  0.3966    0.50096 0.000 0.000 0.336 0.664 0.000
#> GSM254664     3  0.3074    0.82627 0.196 0.000 0.804 0.000 0.000
#> GSM254672     3  0.0000    0.88966 0.000 0.000 1.000 0.000 0.000
#> GSM254692     5  0.0000    0.98416 0.000 0.000 0.000 0.000 1.000
#> GSM254645     3  0.0000    0.88966 0.000 0.000 1.000 0.000 0.000
#> GSM254666     3  0.0000    0.88966 0.000 0.000 1.000 0.000 0.000
#> GSM254675     3  0.0404    0.88722 0.012 0.000 0.988 0.000 0.000
#> GSM254678     3  0.0000    0.88966 0.000 0.000 1.000 0.000 0.000
#> GSM254688     5  0.2377    0.84986 0.128 0.000 0.000 0.000 0.872
#> GSM254690     3  0.5904    0.60979 0.200 0.000 0.600 0.000 0.200
#> GSM254696     3  0.0000    0.88966 0.000 0.000 1.000 0.000 0.000
#> GSM254705     5  0.0000    0.98416 0.000 0.000 0.000 0.000 1.000
#> GSM254642     3  0.6491    0.33689 0.200 0.000 0.464 0.000 0.336
#> GSM254661     3  0.0000    0.88966 0.000 0.000 1.000 0.000 0.000
#> GSM254698     3  0.2732    0.84105 0.160 0.000 0.840 0.000 0.000
#> GSM254641     3  0.3109    0.82441 0.200 0.000 0.800 0.000 0.000
#> GSM254647     3  0.6146    0.54618 0.200 0.000 0.560 0.000 0.240
#> GSM254663     5  0.0703    0.96398 0.024 0.000 0.000 0.000 0.976
#> GSM254682     5  0.0000    0.98416 0.000 0.000 0.000 0.000 1.000
#> GSM254709     5  0.0000    0.98416 0.000 0.000 0.000 0.000 1.000
#> GSM254721     3  0.6080    0.56630 0.200 0.000 0.572 0.000 0.228
#> GSM254724     3  0.3109    0.82441 0.200 0.000 0.800 0.000 0.000
#> GSM254650     5  0.0000    0.98416 0.000 0.000 0.000 0.000 1.000
#> GSM254687     5  0.0000    0.98416 0.000 0.000 0.000 0.000 1.000
#> GSM254637     3  0.2074    0.86094 0.104 0.000 0.896 0.000 0.000
#> GSM254684     3  0.0000    0.88966 0.000 0.000 1.000 0.000 0.000
#> GSM254649     1  0.3109    0.96811 0.800 0.200 0.000 0.000 0.000
#> GSM254660     2  0.0000    0.90777 0.000 1.000 0.000 0.000 0.000
#> GSM254693     1  0.3143    0.96396 0.796 0.204 0.000 0.000 0.000
#> GSM254695     2  0.3109    0.73085 0.000 0.800 0.000 0.200 0.000
#> GSM254702     2  0.0000    0.90777 0.000 1.000 0.000 0.000 0.000
#> GSM254643     2  0.0000    0.90777 0.000 1.000 0.000 0.000 0.000
#> GSM254727     2  0.0162    0.90677 0.004 0.996 0.000 0.000 0.000
#> GSM254640     2  0.3143    0.72745 0.000 0.796 0.000 0.204 0.000
#> GSM254626     1  0.3109    0.96811 0.800 0.200 0.000 0.000 0.000
#> GSM254635     4  0.0000    0.95547 0.000 0.000 0.000 1.000 0.000
#> GSM254653     2  0.0162    0.90677 0.004 0.996 0.000 0.000 0.000
#> GSM254658     2  0.0162    0.90597 0.004 0.996 0.000 0.000 0.000
#> GSM254681     1  0.3109    0.96811 0.800 0.200 0.000 0.000 0.000
#> GSM254719     2  0.0162    0.90677 0.004 0.996 0.000 0.000 0.000
#> GSM254673     1  0.3109    0.96811 0.800 0.200 0.000 0.000 0.000
#> GSM254655     2  0.0162    0.90677 0.004 0.996 0.000 0.000 0.000
#> GSM254669     2  0.4192   -0.00241 0.404 0.596 0.000 0.000 0.000
#> GSM254699     2  0.0162    0.90677 0.004 0.996 0.000 0.000 0.000
#> GSM254703     2  0.3109    0.73085 0.000 0.800 0.000 0.200 0.000
#> GSM254708     2  0.0000    0.90777 0.000 1.000 0.000 0.000 0.000
#> GSM254715     4  0.0000    0.95547 0.000 0.000 0.000 1.000 0.000
#> GSM254628     1  0.3109    0.96811 0.800 0.200 0.000 0.000 0.000
#> GSM254634     4  0.0000    0.95547 0.000 0.000 0.000 1.000 0.000
#> GSM254646     1  0.3109    0.96811 0.800 0.200 0.000 0.000 0.000
#> GSM254671     4  0.0000    0.95547 0.000 0.000 0.000 1.000 0.000
#> GSM254711     4  0.2377    0.80158 0.000 0.128 0.000 0.872 0.000
#> GSM254717     2  0.0000    0.90777 0.000 1.000 0.000 0.000 0.000
#> GSM254723     2  0.3109    0.68277 0.000 0.800 0.200 0.000 0.000
#> GSM254730     2  0.0000    0.90777 0.000 1.000 0.000 0.000 0.000
#> GSM254731     2  0.0703    0.89290 0.000 0.976 0.000 0.024 0.000
#> GSM254632     3  0.3913    0.44409 0.000 0.324 0.676 0.000 0.000
#> GSM254662     2  0.0162    0.90677 0.004 0.996 0.000 0.000 0.000
#> GSM254677     4  0.0000    0.95547 0.000 0.000 0.000 1.000 0.000
#> GSM254665     2  0.0000    0.90777 0.000 1.000 0.000 0.000 0.000
#> GSM254691     2  0.0000    0.90777 0.000 1.000 0.000 0.000 0.000
#> GSM254644     4  0.0000    0.95547 0.000 0.000 0.000 1.000 0.000
#> GSM254667     2  0.1965    0.83274 0.000 0.904 0.000 0.096 0.000
#> GSM254676     2  0.0000    0.90777 0.000 1.000 0.000 0.000 0.000
#> GSM254679     4  0.0000    0.95547 0.000 0.000 0.000 1.000 0.000
#> GSM254689     1  0.3109    0.96811 0.800 0.200 0.000 0.000 0.000
#> GSM254706     2  0.1121    0.86797 0.044 0.956 0.000 0.000 0.000
#> GSM254712     4  0.0000    0.95547 0.000 0.000 0.000 1.000 0.000
#> GSM254713     4  0.0000    0.95547 0.000 0.000 0.000 1.000 0.000
#> GSM254683     1  0.3109    0.96811 0.800 0.200 0.000 0.000 0.000
#> GSM254710     1  0.3143    0.65726 0.796 0.000 0.000 0.000 0.204
#> GSM254725     4  0.0000    0.95547 0.000 0.000 0.000 1.000 0.000
#> GSM254651     2  0.0000    0.90777 0.000 1.000 0.000 0.000 0.000
#> GSM254638     4  0.0000    0.95547 0.000 0.000 0.000 1.000 0.000
#> GSM254685     4  0.0000    0.95547 0.000 0.000 0.000 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM254629     3  0.0000     0.9388 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM254648     3  0.1387     0.8711 0.000 0.068 0.932 0.000 0.000 0.000
#> GSM254694     3  0.0000     0.9388 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM254701     3  0.0000     0.9388 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM254728     3  0.0000     0.9388 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM254726     2  0.2996     0.6499 0.000 0.772 0.228 0.000 0.000 0.000
#> GSM254639     3  0.1204     0.8906 0.000 0.000 0.944 0.056 0.000 0.000
#> GSM254652     3  0.0000     0.9388 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM254700     1  0.1327     0.9883 0.936 0.000 0.064 0.000 0.000 0.000
#> GSM254625     5  0.0000     0.9836 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM254636     3  0.0146     0.9359 0.004 0.000 0.996 0.000 0.000 0.000
#> GSM254659     3  0.0000     0.9388 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM254680     1  0.1327     0.9883 0.936 0.000 0.064 0.000 0.000 0.000
#> GSM254686     1  0.1327     0.9883 0.936 0.000 0.064 0.000 0.000 0.000
#> GSM254718     3  0.0000     0.9388 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM254674     1  0.1327     0.9883 0.936 0.000 0.064 0.000 0.000 0.000
#> GSM254668     5  0.0000     0.9836 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM254697     1  0.1327     0.9883 0.936 0.000 0.064 0.000 0.000 0.000
#> GSM254704     3  0.0000     0.9388 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM254707     5  0.0000     0.9836 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM254714     3  0.0000     0.9388 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM254722     3  0.3774     0.2623 0.408 0.000 0.592 0.000 0.000 0.000
#> GSM254627     1  0.1327     0.9883 0.936 0.000 0.064 0.000 0.000 0.000
#> GSM254630     1  0.1387     0.9840 0.932 0.000 0.068 0.000 0.000 0.000
#> GSM254633     3  0.0000     0.9388 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM254670     3  0.0000     0.9388 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM254716     5  0.0000     0.9836 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM254720     3  0.0000     0.9388 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM254729     3  0.0000     0.9388 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM254654     3  0.0000     0.9388 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM254656     4  0.0000     0.9591 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM254631     3  0.0000     0.9388 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM254657     4  0.3563     0.4849 0.000 0.000 0.336 0.664 0.000 0.000
#> GSM254664     3  0.3756     0.2876 0.400 0.000 0.600 0.000 0.000 0.000
#> GSM254672     3  0.0000     0.9388 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM254692     5  0.0000     0.9836 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM254645     3  0.0000     0.9388 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM254666     3  0.0000     0.9388 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM254675     3  0.0363     0.9293 0.012 0.000 0.988 0.000 0.000 0.000
#> GSM254678     3  0.0000     0.9388 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM254688     5  0.2135     0.8428 0.128 0.000 0.000 0.000 0.872 0.000
#> GSM254690     1  0.1327     0.9883 0.936 0.000 0.064 0.000 0.000 0.000
#> GSM254696     3  0.0000     0.9388 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM254705     5  0.0000     0.9836 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM254642     1  0.1327     0.9883 0.936 0.000 0.064 0.000 0.000 0.000
#> GSM254661     3  0.0000     0.9388 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM254698     3  0.3351     0.5569 0.288 0.000 0.712 0.000 0.000 0.000
#> GSM254641     1  0.1327     0.9883 0.936 0.000 0.064 0.000 0.000 0.000
#> GSM254647     1  0.1327     0.9883 0.936 0.000 0.064 0.000 0.000 0.000
#> GSM254663     5  0.0632     0.9626 0.024 0.000 0.000 0.000 0.976 0.000
#> GSM254682     5  0.0000     0.9836 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM254709     5  0.0000     0.9836 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM254721     1  0.1327     0.9883 0.936 0.000 0.064 0.000 0.000 0.000
#> GSM254724     1  0.1327     0.9883 0.936 0.000 0.064 0.000 0.000 0.000
#> GSM254650     5  0.0000     0.9836 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM254687     5  0.0000     0.9836 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM254637     1  0.2562     0.8469 0.828 0.000 0.172 0.000 0.000 0.000
#> GSM254684     3  0.0000     0.9388 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM254649     6  0.0000     0.9051 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM254660     2  0.0000     0.9560 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM254693     6  0.0260     0.9003 0.000 0.008 0.000 0.000 0.000 0.992
#> GSM254695     2  0.0000     0.9560 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM254702     2  0.1327     0.9480 0.064 0.936 0.000 0.000 0.000 0.000
#> GSM254643     2  0.0000     0.9560 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM254727     2  0.1471     0.9469 0.064 0.932 0.000 0.000 0.000 0.004
#> GSM254640     2  0.0146     0.9548 0.000 0.996 0.000 0.004 0.000 0.000
#> GSM254626     6  0.0000     0.9051 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM254635     4  0.0000     0.9591 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM254653     2  0.1471     0.9469 0.064 0.932 0.000 0.000 0.000 0.004
#> GSM254658     2  0.1387     0.9261 0.000 0.932 0.000 0.000 0.000 0.068
#> GSM254681     6  0.0000     0.9051 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM254719     2  0.1471     0.9469 0.064 0.932 0.000 0.000 0.000 0.004
#> GSM254673     6  0.1327     0.8629 0.064 0.000 0.000 0.000 0.000 0.936
#> GSM254655     2  0.1471     0.9469 0.064 0.932 0.000 0.000 0.000 0.004
#> GSM254669     6  0.4903    -0.0296 0.060 0.464 0.000 0.000 0.000 0.476
#> GSM254699     2  0.1471     0.9469 0.064 0.932 0.000 0.000 0.000 0.004
#> GSM254703     2  0.0000     0.9560 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM254708     2  0.0000     0.9560 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM254715     4  0.0000     0.9591 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM254628     6  0.0000     0.9051 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM254634     4  0.0000     0.9591 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM254646     6  0.0000     0.9051 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM254671     4  0.0000     0.9591 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM254711     4  0.1714     0.8494 0.000 0.092 0.000 0.908 0.000 0.000
#> GSM254717     2  0.0000     0.9560 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM254723     2  0.1719     0.9414 0.060 0.924 0.016 0.000 0.000 0.000
#> GSM254730     2  0.1327     0.9480 0.064 0.936 0.000 0.000 0.000 0.000
#> GSM254731     2  0.1327     0.9480 0.064 0.936 0.000 0.000 0.000 0.000
#> GSM254632     3  0.3515     0.5201 0.000 0.324 0.676 0.000 0.000 0.000
#> GSM254662     2  0.1471     0.9469 0.064 0.932 0.000 0.000 0.000 0.004
#> GSM254677     4  0.0000     0.9591 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM254665     2  0.0000     0.9560 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM254691     2  0.0000     0.9560 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM254644     4  0.0000     0.9591 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM254667     2  0.0000     0.9560 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM254676     2  0.0000     0.9560 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM254679     4  0.0000     0.9591 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM254689     6  0.0000     0.9051 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM254706     2  0.0865     0.9343 0.000 0.964 0.000 0.000 0.000 0.036
#> GSM254712     4  0.0000     0.9591 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM254713     4  0.0000     0.9591 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM254683     6  0.0000     0.9051 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM254710     6  0.3023     0.6541 0.000 0.000 0.000 0.000 0.232 0.768
#> GSM254725     4  0.0000     0.9591 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM254651     2  0.0000     0.9560 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM254638     4  0.0000     0.9591 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM254685     4  0.0000     0.9591 0.000 0.000 0.000 1.000 0.000 0.000

Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.

consensus_heatmap(res, k = 2)

plot of chunk tab-ATC-pam-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-ATC-pam-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-ATC-pam-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-ATC-pam-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-ATC-pam-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-ATC-pam-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-ATC-pam-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-ATC-pam-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-ATC-pam-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-ATC-pam-membership-heatmap-5

As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

plot of chunk tab-ATC-pam-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-ATC-pam-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-ATC-pam-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-ATC-pam-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-ATC-pam-get-signatures-5

Signature heatmaps where rows are not scaled:

get_signatures(res, k = 2, scale_rows = FALSE)

plot of chunk tab-ATC-pam-get-signatures-no-scale-1

get_signatures(res, k = 3, scale_rows = FALSE)

plot of chunk tab-ATC-pam-get-signatures-no-scale-2

get_signatures(res, k = 4, scale_rows = FALSE)

plot of chunk tab-ATC-pam-get-signatures-no-scale-3

get_signatures(res, k = 5, scale_rows = FALSE)

plot of chunk tab-ATC-pam-get-signatures-no-scale-4

get_signatures(res, k = 6, scale_rows = FALSE)

plot of chunk tab-ATC-pam-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk ATC-pam-signature_compare

get_signature() returns a data frame invisibly. TO get the list of signatures, the function call should be assigned to a variable explicitly. In following code, if plot argument is set to FALSE, no heatmap is plotted while only the differential analysis is performed.

# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)

An example of the output of tb is:

#>   which_row         fdr    mean_1    mean_2 scaled_mean_1 scaled_mean_2 km
#> 1        38 0.042760348  8.373488  9.131774    -0.5533452     0.5164555  1
#> 2        40 0.018707592  7.106213  8.469186    -0.6173731     0.5762149  1
#> 3        55 0.019134737 10.221463 11.207825    -0.6159697     0.5749050  1
#> 4        59 0.006059896  5.921854  7.869574    -0.6899429     0.6439467  1
#> 5        60 0.018055526  8.928898 10.211722    -0.6204761     0.5791110  1
#> 6        98 0.009384629 15.714769 14.887706     0.6635654    -0.6193277  2
...

The columns in tb are:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. km: Row groups if k-means clustering is applied to rows.

UMAP plot which shows how samples are separated.

dimension_reduction(res, k = 2, method = "UMAP")

plot of chunk tab-ATC-pam-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-ATC-pam-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-ATC-pam-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-ATC-pam-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-ATC-pam-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk ATC-pam-collect-classes

Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.

test_to_known_factors(res)
#>           n tissue(p) individual(p) disease.state(p) gender(p) other(p) k
#> ATC:pam 106  3.92e-23         0.588            0.614     0.401    0.814 2
#> ATC:pam 101  5.30e-21         0.100            0.706     0.160    0.524 3
#> ATC:pam 105  2.38e-19         0.137            0.820     0.666    0.818 4
#> ATC:pam 104  2.85e-19         0.107            0.582     0.479    0.602 5
#> ATC:pam 103  3.20e-18         0.183            0.318     0.473    0.867 6

If matrix rows can be associated to genes, consider to use functional_enrichment(res, ...) to perform function enrichment for the signature genes. See this vignette for more detailed explanations.


ATC:mclust**

The object with results only for a single top-value method and a single partition method can be extracted as:

res = res_list["ATC", "mclust"]
# you can also extract it by
# res = res_list["ATC:mclust"]

A summary of res and all the functions that can be applied to it:

res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#>   On a matrix with 21168 rows and 107 columns.
#>   Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'ATC' method.
#>   Subgroups are detected by 'mclust' method.
#>   Performed in total 1250 partitions by row resampling.
#>   Best k for subgroups seems to be 6.
#> 
#> Following methods can be applied to this 'ConsensusPartition' object:
#>  [1] "cola_report"             "collect_classes"         "collect_plots"          
#>  [4] "collect_stats"           "colnames"                "compare_signatures"     
#>  [7] "consensus_heatmap"       "dimension_reduction"     "functional_enrichment"  
#> [10] "get_anno_col"            "get_anno"                "get_classes"            
#> [13] "get_consensus"           "get_matrix"              "get_membership"         
#> [16] "get_param"               "get_signatures"          "get_stats"              
#> [19] "is_best_k"               "is_stable_k"             "membership_heatmap"     
#> [22] "ncol"                    "nrow"                    "plot_ecdf"              
#> [25] "rownames"                "select_partition_number" "show"                   
#> [28] "suggest_best_k"          "test_to_known_factors"

collect_plots() function collects all the plots made from res for all k (number of partitions) into one single page to provide an easy and fast comparison between different k.

collect_plots(res)

plot of chunk ATC-mclust-collect-plots

The plots are:

All the plots in panels can be made by individual functions and they are plotted later in this section.

select_partition_number() produces several plots showing different statistics for choosing “optimized” k. There are following statistics:

The detailed explanations of these statistics can be found in the cola vignette.

Generally speaking, lower PAC score, higher mean silhouette score or higher concordance corresponds to better partition. Rand index and Jaccard index measure how similar the current partition is compared to partition with k-1. If they are too similar, we won't accept k is better than k-1.

select_partition_number(res)

plot of chunk ATC-mclust-select-partition-number

The numeric values for all these statistics can be obtained by get_stats().

get_stats(res)
#>   k 1-PAC mean_silhouette concordance area_increased  Rand Jaccard
#> 2 2 0.340           0.372       0.641         0.3935 0.556   0.556
#> 3 3 0.698           0.873       0.864         0.6366 0.591   0.371
#> 4 4 0.702           0.758       0.806         0.0764 0.763   0.466
#> 5 5 0.740           0.634       0.768         0.0757 0.877   0.640
#> 6 6 0.988           0.945       0.970         0.1121 0.831   0.424

suggest_best_k() suggests the best \(k\) based on these statistics. The rules are as follows:

suggest_best_k(res)
#> [1] 6

Following shows the table of the partitions (You need to click the show/hide code output link to see it). The membership matrix (columns with name p*) is inferred by clue::cl_consensus() function with the SE method. Basically the value in the membership matrix represents the probability to belong to a certain group. The finall class label for an item is determined with the group with highest probability it belongs to.

In get_classes() function, the entropy is calculated from the membership matrix and the silhouette score is calculated from the consensus matrix.

show/hide code output

cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#>           class entropy silhouette    p1    p2
#> GSM254629     2  0.9833     0.3693 0.424 0.576
#> GSM254648     2  0.9833     0.3693 0.424 0.576
#> GSM254694     1  0.9248     0.4625 0.660 0.340
#> GSM254701     1  0.9248     0.4625 0.660 0.340
#> GSM254728     1  0.9248     0.4625 0.660 0.340
#> GSM254726     1  0.9248     0.4625 0.660 0.340
#> GSM254639     1  0.9323     0.4639 0.652 0.348
#> GSM254652     2  0.9833     0.3693 0.424 0.576
#> GSM254700     1  0.9323     0.4639 0.652 0.348
#> GSM254625     1  0.9248     0.4542 0.660 0.340
#> GSM254636     1  0.9323     0.4639 0.652 0.348
#> GSM254659     1  0.9323     0.4639 0.652 0.348
#> GSM254680     2  0.9833     0.3693 0.424 0.576
#> GSM254686     1  0.9323     0.4639 0.652 0.348
#> GSM254718     1  0.9323     0.4639 0.652 0.348
#> GSM254674     1  0.9323     0.4639 0.652 0.348
#> GSM254668     2  0.9881     0.3603 0.436 0.564
#> GSM254697     1  0.9358     0.4535 0.648 0.352
#> GSM254704     2  0.9833     0.3693 0.424 0.576
#> GSM254707     2  0.9881     0.3603 0.436 0.564
#> GSM254714     2  0.9833     0.3693 0.424 0.576
#> GSM254722     1  0.9323     0.4639 0.652 0.348
#> GSM254627     2  0.9833     0.3693 0.424 0.576
#> GSM254630     2  0.9833     0.3693 0.424 0.576
#> GSM254633     2  0.9833     0.3693 0.424 0.576
#> GSM254670     1  0.9323     0.4639 0.652 0.348
#> GSM254716     1  0.9983    -0.0783 0.524 0.476
#> GSM254720     1  0.9323     0.4639 0.652 0.348
#> GSM254729     2  0.9850     0.3597 0.428 0.572
#> GSM254654     2  0.9833     0.3693 0.424 0.576
#> GSM254656     2  0.9833     0.3693 0.424 0.576
#> GSM254631     2  0.9833     0.3693 0.424 0.576
#> GSM254657     2  0.9833     0.3693 0.424 0.576
#> GSM254664     2  0.9833     0.3693 0.424 0.576
#> GSM254672     2  0.9833     0.3693 0.424 0.576
#> GSM254692     2  0.9881     0.3603 0.436 0.564
#> GSM254645     2  0.9833     0.3693 0.424 0.576
#> GSM254666     2  0.9833     0.3693 0.424 0.576
#> GSM254675     2  0.9833     0.3693 0.424 0.576
#> GSM254678     2  0.9833     0.3693 0.424 0.576
#> GSM254688     2  0.9833     0.3693 0.424 0.576
#> GSM254690     1  0.9427     0.4298 0.640 0.360
#> GSM254696     1  0.9323     0.4639 0.652 0.348
#> GSM254705     2  0.9881     0.3603 0.436 0.564
#> GSM254642     2  0.9833     0.3693 0.424 0.576
#> GSM254661     2  0.9833     0.3693 0.424 0.576
#> GSM254698     1  0.9323     0.4639 0.652 0.348
#> GSM254641     2  0.9833     0.3693 0.424 0.576
#> GSM254647     1  0.9323     0.4639 0.652 0.348
#> GSM254663     2  0.9850     0.3658 0.428 0.572
#> GSM254682     2  0.9881     0.3603 0.436 0.564
#> GSM254709     2  0.9881     0.3603 0.436 0.564
#> GSM254721     1  0.9323     0.4639 0.652 0.348
#> GSM254724     1  0.9323     0.4639 0.652 0.348
#> GSM254650     2  0.9881     0.3603 0.436 0.564
#> GSM254687     2  0.9881     0.3603 0.436 0.564
#> GSM254637     2  0.9833     0.3693 0.424 0.576
#> GSM254684     1  0.9323     0.4639 0.652 0.348
#> GSM254649     2  0.0672     0.4770 0.008 0.992
#> GSM254660     2  0.9963    -0.1501 0.464 0.536
#> GSM254693     2  0.0000     0.4819 0.000 1.000
#> GSM254695     2  0.8016     0.0916 0.244 0.756
#> GSM254702     1  0.9881     0.1915 0.564 0.436
#> GSM254643     2  0.0000     0.4819 0.000 1.000
#> GSM254727     1  0.9881     0.1915 0.564 0.436
#> GSM254640     2  0.0000     0.4819 0.000 1.000
#> GSM254626     2  0.0672     0.4770 0.008 0.992
#> GSM254635     2  0.3114     0.4075 0.056 0.944
#> GSM254653     1  0.9881     0.1915 0.564 0.436
#> GSM254658     2  0.0000     0.4819 0.000 1.000
#> GSM254681     2  0.0000     0.4819 0.000 1.000
#> GSM254719     1  0.9881     0.1915 0.564 0.436
#> GSM254673     2  1.0000    -0.1807 0.500 0.500
#> GSM254655     1  0.9881     0.1915 0.564 0.436
#> GSM254669     2  0.9522    -0.0628 0.372 0.628
#> GSM254699     1  0.9881     0.1915 0.564 0.436
#> GSM254703     2  0.0000     0.4819 0.000 1.000
#> GSM254708     2  0.0000     0.4819 0.000 1.000
#> GSM254715     2  0.0000     0.4819 0.000 1.000
#> GSM254628     2  0.0000     0.4819 0.000 1.000
#> GSM254634     2  0.0000     0.4819 0.000 1.000
#> GSM254646     2  0.0672     0.4770 0.008 0.992
#> GSM254671     1  0.9896     0.1894 0.560 0.440
#> GSM254711     2  0.9661    -0.0848 0.392 0.608
#> GSM254717     2  0.0000     0.4819 0.000 1.000
#> GSM254723     1  0.9393     0.4408 0.644 0.356
#> GSM254730     2  0.9963    -0.1501 0.464 0.536
#> GSM254731     1  0.9881     0.1915 0.564 0.436
#> GSM254632     2  0.9833     0.3693 0.424 0.576
#> GSM254662     1  0.9881     0.1915 0.564 0.436
#> GSM254677     2  0.0000     0.4819 0.000 1.000
#> GSM254665     2  0.0000     0.4819 0.000 1.000
#> GSM254691     2  0.0000     0.4819 0.000 1.000
#> GSM254644     2  0.0000     0.4819 0.000 1.000
#> GSM254667     2  0.6148     0.4215 0.152 0.848
#> GSM254676     2  0.0000     0.4819 0.000 1.000
#> GSM254679     2  0.0000     0.4819 0.000 1.000
#> GSM254689     2  0.0672     0.4770 0.008 0.992
#> GSM254706     2  0.0000     0.4819 0.000 1.000
#> GSM254712     2  0.0000     0.4819 0.000 1.000
#> GSM254713     2  0.0000     0.4819 0.000 1.000
#> GSM254683     2  0.0672     0.4770 0.008 0.992
#> GSM254710     2  0.9815     0.3661 0.420 0.580
#> GSM254725     1  0.9998     0.1534 0.508 0.492
#> GSM254651     2  0.0000     0.4819 0.000 1.000
#> GSM254638     2  0.0000     0.4819 0.000 1.000
#> GSM254685     2  0.0000     0.4819 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
#> GSM254629     1  0.1585      0.869 0.964 0.008 0.028
#> GSM254648     1  0.1751      0.868 0.960 0.012 0.028
#> GSM254694     3  0.4002      0.922 0.160 0.000 0.840
#> GSM254701     3  0.4062      0.924 0.164 0.000 0.836
#> GSM254728     3  0.4062      0.924 0.164 0.000 0.836
#> GSM254726     3  0.4475      0.906 0.144 0.016 0.840
#> GSM254639     3  0.4121      0.926 0.168 0.000 0.832
#> GSM254652     1  0.6008      0.486 0.664 0.004 0.332
#> GSM254700     3  0.4399      0.931 0.188 0.000 0.812
#> GSM254625     1  0.1411      0.871 0.964 0.000 0.036
#> GSM254636     3  0.4399      0.931 0.188 0.000 0.812
#> GSM254659     3  0.4121      0.926 0.168 0.000 0.832
#> GSM254680     3  0.6045      0.648 0.380 0.000 0.620
#> GSM254686     3  0.4399      0.931 0.188 0.000 0.812
#> GSM254718     3  0.4121      0.926 0.168 0.000 0.832
#> GSM254674     3  0.4399      0.931 0.188 0.000 0.812
#> GSM254668     1  0.0747      0.876 0.984 0.000 0.016
#> GSM254697     3  0.4399      0.931 0.188 0.000 0.812
#> GSM254704     1  0.5202      0.674 0.772 0.008 0.220
#> GSM254707     1  0.0747      0.876 0.984 0.000 0.016
#> GSM254714     1  0.5502      0.658 0.744 0.008 0.248
#> GSM254722     3  0.4399      0.931 0.188 0.000 0.812
#> GSM254627     1  0.3607      0.804 0.880 0.008 0.112
#> GSM254630     1  0.0747      0.877 0.984 0.000 0.016
#> GSM254633     1  0.5335      0.654 0.760 0.008 0.232
#> GSM254670     3  0.4121      0.926 0.168 0.000 0.832
#> GSM254716     1  0.1163      0.874 0.972 0.000 0.028
#> GSM254720     3  0.4346      0.930 0.184 0.000 0.816
#> GSM254729     3  0.4861      0.907 0.192 0.008 0.800
#> GSM254654     1  0.5202      0.702 0.772 0.008 0.220
#> GSM254656     1  0.4968      0.744 0.800 0.012 0.188
#> GSM254631     1  0.1015      0.873 0.980 0.008 0.012
#> GSM254657     1  0.1711      0.869 0.960 0.008 0.032
#> GSM254664     3  0.6180      0.734 0.332 0.008 0.660
#> GSM254672     1  0.5420      0.639 0.752 0.008 0.240
#> GSM254692     1  0.0747      0.876 0.984 0.000 0.016
#> GSM254645     3  0.6641      0.381 0.448 0.008 0.544
#> GSM254666     1  0.0848      0.874 0.984 0.008 0.008
#> GSM254675     3  0.6314      0.614 0.392 0.004 0.604
#> GSM254678     1  0.5928      0.529 0.696 0.008 0.296
#> GSM254688     1  0.0424      0.876 0.992 0.000 0.008
#> GSM254690     3  0.4654      0.916 0.208 0.000 0.792
#> GSM254696     3  0.4399      0.931 0.188 0.000 0.812
#> GSM254705     1  0.0747      0.876 0.984 0.000 0.016
#> GSM254642     1  0.0424      0.876 0.992 0.000 0.008
#> GSM254661     1  0.1585      0.869 0.964 0.008 0.028
#> GSM254698     3  0.4346      0.930 0.184 0.000 0.816
#> GSM254641     1  0.0848      0.874 0.984 0.008 0.008
#> GSM254647     3  0.4399      0.931 0.188 0.000 0.812
#> GSM254663     1  0.0592      0.876 0.988 0.000 0.012
#> GSM254682     1  0.0747      0.876 0.984 0.000 0.016
#> GSM254709     1  0.0592      0.876 0.988 0.000 0.012
#> GSM254721     3  0.4399      0.931 0.188 0.000 0.812
#> GSM254724     3  0.4399      0.931 0.188 0.000 0.812
#> GSM254650     1  0.0747      0.876 0.984 0.000 0.016
#> GSM254687     1  0.0747      0.876 0.984 0.000 0.016
#> GSM254637     1  0.5502      0.638 0.744 0.008 0.248
#> GSM254684     3  0.4399      0.931 0.188 0.000 0.812
#> GSM254649     2  0.0424      0.952 0.008 0.992 0.000
#> GSM254660     2  0.4002      0.904 0.000 0.840 0.160
#> GSM254693     2  0.0424      0.952 0.008 0.992 0.000
#> GSM254695     3  0.6243      0.773 0.100 0.124 0.776
#> GSM254702     2  0.4178      0.899 0.000 0.828 0.172
#> GSM254643     2  0.0000      0.952 0.000 1.000 0.000
#> GSM254727     2  0.4178      0.899 0.000 0.828 0.172
#> GSM254640     2  0.0000      0.952 0.000 1.000 0.000
#> GSM254626     2  0.0424      0.952 0.008 0.992 0.000
#> GSM254635     2  0.0237      0.952 0.000 0.996 0.004
#> GSM254653     2  0.4178      0.899 0.000 0.828 0.172
#> GSM254658     2  0.0424      0.952 0.008 0.992 0.000
#> GSM254681     2  0.0424      0.952 0.008 0.992 0.000
#> GSM254719     2  0.4178      0.899 0.000 0.828 0.172
#> GSM254673     2  0.4178      0.899 0.000 0.828 0.172
#> GSM254655     2  0.4178      0.899 0.000 0.828 0.172
#> GSM254669     2  0.4062      0.902 0.000 0.836 0.164
#> GSM254699     2  0.4178      0.899 0.000 0.828 0.172
#> GSM254703     2  0.0000      0.952 0.000 1.000 0.000
#> GSM254708     2  0.0424      0.952 0.008 0.992 0.000
#> GSM254715     2  0.0000      0.952 0.000 1.000 0.000
#> GSM254628     2  0.0424      0.952 0.008 0.992 0.000
#> GSM254634     2  0.0000      0.952 0.000 1.000 0.000
#> GSM254646     2  0.0424      0.952 0.008 0.992 0.000
#> GSM254671     2  0.3192      0.922 0.000 0.888 0.112
#> GSM254711     2  0.2066      0.938 0.000 0.940 0.060
#> GSM254717     2  0.0424      0.952 0.008 0.992 0.000
#> GSM254723     3  0.4966      0.847 0.100 0.060 0.840
#> GSM254730     2  0.4178      0.899 0.000 0.828 0.172
#> GSM254731     2  0.4178      0.899 0.000 0.828 0.172
#> GSM254632     1  0.1163      0.870 0.972 0.000 0.028
#> GSM254662     2  0.4178      0.899 0.000 0.828 0.172
#> GSM254677     2  0.0000      0.952 0.000 1.000 0.000
#> GSM254665     2  0.0000      0.952 0.000 1.000 0.000
#> GSM254691     2  0.0000      0.952 0.000 1.000 0.000
#> GSM254644     2  0.0000      0.952 0.000 1.000 0.000
#> GSM254667     1  0.6033      0.455 0.660 0.336 0.004
#> GSM254676     2  0.0000      0.952 0.000 1.000 0.000
#> GSM254679     2  0.0000      0.952 0.000 1.000 0.000
#> GSM254689     2  0.0424      0.952 0.008 0.992 0.000
#> GSM254706     2  0.0892      0.946 0.020 0.980 0.000
#> GSM254712     2  0.0000      0.952 0.000 1.000 0.000
#> GSM254713     2  0.0000      0.952 0.000 1.000 0.000
#> GSM254683     2  0.3752      0.832 0.144 0.856 0.000
#> GSM254710     1  0.2434      0.853 0.940 0.024 0.036
#> GSM254725     2  0.2711      0.930 0.000 0.912 0.088
#> GSM254651     2  0.0424      0.952 0.008 0.992 0.000
#> GSM254638     2  0.0000      0.952 0.000 1.000 0.000
#> GSM254685     2  0.0000      0.952 0.000 1.000 0.000

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM254629     3  0.2928      0.659 0.108 0.000 0.880 0.012
#> GSM254648     3  0.4060      0.571 0.024 0.132 0.832 0.012
#> GSM254694     3  0.4608      0.764 0.004 0.000 0.692 0.304
#> GSM254701     3  0.4608      0.764 0.004 0.000 0.692 0.304
#> GSM254728     3  0.4608      0.764 0.004 0.000 0.692 0.304
#> GSM254726     3  0.4837      0.752 0.004 0.000 0.648 0.348
#> GSM254639     3  0.4431      0.765 0.000 0.000 0.696 0.304
#> GSM254652     3  0.6570      0.748 0.116 0.000 0.604 0.280
#> GSM254700     3  0.4933      0.769 0.016 0.000 0.688 0.296
#> GSM254625     1  0.4606      0.658 0.724 0.000 0.264 0.012
#> GSM254636     3  0.4933      0.769 0.016 0.000 0.688 0.296
#> GSM254659     3  0.4431      0.765 0.000 0.000 0.696 0.304
#> GSM254680     3  0.6773      0.748 0.132 0.000 0.584 0.284
#> GSM254686     3  0.4933      0.769 0.016 0.000 0.688 0.296
#> GSM254718     3  0.4431      0.765 0.000 0.000 0.696 0.304
#> GSM254674     3  0.4933      0.769 0.016 0.000 0.688 0.296
#> GSM254668     1  0.0817      0.863 0.976 0.000 0.024 0.000
#> GSM254697     3  0.4933      0.769 0.016 0.000 0.688 0.296
#> GSM254704     3  0.2976      0.663 0.120 0.000 0.872 0.008
#> GSM254707     1  0.0592      0.864 0.984 0.000 0.016 0.000
#> GSM254714     3  0.2867      0.663 0.104 0.000 0.884 0.012
#> GSM254722     3  0.4933      0.769 0.016 0.000 0.688 0.296
#> GSM254627     3  0.2976      0.663 0.120 0.000 0.872 0.008
#> GSM254630     3  0.3105      0.658 0.140 0.000 0.856 0.004
#> GSM254633     3  0.2976      0.663 0.120 0.000 0.872 0.008
#> GSM254670     3  0.4431      0.765 0.000 0.000 0.696 0.304
#> GSM254716     1  0.4420      0.670 0.748 0.000 0.240 0.012
#> GSM254720     3  0.4820      0.768 0.012 0.000 0.692 0.296
#> GSM254729     3  0.5972      0.764 0.064 0.000 0.632 0.304
#> GSM254654     3  0.3465      0.656 0.072 0.028 0.880 0.020
#> GSM254656     3  0.4576      0.555 0.036 0.132 0.812 0.020
#> GSM254631     3  0.2888      0.661 0.124 0.000 0.872 0.004
#> GSM254657     3  0.3761      0.633 0.044 0.068 0.868 0.020
#> GSM254664     3  0.6773      0.748 0.132 0.000 0.584 0.284
#> GSM254672     3  0.2976      0.663 0.120 0.000 0.872 0.008
#> GSM254692     1  0.0707      0.864 0.980 0.000 0.020 0.000
#> GSM254645     3  0.3205      0.675 0.104 0.000 0.872 0.024
#> GSM254666     3  0.3105      0.660 0.120 0.000 0.868 0.012
#> GSM254675     3  0.6729      0.749 0.128 0.000 0.588 0.284
#> GSM254678     3  0.3105      0.674 0.120 0.000 0.868 0.012
#> GSM254688     1  0.4730      0.582 0.636 0.000 0.364 0.000
#> GSM254690     3  0.5791      0.764 0.060 0.000 0.656 0.284
#> GSM254696     3  0.4933      0.769 0.016 0.000 0.688 0.296
#> GSM254705     1  0.0592      0.864 0.984 0.000 0.016 0.000
#> GSM254642     3  0.2973      0.655 0.144 0.000 0.856 0.000
#> GSM254661     3  0.2928      0.659 0.108 0.000 0.880 0.012
#> GSM254698     3  0.4933      0.769 0.016 0.000 0.688 0.296
#> GSM254641     3  0.2760      0.661 0.128 0.000 0.872 0.000
#> GSM254647     3  0.4933      0.769 0.016 0.000 0.688 0.296
#> GSM254663     1  0.3764      0.756 0.784 0.000 0.216 0.000
#> GSM254682     1  0.0592      0.864 0.984 0.000 0.016 0.000
#> GSM254709     1  0.0592      0.864 0.984 0.000 0.016 0.000
#> GSM254721     3  0.4933      0.769 0.016 0.000 0.688 0.296
#> GSM254724     3  0.4933      0.769 0.016 0.000 0.688 0.296
#> GSM254650     1  0.0592      0.864 0.984 0.000 0.016 0.000
#> GSM254687     1  0.0592      0.864 0.984 0.000 0.016 0.000
#> GSM254637     3  0.2647      0.667 0.120 0.000 0.880 0.000
#> GSM254684     3  0.4933      0.769 0.016 0.000 0.688 0.296
#> GSM254649     2  0.0000      0.911 0.000 1.000 0.000 0.000
#> GSM254660     4  0.4585      0.879 0.000 0.332 0.000 0.668
#> GSM254693     2  0.0000      0.911 0.000 1.000 0.000 0.000
#> GSM254695     4  0.7253     -0.579 0.000 0.144 0.428 0.428
#> GSM254702     4  0.4585      0.879 0.000 0.332 0.000 0.668
#> GSM254643     2  0.0000      0.911 0.000 1.000 0.000 0.000
#> GSM254727     4  0.4585      0.879 0.000 0.332 0.000 0.668
#> GSM254640     2  0.0469      0.908 0.012 0.988 0.000 0.000
#> GSM254626     2  0.0000      0.911 0.000 1.000 0.000 0.000
#> GSM254635     2  0.1388      0.893 0.012 0.960 0.000 0.028
#> GSM254653     4  0.4585      0.879 0.000 0.332 0.000 0.668
#> GSM254658     2  0.0000      0.911 0.000 1.000 0.000 0.000
#> GSM254681     2  0.0000      0.911 0.000 1.000 0.000 0.000
#> GSM254719     4  0.4585      0.879 0.000 0.332 0.000 0.668
#> GSM254673     4  0.4585      0.879 0.000 0.332 0.000 0.668
#> GSM254655     4  0.4585      0.879 0.000 0.332 0.000 0.668
#> GSM254669     4  0.4624      0.871 0.000 0.340 0.000 0.660
#> GSM254699     4  0.4585      0.879 0.000 0.332 0.000 0.668
#> GSM254703     2  0.0336      0.909 0.008 0.992 0.000 0.000
#> GSM254708     2  0.0000      0.911 0.000 1.000 0.000 0.000
#> GSM254715     2  0.1174      0.899 0.012 0.968 0.000 0.020
#> GSM254628     2  0.0000      0.911 0.000 1.000 0.000 0.000
#> GSM254634     2  0.0937      0.905 0.012 0.976 0.000 0.012
#> GSM254646     2  0.0000      0.911 0.000 1.000 0.000 0.000
#> GSM254671     4  0.4948      0.713 0.000 0.440 0.000 0.560
#> GSM254711     2  0.4985     -0.530 0.000 0.532 0.000 0.468
#> GSM254717     2  0.0000      0.911 0.000 1.000 0.000 0.000
#> GSM254723     3  0.6967      0.629 0.004 0.108 0.532 0.356
#> GSM254730     4  0.4585      0.879 0.000 0.332 0.000 0.668
#> GSM254731     4  0.4585      0.879 0.000 0.332 0.000 0.668
#> GSM254632     3  0.3134      0.659 0.100 0.008 0.880 0.012
#> GSM254662     4  0.4585      0.879 0.000 0.332 0.000 0.668
#> GSM254677     2  0.0937      0.905 0.012 0.976 0.000 0.012
#> GSM254665     2  0.0000      0.911 0.000 1.000 0.000 0.000
#> GSM254691     2  0.0000      0.911 0.000 1.000 0.000 0.000
#> GSM254644     2  0.0937      0.905 0.012 0.976 0.000 0.012
#> GSM254667     2  0.5537      0.306 0.016 0.588 0.392 0.004
#> GSM254676     2  0.0000      0.911 0.000 1.000 0.000 0.000
#> GSM254679     2  0.1059      0.903 0.012 0.972 0.000 0.016
#> GSM254689     2  0.3764      0.617 0.216 0.784 0.000 0.000
#> GSM254706     2  0.0000      0.911 0.000 1.000 0.000 0.000
#> GSM254712     2  0.0937      0.905 0.012 0.976 0.000 0.012
#> GSM254713     2  0.0937      0.905 0.012 0.976 0.000 0.012
#> GSM254683     2  0.4795      0.498 0.292 0.696 0.000 0.012
#> GSM254710     1  0.6486      0.597 0.644 0.088 0.256 0.012
#> GSM254725     4  0.4992      0.638 0.000 0.476 0.000 0.524
#> GSM254651     2  0.0000      0.911 0.000 1.000 0.000 0.000
#> GSM254638     2  0.1471      0.891 0.012 0.960 0.004 0.024
#> GSM254685     2  0.0937      0.905 0.012 0.976 0.000 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
#> GSM254629     3  0.0000      0.663 0.000 0.000 1.000 0.000 0.000
#> GSM254648     3  0.1851      0.589 0.000 0.000 0.912 0.088 0.000
#> GSM254694     3  0.3534      0.415 0.256 0.000 0.744 0.000 0.000
#> GSM254701     3  0.3534      0.415 0.256 0.000 0.744 0.000 0.000
#> GSM254728     3  0.3534      0.415 0.256 0.000 0.744 0.000 0.000
#> GSM254726     3  0.6060      0.399 0.136 0.116 0.676 0.072 0.000
#> GSM254639     3  0.3508      0.418 0.252 0.000 0.748 0.000 0.000
#> GSM254652     3  0.2790      0.629 0.068 0.000 0.880 0.000 0.052
#> GSM254700     1  0.4735      0.752 0.524 0.000 0.460 0.000 0.016
#> GSM254625     3  0.4113      0.494 0.028 0.000 0.740 0.000 0.232
#> GSM254636     1  0.4735      0.752 0.524 0.000 0.460 0.000 0.016
#> GSM254659     3  0.3662      0.414 0.252 0.000 0.744 0.000 0.004
#> GSM254680     3  0.6233     -0.448 0.396 0.000 0.460 0.000 0.144
#> GSM254686     1  0.4735      0.752 0.524 0.000 0.460 0.000 0.016
#> GSM254718     3  0.3534      0.415 0.256 0.000 0.744 0.000 0.000
#> GSM254674     1  0.4735      0.752 0.524 0.000 0.460 0.000 0.016
#> GSM254668     5  0.0324      0.955 0.004 0.000 0.004 0.000 0.992
#> GSM254697     1  0.4735      0.752 0.524 0.000 0.460 0.000 0.016
#> GSM254704     3  0.2236      0.640 0.068 0.000 0.908 0.000 0.024
#> GSM254707     5  0.0000      0.958 0.000 0.000 0.000 0.000 1.000
#> GSM254714     3  0.0000      0.663 0.000 0.000 1.000 0.000 0.000
#> GSM254722     1  0.4735      0.752 0.524 0.000 0.460 0.000 0.016
#> GSM254627     3  0.2236      0.640 0.068 0.000 0.908 0.000 0.024
#> GSM254630     3  0.2790      0.629 0.068 0.000 0.880 0.000 0.052
#> GSM254633     3  0.2236      0.640 0.068 0.000 0.908 0.000 0.024
#> GSM254670     3  0.3534      0.415 0.256 0.000 0.744 0.000 0.000
#> GSM254716     3  0.4141      0.491 0.028 0.000 0.736 0.000 0.236
#> GSM254720     3  0.3861      0.384 0.264 0.000 0.728 0.000 0.008
#> GSM254729     3  0.1908      0.626 0.092 0.000 0.908 0.000 0.000
#> GSM254654     3  0.0000      0.663 0.000 0.000 1.000 0.000 0.000
#> GSM254656     3  0.0510      0.660 0.000 0.000 0.984 0.016 0.000
#> GSM254631     3  0.2236      0.640 0.068 0.000 0.908 0.000 0.024
#> GSM254657     3  0.0000      0.663 0.000 0.000 1.000 0.000 0.000
#> GSM254664     3  0.5598     -0.442 0.400 0.000 0.524 0.000 0.076
#> GSM254672     3  0.2144      0.642 0.068 0.000 0.912 0.000 0.020
#> GSM254692     5  0.1544      0.917 0.068 0.000 0.000 0.000 0.932
#> GSM254645     3  0.0000      0.663 0.000 0.000 1.000 0.000 0.000
#> GSM254666     3  0.2079      0.644 0.064 0.000 0.916 0.000 0.020
#> GSM254675     3  0.5309      0.281 0.240 0.000 0.656 0.000 0.104
#> GSM254678     3  0.2300      0.640 0.072 0.000 0.904 0.000 0.024
#> GSM254688     5  0.2927      0.881 0.068 0.000 0.060 0.000 0.872
#> GSM254690     1  0.5042      0.716 0.508 0.000 0.460 0.000 0.032
#> GSM254696     1  0.4747      0.658 0.496 0.000 0.488 0.000 0.016
#> GSM254705     5  0.0162      0.957 0.004 0.000 0.000 0.000 0.996
#> GSM254642     3  0.5447      0.190 0.072 0.000 0.572 0.000 0.356
#> GSM254661     3  0.0000      0.663 0.000 0.000 1.000 0.000 0.000
#> GSM254698     1  0.4735      0.752 0.524 0.000 0.460 0.000 0.016
#> GSM254641     3  0.2325      0.639 0.068 0.000 0.904 0.000 0.028
#> GSM254647     1  0.4735      0.752 0.524 0.000 0.460 0.000 0.016
#> GSM254663     5  0.2859      0.884 0.068 0.000 0.056 0.000 0.876
#> GSM254682     5  0.0000      0.958 0.000 0.000 0.000 0.000 1.000
#> GSM254709     5  0.0000      0.958 0.000 0.000 0.000 0.000 1.000
#> GSM254721     1  0.4735      0.752 0.524 0.000 0.460 0.000 0.016
#> GSM254724     1  0.4735      0.752 0.524 0.000 0.460 0.000 0.016
#> GSM254650     5  0.0000      0.958 0.000 0.000 0.000 0.000 1.000
#> GSM254687     5  0.0000      0.958 0.000 0.000 0.000 0.000 1.000
#> GSM254637     3  0.2236      0.640 0.068 0.000 0.908 0.000 0.024
#> GSM254684     3  0.4696     -0.395 0.428 0.000 0.556 0.000 0.016
#> GSM254649     4  0.5296      0.738 0.468 0.048 0.000 0.484 0.000
#> GSM254660     2  0.0290      0.880 0.000 0.992 0.000 0.008 0.000
#> GSM254693     4  0.5296      0.738 0.468 0.048 0.000 0.484 0.000
#> GSM254695     4  0.7801     -0.122 0.112 0.252 0.176 0.460 0.000
#> GSM254702     2  0.0000      0.884 0.000 1.000 0.000 0.000 0.000
#> GSM254643     4  0.5296      0.738 0.468 0.048 0.000 0.484 0.000
#> GSM254727     2  0.0000      0.884 0.000 1.000 0.000 0.000 0.000
#> GSM254640     4  0.1357      0.658 0.004 0.048 0.000 0.948 0.000
#> GSM254626     4  0.5296      0.738 0.468 0.048 0.000 0.484 0.000
#> GSM254635     4  0.1197      0.656 0.000 0.048 0.000 0.952 0.000
#> GSM254653     2  0.0000      0.884 0.000 1.000 0.000 0.000 0.000
#> GSM254658     4  0.5296      0.738 0.468 0.048 0.000 0.484 0.000
#> GSM254681     4  0.4294      0.741 0.468 0.000 0.000 0.532 0.000
#> GSM254719     2  0.0000      0.884 0.000 1.000 0.000 0.000 0.000
#> GSM254673     2  0.0000      0.884 0.000 1.000 0.000 0.000 0.000
#> GSM254655     2  0.0000      0.884 0.000 1.000 0.000 0.000 0.000
#> GSM254669     2  0.0404      0.877 0.000 0.988 0.000 0.012 0.000
#> GSM254699     2  0.0000      0.884 0.000 1.000 0.000 0.000 0.000
#> GSM254703     4  0.2230      0.698 0.116 0.000 0.000 0.884 0.000
#> GSM254708     4  0.4126      0.744 0.380 0.000 0.000 0.620 0.000
#> GSM254715     4  0.1197      0.656 0.000 0.048 0.000 0.952 0.000
#> GSM254628     4  0.5296      0.738 0.468 0.048 0.000 0.484 0.000
#> GSM254634     4  0.0000      0.667 0.000 0.000 0.000 1.000 0.000
#> GSM254646     4  0.4294      0.741 0.468 0.000 0.000 0.532 0.000
#> GSM254671     2  0.4268      0.427 0.000 0.556 0.000 0.444 0.000
#> GSM254711     2  0.4297      0.374 0.000 0.528 0.000 0.472 0.000
#> GSM254717     4  0.4440      0.741 0.468 0.004 0.000 0.528 0.000
#> GSM254723     3  0.6321      0.376 0.136 0.116 0.656 0.092 0.000
#> GSM254730     2  0.0000      0.884 0.000 1.000 0.000 0.000 0.000
#> GSM254731     2  0.0000      0.884 0.000 1.000 0.000 0.000 0.000
#> GSM254632     3  0.0290      0.662 0.000 0.000 0.992 0.008 0.000
#> GSM254662     2  0.0000      0.884 0.000 1.000 0.000 0.000 0.000
#> GSM254677     4  0.0000      0.667 0.000 0.000 0.000 1.000 0.000
#> GSM254665     4  0.4294      0.741 0.468 0.000 0.000 0.532 0.000
#> GSM254691     4  0.4294      0.741 0.468 0.000 0.000 0.532 0.000
#> GSM254644     4  0.1197      0.656 0.000 0.048 0.000 0.952 0.000
#> GSM254667     4  0.4017      0.679 0.148 0.000 0.064 0.788 0.000
#> GSM254676     4  0.4138      0.744 0.384 0.000 0.000 0.616 0.000
#> GSM254679     4  0.1197      0.656 0.000 0.048 0.000 0.952 0.000
#> GSM254689     4  0.4294      0.741 0.468 0.000 0.000 0.532 0.000
#> GSM254706     4  0.4294      0.741 0.468 0.000 0.000 0.532 0.000
#> GSM254712     4  0.1043      0.659 0.000 0.040 0.000 0.960 0.000
#> GSM254713     4  0.1197      0.656 0.000 0.048 0.000 0.952 0.000
#> GSM254683     1  0.5693     -0.768 0.468 0.080 0.000 0.452 0.000
#> GSM254710     3  0.5458      0.420 0.016 0.000 0.672 0.084 0.228
#> GSM254725     2  0.4291      0.389 0.000 0.536 0.000 0.464 0.000
#> GSM254651     4  0.4294      0.741 0.468 0.000 0.000 0.532 0.000
#> GSM254638     4  0.0000      0.667 0.000 0.000 0.000 1.000 0.000
#> GSM254685     4  0.1197      0.656 0.000 0.048 0.000 0.952 0.000

show/hide code output

cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#>           class entropy silhouette    p1    p2    p3    p4    p5    p6
#> GSM254629     3  0.0363      0.950 0.012 0.000 0.988 0.000 0.000 0.000
#> GSM254648     3  0.0363      0.950 0.012 0.000 0.988 0.000 0.000 0.000
#> GSM254694     1  0.1075      0.940 0.952 0.000 0.048 0.000 0.000 0.000
#> GSM254701     1  0.1075      0.940 0.952 0.000 0.048 0.000 0.000 0.000
#> GSM254728     1  0.1075      0.940 0.952 0.000 0.048 0.000 0.000 0.000
#> GSM254726     6  0.2263      0.893 0.056 0.000 0.048 0.000 0.000 0.896
#> GSM254639     1  0.1075      0.940 0.952 0.000 0.048 0.000 0.000 0.000
#> GSM254652     3  0.1444      0.917 0.072 0.000 0.928 0.000 0.000 0.000
#> GSM254700     1  0.0000      0.959 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM254625     5  0.1434      0.931 0.012 0.000 0.048 0.000 0.940 0.000
#> GSM254636     1  0.0000      0.959 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM254659     1  0.1075      0.940 0.952 0.000 0.048 0.000 0.000 0.000
#> GSM254680     1  0.1957      0.862 0.888 0.000 0.000 0.000 0.112 0.000
#> GSM254686     1  0.0000      0.959 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM254718     1  0.1075      0.940 0.952 0.000 0.048 0.000 0.000 0.000
#> GSM254674     1  0.0000      0.959 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM254668     5  0.0000      0.981 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM254697     1  0.0000      0.959 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM254704     3  0.1267      0.943 0.060 0.000 0.940 0.000 0.000 0.000
#> GSM254707     5  0.0000      0.981 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM254714     3  0.0363      0.950 0.012 0.000 0.988 0.000 0.000 0.000
#> GSM254722     1  0.0000      0.959 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM254627     3  0.1267      0.943 0.060 0.000 0.940 0.000 0.000 0.000
#> GSM254630     3  0.3356      0.823 0.052 0.000 0.808 0.000 0.140 0.000
#> GSM254633     3  0.1267      0.943 0.060 0.000 0.940 0.000 0.000 0.000
#> GSM254670     1  0.1075      0.940 0.952 0.000 0.048 0.000 0.000 0.000
#> GSM254716     5  0.1434      0.931 0.012 0.000 0.048 0.000 0.940 0.000
#> GSM254720     1  0.0000      0.959 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM254729     3  0.2378      0.828 0.152 0.000 0.848 0.000 0.000 0.000
#> GSM254654     3  0.0363      0.950 0.012 0.000 0.988 0.000 0.000 0.000
#> GSM254656     3  0.0363      0.950 0.012 0.000 0.988 0.000 0.000 0.000
#> GSM254631     3  0.1267      0.943 0.060 0.000 0.940 0.000 0.000 0.000
#> GSM254657     3  0.0363      0.950 0.012 0.000 0.988 0.000 0.000 0.000
#> GSM254664     1  0.1714      0.882 0.908 0.000 0.092 0.000 0.000 0.000
#> GSM254672     3  0.1267      0.943 0.060 0.000 0.940 0.000 0.000 0.000
#> GSM254692     5  0.0000      0.981 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM254645     3  0.0363      0.950 0.012 0.000 0.988 0.000 0.000 0.000
#> GSM254666     3  0.0363      0.950 0.012 0.000 0.988 0.000 0.000 0.000
#> GSM254675     1  0.3244      0.604 0.732 0.000 0.268 0.000 0.000 0.000
#> GSM254678     3  0.2300      0.877 0.144 0.000 0.856 0.000 0.000 0.000
#> GSM254688     5  0.0000      0.981 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM254690     1  0.0000      0.959 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM254696     1  0.0000      0.959 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM254705     5  0.0000      0.981 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM254642     5  0.1267      0.924 0.060 0.000 0.000 0.000 0.940 0.000
#> GSM254661     3  0.0363      0.950 0.012 0.000 0.988 0.000 0.000 0.000
#> GSM254698     1  0.0000      0.959 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM254641     3  0.1267      0.943 0.060 0.000 0.940 0.000 0.000 0.000
#> GSM254647     1  0.0000      0.959 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM254663     5  0.0000      0.981 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM254682     5  0.0000      0.981 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM254709     5  0.0000      0.981 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM254721     1  0.0000      0.959 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM254724     1  0.0000      0.959 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM254650     5  0.0000      0.981 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM254687     5  0.0000      0.981 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM254637     3  0.1267      0.943 0.060 0.000 0.940 0.000 0.000 0.000
#> GSM254684     1  0.0000      0.959 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM254649     2  0.0146      0.964 0.000 0.996 0.004 0.000 0.000 0.000
#> GSM254660     6  0.0000      0.975 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM254693     2  0.0000      0.964 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM254695     6  0.1461      0.942 0.000 0.000 0.044 0.016 0.000 0.940
#> GSM254702     6  0.0146      0.974 0.000 0.000 0.000 0.004 0.000 0.996
#> GSM254643     2  0.0260      0.961 0.000 0.992 0.000 0.008 0.000 0.000
#> GSM254727     6  0.0000      0.975 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM254640     4  0.0000      1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM254626     2  0.0146      0.964 0.000 0.996 0.004 0.000 0.000 0.000
#> GSM254635     4  0.0000      1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM254653     6  0.0000      0.975 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM254658     2  0.0000      0.964 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM254681     2  0.0146      0.964 0.000 0.996 0.004 0.000 0.000 0.000
#> GSM254719     6  0.0000      0.975 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM254673     6  0.0000      0.975 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM254655     6  0.0000      0.975 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM254669     6  0.0000      0.975 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM254699     6  0.0000      0.975 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM254703     2  0.1387      0.908 0.000 0.932 0.000 0.068 0.000 0.000
#> GSM254708     2  0.0260      0.963 0.000 0.992 0.008 0.000 0.000 0.000
#> GSM254715     4  0.0000      1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM254628     2  0.0146      0.964 0.000 0.996 0.004 0.000 0.000 0.000
#> GSM254634     4  0.0000      1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM254646     2  0.0146      0.964 0.000 0.996 0.004 0.000 0.000 0.000
#> GSM254671     6  0.1267      0.943 0.000 0.000 0.000 0.060 0.000 0.940
#> GSM254711     6  0.1267      0.943 0.000 0.000 0.000 0.060 0.000 0.940
#> GSM254717     2  0.0260      0.963 0.000 0.992 0.008 0.000 0.000 0.000
#> GSM254723     6  0.1434      0.932 0.012 0.000 0.048 0.000 0.000 0.940
#> GSM254730     6  0.0000      0.975 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM254731     6  0.0146      0.974 0.000 0.000 0.000 0.004 0.000 0.996
#> GSM254632     3  0.0820      0.943 0.012 0.016 0.972 0.000 0.000 0.000
#> GSM254662     6  0.0000      0.975 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM254677     4  0.0000      1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM254665     2  0.0260      0.963 0.000 0.992 0.008 0.000 0.000 0.000
#> GSM254691     2  0.0260      0.963 0.000 0.992 0.008 0.000 0.000 0.000
#> GSM254644     4  0.0000      1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM254667     2  0.1434      0.915 0.000 0.940 0.048 0.012 0.000 0.000
#> GSM254676     2  0.0260      0.963 0.000 0.992 0.008 0.000 0.000 0.000
#> GSM254679     4  0.0000      1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM254689     2  0.0146      0.964 0.000 0.996 0.004 0.000 0.000 0.000
#> GSM254706     2  0.0260      0.963 0.000 0.992 0.008 0.000 0.000 0.000
#> GSM254712     4  0.0000      1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM254713     4  0.0000      1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM254683     2  0.0146      0.964 0.000 0.996 0.004 0.000 0.000 0.000
#> GSM254710     2  0.5050      0.127 0.012 0.512 0.048 0.000 0.428 0.000
#> GSM254725     6  0.1267      0.943 0.000 0.000 0.000 0.060 0.000 0.940
#> GSM254651     2  0.0260      0.963 0.000 0.992 0.008 0.000 0.000 0.000
#> GSM254638     4  0.0000      1.000 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM254685     4  0.0000      1.000 0.000 0.000 0.000 1.000 0.000 0.000

Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.

consensus_heatmap(res, k = 2)

plot of chunk tab-ATC-mclust-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-ATC-mclust-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-ATC-mclust-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-ATC-mclust-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-ATC-mclust-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-ATC-mclust-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-ATC-mclust-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-ATC-mclust-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-ATC-mclust-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-ATC-mclust-membership-heatmap-5

As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

plot of chunk tab-ATC-mclust-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-ATC-mclust-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-ATC-mclust-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-ATC-mclust-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-ATC-mclust-get-signatures-5

Signature heatmaps where rows are not scaled:

get_signatures(res, k = 2, scale_rows = FALSE)

plot of chunk tab-ATC-mclust-get-signatures-no-scale-1

get_signatures(res, k = 3, scale_rows = FALSE)

plot of chunk tab-ATC-mclust-get-signatures-no-scale-2

get_signatures(res, k = 4, scale_rows = FALSE)

plot of chunk tab-ATC-mclust-get-signatures-no-scale-3

get_signatures(res, k = 5, scale_rows = FALSE)

plot of chunk tab-ATC-mclust-get-signatures-no-scale-4

get_signatures(res, k = 6, scale_rows = FALSE)

plot of chunk tab-ATC-mclust-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk ATC-mclust-signature_compare

get_signature() returns a data frame invisibly. TO get the list of signatures, the function call should be assigned to a variable explicitly. In following code, if plot argument is set to FALSE, no heatmap is plotted while only the differential analysis is performed.

# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)

An example of the output of tb is:

#>   which_row         fdr    mean_1    mean_2 scaled_mean_1 scaled_mean_2 km
#> 1        38 0.042760348  8.373488  9.131774    -0.5533452     0.5164555  1
#> 2        40 0.018707592  7.106213  8.469186    -0.6173731     0.5762149  1
#> 3        55 0.019134737 10.221463 11.207825    -0.6159697     0.5749050  1
#> 4        59 0.006059896  5.921854  7.869574    -0.6899429     0.6439467  1
#> 5        60 0.018055526  8.928898 10.211722    -0.6204761     0.5791110  1
#> 6        98 0.009384629 15.714769 14.887706     0.6635654    -0.6193277  2
...

The columns in tb are:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. km: Row groups if k-means clustering is applied to rows.

UMAP plot which shows how samples are separated.

dimension_reduction(res, k = 2, method = "UMAP")

plot of chunk tab-ATC-mclust-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-ATC-mclust-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-ATC-mclust-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-ATC-mclust-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-ATC-mclust-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk ATC-mclust-collect-classes

Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.

test_to_known_factors(res)
#>              n tissue(p) individual(p) disease.state(p) gender(p) other(p) k
#> ATC:mclust   0        NA            NA               NA        NA       NA 2
#> ATC:mclust 104  4.76e-20       0.02886            0.902     0.625    0.934 3
#> ATC:mclust 103  1.07e-19       0.05571            0.855     0.583    0.785 4
#> ATC:mclust  84  1.59e-16       0.00674            0.963     0.994    0.958 5
#> ATC:mclust 106  1.18e-19       0.01011            0.851     0.835    0.652 6

If matrix rows can be associated to genes, consider to use functional_enrichment(res, ...) to perform function enrichment for the signature genes. See this vignette for more detailed explanations.


ATC:NMF**

The object with results only for a single top-value method and a single partition method can be extracted as:

res = res_list["ATC", "NMF"]
# you can also extract it by
# res = res_list["ATC:NMF"]

A summary of res and all the functions that can be applied to it:

res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#>   On a matrix with 21168 rows and 107 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.989       0.996         0.5045 0.496   0.496
#> 3 3 0.887           0.898       0.955         0.3176 0.759   0.549
#> 4 4 0.586           0.563       0.765         0.1144 0.794   0.489
#> 5 5 0.715           0.690       0.841         0.0469 0.888   0.632
#> 6 6 0.643           0.446       0.683         0.0413 0.891   0.587

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
#> GSM254629     1  0.0000      1.000 1.000 0.000
#> GSM254648     2  0.0000      0.991 0.000 1.000
#> GSM254694     1  0.0000      1.000 1.000 0.000
#> GSM254701     1  0.0000      1.000 1.000 0.000
#> GSM254728     1  0.0000      1.000 1.000 0.000
#> GSM254726     2  0.1843      0.965 0.028 0.972
#> GSM254639     1  0.0000      1.000 1.000 0.000
#> GSM254652     1  0.0000      1.000 1.000 0.000
#> GSM254700     1  0.0000      1.000 1.000 0.000
#> GSM254625     1  0.0000      1.000 1.000 0.000
#> GSM254636     1  0.0000      1.000 1.000 0.000
#> GSM254659     1  0.0000      1.000 1.000 0.000
#> GSM254680     1  0.0000      1.000 1.000 0.000
#> GSM254686     1  0.0000      1.000 1.000 0.000
#> GSM254718     1  0.0000      1.000 1.000 0.000
#> GSM254674     1  0.0000      1.000 1.000 0.000
#> GSM254668     1  0.0000      1.000 1.000 0.000
#> GSM254697     1  0.0000      1.000 1.000 0.000
#> GSM254704     1  0.0000      1.000 1.000 0.000
#> GSM254707     1  0.0000      1.000 1.000 0.000
#> GSM254714     1  0.0000      1.000 1.000 0.000
#> GSM254722     1  0.0000      1.000 1.000 0.000
#> GSM254627     1  0.0000      1.000 1.000 0.000
#> GSM254630     1  0.0000      1.000 1.000 0.000
#> GSM254633     1  0.0000      1.000 1.000 0.000
#> GSM254670     1  0.0000      1.000 1.000 0.000
#> GSM254716     1  0.0000      1.000 1.000 0.000
#> GSM254720     1  0.0000      1.000 1.000 0.000
#> GSM254729     1  0.0000      1.000 1.000 0.000
#> GSM254654     1  0.0000      1.000 1.000 0.000
#> GSM254656     2  0.0376      0.988 0.004 0.996
#> GSM254631     1  0.0000      1.000 1.000 0.000
#> GSM254657     1  0.1414      0.979 0.980 0.020
#> GSM254664     1  0.0000      1.000 1.000 0.000
#> GSM254672     1  0.0000      1.000 1.000 0.000
#> GSM254692     1  0.0000      1.000 1.000 0.000
#> GSM254645     1  0.0000      1.000 1.000 0.000
#> GSM254666     1  0.0000      1.000 1.000 0.000
#> GSM254675     1  0.0000      1.000 1.000 0.000
#> GSM254678     1  0.0000      1.000 1.000 0.000
#> GSM254688     1  0.0000      1.000 1.000 0.000
#> GSM254690     1  0.0000      1.000 1.000 0.000
#> GSM254696     1  0.0000      1.000 1.000 0.000
#> GSM254705     1  0.0000      1.000 1.000 0.000
#> GSM254642     1  0.0000      1.000 1.000 0.000
#> GSM254661     1  0.0000      1.000 1.000 0.000
#> GSM254698     1  0.0000      1.000 1.000 0.000
#> GSM254641     1  0.0000      1.000 1.000 0.000
#> GSM254647     1  0.0000      1.000 1.000 0.000
#> GSM254663     1  0.0000      1.000 1.000 0.000
#> GSM254682     1  0.0000      1.000 1.000 0.000
#> GSM254709     1  0.0000      1.000 1.000 0.000
#> GSM254721     1  0.0000      1.000 1.000 0.000
#> GSM254724     1  0.0000      1.000 1.000 0.000
#> GSM254650     1  0.0000      1.000 1.000 0.000
#> GSM254687     1  0.0000      1.000 1.000 0.000
#> GSM254637     1  0.0000      1.000 1.000 0.000
#> GSM254684     1  0.0000      1.000 1.000 0.000
#> GSM254649     2  0.0000      0.991 0.000 1.000
#> GSM254660     2  0.0000      0.991 0.000 1.000
#> GSM254693     2  0.0000      0.991 0.000 1.000
#> GSM254695     2  0.0000      0.991 0.000 1.000
#> GSM254702     2  0.0000      0.991 0.000 1.000
#> GSM254643     2  0.0000      0.991 0.000 1.000
#> GSM254727     2  0.0000      0.991 0.000 1.000
#> GSM254640     2  0.0000      0.991 0.000 1.000
#> GSM254626     2  0.0000      0.991 0.000 1.000
#> GSM254635     2  0.0000      0.991 0.000 1.000
#> GSM254653     2  0.0000      0.991 0.000 1.000
#> GSM254658     2  0.0000      0.991 0.000 1.000
#> GSM254681     2  0.0000      0.991 0.000 1.000
#> GSM254719     2  0.0000      0.991 0.000 1.000
#> GSM254673     2  0.0000      0.991 0.000 1.000
#> GSM254655     2  0.0000      0.991 0.000 1.000
#> GSM254669     2  0.0000      0.991 0.000 1.000
#> GSM254699     2  0.0000      0.991 0.000 1.000
#> GSM254703     2  0.0000      0.991 0.000 1.000
#> GSM254708     2  0.0000      0.991 0.000 1.000
#> GSM254715     2  0.0000      0.991 0.000 1.000
#> GSM254628     2  0.0000      0.991 0.000 1.000
#> GSM254634     2  0.0000      0.991 0.000 1.000
#> GSM254646     2  0.0000      0.991 0.000 1.000
#> GSM254671     2  0.0000      0.991 0.000 1.000
#> GSM254711     2  0.0000      0.991 0.000 1.000
#> GSM254717     2  0.0000      0.991 0.000 1.000
#> GSM254723     2  0.0000      0.991 0.000 1.000
#> GSM254730     2  0.0000      0.991 0.000 1.000
#> GSM254731     2  0.0000      0.991 0.000 1.000
#> GSM254632     2  0.9427      0.442 0.360 0.640
#> GSM254662     2  0.0000      0.991 0.000 1.000
#> GSM254677     2  0.0000      0.991 0.000 1.000
#> GSM254665     2  0.0000      0.991 0.000 1.000
#> GSM254691     2  0.0000      0.991 0.000 1.000
#> GSM254644     2  0.0000      0.991 0.000 1.000
#> GSM254667     2  0.0000      0.991 0.000 1.000
#> GSM254676     2  0.0000      0.991 0.000 1.000
#> GSM254679     2  0.0000      0.991 0.000 1.000
#> GSM254689     2  0.0000      0.991 0.000 1.000
#> GSM254706     2  0.0000      0.991 0.000 1.000
#> GSM254712     2  0.0000      0.991 0.000 1.000
#> GSM254713     2  0.0000      0.991 0.000 1.000
#> GSM254683     2  0.0000      0.991 0.000 1.000
#> GSM254710     2  0.3274      0.932 0.060 0.940
#> GSM254725     2  0.0000      0.991 0.000 1.000
#> GSM254651     2  0.0000      0.991 0.000 1.000
#> GSM254638     2  0.0000      0.991 0.000 1.000
#> GSM254685     2  0.0000      0.991 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
#> GSM254629     1  0.0237      0.977 0.996 0.000 0.004
#> GSM254648     3  0.5591      0.575 0.000 0.304 0.696
#> GSM254694     3  0.0237      0.903 0.004 0.000 0.996
#> GSM254701     1  0.6126      0.270 0.600 0.000 0.400
#> GSM254728     1  0.0000      0.978 1.000 0.000 0.000
#> GSM254726     2  0.0424      0.961 0.008 0.992 0.000
#> GSM254639     3  0.0000      0.903 0.000 0.000 1.000
#> GSM254652     1  0.0237      0.977 0.996 0.000 0.004
#> GSM254700     1  0.0237      0.977 0.996 0.000 0.004
#> GSM254625     1  0.0000      0.978 1.000 0.000 0.000
#> GSM254636     3  0.1163      0.894 0.028 0.000 0.972
#> GSM254659     3  0.5835      0.503 0.340 0.000 0.660
#> GSM254680     1  0.0237      0.977 0.996 0.000 0.004
#> GSM254686     1  0.0000      0.978 1.000 0.000 0.000
#> GSM254718     3  0.0000      0.903 0.000 0.000 1.000
#> GSM254674     1  0.0000      0.978 1.000 0.000 0.000
#> GSM254668     1  0.0000      0.978 1.000 0.000 0.000
#> GSM254697     1  0.0592      0.972 0.988 0.000 0.012
#> GSM254704     3  0.0000      0.903 0.000 0.000 1.000
#> GSM254707     1  0.0000      0.978 1.000 0.000 0.000
#> GSM254714     3  0.0237      0.902 0.004 0.000 0.996
#> GSM254722     1  0.3816      0.813 0.852 0.000 0.148
#> GSM254627     1  0.1163      0.958 0.972 0.000 0.028
#> GSM254630     1  0.0000      0.978 1.000 0.000 0.000
#> GSM254633     3  0.0592      0.900 0.012 0.000 0.988
#> GSM254670     3  0.0000      0.903 0.000 0.000 1.000
#> GSM254716     1  0.0000      0.978 1.000 0.000 0.000
#> GSM254720     3  0.4062      0.776 0.164 0.000 0.836
#> GSM254729     3  0.0000      0.903 0.000 0.000 1.000
#> GSM254654     3  0.0000      0.903 0.000 0.000 1.000
#> GSM254656     3  0.0000      0.903 0.000 0.000 1.000
#> GSM254631     3  0.1411      0.890 0.036 0.000 0.964
#> GSM254657     3  0.0000      0.903 0.000 0.000 1.000
#> GSM254664     1  0.1031      0.962 0.976 0.000 0.024
#> GSM254672     3  0.0000      0.903 0.000 0.000 1.000
#> GSM254692     1  0.0000      0.978 1.000 0.000 0.000
#> GSM254645     3  0.0000      0.903 0.000 0.000 1.000
#> GSM254666     1  0.0592      0.972 0.988 0.000 0.012
#> GSM254675     1  0.0424      0.975 0.992 0.000 0.008
#> GSM254678     3  0.1163      0.894 0.028 0.000 0.972
#> GSM254688     1  0.0000      0.978 1.000 0.000 0.000
#> GSM254690     1  0.0237      0.977 0.996 0.000 0.004
#> GSM254696     3  0.2448      0.862 0.076 0.000 0.924
#> GSM254705     1  0.0000      0.978 1.000 0.000 0.000
#> GSM254642     1  0.0000      0.978 1.000 0.000 0.000
#> GSM254661     3  0.6260      0.240 0.448 0.000 0.552
#> GSM254698     3  0.1163      0.894 0.028 0.000 0.972
#> GSM254641     1  0.0237      0.977 0.996 0.000 0.004
#> GSM254647     1  0.0000      0.978 1.000 0.000 0.000
#> GSM254663     1  0.0000      0.978 1.000 0.000 0.000
#> GSM254682     1  0.0000      0.978 1.000 0.000 0.000
#> GSM254709     1  0.0000      0.978 1.000 0.000 0.000
#> GSM254721     1  0.0237      0.977 0.996 0.000 0.004
#> GSM254724     1  0.0237      0.977 0.996 0.000 0.004
#> GSM254650     1  0.0000      0.978 1.000 0.000 0.000
#> GSM254687     1  0.0000      0.978 1.000 0.000 0.000
#> GSM254637     3  0.5560      0.593 0.300 0.000 0.700
#> GSM254684     3  0.0000      0.903 0.000 0.000 1.000
#> GSM254649     2  0.0000      0.966 0.000 1.000 0.000
#> GSM254660     2  0.0000      0.966 0.000 1.000 0.000
#> GSM254693     2  0.0000      0.966 0.000 1.000 0.000
#> GSM254695     2  0.5431      0.589 0.000 0.716 0.284
#> GSM254702     2  0.0000      0.966 0.000 1.000 0.000
#> GSM254643     2  0.0000      0.966 0.000 1.000 0.000
#> GSM254727     2  0.0000      0.966 0.000 1.000 0.000
#> GSM254640     2  0.0424      0.961 0.000 0.992 0.008
#> GSM254626     2  0.0000      0.966 0.000 1.000 0.000
#> GSM254635     3  0.3482      0.819 0.000 0.128 0.872
#> GSM254653     2  0.0000      0.966 0.000 1.000 0.000
#> GSM254658     2  0.0000      0.966 0.000 1.000 0.000
#> GSM254681     2  0.0237      0.963 0.004 0.996 0.000
#> GSM254719     2  0.0000      0.966 0.000 1.000 0.000
#> GSM254673     2  0.0000      0.966 0.000 1.000 0.000
#> GSM254655     2  0.0000      0.966 0.000 1.000 0.000
#> GSM254669     2  0.0000      0.966 0.000 1.000 0.000
#> GSM254699     2  0.0000      0.966 0.000 1.000 0.000
#> GSM254703     2  0.0424      0.961 0.000 0.992 0.008
#> GSM254708     2  0.0000      0.966 0.000 1.000 0.000
#> GSM254715     2  0.6192      0.242 0.000 0.580 0.420
#> GSM254628     2  0.0000      0.966 0.000 1.000 0.000
#> GSM254634     3  0.0747      0.898 0.000 0.016 0.984
#> GSM254646     2  0.0000      0.966 0.000 1.000 0.000
#> GSM254671     2  0.2878      0.877 0.000 0.904 0.096
#> GSM254711     2  0.4887      0.693 0.000 0.772 0.228
#> GSM254717     2  0.0000      0.966 0.000 1.000 0.000
#> GSM254723     2  0.0000      0.966 0.000 1.000 0.000
#> GSM254730     2  0.0000      0.966 0.000 1.000 0.000
#> GSM254731     2  0.0000      0.966 0.000 1.000 0.000
#> GSM254632     2  0.3192      0.856 0.112 0.888 0.000
#> GSM254662     2  0.0000      0.966 0.000 1.000 0.000
#> GSM254677     3  0.0237      0.902 0.000 0.004 0.996
#> GSM254665     2  0.0000      0.966 0.000 1.000 0.000
#> GSM254691     2  0.0000      0.966 0.000 1.000 0.000
#> GSM254644     2  0.1031      0.949 0.000 0.976 0.024
#> GSM254667     2  0.0000      0.966 0.000 1.000 0.000
#> GSM254676     2  0.0000      0.966 0.000 1.000 0.000
#> GSM254679     3  0.4796      0.709 0.000 0.220 0.780
#> GSM254689     2  0.0237      0.963 0.004 0.996 0.000
#> GSM254706     2  0.0000      0.966 0.000 1.000 0.000
#> GSM254712     3  0.1964      0.877 0.000 0.056 0.944
#> GSM254713     3  0.6244      0.225 0.000 0.440 0.560
#> GSM254683     2  0.0237      0.963 0.004 0.996 0.000
#> GSM254710     2  0.1860      0.921 0.052 0.948 0.000
#> GSM254725     3  0.3941      0.790 0.000 0.156 0.844
#> GSM254651     2  0.0000      0.966 0.000 1.000 0.000
#> GSM254638     3  0.1031      0.895 0.000 0.024 0.976
#> GSM254685     2  0.1529      0.935 0.000 0.960 0.040

show/hide code output

cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#>           class entropy silhouette    p1    p2    p3    p4
#> GSM254629     4  0.3306     0.5230 0.004 0.000 0.156 0.840
#> GSM254648     4  0.5163     0.0231 0.004 0.000 0.480 0.516
#> GSM254694     1  0.1489     0.6444 0.952 0.044 0.004 0.000
#> GSM254701     1  0.3684     0.5717 0.844 0.004 0.132 0.020
#> GSM254728     1  0.0524     0.6840 0.988 0.004 0.000 0.008
#> GSM254726     2  0.5184     0.5960 0.212 0.732 0.000 0.056
#> GSM254639     3  0.4193     0.6786 0.268 0.000 0.732 0.000
#> GSM254652     4  0.5050     0.3722 0.152 0.000 0.084 0.764
#> GSM254700     1  0.3123     0.7455 0.844 0.000 0.000 0.156
#> GSM254625     4  0.0707     0.5437 0.020 0.000 0.000 0.980
#> GSM254636     1  0.5025     0.3516 0.716 0.000 0.252 0.032
#> GSM254659     1  0.6121     0.6407 0.680 0.000 0.164 0.156
#> GSM254680     1  0.4193     0.7195 0.732 0.000 0.000 0.268
#> GSM254686     1  0.4250     0.7167 0.724 0.000 0.000 0.276
#> GSM254718     3  0.4978     0.5762 0.384 0.004 0.612 0.000
#> GSM254674     1  0.4331     0.7072 0.712 0.000 0.000 0.288
#> GSM254668     1  0.4981     0.4912 0.536 0.000 0.000 0.464
#> GSM254697     1  0.2530     0.7354 0.888 0.000 0.000 0.112
#> GSM254704     3  0.4406     0.6465 0.300 0.000 0.700 0.000
#> GSM254707     4  0.3610     0.3592 0.200 0.000 0.000 0.800
#> GSM254714     3  0.0188     0.7488 0.004 0.000 0.996 0.000
#> GSM254722     1  0.1637     0.7153 0.940 0.000 0.000 0.060
#> GSM254627     1  0.3494     0.7467 0.824 0.000 0.004 0.172
#> GSM254630     1  0.5000     0.4100 0.500 0.000 0.000 0.500
#> GSM254633     3  0.4406     0.6468 0.300 0.000 0.700 0.000
#> GSM254670     3  0.5028     0.5692 0.400 0.004 0.596 0.000
#> GSM254716     4  0.1211     0.5355 0.040 0.000 0.000 0.960
#> GSM254720     1  0.0376     0.6851 0.992 0.000 0.004 0.004
#> GSM254729     3  0.3528     0.7348 0.192 0.000 0.808 0.000
#> GSM254654     3  0.0000     0.7484 0.000 0.000 1.000 0.000
#> GSM254656     3  0.0188     0.7488 0.004 0.000 0.996 0.000
#> GSM254631     3  0.3448     0.7277 0.168 0.000 0.828 0.004
#> GSM254657     3  0.0188     0.7488 0.004 0.000 0.996 0.000
#> GSM254664     1  0.3528     0.7448 0.808 0.000 0.000 0.192
#> GSM254672     3  0.3975     0.6982 0.240 0.000 0.760 0.000
#> GSM254692     1  0.4977     0.4977 0.540 0.000 0.000 0.460
#> GSM254645     3  0.2469     0.7476 0.108 0.000 0.892 0.000
#> GSM254666     3  0.5310     0.2566 0.012 0.000 0.576 0.412
#> GSM254675     1  0.4072     0.7267 0.748 0.000 0.000 0.252
#> GSM254678     3  0.5075     0.5733 0.344 0.000 0.644 0.012
#> GSM254688     4  0.4916    -0.2838 0.424 0.000 0.000 0.576
#> GSM254690     1  0.4164     0.7221 0.736 0.000 0.000 0.264
#> GSM254696     1  0.0336     0.6885 0.992 0.000 0.000 0.008
#> GSM254705     1  0.4977     0.4977 0.540 0.000 0.000 0.460
#> GSM254642     1  0.4477     0.6830 0.688 0.000 0.000 0.312
#> GSM254661     4  0.5050     0.1686 0.004 0.000 0.408 0.588
#> GSM254698     1  0.0592     0.6798 0.984 0.000 0.016 0.000
#> GSM254641     1  0.5039     0.5706 0.592 0.000 0.004 0.404
#> GSM254647     1  0.3610     0.7437 0.800 0.000 0.000 0.200
#> GSM254663     1  0.4977     0.4977 0.540 0.000 0.000 0.460
#> GSM254682     4  0.4967    -0.3649 0.452 0.000 0.000 0.548
#> GSM254709     4  0.3610     0.3771 0.200 0.000 0.000 0.800
#> GSM254721     1  0.3311     0.7473 0.828 0.000 0.000 0.172
#> GSM254724     1  0.3172     0.7459 0.840 0.000 0.000 0.160
#> GSM254650     4  0.3074     0.4491 0.152 0.000 0.000 0.848
#> GSM254687     4  0.3219     0.4240 0.164 0.000 0.000 0.836
#> GSM254637     1  0.6545     0.5978 0.632 0.000 0.216 0.152
#> GSM254684     1  0.4877    -0.2421 0.592 0.000 0.408 0.000
#> GSM254649     2  0.4222     0.6451 0.000 0.728 0.000 0.272
#> GSM254660     2  0.0000     0.7746 0.000 1.000 0.000 0.000
#> GSM254693     2  0.3266     0.7302 0.000 0.832 0.000 0.168
#> GSM254695     2  0.3870     0.6477 0.208 0.788 0.004 0.000
#> GSM254702     2  0.0657     0.7710 0.012 0.984 0.004 0.000
#> GSM254643     2  0.3356     0.7255 0.000 0.824 0.000 0.176
#> GSM254727     2  0.0000     0.7746 0.000 1.000 0.000 0.000
#> GSM254640     2  0.4553     0.6787 0.000 0.780 0.180 0.040
#> GSM254626     2  0.3873     0.6868 0.000 0.772 0.000 0.228
#> GSM254635     3  0.5543     0.1055 0.020 0.424 0.556 0.000
#> GSM254653     2  0.0188     0.7746 0.000 0.996 0.000 0.004
#> GSM254658     2  0.3172     0.7348 0.000 0.840 0.000 0.160
#> GSM254681     4  0.4977    -0.1820 0.000 0.460 0.000 0.540
#> GSM254719     2  0.0000     0.7746 0.000 1.000 0.000 0.000
#> GSM254673     2  0.0921     0.7733 0.000 0.972 0.000 0.028
#> GSM254655     2  0.0000     0.7746 0.000 1.000 0.000 0.000
#> GSM254669     2  0.1302     0.7717 0.000 0.956 0.000 0.044
#> GSM254699     2  0.0188     0.7739 0.004 0.996 0.000 0.000
#> GSM254703     2  0.2124     0.7700 0.000 0.932 0.040 0.028
#> GSM254708     2  0.2760     0.7500 0.000 0.872 0.000 0.128
#> GSM254715     2  0.5126     0.2078 0.004 0.552 0.444 0.000
#> GSM254628     2  0.4356     0.6215 0.000 0.708 0.000 0.292
#> GSM254634     3  0.0524     0.7467 0.004 0.008 0.988 0.000
#> GSM254646     2  0.4925     0.3950 0.000 0.572 0.000 0.428
#> GSM254671     2  0.2799     0.7247 0.108 0.884 0.008 0.000
#> GSM254711     2  0.3820     0.7112 0.064 0.848 0.088 0.000
#> GSM254717     2  0.2647     0.7531 0.000 0.880 0.000 0.120
#> GSM254723     2  0.3945     0.6395 0.216 0.780 0.004 0.000
#> GSM254730     2  0.0000     0.7746 0.000 1.000 0.000 0.000
#> GSM254731     2  0.1661     0.7560 0.052 0.944 0.004 0.000
#> GSM254632     4  0.2216     0.5552 0.000 0.092 0.000 0.908
#> GSM254662     2  0.0000     0.7746 0.000 1.000 0.000 0.000
#> GSM254677     3  0.0336     0.7487 0.008 0.000 0.992 0.000
#> GSM254665     2  0.4730     0.5158 0.000 0.636 0.000 0.364
#> GSM254691     2  0.3975     0.6765 0.000 0.760 0.000 0.240
#> GSM254644     2  0.2401     0.7387 0.004 0.904 0.092 0.000
#> GSM254667     4  0.7849    -0.0507 0.000 0.284 0.316 0.400
#> GSM254676     2  0.2345     0.7596 0.000 0.900 0.000 0.100
#> GSM254679     2  0.5606     0.0782 0.020 0.500 0.480 0.000
#> GSM254689     4  0.4977    -0.1820 0.000 0.460 0.000 0.540
#> GSM254706     2  0.4866     0.4432 0.000 0.596 0.000 0.404
#> GSM254712     3  0.1489     0.7270 0.004 0.044 0.952 0.000
#> GSM254713     2  0.5137     0.1881 0.004 0.544 0.452 0.000
#> GSM254683     2  0.5000     0.2349 0.000 0.504 0.000 0.496
#> GSM254710     4  0.3266     0.4772 0.000 0.168 0.000 0.832
#> GSM254725     2  0.7098     0.2776 0.152 0.536 0.312 0.000
#> GSM254651     2  0.4304     0.6314 0.000 0.716 0.000 0.284
#> GSM254638     3  0.1209     0.7356 0.004 0.032 0.964 0.000
#> GSM254685     3  0.4872     0.2462 0.000 0.356 0.640 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
#> GSM254629     5  0.1195     0.7475 0.000 0.000 0.012 0.028 0.960
#> GSM254648     5  0.3690     0.5624 0.000 0.000 0.012 0.224 0.764
#> GSM254694     3  0.0566     0.7873 0.012 0.000 0.984 0.004 0.000
#> GSM254701     3  0.1648     0.7872 0.020 0.000 0.940 0.000 0.040
#> GSM254728     3  0.1845     0.7883 0.056 0.000 0.928 0.000 0.016
#> GSM254726     3  0.2554     0.7505 0.000 0.036 0.892 0.000 0.072
#> GSM254639     3  0.3916     0.7403 0.056 0.000 0.804 0.136 0.004
#> GSM254652     5  0.1901     0.7325 0.012 0.000 0.056 0.004 0.928
#> GSM254700     1  0.0880     0.7858 0.968 0.000 0.032 0.000 0.000
#> GSM254625     5  0.0955     0.7508 0.028 0.000 0.004 0.000 0.968
#> GSM254636     1  0.3777     0.6038 0.784 0.000 0.192 0.020 0.004
#> GSM254659     1  0.6022     0.2672 0.572 0.000 0.336 0.044 0.048
#> GSM254680     1  0.0162     0.7958 0.996 0.000 0.000 0.000 0.004
#> GSM254686     1  0.6211     0.5320 0.548 0.000 0.204 0.000 0.248
#> GSM254718     3  0.2694     0.7889 0.068 0.000 0.892 0.032 0.008
#> GSM254674     1  0.3462     0.7368 0.792 0.000 0.012 0.000 0.196
#> GSM254668     1  0.3534     0.6851 0.744 0.000 0.000 0.000 0.256
#> GSM254697     1  0.0794     0.7864 0.972 0.000 0.028 0.000 0.000
#> GSM254704     4  0.4892     0.5769 0.276 0.000 0.040 0.676 0.008
#> GSM254707     5  0.2488     0.6958 0.124 0.000 0.004 0.000 0.872
#> GSM254714     4  0.2673     0.7327 0.008 0.000 0.072 0.892 0.028
#> GSM254722     1  0.1270     0.7747 0.948 0.000 0.052 0.000 0.000
#> GSM254627     1  0.0854     0.7897 0.976 0.000 0.012 0.004 0.008
#> GSM254630     1  0.3231     0.7340 0.800 0.000 0.000 0.004 0.196
#> GSM254633     4  0.5417     0.4496 0.372 0.000 0.048 0.572 0.008
#> GSM254670     3  0.3446     0.7695 0.108 0.000 0.840 0.048 0.004
#> GSM254716     5  0.1281     0.7495 0.032 0.000 0.012 0.000 0.956
#> GSM254720     1  0.4291    -0.0925 0.536 0.000 0.464 0.000 0.000
#> GSM254729     4  0.4694     0.5090 0.032 0.004 0.288 0.676 0.000
#> GSM254654     4  0.1522     0.7371 0.000 0.000 0.044 0.944 0.012
#> GSM254656     4  0.1043     0.7383 0.000 0.000 0.040 0.960 0.000
#> GSM254631     4  0.4438     0.6303 0.228 0.000 0.032 0.732 0.008
#> GSM254657     4  0.1082     0.7369 0.000 0.000 0.028 0.964 0.008
#> GSM254664     1  0.1124     0.7827 0.960 0.000 0.036 0.004 0.000
#> GSM254672     4  0.4674     0.6193 0.212 0.000 0.052 0.728 0.008
#> GSM254692     1  0.3177     0.7218 0.792 0.000 0.000 0.000 0.208
#> GSM254645     4  0.3635     0.7060 0.112 0.000 0.056 0.828 0.004
#> GSM254666     4  0.4597     0.5502 0.020 0.000 0.020 0.716 0.244
#> GSM254675     1  0.1117     0.7968 0.964 0.000 0.020 0.000 0.016
#> GSM254678     1  0.5364     0.0841 0.572 0.000 0.044 0.376 0.008
#> GSM254688     1  0.3816     0.6215 0.696 0.000 0.000 0.000 0.304
#> GSM254690     1  0.0290     0.7947 0.992 0.000 0.008 0.000 0.000
#> GSM254696     3  0.3579     0.7010 0.240 0.000 0.756 0.004 0.000
#> GSM254705     1  0.3210     0.7188 0.788 0.000 0.000 0.000 0.212
#> GSM254642     1  0.0671     0.7959 0.980 0.000 0.004 0.000 0.016
#> GSM254661     5  0.2124     0.7209 0.000 0.000 0.004 0.096 0.900
#> GSM254698     3  0.4251     0.5195 0.372 0.000 0.624 0.004 0.000
#> GSM254641     1  0.3289     0.7513 0.816 0.000 0.008 0.004 0.172
#> GSM254647     1  0.0404     0.7936 0.988 0.000 0.012 0.000 0.000
#> GSM254663     1  0.2966     0.7391 0.816 0.000 0.000 0.000 0.184
#> GSM254682     1  0.3796     0.6275 0.700 0.000 0.000 0.000 0.300
#> GSM254709     5  0.4305    -0.1985 0.488 0.000 0.000 0.000 0.512
#> GSM254721     1  0.0671     0.7946 0.980 0.000 0.016 0.000 0.004
#> GSM254724     1  0.0609     0.7912 0.980 0.000 0.020 0.000 0.000
#> GSM254650     1  0.3837     0.6174 0.692 0.000 0.000 0.000 0.308
#> GSM254687     5  0.3395     0.5468 0.236 0.000 0.000 0.000 0.764
#> GSM254637     1  0.1525     0.7889 0.948 0.000 0.004 0.036 0.012
#> GSM254684     3  0.4944     0.5502 0.344 0.000 0.620 0.032 0.004
#> GSM254649     2  0.1270     0.8619 0.000 0.948 0.000 0.000 0.052
#> GSM254660     2  0.0609     0.8755 0.000 0.980 0.020 0.000 0.000
#> GSM254693     2  0.0703     0.8726 0.000 0.976 0.000 0.000 0.024
#> GSM254695     2  0.4798     0.2353 0.000 0.512 0.472 0.012 0.004
#> GSM254702     2  0.2452     0.8473 0.000 0.896 0.084 0.016 0.004
#> GSM254643     2  0.1117     0.8742 0.000 0.964 0.000 0.016 0.020
#> GSM254727     2  0.1484     0.8723 0.000 0.944 0.048 0.000 0.008
#> GSM254640     2  0.2439     0.8271 0.000 0.876 0.004 0.120 0.000
#> GSM254626     2  0.0880     0.8701 0.000 0.968 0.000 0.000 0.032
#> GSM254635     2  0.6301     0.2448 0.000 0.492 0.140 0.364 0.004
#> GSM254653     2  0.0566     0.8766 0.000 0.984 0.012 0.000 0.004
#> GSM254658     2  0.0510     0.8747 0.000 0.984 0.000 0.000 0.016
#> GSM254681     5  0.3863     0.5913 0.000 0.248 0.012 0.000 0.740
#> GSM254719     2  0.0290     0.8766 0.000 0.992 0.008 0.000 0.000
#> GSM254673     2  0.0510     0.8749 0.000 0.984 0.000 0.000 0.016
#> GSM254655     2  0.0880     0.8738 0.000 0.968 0.032 0.000 0.000
#> GSM254669     2  0.0404     0.8751 0.000 0.988 0.000 0.000 0.012
#> GSM254699     2  0.1768     0.8598 0.000 0.924 0.072 0.000 0.004
#> GSM254703     2  0.2228     0.8520 0.000 0.908 0.012 0.076 0.004
#> GSM254708     2  0.0794     0.8714 0.000 0.972 0.000 0.000 0.028
#> GSM254715     2  0.4557     0.7031 0.000 0.736 0.056 0.204 0.004
#> GSM254628     2  0.1270     0.8614 0.000 0.948 0.000 0.000 0.052
#> GSM254634     4  0.1568     0.7384 0.000 0.020 0.036 0.944 0.000
#> GSM254646     2  0.4126     0.3384 0.000 0.620 0.000 0.000 0.380
#> GSM254671     2  0.4602     0.5544 0.000 0.640 0.340 0.016 0.004
#> GSM254711     2  0.3722     0.7946 0.000 0.812 0.144 0.040 0.004
#> GSM254717     2  0.0451     0.8761 0.000 0.988 0.000 0.004 0.008
#> GSM254723     3  0.1630     0.7695 0.004 0.036 0.944 0.000 0.016
#> GSM254730     2  0.1116     0.8731 0.000 0.964 0.028 0.004 0.004
#> GSM254731     2  0.2783     0.8310 0.000 0.868 0.116 0.012 0.004
#> GSM254632     5  0.2710     0.7426 0.032 0.056 0.000 0.016 0.896
#> GSM254662     2  0.0404     0.8764 0.000 0.988 0.012 0.000 0.000
#> GSM254677     4  0.2011     0.7273 0.000 0.004 0.088 0.908 0.000
#> GSM254665     2  0.3078     0.7950 0.000 0.848 0.004 0.016 0.132
#> GSM254691     2  0.1485     0.8698 0.000 0.948 0.000 0.020 0.032
#> GSM254644     2  0.2983     0.8312 0.000 0.868 0.032 0.096 0.004
#> GSM254667     4  0.5094     0.0597 0.000 0.468 0.012 0.504 0.016
#> GSM254676     2  0.0404     0.8762 0.000 0.988 0.000 0.012 0.000
#> GSM254679     2  0.5057     0.6404 0.000 0.684 0.072 0.240 0.004
#> GSM254689     5  0.3814     0.5739 0.000 0.276 0.004 0.000 0.720
#> GSM254706     2  0.2408     0.8303 0.000 0.892 0.004 0.008 0.096
#> GSM254712     4  0.1430     0.7259 0.000 0.052 0.004 0.944 0.000
#> GSM254713     2  0.4550     0.6286 0.000 0.692 0.028 0.276 0.004
#> GSM254683     5  0.4242     0.2627 0.000 0.428 0.000 0.000 0.572
#> GSM254710     5  0.1357     0.7481 0.004 0.048 0.000 0.000 0.948
#> GSM254725     3  0.4588     0.5148 0.000 0.208 0.732 0.056 0.004
#> GSM254651     2  0.1124     0.8697 0.000 0.960 0.000 0.004 0.036
#> GSM254638     4  0.2017     0.7095 0.000 0.080 0.008 0.912 0.000
#> GSM254685     4  0.4251     0.2620 0.000 0.372 0.004 0.624 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
#> GSM254629     5  0.6861     0.2215 0.000 0.000 0.196 0.312 0.424 0.068
#> GSM254648     3  0.7404     0.0531 0.000 0.032 0.424 0.268 0.216 0.060
#> GSM254694     6  0.3877     0.5801 0.012 0.000 0.004 0.236 0.012 0.736
#> GSM254701     6  0.4719     0.5472 0.008 0.000 0.004 0.256 0.060 0.672
#> GSM254728     6  0.4959     0.4844 0.008 0.000 0.000 0.184 0.136 0.672
#> GSM254726     6  0.5984     0.2942 0.000 0.004 0.000 0.276 0.240 0.480
#> GSM254639     6  0.4077     0.4939 0.008 0.000 0.180 0.060 0.000 0.752
#> GSM254652     5  0.6398     0.2713 0.004 0.000 0.048 0.228 0.540 0.180
#> GSM254700     1  0.0748     0.7181 0.976 0.000 0.004 0.004 0.000 0.016
#> GSM254625     5  0.1637     0.5295 0.004 0.004 0.000 0.056 0.932 0.004
#> GSM254636     1  0.6924     0.0700 0.472 0.000 0.168 0.064 0.012 0.284
#> GSM254659     6  0.8100     0.3788 0.104 0.000 0.184 0.216 0.084 0.412
#> GSM254680     1  0.3269     0.7041 0.848 0.000 0.020 0.004 0.044 0.084
#> GSM254686     5  0.6852     0.2853 0.100 0.000 0.000 0.208 0.492 0.200
#> GSM254718     6  0.4575     0.5797 0.016 0.000 0.044 0.208 0.012 0.720
#> GSM254674     1  0.4735     0.2708 0.568 0.000 0.000 0.044 0.384 0.004
#> GSM254668     5  0.5014     0.0283 0.428 0.000 0.000 0.052 0.512 0.008
#> GSM254697     1  0.1434     0.7129 0.948 0.000 0.012 0.012 0.000 0.028
#> GSM254704     3  0.5572     0.1896 0.388 0.000 0.504 0.016 0.000 0.092
#> GSM254707     5  0.2328     0.5427 0.052 0.000 0.000 0.056 0.892 0.000
#> GSM254714     3  0.6521     0.2634 0.000 0.000 0.404 0.360 0.204 0.032
#> GSM254722     1  0.2568     0.6825 0.876 0.000 0.012 0.016 0.000 0.096
#> GSM254627     1  0.3557     0.6451 0.824 0.000 0.100 0.044 0.000 0.032
#> GSM254630     1  0.3702     0.5386 0.720 0.000 0.004 0.012 0.264 0.000
#> GSM254633     3  0.6485     0.1737 0.232 0.000 0.520 0.060 0.000 0.188
#> GSM254670     6  0.4792     0.4893 0.064 0.000 0.148 0.060 0.000 0.728
#> GSM254716     5  0.2512     0.5180 0.008 0.000 0.000 0.116 0.868 0.008
#> GSM254720     1  0.5654    -0.1086 0.492 0.000 0.024 0.084 0.000 0.400
#> GSM254729     3  0.6359     0.4033 0.028 0.000 0.484 0.252 0.000 0.236
#> GSM254654     3  0.5167     0.3631 0.000 0.000 0.564 0.360 0.016 0.060
#> GSM254656     3  0.4405     0.5379 0.000 0.000 0.688 0.240 0.000 0.072
#> GSM254631     3  0.4830     0.3619 0.196 0.000 0.704 0.044 0.000 0.056
#> GSM254657     3  0.2266     0.5345 0.000 0.000 0.880 0.108 0.000 0.012
#> GSM254664     1  0.5277     0.5015 0.676 0.000 0.124 0.012 0.016 0.172
#> GSM254672     3  0.4971     0.3587 0.260 0.000 0.656 0.032 0.000 0.052
#> GSM254692     1  0.3398     0.5415 0.740 0.000 0.000 0.008 0.252 0.000
#> GSM254645     3  0.5675     0.5007 0.136 0.000 0.644 0.160 0.000 0.060
#> GSM254666     5  0.5124     0.1240 0.008 0.000 0.444 0.060 0.488 0.000
#> GSM254675     1  0.3279     0.7045 0.860 0.000 0.016 0.048 0.048 0.028
#> GSM254678     3  0.6278     0.0365 0.396 0.000 0.408 0.024 0.000 0.172
#> GSM254688     5  0.3890     0.1474 0.400 0.000 0.000 0.004 0.596 0.000
#> GSM254690     1  0.4082     0.6821 0.780 0.000 0.012 0.004 0.120 0.084
#> GSM254696     6  0.4728     0.4902 0.180 0.000 0.052 0.040 0.004 0.724
#> GSM254705     1  0.3398     0.5436 0.740 0.000 0.000 0.008 0.252 0.000
#> GSM254642     1  0.1299     0.7161 0.952 0.000 0.004 0.004 0.036 0.004
#> GSM254661     5  0.6163     0.2436 0.000 0.000 0.312 0.184 0.484 0.020
#> GSM254698     6  0.5920     0.2916 0.356 0.000 0.068 0.060 0.000 0.516
#> GSM254641     1  0.6923     0.2709 0.468 0.000 0.176 0.060 0.284 0.012
#> GSM254647     1  0.0725     0.7192 0.976 0.000 0.000 0.000 0.012 0.012
#> GSM254663     1  0.3245     0.5735 0.764 0.000 0.000 0.008 0.228 0.000
#> GSM254682     5  0.4089    -0.0415 0.468 0.000 0.000 0.008 0.524 0.000
#> GSM254709     5  0.4844     0.3256 0.312 0.000 0.000 0.080 0.608 0.000
#> GSM254721     1  0.0972     0.7126 0.964 0.000 0.000 0.008 0.028 0.000
#> GSM254724     1  0.0405     0.7176 0.988 0.000 0.000 0.004 0.000 0.008
#> GSM254650     1  0.4039     0.3892 0.632 0.000 0.000 0.016 0.352 0.000
#> GSM254687     5  0.3780     0.4229 0.248 0.000 0.000 0.020 0.728 0.004
#> GSM254637     1  0.3962     0.6713 0.796 0.000 0.112 0.004 0.068 0.020
#> GSM254684     6  0.6451     0.3150 0.252 0.000 0.168 0.060 0.000 0.520
#> GSM254649     2  0.0622     0.7268 0.000 0.980 0.000 0.008 0.012 0.000
#> GSM254660     2  0.2454     0.5887 0.000 0.840 0.000 0.160 0.000 0.000
#> GSM254693     2  0.0000     0.7330 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM254695     4  0.6092     0.5076 0.000 0.348 0.000 0.372 0.000 0.280
#> GSM254702     2  0.3690     0.2292 0.000 0.684 0.000 0.308 0.000 0.008
#> GSM254643     2  0.0520     0.7292 0.000 0.984 0.008 0.008 0.000 0.000
#> GSM254727     2  0.2558     0.5968 0.000 0.840 0.000 0.156 0.000 0.004
#> GSM254640     2  0.5868    -0.5763 0.000 0.448 0.204 0.348 0.000 0.000
#> GSM254626     2  0.0000     0.7330 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM254635     4  0.5692     0.6286 0.000 0.260 0.216 0.524 0.000 0.000
#> GSM254653     2  0.1444     0.6908 0.000 0.928 0.000 0.072 0.000 0.000
#> GSM254658     2  0.0000     0.7330 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM254681     5  0.5189    -0.0601 0.000 0.444 0.000 0.088 0.468 0.000
#> GSM254719     2  0.1267     0.7006 0.000 0.940 0.000 0.060 0.000 0.000
#> GSM254673     2  0.0000     0.7330 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM254655     2  0.2219     0.6250 0.000 0.864 0.000 0.136 0.000 0.000
#> GSM254669     2  0.0000     0.7330 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM254699     2  0.3509     0.4148 0.000 0.744 0.000 0.240 0.000 0.016
#> GSM254703     2  0.4764    -0.3382 0.000 0.560 0.056 0.384 0.000 0.000
#> GSM254708     2  0.0000     0.7330 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM254715     4  0.5541     0.6341 0.000 0.392 0.136 0.472 0.000 0.000
#> GSM254628     2  0.1092     0.7166 0.000 0.960 0.000 0.020 0.020 0.000
#> GSM254634     3  0.4800     0.4807 0.000 0.028 0.636 0.304 0.000 0.032
#> GSM254646     2  0.3952     0.4764 0.000 0.736 0.000 0.052 0.212 0.000
#> GSM254671     4  0.5608     0.5840 0.000 0.380 0.000 0.472 0.000 0.148
#> GSM254711     4  0.4535     0.5080 0.000 0.472 0.004 0.500 0.000 0.024
#> GSM254717     2  0.0146     0.7329 0.000 0.996 0.000 0.004 0.000 0.000
#> GSM254723     6  0.4119     0.3670 0.000 0.004 0.000 0.336 0.016 0.644
#> GSM254730     2  0.3126     0.4171 0.000 0.752 0.000 0.248 0.000 0.000
#> GSM254731     2  0.4079     0.2317 0.000 0.680 0.000 0.288 0.000 0.032
#> GSM254632     5  0.3396     0.5176 0.040 0.056 0.012 0.040 0.852 0.000
#> GSM254662     2  0.0260     0.7314 0.000 0.992 0.000 0.008 0.000 0.000
#> GSM254677     3  0.4241     0.4489 0.000 0.000 0.608 0.368 0.000 0.024
#> GSM254665     2  0.1606     0.7023 0.000 0.932 0.008 0.056 0.004 0.000
#> GSM254691     2  0.0405     0.7307 0.000 0.988 0.008 0.004 0.000 0.000
#> GSM254644     2  0.4903    -0.5661 0.000 0.476 0.060 0.464 0.000 0.000
#> GSM254667     2  0.4161     0.3715 0.000 0.716 0.240 0.036 0.004 0.004
#> GSM254676     2  0.0260     0.7317 0.000 0.992 0.000 0.008 0.000 0.000
#> GSM254679     4  0.5933     0.6822 0.000 0.316 0.184 0.492 0.000 0.008
#> GSM254689     2  0.4886     0.1402 0.000 0.508 0.000 0.060 0.432 0.000
#> GSM254706     2  0.2122     0.6683 0.000 0.900 0.000 0.024 0.076 0.000
#> GSM254712     3  0.3974     0.4376 0.000 0.024 0.680 0.296 0.000 0.000
#> GSM254713     4  0.5818     0.6653 0.000 0.340 0.196 0.464 0.000 0.000
#> GSM254683     2  0.4575     0.3021 0.000 0.600 0.000 0.048 0.352 0.000
#> GSM254710     5  0.4284     0.3268 0.000 0.256 0.000 0.056 0.688 0.000
#> GSM254725     4  0.6038     0.3687 0.000 0.116 0.040 0.524 0.000 0.320
#> GSM254651     2  0.1257     0.7111 0.000 0.952 0.000 0.020 0.028 0.000
#> GSM254638     3  0.4408     0.3835 0.000 0.044 0.636 0.320 0.000 0.000
#> GSM254685     3  0.5539     0.0374 0.000 0.180 0.548 0.272 0.000 0.000

Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.

consensus_heatmap(res, k = 2)

plot of chunk tab-ATC-NMF-consensus-heatmap-1

consensus_heatmap(res, k = 3)

plot of chunk tab-ATC-NMF-consensus-heatmap-2

consensus_heatmap(res, k = 4)

plot of chunk tab-ATC-NMF-consensus-heatmap-3

consensus_heatmap(res, k = 5)

plot of chunk tab-ATC-NMF-consensus-heatmap-4

consensus_heatmap(res, k = 6)

plot of chunk tab-ATC-NMF-consensus-heatmap-5

Heatmaps for the membership of samples in all partitions to see how consistent they are:

membership_heatmap(res, k = 2)

plot of chunk tab-ATC-NMF-membership-heatmap-1

membership_heatmap(res, k = 3)

plot of chunk tab-ATC-NMF-membership-heatmap-2

membership_heatmap(res, k = 4)

plot of chunk tab-ATC-NMF-membership-heatmap-3

membership_heatmap(res, k = 5)

plot of chunk tab-ATC-NMF-membership-heatmap-4

membership_heatmap(res, k = 6)

plot of chunk tab-ATC-NMF-membership-heatmap-5

As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.

Signature heatmaps where rows are scaled:

get_signatures(res, k = 2)

plot of chunk tab-ATC-NMF-get-signatures-1

get_signatures(res, k = 3)

plot of chunk tab-ATC-NMF-get-signatures-2

get_signatures(res, k = 4)

plot of chunk tab-ATC-NMF-get-signatures-3

get_signatures(res, k = 5)

plot of chunk tab-ATC-NMF-get-signatures-4

get_signatures(res, k = 6)

plot of chunk tab-ATC-NMF-get-signatures-5

Signature heatmaps where rows are not scaled:

get_signatures(res, k = 2, scale_rows = FALSE)

plot of chunk tab-ATC-NMF-get-signatures-no-scale-1

get_signatures(res, k = 3, scale_rows = FALSE)

plot of chunk tab-ATC-NMF-get-signatures-no-scale-2

get_signatures(res, k = 4, scale_rows = FALSE)

plot of chunk tab-ATC-NMF-get-signatures-no-scale-3

get_signatures(res, k = 5, scale_rows = FALSE)

plot of chunk tab-ATC-NMF-get-signatures-no-scale-4

get_signatures(res, k = 6, scale_rows = FALSE)

plot of chunk tab-ATC-NMF-get-signatures-no-scale-5

Compare the overlap of signatures from different k:

compare_signatures(res)

plot of chunk ATC-NMF-signature_compare

get_signature() returns a data frame invisibly. TO get the list of signatures, the function call should be assigned to a variable explicitly. In following code, if plot argument is set to FALSE, no heatmap is plotted while only the differential analysis is performed.

# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)

An example of the output of tb is:

#>   which_row         fdr    mean_1    mean_2 scaled_mean_1 scaled_mean_2 km
#> 1        38 0.042760348  8.373488  9.131774    -0.5533452     0.5164555  1
#> 2        40 0.018707592  7.106213  8.469186    -0.6173731     0.5762149  1
#> 3        55 0.019134737 10.221463 11.207825    -0.6159697     0.5749050  1
#> 4        59 0.006059896  5.921854  7.869574    -0.6899429     0.6439467  1
#> 5        60 0.018055526  8.928898 10.211722    -0.6204761     0.5791110  1
#> 6        98 0.009384629 15.714769 14.887706     0.6635654    -0.6193277  2
...

The columns in tb are:

  1. which_row: row indices corresponding to the input matrix.
  2. fdr: FDR for the differential test.
  3. mean_x: The mean value in group x.
  4. scaled_mean_x: The mean value in group x after rows are scaled.
  5. km: Row groups if k-means clustering is applied to rows.

UMAP plot which shows how samples are separated.

dimension_reduction(res, k = 2, method = "UMAP")

plot of chunk tab-ATC-NMF-dimension-reduction-1

dimension_reduction(res, k = 3, method = "UMAP")

plot of chunk tab-ATC-NMF-dimension-reduction-2

dimension_reduction(res, k = 4, method = "UMAP")

plot of chunk tab-ATC-NMF-dimension-reduction-3

dimension_reduction(res, k = 5, method = "UMAP")

plot of chunk tab-ATC-NMF-dimension-reduction-4

dimension_reduction(res, k = 6, method = "UMAP")

plot of chunk tab-ATC-NMF-dimension-reduction-5

Following heatmap shows how subgroups are split when increasing k:

collect_classes(res)

plot of chunk ATC-NMF-collect-classes

Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.

test_to_known_factors(res)
#>           n tissue(p) individual(p) disease.state(p) gender(p) other(p) k
#> ATC:NMF 106  1.55e-21        0.4126            0.571     0.751    0.997 2
#> ATC:NMF 103  1.53e-17        0.2779            0.413     0.520    0.119 3
#> ATC:NMF  77  1.91e-12        0.0416            0.760     0.862    0.488 4
#> ATC:NMF  96  1.01e-13        0.0218            0.569     0.622    0.439 5
#> ATC:NMF  55  5.42e-10        0.0329            0.609     0.132    0.564 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