Date: 2019-12-25 22:08:11 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 51941 rows and 74 columns.
#> Top rows are extracted by 'SD, CV, MAD, ATC' methods.
#> Subgroups are detected by 'hclust, kmeans, skmeans, pam, mclust, NMF' method.
#> Number of partitions are tried for k = 2, 3, 4, 5, 6.
#> Performed in total 30000 partitions by row resampling.
#>
#> Following methods can be applied to this 'ConsensusPartitionList' object:
#> [1] "cola_report" "collect_classes" "collect_plots" "collect_stats"
#> [5] "colnames" "functional_enrichment" "get_anno_col" "get_anno"
#> [9] "get_classes" "get_matrix" "get_membership" "get_stats"
#> [13] "is_best_k" "is_stable_k" "ncol" "nrow"
#> [17] "rownames" "show" "suggest_best_k" "test_to_known_factors"
#> [21] "top_rows_heatmap" "top_rows_overlap"
#>
#> You can get result for a single method by, e.g. object["SD", "hclust"] or object["SD:hclust"]
#> or a subset of methods by object[c("SD", "CV")], c("hclust", "kmeans")]
The call of run_all_consensus_partition_methods()
was:
#> run_all_consensus_partition_methods(data = mat, mc.cores = 4, anno = anno)
Dimension of the input matrix:
mat = get_matrix(res_list)
dim(mat)
#> [1] 51941 74
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:kmeans | 3 | 1.000 | 0.929 | 0.952 | ** | |
SD:pam | 3 | 1.000 | 0.979 | 0.992 | ** | |
SD:mclust | 3 | 1.000 | 0.975 | 0.981 | ** | |
SD:NMF | 3 | 1.000 | 0.987 | 0.994 | ** | |
CV:mclust | 3 | 1.000 | 0.979 | 0.984 | ** | 2 |
CV:NMF | 3 | 1.000 | 0.976 | 0.991 | ** | |
CV:skmeans | 5 | 0.998 | 0.922 | 0.969 | ** | 3,4 |
SD:skmeans | 5 | 0.972 | 0.954 | 0.973 | ** | 3,4 |
MAD:pam | 6 | 0.957 | 0.921 | 0.960 | ** | 3,4,5 |
ATC:mclust | 4 | 0.949 | 0.952 | 0.964 | * | |
ATC:NMF | 2 | 0.943 | 0.909 | 0.966 | * | |
ATC:skmeans | 5 | 0.929 | 0.962 | 0.965 | * | 2,4 |
CV:pam | 5 | 0.926 | 0.953 | 0.981 | * | 3,4 |
MAD:skmeans | 5 | 0.919 | 0.866 | 0.943 | * | 3,4 |
ATC:pam | 5 | 0.902 | 0.886 | 0.912 | * | 4 |
CV:kmeans | 3 | 0.900 | 0.936 | 0.947 | ||
MAD:NMF | 3 | 0.897 | 0.914 | 0.964 | ||
MAD:mclust | 4 | 0.894 | 0.929 | 0.959 | ||
ATC:kmeans | 5 | 0.846 | 0.862 | 0.900 | ||
MAD:kmeans | 4 | 0.785 | 0.832 | 0.884 | ||
SD:hclust | 2 | 0.716 | 0.824 | 0.920 | ||
ATC:hclust | 3 | 0.602 | 0.742 | 0.875 | ||
MAD:hclust | 2 | 0.458 | 0.798 | 0.887 | ||
CV:hclust | 2 | 0.414 | 0.793 | 0.894 |
**: 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.752 0.941 0.962 0.351 0.672 0.672
#> CV:NMF 2 0.703 0.857 0.919 0.380 0.656 0.656
#> MAD:NMF 2 0.523 0.849 0.907 0.462 0.546 0.546
#> ATC:NMF 2 0.943 0.909 0.966 0.469 0.523 0.523
#> SD:skmeans 2 0.748 0.800 0.915 0.474 0.506 0.506
#> CV:skmeans 2 0.712 0.801 0.912 0.476 0.546 0.546
#> MAD:skmeans 2 0.509 0.926 0.939 0.506 0.493 0.493
#> ATC:skmeans 2 1.000 0.976 0.991 0.500 0.502 0.502
#> SD:mclust 2 0.493 0.750 0.851 0.404 0.672 0.672
#> CV:mclust 2 1.000 0.997 0.997 0.329 0.672 0.672
#> MAD:mclust 2 0.889 0.920 0.969 0.370 0.641 0.641
#> ATC:mclust 2 0.631 0.886 0.913 0.448 0.496 0.496
#> SD:kmeans 2 0.521 0.798 0.869 0.359 0.641 0.641
#> CV:kmeans 2 0.521 0.844 0.888 0.356 0.641 0.641
#> MAD:kmeans 2 0.229 0.717 0.793 0.404 0.641 0.641
#> ATC:kmeans 2 0.728 0.959 0.978 0.421 0.576 0.576
#> SD:pam 2 0.522 0.906 0.927 0.338 0.672 0.672
#> CV:pam 2 0.504 0.868 0.907 0.344 0.672 0.672
#> MAD:pam 2 0.468 0.774 0.797 0.427 0.506 0.506
#> ATC:pam 2 0.595 0.835 0.918 0.392 0.641 0.641
#> SD:hclust 2 0.716 0.824 0.920 0.354 0.656 0.656
#> CV:hclust 2 0.414 0.793 0.894 0.366 0.689 0.689
#> MAD:hclust 2 0.458 0.798 0.887 0.396 0.641 0.641
#> ATC:hclust 2 0.521 0.840 0.904 0.337 0.725 0.725
get_stats(res_list, k = 3)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> SD:NMF 3 1.000 0.987 0.994 0.661 0.745 0.621
#> CV:NMF 3 1.000 0.976 0.991 0.537 0.761 0.636
#> MAD:NMF 3 0.897 0.914 0.964 0.298 0.660 0.475
#> ATC:NMF 3 0.529 0.567 0.781 0.331 0.726 0.517
#> SD:skmeans 3 1.000 0.960 0.983 0.372 0.740 0.534
#> CV:skmeans 3 0.960 0.946 0.975 0.369 0.755 0.571
#> MAD:skmeans 3 1.000 0.979 0.989 0.320 0.756 0.544
#> ATC:skmeans 3 0.725 0.852 0.902 0.284 0.784 0.598
#> SD:mclust 3 1.000 0.975 0.981 0.489 0.727 0.594
#> CV:mclust 3 1.000 0.979 0.984 0.829 0.727 0.594
#> MAD:mclust 3 0.590 0.514 0.693 0.682 0.657 0.481
#> ATC:mclust 3 0.677 0.872 0.812 0.357 0.873 0.752
#> SD:kmeans 3 1.000 0.929 0.952 0.579 0.758 0.631
#> CV:kmeans 3 0.900 0.936 0.947 0.600 0.777 0.656
#> MAD:kmeans 3 0.588 0.677 0.829 0.537 0.726 0.573
#> ATC:kmeans 3 0.518 0.682 0.857 0.464 0.628 0.433
#> SD:pam 3 1.000 0.979 0.992 0.686 0.745 0.624
#> CV:pam 3 1.000 0.968 0.987 0.665 0.745 0.624
#> MAD:pam 3 0.955 0.906 0.964 0.486 0.760 0.569
#> ATC:pam 3 0.694 0.842 0.915 0.469 0.745 0.621
#> SD:hclust 3 0.535 0.780 0.831 0.194 0.896 0.860
#> CV:hclust 3 0.351 0.656 0.811 0.211 0.991 0.987
#> MAD:hclust 3 0.532 0.765 0.868 0.193 0.928 0.890
#> ATC:hclust 3 0.602 0.742 0.875 0.741 0.668 0.542
get_stats(res_list, k = 4)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> SD:NMF 4 0.601 0.633 0.809 0.213 0.869 0.688
#> CV:NMF 4 0.559 0.613 0.784 0.226 0.859 0.666
#> MAD:NMF 4 0.569 0.650 0.782 0.215 0.785 0.509
#> ATC:NMF 4 0.665 0.735 0.870 0.141 0.720 0.389
#> SD:skmeans 4 1.000 0.972 0.987 0.147 0.841 0.583
#> CV:skmeans 4 1.000 0.951 0.981 0.140 0.818 0.537
#> MAD:skmeans 4 0.976 0.922 0.969 0.131 0.866 0.623
#> ATC:skmeans 4 1.000 0.999 0.999 0.157 0.877 0.666
#> SD:mclust 4 0.620 0.651 0.766 0.168 0.899 0.751
#> CV:mclust 4 0.592 0.515 0.705 0.173 0.952 0.881
#> MAD:mclust 4 0.894 0.929 0.959 0.204 0.857 0.609
#> ATC:mclust 4 0.949 0.952 0.964 0.217 0.813 0.555
#> SD:kmeans 4 0.708 0.898 0.887 0.239 0.830 0.603
#> CV:kmeans 4 0.767 0.936 0.902 0.238 0.830 0.606
#> MAD:kmeans 4 0.785 0.832 0.884 0.169 0.830 0.574
#> ATC:kmeans 4 0.635 0.769 0.847 0.162 0.793 0.512
#> SD:pam 4 0.877 0.873 0.949 0.308 0.818 0.582
#> CV:pam 4 0.911 0.934 0.971 0.294 0.818 0.582
#> MAD:pam 4 1.000 0.990 0.995 0.183 0.838 0.585
#> ATC:pam 4 1.000 0.981 0.991 0.269 0.799 0.563
#> SD:hclust 4 0.496 0.716 0.798 0.306 0.692 0.578
#> CV:hclust 4 0.377 0.692 0.801 0.300 0.772 0.666
#> MAD:hclust 4 0.445 0.548 0.752 0.266 0.950 0.916
#> ATC:hclust 4 0.600 0.725 0.855 0.136 0.908 0.766
get_stats(res_list, k = 5)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> SD:NMF 5 0.685 0.630 0.733 0.1058 0.837 0.503
#> CV:NMF 5 0.730 0.669 0.798 0.1008 0.845 0.533
#> MAD:NMF 5 0.705 0.718 0.808 0.0769 0.927 0.726
#> ATC:NMF 5 0.531 0.469 0.628 0.0669 0.763 0.382
#> SD:skmeans 5 0.972 0.954 0.973 0.0692 0.915 0.688
#> CV:skmeans 5 0.998 0.922 0.969 0.0686 0.925 0.720
#> MAD:skmeans 5 0.919 0.866 0.943 0.0571 0.910 0.663
#> ATC:skmeans 5 0.929 0.962 0.965 0.0514 0.964 0.859
#> SD:mclust 5 0.767 0.698 0.796 0.0466 0.779 0.420
#> CV:mclust 5 0.773 0.823 0.843 0.0523 0.775 0.444
#> MAD:mclust 5 0.875 0.859 0.916 0.0380 0.937 0.766
#> ATC:mclust 5 0.786 0.766 0.859 0.0322 0.911 0.689
#> SD:kmeans 5 0.808 0.761 0.844 0.0868 0.985 0.941
#> CV:kmeans 5 0.805 0.729 0.845 0.0944 0.972 0.895
#> MAD:kmeans 5 0.787 0.668 0.813 0.0727 0.884 0.614
#> ATC:kmeans 5 0.846 0.862 0.900 0.0806 0.881 0.614
#> SD:pam 5 0.899 0.873 0.952 0.0199 0.985 0.943
#> CV:pam 5 0.926 0.953 0.981 0.0195 0.985 0.943
#> MAD:pam 5 0.938 0.930 0.961 0.0631 0.923 0.705
#> ATC:pam 5 0.902 0.886 0.912 0.0489 0.981 0.932
#> SD:hclust 5 0.625 0.707 0.827 0.1124 0.915 0.830
#> CV:hclust 5 0.486 0.675 0.819 0.0536 0.997 0.994
#> MAD:hclust 5 0.442 0.577 0.714 0.1256 0.803 0.639
#> ATC:hclust 5 0.614 0.750 0.813 0.0538 0.914 0.752
get_stats(res_list, k = 6)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> SD:NMF 6 0.720 0.570 0.745 0.0327 0.917 0.675
#> CV:NMF 6 0.720 0.668 0.800 0.0312 0.921 0.678
#> MAD:NMF 6 0.765 0.691 0.838 0.0324 0.944 0.755
#> ATC:NMF 6 0.587 0.505 0.719 0.0498 0.847 0.469
#> SD:skmeans 6 0.880 0.805 0.854 0.0375 0.990 0.954
#> CV:skmeans 6 0.855 0.707 0.852 0.0417 0.954 0.796
#> MAD:skmeans 6 0.888 0.820 0.910 0.0360 0.941 0.725
#> ATC:skmeans 6 0.879 0.802 0.889 0.0452 0.977 0.895
#> SD:mclust 6 0.865 0.884 0.946 0.0897 0.846 0.465
#> CV:mclust 6 0.665 0.643 0.816 0.0559 0.911 0.668
#> MAD:mclust 6 0.798 0.794 0.846 0.0376 0.958 0.815
#> ATC:mclust 6 0.800 0.773 0.867 0.0131 0.833 0.479
#> SD:kmeans 6 0.795 0.624 0.747 0.0498 0.910 0.657
#> CV:kmeans 6 0.796 0.701 0.798 0.0437 0.925 0.710
#> MAD:kmeans 6 0.794 0.677 0.779 0.0426 0.939 0.746
#> ATC:kmeans 6 0.806 0.788 0.847 0.0430 0.985 0.933
#> SD:pam 6 0.878 0.870 0.889 0.0568 0.900 0.623
#> CV:pam 6 0.862 0.777 0.847 0.0667 0.938 0.755
#> MAD:pam 6 0.957 0.921 0.960 0.0203 0.978 0.891
#> ATC:pam 6 0.877 0.883 0.878 0.0387 0.911 0.661
#> SD:hclust 6 0.647 0.657 0.799 0.1408 0.792 0.577
#> CV:hclust 6 0.591 0.459 0.724 0.1893 0.782 0.533
#> MAD:hclust 6 0.662 0.740 0.836 0.1241 0.854 0.608
#> ATC:hclust 6 0.636 0.814 0.838 0.0872 0.894 0.655
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 agent(p) dose(p) time(p) k
#> SD:NMF 74 5.74e-01 0.946601 1.50e-14 2
#> CV:NMF 73 5.64e-01 0.946789 2.43e-14 2
#> MAD:NMF 71 2.75e-01 0.700041 6.35e-14 2
#> ATC:NMF 70 5.94e-02 0.014118 1.93e-01 2
#> SD:skmeans 61 2.79e-01 0.207521 3.06e-02 2
#> CV:skmeans 60 1.73e-01 0.116238 1.16e-01 2
#> MAD:skmeans 74 1.15e-01 0.442205 8.49e-11 2
#> ATC:skmeans 73 1.40e-02 0.011163 6.18e-02 2
#> SD:mclust 74 5.74e-01 0.946601 1.50e-14 2
#> CV:mclust 74 5.74e-01 0.946601 1.50e-14 2
#> MAD:mclust 71 2.08e-04 0.048799 1.05e-06 2
#> ATC:mclust 73 1.58e-01 0.501793 2.17e-04 2
#> SD:kmeans 65 2.92e-01 0.400891 3.36e-01 2
#> CV:kmeans 74 4.60e-01 0.611344 5.22e-01 2
#> MAD:kmeans 74 4.60e-01 0.611344 5.22e-01 2
#> ATC:kmeans 74 6.70e-02 0.016291 2.54e-01 2
#> SD:pam 74 5.74e-01 0.946601 1.50e-14 2
#> CV:pam 74 5.74e-01 0.946601 1.50e-14 2
#> MAD:pam 69 9.22e-05 0.000385 7.47e-05 2
#> ATC:pam 71 3.55e-01 0.432422 3.31e-01 2
#> SD:hclust 68 5.85e-01 0.608710 3.81e-01 2
#> CV:hclust 71 4.78e-01 0.547888 3.47e-01 2
#> MAD:hclust 70 3.91e-01 0.113741 2.03e-01 2
#> ATC:hclust 74 6.33e-01 0.412935 1.86e-01 2
test_to_known_factors(res_list, k = 3)
#> n agent(p) dose(p) time(p) k
#> SD:NMF 74 0.534902 0.90033 5.44e-13 3
#> CV:NMF 73 0.532923 0.95165 4.10e-13 3
#> MAD:NMF 72 0.859131 0.92354 5.95e-11 3
#> ATC:NMF 55 0.132852 0.11052 9.43e-04 3
#> SD:skmeans 72 0.121440 0.24883 2.30e-08 3
#> CV:skmeans 73 0.132609 0.32695 2.45e-07 3
#> MAD:skmeans 74 0.025203 0.44948 1.01e-08 3
#> ATC:skmeans 72 0.004666 0.00123 1.86e-02 3
#> SD:mclust 74 0.483871 0.71034 8.17e-13 3
#> CV:mclust 74 0.483871 0.71034 8.17e-13 3
#> MAD:mclust 33 0.150930 0.19450 6.89e-02 3
#> ATC:mclust 74 0.483871 0.71034 8.17e-13 3
#> SD:kmeans 72 0.583525 0.87887 8.14e-11 3
#> CV:kmeans 73 0.542571 0.87526 1.59e-09 3
#> MAD:kmeans 60 0.030834 0.14811 5.10e-08 3
#> ATC:kmeans 61 0.009482 0.02781 6.37e-02 3
#> SD:pam 74 0.500889 0.81684 2.54e-11 3
#> CV:pam 73 0.543889 0.83455 4.51e-11 3
#> MAD:pam 69 0.007124 0.05797 1.25e-15 3
#> ATC:pam 71 0.471275 0.75799 1.44e-09 3
#> SD:hclust 70 0.611021 0.74320 4.56e-01 3
#> CV:hclust 59 0.588126 0.16360 1.08e-01 3
#> MAD:hclust 68 0.814600 0.25721 5.96e-03 3
#> ATC:hclust 64 0.000947 0.00823 1.04e-02 3
test_to_known_factors(res_list, k = 4)
#> n agent(p) dose(p) time(p) k
#> SD:NMF 60 0.032085 0.00337 8.79e-12 4
#> CV:NMF 54 0.019720 0.07843 1.17e-13 4
#> MAD:NMF 64 0.005468 0.07183 1.29e-16 4
#> ATC:NMF 67 0.171920 0.21377 1.76e-09 4
#> SD:skmeans 74 0.003286 0.02670 7.47e-15 4
#> CV:skmeans 71 0.004563 0.04317 4.79e-14 4
#> MAD:skmeans 69 0.033457 0.44999 5.36e-17 4
#> ATC:skmeans 74 0.002436 0.00395 8.45e-10 4
#> SD:mclust 58 0.000894 0.46262 1.79e-14 4
#> CV:mclust 35 0.829720 0.59604 1.48e-10 4
#> MAD:mclust 74 0.033193 0.54074 1.80e-16 4
#> ATC:mclust 73 0.000563 0.00491 1.98e-10 4
#> SD:kmeans 72 0.002906 0.02455 2.09e-14 4
#> CV:kmeans 74 0.002460 0.02551 3.44e-13 4
#> MAD:kmeans 65 0.012338 0.13511 8.43e-17 4
#> ATC:kmeans 66 0.001356 0.00818 1.10e-08 4
#> SD:pam 68 0.007216 0.13708 2.82e-17 4
#> CV:pam 72 0.002637 0.02509 7.75e-15 4
#> MAD:pam 74 0.050191 0.72341 8.95e-20 4
#> ATC:pam 73 0.001084 0.00486 1.64e-10 4
#> SD:hclust 65 0.610835 0.89580 9.96e-09 4
#> CV:hclust 68 0.570176 0.76185 2.33e-09 4
#> MAD:hclust 60 0.356812 0.00355 6.35e-04 4
#> ATC:hclust 68 0.001546 0.03860 4.01e-03 4
test_to_known_factors(res_list, k = 5)
#> n agent(p) dose(p) time(p) k
#> SD:NMF 48 3.80e-01 3.51e-01 4.13e-16 5
#> CV:NMF 63 1.47e-01 3.47e-03 8.38e-16 5
#> MAD:NMF 63 1.49e-02 2.03e-01 1.21e-17 5
#> ATC:NMF 41 2.04e-02 5.28e-02 5.95e-08 5
#> SD:skmeans 74 2.95e-02 4.43e-02 5.27e-19 5
#> CV:skmeans 70 1.45e-02 2.79e-01 2.58e-18 5
#> MAD:skmeans 70 1.59e-02 1.28e-01 7.56e-20 5
#> ATC:skmeans 74 6.10e-03 8.48e-03 1.51e-10 5
#> SD:mclust 67 1.70e-03 4.86e-05 1.28e-08 5
#> CV:mclust 69 9.84e-04 5.55e-05 8.41e-09 5
#> MAD:mclust 71 2.89e-06 1.30e-03 2.90e-12 5
#> ATC:mclust 68 7.17e-02 2.33e-01 6.37e-12 5
#> SD:kmeans 70 7.48e-03 3.07e-02 3.75e-14 5
#> CV:kmeans 63 1.47e-02 1.29e-01 1.73e-17 5
#> MAD:kmeans 56 7.38e-02 1.50e-01 2.38e-13 5
#> ATC:kmeans 70 1.82e-03 3.07e-03 1.19e-09 5
#> SD:pam 68 2.89e-02 2.68e-01 3.43e-16 5
#> CV:pam 73 9.99e-03 5.97e-02 3.15e-14 5
#> MAD:pam 73 7.50e-03 1.40e-01 5.52e-18 5
#> ATC:pam 73 3.60e-03 1.83e-02 5.93e-11 5
#> SD:hclust 65 8.60e-01 7.24e-01 3.30e-08 5
#> CV:hclust 64 6.45e-01 9.71e-01 5.99e-09 5
#> MAD:hclust 49 5.50e-01 4.53e-01 1.65e-07 5
#> ATC:hclust 65 6.69e-03 1.19e-01 2.32e-04 5
test_to_known_factors(res_list, k = 6)
#> n agent(p) dose(p) time(p) k
#> SD:NMF 52 6.20e-02 0.333393 4.60e-14 6
#> CV:NMF 59 3.74e-02 0.014930 3.88e-18 6
#> MAD:NMF 64 2.51e-03 0.063025 7.79e-18 6
#> ATC:NMF 48 3.72e-02 0.009220 3.23e-06 6
#> SD:skmeans 70 3.89e-02 0.069497 3.83e-17 6
#> CV:skmeans 60 2.03e-02 0.323744 1.44e-16 6
#> MAD:skmeans 66 4.19e-02 0.140670 5.08e-18 6
#> ATC:skmeans 68 5.28e-03 0.008870 2.35e-10 6
#> SD:mclust 73 7.29e-02 0.008660 4.25e-12 6
#> CV:mclust 62 7.33e-02 0.005570 2.87e-11 6
#> MAD:mclust 70 8.16e-07 0.000308 1.09e-11 6
#> ATC:mclust 62 6.57e-01 0.389570 1.66e-14 6
#> SD:kmeans 48 6.10e-03 0.020389 7.34e-14 6
#> CV:kmeans 65 4.81e-04 0.032321 2.19e-16 6
#> MAD:kmeans 66 1.41e-04 0.009111 4.43e-17 6
#> ATC:kmeans 71 3.08e-03 0.003920 9.30e-10 6
#> SD:pam 71 3.87e-02 0.453410 1.04e-17 6
#> CV:pam 67 1.13e-03 0.078887 5.68e-15 6
#> MAD:pam 74 3.44e-02 0.308949 3.71e-19 6
#> ATC:pam 72 2.82e-05 0.018481 9.20e-11 6
#> SD:hclust 62 2.72e-01 0.006940 3.00e-08 6
#> CV:hclust 53 5.89e-03 0.002182 1.18e-05 6
#> MAD:hclust 67 8.32e-03 0.028011 9.74e-14 6
#> ATC:hclust 73 5.84e-04 0.030428 2.51e-05 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 51941 rows and 74 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'SD' method.
#> Subgroups are detected by 'hclust' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 2.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
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.716 0.824 0.920 0.354 0.656 0.656
#> 3 3 0.535 0.780 0.831 0.194 0.896 0.860
#> 4 4 0.496 0.716 0.798 0.306 0.692 0.578
#> 5 5 0.625 0.707 0.827 0.112 0.915 0.830
#> 6 6 0.647 0.657 0.799 0.141 0.792 0.577
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 2
Following shows the table of the partitions (You need to click the show/hide
code output link to see it). The membership matrix (columns with name p*
)
is inferred by
clue::cl_consensus()
function with the SE
method. Basically the value in the membership matrix
represents the probability to belong to a certain group. The finall class
label for an item is determined with the group with highest probability it
belongs to.
In get_classes()
function, the entropy is calculated from the membership
matrix and the silhouette score is calculated from the consensus matrix.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> GSM386435 2 0.0000 0.922 0.000 1.000
#> GSM386436 2 0.0000 0.922 0.000 1.000
#> GSM386437 2 0.0000 0.922 0.000 1.000
#> GSM386438 2 0.0000 0.922 0.000 1.000
#> GSM386439 1 0.9909 0.294 0.556 0.444
#> GSM386440 2 0.0000 0.922 0.000 1.000
#> GSM386441 2 0.0000 0.922 0.000 1.000
#> GSM386442 2 0.0000 0.922 0.000 1.000
#> GSM386447 2 0.8267 0.627 0.260 0.740
#> GSM386448 2 0.0000 0.922 0.000 1.000
#> GSM386449 2 0.0000 0.922 0.000 1.000
#> GSM386450 2 0.0000 0.922 0.000 1.000
#> GSM386451 2 0.0000 0.922 0.000 1.000
#> GSM386452 1 0.0376 0.843 0.996 0.004
#> GSM386453 2 0.0000 0.922 0.000 1.000
#> GSM386454 1 0.0376 0.843 0.996 0.004
#> GSM386455 2 0.0000 0.922 0.000 1.000
#> GSM386456 2 0.0000 0.922 0.000 1.000
#> GSM386457 2 0.0672 0.921 0.008 0.992
#> GSM386458 2 0.8267 0.627 0.260 0.740
#> GSM386443 1 0.3274 0.836 0.940 0.060
#> GSM386444 2 0.0376 0.920 0.004 0.996
#> GSM386445 2 0.0376 0.920 0.004 0.996
#> GSM386446 2 0.0376 0.920 0.004 0.996
#> GSM386398 1 0.0376 0.843 0.996 0.004
#> GSM386399 1 0.9909 0.294 0.556 0.444
#> GSM386400 1 0.0376 0.843 0.996 0.004
#> GSM386401 2 0.0000 0.922 0.000 1.000
#> GSM386406 2 0.1414 0.917 0.020 0.980
#> GSM386407 2 0.3584 0.892 0.068 0.932
#> GSM386408 2 0.0000 0.922 0.000 1.000
#> GSM386409 1 0.3114 0.835 0.944 0.056
#> GSM386410 1 0.0376 0.843 0.996 0.004
#> GSM386411 2 0.3584 0.892 0.068 0.932
#> GSM386412 2 0.8267 0.627 0.260 0.740
#> GSM386413 2 0.3584 0.892 0.068 0.932
#> GSM386414 2 0.8267 0.627 0.260 0.740
#> GSM386415 2 0.2948 0.901 0.052 0.948
#> GSM386416 2 0.8267 0.627 0.260 0.740
#> GSM386417 2 0.0000 0.922 0.000 1.000
#> GSM386402 2 0.0376 0.920 0.004 0.996
#> GSM386403 2 0.0376 0.920 0.004 0.996
#> GSM386404 2 0.0376 0.920 0.004 0.996
#> GSM386405 2 0.0376 0.920 0.004 0.996
#> GSM386418 2 0.1414 0.917 0.020 0.980
#> GSM386419 2 0.1414 0.917 0.020 0.980
#> GSM386420 2 0.1414 0.917 0.020 0.980
#> GSM386421 2 0.1414 0.917 0.020 0.980
#> GSM386426 1 0.9909 0.294 0.556 0.444
#> GSM386427 1 0.0376 0.843 0.996 0.004
#> GSM386428 2 0.1414 0.917 0.020 0.980
#> GSM386429 2 0.3584 0.892 0.068 0.932
#> GSM386430 2 0.3584 0.892 0.068 0.932
#> GSM386431 2 0.3879 0.887 0.076 0.924
#> GSM386432 2 0.3584 0.892 0.068 0.932
#> GSM386433 2 0.2948 0.901 0.052 0.948
#> GSM386434 2 0.2948 0.901 0.052 0.948
#> GSM386422 2 0.0376 0.920 0.004 0.996
#> GSM386423 1 0.3274 0.836 0.940 0.060
#> GSM386424 2 0.0376 0.920 0.004 0.996
#> GSM386425 2 0.0376 0.920 0.004 0.996
#> GSM386385 2 0.8081 0.648 0.248 0.752
#> GSM386386 1 0.3114 0.835 0.944 0.056
#> GSM386387 2 0.0672 0.920 0.008 0.992
#> GSM386391 2 0.4161 0.881 0.084 0.916
#> GSM386392 1 0.9909 0.294 0.556 0.444
#> GSM386393 2 0.9286 0.491 0.344 0.656
#> GSM386394 1 0.0938 0.844 0.988 0.012
#> GSM386395 2 0.9286 0.491 0.344 0.656
#> GSM386396 2 0.9129 0.525 0.328 0.672
#> GSM386397 2 0.9129 0.525 0.328 0.672
#> GSM386388 2 0.0376 0.920 0.004 0.996
#> GSM386389 1 0.3274 0.836 0.940 0.060
#> GSM386390 2 0.0376 0.920 0.004 0.996
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM386435 2 0.0237 0.8649 0.000 0.996 NA
#> GSM386436 2 0.0237 0.8649 0.000 0.996 NA
#> GSM386437 2 0.0237 0.8649 0.000 0.996 NA
#> GSM386438 2 0.0237 0.8649 0.000 0.996 NA
#> GSM386439 2 0.9521 0.0764 0.192 0.440 NA
#> GSM386440 2 0.0237 0.8649 0.000 0.996 NA
#> GSM386441 2 0.0237 0.8649 0.000 0.996 NA
#> GSM386442 2 0.0237 0.8649 0.000 0.996 NA
#> GSM386447 2 0.6920 0.6783 0.132 0.736 NA
#> GSM386448 2 0.0237 0.8649 0.000 0.996 NA
#> GSM386449 2 0.0237 0.8649 0.000 0.996 NA
#> GSM386450 2 0.0237 0.8649 0.000 0.996 NA
#> GSM386451 2 0.1860 0.8568 0.000 0.948 NA
#> GSM386452 1 0.5016 0.8548 0.760 0.000 NA
#> GSM386453 2 0.1860 0.8568 0.000 0.948 NA
#> GSM386454 1 0.5016 0.8548 0.760 0.000 NA
#> GSM386455 2 0.1860 0.8568 0.000 0.948 NA
#> GSM386456 2 0.1860 0.8568 0.000 0.948 NA
#> GSM386457 2 0.2165 0.8597 0.000 0.936 NA
#> GSM386458 2 0.6920 0.6783 0.132 0.736 NA
#> GSM386443 1 0.3851 0.8644 0.860 0.004 NA
#> GSM386444 2 0.3116 0.8355 0.000 0.892 NA
#> GSM386445 2 0.3116 0.8355 0.000 0.892 NA
#> GSM386446 2 0.3116 0.8355 0.000 0.892 NA
#> GSM386398 1 0.5835 0.8355 0.660 0.000 NA
#> GSM386399 2 0.9521 0.0764 0.192 0.440 NA
#> GSM386400 1 0.5835 0.8355 0.660 0.000 NA
#> GSM386401 2 0.0237 0.8649 0.000 0.996 NA
#> GSM386406 2 0.1129 0.8625 0.004 0.976 NA
#> GSM386407 2 0.2496 0.8522 0.004 0.928 NA
#> GSM386408 2 0.0237 0.8649 0.000 0.996 NA
#> GSM386409 1 0.5138 0.8366 0.828 0.052 NA
#> GSM386410 1 0.0424 0.8756 0.992 0.000 NA
#> GSM386411 2 0.2496 0.8522 0.004 0.928 NA
#> GSM386412 2 0.6920 0.6783 0.132 0.736 NA
#> GSM386413 2 0.2496 0.8522 0.004 0.928 NA
#> GSM386414 2 0.6920 0.6783 0.132 0.736 NA
#> GSM386415 2 0.3030 0.8567 0.004 0.904 NA
#> GSM386416 2 0.6920 0.6783 0.132 0.736 NA
#> GSM386417 2 0.1753 0.8574 0.000 0.952 NA
#> GSM386402 2 0.4002 0.8067 0.000 0.840 NA
#> GSM386403 2 0.4002 0.8067 0.000 0.840 NA
#> GSM386404 2 0.4002 0.8067 0.000 0.840 NA
#> GSM386405 2 0.4002 0.8067 0.000 0.840 NA
#> GSM386418 2 0.1129 0.8625 0.004 0.976 NA
#> GSM386419 2 0.1129 0.8625 0.004 0.976 NA
#> GSM386420 2 0.1129 0.8625 0.004 0.976 NA
#> GSM386421 2 0.1129 0.8625 0.004 0.976 NA
#> GSM386426 2 0.9521 0.0764 0.192 0.440 NA
#> GSM386427 1 0.0424 0.8756 0.992 0.000 NA
#> GSM386428 2 0.1129 0.8625 0.004 0.976 NA
#> GSM386429 2 0.2496 0.8522 0.004 0.928 NA
#> GSM386430 2 0.2496 0.8522 0.004 0.928 NA
#> GSM386431 2 0.2682 0.8498 0.004 0.920 NA
#> GSM386432 2 0.2496 0.8522 0.004 0.928 NA
#> GSM386433 2 0.3030 0.8567 0.004 0.904 NA
#> GSM386434 2 0.3030 0.8567 0.004 0.904 NA
#> GSM386422 2 0.4002 0.8067 0.000 0.840 NA
#> GSM386423 1 0.3918 0.8635 0.856 0.004 NA
#> GSM386424 2 0.4002 0.8067 0.000 0.840 NA
#> GSM386425 2 0.4002 0.8067 0.000 0.840 NA
#> GSM386385 2 0.6726 0.6930 0.120 0.748 NA
#> GSM386386 1 0.5138 0.8366 0.828 0.052 NA
#> GSM386387 2 0.0475 0.8641 0.004 0.992 NA
#> GSM386391 2 0.2860 0.8478 0.004 0.912 NA
#> GSM386392 2 0.9521 0.0764 0.192 0.440 NA
#> GSM386393 2 0.6104 0.6032 0.004 0.648 NA
#> GSM386394 1 0.6669 0.7367 0.524 0.008 NA
#> GSM386395 2 0.6104 0.6032 0.004 0.648 NA
#> GSM386396 2 0.6008 0.6234 0.004 0.664 NA
#> GSM386397 2 0.6008 0.6234 0.004 0.664 NA
#> GSM386388 2 0.4002 0.8067 0.000 0.840 NA
#> GSM386389 1 0.3918 0.8635 0.856 0.004 NA
#> GSM386390 2 0.4002 0.8067 0.000 0.840 NA
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM386435 2 0.0927 0.875 0.008 0.976 0.016 0.000
#> GSM386436 2 0.0927 0.875 0.008 0.976 0.016 0.000
#> GSM386437 2 0.0927 0.875 0.008 0.976 0.016 0.000
#> GSM386438 2 0.0927 0.875 0.008 0.976 0.016 0.000
#> GSM386439 1 0.4977 0.389 0.540 0.460 0.000 0.000
#> GSM386440 2 0.0927 0.875 0.008 0.976 0.016 0.000
#> GSM386441 2 0.0927 0.875 0.008 0.976 0.016 0.000
#> GSM386442 2 0.0927 0.875 0.008 0.976 0.016 0.000
#> GSM386447 2 0.4188 0.567 0.244 0.752 0.004 0.000
#> GSM386448 2 0.0927 0.875 0.008 0.976 0.016 0.000
#> GSM386449 2 0.0927 0.875 0.008 0.976 0.016 0.000
#> GSM386450 2 0.0927 0.875 0.008 0.976 0.016 0.000
#> GSM386451 2 0.2256 0.846 0.020 0.924 0.056 0.000
#> GSM386452 1 0.5673 -0.211 0.596 0.000 0.032 0.372
#> GSM386453 2 0.2256 0.846 0.020 0.924 0.056 0.000
#> GSM386454 1 0.5673 -0.211 0.596 0.000 0.032 0.372
#> GSM386455 2 0.2256 0.846 0.020 0.924 0.056 0.000
#> GSM386456 2 0.2256 0.846 0.020 0.924 0.056 0.000
#> GSM386457 2 0.2197 0.851 0.024 0.928 0.048 0.000
#> GSM386458 2 0.4188 0.567 0.244 0.752 0.004 0.000
#> GSM386443 4 0.2048 0.676 0.008 0.000 0.064 0.928
#> GSM386444 3 0.5271 0.779 0.020 0.340 0.640 0.000
#> GSM386445 3 0.5271 0.779 0.020 0.340 0.640 0.000
#> GSM386446 3 0.5271 0.779 0.020 0.340 0.640 0.000
#> GSM386398 1 0.5549 -0.130 0.672 0.000 0.048 0.280
#> GSM386399 1 0.4977 0.389 0.540 0.460 0.000 0.000
#> GSM386400 1 0.5549 -0.130 0.672 0.000 0.048 0.280
#> GSM386401 2 0.0927 0.875 0.008 0.976 0.016 0.000
#> GSM386406 2 0.0188 0.874 0.004 0.996 0.000 0.000
#> GSM386407 2 0.1722 0.858 0.008 0.944 0.048 0.000
#> GSM386408 2 0.0927 0.875 0.008 0.976 0.016 0.000
#> GSM386409 4 0.6121 0.556 0.352 0.060 0.000 0.588
#> GSM386410 4 0.4857 0.626 0.284 0.000 0.016 0.700
#> GSM386411 2 0.1722 0.858 0.008 0.944 0.048 0.000
#> GSM386412 2 0.4188 0.567 0.244 0.752 0.004 0.000
#> GSM386413 2 0.1722 0.858 0.008 0.944 0.048 0.000
#> GSM386414 2 0.4188 0.567 0.244 0.752 0.004 0.000
#> GSM386415 2 0.2635 0.852 0.020 0.904 0.076 0.000
#> GSM386416 2 0.4188 0.567 0.244 0.752 0.004 0.000
#> GSM386417 2 0.2142 0.848 0.016 0.928 0.056 0.000
#> GSM386402 3 0.3610 0.926 0.000 0.200 0.800 0.000
#> GSM386403 3 0.3610 0.926 0.000 0.200 0.800 0.000
#> GSM386404 3 0.3610 0.926 0.000 0.200 0.800 0.000
#> GSM386405 3 0.3610 0.926 0.000 0.200 0.800 0.000
#> GSM386418 2 0.0188 0.874 0.004 0.996 0.000 0.000
#> GSM386419 2 0.0188 0.874 0.004 0.996 0.000 0.000
#> GSM386420 2 0.0188 0.874 0.004 0.996 0.000 0.000
#> GSM386421 2 0.0188 0.874 0.004 0.996 0.000 0.000
#> GSM386426 1 0.4977 0.389 0.540 0.460 0.000 0.000
#> GSM386427 4 0.4857 0.626 0.284 0.000 0.016 0.700
#> GSM386428 2 0.0188 0.874 0.004 0.996 0.000 0.000
#> GSM386429 2 0.1722 0.858 0.008 0.944 0.048 0.000
#> GSM386430 2 0.1722 0.858 0.008 0.944 0.048 0.000
#> GSM386431 2 0.1938 0.853 0.012 0.936 0.052 0.000
#> GSM386432 2 0.1722 0.858 0.008 0.944 0.048 0.000
#> GSM386433 2 0.2635 0.852 0.020 0.904 0.076 0.000
#> GSM386434 2 0.2635 0.852 0.020 0.904 0.076 0.000
#> GSM386422 3 0.3610 0.926 0.000 0.200 0.800 0.000
#> GSM386423 4 0.1716 0.675 0.000 0.000 0.064 0.936
#> GSM386424 3 0.3610 0.926 0.000 0.200 0.800 0.000
#> GSM386425 3 0.3610 0.926 0.000 0.200 0.800 0.000
#> GSM386385 2 0.3907 0.594 0.232 0.768 0.000 0.000
#> GSM386386 4 0.6121 0.556 0.352 0.060 0.000 0.588
#> GSM386387 2 0.0469 0.875 0.000 0.988 0.012 0.000
#> GSM386391 2 0.2048 0.849 0.008 0.928 0.064 0.000
#> GSM386392 1 0.4977 0.389 0.540 0.460 0.000 0.000
#> GSM386393 2 0.6486 0.502 0.188 0.656 0.152 0.004
#> GSM386394 4 0.7623 0.476 0.324 0.016 0.148 0.512
#> GSM386395 2 0.6486 0.502 0.188 0.656 0.152 0.004
#> GSM386396 2 0.6310 0.531 0.188 0.672 0.136 0.004
#> GSM386397 2 0.6310 0.531 0.188 0.672 0.136 0.004
#> GSM386388 3 0.3610 0.926 0.000 0.200 0.800 0.000
#> GSM386389 4 0.1716 0.675 0.000 0.000 0.064 0.936
#> GSM386390 3 0.3610 0.926 0.000 0.200 0.800 0.000
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM386435 2 0.1492 0.8088 0.000 0.948 0.004 0.008 0.040
#> GSM386436 2 0.1492 0.8088 0.000 0.948 0.004 0.008 0.040
#> GSM386437 2 0.1492 0.8088 0.000 0.948 0.004 0.008 0.040
#> GSM386438 2 0.1492 0.8088 0.000 0.948 0.004 0.008 0.040
#> GSM386439 2 0.6401 0.0957 0.380 0.448 0.000 0.172 0.000
#> GSM386440 2 0.1492 0.8088 0.000 0.948 0.004 0.008 0.040
#> GSM386441 2 0.1492 0.8088 0.000 0.948 0.004 0.008 0.040
#> GSM386442 2 0.1492 0.8088 0.000 0.948 0.004 0.008 0.040
#> GSM386447 2 0.5066 0.6086 0.084 0.676 0.000 0.240 0.000
#> GSM386448 2 0.1492 0.8088 0.000 0.948 0.004 0.008 0.040
#> GSM386449 2 0.1492 0.8088 0.000 0.948 0.004 0.008 0.040
#> GSM386450 2 0.1492 0.8088 0.000 0.948 0.004 0.008 0.040
#> GSM386451 2 0.2654 0.7865 0.000 0.896 0.008 0.040 0.056
#> GSM386452 1 0.2304 0.6497 0.892 0.000 0.000 0.100 0.008
#> GSM386453 2 0.2654 0.7865 0.000 0.896 0.008 0.040 0.056
#> GSM386454 1 0.2304 0.6497 0.892 0.000 0.000 0.100 0.008
#> GSM386455 2 0.2654 0.7865 0.000 0.896 0.008 0.040 0.056
#> GSM386456 2 0.2654 0.7865 0.000 0.896 0.008 0.040 0.056
#> GSM386457 2 0.2694 0.8022 0.000 0.888 0.004 0.076 0.032
#> GSM386458 2 0.5066 0.6086 0.084 0.676 0.000 0.240 0.000
#> GSM386443 5 0.2036 0.9899 0.024 0.000 0.056 0.000 0.920
#> GSM386444 3 0.4874 0.7226 0.000 0.148 0.756 0.040 0.056
#> GSM386445 3 0.4874 0.7226 0.000 0.148 0.756 0.040 0.056
#> GSM386446 3 0.4874 0.7226 0.000 0.148 0.756 0.040 0.056
#> GSM386398 1 0.0609 0.6347 0.980 0.000 0.020 0.000 0.000
#> GSM386399 2 0.6401 0.0957 0.380 0.448 0.000 0.172 0.000
#> GSM386400 1 0.0609 0.6347 0.980 0.000 0.020 0.000 0.000
#> GSM386401 2 0.1492 0.8088 0.000 0.948 0.004 0.008 0.040
#> GSM386406 2 0.0404 0.8128 0.000 0.988 0.000 0.012 0.000
#> GSM386407 2 0.2561 0.7839 0.000 0.856 0.000 0.144 0.000
#> GSM386408 2 0.1492 0.8088 0.000 0.948 0.004 0.008 0.040
#> GSM386409 4 0.6847 0.5037 0.360 0.052 0.000 0.488 0.100
#> GSM386410 1 0.5762 0.1234 0.548 0.000 0.000 0.352 0.100
#> GSM386411 2 0.2561 0.7839 0.000 0.856 0.000 0.144 0.000
#> GSM386412 2 0.5066 0.6086 0.084 0.676 0.000 0.240 0.000
#> GSM386413 2 0.2561 0.7839 0.000 0.856 0.000 0.144 0.000
#> GSM386414 2 0.5066 0.6086 0.084 0.676 0.000 0.240 0.000
#> GSM386415 2 0.3081 0.7811 0.000 0.832 0.000 0.156 0.012
#> GSM386416 2 0.5066 0.6086 0.084 0.676 0.000 0.240 0.000
#> GSM386417 2 0.2584 0.7885 0.000 0.900 0.008 0.040 0.052
#> GSM386402 3 0.0794 0.9106 0.000 0.028 0.972 0.000 0.000
#> GSM386403 3 0.0794 0.9106 0.000 0.028 0.972 0.000 0.000
#> GSM386404 3 0.0794 0.9106 0.000 0.028 0.972 0.000 0.000
#> GSM386405 3 0.0794 0.9106 0.000 0.028 0.972 0.000 0.000
#> GSM386418 2 0.0404 0.8128 0.000 0.988 0.000 0.012 0.000
#> GSM386419 2 0.0404 0.8128 0.000 0.988 0.000 0.012 0.000
#> GSM386420 2 0.0404 0.8128 0.000 0.988 0.000 0.012 0.000
#> GSM386421 2 0.0404 0.8128 0.000 0.988 0.000 0.012 0.000
#> GSM386426 2 0.6401 0.0957 0.380 0.448 0.000 0.172 0.000
#> GSM386427 1 0.5762 0.1234 0.548 0.000 0.000 0.352 0.100
#> GSM386428 2 0.0404 0.8128 0.000 0.988 0.000 0.012 0.000
#> GSM386429 2 0.2561 0.7839 0.000 0.856 0.000 0.144 0.000
#> GSM386430 2 0.2561 0.7839 0.000 0.856 0.000 0.144 0.000
#> GSM386431 2 0.2763 0.7812 0.000 0.848 0.004 0.148 0.000
#> GSM386432 2 0.2561 0.7839 0.000 0.856 0.000 0.144 0.000
#> GSM386433 2 0.3081 0.7811 0.000 0.832 0.000 0.156 0.012
#> GSM386434 2 0.3081 0.7811 0.000 0.832 0.000 0.156 0.012
#> GSM386422 3 0.0794 0.9106 0.000 0.028 0.972 0.000 0.000
#> GSM386423 5 0.1845 0.9950 0.016 0.000 0.056 0.000 0.928
#> GSM386424 3 0.0794 0.9106 0.000 0.028 0.972 0.000 0.000
#> GSM386425 3 0.0794 0.9106 0.000 0.028 0.972 0.000 0.000
#> GSM386385 2 0.4372 0.6449 0.072 0.756 0.000 0.172 0.000
#> GSM386386 4 0.6847 0.5037 0.360 0.052 0.000 0.488 0.100
#> GSM386387 2 0.0162 0.8128 0.000 0.996 0.000 0.004 0.000
#> GSM386391 2 0.2732 0.7783 0.000 0.840 0.000 0.160 0.000
#> GSM386392 2 0.6401 0.0957 0.380 0.448 0.000 0.172 0.000
#> GSM386393 2 0.4397 0.4907 0.000 0.564 0.004 0.432 0.000
#> GSM386394 4 0.2694 0.3273 0.000 0.004 0.004 0.864 0.128
#> GSM386395 2 0.4397 0.4907 0.000 0.564 0.004 0.432 0.000
#> GSM386396 2 0.4367 0.5147 0.000 0.580 0.004 0.416 0.000
#> GSM386397 2 0.4367 0.5147 0.000 0.580 0.004 0.416 0.000
#> GSM386388 3 0.0794 0.9106 0.000 0.028 0.972 0.000 0.000
#> GSM386389 5 0.1845 0.9950 0.016 0.000 0.056 0.000 0.928
#> GSM386390 3 0.0794 0.9106 0.000 0.028 0.972 0.000 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM386435 2 0.000 0.7459 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM386436 2 0.000 0.7459 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM386437 2 0.000 0.7459 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM386438 2 0.000 0.7459 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM386439 1 0.150 0.5759 0.924 0.076 0.000 0.000 0.000 0.000
#> GSM386440 2 0.000 0.7459 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM386441 2 0.000 0.7459 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM386442 2 0.000 0.7459 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM386447 1 0.467 0.7709 0.628 0.304 0.000 0.068 0.000 0.000
#> GSM386448 2 0.000 0.7459 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM386449 2 0.000 0.7459 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM386450 2 0.000 0.7459 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM386451 2 0.150 0.6862 0.000 0.924 0.000 0.076 0.000 0.000
#> GSM386452 6 0.514 0.6136 0.372 0.000 0.000 0.092 0.000 0.536
#> GSM386453 2 0.150 0.6862 0.000 0.924 0.000 0.076 0.000 0.000
#> GSM386454 6 0.514 0.6136 0.372 0.000 0.000 0.092 0.000 0.536
#> GSM386455 2 0.150 0.6862 0.000 0.924 0.000 0.076 0.000 0.000
#> GSM386456 2 0.150 0.6862 0.000 0.924 0.000 0.076 0.000 0.000
#> GSM386457 2 0.375 0.5715 0.108 0.784 0.000 0.108 0.000 0.000
#> GSM386458 1 0.467 0.7709 0.628 0.304 0.000 0.068 0.000 0.000
#> GSM386443 5 0.026 0.9910 0.000 0.000 0.000 0.000 0.992 0.008
#> GSM386444 3 0.381 0.7332 0.000 0.152 0.772 0.076 0.000 0.000
#> GSM386445 3 0.381 0.7332 0.000 0.152 0.772 0.076 0.000 0.000
#> GSM386446 3 0.381 0.7332 0.000 0.152 0.772 0.076 0.000 0.000
#> GSM386398 6 0.569 0.5214 0.328 0.000 0.000 0.176 0.000 0.496
#> GSM386399 1 0.150 0.5759 0.924 0.076 0.000 0.000 0.000 0.000
#> GSM386400 6 0.569 0.5214 0.328 0.000 0.000 0.176 0.000 0.496
#> GSM386401 2 0.000 0.7459 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM386406 2 0.150 0.7239 0.052 0.936 0.000 0.012 0.000 0.000
#> GSM386407 2 0.449 0.1409 0.052 0.636 0.000 0.312 0.000 0.000
#> GSM386408 2 0.000 0.7459 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM386409 6 0.421 0.5258 0.276 0.044 0.000 0.000 0.000 0.680
#> GSM386410 6 0.205 0.6101 0.120 0.000 0.000 0.000 0.000 0.880
#> GSM386411 2 0.449 0.1409 0.052 0.636 0.000 0.312 0.000 0.000
#> GSM386412 1 0.467 0.7709 0.628 0.304 0.000 0.068 0.000 0.000
#> GSM386413 2 0.449 0.1409 0.052 0.636 0.000 0.312 0.000 0.000
#> GSM386414 1 0.467 0.7709 0.628 0.304 0.000 0.068 0.000 0.000
#> GSM386415 2 0.454 0.2395 0.052 0.624 0.000 0.324 0.000 0.000
#> GSM386416 1 0.467 0.7709 0.628 0.304 0.000 0.068 0.000 0.000
#> GSM386417 2 0.186 0.6832 0.004 0.904 0.000 0.092 0.000 0.000
#> GSM386402 3 0.000 0.9170 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386403 3 0.000 0.9170 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386404 3 0.000 0.9170 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386405 3 0.000 0.9170 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386418 2 0.150 0.7239 0.052 0.936 0.000 0.012 0.000 0.000
#> GSM386419 2 0.150 0.7239 0.052 0.936 0.000 0.012 0.000 0.000
#> GSM386420 2 0.150 0.7239 0.052 0.936 0.000 0.012 0.000 0.000
#> GSM386421 2 0.150 0.7239 0.052 0.936 0.000 0.012 0.000 0.000
#> GSM386426 1 0.150 0.5759 0.924 0.076 0.000 0.000 0.000 0.000
#> GSM386427 6 0.205 0.6101 0.120 0.000 0.000 0.000 0.000 0.880
#> GSM386428 2 0.150 0.7239 0.052 0.936 0.000 0.012 0.000 0.000
#> GSM386429 2 0.449 0.1409 0.052 0.636 0.000 0.312 0.000 0.000
#> GSM386430 2 0.449 0.1409 0.052 0.636 0.000 0.312 0.000 0.000
#> GSM386431 2 0.452 0.1037 0.052 0.628 0.000 0.320 0.000 0.000
#> GSM386432 2 0.449 0.1409 0.052 0.636 0.000 0.312 0.000 0.000
#> GSM386433 2 0.454 0.2395 0.052 0.624 0.000 0.324 0.000 0.000
#> GSM386434 2 0.454 0.2395 0.052 0.624 0.000 0.324 0.000 0.000
#> GSM386422 3 0.000 0.9170 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386423 5 0.000 0.9955 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM386424 3 0.000 0.9170 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386425 3 0.000 0.9170 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386385 1 0.373 0.6731 0.612 0.388 0.000 0.000 0.000 0.000
#> GSM386386 6 0.421 0.5258 0.276 0.044 0.000 0.000 0.000 0.680
#> GSM386387 2 0.107 0.7304 0.048 0.952 0.000 0.000 0.000 0.000
#> GSM386391 2 0.455 0.0708 0.052 0.620 0.000 0.328 0.000 0.000
#> GSM386392 1 0.150 0.5759 0.924 0.076 0.000 0.000 0.000 0.000
#> GSM386393 4 0.441 0.9757 0.036 0.356 0.000 0.608 0.000 0.000
#> GSM386394 6 0.516 0.1592 0.072 0.000 0.000 0.460 0.004 0.464
#> GSM386395 4 0.441 0.9757 0.036 0.356 0.000 0.608 0.000 0.000
#> GSM386396 4 0.445 0.9750 0.036 0.372 0.000 0.592 0.000 0.000
#> GSM386397 4 0.445 0.9750 0.036 0.372 0.000 0.592 0.000 0.000
#> GSM386388 3 0.000 0.9170 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386389 5 0.000 0.9955 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM386390 3 0.000 0.9170 0.000 0.000 1.000 0.000 0.000 0.000
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
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 agent(p) dose(p) time(p) k
#> SD:hclust 68 0.585 0.60871 3.81e-01 2
#> SD:hclust 70 0.611 0.74320 4.56e-01 3
#> SD:hclust 65 0.611 0.89580 9.96e-09 4
#> SD:hclust 65 0.860 0.72391 3.30e-08 5
#> SD:hclust 62 0.272 0.00694 3.00e-08 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 51941 rows and 74 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.521 0.798 0.869 0.3591 0.641 0.641
#> 3 3 1.000 0.929 0.952 0.5789 0.758 0.631
#> 4 4 0.708 0.898 0.887 0.2392 0.830 0.603
#> 5 5 0.808 0.761 0.844 0.0868 0.985 0.941
#> 6 6 0.795 0.624 0.747 0.0498 0.910 0.657
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
#> GSM386435 2 0.9129 0.876 0.328 0.672
#> GSM386436 2 0.9129 0.876 0.328 0.672
#> GSM386437 2 0.9129 0.876 0.328 0.672
#> GSM386438 2 0.9129 0.876 0.328 0.672
#> GSM386439 1 0.3431 0.807 0.936 0.064
#> GSM386440 2 0.9129 0.876 0.328 0.672
#> GSM386441 2 0.9129 0.876 0.328 0.672
#> GSM386442 2 0.9129 0.876 0.328 0.672
#> GSM386447 2 0.9129 0.876 0.328 0.672
#> GSM386448 2 0.9129 0.876 0.328 0.672
#> GSM386449 2 0.9129 0.876 0.328 0.672
#> GSM386450 2 0.9129 0.876 0.328 0.672
#> GSM386451 2 0.9129 0.876 0.328 0.672
#> GSM386452 1 0.0000 0.887 1.000 0.000
#> GSM386453 2 0.9129 0.876 0.328 0.672
#> GSM386454 1 0.0000 0.887 1.000 0.000
#> GSM386455 2 0.9129 0.876 0.328 0.672
#> GSM386456 2 0.9129 0.876 0.328 0.672
#> GSM386457 2 0.9129 0.876 0.328 0.672
#> GSM386458 2 0.9996 0.661 0.488 0.512
#> GSM386443 1 0.9129 0.618 0.672 0.328
#> GSM386444 2 0.2423 0.514 0.040 0.960
#> GSM386445 2 0.2423 0.514 0.040 0.960
#> GSM386446 2 0.0376 0.546 0.004 0.996
#> GSM386398 1 0.0000 0.887 1.000 0.000
#> GSM386399 1 0.0000 0.887 1.000 0.000
#> GSM386400 1 0.0000 0.887 1.000 0.000
#> GSM386401 2 0.9129 0.876 0.328 0.672
#> GSM386406 2 0.9129 0.876 0.328 0.672
#> GSM386407 2 0.9129 0.876 0.328 0.672
#> GSM386408 2 0.9129 0.876 0.328 0.672
#> GSM386409 1 0.0000 0.887 1.000 0.000
#> GSM386410 1 0.0000 0.887 1.000 0.000
#> GSM386411 2 0.9129 0.876 0.328 0.672
#> GSM386412 2 0.9129 0.876 0.328 0.672
#> GSM386413 2 0.9129 0.876 0.328 0.672
#> GSM386414 2 0.9129 0.876 0.328 0.672
#> GSM386415 2 0.9129 0.876 0.328 0.672
#> GSM386416 1 0.0000 0.887 1.000 0.000
#> GSM386417 2 0.9129 0.876 0.328 0.672
#> GSM386402 2 0.4161 0.466 0.084 0.916
#> GSM386403 2 0.4161 0.466 0.084 0.916
#> GSM386404 2 0.4161 0.466 0.084 0.916
#> GSM386405 2 0.4161 0.466 0.084 0.916
#> GSM386418 2 0.9129 0.876 0.328 0.672
#> GSM386419 2 0.9129 0.876 0.328 0.672
#> GSM386420 2 0.9129 0.876 0.328 0.672
#> GSM386421 2 0.9129 0.876 0.328 0.672
#> GSM386426 1 0.2778 0.832 0.952 0.048
#> GSM386427 1 0.0000 0.887 1.000 0.000
#> GSM386428 2 0.9129 0.876 0.328 0.672
#> GSM386429 2 0.9129 0.876 0.328 0.672
#> GSM386430 2 0.9129 0.876 0.328 0.672
#> GSM386431 2 0.9129 0.876 0.328 0.672
#> GSM386432 2 0.9129 0.876 0.328 0.672
#> GSM386433 2 0.9129 0.876 0.328 0.672
#> GSM386434 2 0.9129 0.876 0.328 0.672
#> GSM386422 2 0.4161 0.466 0.084 0.916
#> GSM386423 1 0.9129 0.618 0.672 0.328
#> GSM386424 2 0.4161 0.466 0.084 0.916
#> GSM386425 2 0.4161 0.466 0.084 0.916
#> GSM386385 2 0.9129 0.876 0.328 0.672
#> GSM386386 1 0.0376 0.884 0.996 0.004
#> GSM386387 2 0.9129 0.876 0.328 0.672
#> GSM386391 2 0.9129 0.876 0.328 0.672
#> GSM386392 1 0.2423 0.843 0.960 0.040
#> GSM386393 2 0.9129 0.876 0.328 0.672
#> GSM386394 1 0.0376 0.884 0.996 0.004
#> GSM386395 2 0.9129 0.876 0.328 0.672
#> GSM386396 2 0.9129 0.876 0.328 0.672
#> GSM386397 2 0.9129 0.876 0.328 0.672
#> GSM386388 2 0.4161 0.466 0.084 0.916
#> GSM386389 1 0.9129 0.618 0.672 0.328
#> GSM386390 2 0.4161 0.466 0.084 0.916
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM386435 2 0.2063 0.970 0.044 0.948 0.008
#> GSM386436 2 0.2063 0.970 0.044 0.948 0.008
#> GSM386437 2 0.2063 0.970 0.044 0.948 0.008
#> GSM386438 2 0.2063 0.970 0.044 0.948 0.008
#> GSM386439 1 0.0424 0.939 0.992 0.008 0.000
#> GSM386440 2 0.2063 0.970 0.044 0.948 0.008
#> GSM386441 2 0.2063 0.970 0.044 0.948 0.008
#> GSM386442 2 0.2063 0.970 0.044 0.948 0.008
#> GSM386447 2 0.2955 0.946 0.080 0.912 0.008
#> GSM386448 2 0.2063 0.970 0.044 0.948 0.008
#> GSM386449 2 0.2063 0.970 0.044 0.948 0.008
#> GSM386450 2 0.1832 0.971 0.036 0.956 0.008
#> GSM386451 2 0.0848 0.970 0.008 0.984 0.008
#> GSM386452 1 0.1529 0.941 0.960 0.000 0.040
#> GSM386453 2 0.0848 0.970 0.008 0.984 0.008
#> GSM386454 1 0.1411 0.941 0.964 0.000 0.036
#> GSM386455 2 0.0848 0.970 0.008 0.984 0.008
#> GSM386456 2 0.0848 0.970 0.008 0.984 0.008
#> GSM386457 2 0.0848 0.970 0.008 0.984 0.008
#> GSM386458 1 0.5728 0.522 0.720 0.272 0.008
#> GSM386443 1 0.2537 0.897 0.920 0.000 0.080
#> GSM386444 3 0.1753 0.920 0.000 0.048 0.952
#> GSM386445 3 0.1753 0.920 0.000 0.048 0.952
#> GSM386446 3 0.1753 0.920 0.000 0.048 0.952
#> GSM386398 1 0.0747 0.945 0.984 0.000 0.016
#> GSM386399 1 0.0000 0.944 1.000 0.000 0.000
#> GSM386400 1 0.0747 0.945 0.984 0.000 0.016
#> GSM386401 2 0.2063 0.970 0.044 0.948 0.008
#> GSM386406 2 0.2063 0.970 0.044 0.948 0.008
#> GSM386407 2 0.0424 0.966 0.000 0.992 0.008
#> GSM386408 2 0.2063 0.970 0.044 0.948 0.008
#> GSM386409 1 0.0592 0.945 0.988 0.000 0.012
#> GSM386410 1 0.1529 0.941 0.960 0.000 0.040
#> GSM386411 2 0.0424 0.966 0.000 0.992 0.008
#> GSM386412 2 0.1170 0.958 0.016 0.976 0.008
#> GSM386413 2 0.0424 0.966 0.000 0.992 0.008
#> GSM386414 2 0.1170 0.958 0.016 0.976 0.008
#> GSM386415 2 0.0424 0.966 0.000 0.992 0.008
#> GSM386416 1 0.1643 0.907 0.956 0.044 0.000
#> GSM386417 2 0.0747 0.967 0.000 0.984 0.016
#> GSM386402 3 0.1950 0.926 0.008 0.040 0.952
#> GSM386403 3 0.1950 0.926 0.008 0.040 0.952
#> GSM386404 3 0.1950 0.926 0.008 0.040 0.952
#> GSM386405 3 0.1950 0.926 0.008 0.040 0.952
#> GSM386418 2 0.2063 0.970 0.044 0.948 0.008
#> GSM386419 2 0.2063 0.970 0.044 0.948 0.008
#> GSM386420 2 0.2063 0.970 0.044 0.948 0.008
#> GSM386421 2 0.2063 0.970 0.044 0.948 0.008
#> GSM386426 1 0.0237 0.944 0.996 0.000 0.004
#> GSM386427 1 0.1529 0.941 0.960 0.000 0.040
#> GSM386428 2 0.1643 0.970 0.044 0.956 0.000
#> GSM386429 2 0.0424 0.966 0.000 0.992 0.008
#> GSM386430 2 0.0424 0.966 0.000 0.992 0.008
#> GSM386431 2 0.0848 0.963 0.008 0.984 0.008
#> GSM386432 2 0.0424 0.966 0.000 0.992 0.008
#> GSM386433 2 0.0424 0.966 0.000 0.992 0.008
#> GSM386434 2 0.0424 0.966 0.000 0.992 0.008
#> GSM386422 3 0.1950 0.926 0.008 0.040 0.952
#> GSM386423 3 0.6168 0.266 0.412 0.000 0.588
#> GSM386424 3 0.1950 0.926 0.008 0.040 0.952
#> GSM386425 3 0.1950 0.926 0.008 0.040 0.952
#> GSM386385 2 0.2955 0.946 0.080 0.912 0.008
#> GSM386386 1 0.0237 0.944 0.996 0.000 0.004
#> GSM386387 2 0.2063 0.970 0.044 0.948 0.008
#> GSM386391 2 0.1643 0.970 0.044 0.956 0.000
#> GSM386392 1 0.0237 0.944 0.996 0.000 0.004
#> GSM386393 2 0.0424 0.966 0.000 0.992 0.008
#> GSM386394 1 0.2569 0.913 0.936 0.032 0.032
#> GSM386395 2 0.0424 0.966 0.000 0.992 0.008
#> GSM386396 2 0.0424 0.966 0.000 0.992 0.008
#> GSM386397 2 0.0424 0.966 0.000 0.992 0.008
#> GSM386388 3 0.1950 0.926 0.008 0.040 0.952
#> GSM386389 3 0.6168 0.266 0.412 0.000 0.588
#> GSM386390 3 0.1950 0.926 0.008 0.040 0.952
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM386435 2 0.0000 0.959 0.000 1.000 0.000 0.000
#> GSM386436 2 0.0000 0.959 0.000 1.000 0.000 0.000
#> GSM386437 2 0.0000 0.959 0.000 1.000 0.000 0.000
#> GSM386438 2 0.0000 0.959 0.000 1.000 0.000 0.000
#> GSM386439 1 0.3308 0.821 0.872 0.092 0.000 0.036
#> GSM386440 2 0.0000 0.959 0.000 1.000 0.000 0.000
#> GSM386441 2 0.0000 0.959 0.000 1.000 0.000 0.000
#> GSM386442 2 0.0000 0.959 0.000 1.000 0.000 0.000
#> GSM386447 2 0.3279 0.806 0.096 0.872 0.000 0.032
#> GSM386448 2 0.0000 0.959 0.000 1.000 0.000 0.000
#> GSM386449 2 0.0000 0.959 0.000 1.000 0.000 0.000
#> GSM386450 2 0.0000 0.959 0.000 1.000 0.000 0.000
#> GSM386451 2 0.2345 0.860 0.000 0.900 0.000 0.100
#> GSM386452 1 0.2530 0.873 0.888 0.000 0.000 0.112
#> GSM386453 2 0.2345 0.860 0.000 0.900 0.000 0.100
#> GSM386454 1 0.2654 0.874 0.888 0.000 0.004 0.108
#> GSM386455 2 0.2408 0.859 0.000 0.896 0.000 0.104
#> GSM386456 2 0.2345 0.865 0.000 0.900 0.000 0.100
#> GSM386457 2 0.2345 0.860 0.000 0.900 0.000 0.100
#> GSM386458 1 0.5842 0.641 0.704 0.168 0.000 0.128
#> GSM386443 1 0.3649 0.821 0.796 0.000 0.000 0.204
#> GSM386444 3 0.1109 0.906 0.000 0.004 0.968 0.028
#> GSM386445 3 0.1109 0.906 0.000 0.004 0.968 0.028
#> GSM386446 3 0.1109 0.906 0.000 0.004 0.968 0.028
#> GSM386398 1 0.0376 0.892 0.992 0.000 0.004 0.004
#> GSM386399 1 0.0707 0.891 0.980 0.000 0.000 0.020
#> GSM386400 1 0.0376 0.892 0.992 0.000 0.004 0.004
#> GSM386401 2 0.0000 0.959 0.000 1.000 0.000 0.000
#> GSM386406 2 0.0000 0.959 0.000 1.000 0.000 0.000
#> GSM386407 4 0.4164 0.980 0.000 0.264 0.000 0.736
#> GSM386408 2 0.0000 0.959 0.000 1.000 0.000 0.000
#> GSM386409 1 0.1022 0.892 0.968 0.000 0.000 0.032
#> GSM386410 1 0.2530 0.873 0.888 0.000 0.000 0.112
#> GSM386411 4 0.4304 0.979 0.000 0.284 0.000 0.716
#> GSM386412 4 0.4220 0.960 0.004 0.248 0.000 0.748
#> GSM386413 4 0.4304 0.979 0.000 0.284 0.000 0.716
#> GSM386414 4 0.4008 0.960 0.000 0.244 0.000 0.756
#> GSM386415 4 0.4250 0.979 0.000 0.276 0.000 0.724
#> GSM386416 1 0.3123 0.812 0.844 0.000 0.000 0.156
#> GSM386417 4 0.4250 0.979 0.000 0.276 0.000 0.724
#> GSM386402 3 0.0188 0.914 0.000 0.004 0.996 0.000
#> GSM386403 3 0.0188 0.914 0.000 0.004 0.996 0.000
#> GSM386404 3 0.0188 0.914 0.000 0.004 0.996 0.000
#> GSM386405 3 0.0779 0.910 0.000 0.004 0.980 0.016
#> GSM386418 2 0.0000 0.959 0.000 1.000 0.000 0.000
#> GSM386419 2 0.0000 0.959 0.000 1.000 0.000 0.000
#> GSM386420 2 0.0000 0.959 0.000 1.000 0.000 0.000
#> GSM386421 2 0.0000 0.959 0.000 1.000 0.000 0.000
#> GSM386426 1 0.1118 0.889 0.964 0.000 0.000 0.036
#> GSM386427 1 0.2530 0.873 0.888 0.000 0.000 0.112
#> GSM386428 2 0.0000 0.959 0.000 1.000 0.000 0.000
#> GSM386429 4 0.4277 0.980 0.000 0.280 0.000 0.720
#> GSM386430 4 0.4277 0.980 0.000 0.280 0.000 0.720
#> GSM386431 4 0.4164 0.980 0.000 0.264 0.000 0.736
#> GSM386432 4 0.4304 0.979 0.000 0.284 0.000 0.716
#> GSM386433 4 0.4250 0.979 0.000 0.276 0.000 0.724
#> GSM386434 4 0.4250 0.979 0.000 0.276 0.000 0.724
#> GSM386422 3 0.0188 0.914 0.000 0.004 0.996 0.000
#> GSM386423 3 0.7561 0.150 0.348 0.000 0.452 0.200
#> GSM386424 3 0.0188 0.914 0.000 0.004 0.996 0.000
#> GSM386425 3 0.0188 0.914 0.000 0.004 0.996 0.000
#> GSM386385 2 0.3279 0.806 0.096 0.872 0.000 0.032
#> GSM386386 1 0.1557 0.891 0.944 0.000 0.000 0.056
#> GSM386387 2 0.0000 0.959 0.000 1.000 0.000 0.000
#> GSM386391 2 0.0188 0.955 0.000 0.996 0.000 0.004
#> GSM386392 1 0.1118 0.889 0.964 0.000 0.000 0.036
#> GSM386393 4 0.4164 0.980 0.000 0.264 0.000 0.736
#> GSM386394 1 0.4661 0.698 0.652 0.000 0.000 0.348
#> GSM386395 4 0.4164 0.980 0.000 0.264 0.000 0.736
#> GSM386396 4 0.4164 0.980 0.000 0.264 0.000 0.736
#> GSM386397 4 0.4164 0.980 0.000 0.264 0.000 0.736
#> GSM386388 3 0.0188 0.914 0.000 0.004 0.996 0.000
#> GSM386389 3 0.7561 0.150 0.348 0.000 0.452 0.200
#> GSM386390 3 0.0188 0.914 0.000 0.004 0.996 0.000
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM386435 2 0.0000 0.8961 0.000 1.000 0.000 0.000 0.000
#> GSM386436 2 0.0000 0.8961 0.000 1.000 0.000 0.000 0.000
#> GSM386437 2 0.0000 0.8961 0.000 1.000 0.000 0.000 0.000
#> GSM386438 2 0.0000 0.8961 0.000 1.000 0.000 0.000 0.000
#> GSM386439 1 0.2502 0.5905 0.904 0.060 0.000 0.012 0.024
#> GSM386440 2 0.0000 0.8961 0.000 1.000 0.000 0.000 0.000
#> GSM386441 2 0.0000 0.8961 0.000 1.000 0.000 0.000 0.000
#> GSM386442 2 0.0404 0.8957 0.000 0.988 0.000 0.000 0.012
#> GSM386447 2 0.4328 0.6787 0.208 0.752 0.000 0.024 0.016
#> GSM386448 2 0.0000 0.8961 0.000 1.000 0.000 0.000 0.000
#> GSM386449 2 0.0000 0.8961 0.000 1.000 0.000 0.000 0.000
#> GSM386450 2 0.0000 0.8961 0.000 1.000 0.000 0.000 0.000
#> GSM386451 2 0.5240 0.5965 0.000 0.660 0.000 0.244 0.096
#> GSM386452 1 0.4452 0.5100 0.696 0.000 0.000 0.032 0.272
#> GSM386453 2 0.5240 0.5965 0.000 0.660 0.000 0.244 0.096
#> GSM386454 1 0.4645 0.5088 0.688 0.000 0.000 0.044 0.268
#> GSM386455 2 0.5240 0.5965 0.000 0.660 0.000 0.244 0.096
#> GSM386456 2 0.5190 0.6083 0.000 0.668 0.000 0.236 0.096
#> GSM386457 2 0.5265 0.5923 0.000 0.656 0.000 0.248 0.096
#> GSM386458 1 0.7969 0.0873 0.432 0.204 0.000 0.248 0.116
#> GSM386443 5 0.4542 -0.1027 0.456 0.000 0.000 0.008 0.536
#> GSM386444 3 0.3197 0.8252 0.000 0.000 0.836 0.024 0.140
#> GSM386445 3 0.3197 0.8252 0.000 0.000 0.836 0.024 0.140
#> GSM386446 3 0.3197 0.8252 0.000 0.000 0.836 0.024 0.140
#> GSM386398 1 0.3002 0.6046 0.856 0.000 0.000 0.028 0.116
#> GSM386399 1 0.0898 0.6311 0.972 0.000 0.000 0.008 0.020
#> GSM386400 1 0.2951 0.6062 0.860 0.000 0.000 0.028 0.112
#> GSM386401 2 0.0404 0.8957 0.000 0.988 0.000 0.000 0.012
#> GSM386406 2 0.0963 0.8925 0.000 0.964 0.000 0.000 0.036
#> GSM386407 4 0.1544 0.8764 0.000 0.068 0.000 0.932 0.000
#> GSM386408 2 0.0963 0.8925 0.000 0.964 0.000 0.000 0.036
#> GSM386409 1 0.2172 0.6386 0.908 0.000 0.000 0.016 0.076
#> GSM386410 1 0.4354 0.5213 0.712 0.000 0.000 0.032 0.256
#> GSM386411 4 0.1792 0.8748 0.000 0.084 0.000 0.916 0.000
#> GSM386412 4 0.2903 0.8251 0.080 0.048 0.000 0.872 0.000
#> GSM386413 4 0.1792 0.8748 0.000 0.084 0.000 0.916 0.000
#> GSM386414 4 0.1914 0.8697 0.016 0.060 0.000 0.924 0.000
#> GSM386415 4 0.1608 0.8739 0.000 0.072 0.000 0.928 0.000
#> GSM386416 1 0.4588 0.2533 0.604 0.000 0.000 0.380 0.016
#> GSM386417 4 0.4020 0.7620 0.000 0.108 0.000 0.796 0.096
#> GSM386402 3 0.0000 0.9375 0.000 0.000 1.000 0.000 0.000
#> GSM386403 3 0.0162 0.9354 0.000 0.000 0.996 0.000 0.004
#> GSM386404 3 0.0162 0.9354 0.000 0.000 0.996 0.000 0.004
#> GSM386405 3 0.1043 0.9168 0.000 0.000 0.960 0.000 0.040
#> GSM386418 2 0.1043 0.8912 0.000 0.960 0.000 0.000 0.040
#> GSM386419 2 0.0963 0.8925 0.000 0.964 0.000 0.000 0.036
#> GSM386420 2 0.0963 0.8925 0.000 0.964 0.000 0.000 0.036
#> GSM386421 2 0.1043 0.8912 0.000 0.960 0.000 0.000 0.040
#> GSM386426 1 0.1430 0.6337 0.944 0.000 0.000 0.004 0.052
#> GSM386427 1 0.4354 0.5213 0.712 0.000 0.000 0.032 0.256
#> GSM386428 2 0.1043 0.8912 0.000 0.960 0.000 0.000 0.040
#> GSM386429 4 0.4489 0.8392 0.000 0.068 0.000 0.740 0.192
#> GSM386430 4 0.4489 0.8392 0.000 0.068 0.000 0.740 0.192
#> GSM386431 4 0.4489 0.8392 0.000 0.068 0.000 0.740 0.192
#> GSM386432 4 0.1792 0.8748 0.000 0.084 0.000 0.916 0.000
#> GSM386433 4 0.1608 0.8739 0.000 0.072 0.000 0.928 0.000
#> GSM386434 4 0.1608 0.8739 0.000 0.072 0.000 0.928 0.000
#> GSM386422 3 0.0000 0.9375 0.000 0.000 1.000 0.000 0.000
#> GSM386423 5 0.5951 0.6503 0.116 0.000 0.364 0.000 0.520
#> GSM386424 3 0.0000 0.9375 0.000 0.000 1.000 0.000 0.000
#> GSM386425 3 0.0000 0.9375 0.000 0.000 1.000 0.000 0.000
#> GSM386385 2 0.3887 0.7437 0.160 0.796 0.000 0.004 0.040
#> GSM386386 1 0.2777 0.6293 0.864 0.000 0.000 0.016 0.120
#> GSM386387 2 0.0880 0.8931 0.000 0.968 0.000 0.000 0.032
#> GSM386391 2 0.1768 0.8708 0.000 0.924 0.000 0.004 0.072
#> GSM386392 1 0.1197 0.6361 0.952 0.000 0.000 0.000 0.048
#> GSM386393 4 0.4919 0.8150 0.004 0.068 0.000 0.700 0.228
#> GSM386394 1 0.6244 0.1666 0.444 0.000 0.000 0.144 0.412
#> GSM386395 4 0.4919 0.8150 0.004 0.068 0.000 0.700 0.228
#> GSM386396 4 0.4522 0.8378 0.000 0.068 0.000 0.736 0.196
#> GSM386397 4 0.4522 0.8378 0.000 0.068 0.000 0.736 0.196
#> GSM386388 3 0.0000 0.9375 0.000 0.000 1.000 0.000 0.000
#> GSM386389 5 0.5951 0.6503 0.116 0.000 0.364 0.000 0.520
#> GSM386390 3 0.0000 0.9375 0.000 0.000 1.000 0.000 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM386435 2 0.1075 0.9228 0.000 0.952 0.000 0.000 0.000 0.048
#> GSM386436 2 0.1075 0.9228 0.000 0.952 0.000 0.000 0.000 0.048
#> GSM386437 2 0.1075 0.9228 0.000 0.952 0.000 0.000 0.000 0.048
#> GSM386438 2 0.1075 0.9228 0.000 0.952 0.000 0.000 0.000 0.048
#> GSM386439 1 0.5348 0.4677 0.580 0.064 0.000 0.004 0.332 0.020
#> GSM386440 2 0.1219 0.9212 0.004 0.948 0.000 0.000 0.000 0.048
#> GSM386441 2 0.1219 0.9212 0.004 0.948 0.000 0.000 0.000 0.048
#> GSM386442 2 0.1007 0.9232 0.000 0.956 0.000 0.000 0.000 0.044
#> GSM386447 2 0.4688 0.5060 0.288 0.644 0.000 0.004 0.000 0.064
#> GSM386448 2 0.1219 0.9212 0.004 0.948 0.000 0.000 0.000 0.048
#> GSM386449 2 0.1075 0.9228 0.000 0.952 0.000 0.000 0.000 0.048
#> GSM386450 2 0.1219 0.9212 0.004 0.948 0.000 0.000 0.000 0.048
#> GSM386451 6 0.3772 0.7929 0.004 0.296 0.000 0.008 0.000 0.692
#> GSM386452 5 0.0000 0.4552 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM386453 6 0.3840 0.7953 0.008 0.288 0.000 0.008 0.000 0.696
#> GSM386454 5 0.1926 0.4299 0.068 0.000 0.000 0.000 0.912 0.020
#> GSM386455 6 0.3733 0.7974 0.004 0.288 0.000 0.008 0.000 0.700
#> GSM386456 6 0.3733 0.7974 0.004 0.288 0.000 0.008 0.000 0.700
#> GSM386457 6 0.3757 0.7909 0.008 0.272 0.000 0.008 0.000 0.712
#> GSM386458 6 0.5146 0.2228 0.368 0.060 0.000 0.004 0.008 0.560
#> GSM386443 5 0.5600 0.3534 0.296 0.000 0.000 0.004 0.544 0.156
#> GSM386444 3 0.4000 0.7675 0.048 0.000 0.724 0.000 0.000 0.228
#> GSM386445 3 0.4000 0.7675 0.048 0.000 0.724 0.000 0.000 0.228
#> GSM386446 3 0.4000 0.7675 0.048 0.000 0.724 0.000 0.000 0.228
#> GSM386398 5 0.4607 -0.0888 0.380 0.000 0.000 0.004 0.580 0.036
#> GSM386399 1 0.4032 0.4167 0.572 0.000 0.000 0.000 0.420 0.008
#> GSM386400 5 0.4607 -0.0888 0.380 0.000 0.000 0.004 0.580 0.036
#> GSM386401 2 0.1007 0.9232 0.000 0.956 0.000 0.000 0.000 0.044
#> GSM386406 2 0.0790 0.9118 0.032 0.968 0.000 0.000 0.000 0.000
#> GSM386407 4 0.4432 0.4974 0.004 0.020 0.000 0.544 0.000 0.432
#> GSM386408 2 0.0458 0.9170 0.016 0.984 0.000 0.000 0.000 0.000
#> GSM386409 5 0.3668 -0.1698 0.328 0.000 0.000 0.000 0.668 0.004
#> GSM386410 5 0.0260 0.4540 0.008 0.000 0.000 0.000 0.992 0.000
#> GSM386411 4 0.4521 0.4846 0.004 0.024 0.000 0.524 0.000 0.448
#> GSM386412 4 0.5867 0.3412 0.136 0.012 0.000 0.436 0.000 0.416
#> GSM386413 4 0.4521 0.4846 0.004 0.024 0.000 0.524 0.000 0.448
#> GSM386414 4 0.4654 0.4671 0.016 0.016 0.000 0.504 0.000 0.464
#> GSM386415 4 0.4714 0.4718 0.012 0.024 0.000 0.508 0.000 0.456
#> GSM386416 1 0.7020 -0.0262 0.400 0.000 0.000 0.176 0.092 0.332
#> GSM386417 6 0.4009 0.0197 0.000 0.028 0.000 0.288 0.000 0.684
#> GSM386402 3 0.0000 0.9217 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386403 3 0.0260 0.9201 0.000 0.000 0.992 0.008 0.000 0.000
#> GSM386404 3 0.0260 0.9201 0.000 0.000 0.992 0.008 0.000 0.000
#> GSM386405 3 0.1196 0.9021 0.040 0.000 0.952 0.000 0.000 0.008
#> GSM386418 2 0.0790 0.9118 0.032 0.968 0.000 0.000 0.000 0.000
#> GSM386419 2 0.0632 0.9147 0.024 0.976 0.000 0.000 0.000 0.000
#> GSM386420 2 0.0632 0.9147 0.024 0.976 0.000 0.000 0.000 0.000
#> GSM386421 2 0.0790 0.9118 0.032 0.968 0.000 0.000 0.000 0.000
#> GSM386426 1 0.4084 0.5064 0.588 0.000 0.000 0.012 0.400 0.000
#> GSM386427 5 0.0260 0.4540 0.008 0.000 0.000 0.000 0.992 0.000
#> GSM386428 2 0.0790 0.9118 0.032 0.968 0.000 0.000 0.000 0.000
#> GSM386429 4 0.1257 0.5797 0.000 0.020 0.000 0.952 0.000 0.028
#> GSM386430 4 0.1257 0.5797 0.000 0.020 0.000 0.952 0.000 0.028
#> GSM386431 4 0.0914 0.5783 0.000 0.016 0.000 0.968 0.000 0.016
#> GSM386432 4 0.4504 0.4942 0.004 0.024 0.000 0.540 0.000 0.432
#> GSM386433 4 0.4714 0.4718 0.012 0.024 0.000 0.508 0.000 0.456
#> GSM386434 4 0.4627 0.4755 0.008 0.024 0.000 0.512 0.000 0.456
#> GSM386422 3 0.0000 0.9217 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386423 5 0.7602 0.3010 0.228 0.000 0.256 0.004 0.360 0.152
#> GSM386424 3 0.0000 0.9217 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386425 3 0.0000 0.9217 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386385 2 0.3221 0.6787 0.220 0.772 0.000 0.004 0.000 0.004
#> GSM386386 5 0.4002 -0.2710 0.404 0.000 0.000 0.008 0.588 0.000
#> GSM386387 2 0.0458 0.9166 0.016 0.984 0.000 0.000 0.000 0.000
#> GSM386391 2 0.2313 0.8368 0.100 0.884 0.000 0.004 0.000 0.012
#> GSM386392 1 0.4084 0.5064 0.588 0.000 0.000 0.012 0.400 0.000
#> GSM386393 4 0.2889 0.5071 0.116 0.020 0.000 0.852 0.000 0.012
#> GSM386394 4 0.6127 -0.2048 0.200 0.000 0.000 0.460 0.328 0.012
#> GSM386395 4 0.2889 0.5071 0.116 0.020 0.000 0.852 0.000 0.012
#> GSM386396 4 0.1262 0.5717 0.020 0.016 0.000 0.956 0.000 0.008
#> GSM386397 4 0.1262 0.5717 0.020 0.016 0.000 0.956 0.000 0.008
#> GSM386388 3 0.0000 0.9217 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386389 5 0.7602 0.3010 0.228 0.000 0.256 0.004 0.360 0.152
#> GSM386390 3 0.0000 0.9217 0.000 0.000 1.000 0.000 0.000 0.000
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
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 agent(p) dose(p) time(p) k
#> SD:kmeans 65 0.29178 0.4009 3.36e-01 2
#> SD:kmeans 72 0.58353 0.8789 8.14e-11 3
#> SD:kmeans 72 0.00291 0.0245 2.09e-14 4
#> SD:kmeans 70 0.00748 0.0307 3.75e-14 5
#> SD:kmeans 48 0.00610 0.0204 7.34e-14 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 51941 rows and 74 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.748 0.800 0.915 0.4736 0.506 0.506
#> 3 3 1.000 0.960 0.983 0.3725 0.740 0.534
#> 4 4 1.000 0.972 0.987 0.1467 0.841 0.583
#> 5 5 0.972 0.954 0.973 0.0692 0.915 0.688
#> 6 6 0.880 0.805 0.854 0.0375 0.990 0.954
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
#> GSM386435 2 0.9833 0.9515 0.424 0.576
#> GSM386436 2 0.9833 0.9515 0.424 0.576
#> GSM386437 2 0.9833 0.9515 0.424 0.576
#> GSM386438 2 0.9833 0.9515 0.424 0.576
#> GSM386439 1 0.9881 0.8273 0.564 0.436
#> GSM386440 2 0.9833 0.9515 0.424 0.576
#> GSM386441 2 0.9833 0.9515 0.424 0.576
#> GSM386442 2 0.9833 0.9515 0.424 0.576
#> GSM386447 2 0.0376 0.2100 0.004 0.996
#> GSM386448 2 0.9833 0.9515 0.424 0.576
#> GSM386449 2 0.9833 0.9515 0.424 0.576
#> GSM386450 2 0.9833 0.9515 0.424 0.576
#> GSM386451 2 0.9833 0.9515 0.424 0.576
#> GSM386452 1 0.9881 0.8273 0.564 0.436
#> GSM386453 2 0.9833 0.9515 0.424 0.576
#> GSM386454 1 0.9881 0.8273 0.564 0.436
#> GSM386455 2 0.9881 0.9436 0.436 0.564
#> GSM386456 2 0.9881 0.9436 0.436 0.564
#> GSM386457 2 0.9881 0.9436 0.436 0.564
#> GSM386458 1 0.9833 0.8251 0.576 0.424
#> GSM386443 1 0.9833 0.8251 0.576 0.424
#> GSM386444 1 0.0376 0.4386 0.996 0.004
#> GSM386445 1 0.0376 0.4386 0.996 0.004
#> GSM386446 1 0.8144 -0.3793 0.748 0.252
#> GSM386398 1 0.9881 0.8273 0.564 0.436
#> GSM386399 1 0.9881 0.8273 0.564 0.436
#> GSM386400 1 0.9881 0.8273 0.564 0.436
#> GSM386401 2 0.9833 0.9515 0.424 0.576
#> GSM386406 2 0.9833 0.9515 0.424 0.576
#> GSM386407 2 0.9833 0.9515 0.424 0.576
#> GSM386408 2 0.9833 0.9515 0.424 0.576
#> GSM386409 1 0.9881 0.8273 0.564 0.436
#> GSM386410 1 0.9881 0.8273 0.564 0.436
#> GSM386411 2 0.9833 0.9515 0.424 0.576
#> GSM386412 2 0.4298 -0.0474 0.088 0.912
#> GSM386413 2 0.9833 0.9515 0.424 0.576
#> GSM386414 1 0.9866 0.8239 0.568 0.432
#> GSM386415 2 0.9881 0.9436 0.436 0.564
#> GSM386416 1 0.9833 0.8251 0.576 0.424
#> GSM386417 2 0.9881 0.9436 0.436 0.564
#> GSM386402 1 0.0000 0.4470 1.000 0.000
#> GSM386403 1 0.9833 0.8251 0.576 0.424
#> GSM386404 1 0.9833 0.8251 0.576 0.424
#> GSM386405 1 0.0000 0.4470 1.000 0.000
#> GSM386418 2 0.9833 0.9515 0.424 0.576
#> GSM386419 2 0.9833 0.9515 0.424 0.576
#> GSM386420 2 0.9833 0.9515 0.424 0.576
#> GSM386421 2 0.9833 0.9515 0.424 0.576
#> GSM386426 1 0.9881 0.8273 0.564 0.436
#> GSM386427 1 0.9881 0.8273 0.564 0.436
#> GSM386428 2 0.9833 0.9515 0.424 0.576
#> GSM386429 2 0.9833 0.9515 0.424 0.576
#> GSM386430 2 0.9833 0.9515 0.424 0.576
#> GSM386431 2 0.8443 0.7572 0.272 0.728
#> GSM386432 2 0.9833 0.9515 0.424 0.576
#> GSM386433 2 0.9881 0.9436 0.436 0.564
#> GSM386434 2 0.9881 0.9436 0.436 0.564
#> GSM386422 1 0.0000 0.4470 1.000 0.000
#> GSM386423 1 0.9833 0.8251 0.576 0.424
#> GSM386424 1 0.0000 0.4470 1.000 0.000
#> GSM386425 1 0.0000 0.4470 1.000 0.000
#> GSM386385 2 0.0000 0.2200 0.000 1.000
#> GSM386386 1 0.9881 0.8273 0.564 0.436
#> GSM386387 2 0.9833 0.9515 0.424 0.576
#> GSM386391 2 0.9833 0.9515 0.424 0.576
#> GSM386392 1 0.9881 0.8273 0.564 0.436
#> GSM386393 2 0.9833 0.9515 0.424 0.576
#> GSM386394 1 0.9881 0.8273 0.564 0.436
#> GSM386395 2 0.9833 0.9515 0.424 0.576
#> GSM386396 2 0.9881 0.9436 0.436 0.564
#> GSM386397 2 0.9881 0.9436 0.436 0.564
#> GSM386388 1 0.0000 0.4470 1.000 0.000
#> GSM386389 1 0.9833 0.8251 0.576 0.424
#> GSM386390 1 0.1184 0.4693 0.984 0.016
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM386435 2 0.0000 0.999 0.000 1.000 0.000
#> GSM386436 2 0.0000 0.999 0.000 1.000 0.000
#> GSM386437 2 0.0000 0.999 0.000 1.000 0.000
#> GSM386438 2 0.0000 0.999 0.000 1.000 0.000
#> GSM386439 1 0.0000 1.000 1.000 0.000 0.000
#> GSM386440 2 0.0000 0.999 0.000 1.000 0.000
#> GSM386441 2 0.0000 0.999 0.000 1.000 0.000
#> GSM386442 2 0.0000 0.999 0.000 1.000 0.000
#> GSM386447 1 0.0000 1.000 1.000 0.000 0.000
#> GSM386448 2 0.0000 0.999 0.000 1.000 0.000
#> GSM386449 2 0.0000 0.999 0.000 1.000 0.000
#> GSM386450 2 0.0000 0.999 0.000 1.000 0.000
#> GSM386451 2 0.0000 0.999 0.000 1.000 0.000
#> GSM386452 1 0.0000 1.000 1.000 0.000 0.000
#> GSM386453 2 0.0000 0.999 0.000 1.000 0.000
#> GSM386454 1 0.0000 1.000 1.000 0.000 0.000
#> GSM386455 2 0.0000 0.999 0.000 1.000 0.000
#> GSM386456 2 0.0000 0.999 0.000 1.000 0.000
#> GSM386457 2 0.0237 0.996 0.000 0.996 0.004
#> GSM386458 1 0.0000 1.000 1.000 0.000 0.000
#> GSM386443 1 0.0000 1.000 1.000 0.000 0.000
#> GSM386444 3 0.0000 0.933 0.000 0.000 1.000
#> GSM386445 3 0.0000 0.933 0.000 0.000 1.000
#> GSM386446 3 0.0000 0.933 0.000 0.000 1.000
#> GSM386398 1 0.0000 1.000 1.000 0.000 0.000
#> GSM386399 1 0.0000 1.000 1.000 0.000 0.000
#> GSM386400 1 0.0000 1.000 1.000 0.000 0.000
#> GSM386401 2 0.0000 0.999 0.000 1.000 0.000
#> GSM386406 2 0.0000 0.999 0.000 1.000 0.000
#> GSM386407 2 0.0000 0.999 0.000 1.000 0.000
#> GSM386408 2 0.0000 0.999 0.000 1.000 0.000
#> GSM386409 1 0.0000 1.000 1.000 0.000 0.000
#> GSM386410 1 0.0000 1.000 1.000 0.000 0.000
#> GSM386411 2 0.0000 0.999 0.000 1.000 0.000
#> GSM386412 1 0.0000 1.000 1.000 0.000 0.000
#> GSM386413 2 0.0000 0.999 0.000 1.000 0.000
#> GSM386414 3 0.5216 0.663 0.260 0.000 0.740
#> GSM386415 3 0.0237 0.932 0.000 0.004 0.996
#> GSM386416 1 0.0000 1.000 1.000 0.000 0.000
#> GSM386417 3 0.4452 0.740 0.000 0.192 0.808
#> GSM386402 3 0.0000 0.933 0.000 0.000 1.000
#> GSM386403 3 0.0000 0.933 0.000 0.000 1.000
#> GSM386404 3 0.0000 0.933 0.000 0.000 1.000
#> GSM386405 3 0.0000 0.933 0.000 0.000 1.000
#> GSM386418 2 0.0000 0.999 0.000 1.000 0.000
#> GSM386419 2 0.0000 0.999 0.000 1.000 0.000
#> GSM386420 2 0.0000 0.999 0.000 1.000 0.000
#> GSM386421 2 0.0000 0.999 0.000 1.000 0.000
#> GSM386426 1 0.0000 1.000 1.000 0.000 0.000
#> GSM386427 1 0.0000 1.000 1.000 0.000 0.000
#> GSM386428 2 0.0000 0.999 0.000 1.000 0.000
#> GSM386429 2 0.0000 0.999 0.000 1.000 0.000
#> GSM386430 2 0.0000 0.999 0.000 1.000 0.000
#> GSM386431 2 0.0592 0.987 0.012 0.988 0.000
#> GSM386432 2 0.0000 0.999 0.000 1.000 0.000
#> GSM386433 3 0.0237 0.932 0.000 0.004 0.996
#> GSM386434 3 0.0237 0.932 0.000 0.004 0.996
#> GSM386422 3 0.0000 0.933 0.000 0.000 1.000
#> GSM386423 3 0.6126 0.402 0.400 0.000 0.600
#> GSM386424 3 0.0000 0.933 0.000 0.000 1.000
#> GSM386425 3 0.0000 0.933 0.000 0.000 1.000
#> GSM386385 1 0.0237 0.995 0.996 0.004 0.000
#> GSM386386 1 0.0000 1.000 1.000 0.000 0.000
#> GSM386387 2 0.0000 0.999 0.000 1.000 0.000
#> GSM386391 2 0.0000 0.999 0.000 1.000 0.000
#> GSM386392 1 0.0000 1.000 1.000 0.000 0.000
#> GSM386393 2 0.0000 0.999 0.000 1.000 0.000
#> GSM386394 1 0.0000 1.000 1.000 0.000 0.000
#> GSM386395 2 0.0000 0.999 0.000 1.000 0.000
#> GSM386396 3 0.0237 0.932 0.000 0.004 0.996
#> GSM386397 3 0.0237 0.932 0.000 0.004 0.996
#> GSM386388 3 0.0000 0.933 0.000 0.000 1.000
#> GSM386389 3 0.6126 0.402 0.400 0.000 0.600
#> GSM386390 3 0.0000 0.933 0.000 0.000 1.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM386435 2 0.000 0.982 0.000 1.000 0.00 0.000
#> GSM386436 2 0.000 0.982 0.000 1.000 0.00 0.000
#> GSM386437 2 0.000 0.982 0.000 1.000 0.00 0.000
#> GSM386438 2 0.000 0.982 0.000 1.000 0.00 0.000
#> GSM386439 1 0.000 0.985 1.000 0.000 0.00 0.000
#> GSM386440 2 0.000 0.982 0.000 1.000 0.00 0.000
#> GSM386441 2 0.000 0.982 0.000 1.000 0.00 0.000
#> GSM386442 2 0.000 0.982 0.000 1.000 0.00 0.000
#> GSM386447 1 0.000 0.985 1.000 0.000 0.00 0.000
#> GSM386448 2 0.000 0.982 0.000 1.000 0.00 0.000
#> GSM386449 2 0.000 0.982 0.000 1.000 0.00 0.000
#> GSM386450 2 0.000 0.982 0.000 1.000 0.00 0.000
#> GSM386451 2 0.164 0.943 0.000 0.940 0.00 0.060
#> GSM386452 1 0.000 0.985 1.000 0.000 0.00 0.000
#> GSM386453 2 0.164 0.943 0.000 0.940 0.00 0.060
#> GSM386454 1 0.000 0.985 1.000 0.000 0.00 0.000
#> GSM386455 2 0.164 0.943 0.000 0.940 0.00 0.060
#> GSM386456 2 0.164 0.943 0.000 0.940 0.00 0.060
#> GSM386457 2 0.164 0.943 0.000 0.940 0.00 0.060
#> GSM386458 1 0.000 0.985 1.000 0.000 0.00 0.000
#> GSM386443 1 0.000 0.985 1.000 0.000 0.00 0.000
#> GSM386444 3 0.000 0.974 0.000 0.000 1.00 0.000
#> GSM386445 3 0.000 0.974 0.000 0.000 1.00 0.000
#> GSM386446 3 0.000 0.974 0.000 0.000 1.00 0.000
#> GSM386398 1 0.000 0.985 1.000 0.000 0.00 0.000
#> GSM386399 1 0.000 0.985 1.000 0.000 0.00 0.000
#> GSM386400 1 0.000 0.985 1.000 0.000 0.00 0.000
#> GSM386401 2 0.000 0.982 0.000 1.000 0.00 0.000
#> GSM386406 2 0.000 0.982 0.000 1.000 0.00 0.000
#> GSM386407 4 0.000 1.000 0.000 0.000 0.00 1.000
#> GSM386408 2 0.000 0.982 0.000 1.000 0.00 0.000
#> GSM386409 1 0.000 0.985 1.000 0.000 0.00 0.000
#> GSM386410 1 0.000 0.985 1.000 0.000 0.00 0.000
#> GSM386411 4 0.000 1.000 0.000 0.000 0.00 1.000
#> GSM386412 1 0.401 0.678 0.756 0.000 0.00 0.244
#> GSM386413 4 0.000 1.000 0.000 0.000 0.00 1.000
#> GSM386414 4 0.000 1.000 0.000 0.000 0.00 1.000
#> GSM386415 4 0.000 1.000 0.000 0.000 0.00 1.000
#> GSM386416 1 0.000 0.985 1.000 0.000 0.00 0.000
#> GSM386417 4 0.000 1.000 0.000 0.000 0.00 1.000
#> GSM386402 3 0.000 0.974 0.000 0.000 1.00 0.000
#> GSM386403 3 0.000 0.974 0.000 0.000 1.00 0.000
#> GSM386404 3 0.000 0.974 0.000 0.000 1.00 0.000
#> GSM386405 3 0.000 0.974 0.000 0.000 1.00 0.000
#> GSM386418 2 0.000 0.982 0.000 1.000 0.00 0.000
#> GSM386419 2 0.000 0.982 0.000 1.000 0.00 0.000
#> GSM386420 2 0.000 0.982 0.000 1.000 0.00 0.000
#> GSM386421 2 0.000 0.982 0.000 1.000 0.00 0.000
#> GSM386426 1 0.000 0.985 1.000 0.000 0.00 0.000
#> GSM386427 1 0.000 0.985 1.000 0.000 0.00 0.000
#> GSM386428 2 0.000 0.982 0.000 1.000 0.00 0.000
#> GSM386429 4 0.000 1.000 0.000 0.000 0.00 1.000
#> GSM386430 4 0.000 1.000 0.000 0.000 0.00 1.000
#> GSM386431 4 0.000 1.000 0.000 0.000 0.00 1.000
#> GSM386432 4 0.000 1.000 0.000 0.000 0.00 1.000
#> GSM386433 4 0.000 1.000 0.000 0.000 0.00 1.000
#> GSM386434 4 0.000 1.000 0.000 0.000 0.00 1.000
#> GSM386422 3 0.000 0.974 0.000 0.000 1.00 0.000
#> GSM386423 3 0.317 0.821 0.160 0.000 0.84 0.000
#> GSM386424 3 0.000 0.974 0.000 0.000 1.00 0.000
#> GSM386425 3 0.000 0.974 0.000 0.000 1.00 0.000
#> GSM386385 2 0.281 0.845 0.132 0.868 0.00 0.000
#> GSM386386 1 0.000 0.985 1.000 0.000 0.00 0.000
#> GSM386387 2 0.000 0.982 0.000 1.000 0.00 0.000
#> GSM386391 2 0.000 0.982 0.000 1.000 0.00 0.000
#> GSM386392 1 0.000 0.985 1.000 0.000 0.00 0.000
#> GSM386393 4 0.000 1.000 0.000 0.000 0.00 1.000
#> GSM386394 1 0.000 0.985 1.000 0.000 0.00 0.000
#> GSM386395 4 0.000 1.000 0.000 0.000 0.00 1.000
#> GSM386396 4 0.000 1.000 0.000 0.000 0.00 1.000
#> GSM386397 4 0.000 1.000 0.000 0.000 0.00 1.000
#> GSM386388 3 0.000 0.974 0.000 0.000 1.00 0.000
#> GSM386389 3 0.317 0.821 0.160 0.000 0.84 0.000
#> GSM386390 3 0.000 0.974 0.000 0.000 1.00 0.000
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM386435 2 0.1270 0.975 0.000 0.948 0.000 0.000 0.052
#> GSM386436 2 0.1270 0.975 0.000 0.948 0.000 0.000 0.052
#> GSM386437 2 0.1270 0.975 0.000 0.948 0.000 0.000 0.052
#> GSM386438 2 0.1270 0.975 0.000 0.948 0.000 0.000 0.052
#> GSM386439 1 0.0000 0.986 1.000 0.000 0.000 0.000 0.000
#> GSM386440 2 0.1270 0.975 0.000 0.948 0.000 0.000 0.052
#> GSM386441 2 0.1270 0.975 0.000 0.948 0.000 0.000 0.052
#> GSM386442 2 0.1270 0.975 0.000 0.948 0.000 0.000 0.052
#> GSM386447 1 0.0000 0.986 1.000 0.000 0.000 0.000 0.000
#> GSM386448 2 0.1270 0.975 0.000 0.948 0.000 0.000 0.052
#> GSM386449 2 0.1270 0.975 0.000 0.948 0.000 0.000 0.052
#> GSM386450 2 0.1270 0.975 0.000 0.948 0.000 0.000 0.052
#> GSM386451 5 0.0000 0.941 0.000 0.000 0.000 0.000 1.000
#> GSM386452 1 0.0000 0.986 1.000 0.000 0.000 0.000 0.000
#> GSM386453 5 0.0000 0.941 0.000 0.000 0.000 0.000 1.000
#> GSM386454 1 0.0000 0.986 1.000 0.000 0.000 0.000 0.000
#> GSM386455 5 0.0000 0.941 0.000 0.000 0.000 0.000 1.000
#> GSM386456 5 0.0000 0.941 0.000 0.000 0.000 0.000 1.000
#> GSM386457 5 0.0000 0.941 0.000 0.000 0.000 0.000 1.000
#> GSM386458 1 0.0000 0.986 1.000 0.000 0.000 0.000 0.000
#> GSM386443 1 0.0000 0.986 1.000 0.000 0.000 0.000 0.000
#> GSM386444 3 0.0000 0.967 0.000 0.000 1.000 0.000 0.000
#> GSM386445 3 0.0000 0.967 0.000 0.000 1.000 0.000 0.000
#> GSM386446 3 0.0000 0.967 0.000 0.000 1.000 0.000 0.000
#> GSM386398 1 0.0000 0.986 1.000 0.000 0.000 0.000 0.000
#> GSM386399 1 0.0000 0.986 1.000 0.000 0.000 0.000 0.000
#> GSM386400 1 0.0000 0.986 1.000 0.000 0.000 0.000 0.000
#> GSM386401 2 0.1270 0.975 0.000 0.948 0.000 0.000 0.052
#> GSM386406 2 0.0000 0.972 0.000 1.000 0.000 0.000 0.000
#> GSM386407 4 0.0000 0.970 0.000 0.000 0.000 1.000 0.000
#> GSM386408 2 0.0000 0.972 0.000 1.000 0.000 0.000 0.000
#> GSM386409 1 0.0000 0.986 1.000 0.000 0.000 0.000 0.000
#> GSM386410 1 0.0000 0.986 1.000 0.000 0.000 0.000 0.000
#> GSM386411 5 0.2074 0.912 0.000 0.000 0.000 0.104 0.896
#> GSM386412 1 0.3242 0.714 0.784 0.000 0.000 0.216 0.000
#> GSM386413 5 0.1965 0.918 0.000 0.000 0.000 0.096 0.904
#> GSM386414 5 0.3305 0.769 0.000 0.000 0.000 0.224 0.776
#> GSM386415 5 0.1341 0.939 0.000 0.000 0.000 0.056 0.944
#> GSM386416 1 0.0000 0.986 1.000 0.000 0.000 0.000 0.000
#> GSM386417 5 0.0609 0.943 0.000 0.000 0.000 0.020 0.980
#> GSM386402 3 0.0000 0.967 0.000 0.000 1.000 0.000 0.000
#> GSM386403 3 0.0000 0.967 0.000 0.000 1.000 0.000 0.000
#> GSM386404 3 0.0000 0.967 0.000 0.000 1.000 0.000 0.000
#> GSM386405 3 0.0000 0.967 0.000 0.000 1.000 0.000 0.000
#> GSM386418 2 0.0000 0.972 0.000 1.000 0.000 0.000 0.000
#> GSM386419 2 0.0000 0.972 0.000 1.000 0.000 0.000 0.000
#> GSM386420 2 0.0000 0.972 0.000 1.000 0.000 0.000 0.000
#> GSM386421 2 0.0000 0.972 0.000 1.000 0.000 0.000 0.000
#> GSM386426 1 0.0000 0.986 1.000 0.000 0.000 0.000 0.000
#> GSM386427 1 0.0000 0.986 1.000 0.000 0.000 0.000 0.000
#> GSM386428 2 0.0000 0.972 0.000 1.000 0.000 0.000 0.000
#> GSM386429 4 0.0000 0.970 0.000 0.000 0.000 1.000 0.000
#> GSM386430 4 0.0000 0.970 0.000 0.000 0.000 1.000 0.000
#> GSM386431 4 0.0000 0.970 0.000 0.000 0.000 1.000 0.000
#> GSM386432 4 0.0000 0.970 0.000 0.000 0.000 1.000 0.000
#> GSM386433 5 0.1341 0.939 0.000 0.000 0.000 0.056 0.944
#> GSM386434 5 0.1341 0.939 0.000 0.000 0.000 0.056 0.944
#> GSM386422 3 0.0000 0.967 0.000 0.000 1.000 0.000 0.000
#> GSM386423 3 0.2966 0.783 0.184 0.000 0.816 0.000 0.000
#> GSM386424 3 0.0000 0.967 0.000 0.000 1.000 0.000 0.000
#> GSM386425 3 0.0000 0.967 0.000 0.000 1.000 0.000 0.000
#> GSM386385 2 0.0290 0.968 0.008 0.992 0.000 0.000 0.000
#> GSM386386 1 0.0000 0.986 1.000 0.000 0.000 0.000 0.000
#> GSM386387 2 0.0000 0.972 0.000 1.000 0.000 0.000 0.000
#> GSM386391 2 0.0000 0.972 0.000 1.000 0.000 0.000 0.000
#> GSM386392 1 0.0000 0.986 1.000 0.000 0.000 0.000 0.000
#> GSM386393 4 0.0000 0.970 0.000 0.000 0.000 1.000 0.000
#> GSM386394 4 0.3242 0.704 0.216 0.000 0.000 0.784 0.000
#> GSM386395 4 0.0000 0.970 0.000 0.000 0.000 1.000 0.000
#> GSM386396 4 0.0000 0.970 0.000 0.000 0.000 1.000 0.000
#> GSM386397 4 0.0000 0.970 0.000 0.000 0.000 1.000 0.000
#> GSM386388 3 0.0000 0.967 0.000 0.000 1.000 0.000 0.000
#> GSM386389 3 0.2966 0.783 0.184 0.000 0.816 0.000 0.000
#> GSM386390 3 0.0000 0.967 0.000 0.000 1.000 0.000 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM386435 2 0.3383 0.8689 0.000 0.728 0.000 0.000 NA 0.004
#> GSM386436 2 0.3383 0.8689 0.000 0.728 0.000 0.000 NA 0.004
#> GSM386437 2 0.3383 0.8689 0.000 0.728 0.000 0.000 NA 0.004
#> GSM386438 2 0.3383 0.8689 0.000 0.728 0.000 0.000 NA 0.004
#> GSM386439 1 0.3737 0.7274 0.608 0.000 0.000 0.000 NA 0.000
#> GSM386440 2 0.3405 0.8678 0.000 0.724 0.000 0.000 NA 0.004
#> GSM386441 2 0.3405 0.8678 0.000 0.724 0.000 0.000 NA 0.004
#> GSM386442 2 0.3383 0.8689 0.000 0.728 0.000 0.000 NA 0.004
#> GSM386447 1 0.3330 0.7450 0.716 0.000 0.000 0.000 NA 0.000
#> GSM386448 2 0.3405 0.8678 0.000 0.724 0.000 0.000 NA 0.004
#> GSM386449 2 0.3405 0.8678 0.000 0.724 0.000 0.000 NA 0.004
#> GSM386450 2 0.3405 0.8678 0.000 0.724 0.000 0.000 NA 0.004
#> GSM386451 6 0.0790 0.8680 0.000 0.000 0.000 0.000 NA 0.968
#> GSM386452 1 0.0146 0.7759 0.996 0.000 0.000 0.000 NA 0.000
#> GSM386453 6 0.0790 0.8680 0.000 0.000 0.000 0.000 NA 0.968
#> GSM386454 1 0.1556 0.7709 0.920 0.000 0.000 0.000 NA 0.000
#> GSM386455 6 0.0865 0.8676 0.000 0.000 0.000 0.000 NA 0.964
#> GSM386456 6 0.0865 0.8676 0.000 0.000 0.000 0.000 NA 0.964
#> GSM386457 6 0.0865 0.8676 0.000 0.000 0.000 0.000 NA 0.964
#> GSM386458 1 0.3445 0.7012 0.732 0.000 0.000 0.000 NA 0.008
#> GSM386443 1 0.3198 0.6961 0.740 0.000 0.000 0.000 NA 0.000
#> GSM386444 3 0.0146 0.9178 0.000 0.000 0.996 0.000 NA 0.000
#> GSM386445 3 0.0146 0.9178 0.000 0.000 0.996 0.000 NA 0.000
#> GSM386446 3 0.0146 0.9178 0.000 0.000 0.996 0.000 NA 0.000
#> GSM386398 1 0.3659 0.7383 0.636 0.000 0.000 0.000 NA 0.000
#> GSM386399 1 0.3727 0.7283 0.612 0.000 0.000 0.000 NA 0.000
#> GSM386400 1 0.3695 0.7332 0.624 0.000 0.000 0.000 NA 0.000
#> GSM386401 2 0.3383 0.8689 0.000 0.728 0.000 0.000 NA 0.004
#> GSM386406 2 0.0000 0.8278 0.000 1.000 0.000 0.000 NA 0.000
#> GSM386407 4 0.1408 0.9457 0.000 0.000 0.000 0.944 NA 0.020
#> GSM386408 2 0.2762 0.8611 0.000 0.804 0.000 0.000 NA 0.000
#> GSM386409 1 0.0146 0.7773 0.996 0.000 0.000 0.000 NA 0.000
#> GSM386410 1 0.0146 0.7763 0.996 0.000 0.000 0.000 NA 0.000
#> GSM386411 6 0.4269 0.5644 0.000 0.000 0.000 0.316 NA 0.648
#> GSM386412 1 0.4573 0.6164 0.688 0.000 0.000 0.104 NA 0.000
#> GSM386413 6 0.4183 0.5970 0.000 0.000 0.000 0.296 NA 0.668
#> GSM386414 6 0.5545 0.5926 0.012 0.000 0.000 0.124 NA 0.568
#> GSM386415 6 0.2358 0.8471 0.000 0.000 0.000 0.016 NA 0.876
#> GSM386416 1 0.3592 0.6376 0.656 0.000 0.000 0.000 NA 0.000
#> GSM386417 6 0.0000 0.8644 0.000 0.000 0.000 0.000 NA 1.000
#> GSM386402 3 0.0000 0.9191 0.000 0.000 1.000 0.000 NA 0.000
#> GSM386403 3 0.0260 0.9159 0.000 0.000 0.992 0.000 NA 0.000
#> GSM386404 3 0.0260 0.9159 0.000 0.000 0.992 0.000 NA 0.000
#> GSM386405 3 0.0000 0.9191 0.000 0.000 1.000 0.000 NA 0.000
#> GSM386418 2 0.0000 0.8278 0.000 1.000 0.000 0.000 NA 0.000
#> GSM386419 2 0.0000 0.8278 0.000 1.000 0.000 0.000 NA 0.000
#> GSM386420 2 0.0000 0.8278 0.000 1.000 0.000 0.000 NA 0.000
#> GSM386421 2 0.0000 0.8278 0.000 1.000 0.000 0.000 NA 0.000
#> GSM386426 1 0.3482 0.7317 0.684 0.000 0.000 0.000 NA 0.000
#> GSM386427 1 0.0146 0.7763 0.996 0.000 0.000 0.000 NA 0.000
#> GSM386428 2 0.0000 0.8278 0.000 1.000 0.000 0.000 NA 0.000
#> GSM386429 4 0.0000 0.9823 0.000 0.000 0.000 1.000 NA 0.000
#> GSM386430 4 0.0000 0.9823 0.000 0.000 0.000 1.000 NA 0.000
#> GSM386431 4 0.0000 0.9823 0.000 0.000 0.000 1.000 NA 0.000
#> GSM386432 4 0.1408 0.9457 0.000 0.000 0.000 0.944 NA 0.020
#> GSM386433 6 0.2266 0.8480 0.000 0.000 0.000 0.012 NA 0.880
#> GSM386434 6 0.2358 0.8471 0.000 0.000 0.000 0.016 NA 0.876
#> GSM386422 3 0.0000 0.9191 0.000 0.000 1.000 0.000 NA 0.000
#> GSM386423 3 0.5763 0.2691 0.332 0.000 0.480 0.000 NA 0.000
#> GSM386424 3 0.0000 0.9191 0.000 0.000 1.000 0.000 NA 0.000
#> GSM386425 3 0.0000 0.9191 0.000 0.000 1.000 0.000 NA 0.000
#> GSM386385 2 0.4703 0.3155 0.068 0.620 0.000 0.000 NA 0.000
#> GSM386386 1 0.0713 0.7778 0.972 0.000 0.000 0.000 NA 0.000
#> GSM386387 2 0.0000 0.8278 0.000 1.000 0.000 0.000 NA 0.000
#> GSM386391 2 0.0363 0.8214 0.000 0.988 0.000 0.000 NA 0.000
#> GSM386392 1 0.3482 0.7317 0.684 0.000 0.000 0.000 NA 0.000
#> GSM386393 4 0.0363 0.9764 0.000 0.000 0.000 0.988 NA 0.000
#> GSM386394 1 0.4337 -0.0606 0.500 0.000 0.000 0.480 NA 0.000
#> GSM386395 4 0.0363 0.9764 0.000 0.000 0.000 0.988 NA 0.000
#> GSM386396 4 0.0000 0.9823 0.000 0.000 0.000 1.000 NA 0.000
#> GSM386397 4 0.0000 0.9823 0.000 0.000 0.000 1.000 NA 0.000
#> GSM386388 3 0.0000 0.9191 0.000 0.000 1.000 0.000 NA 0.000
#> GSM386389 3 0.5763 0.2691 0.332 0.000 0.480 0.000 NA 0.000
#> GSM386390 3 0.0000 0.9191 0.000 0.000 1.000 0.000 NA 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 agent(p) dose(p) time(p) k
#> SD:skmeans 61 0.27866 0.2075 3.06e-02 2
#> SD:skmeans 72 0.12144 0.2488 2.30e-08 3
#> SD:skmeans 74 0.00329 0.0267 7.47e-15 4
#> SD:skmeans 74 0.02952 0.0443 5.27e-19 5
#> SD:skmeans 70 0.03895 0.0695 3.83e-17 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 51941 rows and 74 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'SD' method.
#> Subgroups are detected by 'pam' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 3.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
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.522 0.906 0.927 0.3376 0.672 0.672
#> 3 3 1.000 0.979 0.992 0.6856 0.745 0.624
#> 4 4 0.877 0.873 0.949 0.3084 0.818 0.582
#> 5 5 0.899 0.873 0.952 0.0199 0.985 0.943
#> 6 6 0.878 0.870 0.889 0.0568 0.900 0.623
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
#> GSM386435 1 0.000 0.936 1.000 0.000
#> GSM386436 1 0.000 0.936 1.000 0.000
#> GSM386437 1 0.000 0.936 1.000 0.000
#> GSM386438 1 0.000 0.936 1.000 0.000
#> GSM386439 1 0.722 0.805 0.800 0.200
#> GSM386440 1 0.000 0.936 1.000 0.000
#> GSM386441 1 0.000 0.936 1.000 0.000
#> GSM386442 1 0.000 0.936 1.000 0.000
#> GSM386447 1 0.118 0.927 0.984 0.016
#> GSM386448 1 0.000 0.936 1.000 0.000
#> GSM386449 1 0.000 0.936 1.000 0.000
#> GSM386450 1 0.000 0.936 1.000 0.000
#> GSM386451 1 0.000 0.936 1.000 0.000
#> GSM386452 1 0.722 0.805 0.800 0.200
#> GSM386453 1 0.000 0.936 1.000 0.000
#> GSM386454 1 0.722 0.805 0.800 0.200
#> GSM386455 1 0.000 0.936 1.000 0.000
#> GSM386456 1 0.000 0.936 1.000 0.000
#> GSM386457 1 0.000 0.936 1.000 0.000
#> GSM386458 1 0.722 0.805 0.800 0.200
#> GSM386443 2 0.000 0.800 0.000 1.000
#> GSM386444 2 0.722 0.946 0.200 0.800
#> GSM386445 2 0.722 0.946 0.200 0.800
#> GSM386446 2 0.722 0.946 0.200 0.800
#> GSM386398 1 0.722 0.805 0.800 0.200
#> GSM386399 1 0.722 0.805 0.800 0.200
#> GSM386400 1 0.722 0.805 0.800 0.200
#> GSM386401 1 0.000 0.936 1.000 0.000
#> GSM386406 1 0.000 0.936 1.000 0.000
#> GSM386407 1 0.000 0.936 1.000 0.000
#> GSM386408 1 0.000 0.936 1.000 0.000
#> GSM386409 1 0.722 0.805 0.800 0.200
#> GSM386410 1 0.722 0.805 0.800 0.200
#> GSM386411 1 0.000 0.936 1.000 0.000
#> GSM386412 1 0.000 0.936 1.000 0.000
#> GSM386413 1 0.000 0.936 1.000 0.000
#> GSM386414 1 0.000 0.936 1.000 0.000
#> GSM386415 1 0.000 0.936 1.000 0.000
#> GSM386416 1 0.722 0.805 0.800 0.200
#> GSM386417 1 0.000 0.936 1.000 0.000
#> GSM386402 2 0.722 0.946 0.200 0.800
#> GSM386403 2 0.722 0.946 0.200 0.800
#> GSM386404 2 0.722 0.946 0.200 0.800
#> GSM386405 2 0.722 0.946 0.200 0.800
#> GSM386418 1 0.000 0.936 1.000 0.000
#> GSM386419 1 0.000 0.936 1.000 0.000
#> GSM386420 1 0.000 0.936 1.000 0.000
#> GSM386421 1 0.000 0.936 1.000 0.000
#> GSM386426 1 0.722 0.805 0.800 0.200
#> GSM386427 1 0.722 0.805 0.800 0.200
#> GSM386428 1 0.000 0.936 1.000 0.000
#> GSM386429 1 0.000 0.936 1.000 0.000
#> GSM386430 1 0.000 0.936 1.000 0.000
#> GSM386431 1 0.000 0.936 1.000 0.000
#> GSM386432 1 0.000 0.936 1.000 0.000
#> GSM386433 1 0.000 0.936 1.000 0.000
#> GSM386434 1 0.000 0.936 1.000 0.000
#> GSM386422 2 0.722 0.946 0.200 0.800
#> GSM386423 2 0.000 0.800 0.000 1.000
#> GSM386424 2 0.722 0.946 0.200 0.800
#> GSM386425 2 0.722 0.946 0.200 0.800
#> GSM386385 1 0.000 0.936 1.000 0.000
#> GSM386386 1 0.722 0.805 0.800 0.200
#> GSM386387 1 0.000 0.936 1.000 0.000
#> GSM386391 1 0.000 0.936 1.000 0.000
#> GSM386392 1 0.722 0.805 0.800 0.200
#> GSM386393 1 0.000 0.936 1.000 0.000
#> GSM386394 1 0.722 0.805 0.800 0.200
#> GSM386395 1 0.000 0.936 1.000 0.000
#> GSM386396 1 0.000 0.936 1.000 0.000
#> GSM386397 1 0.000 0.936 1.000 0.000
#> GSM386388 2 0.722 0.946 0.200 0.800
#> GSM386389 2 0.000 0.800 0.000 1.000
#> GSM386390 2 0.722 0.946 0.200 0.800
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM386435 2 0.000 1.000 0.000 1.000 0.000
#> GSM386436 2 0.000 1.000 0.000 1.000 0.000
#> GSM386437 2 0.000 1.000 0.000 1.000 0.000
#> GSM386438 2 0.000 1.000 0.000 1.000 0.000
#> GSM386439 1 0.489 0.637 0.772 0.228 0.000
#> GSM386440 2 0.000 1.000 0.000 1.000 0.000
#> GSM386441 2 0.000 1.000 0.000 1.000 0.000
#> GSM386442 2 0.000 1.000 0.000 1.000 0.000
#> GSM386447 2 0.000 1.000 0.000 1.000 0.000
#> GSM386448 2 0.000 1.000 0.000 1.000 0.000
#> GSM386449 2 0.000 1.000 0.000 1.000 0.000
#> GSM386450 2 0.000 1.000 0.000 1.000 0.000
#> GSM386451 2 0.000 1.000 0.000 1.000 0.000
#> GSM386452 1 0.000 0.977 1.000 0.000 0.000
#> GSM386453 2 0.000 1.000 0.000 1.000 0.000
#> GSM386454 1 0.000 0.977 1.000 0.000 0.000
#> GSM386455 2 0.000 1.000 0.000 1.000 0.000
#> GSM386456 2 0.000 1.000 0.000 1.000 0.000
#> GSM386457 2 0.000 1.000 0.000 1.000 0.000
#> GSM386458 1 0.000 0.977 1.000 0.000 0.000
#> GSM386443 1 0.000 0.977 1.000 0.000 0.000
#> GSM386444 3 0.000 0.969 0.000 0.000 1.000
#> GSM386445 3 0.000 0.969 0.000 0.000 1.000
#> GSM386446 3 0.000 0.969 0.000 0.000 1.000
#> GSM386398 1 0.000 0.977 1.000 0.000 0.000
#> GSM386399 1 0.000 0.977 1.000 0.000 0.000
#> GSM386400 1 0.000 0.977 1.000 0.000 0.000
#> GSM386401 2 0.000 1.000 0.000 1.000 0.000
#> GSM386406 2 0.000 1.000 0.000 1.000 0.000
#> GSM386407 2 0.000 1.000 0.000 1.000 0.000
#> GSM386408 2 0.000 1.000 0.000 1.000 0.000
#> GSM386409 1 0.000 0.977 1.000 0.000 0.000
#> GSM386410 1 0.000 0.977 1.000 0.000 0.000
#> GSM386411 2 0.000 1.000 0.000 1.000 0.000
#> GSM386412 2 0.000 1.000 0.000 1.000 0.000
#> GSM386413 2 0.000 1.000 0.000 1.000 0.000
#> GSM386414 2 0.000 1.000 0.000 1.000 0.000
#> GSM386415 2 0.000 1.000 0.000 1.000 0.000
#> GSM386416 1 0.000 0.977 1.000 0.000 0.000
#> GSM386417 2 0.000 1.000 0.000 1.000 0.000
#> GSM386402 3 0.000 0.969 0.000 0.000 1.000
#> GSM386403 3 0.000 0.969 0.000 0.000 1.000
#> GSM386404 3 0.000 0.969 0.000 0.000 1.000
#> GSM386405 3 0.000 0.969 0.000 0.000 1.000
#> GSM386418 2 0.000 1.000 0.000 1.000 0.000
#> GSM386419 2 0.000 1.000 0.000 1.000 0.000
#> GSM386420 2 0.000 1.000 0.000 1.000 0.000
#> GSM386421 2 0.000 1.000 0.000 1.000 0.000
#> GSM386426 1 0.000 0.977 1.000 0.000 0.000
#> GSM386427 1 0.000 0.977 1.000 0.000 0.000
#> GSM386428 2 0.000 1.000 0.000 1.000 0.000
#> GSM386429 2 0.000 1.000 0.000 1.000 0.000
#> GSM386430 2 0.000 1.000 0.000 1.000 0.000
#> GSM386431 2 0.000 1.000 0.000 1.000 0.000
#> GSM386432 2 0.000 1.000 0.000 1.000 0.000
#> GSM386433 2 0.000 1.000 0.000 1.000 0.000
#> GSM386434 2 0.000 1.000 0.000 1.000 0.000
#> GSM386422 3 0.000 0.969 0.000 0.000 1.000
#> GSM386423 3 0.450 0.772 0.196 0.000 0.804
#> GSM386424 3 0.000 0.969 0.000 0.000 1.000
#> GSM386425 3 0.000 0.969 0.000 0.000 1.000
#> GSM386385 2 0.000 1.000 0.000 1.000 0.000
#> GSM386386 1 0.000 0.977 1.000 0.000 0.000
#> GSM386387 2 0.000 1.000 0.000 1.000 0.000
#> GSM386391 2 0.000 1.000 0.000 1.000 0.000
#> GSM386392 1 0.000 0.977 1.000 0.000 0.000
#> GSM386393 2 0.000 1.000 0.000 1.000 0.000
#> GSM386394 1 0.000 0.977 1.000 0.000 0.000
#> GSM386395 2 0.000 1.000 0.000 1.000 0.000
#> GSM386396 2 0.000 1.000 0.000 1.000 0.000
#> GSM386397 2 0.000 1.000 0.000 1.000 0.000
#> GSM386388 3 0.000 0.969 0.000 0.000 1.000
#> GSM386389 3 0.450 0.772 0.196 0.000 0.804
#> GSM386390 3 0.000 0.969 0.000 0.000 1.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM386435 2 0.0000 0.8792 0.000 1.000 0.000 0.000
#> GSM386436 2 0.0000 0.8792 0.000 1.000 0.000 0.000
#> GSM386437 2 0.0000 0.8792 0.000 1.000 0.000 0.000
#> GSM386438 2 0.0000 0.8792 0.000 1.000 0.000 0.000
#> GSM386439 1 0.3688 0.7085 0.792 0.208 0.000 0.000
#> GSM386440 2 0.0000 0.8792 0.000 1.000 0.000 0.000
#> GSM386441 2 0.0000 0.8792 0.000 1.000 0.000 0.000
#> GSM386442 2 0.0000 0.8792 0.000 1.000 0.000 0.000
#> GSM386447 2 0.4994 0.0908 0.480 0.520 0.000 0.000
#> GSM386448 2 0.0000 0.8792 0.000 1.000 0.000 0.000
#> GSM386449 2 0.0000 0.8792 0.000 1.000 0.000 0.000
#> GSM386450 2 0.0000 0.8792 0.000 1.000 0.000 0.000
#> GSM386451 2 0.4994 0.2364 0.000 0.520 0.000 0.480
#> GSM386452 1 0.0000 0.9812 1.000 0.000 0.000 0.000
#> GSM386453 2 0.4994 0.2364 0.000 0.520 0.000 0.480
#> GSM386454 1 0.0000 0.9812 1.000 0.000 0.000 0.000
#> GSM386455 2 0.4994 0.2364 0.000 0.520 0.000 0.480
#> GSM386456 2 0.4994 0.2364 0.000 0.520 0.000 0.480
#> GSM386457 2 0.4994 0.2364 0.000 0.520 0.000 0.480
#> GSM386458 1 0.0000 0.9812 1.000 0.000 0.000 0.000
#> GSM386443 1 0.0000 0.9812 1.000 0.000 0.000 0.000
#> GSM386444 3 0.0000 0.9680 0.000 0.000 1.000 0.000
#> GSM386445 3 0.0000 0.9680 0.000 0.000 1.000 0.000
#> GSM386446 3 0.0000 0.9680 0.000 0.000 1.000 0.000
#> GSM386398 1 0.0000 0.9812 1.000 0.000 0.000 0.000
#> GSM386399 1 0.0000 0.9812 1.000 0.000 0.000 0.000
#> GSM386400 1 0.0000 0.9812 1.000 0.000 0.000 0.000
#> GSM386401 2 0.0000 0.8792 0.000 1.000 0.000 0.000
#> GSM386406 2 0.0000 0.8792 0.000 1.000 0.000 0.000
#> GSM386407 4 0.0000 0.9822 0.000 0.000 0.000 1.000
#> GSM386408 2 0.0000 0.8792 0.000 1.000 0.000 0.000
#> GSM386409 1 0.0000 0.9812 1.000 0.000 0.000 0.000
#> GSM386410 1 0.0000 0.9812 1.000 0.000 0.000 0.000
#> GSM386411 4 0.0000 0.9822 0.000 0.000 0.000 1.000
#> GSM386412 4 0.0000 0.9822 0.000 0.000 0.000 1.000
#> GSM386413 4 0.0000 0.9822 0.000 0.000 0.000 1.000
#> GSM386414 4 0.0000 0.9822 0.000 0.000 0.000 1.000
#> GSM386415 4 0.0000 0.9822 0.000 0.000 0.000 1.000
#> GSM386416 4 0.4164 0.6030 0.264 0.000 0.000 0.736
#> GSM386417 4 0.0188 0.9780 0.000 0.004 0.000 0.996
#> GSM386402 3 0.0000 0.9680 0.000 0.000 1.000 0.000
#> GSM386403 3 0.0000 0.9680 0.000 0.000 1.000 0.000
#> GSM386404 3 0.0000 0.9680 0.000 0.000 1.000 0.000
#> GSM386405 3 0.0000 0.9680 0.000 0.000 1.000 0.000
#> GSM386418 2 0.0000 0.8792 0.000 1.000 0.000 0.000
#> GSM386419 2 0.0000 0.8792 0.000 1.000 0.000 0.000
#> GSM386420 2 0.0000 0.8792 0.000 1.000 0.000 0.000
#> GSM386421 2 0.0000 0.8792 0.000 1.000 0.000 0.000
#> GSM386426 1 0.0000 0.9812 1.000 0.000 0.000 0.000
#> GSM386427 1 0.0000 0.9812 1.000 0.000 0.000 0.000
#> GSM386428 2 0.0000 0.8792 0.000 1.000 0.000 0.000
#> GSM386429 4 0.0000 0.9822 0.000 0.000 0.000 1.000
#> GSM386430 4 0.0000 0.9822 0.000 0.000 0.000 1.000
#> GSM386431 4 0.0000 0.9822 0.000 0.000 0.000 1.000
#> GSM386432 4 0.0000 0.9822 0.000 0.000 0.000 1.000
#> GSM386433 4 0.0000 0.9822 0.000 0.000 0.000 1.000
#> GSM386434 4 0.0000 0.9822 0.000 0.000 0.000 1.000
#> GSM386422 3 0.0000 0.9680 0.000 0.000 1.000 0.000
#> GSM386423 3 0.3569 0.7653 0.196 0.000 0.804 0.000
#> GSM386424 3 0.0000 0.9680 0.000 0.000 1.000 0.000
#> GSM386425 3 0.0000 0.9680 0.000 0.000 1.000 0.000
#> GSM386385 2 0.0000 0.8792 0.000 1.000 0.000 0.000
#> GSM386386 1 0.0000 0.9812 1.000 0.000 0.000 0.000
#> GSM386387 2 0.0000 0.8792 0.000 1.000 0.000 0.000
#> GSM386391 2 0.0000 0.8792 0.000 1.000 0.000 0.000
#> GSM386392 1 0.0000 0.9812 1.000 0.000 0.000 0.000
#> GSM386393 4 0.0000 0.9822 0.000 0.000 0.000 1.000
#> GSM386394 1 0.0000 0.9812 1.000 0.000 0.000 0.000
#> GSM386395 4 0.0000 0.9822 0.000 0.000 0.000 1.000
#> GSM386396 4 0.0000 0.9822 0.000 0.000 0.000 1.000
#> GSM386397 4 0.0000 0.9822 0.000 0.000 0.000 1.000
#> GSM386388 3 0.0000 0.9680 0.000 0.000 1.000 0.000
#> GSM386389 3 0.3569 0.7653 0.196 0.000 0.804 0.000
#> GSM386390 3 0.0000 0.9680 0.000 0.000 1.000 0.000
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM386435 2 0.0000 0.859 0.000 1.000 0.000 0.000 0.000
#> GSM386436 2 0.0000 0.859 0.000 1.000 0.000 0.000 0.000
#> GSM386437 2 0.0000 0.859 0.000 1.000 0.000 0.000 0.000
#> GSM386438 2 0.0000 0.859 0.000 1.000 0.000 0.000 0.000
#> GSM386439 1 0.3177 0.639 0.792 0.208 0.000 0.000 0.000
#> GSM386440 2 0.0000 0.859 0.000 1.000 0.000 0.000 0.000
#> GSM386441 2 0.0000 0.859 0.000 1.000 0.000 0.000 0.000
#> GSM386442 2 0.0000 0.859 0.000 1.000 0.000 0.000 0.000
#> GSM386447 2 0.4302 0.096 0.480 0.520 0.000 0.000 0.000
#> GSM386448 2 0.0000 0.859 0.000 1.000 0.000 0.000 0.000
#> GSM386449 2 0.0000 0.859 0.000 1.000 0.000 0.000 0.000
#> GSM386450 2 0.0000 0.859 0.000 1.000 0.000 0.000 0.000
#> GSM386451 2 0.4738 0.247 0.000 0.520 0.000 0.464 0.016
#> GSM386452 1 0.0000 0.973 1.000 0.000 0.000 0.000 0.000
#> GSM386453 2 0.4738 0.247 0.000 0.520 0.000 0.464 0.016
#> GSM386454 1 0.0000 0.973 1.000 0.000 0.000 0.000 0.000
#> GSM386455 2 0.4738 0.247 0.000 0.520 0.000 0.464 0.016
#> GSM386456 2 0.4738 0.247 0.000 0.520 0.000 0.464 0.016
#> GSM386457 2 0.4738 0.247 0.000 0.520 0.000 0.464 0.016
#> GSM386458 1 0.0000 0.973 1.000 0.000 0.000 0.000 0.000
#> GSM386443 5 0.0510 0.978 0.016 0.000 0.000 0.000 0.984
#> GSM386444 3 0.0000 0.998 0.000 0.000 1.000 0.000 0.000
#> GSM386445 3 0.0000 0.998 0.000 0.000 1.000 0.000 0.000
#> GSM386446 3 0.0510 0.979 0.000 0.000 0.984 0.000 0.016
#> GSM386398 1 0.0000 0.973 1.000 0.000 0.000 0.000 0.000
#> GSM386399 1 0.0000 0.973 1.000 0.000 0.000 0.000 0.000
#> GSM386400 1 0.0000 0.973 1.000 0.000 0.000 0.000 0.000
#> GSM386401 2 0.0000 0.859 0.000 1.000 0.000 0.000 0.000
#> GSM386406 2 0.0000 0.859 0.000 1.000 0.000 0.000 0.000
#> GSM386407 4 0.0000 0.973 0.000 0.000 0.000 1.000 0.000
#> GSM386408 2 0.0000 0.859 0.000 1.000 0.000 0.000 0.000
#> GSM386409 1 0.0000 0.973 1.000 0.000 0.000 0.000 0.000
#> GSM386410 1 0.0000 0.973 1.000 0.000 0.000 0.000 0.000
#> GSM386411 4 0.0510 0.968 0.000 0.000 0.000 0.984 0.016
#> GSM386412 4 0.0000 0.973 0.000 0.000 0.000 1.000 0.000
#> GSM386413 4 0.0510 0.968 0.000 0.000 0.000 0.984 0.016
#> GSM386414 4 0.0000 0.973 0.000 0.000 0.000 1.000 0.000
#> GSM386415 4 0.0510 0.968 0.000 0.000 0.000 0.984 0.016
#> GSM386416 4 0.3586 0.568 0.264 0.000 0.000 0.736 0.000
#> GSM386417 4 0.0671 0.964 0.000 0.004 0.000 0.980 0.016
#> GSM386402 3 0.0000 0.998 0.000 0.000 1.000 0.000 0.000
#> GSM386403 3 0.0000 0.998 0.000 0.000 1.000 0.000 0.000
#> GSM386404 3 0.0000 0.998 0.000 0.000 1.000 0.000 0.000
#> GSM386405 3 0.0000 0.998 0.000 0.000 1.000 0.000 0.000
#> GSM386418 2 0.0000 0.859 0.000 1.000 0.000 0.000 0.000
#> GSM386419 2 0.0000 0.859 0.000 1.000 0.000 0.000 0.000
#> GSM386420 2 0.0000 0.859 0.000 1.000 0.000 0.000 0.000
#> GSM386421 2 0.0000 0.859 0.000 1.000 0.000 0.000 0.000
#> GSM386426 1 0.0000 0.973 1.000 0.000 0.000 0.000 0.000
#> GSM386427 1 0.0000 0.973 1.000 0.000 0.000 0.000 0.000
#> GSM386428 2 0.0000 0.859 0.000 1.000 0.000 0.000 0.000
#> GSM386429 4 0.0000 0.973 0.000 0.000 0.000 1.000 0.000
#> GSM386430 4 0.0000 0.973 0.000 0.000 0.000 1.000 0.000
#> GSM386431 4 0.0000 0.973 0.000 0.000 0.000 1.000 0.000
#> GSM386432 4 0.0000 0.973 0.000 0.000 0.000 1.000 0.000
#> GSM386433 4 0.0510 0.968 0.000 0.000 0.000 0.984 0.016
#> GSM386434 4 0.0510 0.968 0.000 0.000 0.000 0.984 0.016
#> GSM386422 3 0.0000 0.998 0.000 0.000 1.000 0.000 0.000
#> GSM386423 5 0.0510 0.989 0.000 0.000 0.016 0.000 0.984
#> GSM386424 3 0.0000 0.998 0.000 0.000 1.000 0.000 0.000
#> GSM386425 3 0.0000 0.998 0.000 0.000 1.000 0.000 0.000
#> GSM386385 2 0.0000 0.859 0.000 1.000 0.000 0.000 0.000
#> GSM386386 1 0.0000 0.973 1.000 0.000 0.000 0.000 0.000
#> GSM386387 2 0.0000 0.859 0.000 1.000 0.000 0.000 0.000
#> GSM386391 2 0.0000 0.859 0.000 1.000 0.000 0.000 0.000
#> GSM386392 1 0.0000 0.973 1.000 0.000 0.000 0.000 0.000
#> GSM386393 4 0.0000 0.973 0.000 0.000 0.000 1.000 0.000
#> GSM386394 1 0.0510 0.956 0.984 0.000 0.000 0.016 0.000
#> GSM386395 4 0.0000 0.973 0.000 0.000 0.000 1.000 0.000
#> GSM386396 4 0.0000 0.973 0.000 0.000 0.000 1.000 0.000
#> GSM386397 4 0.0000 0.973 0.000 0.000 0.000 1.000 0.000
#> GSM386388 3 0.0000 0.998 0.000 0.000 1.000 0.000 0.000
#> GSM386389 5 0.0510 0.989 0.000 0.000 0.016 0.000 0.984
#> GSM386390 3 0.0000 0.998 0.000 0.000 1.000 0.000 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM386435 2 0.0000 0.986 0.000 1.000 0.000 0.000 0.00 0.000
#> GSM386436 2 0.0000 0.986 0.000 1.000 0.000 0.000 0.00 0.000
#> GSM386437 2 0.0000 0.986 0.000 1.000 0.000 0.000 0.00 0.000
#> GSM386438 2 0.0000 0.986 0.000 1.000 0.000 0.000 0.00 0.000
#> GSM386439 1 0.0000 0.842 1.000 0.000 0.000 0.000 0.00 0.000
#> GSM386440 2 0.0000 0.986 0.000 1.000 0.000 0.000 0.00 0.000
#> GSM386441 2 0.0000 0.986 0.000 1.000 0.000 0.000 0.00 0.000
#> GSM386442 2 0.0000 0.986 0.000 1.000 0.000 0.000 0.00 0.000
#> GSM386447 1 0.3990 0.530 0.688 0.284 0.000 0.028 0.00 0.000
#> GSM386448 2 0.0000 0.986 0.000 1.000 0.000 0.000 0.00 0.000
#> GSM386449 2 0.0000 0.986 0.000 1.000 0.000 0.000 0.00 0.000
#> GSM386450 2 0.0000 0.986 0.000 1.000 0.000 0.000 0.00 0.000
#> GSM386451 6 0.4546 0.752 0.000 0.204 0.000 0.104 0.00 0.692
#> GSM386452 1 0.3198 0.820 0.740 0.000 0.000 0.000 0.26 0.000
#> GSM386453 6 0.4546 0.752 0.000 0.204 0.000 0.104 0.00 0.692
#> GSM386454 1 0.3198 0.820 0.740 0.000 0.000 0.000 0.26 0.000
#> GSM386455 6 0.4546 0.752 0.000 0.204 0.000 0.104 0.00 0.692
#> GSM386456 6 0.4546 0.752 0.000 0.204 0.000 0.104 0.00 0.692
#> GSM386457 6 0.4546 0.752 0.000 0.204 0.000 0.104 0.00 0.692
#> GSM386458 1 0.0146 0.840 0.996 0.004 0.000 0.000 0.00 0.000
#> GSM386443 5 0.3198 1.000 0.000 0.000 0.000 0.000 0.74 0.260
#> GSM386444 3 0.0547 0.985 0.000 0.000 0.980 0.000 0.00 0.020
#> GSM386445 3 0.0547 0.985 0.000 0.000 0.980 0.000 0.00 0.020
#> GSM386446 3 0.0632 0.982 0.000 0.000 0.976 0.000 0.00 0.024
#> GSM386398 1 0.0000 0.842 1.000 0.000 0.000 0.000 0.00 0.000
#> GSM386399 1 0.0000 0.842 1.000 0.000 0.000 0.000 0.00 0.000
#> GSM386400 1 0.0000 0.842 1.000 0.000 0.000 0.000 0.00 0.000
#> GSM386401 2 0.0000 0.986 0.000 1.000 0.000 0.000 0.00 0.000
#> GSM386406 2 0.0713 0.982 0.000 0.972 0.000 0.000 0.00 0.028
#> GSM386407 4 0.1267 0.850 0.000 0.000 0.000 0.940 0.00 0.060
#> GSM386408 2 0.0000 0.986 0.000 1.000 0.000 0.000 0.00 0.000
#> GSM386409 1 0.3198 0.820 0.740 0.000 0.000 0.000 0.26 0.000
#> GSM386410 1 0.3198 0.820 0.740 0.000 0.000 0.000 0.26 0.000
#> GSM386411 6 0.3857 0.484 0.000 0.000 0.000 0.468 0.00 0.532
#> GSM386412 4 0.1267 0.850 0.000 0.000 0.000 0.940 0.00 0.060
#> GSM386413 6 0.3857 0.484 0.000 0.000 0.000 0.468 0.00 0.532
#> GSM386414 4 0.2697 0.644 0.000 0.000 0.000 0.812 0.00 0.188
#> GSM386415 6 0.3446 0.723 0.000 0.000 0.000 0.308 0.00 0.692
#> GSM386416 4 0.3758 0.562 0.284 0.000 0.000 0.700 0.00 0.016
#> GSM386417 6 0.3859 0.733 0.000 0.020 0.000 0.288 0.00 0.692
#> GSM386402 3 0.0000 0.995 0.000 0.000 1.000 0.000 0.00 0.000
#> GSM386403 3 0.0000 0.995 0.000 0.000 1.000 0.000 0.00 0.000
#> GSM386404 3 0.0000 0.995 0.000 0.000 1.000 0.000 0.00 0.000
#> GSM386405 3 0.0000 0.995 0.000 0.000 1.000 0.000 0.00 0.000
#> GSM386418 2 0.0713 0.982 0.000 0.972 0.000 0.000 0.00 0.028
#> GSM386419 2 0.0713 0.982 0.000 0.972 0.000 0.000 0.00 0.028
#> GSM386420 2 0.0713 0.982 0.000 0.972 0.000 0.000 0.00 0.028
#> GSM386421 2 0.0713 0.982 0.000 0.972 0.000 0.000 0.00 0.028
#> GSM386426 1 0.0000 0.842 1.000 0.000 0.000 0.000 0.00 0.000
#> GSM386427 1 0.3198 0.820 0.740 0.000 0.000 0.000 0.26 0.000
#> GSM386428 2 0.0713 0.982 0.000 0.972 0.000 0.000 0.00 0.028
#> GSM386429 4 0.1267 0.850 0.000 0.000 0.000 0.940 0.00 0.060
#> GSM386430 4 0.1267 0.850 0.000 0.000 0.000 0.940 0.00 0.060
#> GSM386431 4 0.1267 0.850 0.000 0.000 0.000 0.940 0.00 0.060
#> GSM386432 4 0.1267 0.850 0.000 0.000 0.000 0.940 0.00 0.060
#> GSM386433 6 0.3446 0.723 0.000 0.000 0.000 0.308 0.00 0.692
#> GSM386434 6 0.3446 0.723 0.000 0.000 0.000 0.308 0.00 0.692
#> GSM386422 3 0.0000 0.995 0.000 0.000 1.000 0.000 0.00 0.000
#> GSM386423 5 0.3198 1.000 0.000 0.000 0.000 0.000 0.74 0.260
#> GSM386424 3 0.0000 0.995 0.000 0.000 1.000 0.000 0.00 0.000
#> GSM386425 3 0.0000 0.995 0.000 0.000 1.000 0.000 0.00 0.000
#> GSM386385 2 0.0713 0.982 0.000 0.972 0.000 0.000 0.00 0.028
#> GSM386386 1 0.3198 0.820 0.740 0.000 0.000 0.000 0.26 0.000
#> GSM386387 2 0.0713 0.982 0.000 0.972 0.000 0.000 0.00 0.028
#> GSM386391 2 0.0713 0.982 0.000 0.972 0.000 0.000 0.00 0.028
#> GSM386392 1 0.0000 0.842 1.000 0.000 0.000 0.000 0.00 0.000
#> GSM386393 4 0.0000 0.842 0.000 0.000 0.000 1.000 0.00 0.000
#> GSM386394 4 0.5651 0.173 0.208 0.000 0.000 0.532 0.26 0.000
#> GSM386395 4 0.0000 0.842 0.000 0.000 0.000 1.000 0.00 0.000
#> GSM386396 4 0.0000 0.842 0.000 0.000 0.000 1.000 0.00 0.000
#> GSM386397 4 0.0000 0.842 0.000 0.000 0.000 1.000 0.00 0.000
#> GSM386388 3 0.0000 0.995 0.000 0.000 1.000 0.000 0.00 0.000
#> GSM386389 5 0.3198 1.000 0.000 0.000 0.000 0.000 0.74 0.260
#> GSM386390 3 0.0000 0.995 0.000 0.000 1.000 0.000 0.00 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 agent(p) dose(p) time(p) k
#> SD:pam 74 0.57395 0.947 1.50e-14 2
#> SD:pam 74 0.50089 0.817 2.54e-11 3
#> SD:pam 68 0.00722 0.137 2.82e-17 4
#> SD:pam 68 0.02893 0.268 3.43e-16 5
#> SD:pam 71 0.03871 0.453 1.04e-17 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 51941 rows and 74 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 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.493 0.750 0.851 0.4040 0.672 0.672
#> 3 3 1.000 0.975 0.981 0.4887 0.727 0.594
#> 4 4 0.620 0.651 0.766 0.1679 0.899 0.751
#> 5 5 0.767 0.698 0.796 0.0466 0.779 0.420
#> 6 6 0.865 0.884 0.946 0.0897 0.846 0.465
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
#> GSM386435 1 0.0000 0.774 1.000 0.000
#> GSM386436 1 0.0000 0.774 1.000 0.000
#> GSM386437 1 0.8443 0.676 0.728 0.272
#> GSM386438 1 0.0000 0.774 1.000 0.000
#> GSM386439 1 0.9896 0.559 0.560 0.440
#> GSM386440 1 0.0000 0.774 1.000 0.000
#> GSM386441 1 0.0000 0.774 1.000 0.000
#> GSM386442 1 0.0000 0.774 1.000 0.000
#> GSM386447 1 0.9896 0.559 0.560 0.440
#> GSM386448 1 0.0000 0.774 1.000 0.000
#> GSM386449 1 0.0000 0.774 1.000 0.000
#> GSM386450 1 0.0000 0.774 1.000 0.000
#> GSM386451 1 0.0000 0.774 1.000 0.000
#> GSM386452 1 0.9896 0.559 0.560 0.440
#> GSM386453 1 0.0000 0.774 1.000 0.000
#> GSM386454 1 0.9896 0.559 0.560 0.440
#> GSM386455 1 0.8443 0.677 0.728 0.272
#> GSM386456 1 0.8861 0.661 0.696 0.304
#> GSM386457 1 0.8955 0.657 0.688 0.312
#> GSM386458 1 0.9896 0.559 0.560 0.440
#> GSM386443 2 0.0000 1.000 0.000 1.000
#> GSM386444 2 0.0000 1.000 0.000 1.000
#> GSM386445 2 0.0000 1.000 0.000 1.000
#> GSM386446 2 0.0000 1.000 0.000 1.000
#> GSM386398 1 0.9896 0.559 0.560 0.440
#> GSM386399 1 0.9896 0.559 0.560 0.440
#> GSM386400 1 0.9896 0.559 0.560 0.440
#> GSM386401 1 0.0000 0.774 1.000 0.000
#> GSM386406 1 0.0000 0.774 1.000 0.000
#> GSM386407 1 0.0000 0.774 1.000 0.000
#> GSM386408 1 0.0000 0.774 1.000 0.000
#> GSM386409 1 0.9896 0.559 0.560 0.440
#> GSM386410 1 0.9896 0.559 0.560 0.440
#> GSM386411 1 0.0000 0.774 1.000 0.000
#> GSM386412 1 0.9896 0.559 0.560 0.440
#> GSM386413 1 0.0000 0.774 1.000 0.000
#> GSM386414 1 0.9896 0.559 0.560 0.440
#> GSM386415 1 0.9393 0.628 0.644 0.356
#> GSM386416 1 0.9896 0.559 0.560 0.440
#> GSM386417 1 0.8955 0.657 0.688 0.312
#> GSM386402 2 0.0000 1.000 0.000 1.000
#> GSM386403 2 0.0000 1.000 0.000 1.000
#> GSM386404 2 0.0000 1.000 0.000 1.000
#> GSM386405 2 0.0000 1.000 0.000 1.000
#> GSM386418 1 0.0000 0.774 1.000 0.000
#> GSM386419 1 0.0000 0.774 1.000 0.000
#> GSM386420 1 0.0000 0.774 1.000 0.000
#> GSM386421 1 0.0000 0.774 1.000 0.000
#> GSM386426 1 0.9896 0.559 0.560 0.440
#> GSM386427 1 0.9896 0.559 0.560 0.440
#> GSM386428 1 0.0000 0.774 1.000 0.000
#> GSM386429 1 0.0000 0.774 1.000 0.000
#> GSM386430 1 0.0000 0.774 1.000 0.000
#> GSM386431 1 0.0000 0.774 1.000 0.000
#> GSM386432 1 0.0000 0.774 1.000 0.000
#> GSM386433 1 0.9775 0.584 0.588 0.412
#> GSM386434 1 0.9358 0.631 0.648 0.352
#> GSM386422 2 0.0000 1.000 0.000 1.000
#> GSM386423 2 0.0000 1.000 0.000 1.000
#> GSM386424 2 0.0000 1.000 0.000 1.000
#> GSM386425 2 0.0000 1.000 0.000 1.000
#> GSM386385 1 0.9896 0.559 0.560 0.440
#> GSM386386 1 0.9896 0.559 0.560 0.440
#> GSM386387 1 0.0000 0.774 1.000 0.000
#> GSM386391 1 0.0000 0.774 1.000 0.000
#> GSM386392 1 0.9896 0.559 0.560 0.440
#> GSM386393 1 0.0000 0.774 1.000 0.000
#> GSM386394 1 0.9896 0.559 0.560 0.440
#> GSM386395 1 0.0000 0.774 1.000 0.000
#> GSM386396 1 0.2236 0.764 0.964 0.036
#> GSM386397 1 0.0938 0.771 0.988 0.012
#> GSM386388 2 0.0000 1.000 0.000 1.000
#> GSM386389 2 0.0000 1.000 0.000 1.000
#> GSM386390 2 0.0000 1.000 0.000 1.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM386435 2 0.0000 0.968 0.000 1.000 0
#> GSM386436 2 0.0000 0.968 0.000 1.000 0
#> GSM386437 2 0.0747 0.966 0.016 0.984 0
#> GSM386438 2 0.0000 0.968 0.000 1.000 0
#> GSM386439 1 0.0000 0.987 1.000 0.000 0
#> GSM386440 2 0.0000 0.968 0.000 1.000 0
#> GSM386441 2 0.0000 0.968 0.000 1.000 0
#> GSM386442 2 0.0000 0.968 0.000 1.000 0
#> GSM386447 1 0.0000 0.987 1.000 0.000 0
#> GSM386448 2 0.0000 0.968 0.000 1.000 0
#> GSM386449 2 0.0000 0.968 0.000 1.000 0
#> GSM386450 2 0.0000 0.968 0.000 1.000 0
#> GSM386451 2 0.0424 0.967 0.008 0.992 0
#> GSM386452 1 0.0000 0.987 1.000 0.000 0
#> GSM386453 2 0.0000 0.968 0.000 1.000 0
#> GSM386454 1 0.0000 0.987 1.000 0.000 0
#> GSM386455 2 0.2165 0.962 0.064 0.936 0
#> GSM386456 2 0.2165 0.962 0.064 0.936 0
#> GSM386457 2 0.2066 0.963 0.060 0.940 0
#> GSM386458 1 0.1753 0.944 0.952 0.048 0
#> GSM386443 3 0.0000 1.000 0.000 0.000 1
#> GSM386444 3 0.0000 1.000 0.000 0.000 1
#> GSM386445 3 0.0000 1.000 0.000 0.000 1
#> GSM386446 3 0.0000 1.000 0.000 0.000 1
#> GSM386398 1 0.0000 0.987 1.000 0.000 0
#> GSM386399 1 0.0000 0.987 1.000 0.000 0
#> GSM386400 1 0.0000 0.987 1.000 0.000 0
#> GSM386401 2 0.0000 0.968 0.000 1.000 0
#> GSM386406 2 0.0000 0.968 0.000 1.000 0
#> GSM386407 2 0.2165 0.962 0.064 0.936 0
#> GSM386408 2 0.0000 0.968 0.000 1.000 0
#> GSM386409 1 0.0000 0.987 1.000 0.000 0
#> GSM386410 1 0.0000 0.987 1.000 0.000 0
#> GSM386411 2 0.2165 0.962 0.064 0.936 0
#> GSM386412 1 0.1753 0.944 0.952 0.048 0
#> GSM386413 2 0.2165 0.962 0.064 0.936 0
#> GSM386414 2 0.2356 0.956 0.072 0.928 0
#> GSM386415 2 0.2165 0.962 0.064 0.936 0
#> GSM386416 1 0.1753 0.944 0.952 0.048 0
#> GSM386417 2 0.2165 0.962 0.064 0.936 0
#> GSM386402 3 0.0000 1.000 0.000 0.000 1
#> GSM386403 3 0.0000 1.000 0.000 0.000 1
#> GSM386404 3 0.0000 1.000 0.000 0.000 1
#> GSM386405 3 0.0000 1.000 0.000 0.000 1
#> GSM386418 2 0.0000 0.968 0.000 1.000 0
#> GSM386419 2 0.0000 0.968 0.000 1.000 0
#> GSM386420 2 0.0000 0.968 0.000 1.000 0
#> GSM386421 2 0.0000 0.968 0.000 1.000 0
#> GSM386426 1 0.0000 0.987 1.000 0.000 0
#> GSM386427 1 0.0000 0.987 1.000 0.000 0
#> GSM386428 2 0.0000 0.968 0.000 1.000 0
#> GSM386429 2 0.2165 0.962 0.064 0.936 0
#> GSM386430 2 0.2165 0.962 0.064 0.936 0
#> GSM386431 2 0.2165 0.962 0.064 0.936 0
#> GSM386432 2 0.2165 0.962 0.064 0.936 0
#> GSM386433 2 0.2165 0.962 0.064 0.936 0
#> GSM386434 2 0.2165 0.962 0.064 0.936 0
#> GSM386422 3 0.0000 1.000 0.000 0.000 1
#> GSM386423 3 0.0000 1.000 0.000 0.000 1
#> GSM386424 3 0.0000 1.000 0.000 0.000 1
#> GSM386425 3 0.0000 1.000 0.000 0.000 1
#> GSM386385 1 0.0000 0.987 1.000 0.000 0
#> GSM386386 1 0.0000 0.987 1.000 0.000 0
#> GSM386387 2 0.0000 0.968 0.000 1.000 0
#> GSM386391 2 0.0000 0.968 0.000 1.000 0
#> GSM386392 1 0.0000 0.987 1.000 0.000 0
#> GSM386393 2 0.2165 0.962 0.064 0.936 0
#> GSM386394 1 0.1031 0.966 0.976 0.024 0
#> GSM386395 2 0.2165 0.962 0.064 0.936 0
#> GSM386396 2 0.2165 0.962 0.064 0.936 0
#> GSM386397 2 0.2165 0.962 0.064 0.936 0
#> GSM386388 3 0.0000 1.000 0.000 0.000 1
#> GSM386389 3 0.0000 1.000 0.000 0.000 1
#> GSM386390 3 0.0000 1.000 0.000 0.000 1
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM386435 4 0.4713 0.4830 0.000 0.360 0.000 0.640
#> GSM386436 2 0.4855 -0.0143 0.000 0.600 0.000 0.400
#> GSM386437 4 0.5074 0.5426 0.040 0.236 0.000 0.724
#> GSM386438 4 0.4585 0.5073 0.000 0.332 0.000 0.668
#> GSM386439 1 0.0188 0.8747 0.996 0.000 0.000 0.004
#> GSM386440 2 0.4134 0.4248 0.000 0.740 0.000 0.260
#> GSM386441 2 0.4134 0.4250 0.000 0.740 0.000 0.260
#> GSM386442 2 0.3837 0.4627 0.000 0.776 0.000 0.224
#> GSM386447 1 0.0336 0.8729 0.992 0.000 0.000 0.008
#> GSM386448 2 0.4454 0.3384 0.000 0.692 0.000 0.308
#> GSM386449 2 0.3975 0.4479 0.000 0.760 0.000 0.240
#> GSM386450 4 0.4985 0.2565 0.000 0.468 0.000 0.532
#> GSM386451 2 0.4713 0.6226 0.172 0.776 0.000 0.052
#> GSM386452 1 0.3873 0.7470 0.772 0.000 0.000 0.228
#> GSM386453 2 0.2742 0.5538 0.024 0.900 0.000 0.076
#> GSM386454 1 0.3873 0.7470 0.772 0.000 0.000 0.228
#> GSM386455 2 0.5312 0.6298 0.236 0.712 0.000 0.052
#> GSM386456 2 0.5312 0.6298 0.236 0.712 0.000 0.052
#> GSM386457 4 0.7241 0.4510 0.276 0.188 0.000 0.536
#> GSM386458 4 0.4356 0.5406 0.292 0.000 0.000 0.708
#> GSM386443 3 0.5374 0.7463 0.052 0.000 0.704 0.244
#> GSM386444 3 0.0000 0.9449 0.000 0.000 1.000 0.000
#> GSM386445 3 0.0000 0.9449 0.000 0.000 1.000 0.000
#> GSM386446 3 0.0000 0.9449 0.000 0.000 1.000 0.000
#> GSM386398 1 0.1211 0.8640 0.960 0.000 0.000 0.040
#> GSM386399 1 0.0188 0.8747 0.996 0.000 0.000 0.004
#> GSM386400 1 0.1211 0.8640 0.960 0.000 0.000 0.040
#> GSM386401 2 0.4072 0.4340 0.000 0.748 0.000 0.252
#> GSM386406 2 0.3569 0.4765 0.000 0.804 0.000 0.196
#> GSM386407 2 0.3942 0.6465 0.236 0.764 0.000 0.000
#> GSM386408 2 0.4866 0.0398 0.000 0.596 0.000 0.404
#> GSM386409 1 0.1118 0.8652 0.964 0.000 0.000 0.036
#> GSM386410 1 0.3873 0.7470 0.772 0.000 0.000 0.228
#> GSM386411 2 0.3942 0.6465 0.236 0.764 0.000 0.000
#> GSM386412 4 0.5358 0.5713 0.252 0.048 0.000 0.700
#> GSM386413 2 0.3942 0.6465 0.236 0.764 0.000 0.000
#> GSM386414 4 0.7459 0.4017 0.244 0.248 0.000 0.508
#> GSM386415 2 0.3975 0.6439 0.240 0.760 0.000 0.000
#> GSM386416 4 0.4356 0.5406 0.292 0.000 0.000 0.708
#> GSM386417 2 0.3942 0.6465 0.236 0.764 0.000 0.000
#> GSM386402 3 0.0000 0.9449 0.000 0.000 1.000 0.000
#> GSM386403 3 0.0000 0.9449 0.000 0.000 1.000 0.000
#> GSM386404 3 0.0000 0.9449 0.000 0.000 1.000 0.000
#> GSM386405 3 0.0000 0.9449 0.000 0.000 1.000 0.000
#> GSM386418 2 0.4692 0.4171 0.032 0.756 0.000 0.212
#> GSM386419 2 0.3266 0.5059 0.000 0.832 0.000 0.168
#> GSM386420 2 0.3074 0.5151 0.000 0.848 0.000 0.152
#> GSM386421 2 0.3649 0.4725 0.000 0.796 0.000 0.204
#> GSM386426 1 0.0188 0.8747 0.996 0.000 0.000 0.004
#> GSM386427 1 0.3873 0.7470 0.772 0.000 0.000 0.228
#> GSM386428 2 0.3123 0.5034 0.000 0.844 0.000 0.156
#> GSM386429 2 0.3942 0.6465 0.236 0.764 0.000 0.000
#> GSM386430 2 0.3942 0.6465 0.236 0.764 0.000 0.000
#> GSM386431 2 0.4535 0.6368 0.240 0.744 0.000 0.016
#> GSM386432 2 0.3942 0.6465 0.236 0.764 0.000 0.000
#> GSM386433 2 0.3975 0.6439 0.240 0.760 0.000 0.000
#> GSM386434 2 0.3942 0.6465 0.236 0.764 0.000 0.000
#> GSM386422 3 0.0000 0.9449 0.000 0.000 1.000 0.000
#> GSM386423 3 0.5312 0.7537 0.052 0.000 0.712 0.236
#> GSM386424 3 0.0000 0.9449 0.000 0.000 1.000 0.000
#> GSM386425 3 0.0000 0.9449 0.000 0.000 1.000 0.000
#> GSM386385 1 0.0524 0.8699 0.988 0.004 0.000 0.008
#> GSM386386 1 0.0188 0.8747 0.996 0.000 0.000 0.004
#> GSM386387 2 0.4855 -0.1240 0.000 0.600 0.000 0.400
#> GSM386391 2 0.2813 0.6002 0.080 0.896 0.000 0.024
#> GSM386392 1 0.0188 0.8747 0.996 0.000 0.000 0.004
#> GSM386393 2 0.3942 0.6465 0.236 0.764 0.000 0.000
#> GSM386394 1 0.4040 0.5591 0.752 0.000 0.000 0.248
#> GSM386395 2 0.3942 0.6465 0.236 0.764 0.000 0.000
#> GSM386396 2 0.3942 0.6465 0.236 0.764 0.000 0.000
#> GSM386397 2 0.3942 0.6465 0.236 0.764 0.000 0.000
#> GSM386388 3 0.0000 0.9449 0.000 0.000 1.000 0.000
#> GSM386389 3 0.5312 0.7537 0.052 0.000 0.712 0.236
#> GSM386390 3 0.0000 0.9449 0.000 0.000 1.000 0.000
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM386435 2 0.0162 0.77409 0.000 0.996 0.000 0.004 0.000
#> GSM386436 2 0.0000 0.77846 0.000 1.000 0.000 0.000 0.000
#> GSM386437 2 0.6407 0.02938 0.296 0.520 0.000 0.004 0.180
#> GSM386438 2 0.0000 0.77846 0.000 1.000 0.000 0.000 0.000
#> GSM386439 1 0.0162 0.82264 0.996 0.000 0.000 0.004 0.000
#> GSM386440 2 0.0000 0.77846 0.000 1.000 0.000 0.000 0.000
#> GSM386441 2 0.0000 0.77846 0.000 1.000 0.000 0.000 0.000
#> GSM386442 2 0.0000 0.77846 0.000 1.000 0.000 0.000 0.000
#> GSM386447 1 0.0324 0.82280 0.992 0.004 0.000 0.004 0.000
#> GSM386448 2 0.0000 0.77846 0.000 1.000 0.000 0.000 0.000
#> GSM386449 2 0.0000 0.77846 0.000 1.000 0.000 0.000 0.000
#> GSM386450 2 0.0000 0.77846 0.000 1.000 0.000 0.000 0.000
#> GSM386451 2 0.1544 0.69932 0.000 0.932 0.000 0.068 0.000
#> GSM386452 1 0.0162 0.82362 0.996 0.004 0.000 0.000 0.000
#> GSM386453 2 0.0510 0.76299 0.000 0.984 0.000 0.016 0.000
#> GSM386454 1 0.0000 0.82281 1.000 0.000 0.000 0.000 0.000
#> GSM386455 2 0.1732 0.68776 0.000 0.920 0.000 0.080 0.000
#> GSM386456 2 0.1732 0.68776 0.000 0.920 0.000 0.080 0.000
#> GSM386457 2 0.5847 0.01989 0.048 0.520 0.000 0.024 0.408
#> GSM386458 1 0.4613 0.59789 0.580 0.008 0.000 0.004 0.408
#> GSM386443 1 0.6006 0.61431 0.504 0.000 0.016 0.408 0.072
#> GSM386444 3 0.0000 1.00000 0.000 0.000 1.000 0.000 0.000
#> GSM386445 3 0.0000 1.00000 0.000 0.000 1.000 0.000 0.000
#> GSM386446 3 0.0000 1.00000 0.000 0.000 1.000 0.000 0.000
#> GSM386398 1 0.5439 0.64633 0.560 0.000 0.000 0.372 0.068
#> GSM386399 1 0.0162 0.82264 0.996 0.000 0.000 0.004 0.000
#> GSM386400 1 0.5439 0.64633 0.560 0.000 0.000 0.372 0.068
#> GSM386401 2 0.0000 0.77846 0.000 1.000 0.000 0.000 0.000
#> GSM386406 2 0.4138 -0.45929 0.000 0.616 0.000 0.384 0.000
#> GSM386407 4 0.4210 0.86382 0.000 0.412 0.000 0.588 0.000
#> GSM386408 2 0.0000 0.77846 0.000 1.000 0.000 0.000 0.000
#> GSM386409 1 0.0162 0.82362 0.996 0.004 0.000 0.000 0.000
#> GSM386410 1 0.0162 0.82362 0.996 0.004 0.000 0.000 0.000
#> GSM386411 4 0.4210 0.86382 0.000 0.412 0.000 0.588 0.000
#> GSM386412 5 0.6685 0.00194 0.176 0.008 0.000 0.408 0.408
#> GSM386413 4 0.4210 0.86382 0.000 0.412 0.000 0.588 0.000
#> GSM386414 4 0.6055 -0.23930 0.104 0.004 0.000 0.484 0.408
#> GSM386415 4 0.4210 0.86382 0.000 0.412 0.000 0.588 0.000
#> GSM386416 1 0.4565 0.59832 0.580 0.012 0.000 0.000 0.408
#> GSM386417 4 0.4210 0.86382 0.000 0.412 0.000 0.588 0.000
#> GSM386402 3 0.0000 1.00000 0.000 0.000 1.000 0.000 0.000
#> GSM386403 3 0.0000 1.00000 0.000 0.000 1.000 0.000 0.000
#> GSM386404 3 0.0000 1.00000 0.000 0.000 1.000 0.000 0.000
#> GSM386405 3 0.0000 1.00000 0.000 0.000 1.000 0.000 0.000
#> GSM386418 4 0.4305 0.74603 0.000 0.488 0.000 0.512 0.000
#> GSM386419 2 0.0000 0.77846 0.000 1.000 0.000 0.000 0.000
#> GSM386420 2 0.0000 0.77846 0.000 1.000 0.000 0.000 0.000
#> GSM386421 2 0.4307 -0.77206 0.000 0.504 0.000 0.496 0.000
#> GSM386426 1 0.0162 0.82362 0.996 0.004 0.000 0.000 0.000
#> GSM386427 1 0.0162 0.82362 0.996 0.004 0.000 0.000 0.000
#> GSM386428 4 0.4304 0.75222 0.000 0.484 0.000 0.516 0.000
#> GSM386429 4 0.4210 0.86382 0.000 0.412 0.000 0.588 0.000
#> GSM386430 4 0.4210 0.86382 0.000 0.412 0.000 0.588 0.000
#> GSM386431 4 0.6281 0.57848 0.000 0.352 0.000 0.488 0.160
#> GSM386432 4 0.4210 0.86382 0.000 0.412 0.000 0.588 0.000
#> GSM386433 4 0.4210 0.86382 0.000 0.412 0.000 0.588 0.000
#> GSM386434 4 0.4210 0.86382 0.000 0.412 0.000 0.588 0.000
#> GSM386422 3 0.0000 1.00000 0.000 0.000 1.000 0.000 0.000
#> GSM386423 1 0.6089 0.61133 0.500 0.000 0.020 0.408 0.072
#> GSM386424 3 0.0000 1.00000 0.000 0.000 1.000 0.000 0.000
#> GSM386425 3 0.0000 1.00000 0.000 0.000 1.000 0.000 0.000
#> GSM386385 1 0.0566 0.81879 0.984 0.004 0.000 0.012 0.000
#> GSM386386 1 0.0162 0.82362 0.996 0.004 0.000 0.000 0.000
#> GSM386387 2 0.0000 0.77846 0.000 1.000 0.000 0.000 0.000
#> GSM386391 4 0.4256 0.83208 0.000 0.436 0.000 0.564 0.000
#> GSM386392 1 0.0162 0.82362 0.996 0.004 0.000 0.000 0.000
#> GSM386393 5 0.5562 0.54540 0.000 0.408 0.000 0.072 0.520
#> GSM386394 1 0.5679 0.51858 0.504 0.004 0.000 0.068 0.424
#> GSM386395 2 0.6684 -0.58898 0.000 0.408 0.000 0.352 0.240
#> GSM386396 5 0.5562 0.54540 0.000 0.408 0.000 0.072 0.520
#> GSM386397 5 0.5562 0.54540 0.000 0.408 0.000 0.072 0.520
#> GSM386388 3 0.0000 1.00000 0.000 0.000 1.000 0.000 0.000
#> GSM386389 1 0.6089 0.61133 0.500 0.000 0.020 0.408 0.072
#> GSM386390 3 0.0000 1.00000 0.000 0.000 1.000 0.000 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM386435 2 0.0146 0.951 0.004 0.996 0.000 0.000 0.000 0.000
#> GSM386436 2 0.0146 0.951 0.004 0.996 0.000 0.000 0.000 0.000
#> GSM386437 1 0.2092 0.843 0.876 0.124 0.000 0.000 0.000 0.000
#> GSM386438 2 0.0146 0.951 0.004 0.996 0.000 0.000 0.000 0.000
#> GSM386439 1 0.0000 0.930 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM386440 2 0.0000 0.953 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM386441 2 0.0000 0.953 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM386442 2 0.0000 0.953 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM386447 1 0.0000 0.930 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM386448 2 0.0000 0.953 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM386449 2 0.0000 0.953 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM386450 2 0.0000 0.953 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM386451 1 0.3198 0.637 0.740 0.260 0.000 0.000 0.000 0.000
#> GSM386452 1 0.0713 0.923 0.972 0.000 0.000 0.000 0.028 0.000
#> GSM386453 2 0.3023 0.629 0.232 0.768 0.000 0.000 0.000 0.000
#> GSM386454 1 0.2454 0.777 0.840 0.000 0.000 0.000 0.160 0.000
#> GSM386455 1 0.2212 0.853 0.880 0.112 0.000 0.008 0.000 0.000
#> GSM386456 1 0.2212 0.853 0.880 0.112 0.000 0.008 0.000 0.000
#> GSM386457 1 0.2311 0.858 0.880 0.104 0.000 0.016 0.000 0.000
#> GSM386458 1 0.0458 0.926 0.984 0.000 0.000 0.016 0.000 0.000
#> GSM386443 5 0.0260 0.771 0.008 0.000 0.000 0.000 0.992 0.000
#> GSM386444 3 0.0260 0.994 0.000 0.000 0.992 0.000 0.008 0.000
#> GSM386445 3 0.0260 0.994 0.000 0.000 0.992 0.000 0.008 0.000
#> GSM386446 3 0.0260 0.994 0.000 0.000 0.992 0.000 0.008 0.000
#> GSM386398 5 0.3758 0.675 0.284 0.000 0.000 0.016 0.700 0.000
#> GSM386399 1 0.0000 0.930 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM386400 5 0.3758 0.675 0.284 0.000 0.000 0.016 0.700 0.000
#> GSM386401 2 0.0000 0.953 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM386406 2 0.1863 0.877 0.000 0.896 0.000 0.104 0.000 0.000
#> GSM386407 4 0.0458 0.928 0.000 0.016 0.000 0.984 0.000 0.000
#> GSM386408 2 0.0146 0.952 0.000 0.996 0.000 0.004 0.000 0.000
#> GSM386409 1 0.0260 0.929 0.992 0.000 0.000 0.000 0.008 0.000
#> GSM386410 1 0.0713 0.923 0.972 0.000 0.000 0.000 0.028 0.000
#> GSM386411 4 0.0458 0.928 0.000 0.016 0.000 0.984 0.000 0.000
#> GSM386412 1 0.0458 0.925 0.984 0.000 0.000 0.016 0.000 0.000
#> GSM386413 4 0.0458 0.928 0.000 0.016 0.000 0.984 0.000 0.000
#> GSM386414 1 0.1387 0.893 0.932 0.000 0.000 0.068 0.000 0.000
#> GSM386415 4 0.0000 0.922 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM386416 1 0.0458 0.926 0.984 0.000 0.000 0.016 0.000 0.000
#> GSM386417 4 0.1075 0.881 0.048 0.000 0.000 0.952 0.000 0.000
#> GSM386402 3 0.0000 0.998 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386403 3 0.0000 0.998 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386404 3 0.0000 0.998 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386405 3 0.0000 0.998 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386418 2 0.1958 0.877 0.004 0.896 0.000 0.100 0.000 0.000
#> GSM386419 2 0.0146 0.952 0.000 0.996 0.000 0.004 0.000 0.000
#> GSM386420 2 0.0146 0.952 0.000 0.996 0.000 0.004 0.000 0.000
#> GSM386421 2 0.1863 0.877 0.000 0.896 0.000 0.104 0.000 0.000
#> GSM386426 1 0.0000 0.930 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM386427 1 0.0713 0.923 0.972 0.000 0.000 0.000 0.028 0.000
#> GSM386428 2 0.1863 0.877 0.000 0.896 0.000 0.104 0.000 0.000
#> GSM386429 6 0.4148 0.589 0.004 0.016 0.000 0.344 0.000 0.636
#> GSM386430 6 0.4317 0.597 0.012 0.016 0.000 0.336 0.000 0.636
#> GSM386431 4 0.4190 0.421 0.012 0.016 0.000 0.668 0.000 0.304
#> GSM386432 4 0.0458 0.928 0.000 0.016 0.000 0.984 0.000 0.000
#> GSM386433 4 0.0547 0.913 0.020 0.000 0.000 0.980 0.000 0.000
#> GSM386434 4 0.0000 0.922 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM386422 3 0.0000 0.998 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386423 5 0.0260 0.771 0.008 0.000 0.000 0.000 0.992 0.000
#> GSM386424 3 0.0000 0.998 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386425 3 0.0000 0.998 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386385 1 0.0000 0.930 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM386386 1 0.0000 0.930 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM386387 2 0.0000 0.953 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM386391 4 0.1075 0.893 0.000 0.048 0.000 0.952 0.000 0.000
#> GSM386392 1 0.0000 0.930 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM386393 6 0.0603 0.783 0.000 0.016 0.000 0.004 0.000 0.980
#> GSM386394 6 0.0972 0.764 0.008 0.000 0.000 0.000 0.028 0.964
#> GSM386395 6 0.3582 0.690 0.000 0.016 0.000 0.252 0.000 0.732
#> GSM386396 6 0.0000 0.781 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM386397 6 0.0000 0.781 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM386388 3 0.0000 0.998 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386389 5 0.0260 0.771 0.008 0.000 0.000 0.000 0.992 0.000
#> GSM386390 3 0.0000 0.998 0.000 0.000 1.000 0.000 0.000 0.000
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
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 agent(p) dose(p) time(p) k
#> SD:mclust 74 0.573952 9.47e-01 1.50e-14 2
#> SD:mclust 74 0.483871 7.10e-01 8.17e-13 3
#> SD:mclust 58 0.000894 4.63e-01 1.79e-14 4
#> SD:mclust 67 0.001701 4.86e-05 1.28e-08 5
#> SD:mclust 73 0.072862 8.66e-03 4.25e-12 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 51941 rows and 74 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'SD' method.
#> Subgroups are detected by 'NMF' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 3.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
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.752 0.941 0.962 0.3509 0.672 0.672
#> 3 3 1.000 0.987 0.994 0.6606 0.745 0.621
#> 4 4 0.601 0.633 0.809 0.2130 0.869 0.688
#> 5 5 0.685 0.630 0.733 0.1058 0.837 0.503
#> 6 6 0.720 0.570 0.745 0.0327 0.917 0.675
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
#> GSM386435 1 0.0000 0.961 1.000 0.000
#> GSM386436 1 0.0000 0.961 1.000 0.000
#> GSM386437 1 0.0376 0.960 0.996 0.004
#> GSM386438 1 0.0000 0.961 1.000 0.000
#> GSM386439 1 0.4939 0.897 0.892 0.108
#> GSM386440 1 0.0376 0.960 0.996 0.004
#> GSM386441 1 0.0000 0.961 1.000 0.000
#> GSM386442 1 0.0000 0.961 1.000 0.000
#> GSM386447 1 0.1184 0.954 0.984 0.016
#> GSM386448 1 0.0000 0.961 1.000 0.000
#> GSM386449 1 0.0376 0.960 0.996 0.004
#> GSM386450 1 0.0000 0.961 1.000 0.000
#> GSM386451 1 0.0376 0.960 0.996 0.004
#> GSM386452 1 0.6048 0.864 0.852 0.148
#> GSM386453 1 0.0000 0.961 1.000 0.000
#> GSM386454 1 0.6048 0.864 0.852 0.148
#> GSM386455 1 0.0672 0.959 0.992 0.008
#> GSM386456 1 0.0672 0.959 0.992 0.008
#> GSM386457 1 0.0000 0.961 1.000 0.000
#> GSM386458 1 0.6048 0.864 0.852 0.148
#> GSM386443 2 0.0672 0.958 0.008 0.992
#> GSM386444 2 0.3114 0.959 0.056 0.944
#> GSM386445 2 0.1843 0.973 0.028 0.972
#> GSM386446 2 0.5842 0.869 0.140 0.860
#> GSM386398 1 0.6048 0.864 0.852 0.148
#> GSM386399 1 0.5946 0.867 0.856 0.144
#> GSM386400 1 0.6048 0.864 0.852 0.148
#> GSM386401 1 0.0000 0.961 1.000 0.000
#> GSM386406 1 0.0000 0.961 1.000 0.000
#> GSM386407 1 0.0672 0.959 0.992 0.008
#> GSM386408 1 0.0376 0.960 0.996 0.004
#> GSM386409 1 0.6048 0.864 0.852 0.148
#> GSM386410 1 0.6048 0.864 0.852 0.148
#> GSM386411 1 0.0672 0.959 0.992 0.008
#> GSM386412 1 0.0376 0.960 0.996 0.004
#> GSM386413 1 0.0672 0.959 0.992 0.008
#> GSM386414 1 0.0672 0.959 0.992 0.008
#> GSM386415 1 0.1184 0.956 0.984 0.016
#> GSM386416 1 0.8081 0.739 0.752 0.248
#> GSM386417 1 0.0938 0.958 0.988 0.012
#> GSM386402 2 0.1184 0.974 0.016 0.984
#> GSM386403 2 0.1184 0.974 0.016 0.984
#> GSM386404 2 0.1184 0.974 0.016 0.984
#> GSM386405 2 0.2423 0.968 0.040 0.960
#> GSM386418 1 0.0376 0.960 0.996 0.004
#> GSM386419 1 0.0000 0.961 1.000 0.000
#> GSM386420 1 0.0000 0.961 1.000 0.000
#> GSM386421 1 0.0000 0.961 1.000 0.000
#> GSM386426 1 0.1184 0.954 0.984 0.016
#> GSM386427 1 0.6048 0.864 0.852 0.148
#> GSM386428 1 0.0000 0.961 1.000 0.000
#> GSM386429 1 0.0672 0.959 0.992 0.008
#> GSM386430 1 0.0672 0.959 0.992 0.008
#> GSM386431 1 0.0672 0.959 0.992 0.008
#> GSM386432 1 0.0672 0.959 0.992 0.008
#> GSM386433 1 0.3114 0.927 0.944 0.056
#> GSM386434 1 0.5294 0.863 0.880 0.120
#> GSM386422 2 0.1843 0.973 0.028 0.972
#> GSM386423 2 0.1184 0.974 0.016 0.984
#> GSM386424 2 0.1184 0.974 0.016 0.984
#> GSM386425 2 0.4022 0.938 0.080 0.920
#> GSM386385 1 0.1184 0.954 0.984 0.016
#> GSM386386 1 0.2236 0.946 0.964 0.036
#> GSM386387 1 0.0000 0.961 1.000 0.000
#> GSM386391 1 0.0000 0.961 1.000 0.000
#> GSM386392 1 0.1184 0.954 0.984 0.016
#> GSM386393 1 0.0672 0.959 0.992 0.008
#> GSM386394 1 0.0376 0.960 0.996 0.004
#> GSM386395 1 0.0672 0.959 0.992 0.008
#> GSM386396 1 0.5408 0.858 0.876 0.124
#> GSM386397 1 0.1414 0.953 0.980 0.020
#> GSM386388 2 0.3114 0.959 0.056 0.944
#> GSM386389 2 0.1184 0.974 0.016 0.984
#> GSM386390 2 0.1184 0.974 0.016 0.984
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM386435 2 0.0000 0.996 0.000 1.000 0.000
#> GSM386436 2 0.0000 0.996 0.000 1.000 0.000
#> GSM386437 2 0.1753 0.949 0.048 0.952 0.000
#> GSM386438 2 0.0000 0.996 0.000 1.000 0.000
#> GSM386439 1 0.0000 0.979 1.000 0.000 0.000
#> GSM386440 2 0.0000 0.996 0.000 1.000 0.000
#> GSM386441 2 0.0000 0.996 0.000 1.000 0.000
#> GSM386442 2 0.0000 0.996 0.000 1.000 0.000
#> GSM386447 1 0.1529 0.937 0.960 0.040 0.000
#> GSM386448 2 0.0000 0.996 0.000 1.000 0.000
#> GSM386449 2 0.0000 0.996 0.000 1.000 0.000
#> GSM386450 2 0.0000 0.996 0.000 1.000 0.000
#> GSM386451 2 0.0000 0.996 0.000 1.000 0.000
#> GSM386452 1 0.0000 0.979 1.000 0.000 0.000
#> GSM386453 2 0.0000 0.996 0.000 1.000 0.000
#> GSM386454 1 0.0000 0.979 1.000 0.000 0.000
#> GSM386455 2 0.0000 0.996 0.000 1.000 0.000
#> GSM386456 2 0.0000 0.996 0.000 1.000 0.000
#> GSM386457 2 0.0000 0.996 0.000 1.000 0.000
#> GSM386458 1 0.0000 0.979 1.000 0.000 0.000
#> GSM386443 3 0.0592 0.988 0.012 0.000 0.988
#> GSM386444 3 0.0000 0.999 0.000 0.000 1.000
#> GSM386445 3 0.0000 0.999 0.000 0.000 1.000
#> GSM386446 3 0.0237 0.994 0.000 0.004 0.996
#> GSM386398 1 0.0000 0.979 1.000 0.000 0.000
#> GSM386399 1 0.0000 0.979 1.000 0.000 0.000
#> GSM386400 1 0.0000 0.979 1.000 0.000 0.000
#> GSM386401 2 0.0000 0.996 0.000 1.000 0.000
#> GSM386406 2 0.0000 0.996 0.000 1.000 0.000
#> GSM386407 2 0.0000 0.996 0.000 1.000 0.000
#> GSM386408 2 0.0000 0.996 0.000 1.000 0.000
#> GSM386409 1 0.0000 0.979 1.000 0.000 0.000
#> GSM386410 1 0.0000 0.979 1.000 0.000 0.000
#> GSM386411 2 0.0000 0.996 0.000 1.000 0.000
#> GSM386412 2 0.0424 0.989 0.008 0.992 0.000
#> GSM386413 2 0.0000 0.996 0.000 1.000 0.000
#> GSM386414 2 0.0000 0.996 0.000 1.000 0.000
#> GSM386415 2 0.0000 0.996 0.000 1.000 0.000
#> GSM386416 1 0.3116 0.874 0.892 0.000 0.108
#> GSM386417 2 0.0000 0.996 0.000 1.000 0.000
#> GSM386402 3 0.0000 0.999 0.000 0.000 1.000
#> GSM386403 3 0.0000 0.999 0.000 0.000 1.000
#> GSM386404 3 0.0000 0.999 0.000 0.000 1.000
#> GSM386405 3 0.0000 0.999 0.000 0.000 1.000
#> GSM386418 2 0.0000 0.996 0.000 1.000 0.000
#> GSM386419 2 0.0000 0.996 0.000 1.000 0.000
#> GSM386420 2 0.0000 0.996 0.000 1.000 0.000
#> GSM386421 2 0.0000 0.996 0.000 1.000 0.000
#> GSM386426 1 0.0000 0.979 1.000 0.000 0.000
#> GSM386427 1 0.0000 0.979 1.000 0.000 0.000
#> GSM386428 2 0.0000 0.996 0.000 1.000 0.000
#> GSM386429 2 0.0000 0.996 0.000 1.000 0.000
#> GSM386430 2 0.0000 0.996 0.000 1.000 0.000
#> GSM386431 2 0.0000 0.996 0.000 1.000 0.000
#> GSM386432 2 0.0000 0.996 0.000 1.000 0.000
#> GSM386433 2 0.0000 0.996 0.000 1.000 0.000
#> GSM386434 2 0.0000 0.996 0.000 1.000 0.000
#> GSM386422 3 0.0000 0.999 0.000 0.000 1.000
#> GSM386423 3 0.0000 0.999 0.000 0.000 1.000
#> GSM386424 3 0.0000 0.999 0.000 0.000 1.000
#> GSM386425 3 0.0000 0.999 0.000 0.000 1.000
#> GSM386385 1 0.3116 0.848 0.892 0.108 0.000
#> GSM386386 1 0.0000 0.979 1.000 0.000 0.000
#> GSM386387 2 0.0000 0.996 0.000 1.000 0.000
#> GSM386391 2 0.0000 0.996 0.000 1.000 0.000
#> GSM386392 1 0.0000 0.979 1.000 0.000 0.000
#> GSM386393 2 0.0000 0.996 0.000 1.000 0.000
#> GSM386394 2 0.3038 0.884 0.104 0.896 0.000
#> GSM386395 2 0.0000 0.996 0.000 1.000 0.000
#> GSM386396 2 0.0000 0.996 0.000 1.000 0.000
#> GSM386397 2 0.0000 0.996 0.000 1.000 0.000
#> GSM386388 3 0.0000 0.999 0.000 0.000 1.000
#> GSM386389 3 0.0000 0.999 0.000 0.000 1.000
#> GSM386390 3 0.0000 0.999 0.000 0.000 1.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM386435 2 0.3196 0.653 0.136 0.856 0.000 0.008
#> GSM386436 2 0.0895 0.729 0.020 0.976 0.000 0.004
#> GSM386437 2 0.4328 0.524 0.244 0.748 0.000 0.008
#> GSM386438 2 0.1867 0.711 0.072 0.928 0.000 0.000
#> GSM386439 1 0.1913 0.775 0.940 0.040 0.000 0.020
#> GSM386440 2 0.3768 0.599 0.184 0.808 0.000 0.008
#> GSM386441 2 0.2412 0.703 0.084 0.908 0.000 0.008
#> GSM386442 2 0.0779 0.730 0.016 0.980 0.000 0.004
#> GSM386447 1 0.5050 0.547 0.704 0.268 0.000 0.028
#> GSM386448 2 0.0895 0.730 0.020 0.976 0.000 0.004
#> GSM386449 2 0.0779 0.730 0.016 0.980 0.000 0.004
#> GSM386450 2 0.0336 0.726 0.000 0.992 0.000 0.008
#> GSM386451 2 0.2647 0.677 0.000 0.880 0.000 0.120
#> GSM386452 1 0.4134 0.735 0.740 0.000 0.000 0.260
#> GSM386453 2 0.2976 0.676 0.008 0.872 0.000 0.120
#> GSM386454 1 0.2216 0.778 0.908 0.000 0.000 0.092
#> GSM386455 2 0.2737 0.694 0.008 0.888 0.000 0.104
#> GSM386456 2 0.2179 0.717 0.012 0.924 0.000 0.064
#> GSM386457 2 0.5985 0.570 0.168 0.692 0.000 0.140
#> GSM386458 1 0.2660 0.754 0.908 0.036 0.000 0.056
#> GSM386443 3 0.4509 0.525 0.288 0.000 0.708 0.004
#> GSM386444 3 0.0817 0.920 0.000 0.024 0.976 0.000
#> GSM386445 3 0.0469 0.932 0.000 0.012 0.988 0.000
#> GSM386446 3 0.4720 0.481 0.000 0.324 0.672 0.004
#> GSM386398 1 0.0524 0.779 0.988 0.004 0.000 0.008
#> GSM386399 1 0.1913 0.782 0.940 0.020 0.000 0.040
#> GSM386400 1 0.0672 0.777 0.984 0.008 0.000 0.008
#> GSM386401 2 0.2662 0.697 0.084 0.900 0.000 0.016
#> GSM386406 2 0.2814 0.653 0.000 0.868 0.000 0.132
#> GSM386407 2 0.4985 -0.181 0.000 0.532 0.000 0.468
#> GSM386408 2 0.2919 0.704 0.060 0.896 0.000 0.044
#> GSM386409 1 0.4936 0.716 0.672 0.012 0.000 0.316
#> GSM386410 1 0.4535 0.724 0.704 0.004 0.000 0.292
#> GSM386411 2 0.4790 0.182 0.000 0.620 0.000 0.380
#> GSM386412 4 0.5821 0.436 0.032 0.432 0.000 0.536
#> GSM386413 2 0.4585 0.324 0.000 0.668 0.000 0.332
#> GSM386414 2 0.4800 0.328 0.004 0.656 0.000 0.340
#> GSM386415 2 0.4776 0.194 0.000 0.624 0.000 0.376
#> GSM386416 1 0.4895 0.694 0.796 0.012 0.072 0.120
#> GSM386417 2 0.2814 0.666 0.000 0.868 0.000 0.132
#> GSM386402 3 0.0000 0.942 0.000 0.000 1.000 0.000
#> GSM386403 3 0.0000 0.942 0.000 0.000 1.000 0.000
#> GSM386404 3 0.0000 0.942 0.000 0.000 1.000 0.000
#> GSM386405 3 0.0000 0.942 0.000 0.000 1.000 0.000
#> GSM386418 2 0.2647 0.663 0.000 0.880 0.000 0.120
#> GSM386419 2 0.1211 0.722 0.000 0.960 0.000 0.040
#> GSM386420 2 0.1389 0.718 0.000 0.952 0.000 0.048
#> GSM386421 2 0.2408 0.677 0.000 0.896 0.000 0.104
#> GSM386426 1 0.5823 0.655 0.608 0.044 0.000 0.348
#> GSM386427 1 0.5004 0.658 0.604 0.004 0.000 0.392
#> GSM386428 2 0.3942 0.501 0.000 0.764 0.000 0.236
#> GSM386429 4 0.4817 0.564 0.000 0.388 0.000 0.612
#> GSM386430 4 0.4790 0.575 0.000 0.380 0.000 0.620
#> GSM386431 4 0.4522 0.636 0.000 0.320 0.000 0.680
#> GSM386432 2 0.4961 -0.118 0.000 0.552 0.000 0.448
#> GSM386433 2 0.4072 0.498 0.000 0.748 0.000 0.252
#> GSM386434 2 0.4804 0.166 0.000 0.616 0.000 0.384
#> GSM386422 3 0.0000 0.942 0.000 0.000 1.000 0.000
#> GSM386423 3 0.0000 0.942 0.000 0.000 1.000 0.000
#> GSM386424 3 0.0000 0.942 0.000 0.000 1.000 0.000
#> GSM386425 3 0.0000 0.942 0.000 0.000 1.000 0.000
#> GSM386385 1 0.6574 0.319 0.532 0.384 0.000 0.084
#> GSM386386 4 0.6010 -0.593 0.472 0.040 0.000 0.488
#> GSM386387 2 0.1118 0.723 0.000 0.964 0.000 0.036
#> GSM386391 4 0.4981 0.384 0.000 0.464 0.000 0.536
#> GSM386392 1 0.5712 0.676 0.644 0.048 0.000 0.308
#> GSM386393 4 0.3074 0.627 0.000 0.152 0.000 0.848
#> GSM386394 4 0.1624 0.444 0.020 0.028 0.000 0.952
#> GSM386395 4 0.2921 0.622 0.000 0.140 0.000 0.860
#> GSM386396 4 0.4730 0.605 0.000 0.364 0.000 0.636
#> GSM386397 4 0.4477 0.640 0.000 0.312 0.000 0.688
#> GSM386388 3 0.0000 0.942 0.000 0.000 1.000 0.000
#> GSM386389 3 0.0000 0.942 0.000 0.000 1.000 0.000
#> GSM386390 3 0.0000 0.942 0.000 0.000 1.000 0.000
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM386435 2 0.2040 0.8582 0.032 0.928 0.000 0.008 0.032
#> GSM386436 2 0.1485 0.8752 0.000 0.948 0.000 0.020 0.032
#> GSM386437 2 0.2861 0.8220 0.064 0.888 0.000 0.024 0.024
#> GSM386438 2 0.1281 0.8698 0.012 0.956 0.000 0.000 0.032
#> GSM386439 1 0.6706 0.6469 0.588 0.224 0.000 0.060 0.128
#> GSM386440 2 0.2927 0.8260 0.048 0.888 0.000 0.036 0.028
#> GSM386441 2 0.2082 0.8640 0.016 0.928 0.000 0.024 0.032
#> GSM386442 2 0.1386 0.8743 0.000 0.952 0.000 0.016 0.032
#> GSM386447 1 0.6267 0.3954 0.500 0.400 0.000 0.064 0.036
#> GSM386448 2 0.2645 0.8394 0.000 0.888 0.000 0.044 0.068
#> GSM386449 2 0.2654 0.8439 0.000 0.888 0.000 0.048 0.064
#> GSM386450 2 0.3437 0.7922 0.000 0.832 0.000 0.048 0.120
#> GSM386451 5 0.5288 0.4192 0.000 0.100 0.000 0.244 0.656
#> GSM386452 1 0.3226 0.6695 0.852 0.000 0.000 0.088 0.060
#> GSM386453 5 0.4800 0.4351 0.000 0.052 0.000 0.272 0.676
#> GSM386454 1 0.3882 0.6279 0.756 0.000 0.000 0.020 0.224
#> GSM386455 5 0.3593 0.4108 0.000 0.084 0.000 0.088 0.828
#> GSM386456 5 0.3888 0.3535 0.000 0.148 0.000 0.056 0.796
#> GSM386457 5 0.1799 0.3558 0.020 0.012 0.000 0.028 0.940
#> GSM386458 5 0.4891 -0.1280 0.316 0.000 0.000 0.044 0.640
#> GSM386443 3 0.3003 0.7419 0.188 0.000 0.812 0.000 0.000
#> GSM386444 3 0.0451 0.9515 0.000 0.008 0.988 0.000 0.004
#> GSM386445 3 0.0162 0.9585 0.000 0.000 0.996 0.000 0.004
#> GSM386446 3 0.4434 0.6304 0.000 0.208 0.736 0.000 0.056
#> GSM386398 1 0.6612 0.6109 0.564 0.088 0.000 0.060 0.288
#> GSM386399 1 0.5052 0.6964 0.732 0.176 0.000 0.060 0.032
#> GSM386400 1 0.7181 0.6001 0.492 0.140 0.000 0.060 0.308
#> GSM386401 2 0.0404 0.8728 0.000 0.988 0.000 0.000 0.012
#> GSM386406 2 0.3433 0.8337 0.024 0.832 0.000 0.136 0.008
#> GSM386407 4 0.4818 -0.1315 0.000 0.020 0.000 0.520 0.460
#> GSM386408 2 0.1568 0.8698 0.020 0.944 0.000 0.036 0.000
#> GSM386409 1 0.2674 0.6950 0.868 0.012 0.000 0.120 0.000
#> GSM386410 1 0.2612 0.6777 0.868 0.000 0.000 0.124 0.008
#> GSM386411 5 0.4904 0.1950 0.000 0.024 0.000 0.472 0.504
#> GSM386412 4 0.6173 -0.0155 0.136 0.000 0.000 0.468 0.396
#> GSM386413 5 0.5028 0.2845 0.000 0.032 0.000 0.444 0.524
#> GSM386414 5 0.4499 0.2858 0.004 0.004 0.000 0.408 0.584
#> GSM386415 5 0.4798 0.2907 0.000 0.020 0.000 0.440 0.540
#> GSM386416 5 0.6323 0.1910 0.220 0.000 0.000 0.252 0.528
#> GSM386417 5 0.5353 0.3815 0.000 0.064 0.000 0.360 0.576
#> GSM386402 3 0.0000 0.9615 0.000 0.000 1.000 0.000 0.000
#> GSM386403 3 0.0000 0.9615 0.000 0.000 1.000 0.000 0.000
#> GSM386404 3 0.0000 0.9615 0.000 0.000 1.000 0.000 0.000
#> GSM386405 3 0.0000 0.9615 0.000 0.000 1.000 0.000 0.000
#> GSM386418 2 0.3248 0.8303 0.040 0.852 0.000 0.104 0.004
#> GSM386419 2 0.1990 0.8714 0.004 0.920 0.000 0.068 0.008
#> GSM386420 2 0.1956 0.8642 0.008 0.916 0.000 0.076 0.000
#> GSM386421 2 0.2824 0.8451 0.032 0.872 0.000 0.096 0.000
#> GSM386426 1 0.6174 0.5333 0.552 0.256 0.000 0.192 0.000
#> GSM386427 1 0.2848 0.6706 0.840 0.000 0.000 0.156 0.004
#> GSM386428 2 0.3769 0.8043 0.028 0.796 0.000 0.172 0.004
#> GSM386429 4 0.4527 0.4702 0.000 0.036 0.000 0.692 0.272
#> GSM386430 4 0.4728 0.4907 0.000 0.060 0.000 0.700 0.240
#> GSM386431 4 0.3937 0.4958 0.004 0.008 0.000 0.736 0.252
#> GSM386432 4 0.4905 -0.2081 0.000 0.024 0.000 0.500 0.476
#> GSM386433 5 0.4982 0.3317 0.000 0.032 0.000 0.412 0.556
#> GSM386434 5 0.5083 0.3077 0.000 0.036 0.000 0.432 0.532
#> GSM386422 3 0.0000 0.9615 0.000 0.000 1.000 0.000 0.000
#> GSM386423 3 0.0000 0.9615 0.000 0.000 1.000 0.000 0.000
#> GSM386424 3 0.0000 0.9615 0.000 0.000 1.000 0.000 0.000
#> GSM386425 3 0.0000 0.9615 0.000 0.000 1.000 0.000 0.000
#> GSM386385 2 0.4321 0.5461 0.252 0.720 0.000 0.024 0.004
#> GSM386386 1 0.6007 0.6300 0.564 0.152 0.000 0.284 0.000
#> GSM386387 2 0.1282 0.8760 0.000 0.952 0.000 0.044 0.004
#> GSM386391 2 0.4375 0.7370 0.032 0.728 0.000 0.236 0.004
#> GSM386392 1 0.6158 0.4725 0.528 0.316 0.000 0.156 0.000
#> GSM386393 4 0.3216 0.4389 0.044 0.108 0.000 0.848 0.000
#> GSM386394 4 0.3146 0.3858 0.128 0.028 0.000 0.844 0.000
#> GSM386395 4 0.3242 0.4334 0.040 0.116 0.000 0.844 0.000
#> GSM386396 4 0.4147 0.4018 0.000 0.008 0.000 0.676 0.316
#> GSM386397 4 0.3891 0.5144 0.008 0.028 0.000 0.792 0.172
#> GSM386388 3 0.0000 0.9615 0.000 0.000 1.000 0.000 0.000
#> GSM386389 3 0.0000 0.9615 0.000 0.000 1.000 0.000 0.000
#> GSM386390 3 0.0000 0.9615 0.000 0.000 1.000 0.000 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM386435 2 0.2033 0.770 0.020 0.916 0.000 0.004 0.004 0.056
#> GSM386436 2 0.1452 0.776 0.008 0.948 0.000 0.004 0.008 0.032
#> GSM386437 2 0.1899 0.782 0.032 0.928 0.000 0.004 0.008 0.028
#> GSM386438 2 0.0837 0.780 0.004 0.972 0.000 0.004 0.000 0.020
#> GSM386439 1 0.2699 0.688 0.856 0.124 0.000 0.000 0.012 0.008
#> GSM386440 2 0.3558 0.741 0.192 0.780 0.000 0.004 0.016 0.008
#> GSM386441 2 0.2783 0.773 0.056 0.884 0.000 0.008 0.024 0.028
#> GSM386442 2 0.1760 0.779 0.028 0.936 0.000 0.004 0.012 0.020
#> GSM386447 2 0.6620 0.468 0.208 0.552 0.000 0.016 0.164 0.060
#> GSM386448 2 0.3568 0.721 0.072 0.836 0.000 0.020 0.012 0.060
#> GSM386449 2 0.3406 0.772 0.080 0.840 0.000 0.020 0.004 0.056
#> GSM386450 2 0.3794 0.707 0.076 0.824 0.000 0.024 0.016 0.060
#> GSM386451 4 0.6448 -0.508 0.016 0.252 0.000 0.440 0.004 0.288
#> GSM386452 5 0.3799 0.778 0.276 0.000 0.000 0.000 0.704 0.020
#> GSM386453 4 0.5413 -0.698 0.012 0.060 0.000 0.508 0.008 0.412
#> GSM386454 5 0.4668 0.721 0.316 0.000 0.000 0.000 0.620 0.064
#> GSM386455 4 0.6103 -0.623 0.012 0.180 0.000 0.420 0.000 0.388
#> GSM386456 4 0.6332 -0.440 0.012 0.332 0.000 0.400 0.000 0.256
#> GSM386457 6 0.5431 0.759 0.024 0.036 0.000 0.436 0.012 0.492
#> GSM386458 6 0.6634 0.775 0.060 0.020 0.000 0.336 0.096 0.488
#> GSM386443 3 0.5454 0.259 0.192 0.000 0.572 0.000 0.236 0.000
#> GSM386444 3 0.0000 0.945 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386445 3 0.0000 0.945 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386446 3 0.4836 0.653 0.016 0.168 0.740 0.024 0.032 0.020
#> GSM386398 1 0.4141 0.394 0.756 0.008 0.000 0.000 0.156 0.080
#> GSM386399 1 0.2954 0.681 0.844 0.108 0.000 0.000 0.048 0.000
#> GSM386400 1 0.3780 0.580 0.816 0.048 0.000 0.000 0.068 0.068
#> GSM386401 2 0.3592 0.756 0.156 0.800 0.000 0.004 0.028 0.012
#> GSM386406 2 0.5347 0.659 0.172 0.684 0.000 0.008 0.044 0.092
#> GSM386407 4 0.2632 0.507 0.000 0.000 0.000 0.832 0.004 0.164
#> GSM386408 2 0.5574 0.359 0.372 0.536 0.000 0.004 0.040 0.048
#> GSM386409 5 0.3695 0.785 0.244 0.024 0.000 0.000 0.732 0.000
#> GSM386410 5 0.3411 0.796 0.232 0.004 0.000 0.000 0.756 0.008
#> GSM386411 4 0.1092 0.451 0.000 0.020 0.000 0.960 0.000 0.020
#> GSM386412 4 0.2030 0.411 0.000 0.000 0.000 0.908 0.028 0.064
#> GSM386413 4 0.1606 0.406 0.004 0.056 0.000 0.932 0.000 0.008
#> GSM386414 4 0.1349 0.398 0.000 0.004 0.000 0.940 0.000 0.056
#> GSM386415 4 0.1826 0.383 0.000 0.020 0.000 0.924 0.004 0.052
#> GSM386416 4 0.6210 -0.484 0.136 0.000 0.000 0.548 0.056 0.260
#> GSM386417 4 0.4998 -0.278 0.008 0.112 0.000 0.656 0.000 0.224
#> GSM386402 3 0.0000 0.945 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386403 3 0.0146 0.944 0.000 0.000 0.996 0.000 0.004 0.000
#> GSM386404 3 0.0291 0.943 0.000 0.000 0.992 0.000 0.004 0.004
#> GSM386405 3 0.0000 0.945 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386418 2 0.4331 0.734 0.116 0.776 0.000 0.004 0.048 0.056
#> GSM386419 2 0.1787 0.784 0.032 0.932 0.000 0.000 0.016 0.020
#> GSM386420 2 0.2515 0.778 0.072 0.888 0.000 0.000 0.016 0.024
#> GSM386421 2 0.4276 0.735 0.124 0.776 0.000 0.004 0.036 0.060
#> GSM386426 1 0.6178 0.569 0.588 0.208 0.000 0.020 0.028 0.156
#> GSM386427 5 0.2584 0.761 0.144 0.004 0.000 0.000 0.848 0.004
#> GSM386428 2 0.5974 0.527 0.224 0.596 0.000 0.004 0.044 0.132
#> GSM386429 4 0.4227 0.513 0.004 0.020 0.000 0.632 0.000 0.344
#> GSM386430 4 0.3912 0.517 0.000 0.012 0.000 0.648 0.000 0.340
#> GSM386431 4 0.3835 0.517 0.000 0.000 0.000 0.668 0.012 0.320
#> GSM386432 4 0.3183 0.516 0.004 0.008 0.000 0.788 0.000 0.200
#> GSM386433 4 0.2036 0.366 0.000 0.016 0.000 0.912 0.008 0.064
#> GSM386434 4 0.2197 0.406 0.000 0.044 0.000 0.900 0.000 0.056
#> GSM386422 3 0.0000 0.945 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386423 3 0.0405 0.942 0.000 0.000 0.988 0.000 0.008 0.004
#> GSM386424 3 0.0000 0.945 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386425 3 0.0000 0.945 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386385 2 0.5420 0.308 0.392 0.524 0.000 0.000 0.048 0.036
#> GSM386386 5 0.4463 0.442 0.048 0.164 0.000 0.000 0.744 0.044
#> GSM386387 2 0.2001 0.784 0.044 0.920 0.000 0.000 0.020 0.016
#> GSM386391 2 0.6307 0.567 0.116 0.612 0.000 0.016 0.088 0.168
#> GSM386392 1 0.5837 0.581 0.612 0.228 0.000 0.008 0.036 0.116
#> GSM386393 4 0.5220 0.453 0.008 0.004 0.000 0.520 0.060 0.408
#> GSM386394 4 0.6271 0.367 0.008 0.004 0.000 0.420 0.216 0.352
#> GSM386395 4 0.5227 0.449 0.008 0.000 0.000 0.512 0.072 0.408
#> GSM386396 4 0.4008 0.518 0.000 0.016 0.000 0.672 0.004 0.308
#> GSM386397 4 0.3996 0.508 0.004 0.000 0.000 0.636 0.008 0.352
#> GSM386388 3 0.0146 0.944 0.000 0.000 0.996 0.000 0.000 0.004
#> GSM386389 3 0.0405 0.942 0.000 0.000 0.988 0.000 0.008 0.004
#> GSM386390 3 0.0146 0.944 0.000 0.000 0.996 0.000 0.000 0.004
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
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 agent(p) dose(p) time(p) k
#> SD:NMF 74 0.5740 0.94660 1.50e-14 2
#> SD:NMF 74 0.5349 0.90033 5.44e-13 3
#> SD:NMF 60 0.0321 0.00337 8.79e-12 4
#> SD:NMF 48 0.3798 0.35112 4.13e-16 5
#> SD:NMF 52 0.0620 0.33339 4.60e-14 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 51941 rows and 74 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'CV' method.
#> Subgroups are detected by 'hclust' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 2.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
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.414 0.793 0.894 0.3659 0.689 0.689
#> 3 3 0.351 0.656 0.811 0.2110 0.991 0.987
#> 4 4 0.377 0.692 0.801 0.2995 0.772 0.666
#> 5 5 0.486 0.675 0.819 0.0536 0.997 0.994
#> 6 6 0.591 0.459 0.724 0.1893 0.782 0.533
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 2
Following shows the table of the partitions (You need to click the show/hide
code output link to see it). The membership matrix (columns with name p*
)
is inferred by
clue::cl_consensus()
function with the SE
method. Basically the value in the membership matrix
represents the probability to belong to a certain group. The finall class
label for an item is determined with the group with highest probability it
belongs to.
In get_classes()
function, the entropy is calculated from the membership
matrix and the silhouette score is calculated from the consensus matrix.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> GSM386435 2 0.000 0.871 0.000 1.000
#> GSM386436 2 0.000 0.871 0.000 1.000
#> GSM386437 2 0.000 0.871 0.000 1.000
#> GSM386438 2 0.000 0.871 0.000 1.000
#> GSM386439 2 0.998 0.133 0.476 0.524
#> GSM386440 2 0.000 0.871 0.000 1.000
#> GSM386441 2 0.000 0.871 0.000 1.000
#> GSM386442 2 0.000 0.871 0.000 1.000
#> GSM386447 2 0.821 0.678 0.256 0.744
#> GSM386448 2 0.000 0.871 0.000 1.000
#> GSM386449 2 0.000 0.871 0.000 1.000
#> GSM386450 2 0.000 0.871 0.000 1.000
#> GSM386451 2 0.000 0.871 0.000 1.000
#> GSM386452 1 0.000 0.897 1.000 0.000
#> GSM386453 2 0.000 0.871 0.000 1.000
#> GSM386454 1 0.000 0.897 1.000 0.000
#> GSM386455 2 0.000 0.871 0.000 1.000
#> GSM386456 2 0.000 0.871 0.000 1.000
#> GSM386457 2 0.163 0.865 0.024 0.976
#> GSM386458 2 0.821 0.678 0.256 0.744
#> GSM386443 1 0.000 0.897 1.000 0.000
#> GSM386444 2 0.000 0.871 0.000 1.000
#> GSM386445 2 0.000 0.871 0.000 1.000
#> GSM386446 2 0.000 0.871 0.000 1.000
#> GSM386398 1 0.000 0.897 1.000 0.000
#> GSM386399 2 0.998 0.133 0.476 0.524
#> GSM386400 1 0.000 0.897 1.000 0.000
#> GSM386401 2 0.000 0.871 0.000 1.000
#> GSM386406 2 0.697 0.799 0.188 0.812
#> GSM386407 2 0.689 0.802 0.184 0.816
#> GSM386408 2 0.000 0.871 0.000 1.000
#> GSM386409 1 0.781 0.681 0.768 0.232
#> GSM386410 1 0.000 0.897 1.000 0.000
#> GSM386411 2 0.689 0.802 0.184 0.816
#> GSM386412 2 0.821 0.678 0.256 0.744
#> GSM386413 2 0.689 0.802 0.184 0.816
#> GSM386414 2 0.775 0.710 0.228 0.772
#> GSM386415 2 0.662 0.808 0.172 0.828
#> GSM386416 2 0.775 0.710 0.228 0.772
#> GSM386417 2 0.000 0.871 0.000 1.000
#> GSM386402 2 0.000 0.871 0.000 1.000
#> GSM386403 2 0.000 0.871 0.000 1.000
#> GSM386404 2 0.000 0.871 0.000 1.000
#> GSM386405 2 0.000 0.871 0.000 1.000
#> GSM386418 2 0.697 0.799 0.188 0.812
#> GSM386419 2 0.163 0.866 0.024 0.976
#> GSM386420 2 0.163 0.866 0.024 0.976
#> GSM386421 2 0.697 0.799 0.188 0.812
#> GSM386426 1 0.881 0.547 0.700 0.300
#> GSM386427 1 0.000 0.897 1.000 0.000
#> GSM386428 2 0.697 0.799 0.188 0.812
#> GSM386429 2 0.689 0.802 0.184 0.816
#> GSM386430 2 0.689 0.802 0.184 0.816
#> GSM386431 2 0.689 0.802 0.184 0.816
#> GSM386432 2 0.689 0.802 0.184 0.816
#> GSM386433 2 0.662 0.808 0.172 0.828
#> GSM386434 2 0.662 0.808 0.172 0.828
#> GSM386422 2 0.000 0.871 0.000 1.000
#> GSM386423 1 0.000 0.897 1.000 0.000
#> GSM386424 2 0.000 0.871 0.000 1.000
#> GSM386425 2 0.000 0.871 0.000 1.000
#> GSM386385 2 0.987 0.279 0.432 0.568
#> GSM386386 1 0.781 0.681 0.768 0.232
#> GSM386387 2 0.000 0.871 0.000 1.000
#> GSM386391 2 0.714 0.792 0.196 0.804
#> GSM386392 1 0.881 0.547 0.700 0.300
#> GSM386393 2 0.913 0.634 0.328 0.672
#> GSM386394 1 0.000 0.897 1.000 0.000
#> GSM386395 2 0.913 0.634 0.328 0.672
#> GSM386396 2 0.913 0.634 0.328 0.672
#> GSM386397 2 0.913 0.634 0.328 0.672
#> GSM386388 2 0.000 0.871 0.000 1.000
#> GSM386389 1 0.000 0.897 1.000 0.000
#> GSM386390 2 0.000 0.871 0.000 1.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM386435 2 0.0000 0.815 0.000 1.000 0.000
#> GSM386436 2 0.0000 0.815 0.000 1.000 0.000
#> GSM386437 2 0.0000 0.815 0.000 1.000 0.000
#> GSM386438 2 0.0000 0.815 0.000 1.000 0.000
#> GSM386439 2 0.9355 0.173 0.252 0.516 0.232
#> GSM386440 2 0.0000 0.815 0.000 1.000 0.000
#> GSM386441 2 0.0000 0.815 0.000 1.000 0.000
#> GSM386442 2 0.0000 0.815 0.000 1.000 0.000
#> GSM386447 2 0.6710 0.646 0.196 0.732 0.072
#> GSM386448 2 0.0000 0.815 0.000 1.000 0.000
#> GSM386449 2 0.0000 0.815 0.000 1.000 0.000
#> GSM386450 2 0.0000 0.815 0.000 1.000 0.000
#> GSM386451 2 0.3551 0.786 0.000 0.868 0.132
#> GSM386452 1 0.0000 0.262 1.000 0.000 0.000
#> GSM386453 2 0.3551 0.786 0.000 0.868 0.132
#> GSM386454 1 0.0000 0.262 1.000 0.000 0.000
#> GSM386455 2 0.3551 0.786 0.000 0.868 0.132
#> GSM386456 2 0.3551 0.786 0.000 0.868 0.132
#> GSM386457 2 0.4390 0.789 0.012 0.840 0.148
#> GSM386458 2 0.6710 0.646 0.196 0.732 0.072
#> GSM386443 1 0.1643 0.267 0.956 0.000 0.044
#> GSM386444 2 0.4002 0.774 0.000 0.840 0.160
#> GSM386445 2 0.4002 0.774 0.000 0.840 0.160
#> GSM386446 2 0.4002 0.774 0.000 0.840 0.160
#> GSM386398 3 0.6305 1.000 0.484 0.000 0.516
#> GSM386399 2 0.9355 0.173 0.252 0.516 0.232
#> GSM386400 3 0.6305 1.000 0.484 0.000 0.516
#> GSM386401 2 0.0000 0.815 0.000 1.000 0.000
#> GSM386406 2 0.4968 0.760 0.012 0.800 0.188
#> GSM386407 2 0.4682 0.761 0.004 0.804 0.192
#> GSM386408 2 0.0237 0.815 0.000 0.996 0.004
#> GSM386409 1 0.9608 0.142 0.468 0.232 0.300
#> GSM386410 1 0.0000 0.262 1.000 0.000 0.000
#> GSM386411 2 0.4682 0.761 0.004 0.804 0.192
#> GSM386412 2 0.6710 0.646 0.196 0.732 0.072
#> GSM386413 2 0.4682 0.761 0.004 0.804 0.192
#> GSM386414 2 0.6245 0.676 0.180 0.760 0.060
#> GSM386415 2 0.4521 0.767 0.004 0.816 0.180
#> GSM386416 2 0.6245 0.676 0.180 0.760 0.060
#> GSM386417 2 0.3752 0.789 0.000 0.856 0.144
#> GSM386402 2 0.4002 0.774 0.000 0.840 0.160
#> GSM386403 2 0.4002 0.774 0.000 0.840 0.160
#> GSM386404 2 0.4002 0.774 0.000 0.840 0.160
#> GSM386405 2 0.4002 0.774 0.000 0.840 0.160
#> GSM386418 2 0.4968 0.760 0.012 0.800 0.188
#> GSM386419 2 0.1411 0.811 0.000 0.964 0.036
#> GSM386420 2 0.1411 0.811 0.000 0.964 0.036
#> GSM386421 2 0.4968 0.760 0.012 0.800 0.188
#> GSM386426 1 0.9964 0.131 0.368 0.296 0.336
#> GSM386427 1 0.0000 0.262 1.000 0.000 0.000
#> GSM386428 2 0.4968 0.760 0.012 0.800 0.188
#> GSM386429 2 0.4682 0.761 0.004 0.804 0.192
#> GSM386430 2 0.4682 0.761 0.004 0.804 0.192
#> GSM386431 2 0.4682 0.761 0.004 0.804 0.192
#> GSM386432 2 0.4682 0.761 0.004 0.804 0.192
#> GSM386433 2 0.4521 0.767 0.004 0.816 0.180
#> GSM386434 2 0.4521 0.767 0.004 0.816 0.180
#> GSM386422 2 0.4002 0.774 0.000 0.840 0.160
#> GSM386423 1 0.1643 0.267 0.956 0.000 0.044
#> GSM386424 2 0.4002 0.774 0.000 0.840 0.160
#> GSM386425 2 0.4002 0.774 0.000 0.840 0.160
#> GSM386385 2 0.9052 0.288 0.216 0.556 0.228
#> GSM386386 1 0.9608 0.142 0.468 0.232 0.300
#> GSM386387 2 0.0000 0.815 0.000 1.000 0.000
#> GSM386391 2 0.5072 0.754 0.012 0.792 0.196
#> GSM386392 1 0.9964 0.131 0.368 0.296 0.336
#> GSM386393 2 0.7277 0.621 0.060 0.660 0.280
#> GSM386394 1 0.5650 0.122 0.688 0.000 0.312
#> GSM386395 2 0.7277 0.621 0.060 0.660 0.280
#> GSM386396 2 0.7277 0.621 0.060 0.660 0.280
#> GSM386397 2 0.7277 0.621 0.060 0.660 0.280
#> GSM386388 2 0.4002 0.774 0.000 0.840 0.160
#> GSM386389 1 0.1643 0.267 0.956 0.000 0.044
#> GSM386390 2 0.4002 0.774 0.000 0.840 0.160
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM386435 2 0.2760 0.7497 0.000 0.872 0.128 0.000
#> GSM386436 2 0.2760 0.7497 0.000 0.872 0.128 0.000
#> GSM386437 2 0.2760 0.7497 0.000 0.872 0.128 0.000
#> GSM386438 2 0.2760 0.7497 0.000 0.872 0.128 0.000
#> GSM386439 2 0.5399 -0.0961 0.012 0.520 0.000 0.468
#> GSM386440 2 0.2760 0.7497 0.000 0.872 0.128 0.000
#> GSM386441 2 0.2760 0.7497 0.000 0.872 0.128 0.000
#> GSM386442 2 0.2760 0.7497 0.000 0.872 0.128 0.000
#> GSM386447 2 0.4898 0.5316 0.000 0.716 0.024 0.260
#> GSM386448 2 0.2760 0.7497 0.000 0.872 0.128 0.000
#> GSM386449 2 0.2760 0.7497 0.000 0.872 0.128 0.000
#> GSM386450 2 0.2760 0.7497 0.000 0.872 0.128 0.000
#> GSM386451 2 0.4382 0.5818 0.000 0.704 0.296 0.000
#> GSM386452 1 0.3024 0.8088 0.852 0.000 0.000 0.148
#> GSM386453 2 0.4382 0.5818 0.000 0.704 0.296 0.000
#> GSM386454 1 0.3024 0.8088 0.852 0.000 0.000 0.148
#> GSM386455 2 0.4382 0.5818 0.000 0.704 0.296 0.000
#> GSM386456 2 0.4382 0.5818 0.000 0.704 0.296 0.000
#> GSM386457 2 0.4872 0.6192 0.000 0.728 0.244 0.028
#> GSM386458 2 0.4898 0.5316 0.000 0.716 0.024 0.260
#> GSM386443 1 0.0336 0.8184 0.992 0.000 0.008 0.000
#> GSM386444 3 0.2973 1.0000 0.000 0.144 0.856 0.000
#> GSM386445 3 0.2973 1.0000 0.000 0.144 0.856 0.000
#> GSM386446 3 0.2973 1.0000 0.000 0.144 0.856 0.000
#> GSM386398 4 0.3978 0.1128 0.192 0.000 0.012 0.796
#> GSM386399 2 0.5399 -0.0961 0.012 0.520 0.000 0.468
#> GSM386400 4 0.3978 0.1128 0.192 0.000 0.012 0.796
#> GSM386401 2 0.2760 0.7497 0.000 0.872 0.128 0.000
#> GSM386406 2 0.2949 0.7251 0.000 0.888 0.024 0.088
#> GSM386407 2 0.2610 0.7251 0.000 0.900 0.012 0.088
#> GSM386408 2 0.2704 0.7502 0.000 0.876 0.124 0.000
#> GSM386409 4 0.8070 0.5724 0.280 0.236 0.016 0.468
#> GSM386410 1 0.2814 0.8220 0.868 0.000 0.000 0.132
#> GSM386411 2 0.2610 0.7251 0.000 0.900 0.012 0.088
#> GSM386412 2 0.4898 0.5316 0.000 0.716 0.024 0.260
#> GSM386413 2 0.2610 0.7251 0.000 0.900 0.012 0.088
#> GSM386414 2 0.4678 0.5675 0.000 0.744 0.024 0.232
#> GSM386415 2 0.2480 0.7302 0.000 0.904 0.008 0.088
#> GSM386416 2 0.4678 0.5675 0.000 0.744 0.024 0.232
#> GSM386417 2 0.4250 0.6055 0.000 0.724 0.276 0.000
#> GSM386402 3 0.2973 1.0000 0.000 0.144 0.856 0.000
#> GSM386403 3 0.2973 1.0000 0.000 0.144 0.856 0.000
#> GSM386404 3 0.2973 1.0000 0.000 0.144 0.856 0.000
#> GSM386405 3 0.2973 1.0000 0.000 0.144 0.856 0.000
#> GSM386418 2 0.2949 0.7251 0.000 0.888 0.024 0.088
#> GSM386419 2 0.2053 0.7531 0.000 0.924 0.072 0.004
#> GSM386420 2 0.2053 0.7531 0.000 0.924 0.072 0.004
#> GSM386421 2 0.2949 0.7251 0.000 0.888 0.024 0.088
#> GSM386426 4 0.7586 0.6043 0.152 0.304 0.016 0.528
#> GSM386427 1 0.2814 0.8220 0.868 0.000 0.000 0.132
#> GSM386428 2 0.2949 0.7251 0.000 0.888 0.024 0.088
#> GSM386429 2 0.2610 0.7251 0.000 0.900 0.012 0.088
#> GSM386430 2 0.2610 0.7251 0.000 0.900 0.012 0.088
#> GSM386431 2 0.2610 0.7251 0.000 0.900 0.012 0.088
#> GSM386432 2 0.2610 0.7251 0.000 0.900 0.012 0.088
#> GSM386433 2 0.2480 0.7302 0.000 0.904 0.008 0.088
#> GSM386434 2 0.2480 0.7302 0.000 0.904 0.008 0.088
#> GSM386422 3 0.2973 1.0000 0.000 0.144 0.856 0.000
#> GSM386423 1 0.0336 0.8184 0.992 0.000 0.008 0.000
#> GSM386424 3 0.2973 1.0000 0.000 0.144 0.856 0.000
#> GSM386425 3 0.2973 1.0000 0.000 0.144 0.856 0.000
#> GSM386385 2 0.5244 0.0565 0.000 0.556 0.008 0.436
#> GSM386386 4 0.8070 0.5724 0.280 0.236 0.016 0.468
#> GSM386387 2 0.2760 0.7497 0.000 0.872 0.128 0.000
#> GSM386391 2 0.2909 0.7151 0.000 0.888 0.020 0.092
#> GSM386392 4 0.7586 0.6043 0.152 0.304 0.016 0.528
#> GSM386393 2 0.5228 0.5627 0.000 0.756 0.124 0.120
#> GSM386394 1 0.7831 0.3691 0.604 0.084 0.124 0.188
#> GSM386395 2 0.5228 0.5627 0.000 0.756 0.124 0.120
#> GSM386396 2 0.5228 0.5627 0.000 0.756 0.124 0.120
#> GSM386397 2 0.5228 0.5627 0.000 0.756 0.124 0.120
#> GSM386388 3 0.2973 1.0000 0.000 0.144 0.856 0.000
#> GSM386389 1 0.0336 0.8184 0.992 0.000 0.008 0.000
#> GSM386390 3 0.2973 1.0000 0.000 0.144 0.856 0.000
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM386435 2 0.225 0.7540 0.000 0.896 0.096 0.008 0.000
#> GSM386436 2 0.225 0.7540 0.000 0.896 0.096 0.008 0.000
#> GSM386437 2 0.225 0.7540 0.000 0.896 0.096 0.008 0.000
#> GSM386438 2 0.225 0.7540 0.000 0.896 0.096 0.008 0.000
#> GSM386439 2 0.445 -0.0961 0.480 0.516 0.000 0.004 0.000
#> GSM386440 2 0.225 0.7540 0.000 0.896 0.096 0.008 0.000
#> GSM386441 2 0.225 0.7540 0.000 0.896 0.096 0.008 0.000
#> GSM386442 2 0.225 0.7540 0.000 0.896 0.096 0.008 0.000
#> GSM386447 2 0.359 0.5315 0.264 0.736 0.000 0.000 0.000
#> GSM386448 2 0.225 0.7540 0.000 0.896 0.096 0.008 0.000
#> GSM386449 2 0.225 0.7540 0.000 0.896 0.096 0.008 0.000
#> GSM386450 2 0.225 0.7540 0.000 0.896 0.096 0.008 0.000
#> GSM386451 2 0.416 0.6108 0.008 0.728 0.252 0.012 0.000
#> GSM386452 5 0.560 0.7625 0.244 0.000 0.008 0.104 0.644
#> GSM386453 2 0.416 0.6108 0.008 0.728 0.252 0.012 0.000
#> GSM386454 5 0.560 0.7625 0.244 0.000 0.008 0.104 0.644
#> GSM386455 2 0.416 0.6108 0.008 0.728 0.252 0.012 0.000
#> GSM386456 2 0.416 0.6108 0.008 0.728 0.252 0.012 0.000
#> GSM386457 2 0.433 0.6240 0.036 0.752 0.204 0.008 0.000
#> GSM386458 2 0.359 0.5315 0.264 0.736 0.000 0.000 0.000
#> GSM386443 5 0.000 0.7068 0.000 0.000 0.000 0.000 1.000
#> GSM386444 3 0.165 0.9763 0.008 0.036 0.944 0.012 0.000
#> GSM386445 3 0.165 0.9763 0.008 0.036 0.944 0.012 0.000
#> GSM386446 3 0.165 0.9763 0.008 0.036 0.944 0.012 0.000
#> GSM386398 1 0.522 0.0232 0.660 0.000 0.032 0.280 0.028
#> GSM386399 2 0.445 -0.0961 0.480 0.516 0.000 0.004 0.000
#> GSM386400 1 0.522 0.0232 0.660 0.000 0.032 0.280 0.028
#> GSM386401 2 0.225 0.7540 0.000 0.896 0.096 0.008 0.000
#> GSM386406 2 0.319 0.7310 0.080 0.864 0.008 0.048 0.000
#> GSM386407 2 0.285 0.7298 0.072 0.876 0.000 0.052 0.000
#> GSM386408 2 0.219 0.7543 0.000 0.900 0.092 0.008 0.000
#> GSM386409 1 0.654 0.4712 0.604 0.232 0.000 0.076 0.088
#> GSM386410 5 0.571 0.7647 0.220 0.000 0.008 0.128 0.644
#> GSM386411 2 0.285 0.7298 0.072 0.876 0.000 0.052 0.000
#> GSM386412 2 0.359 0.5315 0.264 0.736 0.000 0.000 0.000
#> GSM386413 2 0.285 0.7298 0.072 0.876 0.000 0.052 0.000
#> GSM386414 2 0.340 0.5673 0.236 0.764 0.000 0.000 0.000
#> GSM386415 2 0.263 0.7347 0.072 0.888 0.000 0.040 0.000
#> GSM386416 2 0.340 0.5673 0.236 0.764 0.000 0.000 0.000
#> GSM386417 2 0.403 0.6257 0.008 0.748 0.232 0.012 0.000
#> GSM386402 3 0.088 0.9921 0.000 0.032 0.968 0.000 0.000
#> GSM386403 3 0.088 0.9921 0.000 0.032 0.968 0.000 0.000
#> GSM386404 3 0.088 0.9921 0.000 0.032 0.968 0.000 0.000
#> GSM386405 3 0.088 0.9921 0.000 0.032 0.968 0.000 0.000
#> GSM386418 2 0.319 0.7310 0.080 0.864 0.008 0.048 0.000
#> GSM386419 2 0.159 0.7570 0.004 0.940 0.052 0.004 0.000
#> GSM386420 2 0.159 0.7570 0.004 0.940 0.052 0.004 0.000
#> GSM386421 2 0.319 0.7310 0.080 0.864 0.008 0.048 0.000
#> GSM386426 1 0.468 0.4966 0.664 0.300 0.000 0.036 0.000
#> GSM386427 5 0.571 0.7647 0.220 0.000 0.008 0.128 0.644
#> GSM386428 2 0.319 0.7310 0.080 0.864 0.008 0.048 0.000
#> GSM386429 2 0.285 0.7298 0.072 0.876 0.000 0.052 0.000
#> GSM386430 2 0.285 0.7298 0.072 0.876 0.000 0.052 0.000
#> GSM386431 2 0.285 0.7298 0.072 0.876 0.000 0.052 0.000
#> GSM386432 2 0.285 0.7298 0.072 0.876 0.000 0.052 0.000
#> GSM386433 2 0.263 0.7347 0.072 0.888 0.000 0.040 0.000
#> GSM386434 2 0.263 0.7347 0.072 0.888 0.000 0.040 0.000
#> GSM386422 3 0.088 0.9921 0.000 0.032 0.968 0.000 0.000
#> GSM386423 5 0.000 0.7068 0.000 0.000 0.000 0.000 1.000
#> GSM386424 3 0.088 0.9921 0.000 0.032 0.968 0.000 0.000
#> GSM386425 3 0.088 0.9921 0.000 0.032 0.968 0.000 0.000
#> GSM386385 2 0.452 0.0524 0.440 0.552 0.008 0.000 0.000
#> GSM386386 1 0.654 0.4712 0.604 0.232 0.000 0.076 0.088
#> GSM386387 2 0.225 0.7540 0.000 0.896 0.096 0.008 0.000
#> GSM386391 2 0.304 0.7229 0.080 0.864 0.000 0.056 0.000
#> GSM386392 1 0.468 0.4966 0.664 0.300 0.000 0.036 0.000
#> GSM386393 2 0.467 0.5875 0.088 0.732 0.000 0.180 0.000
#> GSM386394 4 0.467 0.0000 0.232 0.060 0.000 0.708 0.000
#> GSM386395 2 0.467 0.5875 0.088 0.732 0.000 0.180 0.000
#> GSM386396 2 0.467 0.5875 0.088 0.732 0.000 0.180 0.000
#> GSM386397 2 0.467 0.5875 0.088 0.732 0.000 0.180 0.000
#> GSM386388 3 0.088 0.9921 0.000 0.032 0.968 0.000 0.000
#> GSM386389 5 0.000 0.7068 0.000 0.000 0.000 0.000 1.000
#> GSM386390 3 0.088 0.9921 0.000 0.032 0.968 0.000 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM386435 2 0.000 0.601 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM386436 2 0.000 0.601 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM386437 2 0.000 0.601 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM386438 2 0.000 0.601 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM386439 1 0.377 0.580 0.720 0.256 0.000 0.000 0.000 0.024
#> GSM386440 2 0.000 0.601 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM386441 2 0.000 0.601 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM386442 2 0.000 0.601 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM386447 1 0.509 0.558 0.516 0.424 0.000 0.040 0.000 0.020
#> GSM386448 2 0.000 0.601 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM386449 2 0.000 0.601 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM386450 2 0.000 0.601 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM386451 2 0.356 0.506 0.044 0.832 0.024 0.008 0.000 0.092
#> GSM386452 5 0.564 0.712 0.160 0.000 0.000 0.020 0.600 0.220
#> GSM386453 2 0.356 0.506 0.044 0.832 0.024 0.008 0.000 0.092
#> GSM386454 5 0.564 0.712 0.160 0.000 0.000 0.020 0.600 0.220
#> GSM386455 2 0.356 0.506 0.044 0.832 0.024 0.008 0.000 0.092
#> GSM386456 2 0.356 0.506 0.044 0.832 0.024 0.008 0.000 0.092
#> GSM386457 2 0.503 0.468 0.084 0.740 0.024 0.048 0.000 0.104
#> GSM386458 1 0.509 0.558 0.516 0.424 0.000 0.040 0.000 0.020
#> GSM386443 5 0.000 0.683 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM386444 3 0.422 0.797 0.044 0.064 0.792 0.008 0.000 0.092
#> GSM386445 3 0.422 0.797 0.044 0.064 0.792 0.008 0.000 0.092
#> GSM386446 3 0.422 0.797 0.044 0.064 0.792 0.008 0.000 0.092
#> GSM386398 6 0.345 1.000 0.308 0.000 0.000 0.000 0.000 0.692
#> GSM386399 1 0.377 0.580 0.720 0.256 0.000 0.000 0.000 0.024
#> GSM386400 6 0.345 1.000 0.308 0.000 0.000 0.000 0.000 0.692
#> GSM386401 2 0.000 0.601 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM386406 4 0.526 0.677 0.096 0.440 0.000 0.464 0.000 0.000
#> GSM386407 2 0.387 -0.494 0.000 0.508 0.000 0.492 0.000 0.000
#> GSM386408 2 0.026 0.595 0.000 0.992 0.000 0.008 0.000 0.000
#> GSM386409 1 0.468 0.233 0.776 0.044 0.004 0.060 0.088 0.028
#> GSM386410 5 0.583 0.719 0.144 0.000 0.000 0.040 0.600 0.216
#> GSM386411 2 0.387 -0.494 0.000 0.508 0.000 0.492 0.000 0.000
#> GSM386412 1 0.509 0.558 0.516 0.424 0.000 0.040 0.000 0.020
#> GSM386413 2 0.387 -0.494 0.000 0.508 0.000 0.492 0.000 0.000
#> GSM386414 2 0.493 -0.397 0.420 0.528 0.000 0.040 0.000 0.012
#> GSM386415 2 0.399 -0.462 0.000 0.528 0.000 0.468 0.000 0.004
#> GSM386416 2 0.493 -0.397 0.420 0.528 0.000 0.040 0.000 0.012
#> GSM386417 2 0.587 0.330 0.044 0.644 0.024 0.192 0.000 0.096
#> GSM386402 3 0.026 0.937 0.000 0.008 0.992 0.000 0.000 0.000
#> GSM386403 3 0.026 0.937 0.000 0.008 0.992 0.000 0.000 0.000
#> GSM386404 3 0.026 0.937 0.000 0.008 0.992 0.000 0.000 0.000
#> GSM386405 3 0.026 0.937 0.000 0.008 0.992 0.000 0.000 0.000
#> GSM386418 4 0.526 0.677 0.096 0.440 0.000 0.464 0.000 0.000
#> GSM386419 2 0.230 0.499 0.020 0.884 0.000 0.096 0.000 0.000
#> GSM386420 2 0.230 0.499 0.020 0.884 0.000 0.096 0.000 0.000
#> GSM386421 4 0.526 0.677 0.096 0.440 0.000 0.464 0.000 0.000
#> GSM386426 1 0.222 0.361 0.908 0.048 0.004 0.036 0.000 0.004
#> GSM386427 5 0.583 0.719 0.144 0.000 0.000 0.040 0.600 0.216
#> GSM386428 4 0.526 0.677 0.096 0.440 0.000 0.464 0.000 0.000
#> GSM386429 2 0.387 -0.494 0.000 0.508 0.000 0.492 0.000 0.000
#> GSM386430 2 0.387 -0.494 0.000 0.508 0.000 0.492 0.000 0.000
#> GSM386431 2 0.387 -0.494 0.000 0.508 0.000 0.492 0.000 0.000
#> GSM386432 2 0.387 -0.494 0.000 0.508 0.000 0.492 0.000 0.000
#> GSM386433 2 0.399 -0.462 0.000 0.528 0.000 0.468 0.000 0.004
#> GSM386434 2 0.399 -0.462 0.000 0.528 0.000 0.468 0.000 0.004
#> GSM386422 3 0.026 0.937 0.000 0.008 0.992 0.000 0.000 0.000
#> GSM386423 5 0.000 0.683 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM386424 3 0.026 0.937 0.000 0.008 0.992 0.000 0.000 0.000
#> GSM386425 3 0.026 0.937 0.000 0.008 0.992 0.000 0.000 0.000
#> GSM386385 1 0.386 0.587 0.692 0.292 0.000 0.008 0.000 0.008
#> GSM386386 1 0.468 0.233 0.776 0.044 0.004 0.060 0.088 0.028
#> GSM386387 2 0.000 0.601 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM386391 4 0.525 0.679 0.096 0.424 0.000 0.480 0.000 0.000
#> GSM386392 1 0.222 0.361 0.908 0.048 0.004 0.036 0.000 0.004
#> GSM386393 4 0.365 0.696 0.000 0.360 0.000 0.640 0.000 0.000
#> GSM386394 4 0.560 -0.509 0.224 0.000 0.008 0.580 0.000 0.188
#> GSM386395 4 0.365 0.696 0.000 0.360 0.000 0.640 0.000 0.000
#> GSM386396 4 0.365 0.696 0.000 0.360 0.000 0.640 0.000 0.000
#> GSM386397 4 0.365 0.696 0.000 0.360 0.000 0.640 0.000 0.000
#> GSM386388 3 0.026 0.937 0.000 0.008 0.992 0.000 0.000 0.000
#> GSM386389 5 0.000 0.683 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM386390 3 0.026 0.937 0.000 0.008 0.992 0.000 0.000 0.000
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
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 agent(p) dose(p) time(p) k
#> CV:hclust 71 0.47762 0.54789 3.47e-01 2
#> CV:hclust 59 0.58813 0.16360 1.08e-01 3
#> CV:hclust 68 0.57018 0.76185 2.33e-09 4
#> CV:hclust 64 0.64526 0.97100 5.99e-09 5
#> CV:hclust 53 0.00589 0.00218 1.18e-05 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 51941 rows and 74 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.521 0.844 0.888 0.3560 0.641 0.641
#> 3 3 0.900 0.936 0.947 0.6000 0.777 0.656
#> 4 4 0.767 0.936 0.902 0.2379 0.830 0.606
#> 5 5 0.805 0.729 0.845 0.0944 0.972 0.895
#> 6 6 0.796 0.701 0.798 0.0437 0.925 0.710
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
#> GSM386435 2 0.000 0.902 0.000 1.000
#> GSM386436 2 0.000 0.902 0.000 1.000
#> GSM386437 2 0.000 0.902 0.000 1.000
#> GSM386438 2 0.000 0.902 0.000 1.000
#> GSM386439 1 0.881 0.917 0.700 0.300
#> GSM386440 2 0.000 0.902 0.000 1.000
#> GSM386441 2 0.000 0.902 0.000 1.000
#> GSM386442 2 0.000 0.902 0.000 1.000
#> GSM386447 2 0.000 0.902 0.000 1.000
#> GSM386448 2 0.000 0.902 0.000 1.000
#> GSM386449 2 0.000 0.902 0.000 1.000
#> GSM386450 2 0.000 0.902 0.000 1.000
#> GSM386451 2 0.000 0.902 0.000 1.000
#> GSM386452 1 0.881 0.917 0.700 0.300
#> GSM386453 2 0.000 0.902 0.000 1.000
#> GSM386454 1 0.881 0.917 0.700 0.300
#> GSM386455 2 0.000 0.902 0.000 1.000
#> GSM386456 2 0.000 0.902 0.000 1.000
#> GSM386457 2 0.000 0.902 0.000 1.000
#> GSM386458 2 0.494 0.772 0.108 0.892
#> GSM386443 1 0.000 0.670 1.000 0.000
#> GSM386444 2 0.886 0.623 0.304 0.696
#> GSM386445 2 0.886 0.623 0.304 0.696
#> GSM386446 2 0.881 0.626 0.300 0.700
#> GSM386398 1 0.881 0.917 0.700 0.300
#> GSM386399 1 0.881 0.917 0.700 0.300
#> GSM386400 1 0.881 0.917 0.700 0.300
#> GSM386401 2 0.000 0.902 0.000 1.000
#> GSM386406 2 0.000 0.902 0.000 1.000
#> GSM386407 2 0.000 0.902 0.000 1.000
#> GSM386408 2 0.000 0.902 0.000 1.000
#> GSM386409 1 0.881 0.917 0.700 0.300
#> GSM386410 1 0.881 0.917 0.700 0.300
#> GSM386411 2 0.000 0.902 0.000 1.000
#> GSM386412 2 0.000 0.902 0.000 1.000
#> GSM386413 2 0.000 0.902 0.000 1.000
#> GSM386414 2 0.000 0.902 0.000 1.000
#> GSM386415 2 0.000 0.902 0.000 1.000
#> GSM386416 1 0.881 0.917 0.700 0.300
#> GSM386417 2 0.000 0.902 0.000 1.000
#> GSM386402 2 0.929 0.588 0.344 0.656
#> GSM386403 2 0.929 0.588 0.344 0.656
#> GSM386404 2 0.929 0.588 0.344 0.656
#> GSM386405 2 0.929 0.588 0.344 0.656
#> GSM386418 2 0.000 0.902 0.000 1.000
#> GSM386419 2 0.000 0.902 0.000 1.000
#> GSM386420 2 0.000 0.902 0.000 1.000
#> GSM386421 2 0.000 0.902 0.000 1.000
#> GSM386426 1 0.881 0.917 0.700 0.300
#> GSM386427 1 0.881 0.917 0.700 0.300
#> GSM386428 2 0.000 0.902 0.000 1.000
#> GSM386429 2 0.000 0.902 0.000 1.000
#> GSM386430 2 0.000 0.902 0.000 1.000
#> GSM386431 2 0.000 0.902 0.000 1.000
#> GSM386432 2 0.000 0.902 0.000 1.000
#> GSM386433 2 0.000 0.902 0.000 1.000
#> GSM386434 2 0.000 0.902 0.000 1.000
#> GSM386422 2 0.929 0.588 0.344 0.656
#> GSM386423 1 0.000 0.670 1.000 0.000
#> GSM386424 2 0.929 0.588 0.344 0.656
#> GSM386425 2 0.929 0.588 0.344 0.656
#> GSM386385 2 0.000 0.902 0.000 1.000
#> GSM386386 1 0.881 0.917 0.700 0.300
#> GSM386387 2 0.000 0.902 0.000 1.000
#> GSM386391 2 0.000 0.902 0.000 1.000
#> GSM386392 1 0.881 0.917 0.700 0.300
#> GSM386393 2 0.000 0.902 0.000 1.000
#> GSM386394 1 0.881 0.917 0.700 0.300
#> GSM386395 2 0.000 0.902 0.000 1.000
#> GSM386396 2 0.000 0.902 0.000 1.000
#> GSM386397 2 0.000 0.902 0.000 1.000
#> GSM386388 2 0.929 0.588 0.344 0.656
#> GSM386389 1 0.000 0.670 1.000 0.000
#> GSM386390 2 0.929 0.588 0.344 0.656
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM386435 2 0.2681 0.955 0.028 0.932 0.040
#> GSM386436 2 0.2681 0.955 0.028 0.932 0.040
#> GSM386437 2 0.2681 0.955 0.028 0.932 0.040
#> GSM386438 2 0.2681 0.955 0.028 0.932 0.040
#> GSM386439 1 0.1877 0.902 0.956 0.032 0.012
#> GSM386440 2 0.2681 0.955 0.028 0.932 0.040
#> GSM386441 2 0.2681 0.955 0.028 0.932 0.040
#> GSM386442 2 0.2681 0.955 0.028 0.932 0.040
#> GSM386447 2 0.2261 0.940 0.068 0.932 0.000
#> GSM386448 2 0.2681 0.955 0.028 0.932 0.040
#> GSM386449 2 0.2681 0.955 0.028 0.932 0.040
#> GSM386450 2 0.2550 0.956 0.024 0.936 0.040
#> GSM386451 2 0.1950 0.956 0.008 0.952 0.040
#> GSM386452 1 0.1031 0.920 0.976 0.000 0.024
#> GSM386453 2 0.1950 0.956 0.008 0.952 0.040
#> GSM386454 1 0.1411 0.919 0.964 0.000 0.036
#> GSM386455 2 0.1950 0.956 0.008 0.952 0.040
#> GSM386456 2 0.1950 0.956 0.008 0.952 0.040
#> GSM386457 2 0.1950 0.956 0.008 0.952 0.040
#> GSM386458 1 0.6969 0.334 0.596 0.380 0.024
#> GSM386443 1 0.2448 0.894 0.924 0.000 0.076
#> GSM386444 3 0.1765 0.985 0.004 0.040 0.956
#> GSM386445 3 0.1765 0.985 0.004 0.040 0.956
#> GSM386446 3 0.1643 0.981 0.000 0.044 0.956
#> GSM386398 1 0.1620 0.915 0.964 0.012 0.024
#> GSM386399 1 0.1482 0.915 0.968 0.012 0.020
#> GSM386400 1 0.1620 0.915 0.964 0.012 0.024
#> GSM386401 2 0.2681 0.955 0.028 0.932 0.040
#> GSM386406 2 0.1163 0.956 0.028 0.972 0.000
#> GSM386407 2 0.1482 0.949 0.020 0.968 0.012
#> GSM386408 2 0.2681 0.955 0.028 0.932 0.040
#> GSM386409 1 0.0424 0.920 0.992 0.000 0.008
#> GSM386410 1 0.0892 0.919 0.980 0.000 0.020
#> GSM386411 2 0.1482 0.949 0.020 0.968 0.012
#> GSM386412 2 0.1482 0.949 0.020 0.968 0.012
#> GSM386413 2 0.1482 0.949 0.020 0.968 0.012
#> GSM386414 2 0.1482 0.949 0.020 0.968 0.012
#> GSM386415 2 0.1482 0.949 0.020 0.968 0.012
#> GSM386416 1 0.2050 0.903 0.952 0.028 0.020
#> GSM386417 2 0.1753 0.954 0.000 0.952 0.048
#> GSM386402 3 0.1585 0.995 0.008 0.028 0.964
#> GSM386403 3 0.1585 0.995 0.008 0.028 0.964
#> GSM386404 3 0.1585 0.995 0.008 0.028 0.964
#> GSM386405 3 0.1585 0.995 0.008 0.028 0.964
#> GSM386418 2 0.1411 0.955 0.036 0.964 0.000
#> GSM386419 2 0.2564 0.956 0.028 0.936 0.036
#> GSM386420 2 0.2681 0.955 0.028 0.932 0.040
#> GSM386421 2 0.1163 0.956 0.028 0.972 0.000
#> GSM386426 1 0.0000 0.919 1.000 0.000 0.000
#> GSM386427 1 0.0892 0.919 0.980 0.000 0.020
#> GSM386428 2 0.1411 0.955 0.036 0.964 0.000
#> GSM386429 2 0.1482 0.949 0.020 0.968 0.012
#> GSM386430 2 0.1482 0.949 0.020 0.968 0.012
#> GSM386431 2 0.1482 0.949 0.020 0.968 0.012
#> GSM386432 2 0.1482 0.949 0.020 0.968 0.012
#> GSM386433 2 0.1482 0.949 0.020 0.968 0.012
#> GSM386434 2 0.1482 0.949 0.020 0.968 0.012
#> GSM386422 3 0.1585 0.995 0.008 0.028 0.964
#> GSM386423 1 0.4750 0.741 0.784 0.000 0.216
#> GSM386424 3 0.1585 0.995 0.008 0.028 0.964
#> GSM386425 3 0.1585 0.995 0.008 0.028 0.964
#> GSM386385 2 0.3042 0.950 0.040 0.920 0.040
#> GSM386386 1 0.0237 0.919 0.996 0.000 0.004
#> GSM386387 2 0.2681 0.955 0.028 0.932 0.040
#> GSM386391 2 0.1989 0.952 0.048 0.948 0.004
#> GSM386392 1 0.0000 0.919 1.000 0.000 0.000
#> GSM386393 2 0.1482 0.949 0.020 0.968 0.012
#> GSM386394 1 0.3045 0.867 0.916 0.064 0.020
#> GSM386395 2 0.1482 0.949 0.020 0.968 0.012
#> GSM386396 2 0.1482 0.949 0.020 0.968 0.012
#> GSM386397 2 0.1482 0.949 0.020 0.968 0.012
#> GSM386388 3 0.1585 0.995 0.008 0.028 0.964
#> GSM386389 1 0.4750 0.741 0.784 0.000 0.216
#> GSM386390 3 0.1585 0.995 0.008 0.028 0.964
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM386435 2 0.0000 0.983 0.000 1.000 0.000 0.000
#> GSM386436 2 0.0000 0.983 0.000 1.000 0.000 0.000
#> GSM386437 2 0.0000 0.983 0.000 1.000 0.000 0.000
#> GSM386438 2 0.0000 0.983 0.000 1.000 0.000 0.000
#> GSM386439 1 0.3485 0.792 0.856 0.116 0.000 0.028
#> GSM386440 2 0.0000 0.983 0.000 1.000 0.000 0.000
#> GSM386441 2 0.0000 0.983 0.000 1.000 0.000 0.000
#> GSM386442 2 0.0000 0.983 0.000 1.000 0.000 0.000
#> GSM386447 2 0.2563 0.876 0.072 0.908 0.000 0.020
#> GSM386448 2 0.0000 0.983 0.000 1.000 0.000 0.000
#> GSM386449 2 0.0000 0.983 0.000 1.000 0.000 0.000
#> GSM386450 2 0.0000 0.983 0.000 1.000 0.000 0.000
#> GSM386451 2 0.0707 0.968 0.000 0.980 0.000 0.020
#> GSM386452 1 0.2345 0.871 0.900 0.000 0.000 0.100
#> GSM386453 2 0.0469 0.974 0.000 0.988 0.000 0.012
#> GSM386454 1 0.2011 0.875 0.920 0.000 0.000 0.080
#> GSM386455 2 0.1022 0.957 0.000 0.968 0.000 0.032
#> GSM386456 2 0.1022 0.957 0.000 0.968 0.000 0.032
#> GSM386457 2 0.1022 0.957 0.000 0.968 0.000 0.032
#> GSM386458 1 0.5219 0.660 0.728 0.216 0.000 0.056
#> GSM386443 1 0.3356 0.841 0.824 0.000 0.000 0.176
#> GSM386444 3 0.1022 0.969 0.000 0.000 0.968 0.032
#> GSM386445 3 0.1022 0.969 0.000 0.000 0.968 0.032
#> GSM386446 3 0.1022 0.969 0.000 0.000 0.968 0.032
#> GSM386398 1 0.0592 0.878 0.984 0.000 0.000 0.016
#> GSM386399 1 0.0817 0.876 0.976 0.000 0.000 0.024
#> GSM386400 1 0.0592 0.878 0.984 0.000 0.000 0.016
#> GSM386401 2 0.0000 0.983 0.000 1.000 0.000 0.000
#> GSM386406 2 0.0000 0.983 0.000 1.000 0.000 0.000
#> GSM386407 4 0.4103 0.987 0.000 0.256 0.000 0.744
#> GSM386408 2 0.0000 0.983 0.000 1.000 0.000 0.000
#> GSM386409 1 0.0469 0.879 0.988 0.000 0.000 0.012
#> GSM386410 1 0.2281 0.872 0.904 0.000 0.000 0.096
#> GSM386411 4 0.4134 0.986 0.000 0.260 0.000 0.740
#> GSM386412 4 0.3975 0.977 0.000 0.240 0.000 0.760
#> GSM386413 4 0.4134 0.986 0.000 0.260 0.000 0.740
#> GSM386414 4 0.3873 0.970 0.000 0.228 0.000 0.772
#> GSM386415 4 0.4008 0.983 0.000 0.244 0.000 0.756
#> GSM386416 1 0.2704 0.833 0.876 0.000 0.000 0.124
#> GSM386417 4 0.3873 0.963 0.000 0.228 0.000 0.772
#> GSM386402 3 0.0000 0.981 0.000 0.000 1.000 0.000
#> GSM386403 3 0.1940 0.940 0.000 0.000 0.924 0.076
#> GSM386404 3 0.1940 0.940 0.000 0.000 0.924 0.076
#> GSM386405 3 0.0000 0.981 0.000 0.000 1.000 0.000
#> GSM386418 2 0.0000 0.983 0.000 1.000 0.000 0.000
#> GSM386419 2 0.0000 0.983 0.000 1.000 0.000 0.000
#> GSM386420 2 0.0000 0.983 0.000 1.000 0.000 0.000
#> GSM386421 2 0.0000 0.983 0.000 1.000 0.000 0.000
#> GSM386426 1 0.1022 0.877 0.968 0.000 0.000 0.032
#> GSM386427 1 0.2281 0.872 0.904 0.000 0.000 0.096
#> GSM386428 2 0.0000 0.983 0.000 1.000 0.000 0.000
#> GSM386429 4 0.4134 0.986 0.000 0.260 0.000 0.740
#> GSM386430 4 0.4134 0.986 0.000 0.260 0.000 0.740
#> GSM386431 4 0.4040 0.984 0.000 0.248 0.000 0.752
#> GSM386432 4 0.4134 0.986 0.000 0.260 0.000 0.740
#> GSM386433 4 0.4040 0.983 0.000 0.248 0.000 0.752
#> GSM386434 4 0.4040 0.983 0.000 0.248 0.000 0.752
#> GSM386422 3 0.0000 0.981 0.000 0.000 1.000 0.000
#> GSM386423 1 0.6750 0.624 0.612 0.000 0.208 0.180
#> GSM386424 3 0.0000 0.981 0.000 0.000 1.000 0.000
#> GSM386425 3 0.0000 0.981 0.000 0.000 1.000 0.000
#> GSM386385 2 0.2563 0.876 0.072 0.908 0.000 0.020
#> GSM386386 1 0.2081 0.878 0.916 0.000 0.000 0.084
#> GSM386387 2 0.0000 0.983 0.000 1.000 0.000 0.000
#> GSM386391 2 0.0000 0.983 0.000 1.000 0.000 0.000
#> GSM386392 1 0.1022 0.877 0.968 0.000 0.000 0.032
#> GSM386393 4 0.4040 0.985 0.000 0.248 0.000 0.752
#> GSM386394 1 0.4697 0.664 0.644 0.000 0.000 0.356
#> GSM386395 4 0.4040 0.985 0.000 0.248 0.000 0.752
#> GSM386396 4 0.4103 0.987 0.000 0.256 0.000 0.744
#> GSM386397 4 0.4103 0.987 0.000 0.256 0.000 0.744
#> GSM386388 3 0.0000 0.981 0.000 0.000 1.000 0.000
#> GSM386389 1 0.6750 0.624 0.612 0.000 0.208 0.180
#> GSM386390 3 0.0000 0.981 0.000 0.000 1.000 0.000
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM386435 2 0.0000 0.8745 0.000 1.000 0.000 0.000 0.000
#> GSM386436 2 0.0000 0.8745 0.000 1.000 0.000 0.000 0.000
#> GSM386437 2 0.0162 0.8741 0.000 0.996 0.000 0.000 0.004
#> GSM386438 2 0.0000 0.8745 0.000 1.000 0.000 0.000 0.000
#> GSM386439 1 0.3189 0.6583 0.868 0.056 0.000 0.012 0.064
#> GSM386440 2 0.0000 0.8745 0.000 1.000 0.000 0.000 0.000
#> GSM386441 2 0.0000 0.8745 0.000 1.000 0.000 0.000 0.000
#> GSM386442 2 0.0000 0.8745 0.000 1.000 0.000 0.000 0.000
#> GSM386447 2 0.4335 0.6736 0.168 0.760 0.000 0.000 0.072
#> GSM386448 2 0.0000 0.8745 0.000 1.000 0.000 0.000 0.000
#> GSM386449 2 0.0000 0.8745 0.000 1.000 0.000 0.000 0.000
#> GSM386450 2 0.0000 0.8745 0.000 1.000 0.000 0.000 0.000
#> GSM386451 2 0.4505 0.4706 0.000 0.604 0.000 0.012 0.384
#> GSM386452 1 0.3596 0.6409 0.776 0.000 0.000 0.012 0.212
#> GSM386453 2 0.4494 0.4758 0.000 0.608 0.000 0.012 0.380
#> GSM386454 1 0.4042 0.6679 0.756 0.000 0.000 0.032 0.212
#> GSM386455 2 0.4537 0.4554 0.000 0.592 0.000 0.012 0.396
#> GSM386456 2 0.4537 0.4554 0.000 0.592 0.000 0.012 0.396
#> GSM386457 2 0.4537 0.4554 0.000 0.592 0.000 0.012 0.396
#> GSM386458 5 0.6932 0.0172 0.312 0.212 0.000 0.016 0.460
#> GSM386443 1 0.4793 0.2639 0.544 0.000 0.000 0.020 0.436
#> GSM386444 3 0.2690 0.8146 0.000 0.000 0.844 0.000 0.156
#> GSM386445 3 0.2690 0.8146 0.000 0.000 0.844 0.000 0.156
#> GSM386446 3 0.2690 0.8146 0.000 0.000 0.844 0.000 0.156
#> GSM386398 1 0.2144 0.7252 0.912 0.000 0.000 0.020 0.068
#> GSM386399 1 0.1740 0.7201 0.932 0.000 0.000 0.012 0.056
#> GSM386400 1 0.2144 0.7252 0.912 0.000 0.000 0.020 0.068
#> GSM386401 2 0.0000 0.8745 0.000 1.000 0.000 0.000 0.000
#> GSM386406 2 0.0963 0.8690 0.000 0.964 0.000 0.000 0.036
#> GSM386407 4 0.4134 0.8201 0.000 0.044 0.000 0.760 0.196
#> GSM386408 2 0.0963 0.8690 0.000 0.964 0.000 0.000 0.036
#> GSM386409 1 0.0404 0.7355 0.988 0.000 0.000 0.000 0.012
#> GSM386410 1 0.3596 0.6409 0.776 0.000 0.000 0.012 0.212
#> GSM386411 4 0.4204 0.8196 0.000 0.048 0.000 0.756 0.196
#> GSM386412 4 0.4568 0.8135 0.016 0.036 0.000 0.740 0.208
#> GSM386413 4 0.4204 0.8196 0.000 0.048 0.000 0.756 0.196
#> GSM386414 4 0.4316 0.8181 0.004 0.040 0.000 0.748 0.208
#> GSM386415 4 0.4468 0.8026 0.000 0.044 0.000 0.716 0.240
#> GSM386416 1 0.5941 0.1802 0.592 0.000 0.000 0.228 0.180
#> GSM386417 4 0.5542 0.5848 0.000 0.072 0.000 0.532 0.396
#> GSM386402 3 0.0000 0.9152 0.000 0.000 1.000 0.000 0.000
#> GSM386403 3 0.2561 0.8079 0.000 0.000 0.856 0.000 0.144
#> GSM386404 3 0.2561 0.8079 0.000 0.000 0.856 0.000 0.144
#> GSM386405 3 0.0000 0.9152 0.000 0.000 1.000 0.000 0.000
#> GSM386418 2 0.1043 0.8674 0.000 0.960 0.000 0.000 0.040
#> GSM386419 2 0.0963 0.8690 0.000 0.964 0.000 0.000 0.036
#> GSM386420 2 0.0963 0.8690 0.000 0.964 0.000 0.000 0.036
#> GSM386421 2 0.1043 0.8674 0.000 0.960 0.000 0.000 0.040
#> GSM386426 1 0.1478 0.7140 0.936 0.000 0.000 0.000 0.064
#> GSM386427 1 0.3659 0.6377 0.768 0.000 0.000 0.012 0.220
#> GSM386428 2 0.1043 0.8674 0.000 0.960 0.000 0.000 0.040
#> GSM386429 4 0.1121 0.7889 0.000 0.044 0.000 0.956 0.000
#> GSM386430 4 0.1121 0.7889 0.000 0.044 0.000 0.956 0.000
#> GSM386431 4 0.1408 0.7853 0.000 0.044 0.000 0.948 0.008
#> GSM386432 4 0.4204 0.8196 0.000 0.048 0.000 0.756 0.196
#> GSM386433 4 0.4495 0.8004 0.000 0.044 0.000 0.712 0.244
#> GSM386434 4 0.4495 0.8004 0.000 0.044 0.000 0.712 0.244
#> GSM386422 3 0.0000 0.9152 0.000 0.000 1.000 0.000 0.000
#> GSM386423 5 0.6900 0.3226 0.312 0.000 0.224 0.012 0.452
#> GSM386424 3 0.0000 0.9152 0.000 0.000 1.000 0.000 0.000
#> GSM386425 3 0.0000 0.9152 0.000 0.000 1.000 0.000 0.000
#> GSM386385 2 0.3794 0.7100 0.152 0.800 0.000 0.000 0.048
#> GSM386386 1 0.2890 0.6952 0.836 0.000 0.000 0.004 0.160
#> GSM386387 2 0.0794 0.8705 0.000 0.972 0.000 0.000 0.028
#> GSM386391 2 0.2127 0.8191 0.000 0.892 0.000 0.000 0.108
#> GSM386392 1 0.1478 0.7140 0.936 0.000 0.000 0.000 0.064
#> GSM386393 4 0.2830 0.7427 0.000 0.044 0.000 0.876 0.080
#> GSM386394 4 0.6744 -0.2989 0.332 0.000 0.000 0.400 0.268
#> GSM386395 4 0.2830 0.7427 0.000 0.044 0.000 0.876 0.080
#> GSM386396 4 0.1121 0.7889 0.000 0.044 0.000 0.956 0.000
#> GSM386397 4 0.1121 0.7889 0.000 0.044 0.000 0.956 0.000
#> GSM386388 3 0.0000 0.9152 0.000 0.000 1.000 0.000 0.000
#> GSM386389 5 0.6900 0.3226 0.312 0.000 0.224 0.012 0.452
#> GSM386390 3 0.0000 0.9152 0.000 0.000 1.000 0.000 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM386435 2 0.1196 0.9211 0.000 0.952 0.000 0.000 0.008 0.040
#> GSM386436 2 0.0713 0.9255 0.000 0.972 0.000 0.000 0.000 0.028
#> GSM386437 2 0.0713 0.9255 0.000 0.972 0.000 0.000 0.000 0.028
#> GSM386438 2 0.0713 0.9255 0.000 0.972 0.000 0.000 0.000 0.028
#> GSM386439 1 0.6673 0.5727 0.412 0.028 0.000 0.008 0.348 0.204
#> GSM386440 2 0.1333 0.9179 0.000 0.944 0.000 0.000 0.008 0.048
#> GSM386441 2 0.1333 0.9179 0.000 0.944 0.000 0.000 0.008 0.048
#> GSM386442 2 0.1049 0.9236 0.000 0.960 0.000 0.000 0.008 0.032
#> GSM386447 2 0.5057 0.4924 0.000 0.660 0.000 0.008 0.144 0.188
#> GSM386448 2 0.1333 0.9179 0.000 0.944 0.000 0.000 0.008 0.048
#> GSM386449 2 0.1333 0.9179 0.000 0.944 0.000 0.000 0.008 0.048
#> GSM386450 2 0.1333 0.9179 0.000 0.944 0.000 0.000 0.008 0.048
#> GSM386451 6 0.4111 0.6842 0.000 0.296 0.000 0.024 0.004 0.676
#> GSM386452 1 0.0146 0.3817 0.996 0.000 0.000 0.000 0.000 0.004
#> GSM386453 6 0.3956 0.6815 0.000 0.292 0.000 0.024 0.000 0.684
#> GSM386454 1 0.2623 0.3860 0.852 0.000 0.000 0.000 0.132 0.016
#> GSM386455 6 0.3993 0.7008 0.000 0.272 0.000 0.004 0.024 0.700
#> GSM386456 6 0.3993 0.7008 0.000 0.272 0.000 0.004 0.024 0.700
#> GSM386457 6 0.3656 0.7003 0.000 0.256 0.000 0.004 0.012 0.728
#> GSM386458 6 0.4495 0.3681 0.024 0.048 0.000 0.008 0.180 0.740
#> GSM386443 5 0.3923 0.6724 0.416 0.000 0.000 0.004 0.580 0.000
#> GSM386444 3 0.3555 0.7428 0.000 0.000 0.776 0.000 0.040 0.184
#> GSM386445 3 0.3555 0.7428 0.000 0.000 0.776 0.000 0.040 0.184
#> GSM386446 3 0.3555 0.7428 0.000 0.000 0.776 0.000 0.040 0.184
#> GSM386398 1 0.5353 0.5637 0.528 0.000 0.000 0.000 0.352 0.120
#> GSM386399 1 0.6043 0.5904 0.448 0.000 0.000 0.008 0.352 0.192
#> GSM386400 1 0.5393 0.5726 0.508 0.000 0.000 0.000 0.372 0.120
#> GSM386401 2 0.1049 0.9236 0.000 0.960 0.000 0.000 0.008 0.032
#> GSM386406 2 0.1003 0.9145 0.000 0.964 0.000 0.000 0.020 0.016
#> GSM386407 4 0.4138 0.6949 0.000 0.020 0.000 0.692 0.012 0.276
#> GSM386408 2 0.0146 0.9238 0.000 0.996 0.000 0.000 0.004 0.000
#> GSM386409 1 0.4980 0.5986 0.676 0.000 0.000 0.012 0.184 0.128
#> GSM386410 1 0.0000 0.3809 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM386411 4 0.4177 0.6878 0.000 0.020 0.000 0.668 0.008 0.304
#> GSM386412 4 0.4582 0.6353 0.000 0.012 0.000 0.612 0.028 0.348
#> GSM386413 4 0.4177 0.6878 0.000 0.020 0.000 0.668 0.008 0.304
#> GSM386414 4 0.4187 0.6699 0.000 0.012 0.000 0.652 0.012 0.324
#> GSM386415 4 0.4564 0.5964 0.000 0.020 0.000 0.572 0.012 0.396
#> GSM386416 6 0.7367 -0.1149 0.184 0.000 0.000 0.196 0.204 0.416
#> GSM386417 6 0.3528 0.0953 0.000 0.004 0.000 0.296 0.000 0.700
#> GSM386402 3 0.0000 0.8687 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386403 3 0.3536 0.6271 0.000 0.000 0.736 0.004 0.252 0.008
#> GSM386404 3 0.3536 0.6271 0.000 0.000 0.736 0.004 0.252 0.008
#> GSM386405 3 0.0000 0.8687 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386418 2 0.1257 0.9092 0.000 0.952 0.000 0.000 0.020 0.028
#> GSM386419 2 0.1003 0.9145 0.000 0.964 0.000 0.000 0.020 0.016
#> GSM386420 2 0.1003 0.9145 0.000 0.964 0.000 0.000 0.020 0.016
#> GSM386421 2 0.1257 0.9092 0.000 0.952 0.000 0.000 0.020 0.028
#> GSM386426 1 0.6107 0.6050 0.504 0.004 0.000 0.012 0.292 0.188
#> GSM386427 1 0.0000 0.3809 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM386428 2 0.1257 0.9092 0.000 0.952 0.000 0.000 0.020 0.028
#> GSM386429 4 0.0806 0.6918 0.000 0.020 0.000 0.972 0.000 0.008
#> GSM386430 4 0.0806 0.6918 0.000 0.020 0.000 0.972 0.000 0.008
#> GSM386431 4 0.1003 0.6845 0.000 0.020 0.000 0.964 0.016 0.000
#> GSM386432 4 0.4159 0.6895 0.000 0.020 0.000 0.672 0.008 0.300
#> GSM386433 4 0.4533 0.5460 0.000 0.020 0.000 0.540 0.008 0.432
#> GSM386434 4 0.4528 0.5527 0.000 0.020 0.000 0.544 0.008 0.428
#> GSM386422 3 0.0000 0.8687 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386423 5 0.5632 0.8614 0.404 0.000 0.116 0.008 0.472 0.000
#> GSM386424 3 0.0405 0.8673 0.000 0.000 0.988 0.000 0.004 0.008
#> GSM386425 3 0.0000 0.8687 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386385 2 0.3606 0.7307 0.000 0.800 0.000 0.008 0.052 0.140
#> GSM386386 1 0.4428 0.5568 0.736 0.000 0.000 0.012 0.156 0.096
#> GSM386387 2 0.0363 0.9227 0.000 0.988 0.000 0.000 0.012 0.000
#> GSM386391 2 0.2197 0.8683 0.000 0.900 0.000 0.000 0.044 0.056
#> GSM386392 1 0.6107 0.6050 0.504 0.004 0.000 0.012 0.292 0.188
#> GSM386393 4 0.3345 0.6146 0.004 0.020 0.000 0.844 0.080 0.052
#> GSM386394 1 0.6210 -0.0733 0.448 0.000 0.000 0.400 0.096 0.056
#> GSM386395 4 0.3345 0.6146 0.004 0.020 0.000 0.844 0.080 0.052
#> GSM386396 4 0.1693 0.6725 0.000 0.020 0.000 0.932 0.044 0.004
#> GSM386397 4 0.1693 0.6725 0.000 0.020 0.000 0.932 0.044 0.004
#> GSM386388 3 0.0405 0.8673 0.000 0.000 0.988 0.000 0.004 0.008
#> GSM386389 5 0.5632 0.8614 0.404 0.000 0.116 0.008 0.472 0.000
#> GSM386390 3 0.0405 0.8673 0.000 0.000 0.988 0.000 0.004 0.008
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
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 agent(p) dose(p) time(p) k
#> CV:kmeans 74 0.460293 0.6113 5.22e-01 2
#> CV:kmeans 73 0.542571 0.8753 1.59e-09 3
#> CV:kmeans 74 0.002460 0.0255 3.44e-13 4
#> CV:kmeans 63 0.014743 0.1291 1.73e-17 5
#> CV:kmeans 65 0.000481 0.0323 2.19e-16 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 51941 rows and 74 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 0.712 0.801 0.912 0.4765 0.546 0.546
#> 3 3 0.960 0.946 0.975 0.3690 0.755 0.571
#> 4 4 1.000 0.951 0.981 0.1398 0.818 0.537
#> 5 5 0.998 0.922 0.969 0.0686 0.925 0.720
#> 6 6 0.855 0.707 0.852 0.0417 0.954 0.796
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
#> GSM386435 2 0.000 0.8863 0.000 1.000
#> GSM386436 2 0.000 0.8863 0.000 1.000
#> GSM386437 2 0.000 0.8863 0.000 1.000
#> GSM386438 2 0.000 0.8863 0.000 1.000
#> GSM386439 1 0.184 0.9260 0.972 0.028
#> GSM386440 2 0.000 0.8863 0.000 1.000
#> GSM386441 2 0.000 0.8863 0.000 1.000
#> GSM386442 2 0.000 0.8863 0.000 1.000
#> GSM386447 1 0.961 0.4277 0.616 0.384
#> GSM386448 2 0.000 0.8863 0.000 1.000
#> GSM386449 2 0.000 0.8863 0.000 1.000
#> GSM386450 2 0.000 0.8863 0.000 1.000
#> GSM386451 2 0.000 0.8863 0.000 1.000
#> GSM386452 1 0.184 0.9260 0.972 0.028
#> GSM386453 2 0.000 0.8863 0.000 1.000
#> GSM386454 1 0.184 0.9260 0.972 0.028
#> GSM386455 2 0.184 0.8747 0.028 0.972
#> GSM386456 2 0.184 0.8747 0.028 0.972
#> GSM386457 2 0.184 0.8747 0.028 0.972
#> GSM386458 1 0.000 0.9167 1.000 0.000
#> GSM386443 1 0.000 0.9167 1.000 0.000
#> GSM386444 2 0.961 0.4888 0.384 0.616
#> GSM386445 2 0.961 0.4888 0.384 0.616
#> GSM386446 2 0.518 0.8129 0.116 0.884
#> GSM386398 1 0.184 0.9260 0.972 0.028
#> GSM386399 1 0.184 0.9260 0.972 0.028
#> GSM386400 1 0.184 0.9260 0.972 0.028
#> GSM386401 2 0.000 0.8863 0.000 1.000
#> GSM386406 2 0.000 0.8863 0.000 1.000
#> GSM386407 2 0.000 0.8863 0.000 1.000
#> GSM386408 2 0.000 0.8863 0.000 1.000
#> GSM386409 1 0.184 0.9260 0.972 0.028
#> GSM386410 1 0.184 0.9260 0.972 0.028
#> GSM386411 2 0.000 0.8863 0.000 1.000
#> GSM386412 1 0.653 0.7811 0.832 0.168
#> GSM386413 2 0.000 0.8863 0.000 1.000
#> GSM386414 1 0.000 0.9167 1.000 0.000
#> GSM386415 2 0.184 0.8747 0.028 0.972
#> GSM386416 1 0.000 0.9167 1.000 0.000
#> GSM386417 2 0.184 0.8747 0.028 0.972
#> GSM386402 2 0.963 0.4822 0.388 0.612
#> GSM386403 1 0.000 0.9167 1.000 0.000
#> GSM386404 1 0.000 0.9167 1.000 0.000
#> GSM386405 2 0.963 0.4822 0.388 0.612
#> GSM386418 2 0.000 0.8863 0.000 1.000
#> GSM386419 2 0.000 0.8863 0.000 1.000
#> GSM386420 2 0.000 0.8863 0.000 1.000
#> GSM386421 2 0.000 0.8863 0.000 1.000
#> GSM386426 1 0.184 0.9260 0.972 0.028
#> GSM386427 1 0.184 0.9260 0.972 0.028
#> GSM386428 2 0.000 0.8863 0.000 1.000
#> GSM386429 2 0.000 0.8863 0.000 1.000
#> GSM386430 2 0.000 0.8863 0.000 1.000
#> GSM386431 1 0.969 0.4014 0.604 0.396
#> GSM386432 2 0.000 0.8863 0.000 1.000
#> GSM386433 2 0.184 0.8747 0.028 0.972
#> GSM386434 2 0.184 0.8747 0.028 0.972
#> GSM386422 2 0.963 0.4822 0.388 0.612
#> GSM386423 1 0.000 0.9167 1.000 0.000
#> GSM386424 2 0.963 0.4822 0.388 0.612
#> GSM386425 2 0.963 0.4822 0.388 0.612
#> GSM386385 1 0.961 0.4277 0.616 0.384
#> GSM386386 1 0.184 0.9260 0.972 0.028
#> GSM386387 2 0.000 0.8863 0.000 1.000
#> GSM386391 2 0.000 0.8863 0.000 1.000
#> GSM386392 1 0.184 0.9260 0.972 0.028
#> GSM386393 2 0.988 0.0914 0.436 0.564
#> GSM386394 1 0.184 0.9260 0.972 0.028
#> GSM386395 2 0.988 0.0914 0.436 0.564
#> GSM386396 2 0.278 0.8681 0.048 0.952
#> GSM386397 2 0.278 0.8681 0.048 0.952
#> GSM386388 2 0.963 0.4822 0.388 0.612
#> GSM386389 1 0.000 0.9167 1.000 0.000
#> GSM386390 2 0.994 0.3353 0.456 0.544
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM386435 2 0.0000 0.979 0.000 1.000 0.000
#> GSM386436 2 0.0000 0.979 0.000 1.000 0.000
#> GSM386437 2 0.0000 0.979 0.000 1.000 0.000
#> GSM386438 2 0.0000 0.979 0.000 1.000 0.000
#> GSM386439 1 0.0000 0.947 1.000 0.000 0.000
#> GSM386440 2 0.0000 0.979 0.000 1.000 0.000
#> GSM386441 2 0.0000 0.979 0.000 1.000 0.000
#> GSM386442 2 0.0000 0.979 0.000 1.000 0.000
#> GSM386447 1 0.0000 0.947 1.000 0.000 0.000
#> GSM386448 2 0.0000 0.979 0.000 1.000 0.000
#> GSM386449 2 0.0000 0.979 0.000 1.000 0.000
#> GSM386450 2 0.0000 0.979 0.000 1.000 0.000
#> GSM386451 2 0.0000 0.979 0.000 1.000 0.000
#> GSM386452 1 0.0000 0.947 1.000 0.000 0.000
#> GSM386453 2 0.0000 0.979 0.000 1.000 0.000
#> GSM386454 1 0.0000 0.947 1.000 0.000 0.000
#> GSM386455 2 0.2356 0.920 0.000 0.928 0.072
#> GSM386456 2 0.2356 0.920 0.000 0.928 0.072
#> GSM386457 2 0.3686 0.841 0.000 0.860 0.140
#> GSM386458 1 0.0000 0.947 1.000 0.000 0.000
#> GSM386443 1 0.0000 0.947 1.000 0.000 0.000
#> GSM386444 3 0.0000 0.991 0.000 0.000 1.000
#> GSM386445 3 0.0000 0.991 0.000 0.000 1.000
#> GSM386446 3 0.0000 0.991 0.000 0.000 1.000
#> GSM386398 1 0.0000 0.947 1.000 0.000 0.000
#> GSM386399 1 0.0000 0.947 1.000 0.000 0.000
#> GSM386400 1 0.0000 0.947 1.000 0.000 0.000
#> GSM386401 2 0.0000 0.979 0.000 1.000 0.000
#> GSM386406 2 0.0000 0.979 0.000 1.000 0.000
#> GSM386407 2 0.0747 0.972 0.000 0.984 0.016
#> GSM386408 2 0.0000 0.979 0.000 1.000 0.000
#> GSM386409 1 0.0000 0.947 1.000 0.000 0.000
#> GSM386410 1 0.0000 0.947 1.000 0.000 0.000
#> GSM386411 2 0.0747 0.972 0.000 0.984 0.016
#> GSM386412 1 0.0000 0.947 1.000 0.000 0.000
#> GSM386413 2 0.0747 0.972 0.000 0.984 0.016
#> GSM386414 1 0.6111 0.397 0.604 0.000 0.396
#> GSM386415 3 0.0892 0.982 0.000 0.020 0.980
#> GSM386416 1 0.0000 0.947 1.000 0.000 0.000
#> GSM386417 3 0.0892 0.982 0.000 0.020 0.980
#> GSM386402 3 0.0000 0.991 0.000 0.000 1.000
#> GSM386403 3 0.0000 0.991 0.000 0.000 1.000
#> GSM386404 3 0.0000 0.991 0.000 0.000 1.000
#> GSM386405 3 0.0000 0.991 0.000 0.000 1.000
#> GSM386418 2 0.0000 0.979 0.000 1.000 0.000
#> GSM386419 2 0.0000 0.979 0.000 1.000 0.000
#> GSM386420 2 0.0000 0.979 0.000 1.000 0.000
#> GSM386421 2 0.0000 0.979 0.000 1.000 0.000
#> GSM386426 1 0.0000 0.947 1.000 0.000 0.000
#> GSM386427 1 0.0000 0.947 1.000 0.000 0.000
#> GSM386428 2 0.0000 0.979 0.000 1.000 0.000
#> GSM386429 2 0.0747 0.972 0.000 0.984 0.016
#> GSM386430 2 0.0747 0.972 0.000 0.984 0.016
#> GSM386431 2 0.5723 0.666 0.240 0.744 0.016
#> GSM386432 2 0.0747 0.972 0.000 0.984 0.016
#> GSM386433 3 0.0892 0.982 0.000 0.020 0.980
#> GSM386434 3 0.0892 0.982 0.000 0.020 0.980
#> GSM386422 3 0.0000 0.991 0.000 0.000 1.000
#> GSM386423 1 0.5327 0.654 0.728 0.000 0.272
#> GSM386424 3 0.0000 0.991 0.000 0.000 1.000
#> GSM386425 3 0.0000 0.991 0.000 0.000 1.000
#> GSM386385 1 0.3551 0.813 0.868 0.132 0.000
#> GSM386386 1 0.0000 0.947 1.000 0.000 0.000
#> GSM386387 2 0.0000 0.979 0.000 1.000 0.000
#> GSM386391 2 0.0000 0.979 0.000 1.000 0.000
#> GSM386392 1 0.0000 0.947 1.000 0.000 0.000
#> GSM386393 2 0.1170 0.968 0.008 0.976 0.016
#> GSM386394 1 0.0000 0.947 1.000 0.000 0.000
#> GSM386395 2 0.1170 0.968 0.008 0.976 0.016
#> GSM386396 3 0.0892 0.982 0.000 0.020 0.980
#> GSM386397 3 0.0892 0.982 0.000 0.020 0.980
#> GSM386388 3 0.0000 0.991 0.000 0.000 1.000
#> GSM386389 1 0.5327 0.654 0.728 0.000 0.272
#> GSM386390 3 0.0000 0.991 0.000 0.000 1.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM386435 2 0.000 0.999 0.000 1.000 0.000 0.000
#> GSM386436 2 0.000 0.999 0.000 1.000 0.000 0.000
#> GSM386437 2 0.000 0.999 0.000 1.000 0.000 0.000
#> GSM386438 2 0.000 0.999 0.000 1.000 0.000 0.000
#> GSM386439 1 0.000 0.962 1.000 0.000 0.000 0.000
#> GSM386440 2 0.000 0.999 0.000 1.000 0.000 0.000
#> GSM386441 2 0.000 0.999 0.000 1.000 0.000 0.000
#> GSM386442 2 0.000 0.999 0.000 1.000 0.000 0.000
#> GSM386447 1 0.000 0.962 1.000 0.000 0.000 0.000
#> GSM386448 2 0.000 0.999 0.000 1.000 0.000 0.000
#> GSM386449 2 0.000 0.999 0.000 1.000 0.000 0.000
#> GSM386450 2 0.000 0.999 0.000 1.000 0.000 0.000
#> GSM386451 2 0.000 0.999 0.000 1.000 0.000 0.000
#> GSM386452 1 0.000 0.962 1.000 0.000 0.000 0.000
#> GSM386453 2 0.000 0.999 0.000 1.000 0.000 0.000
#> GSM386454 1 0.000 0.962 1.000 0.000 0.000 0.000
#> GSM386455 2 0.000 0.999 0.000 1.000 0.000 0.000
#> GSM386456 2 0.000 0.999 0.000 1.000 0.000 0.000
#> GSM386457 2 0.000 0.999 0.000 1.000 0.000 0.000
#> GSM386458 1 0.000 0.962 1.000 0.000 0.000 0.000
#> GSM386443 1 0.000 0.962 1.000 0.000 0.000 0.000
#> GSM386444 3 0.000 0.933 0.000 0.000 1.000 0.000
#> GSM386445 3 0.000 0.933 0.000 0.000 1.000 0.000
#> GSM386446 3 0.000 0.933 0.000 0.000 1.000 0.000
#> GSM386398 1 0.000 0.962 1.000 0.000 0.000 0.000
#> GSM386399 1 0.000 0.962 1.000 0.000 0.000 0.000
#> GSM386400 1 0.000 0.962 1.000 0.000 0.000 0.000
#> GSM386401 2 0.000 0.999 0.000 1.000 0.000 0.000
#> GSM386406 2 0.000 0.999 0.000 1.000 0.000 0.000
#> GSM386407 4 0.000 1.000 0.000 0.000 0.000 1.000
#> GSM386408 2 0.000 0.999 0.000 1.000 0.000 0.000
#> GSM386409 1 0.000 0.962 1.000 0.000 0.000 0.000
#> GSM386410 1 0.000 0.962 1.000 0.000 0.000 0.000
#> GSM386411 4 0.000 1.000 0.000 0.000 0.000 1.000
#> GSM386412 1 0.473 0.462 0.636 0.000 0.000 0.364
#> GSM386413 4 0.000 1.000 0.000 0.000 0.000 1.000
#> GSM386414 4 0.000 1.000 0.000 0.000 0.000 1.000
#> GSM386415 4 0.000 1.000 0.000 0.000 0.000 1.000
#> GSM386416 1 0.000 0.962 1.000 0.000 0.000 0.000
#> GSM386417 4 0.000 1.000 0.000 0.000 0.000 1.000
#> GSM386402 3 0.000 0.933 0.000 0.000 1.000 0.000
#> GSM386403 3 0.000 0.933 0.000 0.000 1.000 0.000
#> GSM386404 3 0.000 0.933 0.000 0.000 1.000 0.000
#> GSM386405 3 0.000 0.933 0.000 0.000 1.000 0.000
#> GSM386418 2 0.000 0.999 0.000 1.000 0.000 0.000
#> GSM386419 2 0.000 0.999 0.000 1.000 0.000 0.000
#> GSM386420 2 0.000 0.999 0.000 1.000 0.000 0.000
#> GSM386421 2 0.000 0.999 0.000 1.000 0.000 0.000
#> GSM386426 1 0.000 0.962 1.000 0.000 0.000 0.000
#> GSM386427 1 0.000 0.962 1.000 0.000 0.000 0.000
#> GSM386428 2 0.000 0.999 0.000 1.000 0.000 0.000
#> GSM386429 4 0.000 1.000 0.000 0.000 0.000 1.000
#> GSM386430 4 0.000 1.000 0.000 0.000 0.000 1.000
#> GSM386431 4 0.000 1.000 0.000 0.000 0.000 1.000
#> GSM386432 4 0.000 1.000 0.000 0.000 0.000 1.000
#> GSM386433 4 0.000 1.000 0.000 0.000 0.000 1.000
#> GSM386434 4 0.000 1.000 0.000 0.000 0.000 1.000
#> GSM386422 3 0.000 0.933 0.000 0.000 1.000 0.000
#> GSM386423 3 0.489 0.330 0.412 0.000 0.588 0.000
#> GSM386424 3 0.000 0.933 0.000 0.000 1.000 0.000
#> GSM386425 3 0.000 0.933 0.000 0.000 1.000 0.000
#> GSM386385 2 0.102 0.965 0.032 0.968 0.000 0.000
#> GSM386386 1 0.000 0.962 1.000 0.000 0.000 0.000
#> GSM386387 2 0.000 0.999 0.000 1.000 0.000 0.000
#> GSM386391 2 0.000 0.999 0.000 1.000 0.000 0.000
#> GSM386392 1 0.000 0.962 1.000 0.000 0.000 0.000
#> GSM386393 4 0.000 1.000 0.000 0.000 0.000 1.000
#> GSM386394 1 0.373 0.735 0.788 0.000 0.000 0.212
#> GSM386395 4 0.000 1.000 0.000 0.000 0.000 1.000
#> GSM386396 4 0.000 1.000 0.000 0.000 0.000 1.000
#> GSM386397 4 0.000 1.000 0.000 0.000 0.000 1.000
#> GSM386388 3 0.000 0.933 0.000 0.000 1.000 0.000
#> GSM386389 3 0.489 0.330 0.412 0.000 0.588 0.000
#> GSM386390 3 0.000 0.933 0.000 0.000 1.000 0.000
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM386435 2 0.0703 0.9875 0.000 0.976 0.000 0.000 0.024
#> GSM386436 2 0.0703 0.9875 0.000 0.976 0.000 0.000 0.024
#> GSM386437 2 0.0703 0.9875 0.000 0.976 0.000 0.000 0.024
#> GSM386438 2 0.0703 0.9875 0.000 0.976 0.000 0.000 0.024
#> GSM386439 1 0.0000 0.9684 1.000 0.000 0.000 0.000 0.000
#> GSM386440 2 0.0794 0.9861 0.000 0.972 0.000 0.000 0.028
#> GSM386441 2 0.0794 0.9861 0.000 0.972 0.000 0.000 0.028
#> GSM386442 2 0.0703 0.9875 0.000 0.976 0.000 0.000 0.024
#> GSM386447 1 0.0000 0.9684 1.000 0.000 0.000 0.000 0.000
#> GSM386448 2 0.0794 0.9861 0.000 0.972 0.000 0.000 0.028
#> GSM386449 2 0.0794 0.9861 0.000 0.972 0.000 0.000 0.028
#> GSM386450 2 0.0794 0.9861 0.000 0.972 0.000 0.000 0.028
#> GSM386451 5 0.0000 0.9795 0.000 0.000 0.000 0.000 1.000
#> GSM386452 1 0.0000 0.9684 1.000 0.000 0.000 0.000 0.000
#> GSM386453 5 0.0000 0.9795 0.000 0.000 0.000 0.000 1.000
#> GSM386454 1 0.0000 0.9684 1.000 0.000 0.000 0.000 0.000
#> GSM386455 5 0.0000 0.9795 0.000 0.000 0.000 0.000 1.000
#> GSM386456 5 0.0000 0.9795 0.000 0.000 0.000 0.000 1.000
#> GSM386457 5 0.0000 0.9795 0.000 0.000 0.000 0.000 1.000
#> GSM386458 1 0.0000 0.9684 1.000 0.000 0.000 0.000 0.000
#> GSM386443 1 0.0000 0.9684 1.000 0.000 0.000 0.000 0.000
#> GSM386444 3 0.0000 0.9234 0.000 0.000 1.000 0.000 0.000
#> GSM386445 3 0.0000 0.9234 0.000 0.000 1.000 0.000 0.000
#> GSM386446 3 0.0000 0.9234 0.000 0.000 1.000 0.000 0.000
#> GSM386398 1 0.0000 0.9684 1.000 0.000 0.000 0.000 0.000
#> GSM386399 1 0.0000 0.9684 1.000 0.000 0.000 0.000 0.000
#> GSM386400 1 0.0000 0.9684 1.000 0.000 0.000 0.000 0.000
#> GSM386401 2 0.0703 0.9875 0.000 0.976 0.000 0.000 0.024
#> GSM386406 2 0.0000 0.9868 0.000 1.000 0.000 0.000 0.000
#> GSM386407 4 0.0000 0.9421 0.000 0.000 0.000 1.000 0.000
#> GSM386408 2 0.0000 0.9868 0.000 1.000 0.000 0.000 0.000
#> GSM386409 1 0.0000 0.9684 1.000 0.000 0.000 0.000 0.000
#> GSM386410 1 0.0000 0.9684 1.000 0.000 0.000 0.000 0.000
#> GSM386411 4 0.1792 0.8810 0.000 0.000 0.000 0.916 0.084
#> GSM386412 1 0.4294 0.0657 0.532 0.000 0.000 0.468 0.000
#> GSM386413 4 0.1792 0.8810 0.000 0.000 0.000 0.916 0.084
#> GSM386414 4 0.0703 0.9279 0.000 0.000 0.000 0.976 0.024
#> GSM386415 5 0.1410 0.9466 0.000 0.000 0.000 0.060 0.940
#> GSM386416 1 0.0000 0.9684 1.000 0.000 0.000 0.000 0.000
#> GSM386417 5 0.0404 0.9768 0.000 0.000 0.000 0.012 0.988
#> GSM386402 3 0.0000 0.9234 0.000 0.000 1.000 0.000 0.000
#> GSM386403 3 0.0000 0.9234 0.000 0.000 1.000 0.000 0.000
#> GSM386404 3 0.0000 0.9234 0.000 0.000 1.000 0.000 0.000
#> GSM386405 3 0.0000 0.9234 0.000 0.000 1.000 0.000 0.000
#> GSM386418 2 0.0000 0.9868 0.000 1.000 0.000 0.000 0.000
#> GSM386419 2 0.0000 0.9868 0.000 1.000 0.000 0.000 0.000
#> GSM386420 2 0.0000 0.9868 0.000 1.000 0.000 0.000 0.000
#> GSM386421 2 0.0000 0.9868 0.000 1.000 0.000 0.000 0.000
#> GSM386426 1 0.0000 0.9684 1.000 0.000 0.000 0.000 0.000
#> GSM386427 1 0.0000 0.9684 1.000 0.000 0.000 0.000 0.000
#> GSM386428 2 0.0000 0.9868 0.000 1.000 0.000 0.000 0.000
#> GSM386429 4 0.0000 0.9421 0.000 0.000 0.000 1.000 0.000
#> GSM386430 4 0.0000 0.9421 0.000 0.000 0.000 1.000 0.000
#> GSM386431 4 0.0000 0.9421 0.000 0.000 0.000 1.000 0.000
#> GSM386432 4 0.0000 0.9421 0.000 0.000 0.000 1.000 0.000
#> GSM386433 5 0.0963 0.9662 0.000 0.000 0.000 0.036 0.964
#> GSM386434 5 0.1043 0.9639 0.000 0.000 0.000 0.040 0.960
#> GSM386422 3 0.0000 0.9234 0.000 0.000 1.000 0.000 0.000
#> GSM386423 3 0.4201 0.3414 0.408 0.000 0.592 0.000 0.000
#> GSM386424 3 0.0000 0.9234 0.000 0.000 1.000 0.000 0.000
#> GSM386425 3 0.0000 0.9234 0.000 0.000 1.000 0.000 0.000
#> GSM386385 2 0.0000 0.9868 0.000 1.000 0.000 0.000 0.000
#> GSM386386 1 0.0000 0.9684 1.000 0.000 0.000 0.000 0.000
#> GSM386387 2 0.0000 0.9868 0.000 1.000 0.000 0.000 0.000
#> GSM386391 2 0.0000 0.9868 0.000 1.000 0.000 0.000 0.000
#> GSM386392 1 0.0000 0.9684 1.000 0.000 0.000 0.000 0.000
#> GSM386393 4 0.0000 0.9421 0.000 0.000 0.000 1.000 0.000
#> GSM386394 4 0.4161 0.2937 0.392 0.000 0.000 0.608 0.000
#> GSM386395 4 0.0000 0.9421 0.000 0.000 0.000 1.000 0.000
#> GSM386396 4 0.0000 0.9421 0.000 0.000 0.000 1.000 0.000
#> GSM386397 4 0.0000 0.9421 0.000 0.000 0.000 1.000 0.000
#> GSM386388 3 0.0000 0.9234 0.000 0.000 1.000 0.000 0.000
#> GSM386389 3 0.4201 0.3414 0.408 0.000 0.592 0.000 0.000
#> GSM386390 3 0.0000 0.9234 0.000 0.000 1.000 0.000 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM386435 2 0.0146 0.8693 0.000 0.996 0.000 0.000 0.000 0.004
#> GSM386436 2 0.0000 0.8702 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM386437 2 0.0000 0.8702 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM386438 2 0.0000 0.8702 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM386439 5 0.3869 -0.4170 0.500 0.000 0.000 0.000 0.500 0.000
#> GSM386440 2 0.0146 0.8693 0.000 0.996 0.000 0.000 0.000 0.004
#> GSM386441 2 0.0146 0.8693 0.000 0.996 0.000 0.000 0.000 0.004
#> GSM386442 2 0.0000 0.8702 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM386447 1 0.3854 -0.1265 0.536 0.000 0.000 0.000 0.464 0.000
#> GSM386448 2 0.0146 0.8693 0.000 0.996 0.000 0.000 0.000 0.004
#> GSM386449 2 0.0146 0.8693 0.000 0.996 0.000 0.000 0.000 0.004
#> GSM386450 2 0.0146 0.8693 0.000 0.996 0.000 0.000 0.000 0.004
#> GSM386451 6 0.0547 0.9368 0.000 0.020 0.000 0.000 0.000 0.980
#> GSM386452 1 0.0000 0.5454 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM386453 6 0.0547 0.9368 0.000 0.020 0.000 0.000 0.000 0.980
#> GSM386454 1 0.1007 0.5400 0.956 0.000 0.000 0.000 0.044 0.000
#> GSM386455 6 0.0692 0.9362 0.000 0.020 0.000 0.000 0.004 0.976
#> GSM386456 6 0.0692 0.9362 0.000 0.020 0.000 0.000 0.004 0.976
#> GSM386457 6 0.0692 0.9362 0.000 0.020 0.000 0.000 0.004 0.976
#> GSM386458 1 0.5271 0.2785 0.516 0.000 0.000 0.000 0.380 0.104
#> GSM386443 1 0.2562 0.5146 0.828 0.000 0.000 0.000 0.172 0.000
#> GSM386444 3 0.0146 0.9943 0.000 0.000 0.996 0.000 0.004 0.000
#> GSM386445 3 0.0146 0.9943 0.000 0.000 0.996 0.000 0.004 0.000
#> GSM386446 3 0.0146 0.9943 0.000 0.000 0.996 0.000 0.004 0.000
#> GSM386398 1 0.3869 -0.1875 0.500 0.000 0.000 0.000 0.500 0.000
#> GSM386399 1 0.3869 -0.1875 0.500 0.000 0.000 0.000 0.500 0.000
#> GSM386400 1 0.3869 -0.1875 0.500 0.000 0.000 0.000 0.500 0.000
#> GSM386401 2 0.0000 0.8702 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM386406 2 0.3244 0.7892 0.000 0.732 0.000 0.000 0.268 0.000
#> GSM386407 4 0.1092 0.9284 0.000 0.000 0.000 0.960 0.020 0.020
#> GSM386408 2 0.0547 0.8652 0.000 0.980 0.000 0.000 0.020 0.000
#> GSM386409 1 0.1327 0.5204 0.936 0.000 0.000 0.000 0.064 0.000
#> GSM386410 1 0.0000 0.5454 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM386411 4 0.2432 0.8706 0.000 0.000 0.000 0.876 0.024 0.100
#> GSM386412 1 0.5701 0.3066 0.540 0.000 0.000 0.296 0.156 0.008
#> GSM386413 4 0.2432 0.8706 0.000 0.000 0.000 0.876 0.024 0.100
#> GSM386414 4 0.5662 0.6304 0.124 0.000 0.000 0.640 0.180 0.056
#> GSM386415 6 0.3501 0.8174 0.000 0.000 0.000 0.116 0.080 0.804
#> GSM386416 1 0.2969 0.4941 0.776 0.000 0.000 0.000 0.224 0.000
#> GSM386417 6 0.0146 0.9299 0.000 0.000 0.000 0.000 0.004 0.996
#> GSM386402 3 0.0000 0.9958 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386403 3 0.0547 0.9838 0.000 0.000 0.980 0.000 0.020 0.000
#> GSM386404 3 0.0547 0.9838 0.000 0.000 0.980 0.000 0.020 0.000
#> GSM386405 3 0.0000 0.9958 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386418 2 0.3309 0.7829 0.000 0.720 0.000 0.000 0.280 0.000
#> GSM386419 2 0.3244 0.7892 0.000 0.732 0.000 0.000 0.268 0.000
#> GSM386420 2 0.3244 0.7892 0.000 0.732 0.000 0.000 0.268 0.000
#> GSM386421 2 0.3309 0.7829 0.000 0.720 0.000 0.000 0.280 0.000
#> GSM386426 1 0.3851 -0.1168 0.540 0.000 0.000 0.000 0.460 0.000
#> GSM386427 1 0.0146 0.5449 0.996 0.000 0.000 0.000 0.004 0.000
#> GSM386428 2 0.3309 0.7829 0.000 0.720 0.000 0.000 0.280 0.000
#> GSM386429 4 0.0000 0.9398 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM386430 4 0.0000 0.9398 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM386431 4 0.0000 0.9398 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM386432 4 0.0909 0.9316 0.000 0.000 0.000 0.968 0.012 0.020
#> GSM386433 6 0.2474 0.8912 0.000 0.000 0.000 0.040 0.080 0.880
#> GSM386434 6 0.2672 0.8837 0.000 0.000 0.000 0.052 0.080 0.868
#> GSM386422 3 0.0000 0.9958 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386423 1 0.5130 0.3684 0.612 0.000 0.252 0.000 0.136 0.000
#> GSM386424 3 0.0000 0.9958 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386425 3 0.0000 0.9958 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386385 5 0.3794 0.0932 0.028 0.248 0.000 0.000 0.724 0.000
#> GSM386386 1 0.1141 0.5294 0.948 0.000 0.000 0.000 0.052 0.000
#> GSM386387 2 0.3151 0.7961 0.000 0.748 0.000 0.000 0.252 0.000
#> GSM386391 2 0.3330 0.7797 0.000 0.716 0.000 0.000 0.284 0.000
#> GSM386392 1 0.3851 -0.1168 0.540 0.000 0.000 0.000 0.460 0.000
#> GSM386393 4 0.0458 0.9327 0.000 0.000 0.000 0.984 0.016 0.000
#> GSM386394 1 0.3853 0.3586 0.680 0.000 0.000 0.304 0.016 0.000
#> GSM386395 4 0.0458 0.9327 0.000 0.000 0.000 0.984 0.016 0.000
#> GSM386396 4 0.0000 0.9398 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM386397 4 0.0000 0.9398 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM386388 3 0.0000 0.9958 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386389 1 0.5130 0.3684 0.612 0.000 0.252 0.000 0.136 0.000
#> GSM386390 3 0.0000 0.9958 0.000 0.000 1.000 0.000 0.000 0.000
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
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 agent(p) dose(p) time(p) k
#> CV:skmeans 60 0.17325 0.1162 1.16e-01 2
#> CV:skmeans 73 0.13261 0.3269 2.45e-07 3
#> CV:skmeans 71 0.00456 0.0432 4.79e-14 4
#> CV:skmeans 70 0.01448 0.2785 2.58e-18 5
#> CV:skmeans 60 0.02026 0.3237 1.44e-16 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 51941 rows and 74 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.504 0.868 0.907 0.3438 0.672 0.672
#> 3 3 1.000 0.968 0.987 0.6649 0.745 0.624
#> 4 4 0.911 0.934 0.971 0.2937 0.818 0.582
#> 5 5 0.926 0.953 0.981 0.0195 0.985 0.943
#> 6 6 0.862 0.777 0.847 0.0667 0.938 0.755
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
#> GSM386435 1 0.0000 0.912 1.000 0.000
#> GSM386436 1 0.0000 0.912 1.000 0.000
#> GSM386437 1 0.0000 0.912 1.000 0.000
#> GSM386438 1 0.0000 0.912 1.000 0.000
#> GSM386439 1 0.8207 0.738 0.744 0.256
#> GSM386440 1 0.0000 0.912 1.000 0.000
#> GSM386441 1 0.0000 0.912 1.000 0.000
#> GSM386442 1 0.0000 0.912 1.000 0.000
#> GSM386447 1 0.5408 0.831 0.876 0.124
#> GSM386448 1 0.0000 0.912 1.000 0.000
#> GSM386449 1 0.0000 0.912 1.000 0.000
#> GSM386450 1 0.0000 0.912 1.000 0.000
#> GSM386451 1 0.0000 0.912 1.000 0.000
#> GSM386452 1 0.8207 0.738 0.744 0.256
#> GSM386453 1 0.0000 0.912 1.000 0.000
#> GSM386454 1 0.8207 0.738 0.744 0.256
#> GSM386455 1 0.0000 0.912 1.000 0.000
#> GSM386456 1 0.0000 0.912 1.000 0.000
#> GSM386457 1 0.0000 0.912 1.000 0.000
#> GSM386458 1 0.8207 0.738 0.744 0.256
#> GSM386443 2 0.0000 0.750 0.000 1.000
#> GSM386444 2 0.8207 0.912 0.256 0.744
#> GSM386445 2 0.8207 0.912 0.256 0.744
#> GSM386446 2 0.8207 0.912 0.256 0.744
#> GSM386398 1 0.8207 0.738 0.744 0.256
#> GSM386399 1 0.8207 0.738 0.744 0.256
#> GSM386400 1 0.8207 0.738 0.744 0.256
#> GSM386401 1 0.0000 0.912 1.000 0.000
#> GSM386406 1 0.0000 0.912 1.000 0.000
#> GSM386407 1 0.0000 0.912 1.000 0.000
#> GSM386408 1 0.0000 0.912 1.000 0.000
#> GSM386409 1 0.8207 0.738 0.744 0.256
#> GSM386410 1 0.8207 0.738 0.744 0.256
#> GSM386411 1 0.0000 0.912 1.000 0.000
#> GSM386412 1 0.0672 0.907 0.992 0.008
#> GSM386413 1 0.0000 0.912 1.000 0.000
#> GSM386414 1 0.0000 0.912 1.000 0.000
#> GSM386415 1 0.0000 0.912 1.000 0.000
#> GSM386416 1 0.8207 0.738 0.744 0.256
#> GSM386417 1 0.0000 0.912 1.000 0.000
#> GSM386402 2 0.8207 0.912 0.256 0.744
#> GSM386403 2 0.8016 0.907 0.244 0.756
#> GSM386404 2 0.5178 0.829 0.116 0.884
#> GSM386405 2 0.8207 0.912 0.256 0.744
#> GSM386418 1 0.0000 0.912 1.000 0.000
#> GSM386419 1 0.0000 0.912 1.000 0.000
#> GSM386420 1 0.0000 0.912 1.000 0.000
#> GSM386421 1 0.0000 0.912 1.000 0.000
#> GSM386426 1 0.8207 0.738 0.744 0.256
#> GSM386427 1 0.8207 0.738 0.744 0.256
#> GSM386428 1 0.0000 0.912 1.000 0.000
#> GSM386429 1 0.0000 0.912 1.000 0.000
#> GSM386430 1 0.0000 0.912 1.000 0.000
#> GSM386431 1 0.0000 0.912 1.000 0.000
#> GSM386432 1 0.0000 0.912 1.000 0.000
#> GSM386433 1 0.0000 0.912 1.000 0.000
#> GSM386434 1 0.0000 0.912 1.000 0.000
#> GSM386422 2 0.8207 0.912 0.256 0.744
#> GSM386423 2 0.0000 0.750 0.000 1.000
#> GSM386424 2 0.8207 0.912 0.256 0.744
#> GSM386425 2 0.8207 0.912 0.256 0.744
#> GSM386385 1 0.0000 0.912 1.000 0.000
#> GSM386386 1 0.8207 0.738 0.744 0.256
#> GSM386387 1 0.0000 0.912 1.000 0.000
#> GSM386391 1 0.0000 0.912 1.000 0.000
#> GSM386392 1 0.8207 0.738 0.744 0.256
#> GSM386393 1 0.0000 0.912 1.000 0.000
#> GSM386394 1 0.8207 0.738 0.744 0.256
#> GSM386395 1 0.0000 0.912 1.000 0.000
#> GSM386396 1 0.0000 0.912 1.000 0.000
#> GSM386397 1 0.0000 0.912 1.000 0.000
#> GSM386388 2 0.8207 0.912 0.256 0.744
#> GSM386389 2 0.0000 0.750 0.000 1.000
#> GSM386390 2 0.8207 0.912 0.256 0.744
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM386435 2 0.0000 0.995 0.000 1.000 0.00
#> GSM386436 2 0.0000 0.995 0.000 1.000 0.00
#> GSM386437 2 0.0000 0.995 0.000 1.000 0.00
#> GSM386438 2 0.0000 0.995 0.000 1.000 0.00
#> GSM386439 1 0.1411 0.944 0.964 0.036 0.00
#> GSM386440 2 0.0000 0.995 0.000 1.000 0.00
#> GSM386441 2 0.0000 0.995 0.000 1.000 0.00
#> GSM386442 2 0.0000 0.995 0.000 1.000 0.00
#> GSM386447 2 0.4235 0.783 0.176 0.824 0.00
#> GSM386448 2 0.0000 0.995 0.000 1.000 0.00
#> GSM386449 2 0.0000 0.995 0.000 1.000 0.00
#> GSM386450 2 0.0000 0.995 0.000 1.000 0.00
#> GSM386451 2 0.0000 0.995 0.000 1.000 0.00
#> GSM386452 1 0.0000 0.996 1.000 0.000 0.00
#> GSM386453 2 0.0000 0.995 0.000 1.000 0.00
#> GSM386454 1 0.0000 0.996 1.000 0.000 0.00
#> GSM386455 2 0.0000 0.995 0.000 1.000 0.00
#> GSM386456 2 0.0000 0.995 0.000 1.000 0.00
#> GSM386457 2 0.0000 0.995 0.000 1.000 0.00
#> GSM386458 1 0.0000 0.996 1.000 0.000 0.00
#> GSM386443 1 0.0000 0.996 1.000 0.000 0.00
#> GSM386444 3 0.0000 0.941 0.000 0.000 1.00
#> GSM386445 3 0.0000 0.941 0.000 0.000 1.00
#> GSM386446 3 0.0000 0.941 0.000 0.000 1.00
#> GSM386398 1 0.0000 0.996 1.000 0.000 0.00
#> GSM386399 1 0.0000 0.996 1.000 0.000 0.00
#> GSM386400 1 0.0000 0.996 1.000 0.000 0.00
#> GSM386401 2 0.0000 0.995 0.000 1.000 0.00
#> GSM386406 2 0.0000 0.995 0.000 1.000 0.00
#> GSM386407 2 0.0000 0.995 0.000 1.000 0.00
#> GSM386408 2 0.0000 0.995 0.000 1.000 0.00
#> GSM386409 1 0.0000 0.996 1.000 0.000 0.00
#> GSM386410 1 0.0000 0.996 1.000 0.000 0.00
#> GSM386411 2 0.0000 0.995 0.000 1.000 0.00
#> GSM386412 2 0.0592 0.983 0.012 0.988 0.00
#> GSM386413 2 0.0000 0.995 0.000 1.000 0.00
#> GSM386414 2 0.0000 0.995 0.000 1.000 0.00
#> GSM386415 2 0.0000 0.995 0.000 1.000 0.00
#> GSM386416 1 0.0000 0.996 1.000 0.000 0.00
#> GSM386417 2 0.0000 0.995 0.000 1.000 0.00
#> GSM386402 3 0.0000 0.941 0.000 0.000 1.00
#> GSM386403 3 0.0000 0.941 0.000 0.000 1.00
#> GSM386404 3 0.0000 0.941 0.000 0.000 1.00
#> GSM386405 3 0.0000 0.941 0.000 0.000 1.00
#> GSM386418 2 0.0000 0.995 0.000 1.000 0.00
#> GSM386419 2 0.0000 0.995 0.000 1.000 0.00
#> GSM386420 2 0.0000 0.995 0.000 1.000 0.00
#> GSM386421 2 0.0000 0.995 0.000 1.000 0.00
#> GSM386426 1 0.0000 0.996 1.000 0.000 0.00
#> GSM386427 1 0.0000 0.996 1.000 0.000 0.00
#> GSM386428 2 0.0000 0.995 0.000 1.000 0.00
#> GSM386429 2 0.0000 0.995 0.000 1.000 0.00
#> GSM386430 2 0.0000 0.995 0.000 1.000 0.00
#> GSM386431 2 0.0000 0.995 0.000 1.000 0.00
#> GSM386432 2 0.0000 0.995 0.000 1.000 0.00
#> GSM386433 2 0.0000 0.995 0.000 1.000 0.00
#> GSM386434 2 0.0000 0.995 0.000 1.000 0.00
#> GSM386422 3 0.0000 0.941 0.000 0.000 1.00
#> GSM386423 3 0.5835 0.511 0.340 0.000 0.66
#> GSM386424 3 0.0000 0.941 0.000 0.000 1.00
#> GSM386425 3 0.0000 0.941 0.000 0.000 1.00
#> GSM386385 2 0.0000 0.995 0.000 1.000 0.00
#> GSM386386 1 0.0000 0.996 1.000 0.000 0.00
#> GSM386387 2 0.0000 0.995 0.000 1.000 0.00
#> GSM386391 2 0.0000 0.995 0.000 1.000 0.00
#> GSM386392 1 0.0000 0.996 1.000 0.000 0.00
#> GSM386393 2 0.0000 0.995 0.000 1.000 0.00
#> GSM386394 1 0.0000 0.996 1.000 0.000 0.00
#> GSM386395 2 0.0000 0.995 0.000 1.000 0.00
#> GSM386396 2 0.0000 0.995 0.000 1.000 0.00
#> GSM386397 2 0.0000 0.995 0.000 1.000 0.00
#> GSM386388 3 0.0000 0.941 0.000 0.000 1.00
#> GSM386389 3 0.6126 0.378 0.400 0.000 0.60
#> GSM386390 3 0.0000 0.941 0.000 0.000 1.00
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM386435 2 0.0000 0.965 0.000 1.000 0.00 0.000
#> GSM386436 2 0.0000 0.965 0.000 1.000 0.00 0.000
#> GSM386437 2 0.0000 0.965 0.000 1.000 0.00 0.000
#> GSM386438 2 0.0000 0.965 0.000 1.000 0.00 0.000
#> GSM386439 1 0.1118 0.952 0.964 0.036 0.00 0.000
#> GSM386440 2 0.0000 0.965 0.000 1.000 0.00 0.000
#> GSM386441 2 0.0000 0.965 0.000 1.000 0.00 0.000
#> GSM386442 2 0.0000 0.965 0.000 1.000 0.00 0.000
#> GSM386447 2 0.3688 0.747 0.208 0.792 0.00 0.000
#> GSM386448 2 0.0000 0.965 0.000 1.000 0.00 0.000
#> GSM386449 2 0.0000 0.965 0.000 1.000 0.00 0.000
#> GSM386450 2 0.0000 0.965 0.000 1.000 0.00 0.000
#> GSM386451 2 0.2760 0.872 0.000 0.872 0.00 0.128
#> GSM386452 1 0.0000 0.996 1.000 0.000 0.00 0.000
#> GSM386453 2 0.2760 0.872 0.000 0.872 0.00 0.128
#> GSM386454 1 0.0000 0.996 1.000 0.000 0.00 0.000
#> GSM386455 2 0.2760 0.872 0.000 0.872 0.00 0.128
#> GSM386456 2 0.2760 0.872 0.000 0.872 0.00 0.128
#> GSM386457 2 0.2760 0.872 0.000 0.872 0.00 0.128
#> GSM386458 1 0.0000 0.996 1.000 0.000 0.00 0.000
#> GSM386443 1 0.0000 0.996 1.000 0.000 0.00 0.000
#> GSM386444 3 0.0000 0.941 0.000 0.000 1.00 0.000
#> GSM386445 3 0.0000 0.941 0.000 0.000 1.00 0.000
#> GSM386446 3 0.0000 0.941 0.000 0.000 1.00 0.000
#> GSM386398 1 0.0000 0.996 1.000 0.000 0.00 0.000
#> GSM386399 1 0.0000 0.996 1.000 0.000 0.00 0.000
#> GSM386400 1 0.0000 0.996 1.000 0.000 0.00 0.000
#> GSM386401 2 0.0000 0.965 0.000 1.000 0.00 0.000
#> GSM386406 2 0.0000 0.965 0.000 1.000 0.00 0.000
#> GSM386407 4 0.0000 0.965 0.000 0.000 0.00 1.000
#> GSM386408 2 0.0000 0.965 0.000 1.000 0.00 0.000
#> GSM386409 1 0.0000 0.996 1.000 0.000 0.00 0.000
#> GSM386410 1 0.0000 0.996 1.000 0.000 0.00 0.000
#> GSM386411 4 0.0000 0.965 0.000 0.000 0.00 1.000
#> GSM386412 4 0.0000 0.965 0.000 0.000 0.00 1.000
#> GSM386413 4 0.0000 0.965 0.000 0.000 0.00 1.000
#> GSM386414 4 0.0000 0.965 0.000 0.000 0.00 1.000
#> GSM386415 4 0.0000 0.965 0.000 0.000 0.00 1.000
#> GSM386416 4 0.2760 0.816 0.128 0.000 0.00 0.872
#> GSM386417 4 0.4713 0.393 0.000 0.360 0.00 0.640
#> GSM386402 3 0.0000 0.941 0.000 0.000 1.00 0.000
#> GSM386403 3 0.0000 0.941 0.000 0.000 1.00 0.000
#> GSM386404 3 0.0000 0.941 0.000 0.000 1.00 0.000
#> GSM386405 3 0.0000 0.941 0.000 0.000 1.00 0.000
#> GSM386418 2 0.0000 0.965 0.000 1.000 0.00 0.000
#> GSM386419 2 0.0000 0.965 0.000 1.000 0.00 0.000
#> GSM386420 2 0.0000 0.965 0.000 1.000 0.00 0.000
#> GSM386421 2 0.0000 0.965 0.000 1.000 0.00 0.000
#> GSM386426 1 0.0000 0.996 1.000 0.000 0.00 0.000
#> GSM386427 1 0.0000 0.996 1.000 0.000 0.00 0.000
#> GSM386428 2 0.0000 0.965 0.000 1.000 0.00 0.000
#> GSM386429 4 0.0000 0.965 0.000 0.000 0.00 1.000
#> GSM386430 4 0.0000 0.965 0.000 0.000 0.00 1.000
#> GSM386431 4 0.0000 0.965 0.000 0.000 0.00 1.000
#> GSM386432 4 0.0000 0.965 0.000 0.000 0.00 1.000
#> GSM386433 4 0.0000 0.965 0.000 0.000 0.00 1.000
#> GSM386434 4 0.0000 0.965 0.000 0.000 0.00 1.000
#> GSM386422 3 0.0000 0.941 0.000 0.000 1.00 0.000
#> GSM386423 3 0.4624 0.509 0.340 0.000 0.66 0.000
#> GSM386424 3 0.0000 0.941 0.000 0.000 1.00 0.000
#> GSM386425 3 0.0000 0.941 0.000 0.000 1.00 0.000
#> GSM386385 2 0.0000 0.965 0.000 1.000 0.00 0.000
#> GSM386386 1 0.0000 0.996 1.000 0.000 0.00 0.000
#> GSM386387 2 0.0000 0.965 0.000 1.000 0.00 0.000
#> GSM386391 2 0.0000 0.965 0.000 1.000 0.00 0.000
#> GSM386392 1 0.0000 0.996 1.000 0.000 0.00 0.000
#> GSM386393 4 0.0000 0.965 0.000 0.000 0.00 1.000
#> GSM386394 1 0.0188 0.992 0.996 0.000 0.00 0.004
#> GSM386395 4 0.0000 0.965 0.000 0.000 0.00 1.000
#> GSM386396 4 0.0000 0.965 0.000 0.000 0.00 1.000
#> GSM386397 4 0.0000 0.965 0.000 0.000 0.00 1.000
#> GSM386388 3 0.0000 0.941 0.000 0.000 1.00 0.000
#> GSM386389 3 0.4855 0.376 0.400 0.000 0.60 0.000
#> GSM386390 3 0.0000 0.941 0.000 0.000 1.00 0.000
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM386435 2 0.0000 0.961 0.000 1.000 0 0.000 0
#> GSM386436 2 0.0000 0.961 0.000 1.000 0 0.000 0
#> GSM386437 2 0.0000 0.961 0.000 1.000 0 0.000 0
#> GSM386438 2 0.0000 0.961 0.000 1.000 0 0.000 0
#> GSM386439 1 0.0963 0.943 0.964 0.036 0 0.000 0
#> GSM386440 2 0.0000 0.961 0.000 1.000 0 0.000 0
#> GSM386441 2 0.0000 0.961 0.000 1.000 0 0.000 0
#> GSM386442 2 0.0000 0.961 0.000 1.000 0 0.000 0
#> GSM386447 2 0.3177 0.728 0.208 0.792 0 0.000 0
#> GSM386448 2 0.0000 0.961 0.000 1.000 0 0.000 0
#> GSM386449 2 0.0000 0.961 0.000 1.000 0 0.000 0
#> GSM386450 2 0.0000 0.961 0.000 1.000 0 0.000 0
#> GSM386451 2 0.2377 0.856 0.000 0.872 0 0.128 0
#> GSM386452 1 0.0000 0.995 1.000 0.000 0 0.000 0
#> GSM386453 2 0.2377 0.856 0.000 0.872 0 0.128 0
#> GSM386454 1 0.0000 0.995 1.000 0.000 0 0.000 0
#> GSM386455 2 0.2377 0.856 0.000 0.872 0 0.128 0
#> GSM386456 2 0.2377 0.856 0.000 0.872 0 0.128 0
#> GSM386457 2 0.2377 0.856 0.000 0.872 0 0.128 0
#> GSM386458 1 0.0000 0.995 1.000 0.000 0 0.000 0
#> GSM386443 5 0.0000 1.000 0.000 0.000 0 0.000 1
#> GSM386444 3 0.0000 1.000 0.000 0.000 1 0.000 0
#> GSM386445 3 0.0000 1.000 0.000 0.000 1 0.000 0
#> GSM386446 3 0.0000 1.000 0.000 0.000 1 0.000 0
#> GSM386398 1 0.0000 0.995 1.000 0.000 0 0.000 0
#> GSM386399 1 0.0000 0.995 1.000 0.000 0 0.000 0
#> GSM386400 1 0.0000 0.995 1.000 0.000 0 0.000 0
#> GSM386401 2 0.0000 0.961 0.000 1.000 0 0.000 0
#> GSM386406 2 0.0000 0.961 0.000 1.000 0 0.000 0
#> GSM386407 4 0.0000 0.958 0.000 0.000 0 1.000 0
#> GSM386408 2 0.0000 0.961 0.000 1.000 0 0.000 0
#> GSM386409 1 0.0000 0.995 1.000 0.000 0 0.000 0
#> GSM386410 1 0.0000 0.995 1.000 0.000 0 0.000 0
#> GSM386411 4 0.0000 0.958 0.000 0.000 0 1.000 0
#> GSM386412 4 0.0000 0.958 0.000 0.000 0 1.000 0
#> GSM386413 4 0.0000 0.958 0.000 0.000 0 1.000 0
#> GSM386414 4 0.0000 0.958 0.000 0.000 0 1.000 0
#> GSM386415 4 0.0000 0.958 0.000 0.000 0 1.000 0
#> GSM386416 4 0.2377 0.784 0.128 0.000 0 0.872 0
#> GSM386417 4 0.4060 0.376 0.000 0.360 0 0.640 0
#> GSM386402 3 0.0000 1.000 0.000 0.000 1 0.000 0
#> GSM386403 3 0.0000 1.000 0.000 0.000 1 0.000 0
#> GSM386404 3 0.0000 1.000 0.000 0.000 1 0.000 0
#> GSM386405 3 0.0000 1.000 0.000 0.000 1 0.000 0
#> GSM386418 2 0.0000 0.961 0.000 1.000 0 0.000 0
#> GSM386419 2 0.0000 0.961 0.000 1.000 0 0.000 0
#> GSM386420 2 0.0000 0.961 0.000 1.000 0 0.000 0
#> GSM386421 2 0.0000 0.961 0.000 1.000 0 0.000 0
#> GSM386426 1 0.0000 0.995 1.000 0.000 0 0.000 0
#> GSM386427 1 0.0000 0.995 1.000 0.000 0 0.000 0
#> GSM386428 2 0.0000 0.961 0.000 1.000 0 0.000 0
#> GSM386429 4 0.0000 0.958 0.000 0.000 0 1.000 0
#> GSM386430 4 0.0000 0.958 0.000 0.000 0 1.000 0
#> GSM386431 4 0.0000 0.958 0.000 0.000 0 1.000 0
#> GSM386432 4 0.0000 0.958 0.000 0.000 0 1.000 0
#> GSM386433 4 0.0000 0.958 0.000 0.000 0 1.000 0
#> GSM386434 4 0.0000 0.958 0.000 0.000 0 1.000 0
#> GSM386422 3 0.0000 1.000 0.000 0.000 1 0.000 0
#> GSM386423 5 0.0000 1.000 0.000 0.000 0 0.000 1
#> GSM386424 3 0.0000 1.000 0.000 0.000 1 0.000 0
#> GSM386425 3 0.0000 1.000 0.000 0.000 1 0.000 0
#> GSM386385 2 0.0000 0.961 0.000 1.000 0 0.000 0
#> GSM386386 1 0.0000 0.995 1.000 0.000 0 0.000 0
#> GSM386387 2 0.0000 0.961 0.000 1.000 0 0.000 0
#> GSM386391 2 0.0000 0.961 0.000 1.000 0 0.000 0
#> GSM386392 1 0.0000 0.995 1.000 0.000 0 0.000 0
#> GSM386393 4 0.0000 0.958 0.000 0.000 0 1.000 0
#> GSM386394 1 0.0162 0.991 0.996 0.000 0 0.004 0
#> GSM386395 4 0.0000 0.958 0.000 0.000 0 1.000 0
#> GSM386396 4 0.0000 0.958 0.000 0.000 0 1.000 0
#> GSM386397 4 0.0000 0.958 0.000 0.000 0 1.000 0
#> GSM386388 3 0.0000 1.000 0.000 0.000 1 0.000 0
#> GSM386389 5 0.0000 1.000 0.000 0.000 0 0.000 1
#> GSM386390 3 0.0000 1.000 0.000 0.000 1 0.000 0
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM386435 2 0.3464 0.740 0.000 0.688 0 0.000 0.312 0.000
#> GSM386436 2 0.3446 0.741 0.000 0.692 0 0.000 0.308 0.000
#> GSM386437 2 0.3446 0.741 0.000 0.692 0 0.000 0.308 0.000
#> GSM386438 2 0.3446 0.741 0.000 0.692 0 0.000 0.308 0.000
#> GSM386439 1 0.0865 0.861 0.964 0.036 0 0.000 0.000 0.000
#> GSM386440 2 0.3464 0.740 0.000 0.688 0 0.000 0.312 0.000
#> GSM386441 2 0.3464 0.740 0.000 0.688 0 0.000 0.312 0.000
#> GSM386442 2 0.3464 0.740 0.000 0.688 0 0.000 0.312 0.000
#> GSM386447 1 0.5587 0.103 0.564 0.252 0 0.004 0.180 0.000
#> GSM386448 2 0.3464 0.740 0.000 0.688 0 0.000 0.312 0.000
#> GSM386449 2 0.3464 0.740 0.000 0.688 0 0.000 0.312 0.000
#> GSM386450 2 0.3464 0.740 0.000 0.688 0 0.000 0.312 0.000
#> GSM386451 6 0.7198 0.767 0.000 0.160 0 0.132 0.308 0.400
#> GSM386452 1 0.0937 0.892 0.960 0.000 0 0.000 0.000 0.040
#> GSM386453 6 0.6767 0.822 0.000 0.248 0 0.044 0.308 0.400
#> GSM386454 1 0.0937 0.892 0.960 0.000 0 0.000 0.000 0.040
#> GSM386455 6 0.6722 0.819 0.000 0.248 0 0.040 0.312 0.400
#> GSM386456 6 0.6680 0.812 0.000 0.252 0 0.036 0.312 0.400
#> GSM386457 6 0.6767 0.822 0.000 0.248 0 0.044 0.308 0.400
#> GSM386458 1 0.0000 0.892 1.000 0.000 0 0.000 0.000 0.000
#> GSM386443 5 0.3464 1.000 0.000 0.000 0 0.000 0.688 0.312
#> GSM386444 3 0.0000 1.000 0.000 0.000 1 0.000 0.000 0.000
#> GSM386445 3 0.0000 1.000 0.000 0.000 1 0.000 0.000 0.000
#> GSM386446 3 0.0000 1.000 0.000 0.000 1 0.000 0.000 0.000
#> GSM386398 1 0.0000 0.892 1.000 0.000 0 0.000 0.000 0.000
#> GSM386399 1 0.0000 0.892 1.000 0.000 0 0.000 0.000 0.000
#> GSM386400 1 0.0000 0.892 1.000 0.000 0 0.000 0.000 0.000
#> GSM386401 2 0.3464 0.740 0.000 0.688 0 0.000 0.312 0.000
#> GSM386406 2 0.2664 0.712 0.000 0.816 0 0.000 0.184 0.000
#> GSM386407 4 0.0000 0.797 0.000 0.000 0 1.000 0.000 0.000
#> GSM386408 2 0.3446 0.741 0.000 0.692 0 0.000 0.308 0.000
#> GSM386409 1 0.0937 0.892 0.960 0.000 0 0.000 0.000 0.040
#> GSM386410 1 0.0937 0.892 0.960 0.000 0 0.000 0.000 0.040
#> GSM386411 4 0.3244 0.620 0.000 0.000 0 0.732 0.000 0.268
#> GSM386412 4 0.0000 0.797 0.000 0.000 0 1.000 0.000 0.000
#> GSM386413 4 0.3244 0.620 0.000 0.000 0 0.732 0.000 0.268
#> GSM386414 4 0.0000 0.797 0.000 0.000 0 1.000 0.000 0.000
#> GSM386415 4 0.3706 0.482 0.000 0.000 0 0.620 0.000 0.380
#> GSM386416 4 0.1075 0.768 0.048 0.000 0 0.952 0.000 0.000
#> GSM386417 6 0.6332 0.382 0.000 0.012 0 0.332 0.256 0.400
#> GSM386402 3 0.0000 1.000 0.000 0.000 1 0.000 0.000 0.000
#> GSM386403 3 0.0000 1.000 0.000 0.000 1 0.000 0.000 0.000
#> GSM386404 3 0.0000 1.000 0.000 0.000 1 0.000 0.000 0.000
#> GSM386405 3 0.0000 1.000 0.000 0.000 1 0.000 0.000 0.000
#> GSM386418 2 0.0000 0.667 0.000 1.000 0 0.000 0.000 0.000
#> GSM386419 2 0.0000 0.667 0.000 1.000 0 0.000 0.000 0.000
#> GSM386420 2 0.0000 0.667 0.000 1.000 0 0.000 0.000 0.000
#> GSM386421 2 0.0000 0.667 0.000 1.000 0 0.000 0.000 0.000
#> GSM386426 1 0.0000 0.892 1.000 0.000 0 0.000 0.000 0.000
#> GSM386427 1 0.0937 0.892 0.960 0.000 0 0.000 0.000 0.040
#> GSM386428 2 0.0000 0.667 0.000 1.000 0 0.000 0.000 0.000
#> GSM386429 4 0.0000 0.797 0.000 0.000 0 1.000 0.000 0.000
#> GSM386430 4 0.0000 0.797 0.000 0.000 0 1.000 0.000 0.000
#> GSM386431 4 0.0000 0.797 0.000 0.000 0 1.000 0.000 0.000
#> GSM386432 4 0.0000 0.797 0.000 0.000 0 1.000 0.000 0.000
#> GSM386433 4 0.3756 0.451 0.000 0.000 0 0.600 0.000 0.400
#> GSM386434 4 0.3756 0.451 0.000 0.000 0 0.600 0.000 0.400
#> GSM386422 3 0.0000 1.000 0.000 0.000 1 0.000 0.000 0.000
#> GSM386423 5 0.3464 1.000 0.000 0.000 0 0.000 0.688 0.312
#> GSM386424 3 0.0000 1.000 0.000 0.000 1 0.000 0.000 0.000
#> GSM386425 3 0.0000 1.000 0.000 0.000 1 0.000 0.000 0.000
#> GSM386385 2 0.0000 0.667 0.000 1.000 0 0.000 0.000 0.000
#> GSM386386 1 0.0937 0.892 0.960 0.000 0 0.000 0.000 0.040
#> GSM386387 2 0.0000 0.667 0.000 1.000 0 0.000 0.000 0.000
#> GSM386391 2 0.3050 0.359 0.000 0.764 0 0.000 0.000 0.236
#> GSM386392 1 0.0000 0.892 1.000 0.000 0 0.000 0.000 0.000
#> GSM386393 4 0.3265 0.659 0.000 0.004 0 0.748 0.000 0.248
#> GSM386394 1 0.5982 0.194 0.444 0.000 0 0.268 0.000 0.288
#> GSM386395 4 0.3265 0.659 0.000 0.004 0 0.748 0.000 0.248
#> GSM386396 4 0.3126 0.662 0.000 0.000 0 0.752 0.000 0.248
#> GSM386397 4 0.3126 0.662 0.000 0.000 0 0.752 0.000 0.248
#> GSM386388 3 0.0000 1.000 0.000 0.000 1 0.000 0.000 0.000
#> GSM386389 5 0.3464 1.000 0.000 0.000 0 0.000 0.688 0.312
#> GSM386390 3 0.0000 1.000 0.000 0.000 1 0.000 0.000 0.000
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
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 agent(p) dose(p) time(p) k
#> CV:pam 74 0.57395 0.9466 1.50e-14 2
#> CV:pam 73 0.54389 0.8345 4.51e-11 3
#> CV:pam 72 0.00264 0.0251 7.75e-15 4
#> CV:pam 73 0.00999 0.0597 3.15e-14 5
#> CV:pam 67 0.00113 0.0789 5.68e-15 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 51941 rows and 74 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 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 1.000 0.997 0.997 0.3291 0.672 0.672
#> 3 3 1.000 0.979 0.984 0.8292 0.727 0.594
#> 4 4 0.592 0.515 0.705 0.1725 0.952 0.881
#> 5 5 0.773 0.823 0.843 0.0523 0.775 0.444
#> 6 6 0.665 0.643 0.816 0.0559 0.911 0.668
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 3
#> attr(,"optional")
#> [1] 2
There is also optional best \(k\) = 2 that is worth to check.
Following shows the table of the partitions (You need to click the show/hide
code output link to see it). The membership matrix (columns with name p*
)
is inferred by
clue::cl_consensus()
function with the SE
method. Basically the value in the membership matrix
represents the probability to belong to a certain group. The finall class
label for an item is determined with the group with highest probability it
belongs to.
In get_classes()
function, the entropy is calculated from the membership
matrix and the silhouette score is calculated from the consensus matrix.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> GSM386435 1 0.0376 0.996 0.996 0.004
#> GSM386436 1 0.0376 0.996 0.996 0.004
#> GSM386437 1 0.0672 0.996 0.992 0.008
#> GSM386438 1 0.0376 0.996 0.996 0.004
#> GSM386439 1 0.0376 0.997 0.996 0.004
#> GSM386440 1 0.0376 0.996 0.996 0.004
#> GSM386441 1 0.0376 0.996 0.996 0.004
#> GSM386442 1 0.0376 0.996 0.996 0.004
#> GSM386447 1 0.0376 0.997 0.996 0.004
#> GSM386448 1 0.0376 0.996 0.996 0.004
#> GSM386449 1 0.0376 0.996 0.996 0.004
#> GSM386450 1 0.0376 0.996 0.996 0.004
#> GSM386451 1 0.0000 0.997 1.000 0.000
#> GSM386452 1 0.0376 0.997 0.996 0.004
#> GSM386453 1 0.0376 0.996 0.996 0.004
#> GSM386454 1 0.0376 0.997 0.996 0.004
#> GSM386455 1 0.0376 0.997 0.996 0.004
#> GSM386456 1 0.0376 0.997 0.996 0.004
#> GSM386457 1 0.0376 0.997 0.996 0.004
#> GSM386458 1 0.0376 0.997 0.996 0.004
#> GSM386443 2 0.0376 1.000 0.004 0.996
#> GSM386444 2 0.0376 1.000 0.004 0.996
#> GSM386445 2 0.0376 1.000 0.004 0.996
#> GSM386446 2 0.0376 1.000 0.004 0.996
#> GSM386398 1 0.0376 0.997 0.996 0.004
#> GSM386399 1 0.0376 0.997 0.996 0.004
#> GSM386400 1 0.0376 0.997 0.996 0.004
#> GSM386401 1 0.0376 0.996 0.996 0.004
#> GSM386406 1 0.0376 0.996 0.996 0.004
#> GSM386407 1 0.0000 0.997 1.000 0.000
#> GSM386408 1 0.0376 0.996 0.996 0.004
#> GSM386409 1 0.0376 0.997 0.996 0.004
#> GSM386410 1 0.0376 0.997 0.996 0.004
#> GSM386411 1 0.0000 0.997 1.000 0.000
#> GSM386412 1 0.0376 0.997 0.996 0.004
#> GSM386413 1 0.0000 0.997 1.000 0.000
#> GSM386414 1 0.0376 0.997 0.996 0.004
#> GSM386415 1 0.0376 0.997 0.996 0.004
#> GSM386416 1 0.0376 0.997 0.996 0.004
#> GSM386417 1 0.0376 0.997 0.996 0.004
#> GSM386402 2 0.0376 1.000 0.004 0.996
#> GSM386403 2 0.0376 1.000 0.004 0.996
#> GSM386404 2 0.0376 1.000 0.004 0.996
#> GSM386405 2 0.0376 1.000 0.004 0.996
#> GSM386418 1 0.0376 0.996 0.996 0.004
#> GSM386419 1 0.0376 0.996 0.996 0.004
#> GSM386420 1 0.0376 0.996 0.996 0.004
#> GSM386421 1 0.0376 0.996 0.996 0.004
#> GSM386426 1 0.0376 0.997 0.996 0.004
#> GSM386427 1 0.0376 0.997 0.996 0.004
#> GSM386428 1 0.0376 0.996 0.996 0.004
#> GSM386429 1 0.0000 0.997 1.000 0.000
#> GSM386430 1 0.0000 0.997 1.000 0.000
#> GSM386431 1 0.0000 0.997 1.000 0.000
#> GSM386432 1 0.0000 0.997 1.000 0.000
#> GSM386433 1 0.0376 0.997 0.996 0.004
#> GSM386434 1 0.0376 0.997 0.996 0.004
#> GSM386422 2 0.0376 1.000 0.004 0.996
#> GSM386423 2 0.0376 1.000 0.004 0.996
#> GSM386424 2 0.0376 1.000 0.004 0.996
#> GSM386425 2 0.0376 1.000 0.004 0.996
#> GSM386385 1 0.0376 0.997 0.996 0.004
#> GSM386386 1 0.0376 0.997 0.996 0.004
#> GSM386387 1 0.0376 0.996 0.996 0.004
#> GSM386391 1 0.0376 0.996 0.996 0.004
#> GSM386392 1 0.0376 0.997 0.996 0.004
#> GSM386393 1 0.0000 0.997 1.000 0.000
#> GSM386394 1 0.0376 0.997 0.996 0.004
#> GSM386395 1 0.0000 0.997 1.000 0.000
#> GSM386396 1 0.0000 0.997 1.000 0.000
#> GSM386397 1 0.0000 0.997 1.000 0.000
#> GSM386388 2 0.0376 1.000 0.004 0.996
#> GSM386389 2 0.0376 1.000 0.004 0.996
#> GSM386390 2 0.0376 1.000 0.004 0.996
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM386435 2 0.0000 0.974 0.000 1.000 0
#> GSM386436 2 0.0000 0.974 0.000 1.000 0
#> GSM386437 2 0.1031 0.963 0.024 0.976 0
#> GSM386438 2 0.0000 0.974 0.000 1.000 0
#> GSM386439 1 0.0000 0.989 1.000 0.000 0
#> GSM386440 2 0.0000 0.974 0.000 1.000 0
#> GSM386441 2 0.0000 0.974 0.000 1.000 0
#> GSM386442 2 0.0000 0.974 0.000 1.000 0
#> GSM386447 1 0.0000 0.989 1.000 0.000 0
#> GSM386448 2 0.0000 0.974 0.000 1.000 0
#> GSM386449 2 0.0000 0.974 0.000 1.000 0
#> GSM386450 2 0.0000 0.974 0.000 1.000 0
#> GSM386451 2 0.0000 0.974 0.000 1.000 0
#> GSM386452 1 0.0000 0.989 1.000 0.000 0
#> GSM386453 2 0.0000 0.974 0.000 1.000 0
#> GSM386454 1 0.0000 0.989 1.000 0.000 0
#> GSM386455 2 0.1753 0.970 0.048 0.952 0
#> GSM386456 2 0.1753 0.970 0.048 0.952 0
#> GSM386457 2 0.2356 0.952 0.072 0.928 0
#> GSM386458 1 0.1643 0.947 0.956 0.044 0
#> GSM386443 3 0.0000 1.000 0.000 0.000 1
#> GSM386444 3 0.0000 1.000 0.000 0.000 1
#> GSM386445 3 0.0000 1.000 0.000 0.000 1
#> GSM386446 3 0.0000 1.000 0.000 0.000 1
#> GSM386398 1 0.0000 0.989 1.000 0.000 0
#> GSM386399 1 0.0000 0.989 1.000 0.000 0
#> GSM386400 1 0.0000 0.989 1.000 0.000 0
#> GSM386401 2 0.0000 0.974 0.000 1.000 0
#> GSM386406 2 0.0000 0.974 0.000 1.000 0
#> GSM386407 2 0.1753 0.970 0.048 0.952 0
#> GSM386408 2 0.0000 0.974 0.000 1.000 0
#> GSM386409 1 0.0000 0.989 1.000 0.000 0
#> GSM386410 1 0.0000 0.989 1.000 0.000 0
#> GSM386411 2 0.1753 0.970 0.048 0.952 0
#> GSM386412 1 0.1643 0.947 0.956 0.044 0
#> GSM386413 2 0.1753 0.970 0.048 0.952 0
#> GSM386414 2 0.2959 0.924 0.100 0.900 0
#> GSM386415 2 0.1753 0.970 0.048 0.952 0
#> GSM386416 1 0.1643 0.947 0.956 0.044 0
#> GSM386417 2 0.1753 0.970 0.048 0.952 0
#> GSM386402 3 0.0000 1.000 0.000 0.000 1
#> GSM386403 3 0.0000 1.000 0.000 0.000 1
#> GSM386404 3 0.0000 1.000 0.000 0.000 1
#> GSM386405 3 0.0000 1.000 0.000 0.000 1
#> GSM386418 2 0.0000 0.974 0.000 1.000 0
#> GSM386419 2 0.0000 0.974 0.000 1.000 0
#> GSM386420 2 0.0000 0.974 0.000 1.000 0
#> GSM386421 2 0.0000 0.974 0.000 1.000 0
#> GSM386426 1 0.0000 0.989 1.000 0.000 0
#> GSM386427 1 0.0000 0.989 1.000 0.000 0
#> GSM386428 2 0.0000 0.974 0.000 1.000 0
#> GSM386429 2 0.1753 0.970 0.048 0.952 0
#> GSM386430 2 0.1753 0.970 0.048 0.952 0
#> GSM386431 2 0.1753 0.970 0.048 0.952 0
#> GSM386432 2 0.1753 0.970 0.048 0.952 0
#> GSM386433 2 0.1753 0.970 0.048 0.952 0
#> GSM386434 2 0.1753 0.970 0.048 0.952 0
#> GSM386422 3 0.0000 1.000 0.000 0.000 1
#> GSM386423 3 0.0000 1.000 0.000 0.000 1
#> GSM386424 3 0.0000 1.000 0.000 0.000 1
#> GSM386425 3 0.0000 1.000 0.000 0.000 1
#> GSM386385 1 0.0237 0.986 0.996 0.004 0
#> GSM386386 1 0.0000 0.989 1.000 0.000 0
#> GSM386387 2 0.0000 0.974 0.000 1.000 0
#> GSM386391 2 0.0000 0.974 0.000 1.000 0
#> GSM386392 1 0.0000 0.989 1.000 0.000 0
#> GSM386393 2 0.1753 0.970 0.048 0.952 0
#> GSM386394 1 0.0000 0.989 1.000 0.000 0
#> GSM386395 2 0.1753 0.970 0.048 0.952 0
#> GSM386396 2 0.1753 0.970 0.048 0.952 0
#> GSM386397 2 0.1753 0.970 0.048 0.952 0
#> GSM386388 3 0.0000 1.000 0.000 0.000 1
#> GSM386389 3 0.0000 1.000 0.000 0.000 1
#> GSM386390 3 0.0000 1.000 0.000 0.000 1
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM386435 2 0.4955 -0.06512 0.000 0.556 0.000 0.444
#> GSM386436 2 0.4830 -0.01714 0.000 0.608 0.000 0.392
#> GSM386437 2 0.4992 -0.09429 0.000 0.524 0.000 0.476
#> GSM386438 2 0.4961 -0.06777 0.000 0.552 0.000 0.448
#> GSM386439 1 0.0000 0.90318 1.000 0.000 0.000 0.000
#> GSM386440 2 0.4500 0.05880 0.000 0.684 0.000 0.316
#> GSM386441 2 0.4477 0.06282 0.000 0.688 0.000 0.312
#> GSM386442 2 0.0817 0.31654 0.000 0.976 0.000 0.024
#> GSM386447 1 0.0000 0.90318 1.000 0.000 0.000 0.000
#> GSM386448 2 0.4916 -0.04146 0.000 0.576 0.000 0.424
#> GSM386449 2 0.2281 0.25970 0.000 0.904 0.000 0.096
#> GSM386450 2 0.4907 -0.04026 0.000 0.580 0.000 0.420
#> GSM386451 2 0.6351 0.24927 0.268 0.628 0.000 0.104
#> GSM386452 1 0.3172 0.75596 0.840 0.000 0.000 0.160
#> GSM386453 2 0.3335 0.31401 0.020 0.860 0.000 0.120
#> GSM386454 1 0.3172 0.75596 0.840 0.000 0.000 0.160
#> GSM386455 2 0.6887 0.24819 0.356 0.528 0.000 0.116
#> GSM386456 2 0.6887 0.24819 0.356 0.528 0.000 0.116
#> GSM386457 4 0.7363 0.82141 0.356 0.168 0.000 0.476
#> GSM386458 4 0.6915 0.84615 0.416 0.108 0.000 0.476
#> GSM386443 3 0.6212 0.63804 0.060 0.000 0.560 0.380
#> GSM386444 3 0.0000 0.92748 0.000 0.000 1.000 0.000
#> GSM386445 3 0.0000 0.92748 0.000 0.000 1.000 0.000
#> GSM386446 3 0.0000 0.92748 0.000 0.000 1.000 0.000
#> GSM386398 1 0.0000 0.90318 1.000 0.000 0.000 0.000
#> GSM386399 1 0.0000 0.90318 1.000 0.000 0.000 0.000
#> GSM386400 1 0.0000 0.90318 1.000 0.000 0.000 0.000
#> GSM386401 2 0.3975 0.13011 0.000 0.760 0.000 0.240
#> GSM386406 2 0.0000 0.33058 0.000 1.000 0.000 0.000
#> GSM386407 2 0.7392 0.28167 0.356 0.472 0.000 0.172
#> GSM386408 2 0.4730 0.00876 0.000 0.636 0.000 0.364
#> GSM386409 1 0.0000 0.90318 1.000 0.000 0.000 0.000
#> GSM386410 1 0.3024 0.76870 0.852 0.000 0.000 0.148
#> GSM386411 2 0.7392 0.28167 0.356 0.472 0.000 0.172
#> GSM386412 4 0.6797 0.85209 0.356 0.108 0.000 0.536
#> GSM386413 2 0.7392 0.28167 0.356 0.472 0.000 0.172
#> GSM386414 4 0.5698 0.71935 0.356 0.036 0.000 0.608
#> GSM386415 2 0.7392 0.28167 0.356 0.472 0.000 0.172
#> GSM386416 4 0.6915 0.84615 0.416 0.108 0.000 0.476
#> GSM386417 2 0.7392 0.28167 0.356 0.472 0.000 0.172
#> GSM386402 3 0.0000 0.92748 0.000 0.000 1.000 0.000
#> GSM386403 3 0.0000 0.92748 0.000 0.000 1.000 0.000
#> GSM386404 3 0.0000 0.92748 0.000 0.000 1.000 0.000
#> GSM386405 3 0.0000 0.92748 0.000 0.000 1.000 0.000
#> GSM386418 2 0.1940 0.32846 0.000 0.924 0.000 0.076
#> GSM386419 2 0.0000 0.33058 0.000 1.000 0.000 0.000
#> GSM386420 2 0.0000 0.33058 0.000 1.000 0.000 0.000
#> GSM386421 2 0.1474 0.33477 0.000 0.948 0.000 0.052
#> GSM386426 1 0.0000 0.90318 1.000 0.000 0.000 0.000
#> GSM386427 1 0.3172 0.75596 0.840 0.000 0.000 0.160
#> GSM386428 2 0.1637 0.33413 0.000 0.940 0.000 0.060
#> GSM386429 2 0.7392 0.28167 0.356 0.472 0.000 0.172
#> GSM386430 2 0.7392 0.28167 0.356 0.472 0.000 0.172
#> GSM386431 2 0.7551 0.24047 0.356 0.448 0.000 0.196
#> GSM386432 2 0.7392 0.28167 0.356 0.472 0.000 0.172
#> GSM386433 2 0.7392 0.28167 0.356 0.472 0.000 0.172
#> GSM386434 2 0.7392 0.28167 0.356 0.472 0.000 0.172
#> GSM386422 3 0.0000 0.92748 0.000 0.000 1.000 0.000
#> GSM386423 3 0.6069 0.66342 0.056 0.000 0.588 0.356
#> GSM386424 3 0.0000 0.92748 0.000 0.000 1.000 0.000
#> GSM386425 3 0.0000 0.92748 0.000 0.000 1.000 0.000
#> GSM386385 1 0.0000 0.90318 1.000 0.000 0.000 0.000
#> GSM386386 1 0.0000 0.90318 1.000 0.000 0.000 0.000
#> GSM386387 2 0.4898 -0.03478 0.000 0.584 0.000 0.416
#> GSM386391 2 0.2760 0.33187 0.000 0.872 0.000 0.128
#> GSM386392 1 0.0000 0.90318 1.000 0.000 0.000 0.000
#> GSM386393 2 0.7421 0.27704 0.356 0.468 0.000 0.176
#> GSM386394 1 0.1635 0.82426 0.948 0.044 0.000 0.008
#> GSM386395 2 0.7421 0.27704 0.356 0.468 0.000 0.176
#> GSM386396 2 0.7392 0.28167 0.356 0.472 0.000 0.172
#> GSM386397 2 0.7392 0.28167 0.356 0.472 0.000 0.172
#> GSM386388 3 0.0000 0.92748 0.000 0.000 1.000 0.000
#> GSM386389 3 0.6069 0.66342 0.056 0.000 0.588 0.356
#> GSM386390 3 0.0000 0.92748 0.000 0.000 1.000 0.000
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM386435 2 0.4009 0.921 0.000 0.684 0.000 0.312 0.004
#> GSM386436 2 0.3857 0.921 0.000 0.688 0.000 0.312 0.000
#> GSM386437 2 0.5634 0.384 0.196 0.680 0.000 0.028 0.096
#> GSM386438 2 0.3857 0.921 0.000 0.688 0.000 0.312 0.000
#> GSM386439 1 0.0000 0.863 1.000 0.000 0.000 0.000 0.000
#> GSM386440 2 0.4009 0.921 0.000 0.684 0.000 0.312 0.004
#> GSM386441 2 0.4009 0.921 0.000 0.684 0.000 0.312 0.004
#> GSM386442 2 0.3857 0.921 0.000 0.688 0.000 0.312 0.000
#> GSM386447 1 0.1074 0.857 0.968 0.012 0.000 0.016 0.004
#> GSM386448 2 0.4009 0.921 0.000 0.684 0.000 0.312 0.004
#> GSM386449 2 0.3857 0.921 0.000 0.688 0.000 0.312 0.000
#> GSM386450 2 0.3857 0.921 0.000 0.688 0.000 0.312 0.000
#> GSM386451 2 0.3949 0.898 0.000 0.668 0.000 0.332 0.000
#> GSM386452 1 0.0162 0.863 0.996 0.000 0.000 0.000 0.004
#> GSM386453 2 0.3876 0.918 0.000 0.684 0.000 0.316 0.000
#> GSM386454 1 0.0162 0.863 0.996 0.000 0.000 0.000 0.004
#> GSM386455 2 0.4253 0.846 0.004 0.660 0.000 0.332 0.004
#> GSM386456 2 0.4253 0.846 0.004 0.660 0.000 0.332 0.004
#> GSM386457 2 0.4983 0.329 0.020 0.672 0.000 0.028 0.280
#> GSM386458 1 0.4895 0.718 0.672 0.032 0.000 0.012 0.284
#> GSM386443 1 0.5498 0.730 0.636 0.292 0.044 0.000 0.028
#> GSM386444 3 0.0162 0.997 0.000 0.004 0.996 0.000 0.000
#> GSM386445 3 0.0162 0.997 0.000 0.004 0.996 0.000 0.000
#> GSM386446 3 0.0162 0.997 0.000 0.004 0.996 0.000 0.000
#> GSM386398 1 0.4498 0.754 0.688 0.280 0.000 0.000 0.032
#> GSM386399 1 0.0000 0.863 1.000 0.000 0.000 0.000 0.000
#> GSM386400 1 0.4498 0.754 0.688 0.280 0.000 0.000 0.032
#> GSM386401 2 0.4009 0.921 0.000 0.684 0.000 0.312 0.004
#> GSM386406 4 0.4242 -0.356 0.000 0.428 0.000 0.572 0.000
#> GSM386407 4 0.0451 0.816 0.000 0.008 0.000 0.988 0.004
#> GSM386408 2 0.3857 0.921 0.000 0.688 0.000 0.312 0.000
#> GSM386409 1 0.0000 0.863 1.000 0.000 0.000 0.000 0.000
#> GSM386410 1 0.0162 0.863 0.996 0.000 0.000 0.000 0.004
#> GSM386411 4 0.0404 0.817 0.000 0.012 0.000 0.988 0.000
#> GSM386412 4 0.5969 0.234 0.084 0.024 0.000 0.604 0.288
#> GSM386413 4 0.0404 0.817 0.000 0.012 0.000 0.988 0.000
#> GSM386414 4 0.5287 0.266 0.032 0.028 0.000 0.648 0.292
#> GSM386415 4 0.0671 0.801 0.000 0.016 0.000 0.980 0.004
#> GSM386416 1 0.4860 0.715 0.668 0.028 0.000 0.012 0.292
#> GSM386417 4 0.0960 0.797 0.008 0.016 0.000 0.972 0.004
#> GSM386402 3 0.0000 0.999 0.000 0.000 1.000 0.000 0.000
#> GSM386403 3 0.0000 0.999 0.000 0.000 1.000 0.000 0.000
#> GSM386404 3 0.0000 0.999 0.000 0.000 1.000 0.000 0.000
#> GSM386405 3 0.0000 0.999 0.000 0.000 1.000 0.000 0.000
#> GSM386418 4 0.1197 0.792 0.000 0.048 0.000 0.952 0.000
#> GSM386419 2 0.3913 0.908 0.000 0.676 0.000 0.324 0.000
#> GSM386420 2 0.3857 0.921 0.000 0.688 0.000 0.312 0.000
#> GSM386421 4 0.1410 0.779 0.000 0.060 0.000 0.940 0.000
#> GSM386426 1 0.0912 0.857 0.972 0.012 0.000 0.016 0.000
#> GSM386427 1 0.0162 0.863 0.996 0.000 0.000 0.000 0.004
#> GSM386428 4 0.1197 0.792 0.000 0.048 0.000 0.952 0.000
#> GSM386429 4 0.0510 0.813 0.000 0.000 0.000 0.984 0.016
#> GSM386430 4 0.0703 0.810 0.000 0.000 0.000 0.976 0.024
#> GSM386431 4 0.1168 0.806 0.000 0.008 0.000 0.960 0.032
#> GSM386432 4 0.0404 0.817 0.000 0.012 0.000 0.988 0.000
#> GSM386433 4 0.0671 0.801 0.000 0.016 0.000 0.980 0.004
#> GSM386434 4 0.0671 0.801 0.000 0.016 0.000 0.980 0.004
#> GSM386422 3 0.0000 0.999 0.000 0.000 1.000 0.000 0.000
#> GSM386423 1 0.5687 0.721 0.624 0.292 0.056 0.000 0.028
#> GSM386424 3 0.0000 0.999 0.000 0.000 1.000 0.000 0.000
#> GSM386425 3 0.0000 0.999 0.000 0.000 1.000 0.000 0.000
#> GSM386385 1 0.1179 0.856 0.964 0.016 0.000 0.016 0.004
#> GSM386386 1 0.0912 0.857 0.972 0.012 0.000 0.016 0.000
#> GSM386387 2 0.3857 0.921 0.000 0.688 0.000 0.312 0.000
#> GSM386391 4 0.0794 0.808 0.000 0.028 0.000 0.972 0.000
#> GSM386392 1 0.0912 0.857 0.972 0.012 0.000 0.016 0.000
#> GSM386393 5 0.3932 0.974 0.000 0.000 0.000 0.328 0.672
#> GSM386394 1 0.4727 0.696 0.636 0.012 0.000 0.012 0.340
#> GSM386395 4 0.3109 0.507 0.000 0.000 0.000 0.800 0.200
#> GSM386396 5 0.4384 0.987 0.000 0.016 0.000 0.324 0.660
#> GSM386397 5 0.4384 0.987 0.000 0.016 0.000 0.324 0.660
#> GSM386388 3 0.0000 0.999 0.000 0.000 1.000 0.000 0.000
#> GSM386389 1 0.5687 0.721 0.624 0.292 0.056 0.000 0.028
#> GSM386390 3 0.0000 0.999 0.000 0.000 1.000 0.000 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM386435 2 0.0993 0.80852 0.024 0.964 0.000 0.000 0.012 0.000
#> GSM386436 2 0.0260 0.81616 0.008 0.992 0.000 0.000 0.000 0.000
#> GSM386437 2 0.3859 0.50717 0.292 0.692 0.000 0.000 0.008 0.008
#> GSM386438 2 0.0717 0.81063 0.016 0.976 0.000 0.000 0.000 0.008
#> GSM386439 1 0.2680 0.67931 0.856 0.124 0.000 0.016 0.000 0.004
#> GSM386440 2 0.0508 0.81581 0.000 0.984 0.000 0.000 0.012 0.004
#> GSM386441 2 0.0508 0.81581 0.000 0.984 0.000 0.000 0.012 0.004
#> GSM386442 2 0.0146 0.81581 0.000 0.996 0.000 0.000 0.000 0.004
#> GSM386447 1 0.2653 0.66422 0.844 0.144 0.000 0.000 0.000 0.012
#> GSM386448 2 0.0508 0.81581 0.000 0.984 0.000 0.000 0.012 0.004
#> GSM386449 2 0.0000 0.81631 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM386450 2 0.0146 0.81633 0.004 0.996 0.000 0.000 0.000 0.000
#> GSM386451 2 0.4781 0.51053 0.256 0.664 0.000 0.012 0.000 0.068
#> GSM386452 1 0.3136 0.59126 0.768 0.000 0.000 0.000 0.004 0.228
#> GSM386453 2 0.2300 0.71698 0.144 0.856 0.000 0.000 0.000 0.000
#> GSM386454 1 0.3245 0.58739 0.764 0.000 0.000 0.000 0.008 0.228
#> GSM386455 2 0.7244 0.19326 0.288 0.440 0.000 0.104 0.012 0.156
#> GSM386456 2 0.7244 0.19326 0.288 0.440 0.000 0.104 0.012 0.156
#> GSM386457 2 0.6731 0.22244 0.316 0.488 0.000 0.096 0.012 0.088
#> GSM386458 1 0.4786 0.55608 0.740 0.076 0.000 0.096 0.000 0.088
#> GSM386443 5 0.2883 0.79979 0.212 0.000 0.000 0.000 0.788 0.000
#> GSM386444 3 0.3409 0.70582 0.000 0.000 0.700 0.000 0.300 0.000
#> GSM386445 3 0.3409 0.70582 0.000 0.000 0.700 0.000 0.300 0.000
#> GSM386446 3 0.3409 0.70582 0.000 0.000 0.700 0.000 0.300 0.000
#> GSM386398 1 0.4198 -0.00483 0.656 0.000 0.000 0.024 0.316 0.004
#> GSM386399 1 0.0964 0.66456 0.968 0.012 0.000 0.016 0.000 0.004
#> GSM386400 1 0.4198 -0.00483 0.656 0.000 0.000 0.024 0.316 0.004
#> GSM386401 2 0.0508 0.81581 0.000 0.984 0.000 0.000 0.012 0.004
#> GSM386406 2 0.2631 0.66938 0.000 0.820 0.000 0.180 0.000 0.000
#> GSM386407 4 0.1610 0.68448 0.000 0.084 0.000 0.916 0.000 0.000
#> GSM386408 2 0.0146 0.81633 0.004 0.996 0.000 0.000 0.000 0.000
#> GSM386409 1 0.0000 0.66083 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM386410 1 0.3136 0.59126 0.768 0.000 0.000 0.000 0.004 0.228
#> GSM386411 4 0.4638 0.42951 0.000 0.296 0.000 0.636 0.000 0.068
#> GSM386412 4 0.5424 0.11517 0.328 0.120 0.000 0.548 0.000 0.004
#> GSM386413 4 0.2962 0.66986 0.000 0.084 0.000 0.848 0.000 0.068
#> GSM386414 4 0.4117 0.47056 0.100 0.008 0.000 0.764 0.000 0.128
#> GSM386415 4 0.2624 0.60304 0.000 0.020 0.000 0.856 0.000 0.124
#> GSM386416 1 0.5022 0.53983 0.716 0.072 0.000 0.084 0.000 0.128
#> GSM386417 4 0.5413 0.39309 0.000 0.228 0.000 0.580 0.000 0.192
#> GSM386402 3 0.0000 0.88791 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386403 3 0.1327 0.87087 0.000 0.000 0.936 0.000 0.064 0.000
#> GSM386404 3 0.1327 0.87087 0.000 0.000 0.936 0.000 0.064 0.000
#> GSM386405 3 0.0000 0.88791 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386418 2 0.3023 0.63342 0.004 0.784 0.000 0.212 0.000 0.000
#> GSM386419 2 0.0291 0.81537 0.000 0.992 0.000 0.004 0.000 0.004
#> GSM386420 2 0.0000 0.81631 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM386421 2 0.2854 0.63798 0.000 0.792 0.000 0.208 0.000 0.000
#> GSM386426 1 0.2135 0.67766 0.872 0.128 0.000 0.000 0.000 0.000
#> GSM386427 1 0.3136 0.59126 0.768 0.000 0.000 0.000 0.004 0.228
#> GSM386428 2 0.3023 0.63048 0.000 0.784 0.000 0.212 0.000 0.004
#> GSM386429 4 0.2404 0.67799 0.000 0.080 0.000 0.884 0.000 0.036
#> GSM386430 4 0.2586 0.67207 0.008 0.080 0.000 0.880 0.000 0.032
#> GSM386431 4 0.2169 0.68060 0.008 0.080 0.000 0.900 0.000 0.012
#> GSM386432 4 0.3013 0.66923 0.000 0.088 0.000 0.844 0.000 0.068
#> GSM386433 4 0.2624 0.60304 0.000 0.020 0.000 0.856 0.000 0.124
#> GSM386434 4 0.3253 0.57578 0.000 0.020 0.000 0.788 0.000 0.192
#> GSM386422 3 0.0000 0.88791 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386423 5 0.4634 0.90273 0.188 0.000 0.124 0.000 0.688 0.000
#> GSM386424 3 0.0000 0.88791 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386425 3 0.0000 0.88791 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386385 1 0.3967 0.41035 0.632 0.356 0.000 0.000 0.000 0.012
#> GSM386386 1 0.1700 0.68713 0.916 0.080 0.000 0.004 0.000 0.000
#> GSM386387 2 0.0146 0.81633 0.004 0.996 0.000 0.000 0.000 0.000
#> GSM386391 2 0.4603 0.41213 0.000 0.644 0.000 0.288 0.000 0.068
#> GSM386392 1 0.2135 0.67766 0.872 0.128 0.000 0.000 0.000 0.000
#> GSM386393 6 0.4458 0.52849 0.000 0.040 0.000 0.352 0.000 0.608
#> GSM386394 6 0.5421 0.04035 0.212 0.000 0.000 0.208 0.000 0.580
#> GSM386395 4 0.3707 0.53303 0.000 0.080 0.000 0.784 0.000 0.136
#> GSM386396 6 0.3614 0.64452 0.000 0.028 0.000 0.220 0.000 0.752
#> GSM386397 6 0.3614 0.64452 0.000 0.028 0.000 0.220 0.000 0.752
#> GSM386388 3 0.1267 0.87250 0.000 0.000 0.940 0.000 0.060 0.000
#> GSM386389 5 0.4634 0.90273 0.188 0.000 0.124 0.000 0.688 0.000
#> GSM386390 3 0.1327 0.87087 0.000 0.000 0.936 0.000 0.064 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 agent(p) dose(p) time(p) k
#> CV:mclust 74 0.573952 9.47e-01 1.50e-14 2
#> CV:mclust 74 0.483871 7.10e-01 8.17e-13 3
#> CV:mclust 35 0.829720 5.96e-01 1.48e-10 4
#> CV:mclust 69 0.000984 5.55e-05 8.41e-09 5
#> CV:mclust 62 0.073299 5.57e-03 2.87e-11 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 51941 rows and 74 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 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.703 0.857 0.919 0.3795 0.656 0.656
#> 3 3 1.000 0.976 0.991 0.5375 0.761 0.636
#> 4 4 0.559 0.613 0.784 0.2264 0.859 0.666
#> 5 5 0.730 0.669 0.798 0.1008 0.845 0.533
#> 6 6 0.720 0.668 0.800 0.0312 0.921 0.678
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
#> GSM386435 1 0.1184 0.904 0.984 0.016
#> GSM386436 1 0.0376 0.909 0.996 0.004
#> GSM386437 1 0.1633 0.901 0.976 0.024
#> GSM386438 1 0.0000 0.908 1.000 0.000
#> GSM386439 1 0.9000 0.624 0.684 0.316
#> GSM386440 1 0.1633 0.901 0.976 0.024
#> GSM386441 1 0.0000 0.908 1.000 0.000
#> GSM386442 1 0.0672 0.907 0.992 0.008
#> GSM386447 1 0.2603 0.889 0.956 0.044
#> GSM386448 1 0.0376 0.909 0.996 0.004
#> GSM386449 1 0.1184 0.904 0.984 0.016
#> GSM386450 1 0.1414 0.909 0.980 0.020
#> GSM386451 1 0.2043 0.908 0.968 0.032
#> GSM386452 1 0.9000 0.624 0.684 0.316
#> GSM386453 1 0.1633 0.909 0.976 0.024
#> GSM386454 1 0.9129 0.604 0.672 0.328
#> GSM386455 1 0.2043 0.908 0.968 0.032
#> GSM386456 1 0.2043 0.908 0.968 0.032
#> GSM386457 1 0.1633 0.909 0.976 0.024
#> GSM386458 1 0.9000 0.624 0.684 0.316
#> GSM386443 2 0.2043 0.878 0.032 0.968
#> GSM386444 2 0.3584 0.926 0.068 0.932
#> GSM386445 2 0.2603 0.939 0.044 0.956
#> GSM386446 2 0.8861 0.607 0.304 0.696
#> GSM386398 1 0.9044 0.618 0.680 0.320
#> GSM386399 1 0.9000 0.624 0.684 0.316
#> GSM386400 1 0.9000 0.624 0.684 0.316
#> GSM386401 1 0.1184 0.904 0.984 0.016
#> GSM386406 1 0.0672 0.907 0.992 0.008
#> GSM386407 1 0.2043 0.908 0.968 0.032
#> GSM386408 1 0.1633 0.901 0.976 0.024
#> GSM386409 1 0.9000 0.624 0.684 0.316
#> GSM386410 1 0.9000 0.624 0.684 0.316
#> GSM386411 1 0.2043 0.908 0.968 0.032
#> GSM386412 1 0.1633 0.901 0.976 0.024
#> GSM386413 1 0.2043 0.908 0.968 0.032
#> GSM386414 1 0.2043 0.908 0.968 0.032
#> GSM386415 1 0.2043 0.908 0.968 0.032
#> GSM386416 2 0.9209 0.409 0.336 0.664
#> GSM386417 1 0.2043 0.908 0.968 0.032
#> GSM386402 2 0.2603 0.939 0.044 0.956
#> GSM386403 2 0.2603 0.939 0.044 0.956
#> GSM386404 2 0.2603 0.939 0.044 0.956
#> GSM386405 2 0.2778 0.938 0.048 0.952
#> GSM386418 1 0.0938 0.905 0.988 0.012
#> GSM386419 1 0.0672 0.909 0.992 0.008
#> GSM386420 1 0.0376 0.909 0.996 0.004
#> GSM386421 1 0.0376 0.909 0.996 0.004
#> GSM386426 1 0.4562 0.860 0.904 0.096
#> GSM386427 1 0.9000 0.624 0.684 0.316
#> GSM386428 1 0.0376 0.909 0.996 0.004
#> GSM386429 1 0.2043 0.908 0.968 0.032
#> GSM386430 1 0.2043 0.908 0.968 0.032
#> GSM386431 1 0.2043 0.908 0.968 0.032
#> GSM386432 1 0.2043 0.908 0.968 0.032
#> GSM386433 1 0.2778 0.898 0.952 0.048
#> GSM386434 1 0.2778 0.898 0.952 0.048
#> GSM386422 2 0.2603 0.939 0.044 0.956
#> GSM386423 2 0.2603 0.939 0.044 0.956
#> GSM386424 2 0.2603 0.939 0.044 0.956
#> GSM386425 2 0.4562 0.901 0.096 0.904
#> GSM386385 1 0.2603 0.889 0.956 0.044
#> GSM386386 1 0.7139 0.771 0.804 0.196
#> GSM386387 1 0.1633 0.909 0.976 0.024
#> GSM386391 1 0.1633 0.909 0.976 0.024
#> GSM386392 1 0.6623 0.796 0.828 0.172
#> GSM386393 1 0.2043 0.908 0.968 0.032
#> GSM386394 1 0.1184 0.904 0.984 0.016
#> GSM386395 1 0.2043 0.908 0.968 0.032
#> GSM386396 1 0.2043 0.908 0.968 0.032
#> GSM386397 1 0.2043 0.908 0.968 0.032
#> GSM386388 2 0.3584 0.926 0.068 0.932
#> GSM386389 2 0.2603 0.939 0.044 0.956
#> GSM386390 2 0.2603 0.939 0.044 0.956
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM386435 2 0.0424 0.9902 0.008 0.992 0.000
#> GSM386436 2 0.0000 0.9969 0.000 1.000 0.000
#> GSM386437 2 0.3038 0.8848 0.104 0.896 0.000
#> GSM386438 2 0.0000 0.9969 0.000 1.000 0.000
#> GSM386439 1 0.0000 0.9955 1.000 0.000 0.000
#> GSM386440 2 0.0592 0.9865 0.012 0.988 0.000
#> GSM386441 2 0.0000 0.9969 0.000 1.000 0.000
#> GSM386442 2 0.0000 0.9969 0.000 1.000 0.000
#> GSM386447 1 0.0892 0.9727 0.980 0.020 0.000
#> GSM386448 2 0.0000 0.9969 0.000 1.000 0.000
#> GSM386449 2 0.0000 0.9969 0.000 1.000 0.000
#> GSM386450 2 0.0000 0.9969 0.000 1.000 0.000
#> GSM386451 2 0.0000 0.9969 0.000 1.000 0.000
#> GSM386452 1 0.0000 0.9955 1.000 0.000 0.000
#> GSM386453 2 0.0000 0.9969 0.000 1.000 0.000
#> GSM386454 1 0.0000 0.9955 1.000 0.000 0.000
#> GSM386455 2 0.0000 0.9969 0.000 1.000 0.000
#> GSM386456 2 0.0000 0.9969 0.000 1.000 0.000
#> GSM386457 2 0.0000 0.9969 0.000 1.000 0.000
#> GSM386458 1 0.0000 0.9955 1.000 0.000 0.000
#> GSM386443 3 0.0424 0.9603 0.008 0.000 0.992
#> GSM386444 3 0.0000 0.9672 0.000 0.000 1.000
#> GSM386445 3 0.0000 0.9672 0.000 0.000 1.000
#> GSM386446 3 0.0000 0.9672 0.000 0.000 1.000
#> GSM386398 1 0.0000 0.9955 1.000 0.000 0.000
#> GSM386399 1 0.0000 0.9955 1.000 0.000 0.000
#> GSM386400 1 0.0000 0.9955 1.000 0.000 0.000
#> GSM386401 2 0.0000 0.9969 0.000 1.000 0.000
#> GSM386406 2 0.0000 0.9969 0.000 1.000 0.000
#> GSM386407 2 0.0000 0.9969 0.000 1.000 0.000
#> GSM386408 2 0.0237 0.9937 0.004 0.996 0.000
#> GSM386409 1 0.0000 0.9955 1.000 0.000 0.000
#> GSM386410 1 0.0000 0.9955 1.000 0.000 0.000
#> GSM386411 2 0.0000 0.9969 0.000 1.000 0.000
#> GSM386412 2 0.0237 0.9937 0.004 0.996 0.000
#> GSM386413 2 0.0000 0.9969 0.000 1.000 0.000
#> GSM386414 2 0.0000 0.9969 0.000 1.000 0.000
#> GSM386415 2 0.0000 0.9969 0.000 1.000 0.000
#> GSM386416 3 0.6299 0.0912 0.476 0.000 0.524
#> GSM386417 2 0.0000 0.9969 0.000 1.000 0.000
#> GSM386402 3 0.0000 0.9672 0.000 0.000 1.000
#> GSM386403 3 0.0000 0.9672 0.000 0.000 1.000
#> GSM386404 3 0.0000 0.9672 0.000 0.000 1.000
#> GSM386405 3 0.0000 0.9672 0.000 0.000 1.000
#> GSM386418 2 0.0000 0.9969 0.000 1.000 0.000
#> GSM386419 2 0.0000 0.9969 0.000 1.000 0.000
#> GSM386420 2 0.0000 0.9969 0.000 1.000 0.000
#> GSM386421 2 0.0000 0.9969 0.000 1.000 0.000
#> GSM386426 1 0.0000 0.9955 1.000 0.000 0.000
#> GSM386427 1 0.0000 0.9955 1.000 0.000 0.000
#> GSM386428 2 0.0000 0.9969 0.000 1.000 0.000
#> GSM386429 2 0.0000 0.9969 0.000 1.000 0.000
#> GSM386430 2 0.0000 0.9969 0.000 1.000 0.000
#> GSM386431 2 0.0000 0.9969 0.000 1.000 0.000
#> GSM386432 2 0.0000 0.9969 0.000 1.000 0.000
#> GSM386433 2 0.0000 0.9969 0.000 1.000 0.000
#> GSM386434 2 0.0000 0.9969 0.000 1.000 0.000
#> GSM386422 3 0.0000 0.9672 0.000 0.000 1.000
#> GSM386423 3 0.0000 0.9672 0.000 0.000 1.000
#> GSM386424 3 0.0000 0.9672 0.000 0.000 1.000
#> GSM386425 3 0.0000 0.9672 0.000 0.000 1.000
#> GSM386385 1 0.1031 0.9674 0.976 0.024 0.000
#> GSM386386 1 0.0000 0.9955 1.000 0.000 0.000
#> GSM386387 2 0.0000 0.9969 0.000 1.000 0.000
#> GSM386391 2 0.0000 0.9969 0.000 1.000 0.000
#> GSM386392 1 0.0000 0.9955 1.000 0.000 0.000
#> GSM386393 2 0.0000 0.9969 0.000 1.000 0.000
#> GSM386394 2 0.0000 0.9969 0.000 1.000 0.000
#> GSM386395 2 0.0000 0.9969 0.000 1.000 0.000
#> GSM386396 2 0.0000 0.9969 0.000 1.000 0.000
#> GSM386397 2 0.0000 0.9969 0.000 1.000 0.000
#> GSM386388 3 0.0000 0.9672 0.000 0.000 1.000
#> GSM386389 3 0.0000 0.9672 0.000 0.000 1.000
#> GSM386390 3 0.0000 0.9672 0.000 0.000 1.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM386435 2 0.3249 0.5749 0.140 0.852 0.000 0.008
#> GSM386436 2 0.0376 0.6235 0.004 0.992 0.000 0.004
#> GSM386437 2 0.3726 0.5032 0.212 0.788 0.000 0.000
#> GSM386438 2 0.1902 0.6175 0.064 0.932 0.000 0.004
#> GSM386439 1 0.1389 0.8033 0.952 0.048 0.000 0.000
#> GSM386440 2 0.3937 0.5291 0.188 0.800 0.000 0.012
#> GSM386441 2 0.2882 0.6099 0.084 0.892 0.000 0.024
#> GSM386442 2 0.0336 0.6226 0.000 0.992 0.000 0.008
#> GSM386447 1 0.3494 0.7387 0.824 0.172 0.000 0.004
#> GSM386448 2 0.2048 0.6091 0.008 0.928 0.000 0.064
#> GSM386449 2 0.1677 0.6194 0.012 0.948 0.000 0.040
#> GSM386450 2 0.1792 0.6036 0.000 0.932 0.000 0.068
#> GSM386451 2 0.4277 0.4077 0.000 0.720 0.000 0.280
#> GSM386452 1 0.3610 0.7796 0.800 0.000 0.000 0.200
#> GSM386453 2 0.4406 0.3988 0.000 0.700 0.000 0.300
#> GSM386454 1 0.2216 0.7946 0.908 0.000 0.000 0.092
#> GSM386455 2 0.4356 0.4272 0.000 0.708 0.000 0.292
#> GSM386456 2 0.4252 0.4734 0.004 0.744 0.000 0.252
#> GSM386457 2 0.6808 0.3365 0.120 0.560 0.000 0.320
#> GSM386458 1 0.3910 0.7129 0.820 0.024 0.000 0.156
#> GSM386443 3 0.2973 0.7890 0.144 0.000 0.856 0.000
#> GSM386444 3 0.0592 0.9379 0.000 0.016 0.984 0.000
#> GSM386445 3 0.0188 0.9494 0.000 0.004 0.996 0.000
#> GSM386446 3 0.5793 0.3960 0.000 0.324 0.628 0.048
#> GSM386398 1 0.0188 0.8010 0.996 0.000 0.000 0.004
#> GSM386399 1 0.1118 0.8046 0.964 0.036 0.000 0.000
#> GSM386400 1 0.0336 0.8006 0.992 0.000 0.000 0.008
#> GSM386401 2 0.3435 0.5853 0.100 0.864 0.000 0.036
#> GSM386406 2 0.3311 0.4997 0.000 0.828 0.000 0.172
#> GSM386407 4 0.4961 0.4591 0.000 0.448 0.000 0.552
#> GSM386408 2 0.4401 0.5497 0.112 0.812 0.000 0.076
#> GSM386409 1 0.3984 0.7982 0.828 0.040 0.000 0.132
#> GSM386410 1 0.3494 0.7819 0.824 0.004 0.000 0.172
#> GSM386411 2 0.4898 0.0086 0.000 0.584 0.000 0.416
#> GSM386412 4 0.5143 0.5901 0.012 0.360 0.000 0.628
#> GSM386413 2 0.4730 0.2042 0.000 0.636 0.000 0.364
#> GSM386414 2 0.4866 0.1909 0.000 0.596 0.000 0.404
#> GSM386415 2 0.4888 0.0250 0.000 0.588 0.000 0.412
#> GSM386416 1 0.7953 0.4816 0.568 0.052 0.164 0.216
#> GSM386417 2 0.4304 0.3952 0.000 0.716 0.000 0.284
#> GSM386402 3 0.0000 0.9527 0.000 0.000 1.000 0.000
#> GSM386403 3 0.0000 0.9527 0.000 0.000 1.000 0.000
#> GSM386404 3 0.0000 0.9527 0.000 0.000 1.000 0.000
#> GSM386405 3 0.0000 0.9527 0.000 0.000 1.000 0.000
#> GSM386418 2 0.3105 0.5422 0.004 0.856 0.000 0.140
#> GSM386419 2 0.2011 0.5992 0.000 0.920 0.000 0.080
#> GSM386420 2 0.2011 0.5992 0.000 0.920 0.000 0.080
#> GSM386421 2 0.2647 0.5652 0.000 0.880 0.000 0.120
#> GSM386426 1 0.6587 0.6806 0.616 0.132 0.000 0.252
#> GSM386427 1 0.4507 0.7665 0.756 0.020 0.000 0.224
#> GSM386428 2 0.4331 0.2704 0.000 0.712 0.000 0.288
#> GSM386429 4 0.4477 0.7105 0.000 0.312 0.000 0.688
#> GSM386430 4 0.4431 0.7113 0.000 0.304 0.000 0.696
#> GSM386431 4 0.4193 0.7171 0.000 0.268 0.000 0.732
#> GSM386432 4 0.4981 0.4090 0.000 0.464 0.000 0.536
#> GSM386433 2 0.4543 0.3122 0.000 0.676 0.000 0.324
#> GSM386434 2 0.4888 0.0250 0.000 0.588 0.000 0.412
#> GSM386422 3 0.0000 0.9527 0.000 0.000 1.000 0.000
#> GSM386423 3 0.0000 0.9527 0.000 0.000 1.000 0.000
#> GSM386424 3 0.0000 0.9527 0.000 0.000 1.000 0.000
#> GSM386425 3 0.0000 0.9527 0.000 0.000 1.000 0.000
#> GSM386385 1 0.5691 0.5686 0.648 0.304 0.000 0.048
#> GSM386386 1 0.7260 0.5554 0.464 0.148 0.000 0.388
#> GSM386387 2 0.1716 0.6077 0.000 0.936 0.000 0.064
#> GSM386391 2 0.5281 -0.2423 0.008 0.528 0.000 0.464
#> GSM386392 1 0.6373 0.6855 0.648 0.136 0.000 0.216
#> GSM386393 4 0.3837 0.5695 0.000 0.224 0.000 0.776
#> GSM386394 4 0.3870 0.4927 0.004 0.208 0.000 0.788
#> GSM386395 4 0.4103 0.5097 0.000 0.256 0.000 0.744
#> GSM386396 4 0.4382 0.7186 0.000 0.296 0.000 0.704
#> GSM386397 4 0.4222 0.7105 0.000 0.272 0.000 0.728
#> GSM386388 3 0.0000 0.9527 0.000 0.000 1.000 0.000
#> GSM386389 3 0.0000 0.9527 0.000 0.000 1.000 0.000
#> GSM386390 3 0.0000 0.9527 0.000 0.000 1.000 0.000
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM386435 2 0.1471 0.8900 0.024 0.952 0.000 0.020 0.004
#> GSM386436 2 0.1041 0.8991 0.000 0.964 0.000 0.032 0.004
#> GSM386437 2 0.1331 0.8792 0.040 0.952 0.000 0.008 0.000
#> GSM386438 2 0.0955 0.8980 0.004 0.968 0.000 0.028 0.000
#> GSM386439 1 0.3575 0.7610 0.824 0.120 0.000 0.000 0.056
#> GSM386440 2 0.1756 0.8779 0.036 0.940 0.000 0.008 0.016
#> GSM386441 2 0.1243 0.8956 0.004 0.960 0.000 0.028 0.008
#> GSM386442 2 0.1364 0.8988 0.000 0.952 0.000 0.036 0.012
#> GSM386447 1 0.5066 0.5116 0.608 0.344 0.000 0.000 0.048
#> GSM386448 2 0.1764 0.8844 0.000 0.928 0.000 0.064 0.008
#> GSM386449 2 0.2026 0.8877 0.012 0.924 0.000 0.056 0.008
#> GSM386450 2 0.2470 0.8564 0.000 0.884 0.000 0.104 0.012
#> GSM386451 4 0.5237 0.5060 0.000 0.156 0.000 0.684 0.160
#> GSM386452 1 0.2843 0.7281 0.848 0.000 0.000 0.008 0.144
#> GSM386453 4 0.4930 0.5276 0.000 0.084 0.000 0.696 0.220
#> GSM386454 1 0.3942 0.6630 0.728 0.000 0.000 0.012 0.260
#> GSM386455 4 0.5516 0.4951 0.000 0.128 0.000 0.640 0.232
#> GSM386456 4 0.5844 0.4155 0.000 0.244 0.000 0.600 0.156
#> GSM386457 4 0.4904 0.4602 0.008 0.020 0.000 0.604 0.368
#> GSM386458 1 0.6697 0.1666 0.380 0.000 0.000 0.240 0.380
#> GSM386443 3 0.3838 0.5710 0.280 0.000 0.716 0.000 0.004
#> GSM386444 3 0.0162 0.9530 0.000 0.004 0.996 0.000 0.000
#> GSM386445 3 0.0000 0.9568 0.000 0.000 1.000 0.000 0.000
#> GSM386446 3 0.3659 0.6687 0.000 0.220 0.768 0.012 0.000
#> GSM386398 1 0.3861 0.7579 0.804 0.068 0.000 0.000 0.128
#> GSM386399 1 0.2761 0.7647 0.872 0.104 0.000 0.000 0.024
#> GSM386400 1 0.4300 0.7542 0.772 0.096 0.000 0.000 0.132
#> GSM386401 2 0.0727 0.8956 0.004 0.980 0.000 0.012 0.004
#> GSM386406 2 0.3405 0.8560 0.024 0.848 0.000 0.020 0.108
#> GSM386407 4 0.1638 0.5273 0.000 0.004 0.000 0.932 0.064
#> GSM386408 2 0.1310 0.8894 0.024 0.956 0.000 0.000 0.020
#> GSM386409 1 0.1364 0.7613 0.952 0.012 0.000 0.000 0.036
#> GSM386410 1 0.1478 0.7518 0.936 0.000 0.000 0.000 0.064
#> GSM386411 4 0.1082 0.5667 0.000 0.008 0.000 0.964 0.028
#> GSM386412 4 0.3043 0.4938 0.080 0.000 0.000 0.864 0.056
#> GSM386413 4 0.0510 0.5852 0.000 0.016 0.000 0.984 0.000
#> GSM386414 4 0.1043 0.5810 0.000 0.000 0.000 0.960 0.040
#> GSM386415 4 0.1106 0.5894 0.000 0.012 0.000 0.964 0.024
#> GSM386416 4 0.6315 0.3469 0.212 0.000 0.000 0.528 0.260
#> GSM386417 4 0.2959 0.5666 0.000 0.100 0.000 0.864 0.036
#> GSM386402 3 0.0000 0.9568 0.000 0.000 1.000 0.000 0.000
#> GSM386403 3 0.0000 0.9568 0.000 0.000 1.000 0.000 0.000
#> GSM386404 3 0.0000 0.9568 0.000 0.000 1.000 0.000 0.000
#> GSM386405 3 0.0000 0.9568 0.000 0.000 1.000 0.000 0.000
#> GSM386418 2 0.2511 0.8722 0.016 0.892 0.000 0.004 0.088
#> GSM386419 2 0.1725 0.8961 0.000 0.936 0.000 0.020 0.044
#> GSM386420 2 0.1484 0.8956 0.000 0.944 0.000 0.008 0.048
#> GSM386421 2 0.2474 0.8761 0.012 0.896 0.000 0.008 0.084
#> GSM386426 1 0.5405 0.6373 0.672 0.124 0.000 0.004 0.200
#> GSM386427 1 0.1831 0.7495 0.920 0.004 0.000 0.000 0.076
#> GSM386428 2 0.4206 0.8040 0.028 0.784 0.000 0.024 0.164
#> GSM386429 4 0.4549 -0.6763 0.000 0.008 0.000 0.528 0.464
#> GSM386430 4 0.4552 -0.6874 0.000 0.008 0.000 0.524 0.468
#> GSM386431 4 0.4557 -0.7090 0.000 0.008 0.000 0.516 0.476
#> GSM386432 4 0.1670 0.5453 0.000 0.012 0.000 0.936 0.052
#> GSM386433 4 0.1386 0.5918 0.000 0.016 0.000 0.952 0.032
#> GSM386434 4 0.0794 0.5874 0.000 0.028 0.000 0.972 0.000
#> GSM386422 3 0.0000 0.9568 0.000 0.000 1.000 0.000 0.000
#> GSM386423 3 0.0000 0.9568 0.000 0.000 1.000 0.000 0.000
#> GSM386424 3 0.0000 0.9568 0.000 0.000 1.000 0.000 0.000
#> GSM386425 3 0.0000 0.9568 0.000 0.000 1.000 0.000 0.000
#> GSM386385 2 0.5003 0.0438 0.424 0.544 0.000 0.000 0.032
#> GSM386386 1 0.5357 0.5939 0.640 0.096 0.000 0.000 0.264
#> GSM386387 2 0.1408 0.8968 0.000 0.948 0.000 0.008 0.044
#> GSM386391 2 0.4879 0.6716 0.016 0.688 0.000 0.032 0.264
#> GSM386392 1 0.5752 0.5951 0.612 0.240 0.000 0.000 0.148
#> GSM386393 5 0.5662 0.8837 0.020 0.048 0.000 0.360 0.572
#> GSM386394 5 0.5131 0.8652 0.024 0.016 0.000 0.352 0.608
#> GSM386395 5 0.5651 0.8829 0.020 0.048 0.000 0.356 0.576
#> GSM386396 4 0.4436 -0.4936 0.000 0.008 0.000 0.596 0.396
#> GSM386397 5 0.4816 0.6829 0.008 0.008 0.000 0.488 0.496
#> GSM386388 3 0.0000 0.9568 0.000 0.000 1.000 0.000 0.000
#> GSM386389 3 0.0000 0.9568 0.000 0.000 1.000 0.000 0.000
#> GSM386390 3 0.0000 0.9568 0.000 0.000 1.000 0.000 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM386435 2 0.1320 0.782 0.036 0.948 0.000 0.000 0.000 0.016
#> GSM386436 2 0.1268 0.781 0.036 0.952 0.000 0.000 0.004 0.008
#> GSM386437 2 0.1719 0.784 0.060 0.924 0.000 0.000 0.000 0.016
#> GSM386438 2 0.0777 0.784 0.024 0.972 0.000 0.000 0.000 0.004
#> GSM386439 1 0.5426 0.655 0.584 0.128 0.000 0.000 0.280 0.008
#> GSM386440 2 0.3547 0.684 0.300 0.696 0.000 0.000 0.000 0.004
#> GSM386441 2 0.2773 0.759 0.164 0.828 0.000 0.004 0.000 0.004
#> GSM386442 2 0.1812 0.765 0.080 0.912 0.000 0.000 0.000 0.008
#> GSM386447 2 0.6153 0.409 0.252 0.540 0.000 0.000 0.172 0.036
#> GSM386448 2 0.2890 0.723 0.128 0.844 0.000 0.004 0.000 0.024
#> GSM386449 2 0.3175 0.762 0.164 0.808 0.000 0.000 0.000 0.028
#> GSM386450 2 0.3364 0.702 0.132 0.820 0.000 0.012 0.000 0.036
#> GSM386451 6 0.4054 0.585 0.024 0.220 0.000 0.020 0.000 0.736
#> GSM386452 5 0.1168 0.735 0.028 0.000 0.000 0.000 0.956 0.016
#> GSM386453 6 0.2445 0.651 0.020 0.056 0.000 0.028 0.000 0.896
#> GSM386454 5 0.2875 0.647 0.096 0.000 0.000 0.000 0.852 0.052
#> GSM386455 6 0.3109 0.613 0.016 0.168 0.000 0.004 0.000 0.812
#> GSM386456 6 0.4365 0.508 0.040 0.292 0.000 0.004 0.000 0.664
#> GSM386457 6 0.0603 0.637 0.016 0.000 0.000 0.000 0.004 0.980
#> GSM386458 6 0.2763 0.584 0.036 0.008 0.000 0.000 0.088 0.868
#> GSM386443 3 0.4493 0.343 0.040 0.000 0.596 0.000 0.364 0.000
#> GSM386444 3 0.0000 0.950 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386445 3 0.0000 0.950 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386446 3 0.3938 0.719 0.068 0.136 0.784 0.008 0.000 0.004
#> GSM386398 1 0.4816 0.429 0.500 0.008 0.000 0.000 0.456 0.036
#> GSM386399 1 0.5057 0.654 0.580 0.096 0.000 0.000 0.324 0.000
#> GSM386400 1 0.4734 0.552 0.556 0.024 0.000 0.000 0.404 0.016
#> GSM386401 2 0.3329 0.742 0.236 0.756 0.000 0.004 0.000 0.004
#> GSM386406 2 0.4344 0.680 0.188 0.716 0.000 0.096 0.000 0.000
#> GSM386407 4 0.3634 0.415 0.000 0.000 0.000 0.644 0.000 0.356
#> GSM386408 2 0.4250 0.400 0.456 0.528 0.000 0.016 0.000 0.000
#> GSM386409 5 0.1599 0.740 0.028 0.024 0.000 0.008 0.940 0.000
#> GSM386410 5 0.0713 0.751 0.028 0.000 0.000 0.000 0.972 0.000
#> GSM386411 4 0.3867 -0.102 0.000 0.000 0.000 0.512 0.000 0.488
#> GSM386412 6 0.4123 0.272 0.000 0.000 0.000 0.420 0.012 0.568
#> GSM386413 6 0.4067 0.240 0.000 0.008 0.000 0.444 0.000 0.548
#> GSM386414 6 0.3351 0.542 0.000 0.000 0.000 0.288 0.000 0.712
#> GSM386415 6 0.3620 0.460 0.000 0.000 0.000 0.352 0.000 0.648
#> GSM386416 6 0.2325 0.632 0.008 0.000 0.000 0.048 0.044 0.900
#> GSM386417 6 0.3635 0.644 0.008 0.068 0.000 0.120 0.000 0.804
#> GSM386402 3 0.0000 0.950 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386403 3 0.0146 0.950 0.004 0.000 0.996 0.000 0.000 0.000
#> GSM386404 3 0.0146 0.950 0.004 0.000 0.996 0.000 0.000 0.000
#> GSM386405 3 0.0000 0.950 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386418 2 0.3381 0.753 0.148 0.808 0.000 0.040 0.004 0.000
#> GSM386419 2 0.1152 0.786 0.044 0.952 0.000 0.004 0.000 0.000
#> GSM386420 2 0.1753 0.783 0.084 0.912 0.000 0.004 0.000 0.000
#> GSM386421 2 0.2882 0.767 0.120 0.848 0.000 0.028 0.004 0.000
#> GSM386426 1 0.7573 0.495 0.356 0.208 0.000 0.200 0.236 0.000
#> GSM386427 5 0.2803 0.695 0.116 0.012 0.000 0.016 0.856 0.000
#> GSM386428 2 0.5440 0.509 0.224 0.576 0.000 0.200 0.000 0.000
#> GSM386429 4 0.2125 0.765 0.016 0.004 0.000 0.908 0.004 0.068
#> GSM386430 4 0.2051 0.769 0.004 0.004 0.000 0.896 0.000 0.096
#> GSM386431 4 0.2165 0.766 0.000 0.000 0.000 0.884 0.008 0.108
#> GSM386432 4 0.3668 0.477 0.004 0.000 0.000 0.668 0.000 0.328
#> GSM386433 6 0.3528 0.535 0.000 0.004 0.000 0.296 0.000 0.700
#> GSM386434 6 0.4135 0.339 0.004 0.008 0.000 0.404 0.000 0.584
#> GSM386422 3 0.0000 0.950 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386423 3 0.0363 0.946 0.012 0.000 0.988 0.000 0.000 0.000
#> GSM386424 3 0.0146 0.950 0.004 0.000 0.996 0.000 0.000 0.000
#> GSM386425 3 0.0000 0.950 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386385 2 0.4657 0.298 0.456 0.508 0.000 0.004 0.032 0.000
#> GSM386386 5 0.6281 0.312 0.128 0.212 0.000 0.088 0.572 0.000
#> GSM386387 2 0.1958 0.785 0.100 0.896 0.000 0.004 0.000 0.000
#> GSM386391 2 0.5980 0.458 0.176 0.536 0.000 0.272 0.008 0.008
#> GSM386392 1 0.7217 0.533 0.436 0.212 0.000 0.136 0.216 0.000
#> GSM386393 4 0.0458 0.726 0.016 0.000 0.000 0.984 0.000 0.000
#> GSM386394 4 0.2506 0.661 0.052 0.000 0.000 0.880 0.068 0.000
#> GSM386395 4 0.0363 0.727 0.012 0.000 0.000 0.988 0.000 0.000
#> GSM386396 4 0.2951 0.720 0.004 0.004 0.000 0.820 0.004 0.168
#> GSM386397 4 0.1858 0.770 0.000 0.000 0.000 0.904 0.004 0.092
#> GSM386388 3 0.0000 0.950 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386389 3 0.0458 0.945 0.016 0.000 0.984 0.000 0.000 0.000
#> GSM386390 3 0.0146 0.950 0.004 0.000 0.996 0.000 0.000 0.000
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
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 agent(p) dose(p) time(p) k
#> CV:NMF 73 0.5637 0.94679 2.43e-14 2
#> CV:NMF 73 0.5329 0.95165 4.10e-13 3
#> CV:NMF 54 0.0197 0.07843 1.17e-13 4
#> CV:NMF 63 0.1473 0.00347 8.38e-16 5
#> CV:NMF 59 0.0374 0.01493 3.88e-18 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 51941 rows and 74 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'MAD' method.
#> Subgroups are detected by 'hclust' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 2.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
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.458 0.798 0.887 0.396 0.641 0.641
#> 3 3 0.532 0.765 0.868 0.193 0.928 0.890
#> 4 4 0.445 0.548 0.752 0.266 0.950 0.916
#> 5 5 0.442 0.577 0.714 0.126 0.803 0.639
#> 6 6 0.662 0.740 0.836 0.124 0.854 0.608
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 2
Following shows the table of the partitions (You need to click the show/hide
code output link to see it). The membership matrix (columns with name p*
)
is inferred by
clue::cl_consensus()
function with the SE
method. Basically the value in the membership matrix
represents the probability to belong to a certain group. The finall class
label for an item is determined with the group with highest probability it
belongs to.
In get_classes()
function, the entropy is calculated from the membership
matrix and the silhouette score is calculated from the consensus matrix.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> GSM386435 2 0.000 0.872 0.000 1.000
#> GSM386436 2 0.000 0.872 0.000 1.000
#> GSM386437 2 0.000 0.872 0.000 1.000
#> GSM386438 2 0.000 0.872 0.000 1.000
#> GSM386439 1 0.909 0.639 0.676 0.324
#> GSM386440 2 0.000 0.872 0.000 1.000
#> GSM386441 2 0.000 0.872 0.000 1.000
#> GSM386442 2 0.000 0.872 0.000 1.000
#> GSM386447 2 0.730 0.737 0.204 0.796
#> GSM386448 2 0.000 0.872 0.000 1.000
#> GSM386449 2 0.000 0.872 0.000 1.000
#> GSM386450 2 0.000 0.872 0.000 1.000
#> GSM386451 2 0.000 0.872 0.000 1.000
#> GSM386452 1 0.000 0.856 1.000 0.000
#> GSM386453 2 0.000 0.872 0.000 1.000
#> GSM386454 1 0.000 0.856 1.000 0.000
#> GSM386455 2 0.000 0.872 0.000 1.000
#> GSM386456 2 0.000 0.872 0.000 1.000
#> GSM386457 2 0.634 0.802 0.160 0.840
#> GSM386458 2 0.634 0.802 0.160 0.840
#> GSM386443 1 0.000 0.856 1.000 0.000
#> GSM386444 2 0.000 0.872 0.000 1.000
#> GSM386445 2 0.000 0.872 0.000 1.000
#> GSM386446 2 0.000 0.872 0.000 1.000
#> GSM386398 1 0.881 0.673 0.700 0.300
#> GSM386399 1 0.909 0.639 0.676 0.324
#> GSM386400 1 0.881 0.673 0.700 0.300
#> GSM386401 2 0.000 0.872 0.000 1.000
#> GSM386406 2 0.388 0.849 0.076 0.924
#> GSM386407 2 0.795 0.755 0.240 0.760
#> GSM386408 2 0.000 0.872 0.000 1.000
#> GSM386409 1 0.000 0.856 1.000 0.000
#> GSM386410 1 0.000 0.856 1.000 0.000
#> GSM386411 2 0.795 0.755 0.240 0.760
#> GSM386412 2 0.584 0.820 0.140 0.860
#> GSM386413 2 0.795 0.755 0.240 0.760
#> GSM386414 2 0.671 0.785 0.176 0.824
#> GSM386415 2 0.722 0.789 0.200 0.800
#> GSM386416 2 0.671 0.785 0.176 0.824
#> GSM386417 2 0.000 0.872 0.000 1.000
#> GSM386402 2 0.443 0.855 0.092 0.908
#> GSM386403 2 0.443 0.855 0.092 0.908
#> GSM386404 2 0.443 0.855 0.092 0.908
#> GSM386405 2 0.443 0.855 0.092 0.908
#> GSM386418 2 0.402 0.847 0.080 0.920
#> GSM386419 2 0.000 0.872 0.000 1.000
#> GSM386420 2 0.000 0.872 0.000 1.000
#> GSM386421 2 0.402 0.847 0.080 0.920
#> GSM386426 1 0.697 0.775 0.812 0.188
#> GSM386427 1 0.000 0.856 1.000 0.000
#> GSM386428 2 0.388 0.849 0.076 0.924
#> GSM386429 2 0.795 0.755 0.240 0.760
#> GSM386430 2 0.795 0.755 0.240 0.760
#> GSM386431 2 0.795 0.755 0.240 0.760
#> GSM386432 2 0.795 0.755 0.240 0.760
#> GSM386433 2 0.722 0.789 0.200 0.800
#> GSM386434 2 0.722 0.789 0.200 0.800
#> GSM386422 2 0.443 0.855 0.092 0.908
#> GSM386423 1 0.000 0.856 1.000 0.000
#> GSM386424 2 0.443 0.855 0.092 0.908
#> GSM386425 2 0.443 0.855 0.092 0.908
#> GSM386385 1 0.929 0.614 0.656 0.344
#> GSM386386 1 0.000 0.856 1.000 0.000
#> GSM386387 2 0.000 0.872 0.000 1.000
#> GSM386391 2 0.430 0.844 0.088 0.912
#> GSM386392 1 0.697 0.775 0.812 0.188
#> GSM386393 2 1.000 0.300 0.488 0.512
#> GSM386394 1 0.000 0.856 1.000 0.000
#> GSM386395 2 1.000 0.300 0.488 0.512
#> GSM386396 2 0.996 0.361 0.464 0.536
#> GSM386397 2 0.996 0.361 0.464 0.536
#> GSM386388 2 0.443 0.855 0.092 0.908
#> GSM386389 1 0.000 0.856 1.000 0.000
#> GSM386390 2 0.443 0.855 0.092 0.908
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM386435 2 0.0237 0.879 0.000 0.996 0.004
#> GSM386436 2 0.0237 0.879 0.000 0.996 0.004
#> GSM386437 2 0.0237 0.879 0.000 0.996 0.004
#> GSM386438 2 0.0237 0.879 0.000 0.996 0.004
#> GSM386439 3 0.2982 0.963 0.056 0.024 0.920
#> GSM386440 2 0.0237 0.879 0.000 0.996 0.004
#> GSM386441 2 0.0237 0.879 0.000 0.996 0.004
#> GSM386442 2 0.0237 0.879 0.000 0.996 0.004
#> GSM386447 2 0.5597 0.739 0.020 0.764 0.216
#> GSM386448 2 0.0237 0.879 0.000 0.996 0.004
#> GSM386449 2 0.0237 0.879 0.000 0.996 0.004
#> GSM386450 2 0.0237 0.879 0.000 0.996 0.004
#> GSM386451 2 0.0237 0.879 0.000 0.996 0.004
#> GSM386452 1 0.4291 0.667 0.820 0.000 0.180
#> GSM386453 2 0.0237 0.879 0.000 0.996 0.004
#> GSM386454 1 0.4291 0.667 0.820 0.000 0.180
#> GSM386455 2 0.0237 0.879 0.000 0.996 0.004
#> GSM386456 2 0.0237 0.879 0.000 0.996 0.004
#> GSM386457 2 0.5020 0.785 0.012 0.796 0.192
#> GSM386458 2 0.5020 0.785 0.012 0.796 0.192
#> GSM386443 1 0.1753 0.656 0.952 0.000 0.048
#> GSM386444 2 0.0237 0.879 0.000 0.996 0.004
#> GSM386445 2 0.0237 0.879 0.000 0.996 0.004
#> GSM386446 2 0.0237 0.879 0.000 0.996 0.004
#> GSM386398 3 0.1964 0.951 0.056 0.000 0.944
#> GSM386399 3 0.2982 0.963 0.056 0.024 0.920
#> GSM386400 3 0.1964 0.951 0.056 0.000 0.944
#> GSM386401 2 0.0237 0.879 0.000 0.996 0.004
#> GSM386406 2 0.2448 0.855 0.076 0.924 0.000
#> GSM386407 2 0.6546 0.723 0.240 0.716 0.044
#> GSM386408 2 0.0000 0.879 0.000 1.000 0.000
#> GSM386409 1 0.3482 0.690 0.872 0.000 0.128
#> GSM386410 1 0.3267 0.694 0.884 0.000 0.116
#> GSM386411 2 0.6546 0.723 0.240 0.716 0.044
#> GSM386412 2 0.5060 0.809 0.028 0.816 0.156
#> GSM386413 2 0.6546 0.723 0.240 0.716 0.044
#> GSM386414 2 0.5559 0.769 0.028 0.780 0.192
#> GSM386415 2 0.5891 0.769 0.200 0.764 0.036
#> GSM386416 2 0.5559 0.769 0.028 0.780 0.192
#> GSM386417 2 0.0592 0.878 0.000 0.988 0.012
#> GSM386402 2 0.3502 0.862 0.084 0.896 0.020
#> GSM386403 2 0.3502 0.862 0.084 0.896 0.020
#> GSM386404 2 0.3502 0.862 0.084 0.896 0.020
#> GSM386405 2 0.3502 0.862 0.084 0.896 0.020
#> GSM386418 2 0.2537 0.854 0.080 0.920 0.000
#> GSM386419 2 0.0000 0.879 0.000 1.000 0.000
#> GSM386420 2 0.0000 0.879 0.000 1.000 0.000
#> GSM386421 2 0.2537 0.854 0.080 0.920 0.000
#> GSM386426 1 0.5591 0.418 0.696 0.000 0.304
#> GSM386427 1 0.3267 0.694 0.884 0.000 0.116
#> GSM386428 2 0.2448 0.855 0.076 0.924 0.000
#> GSM386429 2 0.6546 0.723 0.240 0.716 0.044
#> GSM386430 2 0.6546 0.723 0.240 0.716 0.044
#> GSM386431 2 0.6546 0.723 0.240 0.716 0.044
#> GSM386432 2 0.6546 0.723 0.240 0.716 0.044
#> GSM386433 2 0.5891 0.769 0.200 0.764 0.036
#> GSM386434 2 0.5891 0.769 0.200 0.764 0.036
#> GSM386422 2 0.3502 0.862 0.084 0.896 0.020
#> GSM386423 1 0.1753 0.656 0.952 0.000 0.048
#> GSM386424 2 0.3502 0.862 0.084 0.896 0.020
#> GSM386425 2 0.3502 0.862 0.084 0.896 0.020
#> GSM386385 3 0.3481 0.936 0.052 0.044 0.904
#> GSM386386 1 0.3267 0.694 0.884 0.000 0.116
#> GSM386387 2 0.0237 0.879 0.000 0.996 0.004
#> GSM386391 2 0.2945 0.851 0.088 0.908 0.004
#> GSM386392 1 0.5591 0.418 0.696 0.000 0.304
#> GSM386393 1 0.7758 -0.257 0.484 0.468 0.048
#> GSM386394 1 0.2448 0.691 0.924 0.000 0.076
#> GSM386395 1 0.7758 -0.257 0.484 0.468 0.048
#> GSM386396 2 0.7671 0.256 0.464 0.492 0.044
#> GSM386397 2 0.7671 0.256 0.464 0.492 0.044
#> GSM386388 2 0.3502 0.862 0.084 0.896 0.020
#> GSM386389 1 0.1753 0.656 0.952 0.000 0.048
#> GSM386390 2 0.3502 0.862 0.084 0.896 0.020
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM386435 2 0.0000 0.650 0.000 1.000 0.000 0.000
#> GSM386436 2 0.0000 0.650 0.000 1.000 0.000 0.000
#> GSM386437 2 0.0000 0.650 0.000 1.000 0.000 0.000
#> GSM386438 2 0.0000 0.650 0.000 1.000 0.000 0.000
#> GSM386439 3 0.0707 0.969 0.000 0.020 0.980 0.000
#> GSM386440 2 0.0000 0.650 0.000 1.000 0.000 0.000
#> GSM386441 2 0.0000 0.650 0.000 1.000 0.000 0.000
#> GSM386442 2 0.0000 0.650 0.000 1.000 0.000 0.000
#> GSM386447 2 0.6407 0.489 0.000 0.648 0.204 0.148
#> GSM386448 2 0.0000 0.650 0.000 1.000 0.000 0.000
#> GSM386449 2 0.0000 0.650 0.000 1.000 0.000 0.000
#> GSM386450 2 0.0000 0.650 0.000 1.000 0.000 0.000
#> GSM386451 2 0.2868 0.638 0.000 0.864 0.000 0.136
#> GSM386452 1 0.3074 0.721 0.848 0.000 0.152 0.000
#> GSM386453 2 0.2868 0.638 0.000 0.864 0.000 0.136
#> GSM386454 1 0.3074 0.721 0.848 0.000 0.152 0.000
#> GSM386455 2 0.2868 0.638 0.000 0.864 0.000 0.136
#> GSM386456 2 0.2868 0.638 0.000 0.864 0.000 0.136
#> GSM386457 2 0.6463 0.517 0.000 0.644 0.160 0.196
#> GSM386458 2 0.6463 0.517 0.000 0.644 0.160 0.196
#> GSM386443 1 0.1867 0.747 0.928 0.000 0.000 0.072
#> GSM386444 2 0.4222 0.568 0.000 0.728 0.000 0.272
#> GSM386445 2 0.4222 0.568 0.000 0.728 0.000 0.272
#> GSM386446 2 0.4222 0.568 0.000 0.728 0.000 0.272
#> GSM386398 3 0.0336 0.960 0.008 0.000 0.992 0.000
#> GSM386399 3 0.0707 0.969 0.000 0.020 0.980 0.000
#> GSM386400 3 0.0336 0.960 0.008 0.000 0.992 0.000
#> GSM386401 2 0.0000 0.650 0.000 1.000 0.000 0.000
#> GSM386406 2 0.2760 0.574 0.000 0.872 0.000 0.128
#> GSM386407 2 0.4981 -0.265 0.000 0.536 0.000 0.464
#> GSM386408 2 0.0592 0.646 0.000 0.984 0.000 0.016
#> GSM386409 1 0.4789 0.802 0.772 0.000 0.056 0.172
#> GSM386410 1 0.4552 0.805 0.784 0.000 0.044 0.172
#> GSM386411 2 0.4981 -0.265 0.000 0.536 0.000 0.464
#> GSM386412 2 0.6265 0.489 0.000 0.656 0.124 0.220
#> GSM386413 2 0.4981 -0.265 0.000 0.536 0.000 0.464
#> GSM386414 2 0.6900 0.475 0.016 0.640 0.160 0.184
#> GSM386415 2 0.4888 -0.065 0.000 0.588 0.000 0.412
#> GSM386416 2 0.6900 0.475 0.016 0.640 0.160 0.184
#> GSM386417 2 0.3688 0.633 0.000 0.792 0.000 0.208
#> GSM386402 2 0.5602 0.516 0.024 0.568 0.000 0.408
#> GSM386403 2 0.5602 0.516 0.024 0.568 0.000 0.408
#> GSM386404 2 0.5602 0.516 0.024 0.568 0.000 0.408
#> GSM386405 2 0.5602 0.516 0.024 0.568 0.000 0.408
#> GSM386418 2 0.2814 0.569 0.000 0.868 0.000 0.132
#> GSM386419 2 0.1302 0.640 0.000 0.956 0.000 0.044
#> GSM386420 2 0.1302 0.640 0.000 0.956 0.000 0.044
#> GSM386421 2 0.2814 0.569 0.000 0.868 0.000 0.132
#> GSM386426 1 0.6854 0.675 0.596 0.000 0.232 0.172
#> GSM386427 1 0.4552 0.805 0.784 0.000 0.044 0.172
#> GSM386428 2 0.2760 0.574 0.000 0.872 0.000 0.128
#> GSM386429 2 0.4981 -0.265 0.000 0.536 0.000 0.464
#> GSM386430 2 0.4981 -0.265 0.000 0.536 0.000 0.464
#> GSM386431 2 0.4981 -0.265 0.000 0.536 0.000 0.464
#> GSM386432 2 0.4981 -0.265 0.000 0.536 0.000 0.464
#> GSM386433 2 0.4888 -0.065 0.000 0.588 0.000 0.412
#> GSM386434 2 0.4888 -0.065 0.000 0.588 0.000 0.412
#> GSM386422 2 0.5602 0.516 0.024 0.568 0.000 0.408
#> GSM386423 1 0.1867 0.747 0.928 0.000 0.000 0.072
#> GSM386424 2 0.5602 0.516 0.024 0.568 0.000 0.408
#> GSM386425 2 0.5602 0.516 0.024 0.568 0.000 0.408
#> GSM386385 3 0.1305 0.946 0.000 0.036 0.960 0.004
#> GSM386386 1 0.4552 0.805 0.784 0.000 0.044 0.172
#> GSM386387 2 0.0469 0.648 0.000 0.988 0.000 0.012
#> GSM386391 2 0.3257 0.554 0.000 0.844 0.004 0.152
#> GSM386392 1 0.6854 0.675 0.596 0.000 0.232 0.172
#> GSM386393 4 0.4483 0.969 0.000 0.284 0.004 0.712
#> GSM386394 1 0.5300 0.638 0.580 0.000 0.012 0.408
#> GSM386395 4 0.4483 0.969 0.000 0.284 0.004 0.712
#> GSM386396 4 0.4454 0.968 0.000 0.308 0.000 0.692
#> GSM386397 4 0.4454 0.968 0.000 0.308 0.000 0.692
#> GSM386388 2 0.5602 0.516 0.024 0.568 0.000 0.408
#> GSM386389 1 0.1867 0.747 0.928 0.000 0.000 0.072
#> GSM386390 2 0.5602 0.516 0.024 0.568 0.000 0.408
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM386435 2 0.0162 0.699 0.000 0.996 0.004 0.000 0.000
#> GSM386436 2 0.0162 0.699 0.000 0.996 0.004 0.000 0.000
#> GSM386437 2 0.0162 0.699 0.000 0.996 0.004 0.000 0.000
#> GSM386438 2 0.0162 0.699 0.000 0.996 0.004 0.000 0.000
#> GSM386439 5 0.0609 0.972 0.000 0.020 0.000 0.000 0.980
#> GSM386440 2 0.0162 0.699 0.000 0.996 0.004 0.000 0.000
#> GSM386441 2 0.0162 0.699 0.000 0.996 0.004 0.000 0.000
#> GSM386442 2 0.0162 0.699 0.000 0.996 0.004 0.000 0.000
#> GSM386447 2 0.6473 0.510 0.000 0.620 0.112 0.064 0.204
#> GSM386448 2 0.0162 0.699 0.000 0.996 0.004 0.000 0.000
#> GSM386449 2 0.0162 0.699 0.000 0.996 0.004 0.000 0.000
#> GSM386450 2 0.0162 0.699 0.000 0.996 0.004 0.000 0.000
#> GSM386451 2 0.2891 0.534 0.000 0.824 0.176 0.000 0.000
#> GSM386452 1 0.5555 0.471 0.644 0.000 0.204 0.000 0.152
#> GSM386453 2 0.2891 0.534 0.000 0.824 0.176 0.000 0.000
#> GSM386454 1 0.5555 0.471 0.644 0.000 0.204 0.000 0.152
#> GSM386455 2 0.2891 0.534 0.000 0.824 0.176 0.000 0.000
#> GSM386456 2 0.2891 0.534 0.000 0.824 0.176 0.000 0.000
#> GSM386457 2 0.6680 0.486 0.000 0.608 0.164 0.068 0.160
#> GSM386458 2 0.6680 0.486 0.000 0.608 0.164 0.068 0.160
#> GSM386443 1 0.3837 0.535 0.692 0.000 0.308 0.000 0.000
#> GSM386444 3 0.4138 0.788 0.000 0.384 0.616 0.000 0.000
#> GSM386445 3 0.4138 0.788 0.000 0.384 0.616 0.000 0.000
#> GSM386446 3 0.4138 0.788 0.000 0.384 0.616 0.000 0.000
#> GSM386398 5 0.0290 0.963 0.008 0.000 0.000 0.000 0.992
#> GSM386399 5 0.0609 0.972 0.000 0.020 0.000 0.000 0.980
#> GSM386400 5 0.0290 0.963 0.008 0.000 0.000 0.000 0.992
#> GSM386401 2 0.0162 0.699 0.000 0.996 0.004 0.000 0.000
#> GSM386406 2 0.3037 0.674 0.004 0.864 0.032 0.100 0.000
#> GSM386407 2 0.5648 0.223 0.000 0.476 0.076 0.448 0.000
#> GSM386408 2 0.0566 0.701 0.000 0.984 0.004 0.012 0.000
#> GSM386409 1 0.5243 0.402 0.540 0.000 0.000 0.412 0.048
#> GSM386410 1 0.5065 0.404 0.544 0.000 0.000 0.420 0.036
#> GSM386411 2 0.5648 0.223 0.000 0.476 0.076 0.448 0.000
#> GSM386412 2 0.6835 0.536 0.000 0.608 0.136 0.132 0.124
#> GSM386413 2 0.5648 0.223 0.000 0.476 0.076 0.448 0.000
#> GSM386414 2 0.6993 0.516 0.008 0.604 0.140 0.088 0.160
#> GSM386415 2 0.5632 0.334 0.000 0.528 0.080 0.392 0.000
#> GSM386416 2 0.6993 0.516 0.008 0.604 0.140 0.088 0.160
#> GSM386417 2 0.4337 0.573 0.000 0.748 0.196 0.056 0.000
#> GSM386402 3 0.3242 0.937 0.000 0.216 0.784 0.000 0.000
#> GSM386403 3 0.3242 0.937 0.000 0.216 0.784 0.000 0.000
#> GSM386404 3 0.3242 0.937 0.000 0.216 0.784 0.000 0.000
#> GSM386405 3 0.3242 0.937 0.000 0.216 0.784 0.000 0.000
#> GSM386418 2 0.3090 0.672 0.004 0.860 0.032 0.104 0.000
#> GSM386419 2 0.1547 0.697 0.004 0.948 0.032 0.016 0.000
#> GSM386420 2 0.1547 0.697 0.004 0.948 0.032 0.016 0.000
#> GSM386421 2 0.3090 0.672 0.004 0.860 0.032 0.104 0.000
#> GSM386426 4 0.6631 -0.325 0.356 0.000 0.000 0.420 0.224
#> GSM386427 1 0.5065 0.404 0.544 0.000 0.000 0.420 0.036
#> GSM386428 2 0.3037 0.674 0.004 0.864 0.032 0.100 0.000
#> GSM386429 2 0.5648 0.223 0.000 0.476 0.076 0.448 0.000
#> GSM386430 2 0.5648 0.223 0.000 0.476 0.076 0.448 0.000
#> GSM386431 2 0.5648 0.223 0.000 0.476 0.076 0.448 0.000
#> GSM386432 2 0.5648 0.223 0.000 0.476 0.076 0.448 0.000
#> GSM386433 2 0.5632 0.334 0.000 0.528 0.080 0.392 0.000
#> GSM386434 2 0.5632 0.334 0.000 0.528 0.080 0.392 0.000
#> GSM386422 3 0.3242 0.937 0.000 0.216 0.784 0.000 0.000
#> GSM386423 1 0.3837 0.535 0.692 0.000 0.308 0.000 0.000
#> GSM386424 3 0.3242 0.937 0.000 0.216 0.784 0.000 0.000
#> GSM386425 3 0.3242 0.937 0.000 0.216 0.784 0.000 0.000
#> GSM386385 5 0.1124 0.948 0.000 0.036 0.000 0.004 0.960
#> GSM386386 1 0.5065 0.404 0.544 0.000 0.000 0.420 0.036
#> GSM386387 2 0.0613 0.698 0.004 0.984 0.008 0.004 0.000
#> GSM386391 2 0.3654 0.663 0.004 0.828 0.040 0.124 0.004
#> GSM386392 4 0.6631 -0.325 0.356 0.000 0.000 0.420 0.224
#> GSM386393 4 0.5111 0.420 0.004 0.252 0.060 0.680 0.004
#> GSM386394 4 0.4151 -0.210 0.344 0.000 0.000 0.652 0.004
#> GSM386395 4 0.5111 0.420 0.004 0.252 0.060 0.680 0.004
#> GSM386396 4 0.5004 0.401 0.000 0.256 0.072 0.672 0.000
#> GSM386397 4 0.5004 0.401 0.000 0.256 0.072 0.672 0.000
#> GSM386388 3 0.3242 0.937 0.000 0.216 0.784 0.000 0.000
#> GSM386389 1 0.3837 0.535 0.692 0.000 0.308 0.000 0.000
#> GSM386390 3 0.3242 0.937 0.000 0.216 0.784 0.000 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM386435 2 0.0000 0.750 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM386436 2 0.0000 0.750 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM386437 2 0.0000 0.750 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM386438 2 0.0000 0.750 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM386439 6 0.0547 0.963 0.000 0.020 0.000 0.000 0.000 0.980
#> GSM386440 2 0.0000 0.750 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM386441 2 0.0000 0.750 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM386442 2 0.0000 0.750 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM386447 2 0.7470 0.344 0.016 0.484 0.144 0.144 0.008 0.204
#> GSM386448 2 0.0000 0.750 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM386449 2 0.0000 0.750 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM386450 2 0.0000 0.750 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM386451 2 0.4906 0.541 0.008 0.652 0.272 0.008 0.060 0.000
#> GSM386452 5 0.2956 0.828 0.040 0.000 0.000 0.000 0.840 0.120
#> GSM386453 2 0.4906 0.541 0.008 0.652 0.272 0.008 0.060 0.000
#> GSM386454 5 0.2956 0.828 0.040 0.000 0.000 0.000 0.840 0.120
#> GSM386455 2 0.4906 0.541 0.008 0.652 0.272 0.008 0.060 0.000
#> GSM386456 2 0.4906 0.541 0.008 0.652 0.272 0.008 0.060 0.000
#> GSM386457 2 0.7754 0.301 0.020 0.444 0.212 0.160 0.008 0.156
#> GSM386458 2 0.7754 0.301 0.020 0.444 0.212 0.160 0.008 0.156
#> GSM386443 5 0.1714 0.892 0.000 0.000 0.092 0.000 0.908 0.000
#> GSM386444 3 0.3564 0.794 0.008 0.124 0.808 0.000 0.060 0.000
#> GSM386445 3 0.3564 0.794 0.008 0.124 0.808 0.000 0.060 0.000
#> GSM386446 3 0.3564 0.794 0.008 0.124 0.808 0.000 0.060 0.000
#> GSM386398 6 0.0748 0.951 0.004 0.000 0.004 0.000 0.016 0.976
#> GSM386399 6 0.0547 0.963 0.000 0.020 0.000 0.000 0.000 0.980
#> GSM386400 6 0.0748 0.951 0.004 0.000 0.004 0.000 0.016 0.976
#> GSM386401 2 0.0000 0.750 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM386406 2 0.2848 0.645 0.004 0.828 0.000 0.160 0.008 0.000
#> GSM386407 4 0.3431 0.836 0.000 0.228 0.016 0.756 0.000 0.000
#> GSM386408 2 0.0603 0.744 0.000 0.980 0.000 0.016 0.004 0.000
#> GSM386409 1 0.3450 0.849 0.780 0.000 0.000 0.000 0.188 0.032
#> GSM386410 1 0.3221 0.854 0.792 0.000 0.000 0.000 0.188 0.020
#> GSM386411 4 0.3431 0.836 0.000 0.228 0.016 0.756 0.000 0.000
#> GSM386412 2 0.7490 0.186 0.016 0.444 0.148 0.264 0.004 0.124
#> GSM386413 4 0.3431 0.836 0.000 0.228 0.016 0.756 0.000 0.000
#> GSM386414 2 0.7908 0.258 0.016 0.448 0.156 0.200 0.024 0.156
#> GSM386415 4 0.4449 0.765 0.000 0.272 0.052 0.672 0.004 0.000
#> GSM386416 2 0.7908 0.258 0.016 0.448 0.156 0.200 0.024 0.156
#> GSM386417 2 0.6511 0.377 0.004 0.520 0.268 0.148 0.060 0.000
#> GSM386402 3 0.0260 0.933 0.000 0.000 0.992 0.008 0.000 0.000
#> GSM386403 3 0.0260 0.933 0.000 0.000 0.992 0.008 0.000 0.000
#> GSM386404 3 0.0260 0.933 0.000 0.000 0.992 0.008 0.000 0.000
#> GSM386405 3 0.0260 0.933 0.000 0.000 0.992 0.008 0.000 0.000
#> GSM386418 2 0.2958 0.642 0.008 0.824 0.000 0.160 0.008 0.000
#> GSM386419 2 0.1410 0.729 0.004 0.944 0.000 0.044 0.008 0.000
#> GSM386420 2 0.1410 0.729 0.004 0.944 0.000 0.044 0.008 0.000
#> GSM386421 2 0.2958 0.642 0.008 0.824 0.000 0.160 0.008 0.000
#> GSM386426 1 0.2854 0.775 0.792 0.000 0.000 0.000 0.000 0.208
#> GSM386427 1 0.3221 0.854 0.792 0.000 0.000 0.000 0.188 0.020
#> GSM386428 2 0.2848 0.645 0.004 0.828 0.000 0.160 0.008 0.000
#> GSM386429 4 0.3431 0.836 0.000 0.228 0.016 0.756 0.000 0.000
#> GSM386430 4 0.3431 0.836 0.000 0.228 0.016 0.756 0.000 0.000
#> GSM386431 4 0.3431 0.836 0.000 0.228 0.016 0.756 0.000 0.000
#> GSM386432 4 0.3431 0.836 0.000 0.228 0.016 0.756 0.000 0.000
#> GSM386433 4 0.4449 0.765 0.000 0.272 0.052 0.672 0.004 0.000
#> GSM386434 4 0.4449 0.765 0.000 0.272 0.052 0.672 0.004 0.000
#> GSM386422 3 0.0260 0.933 0.000 0.000 0.992 0.008 0.000 0.000
#> GSM386423 5 0.1714 0.892 0.000 0.000 0.092 0.000 0.908 0.000
#> GSM386424 3 0.0260 0.933 0.000 0.000 0.992 0.008 0.000 0.000
#> GSM386425 3 0.0260 0.933 0.000 0.000 0.992 0.008 0.000 0.000
#> GSM386385 6 0.1010 0.943 0.000 0.036 0.000 0.000 0.004 0.960
#> GSM386386 1 0.3221 0.854 0.792 0.000 0.000 0.000 0.188 0.020
#> GSM386387 2 0.0603 0.744 0.000 0.980 0.000 0.016 0.004 0.000
#> GSM386391 2 0.3362 0.609 0.012 0.792 0.000 0.184 0.012 0.000
#> GSM386392 1 0.2854 0.775 0.792 0.000 0.000 0.000 0.000 0.208
#> GSM386393 4 0.1584 0.612 0.064 0.000 0.000 0.928 0.008 0.000
#> GSM386394 1 0.1285 0.737 0.944 0.000 0.000 0.052 0.004 0.000
#> GSM386395 4 0.1584 0.612 0.064 0.000 0.000 0.928 0.008 0.000
#> GSM386396 4 0.1219 0.632 0.048 0.000 0.004 0.948 0.000 0.000
#> GSM386397 4 0.1219 0.632 0.048 0.000 0.004 0.948 0.000 0.000
#> GSM386388 3 0.0260 0.933 0.000 0.000 0.992 0.008 0.000 0.000
#> GSM386389 5 0.1714 0.892 0.000 0.000 0.092 0.000 0.908 0.000
#> GSM386390 3 0.0260 0.933 0.000 0.000 0.992 0.008 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 agent(p) dose(p) time(p) k
#> MAD:hclust 70 0.39100 0.11374 2.03e-01 2
#> MAD:hclust 68 0.81460 0.25721 5.96e-03 3
#> MAD:hclust 60 0.35681 0.00355 6.35e-04 4
#> MAD:hclust 49 0.55005 0.45320 1.65e-07 5
#> MAD:hclust 67 0.00832 0.02801 9.74e-14 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 51941 rows and 74 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.229 0.717 0.793 0.4043 0.641 0.641
#> 3 3 0.588 0.677 0.829 0.5372 0.726 0.573
#> 4 4 0.785 0.832 0.884 0.1685 0.830 0.574
#> 5 5 0.787 0.668 0.813 0.0727 0.884 0.614
#> 6 6 0.794 0.677 0.779 0.0426 0.939 0.746
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
#> GSM386435 2 0.4690 0.744 0.100 0.900
#> GSM386436 2 0.4690 0.744 0.100 0.900
#> GSM386437 2 0.4690 0.744 0.100 0.900
#> GSM386438 2 0.4690 0.744 0.100 0.900
#> GSM386439 1 0.9323 0.774 0.652 0.348
#> GSM386440 2 0.4690 0.744 0.100 0.900
#> GSM386441 2 0.4690 0.744 0.100 0.900
#> GSM386442 2 0.4690 0.744 0.100 0.900
#> GSM386447 2 0.6887 0.645 0.184 0.816
#> GSM386448 2 0.4690 0.744 0.100 0.900
#> GSM386449 2 0.4690 0.744 0.100 0.900
#> GSM386450 2 0.4690 0.744 0.100 0.900
#> GSM386451 2 0.0672 0.763 0.008 0.992
#> GSM386452 1 0.8207 0.835 0.744 0.256
#> GSM386453 2 0.0376 0.763 0.004 0.996
#> GSM386454 1 0.8207 0.835 0.744 0.256
#> GSM386455 2 0.4161 0.752 0.084 0.916
#> GSM386456 2 0.4022 0.753 0.080 0.920
#> GSM386457 2 0.4161 0.752 0.084 0.916
#> GSM386458 2 0.7139 0.702 0.196 0.804
#> GSM386443 1 0.4815 0.566 0.896 0.104
#> GSM386444 2 0.8443 0.642 0.272 0.728
#> GSM386445 2 0.8443 0.642 0.272 0.728
#> GSM386446 2 0.8327 0.644 0.264 0.736
#> GSM386398 1 0.9044 0.813 0.680 0.320
#> GSM386399 1 0.9044 0.813 0.680 0.320
#> GSM386400 1 0.9044 0.813 0.680 0.320
#> GSM386401 2 0.4690 0.744 0.100 0.900
#> GSM386406 2 0.4690 0.744 0.100 0.900
#> GSM386407 2 0.4298 0.749 0.088 0.912
#> GSM386408 2 0.4690 0.744 0.100 0.900
#> GSM386409 1 0.8499 0.835 0.724 0.276
#> GSM386410 1 0.8207 0.835 0.744 0.256
#> GSM386411 2 0.1843 0.764 0.028 0.972
#> GSM386412 2 0.6801 0.670 0.180 0.820
#> GSM386413 2 0.1843 0.764 0.028 0.972
#> GSM386414 2 0.8955 0.618 0.312 0.688
#> GSM386415 2 0.7602 0.702 0.220 0.780
#> GSM386416 1 0.7674 0.628 0.776 0.224
#> GSM386417 2 0.6247 0.727 0.156 0.844
#> GSM386402 2 0.9323 0.603 0.348 0.652
#> GSM386403 2 0.9393 0.595 0.356 0.644
#> GSM386404 2 0.9393 0.595 0.356 0.644
#> GSM386405 2 0.9286 0.605 0.344 0.656
#> GSM386418 2 0.4690 0.744 0.100 0.900
#> GSM386419 2 0.4690 0.744 0.100 0.900
#> GSM386420 2 0.4690 0.744 0.100 0.900
#> GSM386421 2 0.4690 0.744 0.100 0.900
#> GSM386426 1 0.8909 0.823 0.692 0.308
#> GSM386427 1 0.8207 0.835 0.744 0.256
#> GSM386428 2 0.4690 0.744 0.100 0.900
#> GSM386429 2 0.2948 0.761 0.052 0.948
#> GSM386430 2 0.2948 0.761 0.052 0.948
#> GSM386431 2 0.6623 0.680 0.172 0.828
#> GSM386432 2 0.1633 0.764 0.024 0.976
#> GSM386433 2 0.7602 0.702 0.220 0.780
#> GSM386434 2 0.7602 0.702 0.220 0.780
#> GSM386422 2 0.9323 0.603 0.348 0.652
#> GSM386423 1 0.4815 0.566 0.896 0.104
#> GSM386424 2 0.9323 0.603 0.348 0.652
#> GSM386425 2 0.9323 0.603 0.348 0.652
#> GSM386385 2 0.6712 0.655 0.176 0.824
#> GSM386386 1 0.8499 0.835 0.724 0.276
#> GSM386387 2 0.4690 0.744 0.100 0.900
#> GSM386391 2 0.4690 0.744 0.100 0.900
#> GSM386392 1 0.8909 0.823 0.692 0.308
#> GSM386393 2 0.8386 0.630 0.268 0.732
#> GSM386394 1 0.8144 0.833 0.748 0.252
#> GSM386395 2 0.8386 0.630 0.268 0.732
#> GSM386396 2 0.7602 0.702 0.220 0.780
#> GSM386397 2 0.7602 0.702 0.220 0.780
#> GSM386388 2 0.9323 0.603 0.348 0.652
#> GSM386389 1 0.4815 0.566 0.896 0.104
#> GSM386390 2 0.9323 0.603 0.348 0.652
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM386435 2 0.0000 0.7640 0.000 1.000 0.000
#> GSM386436 2 0.0000 0.7640 0.000 1.000 0.000
#> GSM386437 2 0.0000 0.7640 0.000 1.000 0.000
#> GSM386438 2 0.0000 0.7640 0.000 1.000 0.000
#> GSM386439 1 0.5580 0.7607 0.736 0.256 0.008
#> GSM386440 2 0.0000 0.7640 0.000 1.000 0.000
#> GSM386441 2 0.0000 0.7640 0.000 1.000 0.000
#> GSM386442 2 0.0000 0.7640 0.000 1.000 0.000
#> GSM386447 2 0.0829 0.7549 0.012 0.984 0.004
#> GSM386448 2 0.0000 0.7640 0.000 1.000 0.000
#> GSM386449 2 0.0000 0.7640 0.000 1.000 0.000
#> GSM386450 2 0.0000 0.7640 0.000 1.000 0.000
#> GSM386451 2 0.7145 0.5333 0.072 0.692 0.236
#> GSM386452 1 0.2384 0.8955 0.936 0.056 0.008
#> GSM386453 2 0.7145 0.5333 0.072 0.692 0.236
#> GSM386454 1 0.2703 0.8958 0.928 0.056 0.016
#> GSM386455 2 0.8108 0.1792 0.072 0.536 0.392
#> GSM386456 2 0.8108 0.1792 0.072 0.536 0.392
#> GSM386457 2 0.8190 0.0432 0.072 0.496 0.432
#> GSM386458 3 0.9439 0.2318 0.180 0.376 0.444
#> GSM386443 1 0.3686 0.8317 0.860 0.000 0.140
#> GSM386444 3 0.2066 0.7940 0.000 0.060 0.940
#> GSM386445 3 0.2066 0.7940 0.000 0.060 0.940
#> GSM386446 3 0.2066 0.7940 0.000 0.060 0.940
#> GSM386398 1 0.3826 0.8827 0.868 0.124 0.008
#> GSM386399 1 0.3826 0.8827 0.868 0.124 0.008
#> GSM386400 1 0.3826 0.8827 0.868 0.124 0.008
#> GSM386401 2 0.0000 0.7640 0.000 1.000 0.000
#> GSM386406 2 0.0237 0.7630 0.000 0.996 0.004
#> GSM386407 2 0.8754 0.3786 0.124 0.532 0.344
#> GSM386408 2 0.0000 0.7640 0.000 1.000 0.000
#> GSM386409 1 0.2537 0.9006 0.920 0.080 0.000
#> GSM386410 1 0.2584 0.8991 0.928 0.064 0.008
#> GSM386411 2 0.8700 0.3841 0.120 0.536 0.344
#> GSM386412 2 0.8891 0.3683 0.136 0.524 0.340
#> GSM386413 2 0.8700 0.3841 0.120 0.536 0.344
#> GSM386414 3 0.8176 0.5543 0.140 0.224 0.636
#> GSM386415 3 0.8021 0.5532 0.124 0.232 0.644
#> GSM386416 1 0.2711 0.7877 0.912 0.000 0.088
#> GSM386417 3 0.7949 0.5058 0.084 0.308 0.608
#> GSM386402 3 0.2384 0.7954 0.008 0.056 0.936
#> GSM386403 3 0.2280 0.7923 0.008 0.052 0.940
#> GSM386404 3 0.2280 0.7923 0.008 0.052 0.940
#> GSM386405 3 0.2384 0.7954 0.008 0.056 0.936
#> GSM386418 2 0.0237 0.7630 0.000 0.996 0.004
#> GSM386419 2 0.0000 0.7640 0.000 1.000 0.000
#> GSM386420 2 0.0000 0.7640 0.000 1.000 0.000
#> GSM386421 2 0.0237 0.7630 0.000 0.996 0.004
#> GSM386426 1 0.2796 0.8991 0.908 0.092 0.000
#> GSM386427 1 0.2584 0.8991 0.928 0.064 0.008
#> GSM386428 2 0.0237 0.7630 0.000 0.996 0.004
#> GSM386429 2 0.8754 0.3786 0.124 0.532 0.344
#> GSM386430 2 0.8754 0.3786 0.124 0.532 0.344
#> GSM386431 2 0.8841 0.3748 0.132 0.528 0.340
#> GSM386432 2 0.8700 0.3841 0.120 0.536 0.344
#> GSM386433 3 0.8021 0.5532 0.124 0.232 0.644
#> GSM386434 3 0.8021 0.5532 0.124 0.232 0.644
#> GSM386422 3 0.2384 0.7954 0.008 0.056 0.936
#> GSM386423 1 0.5621 0.6749 0.692 0.000 0.308
#> GSM386424 3 0.2384 0.7954 0.008 0.056 0.936
#> GSM386425 3 0.2384 0.7954 0.008 0.056 0.936
#> GSM386385 2 0.0424 0.7576 0.008 0.992 0.000
#> GSM386386 1 0.2537 0.9006 0.920 0.080 0.000
#> GSM386387 2 0.0000 0.7640 0.000 1.000 0.000
#> GSM386391 2 0.1289 0.7465 0.000 0.968 0.032
#> GSM386392 1 0.2796 0.8991 0.908 0.092 0.000
#> GSM386393 2 0.8650 0.4465 0.136 0.572 0.292
#> GSM386394 1 0.1753 0.8210 0.952 0.000 0.048
#> GSM386395 2 0.8650 0.4465 0.136 0.572 0.292
#> GSM386396 3 0.8255 0.5143 0.128 0.252 0.620
#> GSM386397 3 0.8255 0.5143 0.128 0.252 0.620
#> GSM386388 3 0.2384 0.7954 0.008 0.056 0.936
#> GSM386389 1 0.5621 0.6749 0.692 0.000 0.308
#> GSM386390 3 0.2384 0.7954 0.008 0.056 0.936
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM386435 2 0.0336 0.896 0.000 0.992 0.008 0.000
#> GSM386436 2 0.0336 0.896 0.000 0.992 0.008 0.000
#> GSM386437 2 0.0336 0.896 0.000 0.992 0.008 0.000
#> GSM386438 2 0.0336 0.896 0.000 0.992 0.008 0.000
#> GSM386439 1 0.3947 0.774 0.856 0.088 0.028 0.028
#> GSM386440 2 0.0336 0.896 0.000 0.992 0.008 0.000
#> GSM386441 2 0.0336 0.896 0.000 0.992 0.008 0.000
#> GSM386442 2 0.0336 0.896 0.000 0.992 0.008 0.000
#> GSM386447 2 0.1545 0.866 0.040 0.952 0.008 0.000
#> GSM386448 2 0.0336 0.896 0.000 0.992 0.008 0.000
#> GSM386449 2 0.0336 0.896 0.000 0.992 0.008 0.000
#> GSM386450 2 0.0336 0.896 0.000 0.992 0.008 0.000
#> GSM386451 2 0.5138 0.318 0.000 0.600 0.008 0.392
#> GSM386452 1 0.2282 0.827 0.924 0.000 0.024 0.052
#> GSM386453 2 0.5150 0.309 0.000 0.596 0.008 0.396
#> GSM386454 1 0.2443 0.829 0.916 0.000 0.024 0.060
#> GSM386455 2 0.5756 0.265 0.000 0.568 0.032 0.400
#> GSM386456 2 0.5756 0.265 0.000 0.568 0.032 0.400
#> GSM386457 2 0.5792 0.214 0.000 0.552 0.032 0.416
#> GSM386458 1 0.7018 0.161 0.500 0.056 0.028 0.416
#> GSM386443 1 0.3015 0.822 0.884 0.000 0.024 0.092
#> GSM386444 3 0.1978 0.988 0.000 0.004 0.928 0.068
#> GSM386445 3 0.1978 0.988 0.000 0.004 0.928 0.068
#> GSM386446 3 0.2048 0.984 0.000 0.008 0.928 0.064
#> GSM386398 1 0.1837 0.828 0.944 0.000 0.028 0.028
#> GSM386399 1 0.1837 0.828 0.944 0.000 0.028 0.028
#> GSM386400 1 0.1837 0.828 0.944 0.000 0.028 0.028
#> GSM386401 2 0.0336 0.896 0.000 0.992 0.008 0.000
#> GSM386406 2 0.0188 0.895 0.000 0.996 0.004 0.000
#> GSM386407 4 0.2589 0.959 0.000 0.116 0.000 0.884
#> GSM386408 2 0.0188 0.895 0.000 0.996 0.004 0.000
#> GSM386409 1 0.0336 0.834 0.992 0.000 0.000 0.008
#> GSM386410 1 0.2578 0.827 0.912 0.000 0.036 0.052
#> GSM386411 4 0.2589 0.959 0.000 0.116 0.000 0.884
#> GSM386412 4 0.2714 0.959 0.004 0.112 0.000 0.884
#> GSM386413 4 0.2589 0.959 0.000 0.116 0.000 0.884
#> GSM386414 4 0.2675 0.927 0.000 0.044 0.048 0.908
#> GSM386415 4 0.3164 0.947 0.000 0.064 0.052 0.884
#> GSM386416 1 0.5452 0.446 0.556 0.000 0.016 0.428
#> GSM386417 4 0.3245 0.945 0.000 0.064 0.056 0.880
#> GSM386402 3 0.2125 0.992 0.000 0.004 0.920 0.076
#> GSM386403 3 0.2266 0.987 0.000 0.004 0.912 0.084
#> GSM386404 3 0.2266 0.987 0.000 0.004 0.912 0.084
#> GSM386405 3 0.2125 0.992 0.000 0.004 0.920 0.076
#> GSM386418 2 0.0188 0.895 0.000 0.996 0.004 0.000
#> GSM386419 2 0.0188 0.895 0.000 0.996 0.004 0.000
#> GSM386420 2 0.0188 0.895 0.000 0.996 0.004 0.000
#> GSM386421 2 0.0188 0.895 0.000 0.996 0.004 0.000
#> GSM386426 1 0.1724 0.830 0.948 0.000 0.032 0.020
#> GSM386427 1 0.2578 0.827 0.912 0.000 0.036 0.052
#> GSM386428 2 0.0188 0.895 0.000 0.996 0.004 0.000
#> GSM386429 4 0.2589 0.959 0.000 0.116 0.000 0.884
#> GSM386430 4 0.2589 0.959 0.000 0.116 0.000 0.884
#> GSM386431 4 0.3052 0.954 0.004 0.104 0.012 0.880
#> GSM386432 4 0.2589 0.959 0.000 0.116 0.000 0.884
#> GSM386433 4 0.3164 0.947 0.000 0.064 0.052 0.884
#> GSM386434 4 0.3164 0.947 0.000 0.064 0.052 0.884
#> GSM386422 3 0.2125 0.992 0.000 0.004 0.920 0.076
#> GSM386423 1 0.6554 0.349 0.520 0.000 0.400 0.080
#> GSM386424 3 0.2053 0.992 0.000 0.004 0.924 0.072
#> GSM386425 3 0.2125 0.992 0.000 0.004 0.920 0.076
#> GSM386385 2 0.2433 0.836 0.060 0.920 0.008 0.012
#> GSM386386 1 0.1488 0.832 0.956 0.000 0.032 0.012
#> GSM386387 2 0.0188 0.895 0.000 0.996 0.004 0.000
#> GSM386391 2 0.0188 0.895 0.000 0.996 0.004 0.000
#> GSM386392 1 0.1724 0.830 0.948 0.000 0.032 0.020
#> GSM386393 4 0.3782 0.933 0.012 0.112 0.024 0.852
#> GSM386394 1 0.5677 0.567 0.628 0.000 0.040 0.332
#> GSM386395 4 0.3782 0.933 0.012 0.112 0.024 0.852
#> GSM386396 4 0.3239 0.950 0.000 0.068 0.052 0.880
#> GSM386397 4 0.3239 0.950 0.000 0.068 0.052 0.880
#> GSM386388 3 0.2053 0.992 0.000 0.004 0.924 0.072
#> GSM386389 1 0.6554 0.349 0.520 0.000 0.400 0.080
#> GSM386390 3 0.2053 0.992 0.000 0.004 0.924 0.072
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM386435 2 0.0000 0.9788 0.000 1.000 0.000 0.000 0.000
#> GSM386436 2 0.0000 0.9788 0.000 1.000 0.000 0.000 0.000
#> GSM386437 2 0.0000 0.9788 0.000 1.000 0.000 0.000 0.000
#> GSM386438 2 0.0000 0.9788 0.000 1.000 0.000 0.000 0.000
#> GSM386439 1 0.3393 0.7811 0.848 0.044 0.000 0.008 0.100
#> GSM386440 2 0.0000 0.9788 0.000 1.000 0.000 0.000 0.000
#> GSM386441 2 0.0000 0.9788 0.000 1.000 0.000 0.000 0.000
#> GSM386442 2 0.0000 0.9788 0.000 1.000 0.000 0.000 0.000
#> GSM386447 2 0.2351 0.8970 0.088 0.896 0.000 0.000 0.016
#> GSM386448 2 0.0000 0.9788 0.000 1.000 0.000 0.000 0.000
#> GSM386449 2 0.0000 0.9788 0.000 1.000 0.000 0.000 0.000
#> GSM386450 2 0.0000 0.9788 0.000 1.000 0.000 0.000 0.000
#> GSM386451 4 0.3857 0.3002 0.000 0.312 0.000 0.688 0.000
#> GSM386452 1 0.3074 0.7856 0.804 0.000 0.000 0.000 0.196
#> GSM386453 4 0.3752 0.3128 0.000 0.292 0.000 0.708 0.000
#> GSM386454 1 0.3835 0.7919 0.744 0.000 0.000 0.012 0.244
#> GSM386455 4 0.4108 0.2978 0.000 0.308 0.008 0.684 0.000
#> GSM386456 4 0.4108 0.2978 0.000 0.308 0.008 0.684 0.000
#> GSM386457 4 0.3980 0.3101 0.000 0.284 0.008 0.708 0.000
#> GSM386458 4 0.6781 -0.0185 0.192 0.044 0.004 0.588 0.172
#> GSM386443 1 0.4597 0.5997 0.564 0.000 0.000 0.012 0.424
#> GSM386444 3 0.3684 0.6939 0.000 0.000 0.720 0.280 0.000
#> GSM386445 3 0.3684 0.6939 0.000 0.000 0.720 0.280 0.000
#> GSM386446 3 0.3838 0.6899 0.000 0.004 0.716 0.280 0.000
#> GSM386398 1 0.2464 0.8128 0.888 0.000 0.000 0.016 0.096
#> GSM386399 1 0.2249 0.8129 0.896 0.000 0.000 0.008 0.096
#> GSM386400 1 0.2464 0.8128 0.888 0.000 0.000 0.016 0.096
#> GSM386401 2 0.0000 0.9788 0.000 1.000 0.000 0.000 0.000
#> GSM386406 2 0.0609 0.9755 0.000 0.980 0.000 0.000 0.020
#> GSM386407 4 0.4425 0.5665 0.000 0.024 0.000 0.680 0.296
#> GSM386408 2 0.0404 0.9772 0.000 0.988 0.000 0.000 0.012
#> GSM386409 1 0.1121 0.8324 0.956 0.000 0.000 0.000 0.044
#> GSM386410 1 0.3143 0.7842 0.796 0.000 0.000 0.000 0.204
#> GSM386411 4 0.4382 0.5697 0.000 0.024 0.000 0.688 0.288
#> GSM386412 4 0.4428 0.5686 0.004 0.020 0.000 0.692 0.284
#> GSM386413 4 0.4382 0.5697 0.000 0.024 0.000 0.688 0.288
#> GSM386414 4 0.4406 0.5621 0.004 0.008 0.008 0.696 0.284
#> GSM386415 4 0.4419 0.5661 0.000 0.012 0.012 0.700 0.276
#> GSM386416 5 0.6638 0.0807 0.240 0.000 0.000 0.320 0.440
#> GSM386417 4 0.0807 0.3956 0.000 0.012 0.012 0.976 0.000
#> GSM386402 3 0.0000 0.8768 0.000 0.000 1.000 0.000 0.000
#> GSM386403 3 0.2605 0.7807 0.000 0.000 0.852 0.000 0.148
#> GSM386404 3 0.2605 0.7807 0.000 0.000 0.852 0.000 0.148
#> GSM386405 3 0.0000 0.8768 0.000 0.000 1.000 0.000 0.000
#> GSM386418 2 0.0880 0.9700 0.000 0.968 0.000 0.000 0.032
#> GSM386419 2 0.0609 0.9755 0.000 0.980 0.000 0.000 0.020
#> GSM386420 2 0.0609 0.9755 0.000 0.980 0.000 0.000 0.020
#> GSM386421 2 0.0794 0.9721 0.000 0.972 0.000 0.000 0.028
#> GSM386426 1 0.1478 0.8119 0.936 0.000 0.000 0.000 0.064
#> GSM386427 1 0.3143 0.7842 0.796 0.000 0.000 0.000 0.204
#> GSM386428 2 0.0880 0.9700 0.000 0.968 0.000 0.000 0.032
#> GSM386429 4 0.4886 0.4259 0.000 0.024 0.000 0.528 0.448
#> GSM386430 4 0.4886 0.4259 0.000 0.024 0.000 0.528 0.448
#> GSM386431 4 0.4886 0.4259 0.000 0.024 0.000 0.528 0.448
#> GSM386432 4 0.4425 0.5665 0.000 0.024 0.000 0.680 0.296
#> GSM386433 4 0.4371 0.5650 0.000 0.012 0.012 0.708 0.268
#> GSM386434 4 0.4371 0.5650 0.000 0.012 0.012 0.708 0.268
#> GSM386422 3 0.0000 0.8768 0.000 0.000 1.000 0.000 0.000
#> GSM386423 5 0.6876 -0.0739 0.220 0.000 0.384 0.008 0.388
#> GSM386424 3 0.0000 0.8768 0.000 0.000 1.000 0.000 0.000
#> GSM386425 3 0.0000 0.8768 0.000 0.000 1.000 0.000 0.000
#> GSM386385 2 0.2932 0.8717 0.104 0.864 0.000 0.000 0.032
#> GSM386386 1 0.2929 0.7954 0.820 0.000 0.000 0.000 0.180
#> GSM386387 2 0.0404 0.9772 0.000 0.988 0.000 0.000 0.012
#> GSM386391 2 0.1502 0.9496 0.004 0.940 0.000 0.000 0.056
#> GSM386392 1 0.1478 0.8119 0.936 0.000 0.000 0.000 0.064
#> GSM386393 5 0.5489 -0.4064 0.028 0.020 0.000 0.448 0.504
#> GSM386394 5 0.5252 -0.0444 0.364 0.000 0.000 0.056 0.580
#> GSM386395 5 0.5489 -0.4064 0.028 0.020 0.000 0.448 0.504
#> GSM386396 4 0.4981 0.4224 0.000 0.016 0.008 0.528 0.448
#> GSM386397 4 0.4981 0.4224 0.000 0.016 0.008 0.528 0.448
#> GSM386388 3 0.0000 0.8768 0.000 0.000 1.000 0.000 0.000
#> GSM386389 5 0.6876 -0.0739 0.220 0.000 0.384 0.008 0.388
#> GSM386390 3 0.0162 0.8746 0.000 0.000 0.996 0.000 0.004
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM386435 2 0.1168 0.923 0.000 0.956 0.000 0.000 0.028 0.016
#> GSM386436 2 0.0820 0.926 0.000 0.972 0.000 0.000 0.012 0.016
#> GSM386437 2 0.0820 0.926 0.000 0.972 0.000 0.000 0.012 0.016
#> GSM386438 2 0.0820 0.926 0.000 0.972 0.000 0.000 0.012 0.016
#> GSM386439 1 0.1003 0.623 0.964 0.020 0.000 0.000 0.016 0.000
#> GSM386440 2 0.1176 0.923 0.000 0.956 0.000 0.000 0.024 0.020
#> GSM386441 2 0.1003 0.925 0.000 0.964 0.000 0.000 0.016 0.020
#> GSM386442 2 0.0914 0.925 0.000 0.968 0.000 0.000 0.016 0.016
#> GSM386447 2 0.4259 0.764 0.160 0.752 0.000 0.000 0.072 0.016
#> GSM386448 2 0.1003 0.925 0.000 0.964 0.000 0.000 0.016 0.020
#> GSM386449 2 0.1003 0.925 0.000 0.964 0.000 0.000 0.016 0.020
#> GSM386450 2 0.1003 0.925 0.000 0.964 0.000 0.000 0.016 0.020
#> GSM386451 6 0.5587 0.735 0.000 0.124 0.000 0.396 0.004 0.476
#> GSM386452 1 0.5288 0.459 0.476 0.000 0.000 0.000 0.424 0.100
#> GSM386453 6 0.5436 0.730 0.000 0.120 0.000 0.404 0.000 0.476
#> GSM386454 1 0.5065 0.421 0.588 0.000 0.000 0.004 0.324 0.084
#> GSM386455 6 0.5724 0.753 0.000 0.120 0.008 0.356 0.004 0.512
#> GSM386456 6 0.5748 0.751 0.000 0.124 0.008 0.352 0.004 0.512
#> GSM386457 6 0.5699 0.751 0.000 0.116 0.008 0.360 0.004 0.512
#> GSM386458 6 0.6707 0.637 0.084 0.032 0.004 0.340 0.048 0.492
#> GSM386443 5 0.4181 0.174 0.368 0.000 0.004 0.004 0.616 0.008
#> GSM386444 3 0.4015 0.517 0.000 0.000 0.616 0.012 0.000 0.372
#> GSM386445 3 0.4015 0.517 0.000 0.000 0.616 0.012 0.000 0.372
#> GSM386446 3 0.4015 0.517 0.000 0.000 0.616 0.012 0.000 0.372
#> GSM386398 1 0.0622 0.640 0.980 0.000 0.000 0.000 0.008 0.012
#> GSM386399 1 0.0146 0.643 0.996 0.000 0.000 0.000 0.004 0.000
#> GSM386400 1 0.0622 0.640 0.980 0.000 0.000 0.000 0.008 0.012
#> GSM386401 2 0.0914 0.925 0.000 0.968 0.000 0.000 0.016 0.016
#> GSM386406 2 0.1983 0.908 0.000 0.908 0.000 0.000 0.072 0.020
#> GSM386407 4 0.1082 0.647 0.000 0.004 0.000 0.956 0.000 0.040
#> GSM386408 2 0.1082 0.925 0.000 0.956 0.000 0.000 0.040 0.004
#> GSM386409 1 0.4548 0.630 0.672 0.000 0.000 0.000 0.248 0.080
#> GSM386410 1 0.5436 0.482 0.476 0.000 0.000 0.000 0.404 0.120
#> GSM386411 4 0.0291 0.636 0.000 0.004 0.000 0.992 0.000 0.004
#> GSM386412 4 0.0405 0.635 0.000 0.000 0.000 0.988 0.008 0.004
#> GSM386413 4 0.0291 0.636 0.000 0.004 0.000 0.992 0.000 0.004
#> GSM386414 4 0.0725 0.633 0.000 0.000 0.000 0.976 0.012 0.012
#> GSM386415 4 0.0935 0.614 0.000 0.000 0.000 0.964 0.004 0.032
#> GSM386416 4 0.5638 0.151 0.148 0.000 0.000 0.596 0.236 0.020
#> GSM386417 4 0.4080 -0.504 0.000 0.000 0.008 0.536 0.000 0.456
#> GSM386402 3 0.0146 0.795 0.000 0.000 0.996 0.000 0.000 0.004
#> GSM386403 3 0.2823 0.598 0.000 0.000 0.796 0.000 0.204 0.000
#> GSM386404 3 0.2823 0.598 0.000 0.000 0.796 0.000 0.204 0.000
#> GSM386405 3 0.0146 0.795 0.000 0.000 0.996 0.000 0.000 0.004
#> GSM386418 2 0.2201 0.903 0.000 0.896 0.000 0.000 0.076 0.028
#> GSM386419 2 0.1701 0.912 0.000 0.920 0.000 0.000 0.072 0.008
#> GSM386420 2 0.1701 0.912 0.000 0.920 0.000 0.000 0.072 0.008
#> GSM386421 2 0.2201 0.903 0.000 0.896 0.000 0.000 0.076 0.028
#> GSM386426 1 0.3347 0.653 0.824 0.004 0.000 0.000 0.104 0.068
#> GSM386427 1 0.5469 0.478 0.468 0.000 0.000 0.000 0.408 0.124
#> GSM386428 2 0.2201 0.903 0.000 0.896 0.000 0.000 0.076 0.028
#> GSM386429 4 0.4900 0.610 0.000 0.004 0.000 0.624 0.080 0.292
#> GSM386430 4 0.4900 0.610 0.000 0.004 0.000 0.624 0.080 0.292
#> GSM386431 4 0.4961 0.607 0.000 0.004 0.000 0.616 0.084 0.296
#> GSM386432 4 0.1082 0.647 0.000 0.004 0.000 0.956 0.000 0.040
#> GSM386433 4 0.1082 0.605 0.000 0.000 0.000 0.956 0.004 0.040
#> GSM386434 4 0.1082 0.605 0.000 0.000 0.000 0.956 0.004 0.040
#> GSM386422 3 0.0146 0.795 0.000 0.000 0.996 0.000 0.000 0.004
#> GSM386423 5 0.4720 0.737 0.068 0.000 0.284 0.000 0.644 0.004
#> GSM386424 3 0.0000 0.794 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386425 3 0.0146 0.795 0.000 0.000 0.996 0.000 0.000 0.004
#> GSM386385 2 0.4926 0.701 0.200 0.688 0.000 0.000 0.088 0.024
#> GSM386386 1 0.5238 0.605 0.592 0.000 0.000 0.000 0.268 0.140
#> GSM386387 2 0.0935 0.923 0.000 0.964 0.000 0.000 0.032 0.004
#> GSM386391 2 0.2997 0.870 0.000 0.844 0.000 0.000 0.096 0.060
#> GSM386392 1 0.3347 0.653 0.824 0.004 0.000 0.000 0.104 0.068
#> GSM386393 4 0.5638 0.521 0.000 0.004 0.000 0.492 0.136 0.368
#> GSM386394 6 0.6627 -0.328 0.096 0.000 0.000 0.100 0.388 0.416
#> GSM386395 4 0.5638 0.521 0.000 0.004 0.000 0.492 0.136 0.368
#> GSM386396 4 0.5114 0.602 0.000 0.004 0.000 0.604 0.100 0.292
#> GSM386397 4 0.5114 0.602 0.000 0.004 0.000 0.604 0.100 0.292
#> GSM386388 3 0.0000 0.794 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386389 5 0.4720 0.737 0.068 0.000 0.284 0.000 0.644 0.004
#> GSM386390 3 0.0632 0.780 0.000 0.000 0.976 0.000 0.024 0.000
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
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 agent(p) dose(p) time(p) k
#> MAD:kmeans 74 0.460293 0.61134 5.22e-01 2
#> MAD:kmeans 60 0.030834 0.14811 5.10e-08 3
#> MAD:kmeans 65 0.012338 0.13511 8.43e-17 4
#> MAD:kmeans 56 0.073785 0.15027 2.38e-13 5
#> MAD:kmeans 66 0.000141 0.00911 4.43e-17 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 51941 rows and 74 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.509 0.926 0.939 0.5060 0.493 0.493
#> 3 3 1.000 0.979 0.989 0.3197 0.756 0.544
#> 4 4 0.976 0.922 0.969 0.1309 0.866 0.623
#> 5 5 0.919 0.866 0.943 0.0571 0.910 0.663
#> 6 6 0.888 0.820 0.910 0.0360 0.941 0.725
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
#> GSM386435 1 0.5408 0.931 0.876 0.124
#> GSM386436 1 0.5408 0.931 0.876 0.124
#> GSM386437 1 0.5408 0.931 0.876 0.124
#> GSM386438 1 0.5408 0.931 0.876 0.124
#> GSM386439 1 0.0000 0.919 1.000 0.000
#> GSM386440 1 0.5408 0.931 0.876 0.124
#> GSM386441 1 0.5408 0.931 0.876 0.124
#> GSM386442 1 0.5408 0.931 0.876 0.124
#> GSM386447 1 0.0000 0.919 1.000 0.000
#> GSM386448 1 0.5408 0.931 0.876 0.124
#> GSM386449 1 0.5408 0.931 0.876 0.124
#> GSM386450 1 0.5408 0.931 0.876 0.124
#> GSM386451 2 0.0672 0.938 0.008 0.992
#> GSM386452 1 0.0672 0.918 0.992 0.008
#> GSM386453 2 0.0672 0.938 0.008 0.992
#> GSM386454 1 0.0672 0.918 0.992 0.008
#> GSM386455 2 0.0672 0.938 0.008 0.992
#> GSM386456 2 0.0672 0.938 0.008 0.992
#> GSM386457 2 0.0672 0.938 0.008 0.992
#> GSM386458 2 0.5408 0.910 0.124 0.876
#> GSM386443 2 0.5408 0.910 0.124 0.876
#> GSM386444 2 0.0672 0.938 0.008 0.992
#> GSM386445 2 0.0672 0.938 0.008 0.992
#> GSM386446 2 0.0672 0.938 0.008 0.992
#> GSM386398 1 0.0672 0.918 0.992 0.008
#> GSM386399 1 0.0672 0.918 0.992 0.008
#> GSM386400 1 0.0672 0.918 0.992 0.008
#> GSM386401 1 0.5408 0.931 0.876 0.124
#> GSM386406 1 0.5408 0.931 0.876 0.124
#> GSM386407 2 0.5408 0.910 0.124 0.876
#> GSM386408 1 0.5408 0.931 0.876 0.124
#> GSM386409 1 0.0672 0.918 0.992 0.008
#> GSM386410 1 0.0672 0.918 0.992 0.008
#> GSM386411 2 0.0672 0.938 0.008 0.992
#> GSM386412 2 0.5408 0.910 0.124 0.876
#> GSM386413 2 0.0672 0.938 0.008 0.992
#> GSM386414 2 0.5408 0.910 0.124 0.876
#> GSM386415 2 0.4161 0.921 0.084 0.916
#> GSM386416 2 0.5408 0.910 0.124 0.876
#> GSM386417 2 0.0672 0.938 0.008 0.992
#> GSM386402 2 0.0000 0.939 0.000 1.000
#> GSM386403 2 0.5408 0.910 0.124 0.876
#> GSM386404 2 0.5408 0.910 0.124 0.876
#> GSM386405 2 0.0000 0.939 0.000 1.000
#> GSM386418 1 0.5408 0.931 0.876 0.124
#> GSM386419 1 0.5408 0.931 0.876 0.124
#> GSM386420 1 0.5408 0.931 0.876 0.124
#> GSM386421 1 0.5408 0.931 0.876 0.124
#> GSM386426 1 0.0672 0.918 0.992 0.008
#> GSM386427 1 0.0672 0.918 0.992 0.008
#> GSM386428 1 0.5408 0.931 0.876 0.124
#> GSM386429 2 0.0672 0.938 0.008 0.992
#> GSM386430 2 0.0672 0.938 0.008 0.992
#> GSM386431 2 0.5408 0.910 0.124 0.876
#> GSM386432 2 0.0672 0.938 0.008 0.992
#> GSM386433 2 0.0000 0.939 0.000 1.000
#> GSM386434 2 0.0000 0.939 0.000 1.000
#> GSM386422 2 0.0000 0.939 0.000 1.000
#> GSM386423 2 0.5408 0.910 0.124 0.876
#> GSM386424 2 0.0000 0.939 0.000 1.000
#> GSM386425 2 0.0000 0.939 0.000 1.000
#> GSM386385 1 0.0000 0.919 1.000 0.000
#> GSM386386 1 0.0672 0.918 0.992 0.008
#> GSM386387 1 0.5408 0.931 0.876 0.124
#> GSM386391 1 0.5408 0.931 0.876 0.124
#> GSM386392 1 0.0672 0.918 0.992 0.008
#> GSM386393 1 0.0672 0.918 0.992 0.008
#> GSM386394 1 0.0672 0.918 0.992 0.008
#> GSM386395 1 0.0672 0.918 0.992 0.008
#> GSM386396 2 0.5408 0.910 0.124 0.876
#> GSM386397 2 0.5408 0.910 0.124 0.876
#> GSM386388 2 0.0000 0.939 0.000 1.000
#> GSM386389 2 0.5408 0.910 0.124 0.876
#> GSM386390 2 0.5408 0.910 0.124 0.876
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM386435 2 0.0000 0.998 0.000 1.000 0.000
#> GSM386436 2 0.0000 0.998 0.000 1.000 0.000
#> GSM386437 2 0.0000 0.998 0.000 1.000 0.000
#> GSM386438 2 0.0000 0.998 0.000 1.000 0.000
#> GSM386439 1 0.0000 0.988 1.000 0.000 0.000
#> GSM386440 2 0.0000 0.998 0.000 1.000 0.000
#> GSM386441 2 0.0000 0.998 0.000 1.000 0.000
#> GSM386442 2 0.0000 0.998 0.000 1.000 0.000
#> GSM386447 1 0.0000 0.988 1.000 0.000 0.000
#> GSM386448 2 0.0000 0.998 0.000 1.000 0.000
#> GSM386449 2 0.0000 0.998 0.000 1.000 0.000
#> GSM386450 2 0.0000 0.998 0.000 1.000 0.000
#> GSM386451 3 0.1643 0.960 0.000 0.044 0.956
#> GSM386452 1 0.0000 0.988 1.000 0.000 0.000
#> GSM386453 3 0.1643 0.960 0.000 0.044 0.956
#> GSM386454 1 0.0000 0.988 1.000 0.000 0.000
#> GSM386455 3 0.0424 0.979 0.000 0.008 0.992
#> GSM386456 3 0.0424 0.979 0.000 0.008 0.992
#> GSM386457 3 0.0000 0.982 0.000 0.000 1.000
#> GSM386458 1 0.0000 0.988 1.000 0.000 0.000
#> GSM386443 1 0.0000 0.988 1.000 0.000 0.000
#> GSM386444 3 0.0000 0.982 0.000 0.000 1.000
#> GSM386445 3 0.0000 0.982 0.000 0.000 1.000
#> GSM386446 3 0.0000 0.982 0.000 0.000 1.000
#> GSM386398 1 0.0000 0.988 1.000 0.000 0.000
#> GSM386399 1 0.0000 0.988 1.000 0.000 0.000
#> GSM386400 1 0.0000 0.988 1.000 0.000 0.000
#> GSM386401 2 0.0000 0.998 0.000 1.000 0.000
#> GSM386406 2 0.0000 0.998 0.000 1.000 0.000
#> GSM386407 3 0.1031 0.971 0.000 0.024 0.976
#> GSM386408 2 0.0000 0.998 0.000 1.000 0.000
#> GSM386409 1 0.0000 0.988 1.000 0.000 0.000
#> GSM386410 1 0.0000 0.988 1.000 0.000 0.000
#> GSM386411 3 0.1529 0.963 0.000 0.040 0.960
#> GSM386412 1 0.0000 0.988 1.000 0.000 0.000
#> GSM386413 3 0.1529 0.963 0.000 0.040 0.960
#> GSM386414 3 0.4555 0.746 0.200 0.000 0.800
#> GSM386415 3 0.0000 0.982 0.000 0.000 1.000
#> GSM386416 1 0.0000 0.988 1.000 0.000 0.000
#> GSM386417 3 0.0000 0.982 0.000 0.000 1.000
#> GSM386402 3 0.0000 0.982 0.000 0.000 1.000
#> GSM386403 3 0.0000 0.982 0.000 0.000 1.000
#> GSM386404 3 0.0000 0.982 0.000 0.000 1.000
#> GSM386405 3 0.0000 0.982 0.000 0.000 1.000
#> GSM386418 2 0.0000 0.998 0.000 1.000 0.000
#> GSM386419 2 0.0000 0.998 0.000 1.000 0.000
#> GSM386420 2 0.0000 0.998 0.000 1.000 0.000
#> GSM386421 2 0.0000 0.998 0.000 1.000 0.000
#> GSM386426 1 0.0000 0.988 1.000 0.000 0.000
#> GSM386427 1 0.0000 0.988 1.000 0.000 0.000
#> GSM386428 2 0.0000 0.998 0.000 1.000 0.000
#> GSM386429 3 0.1529 0.963 0.000 0.040 0.960
#> GSM386430 3 0.1529 0.963 0.000 0.040 0.960
#> GSM386431 1 0.4999 0.796 0.820 0.028 0.152
#> GSM386432 3 0.1529 0.963 0.000 0.040 0.960
#> GSM386433 3 0.0000 0.982 0.000 0.000 1.000
#> GSM386434 3 0.0000 0.982 0.000 0.000 1.000
#> GSM386422 3 0.0000 0.982 0.000 0.000 1.000
#> GSM386423 1 0.0424 0.982 0.992 0.000 0.008
#> GSM386424 3 0.0000 0.982 0.000 0.000 1.000
#> GSM386425 3 0.0000 0.982 0.000 0.000 1.000
#> GSM386385 2 0.1289 0.965 0.032 0.968 0.000
#> GSM386386 1 0.0000 0.988 1.000 0.000 0.000
#> GSM386387 2 0.0000 0.998 0.000 1.000 0.000
#> GSM386391 2 0.0000 0.998 0.000 1.000 0.000
#> GSM386392 1 0.0000 0.988 1.000 0.000 0.000
#> GSM386393 1 0.1289 0.960 0.968 0.032 0.000
#> GSM386394 1 0.0000 0.988 1.000 0.000 0.000
#> GSM386395 1 0.1289 0.960 0.968 0.032 0.000
#> GSM386396 3 0.0000 0.982 0.000 0.000 1.000
#> GSM386397 3 0.0000 0.982 0.000 0.000 1.000
#> GSM386388 3 0.0000 0.982 0.000 0.000 1.000
#> GSM386389 1 0.0424 0.982 0.992 0.000 0.008
#> GSM386390 3 0.0000 0.982 0.000 0.000 1.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM386435 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> GSM386436 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> GSM386437 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> GSM386438 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> GSM386439 1 0.0000 0.952 1.000 0.000 0.000 0.000
#> GSM386440 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> GSM386441 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> GSM386442 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> GSM386447 1 0.0000 0.952 1.000 0.000 0.000 0.000
#> GSM386448 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> GSM386449 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> GSM386450 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> GSM386451 4 0.0188 0.989 0.000 0.004 0.000 0.996
#> GSM386452 1 0.0000 0.952 1.000 0.000 0.000 0.000
#> GSM386453 4 0.0188 0.989 0.000 0.004 0.000 0.996
#> GSM386454 1 0.0000 0.952 1.000 0.000 0.000 0.000
#> GSM386455 3 0.5119 0.292 0.000 0.004 0.556 0.440
#> GSM386456 3 0.5353 0.303 0.000 0.012 0.556 0.432
#> GSM386457 3 0.5119 0.292 0.000 0.004 0.556 0.440
#> GSM386458 1 0.0000 0.952 1.000 0.000 0.000 0.000
#> GSM386443 1 0.0000 0.952 1.000 0.000 0.000 0.000
#> GSM386444 3 0.0000 0.893 0.000 0.000 1.000 0.000
#> GSM386445 3 0.0000 0.893 0.000 0.000 1.000 0.000
#> GSM386446 3 0.0000 0.893 0.000 0.000 1.000 0.000
#> GSM386398 1 0.0000 0.952 1.000 0.000 0.000 0.000
#> GSM386399 1 0.0000 0.952 1.000 0.000 0.000 0.000
#> GSM386400 1 0.0000 0.952 1.000 0.000 0.000 0.000
#> GSM386401 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> GSM386406 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> GSM386407 4 0.0000 0.993 0.000 0.000 0.000 1.000
#> GSM386408 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> GSM386409 1 0.0000 0.952 1.000 0.000 0.000 0.000
#> GSM386410 1 0.0000 0.952 1.000 0.000 0.000 0.000
#> GSM386411 4 0.0000 0.993 0.000 0.000 0.000 1.000
#> GSM386412 4 0.0817 0.967 0.024 0.000 0.000 0.976
#> GSM386413 4 0.0000 0.993 0.000 0.000 0.000 1.000
#> GSM386414 4 0.0000 0.993 0.000 0.000 0.000 1.000
#> GSM386415 4 0.0000 0.993 0.000 0.000 0.000 1.000
#> GSM386416 1 0.0000 0.952 1.000 0.000 0.000 0.000
#> GSM386417 4 0.2011 0.901 0.000 0.000 0.080 0.920
#> GSM386402 3 0.0000 0.893 0.000 0.000 1.000 0.000
#> GSM386403 3 0.0000 0.893 0.000 0.000 1.000 0.000
#> GSM386404 3 0.0000 0.893 0.000 0.000 1.000 0.000
#> GSM386405 3 0.0000 0.893 0.000 0.000 1.000 0.000
#> GSM386418 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> GSM386419 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> GSM386420 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> GSM386421 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> GSM386426 1 0.0000 0.952 1.000 0.000 0.000 0.000
#> GSM386427 1 0.0000 0.952 1.000 0.000 0.000 0.000
#> GSM386428 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> GSM386429 4 0.0000 0.993 0.000 0.000 0.000 1.000
#> GSM386430 4 0.0000 0.993 0.000 0.000 0.000 1.000
#> GSM386431 4 0.0000 0.993 0.000 0.000 0.000 1.000
#> GSM386432 4 0.0000 0.993 0.000 0.000 0.000 1.000
#> GSM386433 4 0.0000 0.993 0.000 0.000 0.000 1.000
#> GSM386434 4 0.0000 0.993 0.000 0.000 0.000 1.000
#> GSM386422 3 0.0000 0.893 0.000 0.000 1.000 0.000
#> GSM386423 1 0.4916 0.353 0.576 0.000 0.424 0.000
#> GSM386424 3 0.0000 0.893 0.000 0.000 1.000 0.000
#> GSM386425 3 0.0000 0.893 0.000 0.000 1.000 0.000
#> GSM386385 2 0.0188 0.996 0.004 0.996 0.000 0.000
#> GSM386386 1 0.0000 0.952 1.000 0.000 0.000 0.000
#> GSM386387 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> GSM386391 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> GSM386392 1 0.0000 0.952 1.000 0.000 0.000 0.000
#> GSM386393 4 0.0000 0.993 0.000 0.000 0.000 1.000
#> GSM386394 1 0.0188 0.948 0.996 0.000 0.000 0.004
#> GSM386395 4 0.0000 0.993 0.000 0.000 0.000 1.000
#> GSM386396 4 0.0000 0.993 0.000 0.000 0.000 1.000
#> GSM386397 4 0.0000 0.993 0.000 0.000 0.000 1.000
#> GSM386388 3 0.0000 0.893 0.000 0.000 1.000 0.000
#> GSM386389 1 0.4916 0.353 0.576 0.000 0.424 0.000
#> GSM386390 3 0.0000 0.893 0.000 0.000 1.000 0.000
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM386435 2 0.0290 0.995 0.000 0.992 0.000 0.000 0.008
#> GSM386436 2 0.0162 0.995 0.000 0.996 0.000 0.000 0.004
#> GSM386437 2 0.0162 0.995 0.000 0.996 0.000 0.000 0.004
#> GSM386438 2 0.0162 0.995 0.000 0.996 0.000 0.000 0.004
#> GSM386439 1 0.0000 0.983 1.000 0.000 0.000 0.000 0.000
#> GSM386440 2 0.0290 0.995 0.000 0.992 0.000 0.000 0.008
#> GSM386441 2 0.0290 0.995 0.000 0.992 0.000 0.000 0.008
#> GSM386442 2 0.0290 0.995 0.000 0.992 0.000 0.000 0.008
#> GSM386447 1 0.0000 0.983 1.000 0.000 0.000 0.000 0.000
#> GSM386448 2 0.0290 0.995 0.000 0.992 0.000 0.000 0.008
#> GSM386449 2 0.0290 0.995 0.000 0.992 0.000 0.000 0.008
#> GSM386450 2 0.0290 0.995 0.000 0.992 0.000 0.000 0.008
#> GSM386451 5 0.0162 0.811 0.000 0.000 0.000 0.004 0.996
#> GSM386452 1 0.0162 0.982 0.996 0.000 0.000 0.000 0.004
#> GSM386453 5 0.0162 0.811 0.000 0.000 0.000 0.004 0.996
#> GSM386454 1 0.0162 0.982 0.996 0.000 0.000 0.000 0.004
#> GSM386455 5 0.0162 0.810 0.000 0.000 0.004 0.000 0.996
#> GSM386456 5 0.0162 0.810 0.000 0.000 0.004 0.000 0.996
#> GSM386457 5 0.0162 0.810 0.000 0.000 0.004 0.000 0.996
#> GSM386458 5 0.4201 0.176 0.408 0.000 0.000 0.000 0.592
#> GSM386443 1 0.0162 0.982 0.996 0.000 0.000 0.000 0.004
#> GSM386444 3 0.3636 0.693 0.000 0.000 0.728 0.000 0.272
#> GSM386445 3 0.3636 0.693 0.000 0.000 0.728 0.000 0.272
#> GSM386446 3 0.3636 0.693 0.000 0.000 0.728 0.000 0.272
#> GSM386398 1 0.0000 0.983 1.000 0.000 0.000 0.000 0.000
#> GSM386399 1 0.0000 0.983 1.000 0.000 0.000 0.000 0.000
#> GSM386400 1 0.0000 0.983 1.000 0.000 0.000 0.000 0.000
#> GSM386401 2 0.0290 0.995 0.000 0.992 0.000 0.000 0.008
#> GSM386406 2 0.0000 0.995 0.000 1.000 0.000 0.000 0.000
#> GSM386407 4 0.0162 0.872 0.000 0.000 0.000 0.996 0.004
#> GSM386408 2 0.0000 0.995 0.000 1.000 0.000 0.000 0.000
#> GSM386409 1 0.0000 0.983 1.000 0.000 0.000 0.000 0.000
#> GSM386410 1 0.0162 0.982 0.996 0.000 0.000 0.000 0.004
#> GSM386411 4 0.3999 0.447 0.000 0.000 0.000 0.656 0.344
#> GSM386412 4 0.0451 0.867 0.004 0.000 0.000 0.988 0.008
#> GSM386413 4 0.4015 0.439 0.000 0.000 0.000 0.652 0.348
#> GSM386414 4 0.4161 0.292 0.000 0.000 0.000 0.608 0.392
#> GSM386415 5 0.3837 0.520 0.000 0.000 0.000 0.308 0.692
#> GSM386416 1 0.3074 0.734 0.804 0.000 0.000 0.000 0.196
#> GSM386417 5 0.0404 0.808 0.000 0.000 0.000 0.012 0.988
#> GSM386402 3 0.0000 0.895 0.000 0.000 1.000 0.000 0.000
#> GSM386403 3 0.0000 0.895 0.000 0.000 1.000 0.000 0.000
#> GSM386404 3 0.0000 0.895 0.000 0.000 1.000 0.000 0.000
#> GSM386405 3 0.0000 0.895 0.000 0.000 1.000 0.000 0.000
#> GSM386418 2 0.0162 0.994 0.000 0.996 0.000 0.004 0.000
#> GSM386419 2 0.0000 0.995 0.000 1.000 0.000 0.000 0.000
#> GSM386420 2 0.0000 0.995 0.000 1.000 0.000 0.000 0.000
#> GSM386421 2 0.0162 0.994 0.000 0.996 0.000 0.004 0.000
#> GSM386426 1 0.0000 0.983 1.000 0.000 0.000 0.000 0.000
#> GSM386427 1 0.0162 0.982 0.996 0.000 0.000 0.000 0.004
#> GSM386428 2 0.0162 0.994 0.000 0.996 0.000 0.004 0.000
#> GSM386429 4 0.0162 0.872 0.000 0.000 0.000 0.996 0.004
#> GSM386430 4 0.0162 0.872 0.000 0.000 0.000 0.996 0.004
#> GSM386431 4 0.0162 0.872 0.000 0.000 0.000 0.996 0.004
#> GSM386432 4 0.0162 0.872 0.000 0.000 0.000 0.996 0.004
#> GSM386433 5 0.3707 0.563 0.000 0.000 0.000 0.284 0.716
#> GSM386434 5 0.3730 0.557 0.000 0.000 0.000 0.288 0.712
#> GSM386422 3 0.0000 0.895 0.000 0.000 1.000 0.000 0.000
#> GSM386423 3 0.3266 0.723 0.200 0.000 0.796 0.000 0.004
#> GSM386424 3 0.0000 0.895 0.000 0.000 1.000 0.000 0.000
#> GSM386425 3 0.0000 0.895 0.000 0.000 1.000 0.000 0.000
#> GSM386385 2 0.0510 0.982 0.016 0.984 0.000 0.000 0.000
#> GSM386386 1 0.0000 0.983 1.000 0.000 0.000 0.000 0.000
#> GSM386387 2 0.0000 0.995 0.000 1.000 0.000 0.000 0.000
#> GSM386391 2 0.0162 0.994 0.000 0.996 0.000 0.004 0.000
#> GSM386392 1 0.0000 0.983 1.000 0.000 0.000 0.000 0.000
#> GSM386393 4 0.0000 0.870 0.000 0.000 0.000 1.000 0.000
#> GSM386394 4 0.3635 0.574 0.248 0.000 0.000 0.748 0.004
#> GSM386395 4 0.0000 0.870 0.000 0.000 0.000 1.000 0.000
#> GSM386396 4 0.0162 0.872 0.000 0.000 0.000 0.996 0.004
#> GSM386397 4 0.0162 0.872 0.000 0.000 0.000 0.996 0.004
#> GSM386388 3 0.0000 0.895 0.000 0.000 1.000 0.000 0.000
#> GSM386389 3 0.3266 0.723 0.200 0.000 0.796 0.000 0.004
#> GSM386390 3 0.0000 0.895 0.000 0.000 1.000 0.000 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM386435 2 0.0146 0.989 0.000 0.996 0.000 0.000 0.004 0.000
#> GSM386436 2 0.0146 0.989 0.000 0.996 0.000 0.000 0.004 0.000
#> GSM386437 2 0.0146 0.989 0.000 0.996 0.000 0.000 0.004 0.000
#> GSM386438 2 0.0146 0.989 0.000 0.996 0.000 0.000 0.004 0.000
#> GSM386439 1 0.1007 0.842 0.956 0.000 0.000 0.000 0.044 0.000
#> GSM386440 2 0.0146 0.989 0.000 0.996 0.000 0.000 0.004 0.000
#> GSM386441 2 0.0000 0.990 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM386442 2 0.0000 0.990 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM386447 1 0.0547 0.843 0.980 0.000 0.000 0.000 0.020 0.000
#> GSM386448 2 0.0000 0.990 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM386449 2 0.0000 0.990 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM386450 2 0.0000 0.990 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM386451 6 0.0000 0.866 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM386452 5 0.3592 0.466 0.344 0.000 0.000 0.000 0.656 0.000
#> GSM386453 6 0.0000 0.866 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM386454 5 0.3409 0.484 0.300 0.000 0.000 0.000 0.700 0.000
#> GSM386455 6 0.0000 0.866 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM386456 6 0.0000 0.866 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM386457 6 0.0000 0.866 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM386458 5 0.3993 0.343 0.008 0.000 0.000 0.000 0.592 0.400
#> GSM386443 5 0.2969 0.573 0.224 0.000 0.000 0.000 0.776 0.000
#> GSM386444 3 0.2527 0.828 0.000 0.000 0.832 0.000 0.000 0.168
#> GSM386445 3 0.2527 0.828 0.000 0.000 0.832 0.000 0.000 0.168
#> GSM386446 3 0.2597 0.820 0.000 0.000 0.824 0.000 0.000 0.176
#> GSM386398 1 0.1007 0.842 0.956 0.000 0.000 0.000 0.044 0.000
#> GSM386399 1 0.1007 0.842 0.956 0.000 0.000 0.000 0.044 0.000
#> GSM386400 1 0.1007 0.842 0.956 0.000 0.000 0.000 0.044 0.000
#> GSM386401 2 0.0000 0.990 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM386406 2 0.0632 0.985 0.000 0.976 0.000 0.000 0.024 0.000
#> GSM386407 4 0.0790 0.854 0.000 0.000 0.000 0.968 0.032 0.000
#> GSM386408 2 0.0000 0.990 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM386409 1 0.2378 0.771 0.848 0.000 0.000 0.000 0.152 0.000
#> GSM386410 1 0.2883 0.713 0.788 0.000 0.000 0.000 0.212 0.000
#> GSM386411 4 0.4400 0.301 0.000 0.000 0.000 0.592 0.032 0.376
#> GSM386412 5 0.3547 0.341 0.000 0.000 0.000 0.332 0.668 0.000
#> GSM386413 4 0.4453 0.233 0.000 0.000 0.000 0.568 0.032 0.400
#> GSM386414 5 0.4148 0.473 0.000 0.000 0.000 0.148 0.744 0.108
#> GSM386415 6 0.4809 0.684 0.000 0.000 0.000 0.140 0.192 0.668
#> GSM386416 5 0.0891 0.658 0.024 0.000 0.000 0.000 0.968 0.008
#> GSM386417 6 0.0000 0.866 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM386402 3 0.0000 0.943 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386403 3 0.0363 0.936 0.000 0.000 0.988 0.000 0.012 0.000
#> GSM386404 3 0.0363 0.936 0.000 0.000 0.988 0.000 0.012 0.000
#> GSM386405 3 0.0000 0.943 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386418 2 0.0632 0.985 0.000 0.976 0.000 0.000 0.024 0.000
#> GSM386419 2 0.0632 0.985 0.000 0.976 0.000 0.000 0.024 0.000
#> GSM386420 2 0.0632 0.985 0.000 0.976 0.000 0.000 0.024 0.000
#> GSM386421 2 0.0632 0.985 0.000 0.976 0.000 0.000 0.024 0.000
#> GSM386426 1 0.0000 0.841 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM386427 1 0.2883 0.713 0.788 0.000 0.000 0.000 0.212 0.000
#> GSM386428 2 0.0713 0.984 0.000 0.972 0.000 0.000 0.028 0.000
#> GSM386429 4 0.0000 0.875 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM386430 4 0.0000 0.875 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM386431 4 0.0000 0.875 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM386432 4 0.0000 0.875 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM386433 6 0.4545 0.709 0.000 0.000 0.000 0.112 0.192 0.696
#> GSM386434 6 0.4701 0.697 0.000 0.000 0.000 0.128 0.192 0.680
#> GSM386422 3 0.0000 0.943 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386423 5 0.3518 0.606 0.012 0.000 0.256 0.000 0.732 0.000
#> GSM386424 3 0.0000 0.943 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386425 3 0.0000 0.943 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386385 1 0.4083 0.412 0.668 0.304 0.000 0.000 0.028 0.000
#> GSM386386 1 0.2597 0.752 0.824 0.000 0.000 0.000 0.176 0.000
#> GSM386387 2 0.0632 0.985 0.000 0.976 0.000 0.000 0.024 0.000
#> GSM386391 2 0.0713 0.984 0.000 0.972 0.000 0.000 0.028 0.000
#> GSM386392 1 0.0000 0.841 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM386393 4 0.0146 0.873 0.000 0.000 0.000 0.996 0.004 0.000
#> GSM386394 4 0.4136 0.538 0.076 0.000 0.000 0.732 0.192 0.000
#> GSM386395 4 0.0146 0.873 0.000 0.000 0.000 0.996 0.004 0.000
#> GSM386396 4 0.0000 0.875 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM386397 4 0.0000 0.875 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM386388 3 0.0000 0.943 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386389 5 0.3518 0.606 0.012 0.000 0.256 0.000 0.732 0.000
#> GSM386390 3 0.0000 0.943 0.000 0.000 1.000 0.000 0.000 0.000
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
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 agent(p) dose(p) time(p) k
#> MAD:skmeans 74 0.1153 0.442 8.49e-11 2
#> MAD:skmeans 74 0.0252 0.449 1.01e-08 3
#> MAD:skmeans 69 0.0335 0.450 5.36e-17 4
#> MAD:skmeans 70 0.0159 0.128 7.56e-20 5
#> MAD:skmeans 66 0.0419 0.141 5.08e-18 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 51941 rows and 74 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.468 0.774 0.797 0.4274 0.506 0.506
#> 3 3 0.955 0.906 0.964 0.4858 0.760 0.569
#> 4 4 1.000 0.990 0.995 0.1826 0.838 0.585
#> 5 5 0.938 0.930 0.961 0.0631 0.923 0.705
#> 6 6 0.957 0.921 0.960 0.0203 0.978 0.891
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
#> GSM386435 2 0.0000 0.895 0.000 1.000
#> GSM386436 2 0.0000 0.895 0.000 1.000
#> GSM386437 2 0.0000 0.895 0.000 1.000
#> GSM386438 2 0.0000 0.895 0.000 1.000
#> GSM386439 2 0.4939 0.734 0.108 0.892
#> GSM386440 2 0.0000 0.895 0.000 1.000
#> GSM386441 2 0.0000 0.895 0.000 1.000
#> GSM386442 2 0.0000 0.895 0.000 1.000
#> GSM386447 1 0.9933 0.732 0.548 0.452
#> GSM386448 2 0.0000 0.895 0.000 1.000
#> GSM386449 2 0.0000 0.895 0.000 1.000
#> GSM386450 2 0.0000 0.895 0.000 1.000
#> GSM386451 2 0.3274 0.818 0.060 0.940
#> GSM386452 1 0.9710 0.817 0.600 0.400
#> GSM386453 2 0.3274 0.818 0.060 0.940
#> GSM386454 1 0.9710 0.817 0.600 0.400
#> GSM386455 2 0.0376 0.891 0.004 0.996
#> GSM386456 2 0.0000 0.895 0.000 1.000
#> GSM386457 2 0.4815 0.741 0.104 0.896
#> GSM386458 1 0.9710 0.817 0.600 0.400
#> GSM386443 1 0.0000 0.552 1.000 0.000
#> GSM386444 2 0.9710 0.458 0.400 0.600
#> GSM386445 2 0.9710 0.458 0.400 0.600
#> GSM386446 2 0.9710 0.458 0.400 0.600
#> GSM386398 1 0.9710 0.817 0.600 0.400
#> GSM386399 1 0.9710 0.817 0.600 0.400
#> GSM386400 1 0.9710 0.817 0.600 0.400
#> GSM386401 2 0.0000 0.895 0.000 1.000
#> GSM386406 2 0.0000 0.895 0.000 1.000
#> GSM386407 1 0.9710 0.817 0.600 0.400
#> GSM386408 2 0.0000 0.895 0.000 1.000
#> GSM386409 1 0.9710 0.817 0.600 0.400
#> GSM386410 1 0.9710 0.817 0.600 0.400
#> GSM386411 1 0.9710 0.817 0.600 0.400
#> GSM386412 1 0.9710 0.817 0.600 0.400
#> GSM386413 1 0.9710 0.817 0.600 0.400
#> GSM386414 1 0.9710 0.817 0.600 0.400
#> GSM386415 1 0.9710 0.817 0.600 0.400
#> GSM386416 1 0.9710 0.817 0.600 0.400
#> GSM386417 1 0.9732 0.811 0.596 0.404
#> GSM386402 1 0.0000 0.552 1.000 0.000
#> GSM386403 1 0.0000 0.552 1.000 0.000
#> GSM386404 1 0.0000 0.552 1.000 0.000
#> GSM386405 2 0.9896 0.429 0.440 0.560
#> GSM386418 2 0.0000 0.895 0.000 1.000
#> GSM386419 2 0.0000 0.895 0.000 1.000
#> GSM386420 2 0.0000 0.895 0.000 1.000
#> GSM386421 2 0.0000 0.895 0.000 1.000
#> GSM386426 1 0.9710 0.817 0.600 0.400
#> GSM386427 1 0.9710 0.817 0.600 0.400
#> GSM386428 2 0.0000 0.895 0.000 1.000
#> GSM386429 1 0.9710 0.817 0.600 0.400
#> GSM386430 1 0.9710 0.817 0.600 0.400
#> GSM386431 1 0.9710 0.817 0.600 0.400
#> GSM386432 1 0.9710 0.817 0.600 0.400
#> GSM386433 1 0.9710 0.817 0.600 0.400
#> GSM386434 1 0.9710 0.817 0.600 0.400
#> GSM386422 1 0.0000 0.552 1.000 0.000
#> GSM386423 1 0.0000 0.552 1.000 0.000
#> GSM386424 1 0.0000 0.552 1.000 0.000
#> GSM386425 1 0.7528 0.246 0.784 0.216
#> GSM386385 2 0.0000 0.895 0.000 1.000
#> GSM386386 1 0.9710 0.817 0.600 0.400
#> GSM386387 2 0.0000 0.895 0.000 1.000
#> GSM386391 2 0.0000 0.895 0.000 1.000
#> GSM386392 1 0.9710 0.817 0.600 0.400
#> GSM386393 1 0.9710 0.817 0.600 0.400
#> GSM386394 1 0.9710 0.817 0.600 0.400
#> GSM386395 1 0.9710 0.817 0.600 0.400
#> GSM386396 1 0.9393 0.784 0.644 0.356
#> GSM386397 1 0.9710 0.817 0.600 0.400
#> GSM386388 1 0.0000 0.552 1.000 0.000
#> GSM386389 1 0.0000 0.552 1.000 0.000
#> GSM386390 1 0.0000 0.552 1.000 0.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM386435 2 0.0000 0.9719 0.000 1.000 0.000
#> GSM386436 2 0.0000 0.9719 0.000 1.000 0.000
#> GSM386437 2 0.0000 0.9719 0.000 1.000 0.000
#> GSM386438 2 0.0000 0.9719 0.000 1.000 0.000
#> GSM386439 2 0.6305 -0.0424 0.484 0.516 0.000
#> GSM386440 2 0.0000 0.9719 0.000 1.000 0.000
#> GSM386441 2 0.0000 0.9719 0.000 1.000 0.000
#> GSM386442 2 0.0000 0.9719 0.000 1.000 0.000
#> GSM386447 1 0.5988 0.4245 0.632 0.368 0.000
#> GSM386448 2 0.0000 0.9719 0.000 1.000 0.000
#> GSM386449 2 0.0000 0.9719 0.000 1.000 0.000
#> GSM386450 2 0.0000 0.9719 0.000 1.000 0.000
#> GSM386451 1 0.6786 0.2197 0.540 0.448 0.012
#> GSM386452 1 0.0000 0.9326 1.000 0.000 0.000
#> GSM386453 1 0.6786 0.2197 0.540 0.448 0.012
#> GSM386454 1 0.0000 0.9326 1.000 0.000 0.000
#> GSM386455 2 0.1337 0.9443 0.016 0.972 0.012
#> GSM386456 2 0.0592 0.9596 0.000 0.988 0.012
#> GSM386457 1 0.6786 0.2197 0.540 0.448 0.012
#> GSM386458 1 0.0592 0.9342 0.988 0.000 0.012
#> GSM386443 1 0.0237 0.9313 0.996 0.000 0.004
#> GSM386444 3 0.0000 0.9978 0.000 0.000 1.000
#> GSM386445 3 0.0000 0.9978 0.000 0.000 1.000
#> GSM386446 3 0.0000 0.9978 0.000 0.000 1.000
#> GSM386398 1 0.0000 0.9326 1.000 0.000 0.000
#> GSM386399 1 0.0000 0.9326 1.000 0.000 0.000
#> GSM386400 1 0.0000 0.9326 1.000 0.000 0.000
#> GSM386401 2 0.0000 0.9719 0.000 1.000 0.000
#> GSM386406 2 0.0000 0.9719 0.000 1.000 0.000
#> GSM386407 1 0.0592 0.9342 0.988 0.000 0.012
#> GSM386408 2 0.0000 0.9719 0.000 1.000 0.000
#> GSM386409 1 0.0000 0.9326 1.000 0.000 0.000
#> GSM386410 1 0.0000 0.9326 1.000 0.000 0.000
#> GSM386411 1 0.0592 0.9342 0.988 0.000 0.012
#> GSM386412 1 0.0592 0.9342 0.988 0.000 0.012
#> GSM386413 1 0.0592 0.9342 0.988 0.000 0.012
#> GSM386414 1 0.0592 0.9342 0.988 0.000 0.012
#> GSM386415 1 0.0592 0.9342 0.988 0.000 0.012
#> GSM386416 1 0.0592 0.9342 0.988 0.000 0.012
#> GSM386417 1 0.0592 0.9342 0.988 0.000 0.012
#> GSM386402 3 0.0000 0.9978 0.000 0.000 1.000
#> GSM386403 3 0.0000 0.9978 0.000 0.000 1.000
#> GSM386404 3 0.0000 0.9978 0.000 0.000 1.000
#> GSM386405 3 0.0000 0.9978 0.000 0.000 1.000
#> GSM386418 2 0.0000 0.9719 0.000 1.000 0.000
#> GSM386419 2 0.0000 0.9719 0.000 1.000 0.000
#> GSM386420 2 0.0000 0.9719 0.000 1.000 0.000
#> GSM386421 2 0.0000 0.9719 0.000 1.000 0.000
#> GSM386426 1 0.0000 0.9326 1.000 0.000 0.000
#> GSM386427 1 0.0000 0.9326 1.000 0.000 0.000
#> GSM386428 2 0.0000 0.9719 0.000 1.000 0.000
#> GSM386429 1 0.0592 0.9342 0.988 0.000 0.012
#> GSM386430 1 0.0592 0.9342 0.988 0.000 0.012
#> GSM386431 1 0.0592 0.9342 0.988 0.000 0.012
#> GSM386432 1 0.0592 0.9342 0.988 0.000 0.012
#> GSM386433 1 0.0592 0.9342 0.988 0.000 0.012
#> GSM386434 1 0.0592 0.9342 0.988 0.000 0.012
#> GSM386422 3 0.0000 0.9978 0.000 0.000 1.000
#> GSM386423 3 0.0592 0.9870 0.012 0.000 0.988
#> GSM386424 3 0.0000 0.9978 0.000 0.000 1.000
#> GSM386425 3 0.0000 0.9978 0.000 0.000 1.000
#> GSM386385 2 0.0000 0.9719 0.000 1.000 0.000
#> GSM386386 1 0.0000 0.9326 1.000 0.000 0.000
#> GSM386387 2 0.0000 0.9719 0.000 1.000 0.000
#> GSM386391 2 0.0000 0.9719 0.000 1.000 0.000
#> GSM386392 1 0.3941 0.7797 0.844 0.156 0.000
#> GSM386393 1 0.0592 0.9300 0.988 0.012 0.000
#> GSM386394 1 0.0000 0.9326 1.000 0.000 0.000
#> GSM386395 1 0.0592 0.9300 0.988 0.012 0.000
#> GSM386396 1 0.0592 0.9342 0.988 0.000 0.012
#> GSM386397 1 0.0592 0.9342 0.988 0.000 0.012
#> GSM386388 3 0.0000 0.9978 0.000 0.000 1.000
#> GSM386389 3 0.0592 0.9870 0.012 0.000 0.988
#> GSM386390 3 0.0000 0.9978 0.000 0.000 1.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM386435 2 0.0000 1.000 0.000 1.00 0.000 0.00
#> GSM386436 2 0.0000 1.000 0.000 1.00 0.000 0.00
#> GSM386437 2 0.0000 1.000 0.000 1.00 0.000 0.00
#> GSM386438 2 0.0000 1.000 0.000 1.00 0.000 0.00
#> GSM386439 1 0.0000 0.998 1.000 0.00 0.000 0.00
#> GSM386440 2 0.0000 1.000 0.000 1.00 0.000 0.00
#> GSM386441 2 0.0000 1.000 0.000 1.00 0.000 0.00
#> GSM386442 2 0.0000 1.000 0.000 1.00 0.000 0.00
#> GSM386447 1 0.0707 0.976 0.980 0.02 0.000 0.00
#> GSM386448 2 0.0000 1.000 0.000 1.00 0.000 0.00
#> GSM386449 2 0.0000 1.000 0.000 1.00 0.000 0.00
#> GSM386450 2 0.0000 1.000 0.000 1.00 0.000 0.00
#> GSM386451 4 0.0707 0.973 0.000 0.02 0.000 0.98
#> GSM386452 1 0.0000 0.998 1.000 0.00 0.000 0.00
#> GSM386453 4 0.0707 0.973 0.000 0.02 0.000 0.98
#> GSM386454 1 0.0000 0.998 1.000 0.00 0.000 0.00
#> GSM386455 4 0.0707 0.973 0.000 0.02 0.000 0.98
#> GSM386456 4 0.0707 0.973 0.000 0.02 0.000 0.98
#> GSM386457 4 0.0707 0.973 0.000 0.02 0.000 0.98
#> GSM386458 1 0.0000 0.998 1.000 0.00 0.000 0.00
#> GSM386443 1 0.0000 0.998 1.000 0.00 0.000 0.00
#> GSM386444 3 0.0000 0.999 0.000 0.00 1.000 0.00
#> GSM386445 3 0.0000 0.999 0.000 0.00 1.000 0.00
#> GSM386446 3 0.0000 0.999 0.000 0.00 1.000 0.00
#> GSM386398 1 0.0000 0.998 1.000 0.00 0.000 0.00
#> GSM386399 1 0.0000 0.998 1.000 0.00 0.000 0.00
#> GSM386400 1 0.0000 0.998 1.000 0.00 0.000 0.00
#> GSM386401 2 0.0000 1.000 0.000 1.00 0.000 0.00
#> GSM386406 2 0.0000 1.000 0.000 1.00 0.000 0.00
#> GSM386407 4 0.0000 0.986 0.000 0.00 0.000 1.00
#> GSM386408 2 0.0000 1.000 0.000 1.00 0.000 0.00
#> GSM386409 1 0.0000 0.998 1.000 0.00 0.000 0.00
#> GSM386410 1 0.0000 0.998 1.000 0.00 0.000 0.00
#> GSM386411 4 0.0000 0.986 0.000 0.00 0.000 1.00
#> GSM386412 4 0.0000 0.986 0.000 0.00 0.000 1.00
#> GSM386413 4 0.0000 0.986 0.000 0.00 0.000 1.00
#> GSM386414 4 0.0000 0.986 0.000 0.00 0.000 1.00
#> GSM386415 4 0.0000 0.986 0.000 0.00 0.000 1.00
#> GSM386416 4 0.3610 0.750 0.200 0.00 0.000 0.80
#> GSM386417 4 0.0000 0.986 0.000 0.00 0.000 1.00
#> GSM386402 3 0.0000 0.999 0.000 0.00 1.000 0.00
#> GSM386403 3 0.0000 0.999 0.000 0.00 1.000 0.00
#> GSM386404 3 0.0000 0.999 0.000 0.00 1.000 0.00
#> GSM386405 3 0.0000 0.999 0.000 0.00 1.000 0.00
#> GSM386418 2 0.0000 1.000 0.000 1.00 0.000 0.00
#> GSM386419 2 0.0000 1.000 0.000 1.00 0.000 0.00
#> GSM386420 2 0.0000 1.000 0.000 1.00 0.000 0.00
#> GSM386421 2 0.0000 1.000 0.000 1.00 0.000 0.00
#> GSM386426 1 0.0000 0.998 1.000 0.00 0.000 0.00
#> GSM386427 1 0.0000 0.998 1.000 0.00 0.000 0.00
#> GSM386428 2 0.0000 1.000 0.000 1.00 0.000 0.00
#> GSM386429 4 0.0000 0.986 0.000 0.00 0.000 1.00
#> GSM386430 4 0.0000 0.986 0.000 0.00 0.000 1.00
#> GSM386431 4 0.0000 0.986 0.000 0.00 0.000 1.00
#> GSM386432 4 0.0000 0.986 0.000 0.00 0.000 1.00
#> GSM386433 4 0.0000 0.986 0.000 0.00 0.000 1.00
#> GSM386434 4 0.0000 0.986 0.000 0.00 0.000 1.00
#> GSM386422 3 0.0000 0.999 0.000 0.00 1.000 0.00
#> GSM386423 3 0.0336 0.992 0.008 0.00 0.992 0.00
#> GSM386424 3 0.0000 0.999 0.000 0.00 1.000 0.00
#> GSM386425 3 0.0000 0.999 0.000 0.00 1.000 0.00
#> GSM386385 2 0.0000 1.000 0.000 1.00 0.000 0.00
#> GSM386386 1 0.0000 0.998 1.000 0.00 0.000 0.00
#> GSM386387 2 0.0000 1.000 0.000 1.00 0.000 0.00
#> GSM386391 2 0.0000 1.000 0.000 1.00 0.000 0.00
#> GSM386392 1 0.0000 0.998 1.000 0.00 0.000 0.00
#> GSM386393 4 0.0000 0.986 0.000 0.00 0.000 1.00
#> GSM386394 1 0.0000 0.998 1.000 0.00 0.000 0.00
#> GSM386395 4 0.0000 0.986 0.000 0.00 0.000 1.00
#> GSM386396 4 0.0000 0.986 0.000 0.00 0.000 1.00
#> GSM386397 4 0.0000 0.986 0.000 0.00 0.000 1.00
#> GSM386388 3 0.0000 0.999 0.000 0.00 1.000 0.00
#> GSM386389 3 0.0336 0.992 0.008 0.00 0.992 0.00
#> GSM386390 3 0.0000 0.999 0.000 0.00 1.000 0.00
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM386435 2 0.0000 1.000 0.000 1 0.000 0.000 0.000
#> GSM386436 2 0.0000 1.000 0.000 1 0.000 0.000 0.000
#> GSM386437 2 0.0000 1.000 0.000 1 0.000 0.000 0.000
#> GSM386438 2 0.0000 1.000 0.000 1 0.000 0.000 0.000
#> GSM386439 1 0.0000 0.999 1.000 0 0.000 0.000 0.000
#> GSM386440 2 0.0000 1.000 0.000 1 0.000 0.000 0.000
#> GSM386441 2 0.0000 1.000 0.000 1 0.000 0.000 0.000
#> GSM386442 2 0.0000 1.000 0.000 1 0.000 0.000 0.000
#> GSM386447 1 0.0000 0.999 1.000 0 0.000 0.000 0.000
#> GSM386448 2 0.0000 1.000 0.000 1 0.000 0.000 0.000
#> GSM386449 2 0.0000 1.000 0.000 1 0.000 0.000 0.000
#> GSM386450 2 0.0000 1.000 0.000 1 0.000 0.000 0.000
#> GSM386451 5 0.0000 0.877 0.000 0 0.000 0.000 1.000
#> GSM386452 1 0.0000 0.999 1.000 0 0.000 0.000 0.000
#> GSM386453 5 0.0609 0.864 0.000 0 0.000 0.020 0.980
#> GSM386454 1 0.0000 0.999 1.000 0 0.000 0.000 0.000
#> GSM386455 5 0.0000 0.877 0.000 0 0.000 0.000 1.000
#> GSM386456 5 0.0000 0.877 0.000 0 0.000 0.000 1.000
#> GSM386457 5 0.0000 0.877 0.000 0 0.000 0.000 1.000
#> GSM386458 5 0.4201 0.289 0.408 0 0.000 0.000 0.592
#> GSM386443 1 0.0404 0.989 0.988 0 0.000 0.012 0.000
#> GSM386444 3 0.0000 0.998 0.000 0 1.000 0.000 0.000
#> GSM386445 3 0.0000 0.998 0.000 0 1.000 0.000 0.000
#> GSM386446 5 0.3612 0.577 0.000 0 0.268 0.000 0.732
#> GSM386398 1 0.0000 0.999 1.000 0 0.000 0.000 0.000
#> GSM386399 1 0.0000 0.999 1.000 0 0.000 0.000 0.000
#> GSM386400 1 0.0000 0.999 1.000 0 0.000 0.000 0.000
#> GSM386401 2 0.0000 1.000 0.000 1 0.000 0.000 0.000
#> GSM386406 2 0.0000 1.000 0.000 1 0.000 0.000 0.000
#> GSM386407 4 0.2690 0.888 0.000 0 0.000 0.844 0.156
#> GSM386408 2 0.0000 1.000 0.000 1 0.000 0.000 0.000
#> GSM386409 1 0.0000 0.999 1.000 0 0.000 0.000 0.000
#> GSM386410 1 0.0000 0.999 1.000 0 0.000 0.000 0.000
#> GSM386411 5 0.3395 0.607 0.000 0 0.000 0.236 0.764
#> GSM386412 4 0.2690 0.888 0.000 0 0.000 0.844 0.156
#> GSM386413 5 0.3395 0.607 0.000 0 0.000 0.236 0.764
#> GSM386414 4 0.3661 0.744 0.000 0 0.000 0.724 0.276
#> GSM386415 5 0.0000 0.877 0.000 0 0.000 0.000 1.000
#> GSM386416 4 0.2890 0.876 0.004 0 0.000 0.836 0.160
#> GSM386417 5 0.0000 0.877 0.000 0 0.000 0.000 1.000
#> GSM386402 3 0.0000 0.998 0.000 0 1.000 0.000 0.000
#> GSM386403 3 0.0404 0.992 0.000 0 0.988 0.012 0.000
#> GSM386404 3 0.0000 0.998 0.000 0 1.000 0.000 0.000
#> GSM386405 3 0.0000 0.998 0.000 0 1.000 0.000 0.000
#> GSM386418 2 0.0000 1.000 0.000 1 0.000 0.000 0.000
#> GSM386419 2 0.0000 1.000 0.000 1 0.000 0.000 0.000
#> GSM386420 2 0.0000 1.000 0.000 1 0.000 0.000 0.000
#> GSM386421 2 0.0000 1.000 0.000 1 0.000 0.000 0.000
#> GSM386426 1 0.0000 0.999 1.000 0 0.000 0.000 0.000
#> GSM386427 1 0.0000 0.999 1.000 0 0.000 0.000 0.000
#> GSM386428 2 0.0000 1.000 0.000 1 0.000 0.000 0.000
#> GSM386429 4 0.2690 0.888 0.000 0 0.000 0.844 0.156
#> GSM386430 4 0.2690 0.888 0.000 0 0.000 0.844 0.156
#> GSM386431 4 0.2690 0.888 0.000 0 0.000 0.844 0.156
#> GSM386432 4 0.2690 0.888 0.000 0 0.000 0.844 0.156
#> GSM386433 5 0.0000 0.877 0.000 0 0.000 0.000 1.000
#> GSM386434 5 0.0000 0.877 0.000 0 0.000 0.000 1.000
#> GSM386422 3 0.0000 0.998 0.000 0 1.000 0.000 0.000
#> GSM386423 3 0.0404 0.992 0.000 0 0.988 0.012 0.000
#> GSM386424 3 0.0000 0.998 0.000 0 1.000 0.000 0.000
#> GSM386425 3 0.0000 0.998 0.000 0 1.000 0.000 0.000
#> GSM386385 2 0.0000 1.000 0.000 1 0.000 0.000 0.000
#> GSM386386 1 0.0000 0.999 1.000 0 0.000 0.000 0.000
#> GSM386387 2 0.0000 1.000 0.000 1 0.000 0.000 0.000
#> GSM386391 2 0.0000 1.000 0.000 1 0.000 0.000 0.000
#> GSM386392 1 0.0000 0.999 1.000 0 0.000 0.000 0.000
#> GSM386393 4 0.0404 0.850 0.000 0 0.000 0.988 0.012
#> GSM386394 4 0.3480 0.577 0.248 0 0.000 0.752 0.000
#> GSM386395 4 0.0404 0.850 0.000 0 0.000 0.988 0.012
#> GSM386396 4 0.0404 0.850 0.000 0 0.000 0.988 0.012
#> GSM386397 4 0.0404 0.850 0.000 0 0.000 0.988 0.012
#> GSM386388 3 0.0000 0.998 0.000 0 1.000 0.000 0.000
#> GSM386389 3 0.0404 0.992 0.000 0 0.988 0.012 0.000
#> GSM386390 3 0.0000 0.998 0.000 0 1.000 0.000 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM386435 2 0.0000 0.998 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM386436 2 0.0146 0.998 0.000 0.996 0.000 0.000 0.004 0.000
#> GSM386437 2 0.0146 0.998 0.000 0.996 0.000 0.000 0.004 0.000
#> GSM386438 2 0.0000 0.998 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM386439 1 0.2730 0.835 0.808 0.000 0.000 0.000 0.192 0.000
#> GSM386440 2 0.0000 0.998 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM386441 2 0.0000 0.998 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM386442 2 0.0000 0.998 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM386447 1 0.0458 0.937 0.984 0.016 0.000 0.000 0.000 0.000
#> GSM386448 2 0.0000 0.998 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM386449 2 0.0000 0.998 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM386450 2 0.0000 0.998 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM386451 6 0.0000 0.906 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM386452 1 0.0000 0.947 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM386453 6 0.0547 0.893 0.000 0.000 0.000 0.020 0.000 0.980
#> GSM386454 1 0.0000 0.947 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM386455 6 0.0000 0.906 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM386456 6 0.0000 0.906 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM386457 6 0.0000 0.906 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM386458 6 0.3221 0.577 0.264 0.000 0.000 0.000 0.000 0.736
#> GSM386443 5 0.2631 0.700 0.180 0.000 0.000 0.000 0.820 0.000
#> GSM386444 3 0.0000 0.973 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386445 3 0.0000 0.973 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386446 3 0.0547 0.950 0.000 0.000 0.980 0.000 0.000 0.020
#> GSM386398 1 0.2730 0.835 0.808 0.000 0.000 0.000 0.192 0.000
#> GSM386399 1 0.0458 0.945 0.984 0.000 0.000 0.000 0.016 0.000
#> GSM386400 1 0.2730 0.835 0.808 0.000 0.000 0.000 0.192 0.000
#> GSM386401 2 0.0000 0.998 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM386406 2 0.0146 0.998 0.000 0.996 0.000 0.000 0.004 0.000
#> GSM386407 4 0.0260 0.938 0.000 0.000 0.000 0.992 0.000 0.008
#> GSM386408 2 0.0000 0.998 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM386409 1 0.0000 0.947 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM386410 1 0.0000 0.947 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM386411 6 0.3175 0.663 0.000 0.000 0.000 0.256 0.000 0.744
#> GSM386412 4 0.0260 0.938 0.000 0.000 0.000 0.992 0.000 0.008
#> GSM386413 6 0.3175 0.663 0.000 0.000 0.000 0.256 0.000 0.744
#> GSM386414 4 0.3198 0.622 0.000 0.000 0.000 0.740 0.000 0.260
#> GSM386415 6 0.0000 0.906 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM386416 4 0.1364 0.898 0.004 0.000 0.000 0.944 0.004 0.048
#> GSM386417 6 0.0000 0.906 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM386402 3 0.0000 0.973 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386403 3 0.2941 0.659 0.000 0.000 0.780 0.000 0.220 0.000
#> GSM386404 3 0.0260 0.966 0.000 0.000 0.992 0.000 0.008 0.000
#> GSM386405 3 0.0000 0.973 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386418 2 0.0146 0.998 0.000 0.996 0.000 0.000 0.004 0.000
#> GSM386419 2 0.0146 0.998 0.000 0.996 0.000 0.000 0.004 0.000
#> GSM386420 2 0.0146 0.998 0.000 0.996 0.000 0.000 0.004 0.000
#> GSM386421 2 0.0146 0.998 0.000 0.996 0.000 0.000 0.004 0.000
#> GSM386426 1 0.0458 0.945 0.984 0.000 0.000 0.000 0.016 0.000
#> GSM386427 1 0.0000 0.947 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM386428 2 0.0146 0.998 0.000 0.996 0.000 0.000 0.004 0.000
#> GSM386429 4 0.0260 0.938 0.000 0.000 0.000 0.992 0.000 0.008
#> GSM386430 4 0.0260 0.938 0.000 0.000 0.000 0.992 0.000 0.008
#> GSM386431 4 0.0260 0.938 0.000 0.000 0.000 0.992 0.000 0.008
#> GSM386432 4 0.0260 0.938 0.000 0.000 0.000 0.992 0.000 0.008
#> GSM386433 6 0.0000 0.906 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM386434 6 0.0000 0.906 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM386422 3 0.0000 0.973 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386423 5 0.2762 0.838 0.000 0.000 0.196 0.000 0.804 0.000
#> GSM386424 3 0.0000 0.973 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386425 3 0.0000 0.973 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386385 2 0.0146 0.998 0.000 0.996 0.000 0.000 0.004 0.000
#> GSM386386 1 0.0000 0.947 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM386387 2 0.0000 0.998 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM386391 2 0.0146 0.998 0.000 0.996 0.000 0.000 0.004 0.000
#> GSM386392 1 0.0458 0.945 0.984 0.000 0.000 0.000 0.016 0.000
#> GSM386393 4 0.0000 0.934 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM386394 4 0.3175 0.587 0.256 0.000 0.000 0.744 0.000 0.000
#> GSM386395 4 0.0000 0.934 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM386396 4 0.0260 0.938 0.000 0.000 0.000 0.992 0.000 0.008
#> GSM386397 4 0.0000 0.934 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM386388 3 0.0000 0.973 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386389 5 0.2762 0.838 0.000 0.000 0.196 0.000 0.804 0.000
#> GSM386390 3 0.0000 0.973 0.000 0.000 1.000 0.000 0.000 0.000
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
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 agent(p) dose(p) time(p) k
#> MAD:pam 69 9.22e-05 0.000385 7.47e-05 2
#> MAD:pam 69 7.12e-03 0.057969 1.25e-15 3
#> MAD:pam 74 5.02e-02 0.723408 8.95e-20 4
#> MAD:pam 73 7.50e-03 0.140392 5.52e-18 5
#> MAD:pam 74 3.44e-02 0.308949 3.71e-19 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 51941 rows and 74 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 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.889 0.920 0.969 0.3698 0.641 0.641
#> 3 3 0.590 0.514 0.693 0.6817 0.657 0.481
#> 4 4 0.894 0.929 0.959 0.2043 0.857 0.609
#> 5 5 0.875 0.859 0.916 0.0380 0.937 0.766
#> 6 6 0.798 0.794 0.846 0.0376 0.958 0.815
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
#> GSM386435 2 0.0000 0.952 0.000 1.000
#> GSM386436 2 0.0000 0.952 0.000 1.000
#> GSM386437 2 0.5178 0.847 0.116 0.884
#> GSM386438 2 0.0000 0.952 0.000 1.000
#> GSM386439 1 0.0000 0.970 1.000 0.000
#> GSM386440 2 0.0000 0.952 0.000 1.000
#> GSM386441 2 0.0000 0.952 0.000 1.000
#> GSM386442 2 0.0000 0.952 0.000 1.000
#> GSM386447 1 0.7815 0.685 0.768 0.232
#> GSM386448 2 0.0000 0.952 0.000 1.000
#> GSM386449 2 0.0000 0.952 0.000 1.000
#> GSM386450 2 0.0000 0.952 0.000 1.000
#> GSM386451 1 0.0938 0.960 0.988 0.012
#> GSM386452 1 0.0000 0.970 1.000 0.000
#> GSM386453 1 0.2423 0.933 0.960 0.040
#> GSM386454 1 0.0000 0.970 1.000 0.000
#> GSM386455 1 0.0000 0.970 1.000 0.000
#> GSM386456 1 0.0000 0.970 1.000 0.000
#> GSM386457 1 0.0000 0.970 1.000 0.000
#> GSM386458 1 0.0000 0.970 1.000 0.000
#> GSM386443 1 0.0000 0.970 1.000 0.000
#> GSM386444 1 0.0000 0.970 1.000 0.000
#> GSM386445 1 0.0000 0.970 1.000 0.000
#> GSM386446 1 0.0000 0.970 1.000 0.000
#> GSM386398 1 0.0000 0.970 1.000 0.000
#> GSM386399 1 0.0000 0.970 1.000 0.000
#> GSM386400 1 0.0000 0.970 1.000 0.000
#> GSM386401 2 0.0000 0.952 0.000 1.000
#> GSM386406 2 0.6343 0.792 0.160 0.840
#> GSM386407 1 0.0000 0.970 1.000 0.000
#> GSM386408 2 0.0000 0.952 0.000 1.000
#> GSM386409 1 0.0000 0.970 1.000 0.000
#> GSM386410 1 0.0000 0.970 1.000 0.000
#> GSM386411 1 0.0000 0.970 1.000 0.000
#> GSM386412 1 0.0000 0.970 1.000 0.000
#> GSM386413 1 0.0000 0.970 1.000 0.000
#> GSM386414 1 0.0000 0.970 1.000 0.000
#> GSM386415 1 0.0000 0.970 1.000 0.000
#> GSM386416 1 0.0000 0.970 1.000 0.000
#> GSM386417 1 0.0000 0.970 1.000 0.000
#> GSM386402 1 0.0000 0.970 1.000 0.000
#> GSM386403 1 0.0000 0.970 1.000 0.000
#> GSM386404 1 0.0000 0.970 1.000 0.000
#> GSM386405 1 0.0000 0.970 1.000 0.000
#> GSM386418 1 0.9933 0.158 0.548 0.452
#> GSM386419 2 0.0000 0.952 0.000 1.000
#> GSM386420 2 0.0000 0.952 0.000 1.000
#> GSM386421 2 0.9896 0.183 0.440 0.560
#> GSM386426 1 0.0000 0.970 1.000 0.000
#> GSM386427 1 0.0000 0.970 1.000 0.000
#> GSM386428 1 0.9909 0.185 0.556 0.444
#> GSM386429 1 0.0000 0.970 1.000 0.000
#> GSM386430 1 0.0000 0.970 1.000 0.000
#> GSM386431 1 0.0000 0.970 1.000 0.000
#> GSM386432 1 0.0000 0.970 1.000 0.000
#> GSM386433 1 0.0000 0.970 1.000 0.000
#> GSM386434 1 0.0000 0.970 1.000 0.000
#> GSM386422 1 0.0000 0.970 1.000 0.000
#> GSM386423 1 0.0000 0.970 1.000 0.000
#> GSM386424 1 0.0000 0.970 1.000 0.000
#> GSM386425 1 0.0000 0.970 1.000 0.000
#> GSM386385 1 0.6531 0.782 0.832 0.168
#> GSM386386 1 0.0000 0.970 1.000 0.000
#> GSM386387 2 0.0000 0.952 0.000 1.000
#> GSM386391 1 0.7376 0.717 0.792 0.208
#> GSM386392 1 0.0000 0.970 1.000 0.000
#> GSM386393 1 0.0000 0.970 1.000 0.000
#> GSM386394 1 0.0000 0.970 1.000 0.000
#> GSM386395 1 0.0000 0.970 1.000 0.000
#> GSM386396 1 0.0000 0.970 1.000 0.000
#> GSM386397 1 0.0000 0.970 1.000 0.000
#> GSM386388 1 0.0000 0.970 1.000 0.000
#> GSM386389 1 0.0000 0.970 1.000 0.000
#> GSM386390 1 0.0000 0.970 1.000 0.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM386435 2 0.0000 0.970 0.000 1.000 0.000
#> GSM386436 2 0.0000 0.970 0.000 1.000 0.000
#> GSM386437 2 0.0000 0.970 0.000 1.000 0.000
#> GSM386438 2 0.0000 0.970 0.000 1.000 0.000
#> GSM386439 1 0.0747 0.760 0.984 0.016 0.000
#> GSM386440 2 0.0000 0.970 0.000 1.000 0.000
#> GSM386441 2 0.0000 0.970 0.000 1.000 0.000
#> GSM386442 2 0.0000 0.970 0.000 1.000 0.000
#> GSM386447 1 0.0747 0.760 0.984 0.016 0.000
#> GSM386448 2 0.0000 0.970 0.000 1.000 0.000
#> GSM386449 2 0.0000 0.970 0.000 1.000 0.000
#> GSM386450 2 0.0000 0.970 0.000 1.000 0.000
#> GSM386451 3 0.7624 0.432 0.048 0.392 0.560
#> GSM386452 1 0.0747 0.760 0.984 0.016 0.000
#> GSM386453 3 0.7624 0.432 0.048 0.392 0.560
#> GSM386454 1 0.0747 0.760 0.984 0.016 0.000
#> GSM386455 3 0.7624 0.432 0.048 0.392 0.560
#> GSM386456 3 0.7624 0.432 0.048 0.392 0.560
#> GSM386457 1 0.9574 -0.188 0.412 0.392 0.196
#> GSM386458 1 0.6154 0.477 0.592 0.000 0.408
#> GSM386443 1 0.6095 0.475 0.608 0.000 0.392
#> GSM386444 3 0.6215 -0.169 0.428 0.000 0.572
#> GSM386445 3 0.6215 -0.169 0.428 0.000 0.572
#> GSM386446 3 0.6215 -0.169 0.428 0.000 0.572
#> GSM386398 1 0.0747 0.760 0.984 0.016 0.000
#> GSM386399 1 0.0747 0.760 0.984 0.016 0.000
#> GSM386400 1 0.0747 0.760 0.984 0.016 0.000
#> GSM386401 2 0.0000 0.970 0.000 1.000 0.000
#> GSM386406 2 0.0000 0.970 0.000 1.000 0.000
#> GSM386407 3 0.7624 0.432 0.048 0.392 0.560
#> GSM386408 2 0.0000 0.970 0.000 1.000 0.000
#> GSM386409 1 0.0747 0.760 0.984 0.016 0.000
#> GSM386410 1 0.0747 0.760 0.984 0.016 0.000
#> GSM386411 3 0.7624 0.432 0.048 0.392 0.560
#> GSM386412 1 0.9037 -0.089 0.472 0.392 0.136
#> GSM386413 3 0.7624 0.432 0.048 0.392 0.560
#> GSM386414 1 0.9626 -0.203 0.404 0.392 0.204
#> GSM386415 3 0.7624 0.432 0.048 0.392 0.560
#> GSM386416 1 0.6154 0.477 0.592 0.000 0.408
#> GSM386417 3 0.7624 0.432 0.048 0.392 0.560
#> GSM386402 3 0.6045 -0.135 0.380 0.000 0.620
#> GSM386403 3 0.6095 -0.160 0.392 0.000 0.608
#> GSM386404 3 0.6095 -0.160 0.392 0.000 0.608
#> GSM386405 3 0.6045 -0.135 0.380 0.000 0.620
#> GSM386418 2 0.1643 0.914 0.044 0.956 0.000
#> GSM386419 2 0.0000 0.970 0.000 1.000 0.000
#> GSM386420 2 0.0000 0.970 0.000 1.000 0.000
#> GSM386421 2 0.1163 0.937 0.028 0.972 0.000
#> GSM386426 1 0.0747 0.760 0.984 0.016 0.000
#> GSM386427 1 0.0747 0.760 0.984 0.016 0.000
#> GSM386428 2 0.1753 0.908 0.048 0.952 0.000
#> GSM386429 3 0.7624 0.432 0.048 0.392 0.560
#> GSM386430 3 0.7624 0.432 0.048 0.392 0.560
#> GSM386431 3 0.7624 0.432 0.048 0.392 0.560
#> GSM386432 3 0.7624 0.432 0.048 0.392 0.560
#> GSM386433 3 0.7624 0.432 0.048 0.392 0.560
#> GSM386434 3 0.7624 0.432 0.048 0.392 0.560
#> GSM386422 3 0.6045 -0.135 0.380 0.000 0.620
#> GSM386423 1 0.6095 0.475 0.608 0.000 0.392
#> GSM386424 3 0.6045 -0.135 0.380 0.000 0.620
#> GSM386425 3 0.6045 -0.135 0.380 0.000 0.620
#> GSM386385 1 0.0747 0.760 0.984 0.016 0.000
#> GSM386386 1 0.0747 0.760 0.984 0.016 0.000
#> GSM386387 2 0.0000 0.970 0.000 1.000 0.000
#> GSM386391 2 0.6437 0.497 0.048 0.732 0.220
#> GSM386392 1 0.0747 0.760 0.984 0.016 0.000
#> GSM386393 3 0.7624 0.432 0.048 0.392 0.560
#> GSM386394 1 0.6648 0.257 0.620 0.016 0.364
#> GSM386395 3 0.7624 0.432 0.048 0.392 0.560
#> GSM386396 3 0.7624 0.432 0.048 0.392 0.560
#> GSM386397 3 0.7624 0.432 0.048 0.392 0.560
#> GSM386388 3 0.6045 -0.135 0.380 0.000 0.620
#> GSM386389 1 0.6095 0.475 0.608 0.000 0.392
#> GSM386390 3 0.6045 -0.135 0.380 0.000 0.620
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM386435 2 0.0000 0.991 0.000 1.000 0.000 0.000
#> GSM386436 2 0.0000 0.991 0.000 1.000 0.000 0.000
#> GSM386437 2 0.1256 0.959 0.028 0.964 0.008 0.000
#> GSM386438 2 0.0000 0.991 0.000 1.000 0.000 0.000
#> GSM386439 1 0.0188 0.975 0.996 0.004 0.000 0.000
#> GSM386440 2 0.0000 0.991 0.000 1.000 0.000 0.000
#> GSM386441 2 0.0188 0.991 0.000 0.996 0.000 0.004
#> GSM386442 2 0.0188 0.991 0.000 0.996 0.000 0.004
#> GSM386447 1 0.0524 0.969 0.988 0.004 0.000 0.008
#> GSM386448 2 0.0000 0.991 0.000 1.000 0.000 0.000
#> GSM386449 2 0.0188 0.991 0.000 0.996 0.000 0.004
#> GSM386450 2 0.0000 0.991 0.000 1.000 0.000 0.000
#> GSM386451 4 0.3123 0.817 0.000 0.156 0.000 0.844
#> GSM386452 1 0.0188 0.975 0.996 0.004 0.000 0.000
#> GSM386453 4 0.3123 0.817 0.000 0.156 0.000 0.844
#> GSM386454 1 0.0000 0.974 1.000 0.000 0.000 0.000
#> GSM386455 4 0.3219 0.820 0.000 0.000 0.164 0.836
#> GSM386456 4 0.3219 0.820 0.000 0.000 0.164 0.836
#> GSM386457 4 0.6399 0.622 0.008 0.080 0.280 0.632
#> GSM386458 1 0.2011 0.908 0.920 0.080 0.000 0.000
#> GSM386443 1 0.2081 0.917 0.916 0.000 0.084 0.000
#> GSM386444 3 0.0188 0.963 0.004 0.000 0.996 0.000
#> GSM386445 3 0.0188 0.963 0.004 0.000 0.996 0.000
#> GSM386446 3 0.2469 0.867 0.000 0.000 0.892 0.108
#> GSM386398 1 0.0000 0.974 1.000 0.000 0.000 0.000
#> GSM386399 1 0.0188 0.975 0.996 0.004 0.000 0.000
#> GSM386400 1 0.0000 0.974 1.000 0.000 0.000 0.000
#> GSM386401 2 0.0188 0.991 0.000 0.996 0.000 0.004
#> GSM386406 2 0.0592 0.983 0.000 0.984 0.000 0.016
#> GSM386407 4 0.0000 0.905 0.000 0.000 0.000 1.000
#> GSM386408 2 0.0000 0.991 0.000 1.000 0.000 0.000
#> GSM386409 1 0.0188 0.975 0.996 0.004 0.000 0.000
#> GSM386410 1 0.0188 0.975 0.996 0.004 0.000 0.000
#> GSM386411 4 0.0000 0.905 0.000 0.000 0.000 1.000
#> GSM386412 4 0.4646 0.761 0.120 0.084 0.000 0.796
#> GSM386413 4 0.0000 0.905 0.000 0.000 0.000 1.000
#> GSM386414 4 0.5522 0.688 0.204 0.080 0.000 0.716
#> GSM386415 4 0.0188 0.903 0.004 0.000 0.000 0.996
#> GSM386416 1 0.2011 0.908 0.920 0.080 0.000 0.000
#> GSM386417 4 0.3219 0.820 0.000 0.000 0.164 0.836
#> GSM386402 3 0.0000 0.965 0.000 0.000 1.000 0.000
#> GSM386403 3 0.2589 0.871 0.116 0.000 0.884 0.000
#> GSM386404 3 0.2589 0.871 0.116 0.000 0.884 0.000
#> GSM386405 3 0.0000 0.965 0.000 0.000 1.000 0.000
#> GSM386418 2 0.0592 0.982 0.000 0.984 0.000 0.016
#> GSM386419 2 0.0188 0.991 0.000 0.996 0.000 0.004
#> GSM386420 2 0.0188 0.991 0.000 0.996 0.000 0.004
#> GSM386421 2 0.0336 0.989 0.000 0.992 0.000 0.008
#> GSM386426 1 0.0188 0.975 0.996 0.004 0.000 0.000
#> GSM386427 1 0.0188 0.975 0.996 0.004 0.000 0.000
#> GSM386428 2 0.1389 0.954 0.000 0.952 0.000 0.048
#> GSM386429 4 0.0000 0.905 0.000 0.000 0.000 1.000
#> GSM386430 4 0.0000 0.905 0.000 0.000 0.000 1.000
#> GSM386431 4 0.0000 0.905 0.000 0.000 0.000 1.000
#> GSM386432 4 0.0000 0.905 0.000 0.000 0.000 1.000
#> GSM386433 4 0.3355 0.822 0.004 0.000 0.160 0.836
#> GSM386434 4 0.1978 0.879 0.004 0.000 0.068 0.928
#> GSM386422 3 0.0000 0.965 0.000 0.000 1.000 0.000
#> GSM386423 1 0.2149 0.914 0.912 0.000 0.088 0.000
#> GSM386424 3 0.0000 0.965 0.000 0.000 1.000 0.000
#> GSM386425 3 0.0000 0.965 0.000 0.000 1.000 0.000
#> GSM386385 1 0.0188 0.975 0.996 0.004 0.000 0.000
#> GSM386386 1 0.0188 0.975 0.996 0.004 0.000 0.000
#> GSM386387 2 0.0188 0.991 0.000 0.996 0.000 0.004
#> GSM386391 4 0.2868 0.816 0.000 0.136 0.000 0.864
#> GSM386392 1 0.0188 0.975 0.996 0.004 0.000 0.000
#> GSM386393 4 0.0000 0.905 0.000 0.000 0.000 1.000
#> GSM386394 1 0.0188 0.975 0.996 0.004 0.000 0.000
#> GSM386395 4 0.0000 0.905 0.000 0.000 0.000 1.000
#> GSM386396 4 0.0000 0.905 0.000 0.000 0.000 1.000
#> GSM386397 4 0.0000 0.905 0.000 0.000 0.000 1.000
#> GSM386388 3 0.0000 0.965 0.000 0.000 1.000 0.000
#> GSM386389 1 0.2149 0.914 0.912 0.000 0.088 0.000
#> GSM386390 3 0.0000 0.965 0.000 0.000 1.000 0.000
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM386435 2 0.0000 0.935 0.000 1.000 0.000 0.000 0.000
#> GSM386436 2 0.0000 0.935 0.000 1.000 0.000 0.000 0.000
#> GSM386437 2 0.1444 0.906 0.012 0.948 0.000 0.000 0.040
#> GSM386438 2 0.0000 0.935 0.000 1.000 0.000 0.000 0.000
#> GSM386439 1 0.2012 0.926 0.920 0.020 0.000 0.000 0.060
#> GSM386440 2 0.0000 0.935 0.000 1.000 0.000 0.000 0.000
#> GSM386441 2 0.0000 0.935 0.000 1.000 0.000 0.000 0.000
#> GSM386442 2 0.0000 0.935 0.000 1.000 0.000 0.000 0.000
#> GSM386447 1 0.2676 0.887 0.884 0.080 0.000 0.000 0.036
#> GSM386448 2 0.0000 0.935 0.000 1.000 0.000 0.000 0.000
#> GSM386449 2 0.0000 0.935 0.000 1.000 0.000 0.000 0.000
#> GSM386450 2 0.0000 0.935 0.000 1.000 0.000 0.000 0.000
#> GSM386451 2 0.5302 0.363 0.000 0.592 0.000 0.344 0.064
#> GSM386452 1 0.0404 0.923 0.988 0.000 0.000 0.000 0.012
#> GSM386453 2 0.5302 0.363 0.000 0.592 0.000 0.344 0.064
#> GSM386454 1 0.0794 0.921 0.972 0.000 0.000 0.000 0.028
#> GSM386455 5 0.3949 0.587 0.000 0.000 0.000 0.332 0.668
#> GSM386456 5 0.3949 0.587 0.000 0.000 0.000 0.332 0.668
#> GSM386457 5 0.3476 0.668 0.020 0.000 0.000 0.176 0.804
#> GSM386458 1 0.3601 0.870 0.820 0.000 0.000 0.052 0.128
#> GSM386443 1 0.3401 0.877 0.840 0.000 0.064 0.000 0.096
#> GSM386444 5 0.3885 0.608 0.008 0.000 0.268 0.000 0.724
#> GSM386445 5 0.3885 0.608 0.008 0.000 0.268 0.000 0.724
#> GSM386446 5 0.4983 0.631 0.008 0.000 0.268 0.048 0.676
#> GSM386398 1 0.2189 0.916 0.904 0.012 0.000 0.000 0.084
#> GSM386399 1 0.1981 0.926 0.920 0.016 0.000 0.000 0.064
#> GSM386400 1 0.2189 0.916 0.904 0.012 0.000 0.000 0.084
#> GSM386401 2 0.0000 0.935 0.000 1.000 0.000 0.000 0.000
#> GSM386406 2 0.0671 0.926 0.000 0.980 0.000 0.004 0.016
#> GSM386407 4 0.0162 0.897 0.000 0.000 0.000 0.996 0.004
#> GSM386408 2 0.0290 0.932 0.000 0.992 0.000 0.000 0.008
#> GSM386409 1 0.1117 0.924 0.964 0.016 0.000 0.000 0.020
#> GSM386410 1 0.0404 0.925 0.988 0.012 0.000 0.000 0.000
#> GSM386411 4 0.0000 0.897 0.000 0.000 0.000 1.000 0.000
#> GSM386412 4 0.4280 0.674 0.140 0.000 0.000 0.772 0.088
#> GSM386413 4 0.0000 0.897 0.000 0.000 0.000 1.000 0.000
#> GSM386414 4 0.3798 0.753 0.064 0.000 0.000 0.808 0.128
#> GSM386415 4 0.1608 0.869 0.000 0.000 0.000 0.928 0.072
#> GSM386416 1 0.3647 0.870 0.816 0.000 0.000 0.052 0.132
#> GSM386417 4 0.4276 0.208 0.000 0.000 0.004 0.616 0.380
#> GSM386402 3 0.0000 0.990 0.000 0.000 1.000 0.000 0.000
#> GSM386403 3 0.0000 0.990 0.000 0.000 1.000 0.000 0.000
#> GSM386404 3 0.0000 0.990 0.000 0.000 1.000 0.000 0.000
#> GSM386405 3 0.1270 0.948 0.000 0.000 0.948 0.000 0.052
#> GSM386418 2 0.2046 0.873 0.000 0.916 0.000 0.068 0.016
#> GSM386419 2 0.0000 0.935 0.000 1.000 0.000 0.000 0.000
#> GSM386420 2 0.0000 0.935 0.000 1.000 0.000 0.000 0.000
#> GSM386421 2 0.0671 0.926 0.000 0.980 0.000 0.004 0.016
#> GSM386426 1 0.1800 0.916 0.932 0.048 0.000 0.000 0.020
#> GSM386427 1 0.0290 0.925 0.992 0.008 0.000 0.000 0.000
#> GSM386428 2 0.2727 0.817 0.000 0.868 0.000 0.116 0.016
#> GSM386429 4 0.0404 0.897 0.000 0.000 0.000 0.988 0.012
#> GSM386430 4 0.0404 0.897 0.000 0.000 0.000 0.988 0.012
#> GSM386431 4 0.0963 0.889 0.000 0.000 0.000 0.964 0.036
#> GSM386432 4 0.0404 0.897 0.000 0.000 0.000 0.988 0.012
#> GSM386433 4 0.1671 0.866 0.000 0.000 0.000 0.924 0.076
#> GSM386434 4 0.1270 0.875 0.000 0.000 0.000 0.948 0.052
#> GSM386422 3 0.0703 0.973 0.000 0.000 0.976 0.000 0.024
#> GSM386423 1 0.3644 0.871 0.824 0.000 0.080 0.000 0.096
#> GSM386424 3 0.0000 0.990 0.000 0.000 1.000 0.000 0.000
#> GSM386425 3 0.0000 0.990 0.000 0.000 1.000 0.000 0.000
#> GSM386385 1 0.2595 0.889 0.888 0.080 0.000 0.000 0.032
#> GSM386386 1 0.1117 0.924 0.964 0.016 0.000 0.000 0.020
#> GSM386387 2 0.0000 0.935 0.000 1.000 0.000 0.000 0.000
#> GSM386391 4 0.4333 0.585 0.000 0.212 0.000 0.740 0.048
#> GSM386392 1 0.1648 0.919 0.940 0.040 0.000 0.000 0.020
#> GSM386393 4 0.0963 0.889 0.000 0.000 0.000 0.964 0.036
#> GSM386394 1 0.2871 0.871 0.872 0.000 0.000 0.088 0.040
#> GSM386395 4 0.0963 0.889 0.000 0.000 0.000 0.964 0.036
#> GSM386396 4 0.0290 0.896 0.000 0.000 0.000 0.992 0.008
#> GSM386397 4 0.0000 0.897 0.000 0.000 0.000 1.000 0.000
#> GSM386388 3 0.0000 0.990 0.000 0.000 1.000 0.000 0.000
#> GSM386389 1 0.3644 0.871 0.824 0.000 0.080 0.000 0.096
#> GSM386390 3 0.0000 0.990 0.000 0.000 1.000 0.000 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM386435 2 0.0146 0.876 0.000 0.996 0.000 0.000 0.004 0.000
#> GSM386436 2 0.0146 0.876 0.000 0.996 0.000 0.000 0.004 0.000
#> GSM386437 2 0.2667 0.651 0.020 0.852 0.000 0.000 0.128 0.000
#> GSM386438 2 0.0146 0.876 0.000 0.996 0.000 0.000 0.004 0.000
#> GSM386439 1 0.1950 0.854 0.912 0.024 0.000 0.000 0.064 0.000
#> GSM386440 2 0.0458 0.868 0.000 0.984 0.000 0.000 0.016 0.000
#> GSM386441 2 0.0363 0.870 0.000 0.988 0.000 0.000 0.012 0.000
#> GSM386442 2 0.0000 0.876 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM386447 1 0.4945 0.578 0.664 0.192 0.000 0.000 0.140 0.004
#> GSM386448 2 0.0363 0.870 0.000 0.988 0.000 0.000 0.012 0.000
#> GSM386449 2 0.0000 0.876 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM386450 2 0.0000 0.876 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM386451 6 0.7236 0.344 0.004 0.248 0.000 0.328 0.076 0.344
#> GSM386452 1 0.1585 0.858 0.940 0.000 0.000 0.012 0.012 0.036
#> GSM386453 2 0.7405 -0.350 0.004 0.336 0.000 0.296 0.096 0.268
#> GSM386454 1 0.1251 0.860 0.956 0.000 0.000 0.008 0.012 0.024
#> GSM386455 6 0.4138 0.728 0.004 0.024 0.000 0.212 0.020 0.740
#> GSM386456 6 0.4138 0.728 0.004 0.024 0.000 0.212 0.020 0.740
#> GSM386457 6 0.4214 0.735 0.012 0.024 0.000 0.184 0.024 0.756
#> GSM386458 1 0.5208 0.718 0.684 0.000 0.004 0.104 0.176 0.032
#> GSM386443 1 0.6071 0.733 0.652 0.000 0.088 0.032 0.080 0.148
#> GSM386444 6 0.2482 0.676 0.000 0.000 0.148 0.004 0.000 0.848
#> GSM386445 6 0.2482 0.676 0.000 0.000 0.148 0.004 0.000 0.848
#> GSM386446 6 0.2482 0.676 0.000 0.000 0.148 0.004 0.000 0.848
#> GSM386398 1 0.1644 0.850 0.920 0.000 0.000 0.000 0.076 0.004
#> GSM386399 1 0.1657 0.855 0.928 0.016 0.000 0.000 0.056 0.000
#> GSM386400 1 0.1644 0.850 0.920 0.000 0.000 0.000 0.076 0.004
#> GSM386401 2 0.0363 0.870 0.000 0.988 0.000 0.000 0.012 0.000
#> GSM386406 5 0.3828 0.980 0.000 0.440 0.000 0.000 0.560 0.000
#> GSM386407 4 0.0000 0.842 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM386408 2 0.0458 0.863 0.000 0.984 0.000 0.000 0.016 0.000
#> GSM386409 1 0.0260 0.859 0.992 0.000 0.000 0.000 0.000 0.008
#> GSM386410 1 0.1245 0.859 0.952 0.000 0.000 0.000 0.016 0.032
#> GSM386411 4 0.0146 0.842 0.000 0.000 0.000 0.996 0.004 0.000
#> GSM386412 4 0.4357 0.692 0.084 0.004 0.000 0.736 0.172 0.004
#> GSM386413 4 0.0146 0.842 0.000 0.000 0.000 0.996 0.004 0.000
#> GSM386414 4 0.4637 0.718 0.060 0.004 0.000 0.728 0.180 0.028
#> GSM386415 4 0.2536 0.813 0.000 0.000 0.000 0.864 0.116 0.020
#> GSM386416 1 0.5129 0.710 0.672 0.004 0.000 0.096 0.208 0.020
#> GSM386417 6 0.5597 0.498 0.004 0.000 0.020 0.356 0.080 0.540
#> GSM386402 3 0.0000 0.999 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386403 3 0.0000 0.999 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386404 3 0.0000 0.999 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386405 3 0.0363 0.988 0.000 0.000 0.988 0.000 0.000 0.012
#> GSM386418 5 0.4051 0.986 0.000 0.432 0.000 0.008 0.560 0.000
#> GSM386419 2 0.1765 0.720 0.000 0.904 0.000 0.000 0.096 0.000
#> GSM386420 2 0.0458 0.862 0.000 0.984 0.000 0.000 0.016 0.000
#> GSM386421 5 0.3955 0.987 0.000 0.436 0.000 0.004 0.560 0.000
#> GSM386426 1 0.0891 0.858 0.968 0.024 0.000 0.000 0.000 0.008
#> GSM386427 1 0.1245 0.859 0.952 0.000 0.000 0.000 0.016 0.032
#> GSM386428 5 0.4136 0.980 0.000 0.428 0.000 0.012 0.560 0.000
#> GSM386429 4 0.1267 0.833 0.000 0.000 0.000 0.940 0.060 0.000
#> GSM386430 4 0.1267 0.833 0.000 0.000 0.000 0.940 0.060 0.000
#> GSM386431 4 0.2482 0.811 0.000 0.004 0.000 0.848 0.148 0.000
#> GSM386432 4 0.0260 0.842 0.000 0.000 0.000 0.992 0.008 0.000
#> GSM386433 4 0.2747 0.811 0.004 0.000 0.000 0.860 0.108 0.028
#> GSM386434 4 0.2536 0.813 0.000 0.000 0.000 0.864 0.116 0.020
#> GSM386422 3 0.0000 0.999 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386423 1 0.5382 0.710 0.660 0.000 0.184 0.000 0.040 0.116
#> GSM386424 3 0.0000 0.999 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386425 3 0.0000 0.999 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386385 1 0.4641 0.625 0.696 0.192 0.000 0.000 0.108 0.004
#> GSM386386 1 0.0260 0.859 0.992 0.000 0.000 0.000 0.000 0.008
#> GSM386387 2 0.0000 0.876 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM386391 4 0.6247 -0.395 0.004 0.316 0.000 0.352 0.328 0.000
#> GSM386392 1 0.1036 0.858 0.964 0.024 0.000 0.000 0.004 0.008
#> GSM386393 4 0.2416 0.812 0.000 0.000 0.000 0.844 0.156 0.000
#> GSM386394 1 0.3981 0.796 0.804 0.008 0.000 0.104 0.052 0.032
#> GSM386395 4 0.2482 0.811 0.000 0.004 0.000 0.848 0.148 0.000
#> GSM386396 4 0.2165 0.830 0.000 0.000 0.000 0.884 0.108 0.008
#> GSM386397 4 0.2165 0.830 0.000 0.000 0.000 0.884 0.108 0.008
#> GSM386388 3 0.0000 0.999 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386389 1 0.5382 0.710 0.660 0.000 0.184 0.000 0.040 0.116
#> GSM386390 3 0.0000 0.999 0.000 0.000 1.000 0.000 0.000 0.000
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
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 agent(p) dose(p) time(p) k
#> MAD:mclust 71 2.08e-04 0.048799 1.05e-06 2
#> MAD:mclust 33 1.51e-01 0.194500 6.89e-02 3
#> MAD:mclust 74 3.32e-02 0.540742 1.80e-16 4
#> MAD:mclust 71 2.89e-06 0.001298 2.90e-12 5
#> MAD:mclust 70 8.16e-07 0.000308 1.09e-11 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 51941 rows and 74 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 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.523 0.849 0.907 0.4620 0.546 0.546
#> 3 3 0.897 0.914 0.964 0.2983 0.660 0.475
#> 4 4 0.569 0.650 0.782 0.2149 0.785 0.509
#> 5 5 0.705 0.718 0.808 0.0769 0.927 0.726
#> 6 6 0.765 0.691 0.838 0.0324 0.944 0.755
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
#> GSM386435 1 0.1843 0.891 0.972 0.028
#> GSM386436 1 0.3584 0.887 0.932 0.068
#> GSM386437 1 0.0376 0.885 0.996 0.004
#> GSM386438 1 0.2236 0.891 0.964 0.036
#> GSM386439 1 0.4161 0.853 0.916 0.084
#> GSM386440 1 0.0000 0.884 1.000 0.000
#> GSM386441 1 0.3584 0.887 0.932 0.068
#> GSM386442 1 0.2778 0.890 0.952 0.048
#> GSM386447 1 0.1414 0.879 0.980 0.020
#> GSM386448 1 0.4562 0.876 0.904 0.096
#> GSM386449 1 0.2423 0.891 0.960 0.040
#> GSM386450 1 0.5408 0.861 0.876 0.124
#> GSM386451 1 0.6531 0.831 0.832 0.168
#> GSM386452 1 0.6048 0.809 0.852 0.148
#> GSM386453 1 0.6531 0.831 0.832 0.168
#> GSM386454 1 0.7602 0.724 0.780 0.220
#> GSM386455 1 0.9775 0.383 0.588 0.412
#> GSM386456 1 0.9850 0.335 0.572 0.428
#> GSM386457 2 0.9635 0.332 0.388 0.612
#> GSM386458 2 0.8661 0.607 0.288 0.712
#> GSM386443 2 0.6531 0.756 0.168 0.832
#> GSM386444 2 0.3431 0.921 0.064 0.936
#> GSM386445 2 0.2778 0.925 0.048 0.952
#> GSM386446 2 0.4161 0.914 0.084 0.916
#> GSM386398 1 0.4161 0.853 0.916 0.084
#> GSM386399 1 0.4161 0.853 0.916 0.084
#> GSM386400 1 0.4161 0.853 0.916 0.084
#> GSM386401 1 0.1414 0.889 0.980 0.020
#> GSM386406 1 0.1414 0.889 0.980 0.020
#> GSM386407 1 0.8861 0.641 0.696 0.304
#> GSM386408 1 0.0000 0.884 1.000 0.000
#> GSM386409 1 0.4161 0.853 0.916 0.084
#> GSM386410 1 0.4161 0.853 0.916 0.084
#> GSM386411 1 0.6712 0.824 0.824 0.176
#> GSM386412 1 0.4022 0.886 0.920 0.080
#> GSM386413 1 0.6712 0.824 0.824 0.176
#> GSM386414 2 0.3879 0.917 0.076 0.924
#> GSM386415 2 0.4161 0.914 0.084 0.916
#> GSM386416 2 0.1633 0.900 0.024 0.976
#> GSM386417 2 0.4161 0.914 0.084 0.916
#> GSM386402 2 0.0672 0.916 0.008 0.992
#> GSM386403 2 0.0000 0.911 0.000 1.000
#> GSM386404 2 0.0000 0.911 0.000 1.000
#> GSM386405 2 0.2778 0.924 0.048 0.952
#> GSM386418 1 0.0000 0.884 1.000 0.000
#> GSM386419 1 0.3584 0.887 0.932 0.068
#> GSM386420 1 0.2236 0.891 0.964 0.036
#> GSM386421 1 0.0672 0.886 0.992 0.008
#> GSM386426 1 0.3879 0.857 0.924 0.076
#> GSM386427 1 0.4161 0.853 0.916 0.084
#> GSM386428 1 0.2236 0.891 0.964 0.036
#> GSM386429 1 0.6531 0.831 0.832 0.168
#> GSM386430 1 0.6531 0.831 0.832 0.168
#> GSM386431 1 0.6531 0.831 0.832 0.168
#> GSM386432 1 0.6531 0.831 0.832 0.168
#> GSM386433 2 0.4022 0.916 0.080 0.920
#> GSM386434 2 0.4161 0.914 0.084 0.916
#> GSM386422 2 0.2236 0.924 0.036 0.964
#> GSM386423 2 0.0376 0.909 0.004 0.996
#> GSM386424 2 0.0672 0.916 0.008 0.992
#> GSM386425 2 0.2948 0.924 0.052 0.948
#> GSM386385 1 0.1633 0.877 0.976 0.024
#> GSM386386 1 0.4161 0.853 0.916 0.084
#> GSM386387 1 0.4161 0.881 0.916 0.084
#> GSM386391 1 0.3879 0.884 0.924 0.076
#> GSM386392 1 0.3879 0.857 0.924 0.076
#> GSM386393 1 0.6531 0.831 0.832 0.168
#> GSM386394 1 0.2603 0.892 0.956 0.044
#> GSM386395 1 0.5737 0.854 0.864 0.136
#> GSM386396 2 0.4161 0.914 0.084 0.916
#> GSM386397 2 0.4161 0.914 0.084 0.916
#> GSM386388 2 0.2236 0.924 0.036 0.964
#> GSM386389 2 0.0376 0.909 0.004 0.996
#> GSM386390 2 0.1184 0.918 0.016 0.984
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM386435 2 0.3619 0.8533 0.136 0.864 0.000
#> GSM386436 2 0.0747 0.9528 0.016 0.984 0.000
#> GSM386437 1 0.4796 0.6792 0.780 0.220 0.000
#> GSM386438 2 0.2356 0.9149 0.072 0.928 0.000
#> GSM386439 1 0.0000 0.9777 1.000 0.000 0.000
#> GSM386440 2 0.3879 0.8356 0.152 0.848 0.000
#> GSM386441 2 0.0000 0.9585 0.000 1.000 0.000
#> GSM386442 2 0.0000 0.9585 0.000 1.000 0.000
#> GSM386447 1 0.0000 0.9777 1.000 0.000 0.000
#> GSM386448 2 0.0000 0.9585 0.000 1.000 0.000
#> GSM386449 2 0.0000 0.9585 0.000 1.000 0.000
#> GSM386450 2 0.0000 0.9585 0.000 1.000 0.000
#> GSM386451 2 0.0000 0.9585 0.000 1.000 0.000
#> GSM386452 1 0.0237 0.9742 0.996 0.000 0.004
#> GSM386453 2 0.0000 0.9585 0.000 1.000 0.000
#> GSM386454 1 0.0237 0.9742 0.996 0.000 0.004
#> GSM386455 2 0.0000 0.9585 0.000 1.000 0.000
#> GSM386456 2 0.0000 0.9585 0.000 1.000 0.000
#> GSM386457 2 0.0237 0.9572 0.000 0.996 0.004
#> GSM386458 3 0.5291 0.6079 0.268 0.000 0.732
#> GSM386443 3 0.0424 0.9373 0.008 0.000 0.992
#> GSM386444 3 0.0237 0.9402 0.000 0.004 0.996
#> GSM386445 3 0.0000 0.9438 0.000 0.000 1.000
#> GSM386446 2 0.6302 0.0567 0.000 0.520 0.480
#> GSM386398 1 0.0000 0.9777 1.000 0.000 0.000
#> GSM386399 1 0.0000 0.9777 1.000 0.000 0.000
#> GSM386400 1 0.0000 0.9777 1.000 0.000 0.000
#> GSM386401 2 0.1163 0.9462 0.028 0.972 0.000
#> GSM386406 2 0.0892 0.9507 0.020 0.980 0.000
#> GSM386407 2 0.0000 0.9585 0.000 1.000 0.000
#> GSM386408 2 0.4555 0.7729 0.200 0.800 0.000
#> GSM386409 1 0.0000 0.9777 1.000 0.000 0.000
#> GSM386410 1 0.0000 0.9777 1.000 0.000 0.000
#> GSM386411 2 0.0000 0.9585 0.000 1.000 0.000
#> GSM386412 2 0.0237 0.9575 0.004 0.996 0.000
#> GSM386413 2 0.0000 0.9585 0.000 1.000 0.000
#> GSM386414 3 0.6274 0.1359 0.000 0.456 0.544
#> GSM386415 2 0.1289 0.9386 0.000 0.968 0.032
#> GSM386416 3 0.0000 0.9438 0.000 0.000 1.000
#> GSM386417 2 0.0237 0.9573 0.000 0.996 0.004
#> GSM386402 3 0.0000 0.9438 0.000 0.000 1.000
#> GSM386403 3 0.0000 0.9438 0.000 0.000 1.000
#> GSM386404 3 0.0000 0.9438 0.000 0.000 1.000
#> GSM386405 3 0.0000 0.9438 0.000 0.000 1.000
#> GSM386418 2 0.3116 0.8816 0.108 0.892 0.000
#> GSM386419 2 0.0237 0.9576 0.004 0.996 0.000
#> GSM386420 2 0.1289 0.9436 0.032 0.968 0.000
#> GSM386421 2 0.1529 0.9386 0.040 0.960 0.000
#> GSM386426 1 0.0000 0.9777 1.000 0.000 0.000
#> GSM386427 1 0.0000 0.9777 1.000 0.000 0.000
#> GSM386428 2 0.0592 0.9544 0.012 0.988 0.000
#> GSM386429 2 0.0000 0.9585 0.000 1.000 0.000
#> GSM386430 2 0.0000 0.9585 0.000 1.000 0.000
#> GSM386431 2 0.0000 0.9585 0.000 1.000 0.000
#> GSM386432 2 0.0000 0.9585 0.000 1.000 0.000
#> GSM386433 2 0.1964 0.9185 0.000 0.944 0.056
#> GSM386434 2 0.0237 0.9573 0.000 0.996 0.004
#> GSM386422 3 0.0000 0.9438 0.000 0.000 1.000
#> GSM386423 3 0.0000 0.9438 0.000 0.000 1.000
#> GSM386424 3 0.0000 0.9438 0.000 0.000 1.000
#> GSM386425 3 0.0000 0.9438 0.000 0.000 1.000
#> GSM386385 1 0.0000 0.9777 1.000 0.000 0.000
#> GSM386386 1 0.0000 0.9777 1.000 0.000 0.000
#> GSM386387 2 0.0000 0.9585 0.000 1.000 0.000
#> GSM386391 2 0.0424 0.9561 0.008 0.992 0.000
#> GSM386392 1 0.0000 0.9777 1.000 0.000 0.000
#> GSM386393 2 0.0000 0.9585 0.000 1.000 0.000
#> GSM386394 2 0.5216 0.6667 0.260 0.740 0.000
#> GSM386395 2 0.0000 0.9585 0.000 1.000 0.000
#> GSM386396 2 0.0237 0.9573 0.000 0.996 0.004
#> GSM386397 2 0.0237 0.9573 0.000 0.996 0.004
#> GSM386388 3 0.0000 0.9438 0.000 0.000 1.000
#> GSM386389 3 0.0000 0.9438 0.000 0.000 1.000
#> GSM386390 3 0.0000 0.9438 0.000 0.000 1.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM386435 2 0.1733 0.63487 0.024 0.948 0.000 0.028
#> GSM386436 2 0.2466 0.70816 0.004 0.900 0.000 0.096
#> GSM386437 2 0.2610 0.51592 0.088 0.900 0.000 0.012
#> GSM386438 2 0.2036 0.63190 0.032 0.936 0.000 0.032
#> GSM386439 1 0.4761 0.82726 0.628 0.372 0.000 0.000
#> GSM386440 2 0.1520 0.62601 0.024 0.956 0.000 0.020
#> GSM386441 2 0.2469 0.70540 0.000 0.892 0.000 0.108
#> GSM386442 2 0.3266 0.70822 0.000 0.832 0.000 0.168
#> GSM386447 1 0.4933 0.76046 0.568 0.432 0.000 0.000
#> GSM386448 2 0.4382 0.65427 0.000 0.704 0.000 0.296
#> GSM386449 2 0.4040 0.68587 0.000 0.752 0.000 0.248
#> GSM386450 2 0.4776 0.55323 0.000 0.624 0.000 0.376
#> GSM386451 4 0.5407 -0.25109 0.012 0.484 0.000 0.504
#> GSM386452 1 0.2271 0.65284 0.916 0.008 0.000 0.076
#> GSM386453 4 0.5833 -0.09495 0.032 0.440 0.000 0.528
#> GSM386454 1 0.5599 0.77126 0.700 0.228 0.000 0.072
#> GSM386455 2 0.5650 0.35721 0.024 0.544 0.000 0.432
#> GSM386456 2 0.5183 0.45048 0.008 0.584 0.000 0.408
#> GSM386457 2 0.6570 0.33466 0.044 0.504 0.016 0.436
#> GSM386458 3 0.8625 0.18615 0.276 0.168 0.484 0.072
#> GSM386443 3 0.3444 0.72000 0.184 0.000 0.816 0.000
#> GSM386444 3 0.3052 0.77169 0.000 0.136 0.860 0.004
#> GSM386445 3 0.2654 0.79882 0.000 0.108 0.888 0.004
#> GSM386446 3 0.6900 -0.00137 0.004 0.416 0.488 0.092
#> GSM386398 1 0.4964 0.82516 0.616 0.380 0.000 0.004
#> GSM386399 1 0.4713 0.82817 0.640 0.360 0.000 0.000
#> GSM386400 1 0.4964 0.82516 0.616 0.380 0.000 0.004
#> GSM386401 2 0.1389 0.67453 0.000 0.952 0.000 0.048
#> GSM386406 2 0.5057 0.61202 0.012 0.648 0.000 0.340
#> GSM386407 4 0.2142 0.76184 0.016 0.056 0.000 0.928
#> GSM386408 2 0.2002 0.60784 0.044 0.936 0.000 0.020
#> GSM386409 1 0.4193 0.82674 0.732 0.268 0.000 0.000
#> GSM386410 1 0.1854 0.73058 0.940 0.048 0.000 0.012
#> GSM386411 4 0.2530 0.74458 0.000 0.112 0.000 0.888
#> GSM386412 4 0.4123 0.65411 0.220 0.008 0.000 0.772
#> GSM386413 4 0.2760 0.73108 0.000 0.128 0.000 0.872
#> GSM386414 4 0.5208 0.64013 0.052 0.032 0.132 0.784
#> GSM386415 4 0.2353 0.74957 0.024 0.040 0.008 0.928
#> GSM386416 3 0.6593 0.62618 0.136 0.020 0.676 0.168
#> GSM386417 4 0.5300 0.24160 0.008 0.352 0.008 0.632
#> GSM386402 3 0.0000 0.87960 0.000 0.000 1.000 0.000
#> GSM386403 3 0.0000 0.87960 0.000 0.000 1.000 0.000
#> GSM386404 3 0.0000 0.87960 0.000 0.000 1.000 0.000
#> GSM386405 3 0.0188 0.87756 0.000 0.004 0.996 0.000
#> GSM386418 2 0.4646 0.67137 0.084 0.796 0.000 0.120
#> GSM386419 2 0.4072 0.68472 0.000 0.748 0.000 0.252
#> GSM386420 2 0.3498 0.71099 0.008 0.832 0.000 0.160
#> GSM386421 2 0.5222 0.66171 0.032 0.688 0.000 0.280
#> GSM386426 1 0.5024 0.82195 0.632 0.360 0.000 0.008
#> GSM386427 1 0.1854 0.72984 0.940 0.048 0.000 0.012
#> GSM386428 2 0.5244 0.55034 0.012 0.600 0.000 0.388
#> GSM386429 4 0.2197 0.75770 0.004 0.080 0.000 0.916
#> GSM386430 4 0.2197 0.75770 0.004 0.080 0.000 0.916
#> GSM386431 4 0.2751 0.75590 0.056 0.040 0.000 0.904
#> GSM386432 4 0.2081 0.75691 0.000 0.084 0.000 0.916
#> GSM386433 4 0.3841 0.72523 0.032 0.076 0.028 0.864
#> GSM386434 4 0.2408 0.74786 0.000 0.104 0.000 0.896
#> GSM386422 3 0.0000 0.87960 0.000 0.000 1.000 0.000
#> GSM386423 3 0.0000 0.87960 0.000 0.000 1.000 0.000
#> GSM386424 3 0.0000 0.87960 0.000 0.000 1.000 0.000
#> GSM386425 3 0.0000 0.87960 0.000 0.000 1.000 0.000
#> GSM386385 2 0.5000 -0.67104 0.500 0.500 0.000 0.000
#> GSM386386 1 0.3450 0.76833 0.836 0.156 0.000 0.008
#> GSM386387 2 0.4382 0.65364 0.000 0.704 0.000 0.296
#> GSM386391 2 0.5459 0.46112 0.016 0.552 0.000 0.432
#> GSM386392 1 0.4776 0.81555 0.624 0.376 0.000 0.000
#> GSM386393 4 0.6052 0.62136 0.284 0.076 0.000 0.640
#> GSM386394 4 0.6023 0.52889 0.344 0.056 0.000 0.600
#> GSM386395 4 0.5727 0.66386 0.228 0.080 0.000 0.692
#> GSM386396 4 0.3056 0.76070 0.040 0.072 0.000 0.888
#> GSM386397 4 0.4387 0.71836 0.144 0.052 0.000 0.804
#> GSM386388 3 0.0000 0.87960 0.000 0.000 1.000 0.000
#> GSM386389 3 0.0000 0.87960 0.000 0.000 1.000 0.000
#> GSM386390 3 0.0000 0.87960 0.000 0.000 1.000 0.000
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM386435 2 0.2344 0.880 0.064 0.904 0.000 0.000 0.032
#> GSM386436 2 0.1026 0.913 0.004 0.968 0.000 0.004 0.024
#> GSM386437 2 0.2915 0.831 0.116 0.860 0.000 0.000 0.024
#> GSM386438 2 0.1493 0.904 0.028 0.948 0.000 0.000 0.024
#> GSM386439 1 0.5668 0.652 0.624 0.144 0.000 0.000 0.232
#> GSM386440 2 0.3551 0.788 0.136 0.820 0.000 0.000 0.044
#> GSM386441 2 0.2687 0.899 0.044 0.900 0.000 0.028 0.028
#> GSM386442 2 0.1493 0.910 0.000 0.948 0.000 0.028 0.024
#> GSM386447 1 0.5531 0.663 0.632 0.248 0.000 0.000 0.120
#> GSM386448 2 0.3483 0.874 0.032 0.852 0.000 0.088 0.028
#> GSM386449 2 0.3671 0.878 0.060 0.844 0.000 0.072 0.024
#> GSM386450 2 0.3229 0.835 0.000 0.840 0.000 0.128 0.032
#> GSM386451 5 0.5915 0.349 0.000 0.104 0.000 0.412 0.484
#> GSM386452 1 0.3819 0.516 0.756 0.000 0.000 0.016 0.228
#> GSM386453 5 0.4808 0.454 0.000 0.032 0.000 0.348 0.620
#> GSM386454 5 0.4517 -0.123 0.436 0.000 0.000 0.008 0.556
#> GSM386455 5 0.5336 0.562 0.000 0.084 0.000 0.288 0.628
#> GSM386456 5 0.6365 0.454 0.000 0.212 0.000 0.272 0.516
#> GSM386457 5 0.3487 0.601 0.000 0.008 0.000 0.212 0.780
#> GSM386458 5 0.5016 0.481 0.176 0.000 0.000 0.120 0.704
#> GSM386443 3 0.3196 0.714 0.192 0.000 0.804 0.000 0.004
#> GSM386444 3 0.1571 0.881 0.000 0.060 0.936 0.000 0.004
#> GSM386445 3 0.1041 0.910 0.000 0.032 0.964 0.004 0.000
#> GSM386446 3 0.5775 0.148 0.000 0.412 0.520 0.020 0.048
#> GSM386398 1 0.5953 0.550 0.540 0.124 0.000 0.000 0.336
#> GSM386399 1 0.4545 0.706 0.752 0.132 0.000 0.000 0.116
#> GSM386400 1 0.6081 0.495 0.496 0.128 0.000 0.000 0.376
#> GSM386401 2 0.1195 0.910 0.012 0.960 0.000 0.000 0.028
#> GSM386406 2 0.1502 0.901 0.004 0.940 0.000 0.056 0.000
#> GSM386407 4 0.3282 0.696 0.000 0.008 0.000 0.804 0.188
#> GSM386408 2 0.1041 0.907 0.032 0.964 0.000 0.004 0.000
#> GSM386409 1 0.2608 0.708 0.888 0.088 0.000 0.004 0.020
#> GSM386410 1 0.2389 0.608 0.880 0.000 0.000 0.004 0.116
#> GSM386411 4 0.3236 0.698 0.000 0.020 0.000 0.828 0.152
#> GSM386412 4 0.4690 0.623 0.048 0.004 0.000 0.708 0.240
#> GSM386413 4 0.3284 0.696 0.000 0.024 0.000 0.828 0.148
#> GSM386414 4 0.4047 0.579 0.000 0.004 0.000 0.676 0.320
#> GSM386415 4 0.3861 0.644 0.000 0.008 0.000 0.728 0.264
#> GSM386416 5 0.5305 0.591 0.112 0.000 0.004 0.204 0.680
#> GSM386417 4 0.4800 0.564 0.000 0.052 0.000 0.676 0.272
#> GSM386402 3 0.0162 0.932 0.000 0.004 0.996 0.000 0.000
#> GSM386403 3 0.0000 0.932 0.000 0.000 1.000 0.000 0.000
#> GSM386404 3 0.0000 0.932 0.000 0.000 1.000 0.000 0.000
#> GSM386405 3 0.0290 0.930 0.000 0.008 0.992 0.000 0.000
#> GSM386418 2 0.1216 0.907 0.020 0.960 0.000 0.020 0.000
#> GSM386419 2 0.0609 0.913 0.000 0.980 0.000 0.020 0.000
#> GSM386420 2 0.0912 0.911 0.012 0.972 0.000 0.016 0.000
#> GSM386421 2 0.1012 0.909 0.012 0.968 0.000 0.020 0.000
#> GSM386426 1 0.3462 0.715 0.792 0.196 0.000 0.000 0.012
#> GSM386427 1 0.2818 0.595 0.856 0.000 0.000 0.012 0.132
#> GSM386428 2 0.2588 0.865 0.008 0.884 0.000 0.100 0.008
#> GSM386429 4 0.0510 0.698 0.000 0.016 0.000 0.984 0.000
#> GSM386430 4 0.1041 0.688 0.000 0.032 0.000 0.964 0.004
#> GSM386431 4 0.1525 0.694 0.036 0.004 0.000 0.948 0.012
#> GSM386432 4 0.2921 0.706 0.000 0.020 0.000 0.856 0.124
#> GSM386433 4 0.3906 0.617 0.000 0.004 0.000 0.704 0.292
#> GSM386434 4 0.3562 0.687 0.000 0.016 0.000 0.788 0.196
#> GSM386422 3 0.0162 0.932 0.000 0.004 0.996 0.000 0.000
#> GSM386423 3 0.0162 0.931 0.000 0.000 0.996 0.000 0.004
#> GSM386424 3 0.0000 0.932 0.000 0.000 1.000 0.000 0.000
#> GSM386425 3 0.0162 0.932 0.000 0.004 0.996 0.000 0.000
#> GSM386385 1 0.4627 0.366 0.544 0.444 0.000 0.000 0.012
#> GSM386386 1 0.4819 0.678 0.736 0.148 0.000 0.004 0.112
#> GSM386387 2 0.0609 0.913 0.000 0.980 0.000 0.020 0.000
#> GSM386391 2 0.3277 0.817 0.008 0.832 0.000 0.148 0.012
#> GSM386392 1 0.3849 0.701 0.752 0.232 0.000 0.000 0.016
#> GSM386393 4 0.6055 0.433 0.128 0.168 0.000 0.660 0.044
#> GSM386394 4 0.6070 0.368 0.228 0.016 0.000 0.616 0.140
#> GSM386395 4 0.5749 0.444 0.092 0.172 0.000 0.688 0.048
#> GSM386396 4 0.1483 0.698 0.028 0.008 0.000 0.952 0.012
#> GSM386397 4 0.2011 0.685 0.044 0.008 0.000 0.928 0.020
#> GSM386388 3 0.0000 0.932 0.000 0.000 1.000 0.000 0.000
#> GSM386389 3 0.0324 0.930 0.004 0.000 0.992 0.000 0.004
#> GSM386390 3 0.0000 0.932 0.000 0.000 1.000 0.000 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM386435 2 0.1080 0.797 0.004 0.960 0.000 0.000 0.004 0.032
#> GSM386436 2 0.1036 0.797 0.008 0.964 0.000 0.000 0.004 0.024
#> GSM386437 2 0.1232 0.798 0.016 0.956 0.000 0.000 0.004 0.024
#> GSM386438 2 0.0603 0.798 0.004 0.980 0.000 0.000 0.000 0.016
#> GSM386439 1 0.2358 0.687 0.900 0.048 0.000 0.000 0.012 0.040
#> GSM386440 2 0.3301 0.703 0.188 0.788 0.000 0.000 0.000 0.024
#> GSM386441 2 0.2258 0.779 0.056 0.908 0.000 0.008 0.008 0.020
#> GSM386442 2 0.1608 0.791 0.036 0.940 0.000 0.004 0.004 0.016
#> GSM386447 2 0.6251 0.308 0.268 0.536 0.000 0.000 0.144 0.052
#> GSM386448 2 0.2501 0.770 0.036 0.900 0.000 0.016 0.008 0.040
#> GSM386449 2 0.2653 0.785 0.064 0.876 0.000 0.004 0.000 0.056
#> GSM386450 2 0.2765 0.760 0.044 0.884 0.000 0.024 0.004 0.044
#> GSM386451 6 0.4981 0.411 0.008 0.376 0.000 0.056 0.000 0.560
#> GSM386452 5 0.3213 0.780 0.132 0.000 0.000 0.000 0.820 0.048
#> GSM386453 6 0.2965 0.719 0.000 0.080 0.000 0.072 0.000 0.848
#> GSM386454 5 0.5455 0.582 0.264 0.000 0.000 0.000 0.564 0.172
#> GSM386455 6 0.4013 0.629 0.004 0.228 0.000 0.040 0.000 0.728
#> GSM386456 2 0.5128 -0.236 0.036 0.472 0.000 0.024 0.000 0.468
#> GSM386457 6 0.1464 0.707 0.004 0.016 0.000 0.036 0.000 0.944
#> GSM386458 6 0.1938 0.675 0.028 0.004 0.000 0.016 0.024 0.928
#> GSM386443 3 0.5164 0.488 0.176 0.000 0.648 0.000 0.168 0.008
#> GSM386444 3 0.1007 0.909 0.008 0.004 0.968 0.000 0.016 0.004
#> GSM386445 3 0.1007 0.909 0.008 0.004 0.968 0.000 0.016 0.004
#> GSM386446 3 0.6565 0.192 0.060 0.376 0.484 0.032 0.028 0.020
#> GSM386398 1 0.2920 0.634 0.864 0.016 0.000 0.000 0.080 0.040
#> GSM386399 1 0.2521 0.677 0.892 0.032 0.000 0.000 0.056 0.020
#> GSM386400 1 0.2706 0.649 0.880 0.016 0.000 0.000 0.060 0.044
#> GSM386401 2 0.3324 0.731 0.164 0.808 0.000 0.004 0.016 0.008
#> GSM386406 2 0.4885 0.484 0.284 0.652 0.000 0.012 0.036 0.016
#> GSM386407 4 0.2003 0.794 0.000 0.000 0.000 0.884 0.000 0.116
#> GSM386408 2 0.4684 0.041 0.452 0.516 0.000 0.008 0.020 0.004
#> GSM386409 5 0.3352 0.787 0.148 0.032 0.000 0.000 0.812 0.008
#> GSM386410 5 0.2068 0.806 0.080 0.008 0.000 0.000 0.904 0.008
#> GSM386411 4 0.3052 0.733 0.000 0.004 0.000 0.780 0.000 0.216
#> GSM386412 4 0.3887 0.555 0.000 0.000 0.000 0.632 0.008 0.360
#> GSM386413 4 0.3784 0.696 0.004 0.024 0.000 0.736 0.000 0.236
#> GSM386414 6 0.3841 0.178 0.000 0.000 0.000 0.380 0.004 0.616
#> GSM386415 4 0.3784 0.657 0.004 0.004 0.000 0.696 0.004 0.292
#> GSM386416 6 0.2968 0.652 0.040 0.000 0.008 0.040 0.036 0.876
#> GSM386417 6 0.4818 0.502 0.008 0.072 0.000 0.272 0.000 0.648
#> GSM386402 3 0.0000 0.922 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386403 3 0.0146 0.922 0.004 0.000 0.996 0.000 0.000 0.000
#> GSM386404 3 0.0405 0.919 0.008 0.000 0.988 0.000 0.004 0.000
#> GSM386405 3 0.0508 0.917 0.004 0.000 0.984 0.000 0.012 0.000
#> GSM386418 2 0.3194 0.746 0.076 0.848 0.000 0.004 0.064 0.008
#> GSM386419 2 0.0146 0.798 0.004 0.996 0.000 0.000 0.000 0.000
#> GSM386420 2 0.1296 0.791 0.044 0.948 0.000 0.000 0.004 0.004
#> GSM386421 2 0.2762 0.760 0.072 0.876 0.000 0.004 0.040 0.008
#> GSM386426 1 0.5075 0.617 0.672 0.216 0.000 0.008 0.092 0.012
#> GSM386427 5 0.1370 0.790 0.036 0.012 0.000 0.004 0.948 0.000
#> GSM386428 2 0.5319 0.367 0.320 0.600 0.000 0.020 0.044 0.016
#> GSM386429 4 0.0260 0.795 0.000 0.000 0.000 0.992 0.000 0.008
#> GSM386430 4 0.0363 0.801 0.000 0.000 0.000 0.988 0.000 0.012
#> GSM386431 4 0.1152 0.808 0.000 0.000 0.000 0.952 0.004 0.044
#> GSM386432 4 0.1327 0.807 0.000 0.000 0.000 0.936 0.000 0.064
#> GSM386433 4 0.3996 0.549 0.004 0.008 0.000 0.636 0.000 0.352
#> GSM386434 4 0.3560 0.697 0.008 0.004 0.000 0.732 0.000 0.256
#> GSM386422 3 0.0000 0.922 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386423 3 0.0870 0.912 0.012 0.000 0.972 0.000 0.012 0.004
#> GSM386424 3 0.0000 0.922 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386425 3 0.0000 0.922 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386385 1 0.5184 0.107 0.480 0.432 0.000 0.000 0.088 0.000
#> GSM386386 5 0.3703 0.580 0.036 0.176 0.000 0.004 0.780 0.004
#> GSM386387 2 0.0717 0.798 0.016 0.976 0.000 0.000 0.008 0.000
#> GSM386391 2 0.4333 0.710 0.064 0.792 0.000 0.052 0.076 0.016
#> GSM386392 1 0.4532 0.633 0.696 0.196 0.000 0.000 0.108 0.000
#> GSM386393 4 0.2082 0.760 0.004 0.008 0.000 0.916 0.052 0.020
#> GSM386394 4 0.3887 0.618 0.004 0.012 0.000 0.744 0.224 0.016
#> GSM386395 4 0.2051 0.759 0.004 0.012 0.000 0.920 0.044 0.020
#> GSM386396 4 0.1074 0.808 0.000 0.000 0.000 0.960 0.012 0.028
#> GSM386397 4 0.0909 0.804 0.000 0.000 0.000 0.968 0.020 0.012
#> GSM386388 3 0.0000 0.922 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386389 3 0.0870 0.912 0.012 0.000 0.972 0.000 0.012 0.004
#> GSM386390 3 0.0000 0.922 0.000 0.000 1.000 0.000 0.000 0.000
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
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 agent(p) dose(p) time(p) k
#> MAD:NMF 71 0.27490 0.7000 6.35e-14 2
#> MAD:NMF 72 0.85913 0.9235 5.95e-11 3
#> MAD:NMF 64 0.00547 0.0718 1.29e-16 4
#> MAD:NMF 63 0.01493 0.2033 1.21e-17 5
#> MAD:NMF 64 0.00251 0.0630 7.79e-18 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 51941 rows and 74 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'ATC' method.
#> Subgroups are detected by 'hclust' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 3.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
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.521 0.840 0.904 0.3366 0.725 0.725
#> 3 3 0.602 0.742 0.875 0.7414 0.668 0.542
#> 4 4 0.600 0.725 0.855 0.1363 0.908 0.766
#> 5 5 0.614 0.750 0.813 0.0538 0.914 0.752
#> 6 6 0.636 0.814 0.838 0.0872 0.894 0.655
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
#> GSM386435 2 0.0000 0.875 0.000 1.000
#> GSM386436 2 0.0000 0.875 0.000 1.000
#> GSM386437 2 0.1843 0.871 0.028 0.972
#> GSM386438 2 0.1843 0.871 0.028 0.972
#> GSM386439 2 0.8909 0.712 0.308 0.692
#> GSM386440 2 0.0000 0.875 0.000 1.000
#> GSM386441 2 0.0000 0.875 0.000 1.000
#> GSM386442 2 0.0000 0.875 0.000 1.000
#> GSM386447 2 0.8909 0.712 0.308 0.692
#> GSM386448 2 0.0000 0.875 0.000 1.000
#> GSM386449 2 0.0938 0.874 0.012 0.988
#> GSM386450 2 0.0000 0.875 0.000 1.000
#> GSM386451 2 0.0000 0.875 0.000 1.000
#> GSM386452 1 0.0000 0.960 1.000 0.000
#> GSM386453 2 0.0000 0.875 0.000 1.000
#> GSM386454 1 0.0000 0.960 1.000 0.000
#> GSM386455 2 0.0000 0.875 0.000 1.000
#> GSM386456 2 0.0000 0.875 0.000 1.000
#> GSM386457 2 0.0000 0.875 0.000 1.000
#> GSM386458 2 0.8909 0.712 0.308 0.692
#> GSM386443 1 0.0672 0.954 0.992 0.008
#> GSM386444 2 0.0000 0.875 0.000 1.000
#> GSM386445 2 0.0000 0.875 0.000 1.000
#> GSM386446 2 0.0000 0.875 0.000 1.000
#> GSM386398 2 0.8909 0.712 0.308 0.692
#> GSM386399 2 0.8909 0.712 0.308 0.692
#> GSM386400 2 0.8909 0.712 0.308 0.692
#> GSM386401 2 0.0000 0.875 0.000 1.000
#> GSM386406 2 0.3431 0.862 0.064 0.936
#> GSM386407 2 0.3431 0.862 0.064 0.936
#> GSM386408 2 0.1184 0.873 0.016 0.984
#> GSM386409 1 0.0000 0.960 1.000 0.000
#> GSM386410 1 0.0000 0.960 1.000 0.000
#> GSM386411 2 0.1633 0.872 0.024 0.976
#> GSM386412 2 0.8909 0.712 0.308 0.692
#> GSM386413 2 0.1633 0.872 0.024 0.976
#> GSM386414 2 0.8499 0.743 0.276 0.724
#> GSM386415 2 0.8499 0.743 0.276 0.724
#> GSM386416 2 0.8499 0.743 0.276 0.724
#> GSM386417 2 0.0000 0.875 0.000 1.000
#> GSM386402 2 0.0000 0.875 0.000 1.000
#> GSM386403 2 0.0000 0.875 0.000 1.000
#> GSM386404 2 0.0000 0.875 0.000 1.000
#> GSM386405 2 0.0000 0.875 0.000 1.000
#> GSM386418 2 0.4939 0.844 0.108 0.892
#> GSM386419 2 0.0000 0.875 0.000 1.000
#> GSM386420 2 0.0000 0.875 0.000 1.000
#> GSM386421 2 0.4939 0.844 0.108 0.892
#> GSM386426 1 0.6623 0.755 0.828 0.172
#> GSM386427 1 0.0000 0.960 1.000 0.000
#> GSM386428 2 0.3733 0.859 0.072 0.928
#> GSM386429 2 0.7950 0.770 0.240 0.760
#> GSM386430 2 0.7950 0.770 0.240 0.760
#> GSM386431 2 0.8661 0.731 0.288 0.712
#> GSM386432 2 0.4161 0.854 0.084 0.916
#> GSM386433 2 0.8499 0.743 0.276 0.724
#> GSM386434 2 0.8499 0.743 0.276 0.724
#> GSM386422 2 0.0000 0.875 0.000 1.000
#> GSM386423 1 0.0000 0.960 1.000 0.000
#> GSM386424 2 0.0000 0.875 0.000 1.000
#> GSM386425 2 0.0000 0.875 0.000 1.000
#> GSM386385 2 0.8909 0.712 0.308 0.692
#> GSM386386 1 0.0000 0.960 1.000 0.000
#> GSM386387 2 0.0000 0.875 0.000 1.000
#> GSM386391 2 0.7950 0.770 0.240 0.760
#> GSM386392 1 0.6623 0.755 0.828 0.172
#> GSM386393 2 0.8909 0.712 0.308 0.692
#> GSM386394 1 0.0000 0.960 1.000 0.000
#> GSM386395 2 0.8909 0.712 0.308 0.692
#> GSM386396 2 0.8909 0.712 0.308 0.692
#> GSM386397 2 0.8909 0.712 0.308 0.692
#> GSM386388 2 0.0000 0.875 0.000 1.000
#> GSM386389 1 0.0000 0.960 1.000 0.000
#> GSM386390 2 0.0000 0.875 0.000 1.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM386435 2 0.6280 0.405 0.000 0.540 0.460
#> GSM386436 2 0.6267 0.426 0.000 0.548 0.452
#> GSM386437 2 0.5591 0.679 0.000 0.696 0.304
#> GSM386438 2 0.5591 0.679 0.000 0.696 0.304
#> GSM386439 2 0.0000 0.784 0.000 1.000 0.000
#> GSM386440 3 0.0000 0.899 0.000 0.000 1.000
#> GSM386441 3 0.0000 0.899 0.000 0.000 1.000
#> GSM386442 2 0.6267 0.426 0.000 0.548 0.452
#> GSM386447 2 0.0000 0.784 0.000 1.000 0.000
#> GSM386448 3 0.0000 0.899 0.000 0.000 1.000
#> GSM386449 2 0.6225 0.473 0.000 0.568 0.432
#> GSM386450 3 0.0237 0.896 0.000 0.004 0.996
#> GSM386451 3 0.0237 0.896 0.000 0.004 0.996
#> GSM386452 1 0.0000 0.885 1.000 0.000 0.000
#> GSM386453 3 0.0237 0.896 0.000 0.004 0.996
#> GSM386454 1 0.3116 0.874 0.892 0.108 0.000
#> GSM386455 3 0.0000 0.899 0.000 0.000 1.000
#> GSM386456 3 0.0000 0.899 0.000 0.000 1.000
#> GSM386457 3 0.0000 0.899 0.000 0.000 1.000
#> GSM386458 2 0.0000 0.784 0.000 1.000 0.000
#> GSM386443 1 0.1529 0.888 0.960 0.040 0.000
#> GSM386444 3 0.0000 0.899 0.000 0.000 1.000
#> GSM386445 3 0.0000 0.899 0.000 0.000 1.000
#> GSM386446 3 0.0000 0.899 0.000 0.000 1.000
#> GSM386398 2 0.0000 0.784 0.000 1.000 0.000
#> GSM386399 2 0.0000 0.784 0.000 1.000 0.000
#> GSM386400 2 0.0000 0.784 0.000 1.000 0.000
#> GSM386401 3 0.0000 0.899 0.000 0.000 1.000
#> GSM386406 2 0.5291 0.715 0.000 0.732 0.268
#> GSM386407 2 0.5058 0.732 0.000 0.756 0.244
#> GSM386408 2 0.6140 0.529 0.000 0.596 0.404
#> GSM386409 1 0.3116 0.874 0.892 0.108 0.000
#> GSM386410 1 0.0000 0.885 1.000 0.000 0.000
#> GSM386411 2 0.5431 0.699 0.000 0.716 0.284
#> GSM386412 2 0.0000 0.784 0.000 1.000 0.000
#> GSM386413 2 0.5431 0.699 0.000 0.716 0.284
#> GSM386414 2 0.1289 0.797 0.000 0.968 0.032
#> GSM386415 2 0.1289 0.797 0.000 0.968 0.032
#> GSM386416 2 0.1289 0.797 0.000 0.968 0.032
#> GSM386417 3 0.0000 0.899 0.000 0.000 1.000
#> GSM386402 3 0.0000 0.899 0.000 0.000 1.000
#> GSM386403 3 0.6111 0.124 0.000 0.396 0.604
#> GSM386404 3 0.6111 0.124 0.000 0.396 0.604
#> GSM386405 3 0.0000 0.899 0.000 0.000 1.000
#> GSM386418 2 0.4555 0.757 0.000 0.800 0.200
#> GSM386419 2 0.5988 0.590 0.000 0.632 0.368
#> GSM386420 2 0.6215 0.481 0.000 0.572 0.428
#> GSM386421 2 0.4555 0.757 0.000 0.800 0.200
#> GSM386426 1 0.6225 0.506 0.568 0.432 0.000
#> GSM386427 1 0.0000 0.885 1.000 0.000 0.000
#> GSM386428 2 0.4974 0.738 0.000 0.764 0.236
#> GSM386429 2 0.2261 0.800 0.000 0.932 0.068
#> GSM386430 2 0.2261 0.800 0.000 0.932 0.068
#> GSM386431 2 0.0892 0.792 0.000 0.980 0.020
#> GSM386432 2 0.4842 0.745 0.000 0.776 0.224
#> GSM386433 2 0.1289 0.797 0.000 0.968 0.032
#> GSM386434 2 0.1289 0.797 0.000 0.968 0.032
#> GSM386422 3 0.0000 0.899 0.000 0.000 1.000
#> GSM386423 1 0.1163 0.889 0.972 0.028 0.000
#> GSM386424 3 0.0747 0.885 0.000 0.016 0.984
#> GSM386425 3 0.0000 0.899 0.000 0.000 1.000
#> GSM386385 2 0.0000 0.784 0.000 1.000 0.000
#> GSM386386 1 0.3116 0.874 0.892 0.108 0.000
#> GSM386387 2 0.6267 0.426 0.000 0.548 0.452
#> GSM386391 2 0.2261 0.800 0.000 0.932 0.068
#> GSM386392 1 0.6225 0.506 0.568 0.432 0.000
#> GSM386393 2 0.0000 0.784 0.000 1.000 0.000
#> GSM386394 1 0.0000 0.885 1.000 0.000 0.000
#> GSM386395 2 0.0000 0.784 0.000 1.000 0.000
#> GSM386396 2 0.0000 0.784 0.000 1.000 0.000
#> GSM386397 2 0.0000 0.784 0.000 1.000 0.000
#> GSM386388 3 0.6111 0.124 0.000 0.396 0.604
#> GSM386389 1 0.1163 0.889 0.972 0.028 0.000
#> GSM386390 3 0.6111 0.124 0.000 0.396 0.604
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM386435 4 0.4790 0.559 0.000 0.000 0.380 0.620
#> GSM386436 4 0.4761 0.575 0.000 0.000 0.372 0.628
#> GSM386437 4 0.3837 0.754 0.000 0.000 0.224 0.776
#> GSM386438 4 0.3837 0.754 0.000 0.000 0.224 0.776
#> GSM386439 2 0.4431 0.871 0.000 0.696 0.000 0.304
#> GSM386440 3 0.0000 0.884 0.000 0.000 1.000 0.000
#> GSM386441 3 0.0000 0.884 0.000 0.000 1.000 0.000
#> GSM386442 4 0.4761 0.575 0.000 0.000 0.372 0.628
#> GSM386447 2 0.4522 0.868 0.000 0.680 0.000 0.320
#> GSM386448 3 0.0000 0.884 0.000 0.000 1.000 0.000
#> GSM386449 4 0.4679 0.611 0.000 0.000 0.352 0.648
#> GSM386450 3 0.0188 0.881 0.000 0.000 0.996 0.004
#> GSM386451 3 0.0188 0.881 0.000 0.000 0.996 0.004
#> GSM386452 1 0.0000 0.877 1.000 0.000 0.000 0.000
#> GSM386453 3 0.0188 0.881 0.000 0.000 0.996 0.004
#> GSM386454 1 0.2469 0.843 0.892 0.108 0.000 0.000
#> GSM386455 3 0.0000 0.884 0.000 0.000 1.000 0.000
#> GSM386456 3 0.0000 0.884 0.000 0.000 1.000 0.000
#> GSM386457 3 0.0000 0.884 0.000 0.000 1.000 0.000
#> GSM386458 2 0.4500 0.868 0.000 0.684 0.000 0.316
#> GSM386443 1 0.1388 0.876 0.960 0.028 0.000 0.012
#> GSM386444 3 0.0000 0.884 0.000 0.000 1.000 0.000
#> GSM386445 3 0.0000 0.884 0.000 0.000 1.000 0.000
#> GSM386446 3 0.0000 0.884 0.000 0.000 1.000 0.000
#> GSM386398 2 0.0000 0.595 0.000 1.000 0.000 0.000
#> GSM386399 2 0.4500 0.868 0.000 0.684 0.000 0.316
#> GSM386400 2 0.0000 0.595 0.000 1.000 0.000 0.000
#> GSM386401 3 0.0000 0.884 0.000 0.000 1.000 0.000
#> GSM386406 4 0.3486 0.765 0.000 0.000 0.188 0.812
#> GSM386407 4 0.3219 0.768 0.000 0.000 0.164 0.836
#> GSM386408 4 0.4543 0.653 0.000 0.000 0.324 0.676
#> GSM386409 1 0.2469 0.831 0.892 0.000 0.000 0.108
#> GSM386410 1 0.0000 0.877 1.000 0.000 0.000 0.000
#> GSM386411 4 0.3649 0.761 0.000 0.000 0.204 0.796
#> GSM386412 2 0.4522 0.868 0.000 0.680 0.000 0.320
#> GSM386413 4 0.3649 0.761 0.000 0.000 0.204 0.796
#> GSM386414 4 0.2101 0.692 0.000 0.060 0.012 0.928
#> GSM386415 4 0.2101 0.692 0.000 0.060 0.012 0.928
#> GSM386416 4 0.2101 0.692 0.000 0.060 0.012 0.928
#> GSM386417 3 0.0000 0.884 0.000 0.000 1.000 0.000
#> GSM386402 3 0.0000 0.884 0.000 0.000 1.000 0.000
#> GSM386403 3 0.4992 -0.116 0.000 0.000 0.524 0.476
#> GSM386404 3 0.4992 -0.116 0.000 0.000 0.524 0.476
#> GSM386405 3 0.0000 0.884 0.000 0.000 1.000 0.000
#> GSM386418 4 0.2647 0.764 0.000 0.000 0.120 0.880
#> GSM386419 4 0.4331 0.696 0.000 0.000 0.288 0.712
#> GSM386420 4 0.4661 0.617 0.000 0.000 0.348 0.652
#> GSM386421 4 0.2647 0.764 0.000 0.000 0.120 0.880
#> GSM386426 1 0.7002 0.431 0.568 0.268 0.000 0.164
#> GSM386427 1 0.0000 0.877 1.000 0.000 0.000 0.000
#> GSM386428 4 0.3123 0.768 0.000 0.000 0.156 0.844
#> GSM386429 4 0.3004 0.721 0.000 0.060 0.048 0.892
#> GSM386430 4 0.3004 0.721 0.000 0.060 0.048 0.892
#> GSM386431 4 0.1637 0.675 0.000 0.060 0.000 0.940
#> GSM386432 4 0.2973 0.768 0.000 0.000 0.144 0.856
#> GSM386433 4 0.2101 0.692 0.000 0.060 0.012 0.928
#> GSM386434 4 0.2101 0.692 0.000 0.060 0.012 0.928
#> GSM386422 3 0.0000 0.884 0.000 0.000 1.000 0.000
#> GSM386423 1 0.1059 0.878 0.972 0.016 0.000 0.012
#> GSM386424 3 0.0592 0.871 0.000 0.000 0.984 0.016
#> GSM386425 3 0.0000 0.884 0.000 0.000 1.000 0.000
#> GSM386385 2 0.4431 0.871 0.000 0.696 0.000 0.304
#> GSM386386 1 0.2469 0.831 0.892 0.000 0.000 0.108
#> GSM386387 4 0.4761 0.575 0.000 0.000 0.372 0.628
#> GSM386391 4 0.3004 0.721 0.000 0.060 0.048 0.892
#> GSM386392 1 0.7002 0.431 0.568 0.268 0.000 0.164
#> GSM386393 4 0.2011 0.653 0.000 0.080 0.000 0.920
#> GSM386394 1 0.0000 0.877 1.000 0.000 0.000 0.000
#> GSM386395 4 0.2011 0.653 0.000 0.080 0.000 0.920
#> GSM386396 4 0.2011 0.653 0.000 0.080 0.000 0.920
#> GSM386397 4 0.2011 0.653 0.000 0.080 0.000 0.920
#> GSM386388 3 0.4992 -0.116 0.000 0.000 0.524 0.476
#> GSM386389 1 0.1059 0.878 0.972 0.016 0.000 0.012
#> GSM386390 3 0.4992 -0.116 0.000 0.000 0.524 0.476
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM386435 4 0.3989 0.648 0.004 0.260 0.000 0.728 0.008
#> GSM386436 4 0.3937 0.654 0.004 0.252 0.000 0.736 0.008
#> GSM386437 4 0.2517 0.719 0.004 0.104 0.000 0.884 0.008
#> GSM386438 4 0.2517 0.719 0.004 0.104 0.000 0.884 0.008
#> GSM386439 1 0.3274 0.846 0.780 0.000 0.000 0.220 0.000
#> GSM386440 2 0.0162 0.996 0.000 0.996 0.000 0.004 0.000
#> GSM386441 2 0.0162 0.996 0.000 0.996 0.000 0.004 0.000
#> GSM386442 4 0.3937 0.654 0.004 0.252 0.000 0.736 0.008
#> GSM386447 1 0.3395 0.842 0.764 0.000 0.000 0.236 0.000
#> GSM386448 2 0.0162 0.996 0.000 0.996 0.000 0.004 0.000
#> GSM386449 4 0.3797 0.667 0.004 0.232 0.000 0.756 0.008
#> GSM386450 2 0.0324 0.993 0.004 0.992 0.000 0.004 0.000
#> GSM386451 2 0.0324 0.993 0.004 0.992 0.000 0.004 0.000
#> GSM386452 5 0.3274 1.000 0.000 0.000 0.220 0.000 0.780
#> GSM386453 2 0.0324 0.993 0.004 0.992 0.000 0.004 0.000
#> GSM386454 3 0.4835 0.383 0.028 0.000 0.592 0.000 0.380
#> GSM386455 2 0.0162 0.996 0.000 0.996 0.000 0.004 0.000
#> GSM386456 2 0.0000 0.995 0.000 1.000 0.000 0.000 0.000
#> GSM386457 2 0.0162 0.996 0.000 0.996 0.000 0.004 0.000
#> GSM386458 1 0.3366 0.843 0.768 0.000 0.000 0.232 0.000
#> GSM386443 3 0.0404 0.551 0.012 0.000 0.988 0.000 0.000
#> GSM386444 2 0.0000 0.995 0.000 1.000 0.000 0.000 0.000
#> GSM386445 2 0.0000 0.995 0.000 1.000 0.000 0.000 0.000
#> GSM386446 2 0.0000 0.995 0.000 1.000 0.000 0.000 0.000
#> GSM386398 1 0.1792 0.514 0.916 0.000 0.000 0.000 0.084
#> GSM386399 1 0.3366 0.843 0.768 0.000 0.000 0.232 0.000
#> GSM386400 1 0.1792 0.514 0.916 0.000 0.000 0.000 0.084
#> GSM386401 2 0.0162 0.996 0.000 0.996 0.000 0.004 0.000
#> GSM386406 4 0.1608 0.725 0.000 0.072 0.000 0.928 0.000
#> GSM386407 4 0.1644 0.723 0.004 0.048 0.000 0.940 0.008
#> GSM386408 4 0.3578 0.682 0.004 0.204 0.000 0.784 0.008
#> GSM386409 3 0.6050 0.493 0.080 0.000 0.592 0.028 0.300
#> GSM386410 5 0.3274 1.000 0.000 0.000 0.220 0.000 0.780
#> GSM386411 4 0.2237 0.723 0.004 0.084 0.000 0.904 0.008
#> GSM386412 1 0.3395 0.842 0.764 0.000 0.000 0.236 0.000
#> GSM386413 4 0.2237 0.723 0.004 0.084 0.000 0.904 0.008
#> GSM386414 4 0.4303 0.643 0.068 0.000 0.020 0.796 0.116
#> GSM386415 4 0.4303 0.643 0.068 0.000 0.020 0.796 0.116
#> GSM386416 4 0.4303 0.643 0.068 0.000 0.020 0.796 0.116
#> GSM386417 2 0.0162 0.996 0.000 0.996 0.000 0.004 0.000
#> GSM386402 2 0.0000 0.995 0.000 1.000 0.000 0.000 0.000
#> GSM386403 4 0.4455 0.434 0.000 0.404 0.000 0.588 0.008
#> GSM386404 4 0.4455 0.434 0.000 0.404 0.000 0.588 0.008
#> GSM386405 2 0.0000 0.995 0.000 1.000 0.000 0.000 0.000
#> GSM386418 4 0.0162 0.710 0.000 0.004 0.000 0.996 0.000
#> GSM386419 4 0.3250 0.699 0.004 0.168 0.000 0.820 0.008
#> GSM386420 4 0.3768 0.670 0.004 0.228 0.000 0.760 0.008
#> GSM386421 4 0.0162 0.710 0.000 0.004 0.000 0.996 0.000
#> GSM386426 3 0.7489 0.478 0.268 0.000 0.448 0.052 0.232
#> GSM386427 5 0.3274 1.000 0.000 0.000 0.220 0.000 0.780
#> GSM386428 4 0.1043 0.721 0.000 0.040 0.000 0.960 0.000
#> GSM386429 4 0.3674 0.665 0.032 0.000 0.020 0.832 0.116
#> GSM386430 4 0.3674 0.665 0.032 0.000 0.020 0.832 0.116
#> GSM386431 4 0.4480 0.631 0.080 0.000 0.020 0.784 0.116
#> GSM386432 4 0.0794 0.719 0.000 0.028 0.000 0.972 0.000
#> GSM386433 4 0.4303 0.643 0.068 0.000 0.020 0.796 0.116
#> GSM386434 4 0.4303 0.643 0.068 0.000 0.020 0.796 0.116
#> GSM386422 2 0.0000 0.995 0.000 1.000 0.000 0.000 0.000
#> GSM386423 3 0.0000 0.550 0.000 0.000 1.000 0.000 0.000
#> GSM386424 2 0.0510 0.981 0.000 0.984 0.000 0.016 0.000
#> GSM386425 2 0.0000 0.995 0.000 1.000 0.000 0.000 0.000
#> GSM386385 1 0.3274 0.846 0.780 0.000 0.000 0.220 0.000
#> GSM386386 3 0.6050 0.493 0.080 0.000 0.592 0.028 0.300
#> GSM386387 4 0.3937 0.654 0.004 0.252 0.000 0.736 0.008
#> GSM386391 4 0.3674 0.665 0.032 0.000 0.020 0.832 0.116
#> GSM386392 3 0.7489 0.478 0.268 0.000 0.448 0.052 0.232
#> GSM386393 4 0.4790 0.613 0.080 0.000 0.028 0.764 0.128
#> GSM386394 5 0.3274 1.000 0.000 0.000 0.220 0.000 0.780
#> GSM386395 4 0.4790 0.613 0.080 0.000 0.028 0.764 0.128
#> GSM386396 4 0.4790 0.613 0.080 0.000 0.028 0.764 0.128
#> GSM386397 4 0.4790 0.613 0.080 0.000 0.028 0.764 0.128
#> GSM386388 4 0.4455 0.434 0.000 0.404 0.000 0.588 0.008
#> GSM386389 3 0.0000 0.550 0.000 0.000 1.000 0.000 0.000
#> GSM386390 4 0.4455 0.434 0.000 0.404 0.000 0.588 0.008
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM386435 2 0.2697 0.762 0.000 0.812 0.188 0.000 0.000 0.000
#> GSM386436 2 0.2631 0.769 0.000 0.820 0.180 0.000 0.000 0.000
#> GSM386437 2 0.0790 0.777 0.000 0.968 0.032 0.000 0.000 0.000
#> GSM386438 2 0.0790 0.777 0.000 0.968 0.032 0.000 0.000 0.000
#> GSM386439 1 0.4449 0.860 0.696 0.216 0.000 0.088 0.000 0.000
#> GSM386440 3 0.0458 0.989 0.000 0.016 0.984 0.000 0.000 0.000
#> GSM386441 3 0.0458 0.989 0.000 0.016 0.984 0.000 0.000 0.000
#> GSM386442 2 0.2631 0.769 0.000 0.820 0.180 0.000 0.000 0.000
#> GSM386447 1 0.4590 0.857 0.680 0.224 0.000 0.096 0.000 0.000
#> GSM386448 3 0.0458 0.989 0.000 0.016 0.984 0.000 0.000 0.000
#> GSM386449 2 0.2454 0.779 0.000 0.840 0.160 0.000 0.000 0.000
#> GSM386450 3 0.0632 0.984 0.000 0.024 0.976 0.000 0.000 0.000
#> GSM386451 3 0.0632 0.984 0.000 0.024 0.976 0.000 0.000 0.000
#> GSM386452 6 0.0000 1.000 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM386453 3 0.0632 0.984 0.000 0.024 0.976 0.000 0.000 0.000
#> GSM386454 5 0.5173 0.483 0.108 0.000 0.000 0.000 0.568 0.324
#> GSM386455 3 0.0458 0.989 0.000 0.016 0.984 0.000 0.000 0.000
#> GSM386456 3 0.0146 0.987 0.000 0.004 0.996 0.000 0.000 0.000
#> GSM386457 3 0.0458 0.989 0.000 0.016 0.984 0.000 0.000 0.000
#> GSM386458 1 0.4525 0.858 0.684 0.228 0.000 0.088 0.000 0.000
#> GSM386443 5 0.0363 0.611 0.012 0.000 0.000 0.000 0.988 0.000
#> GSM386444 3 0.0000 0.987 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386445 3 0.0000 0.987 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386446 3 0.0000 0.987 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386398 1 0.0000 0.571 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM386399 1 0.4525 0.858 0.684 0.228 0.000 0.088 0.000 0.000
#> GSM386400 1 0.0000 0.571 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM386401 3 0.0458 0.989 0.000 0.016 0.984 0.000 0.000 0.000
#> GSM386406 2 0.1713 0.752 0.000 0.928 0.028 0.044 0.000 0.000
#> GSM386407 2 0.0865 0.730 0.000 0.964 0.000 0.036 0.000 0.000
#> GSM386408 2 0.2178 0.786 0.000 0.868 0.132 0.000 0.000 0.000
#> GSM386409 5 0.5449 0.565 0.000 0.020 0.000 0.088 0.572 0.320
#> GSM386410 6 0.0000 1.000 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM386411 2 0.0363 0.765 0.000 0.988 0.012 0.000 0.000 0.000
#> GSM386412 1 0.4590 0.857 0.680 0.224 0.000 0.096 0.000 0.000
#> GSM386413 2 0.0363 0.765 0.000 0.988 0.012 0.000 0.000 0.000
#> GSM386414 4 0.3647 0.871 0.000 0.360 0.000 0.640 0.000 0.000
#> GSM386415 4 0.3607 0.876 0.000 0.348 0.000 0.652 0.000 0.000
#> GSM386416 4 0.3647 0.871 0.000 0.360 0.000 0.640 0.000 0.000
#> GSM386417 3 0.0458 0.989 0.000 0.016 0.984 0.000 0.000 0.000
#> GSM386402 3 0.0000 0.987 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386403 2 0.4827 0.636 0.000 0.652 0.112 0.236 0.000 0.000
#> GSM386404 2 0.4827 0.636 0.000 0.652 0.112 0.236 0.000 0.000
#> GSM386405 3 0.0000 0.987 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386418 2 0.1814 0.647 0.000 0.900 0.000 0.100 0.000 0.000
#> GSM386419 2 0.1765 0.789 0.000 0.904 0.096 0.000 0.000 0.000
#> GSM386420 2 0.2416 0.780 0.000 0.844 0.156 0.000 0.000 0.000
#> GSM386421 2 0.1814 0.647 0.000 0.900 0.000 0.100 0.000 0.000
#> GSM386426 5 0.7747 0.504 0.188 0.024 0.000 0.220 0.416 0.152
#> GSM386427 6 0.0000 1.000 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM386428 2 0.1141 0.714 0.000 0.948 0.000 0.052 0.000 0.000
#> GSM386429 4 0.3857 0.732 0.000 0.468 0.000 0.532 0.000 0.000
#> GSM386430 4 0.3857 0.732 0.000 0.468 0.000 0.532 0.000 0.000
#> GSM386431 4 0.3351 0.856 0.000 0.288 0.000 0.712 0.000 0.000
#> GSM386432 2 0.1387 0.696 0.000 0.932 0.000 0.068 0.000 0.000
#> GSM386433 4 0.3607 0.876 0.000 0.348 0.000 0.652 0.000 0.000
#> GSM386434 4 0.3607 0.876 0.000 0.348 0.000 0.652 0.000 0.000
#> GSM386422 3 0.0000 0.987 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386423 5 0.0000 0.611 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM386424 3 0.0458 0.978 0.000 0.016 0.984 0.000 0.000 0.000
#> GSM386425 3 0.0000 0.987 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386385 1 0.4449 0.860 0.696 0.216 0.000 0.088 0.000 0.000
#> GSM386386 5 0.5449 0.565 0.000 0.020 0.000 0.088 0.572 0.320
#> GSM386387 2 0.2631 0.769 0.000 0.820 0.180 0.000 0.000 0.000
#> GSM386391 4 0.3857 0.732 0.000 0.468 0.000 0.532 0.000 0.000
#> GSM386392 5 0.7747 0.504 0.188 0.024 0.000 0.220 0.416 0.152
#> GSM386393 4 0.3050 0.823 0.000 0.236 0.000 0.764 0.000 0.000
#> GSM386394 6 0.0000 1.000 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM386395 4 0.3050 0.823 0.000 0.236 0.000 0.764 0.000 0.000
#> GSM386396 4 0.3050 0.823 0.000 0.236 0.000 0.764 0.000 0.000
#> GSM386397 4 0.3050 0.823 0.000 0.236 0.000 0.764 0.000 0.000
#> GSM386388 2 0.4827 0.636 0.000 0.652 0.112 0.236 0.000 0.000
#> GSM386389 5 0.0000 0.611 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM386390 2 0.4827 0.636 0.000 0.652 0.112 0.236 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 agent(p) dose(p) time(p) k
#> ATC:hclust 74 0.633477 0.41293 1.86e-01 2
#> ATC:hclust 64 0.000947 0.00823 1.04e-02 3
#> ATC:hclust 68 0.001546 0.03860 4.01e-03 4
#> ATC:hclust 65 0.006694 0.11880 2.32e-04 5
#> ATC:hclust 73 0.000584 0.03043 2.51e-05 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 51941 rows and 74 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 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.728 0.959 0.978 0.4212 0.576 0.576
#> 3 3 0.518 0.682 0.857 0.4639 0.628 0.433
#> 4 4 0.635 0.769 0.847 0.1617 0.793 0.512
#> 5 5 0.846 0.862 0.900 0.0806 0.881 0.614
#> 6 6 0.806 0.788 0.847 0.0430 0.985 0.933
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 5
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
#> GSM386435 2 0.000 0.982 0.000 1.000
#> GSM386436 2 0.000 0.982 0.000 1.000
#> GSM386437 2 0.000 0.982 0.000 1.000
#> GSM386438 2 0.000 0.982 0.000 1.000
#> GSM386439 2 0.482 0.893 0.104 0.896
#> GSM386440 2 0.000 0.982 0.000 1.000
#> GSM386441 2 0.000 0.982 0.000 1.000
#> GSM386442 2 0.000 0.982 0.000 1.000
#> GSM386447 2 0.574 0.856 0.136 0.864
#> GSM386448 2 0.000 0.982 0.000 1.000
#> GSM386449 2 0.000 0.982 0.000 1.000
#> GSM386450 2 0.000 0.982 0.000 1.000
#> GSM386451 2 0.000 0.982 0.000 1.000
#> GSM386452 1 0.000 0.961 1.000 0.000
#> GSM386453 2 0.000 0.982 0.000 1.000
#> GSM386454 1 0.000 0.961 1.000 0.000
#> GSM386455 2 0.000 0.982 0.000 1.000
#> GSM386456 2 0.000 0.982 0.000 1.000
#> GSM386457 2 0.000 0.982 0.000 1.000
#> GSM386458 2 0.000 0.982 0.000 1.000
#> GSM386443 1 0.000 0.961 1.000 0.000
#> GSM386444 2 0.000 0.982 0.000 1.000
#> GSM386445 2 0.000 0.982 0.000 1.000
#> GSM386446 2 0.000 0.982 0.000 1.000
#> GSM386398 1 0.000 0.961 1.000 0.000
#> GSM386399 1 0.000 0.961 1.000 0.000
#> GSM386400 1 0.000 0.961 1.000 0.000
#> GSM386401 2 0.000 0.982 0.000 1.000
#> GSM386406 2 0.000 0.982 0.000 1.000
#> GSM386407 2 0.000 0.982 0.000 1.000
#> GSM386408 2 0.000 0.982 0.000 1.000
#> GSM386409 1 0.000 0.961 1.000 0.000
#> GSM386410 1 0.000 0.961 1.000 0.000
#> GSM386411 2 0.000 0.982 0.000 1.000
#> GSM386412 1 0.541 0.886 0.876 0.124
#> GSM386413 2 0.000 0.982 0.000 1.000
#> GSM386414 2 0.482 0.893 0.104 0.896
#> GSM386415 2 0.482 0.893 0.104 0.896
#> GSM386416 1 0.541 0.886 0.876 0.124
#> GSM386417 2 0.000 0.982 0.000 1.000
#> GSM386402 2 0.000 0.982 0.000 1.000
#> GSM386403 2 0.000 0.982 0.000 1.000
#> GSM386404 2 0.000 0.982 0.000 1.000
#> GSM386405 2 0.000 0.982 0.000 1.000
#> GSM386418 2 0.482 0.893 0.104 0.896
#> GSM386419 2 0.000 0.982 0.000 1.000
#> GSM386420 2 0.000 0.982 0.000 1.000
#> GSM386421 2 0.000 0.982 0.000 1.000
#> GSM386426 1 0.000 0.961 1.000 0.000
#> GSM386427 1 0.000 0.961 1.000 0.000
#> GSM386428 2 0.000 0.982 0.000 1.000
#> GSM386429 2 0.482 0.893 0.104 0.896
#> GSM386430 2 0.443 0.904 0.092 0.908
#> GSM386431 1 0.541 0.886 0.876 0.124
#> GSM386432 2 0.000 0.982 0.000 1.000
#> GSM386433 2 0.000 0.982 0.000 1.000
#> GSM386434 2 0.000 0.982 0.000 1.000
#> GSM386422 2 0.000 0.982 0.000 1.000
#> GSM386423 1 0.000 0.961 1.000 0.000
#> GSM386424 2 0.000 0.982 0.000 1.000
#> GSM386425 2 0.000 0.982 0.000 1.000
#> GSM386385 2 0.000 0.982 0.000 1.000
#> GSM386386 1 0.000 0.961 1.000 0.000
#> GSM386387 2 0.000 0.982 0.000 1.000
#> GSM386391 2 0.541 0.870 0.124 0.876
#> GSM386392 1 0.000 0.961 1.000 0.000
#> GSM386393 1 0.000 0.961 1.000 0.000
#> GSM386394 1 0.000 0.961 1.000 0.000
#> GSM386395 1 0.563 0.879 0.868 0.132
#> GSM386396 1 0.563 0.879 0.868 0.132
#> GSM386397 1 0.563 0.879 0.868 0.132
#> GSM386388 2 0.000 0.982 0.000 1.000
#> GSM386389 1 0.000 0.961 1.000 0.000
#> GSM386390 2 0.000 0.982 0.000 1.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM386435 3 0.5497 0.762 0.000 0.292 0.708
#> GSM386436 2 0.6302 -0.347 0.000 0.520 0.480
#> GSM386437 2 0.0000 0.818 0.000 1.000 0.000
#> GSM386438 2 0.6302 -0.347 0.000 0.520 0.480
#> GSM386439 2 0.0000 0.818 0.000 1.000 0.000
#> GSM386440 3 0.5497 0.762 0.000 0.292 0.708
#> GSM386441 3 0.5497 0.762 0.000 0.292 0.708
#> GSM386442 3 0.5810 0.707 0.000 0.336 0.664
#> GSM386447 2 0.0000 0.818 0.000 1.000 0.000
#> GSM386448 3 0.5497 0.762 0.000 0.292 0.708
#> GSM386449 3 0.5810 0.707 0.000 0.336 0.664
#> GSM386450 3 0.5497 0.762 0.000 0.292 0.708
#> GSM386451 3 0.5497 0.762 0.000 0.292 0.708
#> GSM386452 1 0.0000 0.924 1.000 0.000 0.000
#> GSM386453 3 0.5497 0.762 0.000 0.292 0.708
#> GSM386454 1 0.0000 0.924 1.000 0.000 0.000
#> GSM386455 3 0.4504 0.766 0.000 0.196 0.804
#> GSM386456 3 0.3340 0.761 0.000 0.120 0.880
#> GSM386457 3 0.5497 0.762 0.000 0.292 0.708
#> GSM386458 2 0.0424 0.812 0.000 0.992 0.008
#> GSM386443 1 0.0592 0.918 0.988 0.012 0.000
#> GSM386444 3 0.0000 0.739 0.000 0.000 1.000
#> GSM386445 3 0.0000 0.739 0.000 0.000 1.000
#> GSM386446 3 0.0000 0.739 0.000 0.000 1.000
#> GSM386398 1 0.0592 0.918 0.988 0.012 0.000
#> GSM386399 2 0.6111 0.263 0.396 0.604 0.000
#> GSM386400 2 0.6309 -0.101 0.500 0.500 0.000
#> GSM386401 3 0.5497 0.762 0.000 0.292 0.708
#> GSM386406 2 0.0000 0.818 0.000 1.000 0.000
#> GSM386407 2 0.0000 0.818 0.000 1.000 0.000
#> GSM386408 2 0.6225 -0.191 0.000 0.568 0.432
#> GSM386409 1 0.0000 0.924 1.000 0.000 0.000
#> GSM386410 1 0.0000 0.924 1.000 0.000 0.000
#> GSM386411 2 0.6095 -0.069 0.000 0.608 0.392
#> GSM386412 2 0.4121 0.694 0.168 0.832 0.000
#> GSM386413 2 0.1031 0.796 0.000 0.976 0.024
#> GSM386414 2 0.0000 0.818 0.000 1.000 0.000
#> GSM386415 2 0.0000 0.818 0.000 1.000 0.000
#> GSM386416 2 0.4121 0.694 0.168 0.832 0.000
#> GSM386417 3 0.5497 0.762 0.000 0.292 0.708
#> GSM386402 3 0.0000 0.739 0.000 0.000 1.000
#> GSM386403 3 0.5560 0.439 0.000 0.300 0.700
#> GSM386404 3 0.5882 0.360 0.000 0.348 0.652
#> GSM386405 3 0.0000 0.739 0.000 0.000 1.000
#> GSM386418 2 0.0000 0.818 0.000 1.000 0.000
#> GSM386419 3 0.6291 0.454 0.000 0.468 0.532
#> GSM386420 2 0.4654 0.512 0.000 0.792 0.208
#> GSM386421 2 0.0000 0.818 0.000 1.000 0.000
#> GSM386426 1 0.6079 0.382 0.612 0.388 0.000
#> GSM386427 1 0.0000 0.924 1.000 0.000 0.000
#> GSM386428 2 0.0000 0.818 0.000 1.000 0.000
#> GSM386429 2 0.0000 0.818 0.000 1.000 0.000
#> GSM386430 2 0.0000 0.818 0.000 1.000 0.000
#> GSM386431 2 0.4121 0.694 0.168 0.832 0.000
#> GSM386432 2 0.0000 0.818 0.000 1.000 0.000
#> GSM386433 2 0.0000 0.818 0.000 1.000 0.000
#> GSM386434 2 0.0000 0.818 0.000 1.000 0.000
#> GSM386422 3 0.0000 0.739 0.000 0.000 1.000
#> GSM386423 1 0.0000 0.924 1.000 0.000 0.000
#> GSM386424 3 0.0000 0.739 0.000 0.000 1.000
#> GSM386425 3 0.0000 0.739 0.000 0.000 1.000
#> GSM386385 2 0.0000 0.818 0.000 1.000 0.000
#> GSM386386 1 0.0000 0.924 1.000 0.000 0.000
#> GSM386387 3 0.5497 0.762 0.000 0.292 0.708
#> GSM386391 2 0.0000 0.818 0.000 1.000 0.000
#> GSM386392 1 0.6079 0.382 0.612 0.388 0.000
#> GSM386393 2 0.5529 0.466 0.296 0.704 0.000
#> GSM386394 1 0.0000 0.924 1.000 0.000 0.000
#> GSM386395 2 0.3340 0.741 0.120 0.880 0.000
#> GSM386396 2 0.4121 0.694 0.168 0.832 0.000
#> GSM386397 2 0.4121 0.694 0.168 0.832 0.000
#> GSM386388 3 0.0000 0.739 0.000 0.000 1.000
#> GSM386389 1 0.0000 0.924 1.000 0.000 0.000
#> GSM386390 3 0.5560 0.439 0.000 0.300 0.700
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM386435 2 0.0707 0.885 0.000 0.980 0.000 0.020
#> GSM386436 2 0.2530 0.839 0.000 0.888 0.000 0.112
#> GSM386437 4 0.4746 0.442 0.000 0.368 0.000 0.632
#> GSM386438 2 0.2530 0.839 0.000 0.888 0.000 0.112
#> GSM386439 4 0.7525 0.442 0.000 0.276 0.232 0.492
#> GSM386440 2 0.0592 0.885 0.000 0.984 0.016 0.000
#> GSM386441 2 0.0592 0.885 0.000 0.984 0.016 0.000
#> GSM386442 2 0.1118 0.882 0.000 0.964 0.000 0.036
#> GSM386447 4 0.6229 0.616 0.000 0.116 0.228 0.656
#> GSM386448 2 0.0592 0.885 0.000 0.984 0.016 0.000
#> GSM386449 2 0.1118 0.882 0.000 0.964 0.000 0.036
#> GSM386450 2 0.0188 0.888 0.000 0.996 0.004 0.000
#> GSM386451 2 0.0592 0.885 0.000 0.984 0.016 0.000
#> GSM386452 1 0.0000 0.913 1.000 0.000 0.000 0.000
#> GSM386453 2 0.0188 0.888 0.000 0.996 0.004 0.000
#> GSM386454 1 0.0000 0.913 1.000 0.000 0.000 0.000
#> GSM386455 2 0.0592 0.885 0.000 0.984 0.016 0.000
#> GSM386456 2 0.1118 0.860 0.000 0.964 0.036 0.000
#> GSM386457 2 0.0592 0.885 0.000 0.984 0.016 0.000
#> GSM386458 2 0.6969 0.416 0.000 0.584 0.224 0.192
#> GSM386443 1 0.5309 0.776 0.700 0.000 0.256 0.044
#> GSM386444 3 0.4164 0.890 0.000 0.264 0.736 0.000
#> GSM386445 3 0.4164 0.890 0.000 0.264 0.736 0.000
#> GSM386446 3 0.4164 0.890 0.000 0.264 0.736 0.000
#> GSM386398 1 0.5227 0.777 0.704 0.000 0.256 0.040
#> GSM386399 4 0.8759 0.194 0.276 0.048 0.256 0.420
#> GSM386400 4 0.8759 0.194 0.276 0.048 0.256 0.420
#> GSM386401 2 0.0592 0.885 0.000 0.984 0.016 0.000
#> GSM386406 4 0.4500 0.546 0.000 0.316 0.000 0.684
#> GSM386407 4 0.1302 0.802 0.000 0.044 0.000 0.956
#> GSM386408 2 0.2345 0.848 0.000 0.900 0.000 0.100
#> GSM386409 1 0.4934 0.787 0.720 0.000 0.252 0.028
#> GSM386410 1 0.0000 0.913 1.000 0.000 0.000 0.000
#> GSM386411 2 0.2469 0.842 0.000 0.892 0.000 0.108
#> GSM386412 4 0.2466 0.749 0.000 0.004 0.096 0.900
#> GSM386413 2 0.4761 0.405 0.000 0.628 0.000 0.372
#> GSM386414 4 0.1022 0.804 0.000 0.032 0.000 0.968
#> GSM386415 4 0.1209 0.804 0.000 0.032 0.004 0.964
#> GSM386416 4 0.4122 0.646 0.000 0.004 0.236 0.760
#> GSM386417 2 0.0469 0.886 0.000 0.988 0.012 0.000
#> GSM386402 3 0.4164 0.890 0.000 0.264 0.736 0.000
#> GSM386403 3 0.4838 0.658 0.000 0.024 0.724 0.252
#> GSM386404 3 0.4934 0.654 0.000 0.028 0.720 0.252
#> GSM386405 3 0.4164 0.890 0.000 0.264 0.736 0.000
#> GSM386418 4 0.1118 0.804 0.000 0.036 0.000 0.964
#> GSM386419 2 0.2345 0.848 0.000 0.900 0.000 0.100
#> GSM386420 2 0.2973 0.801 0.000 0.856 0.000 0.144
#> GSM386421 4 0.1211 0.803 0.000 0.040 0.000 0.960
#> GSM386426 4 0.7726 0.179 0.296 0.000 0.260 0.444
#> GSM386427 1 0.0000 0.913 1.000 0.000 0.000 0.000
#> GSM386428 4 0.4134 0.626 0.000 0.260 0.000 0.740
#> GSM386429 4 0.1209 0.804 0.000 0.032 0.004 0.964
#> GSM386430 4 0.1209 0.804 0.000 0.032 0.004 0.964
#> GSM386431 4 0.1724 0.802 0.000 0.032 0.020 0.948
#> GSM386432 4 0.1211 0.803 0.000 0.040 0.000 0.960
#> GSM386433 4 0.1211 0.803 0.000 0.040 0.000 0.960
#> GSM386434 4 0.1211 0.803 0.000 0.040 0.000 0.960
#> GSM386422 3 0.4164 0.890 0.000 0.264 0.736 0.000
#> GSM386423 1 0.1109 0.911 0.968 0.000 0.028 0.004
#> GSM386424 3 0.4164 0.890 0.000 0.264 0.736 0.000
#> GSM386425 3 0.4164 0.890 0.000 0.264 0.736 0.000
#> GSM386385 4 0.6720 0.509 0.000 0.300 0.120 0.580
#> GSM386386 1 0.0817 0.911 0.976 0.000 0.024 0.000
#> GSM386387 2 0.0188 0.888 0.000 0.996 0.004 0.000
#> GSM386391 4 0.1209 0.804 0.000 0.032 0.004 0.964
#> GSM386392 4 0.7726 0.179 0.296 0.000 0.260 0.444
#> GSM386393 4 0.2261 0.792 0.008 0.024 0.036 0.932
#> GSM386394 1 0.0188 0.912 0.996 0.000 0.004 0.000
#> GSM386395 4 0.1724 0.802 0.000 0.032 0.020 0.948
#> GSM386396 4 0.1833 0.801 0.000 0.032 0.024 0.944
#> GSM386397 4 0.1833 0.801 0.000 0.032 0.024 0.944
#> GSM386388 3 0.4164 0.890 0.000 0.264 0.736 0.000
#> GSM386389 1 0.0895 0.912 0.976 0.000 0.020 0.004
#> GSM386390 3 0.4838 0.658 0.000 0.024 0.724 0.252
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM386435 2 0.1484 0.894 0.048 0.944 0.000 0.008 0.000
#> GSM386436 2 0.2079 0.885 0.064 0.916 0.000 0.020 0.000
#> GSM386437 2 0.5213 0.506 0.064 0.616 0.000 0.320 0.000
#> GSM386438 2 0.2079 0.885 0.064 0.916 0.000 0.020 0.000
#> GSM386439 1 0.3616 0.816 0.804 0.032 0.000 0.164 0.000
#> GSM386440 2 0.0566 0.896 0.012 0.984 0.004 0.000 0.000
#> GSM386441 2 0.0566 0.896 0.012 0.984 0.004 0.000 0.000
#> GSM386442 2 0.1597 0.893 0.048 0.940 0.000 0.012 0.000
#> GSM386447 1 0.3612 0.819 0.800 0.028 0.000 0.172 0.000
#> GSM386448 2 0.0451 0.897 0.008 0.988 0.004 0.000 0.000
#> GSM386449 2 0.1484 0.894 0.048 0.944 0.000 0.008 0.000
#> GSM386450 2 0.0162 0.898 0.004 0.996 0.000 0.000 0.000
#> GSM386451 2 0.0671 0.895 0.016 0.980 0.004 0.000 0.000
#> GSM386452 5 0.0510 0.983 0.000 0.000 0.016 0.000 0.984
#> GSM386453 2 0.0290 0.898 0.008 0.992 0.000 0.000 0.000
#> GSM386454 5 0.0000 0.981 0.000 0.000 0.000 0.000 1.000
#> GSM386455 2 0.1965 0.861 0.052 0.924 0.024 0.000 0.000
#> GSM386456 2 0.2370 0.845 0.056 0.904 0.040 0.000 0.000
#> GSM386457 2 0.0771 0.894 0.020 0.976 0.004 0.000 0.000
#> GSM386458 1 0.3574 0.682 0.804 0.168 0.000 0.028 0.000
#> GSM386443 1 0.4110 0.649 0.736 0.000 0.012 0.008 0.244
#> GSM386444 3 0.3090 0.881 0.052 0.088 0.860 0.000 0.000
#> GSM386445 3 0.3146 0.878 0.052 0.092 0.856 0.000 0.000
#> GSM386446 3 0.3146 0.878 0.052 0.092 0.856 0.000 0.000
#> GSM386398 1 0.3947 0.662 0.748 0.000 0.008 0.008 0.236
#> GSM386399 1 0.3674 0.826 0.812 0.016 0.000 0.156 0.016
#> GSM386400 1 0.4006 0.826 0.804 0.016 0.008 0.152 0.020
#> GSM386401 2 0.0451 0.897 0.008 0.988 0.004 0.000 0.000
#> GSM386406 2 0.5432 0.329 0.064 0.544 0.000 0.392 0.000
#> GSM386407 4 0.1168 0.929 0.032 0.008 0.000 0.960 0.000
#> GSM386408 2 0.1981 0.887 0.064 0.920 0.000 0.016 0.000
#> GSM386409 1 0.3814 0.619 0.720 0.000 0.004 0.000 0.276
#> GSM386410 5 0.0510 0.983 0.000 0.000 0.016 0.000 0.984
#> GSM386411 2 0.2144 0.888 0.068 0.912 0.000 0.020 0.000
#> GSM386412 4 0.1671 0.881 0.076 0.000 0.000 0.924 0.000
#> GSM386413 2 0.5395 0.433 0.068 0.576 0.000 0.356 0.000
#> GSM386414 4 0.0162 0.948 0.004 0.000 0.000 0.996 0.000
#> GSM386415 4 0.0290 0.947 0.008 0.000 0.000 0.992 0.000
#> GSM386416 1 0.3508 0.782 0.748 0.000 0.000 0.252 0.000
#> GSM386417 2 0.0727 0.896 0.012 0.980 0.004 0.004 0.000
#> GSM386402 3 0.0963 0.922 0.000 0.036 0.964 0.000 0.000
#> GSM386403 3 0.3346 0.889 0.108 0.008 0.848 0.036 0.000
#> GSM386404 3 0.3423 0.887 0.108 0.008 0.844 0.040 0.000
#> GSM386405 3 0.0963 0.922 0.000 0.036 0.964 0.000 0.000
#> GSM386418 4 0.0510 0.944 0.016 0.000 0.000 0.984 0.000
#> GSM386419 2 0.1914 0.889 0.060 0.924 0.000 0.016 0.000
#> GSM386420 2 0.2171 0.883 0.064 0.912 0.000 0.024 0.000
#> GSM386421 4 0.0865 0.938 0.024 0.004 0.000 0.972 0.000
#> GSM386426 1 0.4251 0.810 0.756 0.000 0.004 0.200 0.040
#> GSM386427 5 0.0510 0.983 0.000 0.000 0.016 0.000 0.984
#> GSM386428 4 0.5026 0.458 0.064 0.280 0.000 0.656 0.000
#> GSM386429 4 0.0162 0.948 0.004 0.000 0.000 0.996 0.000
#> GSM386430 4 0.0162 0.948 0.004 0.000 0.000 0.996 0.000
#> GSM386431 4 0.0510 0.944 0.016 0.000 0.000 0.984 0.000
#> GSM386432 4 0.0955 0.936 0.028 0.004 0.000 0.968 0.000
#> GSM386433 4 0.0771 0.942 0.020 0.004 0.000 0.976 0.000
#> GSM386434 4 0.0771 0.942 0.020 0.004 0.000 0.976 0.000
#> GSM386422 3 0.0963 0.922 0.000 0.036 0.964 0.000 0.000
#> GSM386423 5 0.1106 0.971 0.024 0.000 0.012 0.000 0.964
#> GSM386424 3 0.3012 0.908 0.104 0.036 0.860 0.000 0.000
#> GSM386425 3 0.0963 0.922 0.000 0.036 0.964 0.000 0.000
#> GSM386385 1 0.4940 0.473 0.576 0.032 0.000 0.392 0.000
#> GSM386386 5 0.0671 0.976 0.016 0.000 0.004 0.000 0.980
#> GSM386387 2 0.0162 0.899 0.004 0.996 0.000 0.000 0.000
#> GSM386391 4 0.0162 0.948 0.004 0.000 0.000 0.996 0.000
#> GSM386392 1 0.4096 0.810 0.760 0.000 0.000 0.200 0.040
#> GSM386393 4 0.0671 0.941 0.016 0.000 0.004 0.980 0.000
#> GSM386394 5 0.0510 0.983 0.000 0.000 0.016 0.000 0.984
#> GSM386395 4 0.0510 0.944 0.016 0.000 0.000 0.984 0.000
#> GSM386396 4 0.0510 0.944 0.016 0.000 0.000 0.984 0.000
#> GSM386397 4 0.0510 0.944 0.016 0.000 0.000 0.984 0.000
#> GSM386388 3 0.3064 0.907 0.108 0.036 0.856 0.000 0.000
#> GSM386389 5 0.1106 0.971 0.024 0.000 0.012 0.000 0.964
#> GSM386390 3 0.3299 0.888 0.108 0.004 0.848 0.040 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM386435 2 0.0146 0.7845 0.000 0.996 0.000 0.000 0.000 NA
#> GSM386436 2 0.2287 0.7585 0.012 0.904 0.000 0.036 0.000 NA
#> GSM386437 2 0.4673 0.5655 0.016 0.684 0.000 0.240 0.000 NA
#> GSM386438 2 0.2287 0.7585 0.012 0.904 0.000 0.036 0.000 NA
#> GSM386439 1 0.1875 0.8372 0.928 0.032 0.000 0.020 0.000 NA
#> GSM386440 2 0.3171 0.7747 0.000 0.784 0.012 0.000 0.000 NA
#> GSM386441 2 0.3171 0.7747 0.000 0.784 0.012 0.000 0.000 NA
#> GSM386442 2 0.0937 0.7766 0.000 0.960 0.000 0.000 0.000 NA
#> GSM386447 1 0.3724 0.7876 0.820 0.068 0.000 0.064 0.000 NA
#> GSM386448 2 0.3171 0.7747 0.000 0.784 0.012 0.000 0.000 NA
#> GSM386449 2 0.0146 0.7844 0.000 0.996 0.000 0.000 0.000 NA
#> GSM386450 2 0.3110 0.7765 0.000 0.792 0.012 0.000 0.000 NA
#> GSM386451 2 0.3201 0.7733 0.000 0.780 0.012 0.000 0.000 NA
#> GSM386452 5 0.0000 0.9347 0.000 0.000 0.000 0.000 1.000 NA
#> GSM386453 2 0.3141 0.7761 0.000 0.788 0.012 0.000 0.000 NA
#> GSM386454 5 0.1686 0.9275 0.012 0.000 0.000 0.000 0.924 NA
#> GSM386455 2 0.3518 0.7415 0.000 0.732 0.012 0.000 0.000 NA
#> GSM386456 2 0.4093 0.5907 0.000 0.584 0.012 0.000 0.000 NA
#> GSM386457 2 0.3201 0.7733 0.000 0.780 0.012 0.000 0.000 NA
#> GSM386458 1 0.3891 0.7667 0.800 0.112 0.000 0.036 0.000 NA
#> GSM386443 1 0.3385 0.7373 0.788 0.000 0.000 0.000 0.032 NA
#> GSM386444 3 0.3997 0.7225 0.000 0.004 0.508 0.000 0.000 NA
#> GSM386445 3 0.3997 0.7225 0.000 0.004 0.508 0.000 0.000 NA
#> GSM386446 3 0.3997 0.7225 0.000 0.004 0.508 0.000 0.000 NA
#> GSM386398 1 0.1649 0.8297 0.932 0.000 0.000 0.000 0.032 NA
#> GSM386399 1 0.1140 0.8424 0.964 0.008 0.000 0.008 0.008 NA
#> GSM386400 1 0.1639 0.8401 0.940 0.008 0.000 0.008 0.008 NA
#> GSM386401 2 0.3171 0.7747 0.000 0.784 0.012 0.000 0.000 NA
#> GSM386406 2 0.4863 0.5077 0.016 0.648 0.000 0.276 0.000 NA
#> GSM386407 4 0.2213 0.8543 0.012 0.048 0.000 0.908 0.000 NA
#> GSM386408 2 0.1692 0.7691 0.012 0.932 0.000 0.008 0.000 NA
#> GSM386409 1 0.2908 0.7814 0.848 0.000 0.000 0.000 0.048 NA
#> GSM386410 5 0.0000 0.9347 0.000 0.000 0.000 0.000 1.000 NA
#> GSM386411 2 0.2553 0.7523 0.012 0.888 0.000 0.044 0.000 NA
#> GSM386412 4 0.3149 0.7896 0.132 0.000 0.000 0.824 0.000 NA
#> GSM386413 2 0.4962 0.4254 0.012 0.608 0.000 0.320 0.000 NA
#> GSM386414 4 0.1010 0.8913 0.000 0.004 0.000 0.960 0.000 NA
#> GSM386415 4 0.1387 0.9016 0.000 0.000 0.000 0.932 0.000 NA
#> GSM386416 1 0.3388 0.7594 0.792 0.000 0.000 0.172 0.000 NA
#> GSM386417 2 0.3171 0.7750 0.000 0.784 0.012 0.000 0.000 NA
#> GSM386402 3 0.3265 0.8209 0.000 0.004 0.748 0.000 0.000 NA
#> GSM386403 3 0.1975 0.7696 0.020 0.012 0.928 0.028 0.000 NA
#> GSM386404 3 0.2196 0.7612 0.020 0.012 0.916 0.040 0.000 NA
#> GSM386405 3 0.3265 0.8209 0.000 0.004 0.748 0.000 0.000 NA
#> GSM386418 4 0.2279 0.8510 0.016 0.024 0.000 0.904 0.000 NA
#> GSM386419 2 0.1511 0.7714 0.012 0.940 0.000 0.004 0.000 NA
#> GSM386420 2 0.2739 0.7429 0.012 0.876 0.000 0.064 0.000 NA
#> GSM386421 4 0.3930 0.7094 0.016 0.148 0.000 0.780 0.000 NA
#> GSM386426 1 0.1434 0.8408 0.948 0.000 0.000 0.024 0.008 NA
#> GSM386427 5 0.0146 0.9347 0.000 0.000 0.004 0.000 0.996 NA
#> GSM386428 2 0.5292 0.0398 0.016 0.472 0.000 0.452 0.000 NA
#> GSM386429 4 0.1501 0.9031 0.000 0.000 0.000 0.924 0.000 NA
#> GSM386430 4 0.1501 0.9031 0.000 0.000 0.000 0.924 0.000 NA
#> GSM386431 4 0.2048 0.8936 0.000 0.000 0.000 0.880 0.000 NA
#> GSM386432 4 0.2081 0.8593 0.012 0.036 0.000 0.916 0.000 NA
#> GSM386433 4 0.1053 0.8887 0.004 0.012 0.000 0.964 0.000 NA
#> GSM386434 4 0.1053 0.8887 0.004 0.012 0.000 0.964 0.000 NA
#> GSM386422 3 0.3265 0.8209 0.000 0.004 0.748 0.000 0.000 NA
#> GSM386423 5 0.3279 0.8843 0.028 0.000 0.000 0.000 0.796 NA
#> GSM386424 3 0.0146 0.7919 0.000 0.004 0.996 0.000 0.000 NA
#> GSM386425 3 0.3265 0.8209 0.000 0.004 0.748 0.000 0.000 NA
#> GSM386385 1 0.6787 0.3968 0.468 0.232 0.000 0.232 0.000 NA
#> GSM386386 5 0.2629 0.9117 0.040 0.000 0.000 0.000 0.868 NA
#> GSM386387 2 0.1204 0.7872 0.000 0.944 0.000 0.000 0.000 NA
#> GSM386391 4 0.1501 0.9031 0.000 0.000 0.000 0.924 0.000 NA
#> GSM386392 1 0.1434 0.8408 0.948 0.000 0.000 0.024 0.008 NA
#> GSM386393 4 0.2048 0.8936 0.000 0.000 0.000 0.880 0.000 NA
#> GSM386394 5 0.0146 0.9347 0.000 0.000 0.004 0.000 0.996 NA
#> GSM386395 4 0.2048 0.8936 0.000 0.000 0.000 0.880 0.000 NA
#> GSM386396 4 0.2048 0.8936 0.000 0.000 0.000 0.880 0.000 NA
#> GSM386397 4 0.2048 0.8936 0.000 0.000 0.000 0.880 0.000 NA
#> GSM386388 3 0.0146 0.7919 0.000 0.004 0.996 0.000 0.000 NA
#> GSM386389 5 0.3202 0.8867 0.024 0.000 0.000 0.000 0.800 NA
#> GSM386390 3 0.1975 0.7696 0.020 0.012 0.928 0.028 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 agent(p) dose(p) time(p) k
#> ATC:kmeans 74 0.06699 0.01629 2.54e-01 2
#> ATC:kmeans 61 0.00948 0.02781 6.37e-02 3
#> ATC:kmeans 66 0.00136 0.00818 1.10e-08 4
#> ATC:kmeans 70 0.00182 0.00307 1.19e-09 5
#> ATC:kmeans 71 0.00308 0.00392 9.30e-10 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 51941 rows and 74 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 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.976 0.991 0.4997 0.502 0.502
#> 3 3 0.725 0.852 0.902 0.2844 0.784 0.598
#> 4 4 1.000 0.999 0.999 0.1568 0.877 0.666
#> 5 5 0.929 0.962 0.965 0.0514 0.964 0.859
#> 6 6 0.879 0.802 0.889 0.0452 0.977 0.895
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
#> GSM386435 2 0.000 0.986 0.000 1.000
#> GSM386436 2 0.000 0.986 0.000 1.000
#> GSM386437 2 0.000 0.986 0.000 1.000
#> GSM386438 2 0.000 0.986 0.000 1.000
#> GSM386439 1 0.000 0.997 1.000 0.000
#> GSM386440 2 0.000 0.986 0.000 1.000
#> GSM386441 2 0.000 0.986 0.000 1.000
#> GSM386442 2 0.000 0.986 0.000 1.000
#> GSM386447 1 0.000 0.997 1.000 0.000
#> GSM386448 2 0.000 0.986 0.000 1.000
#> GSM386449 2 0.000 0.986 0.000 1.000
#> GSM386450 2 0.000 0.986 0.000 1.000
#> GSM386451 2 0.000 0.986 0.000 1.000
#> GSM386452 1 0.000 0.997 1.000 0.000
#> GSM386453 2 0.000 0.986 0.000 1.000
#> GSM386454 1 0.000 0.997 1.000 0.000
#> GSM386455 2 0.000 0.986 0.000 1.000
#> GSM386456 2 0.000 0.986 0.000 1.000
#> GSM386457 2 0.000 0.986 0.000 1.000
#> GSM386458 2 0.494 0.872 0.108 0.892
#> GSM386443 1 0.000 0.997 1.000 0.000
#> GSM386444 2 0.000 0.986 0.000 1.000
#> GSM386445 2 0.000 0.986 0.000 1.000
#> GSM386446 2 0.000 0.986 0.000 1.000
#> GSM386398 1 0.000 0.997 1.000 0.000
#> GSM386399 1 0.000 0.997 1.000 0.000
#> GSM386400 1 0.000 0.997 1.000 0.000
#> GSM386401 2 0.000 0.986 0.000 1.000
#> GSM386406 2 0.000 0.986 0.000 1.000
#> GSM386407 2 0.990 0.208 0.440 0.560
#> GSM386408 2 0.000 0.986 0.000 1.000
#> GSM386409 1 0.000 0.997 1.000 0.000
#> GSM386410 1 0.000 0.997 1.000 0.000
#> GSM386411 2 0.000 0.986 0.000 1.000
#> GSM386412 1 0.000 0.997 1.000 0.000
#> GSM386413 2 0.000 0.986 0.000 1.000
#> GSM386414 1 0.000 0.997 1.000 0.000
#> GSM386415 1 0.000 0.997 1.000 0.000
#> GSM386416 1 0.000 0.997 1.000 0.000
#> GSM386417 2 0.000 0.986 0.000 1.000
#> GSM386402 2 0.000 0.986 0.000 1.000
#> GSM386403 2 0.000 0.986 0.000 1.000
#> GSM386404 2 0.000 0.986 0.000 1.000
#> GSM386405 2 0.000 0.986 0.000 1.000
#> GSM386418 1 0.000 0.997 1.000 0.000
#> GSM386419 2 0.000 0.986 0.000 1.000
#> GSM386420 2 0.000 0.986 0.000 1.000
#> GSM386421 1 0.469 0.886 0.900 0.100
#> GSM386426 1 0.000 0.997 1.000 0.000
#> GSM386427 1 0.000 0.997 1.000 0.000
#> GSM386428 2 0.000 0.986 0.000 1.000
#> GSM386429 1 0.000 0.997 1.000 0.000
#> GSM386430 1 0.000 0.997 1.000 0.000
#> GSM386431 1 0.000 0.997 1.000 0.000
#> GSM386432 2 0.224 0.952 0.036 0.964
#> GSM386433 2 0.000 0.986 0.000 1.000
#> GSM386434 2 0.000 0.986 0.000 1.000
#> GSM386422 2 0.000 0.986 0.000 1.000
#> GSM386423 1 0.000 0.997 1.000 0.000
#> GSM386424 2 0.000 0.986 0.000 1.000
#> GSM386425 2 0.000 0.986 0.000 1.000
#> GSM386385 1 0.000 0.997 1.000 0.000
#> GSM386386 1 0.000 0.997 1.000 0.000
#> GSM386387 2 0.000 0.986 0.000 1.000
#> GSM386391 1 0.000 0.997 1.000 0.000
#> GSM386392 1 0.000 0.997 1.000 0.000
#> GSM386393 1 0.000 0.997 1.000 0.000
#> GSM386394 1 0.000 0.997 1.000 0.000
#> GSM386395 1 0.000 0.997 1.000 0.000
#> GSM386396 1 0.000 0.997 1.000 0.000
#> GSM386397 1 0.000 0.997 1.000 0.000
#> GSM386388 2 0.000 0.986 0.000 1.000
#> GSM386389 1 0.000 0.997 1.000 0.000
#> GSM386390 2 0.000 0.986 0.000 1.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM386435 3 0.4702 0.917 0.000 0.212 0.788
#> GSM386436 3 0.4702 0.917 0.000 0.212 0.788
#> GSM386437 3 0.4702 0.917 0.000 0.212 0.788
#> GSM386438 3 0.4702 0.917 0.000 0.212 0.788
#> GSM386439 1 0.4452 0.722 0.808 0.192 0.000
#> GSM386440 3 0.4702 0.917 0.000 0.212 0.788
#> GSM386441 3 0.4702 0.917 0.000 0.212 0.788
#> GSM386442 3 0.4702 0.917 0.000 0.212 0.788
#> GSM386447 1 0.0000 0.952 1.000 0.000 0.000
#> GSM386448 3 0.4702 0.917 0.000 0.212 0.788
#> GSM386449 3 0.4702 0.917 0.000 0.212 0.788
#> GSM386450 3 0.4702 0.917 0.000 0.212 0.788
#> GSM386451 3 0.4702 0.917 0.000 0.212 0.788
#> GSM386452 1 0.0000 0.952 1.000 0.000 0.000
#> GSM386453 3 0.4702 0.917 0.000 0.212 0.788
#> GSM386454 1 0.0000 0.952 1.000 0.000 0.000
#> GSM386455 3 0.4702 0.917 0.000 0.212 0.788
#> GSM386456 3 0.4702 0.917 0.000 0.212 0.788
#> GSM386457 3 0.4702 0.917 0.000 0.212 0.788
#> GSM386458 1 0.5109 0.685 0.780 0.212 0.008
#> GSM386443 1 0.0000 0.952 1.000 0.000 0.000
#> GSM386444 3 0.0424 0.831 0.000 0.008 0.992
#> GSM386445 3 0.0424 0.831 0.000 0.008 0.992
#> GSM386446 3 0.0424 0.831 0.000 0.008 0.992
#> GSM386398 1 0.0000 0.952 1.000 0.000 0.000
#> GSM386399 1 0.0000 0.952 1.000 0.000 0.000
#> GSM386400 1 0.0000 0.952 1.000 0.000 0.000
#> GSM386401 3 0.4702 0.917 0.000 0.212 0.788
#> GSM386406 3 0.4702 0.917 0.000 0.212 0.788
#> GSM386407 2 0.4861 0.817 0.192 0.800 0.008
#> GSM386408 3 0.4702 0.917 0.000 0.212 0.788
#> GSM386409 1 0.0000 0.952 1.000 0.000 0.000
#> GSM386410 1 0.0000 0.952 1.000 0.000 0.000
#> GSM386411 3 0.4702 0.917 0.000 0.212 0.788
#> GSM386412 1 0.0000 0.952 1.000 0.000 0.000
#> GSM386413 3 0.4702 0.917 0.000 0.212 0.788
#> GSM386414 2 0.4796 0.829 0.220 0.780 0.000
#> GSM386415 2 0.4796 0.829 0.220 0.780 0.000
#> GSM386416 1 0.0000 0.952 1.000 0.000 0.000
#> GSM386417 3 0.0000 0.834 0.000 0.000 1.000
#> GSM386402 3 0.0424 0.831 0.000 0.008 0.992
#> GSM386403 3 0.0424 0.831 0.000 0.008 0.992
#> GSM386404 3 0.0424 0.831 0.000 0.008 0.992
#> GSM386405 3 0.0424 0.831 0.000 0.008 0.992
#> GSM386418 2 0.4796 0.829 0.220 0.780 0.000
#> GSM386419 3 0.4702 0.917 0.000 0.212 0.788
#> GSM386420 3 0.4702 0.917 0.000 0.212 0.788
#> GSM386421 2 0.0424 0.683 0.000 0.992 0.008
#> GSM386426 1 0.0000 0.952 1.000 0.000 0.000
#> GSM386427 1 0.0000 0.952 1.000 0.000 0.000
#> GSM386428 2 0.6215 -0.327 0.000 0.572 0.428
#> GSM386429 2 0.4796 0.829 0.220 0.780 0.000
#> GSM386430 2 0.4796 0.829 0.220 0.780 0.000
#> GSM386431 2 0.4796 0.829 0.220 0.780 0.000
#> GSM386432 2 0.0424 0.683 0.000 0.992 0.008
#> GSM386433 2 0.4702 0.709 0.000 0.788 0.212
#> GSM386434 2 0.4702 0.709 0.000 0.788 0.212
#> GSM386422 3 0.0424 0.831 0.000 0.008 0.992
#> GSM386423 1 0.0000 0.952 1.000 0.000 0.000
#> GSM386424 3 0.0424 0.831 0.000 0.008 0.992
#> GSM386425 3 0.0424 0.831 0.000 0.008 0.992
#> GSM386385 1 0.4654 0.702 0.792 0.208 0.000
#> GSM386386 1 0.0000 0.952 1.000 0.000 0.000
#> GSM386387 3 0.4702 0.917 0.000 0.212 0.788
#> GSM386391 2 0.4796 0.829 0.220 0.780 0.000
#> GSM386392 1 0.0000 0.952 1.000 0.000 0.000
#> GSM386393 2 0.4796 0.829 0.220 0.780 0.000
#> GSM386394 1 0.0000 0.952 1.000 0.000 0.000
#> GSM386395 2 0.5254 0.783 0.264 0.736 0.000
#> GSM386396 2 0.4796 0.829 0.220 0.780 0.000
#> GSM386397 2 0.4796 0.829 0.220 0.780 0.000
#> GSM386388 3 0.0424 0.831 0.000 0.008 0.992
#> GSM386389 1 0.0000 0.952 1.000 0.000 0.000
#> GSM386390 2 0.6295 0.368 0.000 0.528 0.472
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM386435 2 0.000 1.000 0.00 1 0 0.00
#> GSM386436 2 0.000 1.000 0.00 1 0 0.00
#> GSM386437 2 0.000 1.000 0.00 1 0 0.00
#> GSM386438 2 0.000 1.000 0.00 1 0 0.00
#> GSM386439 1 0.000 1.000 1.00 0 0 0.00
#> GSM386440 2 0.000 1.000 0.00 1 0 0.00
#> GSM386441 2 0.000 1.000 0.00 1 0 0.00
#> GSM386442 2 0.000 1.000 0.00 1 0 0.00
#> GSM386447 1 0.000 1.000 1.00 0 0 0.00
#> GSM386448 2 0.000 1.000 0.00 1 0 0.00
#> GSM386449 2 0.000 1.000 0.00 1 0 0.00
#> GSM386450 2 0.000 1.000 0.00 1 0 0.00
#> GSM386451 2 0.000 1.000 0.00 1 0 0.00
#> GSM386452 1 0.000 1.000 1.00 0 0 0.00
#> GSM386453 2 0.000 1.000 0.00 1 0 0.00
#> GSM386454 1 0.000 1.000 1.00 0 0 0.00
#> GSM386455 2 0.000 1.000 0.00 1 0 0.00
#> GSM386456 2 0.000 1.000 0.00 1 0 0.00
#> GSM386457 2 0.000 1.000 0.00 1 0 0.00
#> GSM386458 1 0.000 1.000 1.00 0 0 0.00
#> GSM386443 1 0.000 1.000 1.00 0 0 0.00
#> GSM386444 3 0.000 1.000 0.00 0 1 0.00
#> GSM386445 3 0.000 1.000 0.00 0 1 0.00
#> GSM386446 3 0.000 1.000 0.00 0 1 0.00
#> GSM386398 1 0.000 1.000 1.00 0 0 0.00
#> GSM386399 1 0.000 1.000 1.00 0 0 0.00
#> GSM386400 1 0.000 1.000 1.00 0 0 0.00
#> GSM386401 2 0.000 1.000 0.00 1 0 0.00
#> GSM386406 2 0.000 1.000 0.00 1 0 0.00
#> GSM386407 4 0.000 0.997 0.00 0 0 1.00
#> GSM386408 2 0.000 1.000 0.00 1 0 0.00
#> GSM386409 1 0.000 1.000 1.00 0 0 0.00
#> GSM386410 1 0.000 1.000 1.00 0 0 0.00
#> GSM386411 2 0.000 1.000 0.00 1 0 0.00
#> GSM386412 1 0.000 1.000 1.00 0 0 0.00
#> GSM386413 2 0.000 1.000 0.00 1 0 0.00
#> GSM386414 4 0.000 0.997 0.00 0 0 1.00
#> GSM386415 4 0.000 0.997 0.00 0 0 1.00
#> GSM386416 1 0.000 1.000 1.00 0 0 0.00
#> GSM386417 2 0.000 1.000 0.00 1 0 0.00
#> GSM386402 3 0.000 1.000 0.00 0 1 0.00
#> GSM386403 3 0.000 1.000 0.00 0 1 0.00
#> GSM386404 3 0.000 1.000 0.00 0 1 0.00
#> GSM386405 3 0.000 1.000 0.00 0 1 0.00
#> GSM386418 4 0.000 0.997 0.00 0 0 1.00
#> GSM386419 2 0.000 1.000 0.00 1 0 0.00
#> GSM386420 2 0.000 1.000 0.00 1 0 0.00
#> GSM386421 4 0.000 0.997 0.00 0 0 1.00
#> GSM386426 1 0.000 1.000 1.00 0 0 0.00
#> GSM386427 1 0.000 1.000 1.00 0 0 0.00
#> GSM386428 2 0.000 1.000 0.00 1 0 0.00
#> GSM386429 4 0.000 0.997 0.00 0 0 1.00
#> GSM386430 4 0.000 0.997 0.00 0 0 1.00
#> GSM386431 4 0.000 0.997 0.00 0 0 1.00
#> GSM386432 4 0.000 0.997 0.00 0 0 1.00
#> GSM386433 4 0.000 0.997 0.00 0 0 1.00
#> GSM386434 4 0.000 0.997 0.00 0 0 1.00
#> GSM386422 3 0.000 1.000 0.00 0 1 0.00
#> GSM386423 1 0.000 1.000 1.00 0 0 0.00
#> GSM386424 3 0.000 1.000 0.00 0 1 0.00
#> GSM386425 3 0.000 1.000 0.00 0 1 0.00
#> GSM386385 1 0.000 1.000 1.00 0 0 0.00
#> GSM386386 1 0.000 1.000 1.00 0 0 0.00
#> GSM386387 2 0.000 1.000 0.00 1 0 0.00
#> GSM386391 4 0.000 0.997 0.00 0 0 1.00
#> GSM386392 1 0.000 1.000 1.00 0 0 0.00
#> GSM386393 4 0.000 0.997 0.00 0 0 1.00
#> GSM386394 1 0.000 1.000 1.00 0 0 0.00
#> GSM386395 4 0.121 0.953 0.04 0 0 0.96
#> GSM386396 4 0.000 0.997 0.00 0 0 1.00
#> GSM386397 4 0.000 0.997 0.00 0 0 1.00
#> GSM386388 3 0.000 1.000 0.00 0 1 0.00
#> GSM386389 1 0.000 1.000 1.00 0 0 0.00
#> GSM386390 3 0.000 1.000 0.00 0 1 0.00
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM386435 2 0.0290 0.964 0.000 0.992 0.000 0.000 0.008
#> GSM386436 2 0.0703 0.960 0.000 0.976 0.000 0.000 0.024
#> GSM386437 2 0.2329 0.900 0.000 0.876 0.000 0.000 0.124
#> GSM386438 2 0.0703 0.960 0.000 0.976 0.000 0.000 0.024
#> GSM386439 5 0.2891 0.959 0.176 0.000 0.000 0.000 0.824
#> GSM386440 2 0.0162 0.965 0.000 0.996 0.000 0.000 0.004
#> GSM386441 2 0.0000 0.965 0.000 1.000 0.000 0.000 0.000
#> GSM386442 2 0.0404 0.964 0.000 0.988 0.000 0.000 0.012
#> GSM386447 5 0.2891 0.959 0.176 0.000 0.000 0.000 0.824
#> GSM386448 2 0.0000 0.965 0.000 1.000 0.000 0.000 0.000
#> GSM386449 2 0.0404 0.964 0.000 0.988 0.000 0.000 0.012
#> GSM386450 2 0.0510 0.964 0.000 0.984 0.000 0.000 0.016
#> GSM386451 2 0.0794 0.961 0.000 0.972 0.000 0.000 0.028
#> GSM386452 1 0.0000 1.000 1.000 0.000 0.000 0.000 0.000
#> GSM386453 2 0.0794 0.961 0.000 0.972 0.000 0.000 0.028
#> GSM386454 1 0.0000 1.000 1.000 0.000 0.000 0.000 0.000
#> GSM386455 2 0.0609 0.963 0.000 0.980 0.000 0.000 0.020
#> GSM386456 2 0.0794 0.961 0.000 0.972 0.000 0.000 0.028
#> GSM386457 2 0.0794 0.961 0.000 0.972 0.000 0.000 0.028
#> GSM386458 5 0.2719 0.934 0.144 0.004 0.000 0.000 0.852
#> GSM386443 1 0.0000 1.000 1.000 0.000 0.000 0.000 0.000
#> GSM386444 3 0.0000 0.999 0.000 0.000 1.000 0.000 0.000
#> GSM386445 3 0.0162 0.996 0.000 0.004 0.996 0.000 0.000
#> GSM386446 3 0.0162 0.996 0.000 0.004 0.996 0.000 0.000
#> GSM386398 5 0.2891 0.959 0.176 0.000 0.000 0.000 0.824
#> GSM386399 5 0.2891 0.959 0.176 0.000 0.000 0.000 0.824
#> GSM386400 5 0.2891 0.959 0.176 0.000 0.000 0.000 0.824
#> GSM386401 2 0.0162 0.965 0.000 0.996 0.000 0.000 0.004
#> GSM386406 2 0.2377 0.897 0.000 0.872 0.000 0.000 0.128
#> GSM386407 4 0.0609 0.956 0.000 0.000 0.000 0.980 0.020
#> GSM386408 2 0.1965 0.920 0.000 0.904 0.000 0.000 0.096
#> GSM386409 1 0.0000 1.000 1.000 0.000 0.000 0.000 0.000
#> GSM386410 1 0.0000 1.000 1.000 0.000 0.000 0.000 0.000
#> GSM386411 2 0.0880 0.960 0.000 0.968 0.000 0.000 0.032
#> GSM386412 1 0.0000 1.000 1.000 0.000 0.000 0.000 0.000
#> GSM386413 2 0.0880 0.960 0.000 0.968 0.000 0.000 0.032
#> GSM386414 4 0.0510 0.959 0.000 0.000 0.000 0.984 0.016
#> GSM386415 4 0.0510 0.960 0.000 0.000 0.000 0.984 0.016
#> GSM386416 1 0.0000 1.000 1.000 0.000 0.000 0.000 0.000
#> GSM386417 2 0.0794 0.961 0.000 0.972 0.000 0.000 0.028
#> GSM386402 3 0.0000 0.999 0.000 0.000 1.000 0.000 0.000
#> GSM386403 3 0.0000 0.999 0.000 0.000 1.000 0.000 0.000
#> GSM386404 3 0.0000 0.999 0.000 0.000 1.000 0.000 0.000
#> GSM386405 3 0.0000 0.999 0.000 0.000 1.000 0.000 0.000
#> GSM386418 4 0.2020 0.894 0.000 0.000 0.000 0.900 0.100
#> GSM386419 2 0.0290 0.965 0.000 0.992 0.000 0.000 0.008
#> GSM386420 2 0.2280 0.903 0.000 0.880 0.000 0.000 0.120
#> GSM386421 4 0.2377 0.872 0.000 0.000 0.000 0.872 0.128
#> GSM386426 1 0.0000 1.000 1.000 0.000 0.000 0.000 0.000
#> GSM386427 1 0.0000 1.000 1.000 0.000 0.000 0.000 0.000
#> GSM386428 2 0.2377 0.897 0.000 0.872 0.000 0.000 0.128
#> GSM386429 4 0.0000 0.960 0.000 0.000 0.000 1.000 0.000
#> GSM386430 4 0.0162 0.960 0.000 0.000 0.000 0.996 0.004
#> GSM386431 4 0.0000 0.960 0.000 0.000 0.000 1.000 0.000
#> GSM386432 4 0.0404 0.960 0.000 0.000 0.000 0.988 0.012
#> GSM386433 4 0.0510 0.960 0.000 0.000 0.000 0.984 0.016
#> GSM386434 4 0.0510 0.960 0.000 0.000 0.000 0.984 0.016
#> GSM386422 3 0.0000 0.999 0.000 0.000 1.000 0.000 0.000
#> GSM386423 1 0.0000 1.000 1.000 0.000 0.000 0.000 0.000
#> GSM386424 3 0.0000 0.999 0.000 0.000 1.000 0.000 0.000
#> GSM386425 3 0.0000 0.999 0.000 0.000 1.000 0.000 0.000
#> GSM386385 5 0.1399 0.819 0.028 0.020 0.000 0.000 0.952
#> GSM386386 1 0.0000 1.000 1.000 0.000 0.000 0.000 0.000
#> GSM386387 2 0.0404 0.964 0.000 0.988 0.000 0.000 0.012
#> GSM386391 4 0.0404 0.959 0.000 0.000 0.000 0.988 0.012
#> GSM386392 1 0.0000 1.000 1.000 0.000 0.000 0.000 0.000
#> GSM386393 4 0.0404 0.955 0.012 0.000 0.000 0.988 0.000
#> GSM386394 1 0.0000 1.000 1.000 0.000 0.000 0.000 0.000
#> GSM386395 4 0.3452 0.668 0.244 0.000 0.000 0.756 0.000
#> GSM386396 4 0.0000 0.960 0.000 0.000 0.000 1.000 0.000
#> GSM386397 4 0.0000 0.960 0.000 0.000 0.000 1.000 0.000
#> GSM386388 3 0.0000 0.999 0.000 0.000 1.000 0.000 0.000
#> GSM386389 1 0.0000 1.000 1.000 0.000 0.000 0.000 0.000
#> GSM386390 3 0.0000 0.999 0.000 0.000 1.000 0.000 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM386435 2 0.1007 0.799 0.000 0.956 0.000 0.000 0.000 0.044
#> GSM386436 2 0.1910 0.746 0.000 0.892 0.000 0.000 0.000 0.108
#> GSM386437 2 0.3838 -0.260 0.000 0.552 0.000 0.000 0.000 0.448
#> GSM386438 2 0.2135 0.724 0.000 0.872 0.000 0.000 0.000 0.128
#> GSM386439 1 0.0632 0.993 0.976 0.000 0.000 0.000 0.024 0.000
#> GSM386440 2 0.0363 0.808 0.000 0.988 0.000 0.000 0.000 0.012
#> GSM386441 2 0.0000 0.809 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM386442 2 0.1007 0.799 0.000 0.956 0.000 0.000 0.000 0.044
#> GSM386447 1 0.0632 0.993 0.976 0.000 0.000 0.000 0.024 0.000
#> GSM386448 2 0.0000 0.809 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM386449 2 0.1007 0.799 0.000 0.956 0.000 0.000 0.000 0.044
#> GSM386450 2 0.0632 0.807 0.000 0.976 0.000 0.000 0.000 0.024
#> GSM386451 2 0.2553 0.763 0.008 0.848 0.000 0.000 0.000 0.144
#> GSM386452 5 0.0000 0.998 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM386453 2 0.2593 0.761 0.008 0.844 0.000 0.000 0.000 0.148
#> GSM386454 5 0.0000 0.998 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM386455 2 0.2431 0.767 0.008 0.860 0.000 0.000 0.000 0.132
#> GSM386456 2 0.2553 0.763 0.008 0.848 0.000 0.000 0.000 0.144
#> GSM386457 2 0.2553 0.763 0.008 0.848 0.000 0.000 0.000 0.144
#> GSM386458 1 0.0458 0.986 0.984 0.000 0.000 0.000 0.016 0.000
#> GSM386443 5 0.0146 0.997 0.000 0.000 0.000 0.000 0.996 0.004
#> GSM386444 3 0.2069 0.908 0.004 0.020 0.908 0.000 0.000 0.068
#> GSM386445 3 0.2833 0.872 0.008 0.040 0.864 0.000 0.000 0.088
#> GSM386446 3 0.2833 0.872 0.008 0.040 0.864 0.000 0.000 0.088
#> GSM386398 1 0.0632 0.993 0.976 0.000 0.000 0.000 0.024 0.000
#> GSM386399 1 0.0632 0.993 0.976 0.000 0.000 0.000 0.024 0.000
#> GSM386400 1 0.0632 0.993 0.976 0.000 0.000 0.000 0.024 0.000
#> GSM386401 2 0.0632 0.806 0.000 0.976 0.000 0.000 0.000 0.024
#> GSM386406 6 0.3854 0.304 0.000 0.464 0.000 0.000 0.000 0.536
#> GSM386407 4 0.3468 0.728 0.008 0.000 0.000 0.728 0.000 0.264
#> GSM386408 2 0.2562 0.662 0.000 0.828 0.000 0.000 0.000 0.172
#> GSM386409 5 0.0000 0.998 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM386410 5 0.0000 0.998 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM386411 2 0.3109 0.697 0.004 0.772 0.000 0.000 0.000 0.224
#> GSM386412 5 0.0000 0.998 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM386413 2 0.3710 0.596 0.012 0.696 0.000 0.000 0.000 0.292
#> GSM386414 4 0.3534 0.747 0.016 0.000 0.000 0.740 0.000 0.244
#> GSM386415 4 0.3431 0.777 0.016 0.000 0.000 0.756 0.000 0.228
#> GSM386416 5 0.0260 0.994 0.000 0.000 0.000 0.000 0.992 0.008
#> GSM386417 2 0.3557 0.720 0.008 0.800 0.044 0.000 0.000 0.148
#> GSM386402 3 0.0000 0.964 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386403 3 0.0146 0.963 0.000 0.000 0.996 0.000 0.000 0.004
#> GSM386404 3 0.0146 0.963 0.000 0.000 0.996 0.000 0.000 0.004
#> GSM386405 3 0.0000 0.964 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386418 4 0.3838 0.130 0.000 0.000 0.000 0.552 0.000 0.448
#> GSM386419 2 0.0790 0.809 0.000 0.968 0.000 0.000 0.000 0.032
#> GSM386420 2 0.3695 0.073 0.000 0.624 0.000 0.000 0.000 0.376
#> GSM386421 6 0.3854 -0.263 0.000 0.000 0.000 0.464 0.000 0.536
#> GSM386426 5 0.0000 0.998 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM386427 5 0.0000 0.998 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM386428 6 0.4649 0.456 0.000 0.380 0.000 0.048 0.000 0.572
#> GSM386429 4 0.0713 0.813 0.000 0.000 0.000 0.972 0.000 0.028
#> GSM386430 4 0.0865 0.813 0.000 0.000 0.000 0.964 0.000 0.036
#> GSM386431 4 0.0146 0.813 0.000 0.000 0.000 0.996 0.004 0.000
#> GSM386432 4 0.1757 0.815 0.008 0.000 0.000 0.916 0.000 0.076
#> GSM386433 4 0.3431 0.777 0.016 0.000 0.000 0.756 0.000 0.228
#> GSM386434 4 0.3431 0.777 0.016 0.000 0.000 0.756 0.000 0.228
#> GSM386422 3 0.0000 0.964 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386423 5 0.0146 0.997 0.000 0.000 0.000 0.000 0.996 0.004
#> GSM386424 3 0.0000 0.964 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386425 3 0.0000 0.964 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386385 1 0.0767 0.972 0.976 0.008 0.000 0.000 0.004 0.012
#> GSM386386 5 0.0000 0.998 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM386387 2 0.1007 0.799 0.000 0.956 0.000 0.000 0.000 0.044
#> GSM386391 4 0.3288 0.547 0.000 0.000 0.000 0.724 0.000 0.276
#> GSM386392 5 0.0000 0.998 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM386393 4 0.0865 0.802 0.000 0.000 0.000 0.964 0.036 0.000
#> GSM386394 5 0.0146 0.995 0.000 0.000 0.000 0.004 0.996 0.000
#> GSM386395 4 0.2491 0.678 0.000 0.000 0.000 0.836 0.164 0.000
#> GSM386396 4 0.1141 0.818 0.000 0.000 0.000 0.948 0.000 0.052
#> GSM386397 4 0.0458 0.817 0.000 0.000 0.000 0.984 0.000 0.016
#> GSM386388 3 0.0000 0.964 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386389 5 0.0146 0.997 0.000 0.000 0.000 0.000 0.996 0.004
#> GSM386390 3 0.0146 0.963 0.000 0.000 0.996 0.000 0.000 0.004
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
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 agent(p) dose(p) time(p) k
#> ATC:skmeans 73 0.01405 0.01116 6.18e-02 2
#> ATC:skmeans 72 0.00467 0.00123 1.86e-02 3
#> ATC:skmeans 74 0.00244 0.00395 8.45e-10 4
#> ATC:skmeans 74 0.00610 0.00848 1.51e-10 5
#> ATC:skmeans 68 0.00528 0.00887 2.35e-10 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 51941 rows and 74 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 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.595 0.835 0.918 0.3919 0.641 0.641
#> 3 3 0.694 0.842 0.915 0.4692 0.745 0.621
#> 4 4 1.000 0.981 0.991 0.2694 0.799 0.563
#> 5 5 0.902 0.886 0.912 0.0489 0.981 0.932
#> 6 6 0.877 0.883 0.878 0.0387 0.911 0.661
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
#> GSM386435 2 0.000 0.890 0.000 1.000
#> GSM386436 2 0.000 0.890 0.000 1.000
#> GSM386437 2 0.000 0.890 0.000 1.000
#> GSM386438 2 0.000 0.890 0.000 1.000
#> GSM386439 2 0.767 0.760 0.224 0.776
#> GSM386440 2 0.000 0.890 0.000 1.000
#> GSM386441 2 0.000 0.890 0.000 1.000
#> GSM386442 2 0.000 0.890 0.000 1.000
#> GSM386447 2 0.855 0.712 0.280 0.720
#> GSM386448 2 0.000 0.890 0.000 1.000
#> GSM386449 2 0.000 0.890 0.000 1.000
#> GSM386450 2 0.000 0.890 0.000 1.000
#> GSM386451 2 0.000 0.890 0.000 1.000
#> GSM386452 1 0.000 0.944 1.000 0.000
#> GSM386453 2 0.000 0.890 0.000 1.000
#> GSM386454 1 0.000 0.944 1.000 0.000
#> GSM386455 2 0.000 0.890 0.000 1.000
#> GSM386456 2 0.000 0.890 0.000 1.000
#> GSM386457 2 0.000 0.890 0.000 1.000
#> GSM386458 2 0.855 0.712 0.280 0.720
#> GSM386443 1 0.000 0.944 1.000 0.000
#> GSM386444 2 0.000 0.890 0.000 1.000
#> GSM386445 2 0.000 0.890 0.000 1.000
#> GSM386446 2 0.000 0.890 0.000 1.000
#> GSM386398 1 0.000 0.944 1.000 0.000
#> GSM386399 1 0.000 0.944 1.000 0.000
#> GSM386400 1 0.000 0.944 1.000 0.000
#> GSM386401 2 0.000 0.890 0.000 1.000
#> GSM386406 2 0.000 0.890 0.000 1.000
#> GSM386407 2 0.541 0.827 0.124 0.876
#> GSM386408 2 0.000 0.890 0.000 1.000
#> GSM386409 1 0.000 0.944 1.000 0.000
#> GSM386410 1 0.000 0.944 1.000 0.000
#> GSM386411 2 0.000 0.890 0.000 1.000
#> GSM386412 2 0.998 0.295 0.472 0.528
#> GSM386413 2 0.000 0.890 0.000 1.000
#> GSM386414 2 0.855 0.712 0.280 0.720
#> GSM386415 2 0.855 0.712 0.280 0.720
#> GSM386416 1 0.958 0.228 0.620 0.380
#> GSM386417 2 0.000 0.890 0.000 1.000
#> GSM386402 2 0.000 0.890 0.000 1.000
#> GSM386403 2 0.706 0.785 0.192 0.808
#> GSM386404 2 0.855 0.712 0.280 0.720
#> GSM386405 2 0.000 0.890 0.000 1.000
#> GSM386418 2 0.855 0.712 0.280 0.720
#> GSM386419 2 0.000 0.890 0.000 1.000
#> GSM386420 2 0.000 0.890 0.000 1.000
#> GSM386421 2 0.000 0.890 0.000 1.000
#> GSM386426 1 0.000 0.944 1.000 0.000
#> GSM386427 1 0.000 0.944 1.000 0.000
#> GSM386428 2 0.000 0.890 0.000 1.000
#> GSM386429 2 0.855 0.712 0.280 0.720
#> GSM386430 2 0.855 0.712 0.280 0.720
#> GSM386431 2 0.855 0.712 0.280 0.720
#> GSM386432 2 0.000 0.890 0.000 1.000
#> GSM386433 2 0.775 0.758 0.228 0.772
#> GSM386434 2 0.850 0.716 0.276 0.724
#> GSM386422 2 0.000 0.890 0.000 1.000
#> GSM386423 1 0.000 0.944 1.000 0.000
#> GSM386424 2 0.000 0.890 0.000 1.000
#> GSM386425 2 0.000 0.890 0.000 1.000
#> GSM386385 2 0.000 0.890 0.000 1.000
#> GSM386386 1 0.000 0.944 1.000 0.000
#> GSM386387 2 0.000 0.890 0.000 1.000
#> GSM386391 2 0.855 0.712 0.280 0.720
#> GSM386392 1 0.000 0.944 1.000 0.000
#> GSM386393 1 0.939 0.305 0.644 0.356
#> GSM386394 1 0.000 0.944 1.000 0.000
#> GSM386395 2 0.855 0.712 0.280 0.720
#> GSM386396 2 0.855 0.712 0.280 0.720
#> GSM386397 2 0.855 0.712 0.280 0.720
#> GSM386388 2 0.000 0.890 0.000 1.000
#> GSM386389 1 0.000 0.944 1.000 0.000
#> GSM386390 2 0.706 0.785 0.192 0.808
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM386435 2 0.4121 0.8116 0.000 0.832 0.168
#> GSM386436 2 0.0000 0.8669 0.000 1.000 0.000
#> GSM386437 2 0.0000 0.8669 0.000 1.000 0.000
#> GSM386438 2 0.0000 0.8669 0.000 1.000 0.000
#> GSM386439 2 0.1643 0.8639 0.044 0.956 0.000
#> GSM386440 2 0.4121 0.8116 0.000 0.832 0.168
#> GSM386441 2 0.4121 0.8116 0.000 0.832 0.168
#> GSM386442 2 0.4121 0.8116 0.000 0.832 0.168
#> GSM386447 2 0.2537 0.8568 0.080 0.920 0.000
#> GSM386448 2 0.4121 0.8116 0.000 0.832 0.168
#> GSM386449 2 0.4121 0.8116 0.000 0.832 0.168
#> GSM386450 2 0.4121 0.8116 0.000 0.832 0.168
#> GSM386451 2 0.4121 0.8116 0.000 0.832 0.168
#> GSM386452 1 0.0000 0.9959 1.000 0.000 0.000
#> GSM386453 2 0.4121 0.8116 0.000 0.832 0.168
#> GSM386454 1 0.0000 0.9959 1.000 0.000 0.000
#> GSM386455 2 0.4974 0.7426 0.000 0.764 0.236
#> GSM386456 3 0.6274 -0.0198 0.000 0.456 0.544
#> GSM386457 2 0.4121 0.8116 0.000 0.832 0.168
#> GSM386458 2 0.4652 0.8522 0.080 0.856 0.064
#> GSM386443 1 0.0424 0.9928 0.992 0.008 0.000
#> GSM386444 3 0.0000 0.8537 0.000 0.000 1.000
#> GSM386445 3 0.0000 0.8537 0.000 0.000 1.000
#> GSM386446 3 0.0000 0.8537 0.000 0.000 1.000
#> GSM386398 1 0.0237 0.9947 0.996 0.004 0.000
#> GSM386399 1 0.0424 0.9928 0.992 0.008 0.000
#> GSM386400 1 0.0424 0.9928 0.992 0.008 0.000
#> GSM386401 2 0.4121 0.8116 0.000 0.832 0.168
#> GSM386406 2 0.0000 0.8669 0.000 1.000 0.000
#> GSM386407 2 0.2448 0.8579 0.076 0.924 0.000
#> GSM386408 2 0.3267 0.8351 0.000 0.884 0.116
#> GSM386409 1 0.0000 0.9959 1.000 0.000 0.000
#> GSM386410 1 0.0000 0.9959 1.000 0.000 0.000
#> GSM386411 2 0.0747 0.8648 0.000 0.984 0.016
#> GSM386412 2 0.4452 0.7543 0.192 0.808 0.000
#> GSM386413 2 0.0000 0.8669 0.000 1.000 0.000
#> GSM386414 2 0.2537 0.8568 0.080 0.920 0.000
#> GSM386415 2 0.2537 0.8568 0.080 0.920 0.000
#> GSM386416 2 0.6244 0.2553 0.440 0.560 0.000
#> GSM386417 2 0.2356 0.8506 0.000 0.928 0.072
#> GSM386402 3 0.0000 0.8537 0.000 0.000 1.000
#> GSM386403 3 0.4121 0.7917 0.000 0.168 0.832
#> GSM386404 3 0.4291 0.7848 0.000 0.180 0.820
#> GSM386405 3 0.0000 0.8537 0.000 0.000 1.000
#> GSM386418 2 0.2537 0.8568 0.080 0.920 0.000
#> GSM386419 2 0.4121 0.8116 0.000 0.832 0.168
#> GSM386420 2 0.0000 0.8669 0.000 1.000 0.000
#> GSM386421 2 0.0000 0.8669 0.000 1.000 0.000
#> GSM386426 1 0.0424 0.9928 0.992 0.008 0.000
#> GSM386427 1 0.0000 0.9959 1.000 0.000 0.000
#> GSM386428 2 0.0000 0.8669 0.000 1.000 0.000
#> GSM386429 2 0.2537 0.8568 0.080 0.920 0.000
#> GSM386430 2 0.2537 0.8568 0.080 0.920 0.000
#> GSM386431 2 0.2537 0.8568 0.080 0.920 0.000
#> GSM386432 2 0.0000 0.8669 0.000 1.000 0.000
#> GSM386433 2 0.2537 0.8568 0.080 0.920 0.000
#> GSM386434 2 0.2537 0.8568 0.080 0.920 0.000
#> GSM386422 3 0.0000 0.8537 0.000 0.000 1.000
#> GSM386423 1 0.0000 0.9959 1.000 0.000 0.000
#> GSM386424 3 0.3038 0.8241 0.000 0.104 0.896
#> GSM386425 3 0.0000 0.8537 0.000 0.000 1.000
#> GSM386385 2 0.0000 0.8669 0.000 1.000 0.000
#> GSM386386 1 0.0000 0.9959 1.000 0.000 0.000
#> GSM386387 2 0.4121 0.8116 0.000 0.832 0.168
#> GSM386391 2 0.2537 0.8568 0.080 0.920 0.000
#> GSM386392 1 0.0424 0.9928 0.992 0.008 0.000
#> GSM386393 2 0.6274 0.2206 0.456 0.544 0.000
#> GSM386394 1 0.0000 0.9959 1.000 0.000 0.000
#> GSM386395 2 0.2537 0.8568 0.080 0.920 0.000
#> GSM386396 2 0.2537 0.8568 0.080 0.920 0.000
#> GSM386397 2 0.2537 0.8568 0.080 0.920 0.000
#> GSM386388 3 0.4062 0.7949 0.000 0.164 0.836
#> GSM386389 1 0.0000 0.9959 1.000 0.000 0.000
#> GSM386390 3 0.4121 0.7917 0.000 0.168 0.832
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM386435 2 0.0000 0.980 0.000 1.000 0.000 0.000
#> GSM386436 2 0.0188 0.979 0.000 0.996 0.000 0.004
#> GSM386437 2 0.0921 0.961 0.000 0.972 0.000 0.028
#> GSM386438 2 0.0188 0.979 0.000 0.996 0.000 0.004
#> GSM386439 2 0.0921 0.961 0.000 0.972 0.000 0.028
#> GSM386440 2 0.0000 0.980 0.000 1.000 0.000 0.000
#> GSM386441 2 0.0000 0.980 0.000 1.000 0.000 0.000
#> GSM386442 2 0.0000 0.980 0.000 1.000 0.000 0.000
#> GSM386447 2 0.4761 0.422 0.000 0.628 0.000 0.372
#> GSM386448 2 0.0000 0.980 0.000 1.000 0.000 0.000
#> GSM386449 2 0.0000 0.980 0.000 1.000 0.000 0.000
#> GSM386450 2 0.0000 0.980 0.000 1.000 0.000 0.000
#> GSM386451 2 0.0000 0.980 0.000 1.000 0.000 0.000
#> GSM386452 1 0.0000 0.989 1.000 0.000 0.000 0.000
#> GSM386453 2 0.0000 0.980 0.000 1.000 0.000 0.000
#> GSM386454 1 0.0000 0.989 1.000 0.000 0.000 0.000
#> GSM386455 2 0.0000 0.980 0.000 1.000 0.000 0.000
#> GSM386456 2 0.0000 0.980 0.000 1.000 0.000 0.000
#> GSM386457 2 0.0000 0.980 0.000 1.000 0.000 0.000
#> GSM386458 2 0.0188 0.979 0.000 0.996 0.000 0.004
#> GSM386443 1 0.0817 0.981 0.976 0.000 0.000 0.024
#> GSM386444 3 0.0000 0.999 0.000 0.000 1.000 0.000
#> GSM386445 3 0.0000 0.999 0.000 0.000 1.000 0.000
#> GSM386446 3 0.0000 0.999 0.000 0.000 1.000 0.000
#> GSM386398 1 0.0469 0.986 0.988 0.000 0.000 0.012
#> GSM386399 1 0.0817 0.981 0.976 0.000 0.000 0.024
#> GSM386400 1 0.0817 0.981 0.976 0.000 0.000 0.024
#> GSM386401 2 0.0000 0.980 0.000 1.000 0.000 0.000
#> GSM386406 2 0.0188 0.979 0.000 0.996 0.000 0.004
#> GSM386407 4 0.0000 1.000 0.000 0.000 0.000 1.000
#> GSM386408 2 0.0188 0.979 0.000 0.996 0.000 0.004
#> GSM386409 1 0.0000 0.989 1.000 0.000 0.000 0.000
#> GSM386410 1 0.0000 0.989 1.000 0.000 0.000 0.000
#> GSM386411 2 0.0000 0.980 0.000 1.000 0.000 0.000
#> GSM386412 4 0.0000 1.000 0.000 0.000 0.000 1.000
#> GSM386413 2 0.0188 0.979 0.000 0.996 0.000 0.004
#> GSM386414 4 0.0000 1.000 0.000 0.000 0.000 1.000
#> GSM386415 4 0.0000 1.000 0.000 0.000 0.000 1.000
#> GSM386416 4 0.0000 1.000 0.000 0.000 0.000 1.000
#> GSM386417 2 0.0000 0.980 0.000 1.000 0.000 0.000
#> GSM386402 3 0.0000 0.999 0.000 0.000 1.000 0.000
#> GSM386403 3 0.0000 0.999 0.000 0.000 1.000 0.000
#> GSM386404 3 0.0336 0.990 0.000 0.000 0.992 0.008
#> GSM386405 3 0.0000 0.999 0.000 0.000 1.000 0.000
#> GSM386418 4 0.0000 1.000 0.000 0.000 0.000 1.000
#> GSM386419 2 0.0000 0.980 0.000 1.000 0.000 0.000
#> GSM386420 2 0.0188 0.979 0.000 0.996 0.000 0.004
#> GSM386421 4 0.0000 1.000 0.000 0.000 0.000 1.000
#> GSM386426 1 0.0817 0.981 0.976 0.000 0.000 0.024
#> GSM386427 1 0.0000 0.989 1.000 0.000 0.000 0.000
#> GSM386428 2 0.0921 0.961 0.000 0.972 0.000 0.028
#> GSM386429 4 0.0000 1.000 0.000 0.000 0.000 1.000
#> GSM386430 4 0.0000 1.000 0.000 0.000 0.000 1.000
#> GSM386431 4 0.0000 1.000 0.000 0.000 0.000 1.000
#> GSM386432 4 0.0000 1.000 0.000 0.000 0.000 1.000
#> GSM386433 4 0.0000 1.000 0.000 0.000 0.000 1.000
#> GSM386434 4 0.0000 1.000 0.000 0.000 0.000 1.000
#> GSM386422 3 0.0000 0.999 0.000 0.000 1.000 0.000
#> GSM386423 1 0.0000 0.989 1.000 0.000 0.000 0.000
#> GSM386424 3 0.0000 0.999 0.000 0.000 1.000 0.000
#> GSM386425 3 0.0000 0.999 0.000 0.000 1.000 0.000
#> GSM386385 2 0.0921 0.961 0.000 0.972 0.000 0.028
#> GSM386386 1 0.0000 0.989 1.000 0.000 0.000 0.000
#> GSM386387 2 0.0000 0.980 0.000 1.000 0.000 0.000
#> GSM386391 4 0.0000 1.000 0.000 0.000 0.000 1.000
#> GSM386392 1 0.0817 0.981 0.976 0.000 0.000 0.024
#> GSM386393 4 0.0000 1.000 0.000 0.000 0.000 1.000
#> GSM386394 1 0.0000 0.989 1.000 0.000 0.000 0.000
#> GSM386395 4 0.0000 1.000 0.000 0.000 0.000 1.000
#> GSM386396 4 0.0000 1.000 0.000 0.000 0.000 1.000
#> GSM386397 4 0.0000 1.000 0.000 0.000 0.000 1.000
#> GSM386388 3 0.0000 0.999 0.000 0.000 1.000 0.000
#> GSM386389 1 0.0000 0.989 1.000 0.000 0.000 0.000
#> GSM386390 3 0.0000 0.999 0.000 0.000 1.000 0.000
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM386435 2 0.3074 0.812 0.196 0.804 0.000 0.000 0.000
#> GSM386436 2 0.4151 0.855 0.344 0.652 0.000 0.004 0.000
#> GSM386437 2 0.4151 0.855 0.344 0.652 0.000 0.004 0.000
#> GSM386438 2 0.4151 0.855 0.344 0.652 0.000 0.004 0.000
#> GSM386439 2 0.4151 0.855 0.344 0.652 0.000 0.004 0.000
#> GSM386440 2 0.0000 0.743 0.000 1.000 0.000 0.000 0.000
#> GSM386441 2 0.0000 0.743 0.000 1.000 0.000 0.000 0.000
#> GSM386442 2 0.3999 0.855 0.344 0.656 0.000 0.000 0.000
#> GSM386447 2 0.6763 0.515 0.332 0.392 0.000 0.276 0.000
#> GSM386448 2 0.0000 0.743 0.000 1.000 0.000 0.000 0.000
#> GSM386449 2 0.3999 0.855 0.344 0.656 0.000 0.000 0.000
#> GSM386450 2 0.0000 0.743 0.000 1.000 0.000 0.000 0.000
#> GSM386451 2 0.0000 0.743 0.000 1.000 0.000 0.000 0.000
#> GSM386452 5 0.0000 0.888 0.000 0.000 0.000 0.000 1.000
#> GSM386453 2 0.0000 0.743 0.000 1.000 0.000 0.000 0.000
#> GSM386454 1 0.3999 1.000 0.656 0.000 0.000 0.000 0.344
#> GSM386455 2 0.0000 0.743 0.000 1.000 0.000 0.000 0.000
#> GSM386456 2 0.0000 0.743 0.000 1.000 0.000 0.000 0.000
#> GSM386457 2 0.0000 0.743 0.000 1.000 0.000 0.000 0.000
#> GSM386458 2 0.4151 0.855 0.344 0.652 0.000 0.004 0.000
#> GSM386443 1 0.3999 1.000 0.656 0.000 0.000 0.000 0.344
#> GSM386444 3 0.0000 0.999 0.000 0.000 1.000 0.000 0.000
#> GSM386445 3 0.0000 0.999 0.000 0.000 1.000 0.000 0.000
#> GSM386446 3 0.0000 0.999 0.000 0.000 1.000 0.000 0.000
#> GSM386398 1 0.3999 1.000 0.656 0.000 0.000 0.000 0.344
#> GSM386399 1 0.3999 1.000 0.656 0.000 0.000 0.000 0.344
#> GSM386400 1 0.3999 1.000 0.656 0.000 0.000 0.000 0.344
#> GSM386401 2 0.0000 0.743 0.000 1.000 0.000 0.000 0.000
#> GSM386406 2 0.4151 0.855 0.344 0.652 0.000 0.004 0.000
#> GSM386407 4 0.0000 0.957 0.000 0.000 0.000 1.000 0.000
#> GSM386408 2 0.4151 0.855 0.344 0.652 0.000 0.004 0.000
#> GSM386409 1 0.3999 1.000 0.656 0.000 0.000 0.000 0.344
#> GSM386410 5 0.0000 0.888 0.000 0.000 0.000 0.000 1.000
#> GSM386411 2 0.3999 0.855 0.344 0.656 0.000 0.000 0.000
#> GSM386412 4 0.0000 0.957 0.000 0.000 0.000 1.000 0.000
#> GSM386413 2 0.4151 0.855 0.344 0.652 0.000 0.004 0.000
#> GSM386414 4 0.0000 0.957 0.000 0.000 0.000 1.000 0.000
#> GSM386415 4 0.0000 0.957 0.000 0.000 0.000 1.000 0.000
#> GSM386416 4 0.0000 0.957 0.000 0.000 0.000 1.000 0.000
#> GSM386417 2 0.3999 0.855 0.344 0.656 0.000 0.000 0.000
#> GSM386402 3 0.0000 0.999 0.000 0.000 1.000 0.000 0.000
#> GSM386403 3 0.0000 0.999 0.000 0.000 1.000 0.000 0.000
#> GSM386404 3 0.0162 0.994 0.000 0.000 0.996 0.004 0.000
#> GSM386405 3 0.0000 0.999 0.000 0.000 1.000 0.000 0.000
#> GSM386418 4 0.3424 0.674 0.240 0.000 0.000 0.760 0.000
#> GSM386419 2 0.3999 0.855 0.344 0.656 0.000 0.000 0.000
#> GSM386420 2 0.4151 0.855 0.344 0.652 0.000 0.004 0.000
#> GSM386421 4 0.3999 0.525 0.344 0.000 0.000 0.656 0.000
#> GSM386426 1 0.3999 1.000 0.656 0.000 0.000 0.000 0.344
#> GSM386427 5 0.0000 0.888 0.000 0.000 0.000 0.000 1.000
#> GSM386428 2 0.4151 0.855 0.344 0.652 0.000 0.004 0.000
#> GSM386429 4 0.0000 0.957 0.000 0.000 0.000 1.000 0.000
#> GSM386430 4 0.0000 0.957 0.000 0.000 0.000 1.000 0.000
#> GSM386431 4 0.0000 0.957 0.000 0.000 0.000 1.000 0.000
#> GSM386432 4 0.0000 0.957 0.000 0.000 0.000 1.000 0.000
#> GSM386433 4 0.0000 0.957 0.000 0.000 0.000 1.000 0.000
#> GSM386434 4 0.0000 0.957 0.000 0.000 0.000 1.000 0.000
#> GSM386422 3 0.0000 0.999 0.000 0.000 1.000 0.000 0.000
#> GSM386423 1 0.3999 1.000 0.656 0.000 0.000 0.000 0.344
#> GSM386424 3 0.0000 0.999 0.000 0.000 1.000 0.000 0.000
#> GSM386425 3 0.0000 0.999 0.000 0.000 1.000 0.000 0.000
#> GSM386385 2 0.4151 0.855 0.344 0.652 0.000 0.004 0.000
#> GSM386386 1 0.3999 1.000 0.656 0.000 0.000 0.000 0.344
#> GSM386387 2 0.3966 0.854 0.336 0.664 0.000 0.000 0.000
#> GSM386391 4 0.0000 0.957 0.000 0.000 0.000 1.000 0.000
#> GSM386392 1 0.3999 1.000 0.656 0.000 0.000 0.000 0.344
#> GSM386393 4 0.0000 0.957 0.000 0.000 0.000 1.000 0.000
#> GSM386394 5 0.0000 0.888 0.000 0.000 0.000 0.000 1.000
#> GSM386395 4 0.0000 0.957 0.000 0.000 0.000 1.000 0.000
#> GSM386396 4 0.0000 0.957 0.000 0.000 0.000 1.000 0.000
#> GSM386397 4 0.0000 0.957 0.000 0.000 0.000 1.000 0.000
#> GSM386388 3 0.0000 0.999 0.000 0.000 1.000 0.000 0.000
#> GSM386389 5 0.3707 0.237 0.284 0.000 0.000 0.000 0.716
#> GSM386390 3 0.0000 0.999 0.000 0.000 1.000 0.000 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM386435 2 0.2416 0.506 0.000 0.844 0.000 0.000 0.000 0.156
#> GSM386436 2 0.0363 0.854 0.000 0.988 0.000 0.012 0.000 0.000
#> GSM386437 2 0.0363 0.854 0.000 0.988 0.000 0.012 0.000 0.000
#> GSM386438 2 0.0363 0.854 0.000 0.988 0.000 0.012 0.000 0.000
#> GSM386439 2 0.2527 0.708 0.000 0.832 0.000 0.000 0.000 0.168
#> GSM386440 6 0.3823 1.000 0.000 0.436 0.000 0.000 0.000 0.564
#> GSM386441 6 0.3823 1.000 0.000 0.436 0.000 0.000 0.000 0.564
#> GSM386442 2 0.0000 0.845 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM386447 2 0.4595 0.532 0.000 0.696 0.000 0.136 0.000 0.168
#> GSM386448 6 0.3823 1.000 0.000 0.436 0.000 0.000 0.000 0.564
#> GSM386449 2 0.0146 0.842 0.000 0.996 0.000 0.000 0.000 0.004
#> GSM386450 6 0.3823 1.000 0.000 0.436 0.000 0.000 0.000 0.564
#> GSM386451 6 0.3823 1.000 0.000 0.436 0.000 0.000 0.000 0.564
#> GSM386452 5 0.0000 1.000 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM386453 6 0.3823 1.000 0.000 0.436 0.000 0.000 0.000 0.564
#> GSM386454 1 0.0000 0.854 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM386455 6 0.3823 1.000 0.000 0.436 0.000 0.000 0.000 0.564
#> GSM386456 6 0.3823 1.000 0.000 0.436 0.000 0.000 0.000 0.564
#> GSM386457 6 0.3823 1.000 0.000 0.436 0.000 0.000 0.000 0.564
#> GSM386458 2 0.2527 0.708 0.000 0.832 0.000 0.000 0.000 0.168
#> GSM386443 1 0.3244 0.726 0.732 0.000 0.000 0.000 0.000 0.268
#> GSM386444 3 0.0000 0.996 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386445 3 0.0000 0.996 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386446 3 0.0000 0.996 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386398 1 0.1765 0.824 0.904 0.000 0.000 0.000 0.000 0.096
#> GSM386399 1 0.2527 0.783 0.832 0.000 0.000 0.000 0.000 0.168
#> GSM386400 1 0.2527 0.783 0.832 0.000 0.000 0.000 0.000 0.168
#> GSM386401 6 0.3823 1.000 0.000 0.436 0.000 0.000 0.000 0.564
#> GSM386406 2 0.0363 0.854 0.000 0.988 0.000 0.012 0.000 0.000
#> GSM386407 4 0.0000 0.964 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM386408 2 0.0363 0.854 0.000 0.988 0.000 0.012 0.000 0.000
#> GSM386409 1 0.0000 0.854 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM386410 5 0.0000 1.000 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM386411 2 0.0363 0.854 0.000 0.988 0.000 0.012 0.000 0.000
#> GSM386412 4 0.0363 0.953 0.000 0.000 0.000 0.988 0.000 0.012
#> GSM386413 2 0.0363 0.854 0.000 0.988 0.000 0.012 0.000 0.000
#> GSM386414 4 0.0000 0.964 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM386415 4 0.0000 0.964 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM386416 4 0.2527 0.789 0.000 0.000 0.000 0.832 0.000 0.168
#> GSM386417 2 0.0000 0.845 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM386402 3 0.0000 0.996 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386403 3 0.0000 0.996 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386404 3 0.0891 0.956 0.000 0.024 0.968 0.008 0.000 0.000
#> GSM386405 3 0.0000 0.996 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386418 4 0.3198 0.608 0.000 0.260 0.000 0.740 0.000 0.000
#> GSM386419 2 0.0000 0.845 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM386420 2 0.0363 0.854 0.000 0.988 0.000 0.012 0.000 0.000
#> GSM386421 2 0.3823 0.152 0.000 0.564 0.000 0.436 0.000 0.000
#> GSM386426 1 0.0000 0.854 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM386427 5 0.0000 1.000 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM386428 2 0.0363 0.854 0.000 0.988 0.000 0.012 0.000 0.000
#> GSM386429 4 0.0000 0.964 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM386430 4 0.0000 0.964 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM386431 4 0.0000 0.964 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM386432 4 0.0547 0.945 0.000 0.020 0.000 0.980 0.000 0.000
#> GSM386433 4 0.0000 0.964 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM386434 4 0.0000 0.964 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM386422 3 0.0000 0.996 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386423 1 0.3244 0.726 0.732 0.000 0.000 0.000 0.000 0.268
#> GSM386424 3 0.0000 0.996 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386425 3 0.0000 0.996 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386385 2 0.2768 0.715 0.000 0.832 0.000 0.012 0.000 0.156
#> GSM386386 1 0.0000 0.854 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM386387 2 0.0865 0.800 0.000 0.964 0.000 0.000 0.000 0.036
#> GSM386391 4 0.0000 0.964 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM386392 1 0.0000 0.854 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM386393 4 0.0000 0.964 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM386394 5 0.0000 1.000 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM386395 4 0.0000 0.964 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM386396 4 0.0000 0.964 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM386397 4 0.0000 0.964 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM386388 3 0.0000 0.996 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386389 1 0.5992 0.295 0.440 0.000 0.000 0.000 0.292 0.268
#> GSM386390 3 0.0000 0.996 0.000 0.000 1.000 0.000 0.000 0.000
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
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 agent(p) dose(p) time(p) k
#> ATC:pam 71 3.55e-01 0.43242 3.31e-01 2
#> ATC:pam 71 4.71e-01 0.75799 1.44e-09 3
#> ATC:pam 73 1.08e-03 0.00486 1.64e-10 4
#> ATC:pam 73 3.60e-03 0.01826 5.93e-11 5
#> ATC:pam 72 2.82e-05 0.01848 9.20e-11 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 51941 rows and 74 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.631 0.886 0.913 0.4481 0.496 0.496
#> 3 3 0.677 0.872 0.812 0.3565 0.873 0.752
#> 4 4 0.949 0.952 0.964 0.2168 0.813 0.555
#> 5 5 0.786 0.766 0.859 0.0322 0.911 0.689
#> 6 6 0.800 0.773 0.867 0.0131 0.833 0.479
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
#> GSM386435 2 0.0000 0.988 0.000 1.000
#> GSM386436 2 0.0000 0.988 0.000 1.000
#> GSM386437 2 0.0672 0.983 0.008 0.992
#> GSM386438 2 0.0000 0.988 0.000 1.000
#> GSM386439 1 0.9044 0.781 0.680 0.320
#> GSM386440 2 0.0000 0.988 0.000 1.000
#> GSM386441 2 0.0000 0.988 0.000 1.000
#> GSM386442 2 0.0000 0.988 0.000 1.000
#> GSM386447 1 0.9044 0.781 0.680 0.320
#> GSM386448 2 0.0000 0.988 0.000 1.000
#> GSM386449 2 0.0000 0.988 0.000 1.000
#> GSM386450 2 0.0000 0.988 0.000 1.000
#> GSM386451 2 0.0000 0.988 0.000 1.000
#> GSM386452 1 0.9044 0.781 0.680 0.320
#> GSM386453 2 0.0000 0.988 0.000 1.000
#> GSM386454 1 0.9044 0.781 0.680 0.320
#> GSM386455 2 0.0672 0.983 0.008 0.992
#> GSM386456 2 0.0672 0.983 0.008 0.992
#> GSM386457 1 0.9129 0.769 0.672 0.328
#> GSM386458 1 0.9044 0.781 0.680 0.320
#> GSM386443 1 0.0000 0.787 1.000 0.000
#> GSM386444 1 0.0000 0.787 1.000 0.000
#> GSM386445 1 0.0000 0.787 1.000 0.000
#> GSM386446 1 0.0000 0.787 1.000 0.000
#> GSM386398 1 0.9044 0.781 0.680 0.320
#> GSM386399 1 0.9044 0.781 0.680 0.320
#> GSM386400 1 0.9044 0.781 0.680 0.320
#> GSM386401 2 0.0000 0.988 0.000 1.000
#> GSM386406 2 0.0000 0.988 0.000 1.000
#> GSM386407 2 0.0000 0.988 0.000 1.000
#> GSM386408 2 0.0000 0.988 0.000 1.000
#> GSM386409 1 0.9044 0.781 0.680 0.320
#> GSM386410 1 0.9044 0.781 0.680 0.320
#> GSM386411 2 0.0000 0.988 0.000 1.000
#> GSM386412 1 0.9044 0.781 0.680 0.320
#> GSM386413 2 0.0000 0.988 0.000 1.000
#> GSM386414 2 0.8386 0.480 0.268 0.732
#> GSM386415 2 0.0672 0.983 0.008 0.992
#> GSM386416 1 0.9044 0.781 0.680 0.320
#> GSM386417 2 0.0672 0.983 0.008 0.992
#> GSM386402 1 0.0000 0.787 1.000 0.000
#> GSM386403 1 0.0000 0.787 1.000 0.000
#> GSM386404 1 0.0000 0.787 1.000 0.000
#> GSM386405 1 0.0000 0.787 1.000 0.000
#> GSM386418 2 0.0000 0.988 0.000 1.000
#> GSM386419 2 0.0000 0.988 0.000 1.000
#> GSM386420 2 0.0000 0.988 0.000 1.000
#> GSM386421 2 0.0000 0.988 0.000 1.000
#> GSM386426 1 0.9044 0.781 0.680 0.320
#> GSM386427 1 0.9044 0.781 0.680 0.320
#> GSM386428 2 0.0000 0.988 0.000 1.000
#> GSM386429 2 0.0000 0.988 0.000 1.000
#> GSM386430 2 0.0672 0.983 0.008 0.992
#> GSM386431 2 0.0000 0.988 0.000 1.000
#> GSM386432 2 0.0000 0.988 0.000 1.000
#> GSM386433 2 0.0672 0.983 0.008 0.992
#> GSM386434 2 0.0672 0.983 0.008 0.992
#> GSM386422 1 0.0000 0.787 1.000 0.000
#> GSM386423 1 0.0000 0.787 1.000 0.000
#> GSM386424 1 0.0000 0.787 1.000 0.000
#> GSM386425 1 0.0000 0.787 1.000 0.000
#> GSM386385 1 0.9087 0.775 0.676 0.324
#> GSM386386 1 0.9044 0.781 0.680 0.320
#> GSM386387 2 0.0000 0.988 0.000 1.000
#> GSM386391 2 0.0000 0.988 0.000 1.000
#> GSM386392 1 0.9044 0.781 0.680 0.320
#> GSM386393 2 0.0000 0.988 0.000 1.000
#> GSM386394 1 0.9044 0.781 0.680 0.320
#> GSM386395 2 0.0000 0.988 0.000 1.000
#> GSM386396 2 0.0672 0.983 0.008 0.992
#> GSM386397 2 0.0672 0.983 0.008 0.992
#> GSM386388 1 0.0000 0.787 1.000 0.000
#> GSM386389 1 0.0000 0.787 1.000 0.000
#> GSM386390 1 0.0000 0.787 1.000 0.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM386435 2 0.5678 0.821 0.000 0.684 0.316
#> GSM386436 2 0.5621 0.823 0.000 0.692 0.308
#> GSM386437 2 0.3742 0.828 0.072 0.892 0.036
#> GSM386438 2 0.5216 0.835 0.000 0.740 0.260
#> GSM386439 1 0.2878 0.934 0.904 0.096 0.000
#> GSM386440 2 0.5678 0.821 0.000 0.684 0.316
#> GSM386441 2 0.5678 0.821 0.000 0.684 0.316
#> GSM386442 2 0.5678 0.821 0.000 0.684 0.316
#> GSM386447 1 0.2959 0.932 0.900 0.100 0.000
#> GSM386448 2 0.5678 0.821 0.000 0.684 0.316
#> GSM386449 2 0.5678 0.821 0.000 0.684 0.316
#> GSM386450 2 0.5650 0.822 0.000 0.688 0.312
#> GSM386451 2 0.5817 0.838 0.020 0.744 0.236
#> GSM386452 1 0.2448 0.930 0.924 0.076 0.000
#> GSM386453 2 0.5678 0.821 0.000 0.684 0.316
#> GSM386454 1 0.2878 0.934 0.904 0.096 0.000
#> GSM386455 2 0.6435 0.829 0.076 0.756 0.168
#> GSM386456 2 0.6488 0.828 0.084 0.756 0.160
#> GSM386457 2 0.5926 0.539 0.356 0.644 0.000
#> GSM386458 1 0.1411 0.829 0.964 0.036 0.000
#> GSM386443 3 0.5733 0.990 0.324 0.000 0.676
#> GSM386444 3 0.5678 0.997 0.316 0.000 0.684
#> GSM386445 3 0.5678 0.997 0.316 0.000 0.684
#> GSM386446 3 0.5678 0.997 0.316 0.000 0.684
#> GSM386398 1 0.2711 0.930 0.912 0.088 0.000
#> GSM386399 1 0.2878 0.934 0.904 0.096 0.000
#> GSM386400 1 0.2711 0.930 0.912 0.088 0.000
#> GSM386401 2 0.5678 0.821 0.000 0.684 0.316
#> GSM386406 2 0.5138 0.836 0.000 0.748 0.252
#> GSM386407 2 0.0000 0.832 0.000 1.000 0.000
#> GSM386408 2 0.5178 0.835 0.000 0.744 0.256
#> GSM386409 1 0.2878 0.934 0.904 0.096 0.000
#> GSM386410 1 0.2448 0.930 0.924 0.076 0.000
#> GSM386411 2 0.4605 0.841 0.000 0.796 0.204
#> GSM386412 1 0.3192 0.919 0.888 0.112 0.000
#> GSM386413 2 0.0000 0.832 0.000 1.000 0.000
#> GSM386414 2 0.3551 0.788 0.132 0.868 0.000
#> GSM386415 2 0.2448 0.804 0.076 0.924 0.000
#> GSM386416 1 0.1753 0.826 0.952 0.048 0.000
#> GSM386417 2 0.2448 0.804 0.076 0.924 0.000
#> GSM386402 3 0.5678 0.997 0.316 0.000 0.684
#> GSM386403 3 0.5678 0.997 0.316 0.000 0.684
#> GSM386404 3 0.5678 0.997 0.316 0.000 0.684
#> GSM386405 3 0.5678 0.997 0.316 0.000 0.684
#> GSM386418 2 0.0892 0.829 0.020 0.980 0.000
#> GSM386419 2 0.5678 0.821 0.000 0.684 0.316
#> GSM386420 2 0.5591 0.824 0.000 0.696 0.304
#> GSM386421 2 0.0892 0.829 0.020 0.980 0.000
#> GSM386426 1 0.2537 0.930 0.920 0.080 0.000
#> GSM386427 1 0.2448 0.930 0.924 0.076 0.000
#> GSM386428 2 0.5414 0.841 0.016 0.772 0.212
#> GSM386429 2 0.0892 0.829 0.020 0.980 0.000
#> GSM386430 2 0.0892 0.829 0.020 0.980 0.000
#> GSM386431 2 0.0892 0.829 0.020 0.980 0.000
#> GSM386432 2 0.0237 0.831 0.004 0.996 0.000
#> GSM386433 2 0.2448 0.804 0.076 0.924 0.000
#> GSM386434 2 0.2448 0.804 0.076 0.924 0.000
#> GSM386422 3 0.5678 0.997 0.316 0.000 0.684
#> GSM386423 3 0.5733 0.990 0.324 0.000 0.676
#> GSM386424 3 0.5678 0.997 0.316 0.000 0.684
#> GSM386425 3 0.5678 0.997 0.316 0.000 0.684
#> GSM386385 1 0.5882 0.507 0.652 0.348 0.000
#> GSM386386 1 0.2448 0.930 0.924 0.076 0.000
#> GSM386387 2 0.5621 0.823 0.000 0.692 0.308
#> GSM386391 2 0.0892 0.829 0.020 0.980 0.000
#> GSM386392 1 0.2625 0.932 0.916 0.084 0.000
#> GSM386393 2 0.0892 0.829 0.020 0.980 0.000
#> GSM386394 1 0.2448 0.930 0.924 0.076 0.000
#> GSM386395 2 0.0892 0.829 0.020 0.980 0.000
#> GSM386396 2 0.2711 0.801 0.088 0.912 0.000
#> GSM386397 2 0.0892 0.829 0.020 0.980 0.000
#> GSM386388 3 0.5678 0.997 0.316 0.000 0.684
#> GSM386389 3 0.5733 0.990 0.324 0.000 0.676
#> GSM386390 3 0.5678 0.997 0.316 0.000 0.684
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM386435 2 0.0336 0.966 0.000 0.992 0.000 0.008
#> GSM386436 2 0.0188 0.966 0.000 0.996 0.000 0.004
#> GSM386437 2 0.2469 0.902 0.000 0.892 0.000 0.108
#> GSM386438 2 0.0469 0.966 0.000 0.988 0.000 0.012
#> GSM386439 1 0.0000 0.968 1.000 0.000 0.000 0.000
#> GSM386440 2 0.0000 0.965 0.000 1.000 0.000 0.000
#> GSM386441 2 0.0000 0.965 0.000 1.000 0.000 0.000
#> GSM386442 2 0.0188 0.966 0.000 0.996 0.000 0.004
#> GSM386447 1 0.0000 0.968 1.000 0.000 0.000 0.000
#> GSM386448 2 0.0000 0.965 0.000 1.000 0.000 0.000
#> GSM386449 2 0.0000 0.965 0.000 1.000 0.000 0.000
#> GSM386450 2 0.0188 0.966 0.000 0.996 0.000 0.004
#> GSM386451 2 0.0592 0.965 0.000 0.984 0.000 0.016
#> GSM386452 1 0.0000 0.968 1.000 0.000 0.000 0.000
#> GSM386453 2 0.0336 0.966 0.000 0.992 0.000 0.008
#> GSM386454 1 0.0000 0.968 1.000 0.000 0.000 0.000
#> GSM386455 2 0.2530 0.898 0.000 0.888 0.000 0.112
#> GSM386456 2 0.2469 0.902 0.000 0.892 0.000 0.108
#> GSM386457 2 0.2654 0.900 0.004 0.888 0.000 0.108
#> GSM386458 1 0.0469 0.964 0.988 0.000 0.000 0.012
#> GSM386443 1 0.1389 0.951 0.952 0.000 0.000 0.048
#> GSM386444 3 0.0000 1.000 0.000 0.000 1.000 0.000
#> GSM386445 3 0.0000 1.000 0.000 0.000 1.000 0.000
#> GSM386446 3 0.0000 1.000 0.000 0.000 1.000 0.000
#> GSM386398 1 0.1118 0.955 0.964 0.000 0.000 0.036
#> GSM386399 1 0.0000 0.968 1.000 0.000 0.000 0.000
#> GSM386400 1 0.1118 0.955 0.964 0.000 0.000 0.036
#> GSM386401 2 0.0000 0.965 0.000 1.000 0.000 0.000
#> GSM386406 2 0.0000 0.965 0.000 1.000 0.000 0.000
#> GSM386407 4 0.2081 0.940 0.000 0.084 0.000 0.916
#> GSM386408 2 0.0469 0.966 0.000 0.988 0.000 0.012
#> GSM386409 1 0.0000 0.968 1.000 0.000 0.000 0.000
#> GSM386410 1 0.0000 0.968 1.000 0.000 0.000 0.000
#> GSM386411 2 0.1867 0.930 0.000 0.928 0.000 0.072
#> GSM386412 1 0.1118 0.947 0.964 0.000 0.000 0.036
#> GSM386413 4 0.4679 0.503 0.000 0.352 0.000 0.648
#> GSM386414 4 0.1389 0.971 0.000 0.048 0.000 0.952
#> GSM386415 4 0.1389 0.971 0.000 0.048 0.000 0.952
#> GSM386416 1 0.0469 0.964 0.988 0.000 0.000 0.012
#> GSM386417 4 0.2647 0.903 0.000 0.120 0.000 0.880
#> GSM386402 3 0.0000 1.000 0.000 0.000 1.000 0.000
#> GSM386403 3 0.0000 1.000 0.000 0.000 1.000 0.000
#> GSM386404 3 0.0000 1.000 0.000 0.000 1.000 0.000
#> GSM386405 3 0.0000 1.000 0.000 0.000 1.000 0.000
#> GSM386418 4 0.1557 0.964 0.000 0.056 0.000 0.944
#> GSM386419 2 0.0000 0.965 0.000 1.000 0.000 0.000
#> GSM386420 2 0.0469 0.966 0.000 0.988 0.000 0.012
#> GSM386421 4 0.1389 0.971 0.000 0.048 0.000 0.952
#> GSM386426 1 0.0000 0.968 1.000 0.000 0.000 0.000
#> GSM386427 1 0.0000 0.968 1.000 0.000 0.000 0.000
#> GSM386428 2 0.2408 0.904 0.000 0.896 0.000 0.104
#> GSM386429 4 0.1389 0.971 0.000 0.048 0.000 0.952
#> GSM386430 4 0.1389 0.971 0.000 0.048 0.000 0.952
#> GSM386431 4 0.1389 0.971 0.000 0.048 0.000 0.952
#> GSM386432 4 0.1389 0.971 0.000 0.048 0.000 0.952
#> GSM386433 4 0.1389 0.971 0.000 0.048 0.000 0.952
#> GSM386434 4 0.1389 0.971 0.000 0.048 0.000 0.952
#> GSM386422 3 0.0000 1.000 0.000 0.000 1.000 0.000
#> GSM386423 1 0.1584 0.949 0.952 0.000 0.012 0.036
#> GSM386424 3 0.0000 1.000 0.000 0.000 1.000 0.000
#> GSM386425 3 0.0000 1.000 0.000 0.000 1.000 0.000
#> GSM386385 1 0.6280 0.415 0.612 0.304 0.000 0.084
#> GSM386386 1 0.0000 0.968 1.000 0.000 0.000 0.000
#> GSM386387 2 0.0469 0.966 0.000 0.988 0.000 0.012
#> GSM386391 4 0.1389 0.971 0.000 0.048 0.000 0.952
#> GSM386392 1 0.0000 0.968 1.000 0.000 0.000 0.000
#> GSM386393 4 0.1389 0.971 0.000 0.048 0.000 0.952
#> GSM386394 1 0.0000 0.968 1.000 0.000 0.000 0.000
#> GSM386395 4 0.1389 0.971 0.000 0.048 0.000 0.952
#> GSM386396 4 0.1389 0.971 0.000 0.048 0.000 0.952
#> GSM386397 4 0.1389 0.971 0.000 0.048 0.000 0.952
#> GSM386388 3 0.0000 1.000 0.000 0.000 1.000 0.000
#> GSM386389 1 0.1584 0.949 0.952 0.000 0.012 0.036
#> GSM386390 3 0.0000 1.000 0.000 0.000 1.000 0.000
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM386435 2 0.0880 0.886 0.000 0.968 0.000 0.000 0.032
#> GSM386436 2 0.0162 0.888 0.000 0.996 0.000 0.004 0.000
#> GSM386437 4 0.4521 0.558 0.012 0.316 0.000 0.664 0.008
#> GSM386438 2 0.0404 0.886 0.000 0.988 0.000 0.012 0.000
#> GSM386439 1 0.0880 0.544 0.968 0.000 0.000 0.032 0.000
#> GSM386440 2 0.1478 0.879 0.000 0.936 0.000 0.000 0.064
#> GSM386441 2 0.1478 0.879 0.000 0.936 0.000 0.000 0.064
#> GSM386442 2 0.0162 0.888 0.000 0.996 0.000 0.004 0.000
#> GSM386447 1 0.0955 0.541 0.968 0.004 0.000 0.028 0.000
#> GSM386448 2 0.1478 0.879 0.000 0.936 0.000 0.000 0.064
#> GSM386449 2 0.0000 0.888 0.000 1.000 0.000 0.000 0.000
#> GSM386450 2 0.1410 0.880 0.000 0.940 0.000 0.000 0.060
#> GSM386451 2 0.5452 -0.188 0.000 0.492 0.000 0.448 0.060
#> GSM386452 1 0.3752 0.681 0.708 0.000 0.000 0.000 0.292
#> GSM386453 2 0.1341 0.881 0.000 0.944 0.000 0.000 0.056
#> GSM386454 1 0.3992 0.689 0.720 0.000 0.000 0.012 0.268
#> GSM386455 4 0.5852 0.506 0.000 0.328 0.000 0.556 0.116
#> GSM386456 4 0.6378 0.476 0.008 0.296 0.000 0.536 0.160
#> GSM386457 4 0.6239 0.457 0.004 0.268 0.000 0.556 0.172
#> GSM386458 1 0.4691 0.614 0.680 0.000 0.000 0.044 0.276
#> GSM386443 5 0.2891 0.993 0.176 0.000 0.000 0.000 0.824
#> GSM386444 3 0.0162 0.997 0.000 0.000 0.996 0.000 0.004
#> GSM386445 3 0.0162 0.997 0.000 0.000 0.996 0.000 0.004
#> GSM386446 3 0.0162 0.997 0.000 0.000 0.996 0.000 0.004
#> GSM386398 1 0.4114 0.686 0.712 0.000 0.000 0.016 0.272
#> GSM386399 1 0.4090 0.687 0.716 0.000 0.000 0.016 0.268
#> GSM386400 1 0.4114 0.686 0.712 0.000 0.000 0.016 0.272
#> GSM386401 2 0.1478 0.879 0.000 0.936 0.000 0.000 0.064
#> GSM386406 2 0.2074 0.804 0.000 0.896 0.000 0.104 0.000
#> GSM386407 4 0.2690 0.845 0.000 0.156 0.000 0.844 0.000
#> GSM386408 2 0.0162 0.888 0.000 0.996 0.000 0.004 0.000
#> GSM386409 1 0.3766 0.691 0.728 0.000 0.000 0.004 0.268
#> GSM386410 1 0.3752 0.681 0.708 0.000 0.000 0.000 0.292
#> GSM386411 2 0.4302 -0.284 0.000 0.520 0.000 0.480 0.000
#> GSM386412 1 0.5179 -0.250 0.496 0.020 0.000 0.472 0.012
#> GSM386413 4 0.3534 0.754 0.000 0.256 0.000 0.744 0.000
#> GSM386414 4 0.1341 0.842 0.000 0.056 0.000 0.944 0.000
#> GSM386415 4 0.1478 0.854 0.000 0.064 0.000 0.936 0.000
#> GSM386416 1 0.2446 0.505 0.900 0.000 0.000 0.044 0.056
#> GSM386417 4 0.4269 0.792 0.000 0.108 0.000 0.776 0.116
#> GSM386402 3 0.0000 0.999 0.000 0.000 1.000 0.000 0.000
#> GSM386403 3 0.0000 0.999 0.000 0.000 1.000 0.000 0.000
#> GSM386404 3 0.0000 0.999 0.000 0.000 1.000 0.000 0.000
#> GSM386405 3 0.0000 0.999 0.000 0.000 1.000 0.000 0.000
#> GSM386418 4 0.2813 0.838 0.000 0.168 0.000 0.832 0.000
#> GSM386419 2 0.0000 0.888 0.000 1.000 0.000 0.000 0.000
#> GSM386420 2 0.0404 0.887 0.000 0.988 0.000 0.012 0.000
#> GSM386421 4 0.2536 0.855 0.000 0.128 0.000 0.868 0.004
#> GSM386426 1 0.1043 0.539 0.960 0.000 0.000 0.040 0.000
#> GSM386427 1 0.3752 0.681 0.708 0.000 0.000 0.000 0.292
#> GSM386428 2 0.2471 0.763 0.000 0.864 0.000 0.136 0.000
#> GSM386429 4 0.2233 0.859 0.000 0.104 0.000 0.892 0.004
#> GSM386430 4 0.2490 0.857 0.020 0.080 0.000 0.896 0.004
#> GSM386431 4 0.2286 0.858 0.000 0.108 0.000 0.888 0.004
#> GSM386432 4 0.2377 0.855 0.000 0.128 0.000 0.872 0.000
#> GSM386433 4 0.1478 0.854 0.000 0.064 0.000 0.936 0.000
#> GSM386434 4 0.1478 0.854 0.000 0.064 0.000 0.936 0.000
#> GSM386422 3 0.0000 0.999 0.000 0.000 1.000 0.000 0.000
#> GSM386423 5 0.3048 0.996 0.176 0.000 0.004 0.000 0.820
#> GSM386424 3 0.0000 0.999 0.000 0.000 1.000 0.000 0.000
#> GSM386425 3 0.0000 0.999 0.000 0.000 1.000 0.000 0.000
#> GSM386385 4 0.5452 0.292 0.448 0.060 0.000 0.492 0.000
#> GSM386386 1 0.3942 0.689 0.728 0.000 0.000 0.012 0.260
#> GSM386387 2 0.0510 0.886 0.000 0.984 0.000 0.016 0.000
#> GSM386391 4 0.2233 0.859 0.000 0.104 0.000 0.892 0.004
#> GSM386392 1 0.1043 0.539 0.960 0.000 0.000 0.040 0.000
#> GSM386393 4 0.2464 0.859 0.012 0.092 0.000 0.892 0.004
#> GSM386394 1 0.4066 0.641 0.672 0.000 0.000 0.004 0.324
#> GSM386395 4 0.2813 0.852 0.024 0.108 0.000 0.868 0.000
#> GSM386396 4 0.1671 0.858 0.000 0.076 0.000 0.924 0.000
#> GSM386397 4 0.2237 0.859 0.008 0.084 0.000 0.904 0.004
#> GSM386388 3 0.0000 0.999 0.000 0.000 1.000 0.000 0.000
#> GSM386389 5 0.3048 0.996 0.176 0.000 0.004 0.000 0.820
#> GSM386390 3 0.0000 0.999 0.000 0.000 1.000 0.000 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM386435 2 0.1010 0.732 0.000 0.960 0.000 0.004 0.036 0.000
#> GSM386436 2 0.0146 0.732 0.000 0.996 0.000 0.000 0.000 0.004
#> GSM386437 2 0.4304 0.441 0.000 0.536 0.000 0.008 0.008 0.448
#> GSM386438 2 0.0260 0.733 0.000 0.992 0.000 0.000 0.000 0.008
#> GSM386439 4 0.0260 0.888 0.008 0.000 0.000 0.992 0.000 0.000
#> GSM386440 2 0.1909 0.723 0.024 0.920 0.000 0.000 0.052 0.004
#> GSM386441 2 0.1909 0.723 0.024 0.920 0.000 0.000 0.052 0.004
#> GSM386442 2 0.0000 0.732 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM386447 4 0.0363 0.888 0.012 0.000 0.000 0.988 0.000 0.000
#> GSM386448 2 0.1909 0.723 0.024 0.920 0.000 0.000 0.052 0.004
#> GSM386449 2 0.0146 0.732 0.000 0.996 0.000 0.000 0.000 0.004
#> GSM386450 2 0.1826 0.724 0.020 0.924 0.000 0.000 0.052 0.004
#> GSM386451 2 0.4758 0.498 0.000 0.580 0.000 0.000 0.060 0.360
#> GSM386452 1 0.1814 0.995 0.900 0.000 0.000 0.100 0.000 0.000
#> GSM386453 2 0.1204 0.729 0.000 0.944 0.000 0.000 0.056 0.000
#> GSM386454 1 0.1765 0.993 0.904 0.000 0.000 0.096 0.000 0.000
#> GSM386455 6 0.2478 0.819 0.012 0.024 0.000 0.000 0.076 0.888
#> GSM386456 6 0.2605 0.806 0.012 0.020 0.000 0.000 0.092 0.876
#> GSM386457 6 0.3156 0.815 0.012 0.048 0.000 0.004 0.084 0.852
#> GSM386458 4 0.2058 0.854 0.072 0.000 0.000 0.908 0.012 0.008
#> GSM386443 5 0.2376 0.995 0.068 0.000 0.000 0.044 0.888 0.000
#> GSM386444 3 0.1549 0.952 0.044 0.000 0.936 0.000 0.020 0.000
#> GSM386445 3 0.1549 0.952 0.044 0.000 0.936 0.000 0.020 0.000
#> GSM386446 3 0.1549 0.952 0.044 0.000 0.936 0.000 0.020 0.000
#> GSM386398 1 0.2020 0.989 0.896 0.000 0.000 0.096 0.008 0.000
#> GSM386399 1 0.1863 0.988 0.896 0.000 0.000 0.104 0.000 0.000
#> GSM386400 1 0.1765 0.993 0.904 0.000 0.000 0.096 0.000 0.000
#> GSM386401 2 0.1909 0.723 0.024 0.920 0.000 0.000 0.052 0.004
#> GSM386406 2 0.0914 0.729 0.016 0.968 0.000 0.000 0.000 0.016
#> GSM386407 2 0.4378 0.442 0.016 0.528 0.000 0.000 0.004 0.452
#> GSM386408 2 0.0146 0.732 0.000 0.996 0.000 0.000 0.000 0.004
#> GSM386409 1 0.1814 0.995 0.900 0.000 0.000 0.100 0.000 0.000
#> GSM386410 1 0.1814 0.995 0.900 0.000 0.000 0.100 0.000 0.000
#> GSM386411 2 0.3855 0.599 0.016 0.704 0.000 0.000 0.004 0.276
#> GSM386412 4 0.1349 0.826 0.004 0.000 0.000 0.940 0.000 0.056
#> GSM386413 2 0.4199 0.477 0.016 0.568 0.000 0.000 0.000 0.416
#> GSM386414 6 0.1080 0.838 0.000 0.032 0.000 0.004 0.004 0.960
#> GSM386415 6 0.0146 0.843 0.000 0.004 0.000 0.000 0.000 0.996
#> GSM386416 4 0.1251 0.879 0.024 0.000 0.000 0.956 0.012 0.008
#> GSM386417 6 0.2367 0.825 0.012 0.020 0.000 0.004 0.064 0.900
#> GSM386402 3 0.0000 0.984 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386403 3 0.0146 0.982 0.000 0.000 0.996 0.000 0.004 0.000
#> GSM386404 3 0.0146 0.982 0.000 0.000 0.996 0.000 0.004 0.000
#> GSM386405 3 0.0000 0.984 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386418 2 0.4199 0.551 0.016 0.620 0.000 0.004 0.000 0.360
#> GSM386419 2 0.0000 0.732 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM386420 2 0.0146 0.731 0.000 0.996 0.000 0.004 0.000 0.000
#> GSM386421 2 0.3430 0.662 0.016 0.772 0.000 0.004 0.000 0.208
#> GSM386426 4 0.0260 0.888 0.008 0.000 0.000 0.992 0.000 0.000
#> GSM386427 1 0.1814 0.995 0.900 0.000 0.000 0.100 0.000 0.000
#> GSM386428 2 0.1391 0.725 0.016 0.944 0.000 0.000 0.000 0.040
#> GSM386429 2 0.3864 0.423 0.000 0.520 0.000 0.000 0.000 0.480
#> GSM386430 2 0.4184 0.393 0.000 0.500 0.000 0.012 0.000 0.488
#> GSM386431 2 0.3993 0.425 0.000 0.520 0.000 0.004 0.000 0.476
#> GSM386432 2 0.4246 0.448 0.016 0.532 0.000 0.000 0.000 0.452
#> GSM386433 6 0.0146 0.843 0.000 0.004 0.000 0.000 0.000 0.996
#> GSM386434 6 0.0146 0.843 0.000 0.004 0.000 0.000 0.000 0.996
#> GSM386422 3 0.0000 0.984 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386423 5 0.2308 0.998 0.068 0.000 0.000 0.040 0.892 0.000
#> GSM386424 3 0.0000 0.984 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386425 3 0.0000 0.984 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386385 4 0.4084 0.577 0.008 0.164 0.000 0.764 0.004 0.060
#> GSM386386 4 0.2402 0.812 0.140 0.000 0.000 0.856 0.004 0.000
#> GSM386387 2 0.1010 0.732 0.000 0.960 0.000 0.004 0.036 0.000
#> GSM386391 2 0.3993 0.425 0.000 0.520 0.000 0.004 0.000 0.476
#> GSM386392 4 0.0260 0.888 0.008 0.000 0.000 0.992 0.000 0.000
#> GSM386393 2 0.4093 0.422 0.000 0.516 0.000 0.008 0.000 0.476
#> GSM386394 4 0.2431 0.813 0.132 0.000 0.000 0.860 0.008 0.000
#> GSM386395 2 0.4258 0.423 0.000 0.516 0.000 0.016 0.000 0.468
#> GSM386396 6 0.1663 0.789 0.000 0.088 0.000 0.000 0.000 0.912
#> GSM386397 6 0.3789 -0.213 0.000 0.416 0.000 0.000 0.000 0.584
#> GSM386388 3 0.0000 0.984 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM386389 5 0.2308 0.998 0.068 0.000 0.000 0.040 0.892 0.000
#> GSM386390 3 0.0000 0.984 0.000 0.000 1.000 0.000 0.000 0.000
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
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 agent(p) dose(p) time(p) k
#> ATC:mclust 73 0.157609 0.50179 2.17e-04 2
#> ATC:mclust 74 0.483871 0.71034 8.17e-13 3
#> ATC:mclust 73 0.000563 0.00491 1.98e-10 4
#> ATC:mclust 68 0.071737 0.23308 6.37e-12 5
#> ATC:mclust 62 0.657084 0.38957 1.66e-14 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 51941 rows and 74 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'ATC' method.
#> Subgroups are detected by 'NMF' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 2.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
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.943 0.909 0.966 0.4685 0.523 0.523
#> 3 3 0.529 0.567 0.781 0.3306 0.726 0.517
#> 4 4 0.665 0.735 0.870 0.1407 0.720 0.389
#> 5 5 0.531 0.469 0.628 0.0669 0.763 0.382
#> 6 6 0.587 0.505 0.719 0.0498 0.847 0.469
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 2
Following shows the table of the partitions (You need to click the show/hide
code output link to see it). The membership matrix (columns with name p*
)
is inferred by
clue::cl_consensus()
function with the SE
method. Basically the value in the membership matrix
represents the probability to belong to a certain group. The finall class
label for an item is determined with the group with highest probability it
belongs to.
In get_classes()
function, the entropy is calculated from the membership
matrix and the silhouette score is calculated from the consensus matrix.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> GSM386435 2 0.0000 0.9803 0.000 1.000
#> GSM386436 2 0.0000 0.9803 0.000 1.000
#> GSM386437 2 0.0000 0.9803 0.000 1.000
#> GSM386438 2 0.0000 0.9803 0.000 1.000
#> GSM386439 1 0.9944 0.2122 0.544 0.456
#> GSM386440 2 0.0000 0.9803 0.000 1.000
#> GSM386441 2 0.0000 0.9803 0.000 1.000
#> GSM386442 2 0.0000 0.9803 0.000 1.000
#> GSM386447 1 0.2948 0.8914 0.948 0.052
#> GSM386448 2 0.0000 0.9803 0.000 1.000
#> GSM386449 2 0.0000 0.9803 0.000 1.000
#> GSM386450 2 0.0000 0.9803 0.000 1.000
#> GSM386451 2 0.0000 0.9803 0.000 1.000
#> GSM386452 1 0.0000 0.9337 1.000 0.000
#> GSM386453 2 0.0000 0.9803 0.000 1.000
#> GSM386454 1 0.0000 0.9337 1.000 0.000
#> GSM386455 2 0.0000 0.9803 0.000 1.000
#> GSM386456 2 0.0000 0.9803 0.000 1.000
#> GSM386457 2 0.0000 0.9803 0.000 1.000
#> GSM386458 2 0.0000 0.9803 0.000 1.000
#> GSM386443 1 0.0000 0.9337 1.000 0.000
#> GSM386444 2 0.0000 0.9803 0.000 1.000
#> GSM386445 2 0.0000 0.9803 0.000 1.000
#> GSM386446 2 0.0000 0.9803 0.000 1.000
#> GSM386398 1 0.0000 0.9337 1.000 0.000
#> GSM386399 1 0.0000 0.9337 1.000 0.000
#> GSM386400 1 0.0000 0.9337 1.000 0.000
#> GSM386401 2 0.0000 0.9803 0.000 1.000
#> GSM386406 2 0.0000 0.9803 0.000 1.000
#> GSM386407 2 0.0000 0.9803 0.000 1.000
#> GSM386408 2 0.0000 0.9803 0.000 1.000
#> GSM386409 1 0.0000 0.9337 1.000 0.000
#> GSM386410 1 0.0000 0.9337 1.000 0.000
#> GSM386411 2 0.0000 0.9803 0.000 1.000
#> GSM386412 1 0.0000 0.9337 1.000 0.000
#> GSM386413 2 0.0000 0.9803 0.000 1.000
#> GSM386414 1 0.9996 0.1038 0.512 0.488
#> GSM386415 1 0.8661 0.5988 0.712 0.288
#> GSM386416 1 0.0000 0.9337 1.000 0.000
#> GSM386417 2 0.0000 0.9803 0.000 1.000
#> GSM386402 2 0.0000 0.9803 0.000 1.000
#> GSM386403 2 0.0000 0.9803 0.000 1.000
#> GSM386404 2 0.0000 0.9803 0.000 1.000
#> GSM386405 2 0.0000 0.9803 0.000 1.000
#> GSM386418 2 0.9954 0.0491 0.460 0.540
#> GSM386419 2 0.0000 0.9803 0.000 1.000
#> GSM386420 2 0.0000 0.9803 0.000 1.000
#> GSM386421 2 0.1414 0.9610 0.020 0.980
#> GSM386426 1 0.0000 0.9337 1.000 0.000
#> GSM386427 1 0.0000 0.9337 1.000 0.000
#> GSM386428 2 0.0000 0.9803 0.000 1.000
#> GSM386429 1 0.9850 0.2947 0.572 0.428
#> GSM386430 2 0.8267 0.6120 0.260 0.740
#> GSM386431 1 0.0000 0.9337 1.000 0.000
#> GSM386432 2 0.0376 0.9766 0.004 0.996
#> GSM386433 2 0.0000 0.9803 0.000 1.000
#> GSM386434 2 0.0000 0.9803 0.000 1.000
#> GSM386422 2 0.0000 0.9803 0.000 1.000
#> GSM386423 1 0.0000 0.9337 1.000 0.000
#> GSM386424 2 0.0000 0.9803 0.000 1.000
#> GSM386425 2 0.0000 0.9803 0.000 1.000
#> GSM386385 2 0.3431 0.9130 0.064 0.936
#> GSM386386 1 0.0000 0.9337 1.000 0.000
#> GSM386387 2 0.0000 0.9803 0.000 1.000
#> GSM386391 1 0.0376 0.9308 0.996 0.004
#> GSM386392 1 0.0000 0.9337 1.000 0.000
#> GSM386393 1 0.0000 0.9337 1.000 0.000
#> GSM386394 1 0.0000 0.9337 1.000 0.000
#> GSM386395 1 0.0000 0.9337 1.000 0.000
#> GSM386396 1 0.0000 0.9337 1.000 0.000
#> GSM386397 1 0.0000 0.9337 1.000 0.000
#> GSM386388 2 0.0000 0.9803 0.000 1.000
#> GSM386389 1 0.0000 0.9337 1.000 0.000
#> GSM386390 2 0.0000 0.9803 0.000 1.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM386435 2 0.6154 0.1327 0.000 0.592 0.408
#> GSM386436 3 0.6215 0.4525 0.000 0.428 0.572
#> GSM386437 3 0.6307 0.2439 0.000 0.488 0.512
#> GSM386438 3 0.6154 0.5019 0.000 0.408 0.592
#> GSM386439 2 0.2537 0.5249 0.080 0.920 0.000
#> GSM386440 2 0.4178 0.5146 0.000 0.828 0.172
#> GSM386441 2 0.5785 0.3295 0.000 0.668 0.332
#> GSM386442 2 0.6309 -0.2412 0.000 0.504 0.496
#> GSM386447 2 0.3192 0.5140 0.112 0.888 0.000
#> GSM386448 2 0.5254 0.4317 0.000 0.736 0.264
#> GSM386449 2 0.6140 0.1460 0.000 0.596 0.404
#> GSM386450 2 0.6154 0.1277 0.000 0.592 0.408
#> GSM386451 3 0.5835 0.6220 0.000 0.340 0.660
#> GSM386452 1 0.0000 0.8596 1.000 0.000 0.000
#> GSM386453 2 0.5859 0.2975 0.000 0.656 0.344
#> GSM386454 1 0.0000 0.8596 1.000 0.000 0.000
#> GSM386455 3 0.5678 0.6500 0.000 0.316 0.684
#> GSM386456 3 0.5706 0.6460 0.000 0.320 0.680
#> GSM386457 2 0.6280 -0.0924 0.000 0.540 0.460
#> GSM386458 2 0.0592 0.5321 0.012 0.988 0.000
#> GSM386443 1 0.0237 0.8590 0.996 0.000 0.004
#> GSM386444 3 0.2959 0.6616 0.000 0.100 0.900
#> GSM386445 3 0.5016 0.6733 0.000 0.240 0.760
#> GSM386446 3 0.5216 0.6718 0.000 0.260 0.740
#> GSM386398 2 0.5650 0.1952 0.312 0.688 0.000
#> GSM386399 2 0.5178 0.3218 0.256 0.744 0.000
#> GSM386400 2 0.5216 0.3139 0.260 0.740 0.000
#> GSM386401 2 0.4121 0.5161 0.000 0.832 0.168
#> GSM386406 2 0.6302 -0.1757 0.000 0.520 0.480
#> GSM386407 3 0.5754 0.6598 0.004 0.296 0.700
#> GSM386408 2 0.4235 0.5123 0.000 0.824 0.176
#> GSM386409 1 0.0000 0.8596 1.000 0.000 0.000
#> GSM386410 1 0.0000 0.8596 1.000 0.000 0.000
#> GSM386411 3 0.5678 0.6500 0.000 0.316 0.684
#> GSM386412 1 0.0000 0.8596 1.000 0.000 0.000
#> GSM386413 3 0.5650 0.6527 0.000 0.312 0.688
#> GSM386414 1 0.6286 0.5033 0.536 0.000 0.464
#> GSM386415 1 0.6095 0.6136 0.608 0.000 0.392
#> GSM386416 1 0.0000 0.8596 1.000 0.000 0.000
#> GSM386417 3 0.5178 0.6730 0.000 0.256 0.744
#> GSM386402 3 0.2165 0.6559 0.000 0.064 0.936
#> GSM386403 3 0.0000 0.6293 0.000 0.000 1.000
#> GSM386404 3 0.0000 0.6293 0.000 0.000 1.000
#> GSM386405 3 0.2165 0.6559 0.000 0.064 0.936
#> GSM386418 1 0.9424 -0.0591 0.472 0.188 0.340
#> GSM386419 3 0.6204 0.4656 0.000 0.424 0.576
#> GSM386420 3 0.6180 0.4836 0.000 0.416 0.584
#> GSM386421 3 0.6129 0.6366 0.008 0.324 0.668
#> GSM386426 1 0.0000 0.8596 1.000 0.000 0.000
#> GSM386427 1 0.0000 0.8596 1.000 0.000 0.000
#> GSM386428 3 0.6291 0.3230 0.000 0.468 0.532
#> GSM386429 1 0.5318 0.7169 0.780 0.016 0.204
#> GSM386430 1 0.7188 0.2133 0.492 0.024 0.484
#> GSM386431 1 0.0747 0.8563 0.984 0.000 0.016
#> GSM386432 3 0.5845 0.6535 0.004 0.308 0.688
#> GSM386433 3 0.0424 0.6347 0.000 0.008 0.992
#> GSM386434 3 0.0000 0.6293 0.000 0.000 1.000
#> GSM386422 3 0.0747 0.6390 0.000 0.016 0.984
#> GSM386423 1 0.3752 0.8060 0.856 0.000 0.144
#> GSM386424 3 0.0000 0.6293 0.000 0.000 1.000
#> GSM386425 3 0.0747 0.6390 0.000 0.016 0.984
#> GSM386385 2 0.1643 0.5322 0.044 0.956 0.000
#> GSM386386 1 0.0000 0.8596 1.000 0.000 0.000
#> GSM386387 3 0.6045 0.5582 0.000 0.380 0.620
#> GSM386391 1 0.0237 0.8578 0.996 0.004 0.000
#> GSM386392 1 0.3482 0.7594 0.872 0.128 0.000
#> GSM386393 1 0.2625 0.8340 0.916 0.000 0.084
#> GSM386394 1 0.0000 0.8596 1.000 0.000 0.000
#> GSM386395 1 0.0000 0.8596 1.000 0.000 0.000
#> GSM386396 1 0.5621 0.6944 0.692 0.000 0.308
#> GSM386397 1 0.5497 0.7072 0.708 0.000 0.292
#> GSM386388 3 0.0000 0.6293 0.000 0.000 1.000
#> GSM386389 1 0.2625 0.8342 0.916 0.000 0.084
#> GSM386390 3 0.0000 0.6293 0.000 0.000 1.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM386435 2 0.3831 0.7128 0.000 0.792 0.004 0.204
#> GSM386436 2 0.1022 0.8249 0.000 0.968 0.000 0.032
#> GSM386437 2 0.1661 0.8213 0.000 0.944 0.004 0.052
#> GSM386438 2 0.1022 0.8249 0.000 0.968 0.000 0.032
#> GSM386439 4 0.2131 0.8421 0.036 0.032 0.000 0.932
#> GSM386440 4 0.6074 0.0124 0.000 0.456 0.044 0.500
#> GSM386441 2 0.5156 0.6333 0.000 0.720 0.044 0.236
#> GSM386442 2 0.1118 0.8246 0.000 0.964 0.000 0.036
#> GSM386447 4 0.2408 0.8425 0.044 0.036 0.000 0.920
#> GSM386448 2 0.3325 0.7818 0.000 0.864 0.024 0.112
#> GSM386449 2 0.1557 0.8200 0.000 0.944 0.000 0.056
#> GSM386450 2 0.1807 0.8180 0.000 0.940 0.008 0.052
#> GSM386451 2 0.2313 0.8125 0.000 0.924 0.044 0.032
#> GSM386452 1 0.0707 0.8427 0.980 0.000 0.000 0.020
#> GSM386453 2 0.3443 0.7705 0.000 0.848 0.016 0.136
#> GSM386454 1 0.1867 0.8211 0.928 0.000 0.000 0.072
#> GSM386455 2 0.5062 0.5567 0.000 0.692 0.284 0.024
#> GSM386456 3 0.5611 0.2414 0.000 0.412 0.564 0.024
#> GSM386457 4 0.5875 0.5741 0.000 0.092 0.224 0.684
#> GSM386458 4 0.3120 0.8254 0.028 0.028 0.044 0.900
#> GSM386443 1 0.5767 0.5463 0.660 0.000 0.280 0.060
#> GSM386444 3 0.1389 0.8726 0.000 0.048 0.952 0.000
#> GSM386445 3 0.2546 0.8255 0.000 0.092 0.900 0.008
#> GSM386446 3 0.3494 0.7281 0.000 0.172 0.824 0.004
#> GSM386398 4 0.2589 0.7933 0.116 0.000 0.000 0.884
#> GSM386399 4 0.2402 0.8321 0.076 0.012 0.000 0.912
#> GSM386400 4 0.2125 0.8277 0.076 0.004 0.000 0.920
#> GSM386401 2 0.4353 0.6688 0.000 0.756 0.012 0.232
#> GSM386406 2 0.0707 0.8258 0.000 0.980 0.000 0.020
#> GSM386407 2 0.1302 0.8139 0.000 0.956 0.000 0.044
#> GSM386408 2 0.3219 0.7528 0.000 0.836 0.000 0.164
#> GSM386409 1 0.2081 0.8137 0.916 0.000 0.000 0.084
#> GSM386410 1 0.0707 0.8427 0.980 0.000 0.000 0.020
#> GSM386411 2 0.0524 0.8261 0.000 0.988 0.004 0.008
#> GSM386412 1 0.0927 0.8426 0.976 0.008 0.000 0.016
#> GSM386413 2 0.1022 0.8177 0.000 0.968 0.000 0.032
#> GSM386414 1 0.4907 0.6917 0.764 0.176 0.000 0.060
#> GSM386415 1 0.4209 0.7685 0.840 0.084 0.012 0.064
#> GSM386416 1 0.1211 0.8381 0.960 0.000 0.000 0.040
#> GSM386417 2 0.5070 0.2454 0.000 0.580 0.416 0.004
#> GSM386402 3 0.0000 0.9035 0.000 0.000 1.000 0.000
#> GSM386403 3 0.0188 0.9025 0.004 0.000 0.996 0.000
#> GSM386404 3 0.0188 0.9025 0.004 0.000 0.996 0.000
#> GSM386405 3 0.0000 0.9035 0.000 0.000 1.000 0.000
#> GSM386418 2 0.3399 0.7651 0.092 0.868 0.000 0.040
#> GSM386419 2 0.1211 0.8239 0.000 0.960 0.000 0.040
#> GSM386420 2 0.0707 0.8258 0.000 0.980 0.000 0.020
#> GSM386421 2 0.1398 0.8145 0.004 0.956 0.000 0.040
#> GSM386426 1 0.1022 0.8402 0.968 0.000 0.000 0.032
#> GSM386427 1 0.0592 0.8425 0.984 0.000 0.000 0.016
#> GSM386428 2 0.0817 0.8195 0.000 0.976 0.000 0.024
#> GSM386429 2 0.3734 0.7475 0.108 0.848 0.000 0.044
#> GSM386430 2 0.2919 0.7845 0.060 0.896 0.000 0.044
#> GSM386431 1 0.6268 0.0622 0.496 0.448 0.000 0.056
#> GSM386432 2 0.1302 0.8139 0.000 0.956 0.000 0.044
#> GSM386433 2 0.8132 0.2300 0.112 0.512 0.312 0.064
#> GSM386434 2 0.5660 0.6835 0.040 0.760 0.136 0.064
#> GSM386422 3 0.0000 0.9035 0.000 0.000 1.000 0.000
#> GSM386423 1 0.4610 0.6397 0.744 0.000 0.236 0.020
#> GSM386424 3 0.0000 0.9035 0.000 0.000 1.000 0.000
#> GSM386425 3 0.0000 0.9035 0.000 0.000 1.000 0.000
#> GSM386385 4 0.2473 0.8198 0.012 0.080 0.000 0.908
#> GSM386386 1 0.0707 0.8427 0.980 0.000 0.000 0.020
#> GSM386387 2 0.1305 0.8240 0.000 0.960 0.004 0.036
#> GSM386391 2 0.5446 0.5308 0.276 0.680 0.000 0.044
#> GSM386392 1 0.2011 0.8193 0.920 0.000 0.000 0.080
#> GSM386393 1 0.4227 0.7444 0.820 0.120 0.000 0.060
#> GSM386394 1 0.0188 0.8403 0.996 0.000 0.000 0.004
#> GSM386395 2 0.5778 0.3616 0.356 0.604 0.000 0.040
#> GSM386396 1 0.5609 0.6196 0.708 0.224 0.004 0.064
#> GSM386397 2 0.6554 0.0443 0.444 0.488 0.004 0.064
#> GSM386388 3 0.0188 0.9025 0.000 0.000 0.996 0.004
#> GSM386389 1 0.2256 0.8124 0.924 0.000 0.056 0.020
#> GSM386390 3 0.1488 0.8731 0.012 0.000 0.956 0.032
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM386435 2 0.5074 0.4993 0.000 0.660 0.000 0.268 0.072
#> GSM386436 2 0.4637 0.1693 0.000 0.536 0.000 0.452 0.012
#> GSM386437 2 0.5069 0.4555 0.000 0.620 0.000 0.328 0.052
#> GSM386438 2 0.4416 0.4109 0.000 0.632 0.000 0.356 0.012
#> GSM386439 5 0.0162 0.7572 0.000 0.004 0.000 0.000 0.996
#> GSM386440 2 0.4754 0.5066 0.000 0.684 0.000 0.052 0.264
#> GSM386441 2 0.4301 0.5025 0.000 0.712 0.000 0.260 0.028
#> GSM386442 4 0.4747 -0.0513 0.000 0.488 0.000 0.496 0.016
#> GSM386447 5 0.7259 0.4223 0.324 0.152 0.000 0.056 0.468
#> GSM386448 2 0.4419 0.4499 0.000 0.668 0.000 0.312 0.020
#> GSM386449 2 0.4624 0.4369 0.000 0.636 0.000 0.340 0.024
#> GSM386450 4 0.4101 0.5112 0.000 0.332 0.000 0.664 0.004
#> GSM386451 4 0.4273 0.2806 0.000 0.448 0.000 0.552 0.000
#> GSM386452 1 0.0162 0.6981 0.996 0.000 0.000 0.004 0.000
#> GSM386453 4 0.5252 0.4874 0.000 0.316 0.000 0.616 0.068
#> GSM386454 1 0.0510 0.6890 0.984 0.000 0.000 0.000 0.016
#> GSM386455 2 0.2492 0.5731 0.000 0.900 0.008 0.072 0.020
#> GSM386456 2 0.1628 0.5615 0.000 0.936 0.008 0.056 0.000
#> GSM386457 2 0.3601 0.4828 0.000 0.824 0.008 0.032 0.136
#> GSM386458 5 0.6748 0.5569 0.256 0.172 0.008 0.016 0.548
#> GSM386443 3 0.4607 0.2250 0.368 0.004 0.616 0.000 0.012
#> GSM386444 2 0.3534 0.0916 0.000 0.744 0.256 0.000 0.000
#> GSM386445 2 0.3143 0.2205 0.000 0.796 0.204 0.000 0.000
#> GSM386446 2 0.2690 0.3148 0.000 0.844 0.156 0.000 0.000
#> GSM386398 5 0.1544 0.7569 0.068 0.000 0.000 0.000 0.932
#> GSM386399 5 0.3487 0.6744 0.212 0.000 0.000 0.008 0.780
#> GSM386400 5 0.0290 0.7604 0.008 0.000 0.000 0.000 0.992
#> GSM386401 2 0.5450 0.5127 0.000 0.652 0.000 0.216 0.132
#> GSM386406 4 0.4570 0.2711 0.000 0.348 0.000 0.632 0.020
#> GSM386407 4 0.3741 0.5801 0.004 0.264 0.000 0.732 0.000
#> GSM386408 2 0.6625 0.3743 0.000 0.456 0.000 0.268 0.276
#> GSM386409 1 0.1205 0.6723 0.956 0.000 0.004 0.000 0.040
#> GSM386410 1 0.0162 0.6981 0.996 0.000 0.000 0.004 0.000
#> GSM386411 4 0.3752 0.5605 0.000 0.292 0.000 0.708 0.000
#> GSM386412 1 0.4658 0.1883 0.576 0.000 0.016 0.408 0.000
#> GSM386413 4 0.3636 0.5747 0.000 0.272 0.000 0.728 0.000
#> GSM386414 4 0.5855 0.4532 0.268 0.052 0.048 0.632 0.000
#> GSM386415 1 0.7259 0.3134 0.408 0.024 0.260 0.308 0.000
#> GSM386416 1 0.5756 0.1495 0.536 0.004 0.400 0.016 0.044
#> GSM386417 2 0.2305 0.5627 0.000 0.896 0.012 0.092 0.000
#> GSM386402 3 0.4273 0.5602 0.000 0.448 0.552 0.000 0.000
#> GSM386403 3 0.3561 0.7142 0.000 0.260 0.740 0.000 0.000
#> GSM386404 3 0.3534 0.7140 0.000 0.256 0.744 0.000 0.000
#> GSM386405 2 0.3999 -0.1680 0.000 0.656 0.344 0.000 0.000
#> GSM386418 4 0.2645 0.6714 0.044 0.068 0.000 0.888 0.000
#> GSM386419 4 0.3730 0.5618 0.000 0.288 0.000 0.712 0.000
#> GSM386420 2 0.4718 0.2211 0.000 0.540 0.000 0.444 0.016
#> GSM386421 4 0.3449 0.6461 0.088 0.064 0.004 0.844 0.000
#> GSM386426 1 0.7802 0.3590 0.520 0.016 0.156 0.104 0.204
#> GSM386427 1 0.0798 0.6960 0.976 0.000 0.016 0.008 0.000
#> GSM386428 4 0.2798 0.6480 0.000 0.140 0.000 0.852 0.008
#> GSM386429 4 0.1560 0.6672 0.020 0.028 0.004 0.948 0.000
#> GSM386430 4 0.1908 0.6618 0.016 0.024 0.024 0.936 0.000
#> GSM386431 4 0.4045 0.5769 0.052 0.016 0.124 0.808 0.000
#> GSM386432 4 0.2389 0.6610 0.004 0.116 0.000 0.880 0.000
#> GSM386433 2 0.7298 0.1175 0.028 0.420 0.264 0.288 0.000
#> GSM386434 4 0.6638 0.2637 0.016 0.292 0.172 0.520 0.000
#> GSM386422 2 0.4227 -0.3637 0.000 0.580 0.420 0.000 0.000
#> GSM386423 3 0.3630 0.2869 0.204 0.000 0.780 0.016 0.000
#> GSM386424 3 0.3983 0.6914 0.000 0.340 0.660 0.000 0.000
#> GSM386425 3 0.4307 0.4727 0.000 0.500 0.500 0.000 0.000
#> GSM386385 5 0.1965 0.7332 0.000 0.024 0.000 0.052 0.924
#> GSM386386 1 0.0324 0.6972 0.992 0.000 0.004 0.004 0.000
#> GSM386387 2 0.4101 0.3757 0.000 0.628 0.000 0.372 0.000
#> GSM386391 4 0.3443 0.6060 0.164 0.012 0.008 0.816 0.000
#> GSM386392 1 0.5355 0.1030 0.552 0.000 0.008 0.040 0.400
#> GSM386393 4 0.5425 0.4142 0.100 0.016 0.196 0.688 0.000
#> GSM386394 1 0.3352 0.6453 0.852 0.012 0.100 0.036 0.000
#> GSM386395 4 0.2905 0.6663 0.096 0.036 0.000 0.868 0.000
#> GSM386396 4 0.3968 0.6229 0.056 0.016 0.112 0.816 0.000
#> GSM386397 4 0.3786 0.5851 0.044 0.008 0.132 0.816 0.000
#> GSM386388 3 0.3990 0.7120 0.000 0.308 0.688 0.004 0.000
#> GSM386389 3 0.5501 -0.1565 0.356 0.016 0.584 0.044 0.000
#> GSM386390 3 0.3671 0.7059 0.000 0.236 0.756 0.008 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM386435 2 0.4094 0.6247 0.056 0.776 0.000 0.028 0.000 0.140
#> GSM386436 2 0.5912 0.0294 0.000 0.452 0.000 0.224 0.000 0.324
#> GSM386437 2 0.5794 0.4949 0.056 0.640 0.000 0.152 0.004 0.148
#> GSM386438 2 0.5156 0.4365 0.000 0.620 0.000 0.164 0.000 0.216
#> GSM386439 1 0.0717 0.7626 0.976 0.008 0.000 0.000 0.000 0.016
#> GSM386440 2 0.2838 0.6363 0.116 0.852 0.000 0.004 0.000 0.028
#> GSM386441 2 0.2776 0.6423 0.004 0.860 0.004 0.020 0.000 0.112
#> GSM386442 2 0.5819 0.2364 0.004 0.520 0.000 0.212 0.000 0.264
#> GSM386447 6 0.7126 0.4340 0.152 0.056 0.000 0.132 0.104 0.556
#> GSM386448 2 0.3496 0.6213 0.004 0.804 0.000 0.052 0.000 0.140
#> GSM386449 2 0.5317 0.4855 0.020 0.648 0.000 0.144 0.000 0.188
#> GSM386450 2 0.6002 -0.2229 0.000 0.396 0.000 0.236 0.000 0.368
#> GSM386451 2 0.5364 0.2901 0.000 0.584 0.000 0.172 0.000 0.244
#> GSM386452 5 0.0000 0.8911 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM386453 6 0.5990 0.5297 0.004 0.252 0.000 0.264 0.000 0.480
#> GSM386454 5 0.1845 0.8560 0.028 0.000 0.000 0.000 0.920 0.052
#> GSM386455 2 0.1794 0.6136 0.008 0.936 0.024 0.012 0.000 0.020
#> GSM386456 2 0.1262 0.6199 0.000 0.956 0.016 0.008 0.000 0.020
#> GSM386457 2 0.4306 0.6144 0.128 0.772 0.016 0.012 0.000 0.072
#> GSM386458 1 0.7526 0.3912 0.428 0.020 0.136 0.000 0.148 0.268
#> GSM386443 3 0.4541 0.5384 0.100 0.000 0.724 0.000 0.164 0.012
#> GSM386444 2 0.2389 0.5247 0.000 0.864 0.128 0.000 0.000 0.008
#> GSM386445 2 0.2070 0.5570 0.000 0.892 0.100 0.000 0.000 0.008
#> GSM386446 2 0.2019 0.5670 0.000 0.900 0.088 0.000 0.000 0.012
#> GSM386398 1 0.1327 0.7592 0.936 0.000 0.000 0.000 0.064 0.000
#> GSM386399 1 0.2988 0.7441 0.852 0.000 0.004 0.000 0.084 0.060
#> GSM386400 1 0.0458 0.7622 0.984 0.000 0.000 0.000 0.016 0.000
#> GSM386401 2 0.3718 0.6290 0.128 0.796 0.000 0.008 0.000 0.068
#> GSM386406 4 0.6120 -0.3171 0.008 0.220 0.000 0.448 0.000 0.324
#> GSM386407 6 0.5024 0.5804 0.000 0.052 0.000 0.440 0.008 0.500
#> GSM386408 1 0.5390 0.5298 0.652 0.216 0.000 0.052 0.000 0.080
#> GSM386409 5 0.1341 0.8744 0.024 0.000 0.000 0.000 0.948 0.028
#> GSM386410 5 0.0000 0.8911 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM386411 6 0.4857 0.6216 0.000 0.060 0.000 0.408 0.000 0.532
#> GSM386412 6 0.5918 0.5047 0.004 0.012 0.000 0.348 0.136 0.500
#> GSM386413 6 0.4735 0.6001 0.000 0.048 0.000 0.432 0.000 0.520
#> GSM386414 4 0.6812 -0.3559 0.000 0.024 0.120 0.428 0.048 0.380
#> GSM386415 4 0.4902 0.4038 0.000 0.004 0.012 0.668 0.072 0.244
#> GSM386416 3 0.6538 0.4080 0.052 0.000 0.608 0.060 0.116 0.164
#> GSM386417 2 0.3382 0.5965 0.000 0.836 0.020 0.080 0.000 0.064
#> GSM386402 3 0.3371 0.6178 0.000 0.292 0.708 0.000 0.000 0.000
#> GSM386403 3 0.0777 0.7178 0.000 0.024 0.972 0.000 0.000 0.004
#> GSM386404 3 0.0405 0.7112 0.000 0.004 0.988 0.000 0.000 0.008
#> GSM386405 2 0.3409 0.2713 0.000 0.700 0.300 0.000 0.000 0.000
#> GSM386418 4 0.5615 -0.1631 0.000 0.112 0.000 0.548 0.016 0.324
#> GSM386419 6 0.5597 0.5333 0.000 0.180 0.000 0.288 0.000 0.532
#> GSM386420 2 0.5660 0.2786 0.000 0.532 0.000 0.252 0.000 0.216
#> GSM386421 4 0.3742 0.4405 0.000 0.116 0.000 0.792 0.004 0.088
#> GSM386426 1 0.6604 0.5516 0.568 0.012 0.000 0.092 0.188 0.140
#> GSM386427 5 0.0458 0.8871 0.000 0.000 0.000 0.000 0.984 0.016
#> GSM386428 6 0.5221 0.4613 0.000 0.092 0.000 0.432 0.000 0.476
#> GSM386429 4 0.1946 0.5629 0.000 0.012 0.000 0.912 0.004 0.072
#> GSM386430 4 0.0993 0.5893 0.000 0.012 0.000 0.964 0.000 0.024
#> GSM386431 4 0.0891 0.5878 0.000 0.000 0.000 0.968 0.008 0.024
#> GSM386432 4 0.3409 0.4050 0.000 0.024 0.000 0.788 0.004 0.184
#> GSM386433 4 0.5333 0.4041 0.000 0.116 0.008 0.656 0.016 0.204
#> GSM386434 4 0.3961 0.4939 0.000 0.096 0.012 0.792 0.004 0.096
#> GSM386422 2 0.3774 0.0270 0.000 0.592 0.408 0.000 0.000 0.000
#> GSM386423 3 0.4077 0.5243 0.000 0.000 0.752 0.008 0.180 0.060
#> GSM386424 3 0.3390 0.6123 0.000 0.296 0.704 0.000 0.000 0.000
#> GSM386425 2 0.3843 -0.1070 0.000 0.548 0.452 0.000 0.000 0.000
#> GSM386385 1 0.3719 0.7066 0.808 0.092 0.000 0.008 0.004 0.088
#> GSM386386 5 0.0547 0.8894 0.000 0.000 0.000 0.000 0.980 0.020
#> GSM386387 2 0.4599 0.5481 0.000 0.696 0.000 0.140 0.000 0.164
#> GSM386391 4 0.3264 0.5403 0.000 0.056 0.000 0.844 0.020 0.080
#> GSM386392 1 0.4028 0.6812 0.752 0.008 0.000 0.016 0.204 0.020
#> GSM386393 4 0.2046 0.5674 0.000 0.000 0.000 0.908 0.032 0.060
#> GSM386394 5 0.2605 0.8187 0.000 0.000 0.000 0.028 0.864 0.108
#> GSM386395 4 0.5426 0.0937 0.000 0.024 0.000 0.616 0.104 0.256
#> GSM386396 4 0.2932 0.4870 0.000 0.000 0.000 0.820 0.016 0.164
#> GSM386397 4 0.1267 0.5805 0.000 0.000 0.000 0.940 0.000 0.060
#> GSM386388 3 0.4016 0.6086 0.000 0.292 0.684 0.020 0.000 0.004
#> GSM386389 5 0.5921 0.3480 0.000 0.000 0.324 0.036 0.532 0.108
#> GSM386390 3 0.3361 0.7054 0.004 0.064 0.844 0.068 0.000 0.020
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
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 agent(p) dose(p) time(p) k
#> ATC:NMF 70 0.0594 0.01412 1.93e-01 2
#> ATC:NMF 55 0.1329 0.11052 9.43e-04 3
#> ATC:NMF 67 0.1719 0.21377 1.76e-09 4
#> ATC:NMF 41 0.0204 0.05281 5.95e-08 5
#> ATC:NMF 48 0.0372 0.00922 3.23e-06 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