Date: 2019-12-25 21:56:30 CET, cola version: 1.3.2
Document is loading...
All available functions which can be applied to this res_list
object:
res_list
#> A 'ConsensusPartitionList' object with 24 methods.
#> On a matrix with 46609 rows and 96 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] 46609 96
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)
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 | 6 | 1.000 | 0.987 | 0.983 | ** | 3,4,5 |
SD:pam | 6 | 1.000 | 0.989 | 0.992 | ** | 2,3,4,5 |
SD:mclust | 4 | 1.000 | 1.000 | 1.000 | ** | |
SD:NMF | 4 | 1.000 | 1.000 | 1.000 | ** | |
CV:pam | 5 | 1.000 | 1.000 | 1.000 | ** | 3,4 |
CV:NMF | 4 | 1.000 | 1.000 | 1.000 | ** | |
MAD:mclust | 5 | 1.000 | 0.982 | 0.983 | ** | 4 |
MAD:NMF | 4 | 1.000 | 1.000 | 1.000 | ** | |
ATC:mclust | 4 | 1.000 | 1.000 | 1.000 | ** | 3 |
ATC:NMF | 4 | 1.000 | 0.999 | 0.987 | ** | 2,3 |
CV:mclust | 5 | 0.990 | 0.975 | 0.970 | ** | 3,4 |
ATC:hclust | 6 | 0.987 | 0.989 | 0.989 | ** | 2,3,4,5 |
SD:skmeans | 5 | 0.970 | 0.973 | 0.952 | ** | 4 |
ATC:pam | 6 | 0.970 | 0.983 | 0.969 | ** | 2,3,4,5 |
CV:hclust | 6 | 0.947 | 0.944 | 0.912 | * | 2,4,5 |
MAD:pam | 6 | 0.947 | 0.963 | 0.968 | * | 3,4,5 |
MAD:skmeans | 5 | 0.917 | 0.968 | 0.940 | * | 4 |
CV:skmeans | 5 | 0.916 | 0.963 | 0.937 | * | 2,4 |
ATC:skmeans | 6 | 0.913 | 0.957 | 0.958 | * | 2,3,4,5 |
MAD:hclust | 6 | 0.903 | 0.974 | 0.934 | * | 3,4,5 |
MAD:kmeans | 4 | 0.687 | 0.957 | 0.848 | ||
SD:kmeans | 3 | 0.621 | 0.822 | 0.822 | ||
ATC:kmeans | 3 | 0.589 | 0.885 | 0.853 | ||
CV:kmeans | 3 | 0.495 | 0.645 | 0.673 |
**: 1-PAC > 0.95, *: 1-PAC > 0.9
Cumulative distribution function curves of consensus matrix for all methods.
collect_plots(res_list, fun = plot_ecdf)
Consensus heatmaps for all methods. (What is a consensus heatmap?)
collect_plots(res_list, k = 2, fun = consensus_heatmap, mc.cores = 4)
collect_plots(res_list, k = 3, fun = consensus_heatmap, mc.cores = 4)
collect_plots(res_list, k = 4, fun = consensus_heatmap, mc.cores = 4)
collect_plots(res_list, k = 5, fun = consensus_heatmap, mc.cores = 4)
collect_plots(res_list, k = 6, fun = consensus_heatmap, mc.cores = 4)
Membership heatmaps for all methods. (What is a membership heatmap?)
collect_plots(res_list, k = 2, fun = membership_heatmap, mc.cores = 4)
collect_plots(res_list, k = 3, fun = membership_heatmap, mc.cores = 4)
collect_plots(res_list, k = 4, fun = membership_heatmap, mc.cores = 4)
collect_plots(res_list, k = 5, fun = membership_heatmap, mc.cores = 4)
collect_plots(res_list, k = 6, fun = membership_heatmap, mc.cores = 4)
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)
collect_plots(res_list, k = 3, fun = get_signatures, mc.cores = 4)
collect_plots(res_list, k = 4, fun = get_signatures, mc.cores = 4)
collect_plots(res_list, k = 5, fun = get_signatures, mc.cores = 4)
collect_plots(res_list, k = 6, fun = get_signatures, mc.cores = 4)
The statistics used for measuring the stability of consensus partitioning. (How are they defined?)
get_stats(res_list, k = 2)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> SD:NMF 2 0.634 0.781 0.870 0.466 0.495 0.495
#> CV:NMF 2 0.709 0.918 0.938 0.489 0.495 0.495
#> MAD:NMF 2 0.340 0.593 0.804 0.433 0.526 0.526
#> ATC:NMF 2 1.000 1.000 1.000 0.380 0.621 0.621
#> SD:skmeans 2 0.495 0.906 0.922 0.506 0.495 0.495
#> CV:skmeans 2 1.000 0.987 0.988 0.506 0.495 0.495
#> MAD:skmeans 2 0.495 0.605 0.746 0.506 0.495 0.495
#> ATC:skmeans 2 1.000 1.000 1.000 0.380 0.621 0.621
#> SD:mclust 2 0.621 0.936 0.941 0.484 0.495 0.495
#> CV:mclust 2 0.368 0.670 0.743 0.489 0.495 0.495
#> MAD:mclust 2 0.368 0.873 0.890 0.488 0.495 0.495
#> ATC:mclust 2 0.495 0.718 0.813 0.505 0.495 0.495
#> SD:kmeans 2 0.242 0.599 0.717 0.422 0.495 0.495
#> CV:kmeans 2 0.242 0.459 0.567 0.423 0.495 0.495
#> MAD:kmeans 2 0.242 0.607 0.676 0.441 0.495 0.495
#> ATC:kmeans 2 0.747 0.962 0.956 0.387 0.621 0.621
#> SD:pam 2 0.981 0.967 0.984 0.421 0.591 0.591
#> CV:pam 2 0.824 0.901 0.950 0.454 0.558 0.558
#> MAD:pam 2 0.853 0.915 0.963 0.457 0.558 0.558
#> ATC:pam 2 1.000 1.000 1.000 0.380 0.621 0.621
#> SD:hclust 2 0.495 0.875 0.803 0.381 0.621 0.621
#> CV:hclust 2 1.000 1.000 1.000 0.380 0.621 0.621
#> MAD:hclust 2 0.368 0.782 0.843 0.445 0.495 0.495
#> ATC:hclust 2 1.000 1.000 1.000 0.380 0.621 0.621
get_stats(res_list, k = 3)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> SD:NMF 3 0.758 0.843 0.880 0.358 0.621 0.390
#> CV:NMF 3 0.495 0.702 0.720 0.294 0.621 0.390
#> MAD:NMF 3 0.747 0.924 0.940 0.462 0.779 0.604
#> ATC:NMF 3 1.000 1.000 1.000 0.665 0.747 0.593
#> SD:skmeans 3 0.747 0.874 0.877 0.250 0.621 0.390
#> CV:skmeans 3 0.747 0.959 0.931 0.250 0.874 0.745
#> MAD:skmeans 3 0.747 0.821 0.880 0.250 0.621 0.390
#> ATC:skmeans 3 1.000 1.000 1.000 0.665 0.747 0.593
#> SD:mclust 3 0.621 0.682 0.635 0.305 0.621 0.390
#> CV:mclust 3 1.000 1.000 1.000 0.291 0.621 0.390
#> MAD:mclust 3 0.747 0.932 0.945 0.295 0.621 0.390
#> ATC:mclust 3 1.000 1.000 1.000 0.250 0.874 0.745
#> SD:kmeans 3 0.621 0.822 0.822 0.456 0.621 0.390
#> CV:kmeans 3 0.495 0.645 0.673 0.454 0.621 0.390
#> MAD:kmeans 3 0.621 0.803 0.807 0.399 0.621 0.390
#> ATC:kmeans 3 0.589 0.885 0.853 0.532 0.747 0.593
#> SD:pam 3 1.000 0.973 0.982 0.511 0.749 0.586
#> CV:pam 3 0.985 0.971 0.986 0.424 0.761 0.586
#> MAD:pam 3 0.984 0.942 0.978 0.426 0.765 0.589
#> ATC:pam 3 1.000 1.000 1.000 0.665 0.747 0.593
#> SD:hclust 3 1.000 0.997 0.997 0.659 0.747 0.593
#> CV:hclust 3 0.747 0.940 0.934 0.665 0.747 0.593
#> MAD:hclust 3 1.000 0.980 0.982 0.421 0.874 0.745
#> ATC:hclust 3 1.000 1.000 1.000 0.665 0.747 0.593
get_stats(res_list, k = 4)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> SD:NMF 4 1.000 1.000 1.000 0.198 0.874 0.657
#> CV:NMF 4 1.000 1.000 1.000 0.198 0.874 0.657
#> MAD:NMF 4 1.000 1.000 1.000 0.198 0.874 0.657
#> ATC:NMF 4 1.000 0.999 0.987 0.190 0.874 0.657
#> SD:skmeans 4 1.000 1.000 1.000 0.199 0.874 0.657
#> CV:skmeans 4 1.000 1.000 1.000 0.199 0.874 0.657
#> MAD:skmeans 4 1.000 1.000 1.000 0.199 0.874 0.657
#> ATC:skmeans 4 1.000 1.000 1.000 0.200 0.874 0.657
#> SD:mclust 4 1.000 1.000 1.000 0.199 0.874 0.657
#> CV:mclust 4 1.000 1.000 1.000 0.200 0.874 0.657
#> MAD:mclust 4 1.000 1.000 1.000 0.200 0.874 0.657
#> ATC:mclust 4 1.000 1.000 1.000 0.200 0.874 0.657
#> SD:kmeans 4 0.560 0.948 0.819 0.146 0.874 0.657
#> CV:kmeans 4 0.695 0.965 0.871 0.173 0.874 0.657
#> MAD:kmeans 4 0.687 0.957 0.848 0.157 0.874 0.657
#> ATC:kmeans 4 0.670 0.956 0.780 0.188 0.874 0.657
#> SD:pam 4 1.000 1.000 1.000 0.193 0.874 0.657
#> CV:pam 4 1.000 1.000 1.000 0.173 0.860 0.620
#> MAD:pam 4 1.000 1.000 1.000 0.164 0.856 0.610
#> ATC:pam 4 1.000 1.000 1.000 0.200 0.874 0.657
#> SD:hclust 4 1.000 1.000 1.000 0.199 0.874 0.657
#> CV:hclust 4 1.000 1.000 1.000 0.199 0.874 0.657
#> MAD:hclust 4 1.000 1.000 1.000 0.200 0.874 0.657
#> ATC:hclust 4 1.000 1.000 1.000 0.200 0.874 0.657
get_stats(res_list, k = 5)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> SD:NMF 5 1.000 0.997 0.997 0.00133 1.000 1.000
#> CV:NMF 5 1.000 0.992 0.991 0.00396 1.000 1.000
#> MAD:NMF 5 1.000 0.997 0.997 0.00131 1.000 1.000
#> ATC:NMF 5 1.000 0.992 0.988 0.00965 1.000 1.000
#> SD:skmeans 5 0.970 0.973 0.952 0.03819 0.970 0.878
#> CV:skmeans 5 0.916 0.963 0.937 0.03837 0.970 0.878
#> MAD:skmeans 5 0.917 0.968 0.941 0.03799 0.970 0.878
#> ATC:skmeans 5 0.968 0.979 0.955 0.03277 0.970 0.878
#> SD:mclust 5 0.957 0.950 0.950 0.02388 1.000 1.000
#> CV:mclust 5 0.990 0.975 0.970 0.02078 0.982 0.928
#> MAD:mclust 5 1.000 0.982 0.983 0.02108 0.982 0.928
#> ATC:mclust 5 0.964 0.952 0.960 0.02054 1.000 1.000
#> SD:kmeans 5 0.760 0.887 0.826 0.07752 1.000 1.000
#> CV:kmeans 5 0.893 0.896 0.863 0.06864 1.000 1.000
#> MAD:kmeans 5 0.886 0.897 0.854 0.07347 1.000 1.000
#> ATC:kmeans 5 0.715 0.885 0.813 0.07505 1.000 1.000
#> SD:pam 5 1.000 1.000 1.000 0.03901 0.970 0.878
#> CV:pam 5 1.000 1.000 1.000 0.03901 0.970 0.878
#> MAD:pam 5 1.000 1.000 1.000 0.03901 0.970 0.878
#> ATC:pam 5 1.000 1.000 1.000 0.03901 0.970 0.878
#> SD:hclust 5 0.987 0.986 0.981 0.03873 0.970 0.878
#> CV:hclust 5 0.941 0.958 0.931 0.03901 0.970 0.878
#> MAD:hclust 5 0.941 0.982 0.954 0.03831 0.970 0.878
#> ATC:hclust 5 0.947 0.964 0.938 0.03594 0.970 0.878
get_stats(res_list, k = 6)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> SD:NMF 6 0.957 0.967 0.963 0.01356 1.000 1.000
#> CV:NMF 6 0.954 0.960 0.957 0.01381 1.000 1.000
#> MAD:NMF 6 0.980 0.981 0.979 0.00773 1.000 1.000
#> ATC:NMF 6 0.979 0.970 0.964 0.01310 1.000 1.000
#> SD:skmeans 6 0.917 0.883 0.903 0.03523 1.000 1.000
#> CV:skmeans 6 0.888 0.869 0.878 0.03434 1.000 1.000
#> MAD:skmeans 6 0.880 0.884 0.896 0.03505 1.000 1.000
#> ATC:skmeans 6 0.913 0.957 0.958 0.02675 0.986 0.935
#> SD:mclust 6 0.921 0.939 0.939 0.00584 1.000 1.000
#> CV:mclust 6 0.965 0.892 0.946 0.01280 0.995 0.978
#> MAD:mclust 6 0.968 0.948 0.958 0.01102 1.000 1.000
#> ATC:mclust 6 0.939 0.929 0.912 0.00899 1.000 1.000
#> SD:kmeans 6 0.874 0.803 0.755 0.05442 0.968 0.870
#> CV:kmeans 6 0.847 0.835 0.823 0.03654 1.000 1.000
#> MAD:kmeans 6 0.855 0.860 0.810 0.04402 0.970 0.878
#> ATC:kmeans 6 0.693 0.600 0.780 0.04673 0.995 0.979
#> SD:pam 6 1.000 0.989 0.992 0.03116 0.976 0.889
#> CV:pam 6 0.917 0.898 0.922 0.03378 1.000 1.000
#> MAD:pam 6 0.947 0.963 0.968 0.03331 0.976 0.889
#> ATC:pam 6 0.970 0.983 0.969 0.03773 0.970 0.861
#> SD:hclust 6 1.000 0.987 0.983 0.03760 0.970 0.861
#> CV:hclust 6 0.947 0.944 0.912 0.03730 0.970 0.861
#> MAD:hclust 6 0.903 0.974 0.934 0.03757 0.970 0.861
#> ATC:hclust 6 0.987 0.989 0.989 0.03067 0.976 0.889
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)
collect_stats(res_list, k = 3)
collect_stats(res_list, k = 4)
collect_stats(res_list, k = 5)
collect_stats(res_list, k = 6)
Collect partitions from all methods:
collect_classes(res_list, k = 2)
collect_classes(res_list, k = 3)
collect_classes(res_list, k = 4)
collect_classes(res_list, k = 5)
collect_classes(res_list, k = 6)
Overlap of top rows from different top-row methods:
top_rows_overlap(res_list, top_n = 1000, method = "euler")
top_rows_overlap(res_list, top_n = 2000, method = "euler")
top_rows_overlap(res_list, top_n = 3000, method = "euler")
top_rows_overlap(res_list, top_n = 4000, method = "euler")
top_rows_overlap(res_list, top_n = 5000, method = "euler")
Also visualize the correspondance of rankings between different top-row methods:
top_rows_overlap(res_list, top_n = 1000, method = "correspondance")
top_rows_overlap(res_list, top_n = 2000, method = "correspondance")
top_rows_overlap(res_list, top_n = 3000, method = "correspondance")
top_rows_overlap(res_list, top_n = 4000, method = "correspondance")
top_rows_overlap(res_list, top_n = 5000, method = "correspondance")
Heatmaps of the top rows:
top_rows_heatmap(res_list, top_n = 1000)
top_rows_heatmap(res_list, top_n = 2000)
top_rows_heatmap(res_list, top_n = 3000)
top_rows_heatmap(res_list, top_n = 4000)
top_rows_heatmap(res_list, top_n = 5000)
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 cell.line(p) agent(p) k
#> SD:NMF 94 3.03e-20 0.79687 2
#> CV:NMF 96 1.13e-20 0.84273 2
#> MAD:NMF 70 6.31e-16 0.39287 2
#> ATC:NMF 96 1.13e-20 0.17295 2
#> SD:skmeans 96 1.13e-20 0.84273 2
#> CV:skmeans 96 1.13e-20 0.84273 2
#> MAD:skmeans 96 1.13e-20 0.84273 2
#> ATC:skmeans 96 1.13e-20 0.17295 2
#> SD:mclust 96 1.13e-20 0.84273 2
#> CV:mclust 96 1.13e-20 0.84273 2
#> MAD:mclust 96 1.13e-20 0.84273 2
#> ATC:mclust 96 1.13e-20 0.84273 2
#> SD:kmeans 72 2.32e-16 0.40836 2
#> CV:kmeans 48 NA NA 2
#> MAD:kmeans 72 2.32e-16 0.40836 2
#> ATC:kmeans 96 1.13e-20 0.17295 2
#> SD:pam 95 1.09e-17 0.05770 2
#> CV:pam 93 2.26e-14 0.00932 2
#> MAD:pam 92 9.27e-15 0.00522 2
#> ATC:pam 96 1.13e-20 0.17295 2
#> SD:hclust 96 1.13e-20 0.17295 2
#> CV:hclust 96 1.13e-20 0.17295 2
#> MAD:hclust 96 1.13e-20 0.84273 2
#> ATC:hclust 96 1.13e-20 0.17295 2
test_to_known_factors(res_list, k = 3)
#> n cell.line(p) agent(p) k
#> SD:NMF 96 9.56e-39 0.741 3
#> CV:NMF 71 1.05e-29 0.919 3
#> MAD:NMF 96 9.56e-39 0.741 3
#> ATC:NMF 96 9.56e-39 0.741 3
#> SD:skmeans 96 9.56e-39 0.741 3
#> CV:skmeans 96 9.56e-39 0.741 3
#> MAD:skmeans 96 9.56e-39 0.741 3
#> ATC:skmeans 96 9.56e-39 0.741 3
#> SD:mclust 72 3.93e-30 0.927 3
#> CV:mclust 96 9.56e-39 0.741 3
#> MAD:mclust 96 9.56e-39 0.741 3
#> ATC:mclust 96 9.56e-39 0.741 3
#> SD:kmeans 96 9.56e-39 0.741 3
#> CV:kmeans 48 3.15e-11 0.780 3
#> MAD:kmeans 96 9.56e-39 0.741 3
#> ATC:kmeans 96 9.56e-39 0.741 3
#> SD:pam 95 2.54e-38 0.740 3
#> CV:pam 96 1.42e-35 0.505 3
#> MAD:pam 93 2.22e-34 0.520 3
#> ATC:pam 96 9.56e-39 0.741 3
#> SD:hclust 96 9.56e-39 0.741 3
#> CV:hclust 96 9.56e-39 0.741 3
#> MAD:hclust 96 9.56e-39 0.741 3
#> ATC:hclust 96 9.56e-39 0.741 3
test_to_known_factors(res_list, k = 4)
#> n cell.line(p) agent(p) k
#> SD:NMF 96 9.14e-57 0.975 4
#> CV:NMF 96 9.14e-57 0.975 4
#> MAD:NMF 96 9.14e-57 0.975 4
#> ATC:NMF 96 9.14e-57 0.975 4
#> SD:skmeans 96 9.14e-57 0.975 4
#> CV:skmeans 96 9.14e-57 0.975 4
#> MAD:skmeans 96 9.14e-57 0.975 4
#> ATC:skmeans 96 9.14e-57 0.975 4
#> SD:mclust 96 9.14e-57 0.975 4
#> CV:mclust 96 9.14e-57 0.975 4
#> MAD:mclust 96 9.14e-57 0.975 4
#> ATC:mclust 96 9.14e-57 0.975 4
#> SD:kmeans 96 9.14e-57 0.975 4
#> CV:kmeans 96 9.14e-57 0.975 4
#> MAD:kmeans 96 9.14e-57 0.975 4
#> ATC:kmeans 96 9.14e-57 0.975 4
#> SD:pam 96 9.14e-57 0.975 4
#> CV:pam 96 9.14e-57 0.975 4
#> MAD:pam 96 9.14e-57 0.975 4
#> ATC:pam 96 9.14e-57 0.975 4
#> SD:hclust 96 9.14e-57 0.975 4
#> CV:hclust 96 9.14e-57 0.975 4
#> MAD:hclust 96 9.14e-57 0.975 4
#> ATC:hclust 96 9.14e-57 0.975 4
test_to_known_factors(res_list, k = 5)
#> n cell.line(p) agent(p) k
#> SD:NMF 96 9.14e-57 0.9750 5
#> CV:NMF 96 9.14e-57 0.9750 5
#> MAD:NMF 96 9.14e-57 0.9750 5
#> ATC:NMF 96 9.14e-57 0.9750 5
#> SD:skmeans 96 1.55e-54 0.1758 5
#> CV:skmeans 96 1.55e-54 0.1758 5
#> MAD:skmeans 96 1.55e-54 0.1758 5
#> ATC:skmeans 96 1.55e-54 0.1758 5
#> SD:mclust 96 9.14e-57 0.9750 5
#> CV:mclust 96 1.55e-54 0.3798 5
#> MAD:mclust 95 6.58e-54 0.1924 5
#> ATC:mclust 96 9.14e-57 0.9750 5
#> SD:kmeans 96 9.14e-57 0.9750 5
#> CV:kmeans 96 9.14e-57 0.9750 5
#> MAD:kmeans 96 9.14e-57 0.9750 5
#> ATC:kmeans 96 9.14e-57 0.9750 5
#> SD:pam 96 1.55e-54 0.1758 5
#> CV:pam 96 1.55e-54 0.1758 5
#> MAD:pam 96 1.55e-54 0.1758 5
#> ATC:pam 96 1.55e-54 0.1758 5
#> SD:hclust 96 1.55e-54 0.0823 5
#> CV:hclust 96 1.55e-54 0.1758 5
#> MAD:hclust 96 1.55e-54 0.1758 5
#> ATC:hclust 96 1.55e-54 0.1758 5
test_to_known_factors(res_list, k = 6)
#> n cell.line(p) agent(p) k
#> SD:NMF 96 9.14e-57 0.97496 6
#> CV:NMF 96 9.14e-57 0.97496 6
#> MAD:NMF 96 9.14e-57 0.97496 6
#> ATC:NMF 96 9.14e-57 0.97496 6
#> SD:skmeans 96 1.55e-54 0.17576 6
#> CV:skmeans 96 1.55e-54 0.17576 6
#> MAD:skmeans 96 1.55e-54 0.17576 6
#> ATC:skmeans 96 1.73e-52 0.00691 6
#> SD:mclust 96 9.14e-57 0.97496 6
#> CV:mclust 93 1.19e-52 0.12797 6
#> MAD:mclust 95 6.58e-54 0.19244 6
#> ATC:mclust 96 9.14e-57 0.97496 6
#> SD:kmeans 93 1.19e-52 0.23805 6
#> CV:kmeans 96 9.14e-57 0.97496 6
#> MAD:kmeans 96 1.55e-54 0.17576 6
#> ATC:kmeans 72 3.93e-30 1.00000 6
#> SD:pam 96 1.73e-52 0.00665 6
#> CV:pam 96 1.55e-54 0.17576 6
#> MAD:pam 95 7.26e-52 0.00673 6
#> ATC:pam 96 1.73e-52 0.00630 6
#> SD:hclust 96 1.73e-52 0.00229 6
#> CV:hclust 96 1.73e-52 0.00229 6
#> MAD:hclust 96 1.73e-52 0.00630 6
#> ATC:hclust 96 1.73e-52 0.00870 6
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 46609 rows and 96 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 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)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.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:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).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)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 0.495 0.875 0.803 0.3810 0.621 0.621
#> 3 3 1.000 0.997 0.997 0.6592 0.747 0.593
#> 4 4 1.000 1.000 1.000 0.1994 0.874 0.657
#> 5 5 0.987 0.986 0.981 0.0387 0.970 0.878
#> 6 6 1.000 0.987 0.983 0.0376 0.970 0.861
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 6
#> attr(,"optional")
#> [1] 3 4 5
There is also optional best \(k\) = 3 4 5 that is worth to check.
Following shows the table of the partitions (You need to click the show/hide
code output link to see it). The membership matrix (columns with name p*
)
is inferred by
clue::cl_consensus()
function with the SE
method. Basically the value in the membership matrix
represents the probability to belong to a certain group. The finall class
label for an item is determined with the group with highest probability it
belongs to.
In get_classes()
function, the entropy is calculated from the membership
matrix and the silhouette score is calculated from the consensus matrix.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> GSM573726 1 0.839 0.870 0.732 0.268
#> GSM573727 1 0.839 0.870 0.732 0.268
#> GSM573728 1 0.839 0.870 0.732 0.268
#> GSM573729 1 0.839 0.870 0.732 0.268
#> GSM573730 1 0.839 0.870 0.732 0.268
#> GSM573731 1 0.839 0.870 0.732 0.268
#> GSM573735 1 0.839 0.870 0.732 0.268
#> GSM573736 1 0.839 0.870 0.732 0.268
#> GSM573737 1 0.839 0.870 0.732 0.268
#> GSM573732 1 0.839 0.870 0.732 0.268
#> GSM573733 1 0.839 0.870 0.732 0.268
#> GSM573734 1 0.839 0.870 0.732 0.268
#> GSM573789 1 0.839 0.870 0.732 0.268
#> GSM573790 1 0.839 0.870 0.732 0.268
#> GSM573791 1 0.839 0.870 0.732 0.268
#> GSM573723 1 0.839 0.870 0.732 0.268
#> GSM573724 1 0.839 0.870 0.732 0.268
#> GSM573725 1 0.839 0.870 0.732 0.268
#> GSM573720 1 0.839 0.870 0.732 0.268
#> GSM573721 1 0.839 0.870 0.732 0.268
#> GSM573722 1 0.839 0.870 0.732 0.268
#> GSM573786 1 0.839 0.870 0.732 0.268
#> GSM573787 1 0.839 0.870 0.732 0.268
#> GSM573788 1 0.839 0.870 0.732 0.268
#> GSM573768 2 0.000 1.000 0.000 1.000
#> GSM573769 2 0.000 1.000 0.000 1.000
#> GSM573770 2 0.000 1.000 0.000 1.000
#> GSM573765 2 0.000 1.000 0.000 1.000
#> GSM573766 2 0.000 1.000 0.000 1.000
#> GSM573767 2 0.000 1.000 0.000 1.000
#> GSM573777 2 0.000 1.000 0.000 1.000
#> GSM573778 2 0.000 1.000 0.000 1.000
#> GSM573779 2 0.000 1.000 0.000 1.000
#> GSM573762 2 0.000 1.000 0.000 1.000
#> GSM573763 2 0.000 1.000 0.000 1.000
#> GSM573764 2 0.000 1.000 0.000 1.000
#> GSM573771 2 0.000 1.000 0.000 1.000
#> GSM573772 2 0.000 1.000 0.000 1.000
#> GSM573773 2 0.000 1.000 0.000 1.000
#> GSM573759 2 0.000 1.000 0.000 1.000
#> GSM573760 2 0.000 1.000 0.000 1.000
#> GSM573761 2 0.000 1.000 0.000 1.000
#> GSM573774 2 0.000 1.000 0.000 1.000
#> GSM573775 2 0.000 1.000 0.000 1.000
#> GSM573776 2 0.000 1.000 0.000 1.000
#> GSM573756 2 0.000 1.000 0.000 1.000
#> GSM573757 2 0.000 1.000 0.000 1.000
#> GSM573758 2 0.000 1.000 0.000 1.000
#> GSM573708 1 0.000 0.764 1.000 0.000
#> GSM573709 1 0.000 0.764 1.000 0.000
#> GSM573710 1 0.000 0.764 1.000 0.000
#> GSM573711 1 0.000 0.764 1.000 0.000
#> GSM573712 1 0.000 0.764 1.000 0.000
#> GSM573713 1 0.000 0.764 1.000 0.000
#> GSM573717 1 0.000 0.764 1.000 0.000
#> GSM573718 1 0.000 0.764 1.000 0.000
#> GSM573719 1 0.000 0.764 1.000 0.000
#> GSM573714 1 0.000 0.764 1.000 0.000
#> GSM573715 1 0.000 0.764 1.000 0.000
#> GSM573716 1 0.000 0.764 1.000 0.000
#> GSM573780 1 0.000 0.764 1.000 0.000
#> GSM573781 1 0.000 0.764 1.000 0.000
#> GSM573782 1 0.000 0.764 1.000 0.000
#> GSM573705 1 0.000 0.764 1.000 0.000
#> GSM573706 1 0.000 0.764 1.000 0.000
#> GSM573707 1 0.000 0.764 1.000 0.000
#> GSM573702 1 0.000 0.764 1.000 0.000
#> GSM573703 1 0.000 0.764 1.000 0.000
#> GSM573704 1 0.000 0.764 1.000 0.000
#> GSM573783 1 0.000 0.764 1.000 0.000
#> GSM573784 1 0.000 0.764 1.000 0.000
#> GSM573785 1 0.000 0.764 1.000 0.000
#> GSM573744 1 0.855 0.866 0.720 0.280
#> GSM573745 1 0.855 0.866 0.720 0.280
#> GSM573746 1 0.855 0.866 0.720 0.280
#> GSM573747 1 0.855 0.866 0.720 0.280
#> GSM573748 1 0.855 0.866 0.720 0.280
#> GSM573749 1 0.855 0.866 0.720 0.280
#> GSM573753 1 0.855 0.866 0.720 0.280
#> GSM573754 1 0.855 0.866 0.720 0.280
#> GSM573755 1 0.855 0.866 0.720 0.280
#> GSM573750 1 0.855 0.866 0.720 0.280
#> GSM573751 1 0.855 0.866 0.720 0.280
#> GSM573752 1 0.855 0.866 0.720 0.280
#> GSM573795 1 0.855 0.866 0.720 0.280
#> GSM573796 1 0.855 0.866 0.720 0.280
#> GSM573797 1 0.855 0.866 0.720 0.280
#> GSM573741 1 0.855 0.866 0.720 0.280
#> GSM573742 1 0.855 0.866 0.720 0.280
#> GSM573743 1 0.855 0.866 0.720 0.280
#> GSM573738 1 0.855 0.866 0.720 0.280
#> GSM573739 1 0.855 0.866 0.720 0.280
#> GSM573740 1 0.855 0.866 0.720 0.280
#> GSM573792 1 0.855 0.866 0.720 0.280
#> GSM573793 1 0.855 0.866 0.720 0.280
#> GSM573794 1 0.855 0.866 0.720 0.280
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM573726 1 0.0424 0.994 0.992 0.000 0.008
#> GSM573727 1 0.0424 0.994 0.992 0.000 0.008
#> GSM573728 1 0.0424 0.994 0.992 0.000 0.008
#> GSM573729 1 0.0424 0.994 0.992 0.000 0.008
#> GSM573730 1 0.0424 0.994 0.992 0.000 0.008
#> GSM573731 1 0.0424 0.994 0.992 0.000 0.008
#> GSM573735 1 0.0424 0.994 0.992 0.000 0.008
#> GSM573736 1 0.0424 0.994 0.992 0.000 0.008
#> GSM573737 1 0.0424 0.994 0.992 0.000 0.008
#> GSM573732 1 0.0424 0.994 0.992 0.000 0.008
#> GSM573733 1 0.0424 0.994 0.992 0.000 0.008
#> GSM573734 1 0.0424 0.994 0.992 0.000 0.008
#> GSM573789 1 0.0424 0.994 0.992 0.000 0.008
#> GSM573790 1 0.0424 0.994 0.992 0.000 0.008
#> GSM573791 1 0.0424 0.994 0.992 0.000 0.008
#> GSM573723 1 0.0424 0.994 0.992 0.000 0.008
#> GSM573724 1 0.0424 0.994 0.992 0.000 0.008
#> GSM573725 1 0.0424 0.994 0.992 0.000 0.008
#> GSM573720 1 0.0424 0.994 0.992 0.000 0.008
#> GSM573721 1 0.0424 0.994 0.992 0.000 0.008
#> GSM573722 1 0.0424 0.994 0.992 0.000 0.008
#> GSM573786 1 0.0424 0.994 0.992 0.000 0.008
#> GSM573787 1 0.0424 0.994 0.992 0.000 0.008
#> GSM573788 1 0.0424 0.994 0.992 0.000 0.008
#> GSM573768 2 0.0000 1.000 0.000 1.000 0.000
#> GSM573769 2 0.0000 1.000 0.000 1.000 0.000
#> GSM573770 2 0.0000 1.000 0.000 1.000 0.000
#> GSM573765 2 0.0000 1.000 0.000 1.000 0.000
#> GSM573766 2 0.0000 1.000 0.000 1.000 0.000
#> GSM573767 2 0.0000 1.000 0.000 1.000 0.000
#> GSM573777 2 0.0000 1.000 0.000 1.000 0.000
#> GSM573778 2 0.0000 1.000 0.000 1.000 0.000
#> GSM573779 2 0.0000 1.000 0.000 1.000 0.000
#> GSM573762 2 0.0000 1.000 0.000 1.000 0.000
#> GSM573763 2 0.0000 1.000 0.000 1.000 0.000
#> GSM573764 2 0.0000 1.000 0.000 1.000 0.000
#> GSM573771 2 0.0000 1.000 0.000 1.000 0.000
#> GSM573772 2 0.0000 1.000 0.000 1.000 0.000
#> GSM573773 2 0.0000 1.000 0.000 1.000 0.000
#> GSM573759 2 0.0000 1.000 0.000 1.000 0.000
#> GSM573760 2 0.0000 1.000 0.000 1.000 0.000
#> GSM573761 2 0.0000 1.000 0.000 1.000 0.000
#> GSM573774 2 0.0000 1.000 0.000 1.000 0.000
#> GSM573775 2 0.0000 1.000 0.000 1.000 0.000
#> GSM573776 2 0.0000 1.000 0.000 1.000 0.000
#> GSM573756 2 0.0000 1.000 0.000 1.000 0.000
#> GSM573757 2 0.0000 1.000 0.000 1.000 0.000
#> GSM573758 2 0.0000 1.000 0.000 1.000 0.000
#> GSM573708 3 0.0000 1.000 0.000 0.000 1.000
#> GSM573709 3 0.0000 1.000 0.000 0.000 1.000
#> GSM573710 3 0.0000 1.000 0.000 0.000 1.000
#> GSM573711 3 0.0000 1.000 0.000 0.000 1.000
#> GSM573712 3 0.0000 1.000 0.000 0.000 1.000
#> GSM573713 3 0.0000 1.000 0.000 0.000 1.000
#> GSM573717 3 0.0000 1.000 0.000 0.000 1.000
#> GSM573718 3 0.0000 1.000 0.000 0.000 1.000
#> GSM573719 3 0.0000 1.000 0.000 0.000 1.000
#> GSM573714 3 0.0000 1.000 0.000 0.000 1.000
#> GSM573715 3 0.0000 1.000 0.000 0.000 1.000
#> GSM573716 3 0.0000 1.000 0.000 0.000 1.000
#> GSM573780 3 0.0000 1.000 0.000 0.000 1.000
#> GSM573781 3 0.0000 1.000 0.000 0.000 1.000
#> GSM573782 3 0.0000 1.000 0.000 0.000 1.000
#> GSM573705 3 0.0000 1.000 0.000 0.000 1.000
#> GSM573706 3 0.0000 1.000 0.000 0.000 1.000
#> GSM573707 3 0.0000 1.000 0.000 0.000 1.000
#> GSM573702 3 0.0000 1.000 0.000 0.000 1.000
#> GSM573703 3 0.0000 1.000 0.000 0.000 1.000
#> GSM573704 3 0.0000 1.000 0.000 0.000 1.000
#> GSM573783 3 0.0000 1.000 0.000 0.000 1.000
#> GSM573784 3 0.0000 1.000 0.000 0.000 1.000
#> GSM573785 3 0.0000 1.000 0.000 0.000 1.000
#> GSM573744 1 0.0237 0.994 0.996 0.004 0.000
#> GSM573745 1 0.0237 0.994 0.996 0.004 0.000
#> GSM573746 1 0.0237 0.994 0.996 0.004 0.000
#> GSM573747 1 0.0237 0.994 0.996 0.004 0.000
#> GSM573748 1 0.0237 0.994 0.996 0.004 0.000
#> GSM573749 1 0.0237 0.994 0.996 0.004 0.000
#> GSM573753 1 0.0237 0.994 0.996 0.004 0.000
#> GSM573754 1 0.0237 0.994 0.996 0.004 0.000
#> GSM573755 1 0.0237 0.994 0.996 0.004 0.000
#> GSM573750 1 0.0237 0.994 0.996 0.004 0.000
#> GSM573751 1 0.0237 0.994 0.996 0.004 0.000
#> GSM573752 1 0.0237 0.994 0.996 0.004 0.000
#> GSM573795 1 0.0237 0.994 0.996 0.004 0.000
#> GSM573796 1 0.0237 0.994 0.996 0.004 0.000
#> GSM573797 1 0.0237 0.994 0.996 0.004 0.000
#> GSM573741 1 0.0237 0.994 0.996 0.004 0.000
#> GSM573742 1 0.0237 0.994 0.996 0.004 0.000
#> GSM573743 1 0.0237 0.994 0.996 0.004 0.000
#> GSM573738 1 0.0237 0.994 0.996 0.004 0.000
#> GSM573739 1 0.0237 0.994 0.996 0.004 0.000
#> GSM573740 1 0.0237 0.994 0.996 0.004 0.000
#> GSM573792 1 0.0237 0.994 0.996 0.004 0.000
#> GSM573793 1 0.0237 0.994 0.996 0.004 0.000
#> GSM573794 1 0.0237 0.994 0.996 0.004 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM573726 1 0 1 1 0 0 0
#> GSM573727 1 0 1 1 0 0 0
#> GSM573728 1 0 1 1 0 0 0
#> GSM573729 1 0 1 1 0 0 0
#> GSM573730 1 0 1 1 0 0 0
#> GSM573731 1 0 1 1 0 0 0
#> GSM573735 1 0 1 1 0 0 0
#> GSM573736 1 0 1 1 0 0 0
#> GSM573737 1 0 1 1 0 0 0
#> GSM573732 1 0 1 1 0 0 0
#> GSM573733 1 0 1 1 0 0 0
#> GSM573734 1 0 1 1 0 0 0
#> GSM573789 1 0 1 1 0 0 0
#> GSM573790 1 0 1 1 0 0 0
#> GSM573791 1 0 1 1 0 0 0
#> GSM573723 1 0 1 1 0 0 0
#> GSM573724 1 0 1 1 0 0 0
#> GSM573725 1 0 1 1 0 0 0
#> GSM573720 1 0 1 1 0 0 0
#> GSM573721 1 0 1 1 0 0 0
#> GSM573722 1 0 1 1 0 0 0
#> GSM573786 1 0 1 1 0 0 0
#> GSM573787 1 0 1 1 0 0 0
#> GSM573788 1 0 1 1 0 0 0
#> GSM573768 2 0 1 0 1 0 0
#> GSM573769 2 0 1 0 1 0 0
#> GSM573770 2 0 1 0 1 0 0
#> GSM573765 2 0 1 0 1 0 0
#> GSM573766 2 0 1 0 1 0 0
#> GSM573767 2 0 1 0 1 0 0
#> GSM573777 2 0 1 0 1 0 0
#> GSM573778 2 0 1 0 1 0 0
#> GSM573779 2 0 1 0 1 0 0
#> GSM573762 2 0 1 0 1 0 0
#> GSM573763 2 0 1 0 1 0 0
#> GSM573764 2 0 1 0 1 0 0
#> GSM573771 2 0 1 0 1 0 0
#> GSM573772 2 0 1 0 1 0 0
#> GSM573773 2 0 1 0 1 0 0
#> GSM573759 2 0 1 0 1 0 0
#> GSM573760 2 0 1 0 1 0 0
#> GSM573761 2 0 1 0 1 0 0
#> GSM573774 2 0 1 0 1 0 0
#> GSM573775 2 0 1 0 1 0 0
#> GSM573776 2 0 1 0 1 0 0
#> GSM573756 2 0 1 0 1 0 0
#> GSM573757 2 0 1 0 1 0 0
#> GSM573758 2 0 1 0 1 0 0
#> GSM573708 3 0 1 0 0 1 0
#> GSM573709 3 0 1 0 0 1 0
#> GSM573710 3 0 1 0 0 1 0
#> GSM573711 3 0 1 0 0 1 0
#> GSM573712 3 0 1 0 0 1 0
#> GSM573713 3 0 1 0 0 1 0
#> GSM573717 3 0 1 0 0 1 0
#> GSM573718 3 0 1 0 0 1 0
#> GSM573719 3 0 1 0 0 1 0
#> GSM573714 3 0 1 0 0 1 0
#> GSM573715 3 0 1 0 0 1 0
#> GSM573716 3 0 1 0 0 1 0
#> GSM573780 3 0 1 0 0 1 0
#> GSM573781 3 0 1 0 0 1 0
#> GSM573782 3 0 1 0 0 1 0
#> GSM573705 3 0 1 0 0 1 0
#> GSM573706 3 0 1 0 0 1 0
#> GSM573707 3 0 1 0 0 1 0
#> GSM573702 3 0 1 0 0 1 0
#> GSM573703 3 0 1 0 0 1 0
#> GSM573704 3 0 1 0 0 1 0
#> GSM573783 3 0 1 0 0 1 0
#> GSM573784 3 0 1 0 0 1 0
#> GSM573785 3 0 1 0 0 1 0
#> GSM573744 4 0 1 0 0 0 1
#> GSM573745 4 0 1 0 0 0 1
#> GSM573746 4 0 1 0 0 0 1
#> GSM573747 4 0 1 0 0 0 1
#> GSM573748 4 0 1 0 0 0 1
#> GSM573749 4 0 1 0 0 0 1
#> GSM573753 4 0 1 0 0 0 1
#> GSM573754 4 0 1 0 0 0 1
#> GSM573755 4 0 1 0 0 0 1
#> GSM573750 4 0 1 0 0 0 1
#> GSM573751 4 0 1 0 0 0 1
#> GSM573752 4 0 1 0 0 0 1
#> GSM573795 4 0 1 0 0 0 1
#> GSM573796 4 0 1 0 0 0 1
#> GSM573797 4 0 1 0 0 0 1
#> GSM573741 4 0 1 0 0 0 1
#> GSM573742 4 0 1 0 0 0 1
#> GSM573743 4 0 1 0 0 0 1
#> GSM573738 4 0 1 0 0 0 1
#> GSM573739 4 0 1 0 0 0 1
#> GSM573740 4 0 1 0 0 0 1
#> GSM573792 4 0 1 0 0 0 1
#> GSM573793 4 0 1 0 0 0 1
#> GSM573794 4 0 1 0 0 0 1
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM573726 1 0.000 1.000 1 0.000 0.000 0 0.000
#> GSM573727 1 0.000 1.000 1 0.000 0.000 0 0.000
#> GSM573728 1 0.000 1.000 1 0.000 0.000 0 0.000
#> GSM573729 1 0.000 1.000 1 0.000 0.000 0 0.000
#> GSM573730 1 0.000 1.000 1 0.000 0.000 0 0.000
#> GSM573731 1 0.000 1.000 1 0.000 0.000 0 0.000
#> GSM573735 1 0.000 1.000 1 0.000 0.000 0 0.000
#> GSM573736 1 0.000 1.000 1 0.000 0.000 0 0.000
#> GSM573737 1 0.000 1.000 1 0.000 0.000 0 0.000
#> GSM573732 1 0.000 1.000 1 0.000 0.000 0 0.000
#> GSM573733 1 0.000 1.000 1 0.000 0.000 0 0.000
#> GSM573734 1 0.000 1.000 1 0.000 0.000 0 0.000
#> GSM573789 1 0.000 1.000 1 0.000 0.000 0 0.000
#> GSM573790 1 0.000 1.000 1 0.000 0.000 0 0.000
#> GSM573791 1 0.000 1.000 1 0.000 0.000 0 0.000
#> GSM573723 1 0.000 1.000 1 0.000 0.000 0 0.000
#> GSM573724 1 0.000 1.000 1 0.000 0.000 0 0.000
#> GSM573725 1 0.000 1.000 1 0.000 0.000 0 0.000
#> GSM573720 1 0.000 1.000 1 0.000 0.000 0 0.000
#> GSM573721 1 0.000 1.000 1 0.000 0.000 0 0.000
#> GSM573722 1 0.000 1.000 1 0.000 0.000 0 0.000
#> GSM573786 1 0.000 1.000 1 0.000 0.000 0 0.000
#> GSM573787 1 0.000 1.000 1 0.000 0.000 0 0.000
#> GSM573788 1 0.000 1.000 1 0.000 0.000 0 0.000
#> GSM573768 2 0.104 0.963 0 0.960 0.000 0 0.040
#> GSM573769 2 0.112 0.963 0 0.956 0.000 0 0.044
#> GSM573770 2 0.134 0.962 0 0.944 0.000 0 0.056
#> GSM573765 2 0.191 0.939 0 0.908 0.000 0 0.092
#> GSM573766 2 0.191 0.939 0 0.908 0.000 0 0.092
#> GSM573767 2 0.191 0.939 0 0.908 0.000 0 0.092
#> GSM573777 5 0.154 1.000 0 0.068 0.000 0 0.932
#> GSM573778 5 0.154 1.000 0 0.068 0.000 0 0.932
#> GSM573779 5 0.154 1.000 0 0.068 0.000 0 0.932
#> GSM573762 5 0.154 1.000 0 0.068 0.000 0 0.932
#> GSM573763 5 0.154 1.000 0 0.068 0.000 0 0.932
#> GSM573764 5 0.154 1.000 0 0.068 0.000 0 0.932
#> GSM573771 5 0.154 1.000 0 0.068 0.000 0 0.932
#> GSM573772 5 0.154 1.000 0 0.068 0.000 0 0.932
#> GSM573773 5 0.154 1.000 0 0.068 0.000 0 0.932
#> GSM573759 2 0.000 0.956 0 1.000 0.000 0 0.000
#> GSM573760 2 0.000 0.956 0 1.000 0.000 0 0.000
#> GSM573761 2 0.000 0.956 0 1.000 0.000 0 0.000
#> GSM573774 2 0.134 0.962 0 0.944 0.000 0 0.056
#> GSM573775 2 0.134 0.962 0 0.944 0.000 0 0.056
#> GSM573776 2 0.134 0.962 0 0.944 0.000 0 0.056
#> GSM573756 2 0.000 0.956 0 1.000 0.000 0 0.000
#> GSM573757 2 0.000 0.956 0 1.000 0.000 0 0.000
#> GSM573758 2 0.000 0.956 0 1.000 0.000 0 0.000
#> GSM573708 3 0.154 0.961 0 0.000 0.932 0 0.068
#> GSM573709 3 0.154 0.961 0 0.000 0.932 0 0.068
#> GSM573710 3 0.154 0.961 0 0.000 0.932 0 0.068
#> GSM573711 3 0.154 0.961 0 0.000 0.932 0 0.068
#> GSM573712 3 0.154 0.961 0 0.000 0.932 0 0.068
#> GSM573713 3 0.154 0.961 0 0.000 0.932 0 0.068
#> GSM573717 3 0.000 0.977 0 0.000 1.000 0 0.000
#> GSM573718 3 0.000 0.977 0 0.000 1.000 0 0.000
#> GSM573719 3 0.000 0.977 0 0.000 1.000 0 0.000
#> GSM573714 3 0.000 0.977 0 0.000 1.000 0 0.000
#> GSM573715 3 0.000 0.977 0 0.000 1.000 0 0.000
#> GSM573716 3 0.000 0.977 0 0.000 1.000 0 0.000
#> GSM573780 3 0.154 0.961 0 0.000 0.932 0 0.068
#> GSM573781 3 0.154 0.961 0 0.000 0.932 0 0.068
#> GSM573782 3 0.154 0.961 0 0.000 0.932 0 0.068
#> GSM573705 3 0.000 0.977 0 0.000 1.000 0 0.000
#> GSM573706 3 0.000 0.977 0 0.000 1.000 0 0.000
#> GSM573707 3 0.000 0.977 0 0.000 1.000 0 0.000
#> GSM573702 3 0.000 0.977 0 0.000 1.000 0 0.000
#> GSM573703 3 0.000 0.977 0 0.000 1.000 0 0.000
#> GSM573704 3 0.000 0.977 0 0.000 1.000 0 0.000
#> GSM573783 3 0.000 0.977 0 0.000 1.000 0 0.000
#> GSM573784 3 0.000 0.977 0 0.000 1.000 0 0.000
#> GSM573785 3 0.000 0.977 0 0.000 1.000 0 0.000
#> GSM573744 4 0.000 1.000 0 0.000 0.000 1 0.000
#> GSM573745 4 0.000 1.000 0 0.000 0.000 1 0.000
#> GSM573746 4 0.000 1.000 0 0.000 0.000 1 0.000
#> GSM573747 4 0.000 1.000 0 0.000 0.000 1 0.000
#> GSM573748 4 0.000 1.000 0 0.000 0.000 1 0.000
#> GSM573749 4 0.000 1.000 0 0.000 0.000 1 0.000
#> GSM573753 4 0.000 1.000 0 0.000 0.000 1 0.000
#> GSM573754 4 0.000 1.000 0 0.000 0.000 1 0.000
#> GSM573755 4 0.000 1.000 0 0.000 0.000 1 0.000
#> GSM573750 4 0.000 1.000 0 0.000 0.000 1 0.000
#> GSM573751 4 0.000 1.000 0 0.000 0.000 1 0.000
#> GSM573752 4 0.000 1.000 0 0.000 0.000 1 0.000
#> GSM573795 4 0.000 1.000 0 0.000 0.000 1 0.000
#> GSM573796 4 0.000 1.000 0 0.000 0.000 1 0.000
#> GSM573797 4 0.000 1.000 0 0.000 0.000 1 0.000
#> GSM573741 4 0.000 1.000 0 0.000 0.000 1 0.000
#> GSM573742 4 0.000 1.000 0 0.000 0.000 1 0.000
#> GSM573743 4 0.000 1.000 0 0.000 0.000 1 0.000
#> GSM573738 4 0.000 1.000 0 0.000 0.000 1 0.000
#> GSM573739 4 0.000 1.000 0 0.000 0.000 1 0.000
#> GSM573740 4 0.000 1.000 0 0.000 0.000 1 0.000
#> GSM573792 4 0.000 1.000 0 0.000 0.000 1 0.000
#> GSM573793 4 0.000 1.000 0 0.000 0.000 1 0.000
#> GSM573794 4 0.000 1.000 0 0.000 0.000 1 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM573726 1 0.0000 1.000 1 0.000 0.000 0.000 0.000 0.000
#> GSM573727 1 0.0000 1.000 1 0.000 0.000 0.000 0.000 0.000
#> GSM573728 1 0.0000 1.000 1 0.000 0.000 0.000 0.000 0.000
#> GSM573729 1 0.0000 1.000 1 0.000 0.000 0.000 0.000 0.000
#> GSM573730 1 0.0000 1.000 1 0.000 0.000 0.000 0.000 0.000
#> GSM573731 1 0.0000 1.000 1 0.000 0.000 0.000 0.000 0.000
#> GSM573735 1 0.0000 1.000 1 0.000 0.000 0.000 0.000 0.000
#> GSM573736 1 0.0000 1.000 1 0.000 0.000 0.000 0.000 0.000
#> GSM573737 1 0.0000 1.000 1 0.000 0.000 0.000 0.000 0.000
#> GSM573732 1 0.0000 1.000 1 0.000 0.000 0.000 0.000 0.000
#> GSM573733 1 0.0000 1.000 1 0.000 0.000 0.000 0.000 0.000
#> GSM573734 1 0.0000 1.000 1 0.000 0.000 0.000 0.000 0.000
#> GSM573789 1 0.0000 1.000 1 0.000 0.000 0.000 0.000 0.000
#> GSM573790 1 0.0000 1.000 1 0.000 0.000 0.000 0.000 0.000
#> GSM573791 1 0.0000 1.000 1 0.000 0.000 0.000 0.000 0.000
#> GSM573723 1 0.0000 1.000 1 0.000 0.000 0.000 0.000 0.000
#> GSM573724 1 0.0000 1.000 1 0.000 0.000 0.000 0.000 0.000
#> GSM573725 1 0.0000 1.000 1 0.000 0.000 0.000 0.000 0.000
#> GSM573720 1 0.0000 1.000 1 0.000 0.000 0.000 0.000 0.000
#> GSM573721 1 0.0000 1.000 1 0.000 0.000 0.000 0.000 0.000
#> GSM573722 1 0.0000 1.000 1 0.000 0.000 0.000 0.000 0.000
#> GSM573786 1 0.0000 1.000 1 0.000 0.000 0.000 0.000 0.000
#> GSM573787 1 0.0000 1.000 1 0.000 0.000 0.000 0.000 0.000
#> GSM573788 1 0.0000 1.000 1 0.000 0.000 0.000 0.000 0.000
#> GSM573768 2 0.0937 0.964 0 0.960 0.000 0.000 0.000 0.040
#> GSM573769 2 0.1007 0.964 0 0.956 0.000 0.000 0.000 0.044
#> GSM573770 2 0.1204 0.963 0 0.944 0.000 0.000 0.000 0.056
#> GSM573765 2 0.1814 0.936 0 0.900 0.000 0.000 0.000 0.100
#> GSM573766 2 0.1814 0.936 0 0.900 0.000 0.000 0.000 0.100
#> GSM573767 2 0.1814 0.936 0 0.900 0.000 0.000 0.000 0.100
#> GSM573777 6 0.0000 1.000 0 0.000 0.000 0.000 0.000 1.000
#> GSM573778 6 0.0000 1.000 0 0.000 0.000 0.000 0.000 1.000
#> GSM573779 6 0.0000 1.000 0 0.000 0.000 0.000 0.000 1.000
#> GSM573762 6 0.0000 1.000 0 0.000 0.000 0.000 0.000 1.000
#> GSM573763 6 0.0000 1.000 0 0.000 0.000 0.000 0.000 1.000
#> GSM573764 6 0.0000 1.000 0 0.000 0.000 0.000 0.000 1.000
#> GSM573771 6 0.0000 1.000 0 0.000 0.000 0.000 0.000 1.000
#> GSM573772 6 0.0000 1.000 0 0.000 0.000 0.000 0.000 1.000
#> GSM573773 6 0.0000 1.000 0 0.000 0.000 0.000 0.000 1.000
#> GSM573759 2 0.0000 0.958 0 1.000 0.000 0.000 0.000 0.000
#> GSM573760 2 0.0000 0.958 0 1.000 0.000 0.000 0.000 0.000
#> GSM573761 2 0.0000 0.958 0 1.000 0.000 0.000 0.000 0.000
#> GSM573774 2 0.1204 0.963 0 0.944 0.000 0.000 0.000 0.056
#> GSM573775 2 0.1204 0.963 0 0.944 0.000 0.000 0.000 0.056
#> GSM573776 2 0.1204 0.963 0 0.944 0.000 0.000 0.000 0.056
#> GSM573756 2 0.0000 0.958 0 1.000 0.000 0.000 0.000 0.000
#> GSM573757 2 0.0000 0.958 0 1.000 0.000 0.000 0.000 0.000
#> GSM573758 2 0.0000 0.958 0 1.000 0.000 0.000 0.000 0.000
#> GSM573708 5 0.1204 1.000 0 0.000 0.056 0.000 0.944 0.000
#> GSM573709 5 0.1204 1.000 0 0.000 0.056 0.000 0.944 0.000
#> GSM573710 5 0.1204 1.000 0 0.000 0.056 0.000 0.944 0.000
#> GSM573711 5 0.1204 1.000 0 0.000 0.056 0.000 0.944 0.000
#> GSM573712 5 0.1204 1.000 0 0.000 0.056 0.000 0.944 0.000
#> GSM573713 5 0.1204 1.000 0 0.000 0.056 0.000 0.944 0.000
#> GSM573717 3 0.0000 1.000 0 0.000 1.000 0.000 0.000 0.000
#> GSM573718 3 0.0000 1.000 0 0.000 1.000 0.000 0.000 0.000
#> GSM573719 3 0.0000 1.000 0 0.000 1.000 0.000 0.000 0.000
#> GSM573714 3 0.0000 1.000 0 0.000 1.000 0.000 0.000 0.000
#> GSM573715 3 0.0000 1.000 0 0.000 1.000 0.000 0.000 0.000
#> GSM573716 3 0.0000 1.000 0 0.000 1.000 0.000 0.000 0.000
#> GSM573780 5 0.1204 1.000 0 0.000 0.056 0.000 0.944 0.000
#> GSM573781 5 0.1204 1.000 0 0.000 0.056 0.000 0.944 0.000
#> GSM573782 5 0.1204 1.000 0 0.000 0.056 0.000 0.944 0.000
#> GSM573705 3 0.0000 1.000 0 0.000 1.000 0.000 0.000 0.000
#> GSM573706 3 0.0000 1.000 0 0.000 1.000 0.000 0.000 0.000
#> GSM573707 3 0.0000 1.000 0 0.000 1.000 0.000 0.000 0.000
#> GSM573702 3 0.0000 1.000 0 0.000 1.000 0.000 0.000 0.000
#> GSM573703 3 0.0000 1.000 0 0.000 1.000 0.000 0.000 0.000
#> GSM573704 3 0.0000 1.000 0 0.000 1.000 0.000 0.000 0.000
#> GSM573783 3 0.0000 1.000 0 0.000 1.000 0.000 0.000 0.000
#> GSM573784 3 0.0000 1.000 0 0.000 1.000 0.000 0.000 0.000
#> GSM573785 3 0.0000 1.000 0 0.000 1.000 0.000 0.000 0.000
#> GSM573744 4 0.0000 0.981 0 0.000 0.000 1.000 0.000 0.000
#> GSM573745 4 0.0000 0.981 0 0.000 0.000 1.000 0.000 0.000
#> GSM573746 4 0.0000 0.981 0 0.000 0.000 1.000 0.000 0.000
#> GSM573747 4 0.0000 0.981 0 0.000 0.000 1.000 0.000 0.000
#> GSM573748 4 0.0000 0.981 0 0.000 0.000 1.000 0.000 0.000
#> GSM573749 4 0.0000 0.981 0 0.000 0.000 1.000 0.000 0.000
#> GSM573753 4 0.1204 0.968 0 0.000 0.000 0.944 0.056 0.000
#> GSM573754 4 0.1204 0.968 0 0.000 0.000 0.944 0.056 0.000
#> GSM573755 4 0.1204 0.968 0 0.000 0.000 0.944 0.056 0.000
#> GSM573750 4 0.1204 0.968 0 0.000 0.000 0.944 0.056 0.000
#> GSM573751 4 0.1204 0.968 0 0.000 0.000 0.944 0.056 0.000
#> GSM573752 4 0.1204 0.968 0 0.000 0.000 0.944 0.056 0.000
#> GSM573795 4 0.1204 0.968 0 0.000 0.000 0.944 0.056 0.000
#> GSM573796 4 0.1204 0.968 0 0.000 0.000 0.944 0.056 0.000
#> GSM573797 4 0.1204 0.968 0 0.000 0.000 0.944 0.056 0.000
#> GSM573741 4 0.0000 0.981 0 0.000 0.000 1.000 0.000 0.000
#> GSM573742 4 0.0000 0.981 0 0.000 0.000 1.000 0.000 0.000
#> GSM573743 4 0.0000 0.981 0 0.000 0.000 1.000 0.000 0.000
#> GSM573738 4 0.0000 0.981 0 0.000 0.000 1.000 0.000 0.000
#> GSM573739 4 0.0000 0.981 0 0.000 0.000 1.000 0.000 0.000
#> GSM573740 4 0.0000 0.981 0 0.000 0.000 1.000 0.000 0.000
#> GSM573792 4 0.0000 0.981 0 0.000 0.000 1.000 0.000 0.000
#> GSM573793 4 0.0000 0.981 0 0.000 0.000 1.000 0.000 0.000
#> GSM573794 4 0.0000 0.981 0 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)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
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)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
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:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.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")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
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 cell.line(p) agent(p) k
#> SD:hclust 96 1.13e-20 0.17295 2
#> SD:hclust 96 9.56e-39 0.74101 3
#> SD:hclust 96 9.14e-57 0.97496 4
#> SD:hclust 96 1.55e-54 0.08231 5
#> SD:hclust 96 1.73e-52 0.00229 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.
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 46609 rows and 96 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 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)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.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:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).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)
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.242 0.599 0.717 0.4215 0.495 0.495
#> 3 3 0.621 0.822 0.822 0.4556 0.621 0.390
#> 4 4 0.560 0.948 0.819 0.1456 0.874 0.657
#> 5 5 0.760 0.887 0.826 0.0775 1.000 1.000
#> 6 6 0.874 0.803 0.755 0.0544 0.968 0.870
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 3
Following shows the table of the partitions (You need to click the show/hide
code output link to see it). The membership matrix (columns with name p*
)
is inferred by
clue::cl_consensus()
function with the SE
method. Basically the value in the membership matrix
represents the probability to belong to a certain group. The finall class
label for an item is determined with the group with highest probability it
belongs to.
In get_classes()
function, the entropy is calculated from the membership
matrix and the silhouette score is calculated from the consensus matrix.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> GSM573726 1 0.900 0.663 0.684 0.316
#> GSM573727 1 0.900 0.663 0.684 0.316
#> GSM573728 1 0.900 0.663 0.684 0.316
#> GSM573729 1 0.900 0.663 0.684 0.316
#> GSM573730 1 0.900 0.663 0.684 0.316
#> GSM573731 1 0.900 0.663 0.684 0.316
#> GSM573735 1 0.900 0.663 0.684 0.316
#> GSM573736 1 0.900 0.663 0.684 0.316
#> GSM573737 1 0.900 0.663 0.684 0.316
#> GSM573732 1 0.900 0.663 0.684 0.316
#> GSM573733 1 0.900 0.663 0.684 0.316
#> GSM573734 1 0.900 0.663 0.684 0.316
#> GSM573789 1 0.900 0.663 0.684 0.316
#> GSM573790 1 0.900 0.663 0.684 0.316
#> GSM573791 1 0.900 0.663 0.684 0.316
#> GSM573723 1 0.900 0.663 0.684 0.316
#> GSM573724 1 0.900 0.663 0.684 0.316
#> GSM573725 1 0.900 0.663 0.684 0.316
#> GSM573720 1 0.900 0.663 0.684 0.316
#> GSM573721 1 0.900 0.663 0.684 0.316
#> GSM573722 1 0.900 0.663 0.684 0.316
#> GSM573786 1 0.900 0.663 0.684 0.316
#> GSM573787 1 0.900 0.663 0.684 0.316
#> GSM573788 1 0.900 0.663 0.684 0.316
#> GSM573768 2 0.595 0.625 0.144 0.856
#> GSM573769 2 0.595 0.625 0.144 0.856
#> GSM573770 2 0.595 0.625 0.144 0.856
#> GSM573765 2 0.595 0.625 0.144 0.856
#> GSM573766 2 0.595 0.625 0.144 0.856
#> GSM573767 2 0.595 0.625 0.144 0.856
#> GSM573777 2 0.595 0.625 0.144 0.856
#> GSM573778 2 0.595 0.625 0.144 0.856
#> GSM573779 2 0.595 0.625 0.144 0.856
#> GSM573762 2 0.595 0.625 0.144 0.856
#> GSM573763 2 0.595 0.625 0.144 0.856
#> GSM573764 2 0.595 0.625 0.144 0.856
#> GSM573771 2 0.595 0.625 0.144 0.856
#> GSM573772 2 0.595 0.625 0.144 0.856
#> GSM573773 2 0.595 0.625 0.144 0.856
#> GSM573759 2 0.595 0.625 0.144 0.856
#> GSM573760 2 0.595 0.625 0.144 0.856
#> GSM573761 2 0.595 0.625 0.144 0.856
#> GSM573774 2 0.595 0.625 0.144 0.856
#> GSM573775 2 0.595 0.625 0.144 0.856
#> GSM573776 2 0.595 0.625 0.144 0.856
#> GSM573756 2 0.595 0.625 0.144 0.856
#> GSM573757 2 0.595 0.625 0.144 0.856
#> GSM573758 2 0.595 0.625 0.144 0.856
#> GSM573708 1 0.118 0.733 0.984 0.016
#> GSM573709 1 0.118 0.733 0.984 0.016
#> GSM573710 1 0.118 0.733 0.984 0.016
#> GSM573711 1 0.118 0.733 0.984 0.016
#> GSM573712 1 0.118 0.733 0.984 0.016
#> GSM573713 1 0.118 0.733 0.984 0.016
#> GSM573717 1 0.118 0.733 0.984 0.016
#> GSM573718 1 0.118 0.733 0.984 0.016
#> GSM573719 1 0.118 0.733 0.984 0.016
#> GSM573714 1 0.118 0.733 0.984 0.016
#> GSM573715 1 0.118 0.733 0.984 0.016
#> GSM573716 1 0.118 0.733 0.984 0.016
#> GSM573780 1 0.118 0.733 0.984 0.016
#> GSM573781 1 0.118 0.733 0.984 0.016
#> GSM573782 1 0.118 0.733 0.984 0.016
#> GSM573705 1 0.118 0.733 0.984 0.016
#> GSM573706 1 0.118 0.733 0.984 0.016
#> GSM573707 1 0.118 0.733 0.984 0.016
#> GSM573702 1 0.118 0.733 0.984 0.016
#> GSM573703 1 0.118 0.733 0.984 0.016
#> GSM573704 1 0.118 0.733 0.984 0.016
#> GSM573783 1 0.118 0.733 0.984 0.016
#> GSM573784 1 0.118 0.733 0.984 0.016
#> GSM573785 1 0.118 0.733 0.984 0.016
#> GSM573744 2 0.961 0.376 0.384 0.616
#> GSM573745 2 0.961 0.376 0.384 0.616
#> GSM573746 2 0.961 0.376 0.384 0.616
#> GSM573747 2 0.961 0.376 0.384 0.616
#> GSM573748 2 0.961 0.376 0.384 0.616
#> GSM573749 2 0.961 0.376 0.384 0.616
#> GSM573753 2 0.961 0.376 0.384 0.616
#> GSM573754 2 0.961 0.376 0.384 0.616
#> GSM573755 2 0.961 0.376 0.384 0.616
#> GSM573750 2 0.961 0.376 0.384 0.616
#> GSM573751 2 0.961 0.376 0.384 0.616
#> GSM573752 2 0.961 0.376 0.384 0.616
#> GSM573795 2 0.961 0.376 0.384 0.616
#> GSM573796 2 0.961 0.376 0.384 0.616
#> GSM573797 2 0.961 0.376 0.384 0.616
#> GSM573741 2 0.961 0.376 0.384 0.616
#> GSM573742 2 0.961 0.376 0.384 0.616
#> GSM573743 2 0.961 0.376 0.384 0.616
#> GSM573738 2 0.961 0.376 0.384 0.616
#> GSM573739 2 0.961 0.376 0.384 0.616
#> GSM573740 2 0.961 0.376 0.384 0.616
#> GSM573792 2 0.961 0.376 0.384 0.616
#> GSM573793 2 0.961 0.376 0.384 0.616
#> GSM573794 2 0.961 0.376 0.384 0.616
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM573726 1 0.927 0.650 0.528 0.236 0.236
#> GSM573727 1 0.927 0.650 0.528 0.236 0.236
#> GSM573728 1 0.927 0.650 0.528 0.236 0.236
#> GSM573729 1 0.927 0.650 0.528 0.236 0.236
#> GSM573730 1 0.927 0.650 0.528 0.236 0.236
#> GSM573731 1 0.927 0.650 0.528 0.236 0.236
#> GSM573735 1 0.927 0.650 0.528 0.236 0.236
#> GSM573736 1 0.927 0.650 0.528 0.236 0.236
#> GSM573737 1 0.927 0.650 0.528 0.236 0.236
#> GSM573732 1 0.927 0.650 0.528 0.236 0.236
#> GSM573733 1 0.927 0.650 0.528 0.236 0.236
#> GSM573734 1 0.927 0.650 0.528 0.236 0.236
#> GSM573789 1 0.927 0.650 0.528 0.236 0.236
#> GSM573790 1 0.927 0.650 0.528 0.236 0.236
#> GSM573791 1 0.927 0.650 0.528 0.236 0.236
#> GSM573723 1 0.927 0.650 0.528 0.236 0.236
#> GSM573724 1 0.927 0.650 0.528 0.236 0.236
#> GSM573725 1 0.927 0.650 0.528 0.236 0.236
#> GSM573720 1 0.927 0.650 0.528 0.236 0.236
#> GSM573721 1 0.927 0.650 0.528 0.236 0.236
#> GSM573722 1 0.927 0.650 0.528 0.236 0.236
#> GSM573786 1 0.927 0.650 0.528 0.236 0.236
#> GSM573787 1 0.927 0.650 0.528 0.236 0.236
#> GSM573788 1 0.927 0.650 0.528 0.236 0.236
#> GSM573768 2 0.608 0.990 0.216 0.748 0.036
#> GSM573769 2 0.608 0.990 0.216 0.748 0.036
#> GSM573770 2 0.608 0.990 0.216 0.748 0.036
#> GSM573765 2 0.619 0.990 0.216 0.744 0.040
#> GSM573766 2 0.619 0.990 0.216 0.744 0.040
#> GSM573767 2 0.619 0.990 0.216 0.744 0.040
#> GSM573777 2 0.685 0.984 0.216 0.716 0.068
#> GSM573778 2 0.685 0.984 0.216 0.716 0.068
#> GSM573779 2 0.685 0.984 0.216 0.716 0.068
#> GSM573762 2 0.685 0.984 0.216 0.716 0.068
#> GSM573763 2 0.685 0.984 0.216 0.716 0.068
#> GSM573764 2 0.685 0.984 0.216 0.716 0.068
#> GSM573771 2 0.685 0.984 0.216 0.716 0.068
#> GSM573772 2 0.685 0.984 0.216 0.716 0.068
#> GSM573773 2 0.685 0.984 0.216 0.716 0.068
#> GSM573759 2 0.608 0.990 0.216 0.748 0.036
#> GSM573760 2 0.608 0.990 0.216 0.748 0.036
#> GSM573761 2 0.608 0.990 0.216 0.748 0.036
#> GSM573774 2 0.608 0.990 0.216 0.748 0.036
#> GSM573775 2 0.608 0.990 0.216 0.748 0.036
#> GSM573776 2 0.608 0.990 0.216 0.748 0.036
#> GSM573756 2 0.608 0.990 0.216 0.748 0.036
#> GSM573757 2 0.608 0.990 0.216 0.748 0.036
#> GSM573758 2 0.608 0.990 0.216 0.748 0.036
#> GSM573708 3 0.303 0.974 0.032 0.048 0.920
#> GSM573709 3 0.303 0.974 0.032 0.048 0.920
#> GSM573710 3 0.303 0.974 0.032 0.048 0.920
#> GSM573711 3 0.303 0.974 0.032 0.048 0.920
#> GSM573712 3 0.303 0.974 0.032 0.048 0.920
#> GSM573713 3 0.303 0.974 0.032 0.048 0.920
#> GSM573717 3 0.129 0.984 0.032 0.000 0.968
#> GSM573718 3 0.129 0.984 0.032 0.000 0.968
#> GSM573719 3 0.129 0.984 0.032 0.000 0.968
#> GSM573714 3 0.129 0.984 0.032 0.000 0.968
#> GSM573715 3 0.129 0.984 0.032 0.000 0.968
#> GSM573716 3 0.129 0.984 0.032 0.000 0.968
#> GSM573780 3 0.313 0.973 0.032 0.052 0.916
#> GSM573781 3 0.313 0.973 0.032 0.052 0.916
#> GSM573782 3 0.313 0.973 0.032 0.052 0.916
#> GSM573705 3 0.129 0.984 0.032 0.000 0.968
#> GSM573706 3 0.129 0.984 0.032 0.000 0.968
#> GSM573707 3 0.129 0.984 0.032 0.000 0.968
#> GSM573702 3 0.129 0.984 0.032 0.000 0.968
#> GSM573703 3 0.129 0.984 0.032 0.000 0.968
#> GSM573704 3 0.129 0.984 0.032 0.000 0.968
#> GSM573783 3 0.153 0.983 0.032 0.004 0.964
#> GSM573784 3 0.153 0.983 0.032 0.004 0.964
#> GSM573785 3 0.153 0.983 0.032 0.004 0.964
#> GSM573744 1 0.141 0.670 0.964 0.000 0.036
#> GSM573745 1 0.141 0.670 0.964 0.000 0.036
#> GSM573746 1 0.141 0.670 0.964 0.000 0.036
#> GSM573747 1 0.141 0.670 0.964 0.000 0.036
#> GSM573748 1 0.141 0.670 0.964 0.000 0.036
#> GSM573749 1 0.141 0.670 0.964 0.000 0.036
#> GSM573753 1 0.141 0.670 0.964 0.000 0.036
#> GSM573754 1 0.141 0.670 0.964 0.000 0.036
#> GSM573755 1 0.141 0.670 0.964 0.000 0.036
#> GSM573750 1 0.141 0.670 0.964 0.000 0.036
#> GSM573751 1 0.141 0.670 0.964 0.000 0.036
#> GSM573752 1 0.141 0.670 0.964 0.000 0.036
#> GSM573795 1 0.141 0.670 0.964 0.000 0.036
#> GSM573796 1 0.141 0.670 0.964 0.000 0.036
#> GSM573797 1 0.141 0.670 0.964 0.000 0.036
#> GSM573741 1 0.141 0.670 0.964 0.000 0.036
#> GSM573742 1 0.141 0.670 0.964 0.000 0.036
#> GSM573743 1 0.141 0.670 0.964 0.000 0.036
#> GSM573738 1 0.141 0.670 0.964 0.000 0.036
#> GSM573739 1 0.141 0.670 0.964 0.000 0.036
#> GSM573740 1 0.141 0.670 0.964 0.000 0.036
#> GSM573792 1 0.141 0.670 0.964 0.000 0.036
#> GSM573793 1 0.141 0.670 0.964 0.000 0.036
#> GSM573794 1 0.141 0.670 0.964 0.000 0.036
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM573726 1 0.4642 0.993 0.740 0.020 0.000 0.240
#> GSM573727 1 0.4642 0.993 0.740 0.020 0.000 0.240
#> GSM573728 1 0.4642 0.993 0.740 0.020 0.000 0.240
#> GSM573729 1 0.4642 0.993 0.740 0.020 0.000 0.240
#> GSM573730 1 0.4642 0.993 0.740 0.020 0.000 0.240
#> GSM573731 1 0.4642 0.993 0.740 0.020 0.000 0.240
#> GSM573735 1 0.4737 0.989 0.728 0.020 0.000 0.252
#> GSM573736 1 0.4737 0.989 0.728 0.020 0.000 0.252
#> GSM573737 1 0.4737 0.989 0.728 0.020 0.000 0.252
#> GSM573732 1 0.4737 0.989 0.728 0.020 0.000 0.252
#> GSM573733 1 0.4737 0.989 0.728 0.020 0.000 0.252
#> GSM573734 1 0.4737 0.989 0.728 0.020 0.000 0.252
#> GSM573789 1 0.5024 0.987 0.724 0.020 0.008 0.248
#> GSM573790 1 0.5024 0.987 0.724 0.020 0.008 0.248
#> GSM573791 1 0.5024 0.987 0.724 0.020 0.008 0.248
#> GSM573723 1 0.4642 0.993 0.740 0.020 0.000 0.240
#> GSM573724 1 0.4642 0.993 0.740 0.020 0.000 0.240
#> GSM573725 1 0.4642 0.993 0.740 0.020 0.000 0.240
#> GSM573720 1 0.4642 0.993 0.740 0.020 0.000 0.240
#> GSM573721 1 0.4642 0.993 0.740 0.020 0.000 0.240
#> GSM573722 1 0.4642 0.993 0.740 0.020 0.000 0.240
#> GSM573786 1 0.5024 0.987 0.724 0.020 0.008 0.248
#> GSM573787 1 0.5024 0.987 0.724 0.020 0.008 0.248
#> GSM573788 1 0.5024 0.987 0.724 0.020 0.008 0.248
#> GSM573768 2 0.0779 0.948 0.004 0.980 0.000 0.016
#> GSM573769 2 0.0779 0.948 0.004 0.980 0.000 0.016
#> GSM573770 2 0.0779 0.948 0.004 0.980 0.000 0.016
#> GSM573765 2 0.1993 0.946 0.024 0.944 0.016 0.016
#> GSM573766 2 0.1993 0.946 0.024 0.944 0.016 0.016
#> GSM573767 2 0.1993 0.946 0.024 0.944 0.016 0.016
#> GSM573777 2 0.4537 0.923 0.088 0.824 0.072 0.016
#> GSM573778 2 0.4537 0.923 0.088 0.824 0.072 0.016
#> GSM573779 2 0.4537 0.923 0.088 0.824 0.072 0.016
#> GSM573762 2 0.4537 0.923 0.088 0.824 0.072 0.016
#> GSM573763 2 0.4537 0.923 0.088 0.824 0.072 0.016
#> GSM573764 2 0.4537 0.923 0.088 0.824 0.072 0.016
#> GSM573771 2 0.4537 0.923 0.088 0.824 0.072 0.016
#> GSM573772 2 0.4537 0.923 0.088 0.824 0.072 0.016
#> GSM573773 2 0.4537 0.923 0.088 0.824 0.072 0.016
#> GSM573759 2 0.0967 0.948 0.004 0.976 0.004 0.016
#> GSM573760 2 0.0967 0.948 0.004 0.976 0.004 0.016
#> GSM573761 2 0.0967 0.948 0.004 0.976 0.004 0.016
#> GSM573774 2 0.0779 0.948 0.004 0.980 0.000 0.016
#> GSM573775 2 0.0779 0.948 0.004 0.980 0.000 0.016
#> GSM573776 2 0.0779 0.948 0.004 0.980 0.000 0.016
#> GSM573756 2 0.1114 0.948 0.004 0.972 0.008 0.016
#> GSM573757 2 0.1114 0.948 0.004 0.972 0.008 0.016
#> GSM573758 2 0.1114 0.948 0.004 0.972 0.008 0.016
#> GSM573708 3 0.6549 0.869 0.308 0.008 0.604 0.080
#> GSM573709 3 0.6549 0.869 0.308 0.008 0.604 0.080
#> GSM573710 3 0.6549 0.869 0.308 0.008 0.604 0.080
#> GSM573711 3 0.6549 0.869 0.308 0.008 0.604 0.080
#> GSM573712 3 0.6549 0.869 0.308 0.008 0.604 0.080
#> GSM573713 3 0.6549 0.869 0.308 0.008 0.604 0.080
#> GSM573717 3 0.3873 0.922 0.144 0.008 0.832 0.016
#> GSM573718 3 0.3873 0.922 0.144 0.008 0.832 0.016
#> GSM573719 3 0.3873 0.922 0.144 0.008 0.832 0.016
#> GSM573714 3 0.3873 0.922 0.144 0.008 0.832 0.016
#> GSM573715 3 0.3873 0.922 0.144 0.008 0.832 0.016
#> GSM573716 3 0.3873 0.922 0.144 0.008 0.832 0.016
#> GSM573780 3 0.6668 0.867 0.308 0.012 0.600 0.080
#> GSM573781 3 0.6668 0.867 0.308 0.012 0.600 0.080
#> GSM573782 3 0.6668 0.867 0.308 0.012 0.600 0.080
#> GSM573705 3 0.3873 0.922 0.144 0.008 0.832 0.016
#> GSM573706 3 0.3873 0.922 0.144 0.008 0.832 0.016
#> GSM573707 3 0.3873 0.922 0.144 0.008 0.832 0.016
#> GSM573702 3 0.3873 0.922 0.144 0.008 0.832 0.016
#> GSM573703 3 0.3873 0.922 0.144 0.008 0.832 0.016
#> GSM573704 3 0.3873 0.922 0.144 0.008 0.832 0.016
#> GSM573783 3 0.4278 0.919 0.148 0.020 0.816 0.016
#> GSM573784 3 0.4278 0.919 0.148 0.020 0.816 0.016
#> GSM573785 3 0.4278 0.919 0.148 0.020 0.816 0.016
#> GSM573744 4 0.2081 0.968 0.000 0.084 0.000 0.916
#> GSM573745 4 0.2081 0.968 0.000 0.084 0.000 0.916
#> GSM573746 4 0.2081 0.968 0.000 0.084 0.000 0.916
#> GSM573747 4 0.2081 0.968 0.000 0.084 0.000 0.916
#> GSM573748 4 0.2081 0.968 0.000 0.084 0.000 0.916
#> GSM573749 4 0.2081 0.968 0.000 0.084 0.000 0.916
#> GSM573753 4 0.4296 0.947 0.008 0.084 0.076 0.832
#> GSM573754 4 0.4296 0.947 0.008 0.084 0.076 0.832
#> GSM573755 4 0.4296 0.947 0.008 0.084 0.076 0.832
#> GSM573750 4 0.4296 0.947 0.008 0.084 0.076 0.832
#> GSM573751 4 0.4296 0.947 0.008 0.084 0.076 0.832
#> GSM573752 4 0.4296 0.947 0.008 0.084 0.076 0.832
#> GSM573795 4 0.4364 0.946 0.008 0.084 0.080 0.828
#> GSM573796 4 0.4364 0.946 0.008 0.084 0.080 0.828
#> GSM573797 4 0.4364 0.946 0.008 0.084 0.080 0.828
#> GSM573741 4 0.2081 0.968 0.000 0.084 0.000 0.916
#> GSM573742 4 0.2081 0.968 0.000 0.084 0.000 0.916
#> GSM573743 4 0.2081 0.968 0.000 0.084 0.000 0.916
#> GSM573738 4 0.2081 0.968 0.000 0.084 0.000 0.916
#> GSM573739 4 0.2081 0.968 0.000 0.084 0.000 0.916
#> GSM573740 4 0.2081 0.968 0.000 0.084 0.000 0.916
#> GSM573792 4 0.2334 0.966 0.000 0.088 0.004 0.908
#> GSM573793 4 0.2334 0.966 0.000 0.088 0.004 0.908
#> GSM573794 4 0.2334 0.966 0.000 0.088 0.004 0.908
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM573726 1 0.2561 0.965 0.856 0.000 0.000 0.144 NA
#> GSM573727 1 0.2561 0.965 0.856 0.000 0.000 0.144 NA
#> GSM573728 1 0.2561 0.965 0.856 0.000 0.000 0.144 NA
#> GSM573729 1 0.2561 0.965 0.856 0.000 0.000 0.144 NA
#> GSM573730 1 0.2561 0.965 0.856 0.000 0.000 0.144 NA
#> GSM573731 1 0.2561 0.965 0.856 0.000 0.000 0.144 NA
#> GSM573735 1 0.4634 0.936 0.752 0.004 0.000 0.144 NA
#> GSM573736 1 0.4634 0.936 0.752 0.004 0.000 0.144 NA
#> GSM573737 1 0.4634 0.936 0.752 0.004 0.000 0.144 NA
#> GSM573732 1 0.4634 0.936 0.752 0.004 0.000 0.144 NA
#> GSM573733 1 0.4634 0.936 0.752 0.004 0.000 0.144 NA
#> GSM573734 1 0.4634 0.936 0.752 0.004 0.000 0.144 NA
#> GSM573789 1 0.4675 0.945 0.764 0.020 0.000 0.144 NA
#> GSM573790 1 0.4675 0.945 0.764 0.020 0.000 0.144 NA
#> GSM573791 1 0.4675 0.945 0.764 0.020 0.000 0.144 NA
#> GSM573723 1 0.2561 0.965 0.856 0.000 0.000 0.144 NA
#> GSM573724 1 0.2561 0.965 0.856 0.000 0.000 0.144 NA
#> GSM573725 1 0.2561 0.965 0.856 0.000 0.000 0.144 NA
#> GSM573720 1 0.2561 0.965 0.856 0.000 0.000 0.144 NA
#> GSM573721 1 0.2561 0.965 0.856 0.000 0.000 0.144 NA
#> GSM573722 1 0.2561 0.965 0.856 0.000 0.000 0.144 NA
#> GSM573786 1 0.3547 0.957 0.824 0.016 0.000 0.144 NA
#> GSM573787 1 0.3547 0.957 0.824 0.016 0.000 0.144 NA
#> GSM573788 1 0.3547 0.957 0.824 0.016 0.000 0.144 NA
#> GSM573768 2 0.1901 0.898 0.012 0.928 0.004 0.056 NA
#> GSM573769 2 0.1901 0.898 0.012 0.928 0.004 0.056 NA
#> GSM573770 2 0.1901 0.898 0.012 0.928 0.004 0.056 NA
#> GSM573765 2 0.3139 0.897 0.024 0.880 0.004 0.056 NA
#> GSM573766 2 0.3139 0.897 0.024 0.880 0.004 0.056 NA
#> GSM573767 2 0.3139 0.897 0.024 0.880 0.004 0.056 NA
#> GSM573777 2 0.6595 0.844 0.072 0.632 0.024 0.056 NA
#> GSM573778 2 0.6595 0.844 0.072 0.632 0.024 0.056 NA
#> GSM573779 2 0.6595 0.844 0.072 0.632 0.024 0.056 NA
#> GSM573762 2 0.6565 0.844 0.076 0.632 0.020 0.056 NA
#> GSM573763 2 0.6538 0.844 0.072 0.632 0.020 0.056 NA
#> GSM573764 2 0.6565 0.844 0.076 0.632 0.020 0.056 NA
#> GSM573771 2 0.6590 0.844 0.080 0.632 0.020 0.056 NA
#> GSM573772 2 0.6590 0.844 0.080 0.632 0.020 0.056 NA
#> GSM573773 2 0.6565 0.844 0.076 0.632 0.020 0.056 NA
#> GSM573759 2 0.2228 0.898 0.020 0.916 0.008 0.056 NA
#> GSM573760 2 0.2228 0.898 0.020 0.916 0.008 0.056 NA
#> GSM573761 2 0.2228 0.898 0.020 0.916 0.008 0.056 NA
#> GSM573774 2 0.1901 0.898 0.012 0.928 0.004 0.056 NA
#> GSM573775 2 0.1901 0.898 0.012 0.928 0.004 0.056 NA
#> GSM573776 2 0.1901 0.898 0.012 0.928 0.004 0.056 NA
#> GSM573756 2 0.2634 0.897 0.024 0.900 0.020 0.056 NA
#> GSM573757 2 0.2634 0.897 0.024 0.900 0.020 0.056 NA
#> GSM573758 2 0.2634 0.897 0.024 0.900 0.020 0.056 NA
#> GSM573708 3 0.5263 0.800 0.056 0.000 0.576 0.000 NA
#> GSM573709 3 0.5263 0.800 0.056 0.000 0.576 0.000 NA
#> GSM573710 3 0.5263 0.800 0.056 0.000 0.576 0.000 NA
#> GSM573711 3 0.5263 0.800 0.056 0.000 0.576 0.000 NA
#> GSM573712 3 0.5263 0.800 0.056 0.000 0.576 0.000 NA
#> GSM573713 3 0.5263 0.800 0.056 0.000 0.576 0.000 NA
#> GSM573717 3 0.1341 0.880 0.056 0.000 0.944 0.000 NA
#> GSM573718 3 0.1341 0.880 0.056 0.000 0.944 0.000 NA
#> GSM573719 3 0.1341 0.880 0.056 0.000 0.944 0.000 NA
#> GSM573714 3 0.1341 0.880 0.056 0.000 0.944 0.000 NA
#> GSM573715 3 0.1341 0.880 0.056 0.000 0.944 0.000 NA
#> GSM573716 3 0.1341 0.880 0.056 0.000 0.944 0.000 NA
#> GSM573780 3 0.5963 0.798 0.076 0.020 0.572 0.000 NA
#> GSM573781 3 0.5963 0.798 0.076 0.020 0.572 0.000 NA
#> GSM573782 3 0.5963 0.798 0.076 0.020 0.572 0.000 NA
#> GSM573705 3 0.1341 0.880 0.056 0.000 0.944 0.000 NA
#> GSM573706 3 0.1341 0.880 0.056 0.000 0.944 0.000 NA
#> GSM573707 3 0.1341 0.880 0.056 0.000 0.944 0.000 NA
#> GSM573702 3 0.1341 0.880 0.056 0.000 0.944 0.000 NA
#> GSM573703 3 0.1341 0.880 0.056 0.000 0.944 0.000 NA
#> GSM573704 3 0.1341 0.880 0.056 0.000 0.944 0.000 NA
#> GSM573783 3 0.2775 0.869 0.100 0.020 0.876 0.000 NA
#> GSM573784 3 0.2775 0.869 0.100 0.020 0.876 0.000 NA
#> GSM573785 3 0.2775 0.869 0.100 0.020 0.876 0.000 NA
#> GSM573744 4 0.3636 0.897 0.000 0.000 0.000 0.728 NA
#> GSM573745 4 0.3636 0.897 0.000 0.000 0.000 0.728 NA
#> GSM573746 4 0.3636 0.897 0.000 0.000 0.000 0.728 NA
#> GSM573747 4 0.3636 0.897 0.000 0.000 0.000 0.728 NA
#> GSM573748 4 0.3636 0.897 0.000 0.000 0.000 0.728 NA
#> GSM573749 4 0.3636 0.897 0.000 0.000 0.000 0.728 NA
#> GSM573753 4 0.0451 0.827 0.000 0.008 0.004 0.988 NA
#> GSM573754 4 0.0451 0.827 0.000 0.008 0.004 0.988 NA
#> GSM573755 4 0.0451 0.827 0.000 0.008 0.004 0.988 NA
#> GSM573750 4 0.0451 0.827 0.000 0.008 0.004 0.988 NA
#> GSM573751 4 0.0451 0.827 0.000 0.008 0.004 0.988 NA
#> GSM573752 4 0.0451 0.827 0.000 0.008 0.004 0.988 NA
#> GSM573795 4 0.0771 0.823 0.000 0.004 0.000 0.976 NA
#> GSM573796 4 0.0771 0.823 0.000 0.004 0.000 0.976 NA
#> GSM573797 4 0.0771 0.823 0.000 0.004 0.000 0.976 NA
#> GSM573741 4 0.3636 0.897 0.000 0.000 0.000 0.728 NA
#> GSM573742 4 0.3636 0.897 0.000 0.000 0.000 0.728 NA
#> GSM573743 4 0.3636 0.897 0.000 0.000 0.000 0.728 NA
#> GSM573738 4 0.3636 0.897 0.000 0.000 0.000 0.728 NA
#> GSM573739 4 0.3636 0.897 0.000 0.000 0.000 0.728 NA
#> GSM573740 4 0.3636 0.897 0.000 0.000 0.000 0.728 NA
#> GSM573792 4 0.4219 0.891 0.000 0.004 0.016 0.716 NA
#> GSM573793 4 0.4219 0.891 0.000 0.004 0.016 0.716 NA
#> GSM573794 4 0.4219 0.891 0.000 0.004 0.016 0.716 NA
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM573726 1 0.0000 0.928 1.000 0.000 0.000 0.000 0.000 NA
#> GSM573727 1 0.0000 0.928 1.000 0.000 0.000 0.000 0.000 NA
#> GSM573728 1 0.0000 0.928 1.000 0.000 0.000 0.000 0.000 NA
#> GSM573729 1 0.0000 0.928 1.000 0.000 0.000 0.000 0.000 NA
#> GSM573730 1 0.0000 0.928 1.000 0.000 0.000 0.000 0.000 NA
#> GSM573731 1 0.0000 0.928 1.000 0.000 0.000 0.000 0.000 NA
#> GSM573735 1 0.4017 0.855 0.760 0.000 0.160 0.004 0.000 NA
#> GSM573736 1 0.4017 0.855 0.760 0.000 0.160 0.004 0.000 NA
#> GSM573737 1 0.4017 0.855 0.760 0.000 0.160 0.004 0.000 NA
#> GSM573732 1 0.4017 0.855 0.760 0.000 0.160 0.004 0.000 NA
#> GSM573733 1 0.4017 0.855 0.760 0.000 0.160 0.004 0.000 NA
#> GSM573734 1 0.4017 0.855 0.760 0.000 0.160 0.004 0.000 NA
#> GSM573789 1 0.3118 0.895 0.836 0.000 0.072 0.000 0.000 NA
#> GSM573790 1 0.3118 0.895 0.836 0.000 0.072 0.000 0.000 NA
#> GSM573791 1 0.3118 0.895 0.836 0.000 0.072 0.000 0.000 NA
#> GSM573723 1 0.0000 0.928 1.000 0.000 0.000 0.000 0.000 NA
#> GSM573724 1 0.0000 0.928 1.000 0.000 0.000 0.000 0.000 NA
#> GSM573725 1 0.0000 0.928 1.000 0.000 0.000 0.000 0.000 NA
#> GSM573720 1 0.0000 0.928 1.000 0.000 0.000 0.000 0.000 NA
#> GSM573721 1 0.0000 0.928 1.000 0.000 0.000 0.000 0.000 NA
#> GSM573722 1 0.0000 0.928 1.000 0.000 0.000 0.000 0.000 NA
#> GSM573786 1 0.1584 0.914 0.928 0.000 0.008 0.000 0.000 NA
#> GSM573787 1 0.1584 0.914 0.928 0.000 0.008 0.000 0.000 NA
#> GSM573788 1 0.1584 0.914 0.928 0.000 0.008 0.000 0.000 NA
#> GSM573768 2 0.3890 0.850 0.004 0.596 0.000 0.000 0.000 NA
#> GSM573769 2 0.3890 0.850 0.004 0.596 0.000 0.000 0.000 NA
#> GSM573770 2 0.3890 0.850 0.004 0.596 0.000 0.000 0.000 NA
#> GSM573765 2 0.3703 0.849 0.004 0.688 0.000 0.004 0.000 NA
#> GSM573766 2 0.3703 0.849 0.004 0.688 0.000 0.004 0.000 NA
#> GSM573767 2 0.3703 0.849 0.004 0.688 0.000 0.004 0.000 NA
#> GSM573777 2 0.0692 0.785 0.004 0.976 0.020 0.000 0.000 NA
#> GSM573778 2 0.0603 0.785 0.004 0.980 0.016 0.000 0.000 NA
#> GSM573779 2 0.0603 0.785 0.004 0.980 0.016 0.000 0.000 NA
#> GSM573762 2 0.0291 0.785 0.004 0.992 0.000 0.004 0.000 NA
#> GSM573763 2 0.0436 0.785 0.004 0.988 0.004 0.004 0.000 NA
#> GSM573764 2 0.0291 0.785 0.004 0.992 0.000 0.000 0.000 NA
#> GSM573771 2 0.0582 0.785 0.004 0.984 0.000 0.004 0.004 NA
#> GSM573772 2 0.0582 0.785 0.004 0.984 0.000 0.004 0.004 NA
#> GSM573773 2 0.0696 0.786 0.004 0.980 0.004 0.008 0.004 NA
#> GSM573759 2 0.4739 0.849 0.004 0.596 0.040 0.000 0.004 NA
#> GSM573760 2 0.4739 0.849 0.004 0.596 0.040 0.000 0.004 NA
#> GSM573761 2 0.4739 0.849 0.004 0.596 0.040 0.000 0.004 NA
#> GSM573774 2 0.4015 0.850 0.004 0.596 0.000 0.004 0.000 NA
#> GSM573775 2 0.4015 0.850 0.004 0.596 0.000 0.004 0.000 NA
#> GSM573776 2 0.4015 0.850 0.004 0.596 0.000 0.004 0.000 NA
#> GSM573756 2 0.5096 0.845 0.004 0.596 0.076 0.000 0.004 NA
#> GSM573757 2 0.5096 0.845 0.004 0.596 0.076 0.000 0.004 NA
#> GSM573758 2 0.5096 0.845 0.004 0.596 0.076 0.000 0.004 NA
#> GSM573708 5 0.0458 0.737 0.016 0.000 0.000 0.000 0.984 NA
#> GSM573709 5 0.0458 0.737 0.016 0.000 0.000 0.000 0.984 NA
#> GSM573710 5 0.0458 0.737 0.016 0.000 0.000 0.000 0.984 NA
#> GSM573711 5 0.0458 0.737 0.016 0.000 0.000 0.000 0.984 NA
#> GSM573712 5 0.0458 0.737 0.016 0.000 0.000 0.000 0.984 NA
#> GSM573713 5 0.0458 0.737 0.016 0.000 0.000 0.000 0.984 NA
#> GSM573717 3 0.4393 0.991 0.016 0.000 0.500 0.004 0.480 NA
#> GSM573718 3 0.4579 0.986 0.016 0.000 0.492 0.012 0.480 NA
#> GSM573719 3 0.4393 0.991 0.016 0.000 0.500 0.004 0.480 NA
#> GSM573714 3 0.4393 0.991 0.016 0.000 0.500 0.004 0.480 NA
#> GSM573715 3 0.4393 0.989 0.016 0.000 0.500 0.004 0.480 NA
#> GSM573716 3 0.4263 0.991 0.016 0.000 0.504 0.000 0.480 NA
#> GSM573780 5 0.1715 0.723 0.016 0.004 0.004 0.008 0.940 NA
#> GSM573781 5 0.1715 0.723 0.016 0.004 0.004 0.008 0.940 NA
#> GSM573782 5 0.1715 0.723 0.016 0.004 0.004 0.008 0.940 NA
#> GSM573705 3 0.4393 0.989 0.016 0.000 0.500 0.004 0.480 NA
#> GSM573706 3 0.4492 0.990 0.016 0.000 0.496 0.008 0.480 NA
#> GSM573707 3 0.4393 0.991 0.016 0.000 0.500 0.004 0.480 NA
#> GSM573702 3 0.4492 0.990 0.016 0.000 0.496 0.008 0.480 NA
#> GSM573703 3 0.4492 0.990 0.016 0.000 0.496 0.008 0.480 NA
#> GSM573704 3 0.4393 0.989 0.016 0.000 0.500 0.004 0.480 NA
#> GSM573783 5 0.6158 -0.710 0.016 0.000 0.376 0.016 0.476 NA
#> GSM573784 5 0.6158 -0.710 0.016 0.000 0.376 0.016 0.476 NA
#> GSM573785 5 0.6235 -0.711 0.016 0.000 0.376 0.024 0.476 NA
#> GSM573744 4 0.1816 0.844 0.048 0.016 0.004 0.928 0.004 NA
#> GSM573745 4 0.1816 0.844 0.048 0.016 0.004 0.928 0.004 NA
#> GSM573746 4 0.1816 0.844 0.048 0.016 0.004 0.928 0.004 NA
#> GSM573747 4 0.1816 0.844 0.048 0.016 0.004 0.928 0.004 NA
#> GSM573748 4 0.1816 0.844 0.048 0.016 0.004 0.928 0.004 NA
#> GSM573749 4 0.1816 0.844 0.048 0.016 0.004 0.928 0.004 NA
#> GSM573753 4 0.6640 0.734 0.048 0.016 0.132 0.496 0.000 NA
#> GSM573754 4 0.6640 0.734 0.048 0.016 0.132 0.496 0.000 NA
#> GSM573755 4 0.6640 0.734 0.048 0.016 0.132 0.496 0.000 NA
#> GSM573750 4 0.6640 0.734 0.048 0.016 0.132 0.496 0.000 NA
#> GSM573751 4 0.6640 0.734 0.048 0.016 0.132 0.496 0.000 NA
#> GSM573752 4 0.6640 0.734 0.048 0.016 0.132 0.496 0.000 NA
#> GSM573795 4 0.6892 0.729 0.048 0.016 0.160 0.488 0.004 NA
#> GSM573796 4 0.6892 0.729 0.048 0.016 0.160 0.488 0.004 NA
#> GSM573797 4 0.6892 0.729 0.048 0.016 0.160 0.488 0.004 NA
#> GSM573741 4 0.1528 0.844 0.048 0.016 0.000 0.936 0.000 NA
#> GSM573742 4 0.1528 0.844 0.048 0.016 0.000 0.936 0.000 NA
#> GSM573743 4 0.1528 0.844 0.048 0.016 0.000 0.936 0.000 NA
#> GSM573738 4 0.1528 0.844 0.048 0.016 0.000 0.936 0.000 NA
#> GSM573739 4 0.1528 0.844 0.048 0.016 0.000 0.936 0.000 NA
#> GSM573740 4 0.1528 0.844 0.048 0.016 0.000 0.936 0.000 NA
#> GSM573792 4 0.2974 0.833 0.048 0.016 0.064 0.868 0.004 NA
#> GSM573793 4 0.2772 0.833 0.048 0.016 0.060 0.876 0.000 NA
#> GSM573794 4 0.2772 0.833 0.048 0.016 0.060 0.876 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)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
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)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
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:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.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")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
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 cell.line(p) agent(p) k
#> SD:kmeans 72 2.32e-16 0.408 2
#> SD:kmeans 96 9.56e-39 0.741 3
#> SD:kmeans 96 9.14e-57 0.975 4
#> SD:kmeans 96 9.14e-57 0.975 5
#> SD:kmeans 93 1.19e-52 0.238 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.
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 46609 rows and 96 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'SD' method.
#> Subgroups are detected by 'skmeans' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 5.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.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:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).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)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 0.495 0.906 0.922 0.5058 0.495 0.495
#> 3 3 0.747 0.874 0.877 0.2498 0.621 0.390
#> 4 4 1.000 1.000 1.000 0.1994 0.874 0.657
#> 5 5 0.970 0.973 0.952 0.0382 0.970 0.878
#> 6 6 0.917 0.883 0.903 0.0352 1.000 1.000
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 5
#> attr(,"optional")
#> [1] 4
There is also optional best \(k\) = 4 that is worth to check.
Following shows the table of the partitions (You need to click the show/hide
code output link to see it). The membership matrix (columns with name p*
)
is inferred by
clue::cl_consensus()
function with the SE
method. Basically the value in the membership matrix
represents the probability to belong to a certain group. The finall class
label for an item is determined with the group with highest probability it
belongs to.
In get_classes()
function, the entropy is calculated from the membership
matrix and the silhouette score is calculated from the consensus matrix.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> GSM573726 1 0.625 0.906 0.844 0.156
#> GSM573727 1 0.625 0.906 0.844 0.156
#> GSM573728 1 0.625 0.906 0.844 0.156
#> GSM573729 1 0.625 0.906 0.844 0.156
#> GSM573730 1 0.625 0.906 0.844 0.156
#> GSM573731 1 0.625 0.906 0.844 0.156
#> GSM573735 1 0.625 0.906 0.844 0.156
#> GSM573736 1 0.625 0.906 0.844 0.156
#> GSM573737 1 0.625 0.906 0.844 0.156
#> GSM573732 1 0.625 0.906 0.844 0.156
#> GSM573733 1 0.625 0.906 0.844 0.156
#> GSM573734 1 0.625 0.906 0.844 0.156
#> GSM573789 1 0.625 0.906 0.844 0.156
#> GSM573790 1 0.625 0.906 0.844 0.156
#> GSM573791 1 0.625 0.906 0.844 0.156
#> GSM573723 1 0.625 0.906 0.844 0.156
#> GSM573724 1 0.625 0.906 0.844 0.156
#> GSM573725 1 0.625 0.906 0.844 0.156
#> GSM573720 1 0.625 0.906 0.844 0.156
#> GSM573721 1 0.625 0.906 0.844 0.156
#> GSM573722 1 0.625 0.906 0.844 0.156
#> GSM573786 1 0.625 0.906 0.844 0.156
#> GSM573787 1 0.625 0.906 0.844 0.156
#> GSM573788 1 0.625 0.906 0.844 0.156
#> GSM573768 2 0.625 0.906 0.156 0.844
#> GSM573769 2 0.625 0.906 0.156 0.844
#> GSM573770 2 0.625 0.906 0.156 0.844
#> GSM573765 2 0.625 0.906 0.156 0.844
#> GSM573766 2 0.625 0.906 0.156 0.844
#> GSM573767 2 0.625 0.906 0.156 0.844
#> GSM573777 2 0.625 0.906 0.156 0.844
#> GSM573778 2 0.625 0.906 0.156 0.844
#> GSM573779 2 0.625 0.906 0.156 0.844
#> GSM573762 2 0.625 0.906 0.156 0.844
#> GSM573763 2 0.625 0.906 0.156 0.844
#> GSM573764 2 0.625 0.906 0.156 0.844
#> GSM573771 2 0.625 0.906 0.156 0.844
#> GSM573772 2 0.625 0.906 0.156 0.844
#> GSM573773 2 0.625 0.906 0.156 0.844
#> GSM573759 2 0.625 0.906 0.156 0.844
#> GSM573760 2 0.625 0.906 0.156 0.844
#> GSM573761 2 0.625 0.906 0.156 0.844
#> GSM573774 2 0.625 0.906 0.156 0.844
#> GSM573775 2 0.625 0.906 0.156 0.844
#> GSM573776 2 0.625 0.906 0.156 0.844
#> GSM573756 2 0.625 0.906 0.156 0.844
#> GSM573757 2 0.625 0.906 0.156 0.844
#> GSM573758 2 0.625 0.906 0.156 0.844
#> GSM573708 1 0.000 0.906 1.000 0.000
#> GSM573709 1 0.000 0.906 1.000 0.000
#> GSM573710 1 0.000 0.906 1.000 0.000
#> GSM573711 1 0.000 0.906 1.000 0.000
#> GSM573712 1 0.000 0.906 1.000 0.000
#> GSM573713 1 0.000 0.906 1.000 0.000
#> GSM573717 1 0.000 0.906 1.000 0.000
#> GSM573718 1 0.000 0.906 1.000 0.000
#> GSM573719 1 0.000 0.906 1.000 0.000
#> GSM573714 1 0.000 0.906 1.000 0.000
#> GSM573715 1 0.000 0.906 1.000 0.000
#> GSM573716 1 0.000 0.906 1.000 0.000
#> GSM573780 1 0.000 0.906 1.000 0.000
#> GSM573781 1 0.000 0.906 1.000 0.000
#> GSM573782 1 0.000 0.906 1.000 0.000
#> GSM573705 1 0.000 0.906 1.000 0.000
#> GSM573706 1 0.000 0.906 1.000 0.000
#> GSM573707 1 0.000 0.906 1.000 0.000
#> GSM573702 1 0.000 0.906 1.000 0.000
#> GSM573703 1 0.000 0.906 1.000 0.000
#> GSM573704 1 0.000 0.906 1.000 0.000
#> GSM573783 1 0.000 0.906 1.000 0.000
#> GSM573784 1 0.000 0.906 1.000 0.000
#> GSM573785 1 0.000 0.906 1.000 0.000
#> GSM573744 2 0.000 0.906 0.000 1.000
#> GSM573745 2 0.000 0.906 0.000 1.000
#> GSM573746 2 0.000 0.906 0.000 1.000
#> GSM573747 2 0.000 0.906 0.000 1.000
#> GSM573748 2 0.000 0.906 0.000 1.000
#> GSM573749 2 0.000 0.906 0.000 1.000
#> GSM573753 2 0.000 0.906 0.000 1.000
#> GSM573754 2 0.000 0.906 0.000 1.000
#> GSM573755 2 0.000 0.906 0.000 1.000
#> GSM573750 2 0.000 0.906 0.000 1.000
#> GSM573751 2 0.000 0.906 0.000 1.000
#> GSM573752 2 0.000 0.906 0.000 1.000
#> GSM573795 2 0.000 0.906 0.000 1.000
#> GSM573796 2 0.000 0.906 0.000 1.000
#> GSM573797 2 0.000 0.906 0.000 1.000
#> GSM573741 2 0.000 0.906 0.000 1.000
#> GSM573742 2 0.000 0.906 0.000 1.000
#> GSM573743 2 0.000 0.906 0.000 1.000
#> GSM573738 2 0.000 0.906 0.000 1.000
#> GSM573739 2 0.000 0.906 0.000 1.000
#> GSM573740 2 0.000 0.906 0.000 1.000
#> GSM573792 2 0.000 0.906 0.000 1.000
#> GSM573793 2 0.000 0.906 0.000 1.000
#> GSM573794 2 0.000 0.906 0.000 1.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM573726 1 0.573 0.718 0.676 0.000 0.324
#> GSM573727 1 0.573 0.718 0.676 0.000 0.324
#> GSM573728 1 0.573 0.718 0.676 0.000 0.324
#> GSM573729 1 0.573 0.718 0.676 0.000 0.324
#> GSM573730 1 0.573 0.718 0.676 0.000 0.324
#> GSM573731 1 0.573 0.718 0.676 0.000 0.324
#> GSM573735 1 0.573 0.718 0.676 0.000 0.324
#> GSM573736 1 0.573 0.718 0.676 0.000 0.324
#> GSM573737 1 0.573 0.718 0.676 0.000 0.324
#> GSM573732 1 0.573 0.718 0.676 0.000 0.324
#> GSM573733 1 0.573 0.718 0.676 0.000 0.324
#> GSM573734 1 0.573 0.718 0.676 0.000 0.324
#> GSM573789 1 0.573 0.718 0.676 0.000 0.324
#> GSM573790 1 0.573 0.718 0.676 0.000 0.324
#> GSM573791 1 0.573 0.718 0.676 0.000 0.324
#> GSM573723 1 0.573 0.718 0.676 0.000 0.324
#> GSM573724 1 0.573 0.718 0.676 0.000 0.324
#> GSM573725 1 0.573 0.718 0.676 0.000 0.324
#> GSM573720 1 0.573 0.718 0.676 0.000 0.324
#> GSM573721 1 0.573 0.718 0.676 0.000 0.324
#> GSM573722 1 0.573 0.718 0.676 0.000 0.324
#> GSM573786 1 0.573 0.718 0.676 0.000 0.324
#> GSM573787 1 0.573 0.718 0.676 0.000 0.324
#> GSM573788 1 0.573 0.718 0.676 0.000 0.324
#> GSM573768 2 0.000 1.000 0.000 1.000 0.000
#> GSM573769 2 0.000 1.000 0.000 1.000 0.000
#> GSM573770 2 0.000 1.000 0.000 1.000 0.000
#> GSM573765 2 0.000 1.000 0.000 1.000 0.000
#> GSM573766 2 0.000 1.000 0.000 1.000 0.000
#> GSM573767 2 0.000 1.000 0.000 1.000 0.000
#> GSM573777 2 0.000 1.000 0.000 1.000 0.000
#> GSM573778 2 0.000 1.000 0.000 1.000 0.000
#> GSM573779 2 0.000 1.000 0.000 1.000 0.000
#> GSM573762 2 0.000 1.000 0.000 1.000 0.000
#> GSM573763 2 0.000 1.000 0.000 1.000 0.000
#> GSM573764 2 0.000 1.000 0.000 1.000 0.000
#> GSM573771 2 0.000 1.000 0.000 1.000 0.000
#> GSM573772 2 0.000 1.000 0.000 1.000 0.000
#> GSM573773 2 0.000 1.000 0.000 1.000 0.000
#> GSM573759 2 0.000 1.000 0.000 1.000 0.000
#> GSM573760 2 0.000 1.000 0.000 1.000 0.000
#> GSM573761 2 0.000 1.000 0.000 1.000 0.000
#> GSM573774 2 0.000 1.000 0.000 1.000 0.000
#> GSM573775 2 0.000 1.000 0.000 1.000 0.000
#> GSM573776 2 0.000 1.000 0.000 1.000 0.000
#> GSM573756 2 0.000 1.000 0.000 1.000 0.000
#> GSM573757 2 0.000 1.000 0.000 1.000 0.000
#> GSM573758 2 0.000 1.000 0.000 1.000 0.000
#> GSM573708 3 0.000 1.000 0.000 0.000 1.000
#> GSM573709 3 0.000 1.000 0.000 0.000 1.000
#> GSM573710 3 0.000 1.000 0.000 0.000 1.000
#> GSM573711 3 0.000 1.000 0.000 0.000 1.000
#> GSM573712 3 0.000 1.000 0.000 0.000 1.000
#> GSM573713 3 0.000 1.000 0.000 0.000 1.000
#> GSM573717 3 0.000 1.000 0.000 0.000 1.000
#> GSM573718 3 0.000 1.000 0.000 0.000 1.000
#> GSM573719 3 0.000 1.000 0.000 0.000 1.000
#> GSM573714 3 0.000 1.000 0.000 0.000 1.000
#> GSM573715 3 0.000 1.000 0.000 0.000 1.000
#> GSM573716 3 0.000 1.000 0.000 0.000 1.000
#> GSM573780 3 0.000 1.000 0.000 0.000 1.000
#> GSM573781 3 0.000 1.000 0.000 0.000 1.000
#> GSM573782 3 0.000 1.000 0.000 0.000 1.000
#> GSM573705 3 0.000 1.000 0.000 0.000 1.000
#> GSM573706 3 0.000 1.000 0.000 0.000 1.000
#> GSM573707 3 0.000 1.000 0.000 0.000 1.000
#> GSM573702 3 0.000 1.000 0.000 0.000 1.000
#> GSM573703 3 0.000 1.000 0.000 0.000 1.000
#> GSM573704 3 0.000 1.000 0.000 0.000 1.000
#> GSM573783 3 0.000 1.000 0.000 0.000 1.000
#> GSM573784 3 0.000 1.000 0.000 0.000 1.000
#> GSM573785 3 0.000 1.000 0.000 0.000 1.000
#> GSM573744 1 0.196 0.778 0.944 0.056 0.000
#> GSM573745 1 0.196 0.778 0.944 0.056 0.000
#> GSM573746 1 0.196 0.778 0.944 0.056 0.000
#> GSM573747 1 0.196 0.778 0.944 0.056 0.000
#> GSM573748 1 0.196 0.778 0.944 0.056 0.000
#> GSM573749 1 0.196 0.778 0.944 0.056 0.000
#> GSM573753 1 0.196 0.778 0.944 0.056 0.000
#> GSM573754 1 0.196 0.778 0.944 0.056 0.000
#> GSM573755 1 0.196 0.778 0.944 0.056 0.000
#> GSM573750 1 0.196 0.778 0.944 0.056 0.000
#> GSM573751 1 0.196 0.778 0.944 0.056 0.000
#> GSM573752 1 0.196 0.778 0.944 0.056 0.000
#> GSM573795 1 0.196 0.778 0.944 0.056 0.000
#> GSM573796 1 0.196 0.778 0.944 0.056 0.000
#> GSM573797 1 0.196 0.778 0.944 0.056 0.000
#> GSM573741 1 0.196 0.778 0.944 0.056 0.000
#> GSM573742 1 0.196 0.778 0.944 0.056 0.000
#> GSM573743 1 0.196 0.778 0.944 0.056 0.000
#> GSM573738 1 0.196 0.778 0.944 0.056 0.000
#> GSM573739 1 0.196 0.778 0.944 0.056 0.000
#> GSM573740 1 0.196 0.778 0.944 0.056 0.000
#> GSM573792 1 0.196 0.778 0.944 0.056 0.000
#> GSM573793 1 0.196 0.778 0.944 0.056 0.000
#> GSM573794 1 0.196 0.778 0.944 0.056 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM573726 1 0 1 1 0 0 0
#> GSM573727 1 0 1 1 0 0 0
#> GSM573728 1 0 1 1 0 0 0
#> GSM573729 1 0 1 1 0 0 0
#> GSM573730 1 0 1 1 0 0 0
#> GSM573731 1 0 1 1 0 0 0
#> GSM573735 1 0 1 1 0 0 0
#> GSM573736 1 0 1 1 0 0 0
#> GSM573737 1 0 1 1 0 0 0
#> GSM573732 1 0 1 1 0 0 0
#> GSM573733 1 0 1 1 0 0 0
#> GSM573734 1 0 1 1 0 0 0
#> GSM573789 1 0 1 1 0 0 0
#> GSM573790 1 0 1 1 0 0 0
#> GSM573791 1 0 1 1 0 0 0
#> GSM573723 1 0 1 1 0 0 0
#> GSM573724 1 0 1 1 0 0 0
#> GSM573725 1 0 1 1 0 0 0
#> GSM573720 1 0 1 1 0 0 0
#> GSM573721 1 0 1 1 0 0 0
#> GSM573722 1 0 1 1 0 0 0
#> GSM573786 1 0 1 1 0 0 0
#> GSM573787 1 0 1 1 0 0 0
#> GSM573788 1 0 1 1 0 0 0
#> GSM573768 2 0 1 0 1 0 0
#> GSM573769 2 0 1 0 1 0 0
#> GSM573770 2 0 1 0 1 0 0
#> GSM573765 2 0 1 0 1 0 0
#> GSM573766 2 0 1 0 1 0 0
#> GSM573767 2 0 1 0 1 0 0
#> GSM573777 2 0 1 0 1 0 0
#> GSM573778 2 0 1 0 1 0 0
#> GSM573779 2 0 1 0 1 0 0
#> GSM573762 2 0 1 0 1 0 0
#> GSM573763 2 0 1 0 1 0 0
#> GSM573764 2 0 1 0 1 0 0
#> GSM573771 2 0 1 0 1 0 0
#> GSM573772 2 0 1 0 1 0 0
#> GSM573773 2 0 1 0 1 0 0
#> GSM573759 2 0 1 0 1 0 0
#> GSM573760 2 0 1 0 1 0 0
#> GSM573761 2 0 1 0 1 0 0
#> GSM573774 2 0 1 0 1 0 0
#> GSM573775 2 0 1 0 1 0 0
#> GSM573776 2 0 1 0 1 0 0
#> GSM573756 2 0 1 0 1 0 0
#> GSM573757 2 0 1 0 1 0 0
#> GSM573758 2 0 1 0 1 0 0
#> GSM573708 3 0 1 0 0 1 0
#> GSM573709 3 0 1 0 0 1 0
#> GSM573710 3 0 1 0 0 1 0
#> GSM573711 3 0 1 0 0 1 0
#> GSM573712 3 0 1 0 0 1 0
#> GSM573713 3 0 1 0 0 1 0
#> GSM573717 3 0 1 0 0 1 0
#> GSM573718 3 0 1 0 0 1 0
#> GSM573719 3 0 1 0 0 1 0
#> GSM573714 3 0 1 0 0 1 0
#> GSM573715 3 0 1 0 0 1 0
#> GSM573716 3 0 1 0 0 1 0
#> GSM573780 3 0 1 0 0 1 0
#> GSM573781 3 0 1 0 0 1 0
#> GSM573782 3 0 1 0 0 1 0
#> GSM573705 3 0 1 0 0 1 0
#> GSM573706 3 0 1 0 0 1 0
#> GSM573707 3 0 1 0 0 1 0
#> GSM573702 3 0 1 0 0 1 0
#> GSM573703 3 0 1 0 0 1 0
#> GSM573704 3 0 1 0 0 1 0
#> GSM573783 3 0 1 0 0 1 0
#> GSM573784 3 0 1 0 0 1 0
#> GSM573785 3 0 1 0 0 1 0
#> GSM573744 4 0 1 0 0 0 1
#> GSM573745 4 0 1 0 0 0 1
#> GSM573746 4 0 1 0 0 0 1
#> GSM573747 4 0 1 0 0 0 1
#> GSM573748 4 0 1 0 0 0 1
#> GSM573749 4 0 1 0 0 0 1
#> GSM573753 4 0 1 0 0 0 1
#> GSM573754 4 0 1 0 0 0 1
#> GSM573755 4 0 1 0 0 0 1
#> GSM573750 4 0 1 0 0 0 1
#> GSM573751 4 0 1 0 0 0 1
#> GSM573752 4 0 1 0 0 0 1
#> GSM573795 4 0 1 0 0 0 1
#> GSM573796 4 0 1 0 0 0 1
#> GSM573797 4 0 1 0 0 0 1
#> GSM573741 4 0 1 0 0 0 1
#> GSM573742 4 0 1 0 0 0 1
#> GSM573743 4 0 1 0 0 0 1
#> GSM573738 4 0 1 0 0 0 1
#> GSM573739 4 0 1 0 0 0 1
#> GSM573740 4 0 1 0 0 0 1
#> GSM573792 4 0 1 0 0 0 1
#> GSM573793 4 0 1 0 0 0 1
#> GSM573794 4 0 1 0 0 0 1
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM573726 1 0.000 0.979 1.000 0.00 0.000 0.000 0.000
#> GSM573727 1 0.000 0.979 1.000 0.00 0.000 0.000 0.000
#> GSM573728 1 0.000 0.979 1.000 0.00 0.000 0.000 0.000
#> GSM573729 1 0.000 0.979 1.000 0.00 0.000 0.000 0.000
#> GSM573730 1 0.000 0.979 1.000 0.00 0.000 0.000 0.000
#> GSM573731 1 0.000 0.979 1.000 0.00 0.000 0.000 0.000
#> GSM573735 1 0.196 0.934 0.904 0.00 0.096 0.000 0.000
#> GSM573736 1 0.196 0.934 0.904 0.00 0.096 0.000 0.000
#> GSM573737 1 0.196 0.934 0.904 0.00 0.096 0.000 0.000
#> GSM573732 1 0.196 0.934 0.904 0.00 0.096 0.000 0.000
#> GSM573733 1 0.196 0.934 0.904 0.00 0.096 0.000 0.000
#> GSM573734 1 0.196 0.934 0.904 0.00 0.096 0.000 0.000
#> GSM573789 1 0.000 0.979 1.000 0.00 0.000 0.000 0.000
#> GSM573790 1 0.000 0.979 1.000 0.00 0.000 0.000 0.000
#> GSM573791 1 0.000 0.979 1.000 0.00 0.000 0.000 0.000
#> GSM573723 1 0.000 0.979 1.000 0.00 0.000 0.000 0.000
#> GSM573724 1 0.000 0.979 1.000 0.00 0.000 0.000 0.000
#> GSM573725 1 0.000 0.979 1.000 0.00 0.000 0.000 0.000
#> GSM573720 1 0.000 0.979 1.000 0.00 0.000 0.000 0.000
#> GSM573721 1 0.000 0.979 1.000 0.00 0.000 0.000 0.000
#> GSM573722 1 0.000 0.979 1.000 0.00 0.000 0.000 0.000
#> GSM573786 1 0.000 0.979 1.000 0.00 0.000 0.000 0.000
#> GSM573787 1 0.000 0.979 1.000 0.00 0.000 0.000 0.000
#> GSM573788 1 0.000 0.979 1.000 0.00 0.000 0.000 0.000
#> GSM573768 2 0.000 0.973 0.000 1.00 0.000 0.000 0.000
#> GSM573769 2 0.000 0.973 0.000 1.00 0.000 0.000 0.000
#> GSM573770 2 0.000 0.973 0.000 1.00 0.000 0.000 0.000
#> GSM573765 2 0.000 0.973 0.000 1.00 0.000 0.000 0.000
#> GSM573766 2 0.000 0.973 0.000 1.00 0.000 0.000 0.000
#> GSM573767 2 0.000 0.973 0.000 1.00 0.000 0.000 0.000
#> GSM573777 2 0.173 0.955 0.000 0.92 0.080 0.000 0.000
#> GSM573778 2 0.173 0.955 0.000 0.92 0.080 0.000 0.000
#> GSM573779 2 0.173 0.955 0.000 0.92 0.080 0.000 0.000
#> GSM573762 2 0.173 0.955 0.000 0.92 0.080 0.000 0.000
#> GSM573763 2 0.173 0.955 0.000 0.92 0.080 0.000 0.000
#> GSM573764 2 0.173 0.955 0.000 0.92 0.080 0.000 0.000
#> GSM573771 2 0.173 0.955 0.000 0.92 0.080 0.000 0.000
#> GSM573772 2 0.173 0.955 0.000 0.92 0.080 0.000 0.000
#> GSM573773 2 0.173 0.955 0.000 0.92 0.080 0.000 0.000
#> GSM573759 2 0.000 0.973 0.000 1.00 0.000 0.000 0.000
#> GSM573760 2 0.000 0.973 0.000 1.00 0.000 0.000 0.000
#> GSM573761 2 0.000 0.973 0.000 1.00 0.000 0.000 0.000
#> GSM573774 2 0.000 0.973 0.000 1.00 0.000 0.000 0.000
#> GSM573775 2 0.000 0.973 0.000 1.00 0.000 0.000 0.000
#> GSM573776 2 0.000 0.973 0.000 1.00 0.000 0.000 0.000
#> GSM573756 2 0.000 0.973 0.000 1.00 0.000 0.000 0.000
#> GSM573757 2 0.000 0.973 0.000 1.00 0.000 0.000 0.000
#> GSM573758 2 0.000 0.973 0.000 1.00 0.000 0.000 0.000
#> GSM573708 5 0.000 1.000 0.000 0.00 0.000 0.000 1.000
#> GSM573709 5 0.000 1.000 0.000 0.00 0.000 0.000 1.000
#> GSM573710 5 0.000 1.000 0.000 0.00 0.000 0.000 1.000
#> GSM573711 5 0.000 1.000 0.000 0.00 0.000 0.000 1.000
#> GSM573712 5 0.000 1.000 0.000 0.00 0.000 0.000 1.000
#> GSM573713 5 0.000 1.000 0.000 0.00 0.000 0.000 1.000
#> GSM573717 3 0.364 1.000 0.000 0.00 0.728 0.000 0.272
#> GSM573718 3 0.364 1.000 0.000 0.00 0.728 0.000 0.272
#> GSM573719 3 0.364 1.000 0.000 0.00 0.728 0.000 0.272
#> GSM573714 3 0.364 1.000 0.000 0.00 0.728 0.000 0.272
#> GSM573715 3 0.364 1.000 0.000 0.00 0.728 0.000 0.272
#> GSM573716 3 0.364 1.000 0.000 0.00 0.728 0.000 0.272
#> GSM573780 5 0.000 1.000 0.000 0.00 0.000 0.000 1.000
#> GSM573781 5 0.000 1.000 0.000 0.00 0.000 0.000 1.000
#> GSM573782 5 0.000 1.000 0.000 0.00 0.000 0.000 1.000
#> GSM573705 3 0.364 1.000 0.000 0.00 0.728 0.000 0.272
#> GSM573706 3 0.364 1.000 0.000 0.00 0.728 0.000 0.272
#> GSM573707 3 0.364 1.000 0.000 0.00 0.728 0.000 0.272
#> GSM573702 3 0.364 1.000 0.000 0.00 0.728 0.000 0.272
#> GSM573703 3 0.364 1.000 0.000 0.00 0.728 0.000 0.272
#> GSM573704 3 0.364 1.000 0.000 0.00 0.728 0.000 0.272
#> GSM573783 3 0.364 1.000 0.000 0.00 0.728 0.000 0.272
#> GSM573784 3 0.364 1.000 0.000 0.00 0.728 0.000 0.272
#> GSM573785 3 0.364 1.000 0.000 0.00 0.728 0.000 0.272
#> GSM573744 4 0.000 0.968 0.000 0.00 0.000 1.000 0.000
#> GSM573745 4 0.000 0.968 0.000 0.00 0.000 1.000 0.000
#> GSM573746 4 0.000 0.968 0.000 0.00 0.000 1.000 0.000
#> GSM573747 4 0.000 0.968 0.000 0.00 0.000 1.000 0.000
#> GSM573748 4 0.000 0.968 0.000 0.00 0.000 1.000 0.000
#> GSM573749 4 0.000 0.968 0.000 0.00 0.000 1.000 0.000
#> GSM573753 4 0.196 0.945 0.000 0.00 0.096 0.904 0.000
#> GSM573754 4 0.196 0.945 0.000 0.00 0.096 0.904 0.000
#> GSM573755 4 0.196 0.945 0.000 0.00 0.096 0.904 0.000
#> GSM573750 4 0.196 0.945 0.000 0.00 0.096 0.904 0.000
#> GSM573751 4 0.196 0.945 0.000 0.00 0.096 0.904 0.000
#> GSM573752 4 0.196 0.945 0.000 0.00 0.096 0.904 0.000
#> GSM573795 4 0.196 0.945 0.000 0.00 0.096 0.904 0.000
#> GSM573796 4 0.196 0.945 0.000 0.00 0.096 0.904 0.000
#> GSM573797 4 0.196 0.945 0.000 0.00 0.096 0.904 0.000
#> GSM573741 4 0.000 0.968 0.000 0.00 0.000 1.000 0.000
#> GSM573742 4 0.000 0.968 0.000 0.00 0.000 1.000 0.000
#> GSM573743 4 0.000 0.968 0.000 0.00 0.000 1.000 0.000
#> GSM573738 4 0.000 0.968 0.000 0.00 0.000 1.000 0.000
#> GSM573739 4 0.000 0.968 0.000 0.00 0.000 1.000 0.000
#> GSM573740 4 0.000 0.968 0.000 0.00 0.000 1.000 0.000
#> GSM573792 4 0.000 0.968 0.000 0.00 0.000 1.000 0.000
#> GSM573793 4 0.000 0.968 0.000 0.00 0.000 1.000 0.000
#> GSM573794 4 0.000 0.968 0.000 0.00 0.000 1.000 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM573726 1 0.000 0.919 1.000 0.000 0.00 0.000 0.000 0.000
#> GSM573727 1 0.000 0.919 1.000 0.000 0.00 0.000 0.000 0.000
#> GSM573728 1 0.000 0.919 1.000 0.000 0.00 0.000 0.000 0.000
#> GSM573729 1 0.000 0.919 1.000 0.000 0.00 0.000 0.000 0.000
#> GSM573730 1 0.000 0.919 1.000 0.000 0.00 0.000 0.000 0.000
#> GSM573731 1 0.000 0.919 1.000 0.000 0.00 0.000 0.000 0.000
#> GSM573735 1 0.441 0.724 0.656 0.000 0.00 0.000 0.052 0.292
#> GSM573736 1 0.441 0.724 0.656 0.000 0.00 0.000 0.052 0.292
#> GSM573737 1 0.441 0.724 0.656 0.000 0.00 0.000 0.052 0.292
#> GSM573732 1 0.441 0.724 0.656 0.000 0.00 0.000 0.052 0.292
#> GSM573733 1 0.441 0.724 0.656 0.000 0.00 0.000 0.052 0.292
#> GSM573734 1 0.441 0.724 0.656 0.000 0.00 0.000 0.052 0.292
#> GSM573789 1 0.000 0.919 1.000 0.000 0.00 0.000 0.000 0.000
#> GSM573790 1 0.000 0.919 1.000 0.000 0.00 0.000 0.000 0.000
#> GSM573791 1 0.000 0.919 1.000 0.000 0.00 0.000 0.000 0.000
#> GSM573723 1 0.000 0.919 1.000 0.000 0.00 0.000 0.000 0.000
#> GSM573724 1 0.000 0.919 1.000 0.000 0.00 0.000 0.000 0.000
#> GSM573725 1 0.000 0.919 1.000 0.000 0.00 0.000 0.000 0.000
#> GSM573720 1 0.000 0.919 1.000 0.000 0.00 0.000 0.000 0.000
#> GSM573721 1 0.000 0.919 1.000 0.000 0.00 0.000 0.000 0.000
#> GSM573722 1 0.000 0.919 1.000 0.000 0.00 0.000 0.000 0.000
#> GSM573786 1 0.000 0.919 1.000 0.000 0.00 0.000 0.000 0.000
#> GSM573787 1 0.000 0.919 1.000 0.000 0.00 0.000 0.000 0.000
#> GSM573788 1 0.000 0.919 1.000 0.000 0.00 0.000 0.000 0.000
#> GSM573768 2 0.000 0.883 0.000 1.000 0.00 0.000 0.000 0.000
#> GSM573769 2 0.000 0.883 0.000 1.000 0.00 0.000 0.000 0.000
#> GSM573770 2 0.000 0.883 0.000 1.000 0.00 0.000 0.000 0.000
#> GSM573765 2 0.026 0.882 0.000 0.992 0.00 0.000 0.000 0.008
#> GSM573766 2 0.026 0.882 0.000 0.992 0.00 0.000 0.000 0.008
#> GSM573767 2 0.026 0.882 0.000 0.992 0.00 0.000 0.000 0.008
#> GSM573777 2 0.405 0.795 0.000 0.676 0.00 0.000 0.028 0.296
#> GSM573778 2 0.405 0.795 0.000 0.676 0.00 0.000 0.028 0.296
#> GSM573779 2 0.405 0.795 0.000 0.676 0.00 0.000 0.028 0.296
#> GSM573762 2 0.405 0.795 0.000 0.676 0.00 0.000 0.028 0.296
#> GSM573763 2 0.405 0.795 0.000 0.676 0.00 0.000 0.028 0.296
#> GSM573764 2 0.405 0.795 0.000 0.676 0.00 0.000 0.028 0.296
#> GSM573771 2 0.405 0.795 0.000 0.676 0.00 0.000 0.028 0.296
#> GSM573772 2 0.405 0.795 0.000 0.676 0.00 0.000 0.028 0.296
#> GSM573773 2 0.405 0.795 0.000 0.676 0.00 0.000 0.028 0.296
#> GSM573759 2 0.000 0.883 0.000 1.000 0.00 0.000 0.000 0.000
#> GSM573760 2 0.000 0.883 0.000 1.000 0.00 0.000 0.000 0.000
#> GSM573761 2 0.000 0.883 0.000 1.000 0.00 0.000 0.000 0.000
#> GSM573774 2 0.000 0.883 0.000 1.000 0.00 0.000 0.000 0.000
#> GSM573775 2 0.000 0.883 0.000 1.000 0.00 0.000 0.000 0.000
#> GSM573776 2 0.000 0.883 0.000 1.000 0.00 0.000 0.000 0.000
#> GSM573756 2 0.000 0.883 0.000 1.000 0.00 0.000 0.000 0.000
#> GSM573757 2 0.000 0.883 0.000 1.000 0.00 0.000 0.000 0.000
#> GSM573758 2 0.000 0.883 0.000 1.000 0.00 0.000 0.000 0.000
#> GSM573708 5 0.156 1.000 0.000 0.000 0.08 0.000 0.920 0.000
#> GSM573709 5 0.156 1.000 0.000 0.000 0.08 0.000 0.920 0.000
#> GSM573710 5 0.156 1.000 0.000 0.000 0.08 0.000 0.920 0.000
#> GSM573711 5 0.156 1.000 0.000 0.000 0.08 0.000 0.920 0.000
#> GSM573712 5 0.156 1.000 0.000 0.000 0.08 0.000 0.920 0.000
#> GSM573713 5 0.156 1.000 0.000 0.000 0.08 0.000 0.920 0.000
#> GSM573717 3 0.000 1.000 0.000 0.000 1.00 0.000 0.000 0.000
#> GSM573718 3 0.000 1.000 0.000 0.000 1.00 0.000 0.000 0.000
#> GSM573719 3 0.000 1.000 0.000 0.000 1.00 0.000 0.000 0.000
#> GSM573714 3 0.000 1.000 0.000 0.000 1.00 0.000 0.000 0.000
#> GSM573715 3 0.000 1.000 0.000 0.000 1.00 0.000 0.000 0.000
#> GSM573716 3 0.000 1.000 0.000 0.000 1.00 0.000 0.000 0.000
#> GSM573780 5 0.156 1.000 0.000 0.000 0.08 0.000 0.920 0.000
#> GSM573781 5 0.156 1.000 0.000 0.000 0.08 0.000 0.920 0.000
#> GSM573782 5 0.156 1.000 0.000 0.000 0.08 0.000 0.920 0.000
#> GSM573705 3 0.000 1.000 0.000 0.000 1.00 0.000 0.000 0.000
#> GSM573706 3 0.000 1.000 0.000 0.000 1.00 0.000 0.000 0.000
#> GSM573707 3 0.000 1.000 0.000 0.000 1.00 0.000 0.000 0.000
#> GSM573702 3 0.000 1.000 0.000 0.000 1.00 0.000 0.000 0.000
#> GSM573703 3 0.000 1.000 0.000 0.000 1.00 0.000 0.000 0.000
#> GSM573704 3 0.000 1.000 0.000 0.000 1.00 0.000 0.000 0.000
#> GSM573783 3 0.000 1.000 0.000 0.000 1.00 0.000 0.000 0.000
#> GSM573784 3 0.000 1.000 0.000 0.000 1.00 0.000 0.000 0.000
#> GSM573785 3 0.000 1.000 0.000 0.000 1.00 0.000 0.000 0.000
#> GSM573744 4 0.000 0.858 0.000 0.000 0.00 1.000 0.000 0.000
#> GSM573745 4 0.000 0.858 0.000 0.000 0.00 1.000 0.000 0.000
#> GSM573746 4 0.000 0.858 0.000 0.000 0.00 1.000 0.000 0.000
#> GSM573747 4 0.000 0.858 0.000 0.000 0.00 1.000 0.000 0.000
#> GSM573748 4 0.000 0.858 0.000 0.000 0.00 1.000 0.000 0.000
#> GSM573749 4 0.000 0.858 0.000 0.000 0.00 1.000 0.000 0.000
#> GSM573753 4 0.372 0.744 0.000 0.000 0.00 0.616 0.000 0.384
#> GSM573754 4 0.372 0.744 0.000 0.000 0.00 0.616 0.000 0.384
#> GSM573755 4 0.372 0.744 0.000 0.000 0.00 0.616 0.000 0.384
#> GSM573750 4 0.372 0.744 0.000 0.000 0.00 0.616 0.000 0.384
#> GSM573751 4 0.372 0.744 0.000 0.000 0.00 0.616 0.000 0.384
#> GSM573752 4 0.372 0.744 0.000 0.000 0.00 0.616 0.000 0.384
#> GSM573795 4 0.378 0.727 0.000 0.000 0.00 0.588 0.000 0.412
#> GSM573796 4 0.378 0.727 0.000 0.000 0.00 0.588 0.000 0.412
#> GSM573797 4 0.378 0.727 0.000 0.000 0.00 0.588 0.000 0.412
#> GSM573741 4 0.000 0.858 0.000 0.000 0.00 1.000 0.000 0.000
#> GSM573742 4 0.000 0.858 0.000 0.000 0.00 1.000 0.000 0.000
#> GSM573743 4 0.000 0.858 0.000 0.000 0.00 1.000 0.000 0.000
#> GSM573738 4 0.000 0.858 0.000 0.000 0.00 1.000 0.000 0.000
#> GSM573739 4 0.000 0.858 0.000 0.000 0.00 1.000 0.000 0.000
#> GSM573740 4 0.000 0.858 0.000 0.000 0.00 1.000 0.000 0.000
#> GSM573792 4 0.000 0.858 0.000 0.000 0.00 1.000 0.000 0.000
#> GSM573793 4 0.000 0.858 0.000 0.000 0.00 1.000 0.000 0.000
#> GSM573794 4 0.000 0.858 0.000 0.000 0.00 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)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
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)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
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:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.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")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
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 cell.line(p) agent(p) k
#> SD:skmeans 96 1.13e-20 0.843 2
#> SD:skmeans 96 9.56e-39 0.741 3
#> SD:skmeans 96 9.14e-57 0.975 4
#> SD:skmeans 96 1.55e-54 0.176 5
#> SD:skmeans 96 1.55e-54 0.176 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.
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 46609 rows and 96 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'SD' method.
#> Subgroups are detected by 'pam' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 6.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.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:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).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)
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.981 0.967 0.984 0.4207 0.591 0.591
#> 3 3 1.000 0.973 0.982 0.5111 0.749 0.586
#> 4 4 1.000 1.000 1.000 0.1926 0.874 0.657
#> 5 5 1.000 1.000 1.000 0.0390 0.970 0.878
#> 6 6 1.000 0.989 0.992 0.0312 0.976 0.889
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 6
#> attr(,"optional")
#> [1] 2 3 4 5
There is also optional best \(k\) = 2 3 4 5 that is worth to check.
Following shows the table of the partitions (You need to click the show/hide
code output link to see it). The membership matrix (columns with name p*
)
is inferred by
clue::cl_consensus()
function with the SE
method. Basically the value in the membership matrix
represents the probability to belong to a certain group. The finall class
label for an item is determined with the group with highest probability it
belongs to.
In get_classes()
function, the entropy is calculated from the membership
matrix and the silhouette score is calculated from the consensus matrix.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> GSM573726 1 0.0000 0.977 1.000 0.000
#> GSM573727 1 0.0000 0.977 1.000 0.000
#> GSM573728 1 0.0000 0.977 1.000 0.000
#> GSM573729 1 0.0000 0.977 1.000 0.000
#> GSM573730 1 0.0000 0.977 1.000 0.000
#> GSM573731 1 0.0000 0.977 1.000 0.000
#> GSM573735 1 0.0000 0.977 1.000 0.000
#> GSM573736 1 0.0000 0.977 1.000 0.000
#> GSM573737 1 0.0000 0.977 1.000 0.000
#> GSM573732 1 0.0000 0.977 1.000 0.000
#> GSM573733 1 0.0000 0.977 1.000 0.000
#> GSM573734 1 0.0000 0.977 1.000 0.000
#> GSM573789 1 0.0000 0.977 1.000 0.000
#> GSM573790 1 0.0000 0.977 1.000 0.000
#> GSM573791 1 0.0000 0.977 1.000 0.000
#> GSM573723 1 0.0000 0.977 1.000 0.000
#> GSM573724 1 0.0000 0.977 1.000 0.000
#> GSM573725 1 0.0000 0.977 1.000 0.000
#> GSM573720 1 0.0000 0.977 1.000 0.000
#> GSM573721 1 0.0000 0.977 1.000 0.000
#> GSM573722 1 0.0000 0.977 1.000 0.000
#> GSM573786 1 0.0000 0.977 1.000 0.000
#> GSM573787 1 0.0000 0.977 1.000 0.000
#> GSM573788 1 0.0000 0.977 1.000 0.000
#> GSM573768 2 0.0000 0.999 0.000 1.000
#> GSM573769 2 0.0000 0.999 0.000 1.000
#> GSM573770 2 0.0000 0.999 0.000 1.000
#> GSM573765 2 0.0000 0.999 0.000 1.000
#> GSM573766 2 0.0000 0.999 0.000 1.000
#> GSM573767 2 0.0000 0.999 0.000 1.000
#> GSM573777 2 0.0000 0.999 0.000 1.000
#> GSM573778 2 0.0000 0.999 0.000 1.000
#> GSM573779 2 0.0000 0.999 0.000 1.000
#> GSM573762 2 0.0000 0.999 0.000 1.000
#> GSM573763 2 0.0000 0.999 0.000 1.000
#> GSM573764 2 0.0000 0.999 0.000 1.000
#> GSM573771 2 0.0000 0.999 0.000 1.000
#> GSM573772 2 0.0000 0.999 0.000 1.000
#> GSM573773 2 0.0000 0.999 0.000 1.000
#> GSM573759 2 0.0000 0.999 0.000 1.000
#> GSM573760 2 0.0000 0.999 0.000 1.000
#> GSM573761 2 0.0000 0.999 0.000 1.000
#> GSM573774 2 0.0000 0.999 0.000 1.000
#> GSM573775 2 0.0000 0.999 0.000 1.000
#> GSM573776 2 0.0000 0.999 0.000 1.000
#> GSM573756 2 0.0000 0.999 0.000 1.000
#> GSM573757 2 0.0000 0.999 0.000 1.000
#> GSM573758 2 0.0000 0.999 0.000 1.000
#> GSM573708 1 0.0672 0.974 0.992 0.008
#> GSM573709 1 0.0000 0.977 1.000 0.000
#> GSM573710 1 0.0000 0.977 1.000 0.000
#> GSM573711 1 0.0000 0.977 1.000 0.000
#> GSM573712 1 0.0000 0.977 1.000 0.000
#> GSM573713 1 0.0000 0.977 1.000 0.000
#> GSM573717 1 0.0000 0.977 1.000 0.000
#> GSM573718 1 0.0000 0.977 1.000 0.000
#> GSM573719 1 0.0000 0.977 1.000 0.000
#> GSM573714 1 0.0000 0.977 1.000 0.000
#> GSM573715 1 0.0000 0.977 1.000 0.000
#> GSM573716 1 0.0000 0.977 1.000 0.000
#> GSM573780 1 0.3733 0.922 0.928 0.072
#> GSM573781 1 0.7299 0.756 0.796 0.204
#> GSM573782 1 0.9686 0.358 0.604 0.396
#> GSM573705 1 0.0000 0.977 1.000 0.000
#> GSM573706 1 0.0000 0.977 1.000 0.000
#> GSM573707 1 0.0000 0.977 1.000 0.000
#> GSM573702 1 0.0000 0.977 1.000 0.000
#> GSM573703 1 0.0000 0.977 1.000 0.000
#> GSM573704 1 0.0000 0.977 1.000 0.000
#> GSM573783 1 0.0000 0.977 1.000 0.000
#> GSM573784 1 0.0000 0.977 1.000 0.000
#> GSM573785 1 0.0000 0.977 1.000 0.000
#> GSM573744 1 0.0938 0.973 0.988 0.012
#> GSM573745 1 0.0938 0.973 0.988 0.012
#> GSM573746 1 0.0938 0.973 0.988 0.012
#> GSM573747 1 0.0938 0.973 0.988 0.012
#> GSM573748 1 0.0938 0.973 0.988 0.012
#> GSM573749 1 0.0938 0.973 0.988 0.012
#> GSM573753 1 0.4815 0.894 0.896 0.104
#> GSM573754 1 0.6438 0.823 0.836 0.164
#> GSM573755 1 0.5178 0.881 0.884 0.116
#> GSM573750 1 0.4562 0.902 0.904 0.096
#> GSM573751 1 0.4690 0.898 0.900 0.100
#> GSM573752 1 0.4431 0.906 0.908 0.092
#> GSM573795 2 0.0938 0.988 0.012 0.988
#> GSM573796 2 0.0376 0.996 0.004 0.996
#> GSM573797 2 0.0376 0.996 0.004 0.996
#> GSM573741 1 0.0938 0.973 0.988 0.012
#> GSM573742 1 0.0938 0.973 0.988 0.012
#> GSM573743 1 0.0938 0.973 0.988 0.012
#> GSM573738 1 0.0938 0.973 0.988 0.012
#> GSM573739 1 0.0938 0.973 0.988 0.012
#> GSM573740 1 0.0938 0.973 0.988 0.012
#> GSM573792 1 0.2043 0.959 0.968 0.032
#> GSM573793 1 0.0938 0.973 0.988 0.012
#> GSM573794 1 0.1184 0.971 0.984 0.016
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM573726 3 0.1411 0.969 0.036 0.000 0.964
#> GSM573727 3 0.1411 0.969 0.036 0.000 0.964
#> GSM573728 3 0.1411 0.969 0.036 0.000 0.964
#> GSM573729 3 0.1411 0.969 0.036 0.000 0.964
#> GSM573730 3 0.1411 0.969 0.036 0.000 0.964
#> GSM573731 3 0.1411 0.969 0.036 0.000 0.964
#> GSM573735 3 0.1411 0.969 0.036 0.000 0.964
#> GSM573736 3 0.1411 0.969 0.036 0.000 0.964
#> GSM573737 3 0.1411 0.969 0.036 0.000 0.964
#> GSM573732 3 0.1411 0.969 0.036 0.000 0.964
#> GSM573733 3 0.1411 0.969 0.036 0.000 0.964
#> GSM573734 3 0.1411 0.969 0.036 0.000 0.964
#> GSM573789 3 0.1411 0.969 0.036 0.000 0.964
#> GSM573790 3 0.1411 0.969 0.036 0.000 0.964
#> GSM573791 3 0.1411 0.969 0.036 0.000 0.964
#> GSM573723 3 0.1411 0.969 0.036 0.000 0.964
#> GSM573724 3 0.1411 0.969 0.036 0.000 0.964
#> GSM573725 3 0.1411 0.969 0.036 0.000 0.964
#> GSM573720 3 0.1411 0.969 0.036 0.000 0.964
#> GSM573721 3 0.1411 0.969 0.036 0.000 0.964
#> GSM573722 3 0.1411 0.969 0.036 0.000 0.964
#> GSM573786 3 0.1411 0.969 0.036 0.000 0.964
#> GSM573787 3 0.1411 0.969 0.036 0.000 0.964
#> GSM573788 3 0.1411 0.969 0.036 0.000 0.964
#> GSM573768 2 0.0000 1.000 0.000 1.000 0.000
#> GSM573769 2 0.0000 1.000 0.000 1.000 0.000
#> GSM573770 2 0.0000 1.000 0.000 1.000 0.000
#> GSM573765 2 0.0000 1.000 0.000 1.000 0.000
#> GSM573766 2 0.0000 1.000 0.000 1.000 0.000
#> GSM573767 2 0.0000 1.000 0.000 1.000 0.000
#> GSM573777 2 0.0000 1.000 0.000 1.000 0.000
#> GSM573778 2 0.0000 1.000 0.000 1.000 0.000
#> GSM573779 2 0.0000 1.000 0.000 1.000 0.000
#> GSM573762 2 0.0000 1.000 0.000 1.000 0.000
#> GSM573763 2 0.0000 1.000 0.000 1.000 0.000
#> GSM573764 2 0.0000 1.000 0.000 1.000 0.000
#> GSM573771 2 0.0000 1.000 0.000 1.000 0.000
#> GSM573772 2 0.0000 1.000 0.000 1.000 0.000
#> GSM573773 2 0.0000 1.000 0.000 1.000 0.000
#> GSM573759 2 0.0000 1.000 0.000 1.000 0.000
#> GSM573760 2 0.0000 1.000 0.000 1.000 0.000
#> GSM573761 2 0.0000 1.000 0.000 1.000 0.000
#> GSM573774 2 0.0000 1.000 0.000 1.000 0.000
#> GSM573775 2 0.0000 1.000 0.000 1.000 0.000
#> GSM573776 2 0.0000 1.000 0.000 1.000 0.000
#> GSM573756 2 0.0000 1.000 0.000 1.000 0.000
#> GSM573757 2 0.0000 1.000 0.000 1.000 0.000
#> GSM573758 2 0.0000 1.000 0.000 1.000 0.000
#> GSM573708 3 0.0237 0.966 0.004 0.000 0.996
#> GSM573709 3 0.0000 0.968 0.000 0.000 1.000
#> GSM573710 3 0.0000 0.968 0.000 0.000 1.000
#> GSM573711 3 0.0000 0.968 0.000 0.000 1.000
#> GSM573712 3 0.0000 0.968 0.000 0.000 1.000
#> GSM573713 3 0.0000 0.968 0.000 0.000 1.000
#> GSM573717 3 0.0000 0.968 0.000 0.000 1.000
#> GSM573718 3 0.0000 0.968 0.000 0.000 1.000
#> GSM573719 3 0.0000 0.968 0.000 0.000 1.000
#> GSM573714 3 0.0000 0.968 0.000 0.000 1.000
#> GSM573715 3 0.0000 0.968 0.000 0.000 1.000
#> GSM573716 3 0.0000 0.968 0.000 0.000 1.000
#> GSM573780 3 0.2682 0.901 0.004 0.076 0.920
#> GSM573781 3 0.4629 0.760 0.004 0.188 0.808
#> GSM573782 3 0.6095 0.356 0.000 0.392 0.608
#> GSM573705 3 0.0000 0.968 0.000 0.000 1.000
#> GSM573706 3 0.0000 0.968 0.000 0.000 1.000
#> GSM573707 3 0.0000 0.968 0.000 0.000 1.000
#> GSM573702 3 0.0000 0.968 0.000 0.000 1.000
#> GSM573703 3 0.0000 0.968 0.000 0.000 1.000
#> GSM573704 3 0.0000 0.968 0.000 0.000 1.000
#> GSM573783 3 0.0000 0.968 0.000 0.000 1.000
#> GSM573784 3 0.0000 0.968 0.000 0.000 1.000
#> GSM573785 3 0.0000 0.968 0.000 0.000 1.000
#> GSM573744 1 0.0237 0.995 0.996 0.004 0.000
#> GSM573745 1 0.0237 0.995 0.996 0.004 0.000
#> GSM573746 1 0.0237 0.995 0.996 0.004 0.000
#> GSM573747 1 0.0237 0.995 0.996 0.004 0.000
#> GSM573748 1 0.0237 0.995 0.996 0.004 0.000
#> GSM573749 1 0.0237 0.995 0.996 0.004 0.000
#> GSM573753 1 0.0237 0.995 0.996 0.004 0.000
#> GSM573754 1 0.0237 0.995 0.996 0.004 0.000
#> GSM573755 1 0.0237 0.995 0.996 0.004 0.000
#> GSM573750 1 0.0237 0.995 0.996 0.004 0.000
#> GSM573751 1 0.0237 0.995 0.996 0.004 0.000
#> GSM573752 1 0.0237 0.995 0.996 0.004 0.000
#> GSM573795 1 0.1289 0.967 0.968 0.032 0.000
#> GSM573796 1 0.1411 0.963 0.964 0.036 0.000
#> GSM573797 1 0.1411 0.963 0.964 0.036 0.000
#> GSM573741 1 0.0237 0.995 0.996 0.004 0.000
#> GSM573742 1 0.0237 0.995 0.996 0.004 0.000
#> GSM573743 1 0.0237 0.995 0.996 0.004 0.000
#> GSM573738 1 0.0237 0.995 0.996 0.004 0.000
#> GSM573739 1 0.0237 0.995 0.996 0.004 0.000
#> GSM573740 1 0.0237 0.995 0.996 0.004 0.000
#> GSM573792 1 0.0237 0.995 0.996 0.004 0.000
#> GSM573793 1 0.0237 0.995 0.996 0.004 0.000
#> GSM573794 1 0.0237 0.995 0.996 0.004 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM573726 1 0 1 1 0 0 0
#> GSM573727 1 0 1 1 0 0 0
#> GSM573728 1 0 1 1 0 0 0
#> GSM573729 1 0 1 1 0 0 0
#> GSM573730 1 0 1 1 0 0 0
#> GSM573731 1 0 1 1 0 0 0
#> GSM573735 1 0 1 1 0 0 0
#> GSM573736 1 0 1 1 0 0 0
#> GSM573737 1 0 1 1 0 0 0
#> GSM573732 1 0 1 1 0 0 0
#> GSM573733 1 0 1 1 0 0 0
#> GSM573734 1 0 1 1 0 0 0
#> GSM573789 1 0 1 1 0 0 0
#> GSM573790 1 0 1 1 0 0 0
#> GSM573791 1 0 1 1 0 0 0
#> GSM573723 1 0 1 1 0 0 0
#> GSM573724 1 0 1 1 0 0 0
#> GSM573725 1 0 1 1 0 0 0
#> GSM573720 1 0 1 1 0 0 0
#> GSM573721 1 0 1 1 0 0 0
#> GSM573722 1 0 1 1 0 0 0
#> GSM573786 1 0 1 1 0 0 0
#> GSM573787 1 0 1 1 0 0 0
#> GSM573788 1 0 1 1 0 0 0
#> GSM573768 2 0 1 0 1 0 0
#> GSM573769 2 0 1 0 1 0 0
#> GSM573770 2 0 1 0 1 0 0
#> GSM573765 2 0 1 0 1 0 0
#> GSM573766 2 0 1 0 1 0 0
#> GSM573767 2 0 1 0 1 0 0
#> GSM573777 2 0 1 0 1 0 0
#> GSM573778 2 0 1 0 1 0 0
#> GSM573779 2 0 1 0 1 0 0
#> GSM573762 2 0 1 0 1 0 0
#> GSM573763 2 0 1 0 1 0 0
#> GSM573764 2 0 1 0 1 0 0
#> GSM573771 2 0 1 0 1 0 0
#> GSM573772 2 0 1 0 1 0 0
#> GSM573773 2 0 1 0 1 0 0
#> GSM573759 2 0 1 0 1 0 0
#> GSM573760 2 0 1 0 1 0 0
#> GSM573761 2 0 1 0 1 0 0
#> GSM573774 2 0 1 0 1 0 0
#> GSM573775 2 0 1 0 1 0 0
#> GSM573776 2 0 1 0 1 0 0
#> GSM573756 2 0 1 0 1 0 0
#> GSM573757 2 0 1 0 1 0 0
#> GSM573758 2 0 1 0 1 0 0
#> GSM573708 3 0 1 0 0 1 0
#> GSM573709 3 0 1 0 0 1 0
#> GSM573710 3 0 1 0 0 1 0
#> GSM573711 3 0 1 0 0 1 0
#> GSM573712 3 0 1 0 0 1 0
#> GSM573713 3 0 1 0 0 1 0
#> GSM573717 3 0 1 0 0 1 0
#> GSM573718 3 0 1 0 0 1 0
#> GSM573719 3 0 1 0 0 1 0
#> GSM573714 3 0 1 0 0 1 0
#> GSM573715 3 0 1 0 0 1 0
#> GSM573716 3 0 1 0 0 1 0
#> GSM573780 3 0 1 0 0 1 0
#> GSM573781 3 0 1 0 0 1 0
#> GSM573782 3 0 1 0 0 1 0
#> GSM573705 3 0 1 0 0 1 0
#> GSM573706 3 0 1 0 0 1 0
#> GSM573707 3 0 1 0 0 1 0
#> GSM573702 3 0 1 0 0 1 0
#> GSM573703 3 0 1 0 0 1 0
#> GSM573704 3 0 1 0 0 1 0
#> GSM573783 3 0 1 0 0 1 0
#> GSM573784 3 0 1 0 0 1 0
#> GSM573785 3 0 1 0 0 1 0
#> GSM573744 4 0 1 0 0 0 1
#> GSM573745 4 0 1 0 0 0 1
#> GSM573746 4 0 1 0 0 0 1
#> GSM573747 4 0 1 0 0 0 1
#> GSM573748 4 0 1 0 0 0 1
#> GSM573749 4 0 1 0 0 0 1
#> GSM573753 4 0 1 0 0 0 1
#> GSM573754 4 0 1 0 0 0 1
#> GSM573755 4 0 1 0 0 0 1
#> GSM573750 4 0 1 0 0 0 1
#> GSM573751 4 0 1 0 0 0 1
#> GSM573752 4 0 1 0 0 0 1
#> GSM573795 4 0 1 0 0 0 1
#> GSM573796 4 0 1 0 0 0 1
#> GSM573797 4 0 1 0 0 0 1
#> GSM573741 4 0 1 0 0 0 1
#> GSM573742 4 0 1 0 0 0 1
#> GSM573743 4 0 1 0 0 0 1
#> GSM573738 4 0 1 0 0 0 1
#> GSM573739 4 0 1 0 0 0 1
#> GSM573740 4 0 1 0 0 0 1
#> GSM573792 4 0 1 0 0 0 1
#> GSM573793 4 0 1 0 0 0 1
#> GSM573794 4 0 1 0 0 0 1
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM573726 1 0 1 1 0 0 0 0
#> GSM573727 1 0 1 1 0 0 0 0
#> GSM573728 1 0 1 1 0 0 0 0
#> GSM573729 1 0 1 1 0 0 0 0
#> GSM573730 1 0 1 1 0 0 0 0
#> GSM573731 1 0 1 1 0 0 0 0
#> GSM573735 1 0 1 1 0 0 0 0
#> GSM573736 1 0 1 1 0 0 0 0
#> GSM573737 1 0 1 1 0 0 0 0
#> GSM573732 1 0 1 1 0 0 0 0
#> GSM573733 1 0 1 1 0 0 0 0
#> GSM573734 1 0 1 1 0 0 0 0
#> GSM573789 1 0 1 1 0 0 0 0
#> GSM573790 1 0 1 1 0 0 0 0
#> GSM573791 1 0 1 1 0 0 0 0
#> GSM573723 1 0 1 1 0 0 0 0
#> GSM573724 1 0 1 1 0 0 0 0
#> GSM573725 1 0 1 1 0 0 0 0
#> GSM573720 1 0 1 1 0 0 0 0
#> GSM573721 1 0 1 1 0 0 0 0
#> GSM573722 1 0 1 1 0 0 0 0
#> GSM573786 1 0 1 1 0 0 0 0
#> GSM573787 1 0 1 1 0 0 0 0
#> GSM573788 1 0 1 1 0 0 0 0
#> GSM573768 2 0 1 0 1 0 0 0
#> GSM573769 2 0 1 0 1 0 0 0
#> GSM573770 2 0 1 0 1 0 0 0
#> GSM573765 2 0 1 0 1 0 0 0
#> GSM573766 2 0 1 0 1 0 0 0
#> GSM573767 2 0 1 0 1 0 0 0
#> GSM573777 2 0 1 0 1 0 0 0
#> GSM573778 2 0 1 0 1 0 0 0
#> GSM573779 2 0 1 0 1 0 0 0
#> GSM573762 2 0 1 0 1 0 0 0
#> GSM573763 2 0 1 0 1 0 0 0
#> GSM573764 2 0 1 0 1 0 0 0
#> GSM573771 2 0 1 0 1 0 0 0
#> GSM573772 2 0 1 0 1 0 0 0
#> GSM573773 2 0 1 0 1 0 0 0
#> GSM573759 2 0 1 0 1 0 0 0
#> GSM573760 2 0 1 0 1 0 0 0
#> GSM573761 2 0 1 0 1 0 0 0
#> GSM573774 2 0 1 0 1 0 0 0
#> GSM573775 2 0 1 0 1 0 0 0
#> GSM573776 2 0 1 0 1 0 0 0
#> GSM573756 2 0 1 0 1 0 0 0
#> GSM573757 2 0 1 0 1 0 0 0
#> GSM573758 2 0 1 0 1 0 0 0
#> GSM573708 5 0 1 0 0 0 0 1
#> GSM573709 5 0 1 0 0 0 0 1
#> GSM573710 5 0 1 0 0 0 0 1
#> GSM573711 5 0 1 0 0 0 0 1
#> GSM573712 5 0 1 0 0 0 0 1
#> GSM573713 5 0 1 0 0 0 0 1
#> GSM573717 3 0 1 0 0 1 0 0
#> GSM573718 3 0 1 0 0 1 0 0
#> GSM573719 3 0 1 0 0 1 0 0
#> GSM573714 3 0 1 0 0 1 0 0
#> GSM573715 3 0 1 0 0 1 0 0
#> GSM573716 3 0 1 0 0 1 0 0
#> GSM573780 5 0 1 0 0 0 0 1
#> GSM573781 5 0 1 0 0 0 0 1
#> GSM573782 5 0 1 0 0 0 0 1
#> GSM573705 3 0 1 0 0 1 0 0
#> GSM573706 3 0 1 0 0 1 0 0
#> GSM573707 3 0 1 0 0 1 0 0
#> GSM573702 3 0 1 0 0 1 0 0
#> GSM573703 3 0 1 0 0 1 0 0
#> GSM573704 3 0 1 0 0 1 0 0
#> GSM573783 3 0 1 0 0 1 0 0
#> GSM573784 3 0 1 0 0 1 0 0
#> GSM573785 3 0 1 0 0 1 0 0
#> GSM573744 4 0 1 0 0 0 1 0
#> GSM573745 4 0 1 0 0 0 1 0
#> GSM573746 4 0 1 0 0 0 1 0
#> GSM573747 4 0 1 0 0 0 1 0
#> GSM573748 4 0 1 0 0 0 1 0
#> GSM573749 4 0 1 0 0 0 1 0
#> GSM573753 4 0 1 0 0 0 1 0
#> GSM573754 4 0 1 0 0 0 1 0
#> GSM573755 4 0 1 0 0 0 1 0
#> GSM573750 4 0 1 0 0 0 1 0
#> GSM573751 4 0 1 0 0 0 1 0
#> GSM573752 4 0 1 0 0 0 1 0
#> GSM573795 4 0 1 0 0 0 1 0
#> GSM573796 4 0 1 0 0 0 1 0
#> GSM573797 4 0 1 0 0 0 1 0
#> GSM573741 4 0 1 0 0 0 1 0
#> GSM573742 4 0 1 0 0 0 1 0
#> GSM573743 4 0 1 0 0 0 1 0
#> GSM573738 4 0 1 0 0 0 1 0
#> GSM573739 4 0 1 0 0 0 1 0
#> GSM573740 4 0 1 0 0 0 1 0
#> GSM573792 4 0 1 0 0 0 1 0
#> GSM573793 4 0 1 0 0 0 1 0
#> GSM573794 4 0 1 0 0 0 1 0
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM573726 1 0.0000 0.981 1.000 0.000 0 0.000 0 0.000
#> GSM573727 1 0.0000 0.981 1.000 0.000 0 0.000 0 0.000
#> GSM573728 1 0.0000 0.981 1.000 0.000 0 0.000 0 0.000
#> GSM573729 1 0.0000 0.981 1.000 0.000 0 0.000 0 0.000
#> GSM573730 1 0.0000 0.981 1.000 0.000 0 0.000 0 0.000
#> GSM573731 1 0.0000 0.981 1.000 0.000 0 0.000 0 0.000
#> GSM573735 6 0.0790 1.000 0.032 0.000 0 0.000 0 0.968
#> GSM573736 6 0.0790 1.000 0.032 0.000 0 0.000 0 0.968
#> GSM573737 6 0.0790 1.000 0.032 0.000 0 0.000 0 0.968
#> GSM573732 6 0.0790 1.000 0.032 0.000 0 0.000 0 0.968
#> GSM573733 6 0.0790 1.000 0.032 0.000 0 0.000 0 0.968
#> GSM573734 6 0.0790 1.000 0.032 0.000 0 0.000 0 0.968
#> GSM573789 1 0.0458 0.968 0.984 0.000 0 0.000 0 0.016
#> GSM573790 1 0.0547 0.965 0.980 0.000 0 0.000 0 0.020
#> GSM573791 1 0.3309 0.600 0.720 0.000 0 0.000 0 0.280
#> GSM573723 1 0.0000 0.981 1.000 0.000 0 0.000 0 0.000
#> GSM573724 1 0.0000 0.981 1.000 0.000 0 0.000 0 0.000
#> GSM573725 1 0.0000 0.981 1.000 0.000 0 0.000 0 0.000
#> GSM573720 1 0.0000 0.981 1.000 0.000 0 0.000 0 0.000
#> GSM573721 1 0.0000 0.981 1.000 0.000 0 0.000 0 0.000
#> GSM573722 1 0.0000 0.981 1.000 0.000 0 0.000 0 0.000
#> GSM573786 1 0.0000 0.981 1.000 0.000 0 0.000 0 0.000
#> GSM573787 1 0.0000 0.981 1.000 0.000 0 0.000 0 0.000
#> GSM573788 1 0.0000 0.981 1.000 0.000 0 0.000 0 0.000
#> GSM573768 2 0.0000 0.990 0.000 1.000 0 0.000 0 0.000
#> GSM573769 2 0.0000 0.990 0.000 1.000 0 0.000 0 0.000
#> GSM573770 2 0.0000 0.990 0.000 1.000 0 0.000 0 0.000
#> GSM573765 2 0.0000 0.990 0.000 1.000 0 0.000 0 0.000
#> GSM573766 2 0.0000 0.990 0.000 1.000 0 0.000 0 0.000
#> GSM573767 2 0.0000 0.990 0.000 1.000 0 0.000 0 0.000
#> GSM573777 2 0.0713 0.983 0.000 0.972 0 0.000 0 0.028
#> GSM573778 2 0.0713 0.983 0.000 0.972 0 0.000 0 0.028
#> GSM573779 2 0.0713 0.983 0.000 0.972 0 0.000 0 0.028
#> GSM573762 2 0.0713 0.983 0.000 0.972 0 0.000 0 0.028
#> GSM573763 2 0.0713 0.983 0.000 0.972 0 0.000 0 0.028
#> GSM573764 2 0.0713 0.983 0.000 0.972 0 0.000 0 0.028
#> GSM573771 2 0.0713 0.983 0.000 0.972 0 0.000 0 0.028
#> GSM573772 2 0.0713 0.983 0.000 0.972 0 0.000 0 0.028
#> GSM573773 2 0.0713 0.983 0.000 0.972 0 0.000 0 0.028
#> GSM573759 2 0.0000 0.990 0.000 1.000 0 0.000 0 0.000
#> GSM573760 2 0.0000 0.990 0.000 1.000 0 0.000 0 0.000
#> GSM573761 2 0.0000 0.990 0.000 1.000 0 0.000 0 0.000
#> GSM573774 2 0.0000 0.990 0.000 1.000 0 0.000 0 0.000
#> GSM573775 2 0.0000 0.990 0.000 1.000 0 0.000 0 0.000
#> GSM573776 2 0.0000 0.990 0.000 1.000 0 0.000 0 0.000
#> GSM573756 2 0.0000 0.990 0.000 1.000 0 0.000 0 0.000
#> GSM573757 2 0.0000 0.990 0.000 1.000 0 0.000 0 0.000
#> GSM573758 2 0.0000 0.990 0.000 1.000 0 0.000 0 0.000
#> GSM573708 5 0.0000 1.000 0.000 0.000 0 0.000 1 0.000
#> GSM573709 5 0.0000 1.000 0.000 0.000 0 0.000 1 0.000
#> GSM573710 5 0.0000 1.000 0.000 0.000 0 0.000 1 0.000
#> GSM573711 5 0.0000 1.000 0.000 0.000 0 0.000 1 0.000
#> GSM573712 5 0.0000 1.000 0.000 0.000 0 0.000 1 0.000
#> GSM573713 5 0.0000 1.000 0.000 0.000 0 0.000 1 0.000
#> GSM573717 3 0.0000 1.000 0.000 0.000 1 0.000 0 0.000
#> GSM573718 3 0.0000 1.000 0.000 0.000 1 0.000 0 0.000
#> GSM573719 3 0.0000 1.000 0.000 0.000 1 0.000 0 0.000
#> GSM573714 3 0.0000 1.000 0.000 0.000 1 0.000 0 0.000
#> GSM573715 3 0.0000 1.000 0.000 0.000 1 0.000 0 0.000
#> GSM573716 3 0.0000 1.000 0.000 0.000 1 0.000 0 0.000
#> GSM573780 5 0.0000 1.000 0.000 0.000 0 0.000 1 0.000
#> GSM573781 5 0.0000 1.000 0.000 0.000 0 0.000 1 0.000
#> GSM573782 5 0.0000 1.000 0.000 0.000 0 0.000 1 0.000
#> GSM573705 3 0.0000 1.000 0.000 0.000 1 0.000 0 0.000
#> GSM573706 3 0.0000 1.000 0.000 0.000 1 0.000 0 0.000
#> GSM573707 3 0.0000 1.000 0.000 0.000 1 0.000 0 0.000
#> GSM573702 3 0.0000 1.000 0.000 0.000 1 0.000 0 0.000
#> GSM573703 3 0.0000 1.000 0.000 0.000 1 0.000 0 0.000
#> GSM573704 3 0.0000 1.000 0.000 0.000 1 0.000 0 0.000
#> GSM573783 3 0.0000 1.000 0.000 0.000 1 0.000 0 0.000
#> GSM573784 3 0.0000 1.000 0.000 0.000 1 0.000 0 0.000
#> GSM573785 3 0.0000 1.000 0.000 0.000 1 0.000 0 0.000
#> GSM573744 4 0.0000 0.999 0.000 0.000 0 1.000 0 0.000
#> GSM573745 4 0.0000 0.999 0.000 0.000 0 1.000 0 0.000
#> GSM573746 4 0.0000 0.999 0.000 0.000 0 1.000 0 0.000
#> GSM573747 4 0.0000 0.999 0.000 0.000 0 1.000 0 0.000
#> GSM573748 4 0.0000 0.999 0.000 0.000 0 1.000 0 0.000
#> GSM573749 4 0.0000 0.999 0.000 0.000 0 1.000 0 0.000
#> GSM573753 4 0.0146 0.998 0.000 0.000 0 0.996 0 0.004
#> GSM573754 4 0.0146 0.998 0.000 0.000 0 0.996 0 0.004
#> GSM573755 4 0.0146 0.998 0.000 0.000 0 0.996 0 0.004
#> GSM573750 4 0.0146 0.998 0.000 0.000 0 0.996 0 0.004
#> GSM573751 4 0.0146 0.998 0.000 0.000 0 0.996 0 0.004
#> GSM573752 4 0.0146 0.998 0.000 0.000 0 0.996 0 0.004
#> GSM573795 4 0.0146 0.998 0.000 0.000 0 0.996 0 0.004
#> GSM573796 4 0.0146 0.998 0.000 0.000 0 0.996 0 0.004
#> GSM573797 4 0.0146 0.998 0.000 0.000 0 0.996 0 0.004
#> GSM573741 4 0.0000 0.999 0.000 0.000 0 1.000 0 0.000
#> GSM573742 4 0.0000 0.999 0.000 0.000 0 1.000 0 0.000
#> GSM573743 4 0.0000 0.999 0.000 0.000 0 1.000 0 0.000
#> GSM573738 4 0.0000 0.999 0.000 0.000 0 1.000 0 0.000
#> GSM573739 4 0.0000 0.999 0.000 0.000 0 1.000 0 0.000
#> GSM573740 4 0.0000 0.999 0.000 0.000 0 1.000 0 0.000
#> GSM573792 4 0.0000 0.999 0.000 0.000 0 1.000 0 0.000
#> GSM573793 4 0.0000 0.999 0.000 0.000 0 1.000 0 0.000
#> GSM573794 4 0.0000 0.999 0.000 0.000 0 1.000 0 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)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
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)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
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:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.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")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
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 cell.line(p) agent(p) k
#> SD:pam 95 1.09e-17 0.05770 2
#> SD:pam 95 2.54e-38 0.74031 3
#> SD:pam 96 9.14e-57 0.97496 4
#> SD:pam 96 1.55e-54 0.17576 5
#> SD:pam 96 1.73e-52 0.00665 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.
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 46609 rows and 96 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'SD' method.
#> Subgroups are detected by 'mclust' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 4.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.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:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).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)
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.621 0.936 0.941 0.48426 0.495 0.495
#> 3 3 0.621 0.682 0.635 0.30523 0.621 0.390
#> 4 4 1.000 1.000 1.000 0.19944 0.874 0.657
#> 5 5 0.957 0.950 0.950 0.02388 1.000 1.000
#> 6 6 0.921 0.939 0.939 0.00584 1.000 1.000
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 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.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> GSM573726 1 0.1633 0.983 0.976 0.024
#> GSM573727 1 0.1633 0.983 0.976 0.024
#> GSM573728 1 0.1633 0.983 0.976 0.024
#> GSM573729 1 0.1633 0.983 0.976 0.024
#> GSM573730 1 0.1633 0.983 0.976 0.024
#> GSM573731 1 0.1633 0.983 0.976 0.024
#> GSM573735 1 0.1633 0.983 0.976 0.024
#> GSM573736 1 0.1633 0.983 0.976 0.024
#> GSM573737 1 0.1633 0.983 0.976 0.024
#> GSM573732 1 0.1633 0.983 0.976 0.024
#> GSM573733 1 0.1633 0.983 0.976 0.024
#> GSM573734 1 0.1633 0.983 0.976 0.024
#> GSM573789 1 0.1633 0.983 0.976 0.024
#> GSM573790 1 0.1633 0.983 0.976 0.024
#> GSM573791 1 0.1633 0.983 0.976 0.024
#> GSM573723 1 0.1633 0.983 0.976 0.024
#> GSM573724 1 0.1633 0.983 0.976 0.024
#> GSM573725 1 0.1633 0.983 0.976 0.024
#> GSM573720 1 0.1633 0.983 0.976 0.024
#> GSM573721 1 0.1633 0.983 0.976 0.024
#> GSM573722 1 0.1633 0.983 0.976 0.024
#> GSM573786 1 0.1633 0.983 0.976 0.024
#> GSM573787 1 0.1633 0.983 0.976 0.024
#> GSM573788 1 0.1633 0.983 0.976 0.024
#> GSM573768 2 0.0000 0.894 0.000 1.000
#> GSM573769 2 0.0000 0.894 0.000 1.000
#> GSM573770 2 0.0000 0.894 0.000 1.000
#> GSM573765 2 0.0000 0.894 0.000 1.000
#> GSM573766 2 0.0000 0.894 0.000 1.000
#> GSM573767 2 0.0000 0.894 0.000 1.000
#> GSM573777 2 0.0000 0.894 0.000 1.000
#> GSM573778 2 0.0000 0.894 0.000 1.000
#> GSM573779 2 0.0000 0.894 0.000 1.000
#> GSM573762 2 0.0000 0.894 0.000 1.000
#> GSM573763 2 0.0000 0.894 0.000 1.000
#> GSM573764 2 0.0000 0.894 0.000 1.000
#> GSM573771 2 0.0000 0.894 0.000 1.000
#> GSM573772 2 0.0000 0.894 0.000 1.000
#> GSM573773 2 0.0000 0.894 0.000 1.000
#> GSM573759 2 0.0000 0.894 0.000 1.000
#> GSM573760 2 0.0000 0.894 0.000 1.000
#> GSM573761 2 0.0000 0.894 0.000 1.000
#> GSM573774 2 0.0000 0.894 0.000 1.000
#> GSM573775 2 0.0000 0.894 0.000 1.000
#> GSM573776 2 0.0000 0.894 0.000 1.000
#> GSM573756 2 0.0000 0.894 0.000 1.000
#> GSM573757 2 0.0000 0.894 0.000 1.000
#> GSM573758 2 0.0000 0.894 0.000 1.000
#> GSM573708 1 0.0938 0.983 0.988 0.012
#> GSM573709 1 0.0938 0.983 0.988 0.012
#> GSM573710 1 0.0938 0.983 0.988 0.012
#> GSM573711 1 0.0938 0.983 0.988 0.012
#> GSM573712 1 0.0938 0.983 0.988 0.012
#> GSM573713 1 0.0938 0.983 0.988 0.012
#> GSM573717 1 0.0938 0.983 0.988 0.012
#> GSM573718 1 0.0938 0.983 0.988 0.012
#> GSM573719 1 0.0938 0.983 0.988 0.012
#> GSM573714 1 0.0938 0.983 0.988 0.012
#> GSM573715 1 0.0938 0.983 0.988 0.012
#> GSM573716 1 0.0938 0.983 0.988 0.012
#> GSM573780 1 0.0938 0.983 0.988 0.012
#> GSM573781 1 0.0938 0.983 0.988 0.012
#> GSM573782 1 0.0938 0.983 0.988 0.012
#> GSM573705 1 0.0938 0.983 0.988 0.012
#> GSM573706 1 0.0938 0.983 0.988 0.012
#> GSM573707 1 0.0938 0.983 0.988 0.012
#> GSM573702 1 0.0938 0.983 0.988 0.012
#> GSM573703 1 0.0938 0.983 0.988 0.012
#> GSM573704 1 0.0938 0.983 0.988 0.012
#> GSM573783 1 0.0938 0.983 0.988 0.012
#> GSM573784 1 0.0938 0.983 0.988 0.012
#> GSM573785 1 0.0938 0.983 0.988 0.012
#> GSM573744 2 0.7219 0.881 0.200 0.800
#> GSM573745 2 0.7219 0.881 0.200 0.800
#> GSM573746 2 0.7219 0.881 0.200 0.800
#> GSM573747 2 0.7219 0.881 0.200 0.800
#> GSM573748 2 0.7219 0.881 0.200 0.800
#> GSM573749 2 0.7219 0.881 0.200 0.800
#> GSM573753 2 0.7219 0.881 0.200 0.800
#> GSM573754 2 0.7219 0.881 0.200 0.800
#> GSM573755 2 0.7219 0.881 0.200 0.800
#> GSM573750 2 0.7219 0.881 0.200 0.800
#> GSM573751 2 0.7219 0.881 0.200 0.800
#> GSM573752 2 0.7219 0.881 0.200 0.800
#> GSM573795 2 0.7219 0.881 0.200 0.800
#> GSM573796 2 0.7219 0.881 0.200 0.800
#> GSM573797 2 0.7219 0.881 0.200 0.800
#> GSM573741 2 0.7219 0.881 0.200 0.800
#> GSM573742 2 0.7219 0.881 0.200 0.800
#> GSM573743 2 0.7219 0.881 0.200 0.800
#> GSM573738 2 0.7219 0.881 0.200 0.800
#> GSM573739 2 0.7219 0.881 0.200 0.800
#> GSM573740 2 0.7219 0.881 0.200 0.800
#> GSM573792 2 0.7219 0.881 0.200 0.800
#> GSM573793 2 0.7219 0.881 0.200 0.800
#> GSM573794 2 0.7219 0.881 0.200 0.800
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM573726 1 0.628 1.000 0.54 0.00 0.46
#> GSM573727 1 0.628 1.000 0.54 0.00 0.46
#> GSM573728 1 0.628 1.000 0.54 0.00 0.46
#> GSM573729 1 0.628 1.000 0.54 0.00 0.46
#> GSM573730 1 0.628 1.000 0.54 0.00 0.46
#> GSM573731 1 0.628 1.000 0.54 0.00 0.46
#> GSM573735 1 0.628 1.000 0.54 0.00 0.46
#> GSM573736 1 0.628 1.000 0.54 0.00 0.46
#> GSM573737 1 0.628 1.000 0.54 0.00 0.46
#> GSM573732 1 0.628 1.000 0.54 0.00 0.46
#> GSM573733 1 0.628 1.000 0.54 0.00 0.46
#> GSM573734 1 0.628 1.000 0.54 0.00 0.46
#> GSM573789 1 0.628 1.000 0.54 0.00 0.46
#> GSM573790 1 0.628 1.000 0.54 0.00 0.46
#> GSM573791 1 0.628 1.000 0.54 0.00 0.46
#> GSM573723 1 0.628 1.000 0.54 0.00 0.46
#> GSM573724 1 0.628 1.000 0.54 0.00 0.46
#> GSM573725 1 0.628 1.000 0.54 0.00 0.46
#> GSM573720 1 0.628 1.000 0.54 0.00 0.46
#> GSM573721 1 0.628 1.000 0.54 0.00 0.46
#> GSM573722 1 0.628 1.000 0.54 0.00 0.46
#> GSM573786 1 0.628 1.000 0.54 0.00 0.46
#> GSM573787 1 0.628 1.000 0.54 0.00 0.46
#> GSM573788 1 0.628 1.000 0.54 0.00 0.46
#> GSM573768 2 0.628 0.500 0.46 0.54 0.00
#> GSM573769 2 0.628 0.500 0.46 0.54 0.00
#> GSM573770 2 0.628 0.500 0.46 0.54 0.00
#> GSM573765 2 0.628 0.500 0.46 0.54 0.00
#> GSM573766 2 0.628 0.500 0.46 0.54 0.00
#> GSM573767 2 0.628 0.500 0.46 0.54 0.00
#> GSM573777 2 0.628 0.500 0.46 0.54 0.00
#> GSM573778 2 0.628 0.500 0.46 0.54 0.00
#> GSM573779 2 0.628 0.500 0.46 0.54 0.00
#> GSM573762 2 0.628 0.500 0.46 0.54 0.00
#> GSM573763 2 0.628 0.500 0.46 0.54 0.00
#> GSM573764 2 0.628 0.500 0.46 0.54 0.00
#> GSM573771 2 0.628 0.500 0.46 0.54 0.00
#> GSM573772 2 0.628 0.500 0.46 0.54 0.00
#> GSM573773 2 0.628 0.500 0.46 0.54 0.00
#> GSM573759 2 0.628 0.500 0.46 0.54 0.00
#> GSM573760 2 0.628 0.500 0.46 0.54 0.00
#> GSM573761 2 0.628 0.500 0.46 0.54 0.00
#> GSM573774 2 0.628 0.500 0.46 0.54 0.00
#> GSM573775 2 0.628 0.500 0.46 0.54 0.00
#> GSM573776 2 0.628 0.500 0.46 0.54 0.00
#> GSM573756 2 0.628 0.500 0.46 0.54 0.00
#> GSM573757 2 0.628 0.500 0.46 0.54 0.00
#> GSM573758 2 0.628 0.500 0.46 0.54 0.00
#> GSM573708 2 0.952 0.226 0.20 0.46 0.34
#> GSM573709 2 0.952 0.226 0.20 0.46 0.34
#> GSM573710 2 0.952 0.226 0.20 0.46 0.34
#> GSM573711 2 0.952 0.226 0.20 0.46 0.34
#> GSM573712 2 0.952 0.226 0.20 0.46 0.34
#> GSM573713 2 0.952 0.226 0.20 0.46 0.34
#> GSM573717 2 0.952 0.226 0.20 0.46 0.34
#> GSM573718 2 0.952 0.226 0.20 0.46 0.34
#> GSM573719 2 0.952 0.226 0.20 0.46 0.34
#> GSM573714 2 0.952 0.226 0.20 0.46 0.34
#> GSM573715 2 0.952 0.226 0.20 0.46 0.34
#> GSM573716 2 0.952 0.226 0.20 0.46 0.34
#> GSM573780 2 0.952 0.226 0.20 0.46 0.34
#> GSM573781 2 0.952 0.226 0.20 0.46 0.34
#> GSM573782 2 0.952 0.226 0.20 0.46 0.34
#> GSM573705 2 0.952 0.226 0.20 0.46 0.34
#> GSM573706 2 0.952 0.226 0.20 0.46 0.34
#> GSM573707 2 0.952 0.226 0.20 0.46 0.34
#> GSM573702 2 0.952 0.226 0.20 0.46 0.34
#> GSM573703 2 0.952 0.226 0.20 0.46 0.34
#> GSM573704 2 0.952 0.226 0.20 0.46 0.34
#> GSM573783 2 0.952 0.226 0.20 0.46 0.34
#> GSM573784 2 0.952 0.226 0.20 0.46 0.34
#> GSM573785 2 0.952 0.226 0.20 0.46 0.34
#> GSM573744 3 0.000 1.000 0.00 0.00 1.00
#> GSM573745 3 0.000 1.000 0.00 0.00 1.00
#> GSM573746 3 0.000 1.000 0.00 0.00 1.00
#> GSM573747 3 0.000 1.000 0.00 0.00 1.00
#> GSM573748 3 0.000 1.000 0.00 0.00 1.00
#> GSM573749 3 0.000 1.000 0.00 0.00 1.00
#> GSM573753 3 0.000 1.000 0.00 0.00 1.00
#> GSM573754 3 0.000 1.000 0.00 0.00 1.00
#> GSM573755 3 0.000 1.000 0.00 0.00 1.00
#> GSM573750 3 0.000 1.000 0.00 0.00 1.00
#> GSM573751 3 0.000 1.000 0.00 0.00 1.00
#> GSM573752 3 0.000 1.000 0.00 0.00 1.00
#> GSM573795 3 0.000 1.000 0.00 0.00 1.00
#> GSM573796 3 0.000 1.000 0.00 0.00 1.00
#> GSM573797 3 0.000 1.000 0.00 0.00 1.00
#> GSM573741 3 0.000 1.000 0.00 0.00 1.00
#> GSM573742 3 0.000 1.000 0.00 0.00 1.00
#> GSM573743 3 0.000 1.000 0.00 0.00 1.00
#> GSM573738 3 0.000 1.000 0.00 0.00 1.00
#> GSM573739 3 0.000 1.000 0.00 0.00 1.00
#> GSM573740 3 0.000 1.000 0.00 0.00 1.00
#> GSM573792 3 0.000 1.000 0.00 0.00 1.00
#> GSM573793 3 0.000 1.000 0.00 0.00 1.00
#> GSM573794 3 0.000 1.000 0.00 0.00 1.00
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM573726 1 0 1 1 0 0 0
#> GSM573727 1 0 1 1 0 0 0
#> GSM573728 1 0 1 1 0 0 0
#> GSM573729 1 0 1 1 0 0 0
#> GSM573730 1 0 1 1 0 0 0
#> GSM573731 1 0 1 1 0 0 0
#> GSM573735 1 0 1 1 0 0 0
#> GSM573736 1 0 1 1 0 0 0
#> GSM573737 1 0 1 1 0 0 0
#> GSM573732 1 0 1 1 0 0 0
#> GSM573733 1 0 1 1 0 0 0
#> GSM573734 1 0 1 1 0 0 0
#> GSM573789 1 0 1 1 0 0 0
#> GSM573790 1 0 1 1 0 0 0
#> GSM573791 1 0 1 1 0 0 0
#> GSM573723 1 0 1 1 0 0 0
#> GSM573724 1 0 1 1 0 0 0
#> GSM573725 1 0 1 1 0 0 0
#> GSM573720 1 0 1 1 0 0 0
#> GSM573721 1 0 1 1 0 0 0
#> GSM573722 1 0 1 1 0 0 0
#> GSM573786 1 0 1 1 0 0 0
#> GSM573787 1 0 1 1 0 0 0
#> GSM573788 1 0 1 1 0 0 0
#> GSM573768 2 0 1 0 1 0 0
#> GSM573769 2 0 1 0 1 0 0
#> GSM573770 2 0 1 0 1 0 0
#> GSM573765 2 0 1 0 1 0 0
#> GSM573766 2 0 1 0 1 0 0
#> GSM573767 2 0 1 0 1 0 0
#> GSM573777 2 0 1 0 1 0 0
#> GSM573778 2 0 1 0 1 0 0
#> GSM573779 2 0 1 0 1 0 0
#> GSM573762 2 0 1 0 1 0 0
#> GSM573763 2 0 1 0 1 0 0
#> GSM573764 2 0 1 0 1 0 0
#> GSM573771 2 0 1 0 1 0 0
#> GSM573772 2 0 1 0 1 0 0
#> GSM573773 2 0 1 0 1 0 0
#> GSM573759 2 0 1 0 1 0 0
#> GSM573760 2 0 1 0 1 0 0
#> GSM573761 2 0 1 0 1 0 0
#> GSM573774 2 0 1 0 1 0 0
#> GSM573775 2 0 1 0 1 0 0
#> GSM573776 2 0 1 0 1 0 0
#> GSM573756 2 0 1 0 1 0 0
#> GSM573757 2 0 1 0 1 0 0
#> GSM573758 2 0 1 0 1 0 0
#> GSM573708 3 0 1 0 0 1 0
#> GSM573709 3 0 1 0 0 1 0
#> GSM573710 3 0 1 0 0 1 0
#> GSM573711 3 0 1 0 0 1 0
#> GSM573712 3 0 1 0 0 1 0
#> GSM573713 3 0 1 0 0 1 0
#> GSM573717 3 0 1 0 0 1 0
#> GSM573718 3 0 1 0 0 1 0
#> GSM573719 3 0 1 0 0 1 0
#> GSM573714 3 0 1 0 0 1 0
#> GSM573715 3 0 1 0 0 1 0
#> GSM573716 3 0 1 0 0 1 0
#> GSM573780 3 0 1 0 0 1 0
#> GSM573781 3 0 1 0 0 1 0
#> GSM573782 3 0 1 0 0 1 0
#> GSM573705 3 0 1 0 0 1 0
#> GSM573706 3 0 1 0 0 1 0
#> GSM573707 3 0 1 0 0 1 0
#> GSM573702 3 0 1 0 0 1 0
#> GSM573703 3 0 1 0 0 1 0
#> GSM573704 3 0 1 0 0 1 0
#> GSM573783 3 0 1 0 0 1 0
#> GSM573784 3 0 1 0 0 1 0
#> GSM573785 3 0 1 0 0 1 0
#> GSM573744 4 0 1 0 0 0 1
#> GSM573745 4 0 1 0 0 0 1
#> GSM573746 4 0 1 0 0 0 1
#> GSM573747 4 0 1 0 0 0 1
#> GSM573748 4 0 1 0 0 0 1
#> GSM573749 4 0 1 0 0 0 1
#> GSM573753 4 0 1 0 0 0 1
#> GSM573754 4 0 1 0 0 0 1
#> GSM573755 4 0 1 0 0 0 1
#> GSM573750 4 0 1 0 0 0 1
#> GSM573751 4 0 1 0 0 0 1
#> GSM573752 4 0 1 0 0 0 1
#> GSM573795 4 0 1 0 0 0 1
#> GSM573796 4 0 1 0 0 0 1
#> GSM573797 4 0 1 0 0 0 1
#> GSM573741 4 0 1 0 0 0 1
#> GSM573742 4 0 1 0 0 0 1
#> GSM573743 4 0 1 0 0 0 1
#> GSM573738 4 0 1 0 0 0 1
#> GSM573739 4 0 1 0 0 0 1
#> GSM573740 4 0 1 0 0 0 1
#> GSM573792 4 0 1 0 0 0 1
#> GSM573793 4 0 1 0 0 0 1
#> GSM573794 4 0 1 0 0 0 1
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM573726 1 0.0000 0.981 1.000 0.000 0.000 0.000 NA
#> GSM573727 1 0.0000 0.981 1.000 0.000 0.000 0.000 NA
#> GSM573728 1 0.0000 0.981 1.000 0.000 0.000 0.000 NA
#> GSM573729 1 0.0000 0.981 1.000 0.000 0.000 0.000 NA
#> GSM573730 1 0.0000 0.981 1.000 0.000 0.000 0.000 NA
#> GSM573731 1 0.0000 0.981 1.000 0.000 0.000 0.000 NA
#> GSM573735 1 0.1851 0.952 0.912 0.000 0.000 0.000 NA
#> GSM573736 1 0.1908 0.950 0.908 0.000 0.000 0.000 NA
#> GSM573737 1 0.1965 0.948 0.904 0.000 0.000 0.000 NA
#> GSM573732 1 0.1851 0.952 0.912 0.000 0.000 0.000 NA
#> GSM573733 1 0.1908 0.950 0.908 0.000 0.000 0.000 NA
#> GSM573734 1 0.1851 0.952 0.912 0.000 0.000 0.000 NA
#> GSM573789 1 0.0703 0.976 0.976 0.000 0.000 0.000 NA
#> GSM573790 1 0.0703 0.976 0.976 0.000 0.000 0.000 NA
#> GSM573791 1 0.0703 0.976 0.976 0.000 0.000 0.000 NA
#> GSM573723 1 0.0000 0.981 1.000 0.000 0.000 0.000 NA
#> GSM573724 1 0.0000 0.981 1.000 0.000 0.000 0.000 NA
#> GSM573725 1 0.0000 0.981 1.000 0.000 0.000 0.000 NA
#> GSM573720 1 0.0000 0.981 1.000 0.000 0.000 0.000 NA
#> GSM573721 1 0.0000 0.981 1.000 0.000 0.000 0.000 NA
#> GSM573722 1 0.0000 0.981 1.000 0.000 0.000 0.000 NA
#> GSM573786 1 0.0162 0.980 0.996 0.000 0.000 0.000 NA
#> GSM573787 1 0.0000 0.981 1.000 0.000 0.000 0.000 NA
#> GSM573788 1 0.0290 0.980 0.992 0.000 0.000 0.000 NA
#> GSM573768 2 0.0510 0.973 0.000 0.984 0.000 0.000 NA
#> GSM573769 2 0.0510 0.972 0.000 0.984 0.000 0.000 NA
#> GSM573770 2 0.0510 0.973 0.000 0.984 0.000 0.000 NA
#> GSM573765 2 0.0290 0.973 0.000 0.992 0.000 0.000 NA
#> GSM573766 2 0.0404 0.974 0.000 0.988 0.000 0.000 NA
#> GSM573767 2 0.0162 0.973 0.000 0.996 0.000 0.000 NA
#> GSM573777 2 0.0880 0.972 0.000 0.968 0.000 0.000 NA
#> GSM573778 2 0.0794 0.972 0.000 0.972 0.000 0.000 NA
#> GSM573779 2 0.0963 0.972 0.000 0.964 0.000 0.000 NA
#> GSM573762 2 0.0880 0.972 0.000 0.968 0.000 0.000 NA
#> GSM573763 2 0.0794 0.973 0.000 0.972 0.000 0.000 NA
#> GSM573764 2 0.1043 0.970 0.000 0.960 0.000 0.000 NA
#> GSM573771 2 0.0703 0.973 0.000 0.976 0.000 0.000 NA
#> GSM573772 2 0.1121 0.970 0.000 0.956 0.000 0.000 NA
#> GSM573773 2 0.0703 0.973 0.000 0.976 0.000 0.000 NA
#> GSM573759 2 0.1121 0.964 0.000 0.956 0.000 0.000 NA
#> GSM573760 2 0.0510 0.973 0.000 0.984 0.000 0.000 NA
#> GSM573761 2 0.0510 0.972 0.000 0.984 0.000 0.000 NA
#> GSM573774 2 0.0000 0.973 0.000 1.000 0.000 0.000 NA
#> GSM573775 2 0.1270 0.962 0.000 0.948 0.000 0.000 NA
#> GSM573776 2 0.0404 0.973 0.000 0.988 0.000 0.000 NA
#> GSM573756 2 0.2852 0.900 0.000 0.828 0.000 0.000 NA
#> GSM573757 2 0.2891 0.898 0.000 0.824 0.000 0.000 NA
#> GSM573758 2 0.2773 0.906 0.000 0.836 0.000 0.000 NA
#> GSM573708 3 0.1965 0.946 0.000 0.000 0.904 0.000 NA
#> GSM573709 3 0.2329 0.939 0.000 0.000 0.876 0.000 NA
#> GSM573710 3 0.2230 0.942 0.000 0.000 0.884 0.000 NA
#> GSM573711 3 0.1908 0.947 0.000 0.000 0.908 0.000 NA
#> GSM573712 3 0.1965 0.946 0.000 0.000 0.904 0.000 NA
#> GSM573713 3 0.2329 0.937 0.000 0.000 0.876 0.000 NA
#> GSM573717 3 0.0290 0.957 0.000 0.000 0.992 0.000 NA
#> GSM573718 3 0.0609 0.958 0.000 0.000 0.980 0.000 NA
#> GSM573719 3 0.0963 0.958 0.000 0.000 0.964 0.000 NA
#> GSM573714 3 0.0290 0.957 0.000 0.000 0.992 0.000 NA
#> GSM573715 3 0.0290 0.958 0.000 0.000 0.992 0.000 NA
#> GSM573716 3 0.0404 0.957 0.000 0.000 0.988 0.000 NA
#> GSM573780 3 0.3003 0.910 0.000 0.000 0.812 0.000 NA
#> GSM573781 3 0.3424 0.879 0.000 0.000 0.760 0.000 NA
#> GSM573782 3 0.3480 0.873 0.000 0.000 0.752 0.000 NA
#> GSM573705 3 0.0290 0.957 0.000 0.000 0.992 0.000 NA
#> GSM573706 3 0.0963 0.958 0.000 0.000 0.964 0.000 NA
#> GSM573707 3 0.0404 0.958 0.000 0.000 0.988 0.000 NA
#> GSM573702 3 0.0510 0.958 0.000 0.000 0.984 0.000 NA
#> GSM573703 3 0.0162 0.957 0.000 0.000 0.996 0.000 NA
#> GSM573704 3 0.0609 0.958 0.000 0.000 0.980 0.000 NA
#> GSM573783 3 0.1121 0.956 0.000 0.000 0.956 0.000 NA
#> GSM573784 3 0.1121 0.956 0.000 0.000 0.956 0.000 NA
#> GSM573785 3 0.0963 0.958 0.000 0.000 0.964 0.000 NA
#> GSM573744 4 0.0404 0.953 0.000 0.000 0.000 0.988 NA
#> GSM573745 4 0.0290 0.953 0.000 0.000 0.000 0.992 NA
#> GSM573746 4 0.0162 0.953 0.000 0.000 0.000 0.996 NA
#> GSM573747 4 0.0404 0.952 0.000 0.000 0.000 0.988 NA
#> GSM573748 4 0.0404 0.952 0.000 0.000 0.000 0.988 NA
#> GSM573749 4 0.0404 0.953 0.000 0.000 0.000 0.988 NA
#> GSM573753 4 0.0609 0.951 0.000 0.000 0.000 0.980 NA
#> GSM573754 4 0.0609 0.951 0.000 0.000 0.000 0.980 NA
#> GSM573755 4 0.3177 0.846 0.000 0.000 0.000 0.792 NA
#> GSM573750 4 0.0290 0.953 0.000 0.000 0.000 0.992 NA
#> GSM573751 4 0.0703 0.952 0.000 0.000 0.000 0.976 NA
#> GSM573752 4 0.0290 0.953 0.000 0.000 0.000 0.992 NA
#> GSM573795 4 0.4074 0.735 0.000 0.000 0.000 0.636 NA
#> GSM573796 4 0.4074 0.735 0.000 0.000 0.000 0.636 NA
#> GSM573797 4 0.4045 0.741 0.000 0.000 0.000 0.644 NA
#> GSM573741 4 0.0510 0.951 0.000 0.000 0.000 0.984 NA
#> GSM573742 4 0.0290 0.953 0.000 0.000 0.000 0.992 NA
#> GSM573743 4 0.0290 0.953 0.000 0.000 0.000 0.992 NA
#> GSM573738 4 0.0162 0.953 0.000 0.000 0.000 0.996 NA
#> GSM573739 4 0.0290 0.953 0.000 0.000 0.000 0.992 NA
#> GSM573740 4 0.0290 0.953 0.000 0.000 0.000 0.992 NA
#> GSM573792 4 0.0404 0.953 0.000 0.000 0.000 0.988 NA
#> GSM573793 4 0.0162 0.954 0.000 0.000 0.000 0.996 NA
#> GSM573794 4 0.0404 0.953 0.000 0.000 0.000 0.988 NA
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM573726 1 0.0000 0.971 1.000 0.000 0.000 0.000 NA NA
#> GSM573727 1 0.0146 0.971 0.996 0.000 0.000 0.000 NA NA
#> GSM573728 1 0.0000 0.971 1.000 0.000 0.000 0.000 NA NA
#> GSM573729 1 0.0000 0.971 1.000 0.000 0.000 0.000 NA NA
#> GSM573730 1 0.0000 0.971 1.000 0.000 0.000 0.000 NA NA
#> GSM573731 1 0.0000 0.971 1.000 0.000 0.000 0.000 NA NA
#> GSM573735 1 0.2660 0.926 0.868 0.000 0.000 0.000 NA NA
#> GSM573736 1 0.2762 0.922 0.860 0.000 0.000 0.000 NA NA
#> GSM573737 1 0.2812 0.920 0.856 0.000 0.000 0.000 NA NA
#> GSM573732 1 0.2595 0.928 0.872 0.000 0.000 0.000 NA NA
#> GSM573733 1 0.2629 0.927 0.868 0.000 0.000 0.000 NA NA
#> GSM573734 1 0.2527 0.930 0.876 0.000 0.000 0.000 NA NA
#> GSM573789 1 0.0632 0.967 0.976 0.000 0.000 0.000 NA NA
#> GSM573790 1 0.1261 0.960 0.952 0.000 0.000 0.000 NA NA
#> GSM573791 1 0.1088 0.962 0.960 0.000 0.000 0.000 NA NA
#> GSM573723 1 0.0000 0.971 1.000 0.000 0.000 0.000 NA NA
#> GSM573724 1 0.0000 0.971 1.000 0.000 0.000 0.000 NA NA
#> GSM573725 1 0.0000 0.971 1.000 0.000 0.000 0.000 NA NA
#> GSM573720 1 0.0000 0.971 1.000 0.000 0.000 0.000 NA NA
#> GSM573721 1 0.0000 0.971 1.000 0.000 0.000 0.000 NA NA
#> GSM573722 1 0.0000 0.971 1.000 0.000 0.000 0.000 NA NA
#> GSM573786 1 0.0291 0.970 0.992 0.000 0.000 0.000 NA NA
#> GSM573787 1 0.0000 0.971 1.000 0.000 0.000 0.000 NA NA
#> GSM573788 1 0.0260 0.970 0.992 0.000 0.000 0.000 NA NA
#> GSM573768 2 0.0777 0.966 0.000 0.972 0.000 0.000 NA NA
#> GSM573769 2 0.0508 0.968 0.000 0.984 0.000 0.000 NA NA
#> GSM573770 2 0.0405 0.968 0.000 0.988 0.000 0.000 NA NA
#> GSM573765 2 0.0260 0.968 0.000 0.992 0.000 0.000 NA NA
#> GSM573766 2 0.0363 0.968 0.000 0.988 0.000 0.000 NA NA
#> GSM573767 2 0.0260 0.968 0.000 0.992 0.000 0.000 NA NA
#> GSM573777 2 0.0363 0.968 0.000 0.988 0.000 0.000 NA NA
#> GSM573778 2 0.0260 0.968 0.000 0.992 0.000 0.000 NA NA
#> GSM573779 2 0.0508 0.968 0.000 0.984 0.000 0.000 NA NA
#> GSM573762 2 0.0603 0.967 0.000 0.980 0.000 0.000 NA NA
#> GSM573763 2 0.0508 0.968 0.000 0.984 0.000 0.000 NA NA
#> GSM573764 2 0.0777 0.965 0.000 0.972 0.000 0.000 NA NA
#> GSM573771 2 0.0260 0.968 0.000 0.992 0.000 0.000 NA NA
#> GSM573772 2 0.0692 0.966 0.000 0.976 0.000 0.000 NA NA
#> GSM573773 2 0.0260 0.968 0.000 0.992 0.000 0.000 NA NA
#> GSM573759 2 0.1794 0.945 0.000 0.924 0.000 0.000 NA NA
#> GSM573760 2 0.0508 0.968 0.000 0.984 0.000 0.000 NA NA
#> GSM573761 2 0.0777 0.966 0.000 0.972 0.000 0.000 NA NA
#> GSM573774 2 0.0260 0.968 0.000 0.992 0.000 0.000 NA NA
#> GSM573775 2 0.1408 0.955 0.000 0.944 0.000 0.000 NA NA
#> GSM573776 2 0.0603 0.968 0.000 0.980 0.000 0.000 NA NA
#> GSM573756 2 0.3555 0.851 0.000 0.780 0.000 0.000 NA NA
#> GSM573757 2 0.3679 0.846 0.000 0.772 0.000 0.000 NA NA
#> GSM573758 2 0.3555 0.852 0.000 0.780 0.000 0.000 NA NA
#> GSM573708 3 0.2094 0.934 0.000 0.000 0.900 0.000 NA NA
#> GSM573709 3 0.2653 0.918 0.000 0.000 0.844 0.000 NA NA
#> GSM573710 3 0.2092 0.925 0.000 0.000 0.876 0.000 NA NA
#> GSM573711 3 0.2325 0.936 0.000 0.000 0.892 0.000 NA NA
#> GSM573712 3 0.2058 0.937 0.000 0.000 0.908 0.000 NA NA
#> GSM573713 3 0.3062 0.920 0.000 0.000 0.836 0.000 NA NA
#> GSM573717 3 0.0865 0.942 0.000 0.000 0.964 0.000 NA NA
#> GSM573718 3 0.1141 0.942 0.000 0.000 0.948 0.000 NA NA
#> GSM573719 3 0.1789 0.942 0.000 0.000 0.924 0.000 NA NA
#> GSM573714 3 0.0777 0.944 0.000 0.000 0.972 0.000 NA NA
#> GSM573715 3 0.0547 0.944 0.000 0.000 0.980 0.000 NA NA
#> GSM573716 3 0.0865 0.943 0.000 0.000 0.964 0.000 NA NA
#> GSM573780 3 0.3287 0.889 0.000 0.000 0.768 0.000 NA NA
#> GSM573781 3 0.3909 0.860 0.000 0.000 0.720 0.000 NA NA
#> GSM573782 3 0.3758 0.851 0.000 0.000 0.700 0.000 NA NA
#> GSM573705 3 0.1010 0.943 0.000 0.000 0.960 0.000 NA NA
#> GSM573706 3 0.1616 0.943 0.000 0.000 0.932 0.000 NA NA
#> GSM573707 3 0.0790 0.942 0.000 0.000 0.968 0.000 NA NA
#> GSM573702 3 0.1007 0.941 0.000 0.000 0.956 0.000 NA NA
#> GSM573703 3 0.0790 0.942 0.000 0.000 0.968 0.000 NA NA
#> GSM573704 3 0.1010 0.942 0.000 0.000 0.960 0.000 NA NA
#> GSM573783 3 0.2058 0.937 0.000 0.000 0.908 0.000 NA NA
#> GSM573784 3 0.2046 0.935 0.000 0.000 0.908 0.000 NA NA
#> GSM573785 3 0.1856 0.940 0.000 0.000 0.920 0.000 NA NA
#> GSM573744 4 0.0603 0.950 0.000 0.000 0.000 0.980 NA NA
#> GSM573745 4 0.0000 0.952 0.000 0.000 0.000 1.000 NA NA
#> GSM573746 4 0.0000 0.952 0.000 0.000 0.000 1.000 NA NA
#> GSM573747 4 0.0000 0.952 0.000 0.000 0.000 1.000 NA NA
#> GSM573748 4 0.0260 0.951 0.000 0.000 0.000 0.992 NA NA
#> GSM573749 4 0.0508 0.951 0.000 0.000 0.000 0.984 NA NA
#> GSM573753 4 0.0909 0.946 0.000 0.000 0.000 0.968 NA NA
#> GSM573754 4 0.0520 0.951 0.000 0.000 0.000 0.984 NA NA
#> GSM573755 4 0.3290 0.829 0.000 0.000 0.000 0.776 NA NA
#> GSM573750 4 0.0260 0.952 0.000 0.000 0.000 0.992 NA NA
#> GSM573751 4 0.0520 0.950 0.000 0.000 0.000 0.984 NA NA
#> GSM573752 4 0.0405 0.951 0.000 0.000 0.000 0.988 NA NA
#> GSM573795 4 0.3807 0.724 0.000 0.000 0.000 0.628 NA NA
#> GSM573796 4 0.3807 0.724 0.000 0.000 0.000 0.628 NA NA
#> GSM573797 4 0.3659 0.730 0.000 0.000 0.000 0.636 NA NA
#> GSM573741 4 0.0260 0.951 0.000 0.000 0.000 0.992 NA NA
#> GSM573742 4 0.0000 0.952 0.000 0.000 0.000 1.000 NA NA
#> GSM573743 4 0.0000 0.952 0.000 0.000 0.000 1.000 NA NA
#> GSM573738 4 0.0000 0.952 0.000 0.000 0.000 1.000 NA NA
#> GSM573739 4 0.0000 0.952 0.000 0.000 0.000 1.000 NA NA
#> GSM573740 4 0.0000 0.952 0.000 0.000 0.000 1.000 NA NA
#> GSM573792 4 0.0363 0.951 0.000 0.000 0.000 0.988 NA NA
#> GSM573793 4 0.0260 0.952 0.000 0.000 0.000 0.992 NA NA
#> GSM573794 4 0.0692 0.949 0.000 0.000 0.000 0.976 NA NA
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
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)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
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:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.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")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
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 cell.line(p) agent(p) k
#> SD:mclust 96 1.13e-20 0.843 2
#> SD:mclust 72 3.93e-30 0.927 3
#> SD:mclust 96 9.14e-57 0.975 4
#> SD:mclust 96 9.14e-57 0.975 5
#> SD:mclust 96 9.14e-57 0.975 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.
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 46609 rows and 96 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 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)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.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:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).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)
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.634 0.781 0.870 0.46606 0.495 0.495
#> 3 3 0.758 0.843 0.880 0.35833 0.621 0.390
#> 4 4 1.000 1.000 1.000 0.19757 0.874 0.657
#> 5 5 1.000 0.997 0.997 0.00133 1.000 1.000
#> 6 6 0.957 0.967 0.963 0.01356 1.000 1.000
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 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.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> GSM573726 1 0.000 0.924 1.000 0.000
#> GSM573727 1 0.000 0.924 1.000 0.000
#> GSM573728 1 0.000 0.924 1.000 0.000
#> GSM573729 1 0.000 0.924 1.000 0.000
#> GSM573730 1 0.000 0.924 1.000 0.000
#> GSM573731 1 0.000 0.924 1.000 0.000
#> GSM573735 1 0.000 0.924 1.000 0.000
#> GSM573736 1 0.000 0.924 1.000 0.000
#> GSM573737 1 0.000 0.924 1.000 0.000
#> GSM573732 1 0.000 0.924 1.000 0.000
#> GSM573733 1 0.000 0.924 1.000 0.000
#> GSM573734 1 0.000 0.924 1.000 0.000
#> GSM573789 1 0.000 0.924 1.000 0.000
#> GSM573790 1 0.000 0.924 1.000 0.000
#> GSM573791 1 0.000 0.924 1.000 0.000
#> GSM573723 1 0.000 0.924 1.000 0.000
#> GSM573724 1 0.000 0.924 1.000 0.000
#> GSM573725 1 0.000 0.924 1.000 0.000
#> GSM573720 1 0.000 0.924 1.000 0.000
#> GSM573721 1 0.000 0.924 1.000 0.000
#> GSM573722 1 0.000 0.924 1.000 0.000
#> GSM573786 1 0.000 0.924 1.000 0.000
#> GSM573787 1 0.000 0.924 1.000 0.000
#> GSM573788 1 0.000 0.924 1.000 0.000
#> GSM573768 2 0.000 0.761 0.000 1.000
#> GSM573769 2 0.000 0.761 0.000 1.000
#> GSM573770 2 0.000 0.761 0.000 1.000
#> GSM573765 2 0.000 0.761 0.000 1.000
#> GSM573766 2 0.000 0.761 0.000 1.000
#> GSM573767 2 0.000 0.761 0.000 1.000
#> GSM573777 2 0.000 0.761 0.000 1.000
#> GSM573778 2 0.000 0.761 0.000 1.000
#> GSM573779 2 0.000 0.761 0.000 1.000
#> GSM573762 2 0.000 0.761 0.000 1.000
#> GSM573763 2 0.000 0.761 0.000 1.000
#> GSM573764 2 0.000 0.761 0.000 1.000
#> GSM573771 2 0.000 0.761 0.000 1.000
#> GSM573772 2 0.000 0.761 0.000 1.000
#> GSM573773 2 0.000 0.761 0.000 1.000
#> GSM573759 2 0.000 0.761 0.000 1.000
#> GSM573760 2 0.000 0.761 0.000 1.000
#> GSM573761 2 0.000 0.761 0.000 1.000
#> GSM573774 2 0.000 0.761 0.000 1.000
#> GSM573775 2 0.000 0.761 0.000 1.000
#> GSM573776 2 0.000 0.761 0.000 1.000
#> GSM573756 2 0.000 0.761 0.000 1.000
#> GSM573757 2 0.000 0.761 0.000 1.000
#> GSM573758 2 0.000 0.761 0.000 1.000
#> GSM573708 1 0.416 0.923 0.916 0.084
#> GSM573709 1 0.416 0.923 0.916 0.084
#> GSM573710 1 0.416 0.923 0.916 0.084
#> GSM573711 1 0.416 0.923 0.916 0.084
#> GSM573712 1 0.416 0.923 0.916 0.084
#> GSM573713 1 0.416 0.923 0.916 0.084
#> GSM573717 1 0.416 0.923 0.916 0.084
#> GSM573718 1 0.416 0.923 0.916 0.084
#> GSM573719 1 0.416 0.923 0.916 0.084
#> GSM573714 1 0.416 0.923 0.916 0.084
#> GSM573715 1 0.416 0.923 0.916 0.084
#> GSM573716 1 0.416 0.923 0.916 0.084
#> GSM573780 1 0.416 0.923 0.916 0.084
#> GSM573781 1 0.416 0.923 0.916 0.084
#> GSM573782 1 0.416 0.923 0.916 0.084
#> GSM573705 1 0.416 0.923 0.916 0.084
#> GSM573706 1 0.416 0.923 0.916 0.084
#> GSM573707 1 0.416 0.923 0.916 0.084
#> GSM573702 1 0.416 0.923 0.916 0.084
#> GSM573703 1 0.416 0.923 0.916 0.084
#> GSM573704 1 0.416 0.923 0.916 0.084
#> GSM573783 1 0.416 0.923 0.916 0.084
#> GSM573784 1 0.416 0.923 0.916 0.084
#> GSM573785 1 0.416 0.923 0.916 0.084
#> GSM573744 2 0.998 0.524 0.476 0.524
#> GSM573745 2 0.999 0.517 0.480 0.520
#> GSM573746 2 0.999 0.517 0.480 0.520
#> GSM573747 2 0.998 0.524 0.476 0.524
#> GSM573748 2 0.998 0.524 0.476 0.524
#> GSM573749 2 0.998 0.524 0.476 0.524
#> GSM573753 2 0.991 0.566 0.444 0.556
#> GSM573754 2 0.980 0.590 0.416 0.584
#> GSM573755 2 0.971 0.603 0.400 0.600
#> GSM573750 2 0.992 0.562 0.448 0.552
#> GSM573751 2 0.992 0.562 0.448 0.552
#> GSM573752 2 0.994 0.552 0.456 0.544
#> GSM573795 2 0.802 0.694 0.244 0.756
#> GSM573796 2 0.697 0.713 0.188 0.812
#> GSM573797 2 0.802 0.694 0.244 0.756
#> GSM573741 1 1.000 -0.491 0.500 0.500
#> GSM573742 2 0.999 0.517 0.480 0.520
#> GSM573743 2 0.999 0.517 0.480 0.520
#> GSM573738 2 0.999 0.508 0.484 0.516
#> GSM573739 2 1.000 0.489 0.492 0.508
#> GSM573740 2 0.999 0.517 0.480 0.520
#> GSM573792 2 0.990 0.570 0.440 0.560
#> GSM573793 2 0.996 0.542 0.464 0.536
#> GSM573794 2 0.995 0.547 0.460 0.540
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM573726 1 0.610 0.640 0.608 0.000 0.392
#> GSM573727 1 0.611 0.636 0.604 0.000 0.396
#> GSM573728 1 0.610 0.640 0.608 0.000 0.392
#> GSM573729 1 0.613 0.630 0.600 0.000 0.400
#> GSM573730 1 0.611 0.636 0.604 0.000 0.396
#> GSM573731 1 0.611 0.636 0.604 0.000 0.396
#> GSM573735 1 0.610 0.640 0.608 0.000 0.392
#> GSM573736 1 0.611 0.636 0.604 0.000 0.396
#> GSM573737 1 0.611 0.636 0.604 0.000 0.396
#> GSM573732 1 0.611 0.636 0.604 0.000 0.396
#> GSM573733 1 0.610 0.640 0.608 0.000 0.392
#> GSM573734 1 0.611 0.636 0.604 0.000 0.396
#> GSM573789 1 0.611 0.636 0.604 0.000 0.396
#> GSM573790 1 0.613 0.630 0.600 0.000 0.400
#> GSM573791 1 0.611 0.636 0.604 0.000 0.396
#> GSM573723 1 0.608 0.643 0.612 0.000 0.388
#> GSM573724 1 0.610 0.640 0.608 0.000 0.392
#> GSM573725 1 0.610 0.640 0.608 0.000 0.392
#> GSM573720 1 0.610 0.640 0.608 0.000 0.392
#> GSM573721 1 0.608 0.643 0.612 0.000 0.388
#> GSM573722 1 0.610 0.640 0.608 0.000 0.392
#> GSM573786 1 0.608 0.643 0.612 0.000 0.388
#> GSM573787 1 0.610 0.640 0.608 0.000 0.392
#> GSM573788 1 0.608 0.643 0.612 0.000 0.388
#> GSM573768 2 0.000 1.000 0.000 1.000 0.000
#> GSM573769 2 0.000 1.000 0.000 1.000 0.000
#> GSM573770 2 0.000 1.000 0.000 1.000 0.000
#> GSM573765 2 0.000 1.000 0.000 1.000 0.000
#> GSM573766 2 0.000 1.000 0.000 1.000 0.000
#> GSM573767 2 0.000 1.000 0.000 1.000 0.000
#> GSM573777 2 0.000 1.000 0.000 1.000 0.000
#> GSM573778 2 0.000 1.000 0.000 1.000 0.000
#> GSM573779 2 0.000 1.000 0.000 1.000 0.000
#> GSM573762 2 0.000 1.000 0.000 1.000 0.000
#> GSM573763 2 0.000 1.000 0.000 1.000 0.000
#> GSM573764 2 0.000 1.000 0.000 1.000 0.000
#> GSM573771 2 0.000 1.000 0.000 1.000 0.000
#> GSM573772 2 0.000 1.000 0.000 1.000 0.000
#> GSM573773 2 0.000 1.000 0.000 1.000 0.000
#> GSM573759 2 0.000 1.000 0.000 1.000 0.000
#> GSM573760 2 0.000 1.000 0.000 1.000 0.000
#> GSM573761 2 0.000 1.000 0.000 1.000 0.000
#> GSM573774 2 0.000 1.000 0.000 1.000 0.000
#> GSM573775 2 0.000 1.000 0.000 1.000 0.000
#> GSM573776 2 0.000 1.000 0.000 1.000 0.000
#> GSM573756 2 0.000 1.000 0.000 1.000 0.000
#> GSM573757 2 0.000 1.000 0.000 1.000 0.000
#> GSM573758 2 0.000 1.000 0.000 1.000 0.000
#> GSM573708 3 0.000 1.000 0.000 0.000 1.000
#> GSM573709 3 0.000 1.000 0.000 0.000 1.000
#> GSM573710 3 0.000 1.000 0.000 0.000 1.000
#> GSM573711 3 0.000 1.000 0.000 0.000 1.000
#> GSM573712 3 0.000 1.000 0.000 0.000 1.000
#> GSM573713 3 0.000 1.000 0.000 0.000 1.000
#> GSM573717 3 0.000 1.000 0.000 0.000 1.000
#> GSM573718 3 0.000 1.000 0.000 0.000 1.000
#> GSM573719 3 0.000 1.000 0.000 0.000 1.000
#> GSM573714 3 0.000 1.000 0.000 0.000 1.000
#> GSM573715 3 0.000 1.000 0.000 0.000 1.000
#> GSM573716 3 0.000 1.000 0.000 0.000 1.000
#> GSM573780 3 0.000 1.000 0.000 0.000 1.000
#> GSM573781 3 0.000 1.000 0.000 0.000 1.000
#> GSM573782 3 0.000 1.000 0.000 0.000 1.000
#> GSM573705 3 0.000 1.000 0.000 0.000 1.000
#> GSM573706 3 0.000 1.000 0.000 0.000 1.000
#> GSM573707 3 0.000 1.000 0.000 0.000 1.000
#> GSM573702 3 0.000 1.000 0.000 0.000 1.000
#> GSM573703 3 0.000 1.000 0.000 0.000 1.000
#> GSM573704 3 0.000 1.000 0.000 0.000 1.000
#> GSM573783 3 0.000 1.000 0.000 0.000 1.000
#> GSM573784 3 0.000 1.000 0.000 0.000 1.000
#> GSM573785 3 0.000 1.000 0.000 0.000 1.000
#> GSM573744 1 0.165 0.735 0.960 0.036 0.004
#> GSM573745 1 0.153 0.736 0.964 0.032 0.004
#> GSM573746 1 0.165 0.735 0.960 0.036 0.004
#> GSM573747 1 0.140 0.736 0.968 0.028 0.004
#> GSM573748 1 0.153 0.736 0.964 0.032 0.004
#> GSM573749 1 0.127 0.736 0.972 0.024 0.004
#> GSM573753 1 0.188 0.732 0.952 0.044 0.004
#> GSM573754 1 0.188 0.732 0.952 0.044 0.004
#> GSM573755 1 0.176 0.734 0.956 0.040 0.004
#> GSM573750 1 0.176 0.734 0.956 0.040 0.004
#> GSM573751 1 0.176 0.734 0.956 0.040 0.004
#> GSM573752 1 0.176 0.734 0.956 0.040 0.004
#> GSM573795 1 0.220 0.724 0.940 0.056 0.004
#> GSM573796 1 0.220 0.724 0.940 0.056 0.004
#> GSM573797 1 0.210 0.727 0.944 0.052 0.004
#> GSM573741 1 0.127 0.736 0.972 0.024 0.004
#> GSM573742 1 0.127 0.736 0.972 0.024 0.004
#> GSM573743 1 0.127 0.736 0.972 0.024 0.004
#> GSM573738 1 0.127 0.736 0.972 0.024 0.004
#> GSM573739 1 0.127 0.736 0.972 0.024 0.004
#> GSM573740 1 0.127 0.736 0.972 0.024 0.004
#> GSM573792 1 0.176 0.734 0.956 0.040 0.004
#> GSM573793 1 0.165 0.735 0.960 0.036 0.004
#> GSM573794 1 0.176 0.734 0.956 0.040 0.004
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM573726 1 0 1 1 0 0 0
#> GSM573727 1 0 1 1 0 0 0
#> GSM573728 1 0 1 1 0 0 0
#> GSM573729 1 0 1 1 0 0 0
#> GSM573730 1 0 1 1 0 0 0
#> GSM573731 1 0 1 1 0 0 0
#> GSM573735 1 0 1 1 0 0 0
#> GSM573736 1 0 1 1 0 0 0
#> GSM573737 1 0 1 1 0 0 0
#> GSM573732 1 0 1 1 0 0 0
#> GSM573733 1 0 1 1 0 0 0
#> GSM573734 1 0 1 1 0 0 0
#> GSM573789 1 0 1 1 0 0 0
#> GSM573790 1 0 1 1 0 0 0
#> GSM573791 1 0 1 1 0 0 0
#> GSM573723 1 0 1 1 0 0 0
#> GSM573724 1 0 1 1 0 0 0
#> GSM573725 1 0 1 1 0 0 0
#> GSM573720 1 0 1 1 0 0 0
#> GSM573721 1 0 1 1 0 0 0
#> GSM573722 1 0 1 1 0 0 0
#> GSM573786 1 0 1 1 0 0 0
#> GSM573787 1 0 1 1 0 0 0
#> GSM573788 1 0 1 1 0 0 0
#> GSM573768 2 0 1 0 1 0 0
#> GSM573769 2 0 1 0 1 0 0
#> GSM573770 2 0 1 0 1 0 0
#> GSM573765 2 0 1 0 1 0 0
#> GSM573766 2 0 1 0 1 0 0
#> GSM573767 2 0 1 0 1 0 0
#> GSM573777 2 0 1 0 1 0 0
#> GSM573778 2 0 1 0 1 0 0
#> GSM573779 2 0 1 0 1 0 0
#> GSM573762 2 0 1 0 1 0 0
#> GSM573763 2 0 1 0 1 0 0
#> GSM573764 2 0 1 0 1 0 0
#> GSM573771 2 0 1 0 1 0 0
#> GSM573772 2 0 1 0 1 0 0
#> GSM573773 2 0 1 0 1 0 0
#> GSM573759 2 0 1 0 1 0 0
#> GSM573760 2 0 1 0 1 0 0
#> GSM573761 2 0 1 0 1 0 0
#> GSM573774 2 0 1 0 1 0 0
#> GSM573775 2 0 1 0 1 0 0
#> GSM573776 2 0 1 0 1 0 0
#> GSM573756 2 0 1 0 1 0 0
#> GSM573757 2 0 1 0 1 0 0
#> GSM573758 2 0 1 0 1 0 0
#> GSM573708 3 0 1 0 0 1 0
#> GSM573709 3 0 1 0 0 1 0
#> GSM573710 3 0 1 0 0 1 0
#> GSM573711 3 0 1 0 0 1 0
#> GSM573712 3 0 1 0 0 1 0
#> GSM573713 3 0 1 0 0 1 0
#> GSM573717 3 0 1 0 0 1 0
#> GSM573718 3 0 1 0 0 1 0
#> GSM573719 3 0 1 0 0 1 0
#> GSM573714 3 0 1 0 0 1 0
#> GSM573715 3 0 1 0 0 1 0
#> GSM573716 3 0 1 0 0 1 0
#> GSM573780 3 0 1 0 0 1 0
#> GSM573781 3 0 1 0 0 1 0
#> GSM573782 3 0 1 0 0 1 0
#> GSM573705 3 0 1 0 0 1 0
#> GSM573706 3 0 1 0 0 1 0
#> GSM573707 3 0 1 0 0 1 0
#> GSM573702 3 0 1 0 0 1 0
#> GSM573703 3 0 1 0 0 1 0
#> GSM573704 3 0 1 0 0 1 0
#> GSM573783 3 0 1 0 0 1 0
#> GSM573784 3 0 1 0 0 1 0
#> GSM573785 3 0 1 0 0 1 0
#> GSM573744 4 0 1 0 0 0 1
#> GSM573745 4 0 1 0 0 0 1
#> GSM573746 4 0 1 0 0 0 1
#> GSM573747 4 0 1 0 0 0 1
#> GSM573748 4 0 1 0 0 0 1
#> GSM573749 4 0 1 0 0 0 1
#> GSM573753 4 0 1 0 0 0 1
#> GSM573754 4 0 1 0 0 0 1
#> GSM573755 4 0 1 0 0 0 1
#> GSM573750 4 0 1 0 0 0 1
#> GSM573751 4 0 1 0 0 0 1
#> GSM573752 4 0 1 0 0 0 1
#> GSM573795 4 0 1 0 0 0 1
#> GSM573796 4 0 1 0 0 0 1
#> GSM573797 4 0 1 0 0 0 1
#> GSM573741 4 0 1 0 0 0 1
#> GSM573742 4 0 1 0 0 0 1
#> GSM573743 4 0 1 0 0 0 1
#> GSM573738 4 0 1 0 0 0 1
#> GSM573739 4 0 1 0 0 0 1
#> GSM573740 4 0 1 0 0 0 1
#> GSM573792 4 0 1 0 0 0 1
#> GSM573793 4 0 1 0 0 0 1
#> GSM573794 4 0 1 0 0 0 1
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM573726 1 0.0000 1.000 1 0.000 0.000 0 NA
#> GSM573727 1 0.0000 1.000 1 0.000 0.000 0 NA
#> GSM573728 1 0.0000 1.000 1 0.000 0.000 0 NA
#> GSM573729 1 0.0000 1.000 1 0.000 0.000 0 NA
#> GSM573730 1 0.0000 1.000 1 0.000 0.000 0 NA
#> GSM573731 1 0.0000 1.000 1 0.000 0.000 0 NA
#> GSM573735 1 0.0000 1.000 1 0.000 0.000 0 NA
#> GSM573736 1 0.0000 1.000 1 0.000 0.000 0 NA
#> GSM573737 1 0.0000 1.000 1 0.000 0.000 0 NA
#> GSM573732 1 0.0000 1.000 1 0.000 0.000 0 NA
#> GSM573733 1 0.0000 1.000 1 0.000 0.000 0 NA
#> GSM573734 1 0.0000 1.000 1 0.000 0.000 0 NA
#> GSM573789 1 0.0000 1.000 1 0.000 0.000 0 NA
#> GSM573790 1 0.0000 1.000 1 0.000 0.000 0 NA
#> GSM573791 1 0.0000 1.000 1 0.000 0.000 0 NA
#> GSM573723 1 0.0000 1.000 1 0.000 0.000 0 NA
#> GSM573724 1 0.0000 1.000 1 0.000 0.000 0 NA
#> GSM573725 1 0.0000 1.000 1 0.000 0.000 0 NA
#> GSM573720 1 0.0000 1.000 1 0.000 0.000 0 NA
#> GSM573721 1 0.0000 1.000 1 0.000 0.000 0 NA
#> GSM573722 1 0.0000 1.000 1 0.000 0.000 0 NA
#> GSM573786 1 0.0000 1.000 1 0.000 0.000 0 NA
#> GSM573787 1 0.0000 1.000 1 0.000 0.000 0 NA
#> GSM573788 1 0.0000 1.000 1 0.000 0.000 0 NA
#> GSM573768 2 0.0000 0.996 0 1.000 0.000 0 NA
#> GSM573769 2 0.0000 0.996 0 1.000 0.000 0 NA
#> GSM573770 2 0.0000 0.996 0 1.000 0.000 0 NA
#> GSM573765 2 0.0000 0.996 0 1.000 0.000 0 NA
#> GSM573766 2 0.0000 0.996 0 1.000 0.000 0 NA
#> GSM573767 2 0.0000 0.996 0 1.000 0.000 0 NA
#> GSM573777 2 0.0162 0.995 0 0.996 0.000 0 NA
#> GSM573778 2 0.0162 0.995 0 0.996 0.000 0 NA
#> GSM573779 2 0.0162 0.995 0 0.996 0.000 0 NA
#> GSM573762 2 0.0162 0.995 0 0.996 0.000 0 NA
#> GSM573763 2 0.0162 0.995 0 0.996 0.000 0 NA
#> GSM573764 2 0.0162 0.995 0 0.996 0.000 0 NA
#> GSM573771 2 0.0162 0.995 0 0.996 0.000 0 NA
#> GSM573772 2 0.0162 0.995 0 0.996 0.000 0 NA
#> GSM573773 2 0.0162 0.995 0 0.996 0.000 0 NA
#> GSM573759 2 0.0000 0.996 0 1.000 0.000 0 NA
#> GSM573760 2 0.0000 0.996 0 1.000 0.000 0 NA
#> GSM573761 2 0.0000 0.996 0 1.000 0.000 0 NA
#> GSM573774 2 0.0000 0.996 0 1.000 0.000 0 NA
#> GSM573775 2 0.0000 0.996 0 1.000 0.000 0 NA
#> GSM573776 2 0.0000 0.996 0 1.000 0.000 0 NA
#> GSM573756 2 0.0794 0.981 0 0.972 0.000 0 NA
#> GSM573757 2 0.0963 0.976 0 0.964 0.000 0 NA
#> GSM573758 2 0.0963 0.976 0 0.964 0.000 0 NA
#> GSM573708 3 0.0510 0.992 0 0.000 0.984 0 NA
#> GSM573709 3 0.0510 0.992 0 0.000 0.984 0 NA
#> GSM573710 3 0.0510 0.992 0 0.000 0.984 0 NA
#> GSM573711 3 0.0510 0.992 0 0.000 0.984 0 NA
#> GSM573712 3 0.0510 0.992 0 0.000 0.984 0 NA
#> GSM573713 3 0.0510 0.992 0 0.000 0.984 0 NA
#> GSM573717 3 0.0000 0.995 0 0.000 1.000 0 NA
#> GSM573718 3 0.0000 0.995 0 0.000 1.000 0 NA
#> GSM573719 3 0.0000 0.995 0 0.000 1.000 0 NA
#> GSM573714 3 0.0000 0.995 0 0.000 1.000 0 NA
#> GSM573715 3 0.0000 0.995 0 0.000 1.000 0 NA
#> GSM573716 3 0.0000 0.995 0 0.000 1.000 0 NA
#> GSM573780 3 0.0510 0.992 0 0.000 0.984 0 NA
#> GSM573781 3 0.0510 0.992 0 0.000 0.984 0 NA
#> GSM573782 3 0.0609 0.991 0 0.000 0.980 0 NA
#> GSM573705 3 0.0000 0.995 0 0.000 1.000 0 NA
#> GSM573706 3 0.0000 0.995 0 0.000 1.000 0 NA
#> GSM573707 3 0.0000 0.995 0 0.000 1.000 0 NA
#> GSM573702 3 0.0000 0.995 0 0.000 1.000 0 NA
#> GSM573703 3 0.0000 0.995 0 0.000 1.000 0 NA
#> GSM573704 3 0.0000 0.995 0 0.000 1.000 0 NA
#> GSM573783 3 0.0000 0.995 0 0.000 1.000 0 NA
#> GSM573784 3 0.0000 0.995 0 0.000 1.000 0 NA
#> GSM573785 3 0.0000 0.995 0 0.000 1.000 0 NA
#> GSM573744 4 0.0000 1.000 0 0.000 0.000 1 NA
#> GSM573745 4 0.0000 1.000 0 0.000 0.000 1 NA
#> GSM573746 4 0.0000 1.000 0 0.000 0.000 1 NA
#> GSM573747 4 0.0000 1.000 0 0.000 0.000 1 NA
#> GSM573748 4 0.0000 1.000 0 0.000 0.000 1 NA
#> GSM573749 4 0.0000 1.000 0 0.000 0.000 1 NA
#> GSM573753 4 0.0000 1.000 0 0.000 0.000 1 NA
#> GSM573754 4 0.0000 1.000 0 0.000 0.000 1 NA
#> GSM573755 4 0.0000 1.000 0 0.000 0.000 1 NA
#> GSM573750 4 0.0000 1.000 0 0.000 0.000 1 NA
#> GSM573751 4 0.0000 1.000 0 0.000 0.000 1 NA
#> GSM573752 4 0.0000 1.000 0 0.000 0.000 1 NA
#> GSM573795 4 0.0000 1.000 0 0.000 0.000 1 NA
#> GSM573796 4 0.0000 1.000 0 0.000 0.000 1 NA
#> GSM573797 4 0.0000 1.000 0 0.000 0.000 1 NA
#> GSM573741 4 0.0000 1.000 0 0.000 0.000 1 NA
#> GSM573742 4 0.0000 1.000 0 0.000 0.000 1 NA
#> GSM573743 4 0.0000 1.000 0 0.000 0.000 1 NA
#> GSM573738 4 0.0000 1.000 0 0.000 0.000 1 NA
#> GSM573739 4 0.0000 1.000 0 0.000 0.000 1 NA
#> GSM573740 4 0.0000 1.000 0 0.000 0.000 1 NA
#> GSM573792 4 0.0000 1.000 0 0.000 0.000 1 NA
#> GSM573793 4 0.0000 1.000 0 0.000 0.000 1 NA
#> GSM573794 4 0.0000 1.000 0 0.000 0.000 1 NA
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM573726 1 0.0000 0.998 1.000 0.000 0.000 0.000 NA NA
#> GSM573727 1 0.0000 0.998 1.000 0.000 0.000 0.000 NA NA
#> GSM573728 1 0.0000 0.998 1.000 0.000 0.000 0.000 NA NA
#> GSM573729 1 0.0000 0.998 1.000 0.000 0.000 0.000 NA NA
#> GSM573730 1 0.0000 0.998 1.000 0.000 0.000 0.000 NA NA
#> GSM573731 1 0.0000 0.998 1.000 0.000 0.000 0.000 NA NA
#> GSM573735 1 0.0146 0.997 0.996 0.000 0.000 0.000 NA NA
#> GSM573736 1 0.0146 0.997 0.996 0.000 0.000 0.000 NA NA
#> GSM573737 1 0.0146 0.997 0.996 0.000 0.000 0.000 NA NA
#> GSM573732 1 0.0146 0.997 0.996 0.000 0.000 0.000 NA NA
#> GSM573733 1 0.0146 0.997 0.996 0.000 0.000 0.000 NA NA
#> GSM573734 1 0.0146 0.997 0.996 0.000 0.000 0.000 NA NA
#> GSM573789 1 0.0146 0.997 0.996 0.000 0.000 0.000 NA NA
#> GSM573790 1 0.0146 0.997 0.996 0.000 0.000 0.000 NA NA
#> GSM573791 1 0.0260 0.996 0.992 0.000 0.000 0.000 NA NA
#> GSM573723 1 0.0000 0.998 1.000 0.000 0.000 0.000 NA NA
#> GSM573724 1 0.0000 0.998 1.000 0.000 0.000 0.000 NA NA
#> GSM573725 1 0.0000 0.998 1.000 0.000 0.000 0.000 NA NA
#> GSM573720 1 0.0000 0.998 1.000 0.000 0.000 0.000 NA NA
#> GSM573721 1 0.0146 0.997 0.996 0.000 0.000 0.000 NA NA
#> GSM573722 1 0.0000 0.998 1.000 0.000 0.000 0.000 NA NA
#> GSM573786 1 0.0260 0.995 0.992 0.000 0.000 0.000 NA NA
#> GSM573787 1 0.0260 0.995 0.992 0.000 0.000 0.000 NA NA
#> GSM573788 1 0.0260 0.995 0.992 0.000 0.000 0.000 NA NA
#> GSM573768 2 0.1765 0.949 0.000 0.904 0.000 0.000 NA NA
#> GSM573769 2 0.1765 0.949 0.000 0.904 0.000 0.000 NA NA
#> GSM573770 2 0.1765 0.949 0.000 0.904 0.000 0.000 NA NA
#> GSM573765 2 0.0000 0.954 0.000 1.000 0.000 0.000 NA NA
#> GSM573766 2 0.0000 0.954 0.000 1.000 0.000 0.000 NA NA
#> GSM573767 2 0.0000 0.954 0.000 1.000 0.000 0.000 NA NA
#> GSM573777 2 0.0790 0.950 0.000 0.968 0.000 0.000 NA NA
#> GSM573778 2 0.0790 0.950 0.000 0.968 0.000 0.000 NA NA
#> GSM573779 2 0.0790 0.950 0.000 0.968 0.000 0.000 NA NA
#> GSM573762 2 0.0790 0.950 0.000 0.968 0.000 0.000 NA NA
#> GSM573763 2 0.0790 0.950 0.000 0.968 0.000 0.000 NA NA
#> GSM573764 2 0.0790 0.950 0.000 0.968 0.000 0.000 NA NA
#> GSM573771 2 0.0790 0.950 0.000 0.968 0.000 0.000 NA NA
#> GSM573772 2 0.0632 0.952 0.000 0.976 0.000 0.000 NA NA
#> GSM573773 2 0.0632 0.952 0.000 0.976 0.000 0.000 NA NA
#> GSM573759 2 0.1957 0.944 0.000 0.888 0.000 0.000 NA NA
#> GSM573760 2 0.1957 0.944 0.000 0.888 0.000 0.000 NA NA
#> GSM573761 2 0.1957 0.944 0.000 0.888 0.000 0.000 NA NA
#> GSM573774 2 0.1387 0.953 0.000 0.932 0.000 0.000 NA NA
#> GSM573775 2 0.1267 0.954 0.000 0.940 0.000 0.000 NA NA
#> GSM573776 2 0.1327 0.953 0.000 0.936 0.000 0.000 NA NA
#> GSM573756 2 0.2219 0.935 0.000 0.864 0.000 0.000 NA NA
#> GSM573757 2 0.2219 0.935 0.000 0.864 0.000 0.000 NA NA
#> GSM573758 2 0.2219 0.935 0.000 0.864 0.000 0.000 NA NA
#> GSM573708 3 0.2664 0.910 0.000 0.000 0.816 0.000 NA NA
#> GSM573709 3 0.2664 0.910 0.000 0.000 0.816 0.000 NA NA
#> GSM573710 3 0.2697 0.908 0.000 0.000 0.812 0.000 NA NA
#> GSM573711 3 0.2664 0.910 0.000 0.000 0.816 0.000 NA NA
#> GSM573712 3 0.2664 0.910 0.000 0.000 0.816 0.000 NA NA
#> GSM573713 3 0.2664 0.910 0.000 0.000 0.816 0.000 NA NA
#> GSM573717 3 0.0260 0.940 0.000 0.000 0.992 0.000 NA NA
#> GSM573718 3 0.0146 0.941 0.000 0.000 0.996 0.000 NA NA
#> GSM573719 3 0.0146 0.941 0.000 0.000 0.996 0.000 NA NA
#> GSM573714 3 0.0146 0.941 0.000 0.000 0.996 0.000 NA NA
#> GSM573715 3 0.0146 0.941 0.000 0.000 0.996 0.000 NA NA
#> GSM573716 3 0.0146 0.941 0.000 0.000 0.996 0.000 NA NA
#> GSM573780 3 0.2823 0.902 0.000 0.000 0.796 0.000 NA NA
#> GSM573781 3 0.2823 0.902 0.000 0.000 0.796 0.000 NA NA
#> GSM573782 3 0.2823 0.902 0.000 0.000 0.796 0.000 NA NA
#> GSM573705 3 0.0000 0.942 0.000 0.000 1.000 0.000 NA NA
#> GSM573706 3 0.0146 0.941 0.000 0.000 0.996 0.000 NA NA
#> GSM573707 3 0.0000 0.942 0.000 0.000 1.000 0.000 NA NA
#> GSM573702 3 0.0000 0.942 0.000 0.000 1.000 0.000 NA NA
#> GSM573703 3 0.0000 0.942 0.000 0.000 1.000 0.000 NA NA
#> GSM573704 3 0.0000 0.942 0.000 0.000 1.000 0.000 NA NA
#> GSM573783 3 0.0790 0.940 0.000 0.000 0.968 0.000 NA NA
#> GSM573784 3 0.0790 0.940 0.000 0.000 0.968 0.000 NA NA
#> GSM573785 3 0.0632 0.941 0.000 0.000 0.976 0.000 NA NA
#> GSM573744 4 0.0000 0.994 0.000 0.000 0.000 1.000 NA NA
#> GSM573745 4 0.0000 0.994 0.000 0.000 0.000 1.000 NA NA
#> GSM573746 4 0.0000 0.994 0.000 0.000 0.000 1.000 NA NA
#> GSM573747 4 0.0000 0.994 0.000 0.000 0.000 1.000 NA NA
#> GSM573748 4 0.0000 0.994 0.000 0.000 0.000 1.000 NA NA
#> GSM573749 4 0.0000 0.994 0.000 0.000 0.000 1.000 NA NA
#> GSM573753 4 0.0405 0.993 0.000 0.000 0.000 0.988 NA NA
#> GSM573754 4 0.0405 0.993 0.000 0.000 0.000 0.988 NA NA
#> GSM573755 4 0.0405 0.993 0.000 0.000 0.000 0.988 NA NA
#> GSM573750 4 0.0405 0.993 0.000 0.000 0.000 0.988 NA NA
#> GSM573751 4 0.0405 0.993 0.000 0.000 0.000 0.988 NA NA
#> GSM573752 4 0.0405 0.993 0.000 0.000 0.000 0.988 NA NA
#> GSM573795 4 0.0777 0.985 0.000 0.000 0.000 0.972 NA NA
#> GSM573796 4 0.0777 0.985 0.000 0.000 0.000 0.972 NA NA
#> GSM573797 4 0.0777 0.985 0.000 0.000 0.000 0.972 NA NA
#> GSM573741 4 0.0146 0.994 0.000 0.000 0.000 0.996 NA NA
#> GSM573742 4 0.0146 0.994 0.000 0.000 0.000 0.996 NA NA
#> GSM573743 4 0.0146 0.994 0.000 0.000 0.000 0.996 NA NA
#> GSM573738 4 0.0146 0.994 0.000 0.000 0.000 0.996 NA NA
#> GSM573739 4 0.0146 0.994 0.000 0.000 0.000 0.996 NA NA
#> GSM573740 4 0.0146 0.994 0.000 0.000 0.000 0.996 NA NA
#> GSM573792 4 0.0291 0.993 0.000 0.000 0.000 0.992 NA NA
#> GSM573793 4 0.0000 0.994 0.000 0.000 0.000 1.000 NA NA
#> GSM573794 4 0.0000 0.994 0.000 0.000 0.000 1.000 NA NA
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
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)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
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:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.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")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
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 cell.line(p) agent(p) k
#> SD:NMF 94 3.03e-20 0.797 2
#> SD:NMF 96 9.56e-39 0.741 3
#> SD:NMF 96 9.14e-57 0.975 4
#> SD:NMF 96 9.14e-57 0.975 5
#> SD:NMF 96 9.14e-57 0.975 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.
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 46609 rows and 96 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 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)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.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:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).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)
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.3796 0.621 0.621
#> 3 3 0.747 0.940 0.934 0.6652 0.747 0.593
#> 4 4 1.000 1.000 1.000 0.1994 0.874 0.657
#> 5 5 0.941 0.958 0.931 0.0390 0.970 0.878
#> 6 6 0.947 0.944 0.912 0.0373 0.970 0.861
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 6
#> attr(,"optional")
#> [1] 2 4 5
There is also optional best \(k\) = 2 4 5 that is worth to check.
Following shows the table of the partitions (You need to click the show/hide
code output link to see it). The membership matrix (columns with name p*
)
is inferred by
clue::cl_consensus()
function with the SE
method. Basically the value in the membership matrix
represents the probability to belong to a certain group. The finall class
label for an item is determined with the group with highest probability it
belongs to.
In get_classes()
function, the entropy is calculated from the membership
matrix and the silhouette score is calculated from the consensus matrix.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> GSM573726 1 0 1 1 0
#> GSM573727 1 0 1 1 0
#> GSM573728 1 0 1 1 0
#> GSM573729 1 0 1 1 0
#> GSM573730 1 0 1 1 0
#> GSM573731 1 0 1 1 0
#> GSM573735 1 0 1 1 0
#> GSM573736 1 0 1 1 0
#> GSM573737 1 0 1 1 0
#> GSM573732 1 0 1 1 0
#> GSM573733 1 0 1 1 0
#> GSM573734 1 0 1 1 0
#> GSM573789 1 0 1 1 0
#> GSM573790 1 0 1 1 0
#> GSM573791 1 0 1 1 0
#> GSM573723 1 0 1 1 0
#> GSM573724 1 0 1 1 0
#> GSM573725 1 0 1 1 0
#> GSM573720 1 0 1 1 0
#> GSM573721 1 0 1 1 0
#> GSM573722 1 0 1 1 0
#> GSM573786 1 0 1 1 0
#> GSM573787 1 0 1 1 0
#> GSM573788 1 0 1 1 0
#> GSM573768 2 0 1 0 1
#> GSM573769 2 0 1 0 1
#> GSM573770 2 0 1 0 1
#> GSM573765 2 0 1 0 1
#> GSM573766 2 0 1 0 1
#> GSM573767 2 0 1 0 1
#> GSM573777 2 0 1 0 1
#> GSM573778 2 0 1 0 1
#> GSM573779 2 0 1 0 1
#> GSM573762 2 0 1 0 1
#> GSM573763 2 0 1 0 1
#> GSM573764 2 0 1 0 1
#> GSM573771 2 0 1 0 1
#> GSM573772 2 0 1 0 1
#> GSM573773 2 0 1 0 1
#> GSM573759 2 0 1 0 1
#> GSM573760 2 0 1 0 1
#> GSM573761 2 0 1 0 1
#> GSM573774 2 0 1 0 1
#> GSM573775 2 0 1 0 1
#> GSM573776 2 0 1 0 1
#> GSM573756 2 0 1 0 1
#> GSM573757 2 0 1 0 1
#> GSM573758 2 0 1 0 1
#> GSM573708 1 0 1 1 0
#> GSM573709 1 0 1 1 0
#> GSM573710 1 0 1 1 0
#> GSM573711 1 0 1 1 0
#> GSM573712 1 0 1 1 0
#> GSM573713 1 0 1 1 0
#> GSM573717 1 0 1 1 0
#> GSM573718 1 0 1 1 0
#> GSM573719 1 0 1 1 0
#> GSM573714 1 0 1 1 0
#> GSM573715 1 0 1 1 0
#> GSM573716 1 0 1 1 0
#> GSM573780 1 0 1 1 0
#> GSM573781 1 0 1 1 0
#> GSM573782 1 0 1 1 0
#> GSM573705 1 0 1 1 0
#> GSM573706 1 0 1 1 0
#> GSM573707 1 0 1 1 0
#> GSM573702 1 0 1 1 0
#> GSM573703 1 0 1 1 0
#> GSM573704 1 0 1 1 0
#> GSM573783 1 0 1 1 0
#> GSM573784 1 0 1 1 0
#> GSM573785 1 0 1 1 0
#> GSM573744 1 0 1 1 0
#> GSM573745 1 0 1 1 0
#> GSM573746 1 0 1 1 0
#> GSM573747 1 0 1 1 0
#> GSM573748 1 0 1 1 0
#> GSM573749 1 0 1 1 0
#> GSM573753 1 0 1 1 0
#> GSM573754 1 0 1 1 0
#> GSM573755 1 0 1 1 0
#> GSM573750 1 0 1 1 0
#> GSM573751 1 0 1 1 0
#> GSM573752 1 0 1 1 0
#> GSM573795 1 0 1 1 0
#> GSM573796 1 0 1 1 0
#> GSM573797 1 0 1 1 0
#> GSM573741 1 0 1 1 0
#> GSM573742 1 0 1 1 0
#> GSM573743 1 0 1 1 0
#> GSM573738 1 0 1 1 0
#> GSM573739 1 0 1 1 0
#> GSM573740 1 0 1 1 0
#> GSM573792 1 0 1 1 0
#> GSM573793 1 0 1 1 0
#> GSM573794 1 0 1 1 0
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM573726 1 0.418 0.876 0.828 0 0.172
#> GSM573727 1 0.418 0.876 0.828 0 0.172
#> GSM573728 1 0.418 0.876 0.828 0 0.172
#> GSM573729 1 0.418 0.876 0.828 0 0.172
#> GSM573730 1 0.418 0.876 0.828 0 0.172
#> GSM573731 1 0.418 0.876 0.828 0 0.172
#> GSM573735 1 0.418 0.876 0.828 0 0.172
#> GSM573736 1 0.418 0.876 0.828 0 0.172
#> GSM573737 1 0.418 0.876 0.828 0 0.172
#> GSM573732 1 0.418 0.876 0.828 0 0.172
#> GSM573733 1 0.418 0.876 0.828 0 0.172
#> GSM573734 1 0.418 0.876 0.828 0 0.172
#> GSM573789 1 0.418 0.876 0.828 0 0.172
#> GSM573790 1 0.418 0.876 0.828 0 0.172
#> GSM573791 1 0.418 0.876 0.828 0 0.172
#> GSM573723 1 0.418 0.876 0.828 0 0.172
#> GSM573724 1 0.418 0.876 0.828 0 0.172
#> GSM573725 1 0.418 0.876 0.828 0 0.172
#> GSM573720 1 0.418 0.876 0.828 0 0.172
#> GSM573721 1 0.418 0.876 0.828 0 0.172
#> GSM573722 1 0.418 0.876 0.828 0 0.172
#> GSM573786 1 0.418 0.876 0.828 0 0.172
#> GSM573787 1 0.418 0.876 0.828 0 0.172
#> GSM573788 1 0.418 0.876 0.828 0 0.172
#> GSM573768 2 0.000 1.000 0.000 1 0.000
#> GSM573769 2 0.000 1.000 0.000 1 0.000
#> GSM573770 2 0.000 1.000 0.000 1 0.000
#> GSM573765 2 0.000 1.000 0.000 1 0.000
#> GSM573766 2 0.000 1.000 0.000 1 0.000
#> GSM573767 2 0.000 1.000 0.000 1 0.000
#> GSM573777 2 0.000 1.000 0.000 1 0.000
#> GSM573778 2 0.000 1.000 0.000 1 0.000
#> GSM573779 2 0.000 1.000 0.000 1 0.000
#> GSM573762 2 0.000 1.000 0.000 1 0.000
#> GSM573763 2 0.000 1.000 0.000 1 0.000
#> GSM573764 2 0.000 1.000 0.000 1 0.000
#> GSM573771 2 0.000 1.000 0.000 1 0.000
#> GSM573772 2 0.000 1.000 0.000 1 0.000
#> GSM573773 2 0.000 1.000 0.000 1 0.000
#> GSM573759 2 0.000 1.000 0.000 1 0.000
#> GSM573760 2 0.000 1.000 0.000 1 0.000
#> GSM573761 2 0.000 1.000 0.000 1 0.000
#> GSM573774 2 0.000 1.000 0.000 1 0.000
#> GSM573775 2 0.000 1.000 0.000 1 0.000
#> GSM573776 2 0.000 1.000 0.000 1 0.000
#> GSM573756 2 0.000 1.000 0.000 1 0.000
#> GSM573757 2 0.000 1.000 0.000 1 0.000
#> GSM573758 2 0.000 1.000 0.000 1 0.000
#> GSM573708 3 0.000 1.000 0.000 0 1.000
#> GSM573709 3 0.000 1.000 0.000 0 1.000
#> GSM573710 3 0.000 1.000 0.000 0 1.000
#> GSM573711 3 0.000 1.000 0.000 0 1.000
#> GSM573712 3 0.000 1.000 0.000 0 1.000
#> GSM573713 3 0.000 1.000 0.000 0 1.000
#> GSM573717 3 0.000 1.000 0.000 0 1.000
#> GSM573718 3 0.000 1.000 0.000 0 1.000
#> GSM573719 3 0.000 1.000 0.000 0 1.000
#> GSM573714 3 0.000 1.000 0.000 0 1.000
#> GSM573715 3 0.000 1.000 0.000 0 1.000
#> GSM573716 3 0.000 1.000 0.000 0 1.000
#> GSM573780 3 0.000 1.000 0.000 0 1.000
#> GSM573781 3 0.000 1.000 0.000 0 1.000
#> GSM573782 3 0.000 1.000 0.000 0 1.000
#> GSM573705 3 0.000 1.000 0.000 0 1.000
#> GSM573706 3 0.000 1.000 0.000 0 1.000
#> GSM573707 3 0.000 1.000 0.000 0 1.000
#> GSM573702 3 0.000 1.000 0.000 0 1.000
#> GSM573703 3 0.000 1.000 0.000 0 1.000
#> GSM573704 3 0.000 1.000 0.000 0 1.000
#> GSM573783 3 0.000 1.000 0.000 0 1.000
#> GSM573784 3 0.000 1.000 0.000 0 1.000
#> GSM573785 3 0.000 1.000 0.000 0 1.000
#> GSM573744 1 0.175 0.884 0.952 0 0.048
#> GSM573745 1 0.175 0.884 0.952 0 0.048
#> GSM573746 1 0.175 0.884 0.952 0 0.048
#> GSM573747 1 0.175 0.884 0.952 0 0.048
#> GSM573748 1 0.175 0.884 0.952 0 0.048
#> GSM573749 1 0.175 0.884 0.952 0 0.048
#> GSM573753 1 0.175 0.884 0.952 0 0.048
#> GSM573754 1 0.175 0.884 0.952 0 0.048
#> GSM573755 1 0.175 0.884 0.952 0 0.048
#> GSM573750 1 0.175 0.884 0.952 0 0.048
#> GSM573751 1 0.175 0.884 0.952 0 0.048
#> GSM573752 1 0.175 0.884 0.952 0 0.048
#> GSM573795 1 0.175 0.884 0.952 0 0.048
#> GSM573796 1 0.175 0.884 0.952 0 0.048
#> GSM573797 1 0.175 0.884 0.952 0 0.048
#> GSM573741 1 0.175 0.884 0.952 0 0.048
#> GSM573742 1 0.175 0.884 0.952 0 0.048
#> GSM573743 1 0.175 0.884 0.952 0 0.048
#> GSM573738 1 0.175 0.884 0.952 0 0.048
#> GSM573739 1 0.175 0.884 0.952 0 0.048
#> GSM573740 1 0.175 0.884 0.952 0 0.048
#> GSM573792 1 0.175 0.884 0.952 0 0.048
#> GSM573793 1 0.175 0.884 0.952 0 0.048
#> GSM573794 1 0.175 0.884 0.952 0 0.048
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM573726 1 0 1 1 0 0 0
#> GSM573727 1 0 1 1 0 0 0
#> GSM573728 1 0 1 1 0 0 0
#> GSM573729 1 0 1 1 0 0 0
#> GSM573730 1 0 1 1 0 0 0
#> GSM573731 1 0 1 1 0 0 0
#> GSM573735 1 0 1 1 0 0 0
#> GSM573736 1 0 1 1 0 0 0
#> GSM573737 1 0 1 1 0 0 0
#> GSM573732 1 0 1 1 0 0 0
#> GSM573733 1 0 1 1 0 0 0
#> GSM573734 1 0 1 1 0 0 0
#> GSM573789 1 0 1 1 0 0 0
#> GSM573790 1 0 1 1 0 0 0
#> GSM573791 1 0 1 1 0 0 0
#> GSM573723 1 0 1 1 0 0 0
#> GSM573724 1 0 1 1 0 0 0
#> GSM573725 1 0 1 1 0 0 0
#> GSM573720 1 0 1 1 0 0 0
#> GSM573721 1 0 1 1 0 0 0
#> GSM573722 1 0 1 1 0 0 0
#> GSM573786 1 0 1 1 0 0 0
#> GSM573787 1 0 1 1 0 0 0
#> GSM573788 1 0 1 1 0 0 0
#> GSM573768 2 0 1 0 1 0 0
#> GSM573769 2 0 1 0 1 0 0
#> GSM573770 2 0 1 0 1 0 0
#> GSM573765 2 0 1 0 1 0 0
#> GSM573766 2 0 1 0 1 0 0
#> GSM573767 2 0 1 0 1 0 0
#> GSM573777 2 0 1 0 1 0 0
#> GSM573778 2 0 1 0 1 0 0
#> GSM573779 2 0 1 0 1 0 0
#> GSM573762 2 0 1 0 1 0 0
#> GSM573763 2 0 1 0 1 0 0
#> GSM573764 2 0 1 0 1 0 0
#> GSM573771 2 0 1 0 1 0 0
#> GSM573772 2 0 1 0 1 0 0
#> GSM573773 2 0 1 0 1 0 0
#> GSM573759 2 0 1 0 1 0 0
#> GSM573760 2 0 1 0 1 0 0
#> GSM573761 2 0 1 0 1 0 0
#> GSM573774 2 0 1 0 1 0 0
#> GSM573775 2 0 1 0 1 0 0
#> GSM573776 2 0 1 0 1 0 0
#> GSM573756 2 0 1 0 1 0 0
#> GSM573757 2 0 1 0 1 0 0
#> GSM573758 2 0 1 0 1 0 0
#> GSM573708 3 0 1 0 0 1 0
#> GSM573709 3 0 1 0 0 1 0
#> GSM573710 3 0 1 0 0 1 0
#> GSM573711 3 0 1 0 0 1 0
#> GSM573712 3 0 1 0 0 1 0
#> GSM573713 3 0 1 0 0 1 0
#> GSM573717 3 0 1 0 0 1 0
#> GSM573718 3 0 1 0 0 1 0
#> GSM573719 3 0 1 0 0 1 0
#> GSM573714 3 0 1 0 0 1 0
#> GSM573715 3 0 1 0 0 1 0
#> GSM573716 3 0 1 0 0 1 0
#> GSM573780 3 0 1 0 0 1 0
#> GSM573781 3 0 1 0 0 1 0
#> GSM573782 3 0 1 0 0 1 0
#> GSM573705 3 0 1 0 0 1 0
#> GSM573706 3 0 1 0 0 1 0
#> GSM573707 3 0 1 0 0 1 0
#> GSM573702 3 0 1 0 0 1 0
#> GSM573703 3 0 1 0 0 1 0
#> GSM573704 3 0 1 0 0 1 0
#> GSM573783 3 0 1 0 0 1 0
#> GSM573784 3 0 1 0 0 1 0
#> GSM573785 3 0 1 0 0 1 0
#> GSM573744 4 0 1 0 0 0 1
#> GSM573745 4 0 1 0 0 0 1
#> GSM573746 4 0 1 0 0 0 1
#> GSM573747 4 0 1 0 0 0 1
#> GSM573748 4 0 1 0 0 0 1
#> GSM573749 4 0 1 0 0 0 1
#> GSM573753 4 0 1 0 0 0 1
#> GSM573754 4 0 1 0 0 0 1
#> GSM573755 4 0 1 0 0 0 1
#> GSM573750 4 0 1 0 0 0 1
#> GSM573751 4 0 1 0 0 0 1
#> GSM573752 4 0 1 0 0 0 1
#> GSM573795 4 0 1 0 0 0 1
#> GSM573796 4 0 1 0 0 0 1
#> GSM573797 4 0 1 0 0 0 1
#> GSM573741 4 0 1 0 0 0 1
#> GSM573742 4 0 1 0 0 0 1
#> GSM573743 4 0 1 0 0 0 1
#> GSM573738 4 0 1 0 0 0 1
#> GSM573739 4 0 1 0 0 0 1
#> GSM573740 4 0 1 0 0 0 1
#> GSM573792 4 0 1 0 0 0 1
#> GSM573793 4 0 1 0 0 0 1
#> GSM573794 4 0 1 0 0 0 1
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM573726 1 0.000 1.00 1 0.000 0.000 0 0.000
#> GSM573727 1 0.000 1.00 1 0.000 0.000 0 0.000
#> GSM573728 1 0.000 1.00 1 0.000 0.000 0 0.000
#> GSM573729 1 0.000 1.00 1 0.000 0.000 0 0.000
#> GSM573730 1 0.000 1.00 1 0.000 0.000 0 0.000
#> GSM573731 1 0.000 1.00 1 0.000 0.000 0 0.000
#> GSM573735 1 0.000 1.00 1 0.000 0.000 0 0.000
#> GSM573736 1 0.000 1.00 1 0.000 0.000 0 0.000
#> GSM573737 1 0.000 1.00 1 0.000 0.000 0 0.000
#> GSM573732 1 0.000 1.00 1 0.000 0.000 0 0.000
#> GSM573733 1 0.000 1.00 1 0.000 0.000 0 0.000
#> GSM573734 1 0.000 1.00 1 0.000 0.000 0 0.000
#> GSM573789 1 0.000 1.00 1 0.000 0.000 0 0.000
#> GSM573790 1 0.000 1.00 1 0.000 0.000 0 0.000
#> GSM573791 1 0.000 1.00 1 0.000 0.000 0 0.000
#> GSM573723 1 0.000 1.00 1 0.000 0.000 0 0.000
#> GSM573724 1 0.000 1.00 1 0.000 0.000 0 0.000
#> GSM573725 1 0.000 1.00 1 0.000 0.000 0 0.000
#> GSM573720 1 0.000 1.00 1 0.000 0.000 0 0.000
#> GSM573721 1 0.000 1.00 1 0.000 0.000 0 0.000
#> GSM573722 1 0.000 1.00 1 0.000 0.000 0 0.000
#> GSM573786 1 0.000 1.00 1 0.000 0.000 0 0.000
#> GSM573787 1 0.000 1.00 1 0.000 0.000 0 0.000
#> GSM573788 1 0.000 1.00 1 0.000 0.000 0 0.000
#> GSM573768 2 0.000 0.87 0 1.000 0.000 0 0.000
#> GSM573769 2 0.000 0.87 0 1.000 0.000 0 0.000
#> GSM573770 2 0.000 0.87 0 1.000 0.000 0 0.000
#> GSM573765 2 0.000 0.87 0 1.000 0.000 0 0.000
#> GSM573766 2 0.000 0.87 0 1.000 0.000 0 0.000
#> GSM573767 2 0.000 0.87 0 1.000 0.000 0 0.000
#> GSM573777 2 0.409 0.77 0 0.632 0.368 0 0.000
#> GSM573778 2 0.409 0.77 0 0.632 0.368 0 0.000
#> GSM573779 2 0.409 0.77 0 0.632 0.368 0 0.000
#> GSM573762 2 0.409 0.77 0 0.632 0.368 0 0.000
#> GSM573763 2 0.409 0.77 0 0.632 0.368 0 0.000
#> GSM573764 2 0.409 0.77 0 0.632 0.368 0 0.000
#> GSM573771 2 0.409 0.77 0 0.632 0.368 0 0.000
#> GSM573772 2 0.409 0.77 0 0.632 0.368 0 0.000
#> GSM573773 2 0.409 0.77 0 0.632 0.368 0 0.000
#> GSM573759 2 0.000 0.87 0 1.000 0.000 0 0.000
#> GSM573760 2 0.000 0.87 0 1.000 0.000 0 0.000
#> GSM573761 2 0.000 0.87 0 1.000 0.000 0 0.000
#> GSM573774 2 0.000 0.87 0 1.000 0.000 0 0.000
#> GSM573775 2 0.000 0.87 0 1.000 0.000 0 0.000
#> GSM573776 2 0.000 0.87 0 1.000 0.000 0 0.000
#> GSM573756 2 0.000 0.87 0 1.000 0.000 0 0.000
#> GSM573757 2 0.000 0.87 0 1.000 0.000 0 0.000
#> GSM573758 2 0.000 0.87 0 1.000 0.000 0 0.000
#> GSM573708 5 0.000 1.00 0 0.000 0.000 0 1.000
#> GSM573709 5 0.000 1.00 0 0.000 0.000 0 1.000
#> GSM573710 5 0.000 1.00 0 0.000 0.000 0 1.000
#> GSM573711 5 0.000 1.00 0 0.000 0.000 0 1.000
#> GSM573712 5 0.000 1.00 0 0.000 0.000 0 1.000
#> GSM573713 5 0.000 1.00 0 0.000 0.000 0 1.000
#> GSM573717 3 0.409 1.00 0 0.000 0.632 0 0.368
#> GSM573718 3 0.409 1.00 0 0.000 0.632 0 0.368
#> GSM573719 3 0.409 1.00 0 0.000 0.632 0 0.368
#> GSM573714 3 0.409 1.00 0 0.000 0.632 0 0.368
#> GSM573715 3 0.409 1.00 0 0.000 0.632 0 0.368
#> GSM573716 3 0.409 1.00 0 0.000 0.632 0 0.368
#> GSM573780 5 0.000 1.00 0 0.000 0.000 0 1.000
#> GSM573781 5 0.000 1.00 0 0.000 0.000 0 1.000
#> GSM573782 5 0.000 1.00 0 0.000 0.000 0 1.000
#> GSM573705 3 0.409 1.00 0 0.000 0.632 0 0.368
#> GSM573706 3 0.409 1.00 0 0.000 0.632 0 0.368
#> GSM573707 3 0.409 1.00 0 0.000 0.632 0 0.368
#> GSM573702 3 0.409 1.00 0 0.000 0.632 0 0.368
#> GSM573703 3 0.409 1.00 0 0.000 0.632 0 0.368
#> GSM573704 3 0.409 1.00 0 0.000 0.632 0 0.368
#> GSM573783 3 0.409 1.00 0 0.000 0.632 0 0.368
#> GSM573784 3 0.409 1.00 0 0.000 0.632 0 0.368
#> GSM573785 3 0.409 1.00 0 0.000 0.632 0 0.368
#> GSM573744 4 0.000 1.00 0 0.000 0.000 1 0.000
#> GSM573745 4 0.000 1.00 0 0.000 0.000 1 0.000
#> GSM573746 4 0.000 1.00 0 0.000 0.000 1 0.000
#> GSM573747 4 0.000 1.00 0 0.000 0.000 1 0.000
#> GSM573748 4 0.000 1.00 0 0.000 0.000 1 0.000
#> GSM573749 4 0.000 1.00 0 0.000 0.000 1 0.000
#> GSM573753 4 0.000 1.00 0 0.000 0.000 1 0.000
#> GSM573754 4 0.000 1.00 0 0.000 0.000 1 0.000
#> GSM573755 4 0.000 1.00 0 0.000 0.000 1 0.000
#> GSM573750 4 0.000 1.00 0 0.000 0.000 1 0.000
#> GSM573751 4 0.000 1.00 0 0.000 0.000 1 0.000
#> GSM573752 4 0.000 1.00 0 0.000 0.000 1 0.000
#> GSM573795 4 0.000 1.00 0 0.000 0.000 1 0.000
#> GSM573796 4 0.000 1.00 0 0.000 0.000 1 0.000
#> GSM573797 4 0.000 1.00 0 0.000 0.000 1 0.000
#> GSM573741 4 0.000 1.00 0 0.000 0.000 1 0.000
#> GSM573742 4 0.000 1.00 0 0.000 0.000 1 0.000
#> GSM573743 4 0.000 1.00 0 0.000 0.000 1 0.000
#> GSM573738 4 0.000 1.00 0 0.000 0.000 1 0.000
#> GSM573739 4 0.000 1.00 0 0.000 0.000 1 0.000
#> GSM573740 4 0.000 1.00 0 0.000 0.000 1 0.000
#> GSM573792 4 0.000 1.00 0 0.000 0.000 1 0.000
#> GSM573793 4 0.000 1.00 0 0.000 0.000 1 0.000
#> GSM573794 4 0.000 1.00 0 0.000 0.000 1 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM573726 1 0.3860 1.000 0.528 0.472 0 0.000 0 0.000
#> GSM573727 1 0.3860 1.000 0.528 0.472 0 0.000 0 0.000
#> GSM573728 1 0.3860 1.000 0.528 0.472 0 0.000 0 0.000
#> GSM573729 1 0.3860 1.000 0.528 0.472 0 0.000 0 0.000
#> GSM573730 1 0.3860 1.000 0.528 0.472 0 0.000 0 0.000
#> GSM573731 1 0.3860 1.000 0.528 0.472 0 0.000 0 0.000
#> GSM573735 1 0.3860 1.000 0.528 0.472 0 0.000 0 0.000
#> GSM573736 1 0.3860 1.000 0.528 0.472 0 0.000 0 0.000
#> GSM573737 1 0.3860 1.000 0.528 0.472 0 0.000 0 0.000
#> GSM573732 1 0.3860 1.000 0.528 0.472 0 0.000 0 0.000
#> GSM573733 1 0.3860 1.000 0.528 0.472 0 0.000 0 0.000
#> GSM573734 1 0.3860 1.000 0.528 0.472 0 0.000 0 0.000
#> GSM573789 1 0.3860 1.000 0.528 0.472 0 0.000 0 0.000
#> GSM573790 1 0.3860 1.000 0.528 0.472 0 0.000 0 0.000
#> GSM573791 1 0.3860 1.000 0.528 0.472 0 0.000 0 0.000
#> GSM573723 1 0.3860 1.000 0.528 0.472 0 0.000 0 0.000
#> GSM573724 1 0.3860 1.000 0.528 0.472 0 0.000 0 0.000
#> GSM573725 1 0.3860 1.000 0.528 0.472 0 0.000 0 0.000
#> GSM573720 1 0.3860 1.000 0.528 0.472 0 0.000 0 0.000
#> GSM573721 1 0.3860 1.000 0.528 0.472 0 0.000 0 0.000
#> GSM573722 1 0.3860 1.000 0.528 0.472 0 0.000 0 0.000
#> GSM573786 1 0.3860 1.000 0.528 0.472 0 0.000 0 0.000
#> GSM573787 1 0.3860 1.000 0.528 0.472 0 0.000 0 0.000
#> GSM573788 1 0.3860 1.000 0.528 0.472 0 0.000 0 0.000
#> GSM573768 2 0.3860 1.000 0.472 0.528 0 0.000 0 0.000
#> GSM573769 2 0.3860 1.000 0.472 0.528 0 0.000 0 0.000
#> GSM573770 2 0.3860 1.000 0.472 0.528 0 0.000 0 0.000
#> GSM573765 2 0.3860 1.000 0.472 0.528 0 0.000 0 0.000
#> GSM573766 2 0.3860 1.000 0.472 0.528 0 0.000 0 0.000
#> GSM573767 2 0.3860 1.000 0.472 0.528 0 0.000 0 0.000
#> GSM573777 6 0.3860 1.000 0.472 0.000 0 0.000 0 0.528
#> GSM573778 6 0.3860 1.000 0.472 0.000 0 0.000 0 0.528
#> GSM573779 6 0.3860 1.000 0.472 0.000 0 0.000 0 0.528
#> GSM573762 6 0.3860 1.000 0.472 0.000 0 0.000 0 0.528
#> GSM573763 6 0.3860 1.000 0.472 0.000 0 0.000 0 0.528
#> GSM573764 6 0.3860 1.000 0.472 0.000 0 0.000 0 0.528
#> GSM573771 6 0.3860 1.000 0.472 0.000 0 0.000 0 0.528
#> GSM573772 6 0.3860 1.000 0.472 0.000 0 0.000 0 0.528
#> GSM573773 6 0.3860 1.000 0.472 0.000 0 0.000 0 0.528
#> GSM573759 2 0.3860 1.000 0.472 0.528 0 0.000 0 0.000
#> GSM573760 2 0.3860 1.000 0.472 0.528 0 0.000 0 0.000
#> GSM573761 2 0.3860 1.000 0.472 0.528 0 0.000 0 0.000
#> GSM573774 2 0.3860 1.000 0.472 0.528 0 0.000 0 0.000
#> GSM573775 2 0.3860 1.000 0.472 0.528 0 0.000 0 0.000
#> GSM573776 2 0.3860 1.000 0.472 0.528 0 0.000 0 0.000
#> GSM573756 2 0.3860 1.000 0.472 0.528 0 0.000 0 0.000
#> GSM573757 2 0.3860 1.000 0.472 0.528 0 0.000 0 0.000
#> GSM573758 2 0.3860 1.000 0.472 0.528 0 0.000 0 0.000
#> GSM573708 5 0.0000 1.000 0.000 0.000 0 0.000 1 0.000
#> GSM573709 5 0.0000 1.000 0.000 0.000 0 0.000 1 0.000
#> GSM573710 5 0.0000 1.000 0.000 0.000 0 0.000 1 0.000
#> GSM573711 5 0.0000 1.000 0.000 0.000 0 0.000 1 0.000
#> GSM573712 5 0.0000 1.000 0.000 0.000 0 0.000 1 0.000
#> GSM573713 5 0.0000 1.000 0.000 0.000 0 0.000 1 0.000
#> GSM573717 3 0.0000 1.000 0.000 0.000 1 0.000 0 0.000
#> GSM573718 3 0.0000 1.000 0.000 0.000 1 0.000 0 0.000
#> GSM573719 3 0.0000 1.000 0.000 0.000 1 0.000 0 0.000
#> GSM573714 3 0.0000 1.000 0.000 0.000 1 0.000 0 0.000
#> GSM573715 3 0.0000 1.000 0.000 0.000 1 0.000 0 0.000
#> GSM573716 3 0.0000 1.000 0.000 0.000 1 0.000 0 0.000
#> GSM573780 5 0.0000 1.000 0.000 0.000 0 0.000 1 0.000
#> GSM573781 5 0.0000 1.000 0.000 0.000 0 0.000 1 0.000
#> GSM573782 5 0.0000 1.000 0.000 0.000 0 0.000 1 0.000
#> GSM573705 3 0.0000 1.000 0.000 0.000 1 0.000 0 0.000
#> GSM573706 3 0.0000 1.000 0.000 0.000 1 0.000 0 0.000
#> GSM573707 3 0.0000 1.000 0.000 0.000 1 0.000 0 0.000
#> GSM573702 3 0.0000 1.000 0.000 0.000 1 0.000 0 0.000
#> GSM573703 3 0.0000 1.000 0.000 0.000 1 0.000 0 0.000
#> GSM573704 3 0.0000 1.000 0.000 0.000 1 0.000 0 0.000
#> GSM573783 3 0.0000 1.000 0.000 0.000 1 0.000 0 0.000
#> GSM573784 3 0.0000 1.000 0.000 0.000 1 0.000 0 0.000
#> GSM573785 3 0.0000 1.000 0.000 0.000 1 0.000 0 0.000
#> GSM573744 4 0.3851 0.828 0.000 0.000 0 0.540 0 0.460
#> GSM573745 4 0.3851 0.828 0.000 0.000 0 0.540 0 0.460
#> GSM573746 4 0.3851 0.828 0.000 0.000 0 0.540 0 0.460
#> GSM573747 4 0.3851 0.828 0.000 0.000 0 0.540 0 0.460
#> GSM573748 4 0.3851 0.828 0.000 0.000 0 0.540 0 0.460
#> GSM573749 4 0.3851 0.828 0.000 0.000 0 0.540 0 0.460
#> GSM573753 4 0.0000 0.687 0.000 0.000 0 1.000 0 0.000
#> GSM573754 4 0.0000 0.687 0.000 0.000 0 1.000 0 0.000
#> GSM573755 4 0.0000 0.687 0.000 0.000 0 1.000 0 0.000
#> GSM573750 4 0.0000 0.687 0.000 0.000 0 1.000 0 0.000
#> GSM573751 4 0.0000 0.687 0.000 0.000 0 1.000 0 0.000
#> GSM573752 4 0.0000 0.687 0.000 0.000 0 1.000 0 0.000
#> GSM573795 4 0.0363 0.680 0.000 0.000 0 0.988 0 0.012
#> GSM573796 4 0.0363 0.680 0.000 0.000 0 0.988 0 0.012
#> GSM573797 4 0.0363 0.680 0.000 0.000 0 0.988 0 0.012
#> GSM573741 4 0.3851 0.828 0.000 0.000 0 0.540 0 0.460
#> GSM573742 4 0.3851 0.828 0.000 0.000 0 0.540 0 0.460
#> GSM573743 4 0.3851 0.828 0.000 0.000 0 0.540 0 0.460
#> GSM573738 4 0.3851 0.828 0.000 0.000 0 0.540 0 0.460
#> GSM573739 4 0.3851 0.828 0.000 0.000 0 0.540 0 0.460
#> GSM573740 4 0.3851 0.828 0.000 0.000 0 0.540 0 0.460
#> GSM573792 4 0.3851 0.828 0.000 0.000 0 0.540 0 0.460
#> GSM573793 4 0.3851 0.828 0.000 0.000 0 0.540 0 0.460
#> GSM573794 4 0.3851 0.828 0.000 0.000 0 0.540 0 0.460
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
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)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
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:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.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")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
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 cell.line(p) agent(p) k
#> CV:hclust 96 1.13e-20 0.17295 2
#> CV:hclust 96 9.56e-39 0.74101 3
#> CV:hclust 96 9.14e-57 0.97496 4
#> CV:hclust 96 1.55e-54 0.17576 5
#> CV:hclust 96 1.73e-52 0.00229 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.
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 46609 rows and 96 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'CV' method.
#> Subgroups are detected by 'kmeans' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 3.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.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:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).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)
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.242 0.459 0.567 0.4226 0.495 0.495
#> 3 3 0.495 0.645 0.673 0.4542 0.621 0.390
#> 4 4 0.695 0.965 0.871 0.1734 0.874 0.657
#> 5 5 0.893 0.896 0.863 0.0686 1.000 1.000
#> 6 6 0.847 0.835 0.823 0.0365 1.000 1.000
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 3
Following shows the table of the partitions (You need to click the show/hide
code output link to see it). The membership matrix (columns with name p*
)
is inferred by
clue::cl_consensus()
function with the SE
method. Basically the value in the membership matrix
represents the probability to belong to a certain group. The finall class
label for an item is determined with the group with highest probability it
belongs to.
In get_classes()
function, the entropy is calculated from the membership
matrix and the silhouette score is calculated from the consensus matrix.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> GSM573726 1 0.917 0.664 0.668 0.332
#> GSM573727 1 0.917 0.664 0.668 0.332
#> GSM573728 1 0.917 0.664 0.668 0.332
#> GSM573729 1 0.917 0.664 0.668 0.332
#> GSM573730 1 0.917 0.664 0.668 0.332
#> GSM573731 1 0.917 0.664 0.668 0.332
#> GSM573735 1 0.917 0.664 0.668 0.332
#> GSM573736 1 0.917 0.664 0.668 0.332
#> GSM573737 1 0.917 0.664 0.668 0.332
#> GSM573732 1 0.917 0.664 0.668 0.332
#> GSM573733 1 0.917 0.664 0.668 0.332
#> GSM573734 1 0.917 0.664 0.668 0.332
#> GSM573789 1 0.917 0.664 0.668 0.332
#> GSM573790 1 0.917 0.664 0.668 0.332
#> GSM573791 1 0.917 0.664 0.668 0.332
#> GSM573723 1 0.917 0.664 0.668 0.332
#> GSM573724 1 0.917 0.664 0.668 0.332
#> GSM573725 1 0.917 0.664 0.668 0.332
#> GSM573720 1 0.917 0.664 0.668 0.332
#> GSM573721 1 0.917 0.664 0.668 0.332
#> GSM573722 1 0.917 0.664 0.668 0.332
#> GSM573786 1 0.917 0.664 0.668 0.332
#> GSM573787 1 0.917 0.664 0.668 0.332
#> GSM573788 1 0.917 0.664 0.668 0.332
#> GSM573768 2 0.999 0.374 0.480 0.520
#> GSM573769 2 0.999 0.374 0.480 0.520
#> GSM573770 2 0.999 0.374 0.480 0.520
#> GSM573765 2 0.999 0.374 0.480 0.520
#> GSM573766 2 0.999 0.374 0.480 0.520
#> GSM573767 2 0.999 0.374 0.480 0.520
#> GSM573777 2 0.999 0.374 0.480 0.520
#> GSM573778 2 0.999 0.374 0.480 0.520
#> GSM573779 2 0.999 0.374 0.480 0.520
#> GSM573762 2 0.999 0.374 0.480 0.520
#> GSM573763 2 0.999 0.374 0.480 0.520
#> GSM573764 2 0.999 0.374 0.480 0.520
#> GSM573771 2 0.999 0.374 0.480 0.520
#> GSM573772 2 0.999 0.374 0.480 0.520
#> GSM573773 2 0.999 0.374 0.480 0.520
#> GSM573759 2 0.999 0.374 0.480 0.520
#> GSM573760 2 0.999 0.374 0.480 0.520
#> GSM573761 2 0.999 0.374 0.480 0.520
#> GSM573774 2 0.999 0.374 0.480 0.520
#> GSM573775 2 0.999 0.374 0.480 0.520
#> GSM573776 2 0.999 0.374 0.480 0.520
#> GSM573756 2 0.999 0.374 0.480 0.520
#> GSM573757 2 0.999 0.374 0.480 0.520
#> GSM573758 2 0.999 0.374 0.480 0.520
#> GSM573708 2 0.980 0.127 0.416 0.584
#> GSM573709 2 0.980 0.127 0.416 0.584
#> GSM573710 2 0.980 0.127 0.416 0.584
#> GSM573711 2 0.980 0.127 0.416 0.584
#> GSM573712 2 0.980 0.127 0.416 0.584
#> GSM573713 2 0.980 0.127 0.416 0.584
#> GSM573717 2 0.980 0.127 0.416 0.584
#> GSM573718 2 0.980 0.127 0.416 0.584
#> GSM573719 2 0.980 0.127 0.416 0.584
#> GSM573714 2 0.980 0.127 0.416 0.584
#> GSM573715 2 0.980 0.127 0.416 0.584
#> GSM573716 2 0.980 0.127 0.416 0.584
#> GSM573780 2 0.980 0.127 0.416 0.584
#> GSM573781 2 0.980 0.127 0.416 0.584
#> GSM573782 2 0.980 0.127 0.416 0.584
#> GSM573705 2 0.980 0.127 0.416 0.584
#> GSM573706 2 0.980 0.127 0.416 0.584
#> GSM573707 2 0.980 0.127 0.416 0.584
#> GSM573702 2 0.980 0.127 0.416 0.584
#> GSM573703 2 0.980 0.127 0.416 0.584
#> GSM573704 2 0.980 0.127 0.416 0.584
#> GSM573783 2 0.980 0.127 0.416 0.584
#> GSM573784 2 0.980 0.127 0.416 0.584
#> GSM573785 2 0.980 0.127 0.416 0.584
#> GSM573744 1 0.000 0.671 1.000 0.000
#> GSM573745 1 0.000 0.671 1.000 0.000
#> GSM573746 1 0.000 0.671 1.000 0.000
#> GSM573747 1 0.000 0.671 1.000 0.000
#> GSM573748 1 0.000 0.671 1.000 0.000
#> GSM573749 1 0.000 0.671 1.000 0.000
#> GSM573753 1 0.000 0.671 1.000 0.000
#> GSM573754 1 0.000 0.671 1.000 0.000
#> GSM573755 1 0.000 0.671 1.000 0.000
#> GSM573750 1 0.000 0.671 1.000 0.000
#> GSM573751 1 0.000 0.671 1.000 0.000
#> GSM573752 1 0.000 0.671 1.000 0.000
#> GSM573795 1 0.000 0.671 1.000 0.000
#> GSM573796 1 0.000 0.671 1.000 0.000
#> GSM573797 1 0.000 0.671 1.000 0.000
#> GSM573741 1 0.000 0.671 1.000 0.000
#> GSM573742 1 0.000 0.671 1.000 0.000
#> GSM573743 1 0.000 0.671 1.000 0.000
#> GSM573738 1 0.000 0.671 1.000 0.000
#> GSM573739 1 0.000 0.671 1.000 0.000
#> GSM573740 1 0.000 0.671 1.000 0.000
#> GSM573792 1 0.000 0.671 1.000 0.000
#> GSM573793 1 0.000 0.671 1.000 0.000
#> GSM573794 1 0.000 0.671 1.000 0.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM573726 1 0.1753 1.000 0.952 0.048 0.000
#> GSM573727 1 0.1753 1.000 0.952 0.048 0.000
#> GSM573728 1 0.1753 1.000 0.952 0.048 0.000
#> GSM573729 1 0.1753 1.000 0.952 0.048 0.000
#> GSM573730 1 0.1753 1.000 0.952 0.048 0.000
#> GSM573731 1 0.1753 1.000 0.952 0.048 0.000
#> GSM573735 1 0.1753 1.000 0.952 0.048 0.000
#> GSM573736 1 0.1753 1.000 0.952 0.048 0.000
#> GSM573737 1 0.1753 1.000 0.952 0.048 0.000
#> GSM573732 1 0.1753 1.000 0.952 0.048 0.000
#> GSM573733 1 0.1753 1.000 0.952 0.048 0.000
#> GSM573734 1 0.1753 1.000 0.952 0.048 0.000
#> GSM573789 1 0.1753 1.000 0.952 0.048 0.000
#> GSM573790 1 0.1753 1.000 0.952 0.048 0.000
#> GSM573791 1 0.1753 1.000 0.952 0.048 0.000
#> GSM573723 1 0.1753 1.000 0.952 0.048 0.000
#> GSM573724 1 0.1753 1.000 0.952 0.048 0.000
#> GSM573725 1 0.1753 1.000 0.952 0.048 0.000
#> GSM573720 1 0.1753 1.000 0.952 0.048 0.000
#> GSM573721 1 0.1753 1.000 0.952 0.048 0.000
#> GSM573722 1 0.1753 1.000 0.952 0.048 0.000
#> GSM573786 1 0.1753 1.000 0.952 0.048 0.000
#> GSM573787 1 0.1753 1.000 0.952 0.048 0.000
#> GSM573788 1 0.1753 1.000 0.952 0.048 0.000
#> GSM573768 2 0.0237 0.984 0.004 0.996 0.000
#> GSM573769 2 0.0237 0.984 0.004 0.996 0.000
#> GSM573770 2 0.0237 0.984 0.004 0.996 0.000
#> GSM573765 2 0.0237 0.984 0.004 0.996 0.000
#> GSM573766 2 0.0237 0.984 0.004 0.996 0.000
#> GSM573767 2 0.0237 0.984 0.004 0.996 0.000
#> GSM573777 2 0.2096 0.973 0.004 0.944 0.052
#> GSM573778 2 0.2096 0.973 0.004 0.944 0.052
#> GSM573779 2 0.2096 0.973 0.004 0.944 0.052
#> GSM573762 2 0.2096 0.973 0.004 0.944 0.052
#> GSM573763 2 0.2096 0.973 0.004 0.944 0.052
#> GSM573764 2 0.2096 0.973 0.004 0.944 0.052
#> GSM573771 2 0.2096 0.973 0.004 0.944 0.052
#> GSM573772 2 0.2096 0.973 0.004 0.944 0.052
#> GSM573773 2 0.2096 0.973 0.004 0.944 0.052
#> GSM573759 2 0.0237 0.984 0.004 0.996 0.000
#> GSM573760 2 0.0237 0.984 0.004 0.996 0.000
#> GSM573761 2 0.0237 0.984 0.004 0.996 0.000
#> GSM573774 2 0.0237 0.984 0.004 0.996 0.000
#> GSM573775 2 0.0237 0.984 0.004 0.996 0.000
#> GSM573776 2 0.0237 0.984 0.004 0.996 0.000
#> GSM573756 2 0.0237 0.984 0.004 0.996 0.000
#> GSM573757 2 0.0237 0.984 0.004 0.996 0.000
#> GSM573758 2 0.0237 0.984 0.004 0.996 0.000
#> GSM573708 3 0.7056 0.278 0.404 0.024 0.572
#> GSM573709 3 0.7056 0.278 0.404 0.024 0.572
#> GSM573710 3 0.7056 0.278 0.404 0.024 0.572
#> GSM573711 3 0.7056 0.278 0.404 0.024 0.572
#> GSM573712 3 0.7056 0.278 0.404 0.024 0.572
#> GSM573713 3 0.7056 0.278 0.404 0.024 0.572
#> GSM573717 3 0.6985 0.281 0.384 0.024 0.592
#> GSM573718 3 0.6985 0.281 0.384 0.024 0.592
#> GSM573719 3 0.6985 0.281 0.384 0.024 0.592
#> GSM573714 3 0.6985 0.281 0.384 0.024 0.592
#> GSM573715 3 0.6985 0.281 0.384 0.024 0.592
#> GSM573716 3 0.6985 0.281 0.384 0.024 0.592
#> GSM573780 3 0.7069 0.277 0.408 0.024 0.568
#> GSM573781 3 0.7069 0.277 0.408 0.024 0.568
#> GSM573782 3 0.7069 0.277 0.408 0.024 0.568
#> GSM573705 3 0.6985 0.281 0.384 0.024 0.592
#> GSM573706 3 0.6985 0.281 0.384 0.024 0.592
#> GSM573707 3 0.6985 0.281 0.384 0.024 0.592
#> GSM573702 3 0.6985 0.281 0.384 0.024 0.592
#> GSM573703 3 0.6985 0.281 0.384 0.024 0.592
#> GSM573704 3 0.6985 0.281 0.384 0.024 0.592
#> GSM573783 3 0.7001 0.280 0.388 0.024 0.588
#> GSM573784 3 0.7001 0.280 0.388 0.024 0.588
#> GSM573785 3 0.7001 0.280 0.388 0.024 0.588
#> GSM573744 3 0.9683 0.319 0.368 0.216 0.416
#> GSM573745 3 0.9683 0.319 0.368 0.216 0.416
#> GSM573746 3 0.9683 0.319 0.368 0.216 0.416
#> GSM573747 3 0.9683 0.319 0.368 0.216 0.416
#> GSM573748 3 0.9683 0.319 0.368 0.216 0.416
#> GSM573749 3 0.9683 0.319 0.368 0.216 0.416
#> GSM573753 3 0.9706 0.319 0.368 0.220 0.412
#> GSM573754 3 0.9706 0.319 0.368 0.220 0.412
#> GSM573755 3 0.9706 0.319 0.368 0.220 0.412
#> GSM573750 3 0.9706 0.319 0.368 0.220 0.412
#> GSM573751 3 0.9706 0.319 0.368 0.220 0.412
#> GSM573752 3 0.9706 0.319 0.368 0.220 0.412
#> GSM573795 3 0.9706 0.319 0.368 0.220 0.412
#> GSM573796 3 0.9706 0.319 0.368 0.220 0.412
#> GSM573797 3 0.9706 0.319 0.368 0.220 0.412
#> GSM573741 3 0.9683 0.319 0.368 0.216 0.416
#> GSM573742 3 0.9683 0.319 0.368 0.216 0.416
#> GSM573743 3 0.9683 0.319 0.368 0.216 0.416
#> GSM573738 3 0.9683 0.319 0.368 0.216 0.416
#> GSM573739 3 0.9683 0.319 0.368 0.216 0.416
#> GSM573740 3 0.9683 0.319 0.368 0.216 0.416
#> GSM573792 3 0.9683 0.319 0.368 0.216 0.416
#> GSM573793 3 0.9683 0.319 0.368 0.216 0.416
#> GSM573794 3 0.9683 0.319 0.368 0.216 0.416
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM573726 1 0.5869 0.987 0.724 0.012 0.100 0.164
#> GSM573727 1 0.5869 0.987 0.724 0.012 0.100 0.164
#> GSM573728 1 0.5869 0.987 0.724 0.012 0.100 0.164
#> GSM573729 1 0.5869 0.987 0.724 0.012 0.100 0.164
#> GSM573730 1 0.5869 0.987 0.724 0.012 0.100 0.164
#> GSM573731 1 0.5869 0.987 0.724 0.012 0.100 0.164
#> GSM573735 1 0.6391 0.976 0.692 0.024 0.100 0.184
#> GSM573736 1 0.6391 0.976 0.692 0.024 0.100 0.184
#> GSM573737 1 0.6391 0.976 0.692 0.024 0.100 0.184
#> GSM573732 1 0.6391 0.976 0.692 0.024 0.100 0.184
#> GSM573733 1 0.6391 0.976 0.692 0.024 0.100 0.184
#> GSM573734 1 0.6391 0.976 0.692 0.024 0.100 0.184
#> GSM573789 1 0.6186 0.980 0.700 0.016 0.100 0.184
#> GSM573790 1 0.6186 0.980 0.700 0.016 0.100 0.184
#> GSM573791 1 0.6186 0.980 0.700 0.016 0.100 0.184
#> GSM573723 1 0.5869 0.987 0.724 0.012 0.100 0.164
#> GSM573724 1 0.5869 0.987 0.724 0.012 0.100 0.164
#> GSM573725 1 0.5869 0.987 0.724 0.012 0.100 0.164
#> GSM573720 1 0.5869 0.987 0.724 0.012 0.100 0.164
#> GSM573721 1 0.5869 0.987 0.724 0.012 0.100 0.164
#> GSM573722 1 0.5869 0.987 0.724 0.012 0.100 0.164
#> GSM573786 1 0.6186 0.980 0.700 0.016 0.100 0.184
#> GSM573787 1 0.6186 0.980 0.700 0.016 0.100 0.184
#> GSM573788 1 0.6186 0.980 0.700 0.016 0.100 0.184
#> GSM573768 2 0.0592 0.959 0.000 0.984 0.016 0.000
#> GSM573769 2 0.0592 0.959 0.000 0.984 0.016 0.000
#> GSM573770 2 0.0592 0.959 0.000 0.984 0.016 0.000
#> GSM573765 2 0.0592 0.959 0.000 0.984 0.016 0.000
#> GSM573766 2 0.0592 0.959 0.000 0.984 0.016 0.000
#> GSM573767 2 0.0592 0.959 0.000 0.984 0.016 0.000
#> GSM573777 2 0.3798 0.930 0.120 0.848 0.016 0.016
#> GSM573778 2 0.3798 0.930 0.120 0.848 0.016 0.016
#> GSM573779 2 0.3798 0.930 0.120 0.848 0.016 0.016
#> GSM573762 2 0.3798 0.930 0.120 0.848 0.016 0.016
#> GSM573763 2 0.3798 0.930 0.120 0.848 0.016 0.016
#> GSM573764 2 0.3798 0.930 0.120 0.848 0.016 0.016
#> GSM573771 2 0.3798 0.930 0.120 0.848 0.016 0.016
#> GSM573772 2 0.3798 0.930 0.120 0.848 0.016 0.016
#> GSM573773 2 0.3798 0.930 0.120 0.848 0.016 0.016
#> GSM573759 2 0.0592 0.959 0.000 0.984 0.016 0.000
#> GSM573760 2 0.0592 0.959 0.000 0.984 0.016 0.000
#> GSM573761 2 0.0592 0.959 0.000 0.984 0.016 0.000
#> GSM573774 2 0.0592 0.959 0.000 0.984 0.016 0.000
#> GSM573775 2 0.0592 0.959 0.000 0.984 0.016 0.000
#> GSM573776 2 0.0592 0.959 0.000 0.984 0.016 0.000
#> GSM573756 2 0.0592 0.959 0.000 0.984 0.016 0.000
#> GSM573757 2 0.0592 0.959 0.000 0.984 0.016 0.000
#> GSM573758 2 0.0592 0.959 0.000 0.984 0.016 0.000
#> GSM573708 3 0.3182 0.931 0.096 0.000 0.876 0.028
#> GSM573709 3 0.3182 0.931 0.096 0.000 0.876 0.028
#> GSM573710 3 0.3182 0.931 0.096 0.000 0.876 0.028
#> GSM573711 3 0.3182 0.931 0.096 0.000 0.876 0.028
#> GSM573712 3 0.3182 0.931 0.096 0.000 0.876 0.028
#> GSM573713 3 0.3182 0.931 0.096 0.000 0.876 0.028
#> GSM573717 3 0.0000 0.958 0.000 0.000 1.000 0.000
#> GSM573718 3 0.0000 0.958 0.000 0.000 1.000 0.000
#> GSM573719 3 0.0000 0.958 0.000 0.000 1.000 0.000
#> GSM573714 3 0.0000 0.958 0.000 0.000 1.000 0.000
#> GSM573715 3 0.0000 0.958 0.000 0.000 1.000 0.000
#> GSM573716 3 0.0000 0.958 0.000 0.000 1.000 0.000
#> GSM573780 3 0.3616 0.923 0.112 0.000 0.852 0.036
#> GSM573781 3 0.3616 0.923 0.112 0.000 0.852 0.036
#> GSM573782 3 0.3616 0.923 0.112 0.000 0.852 0.036
#> GSM573705 3 0.0000 0.958 0.000 0.000 1.000 0.000
#> GSM573706 3 0.0000 0.958 0.000 0.000 1.000 0.000
#> GSM573707 3 0.0000 0.958 0.000 0.000 1.000 0.000
#> GSM573702 3 0.0000 0.958 0.000 0.000 1.000 0.000
#> GSM573703 3 0.0000 0.958 0.000 0.000 1.000 0.000
#> GSM573704 3 0.0000 0.958 0.000 0.000 1.000 0.000
#> GSM573783 3 0.0657 0.954 0.012 0.000 0.984 0.004
#> GSM573784 3 0.0657 0.954 0.012 0.000 0.984 0.004
#> GSM573785 3 0.0657 0.954 0.012 0.000 0.984 0.004
#> GSM573744 4 0.2644 0.986 0.000 0.060 0.032 0.908
#> GSM573745 4 0.2644 0.986 0.000 0.060 0.032 0.908
#> GSM573746 4 0.2644 0.986 0.000 0.060 0.032 0.908
#> GSM573747 4 0.2644 0.986 0.000 0.060 0.032 0.908
#> GSM573748 4 0.2644 0.986 0.000 0.060 0.032 0.908
#> GSM573749 4 0.2644 0.986 0.000 0.060 0.032 0.908
#> GSM573753 4 0.3827 0.977 0.040 0.060 0.032 0.868
#> GSM573754 4 0.3827 0.977 0.040 0.060 0.032 0.868
#> GSM573755 4 0.3827 0.977 0.040 0.060 0.032 0.868
#> GSM573750 4 0.3827 0.977 0.040 0.060 0.032 0.868
#> GSM573751 4 0.3827 0.977 0.040 0.060 0.032 0.868
#> GSM573752 4 0.3827 0.977 0.040 0.060 0.032 0.868
#> GSM573795 4 0.3915 0.976 0.044 0.060 0.032 0.864
#> GSM573796 4 0.3915 0.976 0.044 0.060 0.032 0.864
#> GSM573797 4 0.3915 0.976 0.044 0.060 0.032 0.864
#> GSM573741 4 0.2644 0.986 0.000 0.060 0.032 0.908
#> GSM573742 4 0.2644 0.986 0.000 0.060 0.032 0.908
#> GSM573743 4 0.2644 0.986 0.000 0.060 0.032 0.908
#> GSM573738 4 0.2644 0.986 0.000 0.060 0.032 0.908
#> GSM573739 4 0.2644 0.986 0.000 0.060 0.032 0.908
#> GSM573740 4 0.2644 0.986 0.000 0.060 0.032 0.908
#> GSM573792 4 0.2830 0.985 0.004 0.060 0.032 0.904
#> GSM573793 4 0.2830 0.985 0.004 0.060 0.032 0.904
#> GSM573794 4 0.2830 0.985 0.004 0.060 0.032 0.904
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM573726 1 0.2370 0.970 0.904 0.000 0.040 0.056 NA
#> GSM573727 1 0.2370 0.970 0.904 0.000 0.040 0.056 NA
#> GSM573728 1 0.2370 0.970 0.904 0.000 0.040 0.056 NA
#> GSM573729 1 0.2370 0.970 0.904 0.000 0.040 0.056 NA
#> GSM573730 1 0.2370 0.970 0.904 0.000 0.040 0.056 NA
#> GSM573731 1 0.2370 0.970 0.904 0.000 0.040 0.056 NA
#> GSM573735 1 0.4482 0.935 0.796 0.000 0.044 0.068 NA
#> GSM573736 1 0.4482 0.935 0.796 0.000 0.044 0.068 NA
#> GSM573737 1 0.4482 0.935 0.796 0.000 0.044 0.068 NA
#> GSM573732 1 0.4482 0.935 0.796 0.000 0.044 0.068 NA
#> GSM573733 1 0.4482 0.935 0.796 0.000 0.044 0.068 NA
#> GSM573734 1 0.4482 0.935 0.796 0.000 0.044 0.068 NA
#> GSM573789 1 0.3658 0.961 0.848 0.000 0.044 0.068 NA
#> GSM573790 1 0.3658 0.961 0.848 0.000 0.044 0.068 NA
#> GSM573791 1 0.3658 0.961 0.848 0.000 0.044 0.068 NA
#> GSM573723 1 0.2370 0.970 0.904 0.000 0.040 0.056 NA
#> GSM573724 1 0.2370 0.970 0.904 0.000 0.040 0.056 NA
#> GSM573725 1 0.2370 0.970 0.904 0.000 0.040 0.056 NA
#> GSM573720 1 0.2370 0.970 0.904 0.000 0.040 0.056 NA
#> GSM573721 1 0.2722 0.968 0.892 0.000 0.040 0.060 NA
#> GSM573722 1 0.2370 0.970 0.904 0.000 0.040 0.056 NA
#> GSM573786 1 0.3143 0.963 0.872 0.000 0.044 0.068 NA
#> GSM573787 1 0.3143 0.963 0.872 0.000 0.044 0.068 NA
#> GSM573788 1 0.3143 0.963 0.872 0.000 0.044 0.068 NA
#> GSM573768 2 0.0162 0.894 0.004 0.996 0.000 0.000 NA
#> GSM573769 2 0.0162 0.894 0.004 0.996 0.000 0.000 NA
#> GSM573770 2 0.0162 0.894 0.004 0.996 0.000 0.000 NA
#> GSM573765 2 0.0162 0.894 0.004 0.996 0.000 0.000 NA
#> GSM573766 2 0.0162 0.894 0.004 0.996 0.000 0.000 NA
#> GSM573767 2 0.0162 0.894 0.004 0.996 0.000 0.000 NA
#> GSM573777 2 0.4597 0.820 0.024 0.672 0.004 0.000 NA
#> GSM573778 2 0.4597 0.820 0.024 0.672 0.004 0.000 NA
#> GSM573779 2 0.4597 0.820 0.024 0.672 0.004 0.000 NA
#> GSM573762 2 0.4465 0.820 0.024 0.672 0.000 0.000 NA
#> GSM573763 2 0.4526 0.820 0.028 0.672 0.000 0.000 NA
#> GSM573764 2 0.4465 0.820 0.024 0.672 0.000 0.000 NA
#> GSM573771 2 0.4526 0.820 0.028 0.672 0.000 0.000 NA
#> GSM573772 2 0.4526 0.820 0.028 0.672 0.000 0.000 NA
#> GSM573773 2 0.4526 0.820 0.028 0.672 0.000 0.000 NA
#> GSM573759 2 0.0703 0.891 0.024 0.976 0.000 0.000 NA
#> GSM573760 2 0.0290 0.893 0.008 0.992 0.000 0.000 NA
#> GSM573761 2 0.0290 0.893 0.008 0.992 0.000 0.000 NA
#> GSM573774 2 0.0162 0.894 0.004 0.996 0.000 0.000 NA
#> GSM573775 2 0.0162 0.894 0.004 0.996 0.000 0.000 NA
#> GSM573776 2 0.0162 0.894 0.004 0.996 0.000 0.000 NA
#> GSM573756 2 0.0955 0.890 0.028 0.968 0.004 0.000 NA
#> GSM573757 2 0.0955 0.890 0.028 0.968 0.004 0.000 NA
#> GSM573758 2 0.0955 0.890 0.028 0.968 0.004 0.000 NA
#> GSM573708 3 0.4521 0.823 0.000 0.008 0.664 0.012 NA
#> GSM573709 3 0.4521 0.823 0.000 0.008 0.664 0.012 NA
#> GSM573710 3 0.4521 0.823 0.000 0.008 0.664 0.012 NA
#> GSM573711 3 0.4521 0.823 0.000 0.008 0.664 0.012 NA
#> GSM573712 3 0.4521 0.823 0.000 0.008 0.664 0.012 NA
#> GSM573713 3 0.4521 0.823 0.000 0.008 0.664 0.012 NA
#> GSM573717 3 0.0693 0.894 0.000 0.008 0.980 0.012 NA
#> GSM573718 3 0.0693 0.894 0.000 0.008 0.980 0.012 NA
#> GSM573719 3 0.0693 0.894 0.000 0.008 0.980 0.012 NA
#> GSM573714 3 0.0693 0.894 0.000 0.008 0.980 0.012 NA
#> GSM573715 3 0.0693 0.894 0.000 0.008 0.980 0.012 NA
#> GSM573716 3 0.0693 0.894 0.000 0.008 0.980 0.012 NA
#> GSM573780 3 0.4970 0.813 0.008 0.008 0.632 0.016 NA
#> GSM573781 3 0.4970 0.813 0.008 0.008 0.632 0.016 NA
#> GSM573782 3 0.4970 0.813 0.008 0.008 0.632 0.016 NA
#> GSM573705 3 0.0693 0.894 0.000 0.008 0.980 0.012 NA
#> GSM573706 3 0.0693 0.894 0.000 0.008 0.980 0.012 NA
#> GSM573707 3 0.0693 0.894 0.000 0.008 0.980 0.012 NA
#> GSM573702 3 0.0693 0.894 0.000 0.008 0.980 0.012 NA
#> GSM573703 3 0.0693 0.894 0.000 0.008 0.980 0.012 NA
#> GSM573704 3 0.0693 0.894 0.000 0.008 0.980 0.012 NA
#> GSM573783 3 0.2283 0.882 0.016 0.008 0.924 0.024 NA
#> GSM573784 3 0.2283 0.882 0.016 0.008 0.924 0.024 NA
#> GSM573785 3 0.2190 0.882 0.016 0.008 0.928 0.020 NA
#> GSM573744 4 0.0963 0.918 0.000 0.036 0.000 0.964 NA
#> GSM573745 4 0.0963 0.918 0.000 0.036 0.000 0.964 NA
#> GSM573746 4 0.0963 0.918 0.000 0.036 0.000 0.964 NA
#> GSM573747 4 0.0963 0.918 0.000 0.036 0.000 0.964 NA
#> GSM573748 4 0.0963 0.918 0.000 0.036 0.000 0.964 NA
#> GSM573749 4 0.0963 0.918 0.000 0.036 0.000 0.964 NA
#> GSM573753 4 0.4763 0.862 0.016 0.040 0.000 0.720 NA
#> GSM573754 4 0.4763 0.862 0.016 0.040 0.000 0.720 NA
#> GSM573755 4 0.4792 0.861 0.016 0.040 0.000 0.716 NA
#> GSM573750 4 0.4763 0.862 0.016 0.040 0.000 0.720 NA
#> GSM573751 4 0.4763 0.862 0.016 0.040 0.000 0.720 NA
#> GSM573752 4 0.4763 0.862 0.016 0.040 0.000 0.720 NA
#> GSM573795 4 0.5025 0.856 0.024 0.040 0.000 0.700 NA
#> GSM573796 4 0.5025 0.856 0.024 0.040 0.000 0.700 NA
#> GSM573797 4 0.5025 0.856 0.024 0.040 0.000 0.700 NA
#> GSM573741 4 0.0963 0.918 0.000 0.036 0.000 0.964 NA
#> GSM573742 4 0.0963 0.918 0.000 0.036 0.000 0.964 NA
#> GSM573743 4 0.0963 0.918 0.000 0.036 0.000 0.964 NA
#> GSM573738 4 0.0963 0.918 0.000 0.036 0.000 0.964 NA
#> GSM573739 4 0.0963 0.918 0.000 0.036 0.000 0.964 NA
#> GSM573740 4 0.0963 0.918 0.000 0.036 0.000 0.964 NA
#> GSM573792 4 0.2015 0.911 0.008 0.036 0.004 0.932 NA
#> GSM573793 4 0.2015 0.911 0.008 0.036 0.004 0.932 NA
#> GSM573794 4 0.2015 0.911 0.008 0.036 0.004 0.932 NA
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM573726 1 0.0000 0.929 1.000 0.000 0.000 0.000 NA 0.000
#> GSM573727 1 0.0000 0.929 1.000 0.000 0.000 0.000 NA 0.000
#> GSM573728 1 0.0146 0.929 0.996 0.000 0.004 0.000 NA 0.000
#> GSM573729 1 0.0146 0.929 0.996 0.000 0.004 0.000 NA 0.000
#> GSM573730 1 0.0146 0.929 0.996 0.000 0.004 0.000 NA 0.000
#> GSM573731 1 0.0146 0.929 0.996 0.000 0.004 0.000 NA 0.000
#> GSM573735 1 0.3247 0.873 0.808 0.000 0.000 0.000 NA 0.036
#> GSM573736 1 0.3247 0.873 0.808 0.000 0.000 0.000 NA 0.036
#> GSM573737 1 0.3247 0.873 0.808 0.000 0.000 0.000 NA 0.036
#> GSM573732 1 0.3247 0.873 0.808 0.000 0.000 0.000 NA 0.036
#> GSM573733 1 0.3247 0.873 0.808 0.000 0.000 0.000 NA 0.036
#> GSM573734 1 0.3247 0.873 0.808 0.000 0.000 0.000 NA 0.036
#> GSM573789 1 0.3492 0.884 0.816 0.000 0.000 0.008 NA 0.064
#> GSM573790 1 0.3492 0.884 0.816 0.000 0.000 0.008 NA 0.064
#> GSM573791 1 0.3492 0.884 0.816 0.000 0.000 0.008 NA 0.064
#> GSM573723 1 0.0000 0.929 1.000 0.000 0.000 0.000 NA 0.000
#> GSM573724 1 0.0000 0.929 1.000 0.000 0.000 0.000 NA 0.000
#> GSM573725 1 0.0000 0.929 1.000 0.000 0.000 0.000 NA 0.000
#> GSM573720 1 0.0000 0.929 1.000 0.000 0.000 0.000 NA 0.000
#> GSM573721 1 0.0622 0.925 0.980 0.000 0.000 0.000 NA 0.012
#> GSM573722 1 0.0000 0.929 1.000 0.000 0.000 0.000 NA 0.000
#> GSM573786 1 0.2680 0.892 0.868 0.000 0.000 0.000 NA 0.056
#> GSM573787 1 0.2680 0.892 0.868 0.000 0.000 0.000 NA 0.056
#> GSM573788 1 0.2680 0.892 0.868 0.000 0.000 0.000 NA 0.056
#> GSM573768 2 0.0146 0.851 0.000 0.996 0.000 0.004 NA 0.000
#> GSM573769 2 0.0000 0.851 0.000 1.000 0.000 0.000 NA 0.000
#> GSM573770 2 0.0000 0.851 0.000 1.000 0.000 0.000 NA 0.000
#> GSM573765 2 0.0000 0.851 0.000 1.000 0.000 0.000 NA 0.000
#> GSM573766 2 0.0000 0.851 0.000 1.000 0.000 0.000 NA 0.000
#> GSM573767 2 0.0000 0.851 0.000 1.000 0.000 0.000 NA 0.000
#> GSM573777 2 0.3923 0.763 0.000 0.580 0.000 0.000 NA 0.004
#> GSM573778 2 0.3923 0.763 0.000 0.580 0.000 0.000 NA 0.004
#> GSM573779 2 0.3797 0.763 0.000 0.580 0.000 0.000 NA 0.000
#> GSM573762 2 0.3797 0.763 0.000 0.580 0.000 0.000 NA 0.000
#> GSM573763 2 0.3923 0.763 0.000 0.580 0.000 0.000 NA 0.004
#> GSM573764 2 0.4301 0.763 0.000 0.580 0.000 0.004 NA 0.016
#> GSM573771 2 0.4301 0.763 0.000 0.580 0.000 0.004 NA 0.016
#> GSM573772 2 0.4301 0.763 0.000 0.580 0.000 0.004 NA 0.016
#> GSM573773 2 0.3923 0.763 0.000 0.580 0.000 0.000 NA 0.004
#> GSM573759 2 0.1901 0.843 0.000 0.912 0.008 0.004 NA 0.076
#> GSM573760 2 0.1116 0.849 0.000 0.960 0.008 0.004 NA 0.028
#> GSM573761 2 0.1036 0.849 0.000 0.964 0.008 0.004 NA 0.024
#> GSM573774 2 0.0000 0.851 0.000 1.000 0.000 0.000 NA 0.000
#> GSM573775 2 0.0000 0.851 0.000 1.000 0.000 0.000 NA 0.000
#> GSM573776 2 0.0000 0.851 0.000 1.000 0.000 0.000 NA 0.000
#> GSM573756 2 0.2019 0.841 0.000 0.900 0.012 0.000 NA 0.088
#> GSM573757 2 0.2110 0.841 0.000 0.900 0.012 0.004 NA 0.084
#> GSM573758 2 0.2019 0.841 0.000 0.900 0.012 0.000 NA 0.088
#> GSM573708 3 0.4726 0.752 0.032 0.008 0.536 0.000 NA 0.424
#> GSM573709 3 0.4726 0.752 0.032 0.008 0.536 0.000 NA 0.424
#> GSM573710 3 0.4726 0.752 0.032 0.008 0.536 0.000 NA 0.424
#> GSM573711 3 0.4726 0.752 0.032 0.008 0.536 0.000 NA 0.424
#> GSM573712 3 0.4853 0.752 0.032 0.008 0.536 0.004 NA 0.420
#> GSM573713 3 0.4853 0.752 0.032 0.008 0.536 0.004 NA 0.420
#> GSM573717 3 0.1049 0.848 0.032 0.008 0.960 0.000 NA 0.000
#> GSM573718 3 0.1049 0.848 0.032 0.008 0.960 0.000 NA 0.000
#> GSM573719 3 0.1049 0.848 0.032 0.008 0.960 0.000 NA 0.000
#> GSM573714 3 0.1049 0.848 0.032 0.008 0.960 0.000 NA 0.000
#> GSM573715 3 0.1049 0.848 0.032 0.008 0.960 0.000 NA 0.000
#> GSM573716 3 0.1049 0.848 0.032 0.008 0.960 0.000 NA 0.000
#> GSM573780 3 0.6143 0.735 0.032 0.008 0.488 0.016 NA 0.396
#> GSM573781 3 0.6143 0.735 0.032 0.008 0.488 0.016 NA 0.396
#> GSM573782 3 0.6143 0.735 0.032 0.008 0.488 0.016 NA 0.396
#> GSM573705 3 0.1049 0.848 0.032 0.008 0.960 0.000 NA 0.000
#> GSM573706 3 0.1049 0.848 0.032 0.008 0.960 0.000 NA 0.000
#> GSM573707 3 0.1049 0.848 0.032 0.008 0.960 0.000 NA 0.000
#> GSM573702 3 0.1049 0.848 0.032 0.008 0.960 0.000 NA 0.000
#> GSM573703 3 0.1049 0.848 0.032 0.008 0.960 0.000 NA 0.000
#> GSM573704 3 0.1049 0.848 0.032 0.008 0.960 0.000 NA 0.000
#> GSM573783 3 0.3884 0.815 0.032 0.008 0.812 0.008 NA 0.024
#> GSM573784 3 0.3884 0.815 0.032 0.008 0.812 0.008 NA 0.024
#> GSM573785 3 0.3884 0.815 0.032 0.008 0.812 0.008 NA 0.024
#> GSM573744 4 0.5930 0.853 0.028 0.012 0.000 0.556 NA 0.312
#> GSM573745 4 0.6049 0.853 0.028 0.012 0.004 0.556 NA 0.308
#> GSM573746 4 0.5930 0.853 0.028 0.012 0.000 0.556 NA 0.312
#> GSM573747 4 0.5930 0.853 0.028 0.012 0.000 0.556 NA 0.312
#> GSM573748 4 0.6049 0.853 0.028 0.012 0.004 0.556 NA 0.308
#> GSM573749 4 0.5930 0.853 0.028 0.012 0.000 0.556 NA 0.312
#> GSM573753 4 0.1074 0.764 0.028 0.012 0.000 0.960 NA 0.000
#> GSM573754 4 0.1074 0.764 0.028 0.012 0.000 0.960 NA 0.000
#> GSM573755 4 0.1074 0.764 0.028 0.012 0.000 0.960 NA 0.000
#> GSM573750 4 0.1074 0.764 0.028 0.012 0.000 0.960 NA 0.000
#> GSM573751 4 0.1074 0.764 0.028 0.012 0.000 0.960 NA 0.000
#> GSM573752 4 0.1074 0.764 0.028 0.012 0.000 0.960 NA 0.000
#> GSM573795 4 0.3410 0.746 0.028 0.012 0.008 0.856 NA 0.032
#> GSM573796 4 0.3410 0.746 0.028 0.012 0.008 0.856 NA 0.032
#> GSM573797 4 0.3410 0.746 0.028 0.012 0.008 0.856 NA 0.032
#> GSM573741 4 0.5902 0.853 0.028 0.012 0.000 0.556 NA 0.316
#> GSM573742 4 0.5902 0.853 0.028 0.012 0.000 0.556 NA 0.316
#> GSM573743 4 0.5902 0.853 0.028 0.012 0.000 0.556 NA 0.316
#> GSM573738 4 0.5902 0.853 0.028 0.012 0.000 0.556 NA 0.316
#> GSM573739 4 0.5902 0.853 0.028 0.012 0.000 0.556 NA 0.316
#> GSM573740 4 0.5902 0.853 0.028 0.012 0.000 0.556 NA 0.316
#> GSM573792 4 0.6844 0.822 0.028 0.012 0.016 0.504 NA 0.252
#> GSM573793 4 0.6844 0.822 0.028 0.012 0.016 0.504 NA 0.252
#> GSM573794 4 0.6844 0.822 0.028 0.012 0.016 0.504 NA 0.252
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
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)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
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:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.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")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
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 cell.line(p) agent(p) k
#> CV:kmeans 48 NA NA 2
#> CV:kmeans 48 3.15e-11 0.780 3
#> CV:kmeans 96 9.14e-57 0.975 4
#> CV:kmeans 96 9.14e-57 0.975 5
#> CV:kmeans 96 9.14e-57 0.975 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.
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 46609 rows and 96 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'CV' method.
#> Subgroups are detected by 'skmeans' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 5.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.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:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).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)
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.988 0.5058 0.495 0.495
#> 3 3 0.747 0.959 0.931 0.2498 0.874 0.745
#> 4 4 1.000 1.000 1.000 0.1994 0.874 0.657
#> 5 5 0.916 0.963 0.937 0.0384 0.970 0.878
#> 6 6 0.888 0.869 0.878 0.0343 1.000 1.000
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 5
#> attr(,"optional")
#> [1] 2 4
There is also optional best \(k\) = 2 4 that is worth to check.
Following shows the table of the partitions (You need to click the show/hide
code output link to see it). The membership matrix (columns with name p*
)
is inferred by
clue::cl_consensus()
function with the SE
method. Basically the value in the membership matrix
represents the probability to belong to a certain group. The finall class
label for an item is determined with the group with highest probability it
belongs to.
In get_classes()
function, the entropy is calculated from the membership
matrix and the silhouette score is calculated from the consensus matrix.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> GSM573726 1 0.163 0.987 0.976 0.024
#> GSM573727 1 0.163 0.987 0.976 0.024
#> GSM573728 1 0.163 0.987 0.976 0.024
#> GSM573729 1 0.163 0.987 0.976 0.024
#> GSM573730 1 0.163 0.987 0.976 0.024
#> GSM573731 1 0.163 0.987 0.976 0.024
#> GSM573735 1 0.163 0.987 0.976 0.024
#> GSM573736 1 0.163 0.987 0.976 0.024
#> GSM573737 1 0.163 0.987 0.976 0.024
#> GSM573732 1 0.163 0.987 0.976 0.024
#> GSM573733 1 0.163 0.987 0.976 0.024
#> GSM573734 1 0.163 0.987 0.976 0.024
#> GSM573789 1 0.163 0.987 0.976 0.024
#> GSM573790 1 0.163 0.987 0.976 0.024
#> GSM573791 1 0.163 0.987 0.976 0.024
#> GSM573723 1 0.163 0.987 0.976 0.024
#> GSM573724 1 0.163 0.987 0.976 0.024
#> GSM573725 1 0.163 0.987 0.976 0.024
#> GSM573720 1 0.163 0.987 0.976 0.024
#> GSM573721 1 0.163 0.987 0.976 0.024
#> GSM573722 1 0.163 0.987 0.976 0.024
#> GSM573786 1 0.163 0.987 0.976 0.024
#> GSM573787 1 0.163 0.987 0.976 0.024
#> GSM573788 1 0.163 0.987 0.976 0.024
#> GSM573768 2 0.163 0.987 0.024 0.976
#> GSM573769 2 0.163 0.987 0.024 0.976
#> GSM573770 2 0.163 0.987 0.024 0.976
#> GSM573765 2 0.163 0.987 0.024 0.976
#> GSM573766 2 0.163 0.987 0.024 0.976
#> GSM573767 2 0.163 0.987 0.024 0.976
#> GSM573777 2 0.163 0.987 0.024 0.976
#> GSM573778 2 0.163 0.987 0.024 0.976
#> GSM573779 2 0.163 0.987 0.024 0.976
#> GSM573762 2 0.163 0.987 0.024 0.976
#> GSM573763 2 0.163 0.987 0.024 0.976
#> GSM573764 2 0.163 0.987 0.024 0.976
#> GSM573771 2 0.163 0.987 0.024 0.976
#> GSM573772 2 0.163 0.987 0.024 0.976
#> GSM573773 2 0.163 0.987 0.024 0.976
#> GSM573759 2 0.163 0.987 0.024 0.976
#> GSM573760 2 0.163 0.987 0.024 0.976
#> GSM573761 2 0.163 0.987 0.024 0.976
#> GSM573774 2 0.163 0.987 0.024 0.976
#> GSM573775 2 0.163 0.987 0.024 0.976
#> GSM573776 2 0.163 0.987 0.024 0.976
#> GSM573756 2 0.163 0.987 0.024 0.976
#> GSM573757 2 0.163 0.987 0.024 0.976
#> GSM573758 2 0.163 0.987 0.024 0.976
#> GSM573708 1 0.000 0.987 1.000 0.000
#> GSM573709 1 0.000 0.987 1.000 0.000
#> GSM573710 1 0.000 0.987 1.000 0.000
#> GSM573711 1 0.000 0.987 1.000 0.000
#> GSM573712 1 0.000 0.987 1.000 0.000
#> GSM573713 1 0.000 0.987 1.000 0.000
#> GSM573717 1 0.000 0.987 1.000 0.000
#> GSM573718 1 0.000 0.987 1.000 0.000
#> GSM573719 1 0.000 0.987 1.000 0.000
#> GSM573714 1 0.000 0.987 1.000 0.000
#> GSM573715 1 0.000 0.987 1.000 0.000
#> GSM573716 1 0.000 0.987 1.000 0.000
#> GSM573780 1 0.000 0.987 1.000 0.000
#> GSM573781 1 0.000 0.987 1.000 0.000
#> GSM573782 1 0.000 0.987 1.000 0.000
#> GSM573705 1 0.000 0.987 1.000 0.000
#> GSM573706 1 0.000 0.987 1.000 0.000
#> GSM573707 1 0.000 0.987 1.000 0.000
#> GSM573702 1 0.000 0.987 1.000 0.000
#> GSM573703 1 0.000 0.987 1.000 0.000
#> GSM573704 1 0.000 0.987 1.000 0.000
#> GSM573783 1 0.000 0.987 1.000 0.000
#> GSM573784 1 0.000 0.987 1.000 0.000
#> GSM573785 1 0.000 0.987 1.000 0.000
#> GSM573744 2 0.000 0.987 0.000 1.000
#> GSM573745 2 0.000 0.987 0.000 1.000
#> GSM573746 2 0.000 0.987 0.000 1.000
#> GSM573747 2 0.000 0.987 0.000 1.000
#> GSM573748 2 0.000 0.987 0.000 1.000
#> GSM573749 2 0.000 0.987 0.000 1.000
#> GSM573753 2 0.000 0.987 0.000 1.000
#> GSM573754 2 0.000 0.987 0.000 1.000
#> GSM573755 2 0.000 0.987 0.000 1.000
#> GSM573750 2 0.000 0.987 0.000 1.000
#> GSM573751 2 0.000 0.987 0.000 1.000
#> GSM573752 2 0.000 0.987 0.000 1.000
#> GSM573795 2 0.000 0.987 0.000 1.000
#> GSM573796 2 0.000 0.987 0.000 1.000
#> GSM573797 2 0.000 0.987 0.000 1.000
#> GSM573741 2 0.000 0.987 0.000 1.000
#> GSM573742 2 0.000 0.987 0.000 1.000
#> GSM573743 2 0.000 0.987 0.000 1.000
#> GSM573738 2 0.000 0.987 0.000 1.000
#> GSM573739 2 0.000 0.987 0.000 1.000
#> GSM573740 2 0.000 0.987 0.000 1.000
#> GSM573792 2 0.000 0.987 0.000 1.000
#> GSM573793 2 0.000 0.987 0.000 1.000
#> GSM573794 2 0.000 0.987 0.000 1.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM573726 3 0.226 0.917 0.068 0.000 0.932
#> GSM573727 3 0.226 0.917 0.068 0.000 0.932
#> GSM573728 3 0.226 0.917 0.068 0.000 0.932
#> GSM573729 3 0.226 0.917 0.068 0.000 0.932
#> GSM573730 3 0.226 0.917 0.068 0.000 0.932
#> GSM573731 3 0.226 0.917 0.068 0.000 0.932
#> GSM573735 3 0.226 0.917 0.068 0.000 0.932
#> GSM573736 3 0.226 0.917 0.068 0.000 0.932
#> GSM573737 3 0.226 0.917 0.068 0.000 0.932
#> GSM573732 3 0.226 0.917 0.068 0.000 0.932
#> GSM573733 3 0.226 0.917 0.068 0.000 0.932
#> GSM573734 3 0.226 0.917 0.068 0.000 0.932
#> GSM573789 3 0.226 0.917 0.068 0.000 0.932
#> GSM573790 3 0.226 0.917 0.068 0.000 0.932
#> GSM573791 3 0.226 0.917 0.068 0.000 0.932
#> GSM573723 3 0.226 0.917 0.068 0.000 0.932
#> GSM573724 3 0.226 0.917 0.068 0.000 0.932
#> GSM573725 3 0.226 0.917 0.068 0.000 0.932
#> GSM573720 3 0.226 0.917 0.068 0.000 0.932
#> GSM573721 3 0.226 0.917 0.068 0.000 0.932
#> GSM573722 3 0.226 0.917 0.068 0.000 0.932
#> GSM573786 3 0.226 0.917 0.068 0.000 0.932
#> GSM573787 3 0.226 0.917 0.068 0.000 0.932
#> GSM573788 3 0.226 0.917 0.068 0.000 0.932
#> GSM573768 2 0.304 1.000 0.104 0.896 0.000
#> GSM573769 2 0.304 1.000 0.104 0.896 0.000
#> GSM573770 2 0.304 1.000 0.104 0.896 0.000
#> GSM573765 2 0.304 1.000 0.104 0.896 0.000
#> GSM573766 2 0.304 1.000 0.104 0.896 0.000
#> GSM573767 2 0.304 1.000 0.104 0.896 0.000
#> GSM573777 2 0.304 1.000 0.104 0.896 0.000
#> GSM573778 2 0.304 1.000 0.104 0.896 0.000
#> GSM573779 2 0.304 1.000 0.104 0.896 0.000
#> GSM573762 2 0.304 1.000 0.104 0.896 0.000
#> GSM573763 2 0.304 1.000 0.104 0.896 0.000
#> GSM573764 2 0.304 1.000 0.104 0.896 0.000
#> GSM573771 2 0.304 1.000 0.104 0.896 0.000
#> GSM573772 2 0.304 1.000 0.104 0.896 0.000
#> GSM573773 2 0.304 1.000 0.104 0.896 0.000
#> GSM573759 2 0.304 1.000 0.104 0.896 0.000
#> GSM573760 2 0.304 1.000 0.104 0.896 0.000
#> GSM573761 2 0.304 1.000 0.104 0.896 0.000
#> GSM573774 2 0.304 1.000 0.104 0.896 0.000
#> GSM573775 2 0.304 1.000 0.104 0.896 0.000
#> GSM573776 2 0.304 1.000 0.104 0.896 0.000
#> GSM573756 2 0.304 1.000 0.104 0.896 0.000
#> GSM573757 2 0.304 1.000 0.104 0.896 0.000
#> GSM573758 2 0.304 1.000 0.104 0.896 0.000
#> GSM573708 3 0.304 0.920 0.000 0.104 0.896
#> GSM573709 3 0.304 0.920 0.000 0.104 0.896
#> GSM573710 3 0.304 0.920 0.000 0.104 0.896
#> GSM573711 3 0.304 0.920 0.000 0.104 0.896
#> GSM573712 3 0.304 0.920 0.000 0.104 0.896
#> GSM573713 3 0.304 0.920 0.000 0.104 0.896
#> GSM573717 3 0.304 0.920 0.000 0.104 0.896
#> GSM573718 3 0.304 0.920 0.000 0.104 0.896
#> GSM573719 3 0.304 0.920 0.000 0.104 0.896
#> GSM573714 3 0.304 0.920 0.000 0.104 0.896
#> GSM573715 3 0.304 0.920 0.000 0.104 0.896
#> GSM573716 3 0.304 0.920 0.000 0.104 0.896
#> GSM573780 3 0.304 0.920 0.000 0.104 0.896
#> GSM573781 3 0.304 0.920 0.000 0.104 0.896
#> GSM573782 3 0.304 0.920 0.000 0.104 0.896
#> GSM573705 3 0.304 0.920 0.000 0.104 0.896
#> GSM573706 3 0.304 0.920 0.000 0.104 0.896
#> GSM573707 3 0.304 0.920 0.000 0.104 0.896
#> GSM573702 3 0.304 0.920 0.000 0.104 0.896
#> GSM573703 3 0.304 0.920 0.000 0.104 0.896
#> GSM573704 3 0.304 0.920 0.000 0.104 0.896
#> GSM573783 3 0.304 0.920 0.000 0.104 0.896
#> GSM573784 3 0.304 0.920 0.000 0.104 0.896
#> GSM573785 3 0.304 0.920 0.000 0.104 0.896
#> GSM573744 1 0.000 1.000 1.000 0.000 0.000
#> GSM573745 1 0.000 1.000 1.000 0.000 0.000
#> GSM573746 1 0.000 1.000 1.000 0.000 0.000
#> GSM573747 1 0.000 1.000 1.000 0.000 0.000
#> GSM573748 1 0.000 1.000 1.000 0.000 0.000
#> GSM573749 1 0.000 1.000 1.000 0.000 0.000
#> GSM573753 1 0.000 1.000 1.000 0.000 0.000
#> GSM573754 1 0.000 1.000 1.000 0.000 0.000
#> GSM573755 1 0.000 1.000 1.000 0.000 0.000
#> GSM573750 1 0.000 1.000 1.000 0.000 0.000
#> GSM573751 1 0.000 1.000 1.000 0.000 0.000
#> GSM573752 1 0.000 1.000 1.000 0.000 0.000
#> GSM573795 1 0.000 1.000 1.000 0.000 0.000
#> GSM573796 1 0.000 1.000 1.000 0.000 0.000
#> GSM573797 1 0.000 1.000 1.000 0.000 0.000
#> GSM573741 1 0.000 1.000 1.000 0.000 0.000
#> GSM573742 1 0.000 1.000 1.000 0.000 0.000
#> GSM573743 1 0.000 1.000 1.000 0.000 0.000
#> GSM573738 1 0.000 1.000 1.000 0.000 0.000
#> GSM573739 1 0.000 1.000 1.000 0.000 0.000
#> GSM573740 1 0.000 1.000 1.000 0.000 0.000
#> GSM573792 1 0.000 1.000 1.000 0.000 0.000
#> GSM573793 1 0.000 1.000 1.000 0.000 0.000
#> GSM573794 1 0.000 1.000 1.000 0.000 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM573726 1 0 1 1 0 0 0
#> GSM573727 1 0 1 1 0 0 0
#> GSM573728 1 0 1 1 0 0 0
#> GSM573729 1 0 1 1 0 0 0
#> GSM573730 1 0 1 1 0 0 0
#> GSM573731 1 0 1 1 0 0 0
#> GSM573735 1 0 1 1 0 0 0
#> GSM573736 1 0 1 1 0 0 0
#> GSM573737 1 0 1 1 0 0 0
#> GSM573732 1 0 1 1 0 0 0
#> GSM573733 1 0 1 1 0 0 0
#> GSM573734 1 0 1 1 0 0 0
#> GSM573789 1 0 1 1 0 0 0
#> GSM573790 1 0 1 1 0 0 0
#> GSM573791 1 0 1 1 0 0 0
#> GSM573723 1 0 1 1 0 0 0
#> GSM573724 1 0 1 1 0 0 0
#> GSM573725 1 0 1 1 0 0 0
#> GSM573720 1 0 1 1 0 0 0
#> GSM573721 1 0 1 1 0 0 0
#> GSM573722 1 0 1 1 0 0 0
#> GSM573786 1 0 1 1 0 0 0
#> GSM573787 1 0 1 1 0 0 0
#> GSM573788 1 0 1 1 0 0 0
#> GSM573768 2 0 1 0 1 0 0
#> GSM573769 2 0 1 0 1 0 0
#> GSM573770 2 0 1 0 1 0 0
#> GSM573765 2 0 1 0 1 0 0
#> GSM573766 2 0 1 0 1 0 0
#> GSM573767 2 0 1 0 1 0 0
#> GSM573777 2 0 1 0 1 0 0
#> GSM573778 2 0 1 0 1 0 0
#> GSM573779 2 0 1 0 1 0 0
#> GSM573762 2 0 1 0 1 0 0
#> GSM573763 2 0 1 0 1 0 0
#> GSM573764 2 0 1 0 1 0 0
#> GSM573771 2 0 1 0 1 0 0
#> GSM573772 2 0 1 0 1 0 0
#> GSM573773 2 0 1 0 1 0 0
#> GSM573759 2 0 1 0 1 0 0
#> GSM573760 2 0 1 0 1 0 0
#> GSM573761 2 0 1 0 1 0 0
#> GSM573774 2 0 1 0 1 0 0
#> GSM573775 2 0 1 0 1 0 0
#> GSM573776 2 0 1 0 1 0 0
#> GSM573756 2 0 1 0 1 0 0
#> GSM573757 2 0 1 0 1 0 0
#> GSM573758 2 0 1 0 1 0 0
#> GSM573708 3 0 1 0 0 1 0
#> GSM573709 3 0 1 0 0 1 0
#> GSM573710 3 0 1 0 0 1 0
#> GSM573711 3 0 1 0 0 1 0
#> GSM573712 3 0 1 0 0 1 0
#> GSM573713 3 0 1 0 0 1 0
#> GSM573717 3 0 1 0 0 1 0
#> GSM573718 3 0 1 0 0 1 0
#> GSM573719 3 0 1 0 0 1 0
#> GSM573714 3 0 1 0 0 1 0
#> GSM573715 3 0 1 0 0 1 0
#> GSM573716 3 0 1 0 0 1 0
#> GSM573780 3 0 1 0 0 1 0
#> GSM573781 3 0 1 0 0 1 0
#> GSM573782 3 0 1 0 0 1 0
#> GSM573705 3 0 1 0 0 1 0
#> GSM573706 3 0 1 0 0 1 0
#> GSM573707 3 0 1 0 0 1 0
#> GSM573702 3 0 1 0 0 1 0
#> GSM573703 3 0 1 0 0 1 0
#> GSM573704 3 0 1 0 0 1 0
#> GSM573783 3 0 1 0 0 1 0
#> GSM573784 3 0 1 0 0 1 0
#> GSM573785 3 0 1 0 0 1 0
#> GSM573744 4 0 1 0 0 0 1
#> GSM573745 4 0 1 0 0 0 1
#> GSM573746 4 0 1 0 0 0 1
#> GSM573747 4 0 1 0 0 0 1
#> GSM573748 4 0 1 0 0 0 1
#> GSM573749 4 0 1 0 0 0 1
#> GSM573753 4 0 1 0 0 0 1
#> GSM573754 4 0 1 0 0 0 1
#> GSM573755 4 0 1 0 0 0 1
#> GSM573750 4 0 1 0 0 0 1
#> GSM573751 4 0 1 0 0 0 1
#> GSM573752 4 0 1 0 0 0 1
#> GSM573795 4 0 1 0 0 0 1
#> GSM573796 4 0 1 0 0 0 1
#> GSM573797 4 0 1 0 0 0 1
#> GSM573741 4 0 1 0 0 0 1
#> GSM573742 4 0 1 0 0 0 1
#> GSM573743 4 0 1 0 0 0 1
#> GSM573738 4 0 1 0 0 0 1
#> GSM573739 4 0 1 0 0 0 1
#> GSM573740 4 0 1 0 0 0 1
#> GSM573792 4 0 1 0 0 0 1
#> GSM573793 4 0 1 0 0 0 1
#> GSM573794 4 0 1 0 0 0 1
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM573726 1 0.0000 0.993 1.000 0.000 0.000 0.000 0.000
#> GSM573727 1 0.0000 0.993 1.000 0.000 0.000 0.000 0.000
#> GSM573728 1 0.0000 0.993 1.000 0.000 0.000 0.000 0.000
#> GSM573729 1 0.0000 0.993 1.000 0.000 0.000 0.000 0.000
#> GSM573730 1 0.0000 0.993 1.000 0.000 0.000 0.000 0.000
#> GSM573731 1 0.0000 0.993 1.000 0.000 0.000 0.000 0.000
#> GSM573735 1 0.0609 0.986 0.980 0.000 0.000 0.000 0.020
#> GSM573736 1 0.0609 0.986 0.980 0.000 0.000 0.000 0.020
#> GSM573737 1 0.0609 0.986 0.980 0.000 0.000 0.000 0.020
#> GSM573732 1 0.0609 0.986 0.980 0.000 0.000 0.000 0.020
#> GSM573733 1 0.0609 0.986 0.980 0.000 0.000 0.000 0.020
#> GSM573734 1 0.0609 0.986 0.980 0.000 0.000 0.000 0.020
#> GSM573789 1 0.0404 0.990 0.988 0.000 0.000 0.000 0.012
#> GSM573790 1 0.0404 0.990 0.988 0.000 0.000 0.000 0.012
#> GSM573791 1 0.0404 0.990 0.988 0.000 0.000 0.000 0.012
#> GSM573723 1 0.0000 0.993 1.000 0.000 0.000 0.000 0.000
#> GSM573724 1 0.0000 0.993 1.000 0.000 0.000 0.000 0.000
#> GSM573725 1 0.0000 0.993 1.000 0.000 0.000 0.000 0.000
#> GSM573720 1 0.0000 0.993 1.000 0.000 0.000 0.000 0.000
#> GSM573721 1 0.0290 0.991 0.992 0.000 0.000 0.000 0.008
#> GSM573722 1 0.0000 0.993 1.000 0.000 0.000 0.000 0.000
#> GSM573786 1 0.0404 0.990 0.988 0.000 0.000 0.000 0.012
#> GSM573787 1 0.0404 0.990 0.988 0.000 0.000 0.000 0.012
#> GSM573788 1 0.0404 0.990 0.988 0.000 0.000 0.000 0.012
#> GSM573768 2 0.0000 0.950 0.000 1.000 0.000 0.000 0.000
#> GSM573769 2 0.0000 0.950 0.000 1.000 0.000 0.000 0.000
#> GSM573770 2 0.0000 0.950 0.000 1.000 0.000 0.000 0.000
#> GSM573765 2 0.0000 0.950 0.000 1.000 0.000 0.000 0.000
#> GSM573766 2 0.0000 0.950 0.000 1.000 0.000 0.000 0.000
#> GSM573767 2 0.0000 0.950 0.000 1.000 0.000 0.000 0.000
#> GSM573777 2 0.2605 0.914 0.000 0.852 0.000 0.000 0.148
#> GSM573778 2 0.2605 0.914 0.000 0.852 0.000 0.000 0.148
#> GSM573779 2 0.2605 0.914 0.000 0.852 0.000 0.000 0.148
#> GSM573762 2 0.2605 0.914 0.000 0.852 0.000 0.000 0.148
#> GSM573763 2 0.2605 0.914 0.000 0.852 0.000 0.000 0.148
#> GSM573764 2 0.2605 0.914 0.000 0.852 0.000 0.000 0.148
#> GSM573771 2 0.2605 0.914 0.000 0.852 0.000 0.000 0.148
#> GSM573772 2 0.2605 0.914 0.000 0.852 0.000 0.000 0.148
#> GSM573773 2 0.2605 0.914 0.000 0.852 0.000 0.000 0.148
#> GSM573759 2 0.0000 0.950 0.000 1.000 0.000 0.000 0.000
#> GSM573760 2 0.0000 0.950 0.000 1.000 0.000 0.000 0.000
#> GSM573761 2 0.0000 0.950 0.000 1.000 0.000 0.000 0.000
#> GSM573774 2 0.0000 0.950 0.000 1.000 0.000 0.000 0.000
#> GSM573775 2 0.0000 0.950 0.000 1.000 0.000 0.000 0.000
#> GSM573776 2 0.0000 0.950 0.000 1.000 0.000 0.000 0.000
#> GSM573756 2 0.0000 0.950 0.000 1.000 0.000 0.000 0.000
#> GSM573757 2 0.0000 0.950 0.000 1.000 0.000 0.000 0.000
#> GSM573758 2 0.0000 0.950 0.000 1.000 0.000 0.000 0.000
#> GSM573708 5 0.4030 0.989 0.000 0.000 0.352 0.000 0.648
#> GSM573709 5 0.4030 0.989 0.000 0.000 0.352 0.000 0.648
#> GSM573710 5 0.4030 0.989 0.000 0.000 0.352 0.000 0.648
#> GSM573711 5 0.4030 0.989 0.000 0.000 0.352 0.000 0.648
#> GSM573712 5 0.4030 0.989 0.000 0.000 0.352 0.000 0.648
#> GSM573713 5 0.4030 0.989 0.000 0.000 0.352 0.000 0.648
#> GSM573717 3 0.0000 0.994 0.000 0.000 1.000 0.000 0.000
#> GSM573718 3 0.0000 0.994 0.000 0.000 1.000 0.000 0.000
#> GSM573719 3 0.0000 0.994 0.000 0.000 1.000 0.000 0.000
#> GSM573714 3 0.0000 0.994 0.000 0.000 1.000 0.000 0.000
#> GSM573715 3 0.0000 0.994 0.000 0.000 1.000 0.000 0.000
#> GSM573716 3 0.0000 0.994 0.000 0.000 1.000 0.000 0.000
#> GSM573780 5 0.3949 0.977 0.000 0.000 0.332 0.000 0.668
#> GSM573781 5 0.3949 0.977 0.000 0.000 0.332 0.000 0.668
#> GSM573782 5 0.3949 0.977 0.000 0.000 0.332 0.000 0.668
#> GSM573705 3 0.0000 0.994 0.000 0.000 1.000 0.000 0.000
#> GSM573706 3 0.0000 0.994 0.000 0.000 1.000 0.000 0.000
#> GSM573707 3 0.0000 0.994 0.000 0.000 1.000 0.000 0.000
#> GSM573702 3 0.0000 0.994 0.000 0.000 1.000 0.000 0.000
#> GSM573703 3 0.0000 0.994 0.000 0.000 1.000 0.000 0.000
#> GSM573704 3 0.0000 0.994 0.000 0.000 1.000 0.000 0.000
#> GSM573783 3 0.0609 0.973 0.000 0.000 0.980 0.000 0.020
#> GSM573784 3 0.0609 0.973 0.000 0.000 0.980 0.000 0.020
#> GSM573785 3 0.0510 0.978 0.000 0.000 0.984 0.000 0.016
#> GSM573744 4 0.0000 0.951 0.000 0.000 0.000 1.000 0.000
#> GSM573745 4 0.0000 0.951 0.000 0.000 0.000 1.000 0.000
#> GSM573746 4 0.0000 0.951 0.000 0.000 0.000 1.000 0.000
#> GSM573747 4 0.0000 0.951 0.000 0.000 0.000 1.000 0.000
#> GSM573748 4 0.0000 0.951 0.000 0.000 0.000 1.000 0.000
#> GSM573749 4 0.0000 0.951 0.000 0.000 0.000 1.000 0.000
#> GSM573753 4 0.2516 0.918 0.000 0.000 0.000 0.860 0.140
#> GSM573754 4 0.2516 0.918 0.000 0.000 0.000 0.860 0.140
#> GSM573755 4 0.2516 0.918 0.000 0.000 0.000 0.860 0.140
#> GSM573750 4 0.2516 0.918 0.000 0.000 0.000 0.860 0.140
#> GSM573751 4 0.2516 0.918 0.000 0.000 0.000 0.860 0.140
#> GSM573752 4 0.2516 0.918 0.000 0.000 0.000 0.860 0.140
#> GSM573795 4 0.2648 0.914 0.000 0.000 0.000 0.848 0.152
#> GSM573796 4 0.2648 0.914 0.000 0.000 0.000 0.848 0.152
#> GSM573797 4 0.2648 0.914 0.000 0.000 0.000 0.848 0.152
#> GSM573741 4 0.0000 0.951 0.000 0.000 0.000 1.000 0.000
#> GSM573742 4 0.0000 0.951 0.000 0.000 0.000 1.000 0.000
#> GSM573743 4 0.0000 0.951 0.000 0.000 0.000 1.000 0.000
#> GSM573738 4 0.0000 0.951 0.000 0.000 0.000 1.000 0.000
#> GSM573739 4 0.0000 0.951 0.000 0.000 0.000 1.000 0.000
#> GSM573740 4 0.0000 0.951 0.000 0.000 0.000 1.000 0.000
#> GSM573792 4 0.0510 0.948 0.000 0.000 0.000 0.984 0.016
#> GSM573793 4 0.0290 0.949 0.000 0.000 0.000 0.992 0.008
#> GSM573794 4 0.0290 0.949 0.000 0.000 0.000 0.992 0.008
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM573726 1 0.0000 0.934 1.000 0.000 0.000 0.000 0.000 NA
#> GSM573727 1 0.0000 0.934 1.000 0.000 0.000 0.000 0.000 NA
#> GSM573728 1 0.0000 0.934 1.000 0.000 0.000 0.000 0.000 NA
#> GSM573729 1 0.0000 0.934 1.000 0.000 0.000 0.000 0.000 NA
#> GSM573730 1 0.0000 0.934 1.000 0.000 0.000 0.000 0.000 NA
#> GSM573731 1 0.0000 0.934 1.000 0.000 0.000 0.000 0.000 NA
#> GSM573735 1 0.3548 0.844 0.796 0.000 0.000 0.000 0.068 NA
#> GSM573736 1 0.3548 0.844 0.796 0.000 0.000 0.000 0.068 NA
#> GSM573737 1 0.3548 0.844 0.796 0.000 0.000 0.000 0.068 NA
#> GSM573732 1 0.3548 0.844 0.796 0.000 0.000 0.000 0.068 NA
#> GSM573733 1 0.3548 0.844 0.796 0.000 0.000 0.000 0.068 NA
#> GSM573734 1 0.3548 0.844 0.796 0.000 0.000 0.000 0.068 NA
#> GSM573789 1 0.1863 0.912 0.920 0.000 0.000 0.000 0.036 NA
#> GSM573790 1 0.1863 0.912 0.920 0.000 0.000 0.000 0.036 NA
#> GSM573791 1 0.1863 0.912 0.920 0.000 0.000 0.000 0.036 NA
#> GSM573723 1 0.0000 0.934 1.000 0.000 0.000 0.000 0.000 NA
#> GSM573724 1 0.0000 0.934 1.000 0.000 0.000 0.000 0.000 NA
#> GSM573725 1 0.0000 0.934 1.000 0.000 0.000 0.000 0.000 NA
#> GSM573720 1 0.0000 0.934 1.000 0.000 0.000 0.000 0.000 NA
#> GSM573721 1 0.0520 0.931 0.984 0.000 0.000 0.000 0.008 NA
#> GSM573722 1 0.0000 0.934 1.000 0.000 0.000 0.000 0.000 NA
#> GSM573786 1 0.1863 0.912 0.920 0.000 0.000 0.000 0.036 NA
#> GSM573787 1 0.1863 0.912 0.920 0.000 0.000 0.000 0.036 NA
#> GSM573788 1 0.1863 0.912 0.920 0.000 0.000 0.000 0.036 NA
#> GSM573768 2 0.0000 0.827 0.000 1.000 0.000 0.000 0.000 NA
#> GSM573769 2 0.0000 0.827 0.000 1.000 0.000 0.000 0.000 NA
#> GSM573770 2 0.0000 0.827 0.000 1.000 0.000 0.000 0.000 NA
#> GSM573765 2 0.0146 0.827 0.000 0.996 0.000 0.000 0.000 NA
#> GSM573766 2 0.0146 0.827 0.000 0.996 0.000 0.000 0.000 NA
#> GSM573767 2 0.0260 0.826 0.000 0.992 0.000 0.000 0.000 NA
#> GSM573777 2 0.3854 0.690 0.000 0.536 0.000 0.000 0.000 NA
#> GSM573778 2 0.3854 0.690 0.000 0.536 0.000 0.000 0.000 NA
#> GSM573779 2 0.3854 0.690 0.000 0.536 0.000 0.000 0.000 NA
#> GSM573762 2 0.3854 0.690 0.000 0.536 0.000 0.000 0.000 NA
#> GSM573763 2 0.3854 0.690 0.000 0.536 0.000 0.000 0.000 NA
#> GSM573764 2 0.3854 0.690 0.000 0.536 0.000 0.000 0.000 NA
#> GSM573771 2 0.3854 0.690 0.000 0.536 0.000 0.000 0.000 NA
#> GSM573772 2 0.3854 0.690 0.000 0.536 0.000 0.000 0.000 NA
#> GSM573773 2 0.3854 0.690 0.000 0.536 0.000 0.000 0.000 NA
#> GSM573759 2 0.0146 0.826 0.000 0.996 0.000 0.000 0.000 NA
#> GSM573760 2 0.0146 0.826 0.000 0.996 0.000 0.000 0.000 NA
#> GSM573761 2 0.0146 0.826 0.000 0.996 0.000 0.000 0.000 NA
#> GSM573774 2 0.0000 0.827 0.000 1.000 0.000 0.000 0.000 NA
#> GSM573775 2 0.0000 0.827 0.000 1.000 0.000 0.000 0.000 NA
#> GSM573776 2 0.0000 0.827 0.000 1.000 0.000 0.000 0.000 NA
#> GSM573756 2 0.0146 0.826 0.000 0.996 0.000 0.000 0.000 NA
#> GSM573757 2 0.0146 0.826 0.000 0.996 0.000 0.000 0.000 NA
#> GSM573758 2 0.0146 0.826 0.000 0.996 0.000 0.000 0.000 NA
#> GSM573708 5 0.3076 0.979 0.000 0.000 0.240 0.000 0.760 NA
#> GSM573709 5 0.3076 0.979 0.000 0.000 0.240 0.000 0.760 NA
#> GSM573710 5 0.3076 0.979 0.000 0.000 0.240 0.000 0.760 NA
#> GSM573711 5 0.3076 0.979 0.000 0.000 0.240 0.000 0.760 NA
#> GSM573712 5 0.3076 0.979 0.000 0.000 0.240 0.000 0.760 NA
#> GSM573713 5 0.3076 0.979 0.000 0.000 0.240 0.000 0.760 NA
#> GSM573717 3 0.0000 0.990 0.000 0.000 1.000 0.000 0.000 NA
#> GSM573718 3 0.0000 0.990 0.000 0.000 1.000 0.000 0.000 NA
#> GSM573719 3 0.0000 0.990 0.000 0.000 1.000 0.000 0.000 NA
#> GSM573714 3 0.0000 0.990 0.000 0.000 1.000 0.000 0.000 NA
#> GSM573715 3 0.0000 0.990 0.000 0.000 1.000 0.000 0.000 NA
#> GSM573716 3 0.0000 0.990 0.000 0.000 1.000 0.000 0.000 NA
#> GSM573780 5 0.3043 0.959 0.000 0.000 0.200 0.000 0.792 NA
#> GSM573781 5 0.3043 0.959 0.000 0.000 0.200 0.000 0.792 NA
#> GSM573782 5 0.3043 0.959 0.000 0.000 0.200 0.000 0.792 NA
#> GSM573705 3 0.0000 0.990 0.000 0.000 1.000 0.000 0.000 NA
#> GSM573706 3 0.0000 0.990 0.000 0.000 1.000 0.000 0.000 NA
#> GSM573707 3 0.0000 0.990 0.000 0.000 1.000 0.000 0.000 NA
#> GSM573702 3 0.0000 0.990 0.000 0.000 1.000 0.000 0.000 NA
#> GSM573703 3 0.0000 0.990 0.000 0.000 1.000 0.000 0.000 NA
#> GSM573704 3 0.0000 0.990 0.000 0.000 1.000 0.000 0.000 NA
#> GSM573783 3 0.0865 0.959 0.000 0.000 0.964 0.000 0.036 NA
#> GSM573784 3 0.0865 0.959 0.000 0.000 0.964 0.000 0.036 NA
#> GSM573785 3 0.0865 0.959 0.000 0.000 0.964 0.000 0.036 NA
#> GSM573744 4 0.0000 0.860 0.000 0.000 0.000 1.000 0.000 NA
#> GSM573745 4 0.0000 0.860 0.000 0.000 0.000 1.000 0.000 NA
#> GSM573746 4 0.0000 0.860 0.000 0.000 0.000 1.000 0.000 NA
#> GSM573747 4 0.0000 0.860 0.000 0.000 0.000 1.000 0.000 NA
#> GSM573748 4 0.0000 0.860 0.000 0.000 0.000 1.000 0.000 NA
#> GSM573749 4 0.0000 0.860 0.000 0.000 0.000 1.000 0.000 NA
#> GSM573753 4 0.4664 0.758 0.000 0.000 0.000 0.644 0.076 NA
#> GSM573754 4 0.4664 0.758 0.000 0.000 0.000 0.644 0.076 NA
#> GSM573755 4 0.4747 0.751 0.000 0.000 0.000 0.632 0.080 NA
#> GSM573750 4 0.4645 0.760 0.000 0.000 0.000 0.648 0.076 NA
#> GSM573751 4 0.4626 0.762 0.000 0.000 0.000 0.652 0.076 NA
#> GSM573752 4 0.4626 0.762 0.000 0.000 0.000 0.652 0.076 NA
#> GSM573795 4 0.5116 0.716 0.000 0.000 0.000 0.560 0.096 NA
#> GSM573796 4 0.5116 0.716 0.000 0.000 0.000 0.560 0.096 NA
#> GSM573797 4 0.5116 0.716 0.000 0.000 0.000 0.560 0.096 NA
#> GSM573741 4 0.0000 0.860 0.000 0.000 0.000 1.000 0.000 NA
#> GSM573742 4 0.0000 0.860 0.000 0.000 0.000 1.000 0.000 NA
#> GSM573743 4 0.0000 0.860 0.000 0.000 0.000 1.000 0.000 NA
#> GSM573738 4 0.0000 0.860 0.000 0.000 0.000 1.000 0.000 NA
#> GSM573739 4 0.0000 0.860 0.000 0.000 0.000 1.000 0.000 NA
#> GSM573740 4 0.0000 0.860 0.000 0.000 0.000 1.000 0.000 NA
#> GSM573792 4 0.1367 0.841 0.000 0.000 0.000 0.944 0.012 NA
#> GSM573793 4 0.1196 0.844 0.000 0.000 0.000 0.952 0.008 NA
#> GSM573794 4 0.1297 0.842 0.000 0.000 0.000 0.948 0.012 NA
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
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)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
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:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.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")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
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 cell.line(p) agent(p) k
#> CV:skmeans 96 1.13e-20 0.843 2
#> CV:skmeans 96 9.56e-39 0.741 3
#> CV:skmeans 96 9.14e-57 0.975 4
#> CV:skmeans 96 1.55e-54 0.176 5
#> CV:skmeans 96 1.55e-54 0.176 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.
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 46609 rows and 96 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 5.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.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:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).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)
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.824 0.901 0.950 0.4539 0.558 0.558
#> 3 3 0.985 0.971 0.986 0.4238 0.761 0.586
#> 4 4 1.000 1.000 1.000 0.1731 0.860 0.620
#> 5 5 1.000 1.000 1.000 0.0390 0.970 0.878
#> 6 6 0.917 0.898 0.922 0.0338 1.000 1.000
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 5
#> attr(,"optional")
#> [1] 3 4
There is also optional best \(k\) = 3 4 that is worth to check.
Following shows the table of the partitions (You need to click the show/hide
code output link to see it). The membership matrix (columns with name p*
)
is inferred by
clue::cl_consensus()
function with the SE
method. Basically the value in the membership matrix
represents the probability to belong to a certain group. The finall class
label for an item is determined with the group with highest probability it
belongs to.
In get_classes()
function, the entropy is calculated from the membership
matrix and the silhouette score is calculated from the consensus matrix.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> GSM573726 1 0.0000 0.934 1.000 0.000
#> GSM573727 1 0.0000 0.934 1.000 0.000
#> GSM573728 1 0.0000 0.934 1.000 0.000
#> GSM573729 1 0.0000 0.934 1.000 0.000
#> GSM573730 1 0.0000 0.934 1.000 0.000
#> GSM573731 1 0.0000 0.934 1.000 0.000
#> GSM573735 1 0.0000 0.934 1.000 0.000
#> GSM573736 1 0.0000 0.934 1.000 0.000
#> GSM573737 1 0.0000 0.934 1.000 0.000
#> GSM573732 1 0.0000 0.934 1.000 0.000
#> GSM573733 1 0.0000 0.934 1.000 0.000
#> GSM573734 1 0.0000 0.934 1.000 0.000
#> GSM573789 1 0.0000 0.934 1.000 0.000
#> GSM573790 1 0.0000 0.934 1.000 0.000
#> GSM573791 1 0.0000 0.934 1.000 0.000
#> GSM573723 1 0.0000 0.934 1.000 0.000
#> GSM573724 1 0.0000 0.934 1.000 0.000
#> GSM573725 1 0.0000 0.934 1.000 0.000
#> GSM573720 1 0.0000 0.934 1.000 0.000
#> GSM573721 1 0.0000 0.934 1.000 0.000
#> GSM573722 1 0.0000 0.934 1.000 0.000
#> GSM573786 1 0.0000 0.934 1.000 0.000
#> GSM573787 1 0.0000 0.934 1.000 0.000
#> GSM573788 1 0.0000 0.934 1.000 0.000
#> GSM573768 2 0.0000 0.974 0.000 1.000
#> GSM573769 2 0.0000 0.974 0.000 1.000
#> GSM573770 2 0.0000 0.974 0.000 1.000
#> GSM573765 2 0.0000 0.974 0.000 1.000
#> GSM573766 2 0.0000 0.974 0.000 1.000
#> GSM573767 2 0.0000 0.974 0.000 1.000
#> GSM573777 2 0.0000 0.974 0.000 1.000
#> GSM573778 2 0.0000 0.974 0.000 1.000
#> GSM573779 2 0.0000 0.974 0.000 1.000
#> GSM573762 2 0.0000 0.974 0.000 1.000
#> GSM573763 2 0.0000 0.974 0.000 1.000
#> GSM573764 2 0.0000 0.974 0.000 1.000
#> GSM573771 2 0.0000 0.974 0.000 1.000
#> GSM573772 2 0.0000 0.974 0.000 1.000
#> GSM573773 2 0.0000 0.974 0.000 1.000
#> GSM573759 2 0.0000 0.974 0.000 1.000
#> GSM573760 2 0.0000 0.974 0.000 1.000
#> GSM573761 2 0.0000 0.974 0.000 1.000
#> GSM573774 2 0.0000 0.974 0.000 1.000
#> GSM573775 2 0.0000 0.974 0.000 1.000
#> GSM573776 2 0.0000 0.974 0.000 1.000
#> GSM573756 2 0.0000 0.974 0.000 1.000
#> GSM573757 2 0.0000 0.974 0.000 1.000
#> GSM573758 2 0.0000 0.974 0.000 1.000
#> GSM573708 1 0.4815 0.889 0.896 0.104
#> GSM573709 1 0.4022 0.906 0.920 0.080
#> GSM573710 1 0.3114 0.917 0.944 0.056
#> GSM573711 1 0.4022 0.906 0.920 0.080
#> GSM573712 1 0.4022 0.906 0.920 0.080
#> GSM573713 1 0.5629 0.863 0.868 0.132
#> GSM573717 1 0.0000 0.934 1.000 0.000
#> GSM573718 1 0.0000 0.934 1.000 0.000
#> GSM573719 1 0.0000 0.934 1.000 0.000
#> GSM573714 1 0.0000 0.934 1.000 0.000
#> GSM573715 1 0.0000 0.934 1.000 0.000
#> GSM573716 1 0.0000 0.934 1.000 0.000
#> GSM573780 2 0.6247 0.815 0.156 0.844
#> GSM573781 2 0.6148 0.821 0.152 0.848
#> GSM573782 2 0.5629 0.845 0.132 0.868
#> GSM573705 1 0.0000 0.934 1.000 0.000
#> GSM573706 1 0.0000 0.934 1.000 0.000
#> GSM573707 1 0.0000 0.934 1.000 0.000
#> GSM573702 1 0.0000 0.934 1.000 0.000
#> GSM573703 1 0.0000 0.934 1.000 0.000
#> GSM573704 1 0.0000 0.934 1.000 0.000
#> GSM573783 1 0.0000 0.934 1.000 0.000
#> GSM573784 1 0.0000 0.934 1.000 0.000
#> GSM573785 1 0.0672 0.932 0.992 0.008
#> GSM573744 1 0.3879 0.909 0.924 0.076
#> GSM573745 1 0.3879 0.909 0.924 0.076
#> GSM573746 1 0.4022 0.907 0.920 0.080
#> GSM573747 1 0.4022 0.907 0.920 0.080
#> GSM573748 1 0.3879 0.909 0.924 0.076
#> GSM573749 1 0.3879 0.909 0.924 0.076
#> GSM573753 1 0.7056 0.799 0.808 0.192
#> GSM573754 1 1.0000 0.160 0.504 0.496
#> GSM573755 1 0.9933 0.300 0.548 0.452
#> GSM573750 1 0.8661 0.666 0.712 0.288
#> GSM573751 1 0.9754 0.420 0.592 0.408
#> GSM573752 1 0.9044 0.611 0.680 0.320
#> GSM573795 2 0.1414 0.959 0.020 0.980
#> GSM573796 2 0.0938 0.966 0.012 0.988
#> GSM573797 2 0.0938 0.966 0.012 0.988
#> GSM573741 1 0.3879 0.909 0.924 0.076
#> GSM573742 1 0.3879 0.909 0.924 0.076
#> GSM573743 1 0.3879 0.909 0.924 0.076
#> GSM573738 1 0.3879 0.909 0.924 0.076
#> GSM573739 1 0.3879 0.909 0.924 0.076
#> GSM573740 1 0.3879 0.909 0.924 0.076
#> GSM573792 2 0.7674 0.701 0.224 0.776
#> GSM573793 1 0.6531 0.827 0.832 0.168
#> GSM573794 1 0.9209 0.575 0.664 0.336
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM573726 3 0.0000 0.988 0.000 0.000 1.000
#> GSM573727 3 0.0000 0.988 0.000 0.000 1.000
#> GSM573728 3 0.0000 0.988 0.000 0.000 1.000
#> GSM573729 3 0.0000 0.988 0.000 0.000 1.000
#> GSM573730 3 0.0000 0.988 0.000 0.000 1.000
#> GSM573731 3 0.0000 0.988 0.000 0.000 1.000
#> GSM573735 3 0.0000 0.988 0.000 0.000 1.000
#> GSM573736 3 0.0000 0.988 0.000 0.000 1.000
#> GSM573737 3 0.0000 0.988 0.000 0.000 1.000
#> GSM573732 3 0.0000 0.988 0.000 0.000 1.000
#> GSM573733 3 0.0000 0.988 0.000 0.000 1.000
#> GSM573734 3 0.0000 0.988 0.000 0.000 1.000
#> GSM573789 3 0.0000 0.988 0.000 0.000 1.000
#> GSM573790 3 0.0000 0.988 0.000 0.000 1.000
#> GSM573791 3 0.0000 0.988 0.000 0.000 1.000
#> GSM573723 3 0.0000 0.988 0.000 0.000 1.000
#> GSM573724 3 0.0000 0.988 0.000 0.000 1.000
#> GSM573725 3 0.0000 0.988 0.000 0.000 1.000
#> GSM573720 3 0.0000 0.988 0.000 0.000 1.000
#> GSM573721 3 0.0000 0.988 0.000 0.000 1.000
#> GSM573722 3 0.0000 0.988 0.000 0.000 1.000
#> GSM573786 3 0.0000 0.988 0.000 0.000 1.000
#> GSM573787 3 0.0000 0.988 0.000 0.000 1.000
#> GSM573788 3 0.0000 0.988 0.000 0.000 1.000
#> GSM573768 2 0.0000 0.968 0.000 1.000 0.000
#> GSM573769 2 0.0000 0.968 0.000 1.000 0.000
#> GSM573770 2 0.0000 0.968 0.000 1.000 0.000
#> GSM573765 2 0.0000 0.968 0.000 1.000 0.000
#> GSM573766 2 0.0000 0.968 0.000 1.000 0.000
#> GSM573767 2 0.0000 0.968 0.000 1.000 0.000
#> GSM573777 2 0.0000 0.968 0.000 1.000 0.000
#> GSM573778 2 0.0000 0.968 0.000 1.000 0.000
#> GSM573779 2 0.0000 0.968 0.000 1.000 0.000
#> GSM573762 2 0.0000 0.968 0.000 1.000 0.000
#> GSM573763 2 0.0000 0.968 0.000 1.000 0.000
#> GSM573764 2 0.0000 0.968 0.000 1.000 0.000
#> GSM573771 2 0.0000 0.968 0.000 1.000 0.000
#> GSM573772 2 0.0000 0.968 0.000 1.000 0.000
#> GSM573773 2 0.0000 0.968 0.000 1.000 0.000
#> GSM573759 2 0.0000 0.968 0.000 1.000 0.000
#> GSM573760 2 0.0000 0.968 0.000 1.000 0.000
#> GSM573761 2 0.0000 0.968 0.000 1.000 0.000
#> GSM573774 2 0.0000 0.968 0.000 1.000 0.000
#> GSM573775 2 0.0000 0.968 0.000 1.000 0.000
#> GSM573776 2 0.0000 0.968 0.000 1.000 0.000
#> GSM573756 2 0.0000 0.968 0.000 1.000 0.000
#> GSM573757 2 0.0000 0.968 0.000 1.000 0.000
#> GSM573758 2 0.0000 0.968 0.000 1.000 0.000
#> GSM573708 3 0.4136 0.861 0.116 0.020 0.864
#> GSM573709 3 0.1399 0.964 0.028 0.004 0.968
#> GSM573710 3 0.0829 0.977 0.012 0.004 0.984
#> GSM573711 3 0.2496 0.927 0.068 0.004 0.928
#> GSM573712 3 0.3116 0.887 0.108 0.000 0.892
#> GSM573713 3 0.4677 0.834 0.132 0.028 0.840
#> GSM573717 3 0.0000 0.988 0.000 0.000 1.000
#> GSM573718 3 0.0000 0.988 0.000 0.000 1.000
#> GSM573719 3 0.0000 0.988 0.000 0.000 1.000
#> GSM573714 3 0.0000 0.988 0.000 0.000 1.000
#> GSM573715 3 0.0000 0.988 0.000 0.000 1.000
#> GSM573716 3 0.0000 0.988 0.000 0.000 1.000
#> GSM573780 2 0.7184 0.622 0.240 0.688 0.072
#> GSM573781 2 0.6521 0.643 0.248 0.712 0.040
#> GSM573782 2 0.4842 0.718 0.000 0.776 0.224
#> GSM573705 3 0.0000 0.988 0.000 0.000 1.000
#> GSM573706 3 0.0000 0.988 0.000 0.000 1.000
#> GSM573707 3 0.0000 0.988 0.000 0.000 1.000
#> GSM573702 3 0.0000 0.988 0.000 0.000 1.000
#> GSM573703 3 0.0000 0.988 0.000 0.000 1.000
#> GSM573704 3 0.0000 0.988 0.000 0.000 1.000
#> GSM573783 3 0.0237 0.985 0.004 0.000 0.996
#> GSM573784 3 0.0000 0.988 0.000 0.000 1.000
#> GSM573785 3 0.0747 0.976 0.016 0.000 0.984
#> GSM573744 1 0.0000 1.000 1.000 0.000 0.000
#> GSM573745 1 0.0000 1.000 1.000 0.000 0.000
#> GSM573746 1 0.0000 1.000 1.000 0.000 0.000
#> GSM573747 1 0.0000 1.000 1.000 0.000 0.000
#> GSM573748 1 0.0000 1.000 1.000 0.000 0.000
#> GSM573749 1 0.0000 1.000 1.000 0.000 0.000
#> GSM573753 1 0.0000 1.000 1.000 0.000 0.000
#> GSM573754 1 0.0000 1.000 1.000 0.000 0.000
#> GSM573755 1 0.0000 1.000 1.000 0.000 0.000
#> GSM573750 1 0.0000 1.000 1.000 0.000 0.000
#> GSM573751 1 0.0000 1.000 1.000 0.000 0.000
#> GSM573752 1 0.0000 1.000 1.000 0.000 0.000
#> GSM573795 1 0.0000 1.000 1.000 0.000 0.000
#> GSM573796 1 0.0000 1.000 1.000 0.000 0.000
#> GSM573797 1 0.0000 1.000 1.000 0.000 0.000
#> GSM573741 1 0.0000 1.000 1.000 0.000 0.000
#> GSM573742 1 0.0000 1.000 1.000 0.000 0.000
#> GSM573743 1 0.0000 1.000 1.000 0.000 0.000
#> GSM573738 1 0.0000 1.000 1.000 0.000 0.000
#> GSM573739 1 0.0000 1.000 1.000 0.000 0.000
#> GSM573740 1 0.0000 1.000 1.000 0.000 0.000
#> GSM573792 1 0.0000 1.000 1.000 0.000 0.000
#> GSM573793 1 0.0000 1.000 1.000 0.000 0.000
#> GSM573794 1 0.0000 1.000 1.000 0.000 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM573726 1 0 1 1 0 0 0
#> GSM573727 1 0 1 1 0 0 0
#> GSM573728 1 0 1 1 0 0 0
#> GSM573729 1 0 1 1 0 0 0
#> GSM573730 1 0 1 1 0 0 0
#> GSM573731 1 0 1 1 0 0 0
#> GSM573735 1 0 1 1 0 0 0
#> GSM573736 1 0 1 1 0 0 0
#> GSM573737 1 0 1 1 0 0 0
#> GSM573732 1 0 1 1 0 0 0
#> GSM573733 1 0 1 1 0 0 0
#> GSM573734 1 0 1 1 0 0 0
#> GSM573789 1 0 1 1 0 0 0
#> GSM573790 1 0 1 1 0 0 0
#> GSM573791 1 0 1 1 0 0 0
#> GSM573723 1 0 1 1 0 0 0
#> GSM573724 1 0 1 1 0 0 0
#> GSM573725 1 0 1 1 0 0 0
#> GSM573720 1 0 1 1 0 0 0
#> GSM573721 1 0 1 1 0 0 0
#> GSM573722 1 0 1 1 0 0 0
#> GSM573786 1 0 1 1 0 0 0
#> GSM573787 1 0 1 1 0 0 0
#> GSM573788 1 0 1 1 0 0 0
#> GSM573768 2 0 1 0 1 0 0
#> GSM573769 2 0 1 0 1 0 0
#> GSM573770 2 0 1 0 1 0 0
#> GSM573765 2 0 1 0 1 0 0
#> GSM573766 2 0 1 0 1 0 0
#> GSM573767 2 0 1 0 1 0 0
#> GSM573777 2 0 1 0 1 0 0
#> GSM573778 2 0 1 0 1 0 0
#> GSM573779 2 0 1 0 1 0 0
#> GSM573762 2 0 1 0 1 0 0
#> GSM573763 2 0 1 0 1 0 0
#> GSM573764 2 0 1 0 1 0 0
#> GSM573771 2 0 1 0 1 0 0
#> GSM573772 2 0 1 0 1 0 0
#> GSM573773 2 0 1 0 1 0 0
#> GSM573759 2 0 1 0 1 0 0
#> GSM573760 2 0 1 0 1 0 0
#> GSM573761 2 0 1 0 1 0 0
#> GSM573774 2 0 1 0 1 0 0
#> GSM573775 2 0 1 0 1 0 0
#> GSM573776 2 0 1 0 1 0 0
#> GSM573756 2 0 1 0 1 0 0
#> GSM573757 2 0 1 0 1 0 0
#> GSM573758 2 0 1 0 1 0 0
#> GSM573708 3 0 1 0 0 1 0
#> GSM573709 3 0 1 0 0 1 0
#> GSM573710 3 0 1 0 0 1 0
#> GSM573711 3 0 1 0 0 1 0
#> GSM573712 3 0 1 0 0 1 0
#> GSM573713 3 0 1 0 0 1 0
#> GSM573717 3 0 1 0 0 1 0
#> GSM573718 3 0 1 0 0 1 0
#> GSM573719 3 0 1 0 0 1 0
#> GSM573714 3 0 1 0 0 1 0
#> GSM573715 3 0 1 0 0 1 0
#> GSM573716 3 0 1 0 0 1 0
#> GSM573780 3 0 1 0 0 1 0
#> GSM573781 3 0 1 0 0 1 0
#> GSM573782 3 0 1 0 0 1 0
#> GSM573705 3 0 1 0 0 1 0
#> GSM573706 3 0 1 0 0 1 0
#> GSM573707 3 0 1 0 0 1 0
#> GSM573702 3 0 1 0 0 1 0
#> GSM573703 3 0 1 0 0 1 0
#> GSM573704 3 0 1 0 0 1 0
#> GSM573783 3 0 1 0 0 1 0
#> GSM573784 3 0 1 0 0 1 0
#> GSM573785 3 0 1 0 0 1 0
#> GSM573744 4 0 1 0 0 0 1
#> GSM573745 4 0 1 0 0 0 1
#> GSM573746 4 0 1 0 0 0 1
#> GSM573747 4 0 1 0 0 0 1
#> GSM573748 4 0 1 0 0 0 1
#> GSM573749 4 0 1 0 0 0 1
#> GSM573753 4 0 1 0 0 0 1
#> GSM573754 4 0 1 0 0 0 1
#> GSM573755 4 0 1 0 0 0 1
#> GSM573750 4 0 1 0 0 0 1
#> GSM573751 4 0 1 0 0 0 1
#> GSM573752 4 0 1 0 0 0 1
#> GSM573795 4 0 1 0 0 0 1
#> GSM573796 4 0 1 0 0 0 1
#> GSM573797 4 0 1 0 0 0 1
#> GSM573741 4 0 1 0 0 0 1
#> GSM573742 4 0 1 0 0 0 1
#> GSM573743 4 0 1 0 0 0 1
#> GSM573738 4 0 1 0 0 0 1
#> GSM573739 4 0 1 0 0 0 1
#> GSM573740 4 0 1 0 0 0 1
#> GSM573792 4 0 1 0 0 0 1
#> GSM573793 4 0 1 0 0 0 1
#> GSM573794 4 0 1 0 0 0 1
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM573726 1 0 1 1 0 0 0 0
#> GSM573727 1 0 1 1 0 0 0 0
#> GSM573728 1 0 1 1 0 0 0 0
#> GSM573729 1 0 1 1 0 0 0 0
#> GSM573730 1 0 1 1 0 0 0 0
#> GSM573731 1 0 1 1 0 0 0 0
#> GSM573735 1 0 1 1 0 0 0 0
#> GSM573736 1 0 1 1 0 0 0 0
#> GSM573737 1 0 1 1 0 0 0 0
#> GSM573732 1 0 1 1 0 0 0 0
#> GSM573733 1 0 1 1 0 0 0 0
#> GSM573734 1 0 1 1 0 0 0 0
#> GSM573789 1 0 1 1 0 0 0 0
#> GSM573790 1 0 1 1 0 0 0 0
#> GSM573791 1 0 1 1 0 0 0 0
#> GSM573723 1 0 1 1 0 0 0 0
#> GSM573724 1 0 1 1 0 0 0 0
#> GSM573725 1 0 1 1 0 0 0 0
#> GSM573720 1 0 1 1 0 0 0 0
#> GSM573721 1 0 1 1 0 0 0 0
#> GSM573722 1 0 1 1 0 0 0 0
#> GSM573786 1 0 1 1 0 0 0 0
#> GSM573787 1 0 1 1 0 0 0 0
#> GSM573788 1 0 1 1 0 0 0 0
#> GSM573768 2 0 1 0 1 0 0 0
#> GSM573769 2 0 1 0 1 0 0 0
#> GSM573770 2 0 1 0 1 0 0 0
#> GSM573765 2 0 1 0 1 0 0 0
#> GSM573766 2 0 1 0 1 0 0 0
#> GSM573767 2 0 1 0 1 0 0 0
#> GSM573777 2 0 1 0 1 0 0 0
#> GSM573778 2 0 1 0 1 0 0 0
#> GSM573779 2 0 1 0 1 0 0 0
#> GSM573762 2 0 1 0 1 0 0 0
#> GSM573763 2 0 1 0 1 0 0 0
#> GSM573764 2 0 1 0 1 0 0 0
#> GSM573771 2 0 1 0 1 0 0 0
#> GSM573772 2 0 1 0 1 0 0 0
#> GSM573773 2 0 1 0 1 0 0 0
#> GSM573759 2 0 1 0 1 0 0 0
#> GSM573760 2 0 1 0 1 0 0 0
#> GSM573761 2 0 1 0 1 0 0 0
#> GSM573774 2 0 1 0 1 0 0 0
#> GSM573775 2 0 1 0 1 0 0 0
#> GSM573776 2 0 1 0 1 0 0 0
#> GSM573756 2 0 1 0 1 0 0 0
#> GSM573757 2 0 1 0 1 0 0 0
#> GSM573758 2 0 1 0 1 0 0 0
#> GSM573708 5 0 1 0 0 0 0 1
#> GSM573709 5 0 1 0 0 0 0 1
#> GSM573710 5 0 1 0 0 0 0 1
#> GSM573711 5 0 1 0 0 0 0 1
#> GSM573712 5 0 1 0 0 0 0 1
#> GSM573713 5 0 1 0 0 0 0 1
#> GSM573717 3 0 1 0 0 1 0 0
#> GSM573718 3 0 1 0 0 1 0 0
#> GSM573719 3 0 1 0 0 1 0 0
#> GSM573714 3 0 1 0 0 1 0 0
#> GSM573715 3 0 1 0 0 1 0 0
#> GSM573716 3 0 1 0 0 1 0 0
#> GSM573780 5 0 1 0 0 0 0 1
#> GSM573781 5 0 1 0 0 0 0 1
#> GSM573782 5 0 1 0 0 0 0 1
#> GSM573705 3 0 1 0 0 1 0 0
#> GSM573706 3 0 1 0 0 1 0 0
#> GSM573707 3 0 1 0 0 1 0 0
#> GSM573702 3 0 1 0 0 1 0 0
#> GSM573703 3 0 1 0 0 1 0 0
#> GSM573704 3 0 1 0 0 1 0 0
#> GSM573783 3 0 1 0 0 1 0 0
#> GSM573784 3 0 1 0 0 1 0 0
#> GSM573785 3 0 1 0 0 1 0 0
#> GSM573744 4 0 1 0 0 0 1 0
#> GSM573745 4 0 1 0 0 0 1 0
#> GSM573746 4 0 1 0 0 0 1 0
#> GSM573747 4 0 1 0 0 0 1 0
#> GSM573748 4 0 1 0 0 0 1 0
#> GSM573749 4 0 1 0 0 0 1 0
#> GSM573753 4 0 1 0 0 0 1 0
#> GSM573754 4 0 1 0 0 0 1 0
#> GSM573755 4 0 1 0 0 0 1 0
#> GSM573750 4 0 1 0 0 0 1 0
#> GSM573751 4 0 1 0 0 0 1 0
#> GSM573752 4 0 1 0 0 0 1 0
#> GSM573795 4 0 1 0 0 0 1 0
#> GSM573796 4 0 1 0 0 0 1 0
#> GSM573797 4 0 1 0 0 0 1 0
#> GSM573741 4 0 1 0 0 0 1 0
#> GSM573742 4 0 1 0 0 0 1 0
#> GSM573743 4 0 1 0 0 0 1 0
#> GSM573738 4 0 1 0 0 0 1 0
#> GSM573739 4 0 1 0 0 0 1 0
#> GSM573740 4 0 1 0 0 0 1 0
#> GSM573792 4 0 1 0 0 0 1 0
#> GSM573793 4 0 1 0 0 0 1 0
#> GSM573794 4 0 1 0 0 0 1 0
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM573726 1 0.0000 0.905 1.000 0.000 0 0.000 0 NA
#> GSM573727 1 0.0000 0.905 1.000 0.000 0 0.000 0 NA
#> GSM573728 1 0.0000 0.905 1.000 0.000 0 0.000 0 NA
#> GSM573729 1 0.0000 0.905 1.000 0.000 0 0.000 0 NA
#> GSM573730 1 0.0000 0.905 1.000 0.000 0 0.000 0 NA
#> GSM573731 1 0.0000 0.905 1.000 0.000 0 0.000 0 NA
#> GSM573735 1 0.3756 0.670 0.600 0.000 0 0.000 0 NA
#> GSM573736 1 0.3756 0.670 0.600 0.000 0 0.000 0 NA
#> GSM573737 1 0.3756 0.670 0.600 0.000 0 0.000 0 NA
#> GSM573732 1 0.3756 0.670 0.600 0.000 0 0.000 0 NA
#> GSM573733 1 0.3756 0.670 0.600 0.000 0 0.000 0 NA
#> GSM573734 1 0.3756 0.670 0.600 0.000 0 0.000 0 NA
#> GSM573789 1 0.0000 0.905 1.000 0.000 0 0.000 0 NA
#> GSM573790 1 0.0000 0.905 1.000 0.000 0 0.000 0 NA
#> GSM573791 1 0.0146 0.903 0.996 0.000 0 0.000 0 NA
#> GSM573723 1 0.0000 0.905 1.000 0.000 0 0.000 0 NA
#> GSM573724 1 0.0000 0.905 1.000 0.000 0 0.000 0 NA
#> GSM573725 1 0.0000 0.905 1.000 0.000 0 0.000 0 NA
#> GSM573720 1 0.0000 0.905 1.000 0.000 0 0.000 0 NA
#> GSM573721 1 0.0000 0.905 1.000 0.000 0 0.000 0 NA
#> GSM573722 1 0.0000 0.905 1.000 0.000 0 0.000 0 NA
#> GSM573786 1 0.0000 0.905 1.000 0.000 0 0.000 0 NA
#> GSM573787 1 0.0000 0.905 1.000 0.000 0 0.000 0 NA
#> GSM573788 1 0.0000 0.905 1.000 0.000 0 0.000 0 NA
#> GSM573768 2 0.0000 0.886 0.000 1.000 0 0.000 0 NA
#> GSM573769 2 0.0000 0.886 0.000 1.000 0 0.000 0 NA
#> GSM573770 2 0.0000 0.886 0.000 1.000 0 0.000 0 NA
#> GSM573765 2 0.0000 0.886 0.000 1.000 0 0.000 0 NA
#> GSM573766 2 0.0000 0.886 0.000 1.000 0 0.000 0 NA
#> GSM573767 2 0.0000 0.886 0.000 1.000 0 0.000 0 NA
#> GSM573777 2 0.3482 0.798 0.000 0.684 0 0.000 0 NA
#> GSM573778 2 0.3482 0.798 0.000 0.684 0 0.000 0 NA
#> GSM573779 2 0.3482 0.798 0.000 0.684 0 0.000 0 NA
#> GSM573762 2 0.3482 0.798 0.000 0.684 0 0.000 0 NA
#> GSM573763 2 0.3482 0.798 0.000 0.684 0 0.000 0 NA
#> GSM573764 2 0.3482 0.798 0.000 0.684 0 0.000 0 NA
#> GSM573771 2 0.3482 0.798 0.000 0.684 0 0.000 0 NA
#> GSM573772 2 0.3482 0.798 0.000 0.684 0 0.000 0 NA
#> GSM573773 2 0.3482 0.798 0.000 0.684 0 0.000 0 NA
#> GSM573759 2 0.0000 0.886 0.000 1.000 0 0.000 0 NA
#> GSM573760 2 0.0000 0.886 0.000 1.000 0 0.000 0 NA
#> GSM573761 2 0.0000 0.886 0.000 1.000 0 0.000 0 NA
#> GSM573774 2 0.0000 0.886 0.000 1.000 0 0.000 0 NA
#> GSM573775 2 0.0000 0.886 0.000 1.000 0 0.000 0 NA
#> GSM573776 2 0.0000 0.886 0.000 1.000 0 0.000 0 NA
#> GSM573756 2 0.0000 0.886 0.000 1.000 0 0.000 0 NA
#> GSM573757 2 0.0000 0.886 0.000 1.000 0 0.000 0 NA
#> GSM573758 2 0.0000 0.886 0.000 1.000 0 0.000 0 NA
#> GSM573708 5 0.0000 1.000 0.000 0.000 0 0.000 1 NA
#> GSM573709 5 0.0000 1.000 0.000 0.000 0 0.000 1 NA
#> GSM573710 5 0.0000 1.000 0.000 0.000 0 0.000 1 NA
#> GSM573711 5 0.0000 1.000 0.000 0.000 0 0.000 1 NA
#> GSM573712 5 0.0000 1.000 0.000 0.000 0 0.000 1 NA
#> GSM573713 5 0.0000 1.000 0.000 0.000 0 0.000 1 NA
#> GSM573717 3 0.0000 1.000 0.000 0.000 1 0.000 0 NA
#> GSM573718 3 0.0000 1.000 0.000 0.000 1 0.000 0 NA
#> GSM573719 3 0.0000 1.000 0.000 0.000 1 0.000 0 NA
#> GSM573714 3 0.0000 1.000 0.000 0.000 1 0.000 0 NA
#> GSM573715 3 0.0000 1.000 0.000 0.000 1 0.000 0 NA
#> GSM573716 3 0.0000 1.000 0.000 0.000 1 0.000 0 NA
#> GSM573780 5 0.0000 1.000 0.000 0.000 0 0.000 1 NA
#> GSM573781 5 0.0000 1.000 0.000 0.000 0 0.000 1 NA
#> GSM573782 5 0.0000 1.000 0.000 0.000 0 0.000 1 NA
#> GSM573705 3 0.0000 1.000 0.000 0.000 1 0.000 0 NA
#> GSM573706 3 0.0000 1.000 0.000 0.000 1 0.000 0 NA
#> GSM573707 3 0.0000 1.000 0.000 0.000 1 0.000 0 NA
#> GSM573702 3 0.0000 1.000 0.000 0.000 1 0.000 0 NA
#> GSM573703 3 0.0000 1.000 0.000 0.000 1 0.000 0 NA
#> GSM573704 3 0.0000 1.000 0.000 0.000 1 0.000 0 NA
#> GSM573783 3 0.0000 1.000 0.000 0.000 1 0.000 0 NA
#> GSM573784 3 0.0000 1.000 0.000 0.000 1 0.000 0 NA
#> GSM573785 3 0.0000 1.000 0.000 0.000 1 0.000 0 NA
#> GSM573744 4 0.0000 0.916 0.000 0.000 0 1.000 0 NA
#> GSM573745 4 0.0000 0.916 0.000 0.000 0 1.000 0 NA
#> GSM573746 4 0.0000 0.916 0.000 0.000 0 1.000 0 NA
#> GSM573747 4 0.0000 0.916 0.000 0.000 0 1.000 0 NA
#> GSM573748 4 0.0000 0.916 0.000 0.000 0 1.000 0 NA
#> GSM573749 4 0.0000 0.916 0.000 0.000 0 1.000 0 NA
#> GSM573753 4 0.2697 0.872 0.000 0.000 0 0.812 0 NA
#> GSM573754 4 0.2697 0.872 0.000 0.000 0 0.812 0 NA
#> GSM573755 4 0.2697 0.872 0.000 0.000 0 0.812 0 NA
#> GSM573750 4 0.2697 0.872 0.000 0.000 0 0.812 0 NA
#> GSM573751 4 0.2697 0.872 0.000 0.000 0 0.812 0 NA
#> GSM573752 4 0.2697 0.872 0.000 0.000 0 0.812 0 NA
#> GSM573795 4 0.3330 0.833 0.000 0.000 0 0.716 0 NA
#> GSM573796 4 0.3330 0.833 0.000 0.000 0 0.716 0 NA
#> GSM573797 4 0.3330 0.833 0.000 0.000 0 0.716 0 NA
#> GSM573741 4 0.0000 0.916 0.000 0.000 0 1.000 0 NA
#> GSM573742 4 0.0000 0.916 0.000 0.000 0 1.000 0 NA
#> GSM573743 4 0.0000 0.916 0.000 0.000 0 1.000 0 NA
#> GSM573738 4 0.0000 0.916 0.000 0.000 0 1.000 0 NA
#> GSM573739 4 0.0000 0.916 0.000 0.000 0 1.000 0 NA
#> GSM573740 4 0.0000 0.916 0.000 0.000 0 1.000 0 NA
#> GSM573792 4 0.1765 0.883 0.000 0.000 0 0.904 0 NA
#> GSM573793 4 0.1765 0.883 0.000 0.000 0 0.904 0 NA
#> GSM573794 4 0.1765 0.883 0.000 0.000 0 0.904 0 NA
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
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)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
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:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.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")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
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 cell.line(p) agent(p) k
#> CV:pam 93 2.26e-14 0.00932 2
#> CV:pam 96 1.42e-35 0.50490 3
#> CV:pam 96 9.14e-57 0.97496 4
#> CV:pam 96 1.55e-54 0.17576 5
#> CV:pam 96 1.55e-54 0.17576 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.
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 46609 rows and 96 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 5.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.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:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).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)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 0.368 0.670 0.743 0.4893 0.495 0.495
#> 3 3 1.000 1.000 1.000 0.2915 0.621 0.390
#> 4 4 1.000 1.000 1.000 0.1997 0.874 0.657
#> 5 5 0.990 0.975 0.970 0.0208 0.982 0.928
#> 6 6 0.965 0.892 0.946 0.0128 0.995 0.978
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 5
#> attr(,"optional")
#> [1] 3 4
There is also optional best \(k\) = 3 4 that is worth to check.
Following shows the table of the partitions (You need to click the show/hide
code output link to see it). The membership matrix (columns with name p*
)
is inferred by
clue::cl_consensus()
function with the SE
method. Basically the value in the membership matrix
represents the probability to belong to a certain group. The finall class
label for an item is determined with the group with highest probability it
belongs to.
In get_classes()
function, the entropy is calculated from the membership
matrix and the silhouette score is calculated from the consensus matrix.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> GSM573726 1 0.932 0.694 0.652 0.348
#> GSM573727 1 0.932 0.694 0.652 0.348
#> GSM573728 1 0.932 0.694 0.652 0.348
#> GSM573729 1 0.932 0.694 0.652 0.348
#> GSM573730 1 0.932 0.694 0.652 0.348
#> GSM573731 1 0.932 0.694 0.652 0.348
#> GSM573735 1 0.932 0.694 0.652 0.348
#> GSM573736 1 0.932 0.694 0.652 0.348
#> GSM573737 1 0.932 0.694 0.652 0.348
#> GSM573732 1 0.932 0.694 0.652 0.348
#> GSM573733 1 0.932 0.694 0.652 0.348
#> GSM573734 1 0.932 0.694 0.652 0.348
#> GSM573789 1 0.932 0.694 0.652 0.348
#> GSM573790 1 0.932 0.694 0.652 0.348
#> GSM573791 1 0.932 0.694 0.652 0.348
#> GSM573723 1 0.932 0.694 0.652 0.348
#> GSM573724 1 0.932 0.694 0.652 0.348
#> GSM573725 1 0.932 0.694 0.652 0.348
#> GSM573720 1 0.932 0.694 0.652 0.348
#> GSM573721 1 0.932 0.694 0.652 0.348
#> GSM573722 1 0.932 0.694 0.652 0.348
#> GSM573786 1 0.932 0.694 0.652 0.348
#> GSM573787 1 0.932 0.694 0.652 0.348
#> GSM573788 1 0.932 0.694 0.652 0.348
#> GSM573768 2 0.000 0.666 0.000 1.000
#> GSM573769 2 0.000 0.666 0.000 1.000
#> GSM573770 2 0.000 0.666 0.000 1.000
#> GSM573765 2 0.000 0.666 0.000 1.000
#> GSM573766 2 0.000 0.666 0.000 1.000
#> GSM573767 2 0.000 0.666 0.000 1.000
#> GSM573777 2 0.000 0.666 0.000 1.000
#> GSM573778 2 0.000 0.666 0.000 1.000
#> GSM573779 2 0.000 0.666 0.000 1.000
#> GSM573762 2 0.000 0.666 0.000 1.000
#> GSM573763 2 0.000 0.666 0.000 1.000
#> GSM573764 2 0.000 0.666 0.000 1.000
#> GSM573771 2 0.000 0.666 0.000 1.000
#> GSM573772 2 0.000 0.666 0.000 1.000
#> GSM573773 2 0.000 0.666 0.000 1.000
#> GSM573759 2 0.000 0.666 0.000 1.000
#> GSM573760 2 0.000 0.666 0.000 1.000
#> GSM573761 2 0.000 0.666 0.000 1.000
#> GSM573774 2 0.000 0.666 0.000 1.000
#> GSM573775 2 0.000 0.666 0.000 1.000
#> GSM573776 2 0.000 0.666 0.000 1.000
#> GSM573756 2 0.000 0.666 0.000 1.000
#> GSM573757 2 0.000 0.666 0.000 1.000
#> GSM573758 2 0.000 0.666 0.000 1.000
#> GSM573708 1 0.242 0.691 0.960 0.040
#> GSM573709 1 0.242 0.691 0.960 0.040
#> GSM573710 1 0.242 0.691 0.960 0.040
#> GSM573711 1 0.242 0.691 0.960 0.040
#> GSM573712 1 0.242 0.691 0.960 0.040
#> GSM573713 1 0.242 0.691 0.960 0.040
#> GSM573717 1 0.242 0.691 0.960 0.040
#> GSM573718 1 0.242 0.691 0.960 0.040
#> GSM573719 1 0.242 0.691 0.960 0.040
#> GSM573714 1 0.242 0.691 0.960 0.040
#> GSM573715 1 0.242 0.691 0.960 0.040
#> GSM573716 1 0.242 0.691 0.960 0.040
#> GSM573780 1 0.242 0.691 0.960 0.040
#> GSM573781 1 0.242 0.691 0.960 0.040
#> GSM573782 1 0.242 0.691 0.960 0.040
#> GSM573705 1 0.242 0.691 0.960 0.040
#> GSM573706 1 0.242 0.691 0.960 0.040
#> GSM573707 1 0.242 0.691 0.960 0.040
#> GSM573702 1 0.242 0.691 0.960 0.040
#> GSM573703 1 0.242 0.691 0.960 0.040
#> GSM573704 1 0.242 0.691 0.960 0.040
#> GSM573783 1 0.242 0.691 0.960 0.040
#> GSM573784 1 0.242 0.691 0.960 0.040
#> GSM573785 1 0.242 0.691 0.960 0.040
#> GSM573744 2 0.998 0.626 0.472 0.528
#> GSM573745 2 0.998 0.626 0.472 0.528
#> GSM573746 2 0.998 0.626 0.472 0.528
#> GSM573747 2 0.998 0.626 0.472 0.528
#> GSM573748 2 0.998 0.626 0.472 0.528
#> GSM573749 2 0.998 0.626 0.472 0.528
#> GSM573753 2 0.998 0.626 0.472 0.528
#> GSM573754 2 0.998 0.626 0.472 0.528
#> GSM573755 2 0.998 0.626 0.472 0.528
#> GSM573750 2 0.998 0.626 0.472 0.528
#> GSM573751 2 0.998 0.626 0.472 0.528
#> GSM573752 2 0.998 0.626 0.472 0.528
#> GSM573795 2 0.998 0.626 0.472 0.528
#> GSM573796 2 0.998 0.626 0.472 0.528
#> GSM573797 2 0.998 0.626 0.472 0.528
#> GSM573741 2 0.998 0.626 0.472 0.528
#> GSM573742 2 0.998 0.626 0.472 0.528
#> GSM573743 2 0.998 0.626 0.472 0.528
#> GSM573738 2 0.998 0.626 0.472 0.528
#> GSM573739 2 0.998 0.626 0.472 0.528
#> GSM573740 2 0.998 0.626 0.472 0.528
#> GSM573792 2 0.998 0.626 0.472 0.528
#> GSM573793 2 0.998 0.626 0.472 0.528
#> GSM573794 2 0.998 0.626 0.472 0.528
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM573726 1 0 1 1 0 0
#> GSM573727 1 0 1 1 0 0
#> GSM573728 1 0 1 1 0 0
#> GSM573729 1 0 1 1 0 0
#> GSM573730 1 0 1 1 0 0
#> GSM573731 1 0 1 1 0 0
#> GSM573735 1 0 1 1 0 0
#> GSM573736 1 0 1 1 0 0
#> GSM573737 1 0 1 1 0 0
#> GSM573732 1 0 1 1 0 0
#> GSM573733 1 0 1 1 0 0
#> GSM573734 1 0 1 1 0 0
#> GSM573789 1 0 1 1 0 0
#> GSM573790 1 0 1 1 0 0
#> GSM573791 1 0 1 1 0 0
#> GSM573723 1 0 1 1 0 0
#> GSM573724 1 0 1 1 0 0
#> GSM573725 1 0 1 1 0 0
#> GSM573720 1 0 1 1 0 0
#> GSM573721 1 0 1 1 0 0
#> GSM573722 1 0 1 1 0 0
#> GSM573786 1 0 1 1 0 0
#> GSM573787 1 0 1 1 0 0
#> GSM573788 1 0 1 1 0 0
#> GSM573768 2 0 1 0 1 0
#> GSM573769 2 0 1 0 1 0
#> GSM573770 2 0 1 0 1 0
#> GSM573765 2 0 1 0 1 0
#> GSM573766 2 0 1 0 1 0
#> GSM573767 2 0 1 0 1 0
#> GSM573777 2 0 1 0 1 0
#> GSM573778 2 0 1 0 1 0
#> GSM573779 2 0 1 0 1 0
#> GSM573762 2 0 1 0 1 0
#> GSM573763 2 0 1 0 1 0
#> GSM573764 2 0 1 0 1 0
#> GSM573771 2 0 1 0 1 0
#> GSM573772 2 0 1 0 1 0
#> GSM573773 2 0 1 0 1 0
#> GSM573759 2 0 1 0 1 0
#> GSM573760 2 0 1 0 1 0
#> GSM573761 2 0 1 0 1 0
#> GSM573774 2 0 1 0 1 0
#> GSM573775 2 0 1 0 1 0
#> GSM573776 2 0 1 0 1 0
#> GSM573756 2 0 1 0 1 0
#> GSM573757 2 0 1 0 1 0
#> GSM573758 2 0 1 0 1 0
#> GSM573708 3 0 1 0 0 1
#> GSM573709 3 0 1 0 0 1
#> GSM573710 3 0 1 0 0 1
#> GSM573711 3 0 1 0 0 1
#> GSM573712 3 0 1 0 0 1
#> GSM573713 3 0 1 0 0 1
#> GSM573717 3 0 1 0 0 1
#> GSM573718 3 0 1 0 0 1
#> GSM573719 3 0 1 0 0 1
#> GSM573714 3 0 1 0 0 1
#> GSM573715 3 0 1 0 0 1
#> GSM573716 3 0 1 0 0 1
#> GSM573780 3 0 1 0 0 1
#> GSM573781 3 0 1 0 0 1
#> GSM573782 3 0 1 0 0 1
#> GSM573705 3 0 1 0 0 1
#> GSM573706 3 0 1 0 0 1
#> GSM573707 3 0 1 0 0 1
#> GSM573702 3 0 1 0 0 1
#> GSM573703 3 0 1 0 0 1
#> GSM573704 3 0 1 0 0 1
#> GSM573783 3 0 1 0 0 1
#> GSM573784 3 0 1 0 0 1
#> GSM573785 3 0 1 0 0 1
#> GSM573744 3 0 1 0 0 1
#> GSM573745 3 0 1 0 0 1
#> GSM573746 3 0 1 0 0 1
#> GSM573747 3 0 1 0 0 1
#> GSM573748 3 0 1 0 0 1
#> GSM573749 3 0 1 0 0 1
#> GSM573753 3 0 1 0 0 1
#> GSM573754 3 0 1 0 0 1
#> GSM573755 3 0 1 0 0 1
#> GSM573750 3 0 1 0 0 1
#> GSM573751 3 0 1 0 0 1
#> GSM573752 3 0 1 0 0 1
#> GSM573795 3 0 1 0 0 1
#> GSM573796 3 0 1 0 0 1
#> GSM573797 3 0 1 0 0 1
#> GSM573741 3 0 1 0 0 1
#> GSM573742 3 0 1 0 0 1
#> GSM573743 3 0 1 0 0 1
#> GSM573738 3 0 1 0 0 1
#> GSM573739 3 0 1 0 0 1
#> GSM573740 3 0 1 0 0 1
#> GSM573792 3 0 1 0 0 1
#> GSM573793 3 0 1 0 0 1
#> GSM573794 3 0 1 0 0 1
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM573726 1 0 1 1 0 0 0
#> GSM573727 1 0 1 1 0 0 0
#> GSM573728 1 0 1 1 0 0 0
#> GSM573729 1 0 1 1 0 0 0
#> GSM573730 1 0 1 1 0 0 0
#> GSM573731 1 0 1 1 0 0 0
#> GSM573735 1 0 1 1 0 0 0
#> GSM573736 1 0 1 1 0 0 0
#> GSM573737 1 0 1 1 0 0 0
#> GSM573732 1 0 1 1 0 0 0
#> GSM573733 1 0 1 1 0 0 0
#> GSM573734 1 0 1 1 0 0 0
#> GSM573789 1 0 1 1 0 0 0
#> GSM573790 1 0 1 1 0 0 0
#> GSM573791 1 0 1 1 0 0 0
#> GSM573723 1 0 1 1 0 0 0
#> GSM573724 1 0 1 1 0 0 0
#> GSM573725 1 0 1 1 0 0 0
#> GSM573720 1 0 1 1 0 0 0
#> GSM573721 1 0 1 1 0 0 0
#> GSM573722 1 0 1 1 0 0 0
#> GSM573786 1 0 1 1 0 0 0
#> GSM573787 1 0 1 1 0 0 0
#> GSM573788 1 0 1 1 0 0 0
#> GSM573768 2 0 1 0 1 0 0
#> GSM573769 2 0 1 0 1 0 0
#> GSM573770 2 0 1 0 1 0 0
#> GSM573765 2 0 1 0 1 0 0
#> GSM573766 2 0 1 0 1 0 0
#> GSM573767 2 0 1 0 1 0 0
#> GSM573777 2 0 1 0 1 0 0
#> GSM573778 2 0 1 0 1 0 0
#> GSM573779 2 0 1 0 1 0 0
#> GSM573762 2 0 1 0 1 0 0
#> GSM573763 2 0 1 0 1 0 0
#> GSM573764 2 0 1 0 1 0 0
#> GSM573771 2 0 1 0 1 0 0
#> GSM573772 2 0 1 0 1 0 0
#> GSM573773 2 0 1 0 1 0 0
#> GSM573759 2 0 1 0 1 0 0
#> GSM573760 2 0 1 0 1 0 0
#> GSM573761 2 0 1 0 1 0 0
#> GSM573774 2 0 1 0 1 0 0
#> GSM573775 2 0 1 0 1 0 0
#> GSM573776 2 0 1 0 1 0 0
#> GSM573756 2 0 1 0 1 0 0
#> GSM573757 2 0 1 0 1 0 0
#> GSM573758 2 0 1 0 1 0 0
#> GSM573708 3 0 1 0 0 1 0
#> GSM573709 3 0 1 0 0 1 0
#> GSM573710 3 0 1 0 0 1 0
#> GSM573711 3 0 1 0 0 1 0
#> GSM573712 3 0 1 0 0 1 0
#> GSM573713 3 0 1 0 0 1 0
#> GSM573717 3 0 1 0 0 1 0
#> GSM573718 3 0 1 0 0 1 0
#> GSM573719 3 0 1 0 0 1 0
#> GSM573714 3 0 1 0 0 1 0
#> GSM573715 3 0 1 0 0 1 0
#> GSM573716 3 0 1 0 0 1 0
#> GSM573780 3 0 1 0 0 1 0
#> GSM573781 3 0 1 0 0 1 0
#> GSM573782 3 0 1 0 0 1 0
#> GSM573705 3 0 1 0 0 1 0
#> GSM573706 3 0 1 0 0 1 0
#> GSM573707 3 0 1 0 0 1 0
#> GSM573702 3 0 1 0 0 1 0
#> GSM573703 3 0 1 0 0 1 0
#> GSM573704 3 0 1 0 0 1 0
#> GSM573783 3 0 1 0 0 1 0
#> GSM573784 3 0 1 0 0 1 0
#> GSM573785 3 0 1 0 0 1 0
#> GSM573744 4 0 1 0 0 0 1
#> GSM573745 4 0 1 0 0 0 1
#> GSM573746 4 0 1 0 0 0 1
#> GSM573747 4 0 1 0 0 0 1
#> GSM573748 4 0 1 0 0 0 1
#> GSM573749 4 0 1 0 0 0 1
#> GSM573753 4 0 1 0 0 0 1
#> GSM573754 4 0 1 0 0 0 1
#> GSM573755 4 0 1 0 0 0 1
#> GSM573750 4 0 1 0 0 0 1
#> GSM573751 4 0 1 0 0 0 1
#> GSM573752 4 0 1 0 0 0 1
#> GSM573795 4 0 1 0 0 0 1
#> GSM573796 4 0 1 0 0 0 1
#> GSM573797 4 0 1 0 0 0 1
#> GSM573741 4 0 1 0 0 0 1
#> GSM573742 4 0 1 0 0 0 1
#> GSM573743 4 0 1 0 0 0 1
#> GSM573738 4 0 1 0 0 0 1
#> GSM573739 4 0 1 0 0 0 1
#> GSM573740 4 0 1 0 0 0 1
#> GSM573792 4 0 1 0 0 0 1
#> GSM573793 4 0 1 0 0 0 1
#> GSM573794 4 0 1 0 0 0 1
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM573726 1 0.0404 0.991 0.988 0.000 0.000 0.000 0.012
#> GSM573727 1 0.0510 0.990 0.984 0.000 0.000 0.000 0.016
#> GSM573728 1 0.0162 0.993 0.996 0.000 0.000 0.000 0.004
#> GSM573729 1 0.0794 0.984 0.972 0.000 0.000 0.000 0.028
#> GSM573730 1 0.0510 0.990 0.984 0.000 0.000 0.000 0.016
#> GSM573731 1 0.0609 0.988 0.980 0.000 0.000 0.000 0.020
#> GSM573735 1 0.0162 0.992 0.996 0.000 0.000 0.000 0.004
#> GSM573736 1 0.0162 0.992 0.996 0.000 0.000 0.000 0.004
#> GSM573737 1 0.0290 0.992 0.992 0.000 0.000 0.000 0.008
#> GSM573732 1 0.0162 0.992 0.996 0.000 0.000 0.000 0.004
#> GSM573733 1 0.0703 0.985 0.976 0.000 0.000 0.000 0.024
#> GSM573734 1 0.0404 0.991 0.988 0.000 0.000 0.000 0.012
#> GSM573789 1 0.0290 0.992 0.992 0.000 0.000 0.000 0.008
#> GSM573790 1 0.0290 0.992 0.992 0.000 0.000 0.000 0.008
#> GSM573791 1 0.0404 0.990 0.988 0.000 0.000 0.000 0.012
#> GSM573723 1 0.0162 0.993 0.996 0.000 0.000 0.000 0.004
#> GSM573724 1 0.0510 0.990 0.984 0.000 0.000 0.000 0.016
#> GSM573725 1 0.0162 0.992 0.996 0.000 0.000 0.000 0.004
#> GSM573720 1 0.0162 0.992 0.996 0.000 0.000 0.000 0.004
#> GSM573721 1 0.0609 0.988 0.980 0.000 0.000 0.000 0.020
#> GSM573722 1 0.0162 0.992 0.996 0.000 0.000 0.000 0.004
#> GSM573786 1 0.0000 0.993 1.000 0.000 0.000 0.000 0.000
#> GSM573787 1 0.0000 0.993 1.000 0.000 0.000 0.000 0.000
#> GSM573788 1 0.0000 0.993 1.000 0.000 0.000 0.000 0.000
#> GSM573768 2 0.0162 0.988 0.000 0.996 0.000 0.000 0.004
#> GSM573769 2 0.0162 0.988 0.000 0.996 0.000 0.000 0.004
#> GSM573770 2 0.0000 0.988 0.000 1.000 0.000 0.000 0.000
#> GSM573765 2 0.0000 0.988 0.000 1.000 0.000 0.000 0.000
#> GSM573766 2 0.0162 0.988 0.000 0.996 0.000 0.000 0.004
#> GSM573767 2 0.0000 0.988 0.000 1.000 0.000 0.000 0.000
#> GSM573777 2 0.0162 0.988 0.000 0.996 0.000 0.000 0.004
#> GSM573778 2 0.0000 0.988 0.000 1.000 0.000 0.000 0.000
#> GSM573779 2 0.0162 0.988 0.000 0.996 0.000 0.000 0.004
#> GSM573762 2 0.0000 0.988 0.000 1.000 0.000 0.000 0.000
#> GSM573763 2 0.0000 0.988 0.000 1.000 0.000 0.000 0.000
#> GSM573764 2 0.0290 0.986 0.000 0.992 0.000 0.000 0.008
#> GSM573771 2 0.0162 0.988 0.000 0.996 0.000 0.000 0.004
#> GSM573772 2 0.0162 0.988 0.000 0.996 0.000 0.000 0.004
#> GSM573773 2 0.0000 0.988 0.000 1.000 0.000 0.000 0.000
#> GSM573759 2 0.0000 0.988 0.000 1.000 0.000 0.000 0.000
#> GSM573760 2 0.0000 0.988 0.000 1.000 0.000 0.000 0.000
#> GSM573761 2 0.0162 0.988 0.000 0.996 0.000 0.000 0.004
#> GSM573774 2 0.0162 0.988 0.000 0.996 0.000 0.000 0.004
#> GSM573775 2 0.0162 0.986 0.000 0.996 0.000 0.000 0.004
#> GSM573776 2 0.0162 0.988 0.000 0.996 0.000 0.000 0.004
#> GSM573756 2 0.1851 0.924 0.000 0.912 0.000 0.000 0.088
#> GSM573757 2 0.1851 0.924 0.000 0.912 0.000 0.000 0.088
#> GSM573758 2 0.1851 0.924 0.000 0.912 0.000 0.000 0.088
#> GSM573708 3 0.1043 0.966 0.000 0.000 0.960 0.000 0.040
#> GSM573709 3 0.1341 0.958 0.000 0.000 0.944 0.000 0.056
#> GSM573710 3 0.1270 0.959 0.000 0.000 0.948 0.000 0.052
#> GSM573711 3 0.0510 0.974 0.000 0.000 0.984 0.000 0.016
#> GSM573712 3 0.0609 0.973 0.000 0.000 0.980 0.000 0.020
#> GSM573713 3 0.0963 0.968 0.000 0.000 0.964 0.000 0.036
#> GSM573717 3 0.0162 0.977 0.000 0.000 0.996 0.000 0.004
#> GSM573718 3 0.0162 0.977 0.000 0.000 0.996 0.000 0.004
#> GSM573719 3 0.0000 0.977 0.000 0.000 1.000 0.000 0.000
#> GSM573714 3 0.0000 0.977 0.000 0.000 1.000 0.000 0.000
#> GSM573715 3 0.0000 0.977 0.000 0.000 1.000 0.000 0.000
#> GSM573716 3 0.0162 0.977 0.000 0.000 0.996 0.000 0.004
#> GSM573780 3 0.2280 0.910 0.000 0.000 0.880 0.000 0.120
#> GSM573781 3 0.2424 0.900 0.000 0.000 0.868 0.000 0.132
#> GSM573782 3 0.2605 0.888 0.000 0.000 0.852 0.000 0.148
#> GSM573705 3 0.0162 0.977 0.000 0.000 0.996 0.000 0.004
#> GSM573706 3 0.0162 0.977 0.000 0.000 0.996 0.000 0.004
#> GSM573707 3 0.0162 0.977 0.000 0.000 0.996 0.000 0.004
#> GSM573702 3 0.0162 0.977 0.000 0.000 0.996 0.000 0.004
#> GSM573703 3 0.0000 0.977 0.000 0.000 1.000 0.000 0.000
#> GSM573704 3 0.0000 0.977 0.000 0.000 1.000 0.000 0.000
#> GSM573783 3 0.0162 0.977 0.000 0.000 0.996 0.000 0.004
#> GSM573784 3 0.0162 0.977 0.000 0.000 0.996 0.000 0.004
#> GSM573785 3 0.0290 0.977 0.000 0.000 0.992 0.000 0.008
#> GSM573744 4 0.0000 0.993 0.000 0.000 0.000 1.000 0.000
#> GSM573745 4 0.0000 0.993 0.000 0.000 0.000 1.000 0.000
#> GSM573746 4 0.0000 0.993 0.000 0.000 0.000 1.000 0.000
#> GSM573747 4 0.0000 0.993 0.000 0.000 0.000 1.000 0.000
#> GSM573748 4 0.0000 0.993 0.000 0.000 0.000 1.000 0.000
#> GSM573749 4 0.0000 0.993 0.000 0.000 0.000 1.000 0.000
#> GSM573753 4 0.0609 0.972 0.000 0.000 0.000 0.980 0.020
#> GSM573754 4 0.0609 0.973 0.000 0.000 0.000 0.980 0.020
#> GSM573755 5 0.4306 0.743 0.000 0.000 0.000 0.492 0.508
#> GSM573750 4 0.0290 0.987 0.000 0.000 0.000 0.992 0.008
#> GSM573751 4 0.0290 0.987 0.000 0.000 0.000 0.992 0.008
#> GSM573752 4 0.0162 0.990 0.000 0.000 0.000 0.996 0.004
#> GSM573795 5 0.3999 0.881 0.000 0.000 0.000 0.344 0.656
#> GSM573796 5 0.3999 0.881 0.000 0.000 0.000 0.344 0.656
#> GSM573797 5 0.4235 0.850 0.000 0.000 0.000 0.424 0.576
#> GSM573741 4 0.0000 0.993 0.000 0.000 0.000 1.000 0.000
#> GSM573742 4 0.0000 0.993 0.000 0.000 0.000 1.000 0.000
#> GSM573743 4 0.0000 0.993 0.000 0.000 0.000 1.000 0.000
#> GSM573738 4 0.0000 0.993 0.000 0.000 0.000 1.000 0.000
#> GSM573739 4 0.0000 0.993 0.000 0.000 0.000 1.000 0.000
#> GSM573740 4 0.0000 0.993 0.000 0.000 0.000 1.000 0.000
#> GSM573792 4 0.0510 0.978 0.000 0.000 0.000 0.984 0.016
#> GSM573793 4 0.0404 0.983 0.000 0.000 0.000 0.988 0.012
#> GSM573794 4 0.0162 0.990 0.000 0.000 0.000 0.996 0.004
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM573726 1 0.0363 0.975 0.988 0.000 0.000 0.000 0.000 0.012
#> GSM573727 1 0.0363 0.975 0.988 0.000 0.000 0.000 0.000 0.012
#> GSM573728 1 0.0260 0.975 0.992 0.000 0.000 0.000 0.000 0.008
#> GSM573729 1 0.0993 0.969 0.964 0.000 0.000 0.000 0.012 0.024
#> GSM573730 1 0.0508 0.974 0.984 0.000 0.000 0.000 0.004 0.012
#> GSM573731 1 0.0820 0.972 0.972 0.000 0.000 0.000 0.012 0.016
#> GSM573735 1 0.1444 0.952 0.928 0.000 0.000 0.000 0.072 0.000
#> GSM573736 1 0.1444 0.952 0.928 0.000 0.000 0.000 0.072 0.000
#> GSM573737 1 0.1556 0.950 0.920 0.000 0.000 0.000 0.080 0.000
#> GSM573732 1 0.0937 0.967 0.960 0.000 0.000 0.000 0.040 0.000
#> GSM573733 1 0.2070 0.932 0.892 0.000 0.000 0.000 0.100 0.008
#> GSM573734 1 0.1757 0.948 0.916 0.000 0.000 0.000 0.076 0.008
#> GSM573789 1 0.0458 0.974 0.984 0.000 0.000 0.000 0.016 0.000
#> GSM573790 1 0.0865 0.970 0.964 0.000 0.000 0.000 0.036 0.000
#> GSM573791 1 0.1267 0.961 0.940 0.000 0.000 0.000 0.060 0.000
#> GSM573723 1 0.0291 0.976 0.992 0.000 0.000 0.000 0.004 0.004
#> GSM573724 1 0.0458 0.974 0.984 0.000 0.000 0.000 0.000 0.016
#> GSM573725 1 0.0000 0.975 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM573720 1 0.0000 0.975 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM573721 1 0.0717 0.974 0.976 0.000 0.000 0.000 0.008 0.016
#> GSM573722 1 0.0291 0.976 0.992 0.000 0.000 0.000 0.004 0.004
#> GSM573786 1 0.0363 0.975 0.988 0.000 0.000 0.000 0.012 0.000
#> GSM573787 1 0.0146 0.975 0.996 0.000 0.000 0.000 0.004 0.000
#> GSM573788 1 0.0363 0.976 0.988 0.000 0.000 0.000 0.012 0.000
#> GSM573768 2 0.0146 0.982 0.000 0.996 0.000 0.000 0.000 0.004
#> GSM573769 2 0.0291 0.981 0.000 0.992 0.000 0.000 0.004 0.004
#> GSM573770 2 0.0146 0.981 0.000 0.996 0.000 0.000 0.004 0.000
#> GSM573765 2 0.0000 0.982 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM573766 2 0.0146 0.982 0.000 0.996 0.000 0.000 0.000 0.004
#> GSM573767 2 0.0000 0.982 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM573777 2 0.0146 0.982 0.000 0.996 0.000 0.000 0.000 0.004
#> GSM573778 2 0.0000 0.982 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM573779 2 0.0146 0.982 0.000 0.996 0.000 0.000 0.000 0.004
#> GSM573762 2 0.0000 0.982 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM573763 2 0.0000 0.982 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM573764 2 0.0405 0.980 0.000 0.988 0.000 0.000 0.008 0.004
#> GSM573771 2 0.0000 0.982 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM573772 2 0.0000 0.982 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM573773 2 0.0000 0.982 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM573759 2 0.0260 0.980 0.000 0.992 0.000 0.000 0.008 0.000
#> GSM573760 2 0.0146 0.982 0.000 0.996 0.000 0.000 0.004 0.000
#> GSM573761 2 0.0520 0.977 0.000 0.984 0.000 0.000 0.008 0.008
#> GSM573774 2 0.0291 0.981 0.000 0.992 0.000 0.000 0.004 0.004
#> GSM573775 2 0.0547 0.974 0.000 0.980 0.000 0.000 0.020 0.000
#> GSM573776 2 0.0146 0.982 0.000 0.996 0.000 0.000 0.000 0.004
#> GSM573756 2 0.2135 0.892 0.000 0.872 0.000 0.000 0.128 0.000
#> GSM573757 2 0.2178 0.889 0.000 0.868 0.000 0.000 0.132 0.000
#> GSM573758 2 0.2191 0.896 0.000 0.876 0.000 0.000 0.120 0.004
#> GSM573708 3 0.1349 0.816 0.000 0.000 0.940 0.000 0.056 0.004
#> GSM573709 3 0.1649 0.806 0.000 0.000 0.932 0.000 0.036 0.032
#> GSM573710 3 0.1995 0.772 0.000 0.000 0.912 0.000 0.036 0.052
#> GSM573711 3 0.0909 0.850 0.000 0.000 0.968 0.000 0.020 0.012
#> GSM573712 3 0.0972 0.846 0.000 0.000 0.964 0.000 0.028 0.008
#> GSM573713 3 0.1411 0.810 0.000 0.000 0.936 0.000 0.060 0.004
#> GSM573717 3 0.0363 0.869 0.000 0.000 0.988 0.000 0.000 0.012
#> GSM573718 3 0.0865 0.857 0.000 0.000 0.964 0.000 0.000 0.036
#> GSM573719 3 0.0000 0.869 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM573714 3 0.0000 0.869 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM573715 3 0.0363 0.870 0.000 0.000 0.988 0.000 0.000 0.012
#> GSM573716 3 0.0363 0.869 0.000 0.000 0.988 0.000 0.000 0.012
#> GSM573780 3 0.3868 -0.983 0.000 0.000 0.508 0.000 0.492 0.000
#> GSM573781 5 0.3869 0.000 0.000 0.000 0.500 0.000 0.500 0.000
#> GSM573782 3 0.5095 -0.928 0.000 0.000 0.500 0.000 0.420 0.080
#> GSM573705 3 0.0363 0.869 0.000 0.000 0.988 0.000 0.000 0.012
#> GSM573706 3 0.0146 0.870 0.000 0.000 0.996 0.000 0.000 0.004
#> GSM573707 3 0.0363 0.869 0.000 0.000 0.988 0.000 0.000 0.012
#> GSM573702 3 0.0363 0.868 0.000 0.000 0.988 0.000 0.000 0.012
#> GSM573703 3 0.0146 0.870 0.000 0.000 0.996 0.000 0.000 0.004
#> GSM573704 3 0.0260 0.870 0.000 0.000 0.992 0.000 0.000 0.008
#> GSM573783 3 0.0146 0.870 0.000 0.000 0.996 0.000 0.004 0.000
#> GSM573784 3 0.0405 0.868 0.000 0.000 0.988 0.000 0.008 0.004
#> GSM573785 3 0.0622 0.865 0.000 0.000 0.980 0.000 0.012 0.008
#> GSM573744 4 0.0000 0.987 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM573745 4 0.0000 0.987 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM573746 4 0.0000 0.987 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM573747 4 0.0000 0.987 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM573748 4 0.0000 0.987 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM573749 4 0.0000 0.987 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM573753 4 0.0891 0.960 0.000 0.000 0.000 0.968 0.008 0.024
#> GSM573754 4 0.0508 0.975 0.000 0.000 0.000 0.984 0.004 0.012
#> GSM573755 6 0.4837 0.754 0.000 0.000 0.000 0.432 0.056 0.512
#> GSM573750 4 0.0146 0.985 0.000 0.000 0.000 0.996 0.004 0.000
#> GSM573751 4 0.0146 0.985 0.000 0.000 0.000 0.996 0.004 0.000
#> GSM573752 4 0.0000 0.987 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM573795 6 0.3748 0.917 0.000 0.000 0.000 0.300 0.012 0.688
#> GSM573796 6 0.3653 0.917 0.000 0.000 0.000 0.300 0.008 0.692
#> GSM573797 6 0.4316 0.913 0.000 0.000 0.000 0.312 0.040 0.648
#> GSM573741 4 0.0000 0.987 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM573742 4 0.0000 0.987 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM573743 4 0.0000 0.987 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM573738 4 0.0000 0.987 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM573739 4 0.0000 0.987 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM573740 4 0.0000 0.987 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM573792 4 0.1219 0.930 0.000 0.000 0.000 0.948 0.004 0.048
#> GSM573793 4 0.0935 0.953 0.000 0.000 0.000 0.964 0.004 0.032
#> GSM573794 4 0.0777 0.962 0.000 0.000 0.000 0.972 0.004 0.024
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
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)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
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:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.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")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
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 cell.line(p) agent(p) k
#> CV:mclust 96 1.13e-20 0.843 2
#> CV:mclust 96 9.56e-39 0.741 3
#> CV:mclust 96 9.14e-57 0.975 4
#> CV:mclust 96 1.55e-54 0.380 5
#> CV:mclust 93 1.19e-52 0.128 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.
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 46609 rows and 96 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 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)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.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:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).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)
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.709 0.918 0.938 0.48917 0.495 0.495
#> 3 3 0.495 0.702 0.720 0.29357 0.621 0.390
#> 4 4 1.000 1.000 1.000 0.19812 0.874 0.657
#> 5 5 1.000 0.992 0.991 0.00396 1.000 1.000
#> 6 6 0.954 0.960 0.957 0.01381 1.000 1.000
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 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.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> GSM573726 1 0.0376 0.980 0.996 0.004
#> GSM573727 1 0.0376 0.980 0.996 0.004
#> GSM573728 1 0.0376 0.980 0.996 0.004
#> GSM573729 1 0.0376 0.980 0.996 0.004
#> GSM573730 1 0.0376 0.980 0.996 0.004
#> GSM573731 1 0.0376 0.980 0.996 0.004
#> GSM573735 1 0.0376 0.980 0.996 0.004
#> GSM573736 1 0.0376 0.980 0.996 0.004
#> GSM573737 1 0.0376 0.980 0.996 0.004
#> GSM573732 1 0.0376 0.980 0.996 0.004
#> GSM573733 1 0.0376 0.980 0.996 0.004
#> GSM573734 1 0.0376 0.980 0.996 0.004
#> GSM573789 1 0.0376 0.980 0.996 0.004
#> GSM573790 1 0.0376 0.980 0.996 0.004
#> GSM573791 1 0.0376 0.980 0.996 0.004
#> GSM573723 1 0.0376 0.980 0.996 0.004
#> GSM573724 1 0.0376 0.980 0.996 0.004
#> GSM573725 1 0.0376 0.980 0.996 0.004
#> GSM573720 1 0.0376 0.980 0.996 0.004
#> GSM573721 1 0.0376 0.980 0.996 0.004
#> GSM573722 1 0.0376 0.980 0.996 0.004
#> GSM573786 1 0.0376 0.980 0.996 0.004
#> GSM573787 1 0.0376 0.980 0.996 0.004
#> GSM573788 1 0.0376 0.980 0.996 0.004
#> GSM573768 2 0.0000 0.894 0.000 1.000
#> GSM573769 2 0.0000 0.894 0.000 1.000
#> GSM573770 2 0.0000 0.894 0.000 1.000
#> GSM573765 2 0.0000 0.894 0.000 1.000
#> GSM573766 2 0.0000 0.894 0.000 1.000
#> GSM573767 2 0.0000 0.894 0.000 1.000
#> GSM573777 2 0.0000 0.894 0.000 1.000
#> GSM573778 2 0.0000 0.894 0.000 1.000
#> GSM573779 2 0.0000 0.894 0.000 1.000
#> GSM573762 2 0.0000 0.894 0.000 1.000
#> GSM573763 2 0.0000 0.894 0.000 1.000
#> GSM573764 2 0.0000 0.894 0.000 1.000
#> GSM573771 2 0.0000 0.894 0.000 1.000
#> GSM573772 2 0.0000 0.894 0.000 1.000
#> GSM573773 2 0.0000 0.894 0.000 1.000
#> GSM573759 2 0.0000 0.894 0.000 1.000
#> GSM573760 2 0.0000 0.894 0.000 1.000
#> GSM573761 2 0.0000 0.894 0.000 1.000
#> GSM573774 2 0.0000 0.894 0.000 1.000
#> GSM573775 2 0.0000 0.894 0.000 1.000
#> GSM573776 2 0.0000 0.894 0.000 1.000
#> GSM573756 2 0.0000 0.894 0.000 1.000
#> GSM573757 2 0.0000 0.894 0.000 1.000
#> GSM573758 2 0.0000 0.894 0.000 1.000
#> GSM573708 1 0.2043 0.980 0.968 0.032
#> GSM573709 1 0.2043 0.980 0.968 0.032
#> GSM573710 1 0.2043 0.980 0.968 0.032
#> GSM573711 1 0.2043 0.980 0.968 0.032
#> GSM573712 1 0.2043 0.980 0.968 0.032
#> GSM573713 1 0.2043 0.980 0.968 0.032
#> GSM573717 1 0.2043 0.980 0.968 0.032
#> GSM573718 1 0.2043 0.980 0.968 0.032
#> GSM573719 1 0.2043 0.980 0.968 0.032
#> GSM573714 1 0.2043 0.980 0.968 0.032
#> GSM573715 1 0.2043 0.980 0.968 0.032
#> GSM573716 1 0.2043 0.980 0.968 0.032
#> GSM573780 1 0.2043 0.980 0.968 0.032
#> GSM573781 1 0.2043 0.980 0.968 0.032
#> GSM573782 1 0.2043 0.980 0.968 0.032
#> GSM573705 1 0.2043 0.980 0.968 0.032
#> GSM573706 1 0.2043 0.980 0.968 0.032
#> GSM573707 1 0.2043 0.980 0.968 0.032
#> GSM573702 1 0.2043 0.980 0.968 0.032
#> GSM573703 1 0.2043 0.980 0.968 0.032
#> GSM573704 1 0.2043 0.980 0.968 0.032
#> GSM573783 1 0.2043 0.980 0.968 0.032
#> GSM573784 1 0.2043 0.980 0.968 0.032
#> GSM573785 1 0.2043 0.980 0.968 0.032
#> GSM573744 2 0.8081 0.805 0.248 0.752
#> GSM573745 2 0.8661 0.765 0.288 0.712
#> GSM573746 2 0.8608 0.769 0.284 0.716
#> GSM573747 2 0.7883 0.815 0.236 0.764
#> GSM573748 2 0.8608 0.769 0.284 0.716
#> GSM573749 2 0.8555 0.774 0.280 0.720
#> GSM573753 2 0.7139 0.844 0.196 0.804
#> GSM573754 2 0.6712 0.854 0.176 0.824
#> GSM573755 2 0.6531 0.857 0.168 0.832
#> GSM573750 2 0.7139 0.844 0.196 0.804
#> GSM573751 2 0.7139 0.844 0.196 0.804
#> GSM573752 2 0.7219 0.841 0.200 0.800
#> GSM573795 2 0.3733 0.884 0.072 0.928
#> GSM573796 2 0.2603 0.886 0.044 0.956
#> GSM573797 2 0.3431 0.885 0.064 0.936
#> GSM573741 2 0.8713 0.760 0.292 0.708
#> GSM573742 2 0.8861 0.743 0.304 0.696
#> GSM573743 2 0.8267 0.794 0.260 0.740
#> GSM573738 2 0.8763 0.755 0.296 0.704
#> GSM573739 2 0.8813 0.749 0.300 0.700
#> GSM573740 2 0.8763 0.755 0.296 0.704
#> GSM573792 2 0.4939 0.877 0.108 0.892
#> GSM573793 2 0.6343 0.861 0.160 0.840
#> GSM573794 2 0.6343 0.861 0.160 0.840
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM573726 1 0.631 0.252 0.512 0.000 0.488
#> GSM573727 1 0.631 0.252 0.512 0.000 0.488
#> GSM573728 1 0.631 0.252 0.512 0.000 0.488
#> GSM573729 1 0.631 0.252 0.512 0.000 0.488
#> GSM573730 1 0.631 0.252 0.512 0.000 0.488
#> GSM573731 1 0.631 0.252 0.512 0.000 0.488
#> GSM573735 1 0.631 0.252 0.512 0.000 0.488
#> GSM573736 1 0.631 0.252 0.512 0.000 0.488
#> GSM573737 1 0.631 0.252 0.512 0.000 0.488
#> GSM573732 1 0.631 0.252 0.512 0.000 0.488
#> GSM573733 1 0.631 0.252 0.512 0.000 0.488
#> GSM573734 1 0.631 0.252 0.512 0.000 0.488
#> GSM573789 1 0.631 0.252 0.512 0.000 0.488
#> GSM573790 1 0.631 0.252 0.512 0.000 0.488
#> GSM573791 1 0.631 0.252 0.512 0.000 0.488
#> GSM573723 1 0.631 0.252 0.512 0.000 0.488
#> GSM573724 1 0.631 0.252 0.512 0.000 0.488
#> GSM573725 1 0.631 0.252 0.512 0.000 0.488
#> GSM573720 1 0.631 0.252 0.512 0.000 0.488
#> GSM573721 1 0.631 0.252 0.512 0.000 0.488
#> GSM573722 1 0.631 0.252 0.512 0.000 0.488
#> GSM573786 1 0.631 0.252 0.512 0.000 0.488
#> GSM573787 1 0.631 0.252 0.512 0.000 0.488
#> GSM573788 1 0.631 0.252 0.512 0.000 0.488
#> GSM573768 2 0.000 1.000 0.000 1.000 0.000
#> GSM573769 2 0.000 1.000 0.000 1.000 0.000
#> GSM573770 2 0.000 1.000 0.000 1.000 0.000
#> GSM573765 2 0.000 1.000 0.000 1.000 0.000
#> GSM573766 2 0.000 1.000 0.000 1.000 0.000
#> GSM573767 2 0.000 1.000 0.000 1.000 0.000
#> GSM573777 2 0.000 1.000 0.000 1.000 0.000
#> GSM573778 2 0.000 1.000 0.000 1.000 0.000
#> GSM573779 2 0.000 1.000 0.000 1.000 0.000
#> GSM573762 2 0.000 1.000 0.000 1.000 0.000
#> GSM573763 2 0.000 1.000 0.000 1.000 0.000
#> GSM573764 2 0.000 1.000 0.000 1.000 0.000
#> GSM573771 2 0.000 1.000 0.000 1.000 0.000
#> GSM573772 2 0.000 1.000 0.000 1.000 0.000
#> GSM573773 2 0.000 1.000 0.000 1.000 0.000
#> GSM573759 2 0.000 1.000 0.000 1.000 0.000
#> GSM573760 2 0.000 1.000 0.000 1.000 0.000
#> GSM573761 2 0.000 1.000 0.000 1.000 0.000
#> GSM573774 2 0.000 1.000 0.000 1.000 0.000
#> GSM573775 2 0.000 1.000 0.000 1.000 0.000
#> GSM573776 2 0.000 1.000 0.000 1.000 0.000
#> GSM573756 2 0.000 1.000 0.000 1.000 0.000
#> GSM573757 2 0.000 1.000 0.000 1.000 0.000
#> GSM573758 2 0.000 1.000 0.000 1.000 0.000
#> GSM573708 3 0.000 1.000 0.000 0.000 1.000
#> GSM573709 3 0.000 1.000 0.000 0.000 1.000
#> GSM573710 3 0.000 1.000 0.000 0.000 1.000
#> GSM573711 3 0.000 1.000 0.000 0.000 1.000
#> GSM573712 3 0.000 1.000 0.000 0.000 1.000
#> GSM573713 3 0.000 1.000 0.000 0.000 1.000
#> GSM573717 3 0.000 1.000 0.000 0.000 1.000
#> GSM573718 3 0.000 1.000 0.000 0.000 1.000
#> GSM573719 3 0.000 1.000 0.000 0.000 1.000
#> GSM573714 3 0.000 1.000 0.000 0.000 1.000
#> GSM573715 3 0.000 1.000 0.000 0.000 1.000
#> GSM573716 3 0.000 1.000 0.000 0.000 1.000
#> GSM573780 3 0.000 1.000 0.000 0.000 1.000
#> GSM573781 3 0.000 1.000 0.000 0.000 1.000
#> GSM573782 3 0.000 1.000 0.000 0.000 1.000
#> GSM573705 3 0.000 1.000 0.000 0.000 1.000
#> GSM573706 3 0.000 1.000 0.000 0.000 1.000
#> GSM573707 3 0.000 1.000 0.000 0.000 1.000
#> GSM573702 3 0.000 1.000 0.000 0.000 1.000
#> GSM573703 3 0.000 1.000 0.000 0.000 1.000
#> GSM573704 3 0.000 1.000 0.000 0.000 1.000
#> GSM573783 3 0.000 1.000 0.000 0.000 1.000
#> GSM573784 3 0.000 1.000 0.000 0.000 1.000
#> GSM573785 3 0.000 1.000 0.000 0.000 1.000
#> GSM573744 1 0.632 0.560 0.772 0.120 0.108
#> GSM573745 1 0.632 0.560 0.772 0.120 0.108
#> GSM573746 1 0.632 0.560 0.772 0.120 0.108
#> GSM573747 1 0.632 0.560 0.772 0.120 0.108
#> GSM573748 1 0.632 0.560 0.772 0.120 0.108
#> GSM573749 1 0.632 0.560 0.772 0.120 0.108
#> GSM573753 1 0.632 0.560 0.772 0.120 0.108
#> GSM573754 1 0.632 0.560 0.772 0.120 0.108
#> GSM573755 1 0.632 0.560 0.772 0.120 0.108
#> GSM573750 1 0.632 0.560 0.772 0.120 0.108
#> GSM573751 1 0.632 0.560 0.772 0.120 0.108
#> GSM573752 1 0.632 0.560 0.772 0.120 0.108
#> GSM573795 1 0.676 0.527 0.744 0.148 0.108
#> GSM573796 1 0.725 0.477 0.708 0.184 0.108
#> GSM573797 1 0.682 0.522 0.740 0.152 0.108
#> GSM573741 1 0.632 0.560 0.772 0.120 0.108
#> GSM573742 1 0.632 0.560 0.772 0.120 0.108
#> GSM573743 1 0.632 0.560 0.772 0.120 0.108
#> GSM573738 1 0.632 0.560 0.772 0.120 0.108
#> GSM573739 1 0.632 0.560 0.772 0.120 0.108
#> GSM573740 1 0.632 0.560 0.772 0.120 0.108
#> GSM573792 1 0.632 0.560 0.772 0.120 0.108
#> GSM573793 1 0.632 0.560 0.772 0.120 0.108
#> GSM573794 1 0.632 0.560 0.772 0.120 0.108
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM573726 1 0 1 1 0 0 0
#> GSM573727 1 0 1 1 0 0 0
#> GSM573728 1 0 1 1 0 0 0
#> GSM573729 1 0 1 1 0 0 0
#> GSM573730 1 0 1 1 0 0 0
#> GSM573731 1 0 1 1 0 0 0
#> GSM573735 1 0 1 1 0 0 0
#> GSM573736 1 0 1 1 0 0 0
#> GSM573737 1 0 1 1 0 0 0
#> GSM573732 1 0 1 1 0 0 0
#> GSM573733 1 0 1 1 0 0 0
#> GSM573734 1 0 1 1 0 0 0
#> GSM573789 1 0 1 1 0 0 0
#> GSM573790 1 0 1 1 0 0 0
#> GSM573791 1 0 1 1 0 0 0
#> GSM573723 1 0 1 1 0 0 0
#> GSM573724 1 0 1 1 0 0 0
#> GSM573725 1 0 1 1 0 0 0
#> GSM573720 1 0 1 1 0 0 0
#> GSM573721 1 0 1 1 0 0 0
#> GSM573722 1 0 1 1 0 0 0
#> GSM573786 1 0 1 1 0 0 0
#> GSM573787 1 0 1 1 0 0 0
#> GSM573788 1 0 1 1 0 0 0
#> GSM573768 2 0 1 0 1 0 0
#> GSM573769 2 0 1 0 1 0 0
#> GSM573770 2 0 1 0 1 0 0
#> GSM573765 2 0 1 0 1 0 0
#> GSM573766 2 0 1 0 1 0 0
#> GSM573767 2 0 1 0 1 0 0
#> GSM573777 2 0 1 0 1 0 0
#> GSM573778 2 0 1 0 1 0 0
#> GSM573779 2 0 1 0 1 0 0
#> GSM573762 2 0 1 0 1 0 0
#> GSM573763 2 0 1 0 1 0 0
#> GSM573764 2 0 1 0 1 0 0
#> GSM573771 2 0 1 0 1 0 0
#> GSM573772 2 0 1 0 1 0 0
#> GSM573773 2 0 1 0 1 0 0
#> GSM573759 2 0 1 0 1 0 0
#> GSM573760 2 0 1 0 1 0 0
#> GSM573761 2 0 1 0 1 0 0
#> GSM573774 2 0 1 0 1 0 0
#> GSM573775 2 0 1 0 1 0 0
#> GSM573776 2 0 1 0 1 0 0
#> GSM573756 2 0 1 0 1 0 0
#> GSM573757 2 0 1 0 1 0 0
#> GSM573758 2 0 1 0 1 0 0
#> GSM573708 3 0 1 0 0 1 0
#> GSM573709 3 0 1 0 0 1 0
#> GSM573710 3 0 1 0 0 1 0
#> GSM573711 3 0 1 0 0 1 0
#> GSM573712 3 0 1 0 0 1 0
#> GSM573713 3 0 1 0 0 1 0
#> GSM573717 3 0 1 0 0 1 0
#> GSM573718 3 0 1 0 0 1 0
#> GSM573719 3 0 1 0 0 1 0
#> GSM573714 3 0 1 0 0 1 0
#> GSM573715 3 0 1 0 0 1 0
#> GSM573716 3 0 1 0 0 1 0
#> GSM573780 3 0 1 0 0 1 0
#> GSM573781 3 0 1 0 0 1 0
#> GSM573782 3 0 1 0 0 1 0
#> GSM573705 3 0 1 0 0 1 0
#> GSM573706 3 0 1 0 0 1 0
#> GSM573707 3 0 1 0 0 1 0
#> GSM573702 3 0 1 0 0 1 0
#> GSM573703 3 0 1 0 0 1 0
#> GSM573704 3 0 1 0 0 1 0
#> GSM573783 3 0 1 0 0 1 0
#> GSM573784 3 0 1 0 0 1 0
#> GSM573785 3 0 1 0 0 1 0
#> GSM573744 4 0 1 0 0 0 1
#> GSM573745 4 0 1 0 0 0 1
#> GSM573746 4 0 1 0 0 0 1
#> GSM573747 4 0 1 0 0 0 1
#> GSM573748 4 0 1 0 0 0 1
#> GSM573749 4 0 1 0 0 0 1
#> GSM573753 4 0 1 0 0 0 1
#> GSM573754 4 0 1 0 0 0 1
#> GSM573755 4 0 1 0 0 0 1
#> GSM573750 4 0 1 0 0 0 1
#> GSM573751 4 0 1 0 0 0 1
#> GSM573752 4 0 1 0 0 0 1
#> GSM573795 4 0 1 0 0 0 1
#> GSM573796 4 0 1 0 0 0 1
#> GSM573797 4 0 1 0 0 0 1
#> GSM573741 4 0 1 0 0 0 1
#> GSM573742 4 0 1 0 0 0 1
#> GSM573743 4 0 1 0 0 0 1
#> GSM573738 4 0 1 0 0 0 1
#> GSM573739 4 0 1 0 0 0 1
#> GSM573740 4 0 1 0 0 0 1
#> GSM573792 4 0 1 0 0 0 1
#> GSM573793 4 0 1 0 0 0 1
#> GSM573794 4 0 1 0 0 0 1
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM573726 1 0.0000 1.000 1 0.000 0.000 0.000 0.000
#> GSM573727 1 0.0000 1.000 1 0.000 0.000 0.000 0.000
#> GSM573728 1 0.0000 1.000 1 0.000 0.000 0.000 0.000
#> GSM573729 1 0.0000 1.000 1 0.000 0.000 0.000 0.000
#> GSM573730 1 0.0000 1.000 1 0.000 0.000 0.000 0.000
#> GSM573731 1 0.0000 1.000 1 0.000 0.000 0.000 0.000
#> GSM573735 1 0.0000 1.000 1 0.000 0.000 0.000 0.000
#> GSM573736 1 0.0000 1.000 1 0.000 0.000 0.000 0.000
#> GSM573737 1 0.0000 1.000 1 0.000 0.000 0.000 0.000
#> GSM573732 1 0.0000 1.000 1 0.000 0.000 0.000 0.000
#> GSM573733 1 0.0000 1.000 1 0.000 0.000 0.000 0.000
#> GSM573734 1 0.0000 1.000 1 0.000 0.000 0.000 0.000
#> GSM573789 1 0.0000 1.000 1 0.000 0.000 0.000 0.000
#> GSM573790 1 0.0000 1.000 1 0.000 0.000 0.000 0.000
#> GSM573791 1 0.0000 1.000 1 0.000 0.000 0.000 0.000
#> GSM573723 1 0.0000 1.000 1 0.000 0.000 0.000 0.000
#> GSM573724 1 0.0000 1.000 1 0.000 0.000 0.000 0.000
#> GSM573725 1 0.0000 1.000 1 0.000 0.000 0.000 0.000
#> GSM573720 1 0.0000 1.000 1 0.000 0.000 0.000 0.000
#> GSM573721 1 0.0000 1.000 1 0.000 0.000 0.000 0.000
#> GSM573722 1 0.0000 1.000 1 0.000 0.000 0.000 0.000
#> GSM573786 1 0.0000 1.000 1 0.000 0.000 0.000 0.000
#> GSM573787 1 0.0000 1.000 1 0.000 0.000 0.000 0.000
#> GSM573788 1 0.0000 1.000 1 0.000 0.000 0.000 0.000
#> GSM573768 2 0.0162 0.993 0 0.996 0.000 0.000 0.004
#> GSM573769 2 0.0162 0.993 0 0.996 0.000 0.000 0.004
#> GSM573770 2 0.0162 0.993 0 0.996 0.000 0.000 0.004
#> GSM573765 2 0.0000 0.993 0 1.000 0.000 0.000 0.000
#> GSM573766 2 0.0162 0.993 0 0.996 0.000 0.000 0.004
#> GSM573767 2 0.0162 0.993 0 0.996 0.000 0.000 0.004
#> GSM573777 2 0.0703 0.988 0 0.976 0.000 0.000 0.024
#> GSM573778 2 0.0880 0.984 0 0.968 0.000 0.000 0.032
#> GSM573779 2 0.0703 0.988 0 0.976 0.000 0.000 0.024
#> GSM573762 2 0.0794 0.986 0 0.972 0.000 0.000 0.028
#> GSM573763 2 0.0703 0.988 0 0.976 0.000 0.000 0.024
#> GSM573764 2 0.0609 0.989 0 0.980 0.000 0.000 0.020
#> GSM573771 2 0.0510 0.990 0 0.984 0.000 0.000 0.016
#> GSM573772 2 0.0510 0.990 0 0.984 0.000 0.000 0.016
#> GSM573773 2 0.0510 0.990 0 0.984 0.000 0.000 0.016
#> GSM573759 2 0.0162 0.993 0 0.996 0.000 0.000 0.004
#> GSM573760 2 0.0162 0.993 0 0.996 0.000 0.000 0.004
#> GSM573761 2 0.0162 0.993 0 0.996 0.000 0.000 0.004
#> GSM573774 2 0.0162 0.993 0 0.996 0.000 0.000 0.004
#> GSM573775 2 0.0000 0.993 0 1.000 0.000 0.000 0.000
#> GSM573776 2 0.0000 0.993 0 1.000 0.000 0.000 0.000
#> GSM573756 2 0.0162 0.993 0 0.996 0.000 0.000 0.004
#> GSM573757 2 0.0162 0.993 0 0.996 0.000 0.000 0.004
#> GSM573758 2 0.0162 0.993 0 0.996 0.000 0.000 0.004
#> GSM573708 3 0.0963 0.979 0 0.000 0.964 0.000 0.036
#> GSM573709 3 0.0963 0.979 0 0.000 0.964 0.000 0.036
#> GSM573710 3 0.0963 0.979 0 0.000 0.964 0.000 0.036
#> GSM573711 3 0.0963 0.979 0 0.000 0.964 0.000 0.036
#> GSM573712 3 0.0963 0.979 0 0.000 0.964 0.000 0.036
#> GSM573713 3 0.0963 0.979 0 0.000 0.964 0.000 0.036
#> GSM573717 3 0.0000 0.984 0 0.000 1.000 0.000 0.000
#> GSM573718 3 0.0000 0.984 0 0.000 1.000 0.000 0.000
#> GSM573719 3 0.0000 0.984 0 0.000 1.000 0.000 0.000
#> GSM573714 3 0.0000 0.984 0 0.000 1.000 0.000 0.000
#> GSM573715 3 0.0000 0.984 0 0.000 1.000 0.000 0.000
#> GSM573716 3 0.0000 0.984 0 0.000 1.000 0.000 0.000
#> GSM573780 3 0.1478 0.966 0 0.000 0.936 0.000 0.064
#> GSM573781 3 0.2230 0.936 0 0.000 0.884 0.000 0.116
#> GSM573782 3 0.2648 0.911 0 0.000 0.848 0.000 0.152
#> GSM573705 3 0.0000 0.984 0 0.000 1.000 0.000 0.000
#> GSM573706 3 0.0000 0.984 0 0.000 1.000 0.000 0.000
#> GSM573707 3 0.0000 0.984 0 0.000 1.000 0.000 0.000
#> GSM573702 3 0.0000 0.984 0 0.000 1.000 0.000 0.000
#> GSM573703 3 0.0000 0.984 0 0.000 1.000 0.000 0.000
#> GSM573704 3 0.0000 0.984 0 0.000 1.000 0.000 0.000
#> GSM573783 3 0.0510 0.982 0 0.000 0.984 0.000 0.016
#> GSM573784 3 0.0510 0.982 0 0.000 0.984 0.000 0.016
#> GSM573785 3 0.0510 0.982 0 0.000 0.984 0.000 0.016
#> GSM573744 4 0.0000 0.999 0 0.000 0.000 1.000 0.000
#> GSM573745 4 0.0000 0.999 0 0.000 0.000 1.000 0.000
#> GSM573746 4 0.0000 0.999 0 0.000 0.000 1.000 0.000
#> GSM573747 4 0.0000 0.999 0 0.000 0.000 1.000 0.000
#> GSM573748 4 0.0000 0.999 0 0.000 0.000 1.000 0.000
#> GSM573749 4 0.0000 0.999 0 0.000 0.000 1.000 0.000
#> GSM573753 4 0.0000 0.999 0 0.000 0.000 1.000 0.000
#> GSM573754 4 0.0000 0.999 0 0.000 0.000 1.000 0.000
#> GSM573755 4 0.0000 0.999 0 0.000 0.000 1.000 0.000
#> GSM573750 4 0.0000 0.999 0 0.000 0.000 1.000 0.000
#> GSM573751 4 0.0000 0.999 0 0.000 0.000 1.000 0.000
#> GSM573752 4 0.0000 0.999 0 0.000 0.000 1.000 0.000
#> GSM573795 4 0.0162 0.997 0 0.000 0.000 0.996 0.004
#> GSM573796 4 0.0404 0.992 0 0.000 0.000 0.988 0.012
#> GSM573797 4 0.0000 0.999 0 0.000 0.000 1.000 0.000
#> GSM573741 4 0.0000 0.999 0 0.000 0.000 1.000 0.000
#> GSM573742 4 0.0000 0.999 0 0.000 0.000 1.000 0.000
#> GSM573743 4 0.0000 0.999 0 0.000 0.000 1.000 0.000
#> GSM573738 4 0.0000 0.999 0 0.000 0.000 1.000 0.000
#> GSM573739 4 0.0000 0.999 0 0.000 0.000 1.000 0.000
#> GSM573740 4 0.0000 0.999 0 0.000 0.000 1.000 0.000
#> GSM573792 4 0.0162 0.997 0 0.000 0.000 0.996 0.004
#> GSM573793 4 0.0000 0.999 0 0.000 0.000 1.000 0.000
#> GSM573794 4 0.0000 0.999 0 0.000 0.000 1.000 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM573726 1 0.0000 0.997 1.000 0.000 0.000 0.000 NA NA
#> GSM573727 1 0.0000 0.997 1.000 0.000 0.000 0.000 NA NA
#> GSM573728 1 0.0000 0.997 1.000 0.000 0.000 0.000 NA NA
#> GSM573729 1 0.0000 0.997 1.000 0.000 0.000 0.000 NA NA
#> GSM573730 1 0.0000 0.997 1.000 0.000 0.000 0.000 NA NA
#> GSM573731 1 0.0000 0.997 1.000 0.000 0.000 0.000 NA NA
#> GSM573735 1 0.0547 0.988 0.980 0.000 0.000 0.000 NA NA
#> GSM573736 1 0.0458 0.990 0.984 0.000 0.000 0.000 NA NA
#> GSM573737 1 0.0547 0.988 0.980 0.000 0.000 0.000 NA NA
#> GSM573732 1 0.0547 0.988 0.980 0.000 0.000 0.000 NA NA
#> GSM573733 1 0.0458 0.990 0.984 0.000 0.000 0.000 NA NA
#> GSM573734 1 0.0458 0.990 0.984 0.000 0.000 0.000 NA NA
#> GSM573789 1 0.0000 0.997 1.000 0.000 0.000 0.000 NA NA
#> GSM573790 1 0.0000 0.997 1.000 0.000 0.000 0.000 NA NA
#> GSM573791 1 0.0000 0.997 1.000 0.000 0.000 0.000 NA NA
#> GSM573723 1 0.0000 0.997 1.000 0.000 0.000 0.000 NA NA
#> GSM573724 1 0.0000 0.997 1.000 0.000 0.000 0.000 NA NA
#> GSM573725 1 0.0000 0.997 1.000 0.000 0.000 0.000 NA NA
#> GSM573720 1 0.0000 0.997 1.000 0.000 0.000 0.000 NA NA
#> GSM573721 1 0.0000 0.997 1.000 0.000 0.000 0.000 NA NA
#> GSM573722 1 0.0000 0.997 1.000 0.000 0.000 0.000 NA NA
#> GSM573786 1 0.0000 0.997 1.000 0.000 0.000 0.000 NA NA
#> GSM573787 1 0.0000 0.997 1.000 0.000 0.000 0.000 NA NA
#> GSM573788 1 0.0000 0.997 1.000 0.000 0.000 0.000 NA NA
#> GSM573768 2 0.0000 0.962 0.000 1.000 0.000 0.000 NA NA
#> GSM573769 2 0.0000 0.962 0.000 1.000 0.000 0.000 NA NA
#> GSM573770 2 0.0000 0.962 0.000 1.000 0.000 0.000 NA NA
#> GSM573765 2 0.0865 0.961 0.000 0.964 0.000 0.000 NA NA
#> GSM573766 2 0.1387 0.959 0.000 0.932 0.000 0.000 NA NA
#> GSM573767 2 0.1610 0.957 0.000 0.916 0.000 0.000 NA NA
#> GSM573777 2 0.1957 0.952 0.000 0.888 0.000 0.000 NA NA
#> GSM573778 2 0.1957 0.952 0.000 0.888 0.000 0.000 NA NA
#> GSM573779 2 0.1957 0.952 0.000 0.888 0.000 0.000 NA NA
#> GSM573762 2 0.2003 0.951 0.000 0.884 0.000 0.000 NA NA
#> GSM573763 2 0.1957 0.952 0.000 0.888 0.000 0.000 NA NA
#> GSM573764 2 0.1957 0.952 0.000 0.888 0.000 0.000 NA NA
#> GSM573771 2 0.1957 0.952 0.000 0.888 0.000 0.000 NA NA
#> GSM573772 2 0.1957 0.952 0.000 0.888 0.000 0.000 NA NA
#> GSM573773 2 0.1957 0.952 0.000 0.888 0.000 0.000 NA NA
#> GSM573759 2 0.0000 0.962 0.000 1.000 0.000 0.000 NA NA
#> GSM573760 2 0.0000 0.962 0.000 1.000 0.000 0.000 NA NA
#> GSM573761 2 0.0000 0.962 0.000 1.000 0.000 0.000 NA NA
#> GSM573774 2 0.0000 0.962 0.000 1.000 0.000 0.000 NA NA
#> GSM573775 2 0.0146 0.962 0.000 0.996 0.000 0.000 NA NA
#> GSM573776 2 0.0000 0.962 0.000 1.000 0.000 0.000 NA NA
#> GSM573756 2 0.0000 0.962 0.000 1.000 0.000 0.000 NA NA
#> GSM573757 2 0.0000 0.962 0.000 1.000 0.000 0.000 NA NA
#> GSM573758 2 0.0000 0.962 0.000 1.000 0.000 0.000 NA NA
#> GSM573708 3 0.2883 0.886 0.000 0.000 0.788 0.000 NA NA
#> GSM573709 3 0.2854 0.888 0.000 0.000 0.792 0.000 NA NA
#> GSM573710 3 0.2883 0.886 0.000 0.000 0.788 0.000 NA NA
#> GSM573711 3 0.2883 0.886 0.000 0.000 0.788 0.000 NA NA
#> GSM573712 3 0.2823 0.889 0.000 0.000 0.796 0.000 NA NA
#> GSM573713 3 0.2883 0.886 0.000 0.000 0.788 0.000 NA NA
#> GSM573717 3 0.0000 0.928 0.000 0.000 1.000 0.000 NA NA
#> GSM573718 3 0.0000 0.928 0.000 0.000 1.000 0.000 NA NA
#> GSM573719 3 0.0000 0.928 0.000 0.000 1.000 0.000 NA NA
#> GSM573714 3 0.0000 0.928 0.000 0.000 1.000 0.000 NA NA
#> GSM573715 3 0.0000 0.928 0.000 0.000 1.000 0.000 NA NA
#> GSM573716 3 0.0000 0.928 0.000 0.000 1.000 0.000 NA NA
#> GSM573780 3 0.3288 0.858 0.000 0.000 0.724 0.000 NA NA
#> GSM573781 3 0.3563 0.823 0.000 0.000 0.664 0.000 NA NA
#> GSM573782 3 0.3756 0.779 0.000 0.000 0.600 0.000 NA NA
#> GSM573705 3 0.0000 0.928 0.000 0.000 1.000 0.000 NA NA
#> GSM573706 3 0.0146 0.927 0.000 0.000 0.996 0.000 NA NA
#> GSM573707 3 0.0000 0.928 0.000 0.000 1.000 0.000 NA NA
#> GSM573702 3 0.0000 0.928 0.000 0.000 1.000 0.000 NA NA
#> GSM573703 3 0.0000 0.928 0.000 0.000 1.000 0.000 NA NA
#> GSM573704 3 0.0000 0.928 0.000 0.000 1.000 0.000 NA NA
#> GSM573783 3 0.1075 0.924 0.000 0.000 0.952 0.000 NA NA
#> GSM573784 3 0.1152 0.924 0.000 0.000 0.952 0.000 NA NA
#> GSM573785 3 0.0632 0.926 0.000 0.000 0.976 0.000 NA NA
#> GSM573744 4 0.0000 0.986 0.000 0.000 0.000 1.000 NA NA
#> GSM573745 4 0.0000 0.986 0.000 0.000 0.000 1.000 NA NA
#> GSM573746 4 0.0000 0.986 0.000 0.000 0.000 1.000 NA NA
#> GSM573747 4 0.0000 0.986 0.000 0.000 0.000 1.000 NA NA
#> GSM573748 4 0.0000 0.986 0.000 0.000 0.000 1.000 NA NA
#> GSM573749 4 0.0000 0.986 0.000 0.000 0.000 1.000 NA NA
#> GSM573753 4 0.1010 0.980 0.000 0.000 0.000 0.960 NA NA
#> GSM573754 4 0.1082 0.979 0.000 0.000 0.000 0.956 NA NA
#> GSM573755 4 0.1082 0.979 0.000 0.000 0.000 0.956 NA NA
#> GSM573750 4 0.0935 0.981 0.000 0.000 0.000 0.964 NA NA
#> GSM573751 4 0.0935 0.981 0.000 0.000 0.000 0.964 NA NA
#> GSM573752 4 0.0632 0.984 0.000 0.000 0.000 0.976 NA NA
#> GSM573795 4 0.1333 0.975 0.000 0.000 0.000 0.944 NA NA
#> GSM573796 4 0.1462 0.971 0.000 0.000 0.000 0.936 NA NA
#> GSM573797 4 0.1265 0.976 0.000 0.000 0.000 0.948 NA NA
#> GSM573741 4 0.0000 0.986 0.000 0.000 0.000 1.000 NA NA
#> GSM573742 4 0.0000 0.986 0.000 0.000 0.000 1.000 NA NA
#> GSM573743 4 0.0000 0.986 0.000 0.000 0.000 1.000 NA NA
#> GSM573738 4 0.0000 0.986 0.000 0.000 0.000 1.000 NA NA
#> GSM573739 4 0.0000 0.986 0.000 0.000 0.000 1.000 NA NA
#> GSM573740 4 0.0000 0.986 0.000 0.000 0.000 1.000 NA NA
#> GSM573792 4 0.1082 0.980 0.000 0.000 0.000 0.956 NA NA
#> GSM573793 4 0.0363 0.985 0.000 0.000 0.000 0.988 NA NA
#> GSM573794 4 0.0363 0.985 0.000 0.000 0.000 0.988 NA NA
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
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)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
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:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.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")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
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 cell.line(p) agent(p) k
#> CV:NMF 96 1.13e-20 0.843 2
#> CV:NMF 71 1.05e-29 0.919 3
#> CV:NMF 96 9.14e-57 0.975 4
#> CV:NMF 96 9.14e-57 0.975 5
#> CV:NMF 96 9.14e-57 0.975 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.
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 46609 rows and 96 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'MAD' method.
#> Subgroups are detected by 'hclust' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 6.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.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:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).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)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 0.368 0.782 0.843 0.4448 0.495 0.495
#> 3 3 1.000 0.980 0.982 0.4207 0.874 0.745
#> 4 4 1.000 1.000 1.000 0.1997 0.874 0.657
#> 5 5 0.941 0.982 0.954 0.0383 0.970 0.878
#> 6 6 0.903 0.974 0.934 0.0376 0.970 0.861
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 6
#> attr(,"optional")
#> [1] 3 4 5
There is also optional best \(k\) = 3 4 5 that is worth to check.
Following shows the table of the partitions (You need to click the show/hide
code output link to see it). The membership matrix (columns with name p*
)
is inferred by
clue::cl_consensus()
function with the SE
method. Basically the value in the membership matrix
represents the probability to belong to a certain group. The finall class
label for an item is determined with the group with highest probability it
belongs to.
In get_classes()
function, the entropy is calculated from the membership
matrix and the silhouette score is calculated from the consensus matrix.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> GSM573726 1 0.373 0.940 0.928 0.072
#> GSM573727 1 0.373 0.940 0.928 0.072
#> GSM573728 1 0.373 0.940 0.928 0.072
#> GSM573729 1 0.373 0.940 0.928 0.072
#> GSM573730 1 0.373 0.940 0.928 0.072
#> GSM573731 1 0.373 0.940 0.928 0.072
#> GSM573735 1 0.373 0.940 0.928 0.072
#> GSM573736 1 0.373 0.940 0.928 0.072
#> GSM573737 1 0.373 0.940 0.928 0.072
#> GSM573732 1 0.373 0.940 0.928 0.072
#> GSM573733 1 0.373 0.940 0.928 0.072
#> GSM573734 1 0.373 0.940 0.928 0.072
#> GSM573789 1 0.373 0.940 0.928 0.072
#> GSM573790 1 0.373 0.940 0.928 0.072
#> GSM573791 1 0.373 0.940 0.928 0.072
#> GSM573723 1 0.373 0.940 0.928 0.072
#> GSM573724 1 0.373 0.940 0.928 0.072
#> GSM573725 1 0.373 0.940 0.928 0.072
#> GSM573720 1 0.373 0.940 0.928 0.072
#> GSM573721 1 0.373 0.940 0.928 0.072
#> GSM573722 1 0.373 0.940 0.928 0.072
#> GSM573786 1 0.373 0.940 0.928 0.072
#> GSM573787 1 0.373 0.940 0.928 0.072
#> GSM573788 1 0.373 0.940 0.928 0.072
#> GSM573768 2 0.993 0.558 0.452 0.548
#> GSM573769 2 0.993 0.558 0.452 0.548
#> GSM573770 2 0.993 0.558 0.452 0.548
#> GSM573765 2 0.993 0.558 0.452 0.548
#> GSM573766 2 0.993 0.558 0.452 0.548
#> GSM573767 2 0.993 0.558 0.452 0.548
#> GSM573777 2 0.993 0.558 0.452 0.548
#> GSM573778 2 0.993 0.558 0.452 0.548
#> GSM573779 2 0.993 0.558 0.452 0.548
#> GSM573762 2 0.993 0.558 0.452 0.548
#> GSM573763 2 0.993 0.558 0.452 0.548
#> GSM573764 2 0.993 0.558 0.452 0.548
#> GSM573771 2 0.993 0.558 0.452 0.548
#> GSM573772 2 0.993 0.558 0.452 0.548
#> GSM573773 2 0.993 0.558 0.452 0.548
#> GSM573759 2 0.993 0.558 0.452 0.548
#> GSM573760 2 0.993 0.558 0.452 0.548
#> GSM573761 2 0.993 0.558 0.452 0.548
#> GSM573774 2 0.993 0.558 0.452 0.548
#> GSM573775 2 0.993 0.558 0.452 0.548
#> GSM573776 2 0.993 0.558 0.452 0.548
#> GSM573756 2 0.993 0.558 0.452 0.548
#> GSM573757 2 0.993 0.558 0.452 0.548
#> GSM573758 2 0.993 0.558 0.452 0.548
#> GSM573708 2 0.482 0.689 0.104 0.896
#> GSM573709 2 0.482 0.689 0.104 0.896
#> GSM573710 2 0.482 0.689 0.104 0.896
#> GSM573711 2 0.482 0.689 0.104 0.896
#> GSM573712 2 0.482 0.689 0.104 0.896
#> GSM573713 2 0.482 0.689 0.104 0.896
#> GSM573717 2 0.482 0.689 0.104 0.896
#> GSM573718 2 0.482 0.689 0.104 0.896
#> GSM573719 2 0.482 0.689 0.104 0.896
#> GSM573714 2 0.482 0.689 0.104 0.896
#> GSM573715 2 0.482 0.689 0.104 0.896
#> GSM573716 2 0.482 0.689 0.104 0.896
#> GSM573780 2 0.482 0.689 0.104 0.896
#> GSM573781 2 0.482 0.689 0.104 0.896
#> GSM573782 2 0.482 0.689 0.104 0.896
#> GSM573705 2 0.482 0.689 0.104 0.896
#> GSM573706 2 0.482 0.689 0.104 0.896
#> GSM573707 2 0.482 0.689 0.104 0.896
#> GSM573702 2 0.482 0.689 0.104 0.896
#> GSM573703 2 0.482 0.689 0.104 0.896
#> GSM573704 2 0.482 0.689 0.104 0.896
#> GSM573783 2 0.482 0.689 0.104 0.896
#> GSM573784 2 0.482 0.689 0.104 0.896
#> GSM573785 2 0.482 0.689 0.104 0.896
#> GSM573744 1 0.000 0.941 1.000 0.000
#> GSM573745 1 0.000 0.941 1.000 0.000
#> GSM573746 1 0.000 0.941 1.000 0.000
#> GSM573747 1 0.000 0.941 1.000 0.000
#> GSM573748 1 0.000 0.941 1.000 0.000
#> GSM573749 1 0.000 0.941 1.000 0.000
#> GSM573753 1 0.000 0.941 1.000 0.000
#> GSM573754 1 0.000 0.941 1.000 0.000
#> GSM573755 1 0.000 0.941 1.000 0.000
#> GSM573750 1 0.000 0.941 1.000 0.000
#> GSM573751 1 0.000 0.941 1.000 0.000
#> GSM573752 1 0.000 0.941 1.000 0.000
#> GSM573795 1 0.000 0.941 1.000 0.000
#> GSM573796 1 0.000 0.941 1.000 0.000
#> GSM573797 1 0.000 0.941 1.000 0.000
#> GSM573741 1 0.000 0.941 1.000 0.000
#> GSM573742 1 0.000 0.941 1.000 0.000
#> GSM573743 1 0.000 0.941 1.000 0.000
#> GSM573738 1 0.000 0.941 1.000 0.000
#> GSM573739 1 0.000 0.941 1.000 0.000
#> GSM573740 1 0.000 0.941 1.000 0.000
#> GSM573792 1 0.000 0.941 1.000 0.000
#> GSM573793 1 0.000 0.941 1.000 0.000
#> GSM573794 1 0.000 0.941 1.000 0.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM573726 1 0.236 0.960 0.928 0 0.072
#> GSM573727 1 0.236 0.960 0.928 0 0.072
#> GSM573728 1 0.236 0.960 0.928 0 0.072
#> GSM573729 1 0.236 0.960 0.928 0 0.072
#> GSM573730 1 0.236 0.960 0.928 0 0.072
#> GSM573731 1 0.236 0.960 0.928 0 0.072
#> GSM573735 1 0.236 0.960 0.928 0 0.072
#> GSM573736 1 0.236 0.960 0.928 0 0.072
#> GSM573737 1 0.236 0.960 0.928 0 0.072
#> GSM573732 1 0.236 0.960 0.928 0 0.072
#> GSM573733 1 0.236 0.960 0.928 0 0.072
#> GSM573734 1 0.236 0.960 0.928 0 0.072
#> GSM573789 1 0.236 0.960 0.928 0 0.072
#> GSM573790 1 0.236 0.960 0.928 0 0.072
#> GSM573791 1 0.236 0.960 0.928 0 0.072
#> GSM573723 1 0.236 0.960 0.928 0 0.072
#> GSM573724 1 0.236 0.960 0.928 0 0.072
#> GSM573725 1 0.236 0.960 0.928 0 0.072
#> GSM573720 1 0.236 0.960 0.928 0 0.072
#> GSM573721 1 0.236 0.960 0.928 0 0.072
#> GSM573722 1 0.236 0.960 0.928 0 0.072
#> GSM573786 1 0.236 0.960 0.928 0 0.072
#> GSM573787 1 0.236 0.960 0.928 0 0.072
#> GSM573788 1 0.236 0.960 0.928 0 0.072
#> GSM573768 2 0.000 1.000 0.000 1 0.000
#> GSM573769 2 0.000 1.000 0.000 1 0.000
#> GSM573770 2 0.000 1.000 0.000 1 0.000
#> GSM573765 2 0.000 1.000 0.000 1 0.000
#> GSM573766 2 0.000 1.000 0.000 1 0.000
#> GSM573767 2 0.000 1.000 0.000 1 0.000
#> GSM573777 2 0.000 1.000 0.000 1 0.000
#> GSM573778 2 0.000 1.000 0.000 1 0.000
#> GSM573779 2 0.000 1.000 0.000 1 0.000
#> GSM573762 2 0.000 1.000 0.000 1 0.000
#> GSM573763 2 0.000 1.000 0.000 1 0.000
#> GSM573764 2 0.000 1.000 0.000 1 0.000
#> GSM573771 2 0.000 1.000 0.000 1 0.000
#> GSM573772 2 0.000 1.000 0.000 1 0.000
#> GSM573773 2 0.000 1.000 0.000 1 0.000
#> GSM573759 2 0.000 1.000 0.000 1 0.000
#> GSM573760 2 0.000 1.000 0.000 1 0.000
#> GSM573761 2 0.000 1.000 0.000 1 0.000
#> GSM573774 2 0.000 1.000 0.000 1 0.000
#> GSM573775 2 0.000 1.000 0.000 1 0.000
#> GSM573776 2 0.000 1.000 0.000 1 0.000
#> GSM573756 2 0.000 1.000 0.000 1 0.000
#> GSM573757 2 0.000 1.000 0.000 1 0.000
#> GSM573758 2 0.000 1.000 0.000 1 0.000
#> GSM573708 3 0.000 1.000 0.000 0 1.000
#> GSM573709 3 0.000 1.000 0.000 0 1.000
#> GSM573710 3 0.000 1.000 0.000 0 1.000
#> GSM573711 3 0.000 1.000 0.000 0 1.000
#> GSM573712 3 0.000 1.000 0.000 0 1.000
#> GSM573713 3 0.000 1.000 0.000 0 1.000
#> GSM573717 3 0.000 1.000 0.000 0 1.000
#> GSM573718 3 0.000 1.000 0.000 0 1.000
#> GSM573719 3 0.000 1.000 0.000 0 1.000
#> GSM573714 3 0.000 1.000 0.000 0 1.000
#> GSM573715 3 0.000 1.000 0.000 0 1.000
#> GSM573716 3 0.000 1.000 0.000 0 1.000
#> GSM573780 3 0.000 1.000 0.000 0 1.000
#> GSM573781 3 0.000 1.000 0.000 0 1.000
#> GSM573782 3 0.000 1.000 0.000 0 1.000
#> GSM573705 3 0.000 1.000 0.000 0 1.000
#> GSM573706 3 0.000 1.000 0.000 0 1.000
#> GSM573707 3 0.000 1.000 0.000 0 1.000
#> GSM573702 3 0.000 1.000 0.000 0 1.000
#> GSM573703 3 0.000 1.000 0.000 0 1.000
#> GSM573704 3 0.000 1.000 0.000 0 1.000
#> GSM573783 3 0.000 1.000 0.000 0 1.000
#> GSM573784 3 0.000 1.000 0.000 0 1.000
#> GSM573785 3 0.000 1.000 0.000 0 1.000
#> GSM573744 1 0.000 0.961 1.000 0 0.000
#> GSM573745 1 0.000 0.961 1.000 0 0.000
#> GSM573746 1 0.000 0.961 1.000 0 0.000
#> GSM573747 1 0.000 0.961 1.000 0 0.000
#> GSM573748 1 0.000 0.961 1.000 0 0.000
#> GSM573749 1 0.000 0.961 1.000 0 0.000
#> GSM573753 1 0.000 0.961 1.000 0 0.000
#> GSM573754 1 0.000 0.961 1.000 0 0.000
#> GSM573755 1 0.000 0.961 1.000 0 0.000
#> GSM573750 1 0.000 0.961 1.000 0 0.000
#> GSM573751 1 0.000 0.961 1.000 0 0.000
#> GSM573752 1 0.000 0.961 1.000 0 0.000
#> GSM573795 1 0.000 0.961 1.000 0 0.000
#> GSM573796 1 0.000 0.961 1.000 0 0.000
#> GSM573797 1 0.000 0.961 1.000 0 0.000
#> GSM573741 1 0.000 0.961 1.000 0 0.000
#> GSM573742 1 0.000 0.961 1.000 0 0.000
#> GSM573743 1 0.000 0.961 1.000 0 0.000
#> GSM573738 1 0.000 0.961 1.000 0 0.000
#> GSM573739 1 0.000 0.961 1.000 0 0.000
#> GSM573740 1 0.000 0.961 1.000 0 0.000
#> GSM573792 1 0.000 0.961 1.000 0 0.000
#> GSM573793 1 0.000 0.961 1.000 0 0.000
#> GSM573794 1 0.000 0.961 1.000 0 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM573726 1 0 1 1 0 0 0
#> GSM573727 1 0 1 1 0 0 0
#> GSM573728 1 0 1 1 0 0 0
#> GSM573729 1 0 1 1 0 0 0
#> GSM573730 1 0 1 1 0 0 0
#> GSM573731 1 0 1 1 0 0 0
#> GSM573735 1 0 1 1 0 0 0
#> GSM573736 1 0 1 1 0 0 0
#> GSM573737 1 0 1 1 0 0 0
#> GSM573732 1 0 1 1 0 0 0
#> GSM573733 1 0 1 1 0 0 0
#> GSM573734 1 0 1 1 0 0 0
#> GSM573789 1 0 1 1 0 0 0
#> GSM573790 1 0 1 1 0 0 0
#> GSM573791 1 0 1 1 0 0 0
#> GSM573723 1 0 1 1 0 0 0
#> GSM573724 1 0 1 1 0 0 0
#> GSM573725 1 0 1 1 0 0 0
#> GSM573720 1 0 1 1 0 0 0
#> GSM573721 1 0 1 1 0 0 0
#> GSM573722 1 0 1 1 0 0 0
#> GSM573786 1 0 1 1 0 0 0
#> GSM573787 1 0 1 1 0 0 0
#> GSM573788 1 0 1 1 0 0 0
#> GSM573768 2 0 1 0 1 0 0
#> GSM573769 2 0 1 0 1 0 0
#> GSM573770 2 0 1 0 1 0 0
#> GSM573765 2 0 1 0 1 0 0
#> GSM573766 2 0 1 0 1 0 0
#> GSM573767 2 0 1 0 1 0 0
#> GSM573777 2 0 1 0 1 0 0
#> GSM573778 2 0 1 0 1 0 0
#> GSM573779 2 0 1 0 1 0 0
#> GSM573762 2 0 1 0 1 0 0
#> GSM573763 2 0 1 0 1 0 0
#> GSM573764 2 0 1 0 1 0 0
#> GSM573771 2 0 1 0 1 0 0
#> GSM573772 2 0 1 0 1 0 0
#> GSM573773 2 0 1 0 1 0 0
#> GSM573759 2 0 1 0 1 0 0
#> GSM573760 2 0 1 0 1 0 0
#> GSM573761 2 0 1 0 1 0 0
#> GSM573774 2 0 1 0 1 0 0
#> GSM573775 2 0 1 0 1 0 0
#> GSM573776 2 0 1 0 1 0 0
#> GSM573756 2 0 1 0 1 0 0
#> GSM573757 2 0 1 0 1 0 0
#> GSM573758 2 0 1 0 1 0 0
#> GSM573708 3 0 1 0 0 1 0
#> GSM573709 3 0 1 0 0 1 0
#> GSM573710 3 0 1 0 0 1 0
#> GSM573711 3 0 1 0 0 1 0
#> GSM573712 3 0 1 0 0 1 0
#> GSM573713 3 0 1 0 0 1 0
#> GSM573717 3 0 1 0 0 1 0
#> GSM573718 3 0 1 0 0 1 0
#> GSM573719 3 0 1 0 0 1 0
#> GSM573714 3 0 1 0 0 1 0
#> GSM573715 3 0 1 0 0 1 0
#> GSM573716 3 0 1 0 0 1 0
#> GSM573780 3 0 1 0 0 1 0
#> GSM573781 3 0 1 0 0 1 0
#> GSM573782 3 0 1 0 0 1 0
#> GSM573705 3 0 1 0 0 1 0
#> GSM573706 3 0 1 0 0 1 0
#> GSM573707 3 0 1 0 0 1 0
#> GSM573702 3 0 1 0 0 1 0
#> GSM573703 3 0 1 0 0 1 0
#> GSM573704 3 0 1 0 0 1 0
#> GSM573783 3 0 1 0 0 1 0
#> GSM573784 3 0 1 0 0 1 0
#> GSM573785 3 0 1 0 0 1 0
#> GSM573744 4 0 1 0 0 0 1
#> GSM573745 4 0 1 0 0 0 1
#> GSM573746 4 0 1 0 0 0 1
#> GSM573747 4 0 1 0 0 0 1
#> GSM573748 4 0 1 0 0 0 1
#> GSM573749 4 0 1 0 0 0 1
#> GSM573753 4 0 1 0 0 0 1
#> GSM573754 4 0 1 0 0 0 1
#> GSM573755 4 0 1 0 0 0 1
#> GSM573750 4 0 1 0 0 0 1
#> GSM573751 4 0 1 0 0 0 1
#> GSM573752 4 0 1 0 0 0 1
#> GSM573795 4 0 1 0 0 0 1
#> GSM573796 4 0 1 0 0 0 1
#> GSM573797 4 0 1 0 0 0 1
#> GSM573741 4 0 1 0 0 0 1
#> GSM573742 4 0 1 0 0 0 1
#> GSM573743 4 0 1 0 0 0 1
#> GSM573738 4 0 1 0 0 0 1
#> GSM573739 4 0 1 0 0 0 1
#> GSM573740 4 0 1 0 0 0 1
#> GSM573792 4 0 1 0 0 0 1
#> GSM573793 4 0 1 0 0 0 1
#> GSM573794 4 0 1 0 0 0 1
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM573726 1 0.000 1.000 1 0.000 0.0 0 0.000
#> GSM573727 1 0.000 1.000 1 0.000 0.0 0 0.000
#> GSM573728 1 0.000 1.000 1 0.000 0.0 0 0.000
#> GSM573729 1 0.000 1.000 1 0.000 0.0 0 0.000
#> GSM573730 1 0.000 1.000 1 0.000 0.0 0 0.000
#> GSM573731 1 0.000 1.000 1 0.000 0.0 0 0.000
#> GSM573735 1 0.000 1.000 1 0.000 0.0 0 0.000
#> GSM573736 1 0.000 1.000 1 0.000 0.0 0 0.000
#> GSM573737 1 0.000 1.000 1 0.000 0.0 0 0.000
#> GSM573732 1 0.000 1.000 1 0.000 0.0 0 0.000
#> GSM573733 1 0.000 1.000 1 0.000 0.0 0 0.000
#> GSM573734 1 0.000 1.000 1 0.000 0.0 0 0.000
#> GSM573789 1 0.000 1.000 1 0.000 0.0 0 0.000
#> GSM573790 1 0.000 1.000 1 0.000 0.0 0 0.000
#> GSM573791 1 0.000 1.000 1 0.000 0.0 0 0.000
#> GSM573723 1 0.000 1.000 1 0.000 0.0 0 0.000
#> GSM573724 1 0.000 1.000 1 0.000 0.0 0 0.000
#> GSM573725 1 0.000 1.000 1 0.000 0.0 0 0.000
#> GSM573720 1 0.000 1.000 1 0.000 0.0 0 0.000
#> GSM573721 1 0.000 1.000 1 0.000 0.0 0 0.000
#> GSM573722 1 0.000 1.000 1 0.000 0.0 0 0.000
#> GSM573786 1 0.000 1.000 1 0.000 0.0 0 0.000
#> GSM573787 1 0.000 1.000 1 0.000 0.0 0 0.000
#> GSM573788 1 0.000 1.000 1 0.000 0.0 0 0.000
#> GSM573768 2 0.000 0.941 0 1.000 0.0 0 0.000
#> GSM573769 2 0.000 0.941 0 1.000 0.0 0 0.000
#> GSM573770 2 0.000 0.941 0 1.000 0.0 0 0.000
#> GSM573765 2 0.000 0.941 0 1.000 0.0 0 0.000
#> GSM573766 2 0.000 0.941 0 1.000 0.0 0 0.000
#> GSM573767 2 0.000 0.941 0 1.000 0.0 0 0.000
#> GSM573777 2 0.218 0.923 0 0.888 0.0 0 0.112
#> GSM573778 2 0.218 0.923 0 0.888 0.0 0 0.112
#> GSM573779 2 0.218 0.923 0 0.888 0.0 0 0.112
#> GSM573762 2 0.218 0.923 0 0.888 0.0 0 0.112
#> GSM573763 2 0.218 0.923 0 0.888 0.0 0 0.112
#> GSM573764 2 0.218 0.923 0 0.888 0.0 0 0.112
#> GSM573771 2 0.218 0.923 0 0.888 0.0 0 0.112
#> GSM573772 2 0.218 0.923 0 0.888 0.0 0 0.112
#> GSM573773 2 0.218 0.923 0 0.888 0.0 0 0.112
#> GSM573759 2 0.185 0.912 0 0.912 0.0 0 0.088
#> GSM573760 2 0.185 0.912 0 0.912 0.0 0 0.088
#> GSM573761 2 0.185 0.912 0 0.912 0.0 0 0.088
#> GSM573774 2 0.000 0.941 0 1.000 0.0 0 0.000
#> GSM573775 2 0.000 0.941 0 1.000 0.0 0 0.000
#> GSM573776 2 0.000 0.941 0 1.000 0.0 0 0.000
#> GSM573756 2 0.185 0.912 0 0.912 0.0 0 0.088
#> GSM573757 2 0.185 0.912 0 0.912 0.0 0 0.088
#> GSM573758 2 0.185 0.912 0 0.912 0.0 0 0.088
#> GSM573708 5 0.311 1.000 0 0.000 0.2 0 0.800
#> GSM573709 5 0.311 1.000 0 0.000 0.2 0 0.800
#> GSM573710 5 0.311 1.000 0 0.000 0.2 0 0.800
#> GSM573711 5 0.311 1.000 0 0.000 0.2 0 0.800
#> GSM573712 5 0.311 1.000 0 0.000 0.2 0 0.800
#> GSM573713 5 0.311 1.000 0 0.000 0.2 0 0.800
#> GSM573717 3 0.000 1.000 0 0.000 1.0 0 0.000
#> GSM573718 3 0.000 1.000 0 0.000 1.0 0 0.000
#> GSM573719 3 0.000 1.000 0 0.000 1.0 0 0.000
#> GSM573714 3 0.000 1.000 0 0.000 1.0 0 0.000
#> GSM573715 3 0.000 1.000 0 0.000 1.0 0 0.000
#> GSM573716 3 0.000 1.000 0 0.000 1.0 0 0.000
#> GSM573780 5 0.311 1.000 0 0.000 0.2 0 0.800
#> GSM573781 5 0.311 1.000 0 0.000 0.2 0 0.800
#> GSM573782 5 0.311 1.000 0 0.000 0.2 0 0.800
#> GSM573705 3 0.000 1.000 0 0.000 1.0 0 0.000
#> GSM573706 3 0.000 1.000 0 0.000 1.0 0 0.000
#> GSM573707 3 0.000 1.000 0 0.000 1.0 0 0.000
#> GSM573702 3 0.000 1.000 0 0.000 1.0 0 0.000
#> GSM573703 3 0.000 1.000 0 0.000 1.0 0 0.000
#> GSM573704 3 0.000 1.000 0 0.000 1.0 0 0.000
#> GSM573783 3 0.000 1.000 0 0.000 1.0 0 0.000
#> GSM573784 3 0.000 1.000 0 0.000 1.0 0 0.000
#> GSM573785 3 0.000 1.000 0 0.000 1.0 0 0.000
#> GSM573744 4 0.000 1.000 0 0.000 0.0 1 0.000
#> GSM573745 4 0.000 1.000 0 0.000 0.0 1 0.000
#> GSM573746 4 0.000 1.000 0 0.000 0.0 1 0.000
#> GSM573747 4 0.000 1.000 0 0.000 0.0 1 0.000
#> GSM573748 4 0.000 1.000 0 0.000 0.0 1 0.000
#> GSM573749 4 0.000 1.000 0 0.000 0.0 1 0.000
#> GSM573753 4 0.000 1.000 0 0.000 0.0 1 0.000
#> GSM573754 4 0.000 1.000 0 0.000 0.0 1 0.000
#> GSM573755 4 0.000 1.000 0 0.000 0.0 1 0.000
#> GSM573750 4 0.000 1.000 0 0.000 0.0 1 0.000
#> GSM573751 4 0.000 1.000 0 0.000 0.0 1 0.000
#> GSM573752 4 0.000 1.000 0 0.000 0.0 1 0.000
#> GSM573795 4 0.000 1.000 0 0.000 0.0 1 0.000
#> GSM573796 4 0.000 1.000 0 0.000 0.0 1 0.000
#> GSM573797 4 0.000 1.000 0 0.000 0.0 1 0.000
#> GSM573741 4 0.000 1.000 0 0.000 0.0 1 0.000
#> GSM573742 4 0.000 1.000 0 0.000 0.0 1 0.000
#> GSM573743 4 0.000 1.000 0 0.000 0.0 1 0.000
#> GSM573738 4 0.000 1.000 0 0.000 0.0 1 0.000
#> GSM573739 4 0.000 1.000 0 0.000 0.0 1 0.000
#> GSM573740 4 0.000 1.000 0 0.000 0.0 1 0.000
#> GSM573792 4 0.000 1.000 0 0.000 0.0 1 0.000
#> GSM573793 4 0.000 1.000 0 0.000 0.0 1 0.000
#> GSM573794 4 0.000 1.000 0 0.000 0.0 1 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM573726 1 0.0000 1.000 1 0.000 0.000 0.00 0.000 0.000
#> GSM573727 1 0.0000 1.000 1 0.000 0.000 0.00 0.000 0.000
#> GSM573728 1 0.0000 1.000 1 0.000 0.000 0.00 0.000 0.000
#> GSM573729 1 0.0000 1.000 1 0.000 0.000 0.00 0.000 0.000
#> GSM573730 1 0.0000 1.000 1 0.000 0.000 0.00 0.000 0.000
#> GSM573731 1 0.0000 1.000 1 0.000 0.000 0.00 0.000 0.000
#> GSM573735 1 0.0000 1.000 1 0.000 0.000 0.00 0.000 0.000
#> GSM573736 1 0.0000 1.000 1 0.000 0.000 0.00 0.000 0.000
#> GSM573737 1 0.0000 1.000 1 0.000 0.000 0.00 0.000 0.000
#> GSM573732 1 0.0000 1.000 1 0.000 0.000 0.00 0.000 0.000
#> GSM573733 1 0.0000 1.000 1 0.000 0.000 0.00 0.000 0.000
#> GSM573734 1 0.0000 1.000 1 0.000 0.000 0.00 0.000 0.000
#> GSM573789 1 0.0000 1.000 1 0.000 0.000 0.00 0.000 0.000
#> GSM573790 1 0.0000 1.000 1 0.000 0.000 0.00 0.000 0.000
#> GSM573791 1 0.0000 1.000 1 0.000 0.000 0.00 0.000 0.000
#> GSM573723 1 0.0000 1.000 1 0.000 0.000 0.00 0.000 0.000
#> GSM573724 1 0.0000 1.000 1 0.000 0.000 0.00 0.000 0.000
#> GSM573725 1 0.0000 1.000 1 0.000 0.000 0.00 0.000 0.000
#> GSM573720 1 0.0000 1.000 1 0.000 0.000 0.00 0.000 0.000
#> GSM573721 1 0.0000 1.000 1 0.000 0.000 0.00 0.000 0.000
#> GSM573722 1 0.0000 1.000 1 0.000 0.000 0.00 0.000 0.000
#> GSM573786 1 0.0000 1.000 1 0.000 0.000 0.00 0.000 0.000
#> GSM573787 1 0.0000 1.000 1 0.000 0.000 0.00 0.000 0.000
#> GSM573788 1 0.0000 1.000 1 0.000 0.000 0.00 0.000 0.000
#> GSM573768 2 0.0260 0.913 0 0.992 0.000 0.00 0.000 0.008
#> GSM573769 2 0.0260 0.913 0 0.992 0.000 0.00 0.000 0.008
#> GSM573770 2 0.0260 0.913 0 0.992 0.000 0.00 0.000 0.008
#> GSM573765 2 0.0260 0.914 0 0.992 0.000 0.00 0.000 0.008
#> GSM573766 2 0.0260 0.914 0 0.992 0.000 0.00 0.000 0.008
#> GSM573767 2 0.0260 0.914 0 0.992 0.000 0.00 0.000 0.008
#> GSM573777 2 0.3221 0.884 0 0.828 0.000 0.00 0.076 0.096
#> GSM573778 2 0.3221 0.884 0 0.828 0.000 0.00 0.076 0.096
#> GSM573779 2 0.3221 0.884 0 0.828 0.000 0.00 0.076 0.096
#> GSM573762 2 0.3221 0.884 0 0.828 0.000 0.00 0.076 0.096
#> GSM573763 2 0.3221 0.884 0 0.828 0.000 0.00 0.076 0.096
#> GSM573764 2 0.3221 0.884 0 0.828 0.000 0.00 0.076 0.096
#> GSM573771 2 0.3221 0.884 0 0.828 0.000 0.00 0.076 0.096
#> GSM573772 2 0.3221 0.884 0 0.828 0.000 0.00 0.076 0.096
#> GSM573773 2 0.3221 0.884 0 0.828 0.000 0.00 0.076 0.096
#> GSM573759 2 0.2258 0.881 0 0.896 0.000 0.00 0.060 0.044
#> GSM573760 2 0.2258 0.881 0 0.896 0.000 0.00 0.060 0.044
#> GSM573761 2 0.2258 0.881 0 0.896 0.000 0.00 0.060 0.044
#> GSM573774 2 0.0146 0.913 0 0.996 0.000 0.00 0.000 0.004
#> GSM573775 2 0.0000 0.913 0 1.000 0.000 0.00 0.000 0.000
#> GSM573776 2 0.0000 0.913 0 1.000 0.000 0.00 0.000 0.000
#> GSM573756 2 0.2258 0.881 0 0.896 0.000 0.00 0.060 0.044
#> GSM573757 2 0.2258 0.881 0 0.896 0.000 0.00 0.060 0.044
#> GSM573758 2 0.2258 0.881 0 0.896 0.000 0.00 0.060 0.044
#> GSM573708 5 0.2219 1.000 0 0.000 0.136 0.00 0.864 0.000
#> GSM573709 5 0.2219 1.000 0 0.000 0.136 0.00 0.864 0.000
#> GSM573710 5 0.2219 1.000 0 0.000 0.136 0.00 0.864 0.000
#> GSM573711 5 0.2219 1.000 0 0.000 0.136 0.00 0.864 0.000
#> GSM573712 5 0.2219 1.000 0 0.000 0.136 0.00 0.864 0.000
#> GSM573713 5 0.2219 1.000 0 0.000 0.136 0.00 0.864 0.000
#> GSM573717 3 0.0000 1.000 0 0.000 1.000 0.00 0.000 0.000
#> GSM573718 3 0.0000 1.000 0 0.000 1.000 0.00 0.000 0.000
#> GSM573719 3 0.0000 1.000 0 0.000 1.000 0.00 0.000 0.000
#> GSM573714 3 0.0000 1.000 0 0.000 1.000 0.00 0.000 0.000
#> GSM573715 3 0.0000 1.000 0 0.000 1.000 0.00 0.000 0.000
#> GSM573716 3 0.0000 1.000 0 0.000 1.000 0.00 0.000 0.000
#> GSM573780 5 0.2219 1.000 0 0.000 0.136 0.00 0.864 0.000
#> GSM573781 5 0.2219 1.000 0 0.000 0.136 0.00 0.864 0.000
#> GSM573782 5 0.2219 1.000 0 0.000 0.136 0.00 0.864 0.000
#> GSM573705 3 0.0000 1.000 0 0.000 1.000 0.00 0.000 0.000
#> GSM573706 3 0.0000 1.000 0 0.000 1.000 0.00 0.000 0.000
#> GSM573707 3 0.0000 1.000 0 0.000 1.000 0.00 0.000 0.000
#> GSM573702 3 0.0000 1.000 0 0.000 1.000 0.00 0.000 0.000
#> GSM573703 3 0.0000 1.000 0 0.000 1.000 0.00 0.000 0.000
#> GSM573704 3 0.0000 1.000 0 0.000 1.000 0.00 0.000 0.000
#> GSM573783 3 0.0000 1.000 0 0.000 1.000 0.00 0.000 0.000
#> GSM573784 3 0.0000 1.000 0 0.000 1.000 0.00 0.000 0.000
#> GSM573785 3 0.0000 1.000 0 0.000 1.000 0.00 0.000 0.000
#> GSM573744 4 0.0000 1.000 0 0.000 0.000 1.00 0.000 0.000
#> GSM573745 4 0.0000 1.000 0 0.000 0.000 1.00 0.000 0.000
#> GSM573746 4 0.0000 1.000 0 0.000 0.000 1.00 0.000 0.000
#> GSM573747 4 0.0000 1.000 0 0.000 0.000 1.00 0.000 0.000
#> GSM573748 4 0.0000 1.000 0 0.000 0.000 1.00 0.000 0.000
#> GSM573749 4 0.0000 1.000 0 0.000 0.000 1.00 0.000 0.000
#> GSM573753 6 0.2260 1.000 0 0.000 0.000 0.14 0.000 0.860
#> GSM573754 6 0.2260 1.000 0 0.000 0.000 0.14 0.000 0.860
#> GSM573755 6 0.2260 1.000 0 0.000 0.000 0.14 0.000 0.860
#> GSM573750 6 0.2260 1.000 0 0.000 0.000 0.14 0.000 0.860
#> GSM573751 6 0.2260 1.000 0 0.000 0.000 0.14 0.000 0.860
#> GSM573752 6 0.2260 1.000 0 0.000 0.000 0.14 0.000 0.860
#> GSM573795 6 0.2260 1.000 0 0.000 0.000 0.14 0.000 0.860
#> GSM573796 6 0.2260 1.000 0 0.000 0.000 0.14 0.000 0.860
#> GSM573797 6 0.2260 1.000 0 0.000 0.000 0.14 0.000 0.860
#> GSM573741 4 0.0000 1.000 0 0.000 0.000 1.00 0.000 0.000
#> GSM573742 4 0.0000 1.000 0 0.000 0.000 1.00 0.000 0.000
#> GSM573743 4 0.0000 1.000 0 0.000 0.000 1.00 0.000 0.000
#> GSM573738 4 0.0000 1.000 0 0.000 0.000 1.00 0.000 0.000
#> GSM573739 4 0.0000 1.000 0 0.000 0.000 1.00 0.000 0.000
#> GSM573740 4 0.0000 1.000 0 0.000 0.000 1.00 0.000 0.000
#> GSM573792 4 0.0000 1.000 0 0.000 0.000 1.00 0.000 0.000
#> GSM573793 4 0.0000 1.000 0 0.000 0.000 1.00 0.000 0.000
#> GSM573794 4 0.0000 1.000 0 0.000 0.000 1.00 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)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
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)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
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:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.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")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
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 cell.line(p) agent(p) k
#> MAD:hclust 96 1.13e-20 0.8427 2
#> MAD:hclust 96 9.56e-39 0.7410 3
#> MAD:hclust 96 9.14e-57 0.9750 4
#> MAD:hclust 96 1.55e-54 0.1758 5
#> MAD:hclust 96 1.73e-52 0.0063 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.
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 46609 rows and 96 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'MAD' method.
#> Subgroups are detected by 'kmeans' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 4.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.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:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).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)
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.242 0.607 0.676 0.4413 0.495 0.495
#> 3 3 0.621 0.803 0.807 0.3986 0.621 0.390
#> 4 4 0.687 0.957 0.848 0.1575 0.874 0.657
#> 5 5 0.886 0.897 0.854 0.0735 1.000 1.000
#> 6 6 0.855 0.860 0.810 0.0440 0.970 0.878
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.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> GSM573726 1 0.932 0.659 0.652 0.348
#> GSM573727 1 0.932 0.659 0.652 0.348
#> GSM573728 1 0.932 0.659 0.652 0.348
#> GSM573729 1 0.932 0.659 0.652 0.348
#> GSM573730 1 0.932 0.659 0.652 0.348
#> GSM573731 1 0.932 0.659 0.652 0.348
#> GSM573735 1 0.932 0.659 0.652 0.348
#> GSM573736 1 0.932 0.659 0.652 0.348
#> GSM573737 1 0.932 0.659 0.652 0.348
#> GSM573732 1 0.932 0.659 0.652 0.348
#> GSM573733 1 0.932 0.659 0.652 0.348
#> GSM573734 1 0.932 0.659 0.652 0.348
#> GSM573789 1 0.932 0.659 0.652 0.348
#> GSM573790 1 0.932 0.659 0.652 0.348
#> GSM573791 1 0.932 0.659 0.652 0.348
#> GSM573723 1 0.932 0.659 0.652 0.348
#> GSM573724 1 0.932 0.659 0.652 0.348
#> GSM573725 1 0.932 0.659 0.652 0.348
#> GSM573720 1 0.932 0.659 0.652 0.348
#> GSM573721 1 0.932 0.659 0.652 0.348
#> GSM573722 1 0.932 0.659 0.652 0.348
#> GSM573786 1 0.932 0.659 0.652 0.348
#> GSM573787 1 0.932 0.659 0.652 0.348
#> GSM573788 1 0.932 0.659 0.652 0.348
#> GSM573768 2 0.808 0.613 0.248 0.752
#> GSM573769 2 0.808 0.613 0.248 0.752
#> GSM573770 2 0.808 0.613 0.248 0.752
#> GSM573765 2 0.808 0.613 0.248 0.752
#> GSM573766 2 0.808 0.613 0.248 0.752
#> GSM573767 2 0.808 0.613 0.248 0.752
#> GSM573777 2 0.808 0.613 0.248 0.752
#> GSM573778 2 0.808 0.613 0.248 0.752
#> GSM573779 2 0.808 0.613 0.248 0.752
#> GSM573762 2 0.808 0.613 0.248 0.752
#> GSM573763 2 0.808 0.613 0.248 0.752
#> GSM573764 2 0.808 0.613 0.248 0.752
#> GSM573771 2 0.808 0.613 0.248 0.752
#> GSM573772 2 0.808 0.613 0.248 0.752
#> GSM573773 2 0.808 0.613 0.248 0.752
#> GSM573759 2 0.808 0.613 0.248 0.752
#> GSM573760 2 0.808 0.613 0.248 0.752
#> GSM573761 2 0.808 0.613 0.248 0.752
#> GSM573774 2 0.808 0.613 0.248 0.752
#> GSM573775 2 0.808 0.613 0.248 0.752
#> GSM573776 2 0.808 0.613 0.248 0.752
#> GSM573756 2 0.808 0.613 0.248 0.752
#> GSM573757 2 0.808 0.613 0.248 0.752
#> GSM573758 2 0.808 0.613 0.248 0.752
#> GSM573708 1 0.163 0.701 0.976 0.024
#> GSM573709 1 0.163 0.701 0.976 0.024
#> GSM573710 1 0.163 0.701 0.976 0.024
#> GSM573711 1 0.163 0.701 0.976 0.024
#> GSM573712 1 0.163 0.701 0.976 0.024
#> GSM573713 1 0.163 0.701 0.976 0.024
#> GSM573717 1 0.163 0.701 0.976 0.024
#> GSM573718 1 0.163 0.701 0.976 0.024
#> GSM573719 1 0.163 0.701 0.976 0.024
#> GSM573714 1 0.163 0.701 0.976 0.024
#> GSM573715 1 0.163 0.701 0.976 0.024
#> GSM573716 1 0.163 0.701 0.976 0.024
#> GSM573780 1 0.163 0.701 0.976 0.024
#> GSM573781 1 0.163 0.701 0.976 0.024
#> GSM573782 1 0.163 0.701 0.976 0.024
#> GSM573705 1 0.163 0.701 0.976 0.024
#> GSM573706 1 0.163 0.701 0.976 0.024
#> GSM573707 1 0.163 0.701 0.976 0.024
#> GSM573702 1 0.163 0.701 0.976 0.024
#> GSM573703 1 0.163 0.701 0.976 0.024
#> GSM573704 1 0.163 0.701 0.976 0.024
#> GSM573783 1 0.163 0.701 0.976 0.024
#> GSM573784 1 0.163 0.701 0.976 0.024
#> GSM573785 1 0.163 0.701 0.976 0.024
#> GSM573744 2 0.871 0.455 0.292 0.708
#> GSM573745 2 0.871 0.455 0.292 0.708
#> GSM573746 2 0.871 0.455 0.292 0.708
#> GSM573747 2 0.871 0.455 0.292 0.708
#> GSM573748 2 0.871 0.455 0.292 0.708
#> GSM573749 2 0.871 0.455 0.292 0.708
#> GSM573753 2 0.871 0.455 0.292 0.708
#> GSM573754 2 0.871 0.455 0.292 0.708
#> GSM573755 2 0.871 0.455 0.292 0.708
#> GSM573750 2 0.871 0.455 0.292 0.708
#> GSM573751 2 0.871 0.455 0.292 0.708
#> GSM573752 2 0.871 0.455 0.292 0.708
#> GSM573795 2 0.871 0.455 0.292 0.708
#> GSM573796 2 0.871 0.455 0.292 0.708
#> GSM573797 2 0.871 0.455 0.292 0.708
#> GSM573741 2 0.871 0.455 0.292 0.708
#> GSM573742 2 0.871 0.455 0.292 0.708
#> GSM573743 2 0.871 0.455 0.292 0.708
#> GSM573738 2 0.871 0.455 0.292 0.708
#> GSM573739 2 0.871 0.455 0.292 0.708
#> GSM573740 2 0.871 0.455 0.292 0.708
#> GSM573792 2 0.871 0.455 0.292 0.708
#> GSM573793 2 0.871 0.455 0.292 0.708
#> GSM573794 2 0.871 0.455 0.292 0.708
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM573726 1 0.706 0.587 0.616 0.032 0.352
#> GSM573727 1 0.706 0.587 0.616 0.032 0.352
#> GSM573728 1 0.706 0.587 0.616 0.032 0.352
#> GSM573729 1 0.706 0.587 0.616 0.032 0.352
#> GSM573730 1 0.706 0.587 0.616 0.032 0.352
#> GSM573731 1 0.706 0.587 0.616 0.032 0.352
#> GSM573735 1 0.706 0.587 0.616 0.032 0.352
#> GSM573736 1 0.706 0.587 0.616 0.032 0.352
#> GSM573737 1 0.706 0.587 0.616 0.032 0.352
#> GSM573732 1 0.706 0.587 0.616 0.032 0.352
#> GSM573733 1 0.706 0.587 0.616 0.032 0.352
#> GSM573734 1 0.706 0.587 0.616 0.032 0.352
#> GSM573789 1 0.706 0.587 0.616 0.032 0.352
#> GSM573790 1 0.706 0.587 0.616 0.032 0.352
#> GSM573791 1 0.706 0.587 0.616 0.032 0.352
#> GSM573723 1 0.706 0.587 0.616 0.032 0.352
#> GSM573724 1 0.706 0.587 0.616 0.032 0.352
#> GSM573725 1 0.706 0.587 0.616 0.032 0.352
#> GSM573720 1 0.706 0.587 0.616 0.032 0.352
#> GSM573721 1 0.706 0.587 0.616 0.032 0.352
#> GSM573722 1 0.706 0.587 0.616 0.032 0.352
#> GSM573786 1 0.706 0.587 0.616 0.032 0.352
#> GSM573787 1 0.706 0.587 0.616 0.032 0.352
#> GSM573788 1 0.706 0.587 0.616 0.032 0.352
#> GSM573768 2 0.191 0.993 0.028 0.956 0.016
#> GSM573769 2 0.191 0.993 0.028 0.956 0.016
#> GSM573770 2 0.191 0.993 0.028 0.956 0.016
#> GSM573765 2 0.191 0.993 0.028 0.956 0.016
#> GSM573766 2 0.191 0.993 0.028 0.956 0.016
#> GSM573767 2 0.191 0.993 0.028 0.956 0.016
#> GSM573777 2 0.268 0.988 0.028 0.932 0.040
#> GSM573778 2 0.268 0.988 0.028 0.932 0.040
#> GSM573779 2 0.268 0.988 0.028 0.932 0.040
#> GSM573762 2 0.268 0.988 0.028 0.932 0.040
#> GSM573763 2 0.268 0.988 0.028 0.932 0.040
#> GSM573764 2 0.268 0.988 0.028 0.932 0.040
#> GSM573771 2 0.268 0.988 0.028 0.932 0.040
#> GSM573772 2 0.268 0.988 0.028 0.932 0.040
#> GSM573773 2 0.268 0.988 0.028 0.932 0.040
#> GSM573759 2 0.191 0.993 0.028 0.956 0.016
#> GSM573760 2 0.191 0.993 0.028 0.956 0.016
#> GSM573761 2 0.191 0.993 0.028 0.956 0.016
#> GSM573774 2 0.191 0.993 0.028 0.956 0.016
#> GSM573775 2 0.191 0.993 0.028 0.956 0.016
#> GSM573776 2 0.191 0.993 0.028 0.956 0.016
#> GSM573756 2 0.191 0.993 0.028 0.956 0.016
#> GSM573757 2 0.191 0.993 0.028 0.956 0.016
#> GSM573758 2 0.191 0.993 0.028 0.956 0.016
#> GSM573708 3 0.364 0.986 0.024 0.084 0.892
#> GSM573709 3 0.364 0.986 0.024 0.084 0.892
#> GSM573710 3 0.364 0.986 0.024 0.084 0.892
#> GSM573711 3 0.364 0.986 0.024 0.084 0.892
#> GSM573712 3 0.364 0.986 0.024 0.084 0.892
#> GSM573713 3 0.364 0.986 0.024 0.084 0.892
#> GSM573717 3 0.308 0.991 0.024 0.060 0.916
#> GSM573718 3 0.308 0.991 0.024 0.060 0.916
#> GSM573719 3 0.308 0.991 0.024 0.060 0.916
#> GSM573714 3 0.308 0.991 0.024 0.060 0.916
#> GSM573715 3 0.308 0.991 0.024 0.060 0.916
#> GSM573716 3 0.308 0.991 0.024 0.060 0.916
#> GSM573780 3 0.372 0.985 0.024 0.088 0.888
#> GSM573781 3 0.372 0.985 0.024 0.088 0.888
#> GSM573782 3 0.372 0.985 0.024 0.088 0.888
#> GSM573705 3 0.308 0.991 0.024 0.060 0.916
#> GSM573706 3 0.308 0.991 0.024 0.060 0.916
#> GSM573707 3 0.308 0.991 0.024 0.060 0.916
#> GSM573702 3 0.308 0.991 0.024 0.060 0.916
#> GSM573703 3 0.308 0.991 0.024 0.060 0.916
#> GSM573704 3 0.308 0.991 0.024 0.060 0.916
#> GSM573783 3 0.318 0.990 0.024 0.064 0.912
#> GSM573784 3 0.318 0.990 0.024 0.064 0.912
#> GSM573785 3 0.318 0.990 0.024 0.064 0.912
#> GSM573744 1 0.499 0.646 0.824 0.144 0.032
#> GSM573745 1 0.499 0.646 0.824 0.144 0.032
#> GSM573746 1 0.499 0.646 0.824 0.144 0.032
#> GSM573747 1 0.499 0.646 0.824 0.144 0.032
#> GSM573748 1 0.499 0.646 0.824 0.144 0.032
#> GSM573749 1 0.499 0.646 0.824 0.144 0.032
#> GSM573753 1 0.524 0.645 0.808 0.160 0.032
#> GSM573754 1 0.524 0.645 0.808 0.160 0.032
#> GSM573755 1 0.524 0.645 0.808 0.160 0.032
#> GSM573750 1 0.524 0.645 0.808 0.160 0.032
#> GSM573751 1 0.524 0.645 0.808 0.160 0.032
#> GSM573752 1 0.524 0.645 0.808 0.160 0.032
#> GSM573795 1 0.524 0.645 0.808 0.160 0.032
#> GSM573796 1 0.524 0.645 0.808 0.160 0.032
#> GSM573797 1 0.524 0.645 0.808 0.160 0.032
#> GSM573741 1 0.499 0.646 0.824 0.144 0.032
#> GSM573742 1 0.499 0.646 0.824 0.144 0.032
#> GSM573743 1 0.499 0.646 0.824 0.144 0.032
#> GSM573738 1 0.499 0.646 0.824 0.144 0.032
#> GSM573739 1 0.499 0.646 0.824 0.144 0.032
#> GSM573740 1 0.499 0.646 0.824 0.144 0.032
#> GSM573792 1 0.499 0.646 0.824 0.144 0.032
#> GSM573793 1 0.499 0.646 0.824 0.144 0.032
#> GSM573794 1 0.499 0.646 0.824 0.144 0.032
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM573726 1 0.4019 0.991 0.792 0.012 0.000 0.196
#> GSM573727 1 0.4019 0.991 0.792 0.012 0.000 0.196
#> GSM573728 1 0.4019 0.991 0.792 0.012 0.000 0.196
#> GSM573729 1 0.4019 0.991 0.792 0.012 0.000 0.196
#> GSM573730 1 0.4019 0.991 0.792 0.012 0.000 0.196
#> GSM573731 1 0.4019 0.991 0.792 0.012 0.000 0.196
#> GSM573735 1 0.4716 0.982 0.764 0.040 0.000 0.196
#> GSM573736 1 0.4716 0.982 0.764 0.040 0.000 0.196
#> GSM573737 1 0.4716 0.982 0.764 0.040 0.000 0.196
#> GSM573732 1 0.4716 0.982 0.764 0.040 0.000 0.196
#> GSM573733 1 0.4716 0.982 0.764 0.040 0.000 0.196
#> GSM573734 1 0.4716 0.982 0.764 0.040 0.000 0.196
#> GSM573789 1 0.4627 0.987 0.772 0.028 0.004 0.196
#> GSM573790 1 0.4627 0.987 0.772 0.028 0.004 0.196
#> GSM573791 1 0.4627 0.987 0.772 0.028 0.004 0.196
#> GSM573723 1 0.4019 0.991 0.792 0.012 0.000 0.196
#> GSM573724 1 0.4019 0.991 0.792 0.012 0.000 0.196
#> GSM573725 1 0.4019 0.991 0.792 0.012 0.000 0.196
#> GSM573720 1 0.4019 0.991 0.792 0.012 0.000 0.196
#> GSM573721 1 0.4019 0.991 0.792 0.012 0.000 0.196
#> GSM573722 1 0.4019 0.991 0.792 0.012 0.000 0.196
#> GSM573786 1 0.4317 0.989 0.784 0.016 0.004 0.196
#> GSM573787 1 0.4317 0.989 0.784 0.016 0.004 0.196
#> GSM573788 1 0.4317 0.989 0.784 0.016 0.004 0.196
#> GSM573768 2 0.2149 0.962 0.000 0.912 0.000 0.088
#> GSM573769 2 0.2149 0.962 0.000 0.912 0.000 0.088
#> GSM573770 2 0.2149 0.962 0.000 0.912 0.000 0.088
#> GSM573765 2 0.3172 0.960 0.020 0.884 0.008 0.088
#> GSM573766 2 0.3172 0.960 0.020 0.884 0.008 0.088
#> GSM573767 2 0.3172 0.960 0.020 0.884 0.008 0.088
#> GSM573777 2 0.5211 0.943 0.072 0.796 0.044 0.088
#> GSM573778 2 0.5211 0.943 0.072 0.796 0.044 0.088
#> GSM573779 2 0.5211 0.943 0.072 0.796 0.044 0.088
#> GSM573762 2 0.5211 0.943 0.072 0.796 0.044 0.088
#> GSM573763 2 0.5211 0.943 0.072 0.796 0.044 0.088
#> GSM573764 2 0.5211 0.943 0.072 0.796 0.044 0.088
#> GSM573771 2 0.5211 0.943 0.072 0.796 0.044 0.088
#> GSM573772 2 0.5211 0.943 0.072 0.796 0.044 0.088
#> GSM573773 2 0.5211 0.943 0.072 0.796 0.044 0.088
#> GSM573759 2 0.2149 0.962 0.000 0.912 0.000 0.088
#> GSM573760 2 0.2149 0.962 0.000 0.912 0.000 0.088
#> GSM573761 2 0.2149 0.962 0.000 0.912 0.000 0.088
#> GSM573774 2 0.2149 0.962 0.000 0.912 0.000 0.088
#> GSM573775 2 0.2149 0.962 0.000 0.912 0.000 0.088
#> GSM573776 2 0.2149 0.962 0.000 0.912 0.000 0.088
#> GSM573756 2 0.2149 0.962 0.000 0.912 0.000 0.088
#> GSM573757 2 0.2149 0.962 0.000 0.912 0.000 0.088
#> GSM573758 2 0.2149 0.962 0.000 0.912 0.000 0.088
#> GSM573708 3 0.5914 0.911 0.228 0.072 0.692 0.008
#> GSM573709 3 0.5914 0.911 0.228 0.072 0.692 0.008
#> GSM573710 3 0.5914 0.911 0.228 0.072 0.692 0.008
#> GSM573711 3 0.5914 0.911 0.228 0.072 0.692 0.008
#> GSM573712 3 0.5914 0.911 0.228 0.072 0.692 0.008
#> GSM573713 3 0.5914 0.911 0.228 0.072 0.692 0.008
#> GSM573717 3 0.3719 0.945 0.124 0.020 0.848 0.008
#> GSM573718 3 0.3719 0.945 0.124 0.020 0.848 0.008
#> GSM573719 3 0.3719 0.945 0.124 0.020 0.848 0.008
#> GSM573714 3 0.3719 0.945 0.124 0.020 0.848 0.008
#> GSM573715 3 0.3719 0.945 0.124 0.020 0.848 0.008
#> GSM573716 3 0.3719 0.945 0.124 0.020 0.848 0.008
#> GSM573780 3 0.6123 0.903 0.256 0.072 0.664 0.008
#> GSM573781 3 0.6123 0.903 0.256 0.072 0.664 0.008
#> GSM573782 3 0.6123 0.903 0.256 0.072 0.664 0.008
#> GSM573705 3 0.3719 0.945 0.124 0.020 0.848 0.008
#> GSM573706 3 0.3719 0.945 0.124 0.020 0.848 0.008
#> GSM573707 3 0.3719 0.945 0.124 0.020 0.848 0.008
#> GSM573702 3 0.3719 0.945 0.124 0.020 0.848 0.008
#> GSM573703 3 0.3719 0.945 0.124 0.020 0.848 0.008
#> GSM573704 3 0.3719 0.945 0.124 0.020 0.848 0.008
#> GSM573783 3 0.4187 0.937 0.152 0.024 0.816 0.008
#> GSM573784 3 0.4187 0.937 0.152 0.024 0.816 0.008
#> GSM573785 3 0.4187 0.937 0.152 0.024 0.816 0.008
#> GSM573744 4 0.0000 0.966 0.000 0.000 0.000 1.000
#> GSM573745 4 0.0000 0.966 0.000 0.000 0.000 1.000
#> GSM573746 4 0.0000 0.966 0.000 0.000 0.000 1.000
#> GSM573747 4 0.0000 0.966 0.000 0.000 0.000 1.000
#> GSM573748 4 0.0000 0.966 0.000 0.000 0.000 1.000
#> GSM573749 4 0.0000 0.966 0.000 0.000 0.000 1.000
#> GSM573753 4 0.2334 0.944 0.004 0.000 0.088 0.908
#> GSM573754 4 0.2334 0.944 0.004 0.000 0.088 0.908
#> GSM573755 4 0.2334 0.944 0.004 0.000 0.088 0.908
#> GSM573750 4 0.2334 0.944 0.004 0.000 0.088 0.908
#> GSM573751 4 0.2334 0.944 0.004 0.000 0.088 0.908
#> GSM573752 4 0.2334 0.944 0.004 0.000 0.088 0.908
#> GSM573795 4 0.2593 0.937 0.004 0.000 0.104 0.892
#> GSM573796 4 0.2593 0.937 0.004 0.000 0.104 0.892
#> GSM573797 4 0.2593 0.937 0.004 0.000 0.104 0.892
#> GSM573741 4 0.0000 0.966 0.000 0.000 0.000 1.000
#> GSM573742 4 0.0000 0.966 0.000 0.000 0.000 1.000
#> GSM573743 4 0.0000 0.966 0.000 0.000 0.000 1.000
#> GSM573738 4 0.0000 0.966 0.000 0.000 0.000 1.000
#> GSM573739 4 0.0000 0.966 0.000 0.000 0.000 1.000
#> GSM573740 4 0.0000 0.966 0.000 0.000 0.000 1.000
#> GSM573792 4 0.0336 0.964 0.000 0.000 0.008 0.992
#> GSM573793 4 0.0336 0.964 0.000 0.000 0.008 0.992
#> GSM573794 4 0.0336 0.964 0.000 0.000 0.008 0.992
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM573726 1 0.0000 0.963 1.000 0.000 0.000 0.000 NA
#> GSM573727 1 0.0000 0.963 1.000 0.000 0.000 0.000 NA
#> GSM573728 1 0.0000 0.963 1.000 0.000 0.000 0.000 NA
#> GSM573729 1 0.0000 0.963 1.000 0.000 0.000 0.000 NA
#> GSM573730 1 0.0000 0.963 1.000 0.000 0.000 0.000 NA
#> GSM573731 1 0.0000 0.963 1.000 0.000 0.000 0.000 NA
#> GSM573735 1 0.2361 0.936 0.892 0.000 0.000 0.012 NA
#> GSM573736 1 0.2361 0.936 0.892 0.000 0.000 0.012 NA
#> GSM573737 1 0.2361 0.936 0.892 0.000 0.000 0.012 NA
#> GSM573732 1 0.2361 0.936 0.892 0.000 0.000 0.012 NA
#> GSM573733 1 0.2361 0.936 0.892 0.000 0.000 0.012 NA
#> GSM573734 1 0.2361 0.936 0.892 0.000 0.000 0.012 NA
#> GSM573789 1 0.2361 0.940 0.892 0.000 0.000 0.012 NA
#> GSM573790 1 0.2361 0.940 0.892 0.000 0.000 0.012 NA
#> GSM573791 1 0.2361 0.940 0.892 0.000 0.000 0.012 NA
#> GSM573723 1 0.0000 0.963 1.000 0.000 0.000 0.000 NA
#> GSM573724 1 0.0000 0.963 1.000 0.000 0.000 0.000 NA
#> GSM573725 1 0.0000 0.963 1.000 0.000 0.000 0.000 NA
#> GSM573720 1 0.0000 0.963 1.000 0.000 0.000 0.000 NA
#> GSM573721 1 0.0000 0.963 1.000 0.000 0.000 0.000 NA
#> GSM573722 1 0.0000 0.963 1.000 0.000 0.000 0.000 NA
#> GSM573786 1 0.1124 0.951 0.960 0.000 0.000 0.004 NA
#> GSM573787 1 0.1124 0.951 0.960 0.000 0.000 0.004 NA
#> GSM573788 1 0.1124 0.951 0.960 0.000 0.000 0.004 NA
#> GSM573768 2 0.0290 0.924 0.008 0.992 0.000 0.000 NA
#> GSM573769 2 0.0290 0.924 0.008 0.992 0.000 0.000 NA
#> GSM573770 2 0.0290 0.924 0.008 0.992 0.000 0.000 NA
#> GSM573765 2 0.1805 0.922 0.008 0.936 0.004 0.004 NA
#> GSM573766 2 0.1805 0.922 0.008 0.936 0.004 0.004 NA
#> GSM573767 2 0.1805 0.922 0.008 0.936 0.004 0.004 NA
#> GSM573777 2 0.4228 0.889 0.008 0.768 0.004 0.028 NA
#> GSM573778 2 0.4228 0.889 0.008 0.768 0.004 0.028 NA
#> GSM573779 2 0.4228 0.889 0.008 0.768 0.004 0.028 NA
#> GSM573762 2 0.4228 0.889 0.008 0.768 0.004 0.028 NA
#> GSM573763 2 0.4228 0.889 0.008 0.768 0.004 0.028 NA
#> GSM573764 2 0.4228 0.889 0.008 0.768 0.004 0.028 NA
#> GSM573771 2 0.4228 0.889 0.008 0.768 0.004 0.028 NA
#> GSM573772 2 0.4228 0.889 0.008 0.768 0.004 0.028 NA
#> GSM573773 2 0.4228 0.889 0.008 0.768 0.004 0.028 NA
#> GSM573759 2 0.0579 0.924 0.008 0.984 0.000 0.008 NA
#> GSM573760 2 0.0579 0.924 0.008 0.984 0.000 0.008 NA
#> GSM573761 2 0.0579 0.924 0.008 0.984 0.000 0.008 NA
#> GSM573774 2 0.0290 0.924 0.008 0.992 0.000 0.000 NA
#> GSM573775 2 0.0290 0.924 0.008 0.992 0.000 0.000 NA
#> GSM573776 2 0.0290 0.924 0.008 0.992 0.000 0.000 NA
#> GSM573756 2 0.0579 0.924 0.008 0.984 0.000 0.008 NA
#> GSM573757 2 0.0579 0.924 0.008 0.984 0.000 0.008 NA
#> GSM573758 2 0.0579 0.924 0.008 0.984 0.000 0.008 NA
#> GSM573708 3 0.1522 0.784 0.044 0.012 0.944 0.000 NA
#> GSM573709 3 0.1522 0.784 0.044 0.012 0.944 0.000 NA
#> GSM573710 3 0.1522 0.784 0.044 0.012 0.944 0.000 NA
#> GSM573711 3 0.1522 0.784 0.044 0.012 0.944 0.000 NA
#> GSM573712 3 0.1522 0.784 0.044 0.012 0.944 0.000 NA
#> GSM573713 3 0.1522 0.784 0.044 0.012 0.944 0.000 NA
#> GSM573717 3 0.5503 0.869 0.044 0.012 0.552 0.000 NA
#> GSM573718 3 0.5503 0.869 0.044 0.012 0.552 0.000 NA
#> GSM573719 3 0.5503 0.869 0.044 0.012 0.552 0.000 NA
#> GSM573714 3 0.5503 0.869 0.044 0.012 0.552 0.000 NA
#> GSM573715 3 0.5503 0.869 0.044 0.012 0.552 0.000 NA
#> GSM573716 3 0.5503 0.869 0.044 0.012 0.552 0.000 NA
#> GSM573780 3 0.2625 0.777 0.044 0.020 0.908 0.016 NA
#> GSM573781 3 0.2625 0.777 0.044 0.020 0.908 0.016 NA
#> GSM573782 3 0.2625 0.777 0.044 0.020 0.908 0.016 NA
#> GSM573705 3 0.5503 0.869 0.044 0.012 0.552 0.000 NA
#> GSM573706 3 0.5503 0.869 0.044 0.012 0.552 0.000 NA
#> GSM573707 3 0.5503 0.869 0.044 0.012 0.552 0.000 NA
#> GSM573702 3 0.5503 0.869 0.044 0.012 0.552 0.000 NA
#> GSM573703 3 0.5503 0.869 0.044 0.012 0.552 0.000 NA
#> GSM573704 3 0.5503 0.869 0.044 0.012 0.552 0.000 NA
#> GSM573783 3 0.6693 0.854 0.044 0.016 0.528 0.060 NA
#> GSM573784 3 0.6693 0.854 0.044 0.016 0.528 0.060 NA
#> GSM573785 3 0.6693 0.854 0.044 0.016 0.528 0.060 NA
#> GSM573744 4 0.2685 0.915 0.092 0.028 0.000 0.880 NA
#> GSM573745 4 0.2685 0.915 0.092 0.028 0.000 0.880 NA
#> GSM573746 4 0.2685 0.915 0.092 0.028 0.000 0.880 NA
#> GSM573747 4 0.2685 0.915 0.092 0.028 0.000 0.880 NA
#> GSM573748 4 0.2685 0.915 0.092 0.028 0.000 0.880 NA
#> GSM573749 4 0.2685 0.915 0.092 0.028 0.000 0.880 NA
#> GSM573753 4 0.5913 0.863 0.092 0.028 0.000 0.636 NA
#> GSM573754 4 0.5913 0.863 0.092 0.028 0.000 0.636 NA
#> GSM573755 4 0.5913 0.863 0.092 0.028 0.000 0.636 NA
#> GSM573750 4 0.5913 0.863 0.092 0.028 0.000 0.636 NA
#> GSM573751 4 0.5913 0.863 0.092 0.028 0.000 0.636 NA
#> GSM573752 4 0.5913 0.863 0.092 0.028 0.000 0.636 NA
#> GSM573795 4 0.6350 0.854 0.092 0.028 0.012 0.612 NA
#> GSM573796 4 0.6350 0.854 0.092 0.028 0.012 0.612 NA
#> GSM573797 4 0.6350 0.854 0.092 0.028 0.012 0.612 NA
#> GSM573741 4 0.2844 0.915 0.092 0.028 0.004 0.876 NA
#> GSM573742 4 0.2844 0.915 0.092 0.028 0.004 0.876 NA
#> GSM573743 4 0.2844 0.915 0.092 0.028 0.004 0.876 NA
#> GSM573738 4 0.2844 0.915 0.092 0.028 0.004 0.876 NA
#> GSM573739 4 0.2844 0.915 0.092 0.028 0.004 0.876 NA
#> GSM573740 4 0.2844 0.915 0.092 0.028 0.004 0.876 NA
#> GSM573792 4 0.4112 0.906 0.092 0.028 0.036 0.828 NA
#> GSM573793 4 0.4112 0.906 0.092 0.028 0.036 0.828 NA
#> GSM573794 4 0.4112 0.906 0.092 0.028 0.036 0.828 NA
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM573726 1 0.0000 0.927 1.000 0.000 0.000 0.000 0.000 NA
#> GSM573727 1 0.0000 0.927 1.000 0.000 0.000 0.000 0.000 NA
#> GSM573728 1 0.0000 0.927 1.000 0.000 0.000 0.000 0.000 NA
#> GSM573729 1 0.0000 0.927 1.000 0.000 0.000 0.000 0.000 NA
#> GSM573730 1 0.0000 0.927 1.000 0.000 0.000 0.000 0.000 NA
#> GSM573731 1 0.0000 0.927 1.000 0.000 0.000 0.000 0.000 NA
#> GSM573735 1 0.3616 0.867 0.792 0.000 0.000 0.000 0.076 NA
#> GSM573736 1 0.3616 0.867 0.792 0.000 0.000 0.000 0.076 NA
#> GSM573737 1 0.3616 0.867 0.792 0.000 0.000 0.000 0.076 NA
#> GSM573732 1 0.3616 0.867 0.792 0.000 0.000 0.000 0.076 NA
#> GSM573733 1 0.3616 0.867 0.792 0.000 0.000 0.000 0.076 NA
#> GSM573734 1 0.3616 0.867 0.792 0.000 0.000 0.000 0.076 NA
#> GSM573789 1 0.3139 0.884 0.812 0.000 0.000 0.000 0.028 NA
#> GSM573790 1 0.3139 0.884 0.812 0.000 0.000 0.000 0.028 NA
#> GSM573791 1 0.3139 0.884 0.812 0.000 0.000 0.000 0.028 NA
#> GSM573723 1 0.0000 0.927 1.000 0.000 0.000 0.000 0.000 NA
#> GSM573724 1 0.0000 0.927 1.000 0.000 0.000 0.000 0.000 NA
#> GSM573725 1 0.0000 0.927 1.000 0.000 0.000 0.000 0.000 NA
#> GSM573720 1 0.0000 0.927 1.000 0.000 0.000 0.000 0.000 NA
#> GSM573721 1 0.0000 0.927 1.000 0.000 0.000 0.000 0.000 NA
#> GSM573722 1 0.0000 0.927 1.000 0.000 0.000 0.000 0.000 NA
#> GSM573786 1 0.2121 0.898 0.892 0.000 0.000 0.000 0.012 NA
#> GSM573787 1 0.2121 0.898 0.892 0.000 0.000 0.000 0.012 NA
#> GSM573788 1 0.2121 0.898 0.892 0.000 0.000 0.000 0.012 NA
#> GSM573768 2 0.0291 0.845 0.004 0.992 0.000 0.000 0.004 NA
#> GSM573769 2 0.0146 0.845 0.004 0.996 0.000 0.000 0.000 NA
#> GSM573770 2 0.0146 0.845 0.004 0.996 0.000 0.000 0.000 NA
#> GSM573765 2 0.1753 0.844 0.004 0.912 0.000 0.000 0.000 NA
#> GSM573766 2 0.1897 0.844 0.004 0.908 0.000 0.000 0.004 NA
#> GSM573767 2 0.1897 0.844 0.004 0.908 0.000 0.000 0.004 NA
#> GSM573777 2 0.4218 0.773 0.004 0.584 0.000 0.000 0.012 NA
#> GSM573778 2 0.4218 0.773 0.004 0.584 0.000 0.000 0.012 NA
#> GSM573779 2 0.4218 0.773 0.004 0.584 0.000 0.000 0.012 NA
#> GSM573762 2 0.4135 0.773 0.004 0.584 0.000 0.000 0.008 NA
#> GSM573763 2 0.3915 0.773 0.004 0.584 0.000 0.000 0.000 NA
#> GSM573764 2 0.4166 0.773 0.004 0.584 0.000 0.004 0.004 NA
#> GSM573771 2 0.4041 0.773 0.004 0.584 0.000 0.004 0.000 NA
#> GSM573772 2 0.4166 0.773 0.004 0.584 0.000 0.004 0.004 NA
#> GSM573773 2 0.4041 0.773 0.004 0.584 0.000 0.000 0.004 NA
#> GSM573759 2 0.1693 0.841 0.004 0.932 0.000 0.020 0.044 NA
#> GSM573760 2 0.1003 0.844 0.004 0.964 0.000 0.004 0.028 NA
#> GSM573761 2 0.1003 0.844 0.004 0.964 0.000 0.004 0.028 NA
#> GSM573774 2 0.0291 0.845 0.004 0.992 0.000 0.000 0.004 NA
#> GSM573775 2 0.0146 0.845 0.004 0.996 0.000 0.000 0.000 NA
#> GSM573776 2 0.0146 0.845 0.004 0.996 0.000 0.000 0.000 NA
#> GSM573756 2 0.1921 0.840 0.004 0.924 0.004 0.024 0.044 NA
#> GSM573757 2 0.1921 0.840 0.004 0.924 0.004 0.024 0.044 NA
#> GSM573758 2 0.1921 0.840 0.004 0.924 0.004 0.024 0.044 NA
#> GSM573708 5 0.4264 0.934 0.016 0.000 0.488 0.000 0.496 NA
#> GSM573709 5 0.4264 0.934 0.016 0.000 0.488 0.000 0.496 NA
#> GSM573710 5 0.4264 0.934 0.016 0.000 0.488 0.000 0.496 NA
#> GSM573711 5 0.4264 0.934 0.016 0.000 0.488 0.000 0.496 NA
#> GSM573712 5 0.4264 0.934 0.016 0.000 0.488 0.000 0.496 NA
#> GSM573713 5 0.4264 0.934 0.016 0.000 0.488 0.000 0.496 NA
#> GSM573717 3 0.0458 0.945 0.016 0.000 0.984 0.000 0.000 NA
#> GSM573718 3 0.0458 0.945 0.016 0.000 0.984 0.000 0.000 NA
#> GSM573719 3 0.0458 0.945 0.016 0.000 0.984 0.000 0.000 NA
#> GSM573714 3 0.0458 0.945 0.016 0.000 0.984 0.000 0.000 NA
#> GSM573715 3 0.0458 0.945 0.016 0.000 0.984 0.000 0.000 NA
#> GSM573716 3 0.0458 0.945 0.016 0.000 0.984 0.000 0.000 NA
#> GSM573780 5 0.5550 0.872 0.016 0.000 0.432 0.012 0.484 NA
#> GSM573781 5 0.5550 0.872 0.016 0.000 0.432 0.012 0.484 NA
#> GSM573782 5 0.5550 0.872 0.016 0.000 0.432 0.012 0.484 NA
#> GSM573705 3 0.0458 0.945 0.016 0.000 0.984 0.000 0.000 NA
#> GSM573706 3 0.0458 0.945 0.016 0.000 0.984 0.000 0.000 NA
#> GSM573707 3 0.0458 0.945 0.016 0.000 0.984 0.000 0.000 NA
#> GSM573702 3 0.0458 0.945 0.016 0.000 0.984 0.000 0.000 NA
#> GSM573703 3 0.0458 0.945 0.016 0.000 0.984 0.000 0.000 NA
#> GSM573704 3 0.0458 0.945 0.016 0.000 0.984 0.000 0.000 NA
#> GSM573783 3 0.3635 0.753 0.016 0.004 0.832 0.012 0.044 NA
#> GSM573784 3 0.3635 0.753 0.016 0.004 0.832 0.012 0.044 NA
#> GSM573785 3 0.3585 0.760 0.016 0.004 0.836 0.012 0.044 NA
#> GSM573744 4 0.1141 0.854 0.052 0.000 0.000 0.948 0.000 NA
#> GSM573745 4 0.1141 0.854 0.052 0.000 0.000 0.948 0.000 NA
#> GSM573746 4 0.1141 0.854 0.052 0.000 0.000 0.948 0.000 NA
#> GSM573747 4 0.1141 0.854 0.052 0.000 0.000 0.948 0.000 NA
#> GSM573748 4 0.1141 0.854 0.052 0.000 0.000 0.948 0.000 NA
#> GSM573749 4 0.1141 0.854 0.052 0.000 0.000 0.948 0.000 NA
#> GSM573753 4 0.5994 0.755 0.052 0.000 0.000 0.556 0.288 NA
#> GSM573754 4 0.5994 0.755 0.052 0.000 0.000 0.556 0.288 NA
#> GSM573755 4 0.5994 0.755 0.052 0.000 0.000 0.556 0.288 NA
#> GSM573750 4 0.5994 0.755 0.052 0.000 0.000 0.556 0.288 NA
#> GSM573751 4 0.5994 0.755 0.052 0.000 0.000 0.556 0.288 NA
#> GSM573752 4 0.5994 0.755 0.052 0.000 0.000 0.556 0.288 NA
#> GSM573795 4 0.6668 0.735 0.052 0.000 0.008 0.508 0.244 NA
#> GSM573796 4 0.6668 0.735 0.052 0.000 0.008 0.508 0.244 NA
#> GSM573797 4 0.6668 0.735 0.052 0.000 0.008 0.508 0.244 NA
#> GSM573741 4 0.1429 0.854 0.052 0.000 0.004 0.940 0.000 NA
#> GSM573742 4 0.1429 0.854 0.052 0.000 0.004 0.940 0.000 NA
#> GSM573743 4 0.1429 0.854 0.052 0.000 0.004 0.940 0.000 NA
#> GSM573738 4 0.1429 0.854 0.052 0.000 0.004 0.940 0.000 NA
#> GSM573739 4 0.1429 0.854 0.052 0.000 0.004 0.940 0.000 NA
#> GSM573740 4 0.1429 0.854 0.052 0.000 0.004 0.940 0.000 NA
#> GSM573792 4 0.3362 0.830 0.052 0.000 0.004 0.840 0.016 NA
#> GSM573793 4 0.3117 0.832 0.052 0.000 0.000 0.852 0.016 NA
#> GSM573794 4 0.3117 0.832 0.052 0.000 0.000 0.852 0.016 NA
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
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)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
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:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.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")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
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 cell.line(p) agent(p) k
#> MAD:kmeans 72 2.32e-16 0.408 2
#> MAD:kmeans 96 9.56e-39 0.741 3
#> MAD:kmeans 96 9.14e-57 0.975 4
#> MAD:kmeans 96 9.14e-57 0.975 5
#> MAD:kmeans 96 1.55e-54 0.176 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.
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 46609 rows and 96 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'MAD' method.
#> Subgroups are detected by 'skmeans' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 5.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.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:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).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)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 0.495 0.605 0.746 0.506 0.495 0.495
#> 3 3 0.747 0.821 0.880 0.250 0.621 0.390
#> 4 4 1.000 1.000 1.000 0.199 0.874 0.657
#> 5 5 0.917 0.968 0.941 0.038 0.970 0.878
#> 6 6 0.880 0.884 0.896 0.035 1.000 1.000
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 5
#> attr(,"optional")
#> [1] 4
There is also optional best \(k\) = 4 that is worth to check.
Following shows the table of the partitions (You need to click the show/hide
code output link to see it). The membership matrix (columns with name p*
)
is inferred by
clue::cl_consensus()
function with the SE
method. Basically the value in the membership matrix
represents the probability to belong to a certain group. The finall class
label for an item is determined with the group with highest probability it
belongs to.
In get_classes()
function, the entropy is calculated from the membership
matrix and the silhouette score is calculated from the consensus matrix.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> GSM573726 1 0.998 0.605 0.524 0.476
#> GSM573727 1 0.998 0.605 0.524 0.476
#> GSM573728 1 0.998 0.605 0.524 0.476
#> GSM573729 1 0.998 0.605 0.524 0.476
#> GSM573730 1 0.998 0.605 0.524 0.476
#> GSM573731 1 0.998 0.605 0.524 0.476
#> GSM573735 1 0.998 0.605 0.524 0.476
#> GSM573736 1 0.998 0.605 0.524 0.476
#> GSM573737 1 0.998 0.605 0.524 0.476
#> GSM573732 1 0.998 0.605 0.524 0.476
#> GSM573733 1 0.998 0.605 0.524 0.476
#> GSM573734 1 0.998 0.605 0.524 0.476
#> GSM573789 1 0.998 0.605 0.524 0.476
#> GSM573790 1 0.998 0.605 0.524 0.476
#> GSM573791 1 0.998 0.605 0.524 0.476
#> GSM573723 1 0.998 0.605 0.524 0.476
#> GSM573724 1 0.998 0.605 0.524 0.476
#> GSM573725 1 0.998 0.605 0.524 0.476
#> GSM573720 1 0.998 0.605 0.524 0.476
#> GSM573721 1 0.998 0.605 0.524 0.476
#> GSM573722 1 0.998 0.605 0.524 0.476
#> GSM573786 1 0.998 0.605 0.524 0.476
#> GSM573787 1 0.998 0.605 0.524 0.476
#> GSM573788 1 0.998 0.605 0.524 0.476
#> GSM573768 2 0.998 0.605 0.476 0.524
#> GSM573769 2 0.998 0.605 0.476 0.524
#> GSM573770 2 0.998 0.605 0.476 0.524
#> GSM573765 2 0.998 0.605 0.476 0.524
#> GSM573766 2 0.998 0.605 0.476 0.524
#> GSM573767 2 0.998 0.605 0.476 0.524
#> GSM573777 2 0.998 0.605 0.476 0.524
#> GSM573778 2 0.998 0.605 0.476 0.524
#> GSM573779 2 0.998 0.605 0.476 0.524
#> GSM573762 2 0.998 0.605 0.476 0.524
#> GSM573763 2 0.998 0.605 0.476 0.524
#> GSM573764 2 0.998 0.605 0.476 0.524
#> GSM573771 2 0.998 0.605 0.476 0.524
#> GSM573772 2 0.998 0.605 0.476 0.524
#> GSM573773 2 0.998 0.605 0.476 0.524
#> GSM573759 2 0.998 0.605 0.476 0.524
#> GSM573760 2 0.998 0.605 0.476 0.524
#> GSM573761 2 0.998 0.605 0.476 0.524
#> GSM573774 2 0.998 0.605 0.476 0.524
#> GSM573775 2 0.998 0.605 0.476 0.524
#> GSM573776 2 0.998 0.605 0.476 0.524
#> GSM573756 2 0.998 0.605 0.476 0.524
#> GSM573757 2 0.998 0.605 0.476 0.524
#> GSM573758 2 0.998 0.605 0.476 0.524
#> GSM573708 2 0.000 0.605 0.000 1.000
#> GSM573709 2 0.000 0.605 0.000 1.000
#> GSM573710 2 0.000 0.605 0.000 1.000
#> GSM573711 2 0.000 0.605 0.000 1.000
#> GSM573712 2 0.000 0.605 0.000 1.000
#> GSM573713 2 0.000 0.605 0.000 1.000
#> GSM573717 2 0.000 0.605 0.000 1.000
#> GSM573718 2 0.000 0.605 0.000 1.000
#> GSM573719 2 0.000 0.605 0.000 1.000
#> GSM573714 2 0.000 0.605 0.000 1.000
#> GSM573715 2 0.000 0.605 0.000 1.000
#> GSM573716 2 0.000 0.605 0.000 1.000
#> GSM573780 2 0.000 0.605 0.000 1.000
#> GSM573781 2 0.000 0.605 0.000 1.000
#> GSM573782 2 0.000 0.605 0.000 1.000
#> GSM573705 2 0.000 0.605 0.000 1.000
#> GSM573706 2 0.000 0.605 0.000 1.000
#> GSM573707 2 0.000 0.605 0.000 1.000
#> GSM573702 2 0.000 0.605 0.000 1.000
#> GSM573703 2 0.000 0.605 0.000 1.000
#> GSM573704 2 0.000 0.605 0.000 1.000
#> GSM573783 2 0.000 0.605 0.000 1.000
#> GSM573784 2 0.000 0.605 0.000 1.000
#> GSM573785 2 0.000 0.605 0.000 1.000
#> GSM573744 1 0.000 0.605 1.000 0.000
#> GSM573745 1 0.000 0.605 1.000 0.000
#> GSM573746 1 0.000 0.605 1.000 0.000
#> GSM573747 1 0.000 0.605 1.000 0.000
#> GSM573748 1 0.000 0.605 1.000 0.000
#> GSM573749 1 0.000 0.605 1.000 0.000
#> GSM573753 1 0.000 0.605 1.000 0.000
#> GSM573754 1 0.000 0.605 1.000 0.000
#> GSM573755 1 0.000 0.605 1.000 0.000
#> GSM573750 1 0.000 0.605 1.000 0.000
#> GSM573751 1 0.000 0.605 1.000 0.000
#> GSM573752 1 0.000 0.605 1.000 0.000
#> GSM573795 1 0.000 0.605 1.000 0.000
#> GSM573796 1 0.000 0.605 1.000 0.000
#> GSM573797 1 0.000 0.605 1.000 0.000
#> GSM573741 1 0.000 0.605 1.000 0.000
#> GSM573742 1 0.000 0.605 1.000 0.000
#> GSM573743 1 0.000 0.605 1.000 0.000
#> GSM573738 1 0.000 0.605 1.000 0.000
#> GSM573739 1 0.000 0.605 1.000 0.000
#> GSM573740 1 0.000 0.605 1.000 0.000
#> GSM573792 1 0.000 0.605 1.000 0.000
#> GSM573793 1 0.000 0.605 1.000 0.000
#> GSM573794 1 0.000 0.605 1.000 0.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM573726 3 0.000 0.572 0.000 0.000 1.000
#> GSM573727 3 0.000 0.572 0.000 0.000 1.000
#> GSM573728 3 0.000 0.572 0.000 0.000 1.000
#> GSM573729 3 0.000 0.572 0.000 0.000 1.000
#> GSM573730 3 0.000 0.572 0.000 0.000 1.000
#> GSM573731 3 0.000 0.572 0.000 0.000 1.000
#> GSM573735 3 0.000 0.572 0.000 0.000 1.000
#> GSM573736 3 0.000 0.572 0.000 0.000 1.000
#> GSM573737 3 0.000 0.572 0.000 0.000 1.000
#> GSM573732 3 0.000 0.572 0.000 0.000 1.000
#> GSM573733 3 0.000 0.572 0.000 0.000 1.000
#> GSM573734 3 0.000 0.572 0.000 0.000 1.000
#> GSM573789 3 0.000 0.572 0.000 0.000 1.000
#> GSM573790 3 0.000 0.572 0.000 0.000 1.000
#> GSM573791 3 0.000 0.572 0.000 0.000 1.000
#> GSM573723 3 0.000 0.572 0.000 0.000 1.000
#> GSM573724 3 0.000 0.572 0.000 0.000 1.000
#> GSM573725 3 0.000 0.572 0.000 0.000 1.000
#> GSM573720 3 0.000 0.572 0.000 0.000 1.000
#> GSM573721 3 0.000 0.572 0.000 0.000 1.000
#> GSM573722 3 0.000 0.572 0.000 0.000 1.000
#> GSM573786 3 0.000 0.572 0.000 0.000 1.000
#> GSM573787 3 0.000 0.572 0.000 0.000 1.000
#> GSM573788 3 0.000 0.572 0.000 0.000 1.000
#> GSM573768 2 0.000 1.000 0.000 1.000 0.000
#> GSM573769 2 0.000 1.000 0.000 1.000 0.000
#> GSM573770 2 0.000 1.000 0.000 1.000 0.000
#> GSM573765 2 0.000 1.000 0.000 1.000 0.000
#> GSM573766 2 0.000 1.000 0.000 1.000 0.000
#> GSM573767 2 0.000 1.000 0.000 1.000 0.000
#> GSM573777 2 0.000 1.000 0.000 1.000 0.000
#> GSM573778 2 0.000 1.000 0.000 1.000 0.000
#> GSM573779 2 0.000 1.000 0.000 1.000 0.000
#> GSM573762 2 0.000 1.000 0.000 1.000 0.000
#> GSM573763 2 0.000 1.000 0.000 1.000 0.000
#> GSM573764 2 0.000 1.000 0.000 1.000 0.000
#> GSM573771 2 0.000 1.000 0.000 1.000 0.000
#> GSM573772 2 0.000 1.000 0.000 1.000 0.000
#> GSM573773 2 0.000 1.000 0.000 1.000 0.000
#> GSM573759 2 0.000 1.000 0.000 1.000 0.000
#> GSM573760 2 0.000 1.000 0.000 1.000 0.000
#> GSM573761 2 0.000 1.000 0.000 1.000 0.000
#> GSM573774 2 0.000 1.000 0.000 1.000 0.000
#> GSM573775 2 0.000 1.000 0.000 1.000 0.000
#> GSM573776 2 0.000 1.000 0.000 1.000 0.000
#> GSM573756 2 0.000 1.000 0.000 1.000 0.000
#> GSM573757 2 0.000 1.000 0.000 1.000 0.000
#> GSM573758 2 0.000 1.000 0.000 1.000 0.000
#> GSM573708 3 0.629 0.714 0.464 0.000 0.536
#> GSM573709 3 0.629 0.714 0.464 0.000 0.536
#> GSM573710 3 0.629 0.714 0.464 0.000 0.536
#> GSM573711 3 0.629 0.714 0.464 0.000 0.536
#> GSM573712 3 0.629 0.714 0.464 0.000 0.536
#> GSM573713 3 0.629 0.714 0.464 0.000 0.536
#> GSM573717 3 0.629 0.714 0.464 0.000 0.536
#> GSM573718 3 0.629 0.714 0.464 0.000 0.536
#> GSM573719 3 0.629 0.714 0.464 0.000 0.536
#> GSM573714 3 0.629 0.714 0.464 0.000 0.536
#> GSM573715 3 0.629 0.714 0.464 0.000 0.536
#> GSM573716 3 0.629 0.714 0.464 0.000 0.536
#> GSM573780 3 0.629 0.714 0.464 0.000 0.536
#> GSM573781 3 0.629 0.714 0.464 0.000 0.536
#> GSM573782 3 0.629 0.714 0.464 0.000 0.536
#> GSM573705 3 0.629 0.714 0.464 0.000 0.536
#> GSM573706 3 0.629 0.714 0.464 0.000 0.536
#> GSM573707 3 0.629 0.714 0.464 0.000 0.536
#> GSM573702 3 0.629 0.714 0.464 0.000 0.536
#> GSM573703 3 0.629 0.714 0.464 0.000 0.536
#> GSM573704 3 0.629 0.714 0.464 0.000 0.536
#> GSM573783 3 0.629 0.714 0.464 0.000 0.536
#> GSM573784 3 0.629 0.714 0.464 0.000 0.536
#> GSM573785 3 0.629 0.714 0.464 0.000 0.536
#> GSM573744 1 0.692 1.000 0.536 0.016 0.448
#> GSM573745 1 0.692 1.000 0.536 0.016 0.448
#> GSM573746 1 0.692 1.000 0.536 0.016 0.448
#> GSM573747 1 0.692 1.000 0.536 0.016 0.448
#> GSM573748 1 0.692 1.000 0.536 0.016 0.448
#> GSM573749 1 0.692 1.000 0.536 0.016 0.448
#> GSM573753 1 0.692 1.000 0.536 0.016 0.448
#> GSM573754 1 0.692 1.000 0.536 0.016 0.448
#> GSM573755 1 0.692 1.000 0.536 0.016 0.448
#> GSM573750 1 0.692 1.000 0.536 0.016 0.448
#> GSM573751 1 0.692 1.000 0.536 0.016 0.448
#> GSM573752 1 0.692 1.000 0.536 0.016 0.448
#> GSM573795 1 0.692 1.000 0.536 0.016 0.448
#> GSM573796 1 0.692 1.000 0.536 0.016 0.448
#> GSM573797 1 0.692 1.000 0.536 0.016 0.448
#> GSM573741 1 0.692 1.000 0.536 0.016 0.448
#> GSM573742 1 0.692 1.000 0.536 0.016 0.448
#> GSM573743 1 0.692 1.000 0.536 0.016 0.448
#> GSM573738 1 0.692 1.000 0.536 0.016 0.448
#> GSM573739 1 0.692 1.000 0.536 0.016 0.448
#> GSM573740 1 0.692 1.000 0.536 0.016 0.448
#> GSM573792 1 0.692 1.000 0.536 0.016 0.448
#> GSM573793 1 0.692 1.000 0.536 0.016 0.448
#> GSM573794 1 0.692 1.000 0.536 0.016 0.448
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM573726 1 0 1 1 0 0 0
#> GSM573727 1 0 1 1 0 0 0
#> GSM573728 1 0 1 1 0 0 0
#> GSM573729 1 0 1 1 0 0 0
#> GSM573730 1 0 1 1 0 0 0
#> GSM573731 1 0 1 1 0 0 0
#> GSM573735 1 0 1 1 0 0 0
#> GSM573736 1 0 1 1 0 0 0
#> GSM573737 1 0 1 1 0 0 0
#> GSM573732 1 0 1 1 0 0 0
#> GSM573733 1 0 1 1 0 0 0
#> GSM573734 1 0 1 1 0 0 0
#> GSM573789 1 0 1 1 0 0 0
#> GSM573790 1 0 1 1 0 0 0
#> GSM573791 1 0 1 1 0 0 0
#> GSM573723 1 0 1 1 0 0 0
#> GSM573724 1 0 1 1 0 0 0
#> GSM573725 1 0 1 1 0 0 0
#> GSM573720 1 0 1 1 0 0 0
#> GSM573721 1 0 1 1 0 0 0
#> GSM573722 1 0 1 1 0 0 0
#> GSM573786 1 0 1 1 0 0 0
#> GSM573787 1 0 1 1 0 0 0
#> GSM573788 1 0 1 1 0 0 0
#> GSM573768 2 0 1 0 1 0 0
#> GSM573769 2 0 1 0 1 0 0
#> GSM573770 2 0 1 0 1 0 0
#> GSM573765 2 0 1 0 1 0 0
#> GSM573766 2 0 1 0 1 0 0
#> GSM573767 2 0 1 0 1 0 0
#> GSM573777 2 0 1 0 1 0 0
#> GSM573778 2 0 1 0 1 0 0
#> GSM573779 2 0 1 0 1 0 0
#> GSM573762 2 0 1 0 1 0 0
#> GSM573763 2 0 1 0 1 0 0
#> GSM573764 2 0 1 0 1 0 0
#> GSM573771 2 0 1 0 1 0 0
#> GSM573772 2 0 1 0 1 0 0
#> GSM573773 2 0 1 0 1 0 0
#> GSM573759 2 0 1 0 1 0 0
#> GSM573760 2 0 1 0 1 0 0
#> GSM573761 2 0 1 0 1 0 0
#> GSM573774 2 0 1 0 1 0 0
#> GSM573775 2 0 1 0 1 0 0
#> GSM573776 2 0 1 0 1 0 0
#> GSM573756 2 0 1 0 1 0 0
#> GSM573757 2 0 1 0 1 0 0
#> GSM573758 2 0 1 0 1 0 0
#> GSM573708 3 0 1 0 0 1 0
#> GSM573709 3 0 1 0 0 1 0
#> GSM573710 3 0 1 0 0 1 0
#> GSM573711 3 0 1 0 0 1 0
#> GSM573712 3 0 1 0 0 1 0
#> GSM573713 3 0 1 0 0 1 0
#> GSM573717 3 0 1 0 0 1 0
#> GSM573718 3 0 1 0 0 1 0
#> GSM573719 3 0 1 0 0 1 0
#> GSM573714 3 0 1 0 0 1 0
#> GSM573715 3 0 1 0 0 1 0
#> GSM573716 3 0 1 0 0 1 0
#> GSM573780 3 0 1 0 0 1 0
#> GSM573781 3 0 1 0 0 1 0
#> GSM573782 3 0 1 0 0 1 0
#> GSM573705 3 0 1 0 0 1 0
#> GSM573706 3 0 1 0 0 1 0
#> GSM573707 3 0 1 0 0 1 0
#> GSM573702 3 0 1 0 0 1 0
#> GSM573703 3 0 1 0 0 1 0
#> GSM573704 3 0 1 0 0 1 0
#> GSM573783 3 0 1 0 0 1 0
#> GSM573784 3 0 1 0 0 1 0
#> GSM573785 3 0 1 0 0 1 0
#> GSM573744 4 0 1 0 0 0 1
#> GSM573745 4 0 1 0 0 0 1
#> GSM573746 4 0 1 0 0 0 1
#> GSM573747 4 0 1 0 0 0 1
#> GSM573748 4 0 1 0 0 0 1
#> GSM573749 4 0 1 0 0 0 1
#> GSM573753 4 0 1 0 0 0 1
#> GSM573754 4 0 1 0 0 0 1
#> GSM573755 4 0 1 0 0 0 1
#> GSM573750 4 0 1 0 0 0 1
#> GSM573751 4 0 1 0 0 0 1
#> GSM573752 4 0 1 0 0 0 1
#> GSM573795 4 0 1 0 0 0 1
#> GSM573796 4 0 1 0 0 0 1
#> GSM573797 4 0 1 0 0 0 1
#> GSM573741 4 0 1 0 0 0 1
#> GSM573742 4 0 1 0 0 0 1
#> GSM573743 4 0 1 0 0 0 1
#> GSM573738 4 0 1 0 0 0 1
#> GSM573739 4 0 1 0 0 0 1
#> GSM573740 4 0 1 0 0 0 1
#> GSM573792 4 0 1 0 0 0 1
#> GSM573793 4 0 1 0 0 0 1
#> GSM573794 4 0 1 0 0 0 1
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM573726 1 0.000 0.965 1.000 0.000 0.000 0.00 0.000
#> GSM573727 1 0.000 0.965 1.000 0.000 0.000 0.00 0.000
#> GSM573728 1 0.000 0.965 1.000 0.000 0.000 0.00 0.000
#> GSM573729 1 0.000 0.965 1.000 0.000 0.000 0.00 0.000
#> GSM573730 1 0.000 0.965 1.000 0.000 0.000 0.00 0.000
#> GSM573731 1 0.000 0.965 1.000 0.000 0.000 0.00 0.000
#> GSM573735 1 0.256 0.907 0.856 0.000 0.000 0.00 0.144
#> GSM573736 1 0.256 0.907 0.856 0.000 0.000 0.00 0.144
#> GSM573737 1 0.256 0.907 0.856 0.000 0.000 0.00 0.144
#> GSM573732 1 0.256 0.907 0.856 0.000 0.000 0.00 0.144
#> GSM573733 1 0.256 0.907 0.856 0.000 0.000 0.00 0.144
#> GSM573734 1 0.256 0.907 0.856 0.000 0.000 0.00 0.144
#> GSM573789 1 0.104 0.955 0.960 0.000 0.000 0.00 0.040
#> GSM573790 1 0.104 0.955 0.960 0.000 0.000 0.00 0.040
#> GSM573791 1 0.104 0.955 0.960 0.000 0.000 0.00 0.040
#> GSM573723 1 0.000 0.965 1.000 0.000 0.000 0.00 0.000
#> GSM573724 1 0.000 0.965 1.000 0.000 0.000 0.00 0.000
#> GSM573725 1 0.000 0.965 1.000 0.000 0.000 0.00 0.000
#> GSM573720 1 0.000 0.965 1.000 0.000 0.000 0.00 0.000
#> GSM573721 1 0.000 0.965 1.000 0.000 0.000 0.00 0.000
#> GSM573722 1 0.000 0.965 1.000 0.000 0.000 0.00 0.000
#> GSM573786 1 0.029 0.962 0.992 0.000 0.000 0.00 0.008
#> GSM573787 1 0.029 0.962 0.992 0.000 0.000 0.00 0.008
#> GSM573788 1 0.029 0.962 0.992 0.000 0.000 0.00 0.008
#> GSM573768 2 0.000 0.985 0.000 1.000 0.000 0.00 0.000
#> GSM573769 2 0.000 0.985 0.000 1.000 0.000 0.00 0.000
#> GSM573770 2 0.000 0.985 0.000 1.000 0.000 0.00 0.000
#> GSM573765 2 0.029 0.985 0.000 0.992 0.000 0.00 0.008
#> GSM573766 2 0.029 0.985 0.000 0.992 0.000 0.00 0.008
#> GSM573767 2 0.029 0.985 0.000 0.992 0.000 0.00 0.008
#> GSM573777 2 0.112 0.977 0.000 0.956 0.000 0.00 0.044
#> GSM573778 2 0.112 0.977 0.000 0.956 0.000 0.00 0.044
#> GSM573779 2 0.112 0.977 0.000 0.956 0.000 0.00 0.044
#> GSM573762 2 0.112 0.977 0.000 0.956 0.000 0.00 0.044
#> GSM573763 2 0.112 0.977 0.000 0.956 0.000 0.00 0.044
#> GSM573764 2 0.112 0.977 0.000 0.956 0.000 0.00 0.044
#> GSM573771 2 0.112 0.977 0.000 0.956 0.000 0.00 0.044
#> GSM573772 2 0.112 0.977 0.000 0.956 0.000 0.00 0.044
#> GSM573773 2 0.112 0.977 0.000 0.956 0.000 0.00 0.044
#> GSM573759 2 0.000 0.985 0.000 1.000 0.000 0.00 0.000
#> GSM573760 2 0.000 0.985 0.000 1.000 0.000 0.00 0.000
#> GSM573761 2 0.000 0.985 0.000 1.000 0.000 0.00 0.000
#> GSM573774 2 0.000 0.985 0.000 1.000 0.000 0.00 0.000
#> GSM573775 2 0.000 0.985 0.000 1.000 0.000 0.00 0.000
#> GSM573776 2 0.000 0.985 0.000 1.000 0.000 0.00 0.000
#> GSM573756 2 0.000 0.985 0.000 1.000 0.000 0.00 0.000
#> GSM573757 2 0.000 0.985 0.000 1.000 0.000 0.00 0.000
#> GSM573758 2 0.000 0.985 0.000 1.000 0.000 0.00 0.000
#> GSM573708 5 0.397 1.000 0.000 0.000 0.336 0.00 0.664
#> GSM573709 5 0.397 1.000 0.000 0.000 0.336 0.00 0.664
#> GSM573710 5 0.397 1.000 0.000 0.000 0.336 0.00 0.664
#> GSM573711 5 0.397 1.000 0.000 0.000 0.336 0.00 0.664
#> GSM573712 5 0.397 1.000 0.000 0.000 0.336 0.00 0.664
#> GSM573713 5 0.397 1.000 0.000 0.000 0.336 0.00 0.664
#> GSM573717 3 0.000 1.000 0.000 0.000 1.000 0.00 0.000
#> GSM573718 3 0.000 1.000 0.000 0.000 1.000 0.00 0.000
#> GSM573719 3 0.000 1.000 0.000 0.000 1.000 0.00 0.000
#> GSM573714 3 0.000 1.000 0.000 0.000 1.000 0.00 0.000
#> GSM573715 3 0.000 1.000 0.000 0.000 1.000 0.00 0.000
#> GSM573716 3 0.000 1.000 0.000 0.000 1.000 0.00 0.000
#> GSM573780 5 0.397 1.000 0.000 0.000 0.336 0.00 0.664
#> GSM573781 5 0.397 1.000 0.000 0.000 0.336 0.00 0.664
#> GSM573782 5 0.397 1.000 0.000 0.000 0.336 0.00 0.664
#> GSM573705 3 0.000 1.000 0.000 0.000 1.000 0.00 0.000
#> GSM573706 3 0.000 1.000 0.000 0.000 1.000 0.00 0.000
#> GSM573707 3 0.000 1.000 0.000 0.000 1.000 0.00 0.000
#> GSM573702 3 0.000 1.000 0.000 0.000 1.000 0.00 0.000
#> GSM573703 3 0.000 1.000 0.000 0.000 1.000 0.00 0.000
#> GSM573704 3 0.000 1.000 0.000 0.000 1.000 0.00 0.000
#> GSM573783 3 0.000 1.000 0.000 0.000 1.000 0.00 0.000
#> GSM573784 3 0.000 1.000 0.000 0.000 1.000 0.00 0.000
#> GSM573785 3 0.000 1.000 0.000 0.000 1.000 0.00 0.000
#> GSM573744 4 0.000 0.953 0.000 0.000 0.000 1.00 0.000
#> GSM573745 4 0.000 0.953 0.000 0.000 0.000 1.00 0.000
#> GSM573746 4 0.000 0.953 0.000 0.000 0.000 1.00 0.000
#> GSM573747 4 0.000 0.953 0.000 0.000 0.000 1.00 0.000
#> GSM573748 4 0.000 0.953 0.000 0.000 0.000 1.00 0.000
#> GSM573749 4 0.000 0.953 0.000 0.000 0.000 1.00 0.000
#> GSM573753 4 0.252 0.919 0.000 0.000 0.000 0.86 0.140
#> GSM573754 4 0.252 0.919 0.000 0.000 0.000 0.86 0.140
#> GSM573755 4 0.252 0.919 0.000 0.000 0.000 0.86 0.140
#> GSM573750 4 0.252 0.919 0.000 0.000 0.000 0.86 0.140
#> GSM573751 4 0.252 0.919 0.000 0.000 0.000 0.86 0.140
#> GSM573752 4 0.252 0.919 0.000 0.000 0.000 0.86 0.140
#> GSM573795 4 0.252 0.919 0.000 0.000 0.000 0.86 0.140
#> GSM573796 4 0.252 0.919 0.000 0.000 0.000 0.86 0.140
#> GSM573797 4 0.252 0.919 0.000 0.000 0.000 0.86 0.140
#> GSM573741 4 0.000 0.953 0.000 0.000 0.000 1.00 0.000
#> GSM573742 4 0.000 0.953 0.000 0.000 0.000 1.00 0.000
#> GSM573743 4 0.000 0.953 0.000 0.000 0.000 1.00 0.000
#> GSM573738 4 0.000 0.953 0.000 0.000 0.000 1.00 0.000
#> GSM573739 4 0.000 0.953 0.000 0.000 0.000 1.00 0.000
#> GSM573740 4 0.000 0.953 0.000 0.000 0.000 1.00 0.000
#> GSM573792 4 0.000 0.953 0.000 0.000 0.000 1.00 0.000
#> GSM573793 4 0.000 0.953 0.000 0.000 0.000 1.00 0.000
#> GSM573794 4 0.000 0.953 0.000 0.000 0.000 1.00 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM573726 1 0.0000 0.895 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM573727 1 0.0000 0.895 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM573728 1 0.0000 0.895 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM573729 1 0.0000 0.895 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM573730 1 0.0000 0.895 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM573731 1 0.0000 0.895 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM573735 1 0.4648 0.703 0.604 0.000 0.000 0.000 0.056 0.340
#> GSM573736 1 0.4648 0.703 0.604 0.000 0.000 0.000 0.056 0.340
#> GSM573737 1 0.4648 0.703 0.604 0.000 0.000 0.000 0.056 0.340
#> GSM573732 1 0.4648 0.703 0.604 0.000 0.000 0.000 0.056 0.340
#> GSM573733 1 0.4648 0.703 0.604 0.000 0.000 0.000 0.056 0.340
#> GSM573734 1 0.4648 0.703 0.604 0.000 0.000 0.000 0.056 0.340
#> GSM573789 1 0.2218 0.864 0.884 0.000 0.000 0.000 0.012 0.104
#> GSM573790 1 0.2218 0.864 0.884 0.000 0.000 0.000 0.012 0.104
#> GSM573791 1 0.2218 0.864 0.884 0.000 0.000 0.000 0.012 0.104
#> GSM573723 1 0.0000 0.895 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM573724 1 0.0000 0.895 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM573725 1 0.0000 0.895 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM573720 1 0.0000 0.895 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM573721 1 0.0000 0.895 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM573722 1 0.0000 0.895 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM573786 1 0.0725 0.888 0.976 0.000 0.000 0.000 0.012 0.012
#> GSM573787 1 0.0725 0.888 0.976 0.000 0.000 0.000 0.012 0.012
#> GSM573788 1 0.0725 0.888 0.976 0.000 0.000 0.000 0.012 0.012
#> GSM573768 2 0.0000 0.900 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM573769 2 0.0000 0.900 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM573770 2 0.0000 0.900 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM573765 2 0.1219 0.896 0.000 0.948 0.000 0.000 0.004 0.048
#> GSM573766 2 0.1285 0.895 0.000 0.944 0.000 0.000 0.004 0.052
#> GSM573767 2 0.1285 0.895 0.000 0.944 0.000 0.000 0.004 0.052
#> GSM573777 2 0.3770 0.843 0.000 0.728 0.000 0.000 0.028 0.244
#> GSM573778 2 0.3770 0.843 0.000 0.728 0.000 0.000 0.028 0.244
#> GSM573779 2 0.3770 0.843 0.000 0.728 0.000 0.000 0.028 0.244
#> GSM573762 2 0.3770 0.843 0.000 0.728 0.000 0.000 0.028 0.244
#> GSM573763 2 0.3770 0.843 0.000 0.728 0.000 0.000 0.028 0.244
#> GSM573764 2 0.3770 0.843 0.000 0.728 0.000 0.000 0.028 0.244
#> GSM573771 2 0.3770 0.843 0.000 0.728 0.000 0.000 0.028 0.244
#> GSM573772 2 0.3770 0.843 0.000 0.728 0.000 0.000 0.028 0.244
#> GSM573773 2 0.3770 0.843 0.000 0.728 0.000 0.000 0.028 0.244
#> GSM573759 2 0.0000 0.900 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM573760 2 0.0000 0.900 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM573761 2 0.0000 0.900 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM573774 2 0.0000 0.900 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM573775 2 0.0000 0.900 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM573776 2 0.0000 0.900 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM573756 2 0.0000 0.900 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM573757 2 0.0000 0.900 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM573758 2 0.0000 0.900 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM573708 5 0.2048 0.997 0.000 0.000 0.120 0.000 0.880 0.000
#> GSM573709 5 0.2048 0.997 0.000 0.000 0.120 0.000 0.880 0.000
#> GSM573710 5 0.2048 0.997 0.000 0.000 0.120 0.000 0.880 0.000
#> GSM573711 5 0.2048 0.997 0.000 0.000 0.120 0.000 0.880 0.000
#> GSM573712 5 0.2048 0.997 0.000 0.000 0.120 0.000 0.880 0.000
#> GSM573713 5 0.2048 0.997 0.000 0.000 0.120 0.000 0.880 0.000
#> GSM573717 3 0.0000 0.998 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM573718 3 0.0000 0.998 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM573719 3 0.0000 0.998 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM573714 3 0.0000 0.998 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM573715 3 0.0000 0.998 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM573716 3 0.0000 0.998 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM573780 5 0.1957 0.993 0.000 0.000 0.112 0.000 0.888 0.000
#> GSM573781 5 0.1957 0.993 0.000 0.000 0.112 0.000 0.888 0.000
#> GSM573782 5 0.1957 0.993 0.000 0.000 0.112 0.000 0.888 0.000
#> GSM573705 3 0.0000 0.998 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM573706 3 0.0000 0.998 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM573707 3 0.0000 0.998 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM573702 3 0.0000 0.998 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM573703 3 0.0000 0.998 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM573704 3 0.0000 0.998 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM573783 3 0.0260 0.992 0.000 0.000 0.992 0.000 0.008 0.000
#> GSM573784 3 0.0260 0.992 0.000 0.000 0.992 0.000 0.008 0.000
#> GSM573785 3 0.0260 0.992 0.000 0.000 0.992 0.000 0.008 0.000
#> GSM573744 4 0.0000 0.863 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM573745 4 0.0000 0.863 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM573746 4 0.0000 0.863 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM573747 4 0.0000 0.863 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM573748 4 0.0000 0.863 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM573749 4 0.0000 0.863 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM573753 4 0.3659 0.755 0.000 0.000 0.000 0.636 0.000 0.364
#> GSM573754 4 0.3672 0.753 0.000 0.000 0.000 0.632 0.000 0.368
#> GSM573755 4 0.3684 0.750 0.000 0.000 0.000 0.628 0.000 0.372
#> GSM573750 4 0.3647 0.756 0.000 0.000 0.000 0.640 0.000 0.360
#> GSM573751 4 0.3647 0.756 0.000 0.000 0.000 0.640 0.000 0.360
#> GSM573752 4 0.3634 0.758 0.000 0.000 0.000 0.644 0.000 0.356
#> GSM573795 4 0.4176 0.722 0.000 0.000 0.000 0.580 0.016 0.404
#> GSM573796 4 0.4176 0.722 0.000 0.000 0.000 0.580 0.016 0.404
#> GSM573797 4 0.4176 0.722 0.000 0.000 0.000 0.580 0.016 0.404
#> GSM573741 4 0.0000 0.863 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM573742 4 0.0000 0.863 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM573743 4 0.0000 0.863 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM573738 4 0.0000 0.863 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM573739 4 0.0000 0.863 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM573740 4 0.0000 0.863 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM573792 4 0.0405 0.859 0.000 0.000 0.000 0.988 0.004 0.008
#> GSM573793 4 0.0291 0.860 0.000 0.000 0.000 0.992 0.004 0.004
#> GSM573794 4 0.0291 0.860 0.000 0.000 0.000 0.992 0.004 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)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
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)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
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:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.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")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
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 cell.line(p) agent(p) k
#> MAD:skmeans 96 1.13e-20 0.843 2
#> MAD:skmeans 96 9.56e-39 0.741 3
#> MAD:skmeans 96 9.14e-57 0.975 4
#> MAD:skmeans 96 1.55e-54 0.176 5
#> MAD:skmeans 96 1.55e-54 0.176 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.
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 46609 rows and 96 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'MAD' method.
#> Subgroups are detected by 'pam' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 6.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.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:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).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)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 0.853 0.915 0.963 0.4569 0.558 0.558
#> 3 3 0.984 0.942 0.978 0.4258 0.765 0.589
#> 4 4 1.000 1.000 1.000 0.1639 0.856 0.610
#> 5 5 1.000 1.000 1.000 0.0390 0.970 0.878
#> 6 6 0.947 0.963 0.968 0.0333 0.976 0.889
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 6
#> attr(,"optional")
#> [1] 3 4 5
There is also optional best \(k\) = 3 4 5 that is worth to check.
Following shows the table of the partitions (You need to click the show/hide
code output link to see it). The membership matrix (columns with name p*
)
is inferred by
clue::cl_consensus()
function with the SE
method. Basically the value in the membership matrix
represents the probability to belong to a certain group. The finall class
label for an item is determined with the group with highest probability it
belongs to.
In get_classes()
function, the entropy is calculated from the membership
matrix and the silhouette score is calculated from the consensus matrix.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> GSM573726 1 0.0000 0.9520 1.000 0.000
#> GSM573727 1 0.0000 0.9520 1.000 0.000
#> GSM573728 1 0.0000 0.9520 1.000 0.000
#> GSM573729 1 0.0000 0.9520 1.000 0.000
#> GSM573730 1 0.0000 0.9520 1.000 0.000
#> GSM573731 1 0.0000 0.9520 1.000 0.000
#> GSM573735 1 0.0000 0.9520 1.000 0.000
#> GSM573736 1 0.0000 0.9520 1.000 0.000
#> GSM573737 1 0.0000 0.9520 1.000 0.000
#> GSM573732 1 0.0000 0.9520 1.000 0.000
#> GSM573733 1 0.0000 0.9520 1.000 0.000
#> GSM573734 1 0.0000 0.9520 1.000 0.000
#> GSM573789 1 0.0000 0.9520 1.000 0.000
#> GSM573790 1 0.0000 0.9520 1.000 0.000
#> GSM573791 1 0.0000 0.9520 1.000 0.000
#> GSM573723 1 0.0000 0.9520 1.000 0.000
#> GSM573724 1 0.0000 0.9520 1.000 0.000
#> GSM573725 1 0.0000 0.9520 1.000 0.000
#> GSM573720 1 0.0000 0.9520 1.000 0.000
#> GSM573721 1 0.0000 0.9520 1.000 0.000
#> GSM573722 1 0.0000 0.9520 1.000 0.000
#> GSM573786 1 0.0000 0.9520 1.000 0.000
#> GSM573787 1 0.0000 0.9520 1.000 0.000
#> GSM573788 1 0.0000 0.9520 1.000 0.000
#> GSM573768 2 0.0000 0.9783 0.000 1.000
#> GSM573769 2 0.0000 0.9783 0.000 1.000
#> GSM573770 2 0.0000 0.9783 0.000 1.000
#> GSM573765 2 0.0000 0.9783 0.000 1.000
#> GSM573766 2 0.0000 0.9783 0.000 1.000
#> GSM573767 2 0.0000 0.9783 0.000 1.000
#> GSM573777 2 0.0000 0.9783 0.000 1.000
#> GSM573778 2 0.0000 0.9783 0.000 1.000
#> GSM573779 2 0.0000 0.9783 0.000 1.000
#> GSM573762 2 0.0000 0.9783 0.000 1.000
#> GSM573763 2 0.0000 0.9783 0.000 1.000
#> GSM573764 2 0.0000 0.9783 0.000 1.000
#> GSM573771 2 0.0000 0.9783 0.000 1.000
#> GSM573772 2 0.0000 0.9783 0.000 1.000
#> GSM573773 2 0.0000 0.9783 0.000 1.000
#> GSM573759 2 0.0000 0.9783 0.000 1.000
#> GSM573760 2 0.0000 0.9783 0.000 1.000
#> GSM573761 2 0.0000 0.9783 0.000 1.000
#> GSM573774 2 0.0000 0.9783 0.000 1.000
#> GSM573775 2 0.0000 0.9783 0.000 1.000
#> GSM573776 2 0.0000 0.9783 0.000 1.000
#> GSM573756 2 0.0000 0.9783 0.000 1.000
#> GSM573757 2 0.0000 0.9783 0.000 1.000
#> GSM573758 2 0.0000 0.9783 0.000 1.000
#> GSM573708 1 0.9754 0.3380 0.592 0.408
#> GSM573709 1 0.4022 0.8894 0.920 0.080
#> GSM573710 2 0.9963 0.0902 0.464 0.536
#> GSM573711 1 0.6531 0.7966 0.832 0.168
#> GSM573712 1 0.5178 0.8555 0.884 0.116
#> GSM573713 1 0.9460 0.4529 0.636 0.364
#> GSM573717 1 0.0000 0.9520 1.000 0.000
#> GSM573718 1 0.0000 0.9520 1.000 0.000
#> GSM573719 1 0.0000 0.9520 1.000 0.000
#> GSM573714 1 0.0000 0.9520 1.000 0.000
#> GSM573715 1 0.0000 0.9520 1.000 0.000
#> GSM573716 1 0.0000 0.9520 1.000 0.000
#> GSM573780 2 0.2603 0.9383 0.044 0.956
#> GSM573781 2 0.2236 0.9464 0.036 0.964
#> GSM573782 2 0.3733 0.9076 0.072 0.928
#> GSM573705 1 0.0000 0.9520 1.000 0.000
#> GSM573706 1 0.0000 0.9520 1.000 0.000
#> GSM573707 1 0.0000 0.9520 1.000 0.000
#> GSM573702 1 0.0000 0.9520 1.000 0.000
#> GSM573703 1 0.0000 0.9520 1.000 0.000
#> GSM573704 1 0.0000 0.9520 1.000 0.000
#> GSM573783 1 0.0000 0.9520 1.000 0.000
#> GSM573784 1 0.0000 0.9520 1.000 0.000
#> GSM573785 1 0.0000 0.9520 1.000 0.000
#> GSM573744 1 0.0672 0.9472 0.992 0.008
#> GSM573745 1 0.0000 0.9520 1.000 0.000
#> GSM573746 1 0.0376 0.9498 0.996 0.004
#> GSM573747 1 0.0376 0.9498 0.996 0.004
#> GSM573748 1 0.0376 0.9498 0.996 0.004
#> GSM573749 1 0.1184 0.9418 0.984 0.016
#> GSM573753 1 0.7453 0.7498 0.788 0.212
#> GSM573754 1 0.9580 0.4551 0.620 0.380
#> GSM573755 1 0.9044 0.5827 0.680 0.320
#> GSM573750 1 0.7602 0.7392 0.780 0.220
#> GSM573751 1 0.7528 0.7446 0.784 0.216
#> GSM573752 1 0.7453 0.7494 0.788 0.212
#> GSM573795 2 0.0000 0.9783 0.000 1.000
#> GSM573796 2 0.0000 0.9783 0.000 1.000
#> GSM573797 2 0.0000 0.9783 0.000 1.000
#> GSM573741 1 0.0000 0.9520 1.000 0.000
#> GSM573742 1 0.0000 0.9520 1.000 0.000
#> GSM573743 1 0.0000 0.9520 1.000 0.000
#> GSM573738 1 0.0000 0.9520 1.000 0.000
#> GSM573739 1 0.0000 0.9520 1.000 0.000
#> GSM573740 1 0.0000 0.9520 1.000 0.000
#> GSM573792 1 0.7745 0.7300 0.772 0.228
#> GSM573793 1 0.0376 0.9497 0.996 0.004
#> GSM573794 1 0.1184 0.9418 0.984 0.016
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM573726 3 0.000 0.963 0 0.000 1.000
#> GSM573727 3 0.000 0.963 0 0.000 1.000
#> GSM573728 3 0.000 0.963 0 0.000 1.000
#> GSM573729 3 0.000 0.963 0 0.000 1.000
#> GSM573730 3 0.000 0.963 0 0.000 1.000
#> GSM573731 3 0.000 0.963 0 0.000 1.000
#> GSM573735 3 0.000 0.963 0 0.000 1.000
#> GSM573736 3 0.000 0.963 0 0.000 1.000
#> GSM573737 3 0.000 0.963 0 0.000 1.000
#> GSM573732 3 0.000 0.963 0 0.000 1.000
#> GSM573733 3 0.000 0.963 0 0.000 1.000
#> GSM573734 3 0.000 0.963 0 0.000 1.000
#> GSM573789 3 0.000 0.963 0 0.000 1.000
#> GSM573790 3 0.000 0.963 0 0.000 1.000
#> GSM573791 3 0.000 0.963 0 0.000 1.000
#> GSM573723 3 0.000 0.963 0 0.000 1.000
#> GSM573724 3 0.000 0.963 0 0.000 1.000
#> GSM573725 3 0.000 0.963 0 0.000 1.000
#> GSM573720 3 0.000 0.963 0 0.000 1.000
#> GSM573721 3 0.000 0.963 0 0.000 1.000
#> GSM573722 3 0.000 0.963 0 0.000 1.000
#> GSM573786 3 0.000 0.963 0 0.000 1.000
#> GSM573787 3 0.000 0.963 0 0.000 1.000
#> GSM573788 3 0.000 0.963 0 0.000 1.000
#> GSM573768 2 0.000 0.975 0 1.000 0.000
#> GSM573769 2 0.000 0.975 0 1.000 0.000
#> GSM573770 2 0.000 0.975 0 1.000 0.000
#> GSM573765 2 0.000 0.975 0 1.000 0.000
#> GSM573766 2 0.000 0.975 0 1.000 0.000
#> GSM573767 2 0.000 0.975 0 1.000 0.000
#> GSM573777 2 0.000 0.975 0 1.000 0.000
#> GSM573778 2 0.000 0.975 0 1.000 0.000
#> GSM573779 2 0.000 0.975 0 1.000 0.000
#> GSM573762 2 0.000 0.975 0 1.000 0.000
#> GSM573763 2 0.000 0.975 0 1.000 0.000
#> GSM573764 2 0.000 0.975 0 1.000 0.000
#> GSM573771 2 0.000 0.975 0 1.000 0.000
#> GSM573772 2 0.000 0.975 0 1.000 0.000
#> GSM573773 2 0.000 0.975 0 1.000 0.000
#> GSM573759 2 0.000 0.975 0 1.000 0.000
#> GSM573760 2 0.000 0.975 0 1.000 0.000
#> GSM573761 2 0.000 0.975 0 1.000 0.000
#> GSM573774 2 0.000 0.975 0 1.000 0.000
#> GSM573775 2 0.000 0.975 0 1.000 0.000
#> GSM573776 2 0.000 0.975 0 1.000 0.000
#> GSM573756 2 0.000 0.975 0 1.000 0.000
#> GSM573757 2 0.000 0.975 0 1.000 0.000
#> GSM573758 2 0.000 0.975 0 1.000 0.000
#> GSM573708 3 0.627 0.197 0 0.452 0.548
#> GSM573709 3 0.394 0.802 0 0.156 0.844
#> GSM573710 2 0.622 0.189 0 0.568 0.432
#> GSM573711 3 0.493 0.697 0 0.232 0.768
#> GSM573712 3 0.493 0.697 0 0.232 0.768
#> GSM573713 3 0.630 0.128 0 0.472 0.528
#> GSM573717 3 0.000 0.963 0 0.000 1.000
#> GSM573718 3 0.000 0.963 0 0.000 1.000
#> GSM573719 3 0.000 0.963 0 0.000 1.000
#> GSM573714 3 0.000 0.963 0 0.000 1.000
#> GSM573715 3 0.000 0.963 0 0.000 1.000
#> GSM573716 3 0.000 0.963 0 0.000 1.000
#> GSM573780 2 0.186 0.926 0 0.948 0.052
#> GSM573781 2 0.129 0.946 0 0.968 0.032
#> GSM573782 2 0.236 0.905 0 0.928 0.072
#> GSM573705 3 0.000 0.963 0 0.000 1.000
#> GSM573706 3 0.000 0.963 0 0.000 1.000
#> GSM573707 3 0.000 0.963 0 0.000 1.000
#> GSM573702 3 0.000 0.963 0 0.000 1.000
#> GSM573703 3 0.000 0.963 0 0.000 1.000
#> GSM573704 3 0.000 0.963 0 0.000 1.000
#> GSM573783 3 0.000 0.963 0 0.000 1.000
#> GSM573784 3 0.000 0.963 0 0.000 1.000
#> GSM573785 3 0.000 0.963 0 0.000 1.000
#> GSM573744 1 0.000 1.000 1 0.000 0.000
#> GSM573745 1 0.000 1.000 1 0.000 0.000
#> GSM573746 1 0.000 1.000 1 0.000 0.000
#> GSM573747 1 0.000 1.000 1 0.000 0.000
#> GSM573748 1 0.000 1.000 1 0.000 0.000
#> GSM573749 1 0.000 1.000 1 0.000 0.000
#> GSM573753 1 0.000 1.000 1 0.000 0.000
#> GSM573754 1 0.000 1.000 1 0.000 0.000
#> GSM573755 1 0.000 1.000 1 0.000 0.000
#> GSM573750 1 0.000 1.000 1 0.000 0.000
#> GSM573751 1 0.000 1.000 1 0.000 0.000
#> GSM573752 1 0.000 1.000 1 0.000 0.000
#> GSM573795 1 0.000 1.000 1 0.000 0.000
#> GSM573796 1 0.000 1.000 1 0.000 0.000
#> GSM573797 1 0.000 1.000 1 0.000 0.000
#> GSM573741 1 0.000 1.000 1 0.000 0.000
#> GSM573742 1 0.000 1.000 1 0.000 0.000
#> GSM573743 1 0.000 1.000 1 0.000 0.000
#> GSM573738 1 0.000 1.000 1 0.000 0.000
#> GSM573739 1 0.000 1.000 1 0.000 0.000
#> GSM573740 1 0.000 1.000 1 0.000 0.000
#> GSM573792 1 0.000 1.000 1 0.000 0.000
#> GSM573793 1 0.000 1.000 1 0.000 0.000
#> GSM573794 1 0.000 1.000 1 0.000 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM573726 1 0 1 1 0 0 0
#> GSM573727 1 0 1 1 0 0 0
#> GSM573728 1 0 1 1 0 0 0
#> GSM573729 1 0 1 1 0 0 0
#> GSM573730 1 0 1 1 0 0 0
#> GSM573731 1 0 1 1 0 0 0
#> GSM573735 1 0 1 1 0 0 0
#> GSM573736 1 0 1 1 0 0 0
#> GSM573737 1 0 1 1 0 0 0
#> GSM573732 1 0 1 1 0 0 0
#> GSM573733 1 0 1 1 0 0 0
#> GSM573734 1 0 1 1 0 0 0
#> GSM573789 1 0 1 1 0 0 0
#> GSM573790 1 0 1 1 0 0 0
#> GSM573791 1 0 1 1 0 0 0
#> GSM573723 1 0 1 1 0 0 0
#> GSM573724 1 0 1 1 0 0 0
#> GSM573725 1 0 1 1 0 0 0
#> GSM573720 1 0 1 1 0 0 0
#> GSM573721 1 0 1 1 0 0 0
#> GSM573722 1 0 1 1 0 0 0
#> GSM573786 1 0 1 1 0 0 0
#> GSM573787 1 0 1 1 0 0 0
#> GSM573788 1 0 1 1 0 0 0
#> GSM573768 2 0 1 0 1 0 0
#> GSM573769 2 0 1 0 1 0 0
#> GSM573770 2 0 1 0 1 0 0
#> GSM573765 2 0 1 0 1 0 0
#> GSM573766 2 0 1 0 1 0 0
#> GSM573767 2 0 1 0 1 0 0
#> GSM573777 2 0 1 0 1 0 0
#> GSM573778 2 0 1 0 1 0 0
#> GSM573779 2 0 1 0 1 0 0
#> GSM573762 2 0 1 0 1 0 0
#> GSM573763 2 0 1 0 1 0 0
#> GSM573764 2 0 1 0 1 0 0
#> GSM573771 2 0 1 0 1 0 0
#> GSM573772 2 0 1 0 1 0 0
#> GSM573773 2 0 1 0 1 0 0
#> GSM573759 2 0 1 0 1 0 0
#> GSM573760 2 0 1 0 1 0 0
#> GSM573761 2 0 1 0 1 0 0
#> GSM573774 2 0 1 0 1 0 0
#> GSM573775 2 0 1 0 1 0 0
#> GSM573776 2 0 1 0 1 0 0
#> GSM573756 2 0 1 0 1 0 0
#> GSM573757 2 0 1 0 1 0 0
#> GSM573758 2 0 1 0 1 0 0
#> GSM573708 3 0 1 0 0 1 0
#> GSM573709 3 0 1 0 0 1 0
#> GSM573710 3 0 1 0 0 1 0
#> GSM573711 3 0 1 0 0 1 0
#> GSM573712 3 0 1 0 0 1 0
#> GSM573713 3 0 1 0 0 1 0
#> GSM573717 3 0 1 0 0 1 0
#> GSM573718 3 0 1 0 0 1 0
#> GSM573719 3 0 1 0 0 1 0
#> GSM573714 3 0 1 0 0 1 0
#> GSM573715 3 0 1 0 0 1 0
#> GSM573716 3 0 1 0 0 1 0
#> GSM573780 3 0 1 0 0 1 0
#> GSM573781 3 0 1 0 0 1 0
#> GSM573782 3 0 1 0 0 1 0
#> GSM573705 3 0 1 0 0 1 0
#> GSM573706 3 0 1 0 0 1 0
#> GSM573707 3 0 1 0 0 1 0
#> GSM573702 3 0 1 0 0 1 0
#> GSM573703 3 0 1 0 0 1 0
#> GSM573704 3 0 1 0 0 1 0
#> GSM573783 3 0 1 0 0 1 0
#> GSM573784 3 0 1 0 0 1 0
#> GSM573785 3 0 1 0 0 1 0
#> GSM573744 4 0 1 0 0 0 1
#> GSM573745 4 0 1 0 0 0 1
#> GSM573746 4 0 1 0 0 0 1
#> GSM573747 4 0 1 0 0 0 1
#> GSM573748 4 0 1 0 0 0 1
#> GSM573749 4 0 1 0 0 0 1
#> GSM573753 4 0 1 0 0 0 1
#> GSM573754 4 0 1 0 0 0 1
#> GSM573755 4 0 1 0 0 0 1
#> GSM573750 4 0 1 0 0 0 1
#> GSM573751 4 0 1 0 0 0 1
#> GSM573752 4 0 1 0 0 0 1
#> GSM573795 4 0 1 0 0 0 1
#> GSM573796 4 0 1 0 0 0 1
#> GSM573797 4 0 1 0 0 0 1
#> GSM573741 4 0 1 0 0 0 1
#> GSM573742 4 0 1 0 0 0 1
#> GSM573743 4 0 1 0 0 0 1
#> GSM573738 4 0 1 0 0 0 1
#> GSM573739 4 0 1 0 0 0 1
#> GSM573740 4 0 1 0 0 0 1
#> GSM573792 4 0 1 0 0 0 1
#> GSM573793 4 0 1 0 0 0 1
#> GSM573794 4 0 1 0 0 0 1
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM573726 1 0 1 1 0 0 0 0
#> GSM573727 1 0 1 1 0 0 0 0
#> GSM573728 1 0 1 1 0 0 0 0
#> GSM573729 1 0 1 1 0 0 0 0
#> GSM573730 1 0 1 1 0 0 0 0
#> GSM573731 1 0 1 1 0 0 0 0
#> GSM573735 1 0 1 1 0 0 0 0
#> GSM573736 1 0 1 1 0 0 0 0
#> GSM573737 1 0 1 1 0 0 0 0
#> GSM573732 1 0 1 1 0 0 0 0
#> GSM573733 1 0 1 1 0 0 0 0
#> GSM573734 1 0 1 1 0 0 0 0
#> GSM573789 1 0 1 1 0 0 0 0
#> GSM573790 1 0 1 1 0 0 0 0
#> GSM573791 1 0 1 1 0 0 0 0
#> GSM573723 1 0 1 1 0 0 0 0
#> GSM573724 1 0 1 1 0 0 0 0
#> GSM573725 1 0 1 1 0 0 0 0
#> GSM573720 1 0 1 1 0 0 0 0
#> GSM573721 1 0 1 1 0 0 0 0
#> GSM573722 1 0 1 1 0 0 0 0
#> GSM573786 1 0 1 1 0 0 0 0
#> GSM573787 1 0 1 1 0 0 0 0
#> GSM573788 1 0 1 1 0 0 0 0
#> GSM573768 2 0 1 0 1 0 0 0
#> GSM573769 2 0 1 0 1 0 0 0
#> GSM573770 2 0 1 0 1 0 0 0
#> GSM573765 2 0 1 0 1 0 0 0
#> GSM573766 2 0 1 0 1 0 0 0
#> GSM573767 2 0 1 0 1 0 0 0
#> GSM573777 2 0 1 0 1 0 0 0
#> GSM573778 2 0 1 0 1 0 0 0
#> GSM573779 2 0 1 0 1 0 0 0
#> GSM573762 2 0 1 0 1 0 0 0
#> GSM573763 2 0 1 0 1 0 0 0
#> GSM573764 2 0 1 0 1 0 0 0
#> GSM573771 2 0 1 0 1 0 0 0
#> GSM573772 2 0 1 0 1 0 0 0
#> GSM573773 2 0 1 0 1 0 0 0
#> GSM573759 2 0 1 0 1 0 0 0
#> GSM573760 2 0 1 0 1 0 0 0
#> GSM573761 2 0 1 0 1 0 0 0
#> GSM573774 2 0 1 0 1 0 0 0
#> GSM573775 2 0 1 0 1 0 0 0
#> GSM573776 2 0 1 0 1 0 0 0
#> GSM573756 2 0 1 0 1 0 0 0
#> GSM573757 2 0 1 0 1 0 0 0
#> GSM573758 2 0 1 0 1 0 0 0
#> GSM573708 5 0 1 0 0 0 0 1
#> GSM573709 5 0 1 0 0 0 0 1
#> GSM573710 5 0 1 0 0 0 0 1
#> GSM573711 5 0 1 0 0 0 0 1
#> GSM573712 5 0 1 0 0 0 0 1
#> GSM573713 5 0 1 0 0 0 0 1
#> GSM573717 3 0 1 0 0 1 0 0
#> GSM573718 3 0 1 0 0 1 0 0
#> GSM573719 3 0 1 0 0 1 0 0
#> GSM573714 3 0 1 0 0 1 0 0
#> GSM573715 3 0 1 0 0 1 0 0
#> GSM573716 3 0 1 0 0 1 0 0
#> GSM573780 5 0 1 0 0 0 0 1
#> GSM573781 5 0 1 0 0 0 0 1
#> GSM573782 5 0 1 0 0 0 0 1
#> GSM573705 3 0 1 0 0 1 0 0
#> GSM573706 3 0 1 0 0 1 0 0
#> GSM573707 3 0 1 0 0 1 0 0
#> GSM573702 3 0 1 0 0 1 0 0
#> GSM573703 3 0 1 0 0 1 0 0
#> GSM573704 3 0 1 0 0 1 0 0
#> GSM573783 3 0 1 0 0 1 0 0
#> GSM573784 3 0 1 0 0 1 0 0
#> GSM573785 3 0 1 0 0 1 0 0
#> GSM573744 4 0 1 0 0 0 1 0
#> GSM573745 4 0 1 0 0 0 1 0
#> GSM573746 4 0 1 0 0 0 1 0
#> GSM573747 4 0 1 0 0 0 1 0
#> GSM573748 4 0 1 0 0 0 1 0
#> GSM573749 4 0 1 0 0 0 1 0
#> GSM573753 4 0 1 0 0 0 1 0
#> GSM573754 4 0 1 0 0 0 1 0
#> GSM573755 4 0 1 0 0 0 1 0
#> GSM573750 4 0 1 0 0 0 1 0
#> GSM573751 4 0 1 0 0 0 1 0
#> GSM573752 4 0 1 0 0 0 1 0
#> GSM573795 4 0 1 0 0 0 1 0
#> GSM573796 4 0 1 0 0 0 1 0
#> GSM573797 4 0 1 0 0 0 1 0
#> GSM573741 4 0 1 0 0 0 1 0
#> GSM573742 4 0 1 0 0 0 1 0
#> GSM573743 4 0 1 0 0 0 1 0
#> GSM573738 4 0 1 0 0 0 1 0
#> GSM573739 4 0 1 0 0 0 1 0
#> GSM573740 4 0 1 0 0 0 1 0
#> GSM573792 4 0 1 0 0 0 1 0
#> GSM573793 4 0 1 0 0 0 1 0
#> GSM573794 4 0 1 0 0 0 1 0
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM573726 1 0.000 0.941 1.000 0.000 0 0 0 0.000
#> GSM573727 1 0.000 0.941 1.000 0.000 0 0 0 0.000
#> GSM573728 1 0.000 0.941 1.000 0.000 0 0 0 0.000
#> GSM573729 1 0.000 0.941 1.000 0.000 0 0 0 0.000
#> GSM573730 1 0.000 0.941 1.000 0.000 0 0 0 0.000
#> GSM573731 1 0.000 0.941 1.000 0.000 0 0 0 0.000
#> GSM573735 6 0.200 1.000 0.116 0.000 0 0 0 0.884
#> GSM573736 6 0.200 1.000 0.116 0.000 0 0 0 0.884
#> GSM573737 6 0.200 1.000 0.116 0.000 0 0 0 0.884
#> GSM573732 6 0.200 1.000 0.116 0.000 0 0 0 0.884
#> GSM573733 6 0.200 1.000 0.116 0.000 0 0 0 0.884
#> GSM573734 6 0.200 1.000 0.116 0.000 0 0 0 0.884
#> GSM573789 1 0.367 0.338 0.632 0.000 0 0 0 0.368
#> GSM573790 1 0.273 0.726 0.808 0.000 0 0 0 0.192
#> GSM573791 1 0.345 0.512 0.692 0.000 0 0 0 0.308
#> GSM573723 1 0.000 0.941 1.000 0.000 0 0 0 0.000
#> GSM573724 1 0.000 0.941 1.000 0.000 0 0 0 0.000
#> GSM573725 1 0.000 0.941 1.000 0.000 0 0 0 0.000
#> GSM573720 1 0.000 0.941 1.000 0.000 0 0 0 0.000
#> GSM573721 1 0.000 0.941 1.000 0.000 0 0 0 0.000
#> GSM573722 1 0.000 0.941 1.000 0.000 0 0 0 0.000
#> GSM573786 1 0.000 0.941 1.000 0.000 0 0 0 0.000
#> GSM573787 1 0.000 0.941 1.000 0.000 0 0 0 0.000
#> GSM573788 1 0.000 0.941 1.000 0.000 0 0 0 0.000
#> GSM573768 2 0.000 0.959 0.000 1.000 0 0 0 0.000
#> GSM573769 2 0.000 0.959 0.000 1.000 0 0 0 0.000
#> GSM573770 2 0.000 0.959 0.000 1.000 0 0 0 0.000
#> GSM573765 2 0.000 0.959 0.000 1.000 0 0 0 0.000
#> GSM573766 2 0.000 0.959 0.000 1.000 0 0 0 0.000
#> GSM573767 2 0.000 0.959 0.000 1.000 0 0 0 0.000
#> GSM573777 2 0.200 0.929 0.000 0.884 0 0 0 0.116
#> GSM573778 2 0.200 0.929 0.000 0.884 0 0 0 0.116
#> GSM573779 2 0.200 0.929 0.000 0.884 0 0 0 0.116
#> GSM573762 2 0.200 0.929 0.000 0.884 0 0 0 0.116
#> GSM573763 2 0.200 0.929 0.000 0.884 0 0 0 0.116
#> GSM573764 2 0.200 0.929 0.000 0.884 0 0 0 0.116
#> GSM573771 2 0.200 0.929 0.000 0.884 0 0 0 0.116
#> GSM573772 2 0.200 0.929 0.000 0.884 0 0 0 0.116
#> GSM573773 2 0.200 0.929 0.000 0.884 0 0 0 0.116
#> GSM573759 2 0.000 0.959 0.000 1.000 0 0 0 0.000
#> GSM573760 2 0.000 0.959 0.000 1.000 0 0 0 0.000
#> GSM573761 2 0.000 0.959 0.000 1.000 0 0 0 0.000
#> GSM573774 2 0.000 0.959 0.000 1.000 0 0 0 0.000
#> GSM573775 2 0.000 0.959 0.000 1.000 0 0 0 0.000
#> GSM573776 2 0.000 0.959 0.000 1.000 0 0 0 0.000
#> GSM573756 2 0.000 0.959 0.000 1.000 0 0 0 0.000
#> GSM573757 2 0.000 0.959 0.000 1.000 0 0 0 0.000
#> GSM573758 2 0.000 0.959 0.000 1.000 0 0 0 0.000
#> GSM573708 5 0.000 1.000 0.000 0.000 0 0 1 0.000
#> GSM573709 5 0.000 1.000 0.000 0.000 0 0 1 0.000
#> GSM573710 5 0.000 1.000 0.000 0.000 0 0 1 0.000
#> GSM573711 5 0.000 1.000 0.000 0.000 0 0 1 0.000
#> GSM573712 5 0.000 1.000 0.000 0.000 0 0 1 0.000
#> GSM573713 5 0.000 1.000 0.000 0.000 0 0 1 0.000
#> GSM573717 3 0.000 1.000 0.000 0.000 1 0 0 0.000
#> GSM573718 3 0.000 1.000 0.000 0.000 1 0 0 0.000
#> GSM573719 3 0.000 1.000 0.000 0.000 1 0 0 0.000
#> GSM573714 3 0.000 1.000 0.000 0.000 1 0 0 0.000
#> GSM573715 3 0.000 1.000 0.000 0.000 1 0 0 0.000
#> GSM573716 3 0.000 1.000 0.000 0.000 1 0 0 0.000
#> GSM573780 5 0.000 1.000 0.000 0.000 0 0 1 0.000
#> GSM573781 5 0.000 1.000 0.000 0.000 0 0 1 0.000
#> GSM573782 5 0.000 1.000 0.000 0.000 0 0 1 0.000
#> GSM573705 3 0.000 1.000 0.000 0.000 1 0 0 0.000
#> GSM573706 3 0.000 1.000 0.000 0.000 1 0 0 0.000
#> GSM573707 3 0.000 1.000 0.000 0.000 1 0 0 0.000
#> GSM573702 3 0.000 1.000 0.000 0.000 1 0 0 0.000
#> GSM573703 3 0.000 1.000 0.000 0.000 1 0 0 0.000
#> GSM573704 3 0.000 1.000 0.000 0.000 1 0 0 0.000
#> GSM573783 3 0.000 1.000 0.000 0.000 1 0 0 0.000
#> GSM573784 3 0.000 1.000 0.000 0.000 1 0 0 0.000
#> GSM573785 3 0.000 1.000 0.000 0.000 1 0 0 0.000
#> GSM573744 4 0.000 1.000 0.000 0.000 0 1 0 0.000
#> GSM573745 4 0.000 1.000 0.000 0.000 0 1 0 0.000
#> GSM573746 4 0.000 1.000 0.000 0.000 0 1 0 0.000
#> GSM573747 4 0.000 1.000 0.000 0.000 0 1 0 0.000
#> GSM573748 4 0.000 1.000 0.000 0.000 0 1 0 0.000
#> GSM573749 4 0.000 1.000 0.000 0.000 0 1 0 0.000
#> GSM573753 4 0.000 1.000 0.000 0.000 0 1 0 0.000
#> GSM573754 4 0.000 1.000 0.000 0.000 0 1 0 0.000
#> GSM573755 4 0.000 1.000 0.000 0.000 0 1 0 0.000
#> GSM573750 4 0.000 1.000 0.000 0.000 0 1 0 0.000
#> GSM573751 4 0.000 1.000 0.000 0.000 0 1 0 0.000
#> GSM573752 4 0.000 1.000 0.000 0.000 0 1 0 0.000
#> GSM573795 4 0.000 1.000 0.000 0.000 0 1 0 0.000
#> GSM573796 4 0.000 1.000 0.000 0.000 0 1 0 0.000
#> GSM573797 4 0.000 1.000 0.000 0.000 0 1 0 0.000
#> GSM573741 4 0.000 1.000 0.000 0.000 0 1 0 0.000
#> GSM573742 4 0.000 1.000 0.000 0.000 0 1 0 0.000
#> GSM573743 4 0.000 1.000 0.000 0.000 0 1 0 0.000
#> GSM573738 4 0.000 1.000 0.000 0.000 0 1 0 0.000
#> GSM573739 4 0.000 1.000 0.000 0.000 0 1 0 0.000
#> GSM573740 4 0.000 1.000 0.000 0.000 0 1 0 0.000
#> GSM573792 4 0.000 1.000 0.000 0.000 0 1 0 0.000
#> GSM573793 4 0.000 1.000 0.000 0.000 0 1 0 0.000
#> GSM573794 4 0.000 1.000 0.000 0.000 0 1 0 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)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
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)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
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:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.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")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
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 cell.line(p) agent(p) k
#> MAD:pam 92 9.27e-15 0.00522 2
#> MAD:pam 93 2.22e-34 0.51983 3
#> MAD:pam 96 9.14e-57 0.97496 4
#> MAD:pam 96 1.55e-54 0.17576 5
#> MAD:pam 95 7.26e-52 0.00673 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.
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 46609 rows and 96 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 5.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.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:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).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)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 0.368 0.873 0.890 0.4878 0.495 0.495
#> 3 3 0.747 0.932 0.945 0.2955 0.621 0.390
#> 4 4 1.000 1.000 1.000 0.1997 0.874 0.657
#> 5 5 1.000 0.982 0.983 0.0211 0.982 0.928
#> 6 6 0.968 0.948 0.958 0.0110 1.000 1.000
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 5
#> attr(,"optional")
#> [1] 4
There is also optional best \(k\) = 4 that is worth to check.
Following shows the table of the partitions (You need to click the show/hide
code output link to see it). The membership matrix (columns with name p*
)
is inferred by
clue::cl_consensus()
function with the SE
method. Basically the value in the membership matrix
represents the probability to belong to a certain group. The finall class
label for an item is determined with the group with highest probability it
belongs to.
In get_classes()
function, the entropy is calculated from the membership
matrix and the silhouette score is calculated from the consensus matrix.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> GSM573726 1 0.563 0.910 0.868 0.132
#> GSM573727 1 0.563 0.910 0.868 0.132
#> GSM573728 1 0.563 0.910 0.868 0.132
#> GSM573729 1 0.563 0.910 0.868 0.132
#> GSM573730 1 0.563 0.910 0.868 0.132
#> GSM573731 1 0.563 0.910 0.868 0.132
#> GSM573735 1 0.563 0.910 0.868 0.132
#> GSM573736 1 0.563 0.910 0.868 0.132
#> GSM573737 1 0.563 0.910 0.868 0.132
#> GSM573732 1 0.563 0.910 0.868 0.132
#> GSM573733 1 0.563 0.910 0.868 0.132
#> GSM573734 1 0.563 0.910 0.868 0.132
#> GSM573789 1 0.563 0.910 0.868 0.132
#> GSM573790 1 0.563 0.910 0.868 0.132
#> GSM573791 1 0.563 0.910 0.868 0.132
#> GSM573723 1 0.563 0.910 0.868 0.132
#> GSM573724 1 0.563 0.910 0.868 0.132
#> GSM573725 1 0.563 0.910 0.868 0.132
#> GSM573720 1 0.563 0.910 0.868 0.132
#> GSM573721 1 0.563 0.910 0.868 0.132
#> GSM573722 1 0.563 0.910 0.868 0.132
#> GSM573786 1 0.563 0.910 0.868 0.132
#> GSM573787 1 0.563 0.910 0.868 0.132
#> GSM573788 1 0.563 0.910 0.868 0.132
#> GSM573768 2 0.000 0.844 0.000 1.000
#> GSM573769 2 0.000 0.844 0.000 1.000
#> GSM573770 2 0.000 0.844 0.000 1.000
#> GSM573765 2 0.000 0.844 0.000 1.000
#> GSM573766 2 0.000 0.844 0.000 1.000
#> GSM573767 2 0.000 0.844 0.000 1.000
#> GSM573777 2 0.000 0.844 0.000 1.000
#> GSM573778 2 0.000 0.844 0.000 1.000
#> GSM573779 2 0.000 0.844 0.000 1.000
#> GSM573762 2 0.000 0.844 0.000 1.000
#> GSM573763 2 0.000 0.844 0.000 1.000
#> GSM573764 2 0.000 0.844 0.000 1.000
#> GSM573771 2 0.000 0.844 0.000 1.000
#> GSM573772 2 0.000 0.844 0.000 1.000
#> GSM573773 2 0.000 0.844 0.000 1.000
#> GSM573759 2 0.000 0.844 0.000 1.000
#> GSM573760 2 0.000 0.844 0.000 1.000
#> GSM573761 2 0.000 0.844 0.000 1.000
#> GSM573774 2 0.000 0.844 0.000 1.000
#> GSM573775 2 0.000 0.844 0.000 1.000
#> GSM573776 2 0.000 0.844 0.000 1.000
#> GSM573756 2 0.000 0.844 0.000 1.000
#> GSM573757 2 0.000 0.844 0.000 1.000
#> GSM573758 2 0.000 0.844 0.000 1.000
#> GSM573708 1 0.118 0.911 0.984 0.016
#> GSM573709 1 0.118 0.911 0.984 0.016
#> GSM573710 1 0.118 0.911 0.984 0.016
#> GSM573711 1 0.118 0.911 0.984 0.016
#> GSM573712 1 0.118 0.911 0.984 0.016
#> GSM573713 1 0.118 0.911 0.984 0.016
#> GSM573717 1 0.118 0.911 0.984 0.016
#> GSM573718 1 0.118 0.911 0.984 0.016
#> GSM573719 1 0.118 0.911 0.984 0.016
#> GSM573714 1 0.118 0.911 0.984 0.016
#> GSM573715 1 0.118 0.911 0.984 0.016
#> GSM573716 1 0.118 0.911 0.984 0.016
#> GSM573780 1 0.118 0.911 0.984 0.016
#> GSM573781 1 0.118 0.911 0.984 0.016
#> GSM573782 1 0.118 0.911 0.984 0.016
#> GSM573705 1 0.118 0.911 0.984 0.016
#> GSM573706 1 0.118 0.911 0.984 0.016
#> GSM573707 1 0.118 0.911 0.984 0.016
#> GSM573702 1 0.118 0.911 0.984 0.016
#> GSM573703 1 0.118 0.911 0.984 0.016
#> GSM573704 1 0.118 0.911 0.984 0.016
#> GSM573783 1 0.118 0.911 0.984 0.016
#> GSM573784 1 0.118 0.911 0.984 0.016
#> GSM573785 1 0.118 0.911 0.984 0.016
#> GSM573744 2 0.871 0.825 0.292 0.708
#> GSM573745 2 0.871 0.825 0.292 0.708
#> GSM573746 2 0.871 0.825 0.292 0.708
#> GSM573747 2 0.871 0.825 0.292 0.708
#> GSM573748 2 0.871 0.825 0.292 0.708
#> GSM573749 2 0.871 0.825 0.292 0.708
#> GSM573753 2 0.871 0.825 0.292 0.708
#> GSM573754 2 0.871 0.825 0.292 0.708
#> GSM573755 2 0.871 0.825 0.292 0.708
#> GSM573750 2 0.871 0.825 0.292 0.708
#> GSM573751 2 0.871 0.825 0.292 0.708
#> GSM573752 2 0.871 0.825 0.292 0.708
#> GSM573795 2 0.871 0.825 0.292 0.708
#> GSM573796 2 0.871 0.825 0.292 0.708
#> GSM573797 2 0.871 0.825 0.292 0.708
#> GSM573741 2 0.871 0.825 0.292 0.708
#> GSM573742 2 0.871 0.825 0.292 0.708
#> GSM573743 2 0.871 0.825 0.292 0.708
#> GSM573738 2 0.871 0.825 0.292 0.708
#> GSM573739 2 0.871 0.825 0.292 0.708
#> GSM573740 2 0.871 0.825 0.292 0.708
#> GSM573792 2 0.871 0.825 0.292 0.708
#> GSM573793 2 0.871 0.825 0.292 0.708
#> GSM573794 2 0.871 0.825 0.292 0.708
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM573726 1 0.00 1.000 1.00 0 0.00
#> GSM573727 1 0.00 1.000 1.00 0 0.00
#> GSM573728 1 0.00 1.000 1.00 0 0.00
#> GSM573729 1 0.00 1.000 1.00 0 0.00
#> GSM573730 1 0.00 1.000 1.00 0 0.00
#> GSM573731 1 0.00 1.000 1.00 0 0.00
#> GSM573735 1 0.00 1.000 1.00 0 0.00
#> GSM573736 1 0.00 1.000 1.00 0 0.00
#> GSM573737 1 0.00 1.000 1.00 0 0.00
#> GSM573732 1 0.00 1.000 1.00 0 0.00
#> GSM573733 1 0.00 1.000 1.00 0 0.00
#> GSM573734 1 0.00 1.000 1.00 0 0.00
#> GSM573789 1 0.00 1.000 1.00 0 0.00
#> GSM573790 1 0.00 1.000 1.00 0 0.00
#> GSM573791 1 0.00 1.000 1.00 0 0.00
#> GSM573723 1 0.00 1.000 1.00 0 0.00
#> GSM573724 1 0.00 1.000 1.00 0 0.00
#> GSM573725 1 0.00 1.000 1.00 0 0.00
#> GSM573720 1 0.00 1.000 1.00 0 0.00
#> GSM573721 1 0.00 1.000 1.00 0 0.00
#> GSM573722 1 0.00 1.000 1.00 0 0.00
#> GSM573786 1 0.00 1.000 1.00 0 0.00
#> GSM573787 1 0.00 1.000 1.00 0 0.00
#> GSM573788 1 0.00 1.000 1.00 0 0.00
#> GSM573768 2 0.00 1.000 0.00 1 0.00
#> GSM573769 2 0.00 1.000 0.00 1 0.00
#> GSM573770 2 0.00 1.000 0.00 1 0.00
#> GSM573765 2 0.00 1.000 0.00 1 0.00
#> GSM573766 2 0.00 1.000 0.00 1 0.00
#> GSM573767 2 0.00 1.000 0.00 1 0.00
#> GSM573777 2 0.00 1.000 0.00 1 0.00
#> GSM573778 2 0.00 1.000 0.00 1 0.00
#> GSM573779 2 0.00 1.000 0.00 1 0.00
#> GSM573762 2 0.00 1.000 0.00 1 0.00
#> GSM573763 2 0.00 1.000 0.00 1 0.00
#> GSM573764 2 0.00 1.000 0.00 1 0.00
#> GSM573771 2 0.00 1.000 0.00 1 0.00
#> GSM573772 2 0.00 1.000 0.00 1 0.00
#> GSM573773 2 0.00 1.000 0.00 1 0.00
#> GSM573759 2 0.00 1.000 0.00 1 0.00
#> GSM573760 2 0.00 1.000 0.00 1 0.00
#> GSM573761 2 0.00 1.000 0.00 1 0.00
#> GSM573774 2 0.00 1.000 0.00 1 0.00
#> GSM573775 2 0.00 1.000 0.00 1 0.00
#> GSM573776 2 0.00 1.000 0.00 1 0.00
#> GSM573756 2 0.00 1.000 0.00 1 0.00
#> GSM573757 2 0.00 1.000 0.00 1 0.00
#> GSM573758 2 0.00 1.000 0.00 1 0.00
#> GSM573708 3 0.00 0.872 0.00 0 1.00
#> GSM573709 3 0.00 0.872 0.00 0 1.00
#> GSM573710 3 0.00 0.872 0.00 0 1.00
#> GSM573711 3 0.00 0.872 0.00 0 1.00
#> GSM573712 3 0.00 0.872 0.00 0 1.00
#> GSM573713 3 0.00 0.872 0.00 0 1.00
#> GSM573717 3 0.00 0.872 0.00 0 1.00
#> GSM573718 3 0.00 0.872 0.00 0 1.00
#> GSM573719 3 0.00 0.872 0.00 0 1.00
#> GSM573714 3 0.00 0.872 0.00 0 1.00
#> GSM573715 3 0.00 0.872 0.00 0 1.00
#> GSM573716 3 0.00 0.872 0.00 0 1.00
#> GSM573780 3 0.00 0.872 0.00 0 1.00
#> GSM573781 3 0.00 0.872 0.00 0 1.00
#> GSM573782 3 0.00 0.872 0.00 0 1.00
#> GSM573705 3 0.00 0.872 0.00 0 1.00
#> GSM573706 3 0.00 0.872 0.00 0 1.00
#> GSM573707 3 0.00 0.872 0.00 0 1.00
#> GSM573702 3 0.00 0.872 0.00 0 1.00
#> GSM573703 3 0.00 0.872 0.00 0 1.00
#> GSM573704 3 0.00 0.872 0.00 0 1.00
#> GSM573783 3 0.00 0.872 0.00 0 1.00
#> GSM573784 3 0.00 0.872 0.00 0 1.00
#> GSM573785 3 0.00 0.872 0.00 0 1.00
#> GSM573744 3 0.48 0.856 0.22 0 0.78
#> GSM573745 3 0.48 0.856 0.22 0 0.78
#> GSM573746 3 0.48 0.856 0.22 0 0.78
#> GSM573747 3 0.48 0.856 0.22 0 0.78
#> GSM573748 3 0.48 0.856 0.22 0 0.78
#> GSM573749 3 0.48 0.856 0.22 0 0.78
#> GSM573753 3 0.48 0.856 0.22 0 0.78
#> GSM573754 3 0.48 0.856 0.22 0 0.78
#> GSM573755 3 0.48 0.856 0.22 0 0.78
#> GSM573750 3 0.48 0.856 0.22 0 0.78
#> GSM573751 3 0.48 0.856 0.22 0 0.78
#> GSM573752 3 0.48 0.856 0.22 0 0.78
#> GSM573795 3 0.48 0.856 0.22 0 0.78
#> GSM573796 3 0.48 0.856 0.22 0 0.78
#> GSM573797 3 0.48 0.856 0.22 0 0.78
#> GSM573741 3 0.48 0.856 0.22 0 0.78
#> GSM573742 3 0.48 0.856 0.22 0 0.78
#> GSM573743 3 0.48 0.856 0.22 0 0.78
#> GSM573738 3 0.48 0.856 0.22 0 0.78
#> GSM573739 3 0.48 0.856 0.22 0 0.78
#> GSM573740 3 0.48 0.856 0.22 0 0.78
#> GSM573792 3 0.48 0.856 0.22 0 0.78
#> GSM573793 3 0.48 0.856 0.22 0 0.78
#> GSM573794 3 0.48 0.856 0.22 0 0.78
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM573726 1 0 1 1 0 0 0
#> GSM573727 1 0 1 1 0 0 0
#> GSM573728 1 0 1 1 0 0 0
#> GSM573729 1 0 1 1 0 0 0
#> GSM573730 1 0 1 1 0 0 0
#> GSM573731 1 0 1 1 0 0 0
#> GSM573735 1 0 1 1 0 0 0
#> GSM573736 1 0 1 1 0 0 0
#> GSM573737 1 0 1 1 0 0 0
#> GSM573732 1 0 1 1 0 0 0
#> GSM573733 1 0 1 1 0 0 0
#> GSM573734 1 0 1 1 0 0 0
#> GSM573789 1 0 1 1 0 0 0
#> GSM573790 1 0 1 1 0 0 0
#> GSM573791 1 0 1 1 0 0 0
#> GSM573723 1 0 1 1 0 0 0
#> GSM573724 1 0 1 1 0 0 0
#> GSM573725 1 0 1 1 0 0 0
#> GSM573720 1 0 1 1 0 0 0
#> GSM573721 1 0 1 1 0 0 0
#> GSM573722 1 0 1 1 0 0 0
#> GSM573786 1 0 1 1 0 0 0
#> GSM573787 1 0 1 1 0 0 0
#> GSM573788 1 0 1 1 0 0 0
#> GSM573768 2 0 1 0 1 0 0
#> GSM573769 2 0 1 0 1 0 0
#> GSM573770 2 0 1 0 1 0 0
#> GSM573765 2 0 1 0 1 0 0
#> GSM573766 2 0 1 0 1 0 0
#> GSM573767 2 0 1 0 1 0 0
#> GSM573777 2 0 1 0 1 0 0
#> GSM573778 2 0 1 0 1 0 0
#> GSM573779 2 0 1 0 1 0 0
#> GSM573762 2 0 1 0 1 0 0
#> GSM573763 2 0 1 0 1 0 0
#> GSM573764 2 0 1 0 1 0 0
#> GSM573771 2 0 1 0 1 0 0
#> GSM573772 2 0 1 0 1 0 0
#> GSM573773 2 0 1 0 1 0 0
#> GSM573759 2 0 1 0 1 0 0
#> GSM573760 2 0 1 0 1 0 0
#> GSM573761 2 0 1 0 1 0 0
#> GSM573774 2 0 1 0 1 0 0
#> GSM573775 2 0 1 0 1 0 0
#> GSM573776 2 0 1 0 1 0 0
#> GSM573756 2 0 1 0 1 0 0
#> GSM573757 2 0 1 0 1 0 0
#> GSM573758 2 0 1 0 1 0 0
#> GSM573708 3 0 1 0 0 1 0
#> GSM573709 3 0 1 0 0 1 0
#> GSM573710 3 0 1 0 0 1 0
#> GSM573711 3 0 1 0 0 1 0
#> GSM573712 3 0 1 0 0 1 0
#> GSM573713 3 0 1 0 0 1 0
#> GSM573717 3 0 1 0 0 1 0
#> GSM573718 3 0 1 0 0 1 0
#> GSM573719 3 0 1 0 0 1 0
#> GSM573714 3 0 1 0 0 1 0
#> GSM573715 3 0 1 0 0 1 0
#> GSM573716 3 0 1 0 0 1 0
#> GSM573780 3 0 1 0 0 1 0
#> GSM573781 3 0 1 0 0 1 0
#> GSM573782 3 0 1 0 0 1 0
#> GSM573705 3 0 1 0 0 1 0
#> GSM573706 3 0 1 0 0 1 0
#> GSM573707 3 0 1 0 0 1 0
#> GSM573702 3 0 1 0 0 1 0
#> GSM573703 3 0 1 0 0 1 0
#> GSM573704 3 0 1 0 0 1 0
#> GSM573783 3 0 1 0 0 1 0
#> GSM573784 3 0 1 0 0 1 0
#> GSM573785 3 0 1 0 0 1 0
#> GSM573744 4 0 1 0 0 0 1
#> GSM573745 4 0 1 0 0 0 1
#> GSM573746 4 0 1 0 0 0 1
#> GSM573747 4 0 1 0 0 0 1
#> GSM573748 4 0 1 0 0 0 1
#> GSM573749 4 0 1 0 0 0 1
#> GSM573753 4 0 1 0 0 0 1
#> GSM573754 4 0 1 0 0 0 1
#> GSM573755 4 0 1 0 0 0 1
#> GSM573750 4 0 1 0 0 0 1
#> GSM573751 4 0 1 0 0 0 1
#> GSM573752 4 0 1 0 0 0 1
#> GSM573795 4 0 1 0 0 0 1
#> GSM573796 4 0 1 0 0 0 1
#> GSM573797 4 0 1 0 0 0 1
#> GSM573741 4 0 1 0 0 0 1
#> GSM573742 4 0 1 0 0 0 1
#> GSM573743 4 0 1 0 0 0 1
#> GSM573738 4 0 1 0 0 0 1
#> GSM573739 4 0 1 0 0 0 1
#> GSM573740 4 0 1 0 0 0 1
#> GSM573792 4 0 1 0 0 0 1
#> GSM573793 4 0 1 0 0 0 1
#> GSM573794 4 0 1 0 0 0 1
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM573726 1 0.0000 0.997 1.000 0.000 0.000 0.000 0.000
#> GSM573727 1 0.0000 0.997 1.000 0.000 0.000 0.000 0.000
#> GSM573728 1 0.0000 0.997 1.000 0.000 0.000 0.000 0.000
#> GSM573729 1 0.0000 0.997 1.000 0.000 0.000 0.000 0.000
#> GSM573730 1 0.0000 0.997 1.000 0.000 0.000 0.000 0.000
#> GSM573731 1 0.0000 0.997 1.000 0.000 0.000 0.000 0.000
#> GSM573735 1 0.0404 0.991 0.988 0.000 0.000 0.000 0.012
#> GSM573736 1 0.0404 0.991 0.988 0.000 0.000 0.000 0.012
#> GSM573737 1 0.0404 0.991 0.988 0.000 0.000 0.000 0.012
#> GSM573732 1 0.0404 0.991 0.988 0.000 0.000 0.000 0.012
#> GSM573733 1 0.0404 0.991 0.988 0.000 0.000 0.000 0.012
#> GSM573734 1 0.0404 0.991 0.988 0.000 0.000 0.000 0.012
#> GSM573789 1 0.0000 0.997 1.000 0.000 0.000 0.000 0.000
#> GSM573790 1 0.0000 0.997 1.000 0.000 0.000 0.000 0.000
#> GSM573791 1 0.0000 0.997 1.000 0.000 0.000 0.000 0.000
#> GSM573723 1 0.0000 0.997 1.000 0.000 0.000 0.000 0.000
#> GSM573724 1 0.0000 0.997 1.000 0.000 0.000 0.000 0.000
#> GSM573725 1 0.0000 0.997 1.000 0.000 0.000 0.000 0.000
#> GSM573720 1 0.0000 0.997 1.000 0.000 0.000 0.000 0.000
#> GSM573721 1 0.0000 0.997 1.000 0.000 0.000 0.000 0.000
#> GSM573722 1 0.0000 0.997 1.000 0.000 0.000 0.000 0.000
#> GSM573786 1 0.0000 0.997 1.000 0.000 0.000 0.000 0.000
#> GSM573787 1 0.0000 0.997 1.000 0.000 0.000 0.000 0.000
#> GSM573788 1 0.0000 0.997 1.000 0.000 0.000 0.000 0.000
#> GSM573768 2 0.0162 0.995 0.000 0.996 0.000 0.000 0.004
#> GSM573769 2 0.0162 0.995 0.000 0.996 0.000 0.000 0.004
#> GSM573770 2 0.0000 0.996 0.000 1.000 0.000 0.000 0.000
#> GSM573765 2 0.0000 0.996 0.000 1.000 0.000 0.000 0.000
#> GSM573766 2 0.0162 0.995 0.000 0.996 0.000 0.000 0.004
#> GSM573767 2 0.0000 0.996 0.000 1.000 0.000 0.000 0.000
#> GSM573777 2 0.0000 0.996 0.000 1.000 0.000 0.000 0.000
#> GSM573778 2 0.0290 0.994 0.000 0.992 0.000 0.000 0.008
#> GSM573779 2 0.0290 0.994 0.000 0.992 0.000 0.000 0.008
#> GSM573762 2 0.0000 0.996 0.000 1.000 0.000 0.000 0.000
#> GSM573763 2 0.0000 0.996 0.000 1.000 0.000 0.000 0.000
#> GSM573764 2 0.0000 0.996 0.000 1.000 0.000 0.000 0.000
#> GSM573771 2 0.0000 0.996 0.000 1.000 0.000 0.000 0.000
#> GSM573772 2 0.0000 0.996 0.000 1.000 0.000 0.000 0.000
#> GSM573773 2 0.0000 0.996 0.000 1.000 0.000 0.000 0.000
#> GSM573759 2 0.0000 0.996 0.000 1.000 0.000 0.000 0.000
#> GSM573760 2 0.0290 0.994 0.000 0.992 0.000 0.000 0.008
#> GSM573761 2 0.0290 0.994 0.000 0.992 0.000 0.000 0.008
#> GSM573774 2 0.0000 0.996 0.000 1.000 0.000 0.000 0.000
#> GSM573775 2 0.0290 0.994 0.000 0.992 0.000 0.000 0.008
#> GSM573776 2 0.0000 0.996 0.000 1.000 0.000 0.000 0.000
#> GSM573756 2 0.0290 0.992 0.000 0.992 0.000 0.000 0.008
#> GSM573757 2 0.0404 0.989 0.000 0.988 0.000 0.000 0.012
#> GSM573758 2 0.1043 0.968 0.000 0.960 0.000 0.000 0.040
#> GSM573708 3 0.0609 0.986 0.000 0.000 0.980 0.000 0.020
#> GSM573709 3 0.0609 0.986 0.000 0.000 0.980 0.000 0.020
#> GSM573710 3 0.0609 0.986 0.000 0.000 0.980 0.000 0.020
#> GSM573711 3 0.0609 0.986 0.000 0.000 0.980 0.000 0.020
#> GSM573712 3 0.0703 0.985 0.000 0.000 0.976 0.000 0.024
#> GSM573713 3 0.0609 0.986 0.000 0.000 0.980 0.000 0.020
#> GSM573717 3 0.0162 0.987 0.000 0.000 0.996 0.000 0.004
#> GSM573718 3 0.0290 0.987 0.000 0.000 0.992 0.000 0.008
#> GSM573719 3 0.0510 0.986 0.000 0.000 0.984 0.000 0.016
#> GSM573714 3 0.0404 0.985 0.000 0.000 0.988 0.000 0.012
#> GSM573715 3 0.0609 0.985 0.000 0.000 0.980 0.000 0.020
#> GSM573716 3 0.0290 0.986 0.000 0.000 0.992 0.000 0.008
#> GSM573780 3 0.0794 0.983 0.000 0.000 0.972 0.000 0.028
#> GSM573781 3 0.0794 0.983 0.000 0.000 0.972 0.000 0.028
#> GSM573782 3 0.0703 0.986 0.000 0.000 0.976 0.000 0.024
#> GSM573705 3 0.0404 0.985 0.000 0.000 0.988 0.000 0.012
#> GSM573706 3 0.0609 0.986 0.000 0.000 0.980 0.000 0.020
#> GSM573707 3 0.0162 0.987 0.000 0.000 0.996 0.000 0.004
#> GSM573702 3 0.0404 0.985 0.000 0.000 0.988 0.000 0.012
#> GSM573703 3 0.0510 0.987 0.000 0.000 0.984 0.000 0.016
#> GSM573704 3 0.0510 0.984 0.000 0.000 0.984 0.000 0.016
#> GSM573783 3 0.0609 0.982 0.000 0.000 0.980 0.000 0.020
#> GSM573784 3 0.0404 0.987 0.000 0.000 0.988 0.000 0.012
#> GSM573785 3 0.0404 0.986 0.000 0.000 0.988 0.000 0.012
#> GSM573744 4 0.0162 0.991 0.000 0.000 0.000 0.996 0.004
#> GSM573745 4 0.0000 0.992 0.000 0.000 0.000 1.000 0.000
#> GSM573746 4 0.0000 0.992 0.000 0.000 0.000 1.000 0.000
#> GSM573747 4 0.0000 0.992 0.000 0.000 0.000 1.000 0.000
#> GSM573748 4 0.0000 0.992 0.000 0.000 0.000 1.000 0.000
#> GSM573749 4 0.0000 0.992 0.000 0.000 0.000 1.000 0.000
#> GSM573753 4 0.0290 0.989 0.000 0.000 0.000 0.992 0.008
#> GSM573754 4 0.0404 0.986 0.000 0.000 0.000 0.988 0.012
#> GSM573755 5 0.4278 0.452 0.000 0.000 0.000 0.452 0.548
#> GSM573750 4 0.0290 0.989 0.000 0.000 0.000 0.992 0.008
#> GSM573751 4 0.0290 0.989 0.000 0.000 0.000 0.992 0.008
#> GSM573752 4 0.0290 0.989 0.000 0.000 0.000 0.992 0.008
#> GSM573795 5 0.2648 0.880 0.000 0.000 0.000 0.152 0.848
#> GSM573796 5 0.2648 0.880 0.000 0.000 0.000 0.152 0.848
#> GSM573797 5 0.2648 0.880 0.000 0.000 0.000 0.152 0.848
#> GSM573741 4 0.0000 0.992 0.000 0.000 0.000 1.000 0.000
#> GSM573742 4 0.0000 0.992 0.000 0.000 0.000 1.000 0.000
#> GSM573743 4 0.0000 0.992 0.000 0.000 0.000 1.000 0.000
#> GSM573738 4 0.0000 0.992 0.000 0.000 0.000 1.000 0.000
#> GSM573739 4 0.0000 0.992 0.000 0.000 0.000 1.000 0.000
#> GSM573740 4 0.0000 0.992 0.000 0.000 0.000 1.000 0.000
#> GSM573792 4 0.0703 0.972 0.000 0.000 0.000 0.976 0.024
#> GSM573793 4 0.0510 0.980 0.000 0.000 0.000 0.984 0.016
#> GSM573794 4 0.0703 0.972 0.000 0.000 0.000 0.976 0.024
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM573726 1 0.0000 0.992 1.000 0.000 0.000 0.000 0.000 NA
#> GSM573727 1 0.0000 0.992 1.000 0.000 0.000 0.000 0.000 NA
#> GSM573728 1 0.0000 0.992 1.000 0.000 0.000 0.000 0.000 NA
#> GSM573729 1 0.0000 0.992 1.000 0.000 0.000 0.000 0.000 NA
#> GSM573730 1 0.0000 0.992 1.000 0.000 0.000 0.000 0.000 NA
#> GSM573731 1 0.0000 0.992 1.000 0.000 0.000 0.000 0.000 NA
#> GSM573735 1 0.0790 0.977 0.968 0.000 0.000 0.000 0.000 NA
#> GSM573736 1 0.0790 0.977 0.968 0.000 0.000 0.000 0.000 NA
#> GSM573737 1 0.0790 0.977 0.968 0.000 0.000 0.000 0.000 NA
#> GSM573732 1 0.0790 0.977 0.968 0.000 0.000 0.000 0.000 NA
#> GSM573733 1 0.0790 0.977 0.968 0.000 0.000 0.000 0.000 NA
#> GSM573734 1 0.0790 0.977 0.968 0.000 0.000 0.000 0.000 NA
#> GSM573789 1 0.0000 0.992 1.000 0.000 0.000 0.000 0.000 NA
#> GSM573790 1 0.0000 0.992 1.000 0.000 0.000 0.000 0.000 NA
#> GSM573791 1 0.0000 0.992 1.000 0.000 0.000 0.000 0.000 NA
#> GSM573723 1 0.0000 0.992 1.000 0.000 0.000 0.000 0.000 NA
#> GSM573724 1 0.0000 0.992 1.000 0.000 0.000 0.000 0.000 NA
#> GSM573725 1 0.0000 0.992 1.000 0.000 0.000 0.000 0.000 NA
#> GSM573720 1 0.0000 0.992 1.000 0.000 0.000 0.000 0.000 NA
#> GSM573721 1 0.0000 0.992 1.000 0.000 0.000 0.000 0.000 NA
#> GSM573722 1 0.0000 0.992 1.000 0.000 0.000 0.000 0.000 NA
#> GSM573786 1 0.0000 0.992 1.000 0.000 0.000 0.000 0.000 NA
#> GSM573787 1 0.0000 0.992 1.000 0.000 0.000 0.000 0.000 NA
#> GSM573788 1 0.0000 0.992 1.000 0.000 0.000 0.000 0.000 NA
#> GSM573768 2 0.0146 0.988 0.000 0.996 0.000 0.000 0.004 NA
#> GSM573769 2 0.0405 0.987 0.000 0.988 0.000 0.000 0.004 NA
#> GSM573770 2 0.0146 0.988 0.000 0.996 0.000 0.000 0.000 NA
#> GSM573765 2 0.0000 0.988 0.000 1.000 0.000 0.000 0.000 NA
#> GSM573766 2 0.0146 0.988 0.000 0.996 0.000 0.000 0.000 NA
#> GSM573767 2 0.0146 0.988 0.000 0.996 0.000 0.000 0.000 NA
#> GSM573777 2 0.0405 0.987 0.000 0.988 0.000 0.000 0.004 NA
#> GSM573778 2 0.0405 0.987 0.000 0.988 0.000 0.000 0.008 NA
#> GSM573779 2 0.0508 0.987 0.000 0.984 0.000 0.000 0.012 NA
#> GSM573762 2 0.0405 0.987 0.000 0.988 0.000 0.000 0.004 NA
#> GSM573763 2 0.0146 0.988 0.000 0.996 0.000 0.000 0.000 NA
#> GSM573764 2 0.0146 0.988 0.000 0.996 0.000 0.000 0.000 NA
#> GSM573771 2 0.0291 0.987 0.000 0.992 0.000 0.000 0.004 NA
#> GSM573772 2 0.0146 0.988 0.000 0.996 0.000 0.000 0.000 NA
#> GSM573773 2 0.0146 0.988 0.000 0.996 0.000 0.000 0.000 NA
#> GSM573759 2 0.0622 0.984 0.000 0.980 0.000 0.000 0.008 NA
#> GSM573760 2 0.0405 0.987 0.000 0.988 0.000 0.000 0.004 NA
#> GSM573761 2 0.0291 0.988 0.000 0.992 0.000 0.000 0.004 NA
#> GSM573774 2 0.0146 0.988 0.000 0.996 0.000 0.000 0.000 NA
#> GSM573775 2 0.0717 0.983 0.000 0.976 0.000 0.000 0.008 NA
#> GSM573776 2 0.0146 0.988 0.000 0.996 0.000 0.000 0.004 NA
#> GSM573756 2 0.1572 0.954 0.000 0.936 0.000 0.000 0.036 NA
#> GSM573757 2 0.1572 0.954 0.000 0.936 0.000 0.000 0.036 NA
#> GSM573758 2 0.1572 0.955 0.000 0.936 0.000 0.000 0.036 NA
#> GSM573708 3 0.2219 0.886 0.000 0.000 0.864 0.000 0.000 NA
#> GSM573709 3 0.1910 0.896 0.000 0.000 0.892 0.000 0.000 NA
#> GSM573710 3 0.2092 0.889 0.000 0.000 0.876 0.000 0.000 NA
#> GSM573711 3 0.1957 0.895 0.000 0.000 0.888 0.000 0.000 NA
#> GSM573712 3 0.1957 0.895 0.000 0.000 0.888 0.000 0.000 NA
#> GSM573713 3 0.2320 0.887 0.000 0.000 0.864 0.000 0.004 NA
#> GSM573717 3 0.0909 0.920 0.000 0.000 0.968 0.000 0.012 NA
#> GSM573718 3 0.1003 0.921 0.000 0.000 0.964 0.000 0.016 NA
#> GSM573719 3 0.0935 0.918 0.000 0.000 0.964 0.000 0.004 NA
#> GSM573714 3 0.0993 0.921 0.000 0.000 0.964 0.000 0.024 NA
#> GSM573715 3 0.1010 0.917 0.000 0.000 0.960 0.000 0.004 NA
#> GSM573716 3 0.0891 0.919 0.000 0.000 0.968 0.000 0.008 NA
#> GSM573780 3 0.3547 0.723 0.000 0.000 0.668 0.000 0.000 NA
#> GSM573781 3 0.3706 0.669 0.000 0.000 0.620 0.000 0.000 NA
#> GSM573782 3 0.3659 0.685 0.000 0.000 0.636 0.000 0.000 NA
#> GSM573705 3 0.1257 0.920 0.000 0.000 0.952 0.000 0.028 NA
#> GSM573706 3 0.1297 0.922 0.000 0.000 0.948 0.000 0.012 NA
#> GSM573707 3 0.0993 0.919 0.000 0.000 0.964 0.000 0.012 NA
#> GSM573702 3 0.0717 0.921 0.000 0.000 0.976 0.000 0.008 NA
#> GSM573703 3 0.0725 0.922 0.000 0.000 0.976 0.000 0.012 NA
#> GSM573704 3 0.0914 0.921 0.000 0.000 0.968 0.000 0.016 NA
#> GSM573783 3 0.0935 0.921 0.000 0.000 0.964 0.000 0.032 NA
#> GSM573784 3 0.0520 0.921 0.000 0.000 0.984 0.000 0.008 NA
#> GSM573785 3 0.0520 0.921 0.000 0.000 0.984 0.000 0.008 NA
#> GSM573744 4 0.0291 0.985 0.000 0.000 0.000 0.992 0.004 NA
#> GSM573745 4 0.0000 0.987 0.000 0.000 0.000 1.000 0.000 NA
#> GSM573746 4 0.0000 0.987 0.000 0.000 0.000 1.000 0.000 NA
#> GSM573747 4 0.0146 0.986 0.000 0.000 0.000 0.996 0.000 NA
#> GSM573748 4 0.0000 0.987 0.000 0.000 0.000 1.000 0.000 NA
#> GSM573749 4 0.0000 0.987 0.000 0.000 0.000 1.000 0.000 NA
#> GSM573753 4 0.0622 0.979 0.000 0.000 0.000 0.980 0.012 NA
#> GSM573754 4 0.0717 0.975 0.000 0.000 0.000 0.976 0.016 NA
#> GSM573755 5 0.4264 0.311 0.000 0.000 0.000 0.492 0.492 NA
#> GSM573750 4 0.0622 0.979 0.000 0.000 0.000 0.980 0.012 NA
#> GSM573751 4 0.0622 0.979 0.000 0.000 0.000 0.980 0.012 NA
#> GSM573752 4 0.0622 0.979 0.000 0.000 0.000 0.980 0.012 NA
#> GSM573795 5 0.2730 0.856 0.000 0.000 0.000 0.152 0.836 NA
#> GSM573796 5 0.2631 0.857 0.000 0.000 0.000 0.152 0.840 NA
#> GSM573797 5 0.2520 0.857 0.000 0.000 0.000 0.152 0.844 NA
#> GSM573741 4 0.0000 0.987 0.000 0.000 0.000 1.000 0.000 NA
#> GSM573742 4 0.0000 0.987 0.000 0.000 0.000 1.000 0.000 NA
#> GSM573743 4 0.0000 0.987 0.000 0.000 0.000 1.000 0.000 NA
#> GSM573738 4 0.0146 0.986 0.000 0.000 0.000 0.996 0.000 NA
#> GSM573739 4 0.0000 0.987 0.000 0.000 0.000 1.000 0.000 NA
#> GSM573740 4 0.0000 0.987 0.000 0.000 0.000 1.000 0.000 NA
#> GSM573792 4 0.0632 0.969 0.000 0.000 0.000 0.976 0.024 NA
#> GSM573793 4 0.0632 0.969 0.000 0.000 0.000 0.976 0.024 NA
#> GSM573794 4 0.0632 0.969 0.000 0.000 0.000 0.976 0.024 NA
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
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)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
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:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.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")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
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 cell.line(p) agent(p) k
#> MAD:mclust 96 1.13e-20 0.843 2
#> MAD:mclust 96 9.56e-39 0.741 3
#> MAD:mclust 96 9.14e-57 0.975 4
#> MAD:mclust 95 6.58e-54 0.192 5
#> MAD:mclust 95 6.58e-54 0.192 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.
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 46609 rows and 96 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'MAD' method.
#> Subgroups are detected by 'NMF' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 4.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.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:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).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)
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.593 0.804 0.43286 0.526 0.526
#> 3 3 0.747 0.924 0.940 0.46188 0.779 0.604
#> 4 4 1.000 1.000 1.000 0.19809 0.874 0.657
#> 5 5 1.000 0.997 0.997 0.00131 1.000 1.000
#> 6 6 0.980 0.981 0.979 0.00773 1.000 1.000
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 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.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> GSM573726 1 0.0938 0.79599 0.988 0.012
#> GSM573727 1 0.0938 0.79599 0.988 0.012
#> GSM573728 1 0.1414 0.79405 0.980 0.020
#> GSM573729 1 0.1184 0.79440 0.984 0.016
#> GSM573730 1 0.0672 0.79630 0.992 0.008
#> GSM573731 1 0.1414 0.79405 0.980 0.020
#> GSM573735 1 0.1414 0.79411 0.980 0.020
#> GSM573736 1 0.1414 0.79411 0.980 0.020
#> GSM573737 1 0.1633 0.79481 0.976 0.024
#> GSM573732 1 0.1633 0.79481 0.976 0.024
#> GSM573733 1 0.1633 0.79171 0.976 0.024
#> GSM573734 1 0.1414 0.79411 0.980 0.020
#> GSM573789 1 0.0938 0.79626 0.988 0.012
#> GSM573790 1 0.1414 0.79618 0.980 0.020
#> GSM573791 1 0.1414 0.79618 0.980 0.020
#> GSM573723 1 0.1843 0.78834 0.972 0.028
#> GSM573724 1 0.1184 0.79572 0.984 0.016
#> GSM573725 1 0.1414 0.79405 0.980 0.020
#> GSM573720 1 0.1414 0.79405 0.980 0.020
#> GSM573721 1 0.1184 0.79573 0.984 0.016
#> GSM573722 1 0.1633 0.79145 0.976 0.024
#> GSM573786 1 0.0938 0.79599 0.988 0.012
#> GSM573787 1 0.1184 0.79573 0.984 0.016
#> GSM573788 1 0.1414 0.79405 0.980 0.020
#> GSM573768 2 0.8016 0.72211 0.244 0.756
#> GSM573769 2 0.8016 0.72211 0.244 0.756
#> GSM573770 2 0.8016 0.72211 0.244 0.756
#> GSM573765 2 0.7950 0.72226 0.240 0.760
#> GSM573766 2 0.8016 0.72211 0.244 0.756
#> GSM573767 2 0.8016 0.72211 0.244 0.756
#> GSM573777 2 0.7883 0.72113 0.236 0.764
#> GSM573778 2 0.8016 0.72211 0.244 0.756
#> GSM573779 2 0.8016 0.72211 0.244 0.756
#> GSM573762 2 0.7883 0.72113 0.236 0.764
#> GSM573763 2 0.7745 0.71694 0.228 0.772
#> GSM573764 2 0.7674 0.71428 0.224 0.776
#> GSM573771 2 0.7950 0.72222 0.240 0.760
#> GSM573772 2 0.7815 0.71921 0.232 0.768
#> GSM573773 2 0.8016 0.72211 0.244 0.756
#> GSM573759 2 0.8016 0.72211 0.244 0.756
#> GSM573760 2 0.8016 0.72211 0.244 0.756
#> GSM573761 2 0.8016 0.72211 0.244 0.756
#> GSM573774 2 0.8016 0.72211 0.244 0.756
#> GSM573775 2 0.8016 0.72211 0.244 0.756
#> GSM573776 2 0.8016 0.72211 0.244 0.756
#> GSM573756 2 0.7950 0.72230 0.240 0.760
#> GSM573757 2 0.7950 0.72230 0.240 0.760
#> GSM573758 2 0.7950 0.72230 0.240 0.760
#> GSM573708 1 0.3114 0.78257 0.944 0.056
#> GSM573709 1 0.2948 0.78623 0.948 0.052
#> GSM573710 1 0.3431 0.77366 0.936 0.064
#> GSM573711 1 0.3114 0.78257 0.944 0.056
#> GSM573712 1 0.3114 0.78257 0.944 0.056
#> GSM573713 1 0.3114 0.78257 0.944 0.056
#> GSM573717 1 0.2948 0.78623 0.948 0.052
#> GSM573718 1 0.2948 0.78623 0.948 0.052
#> GSM573719 1 0.2948 0.78623 0.948 0.052
#> GSM573714 1 0.2948 0.78623 0.948 0.052
#> GSM573715 1 0.2948 0.78623 0.948 0.052
#> GSM573716 1 0.2948 0.78623 0.948 0.052
#> GSM573780 1 0.7056 0.56189 0.808 0.192
#> GSM573781 1 0.7815 0.47689 0.768 0.232
#> GSM573782 1 0.8386 0.38923 0.732 0.268
#> GSM573705 1 0.2948 0.78623 0.948 0.052
#> GSM573706 1 0.2948 0.78623 0.948 0.052
#> GSM573707 1 0.2948 0.78623 0.948 0.052
#> GSM573702 1 0.2948 0.78623 0.948 0.052
#> GSM573703 1 0.2948 0.78623 0.948 0.052
#> GSM573704 1 0.2948 0.78623 0.948 0.052
#> GSM573783 1 0.2948 0.78623 0.948 0.052
#> GSM573784 1 0.2948 0.78623 0.948 0.052
#> GSM573785 1 0.2948 0.78623 0.948 0.052
#> GSM573744 1 0.9996 0.11431 0.512 0.488
#> GSM573745 1 0.9993 0.12552 0.516 0.484
#> GSM573746 1 0.9996 0.11431 0.512 0.488
#> GSM573747 1 0.9996 0.11431 0.512 0.488
#> GSM573748 1 0.9996 0.11431 0.512 0.488
#> GSM573749 1 0.9996 0.11431 0.512 0.488
#> GSM573753 2 0.9963 -0.00203 0.464 0.536
#> GSM573754 2 0.9922 0.04244 0.448 0.552
#> GSM573755 2 0.9909 0.05231 0.444 0.556
#> GSM573750 2 0.9977 -0.02553 0.472 0.528
#> GSM573751 2 0.9983 -0.03765 0.476 0.524
#> GSM573752 2 0.9983 -0.03765 0.476 0.524
#> GSM573795 2 0.8909 0.31609 0.308 0.692
#> GSM573796 2 0.6343 0.47176 0.160 0.840
#> GSM573797 2 0.8861 0.32196 0.304 0.696
#> GSM573741 1 0.9970 0.16770 0.532 0.468
#> GSM573742 1 0.9970 0.16770 0.532 0.468
#> GSM573743 1 0.9977 0.15757 0.528 0.472
#> GSM573738 1 0.9970 0.16770 0.532 0.468
#> GSM573739 1 0.9963 0.17642 0.536 0.464
#> GSM573740 1 0.9970 0.16770 0.532 0.468
#> GSM573792 2 0.9922 0.04239 0.448 0.552
#> GSM573793 2 1.0000 -0.10153 0.496 0.504
#> GSM573794 2 0.9998 -0.08909 0.492 0.508
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM573726 3 0.4931 0.848 0.232 0.000 0.768
#> GSM573727 3 0.4931 0.848 0.232 0.000 0.768
#> GSM573728 3 0.4931 0.848 0.232 0.000 0.768
#> GSM573729 3 0.4931 0.848 0.232 0.000 0.768
#> GSM573730 3 0.4931 0.848 0.232 0.000 0.768
#> GSM573731 3 0.4931 0.848 0.232 0.000 0.768
#> GSM573735 3 0.4931 0.848 0.232 0.000 0.768
#> GSM573736 3 0.4931 0.848 0.232 0.000 0.768
#> GSM573737 3 0.4931 0.848 0.232 0.000 0.768
#> GSM573732 3 0.4931 0.848 0.232 0.000 0.768
#> GSM573733 3 0.4931 0.848 0.232 0.000 0.768
#> GSM573734 3 0.4931 0.848 0.232 0.000 0.768
#> GSM573789 3 0.4931 0.848 0.232 0.000 0.768
#> GSM573790 3 0.4931 0.848 0.232 0.000 0.768
#> GSM573791 3 0.4931 0.848 0.232 0.000 0.768
#> GSM573723 3 0.4931 0.848 0.232 0.000 0.768
#> GSM573724 3 0.4931 0.848 0.232 0.000 0.768
#> GSM573725 3 0.4931 0.848 0.232 0.000 0.768
#> GSM573720 3 0.4931 0.848 0.232 0.000 0.768
#> GSM573721 3 0.4931 0.848 0.232 0.000 0.768
#> GSM573722 3 0.4931 0.848 0.232 0.000 0.768
#> GSM573786 3 0.4931 0.848 0.232 0.000 0.768
#> GSM573787 3 0.4931 0.848 0.232 0.000 0.768
#> GSM573788 3 0.4931 0.848 0.232 0.000 0.768
#> GSM573768 2 0.0000 1.000 0.000 1.000 0.000
#> GSM573769 2 0.0000 1.000 0.000 1.000 0.000
#> GSM573770 2 0.0000 1.000 0.000 1.000 0.000
#> GSM573765 2 0.0000 1.000 0.000 1.000 0.000
#> GSM573766 2 0.0000 1.000 0.000 1.000 0.000
#> GSM573767 2 0.0000 1.000 0.000 1.000 0.000
#> GSM573777 2 0.0000 1.000 0.000 1.000 0.000
#> GSM573778 2 0.0000 1.000 0.000 1.000 0.000
#> GSM573779 2 0.0000 1.000 0.000 1.000 0.000
#> GSM573762 2 0.0000 1.000 0.000 1.000 0.000
#> GSM573763 2 0.0000 1.000 0.000 1.000 0.000
#> GSM573764 2 0.0000 1.000 0.000 1.000 0.000
#> GSM573771 2 0.0000 1.000 0.000 1.000 0.000
#> GSM573772 2 0.0000 1.000 0.000 1.000 0.000
#> GSM573773 2 0.0000 1.000 0.000 1.000 0.000
#> GSM573759 2 0.0000 1.000 0.000 1.000 0.000
#> GSM573760 2 0.0000 1.000 0.000 1.000 0.000
#> GSM573761 2 0.0000 1.000 0.000 1.000 0.000
#> GSM573774 2 0.0000 1.000 0.000 1.000 0.000
#> GSM573775 2 0.0000 1.000 0.000 1.000 0.000
#> GSM573776 2 0.0000 1.000 0.000 1.000 0.000
#> GSM573756 2 0.0000 1.000 0.000 1.000 0.000
#> GSM573757 2 0.0000 1.000 0.000 1.000 0.000
#> GSM573758 2 0.0000 1.000 0.000 1.000 0.000
#> GSM573708 3 0.0000 0.866 0.000 0.000 1.000
#> GSM573709 3 0.0000 0.866 0.000 0.000 1.000
#> GSM573710 3 0.0000 0.866 0.000 0.000 1.000
#> GSM573711 3 0.0000 0.866 0.000 0.000 1.000
#> GSM573712 3 0.0000 0.866 0.000 0.000 1.000
#> GSM573713 3 0.0000 0.866 0.000 0.000 1.000
#> GSM573717 3 0.0000 0.866 0.000 0.000 1.000
#> GSM573718 3 0.0000 0.866 0.000 0.000 1.000
#> GSM573719 3 0.0000 0.866 0.000 0.000 1.000
#> GSM573714 3 0.0000 0.866 0.000 0.000 1.000
#> GSM573715 3 0.0000 0.866 0.000 0.000 1.000
#> GSM573716 3 0.0000 0.866 0.000 0.000 1.000
#> GSM573780 3 0.0000 0.866 0.000 0.000 1.000
#> GSM573781 3 0.0000 0.866 0.000 0.000 1.000
#> GSM573782 3 0.0000 0.866 0.000 0.000 1.000
#> GSM573705 3 0.0000 0.866 0.000 0.000 1.000
#> GSM573706 3 0.0000 0.866 0.000 0.000 1.000
#> GSM573707 3 0.0000 0.866 0.000 0.000 1.000
#> GSM573702 3 0.0000 0.866 0.000 0.000 1.000
#> GSM573703 3 0.0000 0.866 0.000 0.000 1.000
#> GSM573704 3 0.0000 0.866 0.000 0.000 1.000
#> GSM573783 3 0.0000 0.866 0.000 0.000 1.000
#> GSM573784 3 0.0000 0.866 0.000 0.000 1.000
#> GSM573785 3 0.0000 0.866 0.000 0.000 1.000
#> GSM573744 1 0.0000 0.988 1.000 0.000 0.000
#> GSM573745 1 0.0000 0.988 1.000 0.000 0.000
#> GSM573746 1 0.0000 0.988 1.000 0.000 0.000
#> GSM573747 1 0.0000 0.988 1.000 0.000 0.000
#> GSM573748 1 0.0000 0.988 1.000 0.000 0.000
#> GSM573749 1 0.0000 0.988 1.000 0.000 0.000
#> GSM573753 1 0.0747 0.984 0.984 0.016 0.000
#> GSM573754 1 0.0747 0.984 0.984 0.016 0.000
#> GSM573755 1 0.0747 0.984 0.984 0.016 0.000
#> GSM573750 1 0.0747 0.984 0.984 0.016 0.000
#> GSM573751 1 0.0747 0.984 0.984 0.016 0.000
#> GSM573752 1 0.0747 0.984 0.984 0.016 0.000
#> GSM573795 1 0.1529 0.961 0.960 0.040 0.000
#> GSM573796 1 0.1529 0.961 0.960 0.040 0.000
#> GSM573797 1 0.1529 0.961 0.960 0.040 0.000
#> GSM573741 1 0.0000 0.988 1.000 0.000 0.000
#> GSM573742 1 0.0000 0.988 1.000 0.000 0.000
#> GSM573743 1 0.0000 0.988 1.000 0.000 0.000
#> GSM573738 1 0.0000 0.988 1.000 0.000 0.000
#> GSM573739 1 0.0000 0.988 1.000 0.000 0.000
#> GSM573740 1 0.0000 0.988 1.000 0.000 0.000
#> GSM573792 1 0.0747 0.984 0.984 0.016 0.000
#> GSM573793 1 0.0000 0.988 1.000 0.000 0.000
#> GSM573794 1 0.0000 0.988 1.000 0.000 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM573726 1 0 1 1 0 0 0
#> GSM573727 1 0 1 1 0 0 0
#> GSM573728 1 0 1 1 0 0 0
#> GSM573729 1 0 1 1 0 0 0
#> GSM573730 1 0 1 1 0 0 0
#> GSM573731 1 0 1 1 0 0 0
#> GSM573735 1 0 1 1 0 0 0
#> GSM573736 1 0 1 1 0 0 0
#> GSM573737 1 0 1 1 0 0 0
#> GSM573732 1 0 1 1 0 0 0
#> GSM573733 1 0 1 1 0 0 0
#> GSM573734 1 0 1 1 0 0 0
#> GSM573789 1 0 1 1 0 0 0
#> GSM573790 1 0 1 1 0 0 0
#> GSM573791 1 0 1 1 0 0 0
#> GSM573723 1 0 1 1 0 0 0
#> GSM573724 1 0 1 1 0 0 0
#> GSM573725 1 0 1 1 0 0 0
#> GSM573720 1 0 1 1 0 0 0
#> GSM573721 1 0 1 1 0 0 0
#> GSM573722 1 0 1 1 0 0 0
#> GSM573786 1 0 1 1 0 0 0
#> GSM573787 1 0 1 1 0 0 0
#> GSM573788 1 0 1 1 0 0 0
#> GSM573768 2 0 1 0 1 0 0
#> GSM573769 2 0 1 0 1 0 0
#> GSM573770 2 0 1 0 1 0 0
#> GSM573765 2 0 1 0 1 0 0
#> GSM573766 2 0 1 0 1 0 0
#> GSM573767 2 0 1 0 1 0 0
#> GSM573777 2 0 1 0 1 0 0
#> GSM573778 2 0 1 0 1 0 0
#> GSM573779 2 0 1 0 1 0 0
#> GSM573762 2 0 1 0 1 0 0
#> GSM573763 2 0 1 0 1 0 0
#> GSM573764 2 0 1 0 1 0 0
#> GSM573771 2 0 1 0 1 0 0
#> GSM573772 2 0 1 0 1 0 0
#> GSM573773 2 0 1 0 1 0 0
#> GSM573759 2 0 1 0 1 0 0
#> GSM573760 2 0 1 0 1 0 0
#> GSM573761 2 0 1 0 1 0 0
#> GSM573774 2 0 1 0 1 0 0
#> GSM573775 2 0 1 0 1 0 0
#> GSM573776 2 0 1 0 1 0 0
#> GSM573756 2 0 1 0 1 0 0
#> GSM573757 2 0 1 0 1 0 0
#> GSM573758 2 0 1 0 1 0 0
#> GSM573708 3 0 1 0 0 1 0
#> GSM573709 3 0 1 0 0 1 0
#> GSM573710 3 0 1 0 0 1 0
#> GSM573711 3 0 1 0 0 1 0
#> GSM573712 3 0 1 0 0 1 0
#> GSM573713 3 0 1 0 0 1 0
#> GSM573717 3 0 1 0 0 1 0
#> GSM573718 3 0 1 0 0 1 0
#> GSM573719 3 0 1 0 0 1 0
#> GSM573714 3 0 1 0 0 1 0
#> GSM573715 3 0 1 0 0 1 0
#> GSM573716 3 0 1 0 0 1 0
#> GSM573780 3 0 1 0 0 1 0
#> GSM573781 3 0 1 0 0 1 0
#> GSM573782 3 0 1 0 0 1 0
#> GSM573705 3 0 1 0 0 1 0
#> GSM573706 3 0 1 0 0 1 0
#> GSM573707 3 0 1 0 0 1 0
#> GSM573702 3 0 1 0 0 1 0
#> GSM573703 3 0 1 0 0 1 0
#> GSM573704 3 0 1 0 0 1 0
#> GSM573783 3 0 1 0 0 1 0
#> GSM573784 3 0 1 0 0 1 0
#> GSM573785 3 0 1 0 0 1 0
#> GSM573744 4 0 1 0 0 0 1
#> GSM573745 4 0 1 0 0 0 1
#> GSM573746 4 0 1 0 0 0 1
#> GSM573747 4 0 1 0 0 0 1
#> GSM573748 4 0 1 0 0 0 1
#> GSM573749 4 0 1 0 0 0 1
#> GSM573753 4 0 1 0 0 0 1
#> GSM573754 4 0 1 0 0 0 1
#> GSM573755 4 0 1 0 0 0 1
#> GSM573750 4 0 1 0 0 0 1
#> GSM573751 4 0 1 0 0 0 1
#> GSM573752 4 0 1 0 0 0 1
#> GSM573795 4 0 1 0 0 0 1
#> GSM573796 4 0 1 0 0 0 1
#> GSM573797 4 0 1 0 0 0 1
#> GSM573741 4 0 1 0 0 0 1
#> GSM573742 4 0 1 0 0 0 1
#> GSM573743 4 0 1 0 0 0 1
#> GSM573738 4 0 1 0 0 0 1
#> GSM573739 4 0 1 0 0 0 1
#> GSM573740 4 0 1 0 0 0 1
#> GSM573792 4 0 1 0 0 0 1
#> GSM573793 4 0 1 0 0 0 1
#> GSM573794 4 0 1 0 0 0 1
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM573726 1 0.0162 0.998 0.996 0.000 0.000 0.000 NA
#> GSM573727 1 0.0162 0.998 0.996 0.000 0.000 0.000 NA
#> GSM573728 1 0.0162 0.998 0.996 0.000 0.000 0.000 NA
#> GSM573729 1 0.0162 0.998 0.996 0.000 0.000 0.000 NA
#> GSM573730 1 0.0162 0.998 0.996 0.000 0.000 0.000 NA
#> GSM573731 1 0.0162 0.998 0.996 0.000 0.000 0.000 NA
#> GSM573735 1 0.0000 0.999 1.000 0.000 0.000 0.000 NA
#> GSM573736 1 0.0000 0.999 1.000 0.000 0.000 0.000 NA
#> GSM573737 1 0.0000 0.999 1.000 0.000 0.000 0.000 NA
#> GSM573732 1 0.0000 0.999 1.000 0.000 0.000 0.000 NA
#> GSM573733 1 0.0000 0.999 1.000 0.000 0.000 0.000 NA
#> GSM573734 1 0.0000 0.999 1.000 0.000 0.000 0.000 NA
#> GSM573789 1 0.0000 0.999 1.000 0.000 0.000 0.000 NA
#> GSM573790 1 0.0000 0.999 1.000 0.000 0.000 0.000 NA
#> GSM573791 1 0.0000 0.999 1.000 0.000 0.000 0.000 NA
#> GSM573723 1 0.0162 0.998 0.996 0.000 0.000 0.000 NA
#> GSM573724 1 0.0162 0.998 0.996 0.000 0.000 0.000 NA
#> GSM573725 1 0.0162 0.998 0.996 0.000 0.000 0.000 NA
#> GSM573720 1 0.0162 0.998 0.996 0.000 0.000 0.000 NA
#> GSM573721 1 0.0000 0.999 1.000 0.000 0.000 0.000 NA
#> GSM573722 1 0.0162 0.998 0.996 0.000 0.000 0.000 NA
#> GSM573786 1 0.0000 0.999 1.000 0.000 0.000 0.000 NA
#> GSM573787 1 0.0000 0.999 1.000 0.000 0.000 0.000 NA
#> GSM573788 1 0.0000 0.999 1.000 0.000 0.000 0.000 NA
#> GSM573768 2 0.0000 0.998 0.000 1.000 0.000 0.000 NA
#> GSM573769 2 0.0000 0.998 0.000 1.000 0.000 0.000 NA
#> GSM573770 2 0.0000 0.998 0.000 1.000 0.000 0.000 NA
#> GSM573765 2 0.0000 0.998 0.000 1.000 0.000 0.000 NA
#> GSM573766 2 0.0000 0.998 0.000 1.000 0.000 0.000 NA
#> GSM573767 2 0.0000 0.998 0.000 1.000 0.000 0.000 NA
#> GSM573777 2 0.0290 0.996 0.000 0.992 0.000 0.000 NA
#> GSM573778 2 0.0290 0.996 0.000 0.992 0.000 0.000 NA
#> GSM573779 2 0.0290 0.996 0.000 0.992 0.000 0.000 NA
#> GSM573762 2 0.0162 0.998 0.000 0.996 0.000 0.000 NA
#> GSM573763 2 0.0162 0.998 0.000 0.996 0.000 0.000 NA
#> GSM573764 2 0.0162 0.998 0.000 0.996 0.000 0.000 NA
#> GSM573771 2 0.0162 0.998 0.000 0.996 0.000 0.000 NA
#> GSM573772 2 0.0162 0.998 0.000 0.996 0.000 0.000 NA
#> GSM573773 2 0.0162 0.998 0.000 0.996 0.000 0.000 NA
#> GSM573759 2 0.0000 0.998 0.000 1.000 0.000 0.000 NA
#> GSM573760 2 0.0000 0.998 0.000 1.000 0.000 0.000 NA
#> GSM573761 2 0.0000 0.998 0.000 1.000 0.000 0.000 NA
#> GSM573774 2 0.0000 0.998 0.000 1.000 0.000 0.000 NA
#> GSM573775 2 0.0000 0.998 0.000 1.000 0.000 0.000 NA
#> GSM573776 2 0.0000 0.998 0.000 1.000 0.000 0.000 NA
#> GSM573756 2 0.0162 0.997 0.000 0.996 0.000 0.000 NA
#> GSM573757 2 0.0162 0.997 0.000 0.996 0.000 0.000 NA
#> GSM573758 2 0.0162 0.997 0.000 0.996 0.000 0.000 NA
#> GSM573708 3 0.0510 0.991 0.000 0.000 0.984 0.000 NA
#> GSM573709 3 0.0510 0.991 0.000 0.000 0.984 0.000 NA
#> GSM573710 3 0.0510 0.991 0.000 0.000 0.984 0.000 NA
#> GSM573711 3 0.0510 0.991 0.000 0.000 0.984 0.000 NA
#> GSM573712 3 0.0510 0.991 0.000 0.000 0.984 0.000 NA
#> GSM573713 3 0.0510 0.991 0.000 0.000 0.984 0.000 NA
#> GSM573717 3 0.0162 0.994 0.000 0.000 0.996 0.000 NA
#> GSM573718 3 0.0162 0.994 0.000 0.000 0.996 0.000 NA
#> GSM573719 3 0.0162 0.994 0.000 0.000 0.996 0.000 NA
#> GSM573714 3 0.0162 0.994 0.000 0.000 0.996 0.000 NA
#> GSM573715 3 0.0162 0.994 0.000 0.000 0.996 0.000 NA
#> GSM573716 3 0.0162 0.994 0.000 0.000 0.996 0.000 NA
#> GSM573780 3 0.0703 0.988 0.000 0.000 0.976 0.000 NA
#> GSM573781 3 0.0794 0.986 0.000 0.000 0.972 0.000 NA
#> GSM573782 3 0.0703 0.988 0.000 0.000 0.976 0.000 NA
#> GSM573705 3 0.0162 0.994 0.000 0.000 0.996 0.000 NA
#> GSM573706 3 0.0162 0.994 0.000 0.000 0.996 0.000 NA
#> GSM573707 3 0.0162 0.994 0.000 0.000 0.996 0.000 NA
#> GSM573702 3 0.0162 0.994 0.000 0.000 0.996 0.000 NA
#> GSM573703 3 0.0162 0.994 0.000 0.000 0.996 0.000 NA
#> GSM573704 3 0.0000 0.993 0.000 0.000 1.000 0.000 NA
#> GSM573783 3 0.0162 0.993 0.000 0.000 0.996 0.000 NA
#> GSM573784 3 0.0162 0.993 0.000 0.000 0.996 0.000 NA
#> GSM573785 3 0.0162 0.993 0.000 0.000 0.996 0.000 NA
#> GSM573744 4 0.0000 1.000 0.000 0.000 0.000 1.000 NA
#> GSM573745 4 0.0000 1.000 0.000 0.000 0.000 1.000 NA
#> GSM573746 4 0.0000 1.000 0.000 0.000 0.000 1.000 NA
#> GSM573747 4 0.0000 1.000 0.000 0.000 0.000 1.000 NA
#> GSM573748 4 0.0000 1.000 0.000 0.000 0.000 1.000 NA
#> GSM573749 4 0.0000 1.000 0.000 0.000 0.000 1.000 NA
#> GSM573753 4 0.0000 1.000 0.000 0.000 0.000 1.000 NA
#> GSM573754 4 0.0000 1.000 0.000 0.000 0.000 1.000 NA
#> GSM573755 4 0.0000 1.000 0.000 0.000 0.000 1.000 NA
#> GSM573750 4 0.0000 1.000 0.000 0.000 0.000 1.000 NA
#> GSM573751 4 0.0000 1.000 0.000 0.000 0.000 1.000 NA
#> GSM573752 4 0.0000 1.000 0.000 0.000 0.000 1.000 NA
#> GSM573795 4 0.0000 1.000 0.000 0.000 0.000 1.000 NA
#> GSM573796 4 0.0162 0.997 0.000 0.000 0.000 0.996 NA
#> GSM573797 4 0.0000 1.000 0.000 0.000 0.000 1.000 NA
#> GSM573741 4 0.0000 1.000 0.000 0.000 0.000 1.000 NA
#> GSM573742 4 0.0000 1.000 0.000 0.000 0.000 1.000 NA
#> GSM573743 4 0.0000 1.000 0.000 0.000 0.000 1.000 NA
#> GSM573738 4 0.0000 1.000 0.000 0.000 0.000 1.000 NA
#> GSM573739 4 0.0000 1.000 0.000 0.000 0.000 1.000 NA
#> GSM573740 4 0.0000 1.000 0.000 0.000 0.000 1.000 NA
#> GSM573792 4 0.0000 1.000 0.000 0.000 0.000 1.000 NA
#> GSM573793 4 0.0000 1.000 0.000 0.000 0.000 1.000 NA
#> GSM573794 4 0.0000 1.000 0.000 0.000 0.000 1.000 NA
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM573726 1 0.0000 0.998 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM573727 1 0.0000 0.998 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM573728 1 0.0000 0.998 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM573729 1 0.0000 0.998 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM573730 1 0.0000 0.998 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM573731 1 0.0000 0.998 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM573735 1 0.0146 0.997 0.996 0.000 0.000 0.000 0.004 0.000
#> GSM573736 1 0.0146 0.997 0.996 0.000 0.000 0.000 0.004 0.000
#> GSM573737 1 0.0146 0.997 0.996 0.000 0.000 0.000 0.004 0.000
#> GSM573732 1 0.0146 0.997 0.996 0.000 0.000 0.000 0.004 0.000
#> GSM573733 1 0.0146 0.997 0.996 0.000 0.000 0.000 0.004 0.000
#> GSM573734 1 0.0146 0.997 0.996 0.000 0.000 0.000 0.004 0.000
#> GSM573789 1 0.0000 0.998 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM573790 1 0.0146 0.997 0.996 0.000 0.000 0.000 0.004 0.000
#> GSM573791 1 0.0146 0.997 0.996 0.000 0.000 0.000 0.004 0.000
#> GSM573723 1 0.0000 0.998 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM573724 1 0.0000 0.998 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM573725 1 0.0000 0.998 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM573720 1 0.0000 0.998 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM573721 1 0.0000 0.998 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM573722 1 0.0000 0.998 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM573786 1 0.0291 0.995 0.992 0.000 0.000 0.000 0.004 0.004
#> GSM573787 1 0.0000 0.998 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM573788 1 0.0291 0.995 0.992 0.000 0.000 0.000 0.004 0.004
#> GSM573768 2 0.0692 0.985 0.000 0.976 0.000 0.000 0.020 0.004
#> GSM573769 2 0.0692 0.985 0.000 0.976 0.000 0.000 0.020 0.004
#> GSM573770 2 0.0692 0.985 0.000 0.976 0.000 0.000 0.020 0.004
#> GSM573765 2 0.0000 0.987 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM573766 2 0.0000 0.987 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM573767 2 0.0000 0.987 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM573777 2 0.0363 0.985 0.000 0.988 0.000 0.000 0.000 0.012
#> GSM573778 2 0.0260 0.986 0.000 0.992 0.000 0.000 0.000 0.008
#> GSM573779 2 0.0260 0.986 0.000 0.992 0.000 0.000 0.000 0.008
#> GSM573762 2 0.0260 0.986 0.000 0.992 0.000 0.000 0.000 0.008
#> GSM573763 2 0.0260 0.986 0.000 0.992 0.000 0.000 0.000 0.008
#> GSM573764 2 0.0260 0.986 0.000 0.992 0.000 0.000 0.000 0.008
#> GSM573771 2 0.0260 0.986 0.000 0.992 0.000 0.000 0.000 0.008
#> GSM573772 2 0.0260 0.986 0.000 0.992 0.000 0.000 0.000 0.008
#> GSM573773 2 0.0260 0.986 0.000 0.992 0.000 0.000 0.000 0.008
#> GSM573759 2 0.1010 0.980 0.000 0.960 0.000 0.000 0.036 0.004
#> GSM573760 2 0.0858 0.983 0.000 0.968 0.000 0.000 0.028 0.004
#> GSM573761 2 0.0858 0.983 0.000 0.968 0.000 0.000 0.028 0.004
#> GSM573774 2 0.0508 0.986 0.000 0.984 0.000 0.000 0.012 0.004
#> GSM573775 2 0.0405 0.987 0.000 0.988 0.000 0.000 0.008 0.004
#> GSM573776 2 0.0603 0.986 0.000 0.980 0.000 0.000 0.016 0.004
#> GSM573756 2 0.1219 0.975 0.000 0.948 0.000 0.000 0.048 0.004
#> GSM573757 2 0.1219 0.975 0.000 0.948 0.000 0.000 0.048 0.004
#> GSM573758 2 0.1219 0.975 0.000 0.948 0.000 0.000 0.048 0.004
#> GSM573708 3 0.2048 0.939 0.000 0.000 0.880 0.000 0.120 0.000
#> GSM573709 3 0.2048 0.939 0.000 0.000 0.880 0.000 0.120 0.000
#> GSM573710 3 0.2048 0.939 0.000 0.000 0.880 0.000 0.120 0.000
#> GSM573711 3 0.2048 0.939 0.000 0.000 0.880 0.000 0.120 0.000
#> GSM573712 3 0.2048 0.939 0.000 0.000 0.880 0.000 0.120 0.000
#> GSM573713 3 0.2048 0.939 0.000 0.000 0.880 0.000 0.120 0.000
#> GSM573717 3 0.0000 0.959 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM573718 3 0.0000 0.959 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM573719 3 0.0000 0.959 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM573714 3 0.0000 0.959 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM573715 3 0.0000 0.959 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM573716 3 0.0000 0.959 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM573780 3 0.2697 0.910 0.000 0.000 0.812 0.000 0.188 0.000
#> GSM573781 3 0.2762 0.906 0.000 0.000 0.804 0.000 0.196 0.000
#> GSM573782 3 0.2912 0.894 0.000 0.000 0.784 0.000 0.216 0.000
#> GSM573705 3 0.0000 0.959 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM573706 3 0.0000 0.959 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM573707 3 0.0000 0.959 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM573702 3 0.0000 0.959 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM573703 3 0.0000 0.959 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM573704 3 0.0000 0.959 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM573783 3 0.1049 0.956 0.000 0.000 0.960 0.000 0.032 0.008
#> GSM573784 3 0.1049 0.956 0.000 0.000 0.960 0.000 0.032 0.008
#> GSM573785 3 0.0972 0.956 0.000 0.000 0.964 0.000 0.028 0.008
#> GSM573744 4 0.0000 0.996 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM573745 4 0.0000 0.996 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM573746 4 0.0000 0.996 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM573747 4 0.0000 0.996 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM573748 4 0.0000 0.996 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM573749 4 0.0000 0.996 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM573753 4 0.0260 0.995 0.000 0.000 0.000 0.992 0.000 0.008
#> GSM573754 4 0.0260 0.995 0.000 0.000 0.000 0.992 0.000 0.008
#> GSM573755 4 0.0260 0.995 0.000 0.000 0.000 0.992 0.000 0.008
#> GSM573750 4 0.0260 0.995 0.000 0.000 0.000 0.992 0.000 0.008
#> GSM573751 4 0.0260 0.995 0.000 0.000 0.000 0.992 0.000 0.008
#> GSM573752 4 0.0260 0.995 0.000 0.000 0.000 0.992 0.000 0.008
#> GSM573795 4 0.0458 0.991 0.000 0.000 0.000 0.984 0.000 0.016
#> GSM573796 4 0.0547 0.989 0.000 0.000 0.000 0.980 0.000 0.020
#> GSM573797 4 0.0547 0.989 0.000 0.000 0.000 0.980 0.000 0.020
#> GSM573741 4 0.0000 0.996 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM573742 4 0.0000 0.996 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM573743 4 0.0000 0.996 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM573738 4 0.0000 0.996 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM573739 4 0.0000 0.996 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM573740 4 0.0000 0.996 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM573792 4 0.0405 0.994 0.000 0.000 0.000 0.988 0.004 0.008
#> GSM573793 4 0.0146 0.995 0.000 0.000 0.000 0.996 0.004 0.000
#> GSM573794 4 0.0146 0.995 0.000 0.000 0.000 0.996 0.004 0.000
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
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)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
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:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.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")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
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 cell.line(p) agent(p) k
#> MAD:NMF 70 6.31e-16 0.393 2
#> MAD:NMF 96 9.56e-39 0.741 3
#> MAD:NMF 96 9.14e-57 0.975 4
#> MAD:NMF 96 9.14e-57 0.975 5
#> MAD:NMF 96 9.14e-57 0.975 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.
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 46609 rows and 96 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'ATC' method.
#> Subgroups are detected by 'hclust' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 6.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.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:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).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)
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.3796 0.621 0.621
#> 3 3 1.000 1.000 1.000 0.6649 0.747 0.593
#> 4 4 1.000 1.000 1.000 0.1997 0.874 0.657
#> 5 5 0.947 0.964 0.938 0.0359 0.970 0.878
#> 6 6 0.987 0.989 0.989 0.0307 0.976 0.889
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 6
#> attr(,"optional")
#> [1] 2 3 4 5
There is also optional best \(k\) = 2 3 4 5 that is worth to check.
Following shows the table of the partitions (You need to click the show/hide
code output link to see it). The membership matrix (columns with name p*
)
is inferred by
clue::cl_consensus()
function with the SE
method. Basically the value in the membership matrix
represents the probability to belong to a certain group. The finall class
label for an item is determined with the group with highest probability it
belongs to.
In get_classes()
function, the entropy is calculated from the membership
matrix and the silhouette score is calculated from the consensus matrix.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> GSM573726 1 0 1 1 0
#> GSM573727 1 0 1 1 0
#> GSM573728 1 0 1 1 0
#> GSM573729 1 0 1 1 0
#> GSM573730 1 0 1 1 0
#> GSM573731 1 0 1 1 0
#> GSM573735 1 0 1 1 0
#> GSM573736 1 0 1 1 0
#> GSM573737 1 0 1 1 0
#> GSM573732 1 0 1 1 0
#> GSM573733 1 0 1 1 0
#> GSM573734 1 0 1 1 0
#> GSM573789 1 0 1 1 0
#> GSM573790 1 0 1 1 0
#> GSM573791 1 0 1 1 0
#> GSM573723 1 0 1 1 0
#> GSM573724 1 0 1 1 0
#> GSM573725 1 0 1 1 0
#> GSM573720 1 0 1 1 0
#> GSM573721 1 0 1 1 0
#> GSM573722 1 0 1 1 0
#> GSM573786 1 0 1 1 0
#> GSM573787 1 0 1 1 0
#> GSM573788 1 0 1 1 0
#> GSM573768 2 0 1 0 1
#> GSM573769 2 0 1 0 1
#> GSM573770 2 0 1 0 1
#> GSM573765 2 0 1 0 1
#> GSM573766 2 0 1 0 1
#> GSM573767 2 0 1 0 1
#> GSM573777 2 0 1 0 1
#> GSM573778 2 0 1 0 1
#> GSM573779 2 0 1 0 1
#> GSM573762 2 0 1 0 1
#> GSM573763 2 0 1 0 1
#> GSM573764 2 0 1 0 1
#> GSM573771 2 0 1 0 1
#> GSM573772 2 0 1 0 1
#> GSM573773 2 0 1 0 1
#> GSM573759 2 0 1 0 1
#> GSM573760 2 0 1 0 1
#> GSM573761 2 0 1 0 1
#> GSM573774 2 0 1 0 1
#> GSM573775 2 0 1 0 1
#> GSM573776 2 0 1 0 1
#> GSM573756 2 0 1 0 1
#> GSM573757 2 0 1 0 1
#> GSM573758 2 0 1 0 1
#> GSM573708 1 0 1 1 0
#> GSM573709 1 0 1 1 0
#> GSM573710 1 0 1 1 0
#> GSM573711 1 0 1 1 0
#> GSM573712 1 0 1 1 0
#> GSM573713 1 0 1 1 0
#> GSM573717 1 0 1 1 0
#> GSM573718 1 0 1 1 0
#> GSM573719 1 0 1 1 0
#> GSM573714 1 0 1 1 0
#> GSM573715 1 0 1 1 0
#> GSM573716 1 0 1 1 0
#> GSM573780 1 0 1 1 0
#> GSM573781 1 0 1 1 0
#> GSM573782 1 0 1 1 0
#> GSM573705 1 0 1 1 0
#> GSM573706 1 0 1 1 0
#> GSM573707 1 0 1 1 0
#> GSM573702 1 0 1 1 0
#> GSM573703 1 0 1 1 0
#> GSM573704 1 0 1 1 0
#> GSM573783 1 0 1 1 0
#> GSM573784 1 0 1 1 0
#> GSM573785 1 0 1 1 0
#> GSM573744 1 0 1 1 0
#> GSM573745 1 0 1 1 0
#> GSM573746 1 0 1 1 0
#> GSM573747 1 0 1 1 0
#> GSM573748 1 0 1 1 0
#> GSM573749 1 0 1 1 0
#> GSM573753 1 0 1 1 0
#> GSM573754 1 0 1 1 0
#> GSM573755 1 0 1 1 0
#> GSM573750 1 0 1 1 0
#> GSM573751 1 0 1 1 0
#> GSM573752 1 0 1 1 0
#> GSM573795 1 0 1 1 0
#> GSM573796 1 0 1 1 0
#> GSM573797 1 0 1 1 0
#> GSM573741 1 0 1 1 0
#> GSM573742 1 0 1 1 0
#> GSM573743 1 0 1 1 0
#> GSM573738 1 0 1 1 0
#> GSM573739 1 0 1 1 0
#> GSM573740 1 0 1 1 0
#> GSM573792 1 0 1 1 0
#> GSM573793 1 0 1 1 0
#> GSM573794 1 0 1 1 0
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM573726 1 0 1 1 0 0
#> GSM573727 1 0 1 1 0 0
#> GSM573728 1 0 1 1 0 0
#> GSM573729 1 0 1 1 0 0
#> GSM573730 1 0 1 1 0 0
#> GSM573731 1 0 1 1 0 0
#> GSM573735 1 0 1 1 0 0
#> GSM573736 1 0 1 1 0 0
#> GSM573737 1 0 1 1 0 0
#> GSM573732 1 0 1 1 0 0
#> GSM573733 1 0 1 1 0 0
#> GSM573734 1 0 1 1 0 0
#> GSM573789 1 0 1 1 0 0
#> GSM573790 1 0 1 1 0 0
#> GSM573791 1 0 1 1 0 0
#> GSM573723 1 0 1 1 0 0
#> GSM573724 1 0 1 1 0 0
#> GSM573725 1 0 1 1 0 0
#> GSM573720 1 0 1 1 0 0
#> GSM573721 1 0 1 1 0 0
#> GSM573722 1 0 1 1 0 0
#> GSM573786 1 0 1 1 0 0
#> GSM573787 1 0 1 1 0 0
#> GSM573788 1 0 1 1 0 0
#> GSM573768 2 0 1 0 1 0
#> GSM573769 2 0 1 0 1 0
#> GSM573770 2 0 1 0 1 0
#> GSM573765 2 0 1 0 1 0
#> GSM573766 2 0 1 0 1 0
#> GSM573767 2 0 1 0 1 0
#> GSM573777 2 0 1 0 1 0
#> GSM573778 2 0 1 0 1 0
#> GSM573779 2 0 1 0 1 0
#> GSM573762 2 0 1 0 1 0
#> GSM573763 2 0 1 0 1 0
#> GSM573764 2 0 1 0 1 0
#> GSM573771 2 0 1 0 1 0
#> GSM573772 2 0 1 0 1 0
#> GSM573773 2 0 1 0 1 0
#> GSM573759 2 0 1 0 1 0
#> GSM573760 2 0 1 0 1 0
#> GSM573761 2 0 1 0 1 0
#> GSM573774 2 0 1 0 1 0
#> GSM573775 2 0 1 0 1 0
#> GSM573776 2 0 1 0 1 0
#> GSM573756 2 0 1 0 1 0
#> GSM573757 2 0 1 0 1 0
#> GSM573758 2 0 1 0 1 0
#> GSM573708 3 0 1 0 0 1
#> GSM573709 3 0 1 0 0 1
#> GSM573710 3 0 1 0 0 1
#> GSM573711 3 0 1 0 0 1
#> GSM573712 3 0 1 0 0 1
#> GSM573713 3 0 1 0 0 1
#> GSM573717 3 0 1 0 0 1
#> GSM573718 3 0 1 0 0 1
#> GSM573719 3 0 1 0 0 1
#> GSM573714 3 0 1 0 0 1
#> GSM573715 3 0 1 0 0 1
#> GSM573716 3 0 1 0 0 1
#> GSM573780 3 0 1 0 0 1
#> GSM573781 3 0 1 0 0 1
#> GSM573782 3 0 1 0 0 1
#> GSM573705 3 0 1 0 0 1
#> GSM573706 3 0 1 0 0 1
#> GSM573707 3 0 1 0 0 1
#> GSM573702 3 0 1 0 0 1
#> GSM573703 3 0 1 0 0 1
#> GSM573704 3 0 1 0 0 1
#> GSM573783 3 0 1 0 0 1
#> GSM573784 3 0 1 0 0 1
#> GSM573785 3 0 1 0 0 1
#> GSM573744 1 0 1 1 0 0
#> GSM573745 1 0 1 1 0 0
#> GSM573746 1 0 1 1 0 0
#> GSM573747 1 0 1 1 0 0
#> GSM573748 1 0 1 1 0 0
#> GSM573749 1 0 1 1 0 0
#> GSM573753 1 0 1 1 0 0
#> GSM573754 1 0 1 1 0 0
#> GSM573755 1 0 1 1 0 0
#> GSM573750 1 0 1 1 0 0
#> GSM573751 1 0 1 1 0 0
#> GSM573752 1 0 1 1 0 0
#> GSM573795 1 0 1 1 0 0
#> GSM573796 1 0 1 1 0 0
#> GSM573797 1 0 1 1 0 0
#> GSM573741 1 0 1 1 0 0
#> GSM573742 1 0 1 1 0 0
#> GSM573743 1 0 1 1 0 0
#> GSM573738 1 0 1 1 0 0
#> GSM573739 1 0 1 1 0 0
#> GSM573740 1 0 1 1 0 0
#> GSM573792 1 0 1 1 0 0
#> GSM573793 1 0 1 1 0 0
#> GSM573794 1 0 1 1 0 0
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM573726 1 0 1 1 0 0 0
#> GSM573727 1 0 1 1 0 0 0
#> GSM573728 1 0 1 1 0 0 0
#> GSM573729 1 0 1 1 0 0 0
#> GSM573730 1 0 1 1 0 0 0
#> GSM573731 1 0 1 1 0 0 0
#> GSM573735 1 0 1 1 0 0 0
#> GSM573736 1 0 1 1 0 0 0
#> GSM573737 1 0 1 1 0 0 0
#> GSM573732 1 0 1 1 0 0 0
#> GSM573733 1 0 1 1 0 0 0
#> GSM573734 1 0 1 1 0 0 0
#> GSM573789 1 0 1 1 0 0 0
#> GSM573790 1 0 1 1 0 0 0
#> GSM573791 1 0 1 1 0 0 0
#> GSM573723 1 0 1 1 0 0 0
#> GSM573724 1 0 1 1 0 0 0
#> GSM573725 1 0 1 1 0 0 0
#> GSM573720 1 0 1 1 0 0 0
#> GSM573721 1 0 1 1 0 0 0
#> GSM573722 1 0 1 1 0 0 0
#> GSM573786 1 0 1 1 0 0 0
#> GSM573787 1 0 1 1 0 0 0
#> GSM573788 1 0 1 1 0 0 0
#> GSM573768 2 0 1 0 1 0 0
#> GSM573769 2 0 1 0 1 0 0
#> GSM573770 2 0 1 0 1 0 0
#> GSM573765 2 0 1 0 1 0 0
#> GSM573766 2 0 1 0 1 0 0
#> GSM573767 2 0 1 0 1 0 0
#> GSM573777 2 0 1 0 1 0 0
#> GSM573778 2 0 1 0 1 0 0
#> GSM573779 2 0 1 0 1 0 0
#> GSM573762 2 0 1 0 1 0 0
#> GSM573763 2 0 1 0 1 0 0
#> GSM573764 2 0 1 0 1 0 0
#> GSM573771 2 0 1 0 1 0 0
#> GSM573772 2 0 1 0 1 0 0
#> GSM573773 2 0 1 0 1 0 0
#> GSM573759 2 0 1 0 1 0 0
#> GSM573760 2 0 1 0 1 0 0
#> GSM573761 2 0 1 0 1 0 0
#> GSM573774 2 0 1 0 1 0 0
#> GSM573775 2 0 1 0 1 0 0
#> GSM573776 2 0 1 0 1 0 0
#> GSM573756 2 0 1 0 1 0 0
#> GSM573757 2 0 1 0 1 0 0
#> GSM573758 2 0 1 0 1 0 0
#> GSM573708 3 0 1 0 0 1 0
#> GSM573709 3 0 1 0 0 1 0
#> GSM573710 3 0 1 0 0 1 0
#> GSM573711 3 0 1 0 0 1 0
#> GSM573712 3 0 1 0 0 1 0
#> GSM573713 3 0 1 0 0 1 0
#> GSM573717 3 0 1 0 0 1 0
#> GSM573718 3 0 1 0 0 1 0
#> GSM573719 3 0 1 0 0 1 0
#> GSM573714 3 0 1 0 0 1 0
#> GSM573715 3 0 1 0 0 1 0
#> GSM573716 3 0 1 0 0 1 0
#> GSM573780 3 0 1 0 0 1 0
#> GSM573781 3 0 1 0 0 1 0
#> GSM573782 3 0 1 0 0 1 0
#> GSM573705 3 0 1 0 0 1 0
#> GSM573706 3 0 1 0 0 1 0
#> GSM573707 3 0 1 0 0 1 0
#> GSM573702 3 0 1 0 0 1 0
#> GSM573703 3 0 1 0 0 1 0
#> GSM573704 3 0 1 0 0 1 0
#> GSM573783 3 0 1 0 0 1 0
#> GSM573784 3 0 1 0 0 1 0
#> GSM573785 3 0 1 0 0 1 0
#> GSM573744 4 0 1 0 0 0 1
#> GSM573745 4 0 1 0 0 0 1
#> GSM573746 4 0 1 0 0 0 1
#> GSM573747 4 0 1 0 0 0 1
#> GSM573748 4 0 1 0 0 0 1
#> GSM573749 4 0 1 0 0 0 1
#> GSM573753 4 0 1 0 0 0 1
#> GSM573754 4 0 1 0 0 0 1
#> GSM573755 4 0 1 0 0 0 1
#> GSM573750 4 0 1 0 0 0 1
#> GSM573751 4 0 1 0 0 0 1
#> GSM573752 4 0 1 0 0 0 1
#> GSM573795 4 0 1 0 0 0 1
#> GSM573796 4 0 1 0 0 0 1
#> GSM573797 4 0 1 0 0 0 1
#> GSM573741 4 0 1 0 0 0 1
#> GSM573742 4 0 1 0 0 0 1
#> GSM573743 4 0 1 0 0 0 1
#> GSM573738 4 0 1 0 0 0 1
#> GSM573739 4 0 1 0 0 0 1
#> GSM573740 4 0 1 0 0 0 1
#> GSM573792 4 0 1 0 0 0 1
#> GSM573793 4 0 1 0 0 0 1
#> GSM573794 4 0 1 0 0 0 1
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM573726 1 0.0000 1.000 1 0.000 0.000 0 0.000
#> GSM573727 1 0.0000 1.000 1 0.000 0.000 0 0.000
#> GSM573728 1 0.0000 1.000 1 0.000 0.000 0 0.000
#> GSM573729 1 0.0000 1.000 1 0.000 0.000 0 0.000
#> GSM573730 1 0.0000 1.000 1 0.000 0.000 0 0.000
#> GSM573731 1 0.0000 1.000 1 0.000 0.000 0 0.000
#> GSM573735 1 0.0000 1.000 1 0.000 0.000 0 0.000
#> GSM573736 1 0.0000 1.000 1 0.000 0.000 0 0.000
#> GSM573737 1 0.0000 1.000 1 0.000 0.000 0 0.000
#> GSM573732 1 0.0000 1.000 1 0.000 0.000 0 0.000
#> GSM573733 1 0.0000 1.000 1 0.000 0.000 0 0.000
#> GSM573734 1 0.0000 1.000 1 0.000 0.000 0 0.000
#> GSM573789 1 0.0000 1.000 1 0.000 0.000 0 0.000
#> GSM573790 1 0.0000 1.000 1 0.000 0.000 0 0.000
#> GSM573791 1 0.0000 1.000 1 0.000 0.000 0 0.000
#> GSM573723 1 0.0000 1.000 1 0.000 0.000 0 0.000
#> GSM573724 1 0.0000 1.000 1 0.000 0.000 0 0.000
#> GSM573725 1 0.0000 1.000 1 0.000 0.000 0 0.000
#> GSM573720 1 0.0000 1.000 1 0.000 0.000 0 0.000
#> GSM573721 1 0.0000 1.000 1 0.000 0.000 0 0.000
#> GSM573722 1 0.0000 1.000 1 0.000 0.000 0 0.000
#> GSM573786 1 0.0000 1.000 1 0.000 0.000 0 0.000
#> GSM573787 1 0.0000 1.000 1 0.000 0.000 0 0.000
#> GSM573788 1 0.0000 1.000 1 0.000 0.000 0 0.000
#> GSM573768 2 0.0000 0.910 0 1.000 0.000 0 0.000
#> GSM573769 2 0.0162 0.909 0 0.996 0.000 0 0.004
#> GSM573770 2 0.0162 0.909 0 0.996 0.000 0 0.004
#> GSM573765 2 0.0000 0.910 0 1.000 0.000 0 0.000
#> GSM573766 2 0.0000 0.910 0 1.000 0.000 0 0.000
#> GSM573767 2 0.0000 0.910 0 1.000 0.000 0 0.000
#> GSM573777 2 0.0000 0.910 0 1.000 0.000 0 0.000
#> GSM573778 2 0.0000 0.910 0 1.000 0.000 0 0.000
#> GSM573779 2 0.0000 0.910 0 1.000 0.000 0 0.000
#> GSM573762 2 0.0000 0.910 0 1.000 0.000 0 0.000
#> GSM573763 2 0.0000 0.910 0 1.000 0.000 0 0.000
#> GSM573764 2 0.0000 0.910 0 1.000 0.000 0 0.000
#> GSM573771 2 0.0000 0.910 0 1.000 0.000 0 0.000
#> GSM573772 2 0.0000 0.910 0 1.000 0.000 0 0.000
#> GSM573773 2 0.0000 0.910 0 1.000 0.000 0 0.000
#> GSM573759 2 0.4171 0.691 0 0.604 0.000 0 0.396
#> GSM573760 2 0.4171 0.691 0 0.604 0.000 0 0.396
#> GSM573761 2 0.4171 0.691 0 0.604 0.000 0 0.396
#> GSM573774 2 0.0162 0.909 0 0.996 0.000 0 0.004
#> GSM573775 2 0.0162 0.909 0 0.996 0.000 0 0.004
#> GSM573776 2 0.0000 0.910 0 1.000 0.000 0 0.000
#> GSM573756 2 0.4171 0.691 0 0.604 0.000 0 0.396
#> GSM573757 2 0.4171 0.691 0 0.604 0.000 0 0.396
#> GSM573758 2 0.4171 0.691 0 0.604 0.000 0 0.396
#> GSM573708 5 0.4171 1.000 0 0.000 0.396 0 0.604
#> GSM573709 5 0.4171 1.000 0 0.000 0.396 0 0.604
#> GSM573710 5 0.4171 1.000 0 0.000 0.396 0 0.604
#> GSM573711 5 0.4171 1.000 0 0.000 0.396 0 0.604
#> GSM573712 5 0.4171 1.000 0 0.000 0.396 0 0.604
#> GSM573713 5 0.4171 1.000 0 0.000 0.396 0 0.604
#> GSM573717 3 0.0000 1.000 0 0.000 1.000 0 0.000
#> GSM573718 3 0.0000 1.000 0 0.000 1.000 0 0.000
#> GSM573719 3 0.0000 1.000 0 0.000 1.000 0 0.000
#> GSM573714 3 0.0000 1.000 0 0.000 1.000 0 0.000
#> GSM573715 3 0.0000 1.000 0 0.000 1.000 0 0.000
#> GSM573716 3 0.0000 1.000 0 0.000 1.000 0 0.000
#> GSM573780 5 0.4171 1.000 0 0.000 0.396 0 0.604
#> GSM573781 5 0.4171 1.000 0 0.000 0.396 0 0.604
#> GSM573782 5 0.4171 1.000 0 0.000 0.396 0 0.604
#> GSM573705 3 0.0000 1.000 0 0.000 1.000 0 0.000
#> GSM573706 3 0.0000 1.000 0 0.000 1.000 0 0.000
#> GSM573707 3 0.0000 1.000 0 0.000 1.000 0 0.000
#> GSM573702 3 0.0000 1.000 0 0.000 1.000 0 0.000
#> GSM573703 3 0.0000 1.000 0 0.000 1.000 0 0.000
#> GSM573704 3 0.0000 1.000 0 0.000 1.000 0 0.000
#> GSM573783 3 0.0000 1.000 0 0.000 1.000 0 0.000
#> GSM573784 3 0.0000 1.000 0 0.000 1.000 0 0.000
#> GSM573785 3 0.0000 1.000 0 0.000 1.000 0 0.000
#> GSM573744 4 0.0000 1.000 0 0.000 0.000 1 0.000
#> GSM573745 4 0.0000 1.000 0 0.000 0.000 1 0.000
#> GSM573746 4 0.0000 1.000 0 0.000 0.000 1 0.000
#> GSM573747 4 0.0000 1.000 0 0.000 0.000 1 0.000
#> GSM573748 4 0.0000 1.000 0 0.000 0.000 1 0.000
#> GSM573749 4 0.0000 1.000 0 0.000 0.000 1 0.000
#> GSM573753 4 0.0000 1.000 0 0.000 0.000 1 0.000
#> GSM573754 4 0.0000 1.000 0 0.000 0.000 1 0.000
#> GSM573755 4 0.0000 1.000 0 0.000 0.000 1 0.000
#> GSM573750 4 0.0000 1.000 0 0.000 0.000 1 0.000
#> GSM573751 4 0.0000 1.000 0 0.000 0.000 1 0.000
#> GSM573752 4 0.0000 1.000 0 0.000 0.000 1 0.000
#> GSM573795 4 0.0000 1.000 0 0.000 0.000 1 0.000
#> GSM573796 4 0.0000 1.000 0 0.000 0.000 1 0.000
#> GSM573797 4 0.0000 1.000 0 0.000 0.000 1 0.000
#> GSM573741 4 0.0000 1.000 0 0.000 0.000 1 0.000
#> GSM573742 4 0.0000 1.000 0 0.000 0.000 1 0.000
#> GSM573743 4 0.0000 1.000 0 0.000 0.000 1 0.000
#> GSM573738 4 0.0000 1.000 0 0.000 0.000 1 0.000
#> GSM573739 4 0.0000 1.000 0 0.000 0.000 1 0.000
#> GSM573740 4 0.0000 1.000 0 0.000 0.000 1 0.000
#> GSM573792 4 0.0000 1.000 0 0.000 0.000 1 0.000
#> GSM573793 4 0.0000 1.000 0 0.000 0.000 1 0.000
#> GSM573794 4 0.0000 1.000 0 0.000 0.000 1 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM573726 1 0.0000 1.000 1 0.000 0 0.000 0 0.000
#> GSM573727 1 0.0000 1.000 1 0.000 0 0.000 0 0.000
#> GSM573728 1 0.0000 1.000 1 0.000 0 0.000 0 0.000
#> GSM573729 1 0.0000 1.000 1 0.000 0 0.000 0 0.000
#> GSM573730 1 0.0000 1.000 1 0.000 0 0.000 0 0.000
#> GSM573731 1 0.0000 1.000 1 0.000 0 0.000 0 0.000
#> GSM573735 1 0.0000 1.000 1 0.000 0 0.000 0 0.000
#> GSM573736 1 0.0000 1.000 1 0.000 0 0.000 0 0.000
#> GSM573737 1 0.0000 1.000 1 0.000 0 0.000 0 0.000
#> GSM573732 1 0.0000 1.000 1 0.000 0 0.000 0 0.000
#> GSM573733 1 0.0000 1.000 1 0.000 0 0.000 0 0.000
#> GSM573734 1 0.0000 1.000 1 0.000 0 0.000 0 0.000
#> GSM573789 1 0.0000 1.000 1 0.000 0 0.000 0 0.000
#> GSM573790 1 0.0000 1.000 1 0.000 0 0.000 0 0.000
#> GSM573791 1 0.0000 1.000 1 0.000 0 0.000 0 0.000
#> GSM573723 1 0.0000 1.000 1 0.000 0 0.000 0 0.000
#> GSM573724 1 0.0000 1.000 1 0.000 0 0.000 0 0.000
#> GSM573725 1 0.0000 1.000 1 0.000 0 0.000 0 0.000
#> GSM573720 1 0.0000 1.000 1 0.000 0 0.000 0 0.000
#> GSM573721 1 0.0000 1.000 1 0.000 0 0.000 0 0.000
#> GSM573722 1 0.0000 1.000 1 0.000 0 0.000 0 0.000
#> GSM573786 1 0.0000 1.000 1 0.000 0 0.000 0 0.000
#> GSM573787 1 0.0000 1.000 1 0.000 0 0.000 0 0.000
#> GSM573788 1 0.0000 1.000 1 0.000 0 0.000 0 0.000
#> GSM573768 2 0.0000 0.997 0 1.000 0 0.000 0 0.000
#> GSM573769 2 0.0363 0.988 0 0.988 0 0.000 0 0.012
#> GSM573770 2 0.0363 0.988 0 0.988 0 0.000 0 0.012
#> GSM573765 2 0.0000 0.997 0 1.000 0 0.000 0 0.000
#> GSM573766 2 0.0000 0.997 0 1.000 0 0.000 0 0.000
#> GSM573767 2 0.0000 0.997 0 1.000 0 0.000 0 0.000
#> GSM573777 2 0.0000 0.997 0 1.000 0 0.000 0 0.000
#> GSM573778 2 0.0000 0.997 0 1.000 0 0.000 0 0.000
#> GSM573779 2 0.0000 0.997 0 1.000 0 0.000 0 0.000
#> GSM573762 2 0.0000 0.997 0 1.000 0 0.000 0 0.000
#> GSM573763 2 0.0000 0.997 0 1.000 0 0.000 0 0.000
#> GSM573764 2 0.0000 0.997 0 1.000 0 0.000 0 0.000
#> GSM573771 2 0.0000 0.997 0 1.000 0 0.000 0 0.000
#> GSM573772 2 0.0000 0.997 0 1.000 0 0.000 0 0.000
#> GSM573773 2 0.0000 0.997 0 1.000 0 0.000 0 0.000
#> GSM573759 6 0.2793 0.903 0 0.200 0 0.000 0 0.800
#> GSM573760 6 0.2793 0.903 0 0.200 0 0.000 0 0.800
#> GSM573761 6 0.2793 0.903 0 0.200 0 0.000 0 0.800
#> GSM573774 2 0.0363 0.988 0 0.988 0 0.000 0 0.012
#> GSM573775 2 0.0363 0.988 0 0.988 0 0.000 0 0.012
#> GSM573776 2 0.0000 0.997 0 1.000 0 0.000 0 0.000
#> GSM573756 6 0.1444 0.901 0 0.072 0 0.000 0 0.928
#> GSM573757 6 0.1444 0.901 0 0.072 0 0.000 0 0.928
#> GSM573758 6 0.1444 0.901 0 0.072 0 0.000 0 0.928
#> GSM573708 5 0.0000 1.000 0 0.000 0 0.000 1 0.000
#> GSM573709 5 0.0000 1.000 0 0.000 0 0.000 1 0.000
#> GSM573710 5 0.0000 1.000 0 0.000 0 0.000 1 0.000
#> GSM573711 5 0.0000 1.000 0 0.000 0 0.000 1 0.000
#> GSM573712 5 0.0000 1.000 0 0.000 0 0.000 1 0.000
#> GSM573713 5 0.0000 1.000 0 0.000 0 0.000 1 0.000
#> GSM573717 3 0.0000 1.000 0 0.000 1 0.000 0 0.000
#> GSM573718 3 0.0000 1.000 0 0.000 1 0.000 0 0.000
#> GSM573719 3 0.0000 1.000 0 0.000 1 0.000 0 0.000
#> GSM573714 3 0.0000 1.000 0 0.000 1 0.000 0 0.000
#> GSM573715 3 0.0000 1.000 0 0.000 1 0.000 0 0.000
#> GSM573716 3 0.0000 1.000 0 0.000 1 0.000 0 0.000
#> GSM573780 5 0.0000 1.000 0 0.000 0 0.000 1 0.000
#> GSM573781 5 0.0000 1.000 0 0.000 0 0.000 1 0.000
#> GSM573782 5 0.0000 1.000 0 0.000 0 0.000 1 0.000
#> GSM573705 3 0.0000 1.000 0 0.000 1 0.000 0 0.000
#> GSM573706 3 0.0000 1.000 0 0.000 1 0.000 0 0.000
#> GSM573707 3 0.0000 1.000 0 0.000 1 0.000 0 0.000
#> GSM573702 3 0.0000 1.000 0 0.000 1 0.000 0 0.000
#> GSM573703 3 0.0000 1.000 0 0.000 1 0.000 0 0.000
#> GSM573704 3 0.0000 1.000 0 0.000 1 0.000 0 0.000
#> GSM573783 3 0.0000 1.000 0 0.000 1 0.000 0 0.000
#> GSM573784 3 0.0000 1.000 0 0.000 1 0.000 0 0.000
#> GSM573785 3 0.0000 1.000 0 0.000 1 0.000 0 0.000
#> GSM573744 4 0.0000 0.991 0 0.000 0 1.000 0 0.000
#> GSM573745 4 0.0000 0.991 0 0.000 0 1.000 0 0.000
#> GSM573746 4 0.0000 0.991 0 0.000 0 1.000 0 0.000
#> GSM573747 4 0.0000 0.991 0 0.000 0 1.000 0 0.000
#> GSM573748 4 0.0000 0.991 0 0.000 0 1.000 0 0.000
#> GSM573749 4 0.0000 0.991 0 0.000 0 1.000 0 0.000
#> GSM573753 4 0.0000 0.991 0 0.000 0 1.000 0 0.000
#> GSM573754 4 0.0000 0.991 0 0.000 0 1.000 0 0.000
#> GSM573755 4 0.0000 0.991 0 0.000 0 1.000 0 0.000
#> GSM573750 4 0.0000 0.991 0 0.000 0 1.000 0 0.000
#> GSM573751 4 0.0000 0.991 0 0.000 0 1.000 0 0.000
#> GSM573752 4 0.0000 0.991 0 0.000 0 1.000 0 0.000
#> GSM573795 4 0.1444 0.938 0 0.000 0 0.928 0 0.072
#> GSM573796 4 0.1444 0.938 0 0.000 0 0.928 0 0.072
#> GSM573797 4 0.1444 0.938 0 0.000 0 0.928 0 0.072
#> GSM573741 4 0.0000 0.991 0 0.000 0 1.000 0 0.000
#> GSM573742 4 0.0000 0.991 0 0.000 0 1.000 0 0.000
#> GSM573743 4 0.0000 0.991 0 0.000 0 1.000 0 0.000
#> GSM573738 4 0.0000 0.991 0 0.000 0 1.000 0 0.000
#> GSM573739 4 0.0000 0.991 0 0.000 0 1.000 0 0.000
#> GSM573740 4 0.0000 0.991 0 0.000 0 1.000 0 0.000
#> GSM573792 4 0.0000 0.991 0 0.000 0 1.000 0 0.000
#> GSM573793 4 0.0000 0.991 0 0.000 0 1.000 0 0.000
#> GSM573794 4 0.0000 0.991 0 0.000 0 1.000 0 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)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
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)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
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:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.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")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
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 cell.line(p) agent(p) k
#> ATC:hclust 96 1.13e-20 0.1730 2
#> ATC:hclust 96 9.56e-39 0.7410 3
#> ATC:hclust 96 9.14e-57 0.9750 4
#> ATC:hclust 96 1.55e-54 0.1758 5
#> ATC:hclust 96 1.73e-52 0.0087 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.
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 46609 rows and 96 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'ATC' method.
#> Subgroups are detected by 'kmeans' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 3.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.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:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).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)
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.747 0.962 0.956 0.3868 0.621 0.621
#> 3 3 0.589 0.885 0.853 0.5319 0.747 0.593
#> 4 4 0.670 0.956 0.780 0.1879 0.874 0.657
#> 5 5 0.715 0.885 0.813 0.0751 1.000 1.000
#> 6 6 0.693 0.600 0.780 0.0467 0.995 0.979
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 3
Following shows the table of the partitions (You need to click the show/hide
code output link to see it). The membership matrix (columns with name p*
)
is inferred by
clue::cl_consensus()
function with the SE
method. Basically the value in the membership matrix
represents the probability to belong to a certain group. The finall class
label for an item is determined with the group with highest probability it
belongs to.
In get_classes()
function, the entropy is calculated from the membership
matrix and the silhouette score is calculated from the consensus matrix.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> GSM573726 1 0.327 0.963 0.940 0.060
#> GSM573727 1 0.327 0.963 0.940 0.060
#> GSM573728 1 0.327 0.963 0.940 0.060
#> GSM573729 1 0.327 0.963 0.940 0.060
#> GSM573730 1 0.327 0.963 0.940 0.060
#> GSM573731 1 0.327 0.963 0.940 0.060
#> GSM573735 1 0.327 0.963 0.940 0.060
#> GSM573736 1 0.327 0.963 0.940 0.060
#> GSM573737 1 0.327 0.963 0.940 0.060
#> GSM573732 1 0.327 0.963 0.940 0.060
#> GSM573733 1 0.327 0.963 0.940 0.060
#> GSM573734 1 0.327 0.963 0.940 0.060
#> GSM573789 1 0.327 0.963 0.940 0.060
#> GSM573790 1 0.327 0.963 0.940 0.060
#> GSM573791 1 0.327 0.963 0.940 0.060
#> GSM573723 1 0.327 0.963 0.940 0.060
#> GSM573724 1 0.327 0.963 0.940 0.060
#> GSM573725 1 0.327 0.963 0.940 0.060
#> GSM573720 1 0.327 0.963 0.940 0.060
#> GSM573721 1 0.327 0.963 0.940 0.060
#> GSM573722 1 0.327 0.963 0.940 0.060
#> GSM573786 1 0.327 0.963 0.940 0.060
#> GSM573787 1 0.327 0.963 0.940 0.060
#> GSM573788 1 0.327 0.963 0.940 0.060
#> GSM573768 2 0.000 1.000 0.000 1.000
#> GSM573769 2 0.000 1.000 0.000 1.000
#> GSM573770 2 0.000 1.000 0.000 1.000
#> GSM573765 2 0.000 1.000 0.000 1.000
#> GSM573766 2 0.000 1.000 0.000 1.000
#> GSM573767 2 0.000 1.000 0.000 1.000
#> GSM573777 2 0.000 1.000 0.000 1.000
#> GSM573778 2 0.000 1.000 0.000 1.000
#> GSM573779 2 0.000 1.000 0.000 1.000
#> GSM573762 2 0.000 1.000 0.000 1.000
#> GSM573763 2 0.000 1.000 0.000 1.000
#> GSM573764 2 0.000 1.000 0.000 1.000
#> GSM573771 2 0.000 1.000 0.000 1.000
#> GSM573772 2 0.000 1.000 0.000 1.000
#> GSM573773 2 0.000 1.000 0.000 1.000
#> GSM573759 2 0.000 1.000 0.000 1.000
#> GSM573760 2 0.000 1.000 0.000 1.000
#> GSM573761 2 0.000 1.000 0.000 1.000
#> GSM573774 2 0.000 1.000 0.000 1.000
#> GSM573775 2 0.000 1.000 0.000 1.000
#> GSM573776 2 0.000 1.000 0.000 1.000
#> GSM573756 2 0.000 1.000 0.000 1.000
#> GSM573757 2 0.000 1.000 0.000 1.000
#> GSM573758 2 0.000 1.000 0.000 1.000
#> GSM573708 1 0.311 0.923 0.944 0.056
#> GSM573709 1 0.311 0.923 0.944 0.056
#> GSM573710 1 0.311 0.923 0.944 0.056
#> GSM573711 1 0.311 0.923 0.944 0.056
#> GSM573712 1 0.311 0.923 0.944 0.056
#> GSM573713 1 0.311 0.923 0.944 0.056
#> GSM573717 1 0.311 0.923 0.944 0.056
#> GSM573718 1 0.311 0.923 0.944 0.056
#> GSM573719 1 0.311 0.923 0.944 0.056
#> GSM573714 1 0.311 0.923 0.944 0.056
#> GSM573715 1 0.311 0.923 0.944 0.056
#> GSM573716 1 0.311 0.923 0.944 0.056
#> GSM573780 1 0.311 0.923 0.944 0.056
#> GSM573781 1 0.311 0.923 0.944 0.056
#> GSM573782 1 0.311 0.923 0.944 0.056
#> GSM573705 1 0.311 0.923 0.944 0.056
#> GSM573706 1 0.311 0.923 0.944 0.056
#> GSM573707 1 0.311 0.923 0.944 0.056
#> GSM573702 1 0.311 0.923 0.944 0.056
#> GSM573703 1 0.311 0.923 0.944 0.056
#> GSM573704 1 0.311 0.923 0.944 0.056
#> GSM573783 1 0.311 0.923 0.944 0.056
#> GSM573784 1 0.311 0.923 0.944 0.056
#> GSM573785 1 0.311 0.923 0.944 0.056
#> GSM573744 1 0.327 0.963 0.940 0.060
#> GSM573745 1 0.327 0.963 0.940 0.060
#> GSM573746 1 0.327 0.963 0.940 0.060
#> GSM573747 1 0.327 0.963 0.940 0.060
#> GSM573748 1 0.327 0.963 0.940 0.060
#> GSM573749 1 0.327 0.963 0.940 0.060
#> GSM573753 1 0.327 0.963 0.940 0.060
#> GSM573754 1 0.327 0.963 0.940 0.060
#> GSM573755 1 0.327 0.963 0.940 0.060
#> GSM573750 1 0.327 0.963 0.940 0.060
#> GSM573751 1 0.327 0.963 0.940 0.060
#> GSM573752 1 0.327 0.963 0.940 0.060
#> GSM573795 1 0.327 0.963 0.940 0.060
#> GSM573796 1 0.327 0.963 0.940 0.060
#> GSM573797 1 0.327 0.963 0.940 0.060
#> GSM573741 1 0.327 0.963 0.940 0.060
#> GSM573742 1 0.327 0.963 0.940 0.060
#> GSM573743 1 0.327 0.963 0.940 0.060
#> GSM573738 1 0.327 0.963 0.940 0.060
#> GSM573739 1 0.327 0.963 0.940 0.060
#> GSM573740 1 0.327 0.963 0.940 0.060
#> GSM573792 1 0.327 0.963 0.940 0.060
#> GSM573793 1 0.327 0.963 0.940 0.060
#> GSM573794 1 0.327 0.963 0.940 0.060
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM573726 1 0.5216 0.820 0.740 0.000 0.260
#> GSM573727 1 0.5216 0.820 0.740 0.000 0.260
#> GSM573728 1 0.5216 0.820 0.740 0.000 0.260
#> GSM573729 1 0.5216 0.820 0.740 0.000 0.260
#> GSM573730 1 0.5216 0.820 0.740 0.000 0.260
#> GSM573731 1 0.5216 0.820 0.740 0.000 0.260
#> GSM573735 1 0.5216 0.820 0.740 0.000 0.260
#> GSM573736 1 0.5216 0.820 0.740 0.000 0.260
#> GSM573737 1 0.5216 0.820 0.740 0.000 0.260
#> GSM573732 1 0.5216 0.820 0.740 0.000 0.260
#> GSM573733 1 0.5216 0.820 0.740 0.000 0.260
#> GSM573734 1 0.5216 0.820 0.740 0.000 0.260
#> GSM573789 1 0.5216 0.820 0.740 0.000 0.260
#> GSM573790 1 0.5216 0.820 0.740 0.000 0.260
#> GSM573791 1 0.5216 0.820 0.740 0.000 0.260
#> GSM573723 1 0.5216 0.820 0.740 0.000 0.260
#> GSM573724 1 0.5216 0.820 0.740 0.000 0.260
#> GSM573725 1 0.5216 0.820 0.740 0.000 0.260
#> GSM573720 1 0.5216 0.820 0.740 0.000 0.260
#> GSM573721 1 0.5216 0.820 0.740 0.000 0.260
#> GSM573722 1 0.5216 0.820 0.740 0.000 0.260
#> GSM573786 1 0.5216 0.820 0.740 0.000 0.260
#> GSM573787 1 0.5216 0.820 0.740 0.000 0.260
#> GSM573788 1 0.5216 0.820 0.740 0.000 0.260
#> GSM573768 2 0.4473 0.937 0.008 0.828 0.164
#> GSM573769 2 0.4473 0.937 0.008 0.828 0.164
#> GSM573770 2 0.4473 0.937 0.008 0.828 0.164
#> GSM573765 2 0.0424 0.938 0.008 0.992 0.000
#> GSM573766 2 0.0424 0.938 0.008 0.992 0.000
#> GSM573767 2 0.0424 0.938 0.008 0.992 0.000
#> GSM573777 2 0.0661 0.937 0.008 0.988 0.004
#> GSM573778 2 0.0661 0.937 0.008 0.988 0.004
#> GSM573779 2 0.0661 0.937 0.008 0.988 0.004
#> GSM573762 2 0.0661 0.937 0.008 0.988 0.004
#> GSM573763 2 0.0661 0.937 0.008 0.988 0.004
#> GSM573764 2 0.0661 0.937 0.008 0.988 0.004
#> GSM573771 2 0.0661 0.937 0.008 0.988 0.004
#> GSM573772 2 0.0661 0.937 0.008 0.988 0.004
#> GSM573773 2 0.0661 0.937 0.008 0.988 0.004
#> GSM573759 2 0.4531 0.936 0.008 0.824 0.168
#> GSM573760 2 0.4531 0.936 0.008 0.824 0.168
#> GSM573761 2 0.4531 0.936 0.008 0.824 0.168
#> GSM573774 2 0.4413 0.937 0.008 0.832 0.160
#> GSM573775 2 0.4413 0.937 0.008 0.832 0.160
#> GSM573776 2 0.4413 0.937 0.008 0.832 0.160
#> GSM573756 2 0.4531 0.936 0.008 0.824 0.168
#> GSM573757 2 0.4531 0.936 0.008 0.824 0.168
#> GSM573758 2 0.4531 0.936 0.008 0.824 0.168
#> GSM573708 3 0.7250 0.995 0.396 0.032 0.572
#> GSM573709 3 0.7250 0.995 0.396 0.032 0.572
#> GSM573710 3 0.7250 0.995 0.396 0.032 0.572
#> GSM573711 3 0.7250 0.995 0.396 0.032 0.572
#> GSM573712 3 0.7250 0.995 0.396 0.032 0.572
#> GSM573713 3 0.7250 0.995 0.396 0.032 0.572
#> GSM573717 3 0.7030 0.997 0.396 0.024 0.580
#> GSM573718 3 0.7030 0.997 0.396 0.024 0.580
#> GSM573719 3 0.7030 0.997 0.396 0.024 0.580
#> GSM573714 3 0.7030 0.997 0.396 0.024 0.580
#> GSM573715 3 0.7030 0.997 0.396 0.024 0.580
#> GSM573716 3 0.7030 0.997 0.396 0.024 0.580
#> GSM573780 3 0.7250 0.995 0.396 0.032 0.572
#> GSM573781 3 0.7250 0.995 0.396 0.032 0.572
#> GSM573782 3 0.7250 0.995 0.396 0.032 0.572
#> GSM573705 3 0.7030 0.997 0.396 0.024 0.580
#> GSM573706 3 0.7030 0.997 0.396 0.024 0.580
#> GSM573707 3 0.7030 0.997 0.396 0.024 0.580
#> GSM573702 3 0.7030 0.997 0.396 0.024 0.580
#> GSM573703 3 0.7030 0.997 0.396 0.024 0.580
#> GSM573704 3 0.7030 0.997 0.396 0.024 0.580
#> GSM573783 3 0.7030 0.997 0.396 0.024 0.580
#> GSM573784 3 0.7030 0.997 0.396 0.024 0.580
#> GSM573785 3 0.7030 0.997 0.396 0.024 0.580
#> GSM573744 1 0.0000 0.787 1.000 0.000 0.000
#> GSM573745 1 0.0000 0.787 1.000 0.000 0.000
#> GSM573746 1 0.0000 0.787 1.000 0.000 0.000
#> GSM573747 1 0.0000 0.787 1.000 0.000 0.000
#> GSM573748 1 0.0000 0.787 1.000 0.000 0.000
#> GSM573749 1 0.0000 0.787 1.000 0.000 0.000
#> GSM573753 1 0.0000 0.787 1.000 0.000 0.000
#> GSM573754 1 0.0000 0.787 1.000 0.000 0.000
#> GSM573755 1 0.0000 0.787 1.000 0.000 0.000
#> GSM573750 1 0.0000 0.787 1.000 0.000 0.000
#> GSM573751 1 0.0000 0.787 1.000 0.000 0.000
#> GSM573752 1 0.0000 0.787 1.000 0.000 0.000
#> GSM573795 1 0.0000 0.787 1.000 0.000 0.000
#> GSM573796 1 0.0000 0.787 1.000 0.000 0.000
#> GSM573797 1 0.0000 0.787 1.000 0.000 0.000
#> GSM573741 1 0.0000 0.787 1.000 0.000 0.000
#> GSM573742 1 0.0000 0.787 1.000 0.000 0.000
#> GSM573743 1 0.0000 0.787 1.000 0.000 0.000
#> GSM573738 1 0.0000 0.787 1.000 0.000 0.000
#> GSM573739 1 0.0000 0.787 1.000 0.000 0.000
#> GSM573740 1 0.0000 0.787 1.000 0.000 0.000
#> GSM573792 1 0.0000 0.787 1.000 0.000 0.000
#> GSM573793 1 0.0000 0.787 1.000 0.000 0.000
#> GSM573794 1 0.0000 0.787 1.000 0.000 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM573726 1 0.0000 0.987 1.000 0.000 0.000 0.000
#> GSM573727 1 0.0000 0.987 1.000 0.000 0.000 0.000
#> GSM573728 1 0.0000 0.987 1.000 0.000 0.000 0.000
#> GSM573729 1 0.0000 0.987 1.000 0.000 0.000 0.000
#> GSM573730 1 0.0000 0.987 1.000 0.000 0.000 0.000
#> GSM573731 1 0.0000 0.987 1.000 0.000 0.000 0.000
#> GSM573735 1 0.0921 0.978 0.972 0.000 0.000 0.028
#> GSM573736 1 0.0921 0.978 0.972 0.000 0.000 0.028
#> GSM573737 1 0.0921 0.978 0.972 0.000 0.000 0.028
#> GSM573732 1 0.0921 0.978 0.972 0.000 0.000 0.028
#> GSM573733 1 0.0921 0.978 0.972 0.000 0.000 0.028
#> GSM573734 1 0.0921 0.978 0.972 0.000 0.000 0.028
#> GSM573789 1 0.1022 0.977 0.968 0.000 0.000 0.032
#> GSM573790 1 0.1022 0.977 0.968 0.000 0.000 0.032
#> GSM573791 1 0.1022 0.977 0.968 0.000 0.000 0.032
#> GSM573723 1 0.0000 0.987 1.000 0.000 0.000 0.000
#> GSM573724 1 0.0000 0.987 1.000 0.000 0.000 0.000
#> GSM573725 1 0.0000 0.987 1.000 0.000 0.000 0.000
#> GSM573720 1 0.0000 0.987 1.000 0.000 0.000 0.000
#> GSM573721 1 0.0000 0.987 1.000 0.000 0.000 0.000
#> GSM573722 1 0.0000 0.987 1.000 0.000 0.000 0.000
#> GSM573786 1 0.0336 0.984 0.992 0.000 0.000 0.008
#> GSM573787 1 0.0336 0.984 0.992 0.000 0.000 0.008
#> GSM573788 1 0.0336 0.984 0.992 0.000 0.000 0.008
#> GSM573768 2 0.0657 0.900 0.000 0.984 0.004 0.012
#> GSM573769 2 0.0657 0.900 0.000 0.984 0.004 0.012
#> GSM573770 2 0.0657 0.900 0.000 0.984 0.004 0.012
#> GSM573765 2 0.3751 0.904 0.000 0.800 0.004 0.196
#> GSM573766 2 0.3751 0.904 0.000 0.800 0.004 0.196
#> GSM573767 2 0.3751 0.904 0.000 0.800 0.004 0.196
#> GSM573777 2 0.4155 0.903 0.000 0.756 0.004 0.240
#> GSM573778 2 0.4155 0.903 0.000 0.756 0.004 0.240
#> GSM573779 2 0.4155 0.903 0.000 0.756 0.004 0.240
#> GSM573762 2 0.4155 0.903 0.000 0.756 0.004 0.240
#> GSM573763 2 0.4155 0.903 0.000 0.756 0.004 0.240
#> GSM573764 2 0.4155 0.903 0.000 0.756 0.004 0.240
#> GSM573771 2 0.4155 0.903 0.000 0.756 0.004 0.240
#> GSM573772 2 0.4155 0.903 0.000 0.756 0.004 0.240
#> GSM573773 2 0.4155 0.903 0.000 0.756 0.004 0.240
#> GSM573759 2 0.1975 0.897 0.000 0.936 0.048 0.016
#> GSM573760 2 0.1888 0.897 0.000 0.940 0.044 0.016
#> GSM573761 2 0.1888 0.897 0.000 0.940 0.044 0.016
#> GSM573774 2 0.0188 0.903 0.000 0.996 0.004 0.000
#> GSM573775 2 0.0188 0.903 0.000 0.996 0.004 0.000
#> GSM573776 2 0.0188 0.903 0.000 0.996 0.004 0.000
#> GSM573756 2 0.2142 0.897 0.000 0.928 0.056 0.016
#> GSM573757 2 0.2142 0.897 0.000 0.928 0.056 0.016
#> GSM573758 2 0.2142 0.897 0.000 0.928 0.056 0.016
#> GSM573708 3 0.4181 0.933 0.052 0.000 0.820 0.128
#> GSM573709 3 0.4181 0.933 0.052 0.000 0.820 0.128
#> GSM573710 3 0.4181 0.933 0.052 0.000 0.820 0.128
#> GSM573711 3 0.4181 0.933 0.052 0.000 0.820 0.128
#> GSM573712 3 0.4181 0.933 0.052 0.000 0.820 0.128
#> GSM573713 3 0.4181 0.933 0.052 0.000 0.820 0.128
#> GSM573717 3 0.1474 0.957 0.052 0.000 0.948 0.000
#> GSM573718 3 0.1474 0.957 0.052 0.000 0.948 0.000
#> GSM573719 3 0.1474 0.957 0.052 0.000 0.948 0.000
#> GSM573714 3 0.1474 0.957 0.052 0.000 0.948 0.000
#> GSM573715 3 0.1474 0.957 0.052 0.000 0.948 0.000
#> GSM573716 3 0.1474 0.957 0.052 0.000 0.948 0.000
#> GSM573780 3 0.4436 0.926 0.052 0.000 0.800 0.148
#> GSM573781 3 0.4436 0.926 0.052 0.000 0.800 0.148
#> GSM573782 3 0.4436 0.926 0.052 0.000 0.800 0.148
#> GSM573705 3 0.1474 0.957 0.052 0.000 0.948 0.000
#> GSM573706 3 0.1474 0.957 0.052 0.000 0.948 0.000
#> GSM573707 3 0.1474 0.957 0.052 0.000 0.948 0.000
#> GSM573702 3 0.1474 0.957 0.052 0.000 0.948 0.000
#> GSM573703 3 0.1474 0.957 0.052 0.000 0.948 0.000
#> GSM573704 3 0.1474 0.957 0.052 0.000 0.948 0.000
#> GSM573783 3 0.2483 0.953 0.052 0.000 0.916 0.032
#> GSM573784 3 0.2483 0.953 0.052 0.000 0.916 0.032
#> GSM573785 3 0.2483 0.953 0.052 0.000 0.916 0.032
#> GSM573744 4 0.6409 0.993 0.364 0.000 0.076 0.560
#> GSM573745 4 0.6409 0.993 0.364 0.000 0.076 0.560
#> GSM573746 4 0.6409 0.993 0.364 0.000 0.076 0.560
#> GSM573747 4 0.6409 0.993 0.364 0.000 0.076 0.560
#> GSM573748 4 0.6409 0.993 0.364 0.000 0.076 0.560
#> GSM573749 4 0.6409 0.993 0.364 0.000 0.076 0.560
#> GSM573753 4 0.6554 0.991 0.356 0.004 0.076 0.564
#> GSM573754 4 0.6554 0.991 0.356 0.004 0.076 0.564
#> GSM573755 4 0.6554 0.991 0.356 0.004 0.076 0.564
#> GSM573750 4 0.6554 0.991 0.356 0.004 0.076 0.564
#> GSM573751 4 0.6554 0.991 0.356 0.004 0.076 0.564
#> GSM573752 4 0.6554 0.991 0.356 0.004 0.076 0.564
#> GSM573795 4 0.6554 0.991 0.356 0.004 0.076 0.564
#> GSM573796 4 0.6554 0.991 0.356 0.004 0.076 0.564
#> GSM573797 4 0.6554 0.991 0.356 0.004 0.076 0.564
#> GSM573741 4 0.6409 0.993 0.364 0.000 0.076 0.560
#> GSM573742 4 0.6409 0.993 0.364 0.000 0.076 0.560
#> GSM573743 4 0.6409 0.993 0.364 0.000 0.076 0.560
#> GSM573738 4 0.6409 0.993 0.364 0.000 0.076 0.560
#> GSM573739 4 0.6409 0.993 0.364 0.000 0.076 0.560
#> GSM573740 4 0.6409 0.993 0.364 0.000 0.076 0.560
#> GSM573792 4 0.6383 0.991 0.356 0.000 0.076 0.568
#> GSM573793 4 0.6396 0.993 0.360 0.000 0.076 0.564
#> GSM573794 4 0.6396 0.993 0.360 0.000 0.076 0.564
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM573726 1 0.3491 0.918 0.768 0.000 0.004 0.228 NA
#> GSM573727 1 0.3491 0.918 0.768 0.000 0.004 0.228 NA
#> GSM573728 1 0.3491 0.918 0.768 0.000 0.004 0.228 NA
#> GSM573729 1 0.3491 0.918 0.768 0.000 0.004 0.228 NA
#> GSM573730 1 0.3491 0.918 0.768 0.000 0.004 0.228 NA
#> GSM573731 1 0.3491 0.918 0.768 0.000 0.004 0.228 NA
#> GSM573735 1 0.6212 0.871 0.580 0.000 0.008 0.240 NA
#> GSM573736 1 0.6212 0.871 0.580 0.000 0.008 0.240 NA
#> GSM573737 1 0.6212 0.871 0.580 0.000 0.008 0.240 NA
#> GSM573732 1 0.6212 0.871 0.580 0.000 0.008 0.240 NA
#> GSM573733 1 0.6212 0.871 0.580 0.000 0.008 0.240 NA
#> GSM573734 1 0.6212 0.871 0.580 0.000 0.008 0.240 NA
#> GSM573789 1 0.6190 0.865 0.596 0.000 0.012 0.224 NA
#> GSM573790 1 0.6190 0.865 0.596 0.000 0.012 0.224 NA
#> GSM573791 1 0.6190 0.865 0.596 0.000 0.012 0.224 NA
#> GSM573723 1 0.3491 0.918 0.768 0.000 0.004 0.228 NA
#> GSM573724 1 0.3491 0.918 0.768 0.000 0.004 0.228 NA
#> GSM573725 1 0.3491 0.918 0.768 0.000 0.004 0.228 NA
#> GSM573720 1 0.3491 0.918 0.768 0.000 0.004 0.228 NA
#> GSM573721 1 0.3491 0.918 0.768 0.000 0.004 0.228 NA
#> GSM573722 1 0.3491 0.918 0.768 0.000 0.004 0.228 NA
#> GSM573786 1 0.5055 0.895 0.708 0.000 0.012 0.208 NA
#> GSM573787 1 0.5055 0.895 0.708 0.000 0.012 0.208 NA
#> GSM573788 1 0.5055 0.895 0.708 0.000 0.012 0.208 NA
#> GSM573768 2 0.5729 0.825 0.060 0.572 0.016 0.000 NA
#> GSM573769 2 0.5536 0.824 0.044 0.572 0.016 0.000 NA
#> GSM573770 2 0.5536 0.824 0.044 0.572 0.016 0.000 NA
#> GSM573765 2 0.3013 0.828 0.060 0.880 0.016 0.000 NA
#> GSM573766 2 0.3013 0.828 0.060 0.880 0.016 0.000 NA
#> GSM573767 2 0.3013 0.828 0.060 0.880 0.016 0.000 NA
#> GSM573777 2 0.0162 0.821 0.000 0.996 0.004 0.000 NA
#> GSM573778 2 0.0162 0.821 0.000 0.996 0.004 0.000 NA
#> GSM573779 2 0.0162 0.821 0.000 0.996 0.004 0.000 NA
#> GSM573762 2 0.0162 0.821 0.000 0.996 0.004 0.000 NA
#> GSM573763 2 0.0162 0.821 0.000 0.996 0.004 0.000 NA
#> GSM573764 2 0.0162 0.821 0.000 0.996 0.004 0.000 NA
#> GSM573771 2 0.0162 0.821 0.000 0.996 0.004 0.000 NA
#> GSM573772 2 0.0671 0.821 0.016 0.980 0.004 0.000 NA
#> GSM573773 2 0.0162 0.821 0.000 0.996 0.004 0.000 NA
#> GSM573759 2 0.4637 0.818 0.008 0.568 0.004 0.000 NA
#> GSM573760 2 0.4390 0.819 0.000 0.568 0.004 0.000 NA
#> GSM573761 2 0.4390 0.819 0.000 0.568 0.004 0.000 NA
#> GSM573774 2 0.5525 0.825 0.044 0.576 0.016 0.000 NA
#> GSM573775 2 0.5525 0.825 0.044 0.576 0.016 0.000 NA
#> GSM573776 2 0.5717 0.825 0.060 0.576 0.016 0.000 NA
#> GSM573756 2 0.5723 0.813 0.052 0.568 0.020 0.000 NA
#> GSM573757 2 0.5723 0.813 0.052 0.568 0.020 0.000 NA
#> GSM573758 2 0.5723 0.813 0.052 0.568 0.020 0.000 NA
#> GSM573708 3 0.5037 0.876 0.040 0.000 0.724 0.040 NA
#> GSM573709 3 0.5037 0.876 0.040 0.000 0.724 0.040 NA
#> GSM573710 3 0.5037 0.876 0.040 0.000 0.724 0.040 NA
#> GSM573711 3 0.5037 0.876 0.040 0.000 0.724 0.040 NA
#> GSM573712 3 0.5037 0.876 0.040 0.000 0.724 0.040 NA
#> GSM573713 3 0.5037 0.876 0.040 0.000 0.724 0.040 NA
#> GSM573717 3 0.1492 0.910 0.008 0.000 0.948 0.040 NA
#> GSM573718 3 0.1492 0.910 0.008 0.000 0.948 0.040 NA
#> GSM573719 3 0.1492 0.910 0.008 0.000 0.948 0.040 NA
#> GSM573714 3 0.1492 0.910 0.008 0.000 0.948 0.040 NA
#> GSM573715 3 0.1492 0.910 0.008 0.000 0.948 0.040 NA
#> GSM573716 3 0.1492 0.910 0.008 0.000 0.948 0.040 NA
#> GSM573780 3 0.5665 0.856 0.068 0.000 0.672 0.040 NA
#> GSM573781 3 0.5665 0.856 0.068 0.000 0.672 0.040 NA
#> GSM573782 3 0.5665 0.856 0.068 0.000 0.672 0.040 NA
#> GSM573705 3 0.1205 0.911 0.004 0.000 0.956 0.040 NA
#> GSM573706 3 0.1205 0.911 0.004 0.000 0.956 0.040 NA
#> GSM573707 3 0.1205 0.911 0.004 0.000 0.956 0.040 NA
#> GSM573702 3 0.1205 0.911 0.004 0.000 0.956 0.040 NA
#> GSM573703 3 0.1205 0.911 0.004 0.000 0.956 0.040 NA
#> GSM573704 3 0.1205 0.911 0.004 0.000 0.956 0.040 NA
#> GSM573783 3 0.3806 0.898 0.056 0.000 0.840 0.040 NA
#> GSM573784 3 0.3806 0.898 0.056 0.000 0.840 0.040 NA
#> GSM573785 3 0.3806 0.898 0.056 0.000 0.840 0.040 NA
#> GSM573744 4 0.0510 0.942 0.016 0.000 0.000 0.984 NA
#> GSM573745 4 0.0510 0.942 0.016 0.000 0.000 0.984 NA
#> GSM573746 4 0.0510 0.942 0.016 0.000 0.000 0.984 NA
#> GSM573747 4 0.0510 0.942 0.016 0.000 0.000 0.984 NA
#> GSM573748 4 0.0510 0.942 0.016 0.000 0.000 0.984 NA
#> GSM573749 4 0.0510 0.942 0.016 0.000 0.000 0.984 NA
#> GSM573753 4 0.2068 0.921 0.000 0.004 0.000 0.904 NA
#> GSM573754 4 0.2068 0.921 0.000 0.004 0.000 0.904 NA
#> GSM573755 4 0.2068 0.921 0.000 0.004 0.000 0.904 NA
#> GSM573750 4 0.2068 0.921 0.000 0.004 0.000 0.904 NA
#> GSM573751 4 0.2068 0.921 0.000 0.004 0.000 0.904 NA
#> GSM573752 4 0.2068 0.921 0.000 0.004 0.000 0.904 NA
#> GSM573795 4 0.3218 0.893 0.024 0.004 0.000 0.844 NA
#> GSM573796 4 0.3218 0.893 0.024 0.004 0.000 0.844 NA
#> GSM573797 4 0.3218 0.893 0.024 0.004 0.000 0.844 NA
#> GSM573741 4 0.0510 0.942 0.016 0.000 0.000 0.984 NA
#> GSM573742 4 0.0510 0.942 0.016 0.000 0.000 0.984 NA
#> GSM573743 4 0.0510 0.942 0.016 0.000 0.000 0.984 NA
#> GSM573738 4 0.0510 0.942 0.016 0.000 0.000 0.984 NA
#> GSM573739 4 0.0510 0.942 0.016 0.000 0.000 0.984 NA
#> GSM573740 4 0.0510 0.942 0.016 0.000 0.000 0.984 NA
#> GSM573792 4 0.2012 0.922 0.020 0.000 0.000 0.920 NA
#> GSM573793 4 0.1661 0.925 0.024 0.000 0.000 0.940 NA
#> GSM573794 4 0.1661 0.925 0.024 0.000 0.000 0.940 NA
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM573726 1 0.0000 0.873 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM573727 1 0.0000 0.873 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM573728 1 0.0000 0.873 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM573729 1 0.0000 0.873 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM573730 1 0.0000 0.873 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM573731 1 0.0000 0.873 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM573735 1 0.3620 0.777 0.648 0.000 0.000 0.000 0.000 0.352
#> GSM573736 1 0.3620 0.777 0.648 0.000 0.000 0.000 0.000 0.352
#> GSM573737 1 0.3620 0.777 0.648 0.000 0.000 0.000 0.000 0.352
#> GSM573732 1 0.3620 0.777 0.648 0.000 0.000 0.000 0.000 0.352
#> GSM573733 1 0.3620 0.777 0.648 0.000 0.000 0.000 0.000 0.352
#> GSM573734 1 0.3620 0.777 0.648 0.000 0.000 0.000 0.000 0.352
#> GSM573789 1 0.4566 0.806 0.692 0.000 0.000 0.004 0.084 0.220
#> GSM573790 1 0.4566 0.806 0.692 0.000 0.000 0.004 0.084 0.220
#> GSM573791 1 0.4566 0.806 0.692 0.000 0.000 0.004 0.084 0.220
#> GSM573723 1 0.0000 0.873 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM573724 1 0.0000 0.873 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM573725 1 0.0000 0.873 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM573720 1 0.0000 0.873 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM573721 1 0.0000 0.873 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM573722 1 0.0000 0.873 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM573786 1 0.3155 0.843 0.840 0.000 0.000 0.004 0.088 0.068
#> GSM573787 1 0.3155 0.843 0.840 0.000 0.000 0.004 0.088 0.068
#> GSM573788 1 0.3155 0.843 0.840 0.000 0.000 0.004 0.088 0.068
#> GSM573768 2 0.5678 -0.693 0.000 0.500 0.000 0.024 0.388 0.088
#> GSM573769 2 0.5455 -0.724 0.000 0.500 0.000 0.024 0.412 0.064
#> GSM573770 2 0.5455 -0.724 0.000 0.500 0.000 0.024 0.412 0.064
#> GSM573765 2 0.2898 0.406 0.000 0.864 0.000 0.024 0.024 0.088
#> GSM573766 2 0.2898 0.406 0.000 0.864 0.000 0.024 0.024 0.088
#> GSM573767 2 0.2898 0.406 0.000 0.864 0.000 0.024 0.024 0.088
#> GSM573777 2 0.0405 0.474 0.000 0.988 0.008 0.004 0.000 0.000
#> GSM573778 2 0.0405 0.474 0.000 0.988 0.008 0.004 0.000 0.000
#> GSM573779 2 0.0405 0.474 0.000 0.988 0.008 0.004 0.000 0.000
#> GSM573762 2 0.0000 0.475 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM573763 2 0.0000 0.475 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM573764 2 0.0000 0.475 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM573771 2 0.0000 0.475 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM573772 2 0.0547 0.470 0.000 0.980 0.000 0.000 0.000 0.020
#> GSM573773 2 0.0000 0.475 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM573759 2 0.3869 -1.000 0.000 0.500 0.000 0.000 0.500 0.000
#> GSM573760 5 0.3869 0.000 0.000 0.500 0.000 0.000 0.500 0.000
#> GSM573761 2 0.3869 -1.000 0.000 0.500 0.000 0.000 0.500 0.000
#> GSM573774 2 0.5434 -0.683 0.000 0.516 0.000 0.024 0.396 0.064
#> GSM573775 2 0.5434 -0.683 0.000 0.516 0.000 0.024 0.396 0.064
#> GSM573776 2 0.5652 -0.650 0.000 0.516 0.000 0.024 0.372 0.088
#> GSM573756 2 0.5118 -0.845 0.000 0.500 0.000 0.036 0.440 0.024
#> GSM573757 2 0.5118 -0.845 0.000 0.500 0.000 0.036 0.440 0.024
#> GSM573758 2 0.5118 -0.845 0.000 0.500 0.000 0.036 0.440 0.024
#> GSM573708 3 0.5538 0.807 0.008 0.000 0.652 0.032 0.196 0.112
#> GSM573709 3 0.5538 0.807 0.008 0.000 0.652 0.032 0.196 0.112
#> GSM573710 3 0.5538 0.807 0.008 0.000 0.652 0.032 0.196 0.112
#> GSM573711 3 0.5538 0.807 0.008 0.000 0.652 0.032 0.196 0.112
#> GSM573712 3 0.5538 0.807 0.008 0.000 0.652 0.032 0.196 0.112
#> GSM573713 3 0.5538 0.807 0.008 0.000 0.652 0.032 0.196 0.112
#> GSM573717 3 0.1350 0.858 0.008 0.000 0.952 0.020 0.000 0.020
#> GSM573718 3 0.1350 0.858 0.008 0.000 0.952 0.020 0.000 0.020
#> GSM573719 3 0.1350 0.858 0.008 0.000 0.952 0.020 0.000 0.020
#> GSM573714 3 0.1350 0.858 0.008 0.000 0.952 0.020 0.000 0.020
#> GSM573715 3 0.1350 0.858 0.008 0.000 0.952 0.020 0.000 0.020
#> GSM573716 3 0.1350 0.858 0.008 0.000 0.952 0.020 0.000 0.020
#> GSM573780 3 0.5956 0.756 0.008 0.000 0.536 0.004 0.228 0.224
#> GSM573781 3 0.5956 0.756 0.008 0.000 0.536 0.004 0.228 0.224
#> GSM573782 3 0.5956 0.756 0.008 0.000 0.536 0.004 0.228 0.224
#> GSM573705 3 0.0260 0.859 0.008 0.000 0.992 0.000 0.000 0.000
#> GSM573706 3 0.0260 0.859 0.008 0.000 0.992 0.000 0.000 0.000
#> GSM573707 3 0.0260 0.859 0.008 0.000 0.992 0.000 0.000 0.000
#> GSM573702 3 0.0260 0.859 0.008 0.000 0.992 0.000 0.000 0.000
#> GSM573703 3 0.0260 0.859 0.008 0.000 0.992 0.000 0.000 0.000
#> GSM573704 3 0.0260 0.859 0.008 0.000 0.992 0.000 0.000 0.000
#> GSM573783 3 0.4342 0.819 0.008 0.000 0.764 0.012 0.112 0.104
#> GSM573784 3 0.4342 0.819 0.008 0.000 0.764 0.012 0.112 0.104
#> GSM573785 3 0.4342 0.819 0.008 0.000 0.764 0.012 0.112 0.104
#> GSM573744 4 0.2446 0.895 0.124 0.000 0.012 0.864 0.000 0.000
#> GSM573745 4 0.2446 0.895 0.124 0.000 0.012 0.864 0.000 0.000
#> GSM573746 4 0.2446 0.895 0.124 0.000 0.012 0.864 0.000 0.000
#> GSM573747 4 0.2446 0.895 0.124 0.000 0.012 0.864 0.000 0.000
#> GSM573748 4 0.2446 0.895 0.124 0.000 0.012 0.864 0.000 0.000
#> GSM573749 4 0.2446 0.895 0.124 0.000 0.012 0.864 0.000 0.000
#> GSM573753 4 0.5902 0.851 0.120 0.000 0.012 0.632 0.048 0.188
#> GSM573754 4 0.5902 0.851 0.120 0.000 0.012 0.632 0.048 0.188
#> GSM573755 4 0.5902 0.851 0.120 0.000 0.012 0.632 0.048 0.188
#> GSM573750 4 0.5902 0.851 0.120 0.000 0.012 0.632 0.048 0.188
#> GSM573751 4 0.5902 0.851 0.120 0.000 0.012 0.632 0.048 0.188
#> GSM573752 4 0.5902 0.851 0.120 0.000 0.012 0.632 0.048 0.188
#> GSM573795 4 0.6824 0.794 0.116 0.000 0.012 0.536 0.120 0.216
#> GSM573796 4 0.6824 0.794 0.116 0.000 0.012 0.536 0.120 0.216
#> GSM573797 4 0.6824 0.794 0.116 0.000 0.012 0.536 0.120 0.216
#> GSM573741 4 0.2446 0.895 0.124 0.000 0.012 0.864 0.000 0.000
#> GSM573742 4 0.2446 0.895 0.124 0.000 0.012 0.864 0.000 0.000
#> GSM573743 4 0.2446 0.895 0.124 0.000 0.012 0.864 0.000 0.000
#> GSM573738 4 0.2446 0.895 0.124 0.000 0.012 0.864 0.000 0.000
#> GSM573739 4 0.2446 0.895 0.124 0.000 0.012 0.864 0.000 0.000
#> GSM573740 4 0.2446 0.895 0.124 0.000 0.012 0.864 0.000 0.000
#> GSM573792 4 0.5742 0.860 0.120 0.000 0.012 0.672 0.088 0.108
#> GSM573793 4 0.4629 0.876 0.120 0.000 0.012 0.760 0.064 0.044
#> GSM573794 4 0.4629 0.876 0.120 0.000 0.012 0.760 0.064 0.044
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
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)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
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:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.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")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
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 cell.line(p) agent(p) k
#> ATC:kmeans 96 1.13e-20 0.173 2
#> ATC:kmeans 96 9.56e-39 0.741 3
#> ATC:kmeans 96 9.14e-57 0.975 4
#> ATC:kmeans 96 9.14e-57 0.975 5
#> ATC:kmeans 72 3.93e-30 1.000 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.
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 46609 rows and 96 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'ATC' method.
#> Subgroups are detected by 'skmeans' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 6.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.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:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).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)
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.3796 0.621 0.621
#> 3 3 1.000 1.000 1.000 0.6649 0.747 0.593
#> 4 4 1.000 1.000 1.000 0.1997 0.874 0.657
#> 5 5 0.968 0.979 0.955 0.0328 0.970 0.878
#> 6 6 0.913 0.957 0.958 0.0268 0.986 0.935
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 6
#> attr(,"optional")
#> [1] 2 3 4 5
There is also optional best \(k\) = 2 3 4 5 that is worth to check.
Following shows the table of the partitions (You need to click the show/hide
code output link to see it). The membership matrix (columns with name p*
)
is inferred by
clue::cl_consensus()
function with the SE
method. Basically the value in the membership matrix
represents the probability to belong to a certain group. The finall class
label for an item is determined with the group with highest probability it
belongs to.
In get_classes()
function, the entropy is calculated from the membership
matrix and the silhouette score is calculated from the consensus matrix.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> GSM573726 1 0 1 1 0
#> GSM573727 1 0 1 1 0
#> GSM573728 1 0 1 1 0
#> GSM573729 1 0 1 1 0
#> GSM573730 1 0 1 1 0
#> GSM573731 1 0 1 1 0
#> GSM573735 1 0 1 1 0
#> GSM573736 1 0 1 1 0
#> GSM573737 1 0 1 1 0
#> GSM573732 1 0 1 1 0
#> GSM573733 1 0 1 1 0
#> GSM573734 1 0 1 1 0
#> GSM573789 1 0 1 1 0
#> GSM573790 1 0 1 1 0
#> GSM573791 1 0 1 1 0
#> GSM573723 1 0 1 1 0
#> GSM573724 1 0 1 1 0
#> GSM573725 1 0 1 1 0
#> GSM573720 1 0 1 1 0
#> GSM573721 1 0 1 1 0
#> GSM573722 1 0 1 1 0
#> GSM573786 1 0 1 1 0
#> GSM573787 1 0 1 1 0
#> GSM573788 1 0 1 1 0
#> GSM573768 2 0 1 0 1
#> GSM573769 2 0 1 0 1
#> GSM573770 2 0 1 0 1
#> GSM573765 2 0 1 0 1
#> GSM573766 2 0 1 0 1
#> GSM573767 2 0 1 0 1
#> GSM573777 2 0 1 0 1
#> GSM573778 2 0 1 0 1
#> GSM573779 2 0 1 0 1
#> GSM573762 2 0 1 0 1
#> GSM573763 2 0 1 0 1
#> GSM573764 2 0 1 0 1
#> GSM573771 2 0 1 0 1
#> GSM573772 2 0 1 0 1
#> GSM573773 2 0 1 0 1
#> GSM573759 2 0 1 0 1
#> GSM573760 2 0 1 0 1
#> GSM573761 2 0 1 0 1
#> GSM573774 2 0 1 0 1
#> GSM573775 2 0 1 0 1
#> GSM573776 2 0 1 0 1
#> GSM573756 2 0 1 0 1
#> GSM573757 2 0 1 0 1
#> GSM573758 2 0 1 0 1
#> GSM573708 1 0 1 1 0
#> GSM573709 1 0 1 1 0
#> GSM573710 1 0 1 1 0
#> GSM573711 1 0 1 1 0
#> GSM573712 1 0 1 1 0
#> GSM573713 1 0 1 1 0
#> GSM573717 1 0 1 1 0
#> GSM573718 1 0 1 1 0
#> GSM573719 1 0 1 1 0
#> GSM573714 1 0 1 1 0
#> GSM573715 1 0 1 1 0
#> GSM573716 1 0 1 1 0
#> GSM573780 1 0 1 1 0
#> GSM573781 1 0 1 1 0
#> GSM573782 1 0 1 1 0
#> GSM573705 1 0 1 1 0
#> GSM573706 1 0 1 1 0
#> GSM573707 1 0 1 1 0
#> GSM573702 1 0 1 1 0
#> GSM573703 1 0 1 1 0
#> GSM573704 1 0 1 1 0
#> GSM573783 1 0 1 1 0
#> GSM573784 1 0 1 1 0
#> GSM573785 1 0 1 1 0
#> GSM573744 1 0 1 1 0
#> GSM573745 1 0 1 1 0
#> GSM573746 1 0 1 1 0
#> GSM573747 1 0 1 1 0
#> GSM573748 1 0 1 1 0
#> GSM573749 1 0 1 1 0
#> GSM573753 1 0 1 1 0
#> GSM573754 1 0 1 1 0
#> GSM573755 1 0 1 1 0
#> GSM573750 1 0 1 1 0
#> GSM573751 1 0 1 1 0
#> GSM573752 1 0 1 1 0
#> GSM573795 1 0 1 1 0
#> GSM573796 1 0 1 1 0
#> GSM573797 1 0 1 1 0
#> GSM573741 1 0 1 1 0
#> GSM573742 1 0 1 1 0
#> GSM573743 1 0 1 1 0
#> GSM573738 1 0 1 1 0
#> GSM573739 1 0 1 1 0
#> GSM573740 1 0 1 1 0
#> GSM573792 1 0 1 1 0
#> GSM573793 1 0 1 1 0
#> GSM573794 1 0 1 1 0
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM573726 1 0 1 1 0 0
#> GSM573727 1 0 1 1 0 0
#> GSM573728 1 0 1 1 0 0
#> GSM573729 1 0 1 1 0 0
#> GSM573730 1 0 1 1 0 0
#> GSM573731 1 0 1 1 0 0
#> GSM573735 1 0 1 1 0 0
#> GSM573736 1 0 1 1 0 0
#> GSM573737 1 0 1 1 0 0
#> GSM573732 1 0 1 1 0 0
#> GSM573733 1 0 1 1 0 0
#> GSM573734 1 0 1 1 0 0
#> GSM573789 1 0 1 1 0 0
#> GSM573790 1 0 1 1 0 0
#> GSM573791 1 0 1 1 0 0
#> GSM573723 1 0 1 1 0 0
#> GSM573724 1 0 1 1 0 0
#> GSM573725 1 0 1 1 0 0
#> GSM573720 1 0 1 1 0 0
#> GSM573721 1 0 1 1 0 0
#> GSM573722 1 0 1 1 0 0
#> GSM573786 1 0 1 1 0 0
#> GSM573787 1 0 1 1 0 0
#> GSM573788 1 0 1 1 0 0
#> GSM573768 2 0 1 0 1 0
#> GSM573769 2 0 1 0 1 0
#> GSM573770 2 0 1 0 1 0
#> GSM573765 2 0 1 0 1 0
#> GSM573766 2 0 1 0 1 0
#> GSM573767 2 0 1 0 1 0
#> GSM573777 2 0 1 0 1 0
#> GSM573778 2 0 1 0 1 0
#> GSM573779 2 0 1 0 1 0
#> GSM573762 2 0 1 0 1 0
#> GSM573763 2 0 1 0 1 0
#> GSM573764 2 0 1 0 1 0
#> GSM573771 2 0 1 0 1 0
#> GSM573772 2 0 1 0 1 0
#> GSM573773 2 0 1 0 1 0
#> GSM573759 2 0 1 0 1 0
#> GSM573760 2 0 1 0 1 0
#> GSM573761 2 0 1 0 1 0
#> GSM573774 2 0 1 0 1 0
#> GSM573775 2 0 1 0 1 0
#> GSM573776 2 0 1 0 1 0
#> GSM573756 2 0 1 0 1 0
#> GSM573757 2 0 1 0 1 0
#> GSM573758 2 0 1 0 1 0
#> GSM573708 3 0 1 0 0 1
#> GSM573709 3 0 1 0 0 1
#> GSM573710 3 0 1 0 0 1
#> GSM573711 3 0 1 0 0 1
#> GSM573712 3 0 1 0 0 1
#> GSM573713 3 0 1 0 0 1
#> GSM573717 3 0 1 0 0 1
#> GSM573718 3 0 1 0 0 1
#> GSM573719 3 0 1 0 0 1
#> GSM573714 3 0 1 0 0 1
#> GSM573715 3 0 1 0 0 1
#> GSM573716 3 0 1 0 0 1
#> GSM573780 3 0 1 0 0 1
#> GSM573781 3 0 1 0 0 1
#> GSM573782 3 0 1 0 0 1
#> GSM573705 3 0 1 0 0 1
#> GSM573706 3 0 1 0 0 1
#> GSM573707 3 0 1 0 0 1
#> GSM573702 3 0 1 0 0 1
#> GSM573703 3 0 1 0 0 1
#> GSM573704 3 0 1 0 0 1
#> GSM573783 3 0 1 0 0 1
#> GSM573784 3 0 1 0 0 1
#> GSM573785 3 0 1 0 0 1
#> GSM573744 1 0 1 1 0 0
#> GSM573745 1 0 1 1 0 0
#> GSM573746 1 0 1 1 0 0
#> GSM573747 1 0 1 1 0 0
#> GSM573748 1 0 1 1 0 0
#> GSM573749 1 0 1 1 0 0
#> GSM573753 1 0 1 1 0 0
#> GSM573754 1 0 1 1 0 0
#> GSM573755 1 0 1 1 0 0
#> GSM573750 1 0 1 1 0 0
#> GSM573751 1 0 1 1 0 0
#> GSM573752 1 0 1 1 0 0
#> GSM573795 1 0 1 1 0 0
#> GSM573796 1 0 1 1 0 0
#> GSM573797 1 0 1 1 0 0
#> GSM573741 1 0 1 1 0 0
#> GSM573742 1 0 1 1 0 0
#> GSM573743 1 0 1 1 0 0
#> GSM573738 1 0 1 1 0 0
#> GSM573739 1 0 1 1 0 0
#> GSM573740 1 0 1 1 0 0
#> GSM573792 1 0 1 1 0 0
#> GSM573793 1 0 1 1 0 0
#> GSM573794 1 0 1 1 0 0
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM573726 1 0 1 1 0 0 0
#> GSM573727 1 0 1 1 0 0 0
#> GSM573728 1 0 1 1 0 0 0
#> GSM573729 1 0 1 1 0 0 0
#> GSM573730 1 0 1 1 0 0 0
#> GSM573731 1 0 1 1 0 0 0
#> GSM573735 1 0 1 1 0 0 0
#> GSM573736 1 0 1 1 0 0 0
#> GSM573737 1 0 1 1 0 0 0
#> GSM573732 1 0 1 1 0 0 0
#> GSM573733 1 0 1 1 0 0 0
#> GSM573734 1 0 1 1 0 0 0
#> GSM573789 1 0 1 1 0 0 0
#> GSM573790 1 0 1 1 0 0 0
#> GSM573791 1 0 1 1 0 0 0
#> GSM573723 1 0 1 1 0 0 0
#> GSM573724 1 0 1 1 0 0 0
#> GSM573725 1 0 1 1 0 0 0
#> GSM573720 1 0 1 1 0 0 0
#> GSM573721 1 0 1 1 0 0 0
#> GSM573722 1 0 1 1 0 0 0
#> GSM573786 1 0 1 1 0 0 0
#> GSM573787 1 0 1 1 0 0 0
#> GSM573788 1 0 1 1 0 0 0
#> GSM573768 2 0 1 0 1 0 0
#> GSM573769 2 0 1 0 1 0 0
#> GSM573770 2 0 1 0 1 0 0
#> GSM573765 2 0 1 0 1 0 0
#> GSM573766 2 0 1 0 1 0 0
#> GSM573767 2 0 1 0 1 0 0
#> GSM573777 2 0 1 0 1 0 0
#> GSM573778 2 0 1 0 1 0 0
#> GSM573779 2 0 1 0 1 0 0
#> GSM573762 2 0 1 0 1 0 0
#> GSM573763 2 0 1 0 1 0 0
#> GSM573764 2 0 1 0 1 0 0
#> GSM573771 2 0 1 0 1 0 0
#> GSM573772 2 0 1 0 1 0 0
#> GSM573773 2 0 1 0 1 0 0
#> GSM573759 2 0 1 0 1 0 0
#> GSM573760 2 0 1 0 1 0 0
#> GSM573761 2 0 1 0 1 0 0
#> GSM573774 2 0 1 0 1 0 0
#> GSM573775 2 0 1 0 1 0 0
#> GSM573776 2 0 1 0 1 0 0
#> GSM573756 2 0 1 0 1 0 0
#> GSM573757 2 0 1 0 1 0 0
#> GSM573758 2 0 1 0 1 0 0
#> GSM573708 3 0 1 0 0 1 0
#> GSM573709 3 0 1 0 0 1 0
#> GSM573710 3 0 1 0 0 1 0
#> GSM573711 3 0 1 0 0 1 0
#> GSM573712 3 0 1 0 0 1 0
#> GSM573713 3 0 1 0 0 1 0
#> GSM573717 3 0 1 0 0 1 0
#> GSM573718 3 0 1 0 0 1 0
#> GSM573719 3 0 1 0 0 1 0
#> GSM573714 3 0 1 0 0 1 0
#> GSM573715 3 0 1 0 0 1 0
#> GSM573716 3 0 1 0 0 1 0
#> GSM573780 3 0 1 0 0 1 0
#> GSM573781 3 0 1 0 0 1 0
#> GSM573782 3 0 1 0 0 1 0
#> GSM573705 3 0 1 0 0 1 0
#> GSM573706 3 0 1 0 0 1 0
#> GSM573707 3 0 1 0 0 1 0
#> GSM573702 3 0 1 0 0 1 0
#> GSM573703 3 0 1 0 0 1 0
#> GSM573704 3 0 1 0 0 1 0
#> GSM573783 3 0 1 0 0 1 0
#> GSM573784 3 0 1 0 0 1 0
#> GSM573785 3 0 1 0 0 1 0
#> GSM573744 4 0 1 0 0 0 1
#> GSM573745 4 0 1 0 0 0 1
#> GSM573746 4 0 1 0 0 0 1
#> GSM573747 4 0 1 0 0 0 1
#> GSM573748 4 0 1 0 0 0 1
#> GSM573749 4 0 1 0 0 0 1
#> GSM573753 4 0 1 0 0 0 1
#> GSM573754 4 0 1 0 0 0 1
#> GSM573755 4 0 1 0 0 0 1
#> GSM573750 4 0 1 0 0 0 1
#> GSM573751 4 0 1 0 0 0 1
#> GSM573752 4 0 1 0 0 0 1
#> GSM573795 4 0 1 0 0 0 1
#> GSM573796 4 0 1 0 0 0 1
#> GSM573797 4 0 1 0 0 0 1
#> GSM573741 4 0 1 0 0 0 1
#> GSM573742 4 0 1 0 0 0 1
#> GSM573743 4 0 1 0 0 0 1
#> GSM573738 4 0 1 0 0 0 1
#> GSM573739 4 0 1 0 0 0 1
#> GSM573740 4 0 1 0 0 0 1
#> GSM573792 4 0 1 0 0 0 1
#> GSM573793 4 0 1 0 0 0 1
#> GSM573794 4 0 1 0 0 0 1
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM573726 1 0.0000 0.995 1.000 0 0.000 0.000 0.000
#> GSM573727 1 0.0000 0.995 1.000 0 0.000 0.000 0.000
#> GSM573728 1 0.0000 0.995 1.000 0 0.000 0.000 0.000
#> GSM573729 1 0.0000 0.995 1.000 0 0.000 0.000 0.000
#> GSM573730 1 0.0000 0.995 1.000 0 0.000 0.000 0.000
#> GSM573731 1 0.0000 0.995 1.000 0 0.000 0.000 0.000
#> GSM573735 1 0.0609 0.987 0.980 0 0.000 0.000 0.020
#> GSM573736 1 0.0609 0.987 0.980 0 0.000 0.000 0.020
#> GSM573737 1 0.0609 0.987 0.980 0 0.000 0.000 0.020
#> GSM573732 1 0.0609 0.987 0.980 0 0.000 0.000 0.020
#> GSM573733 1 0.0609 0.987 0.980 0 0.000 0.000 0.020
#> GSM573734 1 0.0609 0.987 0.980 0 0.000 0.000 0.020
#> GSM573789 1 0.0162 0.994 0.996 0 0.000 0.000 0.004
#> GSM573790 1 0.0162 0.994 0.996 0 0.000 0.000 0.004
#> GSM573791 1 0.0162 0.994 0.996 0 0.000 0.000 0.004
#> GSM573723 1 0.0000 0.995 1.000 0 0.000 0.000 0.000
#> GSM573724 1 0.0000 0.995 1.000 0 0.000 0.000 0.000
#> GSM573725 1 0.0000 0.995 1.000 0 0.000 0.000 0.000
#> GSM573720 1 0.0000 0.995 1.000 0 0.000 0.000 0.000
#> GSM573721 1 0.0000 0.995 1.000 0 0.000 0.000 0.000
#> GSM573722 1 0.0000 0.995 1.000 0 0.000 0.000 0.000
#> GSM573786 1 0.0162 0.994 0.996 0 0.000 0.000 0.004
#> GSM573787 1 0.0162 0.994 0.996 0 0.000 0.000 0.004
#> GSM573788 1 0.0162 0.994 0.996 0 0.000 0.000 0.004
#> GSM573768 2 0.0000 1.000 0.000 1 0.000 0.000 0.000
#> GSM573769 2 0.0000 1.000 0.000 1 0.000 0.000 0.000
#> GSM573770 2 0.0000 1.000 0.000 1 0.000 0.000 0.000
#> GSM573765 2 0.0000 1.000 0.000 1 0.000 0.000 0.000
#> GSM573766 2 0.0000 1.000 0.000 1 0.000 0.000 0.000
#> GSM573767 2 0.0000 1.000 0.000 1 0.000 0.000 0.000
#> GSM573777 2 0.0000 1.000 0.000 1 0.000 0.000 0.000
#> GSM573778 2 0.0000 1.000 0.000 1 0.000 0.000 0.000
#> GSM573779 2 0.0000 1.000 0.000 1 0.000 0.000 0.000
#> GSM573762 2 0.0000 1.000 0.000 1 0.000 0.000 0.000
#> GSM573763 2 0.0000 1.000 0.000 1 0.000 0.000 0.000
#> GSM573764 2 0.0000 1.000 0.000 1 0.000 0.000 0.000
#> GSM573771 2 0.0000 1.000 0.000 1 0.000 0.000 0.000
#> GSM573772 2 0.0000 1.000 0.000 1 0.000 0.000 0.000
#> GSM573773 2 0.0000 1.000 0.000 1 0.000 0.000 0.000
#> GSM573759 2 0.0000 1.000 0.000 1 0.000 0.000 0.000
#> GSM573760 2 0.0000 1.000 0.000 1 0.000 0.000 0.000
#> GSM573761 2 0.0000 1.000 0.000 1 0.000 0.000 0.000
#> GSM573774 2 0.0000 1.000 0.000 1 0.000 0.000 0.000
#> GSM573775 2 0.0000 1.000 0.000 1 0.000 0.000 0.000
#> GSM573776 2 0.0000 1.000 0.000 1 0.000 0.000 0.000
#> GSM573756 2 0.0000 1.000 0.000 1 0.000 0.000 0.000
#> GSM573757 2 0.0000 1.000 0.000 1 0.000 0.000 0.000
#> GSM573758 2 0.0000 1.000 0.000 1 0.000 0.000 0.000
#> GSM573708 5 0.3999 0.996 0.000 0 0.344 0.000 0.656
#> GSM573709 5 0.3999 0.996 0.000 0 0.344 0.000 0.656
#> GSM573710 5 0.3999 0.996 0.000 0 0.344 0.000 0.656
#> GSM573711 5 0.3999 0.996 0.000 0 0.344 0.000 0.656
#> GSM573712 5 0.3999 0.996 0.000 0 0.344 0.000 0.656
#> GSM573713 5 0.3999 0.996 0.000 0 0.344 0.000 0.656
#> GSM573717 3 0.0000 0.998 0.000 0 1.000 0.000 0.000
#> GSM573718 3 0.0000 0.998 0.000 0 1.000 0.000 0.000
#> GSM573719 3 0.0000 0.998 0.000 0 1.000 0.000 0.000
#> GSM573714 3 0.0000 0.998 0.000 0 1.000 0.000 0.000
#> GSM573715 3 0.0000 0.998 0.000 0 1.000 0.000 0.000
#> GSM573716 3 0.0000 0.998 0.000 0 1.000 0.000 0.000
#> GSM573780 5 0.3966 0.991 0.000 0 0.336 0.000 0.664
#> GSM573781 5 0.3966 0.991 0.000 0 0.336 0.000 0.664
#> GSM573782 5 0.3966 0.991 0.000 0 0.336 0.000 0.664
#> GSM573705 3 0.0000 0.998 0.000 0 1.000 0.000 0.000
#> GSM573706 3 0.0000 0.998 0.000 0 1.000 0.000 0.000
#> GSM573707 3 0.0000 0.998 0.000 0 1.000 0.000 0.000
#> GSM573702 3 0.0000 0.998 0.000 0 1.000 0.000 0.000
#> GSM573703 3 0.0000 0.998 0.000 0 1.000 0.000 0.000
#> GSM573704 3 0.0000 0.998 0.000 0 1.000 0.000 0.000
#> GSM573783 3 0.0290 0.991 0.000 0 0.992 0.000 0.008
#> GSM573784 3 0.0290 0.991 0.000 0 0.992 0.000 0.008
#> GSM573785 3 0.0290 0.991 0.000 0 0.992 0.000 0.008
#> GSM573744 4 0.0000 0.960 0.000 0 0.000 1.000 0.000
#> GSM573745 4 0.0000 0.960 0.000 0 0.000 1.000 0.000
#> GSM573746 4 0.0000 0.960 0.000 0 0.000 1.000 0.000
#> GSM573747 4 0.0000 0.960 0.000 0 0.000 1.000 0.000
#> GSM573748 4 0.0000 0.960 0.000 0 0.000 1.000 0.000
#> GSM573749 4 0.0000 0.960 0.000 0 0.000 1.000 0.000
#> GSM573753 4 0.0794 0.953 0.000 0 0.000 0.972 0.028
#> GSM573754 4 0.0794 0.953 0.000 0 0.000 0.972 0.028
#> GSM573755 4 0.0794 0.953 0.000 0 0.000 0.972 0.028
#> GSM573750 4 0.0794 0.953 0.000 0 0.000 0.972 0.028
#> GSM573751 4 0.0794 0.953 0.000 0 0.000 0.972 0.028
#> GSM573752 4 0.0794 0.953 0.000 0 0.000 0.972 0.028
#> GSM573795 4 0.3857 0.732 0.000 0 0.000 0.688 0.312
#> GSM573796 4 0.3857 0.732 0.000 0 0.000 0.688 0.312
#> GSM573797 4 0.3857 0.732 0.000 0 0.000 0.688 0.312
#> GSM573741 4 0.0000 0.960 0.000 0 0.000 1.000 0.000
#> GSM573742 4 0.0000 0.960 0.000 0 0.000 1.000 0.000
#> GSM573743 4 0.0000 0.960 0.000 0 0.000 1.000 0.000
#> GSM573738 4 0.0000 0.960 0.000 0 0.000 1.000 0.000
#> GSM573739 4 0.0000 0.960 0.000 0 0.000 1.000 0.000
#> GSM573740 4 0.0000 0.960 0.000 0 0.000 1.000 0.000
#> GSM573792 4 0.0162 0.959 0.000 0 0.000 0.996 0.004
#> GSM573793 4 0.0162 0.959 0.000 0 0.000 0.996 0.004
#> GSM573794 4 0.0162 0.959 0.000 0 0.000 0.996 0.004
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM573726 1 0.0000 0.942 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM573727 1 0.0000 0.942 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM573728 1 0.0000 0.942 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM573729 1 0.0000 0.942 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM573730 1 0.0000 0.942 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM573731 1 0.0000 0.942 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM573735 1 0.3277 0.853 0.824 0.000 0.000 0.000 0.092 0.084
#> GSM573736 1 0.3277 0.853 0.824 0.000 0.000 0.000 0.092 0.084
#> GSM573737 1 0.3277 0.853 0.824 0.000 0.000 0.000 0.092 0.084
#> GSM573732 1 0.3277 0.853 0.824 0.000 0.000 0.000 0.092 0.084
#> GSM573733 1 0.3277 0.853 0.824 0.000 0.000 0.000 0.092 0.084
#> GSM573734 1 0.3277 0.853 0.824 0.000 0.000 0.000 0.092 0.084
#> GSM573789 1 0.1367 0.925 0.944 0.000 0.000 0.000 0.012 0.044
#> GSM573790 1 0.1367 0.925 0.944 0.000 0.000 0.000 0.012 0.044
#> GSM573791 1 0.1367 0.925 0.944 0.000 0.000 0.000 0.012 0.044
#> GSM573723 1 0.0000 0.942 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM573724 1 0.0000 0.942 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM573725 1 0.0000 0.942 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM573720 1 0.0000 0.942 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM573721 1 0.0000 0.942 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM573722 1 0.0000 0.942 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM573786 1 0.1297 0.925 0.948 0.000 0.000 0.000 0.012 0.040
#> GSM573787 1 0.1297 0.925 0.948 0.000 0.000 0.000 0.012 0.040
#> GSM573788 1 0.1297 0.925 0.948 0.000 0.000 0.000 0.012 0.040
#> GSM573768 2 0.0260 0.996 0.000 0.992 0.000 0.000 0.008 0.000
#> GSM573769 2 0.0260 0.996 0.000 0.992 0.000 0.000 0.008 0.000
#> GSM573770 2 0.0260 0.996 0.000 0.992 0.000 0.000 0.008 0.000
#> GSM573765 2 0.0000 0.996 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM573766 2 0.0000 0.996 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM573767 2 0.0000 0.996 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM573777 2 0.0000 0.996 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM573778 2 0.0000 0.996 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM573779 2 0.0000 0.996 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM573762 2 0.0000 0.996 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM573763 2 0.0000 0.996 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM573764 2 0.0000 0.996 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM573771 2 0.0000 0.996 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM573772 2 0.0000 0.996 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM573773 2 0.0000 0.996 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM573759 2 0.0260 0.996 0.000 0.992 0.000 0.000 0.008 0.000
#> GSM573760 2 0.0260 0.996 0.000 0.992 0.000 0.000 0.008 0.000
#> GSM573761 2 0.0260 0.996 0.000 0.992 0.000 0.000 0.008 0.000
#> GSM573774 2 0.0260 0.996 0.000 0.992 0.000 0.000 0.008 0.000
#> GSM573775 2 0.0260 0.996 0.000 0.992 0.000 0.000 0.008 0.000
#> GSM573776 2 0.0260 0.996 0.000 0.992 0.000 0.000 0.008 0.000
#> GSM573756 2 0.0260 0.996 0.000 0.992 0.000 0.000 0.008 0.000
#> GSM573757 2 0.0260 0.996 0.000 0.992 0.000 0.000 0.008 0.000
#> GSM573758 2 0.0260 0.996 0.000 0.992 0.000 0.000 0.008 0.000
#> GSM573708 5 0.2340 0.984 0.000 0.000 0.148 0.000 0.852 0.000
#> GSM573709 5 0.2340 0.984 0.000 0.000 0.148 0.000 0.852 0.000
#> GSM573710 5 0.2340 0.984 0.000 0.000 0.148 0.000 0.852 0.000
#> GSM573711 5 0.2340 0.984 0.000 0.000 0.148 0.000 0.852 0.000
#> GSM573712 5 0.2340 0.984 0.000 0.000 0.148 0.000 0.852 0.000
#> GSM573713 5 0.2340 0.984 0.000 0.000 0.148 0.000 0.852 0.000
#> GSM573717 3 0.0000 0.995 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM573718 3 0.0000 0.995 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM573719 3 0.0000 0.995 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM573714 3 0.0000 0.995 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM573715 3 0.0000 0.995 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM573716 3 0.0000 0.995 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM573780 5 0.2146 0.967 0.000 0.000 0.116 0.000 0.880 0.004
#> GSM573781 5 0.2146 0.967 0.000 0.000 0.116 0.000 0.880 0.004
#> GSM573782 5 0.2146 0.967 0.000 0.000 0.116 0.000 0.880 0.004
#> GSM573705 3 0.0000 0.995 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM573706 3 0.0000 0.995 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM573707 3 0.0000 0.995 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM573702 3 0.0000 0.995 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM573703 3 0.0000 0.995 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM573704 3 0.0000 0.995 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM573783 3 0.0547 0.980 0.000 0.000 0.980 0.000 0.020 0.000
#> GSM573784 3 0.0547 0.980 0.000 0.000 0.980 0.000 0.020 0.000
#> GSM573785 3 0.0547 0.980 0.000 0.000 0.980 0.000 0.020 0.000
#> GSM573744 4 0.0000 0.947 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM573745 4 0.0000 0.947 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM573746 4 0.0000 0.947 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM573747 4 0.0000 0.947 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM573748 4 0.0000 0.947 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM573749 4 0.0000 0.947 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM573753 4 0.2402 0.852 0.000 0.000 0.000 0.856 0.004 0.140
#> GSM573754 4 0.2402 0.852 0.000 0.000 0.000 0.856 0.004 0.140
#> GSM573755 4 0.2402 0.852 0.000 0.000 0.000 0.856 0.004 0.140
#> GSM573750 4 0.2402 0.852 0.000 0.000 0.000 0.856 0.004 0.140
#> GSM573751 4 0.2402 0.852 0.000 0.000 0.000 0.856 0.004 0.140
#> GSM573752 4 0.2402 0.852 0.000 0.000 0.000 0.856 0.004 0.140
#> GSM573795 6 0.2135 1.000 0.000 0.000 0.000 0.128 0.000 0.872
#> GSM573796 6 0.2135 1.000 0.000 0.000 0.000 0.128 0.000 0.872
#> GSM573797 6 0.2135 1.000 0.000 0.000 0.000 0.128 0.000 0.872
#> GSM573741 4 0.0000 0.947 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM573742 4 0.0000 0.947 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM573743 4 0.0000 0.947 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM573738 4 0.0000 0.947 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM573739 4 0.0000 0.947 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM573740 4 0.0000 0.947 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM573792 4 0.0000 0.947 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM573793 4 0.0000 0.947 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM573794 4 0.0000 0.947 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)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
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)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
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:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.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")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
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 cell.line(p) agent(p) k
#> ATC:skmeans 96 1.13e-20 0.17295 2
#> ATC:skmeans 96 9.56e-39 0.74101 3
#> ATC:skmeans 96 9.14e-57 0.97496 4
#> ATC:skmeans 96 1.55e-54 0.17576 5
#> ATC:skmeans 96 1.73e-52 0.00691 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.
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 46609 rows and 96 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)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.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:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).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)
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.00 1.000 1.000 0.3796 0.621 0.621
#> 3 3 1.00 1.000 1.000 0.6649 0.747 0.593
#> 4 4 1.00 1.000 1.000 0.1997 0.874 0.657
#> 5 5 1.00 1.000 1.000 0.0390 0.970 0.878
#> 6 6 0.97 0.983 0.969 0.0377 0.970 0.861
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 6
#> attr(,"optional")
#> [1] 2 3 4 5
There is also optional best \(k\) = 2 3 4 5 that is worth to check.
Following shows the table of the partitions (You need to click the show/hide
code output link to see it). The membership matrix (columns with name p*
)
is inferred by
clue::cl_consensus()
function with the SE
method. Basically the value in the membership matrix
represents the probability to belong to a certain group. The finall class
label for an item is determined with the group with highest probability it
belongs to.
In get_classes()
function, the entropy is calculated from the membership
matrix and the silhouette score is calculated from the consensus matrix.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> GSM573726 1 0 1 1 0
#> GSM573727 1 0 1 1 0
#> GSM573728 1 0 1 1 0
#> GSM573729 1 0 1 1 0
#> GSM573730 1 0 1 1 0
#> GSM573731 1 0 1 1 0
#> GSM573735 1 0 1 1 0
#> GSM573736 1 0 1 1 0
#> GSM573737 1 0 1 1 0
#> GSM573732 1 0 1 1 0
#> GSM573733 1 0 1 1 0
#> GSM573734 1 0 1 1 0
#> GSM573789 1 0 1 1 0
#> GSM573790 1 0 1 1 0
#> GSM573791 1 0 1 1 0
#> GSM573723 1 0 1 1 0
#> GSM573724 1 0 1 1 0
#> GSM573725 1 0 1 1 0
#> GSM573720 1 0 1 1 0
#> GSM573721 1 0 1 1 0
#> GSM573722 1 0 1 1 0
#> GSM573786 1 0 1 1 0
#> GSM573787 1 0 1 1 0
#> GSM573788 1 0 1 1 0
#> GSM573768 2 0 1 0 1
#> GSM573769 2 0 1 0 1
#> GSM573770 2 0 1 0 1
#> GSM573765 2 0 1 0 1
#> GSM573766 2 0 1 0 1
#> GSM573767 2 0 1 0 1
#> GSM573777 2 0 1 0 1
#> GSM573778 2 0 1 0 1
#> GSM573779 2 0 1 0 1
#> GSM573762 2 0 1 0 1
#> GSM573763 2 0 1 0 1
#> GSM573764 2 0 1 0 1
#> GSM573771 2 0 1 0 1
#> GSM573772 2 0 1 0 1
#> GSM573773 2 0 1 0 1
#> GSM573759 2 0 1 0 1
#> GSM573760 2 0 1 0 1
#> GSM573761 2 0 1 0 1
#> GSM573774 2 0 1 0 1
#> GSM573775 2 0 1 0 1
#> GSM573776 2 0 1 0 1
#> GSM573756 2 0 1 0 1
#> GSM573757 2 0 1 0 1
#> GSM573758 2 0 1 0 1
#> GSM573708 1 0 1 1 0
#> GSM573709 1 0 1 1 0
#> GSM573710 1 0 1 1 0
#> GSM573711 1 0 1 1 0
#> GSM573712 1 0 1 1 0
#> GSM573713 1 0 1 1 0
#> GSM573717 1 0 1 1 0
#> GSM573718 1 0 1 1 0
#> GSM573719 1 0 1 1 0
#> GSM573714 1 0 1 1 0
#> GSM573715 1 0 1 1 0
#> GSM573716 1 0 1 1 0
#> GSM573780 1 0 1 1 0
#> GSM573781 1 0 1 1 0
#> GSM573782 1 0 1 1 0
#> GSM573705 1 0 1 1 0
#> GSM573706 1 0 1 1 0
#> GSM573707 1 0 1 1 0
#> GSM573702 1 0 1 1 0
#> GSM573703 1 0 1 1 0
#> GSM573704 1 0 1 1 0
#> GSM573783 1 0 1 1 0
#> GSM573784 1 0 1 1 0
#> GSM573785 1 0 1 1 0
#> GSM573744 1 0 1 1 0
#> GSM573745 1 0 1 1 0
#> GSM573746 1 0 1 1 0
#> GSM573747 1 0 1 1 0
#> GSM573748 1 0 1 1 0
#> GSM573749 1 0 1 1 0
#> GSM573753 1 0 1 1 0
#> GSM573754 1 0 1 1 0
#> GSM573755 1 0 1 1 0
#> GSM573750 1 0 1 1 0
#> GSM573751 1 0 1 1 0
#> GSM573752 1 0 1 1 0
#> GSM573795 1 0 1 1 0
#> GSM573796 1 0 1 1 0
#> GSM573797 1 0 1 1 0
#> GSM573741 1 0 1 1 0
#> GSM573742 1 0 1 1 0
#> GSM573743 1 0 1 1 0
#> GSM573738 1 0 1 1 0
#> GSM573739 1 0 1 1 0
#> GSM573740 1 0 1 1 0
#> GSM573792 1 0 1 1 0
#> GSM573793 1 0 1 1 0
#> GSM573794 1 0 1 1 0
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM573726 1 0 1 1 0 0
#> GSM573727 1 0 1 1 0 0
#> GSM573728 1 0 1 1 0 0
#> GSM573729 1 0 1 1 0 0
#> GSM573730 1 0 1 1 0 0
#> GSM573731 1 0 1 1 0 0
#> GSM573735 1 0 1 1 0 0
#> GSM573736 1 0 1 1 0 0
#> GSM573737 1 0 1 1 0 0
#> GSM573732 1 0 1 1 0 0
#> GSM573733 1 0 1 1 0 0
#> GSM573734 1 0 1 1 0 0
#> GSM573789 1 0 1 1 0 0
#> GSM573790 1 0 1 1 0 0
#> GSM573791 1 0 1 1 0 0
#> GSM573723 1 0 1 1 0 0
#> GSM573724 1 0 1 1 0 0
#> GSM573725 1 0 1 1 0 0
#> GSM573720 1 0 1 1 0 0
#> GSM573721 1 0 1 1 0 0
#> GSM573722 1 0 1 1 0 0
#> GSM573786 1 0 1 1 0 0
#> GSM573787 1 0 1 1 0 0
#> GSM573788 1 0 1 1 0 0
#> GSM573768 2 0 1 0 1 0
#> GSM573769 2 0 1 0 1 0
#> GSM573770 2 0 1 0 1 0
#> GSM573765 2 0 1 0 1 0
#> GSM573766 2 0 1 0 1 0
#> GSM573767 2 0 1 0 1 0
#> GSM573777 2 0 1 0 1 0
#> GSM573778 2 0 1 0 1 0
#> GSM573779 2 0 1 0 1 0
#> GSM573762 2 0 1 0 1 0
#> GSM573763 2 0 1 0 1 0
#> GSM573764 2 0 1 0 1 0
#> GSM573771 2 0 1 0 1 0
#> GSM573772 2 0 1 0 1 0
#> GSM573773 2 0 1 0 1 0
#> GSM573759 2 0 1 0 1 0
#> GSM573760 2 0 1 0 1 0
#> GSM573761 2 0 1 0 1 0
#> GSM573774 2 0 1 0 1 0
#> GSM573775 2 0 1 0 1 0
#> GSM573776 2 0 1 0 1 0
#> GSM573756 2 0 1 0 1 0
#> GSM573757 2 0 1 0 1 0
#> GSM573758 2 0 1 0 1 0
#> GSM573708 3 0 1 0 0 1
#> GSM573709 3 0 1 0 0 1
#> GSM573710 3 0 1 0 0 1
#> GSM573711 3 0 1 0 0 1
#> GSM573712 3 0 1 0 0 1
#> GSM573713 3 0 1 0 0 1
#> GSM573717 3 0 1 0 0 1
#> GSM573718 3 0 1 0 0 1
#> GSM573719 3 0 1 0 0 1
#> GSM573714 3 0 1 0 0 1
#> GSM573715 3 0 1 0 0 1
#> GSM573716 3 0 1 0 0 1
#> GSM573780 3 0 1 0 0 1
#> GSM573781 3 0 1 0 0 1
#> GSM573782 3 0 1 0 0 1
#> GSM573705 3 0 1 0 0 1
#> GSM573706 3 0 1 0 0 1
#> GSM573707 3 0 1 0 0 1
#> GSM573702 3 0 1 0 0 1
#> GSM573703 3 0 1 0 0 1
#> GSM573704 3 0 1 0 0 1
#> GSM573783 3 0 1 0 0 1
#> GSM573784 3 0 1 0 0 1
#> GSM573785 3 0 1 0 0 1
#> GSM573744 1 0 1 1 0 0
#> GSM573745 1 0 1 1 0 0
#> GSM573746 1 0 1 1 0 0
#> GSM573747 1 0 1 1 0 0
#> GSM573748 1 0 1 1 0 0
#> GSM573749 1 0 1 1 0 0
#> GSM573753 1 0 1 1 0 0
#> GSM573754 1 0 1 1 0 0
#> GSM573755 1 0 1 1 0 0
#> GSM573750 1 0 1 1 0 0
#> GSM573751 1 0 1 1 0 0
#> GSM573752 1 0 1 1 0 0
#> GSM573795 1 0 1 1 0 0
#> GSM573796 1 0 1 1 0 0
#> GSM573797 1 0 1 1 0 0
#> GSM573741 1 0 1 1 0 0
#> GSM573742 1 0 1 1 0 0
#> GSM573743 1 0 1 1 0 0
#> GSM573738 1 0 1 1 0 0
#> GSM573739 1 0 1 1 0 0
#> GSM573740 1 0 1 1 0 0
#> GSM573792 1 0 1 1 0 0
#> GSM573793 1 0 1 1 0 0
#> GSM573794 1 0 1 1 0 0
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM573726 1 0 1 1 0 0 0
#> GSM573727 1 0 1 1 0 0 0
#> GSM573728 1 0 1 1 0 0 0
#> GSM573729 1 0 1 1 0 0 0
#> GSM573730 1 0 1 1 0 0 0
#> GSM573731 1 0 1 1 0 0 0
#> GSM573735 1 0 1 1 0 0 0
#> GSM573736 1 0 1 1 0 0 0
#> GSM573737 1 0 1 1 0 0 0
#> GSM573732 1 0 1 1 0 0 0
#> GSM573733 1 0 1 1 0 0 0
#> GSM573734 1 0 1 1 0 0 0
#> GSM573789 1 0 1 1 0 0 0
#> GSM573790 1 0 1 1 0 0 0
#> GSM573791 1 0 1 1 0 0 0
#> GSM573723 1 0 1 1 0 0 0
#> GSM573724 1 0 1 1 0 0 0
#> GSM573725 1 0 1 1 0 0 0
#> GSM573720 1 0 1 1 0 0 0
#> GSM573721 1 0 1 1 0 0 0
#> GSM573722 1 0 1 1 0 0 0
#> GSM573786 1 0 1 1 0 0 0
#> GSM573787 1 0 1 1 0 0 0
#> GSM573788 1 0 1 1 0 0 0
#> GSM573768 2 0 1 0 1 0 0
#> GSM573769 2 0 1 0 1 0 0
#> GSM573770 2 0 1 0 1 0 0
#> GSM573765 2 0 1 0 1 0 0
#> GSM573766 2 0 1 0 1 0 0
#> GSM573767 2 0 1 0 1 0 0
#> GSM573777 2 0 1 0 1 0 0
#> GSM573778 2 0 1 0 1 0 0
#> GSM573779 2 0 1 0 1 0 0
#> GSM573762 2 0 1 0 1 0 0
#> GSM573763 2 0 1 0 1 0 0
#> GSM573764 2 0 1 0 1 0 0
#> GSM573771 2 0 1 0 1 0 0
#> GSM573772 2 0 1 0 1 0 0
#> GSM573773 2 0 1 0 1 0 0
#> GSM573759 2 0 1 0 1 0 0
#> GSM573760 2 0 1 0 1 0 0
#> GSM573761 2 0 1 0 1 0 0
#> GSM573774 2 0 1 0 1 0 0
#> GSM573775 2 0 1 0 1 0 0
#> GSM573776 2 0 1 0 1 0 0
#> GSM573756 2 0 1 0 1 0 0
#> GSM573757 2 0 1 0 1 0 0
#> GSM573758 2 0 1 0 1 0 0
#> GSM573708 3 0 1 0 0 1 0
#> GSM573709 3 0 1 0 0 1 0
#> GSM573710 3 0 1 0 0 1 0
#> GSM573711 3 0 1 0 0 1 0
#> GSM573712 3 0 1 0 0 1 0
#> GSM573713 3 0 1 0 0 1 0
#> GSM573717 3 0 1 0 0 1 0
#> GSM573718 3 0 1 0 0 1 0
#> GSM573719 3 0 1 0 0 1 0
#> GSM573714 3 0 1 0 0 1 0
#> GSM573715 3 0 1 0 0 1 0
#> GSM573716 3 0 1 0 0 1 0
#> GSM573780 3 0 1 0 0 1 0
#> GSM573781 3 0 1 0 0 1 0
#> GSM573782 3 0 1 0 0 1 0
#> GSM573705 3 0 1 0 0 1 0
#> GSM573706 3 0 1 0 0 1 0
#> GSM573707 3 0 1 0 0 1 0
#> GSM573702 3 0 1 0 0 1 0
#> GSM573703 3 0 1 0 0 1 0
#> GSM573704 3 0 1 0 0 1 0
#> GSM573783 3 0 1 0 0 1 0
#> GSM573784 3 0 1 0 0 1 0
#> GSM573785 3 0 1 0 0 1 0
#> GSM573744 4 0 1 0 0 0 1
#> GSM573745 4 0 1 0 0 0 1
#> GSM573746 4 0 1 0 0 0 1
#> GSM573747 4 0 1 0 0 0 1
#> GSM573748 4 0 1 0 0 0 1
#> GSM573749 4 0 1 0 0 0 1
#> GSM573753 4 0 1 0 0 0 1
#> GSM573754 4 0 1 0 0 0 1
#> GSM573755 4 0 1 0 0 0 1
#> GSM573750 4 0 1 0 0 0 1
#> GSM573751 4 0 1 0 0 0 1
#> GSM573752 4 0 1 0 0 0 1
#> GSM573795 4 0 1 0 0 0 1
#> GSM573796 4 0 1 0 0 0 1
#> GSM573797 4 0 1 0 0 0 1
#> GSM573741 4 0 1 0 0 0 1
#> GSM573742 4 0 1 0 0 0 1
#> GSM573743 4 0 1 0 0 0 1
#> GSM573738 4 0 1 0 0 0 1
#> GSM573739 4 0 1 0 0 0 1
#> GSM573740 4 0 1 0 0 0 1
#> GSM573792 4 0 1 0 0 0 1
#> GSM573793 4 0 1 0 0 0 1
#> GSM573794 4 0 1 0 0 0 1
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM573726 1 0 1 1 0 0 0 0
#> GSM573727 1 0 1 1 0 0 0 0
#> GSM573728 1 0 1 1 0 0 0 0
#> GSM573729 1 0 1 1 0 0 0 0
#> GSM573730 1 0 1 1 0 0 0 0
#> GSM573731 1 0 1 1 0 0 0 0
#> GSM573735 1 0 1 1 0 0 0 0
#> GSM573736 1 0 1 1 0 0 0 0
#> GSM573737 1 0 1 1 0 0 0 0
#> GSM573732 1 0 1 1 0 0 0 0
#> GSM573733 1 0 1 1 0 0 0 0
#> GSM573734 1 0 1 1 0 0 0 0
#> GSM573789 1 0 1 1 0 0 0 0
#> GSM573790 1 0 1 1 0 0 0 0
#> GSM573791 1 0 1 1 0 0 0 0
#> GSM573723 1 0 1 1 0 0 0 0
#> GSM573724 1 0 1 1 0 0 0 0
#> GSM573725 1 0 1 1 0 0 0 0
#> GSM573720 1 0 1 1 0 0 0 0
#> GSM573721 1 0 1 1 0 0 0 0
#> GSM573722 1 0 1 1 0 0 0 0
#> GSM573786 1 0 1 1 0 0 0 0
#> GSM573787 1 0 1 1 0 0 0 0
#> GSM573788 1 0 1 1 0 0 0 0
#> GSM573768 2 0 1 0 1 0 0 0
#> GSM573769 2 0 1 0 1 0 0 0
#> GSM573770 2 0 1 0 1 0 0 0
#> GSM573765 2 0 1 0 1 0 0 0
#> GSM573766 2 0 1 0 1 0 0 0
#> GSM573767 2 0 1 0 1 0 0 0
#> GSM573777 2 0 1 0 1 0 0 0
#> GSM573778 2 0 1 0 1 0 0 0
#> GSM573779 2 0 1 0 1 0 0 0
#> GSM573762 2 0 1 0 1 0 0 0
#> GSM573763 2 0 1 0 1 0 0 0
#> GSM573764 2 0 1 0 1 0 0 0
#> GSM573771 2 0 1 0 1 0 0 0
#> GSM573772 2 0 1 0 1 0 0 0
#> GSM573773 2 0 1 0 1 0 0 0
#> GSM573759 2 0 1 0 1 0 0 0
#> GSM573760 2 0 1 0 1 0 0 0
#> GSM573761 2 0 1 0 1 0 0 0
#> GSM573774 2 0 1 0 1 0 0 0
#> GSM573775 2 0 1 0 1 0 0 0
#> GSM573776 2 0 1 0 1 0 0 0
#> GSM573756 2 0 1 0 1 0 0 0
#> GSM573757 2 0 1 0 1 0 0 0
#> GSM573758 2 0 1 0 1 0 0 0
#> GSM573708 5 0 1 0 0 0 0 1
#> GSM573709 5 0 1 0 0 0 0 1
#> GSM573710 5 0 1 0 0 0 0 1
#> GSM573711 5 0 1 0 0 0 0 1
#> GSM573712 5 0 1 0 0 0 0 1
#> GSM573713 5 0 1 0 0 0 0 1
#> GSM573717 3 0 1 0 0 1 0 0
#> GSM573718 3 0 1 0 0 1 0 0
#> GSM573719 3 0 1 0 0 1 0 0
#> GSM573714 3 0 1 0 0 1 0 0
#> GSM573715 3 0 1 0 0 1 0 0
#> GSM573716 3 0 1 0 0 1 0 0
#> GSM573780 5 0 1 0 0 0 0 1
#> GSM573781 5 0 1 0 0 0 0 1
#> GSM573782 5 0 1 0 0 0 0 1
#> GSM573705 3 0 1 0 0 1 0 0
#> GSM573706 3 0 1 0 0 1 0 0
#> GSM573707 3 0 1 0 0 1 0 0
#> GSM573702 3 0 1 0 0 1 0 0
#> GSM573703 3 0 1 0 0 1 0 0
#> GSM573704 3 0 1 0 0 1 0 0
#> GSM573783 3 0 1 0 0 1 0 0
#> GSM573784 3 0 1 0 0 1 0 0
#> GSM573785 3 0 1 0 0 1 0 0
#> GSM573744 4 0 1 0 0 0 1 0
#> GSM573745 4 0 1 0 0 0 1 0
#> GSM573746 4 0 1 0 0 0 1 0
#> GSM573747 4 0 1 0 0 0 1 0
#> GSM573748 4 0 1 0 0 0 1 0
#> GSM573749 4 0 1 0 0 0 1 0
#> GSM573753 4 0 1 0 0 0 1 0
#> GSM573754 4 0 1 0 0 0 1 0
#> GSM573755 4 0 1 0 0 0 1 0
#> GSM573750 4 0 1 0 0 0 1 0
#> GSM573751 4 0 1 0 0 0 1 0
#> GSM573752 4 0 1 0 0 0 1 0
#> GSM573795 4 0 1 0 0 0 1 0
#> GSM573796 4 0 1 0 0 0 1 0
#> GSM573797 4 0 1 0 0 0 1 0
#> GSM573741 4 0 1 0 0 0 1 0
#> GSM573742 4 0 1 0 0 0 1 0
#> GSM573743 4 0 1 0 0 0 1 0
#> GSM573738 4 0 1 0 0 0 1 0
#> GSM573739 4 0 1 0 0 0 1 0
#> GSM573740 4 0 1 0 0 0 1 0
#> GSM573792 4 0 1 0 0 0 1 0
#> GSM573793 4 0 1 0 0 0 1 0
#> GSM573794 4 0 1 0 0 0 1 0
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM573726 1 0.0000 1.000 1.000 0.000 0 0.000 0 0.000
#> GSM573727 1 0.0000 1.000 1.000 0.000 0 0.000 0 0.000
#> GSM573728 1 0.0000 1.000 1.000 0.000 0 0.000 0 0.000
#> GSM573729 1 0.0000 1.000 1.000 0.000 0 0.000 0 0.000
#> GSM573730 1 0.0000 1.000 1.000 0.000 0 0.000 0 0.000
#> GSM573731 1 0.0000 1.000 1.000 0.000 0 0.000 0 0.000
#> GSM573735 6 0.2340 0.999 0.148 0.000 0 0.000 0 0.852
#> GSM573736 6 0.2340 0.999 0.148 0.000 0 0.000 0 0.852
#> GSM573737 6 0.2340 0.999 0.148 0.000 0 0.000 0 0.852
#> GSM573732 6 0.2340 0.999 0.148 0.000 0 0.000 0 0.852
#> GSM573733 6 0.2340 0.999 0.148 0.000 0 0.000 0 0.852
#> GSM573734 6 0.2340 0.999 0.148 0.000 0 0.000 0 0.852
#> GSM573789 6 0.2416 0.991 0.156 0.000 0 0.000 0 0.844
#> GSM573790 6 0.2340 0.999 0.148 0.000 0 0.000 0 0.852
#> GSM573791 6 0.2340 0.999 0.148 0.000 0 0.000 0 0.852
#> GSM573723 1 0.0000 1.000 1.000 0.000 0 0.000 0 0.000
#> GSM573724 1 0.0000 1.000 1.000 0.000 0 0.000 0 0.000
#> GSM573725 1 0.0000 1.000 1.000 0.000 0 0.000 0 0.000
#> GSM573720 1 0.0000 1.000 1.000 0.000 0 0.000 0 0.000
#> GSM573721 1 0.0000 1.000 1.000 0.000 0 0.000 0 0.000
#> GSM573722 1 0.0000 1.000 1.000 0.000 0 0.000 0 0.000
#> GSM573786 1 0.0000 1.000 1.000 0.000 0 0.000 0 0.000
#> GSM573787 1 0.0000 1.000 1.000 0.000 0 0.000 0 0.000
#> GSM573788 1 0.0000 1.000 1.000 0.000 0 0.000 0 0.000
#> GSM573768 2 0.0000 0.960 0.000 1.000 0 0.000 0 0.000
#> GSM573769 2 0.0000 0.960 0.000 1.000 0 0.000 0 0.000
#> GSM573770 2 0.0000 0.960 0.000 1.000 0 0.000 0 0.000
#> GSM573765 2 0.1663 0.960 0.000 0.912 0 0.000 0 0.088
#> GSM573766 2 0.1663 0.960 0.000 0.912 0 0.000 0 0.088
#> GSM573767 2 0.1663 0.960 0.000 0.912 0 0.000 0 0.088
#> GSM573777 2 0.1663 0.960 0.000 0.912 0 0.000 0 0.088
#> GSM573778 2 0.1663 0.960 0.000 0.912 0 0.000 0 0.088
#> GSM573779 2 0.1663 0.960 0.000 0.912 0 0.000 0 0.088
#> GSM573762 2 0.1663 0.960 0.000 0.912 0 0.000 0 0.088
#> GSM573763 2 0.1663 0.960 0.000 0.912 0 0.000 0 0.088
#> GSM573764 2 0.1663 0.960 0.000 0.912 0 0.000 0 0.088
#> GSM573771 2 0.1663 0.960 0.000 0.912 0 0.000 0 0.088
#> GSM573772 2 0.1663 0.960 0.000 0.912 0 0.000 0 0.088
#> GSM573773 2 0.1663 0.960 0.000 0.912 0 0.000 0 0.088
#> GSM573759 2 0.0000 0.960 0.000 1.000 0 0.000 0 0.000
#> GSM573760 2 0.0000 0.960 0.000 1.000 0 0.000 0 0.000
#> GSM573761 2 0.0000 0.960 0.000 1.000 0 0.000 0 0.000
#> GSM573774 2 0.0000 0.960 0.000 1.000 0 0.000 0 0.000
#> GSM573775 2 0.0000 0.960 0.000 1.000 0 0.000 0 0.000
#> GSM573776 2 0.0000 0.960 0.000 1.000 0 0.000 0 0.000
#> GSM573756 2 0.0000 0.960 0.000 1.000 0 0.000 0 0.000
#> GSM573757 2 0.0000 0.960 0.000 1.000 0 0.000 0 0.000
#> GSM573758 2 0.0000 0.960 0.000 1.000 0 0.000 0 0.000
#> GSM573708 5 0.0000 1.000 0.000 0.000 0 0.000 1 0.000
#> GSM573709 5 0.0000 1.000 0.000 0.000 0 0.000 1 0.000
#> GSM573710 5 0.0000 1.000 0.000 0.000 0 0.000 1 0.000
#> GSM573711 5 0.0000 1.000 0.000 0.000 0 0.000 1 0.000
#> GSM573712 5 0.0000 1.000 0.000 0.000 0 0.000 1 0.000
#> GSM573713 5 0.0000 1.000 0.000 0.000 0 0.000 1 0.000
#> GSM573717 3 0.0000 1.000 0.000 0.000 1 0.000 0 0.000
#> GSM573718 3 0.0000 1.000 0.000 0.000 1 0.000 0 0.000
#> GSM573719 3 0.0000 1.000 0.000 0.000 1 0.000 0 0.000
#> GSM573714 3 0.0000 1.000 0.000 0.000 1 0.000 0 0.000
#> GSM573715 3 0.0000 1.000 0.000 0.000 1 0.000 0 0.000
#> GSM573716 3 0.0000 1.000 0.000 0.000 1 0.000 0 0.000
#> GSM573780 5 0.0000 1.000 0.000 0.000 0 0.000 1 0.000
#> GSM573781 5 0.0000 1.000 0.000 0.000 0 0.000 1 0.000
#> GSM573782 5 0.0000 1.000 0.000 0.000 0 0.000 1 0.000
#> GSM573705 3 0.0000 1.000 0.000 0.000 1 0.000 0 0.000
#> GSM573706 3 0.0000 1.000 0.000 0.000 1 0.000 0 0.000
#> GSM573707 3 0.0000 1.000 0.000 0.000 1 0.000 0 0.000
#> GSM573702 3 0.0000 1.000 0.000 0.000 1 0.000 0 0.000
#> GSM573703 3 0.0000 1.000 0.000 0.000 1 0.000 0 0.000
#> GSM573704 3 0.0000 1.000 0.000 0.000 1 0.000 0 0.000
#> GSM573783 3 0.0000 1.000 0.000 0.000 1 0.000 0 0.000
#> GSM573784 3 0.0000 1.000 0.000 0.000 1 0.000 0 0.000
#> GSM573785 3 0.0000 1.000 0.000 0.000 1 0.000 0 0.000
#> GSM573744 4 0.0000 0.979 0.000 0.000 0 1.000 0 0.000
#> GSM573745 4 0.0000 0.979 0.000 0.000 0 1.000 0 0.000
#> GSM573746 4 0.0000 0.979 0.000 0.000 0 1.000 0 0.000
#> GSM573747 4 0.0000 0.979 0.000 0.000 0 1.000 0 0.000
#> GSM573748 4 0.0000 0.979 0.000 0.000 0 1.000 0 0.000
#> GSM573749 4 0.0000 0.979 0.000 0.000 0 1.000 0 0.000
#> GSM573753 4 0.1267 0.967 0.000 0.000 0 0.940 0 0.060
#> GSM573754 4 0.1267 0.967 0.000 0.000 0 0.940 0 0.060
#> GSM573755 4 0.1267 0.967 0.000 0.000 0 0.940 0 0.060
#> GSM573750 4 0.1267 0.967 0.000 0.000 0 0.940 0 0.060
#> GSM573751 4 0.1267 0.967 0.000 0.000 0 0.940 0 0.060
#> GSM573752 4 0.1267 0.967 0.000 0.000 0 0.940 0 0.060
#> GSM573795 4 0.1267 0.967 0.000 0.000 0 0.940 0 0.060
#> GSM573796 4 0.1267 0.967 0.000 0.000 0 0.940 0 0.060
#> GSM573797 4 0.1267 0.967 0.000 0.000 0 0.940 0 0.060
#> GSM573741 4 0.0000 0.979 0.000 0.000 0 1.000 0 0.000
#> GSM573742 4 0.0000 0.979 0.000 0.000 0 1.000 0 0.000
#> GSM573743 4 0.0000 0.979 0.000 0.000 0 1.000 0 0.000
#> GSM573738 4 0.0000 0.979 0.000 0.000 0 1.000 0 0.000
#> GSM573739 4 0.0000 0.979 0.000 0.000 0 1.000 0 0.000
#> GSM573740 4 0.0000 0.979 0.000 0.000 0 1.000 0 0.000
#> GSM573792 4 0.0458 0.977 0.000 0.000 0 0.984 0 0.016
#> GSM573793 4 0.0000 0.979 0.000 0.000 0 1.000 0 0.000
#> GSM573794 4 0.0000 0.979 0.000 0.000 0 1.000 0 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)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
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)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
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:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.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")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
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 cell.line(p) agent(p) k
#> ATC:pam 96 1.13e-20 0.1730 2
#> ATC:pam 96 9.56e-39 0.7410 3
#> ATC:pam 96 9.14e-57 0.9750 4
#> ATC:pam 96 1.55e-54 0.1758 5
#> ATC:pam 96 1.73e-52 0.0063 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.
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 46609 rows and 96 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 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)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.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:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).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)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 0.495 0.718 0.813 0.50538 0.495 0.495
#> 3 3 1.000 1.000 1.000 0.25044 0.874 0.745
#> 4 4 1.000 1.000 1.000 0.19968 0.874 0.657
#> 5 5 0.964 0.952 0.960 0.02054 1.000 1.000
#> 6 6 0.939 0.929 0.912 0.00899 1.000 1.000
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 4
#> attr(,"optional")
#> [1] 3
There is also optional best \(k\) = 3 that is worth to check.
Following shows the table of the partitions (You need to click the show/hide
code output link to see it). The membership matrix (columns with name p*
)
is inferred by
clue::cl_consensus()
function with the SE
method. Basically the value in the membership matrix
represents the probability to belong to a certain group. The finall class
label for an item is determined with the group with highest probability it
belongs to.
In get_classes()
function, the entropy is calculated from the membership
matrix and the silhouette score is calculated from the consensus matrix.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> GSM573726 2 0.955 0.717 0.376 0.624
#> GSM573727 2 0.955 0.717 0.376 0.624
#> GSM573728 2 0.955 0.717 0.376 0.624
#> GSM573729 2 0.955 0.717 0.376 0.624
#> GSM573730 2 0.955 0.717 0.376 0.624
#> GSM573731 2 0.955 0.717 0.376 0.624
#> GSM573735 2 0.955 0.717 0.376 0.624
#> GSM573736 2 0.955 0.717 0.376 0.624
#> GSM573737 2 0.955 0.717 0.376 0.624
#> GSM573732 2 0.955 0.717 0.376 0.624
#> GSM573733 2 0.955 0.717 0.376 0.624
#> GSM573734 2 0.955 0.717 0.376 0.624
#> GSM573789 2 0.955 0.717 0.376 0.624
#> GSM573790 2 0.955 0.717 0.376 0.624
#> GSM573791 2 0.955 0.717 0.376 0.624
#> GSM573723 2 0.955 0.717 0.376 0.624
#> GSM573724 2 0.955 0.717 0.376 0.624
#> GSM573725 2 0.955 0.717 0.376 0.624
#> GSM573720 2 0.955 0.717 0.376 0.624
#> GSM573721 2 0.955 0.717 0.376 0.624
#> GSM573722 2 0.955 0.717 0.376 0.624
#> GSM573786 2 0.955 0.717 0.376 0.624
#> GSM573787 2 0.955 0.717 0.376 0.624
#> GSM573788 2 0.955 0.717 0.376 0.624
#> GSM573768 2 0.000 0.718 0.000 1.000
#> GSM573769 2 0.000 0.718 0.000 1.000
#> GSM573770 2 0.000 0.718 0.000 1.000
#> GSM573765 2 0.000 0.718 0.000 1.000
#> GSM573766 2 0.000 0.718 0.000 1.000
#> GSM573767 2 0.000 0.718 0.000 1.000
#> GSM573777 2 0.000 0.718 0.000 1.000
#> GSM573778 2 0.000 0.718 0.000 1.000
#> GSM573779 2 0.000 0.718 0.000 1.000
#> GSM573762 2 0.000 0.718 0.000 1.000
#> GSM573763 2 0.000 0.718 0.000 1.000
#> GSM573764 2 0.000 0.718 0.000 1.000
#> GSM573771 2 0.000 0.718 0.000 1.000
#> GSM573772 2 0.000 0.718 0.000 1.000
#> GSM573773 2 0.000 0.718 0.000 1.000
#> GSM573759 2 0.000 0.718 0.000 1.000
#> GSM573760 2 0.000 0.718 0.000 1.000
#> GSM573761 2 0.000 0.718 0.000 1.000
#> GSM573774 2 0.000 0.718 0.000 1.000
#> GSM573775 2 0.000 0.718 0.000 1.000
#> GSM573776 2 0.000 0.718 0.000 1.000
#> GSM573756 2 0.000 0.718 0.000 1.000
#> GSM573757 2 0.000 0.718 0.000 1.000
#> GSM573758 2 0.000 0.718 0.000 1.000
#> GSM573708 1 0.000 0.719 1.000 0.000
#> GSM573709 1 0.000 0.719 1.000 0.000
#> GSM573710 1 0.000 0.719 1.000 0.000
#> GSM573711 1 0.000 0.719 1.000 0.000
#> GSM573712 1 0.000 0.719 1.000 0.000
#> GSM573713 1 0.000 0.719 1.000 0.000
#> GSM573717 1 0.000 0.719 1.000 0.000
#> GSM573718 1 0.000 0.719 1.000 0.000
#> GSM573719 1 0.000 0.719 1.000 0.000
#> GSM573714 1 0.000 0.719 1.000 0.000
#> GSM573715 1 0.000 0.719 1.000 0.000
#> GSM573716 1 0.000 0.719 1.000 0.000
#> GSM573780 1 0.000 0.719 1.000 0.000
#> GSM573781 1 0.000 0.719 1.000 0.000
#> GSM573782 1 0.000 0.719 1.000 0.000
#> GSM573705 1 0.000 0.719 1.000 0.000
#> GSM573706 1 0.000 0.719 1.000 0.000
#> GSM573707 1 0.000 0.719 1.000 0.000
#> GSM573702 1 0.000 0.719 1.000 0.000
#> GSM573703 1 0.000 0.719 1.000 0.000
#> GSM573704 1 0.000 0.719 1.000 0.000
#> GSM573783 1 0.000 0.719 1.000 0.000
#> GSM573784 1 0.000 0.719 1.000 0.000
#> GSM573785 1 0.000 0.719 1.000 0.000
#> GSM573744 1 0.952 0.719 0.628 0.372
#> GSM573745 1 0.952 0.719 0.628 0.372
#> GSM573746 1 0.952 0.719 0.628 0.372
#> GSM573747 1 0.952 0.719 0.628 0.372
#> GSM573748 1 0.952 0.719 0.628 0.372
#> GSM573749 1 0.952 0.719 0.628 0.372
#> GSM573753 1 0.952 0.719 0.628 0.372
#> GSM573754 1 0.952 0.719 0.628 0.372
#> GSM573755 1 0.952 0.719 0.628 0.372
#> GSM573750 1 0.952 0.719 0.628 0.372
#> GSM573751 1 0.952 0.719 0.628 0.372
#> GSM573752 1 0.952 0.719 0.628 0.372
#> GSM573795 1 0.952 0.719 0.628 0.372
#> GSM573796 1 0.952 0.719 0.628 0.372
#> GSM573797 1 0.952 0.719 0.628 0.372
#> GSM573741 1 0.952 0.719 0.628 0.372
#> GSM573742 1 0.952 0.719 0.628 0.372
#> GSM573743 1 0.952 0.719 0.628 0.372
#> GSM573738 1 0.952 0.719 0.628 0.372
#> GSM573739 1 0.952 0.719 0.628 0.372
#> GSM573740 1 0.952 0.719 0.628 0.372
#> GSM573792 1 0.952 0.719 0.628 0.372
#> GSM573793 1 0.952 0.719 0.628 0.372
#> GSM573794 1 0.952 0.719 0.628 0.372
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM573726 1 0 1 1 0 0
#> GSM573727 1 0 1 1 0 0
#> GSM573728 1 0 1 1 0 0
#> GSM573729 1 0 1 1 0 0
#> GSM573730 1 0 1 1 0 0
#> GSM573731 1 0 1 1 0 0
#> GSM573735 1 0 1 1 0 0
#> GSM573736 1 0 1 1 0 0
#> GSM573737 1 0 1 1 0 0
#> GSM573732 1 0 1 1 0 0
#> GSM573733 1 0 1 1 0 0
#> GSM573734 1 0 1 1 0 0
#> GSM573789 1 0 1 1 0 0
#> GSM573790 1 0 1 1 0 0
#> GSM573791 1 0 1 1 0 0
#> GSM573723 1 0 1 1 0 0
#> GSM573724 1 0 1 1 0 0
#> GSM573725 1 0 1 1 0 0
#> GSM573720 1 0 1 1 0 0
#> GSM573721 1 0 1 1 0 0
#> GSM573722 1 0 1 1 0 0
#> GSM573786 1 0 1 1 0 0
#> GSM573787 1 0 1 1 0 0
#> GSM573788 1 0 1 1 0 0
#> GSM573768 2 0 1 0 1 0
#> GSM573769 2 0 1 0 1 0
#> GSM573770 2 0 1 0 1 0
#> GSM573765 2 0 1 0 1 0
#> GSM573766 2 0 1 0 1 0
#> GSM573767 2 0 1 0 1 0
#> GSM573777 2 0 1 0 1 0
#> GSM573778 2 0 1 0 1 0
#> GSM573779 2 0 1 0 1 0
#> GSM573762 2 0 1 0 1 0
#> GSM573763 2 0 1 0 1 0
#> GSM573764 2 0 1 0 1 0
#> GSM573771 2 0 1 0 1 0
#> GSM573772 2 0 1 0 1 0
#> GSM573773 2 0 1 0 1 0
#> GSM573759 2 0 1 0 1 0
#> GSM573760 2 0 1 0 1 0
#> GSM573761 2 0 1 0 1 0
#> GSM573774 2 0 1 0 1 0
#> GSM573775 2 0 1 0 1 0
#> GSM573776 2 0 1 0 1 0
#> GSM573756 2 0 1 0 1 0
#> GSM573757 2 0 1 0 1 0
#> GSM573758 2 0 1 0 1 0
#> GSM573708 3 0 1 0 0 1
#> GSM573709 3 0 1 0 0 1
#> GSM573710 3 0 1 0 0 1
#> GSM573711 3 0 1 0 0 1
#> GSM573712 3 0 1 0 0 1
#> GSM573713 3 0 1 0 0 1
#> GSM573717 3 0 1 0 0 1
#> GSM573718 3 0 1 0 0 1
#> GSM573719 3 0 1 0 0 1
#> GSM573714 3 0 1 0 0 1
#> GSM573715 3 0 1 0 0 1
#> GSM573716 3 0 1 0 0 1
#> GSM573780 3 0 1 0 0 1
#> GSM573781 3 0 1 0 0 1
#> GSM573782 3 0 1 0 0 1
#> GSM573705 3 0 1 0 0 1
#> GSM573706 3 0 1 0 0 1
#> GSM573707 3 0 1 0 0 1
#> GSM573702 3 0 1 0 0 1
#> GSM573703 3 0 1 0 0 1
#> GSM573704 3 0 1 0 0 1
#> GSM573783 3 0 1 0 0 1
#> GSM573784 3 0 1 0 0 1
#> GSM573785 3 0 1 0 0 1
#> GSM573744 3 0 1 0 0 1
#> GSM573745 3 0 1 0 0 1
#> GSM573746 3 0 1 0 0 1
#> GSM573747 3 0 1 0 0 1
#> GSM573748 3 0 1 0 0 1
#> GSM573749 3 0 1 0 0 1
#> GSM573753 3 0 1 0 0 1
#> GSM573754 3 0 1 0 0 1
#> GSM573755 3 0 1 0 0 1
#> GSM573750 3 0 1 0 0 1
#> GSM573751 3 0 1 0 0 1
#> GSM573752 3 0 1 0 0 1
#> GSM573795 3 0 1 0 0 1
#> GSM573796 3 0 1 0 0 1
#> GSM573797 3 0 1 0 0 1
#> GSM573741 3 0 1 0 0 1
#> GSM573742 3 0 1 0 0 1
#> GSM573743 3 0 1 0 0 1
#> GSM573738 3 0 1 0 0 1
#> GSM573739 3 0 1 0 0 1
#> GSM573740 3 0 1 0 0 1
#> GSM573792 3 0 1 0 0 1
#> GSM573793 3 0 1 0 0 1
#> GSM573794 3 0 1 0 0 1
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM573726 1 0 1 1 0 0 0
#> GSM573727 1 0 1 1 0 0 0
#> GSM573728 1 0 1 1 0 0 0
#> GSM573729 1 0 1 1 0 0 0
#> GSM573730 1 0 1 1 0 0 0
#> GSM573731 1 0 1 1 0 0 0
#> GSM573735 1 0 1 1 0 0 0
#> GSM573736 1 0 1 1 0 0 0
#> GSM573737 1 0 1 1 0 0 0
#> GSM573732 1 0 1 1 0 0 0
#> GSM573733 1 0 1 1 0 0 0
#> GSM573734 1 0 1 1 0 0 0
#> GSM573789 1 0 1 1 0 0 0
#> GSM573790 1 0 1 1 0 0 0
#> GSM573791 1 0 1 1 0 0 0
#> GSM573723 1 0 1 1 0 0 0
#> GSM573724 1 0 1 1 0 0 0
#> GSM573725 1 0 1 1 0 0 0
#> GSM573720 1 0 1 1 0 0 0
#> GSM573721 1 0 1 1 0 0 0
#> GSM573722 1 0 1 1 0 0 0
#> GSM573786 1 0 1 1 0 0 0
#> GSM573787 1 0 1 1 0 0 0
#> GSM573788 1 0 1 1 0 0 0
#> GSM573768 2 0 1 0 1 0 0
#> GSM573769 2 0 1 0 1 0 0
#> GSM573770 2 0 1 0 1 0 0
#> GSM573765 2 0 1 0 1 0 0
#> GSM573766 2 0 1 0 1 0 0
#> GSM573767 2 0 1 0 1 0 0
#> GSM573777 2 0 1 0 1 0 0
#> GSM573778 2 0 1 0 1 0 0
#> GSM573779 2 0 1 0 1 0 0
#> GSM573762 2 0 1 0 1 0 0
#> GSM573763 2 0 1 0 1 0 0
#> GSM573764 2 0 1 0 1 0 0
#> GSM573771 2 0 1 0 1 0 0
#> GSM573772 2 0 1 0 1 0 0
#> GSM573773 2 0 1 0 1 0 0
#> GSM573759 2 0 1 0 1 0 0
#> GSM573760 2 0 1 0 1 0 0
#> GSM573761 2 0 1 0 1 0 0
#> GSM573774 2 0 1 0 1 0 0
#> GSM573775 2 0 1 0 1 0 0
#> GSM573776 2 0 1 0 1 0 0
#> GSM573756 2 0 1 0 1 0 0
#> GSM573757 2 0 1 0 1 0 0
#> GSM573758 2 0 1 0 1 0 0
#> GSM573708 3 0 1 0 0 1 0
#> GSM573709 3 0 1 0 0 1 0
#> GSM573710 3 0 1 0 0 1 0
#> GSM573711 3 0 1 0 0 1 0
#> GSM573712 3 0 1 0 0 1 0
#> GSM573713 3 0 1 0 0 1 0
#> GSM573717 3 0 1 0 0 1 0
#> GSM573718 3 0 1 0 0 1 0
#> GSM573719 3 0 1 0 0 1 0
#> GSM573714 3 0 1 0 0 1 0
#> GSM573715 3 0 1 0 0 1 0
#> GSM573716 3 0 1 0 0 1 0
#> GSM573780 3 0 1 0 0 1 0
#> GSM573781 3 0 1 0 0 1 0
#> GSM573782 3 0 1 0 0 1 0
#> GSM573705 3 0 1 0 0 1 0
#> GSM573706 3 0 1 0 0 1 0
#> GSM573707 3 0 1 0 0 1 0
#> GSM573702 3 0 1 0 0 1 0
#> GSM573703 3 0 1 0 0 1 0
#> GSM573704 3 0 1 0 0 1 0
#> GSM573783 3 0 1 0 0 1 0
#> GSM573784 3 0 1 0 0 1 0
#> GSM573785 3 0 1 0 0 1 0
#> GSM573744 4 0 1 0 0 0 1
#> GSM573745 4 0 1 0 0 0 1
#> GSM573746 4 0 1 0 0 0 1
#> GSM573747 4 0 1 0 0 0 1
#> GSM573748 4 0 1 0 0 0 1
#> GSM573749 4 0 1 0 0 0 1
#> GSM573753 4 0 1 0 0 0 1
#> GSM573754 4 0 1 0 0 0 1
#> GSM573755 4 0 1 0 0 0 1
#> GSM573750 4 0 1 0 0 0 1
#> GSM573751 4 0 1 0 0 0 1
#> GSM573752 4 0 1 0 0 0 1
#> GSM573795 4 0 1 0 0 0 1
#> GSM573796 4 0 1 0 0 0 1
#> GSM573797 4 0 1 0 0 0 1
#> GSM573741 4 0 1 0 0 0 1
#> GSM573742 4 0 1 0 0 0 1
#> GSM573743 4 0 1 0 0 0 1
#> GSM573738 4 0 1 0 0 0 1
#> GSM573739 4 0 1 0 0 0 1
#> GSM573740 4 0 1 0 0 0 1
#> GSM573792 4 0 1 0 0 0 1
#> GSM573793 4 0 1 0 0 0 1
#> GSM573794 4 0 1 0 0 0 1
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM573726 1 0.0290 0.981 0.992 0.000 0.000 0.000 NA
#> GSM573727 1 0.0290 0.981 0.992 0.000 0.000 0.000 NA
#> GSM573728 1 0.0290 0.981 0.992 0.000 0.000 0.000 NA
#> GSM573729 1 0.0290 0.981 0.992 0.000 0.000 0.000 NA
#> GSM573730 1 0.0290 0.981 0.992 0.000 0.000 0.000 NA
#> GSM573731 1 0.0290 0.981 0.992 0.000 0.000 0.000 NA
#> GSM573735 1 0.0880 0.981 0.968 0.000 0.000 0.000 NA
#> GSM573736 1 0.1341 0.975 0.944 0.000 0.000 0.000 NA
#> GSM573737 1 0.1270 0.976 0.948 0.000 0.000 0.000 NA
#> GSM573732 1 0.0963 0.980 0.964 0.000 0.000 0.000 NA
#> GSM573733 1 0.0609 0.982 0.980 0.000 0.000 0.000 NA
#> GSM573734 1 0.0404 0.982 0.988 0.000 0.000 0.000 NA
#> GSM573789 1 0.1410 0.974 0.940 0.000 0.000 0.000 NA
#> GSM573790 1 0.1410 0.974 0.940 0.000 0.000 0.000 NA
#> GSM573791 1 0.1544 0.971 0.932 0.000 0.000 0.000 NA
#> GSM573723 1 0.0290 0.981 0.992 0.000 0.000 0.000 NA
#> GSM573724 1 0.0290 0.981 0.992 0.000 0.000 0.000 NA
#> GSM573725 1 0.0703 0.982 0.976 0.000 0.000 0.000 NA
#> GSM573720 1 0.0162 0.982 0.996 0.000 0.000 0.000 NA
#> GSM573721 1 0.0609 0.982 0.980 0.000 0.000 0.000 NA
#> GSM573722 1 0.0290 0.981 0.992 0.000 0.000 0.000 NA
#> GSM573786 1 0.0880 0.980 0.968 0.000 0.000 0.000 NA
#> GSM573787 1 0.1544 0.971 0.932 0.000 0.000 0.000 NA
#> GSM573788 1 0.1197 0.978 0.952 0.000 0.000 0.000 NA
#> GSM573768 2 0.0000 0.971 0.000 1.000 0.000 0.000 NA
#> GSM573769 2 0.0000 0.971 0.000 1.000 0.000 0.000 NA
#> GSM573770 2 0.0000 0.971 0.000 1.000 0.000 0.000 NA
#> GSM573765 2 0.0000 0.971 0.000 1.000 0.000 0.000 NA
#> GSM573766 2 0.0162 0.971 0.000 0.996 0.000 0.000 NA
#> GSM573767 2 0.0000 0.971 0.000 1.000 0.000 0.000 NA
#> GSM573777 2 0.0162 0.971 0.000 0.996 0.000 0.000 NA
#> GSM573778 2 0.0162 0.971 0.000 0.996 0.000 0.000 NA
#> GSM573779 2 0.0162 0.971 0.000 0.996 0.000 0.000 NA
#> GSM573762 2 0.0162 0.971 0.000 0.996 0.000 0.000 NA
#> GSM573763 2 0.0162 0.971 0.000 0.996 0.000 0.000 NA
#> GSM573764 2 0.0162 0.971 0.000 0.996 0.000 0.000 NA
#> GSM573771 2 0.0162 0.971 0.000 0.996 0.000 0.000 NA
#> GSM573772 2 0.0162 0.971 0.000 0.996 0.000 0.000 NA
#> GSM573773 2 0.0290 0.970 0.000 0.992 0.000 0.000 NA
#> GSM573759 2 0.0794 0.960 0.000 0.972 0.000 0.000 NA
#> GSM573760 2 0.0290 0.969 0.000 0.992 0.000 0.000 NA
#> GSM573761 2 0.0703 0.962 0.000 0.976 0.000 0.000 NA
#> GSM573774 2 0.0000 0.971 0.000 1.000 0.000 0.000 NA
#> GSM573775 2 0.0162 0.970 0.000 0.996 0.000 0.000 NA
#> GSM573776 2 0.0162 0.970 0.000 0.996 0.000 0.000 NA
#> GSM573756 2 0.3612 0.803 0.000 0.732 0.000 0.000 NA
#> GSM573757 2 0.3612 0.803 0.000 0.732 0.000 0.000 NA
#> GSM573758 2 0.3661 0.797 0.000 0.724 0.000 0.000 NA
#> GSM573708 3 0.0000 0.963 0.000 0.000 1.000 0.000 NA
#> GSM573709 3 0.0000 0.963 0.000 0.000 1.000 0.000 NA
#> GSM573710 3 0.0000 0.963 0.000 0.000 1.000 0.000 NA
#> GSM573711 3 0.0000 0.963 0.000 0.000 1.000 0.000 NA
#> GSM573712 3 0.0000 0.963 0.000 0.000 1.000 0.000 NA
#> GSM573713 3 0.0000 0.963 0.000 0.000 1.000 0.000 NA
#> GSM573717 3 0.0000 0.963 0.000 0.000 1.000 0.000 NA
#> GSM573718 3 0.0000 0.963 0.000 0.000 1.000 0.000 NA
#> GSM573719 3 0.0000 0.963 0.000 0.000 1.000 0.000 NA
#> GSM573714 3 0.0000 0.963 0.000 0.000 1.000 0.000 NA
#> GSM573715 3 0.0000 0.963 0.000 0.000 1.000 0.000 NA
#> GSM573716 3 0.0000 0.963 0.000 0.000 1.000 0.000 NA
#> GSM573780 3 0.3143 0.874 0.000 0.000 0.796 0.000 NA
#> GSM573781 3 0.3143 0.874 0.000 0.000 0.796 0.000 NA
#> GSM573782 3 0.3143 0.874 0.000 0.000 0.796 0.000 NA
#> GSM573705 3 0.0000 0.963 0.000 0.000 1.000 0.000 NA
#> GSM573706 3 0.0000 0.963 0.000 0.000 1.000 0.000 NA
#> GSM573707 3 0.0000 0.963 0.000 0.000 1.000 0.000 NA
#> GSM573702 3 0.0000 0.963 0.000 0.000 1.000 0.000 NA
#> GSM573703 3 0.0000 0.963 0.000 0.000 1.000 0.000 NA
#> GSM573704 3 0.0000 0.963 0.000 0.000 1.000 0.000 NA
#> GSM573783 3 0.2891 0.889 0.000 0.000 0.824 0.000 NA
#> GSM573784 3 0.2891 0.889 0.000 0.000 0.824 0.000 NA
#> GSM573785 3 0.2891 0.889 0.000 0.000 0.824 0.000 NA
#> GSM573744 4 0.0000 0.965 0.000 0.000 0.000 1.000 NA
#> GSM573745 4 0.0000 0.965 0.000 0.000 0.000 1.000 NA
#> GSM573746 4 0.0000 0.965 0.000 0.000 0.000 1.000 NA
#> GSM573747 4 0.0000 0.965 0.000 0.000 0.000 1.000 NA
#> GSM573748 4 0.0000 0.965 0.000 0.000 0.000 1.000 NA
#> GSM573749 4 0.0000 0.965 0.000 0.000 0.000 1.000 NA
#> GSM573753 4 0.0404 0.963 0.000 0.000 0.000 0.988 NA
#> GSM573754 4 0.0404 0.963 0.000 0.000 0.000 0.988 NA
#> GSM573755 4 0.0404 0.963 0.000 0.000 0.000 0.988 NA
#> GSM573750 4 0.0404 0.963 0.000 0.000 0.000 0.988 NA
#> GSM573751 4 0.0404 0.963 0.000 0.000 0.000 0.988 NA
#> GSM573752 4 0.0404 0.963 0.000 0.000 0.000 0.988 NA
#> GSM573795 4 0.3999 0.741 0.000 0.000 0.000 0.656 NA
#> GSM573796 4 0.3999 0.741 0.000 0.000 0.000 0.656 NA
#> GSM573797 4 0.3913 0.757 0.000 0.000 0.000 0.676 NA
#> GSM573741 4 0.0000 0.965 0.000 0.000 0.000 1.000 NA
#> GSM573742 4 0.0000 0.965 0.000 0.000 0.000 1.000 NA
#> GSM573743 4 0.0000 0.965 0.000 0.000 0.000 1.000 NA
#> GSM573738 4 0.0000 0.965 0.000 0.000 0.000 1.000 NA
#> GSM573739 4 0.0000 0.965 0.000 0.000 0.000 1.000 NA
#> GSM573740 4 0.0000 0.965 0.000 0.000 0.000 1.000 NA
#> GSM573792 4 0.0404 0.961 0.000 0.000 0.000 0.988 NA
#> GSM573793 4 0.0404 0.961 0.000 0.000 0.000 0.988 NA
#> GSM573794 4 0.0290 0.963 0.000 0.000 0.000 0.992 NA
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM573726 1 0.0632 0.971 0.976 0.000 0.000 0.000 NA NA
#> GSM573727 1 0.0632 0.971 0.976 0.000 0.000 0.000 NA NA
#> GSM573728 1 0.0632 0.971 0.976 0.000 0.000 0.000 NA NA
#> GSM573729 1 0.0632 0.971 0.976 0.000 0.000 0.000 NA NA
#> GSM573730 1 0.0632 0.971 0.976 0.000 0.000 0.000 NA NA
#> GSM573731 1 0.0632 0.971 0.976 0.000 0.000 0.000 NA NA
#> GSM573735 1 0.0547 0.973 0.980 0.000 0.000 0.000 NA NA
#> GSM573736 1 0.1807 0.958 0.920 0.000 0.000 0.000 NA NA
#> GSM573737 1 0.1657 0.961 0.928 0.000 0.000 0.000 NA NA
#> GSM573732 1 0.0632 0.972 0.976 0.000 0.000 0.000 NA NA
#> GSM573733 1 0.0363 0.973 0.988 0.000 0.000 0.000 NA NA
#> GSM573734 1 0.0146 0.973 0.996 0.000 0.000 0.000 NA NA
#> GSM573789 1 0.1926 0.955 0.912 0.000 0.000 0.000 NA NA
#> GSM573790 1 0.1983 0.954 0.908 0.000 0.000 0.000 NA NA
#> GSM573791 1 0.1926 0.956 0.912 0.000 0.000 0.000 NA NA
#> GSM573723 1 0.0632 0.971 0.976 0.000 0.000 0.000 NA NA
#> GSM573724 1 0.0632 0.971 0.976 0.000 0.000 0.000 NA NA
#> GSM573725 1 0.0909 0.972 0.968 0.000 0.000 0.000 NA NA
#> GSM573720 1 0.0405 0.973 0.988 0.000 0.000 0.000 NA NA
#> GSM573721 1 0.0909 0.971 0.968 0.000 0.000 0.000 NA NA
#> GSM573722 1 0.0146 0.973 0.996 0.000 0.000 0.000 NA NA
#> GSM573786 1 0.1151 0.969 0.956 0.000 0.000 0.000 NA NA
#> GSM573787 1 0.2122 0.950 0.900 0.000 0.000 0.000 NA NA
#> GSM573788 1 0.1564 0.964 0.936 0.000 0.000 0.000 NA NA
#> GSM573768 2 0.0146 0.975 0.000 0.996 0.000 0.000 NA NA
#> GSM573769 2 0.0000 0.976 0.000 1.000 0.000 0.000 NA NA
#> GSM573770 2 0.0000 0.976 0.000 1.000 0.000 0.000 NA NA
#> GSM573765 2 0.0146 0.975 0.000 0.996 0.000 0.000 NA NA
#> GSM573766 2 0.0146 0.976 0.000 0.996 0.000 0.000 NA NA
#> GSM573767 2 0.0146 0.976 0.000 0.996 0.000 0.000 NA NA
#> GSM573777 2 0.0146 0.976 0.000 0.996 0.000 0.000 NA NA
#> GSM573778 2 0.0146 0.976 0.000 0.996 0.000 0.000 NA NA
#> GSM573779 2 0.0146 0.976 0.000 0.996 0.000 0.000 NA NA
#> GSM573762 2 0.0146 0.976 0.000 0.996 0.000 0.000 NA NA
#> GSM573763 2 0.0146 0.976 0.000 0.996 0.000 0.000 NA NA
#> GSM573764 2 0.0146 0.976 0.000 0.996 0.000 0.000 NA NA
#> GSM573771 2 0.0146 0.976 0.000 0.996 0.000 0.000 NA NA
#> GSM573772 2 0.0146 0.976 0.000 0.996 0.000 0.000 NA NA
#> GSM573773 2 0.0146 0.976 0.000 0.996 0.000 0.000 NA NA
#> GSM573759 2 0.0000 0.976 0.000 1.000 0.000 0.000 NA NA
#> GSM573760 2 0.0000 0.976 0.000 1.000 0.000 0.000 NA NA
#> GSM573761 2 0.0000 0.976 0.000 1.000 0.000 0.000 NA NA
#> GSM573774 2 0.0000 0.976 0.000 1.000 0.000 0.000 NA NA
#> GSM573775 2 0.0000 0.976 0.000 1.000 0.000 0.000 NA NA
#> GSM573776 2 0.0000 0.976 0.000 1.000 0.000 0.000 NA NA
#> GSM573756 2 0.2941 0.832 0.000 0.780 0.000 0.000 NA NA
#> GSM573757 2 0.2912 0.835 0.000 0.784 0.000 0.000 NA NA
#> GSM573758 2 0.3215 0.813 0.000 0.756 0.000 0.000 NA NA
#> GSM573708 3 0.0000 0.937 0.000 0.000 1.000 0.000 NA NA
#> GSM573709 3 0.0000 0.937 0.000 0.000 1.000 0.000 NA NA
#> GSM573710 3 0.0000 0.937 0.000 0.000 1.000 0.000 NA NA
#> GSM573711 3 0.0000 0.937 0.000 0.000 1.000 0.000 NA NA
#> GSM573712 3 0.0000 0.937 0.000 0.000 1.000 0.000 NA NA
#> GSM573713 3 0.0000 0.937 0.000 0.000 1.000 0.000 NA NA
#> GSM573717 3 0.0000 0.937 0.000 0.000 1.000 0.000 NA NA
#> GSM573718 3 0.0000 0.937 0.000 0.000 1.000 0.000 NA NA
#> GSM573719 3 0.0000 0.937 0.000 0.000 1.000 0.000 NA NA
#> GSM573714 3 0.0000 0.937 0.000 0.000 1.000 0.000 NA NA
#> GSM573715 3 0.0000 0.937 0.000 0.000 1.000 0.000 NA NA
#> GSM573716 3 0.0000 0.937 0.000 0.000 1.000 0.000 NA NA
#> GSM573780 3 0.3578 0.772 0.000 0.000 0.660 0.000 NA NA
#> GSM573781 3 0.3578 0.772 0.000 0.000 0.660 0.000 NA NA
#> GSM573782 3 0.3578 0.772 0.000 0.000 0.660 0.000 NA NA
#> GSM573705 3 0.0000 0.937 0.000 0.000 1.000 0.000 NA NA
#> GSM573706 3 0.0000 0.937 0.000 0.000 1.000 0.000 NA NA
#> GSM573707 3 0.0000 0.937 0.000 0.000 1.000 0.000 NA NA
#> GSM573702 3 0.0000 0.937 0.000 0.000 1.000 0.000 NA NA
#> GSM573703 3 0.0000 0.937 0.000 0.000 1.000 0.000 NA NA
#> GSM573704 3 0.0000 0.937 0.000 0.000 1.000 0.000 NA NA
#> GSM573783 3 0.4357 0.795 0.000 0.000 0.696 0.000 NA NA
#> GSM573784 3 0.4357 0.795 0.000 0.000 0.696 0.000 NA NA
#> GSM573785 3 0.4357 0.795 0.000 0.000 0.696 0.000 NA NA
#> GSM573744 4 0.0000 0.938 0.000 0.000 0.000 1.000 NA NA
#> GSM573745 4 0.0000 0.938 0.000 0.000 0.000 1.000 NA NA
#> GSM573746 4 0.0000 0.938 0.000 0.000 0.000 1.000 NA NA
#> GSM573747 4 0.0000 0.938 0.000 0.000 0.000 1.000 NA NA
#> GSM573748 4 0.0000 0.938 0.000 0.000 0.000 1.000 NA NA
#> GSM573749 4 0.0000 0.938 0.000 0.000 0.000 1.000 NA NA
#> GSM573753 4 0.0508 0.935 0.000 0.000 0.000 0.984 NA NA
#> GSM573754 4 0.0508 0.935 0.000 0.000 0.000 0.984 NA NA
#> GSM573755 4 0.0508 0.935 0.000 0.000 0.000 0.984 NA NA
#> GSM573750 4 0.0508 0.935 0.000 0.000 0.000 0.984 NA NA
#> GSM573751 4 0.0508 0.935 0.000 0.000 0.000 0.984 NA NA
#> GSM573752 4 0.0508 0.935 0.000 0.000 0.000 0.984 NA NA
#> GSM573795 4 0.3847 0.663 0.000 0.000 0.000 0.544 NA NA
#> GSM573796 4 0.3847 0.663 0.000 0.000 0.000 0.544 NA NA
#> GSM573797 4 0.3847 0.663 0.000 0.000 0.000 0.544 NA NA
#> GSM573741 4 0.0000 0.938 0.000 0.000 0.000 1.000 NA NA
#> GSM573742 4 0.0000 0.938 0.000 0.000 0.000 1.000 NA NA
#> GSM573743 4 0.0000 0.938 0.000 0.000 0.000 1.000 NA NA
#> GSM573738 4 0.0000 0.938 0.000 0.000 0.000 1.000 NA NA
#> GSM573739 4 0.0000 0.938 0.000 0.000 0.000 1.000 NA NA
#> GSM573740 4 0.0000 0.938 0.000 0.000 0.000 1.000 NA NA
#> GSM573792 4 0.3103 0.830 0.000 0.000 0.000 0.784 NA NA
#> GSM573793 4 0.3103 0.830 0.000 0.000 0.000 0.784 NA NA
#> GSM573794 4 0.1082 0.922 0.000 0.000 0.000 0.956 NA NA
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
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)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
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:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.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")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
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 cell.line(p) agent(p) k
#> ATC:mclust 96 1.13e-20 0.843 2
#> ATC:mclust 96 9.56e-39 0.741 3
#> ATC:mclust 96 9.14e-57 0.975 4
#> ATC:mclust 96 9.14e-57 0.975 5
#> ATC:mclust 96 9.14e-57 0.975 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.
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 46609 rows and 96 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 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)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.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:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).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)
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.37957 0.621 0.621
#> 3 3 1.000 1.000 1.000 0.66491 0.747 0.593
#> 4 4 1.000 0.999 0.987 0.19025 0.874 0.657
#> 5 5 1.000 0.992 0.988 0.00965 1.000 1.000
#> 6 6 0.979 0.970 0.964 0.01310 1.000 1.000
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 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.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> GSM573726 1 0 1 1 0
#> GSM573727 1 0 1 1 0
#> GSM573728 1 0 1 1 0
#> GSM573729 1 0 1 1 0
#> GSM573730 1 0 1 1 0
#> GSM573731 1 0 1 1 0
#> GSM573735 1 0 1 1 0
#> GSM573736 1 0 1 1 0
#> GSM573737 1 0 1 1 0
#> GSM573732 1 0 1 1 0
#> GSM573733 1 0 1 1 0
#> GSM573734 1 0 1 1 0
#> GSM573789 1 0 1 1 0
#> GSM573790 1 0 1 1 0
#> GSM573791 1 0 1 1 0
#> GSM573723 1 0 1 1 0
#> GSM573724 1 0 1 1 0
#> GSM573725 1 0 1 1 0
#> GSM573720 1 0 1 1 0
#> GSM573721 1 0 1 1 0
#> GSM573722 1 0 1 1 0
#> GSM573786 1 0 1 1 0
#> GSM573787 1 0 1 1 0
#> GSM573788 1 0 1 1 0
#> GSM573768 2 0 1 0 1
#> GSM573769 2 0 1 0 1
#> GSM573770 2 0 1 0 1
#> GSM573765 2 0 1 0 1
#> GSM573766 2 0 1 0 1
#> GSM573767 2 0 1 0 1
#> GSM573777 2 0 1 0 1
#> GSM573778 2 0 1 0 1
#> GSM573779 2 0 1 0 1
#> GSM573762 2 0 1 0 1
#> GSM573763 2 0 1 0 1
#> GSM573764 2 0 1 0 1
#> GSM573771 2 0 1 0 1
#> GSM573772 2 0 1 0 1
#> GSM573773 2 0 1 0 1
#> GSM573759 2 0 1 0 1
#> GSM573760 2 0 1 0 1
#> GSM573761 2 0 1 0 1
#> GSM573774 2 0 1 0 1
#> GSM573775 2 0 1 0 1
#> GSM573776 2 0 1 0 1
#> GSM573756 2 0 1 0 1
#> GSM573757 2 0 1 0 1
#> GSM573758 2 0 1 0 1
#> GSM573708 1 0 1 1 0
#> GSM573709 1 0 1 1 0
#> GSM573710 1 0 1 1 0
#> GSM573711 1 0 1 1 0
#> GSM573712 1 0 1 1 0
#> GSM573713 1 0 1 1 0
#> GSM573717 1 0 1 1 0
#> GSM573718 1 0 1 1 0
#> GSM573719 1 0 1 1 0
#> GSM573714 1 0 1 1 0
#> GSM573715 1 0 1 1 0
#> GSM573716 1 0 1 1 0
#> GSM573780 1 0 1 1 0
#> GSM573781 1 0 1 1 0
#> GSM573782 1 0 1 1 0
#> GSM573705 1 0 1 1 0
#> GSM573706 1 0 1 1 0
#> GSM573707 1 0 1 1 0
#> GSM573702 1 0 1 1 0
#> GSM573703 1 0 1 1 0
#> GSM573704 1 0 1 1 0
#> GSM573783 1 0 1 1 0
#> GSM573784 1 0 1 1 0
#> GSM573785 1 0 1 1 0
#> GSM573744 1 0 1 1 0
#> GSM573745 1 0 1 1 0
#> GSM573746 1 0 1 1 0
#> GSM573747 1 0 1 1 0
#> GSM573748 1 0 1 1 0
#> GSM573749 1 0 1 1 0
#> GSM573753 1 0 1 1 0
#> GSM573754 1 0 1 1 0
#> GSM573755 1 0 1 1 0
#> GSM573750 1 0 1 1 0
#> GSM573751 1 0 1 1 0
#> GSM573752 1 0 1 1 0
#> GSM573795 1 0 1 1 0
#> GSM573796 1 0 1 1 0
#> GSM573797 1 0 1 1 0
#> GSM573741 1 0 1 1 0
#> GSM573742 1 0 1 1 0
#> GSM573743 1 0 1 1 0
#> GSM573738 1 0 1 1 0
#> GSM573739 1 0 1 1 0
#> GSM573740 1 0 1 1 0
#> GSM573792 1 0 1 1 0
#> GSM573793 1 0 1 1 0
#> GSM573794 1 0 1 1 0
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM573726 1 0 1 1 0 0
#> GSM573727 1 0 1 1 0 0
#> GSM573728 1 0 1 1 0 0
#> GSM573729 1 0 1 1 0 0
#> GSM573730 1 0 1 1 0 0
#> GSM573731 1 0 1 1 0 0
#> GSM573735 1 0 1 1 0 0
#> GSM573736 1 0 1 1 0 0
#> GSM573737 1 0 1 1 0 0
#> GSM573732 1 0 1 1 0 0
#> GSM573733 1 0 1 1 0 0
#> GSM573734 1 0 1 1 0 0
#> GSM573789 1 0 1 1 0 0
#> GSM573790 1 0 1 1 0 0
#> GSM573791 1 0 1 1 0 0
#> GSM573723 1 0 1 1 0 0
#> GSM573724 1 0 1 1 0 0
#> GSM573725 1 0 1 1 0 0
#> GSM573720 1 0 1 1 0 0
#> GSM573721 1 0 1 1 0 0
#> GSM573722 1 0 1 1 0 0
#> GSM573786 1 0 1 1 0 0
#> GSM573787 1 0 1 1 0 0
#> GSM573788 1 0 1 1 0 0
#> GSM573768 2 0 1 0 1 0
#> GSM573769 2 0 1 0 1 0
#> GSM573770 2 0 1 0 1 0
#> GSM573765 2 0 1 0 1 0
#> GSM573766 2 0 1 0 1 0
#> GSM573767 2 0 1 0 1 0
#> GSM573777 2 0 1 0 1 0
#> GSM573778 2 0 1 0 1 0
#> GSM573779 2 0 1 0 1 0
#> GSM573762 2 0 1 0 1 0
#> GSM573763 2 0 1 0 1 0
#> GSM573764 2 0 1 0 1 0
#> GSM573771 2 0 1 0 1 0
#> GSM573772 2 0 1 0 1 0
#> GSM573773 2 0 1 0 1 0
#> GSM573759 2 0 1 0 1 0
#> GSM573760 2 0 1 0 1 0
#> GSM573761 2 0 1 0 1 0
#> GSM573774 2 0 1 0 1 0
#> GSM573775 2 0 1 0 1 0
#> GSM573776 2 0 1 0 1 0
#> GSM573756 2 0 1 0 1 0
#> GSM573757 2 0 1 0 1 0
#> GSM573758 2 0 1 0 1 0
#> GSM573708 3 0 1 0 0 1
#> GSM573709 3 0 1 0 0 1
#> GSM573710 3 0 1 0 0 1
#> GSM573711 3 0 1 0 0 1
#> GSM573712 3 0 1 0 0 1
#> GSM573713 3 0 1 0 0 1
#> GSM573717 3 0 1 0 0 1
#> GSM573718 3 0 1 0 0 1
#> GSM573719 3 0 1 0 0 1
#> GSM573714 3 0 1 0 0 1
#> GSM573715 3 0 1 0 0 1
#> GSM573716 3 0 1 0 0 1
#> GSM573780 3 0 1 0 0 1
#> GSM573781 3 0 1 0 0 1
#> GSM573782 3 0 1 0 0 1
#> GSM573705 3 0 1 0 0 1
#> GSM573706 3 0 1 0 0 1
#> GSM573707 3 0 1 0 0 1
#> GSM573702 3 0 1 0 0 1
#> GSM573703 3 0 1 0 0 1
#> GSM573704 3 0 1 0 0 1
#> GSM573783 3 0 1 0 0 1
#> GSM573784 3 0 1 0 0 1
#> GSM573785 3 0 1 0 0 1
#> GSM573744 1 0 1 1 0 0
#> GSM573745 1 0 1 1 0 0
#> GSM573746 1 0 1 1 0 0
#> GSM573747 1 0 1 1 0 0
#> GSM573748 1 0 1 1 0 0
#> GSM573749 1 0 1 1 0 0
#> GSM573753 1 0 1 1 0 0
#> GSM573754 1 0 1 1 0 0
#> GSM573755 1 0 1 1 0 0
#> GSM573750 1 0 1 1 0 0
#> GSM573751 1 0 1 1 0 0
#> GSM573752 1 0 1 1 0 0
#> GSM573795 1 0 1 1 0 0
#> GSM573796 1 0 1 1 0 0
#> GSM573797 1 0 1 1 0 0
#> GSM573741 1 0 1 1 0 0
#> GSM573742 1 0 1 1 0 0
#> GSM573743 1 0 1 1 0 0
#> GSM573738 1 0 1 1 0 0
#> GSM573739 1 0 1 1 0 0
#> GSM573740 1 0 1 1 0 0
#> GSM573792 1 0 1 1 0 0
#> GSM573793 1 0 1 1 0 0
#> GSM573794 1 0 1 1 0 0
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM573726 1 0.1302 1.000 0.956 0 0 0.044
#> GSM573727 1 0.1302 1.000 0.956 0 0 0.044
#> GSM573728 1 0.1302 1.000 0.956 0 0 0.044
#> GSM573729 1 0.1302 1.000 0.956 0 0 0.044
#> GSM573730 1 0.1302 1.000 0.956 0 0 0.044
#> GSM573731 1 0.1302 1.000 0.956 0 0 0.044
#> GSM573735 1 0.1302 1.000 0.956 0 0 0.044
#> GSM573736 1 0.1302 1.000 0.956 0 0 0.044
#> GSM573737 1 0.1302 1.000 0.956 0 0 0.044
#> GSM573732 1 0.1302 1.000 0.956 0 0 0.044
#> GSM573733 1 0.1302 1.000 0.956 0 0 0.044
#> GSM573734 1 0.1302 1.000 0.956 0 0 0.044
#> GSM573789 1 0.1302 1.000 0.956 0 0 0.044
#> GSM573790 1 0.1302 1.000 0.956 0 0 0.044
#> GSM573791 1 0.1302 1.000 0.956 0 0 0.044
#> GSM573723 1 0.1302 1.000 0.956 0 0 0.044
#> GSM573724 1 0.1302 1.000 0.956 0 0 0.044
#> GSM573725 1 0.1302 1.000 0.956 0 0 0.044
#> GSM573720 1 0.1302 1.000 0.956 0 0 0.044
#> GSM573721 1 0.1302 1.000 0.956 0 0 0.044
#> GSM573722 1 0.1302 1.000 0.956 0 0 0.044
#> GSM573786 1 0.1302 1.000 0.956 0 0 0.044
#> GSM573787 1 0.1302 1.000 0.956 0 0 0.044
#> GSM573788 1 0.1302 1.000 0.956 0 0 0.044
#> GSM573768 2 0.0000 1.000 0.000 1 0 0.000
#> GSM573769 2 0.0000 1.000 0.000 1 0 0.000
#> GSM573770 2 0.0000 1.000 0.000 1 0 0.000
#> GSM573765 2 0.0000 1.000 0.000 1 0 0.000
#> GSM573766 2 0.0000 1.000 0.000 1 0 0.000
#> GSM573767 2 0.0000 1.000 0.000 1 0 0.000
#> GSM573777 2 0.0000 1.000 0.000 1 0 0.000
#> GSM573778 2 0.0000 1.000 0.000 1 0 0.000
#> GSM573779 2 0.0000 1.000 0.000 1 0 0.000
#> GSM573762 2 0.0000 1.000 0.000 1 0 0.000
#> GSM573763 2 0.0000 1.000 0.000 1 0 0.000
#> GSM573764 2 0.0000 1.000 0.000 1 0 0.000
#> GSM573771 2 0.0000 1.000 0.000 1 0 0.000
#> GSM573772 2 0.0000 1.000 0.000 1 0 0.000
#> GSM573773 2 0.0000 1.000 0.000 1 0 0.000
#> GSM573759 2 0.0000 1.000 0.000 1 0 0.000
#> GSM573760 2 0.0000 1.000 0.000 1 0 0.000
#> GSM573761 2 0.0000 1.000 0.000 1 0 0.000
#> GSM573774 2 0.0000 1.000 0.000 1 0 0.000
#> GSM573775 2 0.0000 1.000 0.000 1 0 0.000
#> GSM573776 2 0.0000 1.000 0.000 1 0 0.000
#> GSM573756 2 0.0000 1.000 0.000 1 0 0.000
#> GSM573757 2 0.0000 1.000 0.000 1 0 0.000
#> GSM573758 2 0.0000 1.000 0.000 1 0 0.000
#> GSM573708 3 0.0000 1.000 0.000 0 1 0.000
#> GSM573709 3 0.0000 1.000 0.000 0 1 0.000
#> GSM573710 3 0.0000 1.000 0.000 0 1 0.000
#> GSM573711 3 0.0000 1.000 0.000 0 1 0.000
#> GSM573712 3 0.0000 1.000 0.000 0 1 0.000
#> GSM573713 3 0.0000 1.000 0.000 0 1 0.000
#> GSM573717 3 0.0000 1.000 0.000 0 1 0.000
#> GSM573718 3 0.0000 1.000 0.000 0 1 0.000
#> GSM573719 3 0.0000 1.000 0.000 0 1 0.000
#> GSM573714 3 0.0000 1.000 0.000 0 1 0.000
#> GSM573715 3 0.0000 1.000 0.000 0 1 0.000
#> GSM573716 3 0.0000 1.000 0.000 0 1 0.000
#> GSM573780 3 0.0000 1.000 0.000 0 1 0.000
#> GSM573781 3 0.0000 1.000 0.000 0 1 0.000
#> GSM573782 3 0.0000 1.000 0.000 0 1 0.000
#> GSM573705 3 0.0000 1.000 0.000 0 1 0.000
#> GSM573706 3 0.0000 1.000 0.000 0 1 0.000
#> GSM573707 3 0.0000 1.000 0.000 0 1 0.000
#> GSM573702 3 0.0000 1.000 0.000 0 1 0.000
#> GSM573703 3 0.0000 1.000 0.000 0 1 0.000
#> GSM573704 3 0.0000 1.000 0.000 0 1 0.000
#> GSM573783 3 0.0000 1.000 0.000 0 1 0.000
#> GSM573784 3 0.0000 1.000 0.000 0 1 0.000
#> GSM573785 3 0.0000 1.000 0.000 0 1 0.000
#> GSM573744 4 0.0469 0.994 0.012 0 0 0.988
#> GSM573745 4 0.0469 0.994 0.012 0 0 0.988
#> GSM573746 4 0.0336 0.995 0.008 0 0 0.992
#> GSM573747 4 0.0336 0.995 0.008 0 0 0.992
#> GSM573748 4 0.0336 0.995 0.008 0 0 0.992
#> GSM573749 4 0.0336 0.995 0.008 0 0 0.992
#> GSM573753 4 0.0000 0.993 0.000 0 0 1.000
#> GSM573754 4 0.0000 0.993 0.000 0 0 1.000
#> GSM573755 4 0.0000 0.993 0.000 0 0 1.000
#> GSM573750 4 0.0188 0.995 0.004 0 0 0.996
#> GSM573751 4 0.0000 0.993 0.000 0 0 1.000
#> GSM573752 4 0.0000 0.993 0.000 0 0 1.000
#> GSM573795 4 0.0000 0.993 0.000 0 0 1.000
#> GSM573796 4 0.0000 0.993 0.000 0 0 1.000
#> GSM573797 4 0.0000 0.993 0.000 0 0 1.000
#> GSM573741 4 0.0469 0.994 0.012 0 0 0.988
#> GSM573742 4 0.0469 0.994 0.012 0 0 0.988
#> GSM573743 4 0.0469 0.994 0.012 0 0 0.988
#> GSM573738 4 0.0469 0.994 0.012 0 0 0.988
#> GSM573739 4 0.0469 0.994 0.012 0 0 0.988
#> GSM573740 4 0.0469 0.994 0.012 0 0 0.988
#> GSM573792 4 0.0336 0.995 0.008 0 0 0.992
#> GSM573793 4 0.0336 0.995 0.008 0 0 0.992
#> GSM573794 4 0.0336 0.995 0.008 0 0 0.992
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM573726 1 0.0000 0.993 1.000 0.000 0.000 0.000 NA
#> GSM573727 1 0.0000 0.993 1.000 0.000 0.000 0.000 NA
#> GSM573728 1 0.0000 0.993 1.000 0.000 0.000 0.000 NA
#> GSM573729 1 0.0000 0.993 1.000 0.000 0.000 0.000 NA
#> GSM573730 1 0.0000 0.993 1.000 0.000 0.000 0.000 NA
#> GSM573731 1 0.0000 0.993 1.000 0.000 0.000 0.000 NA
#> GSM573735 1 0.0865 0.986 0.972 0.000 0.000 0.004 NA
#> GSM573736 1 0.0865 0.986 0.972 0.000 0.000 0.004 NA
#> GSM573737 1 0.0865 0.986 0.972 0.000 0.000 0.004 NA
#> GSM573732 1 0.0865 0.986 0.972 0.000 0.000 0.004 NA
#> GSM573733 1 0.0865 0.986 0.972 0.000 0.000 0.004 NA
#> GSM573734 1 0.0865 0.986 0.972 0.000 0.000 0.004 NA
#> GSM573789 1 0.0290 0.992 0.992 0.000 0.000 0.000 NA
#> GSM573790 1 0.0404 0.991 0.988 0.000 0.000 0.000 NA
#> GSM573791 1 0.0404 0.991 0.988 0.000 0.000 0.000 NA
#> GSM573723 1 0.0000 0.993 1.000 0.000 0.000 0.000 NA
#> GSM573724 1 0.0000 0.993 1.000 0.000 0.000 0.000 NA
#> GSM573725 1 0.0000 0.993 1.000 0.000 0.000 0.000 NA
#> GSM573720 1 0.0000 0.993 1.000 0.000 0.000 0.000 NA
#> GSM573721 1 0.0000 0.993 1.000 0.000 0.000 0.000 NA
#> GSM573722 1 0.0000 0.993 1.000 0.000 0.000 0.000 NA
#> GSM573786 1 0.0290 0.991 0.992 0.000 0.000 0.000 NA
#> GSM573787 1 0.0404 0.989 0.988 0.000 0.000 0.000 NA
#> GSM573788 1 0.0290 0.991 0.992 0.000 0.000 0.000 NA
#> GSM573768 2 0.0290 0.990 0.000 0.992 0.000 0.000 NA
#> GSM573769 2 0.0290 0.990 0.000 0.992 0.000 0.000 NA
#> GSM573770 2 0.0290 0.990 0.000 0.992 0.000 0.000 NA
#> GSM573765 2 0.0290 0.992 0.000 0.992 0.000 0.000 NA
#> GSM573766 2 0.0404 0.992 0.000 0.988 0.000 0.000 NA
#> GSM573767 2 0.0404 0.992 0.000 0.988 0.000 0.000 NA
#> GSM573777 2 0.0404 0.992 0.000 0.988 0.000 0.000 NA
#> GSM573778 2 0.0404 0.992 0.000 0.988 0.000 0.000 NA
#> GSM573779 2 0.0404 0.992 0.000 0.988 0.000 0.000 NA
#> GSM573762 2 0.0404 0.992 0.000 0.988 0.000 0.000 NA
#> GSM573763 2 0.0404 0.992 0.000 0.988 0.000 0.000 NA
#> GSM573764 2 0.0404 0.992 0.000 0.988 0.000 0.000 NA
#> GSM573771 2 0.0404 0.992 0.000 0.988 0.000 0.000 NA
#> GSM573772 2 0.0404 0.992 0.000 0.988 0.000 0.000 NA
#> GSM573773 2 0.0404 0.992 0.000 0.988 0.000 0.000 NA
#> GSM573759 2 0.0404 0.989 0.000 0.988 0.000 0.000 NA
#> GSM573760 2 0.0404 0.989 0.000 0.988 0.000 0.000 NA
#> GSM573761 2 0.0404 0.989 0.000 0.988 0.000 0.000 NA
#> GSM573774 2 0.0000 0.992 0.000 1.000 0.000 0.000 NA
#> GSM573775 2 0.0000 0.992 0.000 1.000 0.000 0.000 NA
#> GSM573776 2 0.0000 0.992 0.000 1.000 0.000 0.000 NA
#> GSM573756 2 0.0794 0.983 0.000 0.972 0.000 0.000 NA
#> GSM573757 2 0.0794 0.983 0.000 0.972 0.000 0.000 NA
#> GSM573758 2 0.0703 0.984 0.000 0.976 0.000 0.000 NA
#> GSM573708 3 0.0404 0.993 0.000 0.000 0.988 0.000 NA
#> GSM573709 3 0.0404 0.993 0.000 0.000 0.988 0.000 NA
#> GSM573710 3 0.0404 0.993 0.000 0.000 0.988 0.000 NA
#> GSM573711 3 0.0404 0.993 0.000 0.000 0.988 0.000 NA
#> GSM573712 3 0.0404 0.993 0.000 0.000 0.988 0.000 NA
#> GSM573713 3 0.0404 0.993 0.000 0.000 0.988 0.000 NA
#> GSM573717 3 0.0000 0.995 0.000 0.000 1.000 0.000 NA
#> GSM573718 3 0.0000 0.995 0.000 0.000 1.000 0.000 NA
#> GSM573719 3 0.0000 0.995 0.000 0.000 1.000 0.000 NA
#> GSM573714 3 0.0000 0.995 0.000 0.000 1.000 0.000 NA
#> GSM573715 3 0.0000 0.995 0.000 0.000 1.000 0.000 NA
#> GSM573716 3 0.0162 0.994 0.000 0.000 0.996 0.000 NA
#> GSM573780 3 0.0880 0.984 0.000 0.000 0.968 0.000 NA
#> GSM573781 3 0.0880 0.984 0.000 0.000 0.968 0.000 NA
#> GSM573782 3 0.0880 0.984 0.000 0.000 0.968 0.000 NA
#> GSM573705 3 0.0162 0.994 0.000 0.000 0.996 0.000 NA
#> GSM573706 3 0.0000 0.995 0.000 0.000 1.000 0.000 NA
#> GSM573707 3 0.0000 0.995 0.000 0.000 1.000 0.000 NA
#> GSM573702 3 0.0162 0.994 0.000 0.000 0.996 0.000 NA
#> GSM573703 3 0.0000 0.995 0.000 0.000 1.000 0.000 NA
#> GSM573704 3 0.0000 0.995 0.000 0.000 1.000 0.000 NA
#> GSM573783 3 0.0162 0.994 0.000 0.000 0.996 0.000 NA
#> GSM573784 3 0.0162 0.994 0.000 0.000 0.996 0.000 NA
#> GSM573785 3 0.0162 0.994 0.000 0.000 0.996 0.000 NA
#> GSM573744 4 0.0404 0.995 0.012 0.000 0.000 0.988 NA
#> GSM573745 4 0.0404 0.995 0.012 0.000 0.000 0.988 NA
#> GSM573746 4 0.0404 0.995 0.012 0.000 0.000 0.988 NA
#> GSM573747 4 0.0566 0.995 0.012 0.000 0.000 0.984 NA
#> GSM573748 4 0.0404 0.995 0.012 0.000 0.000 0.988 NA
#> GSM573749 4 0.0566 0.995 0.012 0.000 0.000 0.984 NA
#> GSM573753 4 0.0693 0.995 0.012 0.000 0.000 0.980 NA
#> GSM573754 4 0.0693 0.995 0.012 0.000 0.000 0.980 NA
#> GSM573755 4 0.0693 0.995 0.012 0.000 0.000 0.980 NA
#> GSM573750 4 0.0693 0.995 0.012 0.000 0.000 0.980 NA
#> GSM573751 4 0.0693 0.995 0.012 0.000 0.000 0.980 NA
#> GSM573752 4 0.0693 0.995 0.012 0.000 0.000 0.980 NA
#> GSM573795 4 0.0693 0.995 0.012 0.000 0.000 0.980 NA
#> GSM573796 4 0.0693 0.995 0.012 0.000 0.000 0.980 NA
#> GSM573797 4 0.0693 0.995 0.012 0.000 0.000 0.980 NA
#> GSM573741 4 0.0566 0.995 0.012 0.000 0.000 0.984 NA
#> GSM573742 4 0.0566 0.995 0.012 0.000 0.000 0.984 NA
#> GSM573743 4 0.0693 0.994 0.012 0.000 0.000 0.980 NA
#> GSM573738 4 0.0693 0.994 0.012 0.000 0.000 0.980 NA
#> GSM573739 4 0.0693 0.994 0.012 0.000 0.000 0.980 NA
#> GSM573740 4 0.0807 0.993 0.012 0.000 0.000 0.976 NA
#> GSM573792 4 0.0404 0.995 0.012 0.000 0.000 0.988 NA
#> GSM573793 4 0.0807 0.993 0.012 0.000 0.000 0.976 NA
#> GSM573794 4 0.0912 0.991 0.012 0.000 0.000 0.972 NA
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM573726 1 0.0000 0.988 1.000 0.000 0.000 0.000 0.000 NA
#> GSM573727 1 0.0000 0.988 1.000 0.000 0.000 0.000 0.000 NA
#> GSM573728 1 0.0146 0.988 0.996 0.000 0.000 0.000 0.000 NA
#> GSM573729 1 0.0146 0.988 0.996 0.000 0.000 0.000 0.000 NA
#> GSM573730 1 0.0000 0.988 1.000 0.000 0.000 0.000 0.000 NA
#> GSM573731 1 0.0000 0.988 1.000 0.000 0.000 0.000 0.000 NA
#> GSM573735 1 0.1074 0.981 0.960 0.000 0.000 0.000 0.012 NA
#> GSM573736 1 0.1074 0.981 0.960 0.000 0.000 0.000 0.012 NA
#> GSM573737 1 0.1074 0.981 0.960 0.000 0.000 0.000 0.012 NA
#> GSM573732 1 0.1168 0.980 0.956 0.000 0.000 0.000 0.016 NA
#> GSM573733 1 0.0993 0.982 0.964 0.000 0.000 0.000 0.012 NA
#> GSM573734 1 0.0993 0.982 0.964 0.000 0.000 0.000 0.012 NA
#> GSM573789 1 0.0806 0.985 0.972 0.000 0.000 0.000 0.008 NA
#> GSM573790 1 0.0806 0.985 0.972 0.000 0.000 0.000 0.008 NA
#> GSM573791 1 0.0806 0.985 0.972 0.000 0.000 0.000 0.008 NA
#> GSM573723 1 0.0146 0.988 0.996 0.000 0.000 0.000 0.000 NA
#> GSM573724 1 0.0000 0.988 1.000 0.000 0.000 0.000 0.000 NA
#> GSM573725 1 0.0146 0.988 0.996 0.000 0.000 0.000 0.000 NA
#> GSM573720 1 0.0260 0.987 0.992 0.000 0.000 0.000 0.000 NA
#> GSM573721 1 0.0000 0.988 1.000 0.000 0.000 0.000 0.000 NA
#> GSM573722 1 0.0146 0.988 0.996 0.000 0.000 0.000 0.000 NA
#> GSM573786 1 0.0603 0.985 0.980 0.000 0.000 0.000 0.016 NA
#> GSM573787 1 0.0777 0.982 0.972 0.000 0.000 0.000 0.024 NA
#> GSM573788 1 0.0603 0.985 0.980 0.000 0.000 0.000 0.016 NA
#> GSM573768 2 0.1471 0.971 0.000 0.932 0.000 0.000 0.004 NA
#> GSM573769 2 0.1471 0.971 0.000 0.932 0.000 0.000 0.004 NA
#> GSM573770 2 0.1471 0.971 0.000 0.932 0.000 0.000 0.004 NA
#> GSM573765 2 0.0000 0.973 0.000 1.000 0.000 0.000 0.000 NA
#> GSM573766 2 0.0146 0.973 0.000 0.996 0.000 0.000 0.000 NA
#> GSM573767 2 0.0146 0.973 0.000 0.996 0.000 0.000 0.000 NA
#> GSM573777 2 0.0146 0.973 0.000 0.996 0.000 0.000 0.000 NA
#> GSM573778 2 0.0146 0.973 0.000 0.996 0.000 0.000 0.000 NA
#> GSM573779 2 0.0146 0.973 0.000 0.996 0.000 0.000 0.000 NA
#> GSM573762 2 0.0146 0.973 0.000 0.996 0.000 0.000 0.000 NA
#> GSM573763 2 0.0146 0.973 0.000 0.996 0.000 0.000 0.000 NA
#> GSM573764 2 0.0146 0.973 0.000 0.996 0.000 0.000 0.000 NA
#> GSM573771 2 0.0146 0.973 0.000 0.996 0.000 0.000 0.000 NA
#> GSM573772 2 0.0146 0.973 0.000 0.996 0.000 0.000 0.000 NA
#> GSM573773 2 0.0146 0.973 0.000 0.996 0.000 0.000 0.000 NA
#> GSM573759 2 0.1471 0.971 0.000 0.932 0.000 0.000 0.004 NA
#> GSM573760 2 0.1531 0.970 0.000 0.928 0.000 0.000 0.004 NA
#> GSM573761 2 0.1531 0.970 0.000 0.928 0.000 0.000 0.004 NA
#> GSM573774 2 0.1411 0.972 0.000 0.936 0.000 0.000 0.004 NA
#> GSM573775 2 0.1010 0.973 0.000 0.960 0.000 0.000 0.004 NA
#> GSM573776 2 0.1411 0.972 0.000 0.936 0.000 0.000 0.004 NA
#> GSM573756 2 0.1588 0.969 0.000 0.924 0.000 0.000 0.004 NA
#> GSM573757 2 0.1588 0.969 0.000 0.924 0.000 0.000 0.004 NA
#> GSM573758 2 0.1531 0.970 0.000 0.928 0.000 0.000 0.004 NA
#> GSM573708 3 0.2060 0.951 0.000 0.000 0.900 0.000 0.016 NA
#> GSM573709 3 0.2060 0.951 0.000 0.000 0.900 0.000 0.016 NA
#> GSM573710 3 0.2094 0.951 0.000 0.000 0.900 0.000 0.020 NA
#> GSM573711 3 0.2094 0.951 0.000 0.000 0.900 0.000 0.020 NA
#> GSM573712 3 0.2094 0.951 0.000 0.000 0.900 0.000 0.020 NA
#> GSM573713 3 0.2060 0.951 0.000 0.000 0.900 0.000 0.016 NA
#> GSM573717 3 0.0146 0.959 0.000 0.000 0.996 0.004 0.000 NA
#> GSM573718 3 0.0000 0.960 0.000 0.000 1.000 0.000 0.000 NA
#> GSM573719 3 0.0260 0.959 0.000 0.000 0.992 0.000 0.008 NA
#> GSM573714 3 0.0146 0.960 0.000 0.000 0.996 0.000 0.004 NA
#> GSM573715 3 0.0146 0.960 0.000 0.000 0.996 0.000 0.004 NA
#> GSM573716 3 0.0146 0.960 0.000 0.000 0.996 0.000 0.004 NA
#> GSM573780 3 0.2631 0.912 0.000 0.000 0.820 0.000 0.000 NA
#> GSM573781 3 0.2994 0.893 0.000 0.000 0.788 0.000 0.004 NA
#> GSM573782 3 0.2697 0.908 0.000 0.000 0.812 0.000 0.000 NA
#> GSM573705 3 0.0000 0.960 0.000 0.000 1.000 0.000 0.000 NA
#> GSM573706 3 0.0146 0.960 0.000 0.000 0.996 0.000 0.004 NA
#> GSM573707 3 0.0000 0.960 0.000 0.000 1.000 0.000 0.000 NA
#> GSM573702 3 0.0000 0.960 0.000 0.000 1.000 0.000 0.000 NA
#> GSM573703 3 0.0146 0.960 0.000 0.000 0.996 0.000 0.004 NA
#> GSM573704 3 0.0146 0.960 0.000 0.000 0.996 0.000 0.004 NA
#> GSM573783 3 0.1723 0.956 0.000 0.000 0.928 0.000 0.036 NA
#> GSM573784 3 0.1794 0.955 0.000 0.000 0.924 0.000 0.040 NA
#> GSM573785 3 0.1863 0.955 0.000 0.000 0.920 0.000 0.044 NA
#> GSM573744 4 0.0146 0.978 0.004 0.000 0.000 0.996 0.000 NA
#> GSM573745 4 0.0291 0.979 0.004 0.000 0.000 0.992 0.000 NA
#> GSM573746 4 0.0000 0.978 0.000 0.000 0.000 1.000 0.000 NA
#> GSM573747 4 0.0260 0.979 0.000 0.000 0.000 0.992 0.008 NA
#> GSM573748 4 0.0146 0.978 0.004 0.000 0.000 0.996 0.000 NA
#> GSM573749 4 0.0146 0.979 0.000 0.000 0.000 0.996 0.004 NA
#> GSM573753 4 0.0806 0.977 0.000 0.000 0.000 0.972 0.008 NA
#> GSM573754 4 0.0806 0.977 0.000 0.000 0.000 0.972 0.008 NA
#> GSM573755 4 0.0806 0.977 0.000 0.000 0.000 0.972 0.008 NA
#> GSM573750 4 0.0806 0.977 0.000 0.000 0.000 0.972 0.008 NA
#> GSM573751 4 0.0806 0.977 0.000 0.000 0.000 0.972 0.008 NA
#> GSM573752 4 0.0806 0.977 0.000 0.000 0.000 0.972 0.008 NA
#> GSM573795 4 0.2218 0.933 0.000 0.000 0.000 0.884 0.012 NA
#> GSM573796 4 0.2312 0.928 0.000 0.000 0.000 0.876 0.012 NA
#> GSM573797 4 0.2312 0.928 0.000 0.000 0.000 0.876 0.012 NA
#> GSM573741 4 0.0603 0.976 0.004 0.000 0.000 0.980 0.000 NA
#> GSM573742 4 0.0603 0.976 0.004 0.000 0.000 0.980 0.000 NA
#> GSM573743 4 0.0508 0.977 0.004 0.000 0.000 0.984 0.000 NA
#> GSM573738 4 0.0603 0.976 0.004 0.000 0.000 0.980 0.000 NA
#> GSM573739 4 0.0520 0.976 0.008 0.000 0.000 0.984 0.000 NA
#> GSM573740 4 0.0603 0.976 0.004 0.000 0.000 0.980 0.000 NA
#> GSM573792 4 0.0725 0.977 0.000 0.000 0.000 0.976 0.012 NA
#> GSM573793 4 0.0806 0.976 0.000 0.000 0.000 0.972 0.020 NA
#> GSM573794 4 0.0972 0.974 0.000 0.000 0.000 0.964 0.028 NA
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
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)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
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:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.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")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
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 cell.line(p) agent(p) k
#> ATC:NMF 96 1.13e-20 0.173 2
#> ATC:NMF 96 9.56e-39 0.741 3
#> ATC:NMF 96 9.14e-57 0.975 4
#> ATC:NMF 96 9.14e-57 0.975 5
#> ATC:NMF 96 9.14e-57 0.975 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.
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