Date: 2019-12-25 20:17: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 21512 rows and 85 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] 21512 85
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:NMF | 3 | 1.000 | 0.954 | 0.979 | ** | |
CV:pam | 3 | 1.000 | 0.944 | 0.977 | ** | |
MAD:kmeans | 3 | 1.000 | 0.953 | 0.963 | ** | |
MAD:pam | 3 | 1.000 | 0.966 | 0.985 | ** | 2 |
MAD:NMF | 3 | 1.000 | 0.948 | 0.978 | ** | |
ATC:kmeans | 3 | 1.000 | 0.989 | 0.994 | ** | |
ATC:skmeans | 3 | 1.000 | 0.973 | 0.989 | ** | 2 |
SD:skmeans | 3 | 0.999 | 0.955 | 0.981 | ** | |
CV:NMF | 3 | 0.999 | 0.944 | 0.975 | ** | |
MAD:skmeans | 3 | 0.984 | 0.960 | 0.982 | ** | |
ATC:NMF | 3 | 0.982 | 0.951 | 0.977 | ** | 2 |
CV:kmeans | 3 | 0.977 | 0.935 | 0.950 | ** | |
CV:mclust | 2 | 0.974 | 0.916 | 0.943 | ** | |
SD:pam | 3 | 0.973 | 0.937 | 0.970 | ** | |
SD:kmeans | 3 | 0.951 | 0.939 | 0.941 | ** | |
SD:mclust | 3 | 0.951 | 0.912 | 0.965 | ** | 2 |
CV:skmeans | 3 | 0.951 | 0.940 | 0.974 | ** | |
ATC:pam | 4 | 0.937 | 0.924 | 0.967 | * | 3 |
MAD:mclust | 5 | 0.936 | 0.914 | 0.952 | * | 2,3 |
ATC:mclust | 3 | 0.860 | 0.875 | 0.946 | ||
SD:hclust | 3 | 0.609 | 0.753 | 0.878 | ||
MAD:hclust | 3 | 0.590 | 0.803 | 0.890 | ||
CV:hclust | 3 | 0.565 | 0.767 | 0.882 | ||
ATC:hclust | 3 | 0.531 | 0.725 | 0.859 |
**: 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.855 0.902 0.961 0.502 0.495 0.495
#> CV:NMF 2 0.830 0.900 0.958 0.502 0.495 0.495
#> MAD:NMF 2 0.745 0.859 0.944 0.500 0.494 0.494
#> ATC:NMF 2 0.927 0.942 0.976 0.495 0.503 0.503
#> SD:skmeans 2 0.631 0.756 0.902 0.497 0.500 0.500
#> CV:skmeans 2 0.611 0.731 0.898 0.498 0.497 0.497
#> MAD:skmeans 2 0.630 0.776 0.911 0.498 0.497 0.497
#> ATC:skmeans 2 1.000 0.957 0.984 0.500 0.500 0.500
#> SD:mclust 2 0.978 0.923 0.957 0.356 0.624 0.624
#> CV:mclust 2 0.974 0.916 0.943 0.358 0.636 0.636
#> MAD:mclust 2 1.000 0.940 0.969 0.369 0.624 0.624
#> ATC:mclust 2 0.449 0.771 0.822 0.395 0.662 0.662
#> SD:kmeans 2 0.542 0.766 0.819 0.465 0.519 0.519
#> CV:kmeans 2 0.572 0.629 0.849 0.464 0.519 0.519
#> MAD:kmeans 2 0.569 0.698 0.861 0.463 0.531 0.531
#> ATC:kmeans 2 0.644 0.936 0.951 0.473 0.525 0.525
#> SD:pam 2 0.555 0.827 0.907 0.451 0.561 0.561
#> CV:pam 2 0.608 0.897 0.933 0.442 0.570 0.570
#> MAD:pam 2 1.000 0.955 0.971 0.430 0.580 0.580
#> ATC:pam 2 0.817 0.908 0.959 0.488 0.503 0.503
#> SD:hclust 2 0.376 0.782 0.858 0.428 0.561 0.561
#> CV:hclust 2 0.445 0.852 0.898 0.420 0.580 0.580
#> MAD:hclust 2 0.296 0.330 0.567 0.433 0.738 0.738
#> ATC:hclust 2 0.330 0.630 0.813 0.422 0.510 0.510
get_stats(res_list, k = 3)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> SD:NMF 3 1.000 0.954 0.979 0.344 0.717 0.487
#> CV:NMF 3 0.999 0.944 0.975 0.341 0.714 0.484
#> MAD:NMF 3 1.000 0.948 0.978 0.346 0.714 0.483
#> ATC:NMF 3 0.982 0.951 0.977 0.357 0.741 0.524
#> SD:skmeans 3 0.999 0.955 0.981 0.351 0.753 0.541
#> CV:skmeans 3 0.951 0.940 0.974 0.348 0.766 0.559
#> MAD:skmeans 3 0.984 0.960 0.982 0.346 0.754 0.542
#> ATC:skmeans 3 1.000 0.973 0.989 0.334 0.788 0.594
#> SD:mclust 3 0.951 0.912 0.965 0.887 0.645 0.456
#> CV:mclust 3 0.847 0.894 0.949 0.866 0.601 0.413
#> MAD:mclust 3 0.969 0.961 0.982 0.809 0.687 0.507
#> ATC:mclust 3 0.860 0.875 0.946 0.676 0.651 0.485
#> SD:kmeans 3 0.951 0.939 0.941 0.420 0.724 0.507
#> CV:kmeans 3 0.977 0.935 0.950 0.432 0.726 0.511
#> MAD:kmeans 3 1.000 0.953 0.963 0.443 0.739 0.533
#> ATC:kmeans 3 1.000 0.989 0.994 0.424 0.757 0.556
#> SD:pam 3 0.973 0.937 0.970 0.489 0.738 0.545
#> CV:pam 3 1.000 0.944 0.977 0.517 0.743 0.556
#> MAD:pam 3 1.000 0.966 0.985 0.562 0.720 0.529
#> ATC:pam 3 1.000 0.963 0.981 0.379 0.681 0.444
#> SD:hclust 3 0.609 0.753 0.878 0.522 0.749 0.559
#> CV:hclust 3 0.565 0.767 0.882 0.542 0.734 0.549
#> MAD:hclust 3 0.590 0.803 0.890 0.512 0.466 0.332
#> ATC:hclust 3 0.531 0.725 0.859 0.450 0.691 0.469
get_stats(res_list, k = 4)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> SD:NMF 4 0.704 0.700 0.832 0.0968 0.931 0.796
#> CV:NMF 4 0.750 0.754 0.867 0.1011 0.901 0.710
#> MAD:NMF 4 0.748 0.732 0.845 0.0938 0.940 0.822
#> ATC:NMF 4 0.758 0.670 0.857 0.0771 0.978 0.933
#> SD:skmeans 4 0.845 0.803 0.898 0.0880 0.919 0.765
#> CV:skmeans 4 0.811 0.818 0.900 0.0938 0.935 0.806
#> MAD:skmeans 4 0.777 0.796 0.878 0.0917 0.950 0.850
#> ATC:skmeans 4 0.867 0.853 0.918 0.0990 0.920 0.762
#> SD:mclust 4 0.798 0.807 0.852 0.0631 0.906 0.731
#> CV:mclust 4 0.685 0.758 0.863 0.0594 0.936 0.813
#> MAD:mclust 4 0.826 0.857 0.903 0.0650 0.938 0.818
#> ATC:mclust 4 0.736 0.738 0.857 0.0988 0.901 0.726
#> SD:kmeans 4 0.761 0.721 0.830 0.1107 0.919 0.759
#> CV:kmeans 4 0.774 0.684 0.847 0.1026 0.954 0.866
#> MAD:kmeans 4 0.747 0.700 0.837 0.1092 0.933 0.799
#> ATC:kmeans 4 0.757 0.756 0.824 0.0951 0.876 0.654
#> SD:pam 4 0.895 0.846 0.939 0.1252 0.860 0.606
#> CV:pam 4 0.871 0.840 0.935 0.1241 0.883 0.664
#> MAD:pam 4 0.887 0.868 0.938 0.1235 0.881 0.656
#> ATC:pam 4 0.937 0.924 0.967 0.1173 0.840 0.563
#> SD:hclust 4 0.594 0.630 0.781 0.0885 0.929 0.792
#> CV:hclust 4 0.582 0.611 0.823 0.0777 0.974 0.924
#> MAD:hclust 4 0.567 0.639 0.802 0.1058 0.945 0.834
#> ATC:hclust 4 0.581 0.656 0.797 0.1741 0.845 0.588
get_stats(res_list, k = 5)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> SD:NMF 5 0.701 0.653 0.799 0.0624 0.917 0.713
#> CV:NMF 5 0.715 0.660 0.812 0.0616 0.930 0.745
#> MAD:NMF 5 0.691 0.647 0.795 0.0648 0.915 0.711
#> ATC:NMF 5 0.715 0.648 0.814 0.0586 0.904 0.714
#> SD:skmeans 5 0.716 0.696 0.816 0.0647 0.952 0.829
#> CV:skmeans 5 0.686 0.648 0.796 0.0646 0.977 0.917
#> MAD:skmeans 5 0.698 0.656 0.807 0.0625 0.954 0.840
#> ATC:skmeans 5 0.773 0.655 0.827 0.0558 0.970 0.886
#> SD:mclust 5 0.890 0.878 0.918 0.0708 0.911 0.711
#> CV:mclust 5 0.899 0.865 0.938 0.0858 0.926 0.754
#> MAD:mclust 5 0.936 0.914 0.952 0.0884 0.888 0.644
#> ATC:mclust 5 0.808 0.795 0.891 0.0663 0.913 0.705
#> SD:kmeans 5 0.726 0.772 0.821 0.0610 0.892 0.641
#> CV:kmeans 5 0.746 0.784 0.840 0.0609 0.900 0.686
#> MAD:kmeans 5 0.730 0.697 0.776 0.0593 0.908 0.683
#> ATC:kmeans 5 0.703 0.650 0.770 0.0623 0.936 0.765
#> SD:pam 5 0.805 0.689 0.839 0.0460 0.944 0.780
#> CV:pam 5 0.811 0.755 0.890 0.0397 0.967 0.868
#> MAD:pam 5 0.824 0.784 0.879 0.0503 0.957 0.828
#> ATC:pam 5 0.899 0.869 0.932 0.0450 0.964 0.857
#> SD:hclust 5 0.621 0.603 0.794 0.0598 0.906 0.708
#> CV:hclust 5 0.564 0.523 0.772 0.0590 0.915 0.752
#> MAD:hclust 5 0.622 0.626 0.797 0.0605 0.935 0.781
#> ATC:hclust 5 0.639 0.639 0.775 0.0711 0.949 0.809
get_stats(res_list, k = 6)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> SD:NMF 6 0.736 0.618 0.787 0.0366 0.960 0.829
#> CV:NMF 6 0.710 0.596 0.768 0.0398 0.962 0.836
#> MAD:NMF 6 0.724 0.611 0.780 0.0406 0.951 0.791
#> ATC:NMF 6 0.728 0.664 0.800 0.0441 0.916 0.693
#> SD:skmeans 6 0.686 0.546 0.730 0.0407 0.971 0.882
#> CV:skmeans 6 0.658 0.464 0.660 0.0424 0.934 0.756
#> MAD:skmeans 6 0.668 0.578 0.736 0.0395 0.991 0.965
#> ATC:skmeans 6 0.763 0.729 0.818 0.0410 0.900 0.610
#> SD:mclust 6 0.814 0.742 0.862 0.0497 0.971 0.881
#> CV:mclust 6 0.771 0.719 0.853 0.0523 0.934 0.731
#> MAD:mclust 6 0.898 0.805 0.910 0.0393 0.961 0.836
#> ATC:mclust 6 0.792 0.691 0.839 0.0390 0.967 0.858
#> SD:kmeans 6 0.751 0.639 0.802 0.0418 0.970 0.873
#> CV:kmeans 6 0.793 0.703 0.830 0.0430 0.961 0.833
#> MAD:kmeans 6 0.715 0.606 0.749 0.0414 0.938 0.730
#> ATC:kmeans 6 0.720 0.520 0.716 0.0461 0.919 0.681
#> SD:pam 6 0.851 0.755 0.878 0.0365 0.920 0.656
#> CV:pam 6 0.803 0.730 0.870 0.0241 0.956 0.809
#> MAD:pam 6 0.828 0.729 0.855 0.0314 0.951 0.776
#> ATC:pam 6 0.858 0.806 0.902 0.0336 0.962 0.829
#> SD:hclust 6 0.647 0.632 0.777 0.0364 0.973 0.900
#> CV:hclust 6 0.620 0.621 0.787 0.0395 0.962 0.865
#> MAD:hclust 6 0.669 0.634 0.779 0.0337 0.954 0.812
#> ATC:hclust 6 0.673 0.599 0.767 0.0420 0.966 0.852
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 disease.state(p) cell.type(p) k
#> SD:NMF 81 4.94e-04 2.54e-03 2
#> CV:NMF 82 9.73e-04 4.50e-03 2
#> MAD:NMF 78 1.07e-03 4.26e-03 2
#> ATC:NMF 83 6.46e-06 4.04e-05 2
#> SD:skmeans 69 2.56e-03 8.90e-03 2
#> CV:skmeans 67 6.21e-03 1.76e-02 2
#> MAD:skmeans 71 2.21e-03 7.42e-03 2
#> ATC:skmeans 83 3.44e-06 2.20e-05 2
#> SD:mclust 81 2.21e-04 5.78e-04 2
#> CV:mclust 83 8.14e-05 2.80e-04 2
#> MAD:mclust 82 4.93e-04 1.30e-03 2
#> ATC:mclust 83 7.63e-04 1.60e-03 2
#> SD:kmeans 85 3.31e-05 1.93e-04 2
#> CV:kmeans 60 3.72e-04 1.30e-03 2
#> MAD:kmeans 61 5.18e-04 1.80e-03 2
#> ATC:kmeans 85 5.65e-05 3.19e-04 2
#> SD:pam 82 4.33e-02 9.42e-02 2
#> CV:pam 85 7.00e-02 1.75e-01 2
#> MAD:pam 84 5.21e-02 1.37e-01 2
#> ATC:pam 82 3.78e-05 2.21e-04 2
#> SD:hclust 84 1.54e-01 3.67e-01 2
#> CV:hclust 83 4.05e-01 7.09e-01 2
#> MAD:hclust 42 6.84e-02 1.34e-01 2
#> ATC:hclust 75 7.09e-05 3.79e-04 2
test_to_known_factors(res_list, k = 3)
#> n disease.state(p) cell.type(p) k
#> SD:NMF 83 5.07e-04 0.007640 3
#> CV:NMF 83 2.65e-04 0.003255 3
#> MAD:NMF 82 3.91e-04 0.006181 3
#> ATC:NMF 84 3.89e-04 0.006142 3
#> SD:skmeans 84 8.79e-05 0.002744 3
#> CV:skmeans 84 8.79e-05 0.002744 3
#> MAD:skmeans 84 8.79e-05 0.002744 3
#> ATC:skmeans 85 2.80e-05 0.001054 3
#> SD:mclust 81 8.96e-05 0.002797 3
#> CV:mclust 82 2.32e-04 0.006109 3
#> MAD:mclust 85 2.13e-05 0.000834 3
#> ATC:mclust 79 1.68e-05 0.000680 3
#> SD:kmeans 84 9.92e-04 0.019335 3
#> CV:kmeans 83 8.28e-04 0.016801 3
#> MAD:kmeans 83 5.12e-04 0.011515 3
#> ATC:kmeans 85 4.83e-04 0.010993 3
#> SD:pam 82 1.21e-04 0.002308 3
#> CV:pam 82 1.12e-04 0.002131 3
#> MAD:pam 84 1.29e-04 0.002434 3
#> ATC:pam 84 3.89e-04 0.009260 3
#> SD:hclust 73 2.25e-03 0.042381 3
#> CV:hclust 75 1.85e-03 0.033420 3
#> MAD:hclust 79 1.10e-03 0.022627 3
#> ATC:hclust 76 8.89e-03 0.085844 3
test_to_known_factors(res_list, k = 4)
#> n disease.state(p) cell.type(p) k
#> SD:NMF 71 6.86e-04 0.009890 4
#> CV:NMF 74 9.03e-05 0.003380 4
#> MAD:NMF 70 9.05e-04 0.009286 4
#> ATC:NMF 69 1.03e-03 0.013752 4
#> SD:skmeans 77 6.68e-06 0.000871 4
#> CV:skmeans 77 4.30e-06 0.000611 4
#> MAD:skmeans 75 1.29e-05 0.001494 4
#> ATC:skmeans 80 1.04e-04 0.007440 4
#> SD:mclust 79 8.14e-07 0.000184 4
#> CV:mclust 76 8.60e-04 0.035540 4
#> MAD:mclust 82 6.88e-07 0.000135 4
#> ATC:mclust 76 1.55e-04 0.012491 4
#> SD:kmeans 71 3.37e-04 0.018355 4
#> CV:kmeans 71 8.08e-06 0.000365 4
#> MAD:kmeans 68 9.13e-05 0.006960 4
#> ATC:kmeans 73 2.48e-04 0.017735 4
#> SD:pam 77 6.54e-06 0.000508 4
#> CV:pam 77 8.47e-06 0.000634 4
#> MAD:pam 79 9.46e-06 0.000695 4
#> ATC:pam 83 7.02e-06 0.000812 4
#> SD:hclust 70 9.08e-03 0.185016 4
#> CV:hclust 65 1.08e-04 0.003774 4
#> MAD:hclust 64 4.37e-02 0.473348 4
#> ATC:hclust 66 3.90e-04 0.016753 4
test_to_known_factors(res_list, k = 5)
#> n disease.state(p) cell.type(p) k
#> SD:NMF 63 4.60e-04 1.63e-02 5
#> CV:NMF 61 2.37e-04 7.94e-03 5
#> MAD:NMF 61 8.82e-04 2.66e-02 5
#> ATC:NMF 70 1.86e-04 1.00e-02 5
#> SD:skmeans 71 1.49e-04 1.93e-02 5
#> CV:skmeans 68 8.96e-05 6.70e-03 5
#> MAD:skmeans 67 3.74e-04 3.61e-02 5
#> ATC:skmeans 68 3.04e-06 5.30e-04 5
#> SD:mclust 81 8.96e-05 1.37e-02 5
#> CV:mclust 80 5.55e-05 9.54e-03 5
#> MAD:mclust 84 2.30e-05 5.19e-03 5
#> ATC:mclust 80 1.29e-06 6.32e-04 5
#> SD:kmeans 77 2.97e-06 1.36e-03 5
#> CV:kmeans 80 1.13e-06 6.38e-04 5
#> MAD:kmeans 72 1.53e-05 4.68e-03 5
#> ATC:kmeans 63 4.04e-06 1.50e-06 5
#> SD:pam 70 2.45e-05 8.22e-04 5
#> CV:pam 69 1.36e-05 1.57e-03 5
#> MAD:pam 75 8.38e-05 1.91e-03 5
#> ATC:pam 81 1.94e-06 7.17e-04 5
#> SD:hclust 61 8.96e-04 4.00e-02 5
#> CV:hclust 50 1.47e-02 2.87e-01 5
#> MAD:hclust 68 7.48e-04 1.93e-02 5
#> ATC:hclust 62 3.70e-04 2.91e-02 5
test_to_known_factors(res_list, k = 6)
#> n disease.state(p) cell.type(p) k
#> SD:NMF 64 2.07e-04 1.16e-02 6
#> CV:NMF 60 1.23e-03 3.40e-02 6
#> MAD:NMF 61 1.08e-03 9.67e-04 6
#> ATC:NMF 61 1.68e-03 3.80e-02 6
#> SD:skmeans 59 1.31e-03 8.97e-02 6
#> CV:skmeans 44 1.41e-02 1.86e-01 6
#> MAD:skmeans 62 7.39e-04 5.51e-02 6
#> ATC:skmeans 75 3.51e-08 7.99e-05 6
#> SD:mclust 73 4.37e-05 8.24e-03 6
#> CV:mclust 77 8.74e-07 7.05e-04 6
#> MAD:mclust 75 1.19e-04 2.98e-02 6
#> ATC:mclust 68 4.57e-07 3.24e-04 6
#> SD:kmeans 70 7.31e-08 7.19e-05 6
#> CV:kmeans 74 5.67e-08 1.44e-04 6
#> MAD:kmeans 62 5.20e-06 4.84e-03 6
#> ATC:kmeans 52 5.13e-07 7.59e-05 6
#> SD:pam 75 1.64e-04 6.37e-03 6
#> CV:pam 74 5.45e-05 3.28e-03 6
#> MAD:pam 73 2.43e-04 1.27e-02 6
#> ATC:pam 79 4.10e-07 2.36e-04 6
#> SD:hclust 61 3.69e-03 7.74e-02 6
#> CV:hclust 68 1.16e-04 1.83e-02 6
#> MAD:hclust 64 1.50e-05 4.03e-03 6
#> ATC:hclust 68 4.01e-05 1.76e-03 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 21512 rows and 85 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 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.376 0.782 0.858 0.4281 0.561 0.561
#> 3 3 0.609 0.753 0.878 0.5224 0.749 0.559
#> 4 4 0.594 0.630 0.781 0.0885 0.929 0.792
#> 5 5 0.621 0.603 0.794 0.0598 0.906 0.708
#> 6 6 0.647 0.632 0.777 0.0364 0.973 0.900
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
#> GSM99497 2 0.8955 0.756 0.312 0.688
#> GSM99503 1 0.0000 0.910 1.000 0.000
#> GSM99505 1 0.2043 0.901 0.968 0.032
#> GSM99507 2 0.8955 0.756 0.312 0.688
#> GSM99567 2 0.8955 0.756 0.312 0.688
#> GSM99575 1 0.0000 0.910 1.000 0.000
#> GSM99593 2 0.8955 0.756 0.312 0.688
#> GSM99595 2 0.8955 0.756 0.312 0.688
#> GSM99469 1 0.1414 0.906 0.980 0.020
#> GSM99499 1 0.1843 0.903 0.972 0.028
#> GSM99501 1 0.1414 0.906 0.980 0.020
#> GSM99509 2 0.9170 0.736 0.332 0.668
#> GSM99569 2 0.9170 0.736 0.332 0.668
#> GSM99597 2 0.9248 0.727 0.340 0.660
#> GSM99601 2 0.0000 0.780 0.000 1.000
#> GSM99459 1 0.8267 0.541 0.740 0.260
#> GSM99461 1 0.9996 -0.352 0.512 0.488
#> GSM99511 2 0.9044 0.749 0.320 0.680
#> GSM99513 2 0.9044 0.749 0.320 0.680
#> GSM99515 2 0.8955 0.756 0.312 0.688
#> GSM99517 1 0.0000 0.910 1.000 0.000
#> GSM99519 1 0.7528 0.646 0.784 0.216
#> GSM99521 2 0.9000 0.753 0.316 0.684
#> GSM99523 2 0.9170 0.736 0.332 0.668
#> GSM99571 1 0.0000 0.910 1.000 0.000
#> GSM99599 1 0.0000 0.910 1.000 0.000
#> GSM99433 2 0.3879 0.802 0.076 0.924
#> GSM99435 2 0.9000 0.753 0.316 0.684
#> GSM99437 2 0.0938 0.786 0.012 0.988
#> GSM99439 2 0.0000 0.780 0.000 1.000
#> GSM99441 1 0.0000 0.910 1.000 0.000
#> GSM99443 2 0.0000 0.780 0.000 1.000
#> GSM99445 2 0.0000 0.780 0.000 1.000
#> GSM99447 2 0.3733 0.802 0.072 0.928
#> GSM99449 2 0.8499 0.774 0.276 0.724
#> GSM99451 2 0.9129 0.741 0.328 0.672
#> GSM99453 1 0.0000 0.910 1.000 0.000
#> GSM99455 1 0.0000 0.910 1.000 0.000
#> GSM99457 1 0.0000 0.910 1.000 0.000
#> GSM99463 2 0.0000 0.780 0.000 1.000
#> GSM99465 2 0.9754 0.610 0.408 0.592
#> GSM99467 2 0.5629 0.804 0.132 0.868
#> GSM99471 1 0.4815 0.847 0.896 0.104
#> GSM99473 1 0.6438 0.748 0.836 0.164
#> GSM99475 2 0.8955 0.756 0.312 0.688
#> GSM99477 2 0.5946 0.805 0.144 0.856
#> GSM99479 2 0.5519 0.804 0.128 0.872
#> GSM99481 1 0.0000 0.910 1.000 0.000
#> GSM99483 1 0.0376 0.910 0.996 0.004
#> GSM99485 2 0.5178 0.798 0.116 0.884
#> GSM99487 2 0.0938 0.786 0.012 0.988
#> GSM99489 2 0.0000 0.780 0.000 1.000
#> GSM99491 2 0.2043 0.791 0.032 0.968
#> GSM99493 1 0.0000 0.910 1.000 0.000
#> GSM99495 2 0.0000 0.780 0.000 1.000
#> GSM99525 1 0.3114 0.883 0.944 0.056
#> GSM99527 2 0.9323 0.716 0.348 0.652
#> GSM99529 2 0.6887 0.798 0.184 0.816
#> GSM99531 2 0.9552 0.673 0.376 0.624
#> GSM99533 2 0.9087 0.746 0.324 0.676
#> GSM99535 2 0.9393 0.564 0.356 0.644
#> GSM99537 1 0.0000 0.910 1.000 0.000
#> GSM99539 2 0.2043 0.793 0.032 0.968
#> GSM99541 1 0.4562 0.845 0.904 0.096
#> GSM99543 2 0.4562 0.768 0.096 0.904
#> GSM99545 2 0.1633 0.790 0.024 0.976
#> GSM99547 2 0.9358 0.699 0.352 0.648
#> GSM99549 2 0.0376 0.782 0.004 0.996
#> GSM99551 1 0.4815 0.846 0.896 0.104
#> GSM99553 2 0.8499 0.775 0.276 0.724
#> GSM99555 2 0.0000 0.780 0.000 1.000
#> GSM99557 2 0.0376 0.782 0.004 0.996
#> GSM99559 2 0.8499 0.774 0.276 0.724
#> GSM99561 2 0.1633 0.790 0.024 0.976
#> GSM99563 2 0.9044 0.749 0.320 0.680
#> GSM99565 2 0.0000 0.780 0.000 1.000
#> GSM99573 2 0.0376 0.782 0.004 0.996
#> GSM99577 1 0.5408 0.812 0.876 0.124
#> GSM99579 2 0.3584 0.799 0.068 0.932
#> GSM99581 2 0.8661 0.769 0.288 0.712
#> GSM99583 2 0.7453 0.788 0.212 0.788
#> GSM99585 2 0.6048 0.805 0.148 0.852
#> GSM99587 1 0.0000 0.910 1.000 0.000
#> GSM99589 2 0.4298 0.805 0.088 0.912
#> GSM99591 2 0.0000 0.780 0.000 1.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM99497 3 0.1015 0.880 0.012 0.008 0.980
#> GSM99503 1 0.0424 0.913 0.992 0.000 0.008
#> GSM99505 1 0.2711 0.891 0.912 0.000 0.088
#> GSM99507 3 0.1015 0.880 0.012 0.008 0.980
#> GSM99567 3 0.1015 0.880 0.012 0.008 0.980
#> GSM99575 1 0.0424 0.913 0.992 0.000 0.008
#> GSM99593 3 0.1015 0.880 0.012 0.008 0.980
#> GSM99595 3 0.1015 0.880 0.012 0.008 0.980
#> GSM99469 1 0.2261 0.900 0.932 0.000 0.068
#> GSM99499 1 0.2625 0.892 0.916 0.000 0.084
#> GSM99501 1 0.2261 0.900 0.932 0.000 0.068
#> GSM99509 3 0.1031 0.878 0.024 0.000 0.976
#> GSM99569 3 0.1031 0.879 0.024 0.000 0.976
#> GSM99597 3 0.1411 0.873 0.036 0.000 0.964
#> GSM99601 2 0.0892 0.799 0.000 0.980 0.020
#> GSM99459 1 0.6126 0.401 0.600 0.000 0.400
#> GSM99461 3 0.5254 0.602 0.264 0.000 0.736
#> GSM99511 3 0.0592 0.879 0.012 0.000 0.988
#> GSM99513 3 0.0592 0.879 0.012 0.000 0.988
#> GSM99515 3 0.1015 0.880 0.012 0.008 0.980
#> GSM99517 1 0.0424 0.913 0.992 0.000 0.008
#> GSM99519 1 0.5760 0.570 0.672 0.000 0.328
#> GSM99521 3 0.1491 0.878 0.016 0.016 0.968
#> GSM99523 3 0.1031 0.879 0.024 0.000 0.976
#> GSM99571 1 0.0000 0.911 1.000 0.000 0.000
#> GSM99599 1 0.0424 0.913 0.992 0.000 0.008
#> GSM99433 2 0.6225 0.407 0.000 0.568 0.432
#> GSM99435 3 0.0829 0.880 0.012 0.004 0.984
#> GSM99437 2 0.3752 0.768 0.000 0.856 0.144
#> GSM99439 2 0.0000 0.794 0.000 1.000 0.000
#> GSM99441 1 0.0424 0.913 0.992 0.000 0.008
#> GSM99443 2 0.0424 0.798 0.000 0.992 0.008
#> GSM99445 2 0.0424 0.798 0.000 0.992 0.008
#> GSM99447 2 0.5706 0.617 0.000 0.680 0.320
#> GSM99449 3 0.3454 0.812 0.008 0.104 0.888
#> GSM99451 3 0.0892 0.879 0.020 0.000 0.980
#> GSM99453 1 0.0000 0.911 1.000 0.000 0.000
#> GSM99455 1 0.0000 0.911 1.000 0.000 0.000
#> GSM99457 1 0.0000 0.911 1.000 0.000 0.000
#> GSM99463 2 0.0000 0.794 0.000 1.000 0.000
#> GSM99465 3 0.3619 0.788 0.136 0.000 0.864
#> GSM99467 2 0.6647 0.353 0.008 0.540 0.452
#> GSM99471 1 0.4063 0.854 0.868 0.020 0.112
#> GSM99473 1 0.5244 0.717 0.756 0.004 0.240
#> GSM99475 3 0.0661 0.879 0.008 0.004 0.988
#> GSM99477 2 0.6295 0.311 0.000 0.528 0.472
#> GSM99479 2 0.6633 0.371 0.008 0.548 0.444
#> GSM99481 1 0.0424 0.913 0.992 0.000 0.008
#> GSM99483 1 0.0237 0.910 0.996 0.004 0.000
#> GSM99485 2 0.6800 0.601 0.032 0.660 0.308
#> GSM99487 2 0.3752 0.768 0.000 0.856 0.144
#> GSM99489 2 0.0000 0.794 0.000 1.000 0.000
#> GSM99491 2 0.2860 0.789 0.004 0.912 0.084
#> GSM99493 1 0.0000 0.911 1.000 0.000 0.000
#> GSM99495 2 0.0000 0.794 0.000 1.000 0.000
#> GSM99525 1 0.2590 0.890 0.924 0.004 0.072
#> GSM99527 3 0.2680 0.849 0.068 0.008 0.924
#> GSM99529 3 0.7188 -0.244 0.024 0.484 0.492
#> GSM99531 3 0.2625 0.841 0.084 0.000 0.916
#> GSM99533 3 0.0747 0.880 0.016 0.000 0.984
#> GSM99535 2 0.9906 0.215 0.272 0.388 0.340
#> GSM99537 1 0.0747 0.912 0.984 0.000 0.016
#> GSM99539 3 0.5948 0.305 0.000 0.360 0.640
#> GSM99541 1 0.3879 0.833 0.848 0.000 0.152
#> GSM99543 2 0.3805 0.755 0.092 0.884 0.024
#> GSM99545 3 0.5465 0.497 0.000 0.288 0.712
#> GSM99547 3 0.4526 0.797 0.104 0.040 0.856
#> GSM99549 2 0.0747 0.798 0.000 0.984 0.016
#> GSM99551 1 0.4602 0.821 0.832 0.016 0.152
#> GSM99553 3 0.3921 0.804 0.016 0.112 0.872
#> GSM99555 2 0.2066 0.797 0.000 0.940 0.060
#> GSM99557 2 0.0592 0.799 0.000 0.988 0.012
#> GSM99559 3 0.3607 0.803 0.008 0.112 0.880
#> GSM99561 2 0.4605 0.731 0.000 0.796 0.204
#> GSM99563 3 0.0592 0.879 0.012 0.000 0.988
#> GSM99565 2 0.2066 0.797 0.000 0.940 0.060
#> GSM99573 2 0.0747 0.798 0.000 0.984 0.016
#> GSM99577 1 0.4452 0.787 0.808 0.000 0.192
#> GSM99579 2 0.5220 0.720 0.012 0.780 0.208
#> GSM99581 3 0.2955 0.831 0.008 0.080 0.912
#> GSM99583 3 0.7819 -0.142 0.052 0.440 0.508
#> GSM99585 2 0.6678 0.288 0.008 0.512 0.480
#> GSM99587 1 0.0000 0.911 1.000 0.000 0.000
#> GSM99589 2 0.6215 0.398 0.000 0.572 0.428
#> GSM99591 2 0.0424 0.798 0.000 0.992 0.008
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM99497 3 0.0592 0.789 0.000 0.000 0.984 0.016
#> GSM99503 1 0.0336 0.900 0.992 0.000 0.008 0.000
#> GSM99505 1 0.2266 0.877 0.912 0.000 0.084 0.004
#> GSM99507 3 0.0592 0.789 0.000 0.000 0.984 0.016
#> GSM99567 3 0.0592 0.789 0.000 0.000 0.984 0.016
#> GSM99575 1 0.0336 0.900 0.992 0.000 0.008 0.000
#> GSM99593 3 0.0592 0.789 0.000 0.000 0.984 0.016
#> GSM99595 3 0.0592 0.789 0.000 0.000 0.984 0.016
#> GSM99469 1 0.1902 0.887 0.932 0.000 0.064 0.004
#> GSM99499 1 0.2197 0.879 0.916 0.000 0.080 0.004
#> GSM99501 1 0.1902 0.887 0.932 0.000 0.064 0.004
#> GSM99509 3 0.2473 0.759 0.012 0.000 0.908 0.080
#> GSM99569 3 0.0804 0.787 0.012 0.000 0.980 0.008
#> GSM99597 3 0.3718 0.703 0.012 0.000 0.820 0.168
#> GSM99601 2 0.4331 0.596 0.000 0.712 0.000 0.288
#> GSM99459 1 0.6616 0.443 0.584 0.000 0.308 0.108
#> GSM99461 3 0.6691 0.374 0.236 0.000 0.612 0.152
#> GSM99511 3 0.0336 0.788 0.000 0.000 0.992 0.008
#> GSM99513 3 0.0336 0.788 0.000 0.000 0.992 0.008
#> GSM99515 3 0.0592 0.789 0.000 0.000 0.984 0.016
#> GSM99517 1 0.0336 0.900 0.992 0.000 0.008 0.000
#> GSM99519 1 0.6139 0.579 0.656 0.000 0.244 0.100
#> GSM99521 3 0.1576 0.785 0.004 0.000 0.948 0.048
#> GSM99523 3 0.0804 0.787 0.012 0.000 0.980 0.008
#> GSM99571 1 0.1209 0.897 0.964 0.000 0.004 0.032
#> GSM99599 1 0.0336 0.900 0.992 0.000 0.008 0.000
#> GSM99433 4 0.7917 0.519 0.000 0.312 0.340 0.348
#> GSM99435 3 0.1211 0.787 0.000 0.000 0.960 0.040
#> GSM99437 2 0.6648 0.327 0.000 0.536 0.092 0.372
#> GSM99439 2 0.1792 0.600 0.000 0.932 0.000 0.068
#> GSM99441 1 0.0336 0.900 0.992 0.000 0.008 0.000
#> GSM99443 2 0.3726 0.623 0.000 0.788 0.000 0.212
#> GSM99445 2 0.3726 0.623 0.000 0.788 0.000 0.212
#> GSM99447 2 0.7684 -0.361 0.000 0.396 0.216 0.388
#> GSM99449 3 0.3587 0.703 0.000 0.040 0.856 0.104
#> GSM99451 3 0.1890 0.780 0.008 0.000 0.936 0.056
#> GSM99453 1 0.1209 0.897 0.964 0.000 0.004 0.032
#> GSM99455 1 0.1209 0.897 0.964 0.000 0.004 0.032
#> GSM99457 1 0.1557 0.891 0.944 0.000 0.000 0.056
#> GSM99463 2 0.0000 0.591 0.000 1.000 0.000 0.000
#> GSM99465 3 0.5582 0.579 0.108 0.000 0.724 0.168
#> GSM99467 4 0.7785 0.680 0.000 0.284 0.288 0.428
#> GSM99471 1 0.4621 0.822 0.816 0.012 0.080 0.092
#> GSM99473 1 0.5346 0.693 0.732 0.000 0.192 0.076
#> GSM99475 3 0.3726 0.676 0.000 0.000 0.788 0.212
#> GSM99477 4 0.7896 0.662 0.000 0.296 0.336 0.368
#> GSM99479 4 0.7773 0.673 0.000 0.288 0.280 0.432
#> GSM99481 1 0.0336 0.900 0.992 0.000 0.008 0.000
#> GSM99483 1 0.1305 0.897 0.960 0.000 0.004 0.036
#> GSM99485 4 0.7762 0.276 0.012 0.400 0.160 0.428
#> GSM99487 2 0.6648 0.327 0.000 0.536 0.092 0.372
#> GSM99489 2 0.0707 0.583 0.000 0.980 0.000 0.020
#> GSM99491 2 0.5161 0.552 0.000 0.676 0.024 0.300
#> GSM99493 1 0.1474 0.892 0.948 0.000 0.000 0.052
#> GSM99495 2 0.0707 0.583 0.000 0.980 0.000 0.020
#> GSM99525 1 0.3168 0.872 0.884 0.000 0.060 0.056
#> GSM99527 3 0.4237 0.687 0.040 0.000 0.808 0.152
#> GSM99529 4 0.7983 0.630 0.008 0.272 0.272 0.448
#> GSM99531 3 0.5947 0.402 0.044 0.000 0.572 0.384
#> GSM99533 3 0.4011 0.680 0.008 0.000 0.784 0.208
#> GSM99535 4 0.9960 0.335 0.228 0.240 0.236 0.296
#> GSM99537 1 0.0804 0.900 0.980 0.000 0.012 0.008
#> GSM99539 3 0.7493 -0.213 0.000 0.208 0.488 0.304
#> GSM99541 1 0.3900 0.838 0.844 0.000 0.072 0.084
#> GSM99543 2 0.4332 0.464 0.072 0.816 0.000 0.112
#> GSM99545 3 0.6974 0.125 0.000 0.152 0.564 0.284
#> GSM99547 3 0.5307 0.595 0.076 0.000 0.736 0.188
#> GSM99549 2 0.2345 0.560 0.000 0.900 0.000 0.100
#> GSM99551 1 0.4655 0.792 0.760 0.000 0.032 0.208
#> GSM99553 3 0.3962 0.684 0.004 0.052 0.844 0.100
#> GSM99555 2 0.5511 0.517 0.000 0.620 0.028 0.352
#> GSM99557 2 0.4008 0.617 0.000 0.756 0.000 0.244
#> GSM99559 3 0.3850 0.684 0.000 0.044 0.840 0.116
#> GSM99561 2 0.6778 0.248 0.000 0.552 0.112 0.336
#> GSM99563 3 0.0336 0.788 0.000 0.000 0.992 0.008
#> GSM99565 2 0.5511 0.517 0.000 0.620 0.028 0.352
#> GSM99573 2 0.2345 0.560 0.000 0.900 0.000 0.100
#> GSM99577 1 0.4547 0.798 0.804 0.000 0.104 0.092
#> GSM99579 2 0.6542 0.151 0.000 0.496 0.076 0.428
#> GSM99581 3 0.3082 0.725 0.000 0.032 0.884 0.084
#> GSM99583 4 0.8494 0.664 0.032 0.224 0.336 0.408
#> GSM99585 3 0.7920 -0.729 0.000 0.316 0.344 0.340
#> GSM99587 1 0.1474 0.892 0.948 0.000 0.000 0.052
#> GSM99589 2 0.7921 -0.533 0.000 0.348 0.328 0.324
#> GSM99591 2 0.3907 0.621 0.000 0.768 0.000 0.232
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM99497 3 0.0771 0.7123 0.000 0.020 0.976 0.004 0.000
#> GSM99503 1 0.0000 0.8805 1.000 0.000 0.000 0.000 0.000
#> GSM99505 1 0.2144 0.8510 0.912 0.000 0.068 0.020 0.000
#> GSM99507 3 0.0771 0.7123 0.000 0.020 0.976 0.004 0.000
#> GSM99567 3 0.0609 0.7115 0.000 0.020 0.980 0.000 0.000
#> GSM99575 1 0.0000 0.8805 1.000 0.000 0.000 0.000 0.000
#> GSM99593 3 0.0771 0.7114 0.000 0.020 0.976 0.004 0.000
#> GSM99595 3 0.0609 0.7115 0.000 0.020 0.980 0.000 0.000
#> GSM99469 1 0.1800 0.8632 0.932 0.000 0.048 0.020 0.000
#> GSM99499 1 0.2079 0.8535 0.916 0.000 0.064 0.020 0.000
#> GSM99501 1 0.1800 0.8632 0.932 0.000 0.048 0.020 0.000
#> GSM99509 3 0.3070 0.5628 0.012 0.000 0.860 0.112 0.016
#> GSM99569 3 0.0798 0.7037 0.008 0.000 0.976 0.016 0.000
#> GSM99597 3 0.4588 0.3199 0.012 0.008 0.744 0.208 0.028
#> GSM99601 2 0.3266 0.4378 0.000 0.796 0.000 0.004 0.200
#> GSM99459 1 0.6723 0.2806 0.552 0.032 0.252 0.164 0.000
#> GSM99461 3 0.7207 -0.0609 0.200 0.044 0.492 0.264 0.000
#> GSM99511 3 0.0290 0.7061 0.000 0.000 0.992 0.008 0.000
#> GSM99513 3 0.0290 0.7061 0.000 0.000 0.992 0.008 0.000
#> GSM99515 3 0.0771 0.7123 0.000 0.020 0.976 0.004 0.000
#> GSM99517 1 0.0000 0.8805 1.000 0.000 0.000 0.000 0.000
#> GSM99519 1 0.6189 0.4762 0.632 0.032 0.192 0.144 0.000
#> GSM99521 3 0.2142 0.6927 0.004 0.028 0.920 0.048 0.000
#> GSM99523 3 0.0798 0.7037 0.008 0.000 0.976 0.016 0.000
#> GSM99571 1 0.1124 0.8762 0.960 0.000 0.000 0.036 0.004
#> GSM99599 1 0.0000 0.8805 1.000 0.000 0.000 0.000 0.000
#> GSM99433 2 0.6182 0.4612 0.000 0.608 0.268 0.080 0.044
#> GSM99435 3 0.1768 0.6867 0.000 0.000 0.924 0.072 0.004
#> GSM99437 2 0.3067 0.5934 0.000 0.876 0.068 0.016 0.040
#> GSM99439 5 0.3884 0.7487 0.000 0.288 0.000 0.004 0.708
#> GSM99441 1 0.0000 0.8805 1.000 0.000 0.000 0.000 0.000
#> GSM99443 2 0.3730 0.3480 0.000 0.712 0.000 0.000 0.288
#> GSM99445 2 0.3730 0.3480 0.000 0.712 0.000 0.000 0.288
#> GSM99447 2 0.5201 0.6113 0.000 0.732 0.144 0.092 0.032
#> GSM99449 3 0.3712 0.6017 0.000 0.132 0.820 0.040 0.008
#> GSM99451 3 0.2805 0.6355 0.004 0.004 0.864 0.124 0.004
#> GSM99453 1 0.1124 0.8762 0.960 0.000 0.000 0.036 0.004
#> GSM99455 1 0.1124 0.8762 0.960 0.000 0.000 0.036 0.004
#> GSM99457 1 0.1830 0.8679 0.924 0.000 0.000 0.068 0.008
#> GSM99463 5 0.3336 0.8371 0.000 0.228 0.000 0.000 0.772
#> GSM99465 3 0.6410 0.1604 0.072 0.056 0.572 0.300 0.000
#> GSM99467 2 0.6105 0.5402 0.000 0.620 0.176 0.188 0.016
#> GSM99471 1 0.4899 0.7551 0.764 0.008 0.060 0.140 0.028
#> GSM99473 1 0.5575 0.6222 0.712 0.028 0.152 0.100 0.008
#> GSM99475 3 0.4806 0.0266 0.004 0.008 0.600 0.380 0.008
#> GSM99477 2 0.5778 0.5029 0.000 0.620 0.244 0.132 0.004
#> GSM99479 2 0.6338 0.5445 0.000 0.616 0.172 0.180 0.032
#> GSM99481 1 0.0000 0.8805 1.000 0.000 0.000 0.000 0.000
#> GSM99483 1 0.1205 0.8761 0.956 0.000 0.000 0.040 0.004
#> GSM99485 2 0.6482 0.5698 0.000 0.624 0.080 0.200 0.096
#> GSM99487 2 0.3067 0.5934 0.000 0.876 0.068 0.016 0.040
#> GSM99489 5 0.2852 0.8763 0.000 0.172 0.000 0.000 0.828
#> GSM99491 2 0.4578 0.4545 0.000 0.724 0.004 0.048 0.224
#> GSM99493 1 0.1764 0.8683 0.928 0.000 0.000 0.064 0.008
#> GSM99495 5 0.2852 0.8763 0.000 0.172 0.000 0.000 0.828
#> GSM99525 1 0.3099 0.8440 0.872 0.004 0.048 0.072 0.004
#> GSM99527 3 0.5175 0.3527 0.012 0.048 0.656 0.284 0.000
#> GSM99529 2 0.7172 0.4527 0.000 0.516 0.148 0.272 0.064
#> GSM99531 4 0.6692 0.0000 0.028 0.020 0.364 0.516 0.072
#> GSM99533 3 0.4667 0.0830 0.008 0.004 0.612 0.372 0.004
#> GSM99535 2 0.9393 0.1882 0.180 0.352 0.148 0.232 0.088
#> GSM99537 1 0.0609 0.8776 0.980 0.000 0.000 0.020 0.000
#> GSM99539 2 0.7571 -0.0941 0.000 0.360 0.312 0.288 0.040
#> GSM99541 1 0.3889 0.7992 0.832 0.016 0.028 0.108 0.016
#> GSM99543 5 0.4195 0.7623 0.048 0.080 0.000 0.056 0.816
#> GSM99545 3 0.7456 -0.2277 0.000 0.276 0.400 0.288 0.036
#> GSM99547 3 0.6285 0.2700 0.048 0.080 0.596 0.276 0.000
#> GSM99549 5 0.3106 0.8682 0.000 0.140 0.000 0.020 0.840
#> GSM99551 1 0.4598 0.7144 0.700 0.008 0.000 0.264 0.028
#> GSM99553 3 0.3591 0.6000 0.004 0.132 0.828 0.032 0.004
#> GSM99555 2 0.2208 0.5501 0.000 0.908 0.020 0.000 0.072
#> GSM99557 2 0.3814 0.3688 0.000 0.720 0.000 0.004 0.276
#> GSM99559 3 0.4069 0.5712 0.000 0.148 0.796 0.044 0.012
#> GSM99561 2 0.5727 0.4707 0.000 0.680 0.040 0.088 0.192
#> GSM99563 3 0.0290 0.7061 0.000 0.000 0.992 0.008 0.000
#> GSM99565 2 0.2208 0.5501 0.000 0.908 0.020 0.000 0.072
#> GSM99573 5 0.3106 0.8682 0.000 0.140 0.000 0.020 0.840
#> GSM99577 1 0.4600 0.7524 0.792 0.016 0.056 0.116 0.020
#> GSM99579 2 0.4819 0.5533 0.000 0.736 0.004 0.148 0.112
#> GSM99581 3 0.2828 0.6450 0.000 0.104 0.872 0.020 0.004
#> GSM99583 2 0.7068 0.4203 0.012 0.512 0.220 0.240 0.016
#> GSM99585 2 0.6297 0.5010 0.000 0.572 0.216 0.204 0.008
#> GSM99587 1 0.1764 0.8683 0.928 0.000 0.000 0.064 0.008
#> GSM99589 2 0.7050 0.4502 0.000 0.532 0.280 0.080 0.108
#> GSM99591 2 0.3684 0.3569 0.000 0.720 0.000 0.000 0.280
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM99497 3 0.0837 0.7651 0.000 0.020 0.972 0.004 0.000 0.004
#> GSM99503 1 0.0000 0.8610 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99505 1 0.2285 0.8338 0.900 0.000 0.064 0.008 0.000 0.028
#> GSM99507 3 0.0837 0.7651 0.000 0.020 0.972 0.004 0.000 0.004
#> GSM99567 3 0.0837 0.7647 0.000 0.020 0.972 0.004 0.000 0.004
#> GSM99575 1 0.0000 0.8610 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99593 3 0.1053 0.7643 0.000 0.020 0.964 0.012 0.000 0.004
#> GSM99595 3 0.0837 0.7647 0.000 0.020 0.972 0.004 0.000 0.004
#> GSM99469 1 0.1970 0.8450 0.920 0.000 0.044 0.008 0.000 0.028
#> GSM99499 1 0.2226 0.8362 0.904 0.000 0.060 0.008 0.000 0.028
#> GSM99501 1 0.1970 0.8450 0.920 0.000 0.044 0.008 0.000 0.028
#> GSM99509 3 0.3377 0.5872 0.000 0.000 0.808 0.056 0.000 0.136
#> GSM99569 3 0.0891 0.7571 0.000 0.000 0.968 0.008 0.000 0.024
#> GSM99597 3 0.4640 0.3130 0.000 0.004 0.676 0.080 0.000 0.240
#> GSM99601 2 0.3642 0.5239 0.000 0.760 0.000 0.036 0.204 0.000
#> GSM99459 1 0.6332 0.3182 0.536 0.024 0.236 0.012 0.000 0.192
#> GSM99461 3 0.6960 0.0828 0.184 0.032 0.440 0.028 0.000 0.316
#> GSM99511 3 0.0405 0.7592 0.000 0.000 0.988 0.008 0.000 0.004
#> GSM99513 3 0.0405 0.7592 0.000 0.000 0.988 0.008 0.000 0.004
#> GSM99515 3 0.0837 0.7651 0.000 0.020 0.972 0.004 0.000 0.004
#> GSM99517 1 0.0000 0.8610 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99519 1 0.5812 0.4838 0.616 0.020 0.176 0.012 0.000 0.176
#> GSM99521 3 0.2383 0.7458 0.000 0.028 0.900 0.020 0.000 0.052
#> GSM99523 3 0.0891 0.7571 0.000 0.000 0.968 0.008 0.000 0.024
#> GSM99571 1 0.0937 0.8559 0.960 0.000 0.000 0.000 0.000 0.040
#> GSM99599 1 0.0000 0.8610 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99433 2 0.6473 0.3717 0.000 0.568 0.224 0.136 0.020 0.052
#> GSM99435 3 0.2501 0.7059 0.000 0.004 0.872 0.108 0.000 0.016
#> GSM99437 2 0.3828 0.6165 0.000 0.828 0.052 0.040 0.060 0.020
#> GSM99439 5 0.3804 0.7406 0.000 0.184 0.000 0.040 0.768 0.008
#> GSM99441 1 0.0000 0.8610 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99443 2 0.3672 0.4545 0.000 0.688 0.000 0.008 0.304 0.000
#> GSM99445 2 0.3672 0.4545 0.000 0.688 0.000 0.008 0.304 0.000
#> GSM99447 2 0.5214 0.5682 0.000 0.724 0.100 0.084 0.016 0.076
#> GSM99449 3 0.4151 0.6325 0.000 0.124 0.780 0.052 0.000 0.044
#> GSM99451 3 0.3971 0.5640 0.000 0.012 0.772 0.156 0.000 0.060
#> GSM99453 1 0.0937 0.8559 0.960 0.000 0.000 0.000 0.000 0.040
#> GSM99455 1 0.0937 0.8559 0.960 0.000 0.000 0.000 0.000 0.040
#> GSM99457 1 0.2999 0.8059 0.836 0.000 0.000 0.040 0.000 0.124
#> GSM99463 5 0.2300 0.8102 0.000 0.144 0.000 0.000 0.856 0.000
#> GSM99465 3 0.6545 0.2399 0.056 0.040 0.500 0.060 0.000 0.344
#> GSM99467 2 0.5896 0.5119 0.000 0.632 0.136 0.052 0.008 0.172
#> GSM99471 1 0.4826 0.7224 0.736 0.008 0.036 0.048 0.008 0.164
#> GSM99473 1 0.5476 0.6016 0.688 0.020 0.140 0.024 0.004 0.124
#> GSM99475 4 0.5253 0.3909 0.000 0.012 0.352 0.560 0.000 0.076
#> GSM99477 2 0.5810 0.4836 0.000 0.628 0.188 0.072 0.000 0.112
#> GSM99479 2 0.5951 0.5153 0.000 0.628 0.136 0.056 0.008 0.172
#> GSM99481 1 0.0000 0.8610 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99483 1 0.1152 0.8555 0.952 0.000 0.000 0.004 0.000 0.044
#> GSM99485 2 0.6161 0.5605 0.000 0.640 0.052 0.064 0.068 0.176
#> GSM99487 2 0.3828 0.6165 0.000 0.828 0.052 0.040 0.060 0.020
#> GSM99489 5 0.1444 0.8525 0.000 0.072 0.000 0.000 0.928 0.000
#> GSM99491 2 0.4015 0.5423 0.000 0.744 0.000 0.012 0.208 0.036
#> GSM99493 1 0.2930 0.8080 0.840 0.000 0.000 0.036 0.000 0.124
#> GSM99495 5 0.1444 0.8525 0.000 0.072 0.000 0.000 0.928 0.000
#> GSM99525 1 0.2794 0.8282 0.868 0.004 0.036 0.004 0.000 0.088
#> GSM99527 3 0.5654 0.3560 0.000 0.040 0.572 0.080 0.000 0.308
#> GSM99529 2 0.6730 0.4451 0.000 0.516 0.084 0.076 0.028 0.296
#> GSM99531 6 0.5846 0.0000 0.000 0.004 0.224 0.256 0.000 0.516
#> GSM99533 4 0.5491 0.3668 0.000 0.008 0.356 0.528 0.000 0.108
#> GSM99535 2 0.9049 0.1837 0.148 0.336 0.100 0.100 0.056 0.260
#> GSM99537 1 0.0820 0.8580 0.972 0.000 0.000 0.012 0.000 0.016
#> GSM99539 4 0.5784 0.3652 0.000 0.288 0.128 0.564 0.008 0.012
#> GSM99541 1 0.3318 0.7845 0.824 0.000 0.020 0.024 0.000 0.132
#> GSM99543 5 0.3569 0.7401 0.020 0.020 0.000 0.068 0.840 0.052
#> GSM99545 4 0.5414 0.4632 0.000 0.184 0.176 0.628 0.008 0.004
#> GSM99547 3 0.6634 0.2679 0.032 0.064 0.512 0.076 0.000 0.316
#> GSM99549 5 0.2582 0.8320 0.000 0.032 0.000 0.060 0.888 0.020
#> GSM99551 1 0.5303 0.5748 0.588 0.004 0.000 0.088 0.008 0.312
#> GSM99553 3 0.3875 0.6433 0.000 0.120 0.796 0.024 0.000 0.060
#> GSM99555 2 0.2703 0.6101 0.000 0.876 0.016 0.028 0.080 0.000
#> GSM99557 2 0.3767 0.4735 0.000 0.708 0.000 0.012 0.276 0.004
#> GSM99559 3 0.4431 0.6011 0.000 0.140 0.756 0.056 0.000 0.048
#> GSM99561 2 0.6176 0.4281 0.000 0.576 0.008 0.180 0.200 0.036
#> GSM99563 3 0.0405 0.7592 0.000 0.000 0.988 0.008 0.000 0.004
#> GSM99565 2 0.2778 0.6090 0.000 0.872 0.016 0.032 0.080 0.000
#> GSM99573 5 0.2582 0.8320 0.000 0.032 0.000 0.060 0.888 0.020
#> GSM99577 1 0.3973 0.7377 0.780 0.000 0.048 0.024 0.000 0.148
#> GSM99579 2 0.4455 0.5986 0.000 0.764 0.000 0.056 0.076 0.104
#> GSM99581 3 0.2939 0.6931 0.000 0.100 0.856 0.012 0.000 0.032
#> GSM99583 2 0.6797 0.4202 0.012 0.528 0.168 0.060 0.004 0.228
#> GSM99585 2 0.6390 0.4766 0.000 0.568 0.144 0.076 0.004 0.208
#> GSM99587 1 0.2930 0.8080 0.840 0.000 0.000 0.036 0.000 0.124
#> GSM99589 2 0.7047 0.4092 0.000 0.528 0.244 0.052 0.092 0.084
#> GSM99591 2 0.3875 0.4692 0.000 0.700 0.000 0.016 0.280 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 disease.state(p) cell.type(p) k
#> SD:hclust 84 0.153952 0.3667 2
#> SD:hclust 73 0.002253 0.0424 3
#> SD:hclust 70 0.009084 0.1850 4
#> SD:hclust 61 0.000896 0.0400 5
#> SD:hclust 61 0.003689 0.0774 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 21512 rows and 85 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.542 0.766 0.819 0.4655 0.519 0.519
#> 3 3 0.951 0.939 0.941 0.4198 0.724 0.507
#> 4 4 0.761 0.721 0.830 0.1107 0.919 0.759
#> 5 5 0.726 0.772 0.821 0.0610 0.892 0.641
#> 6 6 0.751 0.639 0.802 0.0418 0.970 0.873
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
#> GSM99497 1 0.998 0.530 0.524 0.476
#> GSM99503 1 0.000 0.741 1.000 0.000
#> GSM99505 1 0.204 0.728 0.968 0.032
#> GSM99507 1 0.998 0.530 0.524 0.476
#> GSM99567 1 0.998 0.530 0.524 0.476
#> GSM99575 1 0.000 0.741 1.000 0.000
#> GSM99593 1 0.998 0.530 0.524 0.476
#> GSM99595 1 0.998 0.530 0.524 0.476
#> GSM99469 1 0.000 0.741 1.000 0.000
#> GSM99499 1 0.000 0.741 1.000 0.000
#> GSM99501 1 0.000 0.741 1.000 0.000
#> GSM99509 1 0.998 0.530 0.524 0.476
#> GSM99569 1 0.998 0.530 0.524 0.476
#> GSM99597 1 0.995 0.544 0.540 0.460
#> GSM99601 2 0.224 0.977 0.036 0.964
#> GSM99459 1 0.000 0.741 1.000 0.000
#> GSM99461 1 0.000 0.741 1.000 0.000
#> GSM99511 1 0.998 0.530 0.524 0.476
#> GSM99513 1 0.998 0.530 0.524 0.476
#> GSM99515 1 0.998 0.530 0.524 0.476
#> GSM99517 1 0.000 0.741 1.000 0.000
#> GSM99519 1 0.000 0.741 1.000 0.000
#> GSM99521 1 0.998 0.530 0.524 0.476
#> GSM99523 1 0.929 0.620 0.656 0.344
#> GSM99571 1 0.000 0.741 1.000 0.000
#> GSM99599 1 0.000 0.741 1.000 0.000
#> GSM99433 2 0.000 0.946 0.000 1.000
#> GSM99435 1 0.998 0.530 0.524 0.476
#> GSM99437 2 0.224 0.977 0.036 0.964
#> GSM99439 2 0.224 0.977 0.036 0.964
#> GSM99441 1 0.000 0.741 1.000 0.000
#> GSM99443 2 0.224 0.977 0.036 0.964
#> GSM99445 2 0.224 0.977 0.036 0.964
#> GSM99447 2 0.224 0.977 0.036 0.964
#> GSM99449 2 0.000 0.946 0.000 1.000
#> GSM99451 1 0.998 0.530 0.524 0.476
#> GSM99453 1 0.000 0.741 1.000 0.000
#> GSM99455 1 0.000 0.741 1.000 0.000
#> GSM99457 1 0.000 0.741 1.000 0.000
#> GSM99463 2 0.224 0.977 0.036 0.964
#> GSM99465 1 0.876 0.641 0.704 0.296
#> GSM99467 2 0.224 0.977 0.036 0.964
#> GSM99471 1 0.000 0.741 1.000 0.000
#> GSM99473 1 0.000 0.741 1.000 0.000
#> GSM99475 1 0.998 0.530 0.524 0.476
#> GSM99477 2 0.000 0.946 0.000 1.000
#> GSM99479 2 0.224 0.977 0.036 0.964
#> GSM99481 1 0.000 0.741 1.000 0.000
#> GSM99483 1 0.000 0.741 1.000 0.000
#> GSM99485 2 0.224 0.977 0.036 0.964
#> GSM99487 2 0.224 0.977 0.036 0.964
#> GSM99489 2 0.224 0.977 0.036 0.964
#> GSM99491 2 0.224 0.977 0.036 0.964
#> GSM99493 1 0.000 0.741 1.000 0.000
#> GSM99495 2 0.224 0.977 0.036 0.964
#> GSM99525 1 0.000 0.741 1.000 0.000
#> GSM99527 1 0.997 0.527 0.532 0.468
#> GSM99529 2 0.722 0.695 0.200 0.800
#> GSM99531 1 0.994 0.548 0.544 0.456
#> GSM99533 1 0.921 0.625 0.664 0.336
#> GSM99535 2 0.653 0.800 0.168 0.832
#> GSM99537 1 0.000 0.741 1.000 0.000
#> GSM99539 2 0.000 0.946 0.000 1.000
#> GSM99541 1 0.141 0.733 0.980 0.020
#> GSM99543 2 0.224 0.977 0.036 0.964
#> GSM99545 2 0.000 0.946 0.000 1.000
#> GSM99547 1 0.980 0.539 0.584 0.416
#> GSM99549 2 0.224 0.977 0.036 0.964
#> GSM99551 1 0.000 0.741 1.000 0.000
#> GSM99553 1 0.998 0.530 0.524 0.476
#> GSM99555 2 0.224 0.977 0.036 0.964
#> GSM99557 2 0.224 0.977 0.036 0.964
#> GSM99559 2 0.000 0.946 0.000 1.000
#> GSM99561 2 0.224 0.977 0.036 0.964
#> GSM99563 1 0.998 0.530 0.524 0.476
#> GSM99565 2 0.184 0.971 0.028 0.972
#> GSM99573 2 0.224 0.977 0.036 0.964
#> GSM99577 1 0.000 0.741 1.000 0.000
#> GSM99579 2 0.224 0.977 0.036 0.964
#> GSM99581 1 0.998 0.530 0.524 0.476
#> GSM99583 1 0.990 0.512 0.560 0.440
#> GSM99585 2 0.224 0.977 0.036 0.964
#> GSM99587 1 0.000 0.741 1.000 0.000
#> GSM99589 2 0.224 0.977 0.036 0.964
#> GSM99591 2 0.224 0.977 0.036 0.964
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM99497 3 0.1289 0.949 0.032 0.000 0.968
#> GSM99503 1 0.0000 0.984 1.000 0.000 0.000
#> GSM99505 1 0.0000 0.984 1.000 0.000 0.000
#> GSM99507 3 0.1289 0.949 0.032 0.000 0.968
#> GSM99567 3 0.1289 0.949 0.032 0.000 0.968
#> GSM99575 1 0.0000 0.984 1.000 0.000 0.000
#> GSM99593 3 0.1163 0.947 0.028 0.000 0.972
#> GSM99595 3 0.1289 0.949 0.032 0.000 0.968
#> GSM99469 1 0.0000 0.984 1.000 0.000 0.000
#> GSM99499 1 0.0000 0.984 1.000 0.000 0.000
#> GSM99501 1 0.0000 0.984 1.000 0.000 0.000
#> GSM99509 3 0.1289 0.949 0.032 0.000 0.968
#> GSM99569 3 0.1289 0.949 0.032 0.000 0.968
#> GSM99597 3 0.1289 0.949 0.032 0.000 0.968
#> GSM99601 2 0.2066 0.969 0.000 0.940 0.060
#> GSM99459 1 0.0000 0.984 1.000 0.000 0.000
#> GSM99461 1 0.0000 0.984 1.000 0.000 0.000
#> GSM99511 3 0.1289 0.949 0.032 0.000 0.968
#> GSM99513 3 0.1289 0.949 0.032 0.000 0.968
#> GSM99515 3 0.1289 0.949 0.032 0.000 0.968
#> GSM99517 1 0.0000 0.984 1.000 0.000 0.000
#> GSM99519 1 0.0000 0.984 1.000 0.000 0.000
#> GSM99521 3 0.1289 0.949 0.032 0.000 0.968
#> GSM99523 3 0.2537 0.910 0.080 0.000 0.920
#> GSM99571 1 0.1031 0.983 0.976 0.024 0.000
#> GSM99599 1 0.0237 0.985 0.996 0.004 0.000
#> GSM99433 2 0.4235 0.852 0.000 0.824 0.176
#> GSM99435 3 0.1289 0.949 0.032 0.000 0.968
#> GSM99437 2 0.2165 0.969 0.000 0.936 0.064
#> GSM99439 2 0.2711 0.961 0.000 0.912 0.088
#> GSM99441 1 0.0424 0.985 0.992 0.008 0.000
#> GSM99443 2 0.2165 0.969 0.000 0.936 0.064
#> GSM99445 2 0.2066 0.969 0.000 0.940 0.060
#> GSM99447 2 0.2165 0.969 0.000 0.936 0.064
#> GSM99449 3 0.1163 0.925 0.000 0.028 0.972
#> GSM99451 3 0.1289 0.949 0.032 0.000 0.968
#> GSM99453 1 0.1643 0.979 0.956 0.044 0.000
#> GSM99455 1 0.1643 0.979 0.956 0.044 0.000
#> GSM99457 1 0.2066 0.973 0.940 0.060 0.000
#> GSM99463 2 0.2711 0.961 0.000 0.912 0.088
#> GSM99465 3 0.4235 0.822 0.176 0.000 0.824
#> GSM99467 2 0.2165 0.969 0.000 0.936 0.064
#> GSM99471 1 0.1643 0.979 0.956 0.044 0.000
#> GSM99473 1 0.0237 0.985 0.996 0.004 0.000
#> GSM99475 3 0.1877 0.942 0.032 0.012 0.956
#> GSM99477 3 0.3340 0.844 0.000 0.120 0.880
#> GSM99479 2 0.5363 0.695 0.000 0.724 0.276
#> GSM99481 1 0.0424 0.985 0.992 0.008 0.000
#> GSM99483 1 0.1643 0.979 0.956 0.044 0.000
#> GSM99485 2 0.2165 0.969 0.000 0.936 0.064
#> GSM99487 2 0.2165 0.969 0.000 0.936 0.064
#> GSM99489 2 0.2711 0.961 0.000 0.912 0.088
#> GSM99491 2 0.2165 0.969 0.000 0.936 0.064
#> GSM99493 1 0.2066 0.973 0.940 0.060 0.000
#> GSM99495 2 0.2711 0.961 0.000 0.912 0.088
#> GSM99525 1 0.1529 0.980 0.960 0.040 0.000
#> GSM99527 3 0.1289 0.949 0.032 0.000 0.968
#> GSM99529 3 0.4504 0.745 0.000 0.196 0.804
#> GSM99531 3 0.2569 0.928 0.032 0.032 0.936
#> GSM99533 3 0.2806 0.922 0.040 0.032 0.928
#> GSM99535 2 0.4859 0.844 0.116 0.840 0.044
#> GSM99537 1 0.0592 0.984 0.988 0.012 0.000
#> GSM99539 3 0.4842 0.701 0.000 0.224 0.776
#> GSM99541 1 0.0592 0.984 0.988 0.012 0.000
#> GSM99543 2 0.1964 0.937 0.000 0.944 0.056
#> GSM99545 3 0.6192 0.172 0.000 0.420 0.580
#> GSM99547 3 0.2590 0.921 0.072 0.004 0.924
#> GSM99549 2 0.2448 0.954 0.000 0.924 0.076
#> GSM99551 1 0.2066 0.973 0.940 0.060 0.000
#> GSM99553 3 0.1289 0.949 0.032 0.000 0.968
#> GSM99555 2 0.2165 0.969 0.000 0.936 0.064
#> GSM99557 2 0.2261 0.968 0.000 0.932 0.068
#> GSM99559 3 0.1163 0.925 0.000 0.028 0.972
#> GSM99561 2 0.2448 0.967 0.000 0.924 0.076
#> GSM99563 3 0.1289 0.949 0.032 0.000 0.968
#> GSM99565 2 0.2165 0.969 0.000 0.936 0.064
#> GSM99573 2 0.2711 0.961 0.000 0.912 0.088
#> GSM99577 1 0.1964 0.975 0.944 0.056 0.000
#> GSM99579 2 0.2165 0.969 0.000 0.936 0.064
#> GSM99581 3 0.1289 0.949 0.032 0.000 0.968
#> GSM99583 3 0.2313 0.932 0.032 0.024 0.944
#> GSM99585 2 0.2796 0.949 0.000 0.908 0.092
#> GSM99587 1 0.2066 0.973 0.940 0.060 0.000
#> GSM99589 2 0.2165 0.969 0.000 0.936 0.064
#> GSM99591 2 0.2066 0.969 0.000 0.940 0.060
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM99497 3 0.0000 0.87571 0.000 0.000 1.000 0.000
#> GSM99503 1 0.0000 0.92009 1.000 0.000 0.000 0.000
#> GSM99505 1 0.1042 0.91769 0.972 0.000 0.008 0.020
#> GSM99507 3 0.0000 0.87571 0.000 0.000 1.000 0.000
#> GSM99567 3 0.0000 0.87571 0.000 0.000 1.000 0.000
#> GSM99575 1 0.0000 0.92009 1.000 0.000 0.000 0.000
#> GSM99593 3 0.0000 0.87571 0.000 0.000 1.000 0.000
#> GSM99595 3 0.0000 0.87571 0.000 0.000 1.000 0.000
#> GSM99469 1 0.0817 0.91793 0.976 0.000 0.000 0.024
#> GSM99499 1 0.0707 0.91860 0.980 0.000 0.000 0.020
#> GSM99501 1 0.0817 0.91793 0.976 0.000 0.000 0.024
#> GSM99509 3 0.0000 0.87571 0.000 0.000 1.000 0.000
#> GSM99569 3 0.0000 0.87571 0.000 0.000 1.000 0.000
#> GSM99597 3 0.0000 0.87571 0.000 0.000 1.000 0.000
#> GSM99601 2 0.3726 0.78523 0.000 0.788 0.000 0.212
#> GSM99459 1 0.1792 0.90486 0.932 0.000 0.000 0.068
#> GSM99461 1 0.1792 0.90486 0.932 0.000 0.000 0.068
#> GSM99511 3 0.0000 0.87571 0.000 0.000 1.000 0.000
#> GSM99513 3 0.0000 0.87571 0.000 0.000 1.000 0.000
#> GSM99515 3 0.0000 0.87571 0.000 0.000 1.000 0.000
#> GSM99517 1 0.0000 0.92009 1.000 0.000 0.000 0.000
#> GSM99519 1 0.1716 0.90598 0.936 0.000 0.000 0.064
#> GSM99521 3 0.0188 0.87280 0.000 0.000 0.996 0.004
#> GSM99523 3 0.0000 0.87571 0.000 0.000 1.000 0.000
#> GSM99571 1 0.2081 0.90685 0.916 0.000 0.000 0.084
#> GSM99599 1 0.0000 0.92009 1.000 0.000 0.000 0.000
#> GSM99433 4 0.5573 0.27830 0.000 0.272 0.052 0.676
#> GSM99435 3 0.4406 0.54738 0.000 0.000 0.700 0.300
#> GSM99437 2 0.4522 0.76969 0.000 0.680 0.000 0.320
#> GSM99439 2 0.0188 0.70479 0.000 0.996 0.000 0.004
#> GSM99441 1 0.0000 0.92009 1.000 0.000 0.000 0.000
#> GSM99443 2 0.4193 0.78428 0.000 0.732 0.000 0.268
#> GSM99445 2 0.3356 0.77940 0.000 0.824 0.000 0.176
#> GSM99447 2 0.4605 0.75940 0.000 0.664 0.000 0.336
#> GSM99449 3 0.0000 0.87571 0.000 0.000 1.000 0.000
#> GSM99451 3 0.4564 0.51134 0.000 0.000 0.672 0.328
#> GSM99453 1 0.3356 0.87652 0.824 0.000 0.000 0.176
#> GSM99455 1 0.3311 0.87844 0.828 0.000 0.000 0.172
#> GSM99457 1 0.3764 0.85389 0.784 0.000 0.000 0.216
#> GSM99463 2 0.0000 0.70494 0.000 1.000 0.000 0.000
#> GSM99465 4 0.7358 0.00176 0.160 0.000 0.392 0.448
#> GSM99467 4 0.4977 -0.35592 0.000 0.460 0.000 0.540
#> GSM99471 1 0.3486 0.87917 0.812 0.000 0.000 0.188
#> GSM99473 1 0.1637 0.91156 0.940 0.000 0.000 0.060
#> GSM99475 3 0.4679 0.47729 0.000 0.000 0.648 0.352
#> GSM99477 4 0.6394 0.53570 0.000 0.088 0.316 0.596
#> GSM99479 4 0.5558 -0.00190 0.000 0.364 0.028 0.608
#> GSM99481 1 0.0000 0.92009 1.000 0.000 0.000 0.000
#> GSM99483 1 0.3074 0.88653 0.848 0.000 0.000 0.152
#> GSM99485 2 0.4804 0.69453 0.000 0.616 0.000 0.384
#> GSM99487 2 0.4522 0.76969 0.000 0.680 0.000 0.320
#> GSM99489 2 0.0000 0.70494 0.000 1.000 0.000 0.000
#> GSM99491 2 0.4522 0.76875 0.000 0.680 0.000 0.320
#> GSM99493 1 0.3726 0.85568 0.788 0.000 0.000 0.212
#> GSM99495 2 0.0000 0.70494 0.000 1.000 0.000 0.000
#> GSM99525 1 0.2469 0.90081 0.892 0.000 0.000 0.108
#> GSM99527 3 0.4999 0.10846 0.000 0.000 0.508 0.492
#> GSM99529 4 0.5204 0.53232 0.000 0.088 0.160 0.752
#> GSM99531 3 0.4730 0.46008 0.000 0.000 0.636 0.364
#> GSM99533 3 0.4730 0.46008 0.000 0.000 0.636 0.364
#> GSM99535 2 0.5693 0.49089 0.024 0.504 0.000 0.472
#> GSM99537 1 0.0188 0.92026 0.996 0.000 0.000 0.004
#> GSM99539 4 0.7293 0.40161 0.000 0.156 0.368 0.476
#> GSM99541 1 0.1474 0.91358 0.948 0.000 0.000 0.052
#> GSM99543 2 0.1389 0.67897 0.000 0.952 0.000 0.048
#> GSM99545 4 0.7734 0.41319 0.000 0.236 0.344 0.420
#> GSM99547 4 0.5285 -0.09920 0.008 0.000 0.468 0.524
#> GSM99549 2 0.0336 0.70349 0.000 0.992 0.000 0.008
#> GSM99551 1 0.4977 0.57418 0.540 0.000 0.000 0.460
#> GSM99553 3 0.0000 0.87571 0.000 0.000 1.000 0.000
#> GSM99555 2 0.4250 0.78343 0.000 0.724 0.000 0.276
#> GSM99557 2 0.2647 0.76127 0.000 0.880 0.000 0.120
#> GSM99559 3 0.0000 0.87571 0.000 0.000 1.000 0.000
#> GSM99561 2 0.4543 0.76462 0.000 0.676 0.000 0.324
#> GSM99563 3 0.0000 0.87571 0.000 0.000 1.000 0.000
#> GSM99565 2 0.4522 0.76969 0.000 0.680 0.000 0.320
#> GSM99573 2 0.0336 0.70349 0.000 0.992 0.000 0.008
#> GSM99577 1 0.3764 0.87130 0.784 0.000 0.000 0.216
#> GSM99579 2 0.4643 0.74969 0.000 0.656 0.000 0.344
#> GSM99581 3 0.0000 0.87571 0.000 0.000 1.000 0.000
#> GSM99583 4 0.5349 0.47487 0.000 0.024 0.336 0.640
#> GSM99585 4 0.4936 -0.06204 0.000 0.372 0.004 0.624
#> GSM99587 1 0.3726 0.85568 0.788 0.000 0.000 0.212
#> GSM99589 2 0.4585 0.75894 0.000 0.668 0.000 0.332
#> GSM99591 2 0.3528 0.78289 0.000 0.808 0.000 0.192
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM99497 3 0.0000 0.982 0.000 0.000 1.000 0.000 0.000
#> GSM99503 1 0.0000 0.874 1.000 0.000 0.000 0.000 0.000
#> GSM99505 1 0.2313 0.866 0.916 0.000 0.012 0.040 0.032
#> GSM99507 3 0.0000 0.982 0.000 0.000 1.000 0.000 0.000
#> GSM99567 3 0.0162 0.982 0.000 0.000 0.996 0.000 0.004
#> GSM99575 1 0.0000 0.874 1.000 0.000 0.000 0.000 0.000
#> GSM99593 3 0.0324 0.981 0.000 0.000 0.992 0.004 0.004
#> GSM99595 3 0.0162 0.982 0.000 0.000 0.996 0.000 0.004
#> GSM99469 1 0.1907 0.868 0.928 0.000 0.000 0.044 0.028
#> GSM99499 1 0.1915 0.869 0.928 0.000 0.000 0.040 0.032
#> GSM99501 1 0.1907 0.868 0.928 0.000 0.000 0.044 0.028
#> GSM99509 3 0.0579 0.978 0.000 0.000 0.984 0.008 0.008
#> GSM99569 3 0.0798 0.977 0.000 0.000 0.976 0.008 0.016
#> GSM99597 3 0.0807 0.971 0.000 0.000 0.976 0.012 0.012
#> GSM99601 2 0.4297 0.352 0.000 0.728 0.000 0.036 0.236
#> GSM99459 1 0.2903 0.847 0.872 0.000 0.000 0.080 0.048
#> GSM99461 1 0.2974 0.845 0.868 0.000 0.000 0.080 0.052
#> GSM99511 3 0.1211 0.971 0.000 0.000 0.960 0.016 0.024
#> GSM99513 3 0.1211 0.971 0.000 0.000 0.960 0.016 0.024
#> GSM99515 3 0.0000 0.982 0.000 0.000 1.000 0.000 0.000
#> GSM99517 1 0.0000 0.874 1.000 0.000 0.000 0.000 0.000
#> GSM99519 1 0.2843 0.849 0.876 0.000 0.000 0.076 0.048
#> GSM99521 3 0.0794 0.956 0.000 0.000 0.972 0.028 0.000
#> GSM99523 3 0.1012 0.973 0.000 0.000 0.968 0.012 0.020
#> GSM99571 1 0.2325 0.862 0.904 0.000 0.000 0.068 0.028
#> GSM99599 1 0.0162 0.874 0.996 0.000 0.000 0.000 0.004
#> GSM99433 2 0.5394 0.356 0.000 0.560 0.008 0.388 0.044
#> GSM99435 4 0.4457 0.719 0.000 0.000 0.368 0.620 0.012
#> GSM99437 2 0.2426 0.645 0.000 0.900 0.000 0.036 0.064
#> GSM99439 5 0.4387 0.935 0.000 0.348 0.000 0.012 0.640
#> GSM99441 1 0.0162 0.874 0.996 0.000 0.000 0.000 0.004
#> GSM99443 2 0.2304 0.619 0.000 0.892 0.000 0.008 0.100
#> GSM99445 2 0.4127 0.135 0.000 0.680 0.000 0.008 0.312
#> GSM99447 2 0.2992 0.651 0.000 0.868 0.000 0.064 0.068
#> GSM99449 3 0.0451 0.981 0.000 0.000 0.988 0.004 0.008
#> GSM99451 4 0.4201 0.775 0.000 0.000 0.328 0.664 0.008
#> GSM99453 1 0.4111 0.823 0.788 0.000 0.000 0.120 0.092
#> GSM99455 1 0.3955 0.828 0.800 0.000 0.000 0.116 0.084
#> GSM99457 1 0.5307 0.771 0.676 0.000 0.000 0.156 0.168
#> GSM99463 5 0.3999 0.939 0.000 0.344 0.000 0.000 0.656
#> GSM99465 4 0.6175 0.717 0.120 0.008 0.112 0.684 0.076
#> GSM99467 2 0.3888 0.631 0.000 0.812 0.004 0.112 0.072
#> GSM99471 1 0.5113 0.802 0.708 0.004 0.000 0.160 0.128
#> GSM99473 1 0.2751 0.857 0.888 0.004 0.000 0.052 0.056
#> GSM99475 4 0.4193 0.795 0.000 0.000 0.304 0.684 0.012
#> GSM99477 2 0.6204 0.514 0.000 0.640 0.112 0.200 0.048
#> GSM99479 2 0.4679 0.609 0.000 0.768 0.024 0.136 0.072
#> GSM99481 1 0.0162 0.874 0.996 0.000 0.000 0.000 0.004
#> GSM99483 1 0.3731 0.834 0.816 0.000 0.000 0.112 0.072
#> GSM99485 2 0.2889 0.648 0.000 0.872 0.000 0.044 0.084
#> GSM99487 2 0.2370 0.651 0.000 0.904 0.000 0.040 0.056
#> GSM99489 5 0.4268 0.933 0.000 0.344 0.000 0.008 0.648
#> GSM99491 2 0.1774 0.641 0.000 0.932 0.000 0.016 0.052
#> GSM99493 1 0.5163 0.774 0.692 0.000 0.000 0.152 0.156
#> GSM99495 5 0.3999 0.939 0.000 0.344 0.000 0.000 0.656
#> GSM99525 1 0.3346 0.844 0.844 0.000 0.000 0.092 0.064
#> GSM99527 4 0.4971 0.819 0.000 0.040 0.188 0.732 0.040
#> GSM99529 2 0.6464 0.378 0.000 0.552 0.040 0.316 0.092
#> GSM99531 4 0.4380 0.811 0.000 0.000 0.260 0.708 0.032
#> GSM99533 4 0.4132 0.815 0.000 0.000 0.260 0.720 0.020
#> GSM99535 2 0.3861 0.623 0.004 0.816 0.000 0.088 0.092
#> GSM99537 1 0.1216 0.876 0.960 0.000 0.000 0.020 0.020
#> GSM99539 4 0.5355 0.685 0.000 0.184 0.120 0.688 0.008
#> GSM99541 1 0.3262 0.835 0.840 0.000 0.000 0.124 0.036
#> GSM99543 5 0.4585 0.760 0.000 0.352 0.000 0.020 0.628
#> GSM99545 4 0.6087 0.704 0.000 0.140 0.120 0.672 0.068
#> GSM99547 4 0.5854 0.779 0.000 0.076 0.160 0.688 0.076
#> GSM99549 5 0.4451 0.934 0.000 0.340 0.000 0.016 0.644
#> GSM99551 1 0.6651 0.448 0.428 0.000 0.000 0.336 0.236
#> GSM99553 3 0.0000 0.982 0.000 0.000 1.000 0.000 0.000
#> GSM99555 2 0.2450 0.633 0.000 0.896 0.000 0.028 0.076
#> GSM99557 2 0.4473 -0.304 0.000 0.580 0.000 0.008 0.412
#> GSM99559 3 0.0324 0.980 0.000 0.004 0.992 0.004 0.000
#> GSM99561 2 0.3454 0.610 0.000 0.836 0.000 0.064 0.100
#> GSM99563 3 0.1211 0.971 0.000 0.000 0.960 0.016 0.024
#> GSM99565 2 0.2504 0.643 0.000 0.896 0.000 0.040 0.064
#> GSM99573 5 0.4451 0.934 0.000 0.340 0.000 0.016 0.644
#> GSM99577 1 0.5422 0.787 0.656 0.000 0.000 0.212 0.132
#> GSM99579 2 0.2595 0.642 0.000 0.888 0.000 0.032 0.080
#> GSM99581 3 0.0162 0.982 0.000 0.000 0.996 0.000 0.004
#> GSM99583 2 0.6753 0.452 0.000 0.600 0.124 0.196 0.080
#> GSM99585 2 0.4762 0.581 0.000 0.700 0.000 0.236 0.064
#> GSM99587 1 0.5163 0.774 0.692 0.000 0.000 0.152 0.156
#> GSM99589 2 0.1386 0.656 0.000 0.952 0.000 0.016 0.032
#> GSM99591 2 0.3934 0.268 0.000 0.716 0.000 0.008 0.276
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM99497 3 0.0146 0.9687 0.000 0.000 0.996 0.000 0.000 0.004
#> GSM99503 1 0.0000 0.6930 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99505 1 0.2494 0.6809 0.892 0.000 0.008 0.020 0.008 0.072
#> GSM99507 3 0.0000 0.9695 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM99567 3 0.0000 0.9695 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM99575 1 0.0000 0.6930 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99593 3 0.0291 0.9686 0.000 0.000 0.992 0.004 0.000 0.004
#> GSM99595 3 0.0000 0.9695 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM99469 1 0.2402 0.6793 0.888 0.000 0.000 0.020 0.008 0.084
#> GSM99499 1 0.2239 0.6831 0.900 0.000 0.000 0.020 0.008 0.072
#> GSM99501 1 0.2402 0.6793 0.888 0.000 0.000 0.020 0.008 0.084
#> GSM99509 3 0.0508 0.9669 0.000 0.000 0.984 0.000 0.012 0.004
#> GSM99569 3 0.1894 0.9434 0.000 0.004 0.928 0.012 0.016 0.040
#> GSM99597 3 0.0665 0.9654 0.000 0.000 0.980 0.004 0.008 0.008
#> GSM99601 2 0.5589 0.0629 0.000 0.484 0.000 0.024 0.416 0.076
#> GSM99459 1 0.4070 0.6040 0.780 0.000 0.000 0.068 0.024 0.128
#> GSM99461 1 0.4070 0.6040 0.780 0.000 0.000 0.068 0.024 0.128
#> GSM99511 3 0.2680 0.9159 0.000 0.004 0.884 0.016 0.028 0.068
#> GSM99513 3 0.2562 0.9224 0.000 0.004 0.892 0.016 0.028 0.060
#> GSM99515 3 0.0000 0.9695 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM99517 1 0.0260 0.6931 0.992 0.000 0.000 0.000 0.000 0.008
#> GSM99519 1 0.3820 0.6165 0.796 0.000 0.000 0.056 0.020 0.128
#> GSM99521 3 0.0508 0.9622 0.000 0.000 0.984 0.012 0.000 0.004
#> GSM99523 3 0.2246 0.9332 0.000 0.004 0.908 0.012 0.020 0.056
#> GSM99571 1 0.2378 0.6009 0.848 0.000 0.000 0.000 0.000 0.152
#> GSM99599 1 0.0363 0.6909 0.988 0.000 0.000 0.000 0.000 0.012
#> GSM99433 2 0.5353 0.4378 0.000 0.612 0.000 0.280 0.028 0.080
#> GSM99435 4 0.4580 0.7661 0.000 0.036 0.164 0.744 0.008 0.048
#> GSM99437 2 0.4580 0.6246 0.000 0.716 0.000 0.036 0.204 0.044
#> GSM99439 5 0.2203 0.7613 0.000 0.084 0.000 0.016 0.896 0.004
#> GSM99441 1 0.0363 0.6909 0.988 0.000 0.000 0.000 0.000 0.012
#> GSM99443 2 0.4615 0.5643 0.000 0.676 0.000 0.016 0.260 0.048
#> GSM99445 5 0.4822 0.1314 0.000 0.444 0.000 0.004 0.508 0.044
#> GSM99447 2 0.4711 0.6447 0.000 0.724 0.000 0.052 0.172 0.052
#> GSM99449 3 0.0508 0.9673 0.000 0.000 0.984 0.004 0.000 0.012
#> GSM99451 4 0.3753 0.7895 0.000 0.032 0.144 0.800 0.008 0.016
#> GSM99453 1 0.3695 0.2641 0.624 0.000 0.000 0.000 0.000 0.376
#> GSM99455 1 0.3695 0.2641 0.624 0.000 0.000 0.000 0.000 0.376
#> GSM99457 1 0.4634 -0.1890 0.496 0.000 0.000 0.008 0.024 0.472
#> GSM99463 5 0.1700 0.7639 0.000 0.080 0.000 0.004 0.916 0.000
#> GSM99465 4 0.6361 0.5301 0.092 0.060 0.004 0.608 0.028 0.208
#> GSM99467 2 0.2504 0.6574 0.000 0.892 0.008 0.032 0.004 0.064
#> GSM99471 1 0.4860 0.1518 0.540 0.036 0.000 0.012 0.000 0.412
#> GSM99473 1 0.3581 0.6317 0.800 0.008 0.000 0.020 0.012 0.160
#> GSM99475 4 0.3016 0.7889 0.000 0.012 0.136 0.836 0.000 0.016
#> GSM99477 2 0.3657 0.6381 0.000 0.824 0.044 0.072 0.000 0.060
#> GSM99479 2 0.2563 0.6513 0.000 0.884 0.008 0.040 0.000 0.068
#> GSM99481 1 0.0363 0.6909 0.988 0.000 0.000 0.000 0.000 0.012
#> GSM99483 1 0.3634 0.3098 0.644 0.000 0.000 0.000 0.000 0.356
#> GSM99485 2 0.3155 0.6565 0.000 0.840 0.000 0.004 0.088 0.068
#> GSM99487 2 0.4523 0.6320 0.000 0.724 0.000 0.036 0.196 0.044
#> GSM99489 5 0.2342 0.7556 0.000 0.088 0.000 0.004 0.888 0.020
#> GSM99491 2 0.3663 0.6194 0.000 0.776 0.000 0.004 0.180 0.040
#> GSM99493 1 0.4617 -0.1397 0.524 0.000 0.000 0.008 0.024 0.444
#> GSM99495 5 0.1700 0.7639 0.000 0.080 0.000 0.004 0.916 0.000
#> GSM99525 1 0.3288 0.4565 0.724 0.000 0.000 0.000 0.000 0.276
#> GSM99527 4 0.4280 0.7371 0.000 0.064 0.020 0.788 0.024 0.104
#> GSM99529 2 0.4882 0.5342 0.000 0.704 0.008 0.144 0.008 0.136
#> GSM99531 4 0.3797 0.7859 0.000 0.012 0.108 0.804 0.004 0.072
#> GSM99533 4 0.3078 0.7934 0.000 0.012 0.112 0.844 0.000 0.032
#> GSM99535 2 0.4158 0.6437 0.000 0.768 0.000 0.032 0.048 0.152
#> GSM99537 1 0.1370 0.6912 0.948 0.000 0.000 0.012 0.004 0.036
#> GSM99539 4 0.3529 0.7429 0.000 0.096 0.020 0.832 0.008 0.044
#> GSM99541 1 0.3402 0.6410 0.820 0.000 0.000 0.052 0.008 0.120
#> GSM99543 5 0.4270 0.6426 0.000 0.184 0.000 0.008 0.736 0.072
#> GSM99545 4 0.3523 0.7450 0.000 0.056 0.028 0.848 0.032 0.036
#> GSM99547 4 0.5867 0.6349 0.000 0.160 0.028 0.640 0.024 0.148
#> GSM99549 5 0.3534 0.7423 0.000 0.084 0.000 0.028 0.828 0.060
#> GSM99551 6 0.5693 0.0000 0.204 0.028 0.000 0.096 0.024 0.648
#> GSM99553 3 0.0000 0.9695 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM99555 2 0.4549 0.6122 0.000 0.708 0.000 0.028 0.220 0.044
#> GSM99557 5 0.4428 0.4434 0.000 0.340 0.000 0.004 0.624 0.032
#> GSM99559 3 0.0291 0.9678 0.000 0.004 0.992 0.004 0.000 0.000
#> GSM99561 2 0.5720 0.5223 0.000 0.624 0.000 0.056 0.212 0.108
#> GSM99563 3 0.2390 0.9270 0.000 0.004 0.900 0.012 0.024 0.060
#> GSM99565 2 0.4728 0.6184 0.000 0.704 0.000 0.036 0.208 0.052
#> GSM99573 5 0.3534 0.7423 0.000 0.084 0.000 0.028 0.828 0.060
#> GSM99577 1 0.4721 0.1180 0.496 0.000 0.000 0.036 0.004 0.464
#> GSM99579 2 0.3726 0.6370 0.000 0.792 0.000 0.004 0.124 0.080
#> GSM99581 3 0.0146 0.9697 0.000 0.000 0.996 0.000 0.000 0.004
#> GSM99583 2 0.4103 0.5956 0.000 0.792 0.048 0.044 0.004 0.112
#> GSM99585 2 0.4309 0.6066 0.000 0.736 0.000 0.176 0.008 0.080
#> GSM99587 1 0.4617 -0.1397 0.524 0.000 0.000 0.008 0.024 0.444
#> GSM99589 2 0.3000 0.6614 0.000 0.824 0.000 0.004 0.156 0.016
#> GSM99591 5 0.4834 0.0436 0.000 0.468 0.000 0.004 0.484 0.044
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)
An example of the output of tb
is:
#> which_row fdr mean_1 mean_2 scaled_mean_1 scaled_mean_2 km
#> 1 38 0.042760348 8.373488 9.131774 -0.5533452 0.5164555 1
#> 2 40 0.018707592 7.106213 8.469186 -0.6173731 0.5762149 1
#> 3 55 0.019134737 10.221463 11.207825 -0.6159697 0.5749050 1
#> 4 59 0.006059896 5.921854 7.869574 -0.6899429 0.6439467 1
#> 5 60 0.018055526 8.928898 10.211722 -0.6204761 0.5791110 1
#> 6 98 0.009384629 15.714769 14.887706 0.6635654 -0.6193277 2
...
The columns in tb
are:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.km
: Row groups if k-means clustering is applied to rows.UMAP plot which shows how samples are separated.
dimension_reduction(res, k = 2, method = "UMAP")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.
test_to_known_factors(res)
#> n disease.state(p) cell.type(p) k
#> SD:kmeans 85 3.31e-05 1.93e-04 2
#> SD:kmeans 84 9.92e-04 1.93e-02 3
#> SD:kmeans 71 3.37e-04 1.84e-02 4
#> SD:kmeans 77 2.97e-06 1.36e-03 5
#> SD:kmeans 70 7.31e-08 7.19e-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["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 21512 rows and 85 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 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.631 0.756 0.902 0.4967 0.500 0.500
#> 3 3 0.999 0.955 0.981 0.3513 0.753 0.541
#> 4 4 0.845 0.803 0.898 0.0880 0.919 0.765
#> 5 5 0.716 0.696 0.816 0.0647 0.952 0.829
#> 6 6 0.686 0.546 0.730 0.0407 0.971 0.882
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
#> GSM99497 1 0.997 0.2754 0.532 0.468
#> GSM99503 1 0.000 0.8546 1.000 0.000
#> GSM99505 1 0.000 0.8546 1.000 0.000
#> GSM99507 1 0.994 0.3079 0.544 0.456
#> GSM99567 1 0.999 0.2395 0.520 0.480
#> GSM99575 1 0.000 0.8546 1.000 0.000
#> GSM99593 2 0.722 0.6595 0.200 0.800
#> GSM99595 1 0.995 0.2975 0.540 0.460
#> GSM99469 1 0.000 0.8546 1.000 0.000
#> GSM99499 1 0.000 0.8546 1.000 0.000
#> GSM99501 1 0.000 0.8546 1.000 0.000
#> GSM99509 1 0.946 0.4931 0.636 0.364
#> GSM99569 1 0.767 0.6795 0.776 0.224
#> GSM99597 1 0.680 0.7238 0.820 0.180
#> GSM99601 2 0.000 0.9136 0.000 1.000
#> GSM99459 1 0.000 0.8546 1.000 0.000
#> GSM99461 1 0.000 0.8546 1.000 0.000
#> GSM99511 1 0.994 0.3079 0.544 0.456
#> GSM99513 1 0.997 0.2755 0.532 0.468
#> GSM99515 1 0.992 0.3271 0.552 0.448
#> GSM99517 1 0.000 0.8546 1.000 0.000
#> GSM99519 1 0.000 0.8546 1.000 0.000
#> GSM99521 1 0.985 0.3715 0.572 0.428
#> GSM99523 1 0.000 0.8546 1.000 0.000
#> GSM99571 1 0.000 0.8546 1.000 0.000
#> GSM99599 1 0.000 0.8546 1.000 0.000
#> GSM99433 2 0.000 0.9136 0.000 1.000
#> GSM99435 2 0.946 0.2828 0.364 0.636
#> GSM99437 2 0.000 0.9136 0.000 1.000
#> GSM99439 2 0.000 0.9136 0.000 1.000
#> GSM99441 1 0.000 0.8546 1.000 0.000
#> GSM99443 2 0.000 0.9136 0.000 1.000
#> GSM99445 2 0.000 0.9136 0.000 1.000
#> GSM99447 2 0.000 0.9136 0.000 1.000
#> GSM99449 2 0.000 0.9136 0.000 1.000
#> GSM99451 1 0.443 0.7980 0.908 0.092
#> GSM99453 1 0.000 0.8546 1.000 0.000
#> GSM99455 1 0.000 0.8546 1.000 0.000
#> GSM99457 1 0.000 0.8546 1.000 0.000
#> GSM99463 2 0.000 0.9136 0.000 1.000
#> GSM99465 1 0.000 0.8546 1.000 0.000
#> GSM99467 2 0.000 0.9136 0.000 1.000
#> GSM99471 1 0.000 0.8546 1.000 0.000
#> GSM99473 1 0.000 0.8546 1.000 0.000
#> GSM99475 1 0.929 0.5254 0.656 0.344
#> GSM99477 2 0.000 0.9136 0.000 1.000
#> GSM99479 2 0.000 0.9136 0.000 1.000
#> GSM99481 1 0.000 0.8546 1.000 0.000
#> GSM99483 1 0.000 0.8546 1.000 0.000
#> GSM99485 2 0.000 0.9136 0.000 1.000
#> GSM99487 2 0.000 0.9136 0.000 1.000
#> GSM99489 2 0.000 0.9136 0.000 1.000
#> GSM99491 2 0.000 0.9136 0.000 1.000
#> GSM99493 1 0.000 0.8546 1.000 0.000
#> GSM99495 2 0.000 0.9136 0.000 1.000
#> GSM99525 1 0.000 0.8546 1.000 0.000
#> GSM99527 1 0.929 0.4693 0.656 0.344
#> GSM99529 2 0.000 0.9136 0.000 1.000
#> GSM99531 1 0.163 0.8418 0.976 0.024
#> GSM99533 1 0.000 0.8546 1.000 0.000
#> GSM99535 2 0.971 0.3024 0.400 0.600
#> GSM99537 1 0.000 0.8546 1.000 0.000
#> GSM99539 2 0.000 0.9136 0.000 1.000
#> GSM99541 1 0.000 0.8546 1.000 0.000
#> GSM99543 2 0.932 0.4152 0.348 0.652
#> GSM99545 2 0.000 0.9136 0.000 1.000
#> GSM99547 1 0.584 0.7316 0.860 0.140
#> GSM99549 2 0.000 0.9136 0.000 1.000
#> GSM99551 1 0.000 0.8546 1.000 0.000
#> GSM99553 2 0.961 0.2247 0.384 0.616
#> GSM99555 2 0.000 0.9136 0.000 1.000
#> GSM99557 2 0.000 0.9136 0.000 1.000
#> GSM99559 2 0.000 0.9136 0.000 1.000
#> GSM99561 2 0.000 0.9136 0.000 1.000
#> GSM99563 1 0.939 0.5063 0.644 0.356
#> GSM99565 2 0.000 0.9136 0.000 1.000
#> GSM99573 2 0.000 0.9136 0.000 1.000
#> GSM99577 1 0.000 0.8546 1.000 0.000
#> GSM99579 2 0.000 0.9136 0.000 1.000
#> GSM99581 2 0.990 0.0145 0.440 0.560
#> GSM99583 2 0.991 0.1960 0.444 0.556
#> GSM99585 2 0.000 0.9136 0.000 1.000
#> GSM99587 1 0.000 0.8546 1.000 0.000
#> GSM99589 2 0.000 0.9136 0.000 1.000
#> GSM99591 2 0.000 0.9136 0.000 1.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM99497 3 0.0000 0.991 0.000 0.000 1.000
#> GSM99503 1 0.0000 0.965 1.000 0.000 0.000
#> GSM99505 1 0.0000 0.965 1.000 0.000 0.000
#> GSM99507 3 0.0000 0.991 0.000 0.000 1.000
#> GSM99567 3 0.0000 0.991 0.000 0.000 1.000
#> GSM99575 1 0.0000 0.965 1.000 0.000 0.000
#> GSM99593 3 0.0000 0.991 0.000 0.000 1.000
#> GSM99595 3 0.0000 0.991 0.000 0.000 1.000
#> GSM99469 1 0.0000 0.965 1.000 0.000 0.000
#> GSM99499 1 0.0000 0.965 1.000 0.000 0.000
#> GSM99501 1 0.0000 0.965 1.000 0.000 0.000
#> GSM99509 3 0.0000 0.991 0.000 0.000 1.000
#> GSM99569 3 0.0000 0.991 0.000 0.000 1.000
#> GSM99597 3 0.0000 0.991 0.000 0.000 1.000
#> GSM99601 2 0.0000 0.985 0.000 1.000 0.000
#> GSM99459 1 0.0000 0.965 1.000 0.000 0.000
#> GSM99461 1 0.0000 0.965 1.000 0.000 0.000
#> GSM99511 3 0.0000 0.991 0.000 0.000 1.000
#> GSM99513 3 0.0000 0.991 0.000 0.000 1.000
#> GSM99515 3 0.0000 0.991 0.000 0.000 1.000
#> GSM99517 1 0.0000 0.965 1.000 0.000 0.000
#> GSM99519 1 0.0000 0.965 1.000 0.000 0.000
#> GSM99521 3 0.0000 0.991 0.000 0.000 1.000
#> GSM99523 3 0.0000 0.991 0.000 0.000 1.000
#> GSM99571 1 0.0000 0.965 1.000 0.000 0.000
#> GSM99599 1 0.0000 0.965 1.000 0.000 0.000
#> GSM99433 2 0.0000 0.985 0.000 1.000 0.000
#> GSM99435 3 0.0000 0.991 0.000 0.000 1.000
#> GSM99437 2 0.0000 0.985 0.000 1.000 0.000
#> GSM99439 2 0.0000 0.985 0.000 1.000 0.000
#> GSM99441 1 0.0000 0.965 1.000 0.000 0.000
#> GSM99443 2 0.0000 0.985 0.000 1.000 0.000
#> GSM99445 2 0.0000 0.985 0.000 1.000 0.000
#> GSM99447 2 0.0000 0.985 0.000 1.000 0.000
#> GSM99449 3 0.0000 0.991 0.000 0.000 1.000
#> GSM99451 3 0.0000 0.991 0.000 0.000 1.000
#> GSM99453 1 0.0000 0.965 1.000 0.000 0.000
#> GSM99455 1 0.0000 0.965 1.000 0.000 0.000
#> GSM99457 1 0.0000 0.965 1.000 0.000 0.000
#> GSM99463 2 0.0000 0.985 0.000 1.000 0.000
#> GSM99465 1 0.5678 0.541 0.684 0.000 0.316
#> GSM99467 2 0.0000 0.985 0.000 1.000 0.000
#> GSM99471 1 0.0000 0.965 1.000 0.000 0.000
#> GSM99473 1 0.0000 0.965 1.000 0.000 0.000
#> GSM99475 3 0.0000 0.991 0.000 0.000 1.000
#> GSM99477 2 0.1643 0.947 0.000 0.956 0.044
#> GSM99479 2 0.0000 0.985 0.000 1.000 0.000
#> GSM99481 1 0.0000 0.965 1.000 0.000 0.000
#> GSM99483 1 0.0000 0.965 1.000 0.000 0.000
#> GSM99485 2 0.0000 0.985 0.000 1.000 0.000
#> GSM99487 2 0.0000 0.985 0.000 1.000 0.000
#> GSM99489 2 0.0000 0.985 0.000 1.000 0.000
#> GSM99491 2 0.0000 0.985 0.000 1.000 0.000
#> GSM99493 1 0.0000 0.965 1.000 0.000 0.000
#> GSM99495 2 0.0000 0.985 0.000 1.000 0.000
#> GSM99525 1 0.0000 0.965 1.000 0.000 0.000
#> GSM99527 3 0.4725 0.853 0.088 0.060 0.852
#> GSM99529 2 0.0000 0.985 0.000 1.000 0.000
#> GSM99531 3 0.0237 0.988 0.004 0.000 0.996
#> GSM99533 3 0.1753 0.946 0.048 0.000 0.952
#> GSM99535 2 0.5016 0.671 0.240 0.760 0.000
#> GSM99537 1 0.0000 0.965 1.000 0.000 0.000
#> GSM99539 2 0.1860 0.939 0.000 0.948 0.052
#> GSM99541 1 0.0000 0.965 1.000 0.000 0.000
#> GSM99543 2 0.0000 0.985 0.000 1.000 0.000
#> GSM99545 2 0.2537 0.910 0.000 0.920 0.080
#> GSM99547 1 0.5461 0.705 0.768 0.016 0.216
#> GSM99549 2 0.0000 0.985 0.000 1.000 0.000
#> GSM99551 1 0.0000 0.965 1.000 0.000 0.000
#> GSM99553 3 0.0000 0.991 0.000 0.000 1.000
#> GSM99555 2 0.0000 0.985 0.000 1.000 0.000
#> GSM99557 2 0.0000 0.985 0.000 1.000 0.000
#> GSM99559 3 0.0892 0.973 0.000 0.020 0.980
#> GSM99561 2 0.0000 0.985 0.000 1.000 0.000
#> GSM99563 3 0.0000 0.991 0.000 0.000 1.000
#> GSM99565 2 0.0000 0.985 0.000 1.000 0.000
#> GSM99573 2 0.0000 0.985 0.000 1.000 0.000
#> GSM99577 1 0.0000 0.965 1.000 0.000 0.000
#> GSM99579 2 0.0000 0.985 0.000 1.000 0.000
#> GSM99581 3 0.0000 0.991 0.000 0.000 1.000
#> GSM99583 1 0.8130 0.229 0.528 0.400 0.072
#> GSM99585 2 0.0000 0.985 0.000 1.000 0.000
#> GSM99587 1 0.0000 0.965 1.000 0.000 0.000
#> GSM99589 2 0.0000 0.985 0.000 1.000 0.000
#> GSM99591 2 0.0000 0.985 0.000 1.000 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM99497 3 0.0000 0.94008 0.000 0.000 1.000 0.000
#> GSM99503 1 0.0000 0.96686 1.000 0.000 0.000 0.000
#> GSM99505 1 0.1452 0.94219 0.956 0.000 0.036 0.008
#> GSM99507 3 0.0000 0.94008 0.000 0.000 1.000 0.000
#> GSM99567 3 0.0000 0.94008 0.000 0.000 1.000 0.000
#> GSM99575 1 0.0000 0.96686 1.000 0.000 0.000 0.000
#> GSM99593 3 0.0188 0.93992 0.000 0.000 0.996 0.004
#> GSM99595 3 0.0000 0.94008 0.000 0.000 1.000 0.000
#> GSM99469 1 0.0817 0.96114 0.976 0.000 0.000 0.024
#> GSM99499 1 0.0000 0.96686 1.000 0.000 0.000 0.000
#> GSM99501 1 0.0592 0.96402 0.984 0.000 0.000 0.016
#> GSM99509 3 0.0000 0.94008 0.000 0.000 1.000 0.000
#> GSM99569 3 0.0921 0.93168 0.000 0.000 0.972 0.028
#> GSM99597 3 0.0707 0.93309 0.000 0.000 0.980 0.020
#> GSM99601 2 0.0707 0.86672 0.000 0.980 0.000 0.020
#> GSM99459 1 0.1940 0.92922 0.924 0.000 0.000 0.076
#> GSM99461 1 0.1867 0.93245 0.928 0.000 0.000 0.072
#> GSM99511 3 0.1867 0.88963 0.000 0.000 0.928 0.072
#> GSM99513 3 0.1022 0.92702 0.000 0.000 0.968 0.032
#> GSM99515 3 0.0000 0.94008 0.000 0.000 1.000 0.000
#> GSM99517 1 0.0000 0.96686 1.000 0.000 0.000 0.000
#> GSM99519 1 0.1637 0.94048 0.940 0.000 0.000 0.060
#> GSM99521 3 0.3024 0.77435 0.000 0.000 0.852 0.148
#> GSM99523 3 0.0707 0.93551 0.000 0.000 0.980 0.020
#> GSM99571 1 0.0000 0.96686 1.000 0.000 0.000 0.000
#> GSM99599 1 0.0000 0.96686 1.000 0.000 0.000 0.000
#> GSM99433 2 0.4406 0.61484 0.000 0.700 0.000 0.300
#> GSM99435 3 0.4998 -0.12752 0.000 0.000 0.512 0.488
#> GSM99437 2 0.1389 0.86166 0.000 0.952 0.000 0.048
#> GSM99439 2 0.1557 0.85805 0.000 0.944 0.000 0.056
#> GSM99441 1 0.0000 0.96686 1.000 0.000 0.000 0.000
#> GSM99443 2 0.0921 0.86372 0.000 0.972 0.000 0.028
#> GSM99445 2 0.0188 0.86529 0.000 0.996 0.000 0.004
#> GSM99447 2 0.2216 0.85578 0.000 0.908 0.000 0.092
#> GSM99449 3 0.0592 0.93621 0.000 0.000 0.984 0.016
#> GSM99451 4 0.4898 0.29924 0.000 0.000 0.416 0.584
#> GSM99453 1 0.0592 0.96513 0.984 0.000 0.000 0.016
#> GSM99455 1 0.0592 0.96513 0.984 0.000 0.000 0.016
#> GSM99457 1 0.0817 0.96350 0.976 0.000 0.000 0.024
#> GSM99463 2 0.1118 0.86302 0.000 0.964 0.000 0.036
#> GSM99465 4 0.5993 0.53607 0.248 0.004 0.076 0.672
#> GSM99467 2 0.3356 0.77991 0.000 0.824 0.000 0.176
#> GSM99471 1 0.0921 0.96228 0.972 0.000 0.000 0.028
#> GSM99473 1 0.0817 0.96172 0.976 0.000 0.000 0.024
#> GSM99475 4 0.4406 0.50145 0.000 0.000 0.300 0.700
#> GSM99477 2 0.7270 0.25112 0.000 0.504 0.164 0.332
#> GSM99479 2 0.3764 0.74680 0.000 0.784 0.000 0.216
#> GSM99481 1 0.0000 0.96686 1.000 0.000 0.000 0.000
#> GSM99483 1 0.0469 0.96578 0.988 0.000 0.000 0.012
#> GSM99485 2 0.2216 0.83404 0.000 0.908 0.000 0.092
#> GSM99487 2 0.1474 0.86094 0.000 0.948 0.000 0.052
#> GSM99489 2 0.0817 0.86515 0.000 0.976 0.000 0.024
#> GSM99491 2 0.0469 0.86534 0.000 0.988 0.000 0.012
#> GSM99493 1 0.0707 0.96439 0.980 0.000 0.000 0.020
#> GSM99495 2 0.1302 0.86124 0.000 0.956 0.000 0.044
#> GSM99525 1 0.0336 0.96628 0.992 0.000 0.000 0.008
#> GSM99527 4 0.3562 0.61884 0.020 0.032 0.072 0.876
#> GSM99529 2 0.4967 0.28929 0.000 0.548 0.000 0.452
#> GSM99531 4 0.5099 0.39083 0.008 0.000 0.380 0.612
#> GSM99533 4 0.5332 0.59461 0.080 0.000 0.184 0.736
#> GSM99535 2 0.4775 0.69016 0.140 0.784 0.000 0.076
#> GSM99537 1 0.0707 0.96436 0.980 0.000 0.000 0.020
#> GSM99539 4 0.5938 -0.03637 0.000 0.480 0.036 0.484
#> GSM99541 1 0.2921 0.86590 0.860 0.000 0.000 0.140
#> GSM99543 2 0.1557 0.86124 0.000 0.944 0.000 0.056
#> GSM99545 4 0.5597 -0.00508 0.000 0.464 0.020 0.516
#> GSM99547 4 0.5959 0.54738 0.220 0.028 0.048 0.704
#> GSM99549 2 0.1867 0.85175 0.000 0.928 0.000 0.072
#> GSM99551 1 0.3688 0.75797 0.792 0.000 0.000 0.208
#> GSM99553 3 0.0188 0.93916 0.000 0.000 0.996 0.004
#> GSM99555 2 0.1389 0.86630 0.000 0.952 0.000 0.048
#> GSM99557 2 0.0707 0.86537 0.000 0.980 0.000 0.020
#> GSM99559 3 0.1174 0.91789 0.000 0.012 0.968 0.020
#> GSM99561 2 0.2281 0.83893 0.000 0.904 0.000 0.096
#> GSM99563 3 0.0592 0.93674 0.000 0.000 0.984 0.016
#> GSM99565 2 0.1389 0.86267 0.000 0.952 0.000 0.048
#> GSM99573 2 0.1792 0.85358 0.000 0.932 0.000 0.068
#> GSM99577 1 0.1557 0.94603 0.944 0.000 0.000 0.056
#> GSM99579 2 0.1716 0.84735 0.000 0.936 0.000 0.064
#> GSM99581 3 0.0188 0.93991 0.000 0.000 0.996 0.004
#> GSM99583 2 0.9906 -0.22166 0.208 0.308 0.216 0.268
#> GSM99585 2 0.4277 0.66151 0.000 0.720 0.000 0.280
#> GSM99587 1 0.0707 0.96439 0.980 0.000 0.000 0.020
#> GSM99589 2 0.0592 0.86671 0.000 0.984 0.000 0.016
#> GSM99591 2 0.0188 0.86529 0.000 0.996 0.000 0.004
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM99497 3 0.0162 0.94365 0.000 0.000 0.996 0.000 0.004
#> GSM99503 1 0.1399 0.86346 0.952 0.000 0.000 0.020 0.028
#> GSM99505 1 0.3274 0.83096 0.868 0.000 0.060 0.024 0.048
#> GSM99507 3 0.0162 0.94365 0.000 0.000 0.996 0.000 0.004
#> GSM99567 3 0.0000 0.94362 0.000 0.000 1.000 0.000 0.000
#> GSM99575 1 0.1399 0.86334 0.952 0.000 0.000 0.020 0.028
#> GSM99593 3 0.0451 0.94475 0.000 0.000 0.988 0.008 0.004
#> GSM99595 3 0.0566 0.94510 0.000 0.000 0.984 0.012 0.004
#> GSM99469 1 0.2124 0.85640 0.916 0.000 0.000 0.028 0.056
#> GSM99499 1 0.1740 0.86761 0.932 0.000 0.000 0.012 0.056
#> GSM99501 1 0.2221 0.85448 0.912 0.000 0.000 0.036 0.052
#> GSM99509 3 0.0807 0.94461 0.000 0.000 0.976 0.012 0.012
#> GSM99569 3 0.1579 0.93765 0.000 0.000 0.944 0.032 0.024
#> GSM99597 3 0.2423 0.89039 0.000 0.000 0.896 0.080 0.024
#> GSM99601 2 0.2488 0.71742 0.000 0.872 0.000 0.004 0.124
#> GSM99459 1 0.4038 0.77941 0.792 0.000 0.000 0.128 0.080
#> GSM99461 1 0.4393 0.74619 0.756 0.000 0.000 0.168 0.076
#> GSM99511 3 0.2390 0.89859 0.000 0.000 0.896 0.084 0.020
#> GSM99513 3 0.1701 0.92950 0.000 0.000 0.936 0.048 0.016
#> GSM99515 3 0.0324 0.94415 0.000 0.000 0.992 0.004 0.004
#> GSM99517 1 0.1741 0.86485 0.936 0.000 0.000 0.024 0.040
#> GSM99519 1 0.3840 0.79488 0.808 0.000 0.000 0.116 0.076
#> GSM99521 3 0.2522 0.85519 0.000 0.000 0.880 0.108 0.012
#> GSM99523 3 0.1914 0.92242 0.004 0.000 0.932 0.032 0.032
#> GSM99571 1 0.2074 0.86500 0.920 0.000 0.000 0.036 0.044
#> GSM99599 1 0.0807 0.86952 0.976 0.000 0.000 0.012 0.012
#> GSM99433 2 0.6401 0.09804 0.000 0.532 0.004 0.196 0.268
#> GSM99435 4 0.5227 0.17231 0.000 0.000 0.448 0.508 0.044
#> GSM99437 2 0.4341 0.43388 0.000 0.628 0.000 0.008 0.364
#> GSM99439 2 0.0898 0.71276 0.000 0.972 0.000 0.008 0.020
#> GSM99441 1 0.0807 0.86983 0.976 0.000 0.000 0.012 0.012
#> GSM99443 2 0.3231 0.66743 0.000 0.800 0.000 0.004 0.196
#> GSM99445 2 0.2471 0.70647 0.000 0.864 0.000 0.000 0.136
#> GSM99447 2 0.4104 0.59886 0.000 0.748 0.000 0.032 0.220
#> GSM99449 3 0.1741 0.92638 0.000 0.000 0.936 0.024 0.040
#> GSM99451 4 0.4747 0.43969 0.000 0.000 0.332 0.636 0.032
#> GSM99453 1 0.3800 0.82893 0.812 0.000 0.000 0.080 0.108
#> GSM99455 1 0.3741 0.83136 0.816 0.000 0.000 0.076 0.108
#> GSM99457 1 0.3758 0.83358 0.816 0.000 0.000 0.088 0.096
#> GSM99463 2 0.0290 0.71699 0.000 0.992 0.000 0.000 0.008
#> GSM99465 4 0.6665 0.32755 0.264 0.000 0.020 0.536 0.180
#> GSM99467 5 0.4182 0.51959 0.000 0.352 0.000 0.004 0.644
#> GSM99471 1 0.4181 0.81782 0.788 0.004 0.000 0.076 0.132
#> GSM99473 1 0.2535 0.85621 0.892 0.000 0.000 0.032 0.076
#> GSM99475 4 0.3988 0.56728 0.000 0.008 0.192 0.776 0.024
#> GSM99477 5 0.5903 0.61243 0.000 0.208 0.068 0.060 0.664
#> GSM99479 5 0.4508 0.57160 0.000 0.332 0.000 0.020 0.648
#> GSM99481 1 0.0798 0.87076 0.976 0.000 0.000 0.016 0.008
#> GSM99483 1 0.3579 0.83518 0.828 0.000 0.000 0.072 0.100
#> GSM99485 2 0.4171 0.16334 0.000 0.604 0.000 0.000 0.396
#> GSM99487 2 0.4505 0.37612 0.000 0.604 0.000 0.012 0.384
#> GSM99489 2 0.0510 0.71851 0.000 0.984 0.000 0.000 0.016
#> GSM99491 2 0.3521 0.62846 0.000 0.764 0.000 0.004 0.232
#> GSM99493 1 0.3359 0.84264 0.844 0.000 0.000 0.072 0.084
#> GSM99495 2 0.0566 0.71479 0.000 0.984 0.000 0.004 0.012
#> GSM99525 1 0.2927 0.85365 0.868 0.000 0.000 0.040 0.092
#> GSM99527 4 0.3660 0.50161 0.016 0.016 0.020 0.844 0.104
#> GSM99529 5 0.6462 0.54378 0.004 0.260 0.008 0.172 0.556
#> GSM99531 4 0.5243 0.55801 0.036 0.004 0.212 0.708 0.040
#> GSM99533 4 0.3864 0.55062 0.040 0.004 0.076 0.840 0.040
#> GSM99535 2 0.6578 0.15912 0.116 0.596 0.000 0.056 0.232
#> GSM99537 1 0.1915 0.87090 0.928 0.000 0.000 0.040 0.032
#> GSM99539 4 0.6606 -0.04919 0.000 0.416 0.020 0.440 0.124
#> GSM99541 1 0.4367 0.75793 0.748 0.000 0.000 0.192 0.060
#> GSM99543 2 0.2732 0.65126 0.008 0.884 0.000 0.020 0.088
#> GSM99545 4 0.5951 -0.00489 0.000 0.456 0.012 0.460 0.072
#> GSM99547 4 0.7782 0.28803 0.112 0.072 0.036 0.508 0.272
#> GSM99549 2 0.1364 0.70316 0.000 0.952 0.000 0.012 0.036
#> GSM99551 1 0.6338 0.56663 0.584 0.016 0.000 0.228 0.172
#> GSM99553 3 0.1628 0.92177 0.000 0.000 0.936 0.008 0.056
#> GSM99555 2 0.3421 0.67509 0.000 0.788 0.000 0.008 0.204
#> GSM99557 2 0.1410 0.72428 0.000 0.940 0.000 0.000 0.060
#> GSM99559 3 0.2783 0.83584 0.000 0.012 0.868 0.004 0.116
#> GSM99561 2 0.3239 0.67338 0.000 0.852 0.000 0.068 0.080
#> GSM99563 3 0.1300 0.93963 0.000 0.000 0.956 0.028 0.016
#> GSM99565 2 0.4232 0.52435 0.000 0.676 0.000 0.012 0.312
#> GSM99573 2 0.1386 0.70810 0.000 0.952 0.000 0.016 0.032
#> GSM99577 1 0.4751 0.78047 0.732 0.000 0.000 0.152 0.116
#> GSM99579 2 0.3895 0.46573 0.000 0.680 0.000 0.000 0.320
#> GSM99581 3 0.0807 0.94500 0.000 0.000 0.976 0.012 0.012
#> GSM99583 5 0.7294 0.42376 0.100 0.104 0.084 0.084 0.628
#> GSM99585 5 0.6527 0.28895 0.000 0.376 0.000 0.196 0.428
#> GSM99587 1 0.3644 0.83229 0.824 0.000 0.000 0.080 0.096
#> GSM99589 2 0.2612 0.71218 0.000 0.868 0.000 0.008 0.124
#> GSM99591 2 0.2806 0.69749 0.000 0.844 0.000 0.004 0.152
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM99497 3 0.0976 0.8720 0.000 0.000 0.968 0.008 0.016 0.008
#> GSM99503 1 0.0717 0.7266 0.976 0.000 0.000 0.000 0.008 0.016
#> GSM99505 1 0.3281 0.6732 0.848 0.000 0.048 0.004 0.020 0.080
#> GSM99507 3 0.0976 0.8726 0.000 0.000 0.968 0.008 0.016 0.008
#> GSM99567 3 0.0748 0.8734 0.000 0.000 0.976 0.004 0.004 0.016
#> GSM99575 1 0.0935 0.7272 0.964 0.000 0.000 0.000 0.004 0.032
#> GSM99593 3 0.1838 0.8701 0.000 0.000 0.928 0.040 0.012 0.020
#> GSM99595 3 0.0767 0.8741 0.000 0.000 0.976 0.008 0.004 0.012
#> GSM99469 1 0.1951 0.7117 0.916 0.000 0.000 0.004 0.020 0.060
#> GSM99499 1 0.2597 0.7180 0.880 0.000 0.008 0.004 0.020 0.088
#> GSM99501 1 0.1785 0.7142 0.928 0.000 0.000 0.008 0.016 0.048
#> GSM99509 3 0.1426 0.8724 0.000 0.000 0.948 0.028 0.008 0.016
#> GSM99569 3 0.3798 0.8359 0.008 0.000 0.824 0.052 0.048 0.068
#> GSM99597 3 0.3819 0.7702 0.000 0.000 0.788 0.152 0.028 0.032
#> GSM99601 2 0.3411 0.6031 0.000 0.756 0.000 0.004 0.232 0.008
#> GSM99459 1 0.4062 0.5461 0.764 0.000 0.000 0.064 0.012 0.160
#> GSM99461 1 0.4572 0.4676 0.700 0.000 0.000 0.080 0.008 0.212
#> GSM99511 3 0.4691 0.7205 0.000 0.000 0.728 0.144 0.028 0.100
#> GSM99513 3 0.3246 0.8374 0.000 0.000 0.844 0.072 0.016 0.068
#> GSM99515 3 0.0964 0.8742 0.000 0.000 0.968 0.004 0.012 0.016
#> GSM99517 1 0.0547 0.7317 0.980 0.000 0.000 0.000 0.000 0.020
#> GSM99519 1 0.3943 0.5672 0.776 0.000 0.000 0.052 0.016 0.156
#> GSM99521 3 0.4268 0.7196 0.000 0.000 0.748 0.180 0.032 0.040
#> GSM99523 3 0.3983 0.8292 0.036 0.000 0.820 0.036 0.040 0.068
#> GSM99571 1 0.2219 0.7235 0.864 0.000 0.000 0.000 0.000 0.136
#> GSM99599 1 0.0937 0.7368 0.960 0.000 0.000 0.000 0.000 0.040
#> GSM99433 2 0.6713 0.1334 0.000 0.460 0.000 0.152 0.312 0.076
#> GSM99435 4 0.6154 0.2506 0.000 0.000 0.380 0.464 0.040 0.116
#> GSM99437 2 0.4644 0.2886 0.000 0.512 0.000 0.012 0.456 0.020
#> GSM99439 2 0.0806 0.6254 0.000 0.972 0.000 0.000 0.020 0.008
#> GSM99441 1 0.1082 0.7382 0.956 0.000 0.000 0.000 0.004 0.040
#> GSM99443 2 0.4489 0.5050 0.000 0.632 0.000 0.008 0.328 0.032
#> GSM99445 2 0.3697 0.5825 0.000 0.732 0.000 0.004 0.248 0.016
#> GSM99447 2 0.4980 0.4419 0.000 0.616 0.000 0.036 0.316 0.032
#> GSM99449 3 0.3294 0.8265 0.000 0.000 0.848 0.040 0.064 0.048
#> GSM99451 4 0.4609 0.4849 0.000 0.000 0.244 0.684 0.012 0.060
#> GSM99453 1 0.3738 0.6183 0.680 0.000 0.000 0.004 0.004 0.312
#> GSM99455 1 0.3840 0.6333 0.696 0.000 0.000 0.008 0.008 0.288
#> GSM99457 1 0.3887 0.5655 0.632 0.000 0.000 0.008 0.000 0.360
#> GSM99463 2 0.1036 0.6359 0.000 0.964 0.000 0.004 0.024 0.008
#> GSM99465 6 0.7523 0.1273 0.264 0.000 0.008 0.312 0.100 0.316
#> GSM99467 5 0.3692 0.5019 0.000 0.184 0.000 0.012 0.776 0.028
#> GSM99471 1 0.5363 0.4367 0.572 0.000 0.000 0.040 0.048 0.340
#> GSM99473 1 0.3043 0.6697 0.832 0.000 0.000 0.008 0.020 0.140
#> GSM99475 4 0.3359 0.5149 0.000 0.000 0.136 0.820 0.024 0.020
#> GSM99477 5 0.5077 0.5399 0.000 0.108 0.044 0.036 0.740 0.072
#> GSM99479 5 0.4070 0.5311 0.000 0.168 0.000 0.020 0.764 0.048
#> GSM99481 1 0.1610 0.7378 0.916 0.000 0.000 0.000 0.000 0.084
#> GSM99483 1 0.3650 0.6399 0.708 0.000 0.000 0.000 0.012 0.280
#> GSM99485 2 0.4886 0.0731 0.000 0.480 0.000 0.004 0.468 0.048
#> GSM99487 5 0.4926 -0.3196 0.000 0.464 0.000 0.016 0.488 0.032
#> GSM99489 2 0.1594 0.6344 0.000 0.932 0.000 0.000 0.052 0.016
#> GSM99491 2 0.4165 0.5190 0.000 0.664 0.000 0.004 0.308 0.024
#> GSM99493 1 0.3464 0.6156 0.688 0.000 0.000 0.000 0.000 0.312
#> GSM99495 2 0.0458 0.6263 0.000 0.984 0.000 0.000 0.000 0.016
#> GSM99525 1 0.3136 0.6969 0.796 0.000 0.000 0.000 0.016 0.188
#> GSM99527 4 0.5001 0.2486 0.008 0.000 0.016 0.676 0.072 0.228
#> GSM99529 5 0.6974 0.2689 0.008 0.120 0.008 0.240 0.520 0.104
#> GSM99531 4 0.5956 0.3778 0.016 0.004 0.116 0.632 0.036 0.196
#> GSM99533 4 0.3308 0.4144 0.012 0.000 0.028 0.844 0.016 0.100
#> GSM99535 2 0.7224 0.1458 0.076 0.488 0.000 0.028 0.196 0.212
#> GSM99537 1 0.3037 0.7157 0.820 0.000 0.000 0.016 0.004 0.160
#> GSM99539 4 0.7422 -0.0838 0.000 0.348 0.032 0.376 0.180 0.064
#> GSM99541 1 0.5667 0.3684 0.592 0.000 0.000 0.196 0.016 0.196
#> GSM99543 2 0.3444 0.5551 0.000 0.836 0.000 0.032 0.056 0.076
#> GSM99545 2 0.6165 -0.0529 0.000 0.440 0.008 0.420 0.100 0.032
#> GSM99547 6 0.7789 -0.0991 0.072 0.032 0.032 0.332 0.120 0.412
#> GSM99549 2 0.1642 0.6125 0.000 0.936 0.000 0.004 0.032 0.028
#> GSM99551 6 0.6555 -0.1910 0.376 0.036 0.000 0.116 0.020 0.452
#> GSM99553 3 0.2752 0.8439 0.000 0.000 0.880 0.024 0.052 0.044
#> GSM99555 2 0.4638 0.4881 0.000 0.632 0.000 0.016 0.320 0.032
#> GSM99557 2 0.2400 0.6329 0.000 0.872 0.000 0.004 0.116 0.008
#> GSM99559 3 0.4320 0.6954 0.000 0.012 0.752 0.020 0.180 0.036
#> GSM99561 2 0.3640 0.5953 0.000 0.816 0.000 0.056 0.104 0.024
#> GSM99563 3 0.3216 0.8465 0.000 0.000 0.848 0.060 0.020 0.072
#> GSM99565 2 0.4759 0.3267 0.000 0.540 0.000 0.016 0.420 0.024
#> GSM99573 2 0.2285 0.6077 0.000 0.900 0.000 0.008 0.064 0.028
#> GSM99577 1 0.5898 0.2670 0.472 0.000 0.000 0.104 0.028 0.396
#> GSM99579 2 0.4723 0.3231 0.000 0.548 0.000 0.004 0.408 0.040
#> GSM99581 3 0.2084 0.8736 0.000 0.000 0.916 0.044 0.024 0.016
#> GSM99583 5 0.7913 0.2477 0.100 0.048 0.096 0.080 0.532 0.144
#> GSM99585 5 0.6940 0.3003 0.000 0.248 0.000 0.120 0.476 0.156
#> GSM99587 1 0.3789 0.5899 0.660 0.000 0.000 0.008 0.000 0.332
#> GSM99589 2 0.4172 0.5726 0.000 0.720 0.000 0.004 0.224 0.052
#> GSM99591 2 0.3648 0.5895 0.000 0.740 0.000 0.004 0.240 0.016
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
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 disease.state(p) cell.type(p) k
#> SD:skmeans 69 2.56e-03 0.008903 2
#> SD:skmeans 84 8.79e-05 0.002744 3
#> SD:skmeans 77 6.68e-06 0.000871 4
#> SD:skmeans 71 1.49e-04 0.019314 5
#> SD:skmeans 59 1.31e-03 0.089662 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 21512 rows and 85 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.555 0.827 0.907 0.4507 0.561 0.561
#> 3 3 0.973 0.937 0.970 0.4887 0.738 0.545
#> 4 4 0.895 0.846 0.939 0.1252 0.860 0.606
#> 5 5 0.805 0.689 0.839 0.0460 0.944 0.780
#> 6 6 0.851 0.755 0.878 0.0365 0.920 0.656
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
#> GSM99497 2 0.8955 0.6987 0.312 0.688
#> GSM99503 1 0.0000 0.9514 1.000 0.000
#> GSM99505 1 0.0000 0.9514 1.000 0.000
#> GSM99507 2 0.8955 0.6987 0.312 0.688
#> GSM99567 2 0.8955 0.6987 0.312 0.688
#> GSM99575 1 0.0000 0.9514 1.000 0.000
#> GSM99593 2 0.8955 0.6987 0.312 0.688
#> GSM99595 2 0.8955 0.6987 0.312 0.688
#> GSM99469 1 0.0000 0.9514 1.000 0.000
#> GSM99499 1 0.0000 0.9514 1.000 0.000
#> GSM99501 1 0.0000 0.9514 1.000 0.000
#> GSM99509 2 0.9000 0.6929 0.316 0.684
#> GSM99569 2 0.8955 0.6987 0.312 0.688
#> GSM99597 2 0.8955 0.6987 0.312 0.688
#> GSM99601 2 0.0000 0.8632 0.000 1.000
#> GSM99459 1 0.0000 0.9514 1.000 0.000
#> GSM99461 1 0.0000 0.9514 1.000 0.000
#> GSM99511 2 0.8955 0.6987 0.312 0.688
#> GSM99513 2 0.8955 0.6987 0.312 0.688
#> GSM99515 2 0.8955 0.6987 0.312 0.688
#> GSM99517 1 0.0000 0.9514 1.000 0.000
#> GSM99519 1 0.0000 0.9514 1.000 0.000
#> GSM99521 2 0.8861 0.7072 0.304 0.696
#> GSM99523 1 0.9000 0.3944 0.684 0.316
#> GSM99571 1 0.0000 0.9514 1.000 0.000
#> GSM99599 1 0.0000 0.9514 1.000 0.000
#> GSM99433 2 0.0000 0.8632 0.000 1.000
#> GSM99435 2 0.7674 0.7748 0.224 0.776
#> GSM99437 2 0.0000 0.8632 0.000 1.000
#> GSM99439 2 0.0000 0.8632 0.000 1.000
#> GSM99441 1 0.0000 0.9514 1.000 0.000
#> GSM99443 2 0.0000 0.8632 0.000 1.000
#> GSM99445 2 0.0000 0.8632 0.000 1.000
#> GSM99447 2 0.0000 0.8632 0.000 1.000
#> GSM99449 2 0.0000 0.8632 0.000 1.000
#> GSM99451 2 0.8608 0.7269 0.284 0.716
#> GSM99453 1 0.0000 0.9514 1.000 0.000
#> GSM99455 1 0.0000 0.9514 1.000 0.000
#> GSM99457 1 0.0000 0.9514 1.000 0.000
#> GSM99463 2 0.0000 0.8632 0.000 1.000
#> GSM99465 2 0.7745 0.7729 0.228 0.772
#> GSM99467 2 0.0000 0.8632 0.000 1.000
#> GSM99471 1 0.9963 -0.0743 0.536 0.464
#> GSM99473 1 0.7219 0.7111 0.800 0.200
#> GSM99475 2 0.8081 0.7580 0.248 0.752
#> GSM99477 2 0.0000 0.8632 0.000 1.000
#> GSM99479 2 0.0000 0.8632 0.000 1.000
#> GSM99481 1 0.0000 0.9514 1.000 0.000
#> GSM99483 1 0.0000 0.9514 1.000 0.000
#> GSM99485 2 0.0000 0.8632 0.000 1.000
#> GSM99487 2 0.0000 0.8632 0.000 1.000
#> GSM99489 2 0.0000 0.8632 0.000 1.000
#> GSM99491 2 0.0000 0.8632 0.000 1.000
#> GSM99493 1 0.0000 0.9514 1.000 0.000
#> GSM99495 2 0.0000 0.8632 0.000 1.000
#> GSM99525 1 0.0000 0.9514 1.000 0.000
#> GSM99527 2 0.2423 0.8533 0.040 0.960
#> GSM99529 2 0.0000 0.8632 0.000 1.000
#> GSM99531 2 0.8016 0.7611 0.244 0.756
#> GSM99533 2 0.8443 0.7328 0.272 0.728
#> GSM99535 2 0.2948 0.8326 0.052 0.948
#> GSM99537 1 0.0000 0.9514 1.000 0.000
#> GSM99539 2 0.0000 0.8632 0.000 1.000
#> GSM99541 1 0.0000 0.9514 1.000 0.000
#> GSM99543 2 0.0672 0.8594 0.008 0.992
#> GSM99545 2 0.0000 0.8632 0.000 1.000
#> GSM99547 2 0.4431 0.8163 0.092 0.908
#> GSM99549 2 0.0000 0.8632 0.000 1.000
#> GSM99551 2 0.7602 0.7774 0.220 0.780
#> GSM99553 2 0.7453 0.7812 0.212 0.788
#> GSM99555 2 0.0000 0.8632 0.000 1.000
#> GSM99557 2 0.0000 0.8632 0.000 1.000
#> GSM99559 2 0.5294 0.8249 0.120 0.880
#> GSM99561 2 0.0000 0.8632 0.000 1.000
#> GSM99563 2 0.9909 0.4312 0.444 0.556
#> GSM99565 2 0.0000 0.8632 0.000 1.000
#> GSM99573 2 0.0000 0.8632 0.000 1.000
#> GSM99577 1 0.3879 0.8686 0.924 0.076
#> GSM99579 2 0.0000 0.8632 0.000 1.000
#> GSM99581 2 0.7453 0.7812 0.212 0.788
#> GSM99583 2 0.7453 0.7812 0.212 0.788
#> GSM99585 2 0.0000 0.8632 0.000 1.000
#> GSM99587 1 0.0000 0.9514 1.000 0.000
#> GSM99589 2 0.0000 0.8632 0.000 1.000
#> GSM99591 2 0.0000 0.8632 0.000 1.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM99497 3 0.0592 0.964 0.012 0.000 0.988
#> GSM99503 1 0.0000 0.976 1.000 0.000 0.000
#> GSM99505 1 0.6045 0.362 0.620 0.000 0.380
#> GSM99507 3 0.0592 0.964 0.012 0.000 0.988
#> GSM99567 3 0.0592 0.964 0.012 0.000 0.988
#> GSM99575 1 0.0000 0.976 1.000 0.000 0.000
#> GSM99593 3 0.0592 0.964 0.012 0.000 0.988
#> GSM99595 3 0.0592 0.964 0.012 0.000 0.988
#> GSM99469 1 0.0000 0.976 1.000 0.000 0.000
#> GSM99499 1 0.3619 0.829 0.864 0.000 0.136
#> GSM99501 1 0.0000 0.976 1.000 0.000 0.000
#> GSM99509 3 0.0592 0.964 0.012 0.000 0.988
#> GSM99569 3 0.0592 0.964 0.012 0.000 0.988
#> GSM99597 3 0.0592 0.964 0.012 0.000 0.988
#> GSM99601 2 0.0000 0.970 0.000 1.000 0.000
#> GSM99459 1 0.0000 0.976 1.000 0.000 0.000
#> GSM99461 1 0.0000 0.976 1.000 0.000 0.000
#> GSM99511 3 0.0592 0.964 0.012 0.000 0.988
#> GSM99513 3 0.0592 0.964 0.012 0.000 0.988
#> GSM99515 3 0.0592 0.964 0.012 0.000 0.988
#> GSM99517 1 0.0000 0.976 1.000 0.000 0.000
#> GSM99519 1 0.0000 0.976 1.000 0.000 0.000
#> GSM99521 3 0.0424 0.963 0.008 0.000 0.992
#> GSM99523 3 0.0592 0.964 0.012 0.000 0.988
#> GSM99571 1 0.0000 0.976 1.000 0.000 0.000
#> GSM99599 1 0.0000 0.976 1.000 0.000 0.000
#> GSM99433 2 0.0000 0.970 0.000 1.000 0.000
#> GSM99435 3 0.0000 0.960 0.000 0.000 1.000
#> GSM99437 2 0.0000 0.970 0.000 1.000 0.000
#> GSM99439 2 0.0000 0.970 0.000 1.000 0.000
#> GSM99441 1 0.0000 0.976 1.000 0.000 0.000
#> GSM99443 2 0.0000 0.970 0.000 1.000 0.000
#> GSM99445 2 0.0000 0.970 0.000 1.000 0.000
#> GSM99447 2 0.0000 0.970 0.000 1.000 0.000
#> GSM99449 3 0.0592 0.958 0.000 0.012 0.988
#> GSM99451 3 0.1015 0.961 0.012 0.008 0.980
#> GSM99453 1 0.0000 0.976 1.000 0.000 0.000
#> GSM99455 1 0.0000 0.976 1.000 0.000 0.000
#> GSM99457 1 0.0000 0.976 1.000 0.000 0.000
#> GSM99463 2 0.0000 0.970 0.000 1.000 0.000
#> GSM99465 3 0.6935 0.368 0.372 0.024 0.604
#> GSM99467 2 0.0592 0.967 0.000 0.988 0.012
#> GSM99471 1 0.1182 0.958 0.976 0.012 0.012
#> GSM99473 1 0.1182 0.958 0.976 0.012 0.012
#> GSM99475 3 0.0983 0.953 0.004 0.016 0.980
#> GSM99477 2 0.0592 0.967 0.000 0.988 0.012
#> GSM99479 2 0.2448 0.916 0.000 0.924 0.076
#> GSM99481 1 0.0000 0.976 1.000 0.000 0.000
#> GSM99483 1 0.0000 0.976 1.000 0.000 0.000
#> GSM99485 2 0.0592 0.967 0.000 0.988 0.012
#> GSM99487 2 0.0000 0.970 0.000 1.000 0.000
#> GSM99489 2 0.0000 0.970 0.000 1.000 0.000
#> GSM99491 2 0.0000 0.970 0.000 1.000 0.000
#> GSM99493 1 0.0000 0.976 1.000 0.000 0.000
#> GSM99495 2 0.0000 0.970 0.000 1.000 0.000
#> GSM99525 1 0.0000 0.976 1.000 0.000 0.000
#> GSM99527 2 0.2280 0.931 0.052 0.940 0.008
#> GSM99529 3 0.2878 0.875 0.000 0.096 0.904
#> GSM99531 3 0.1337 0.956 0.012 0.016 0.972
#> GSM99533 3 0.5461 0.703 0.216 0.016 0.768
#> GSM99535 2 0.4749 0.791 0.172 0.816 0.012
#> GSM99537 1 0.0000 0.976 1.000 0.000 0.000
#> GSM99539 2 0.1529 0.946 0.000 0.960 0.040
#> GSM99541 1 0.0000 0.976 1.000 0.000 0.000
#> GSM99543 2 0.3207 0.898 0.084 0.904 0.012
#> GSM99545 2 0.0592 0.964 0.000 0.988 0.012
#> GSM99547 2 0.6796 0.412 0.368 0.612 0.020
#> GSM99549 2 0.0237 0.969 0.000 0.996 0.004
#> GSM99551 1 0.1337 0.954 0.972 0.016 0.012
#> GSM99553 3 0.0000 0.960 0.000 0.000 1.000
#> GSM99555 2 0.0000 0.970 0.000 1.000 0.000
#> GSM99557 2 0.0000 0.970 0.000 1.000 0.000
#> GSM99559 3 0.0000 0.960 0.000 0.000 1.000
#> GSM99561 2 0.0000 0.970 0.000 1.000 0.000
#> GSM99563 3 0.0592 0.964 0.012 0.000 0.988
#> GSM99565 2 0.0000 0.970 0.000 1.000 0.000
#> GSM99573 2 0.0424 0.968 0.000 0.992 0.008
#> GSM99577 1 0.0000 0.976 1.000 0.000 0.000
#> GSM99579 2 0.0592 0.967 0.000 0.988 0.012
#> GSM99581 3 0.0000 0.960 0.000 0.000 1.000
#> GSM99583 3 0.0983 0.950 0.004 0.016 0.980
#> GSM99585 2 0.0592 0.967 0.000 0.988 0.012
#> GSM99587 1 0.0000 0.976 1.000 0.000 0.000
#> GSM99589 2 0.1163 0.958 0.000 0.972 0.028
#> GSM99591 2 0.0000 0.970 0.000 1.000 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM99497 3 0.0000 0.9582 0.000 0.000 1.000 0.000
#> GSM99503 1 0.0000 0.9640 1.000 0.000 0.000 0.000
#> GSM99505 1 0.4790 0.4069 0.620 0.000 0.380 0.000
#> GSM99507 3 0.0000 0.9582 0.000 0.000 1.000 0.000
#> GSM99567 3 0.0000 0.9582 0.000 0.000 1.000 0.000
#> GSM99575 1 0.0000 0.9640 1.000 0.000 0.000 0.000
#> GSM99593 3 0.0000 0.9582 0.000 0.000 1.000 0.000
#> GSM99595 3 0.0000 0.9582 0.000 0.000 1.000 0.000
#> GSM99469 1 0.0000 0.9640 1.000 0.000 0.000 0.000
#> GSM99499 1 0.2868 0.8306 0.864 0.000 0.136 0.000
#> GSM99501 1 0.0000 0.9640 1.000 0.000 0.000 0.000
#> GSM99509 3 0.0000 0.9582 0.000 0.000 1.000 0.000
#> GSM99569 3 0.0000 0.9582 0.000 0.000 1.000 0.000
#> GSM99597 3 0.0000 0.9582 0.000 0.000 1.000 0.000
#> GSM99601 2 0.0000 0.9122 0.000 1.000 0.000 0.000
#> GSM99459 1 0.0000 0.9640 1.000 0.000 0.000 0.000
#> GSM99461 1 0.0000 0.9640 1.000 0.000 0.000 0.000
#> GSM99511 3 0.0000 0.9582 0.000 0.000 1.000 0.000
#> GSM99513 3 0.0000 0.9582 0.000 0.000 1.000 0.000
#> GSM99515 3 0.0000 0.9582 0.000 0.000 1.000 0.000
#> GSM99517 1 0.0000 0.9640 1.000 0.000 0.000 0.000
#> GSM99519 1 0.0000 0.9640 1.000 0.000 0.000 0.000
#> GSM99521 3 0.0000 0.9582 0.000 0.000 1.000 0.000
#> GSM99523 3 0.0000 0.9582 0.000 0.000 1.000 0.000
#> GSM99571 1 0.0000 0.9640 1.000 0.000 0.000 0.000
#> GSM99599 1 0.0000 0.9640 1.000 0.000 0.000 0.000
#> GSM99433 2 0.0817 0.9018 0.000 0.976 0.000 0.024
#> GSM99435 3 0.4500 0.5288 0.000 0.000 0.684 0.316
#> GSM99437 2 0.0000 0.9122 0.000 1.000 0.000 0.000
#> GSM99439 2 0.0000 0.9122 0.000 1.000 0.000 0.000
#> GSM99441 1 0.0000 0.9640 1.000 0.000 0.000 0.000
#> GSM99443 2 0.0000 0.9122 0.000 1.000 0.000 0.000
#> GSM99445 2 0.0000 0.9122 0.000 1.000 0.000 0.000
#> GSM99447 2 0.3400 0.7693 0.000 0.820 0.000 0.180
#> GSM99449 3 0.0000 0.9582 0.000 0.000 1.000 0.000
#> GSM99451 3 0.4877 0.2967 0.000 0.000 0.592 0.408
#> GSM99453 1 0.0000 0.9640 1.000 0.000 0.000 0.000
#> GSM99455 1 0.0000 0.9640 1.000 0.000 0.000 0.000
#> GSM99457 1 0.0000 0.9640 1.000 0.000 0.000 0.000
#> GSM99463 2 0.0188 0.9109 0.000 0.996 0.000 0.004
#> GSM99465 4 0.0188 0.8717 0.004 0.000 0.000 0.996
#> GSM99467 4 0.0000 0.8728 0.000 0.000 0.000 1.000
#> GSM99471 4 0.5000 -0.0123 0.500 0.000 0.000 0.500
#> GSM99473 1 0.3726 0.7065 0.788 0.000 0.000 0.212
#> GSM99475 4 0.4948 0.2049 0.000 0.000 0.440 0.560
#> GSM99477 4 0.0000 0.8728 0.000 0.000 0.000 1.000
#> GSM99479 4 0.0000 0.8728 0.000 0.000 0.000 1.000
#> GSM99481 1 0.0000 0.9640 1.000 0.000 0.000 0.000
#> GSM99483 1 0.0000 0.9640 1.000 0.000 0.000 0.000
#> GSM99485 4 0.0000 0.8728 0.000 0.000 0.000 1.000
#> GSM99487 2 0.0000 0.9122 0.000 1.000 0.000 0.000
#> GSM99489 2 0.0000 0.9122 0.000 1.000 0.000 0.000
#> GSM99491 2 0.3764 0.7244 0.000 0.784 0.000 0.216
#> GSM99493 1 0.0000 0.9640 1.000 0.000 0.000 0.000
#> GSM99495 2 0.0000 0.9122 0.000 1.000 0.000 0.000
#> GSM99525 1 0.0000 0.9640 1.000 0.000 0.000 0.000
#> GSM99527 4 0.1792 0.8225 0.000 0.068 0.000 0.932
#> GSM99529 4 0.0000 0.8728 0.000 0.000 0.000 1.000
#> GSM99531 4 0.4585 0.4814 0.000 0.000 0.332 0.668
#> GSM99533 4 0.1452 0.8531 0.036 0.000 0.008 0.956
#> GSM99535 4 0.1302 0.8495 0.044 0.000 0.000 0.956
#> GSM99537 1 0.0000 0.9640 1.000 0.000 0.000 0.000
#> GSM99539 4 0.4996 -0.0979 0.000 0.484 0.000 0.516
#> GSM99541 1 0.0000 0.9640 1.000 0.000 0.000 0.000
#> GSM99543 4 0.0000 0.8728 0.000 0.000 0.000 1.000
#> GSM99545 2 0.0188 0.9104 0.000 0.996 0.004 0.000
#> GSM99547 4 0.1867 0.8272 0.072 0.000 0.000 0.928
#> GSM99549 2 0.4661 0.4959 0.000 0.652 0.000 0.348
#> GSM99551 4 0.0000 0.8728 0.000 0.000 0.000 1.000
#> GSM99553 3 0.0000 0.9582 0.000 0.000 1.000 0.000
#> GSM99555 2 0.0000 0.9122 0.000 1.000 0.000 0.000
#> GSM99557 2 0.1716 0.8768 0.000 0.936 0.000 0.064
#> GSM99559 3 0.0707 0.9401 0.000 0.000 0.980 0.020
#> GSM99561 2 0.0707 0.9036 0.000 0.980 0.000 0.020
#> GSM99563 3 0.0000 0.9582 0.000 0.000 1.000 0.000
#> GSM99565 2 0.0000 0.9122 0.000 1.000 0.000 0.000
#> GSM99573 2 0.4382 0.6073 0.000 0.704 0.000 0.296
#> GSM99577 1 0.1716 0.9044 0.936 0.000 0.000 0.064
#> GSM99579 4 0.0000 0.8728 0.000 0.000 0.000 1.000
#> GSM99581 3 0.0000 0.9582 0.000 0.000 1.000 0.000
#> GSM99583 4 0.0000 0.8728 0.000 0.000 0.000 1.000
#> GSM99585 2 0.4994 0.1358 0.000 0.520 0.000 0.480
#> GSM99587 1 0.0000 0.9640 1.000 0.000 0.000 0.000
#> GSM99589 4 0.0469 0.8670 0.000 0.012 0.000 0.988
#> GSM99591 2 0.0000 0.9122 0.000 1.000 0.000 0.000
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM99497 3 0.0000 0.91720 0.000 0.000 1.000 0.000 0.000
#> GSM99503 1 0.4074 0.81092 0.636 0.000 0.000 0.000 0.364
#> GSM99505 3 0.6783 -0.35625 0.296 0.000 0.388 0.000 0.316
#> GSM99507 3 0.0000 0.91720 0.000 0.000 1.000 0.000 0.000
#> GSM99567 3 0.0000 0.91720 0.000 0.000 1.000 0.000 0.000
#> GSM99575 1 0.4074 0.81092 0.636 0.000 0.000 0.000 0.364
#> GSM99593 3 0.0000 0.91720 0.000 0.000 1.000 0.000 0.000
#> GSM99595 3 0.0000 0.91720 0.000 0.000 1.000 0.000 0.000
#> GSM99469 1 0.4114 0.79330 0.624 0.000 0.000 0.000 0.376
#> GSM99499 1 0.6153 0.44032 0.484 0.000 0.136 0.000 0.380
#> GSM99501 1 0.4101 0.79886 0.628 0.000 0.000 0.000 0.372
#> GSM99509 3 0.0000 0.91720 0.000 0.000 1.000 0.000 0.000
#> GSM99569 3 0.0000 0.91720 0.000 0.000 1.000 0.000 0.000
#> GSM99597 3 0.0000 0.91720 0.000 0.000 1.000 0.000 0.000
#> GSM99601 2 0.0000 0.84053 0.000 1.000 0.000 0.000 0.000
#> GSM99459 5 0.2966 0.72729 0.184 0.000 0.000 0.000 0.816
#> GSM99461 5 0.2966 0.72729 0.184 0.000 0.000 0.000 0.816
#> GSM99511 3 0.0000 0.91720 0.000 0.000 1.000 0.000 0.000
#> GSM99513 3 0.0000 0.91720 0.000 0.000 1.000 0.000 0.000
#> GSM99515 3 0.0000 0.91720 0.000 0.000 1.000 0.000 0.000
#> GSM99517 1 0.4074 0.81092 0.636 0.000 0.000 0.000 0.364
#> GSM99519 5 0.3143 0.69887 0.204 0.000 0.000 0.000 0.796
#> GSM99521 3 0.0000 0.91720 0.000 0.000 1.000 0.000 0.000
#> GSM99523 3 0.0162 0.91441 0.000 0.000 0.996 0.000 0.004
#> GSM99571 1 0.4074 0.81092 0.636 0.000 0.000 0.000 0.364
#> GSM99599 1 0.4074 0.81092 0.636 0.000 0.000 0.000 0.364
#> GSM99433 2 0.0703 0.83441 0.000 0.976 0.000 0.024 0.000
#> GSM99435 3 0.3876 0.48523 0.000 0.000 0.684 0.316 0.000
#> GSM99437 2 0.0000 0.84053 0.000 1.000 0.000 0.000 0.000
#> GSM99439 2 0.4074 0.71187 0.364 0.636 0.000 0.000 0.000
#> GSM99441 1 0.4074 0.81092 0.636 0.000 0.000 0.000 0.364
#> GSM99443 2 0.0000 0.84053 0.000 1.000 0.000 0.000 0.000
#> GSM99445 2 0.0000 0.84053 0.000 1.000 0.000 0.000 0.000
#> GSM99447 2 0.2929 0.71294 0.000 0.820 0.000 0.180 0.000
#> GSM99449 3 0.0000 0.91720 0.000 0.000 1.000 0.000 0.000
#> GSM99451 3 0.6733 -0.00801 0.000 0.000 0.416 0.296 0.288
#> GSM99453 1 0.4074 0.81092 0.636 0.000 0.000 0.000 0.364
#> GSM99455 1 0.4074 0.81092 0.636 0.000 0.000 0.000 0.364
#> GSM99457 5 0.2966 0.72395 0.184 0.000 0.000 0.000 0.816
#> GSM99463 2 0.4074 0.71187 0.364 0.636 0.000 0.000 0.000
#> GSM99465 4 0.4300 0.36821 0.000 0.000 0.000 0.524 0.476
#> GSM99467 4 0.0000 0.78636 0.000 0.000 0.000 1.000 0.000
#> GSM99471 4 0.6442 -0.08194 0.300 0.000 0.000 0.492 0.208
#> GSM99473 1 0.6598 0.21153 0.428 0.000 0.000 0.216 0.356
#> GSM99475 4 0.6642 0.22875 0.000 0.000 0.352 0.420 0.228
#> GSM99477 4 0.0000 0.78636 0.000 0.000 0.000 1.000 0.000
#> GSM99479 4 0.0000 0.78636 0.000 0.000 0.000 1.000 0.000
#> GSM99481 1 0.4074 0.81092 0.636 0.000 0.000 0.000 0.364
#> GSM99483 1 0.4074 0.81092 0.636 0.000 0.000 0.000 0.364
#> GSM99485 4 0.0000 0.78636 0.000 0.000 0.000 1.000 0.000
#> GSM99487 2 0.0000 0.84053 0.000 1.000 0.000 0.000 0.000
#> GSM99489 2 0.4015 0.72020 0.348 0.652 0.000 0.000 0.000
#> GSM99491 2 0.3242 0.68466 0.000 0.784 0.000 0.216 0.000
#> GSM99493 1 0.4074 0.81092 0.636 0.000 0.000 0.000 0.364
#> GSM99495 2 0.4074 0.71187 0.364 0.636 0.000 0.000 0.000
#> GSM99525 1 0.4074 0.81092 0.636 0.000 0.000 0.000 0.364
#> GSM99527 4 0.4971 0.36662 0.000 0.028 0.000 0.512 0.460
#> GSM99529 4 0.0000 0.78636 0.000 0.000 0.000 1.000 0.000
#> GSM99531 4 0.6234 0.40201 0.000 0.000 0.296 0.528 0.176
#> GSM99533 4 0.4323 0.57766 0.000 0.000 0.012 0.656 0.332
#> GSM99535 4 0.1168 0.76494 0.008 0.000 0.000 0.960 0.032
#> GSM99537 5 0.4161 -0.25134 0.392 0.000 0.000 0.000 0.608
#> GSM99539 4 0.4304 -0.08133 0.000 0.484 0.000 0.516 0.000
#> GSM99541 5 0.0000 0.65299 0.000 0.000 0.000 0.000 1.000
#> GSM99543 4 0.2890 0.70190 0.160 0.000 0.000 0.836 0.004
#> GSM99545 2 0.2890 0.80384 0.160 0.836 0.004 0.000 0.000
#> GSM99547 4 0.2997 0.70279 0.012 0.000 0.000 0.840 0.148
#> GSM99549 1 0.6795 -0.57666 0.364 0.348 0.000 0.288 0.000
#> GSM99551 4 0.0290 0.78481 0.000 0.000 0.000 0.992 0.008
#> GSM99553 3 0.0000 0.91720 0.000 0.000 1.000 0.000 0.000
#> GSM99555 2 0.0162 0.84053 0.004 0.996 0.000 0.000 0.000
#> GSM99557 2 0.2729 0.81524 0.056 0.884 0.000 0.060 0.000
#> GSM99559 3 0.0609 0.89963 0.000 0.000 0.980 0.020 0.000
#> GSM99561 2 0.1626 0.83401 0.044 0.940 0.000 0.016 0.000
#> GSM99563 3 0.0000 0.91720 0.000 0.000 1.000 0.000 0.000
#> GSM99565 2 0.0000 0.84053 0.000 1.000 0.000 0.000 0.000
#> GSM99573 2 0.6667 0.41301 0.364 0.404 0.000 0.232 0.000
#> GSM99577 5 0.1282 0.61959 0.004 0.000 0.000 0.044 0.952
#> GSM99579 4 0.0000 0.78636 0.000 0.000 0.000 1.000 0.000
#> GSM99581 3 0.0000 0.91720 0.000 0.000 1.000 0.000 0.000
#> GSM99583 4 0.0000 0.78636 0.000 0.000 0.000 1.000 0.000
#> GSM99585 2 0.4302 0.10938 0.000 0.520 0.000 0.480 0.000
#> GSM99587 1 0.4074 0.81092 0.636 0.000 0.000 0.000 0.364
#> GSM99589 4 0.0404 0.78309 0.000 0.012 0.000 0.988 0.000
#> GSM99591 2 0.0000 0.84053 0.000 1.000 0.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
#> GSM99497 3 0.0000 0.9764 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM99503 1 0.0000 0.8778 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99505 1 0.4428 0.3142 0.580 0.000 0.388 0.032 0.000 0.000
#> GSM99507 3 0.0000 0.9764 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM99567 3 0.0000 0.9764 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM99575 1 0.0000 0.8778 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99593 3 0.0000 0.9764 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM99595 3 0.0000 0.9764 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM99469 1 0.0713 0.8649 0.972 0.000 0.000 0.028 0.000 0.000
#> GSM99499 1 0.3435 0.6928 0.804 0.000 0.136 0.060 0.000 0.000
#> GSM99501 1 0.0632 0.8668 0.976 0.000 0.000 0.024 0.000 0.000
#> GSM99509 3 0.0000 0.9764 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM99569 3 0.0146 0.9747 0.000 0.000 0.996 0.004 0.000 0.000
#> GSM99597 3 0.0000 0.9764 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM99601 2 0.0000 0.8723 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM99459 4 0.3330 0.6068 0.284 0.000 0.000 0.716 0.000 0.000
#> GSM99461 4 0.3351 0.6046 0.288 0.000 0.000 0.712 0.000 0.000
#> GSM99511 3 0.0146 0.9747 0.000 0.000 0.996 0.004 0.000 0.000
#> GSM99513 3 0.0146 0.9747 0.000 0.000 0.996 0.004 0.000 0.000
#> GSM99515 3 0.0000 0.9764 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM99517 1 0.0000 0.8778 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99519 4 0.3515 0.5528 0.324 0.000 0.000 0.676 0.000 0.000
#> GSM99521 3 0.0000 0.9764 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM99523 3 0.0260 0.9719 0.000 0.000 0.992 0.008 0.000 0.000
#> GSM99571 1 0.0000 0.8778 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99599 1 0.0000 0.8778 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99433 2 0.0632 0.8632 0.000 0.976 0.000 0.000 0.000 0.024
#> GSM99435 3 0.3601 0.5210 0.000 0.000 0.684 0.004 0.000 0.312
#> GSM99437 2 0.0000 0.8723 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM99439 5 0.1444 0.9193 0.000 0.072 0.000 0.000 0.928 0.000
#> GSM99441 1 0.0000 0.8778 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99443 2 0.0000 0.8723 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM99445 2 0.0000 0.8723 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM99447 2 0.2631 0.7282 0.000 0.820 0.000 0.000 0.000 0.180
#> GSM99449 3 0.0000 0.9764 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM99451 4 0.6157 0.1397 0.000 0.000 0.364 0.384 0.004 0.248
#> GSM99453 1 0.0790 0.8578 0.968 0.000 0.000 0.032 0.000 0.000
#> GSM99455 1 0.0000 0.8778 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99457 4 0.3288 0.6078 0.276 0.000 0.000 0.724 0.000 0.000
#> GSM99463 5 0.1501 0.9181 0.000 0.076 0.000 0.000 0.924 0.000
#> GSM99465 4 0.3076 0.5159 0.000 0.000 0.000 0.760 0.000 0.240
#> GSM99467 6 0.0000 0.8164 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM99471 1 0.4856 0.0358 0.480 0.000 0.000 0.056 0.000 0.464
#> GSM99473 1 0.4354 0.5377 0.704 0.000 0.000 0.080 0.000 0.216
#> GSM99475 4 0.7077 -0.0254 0.000 0.000 0.280 0.352 0.068 0.300
#> GSM99477 6 0.0000 0.8164 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM99479 6 0.0000 0.8164 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM99481 1 0.0000 0.8778 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99483 1 0.0146 0.8764 0.996 0.000 0.000 0.004 0.000 0.000
#> GSM99485 6 0.0000 0.8164 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM99487 2 0.0000 0.8723 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM99489 5 0.3330 0.6575 0.000 0.284 0.000 0.000 0.716 0.000
#> GSM99491 2 0.2912 0.6988 0.000 0.784 0.000 0.000 0.000 0.216
#> GSM99493 1 0.0260 0.8753 0.992 0.000 0.000 0.008 0.000 0.000
#> GSM99495 5 0.1387 0.9194 0.000 0.068 0.000 0.000 0.932 0.000
#> GSM99525 1 0.0000 0.8778 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99527 4 0.3541 0.4916 0.000 0.012 0.000 0.728 0.000 0.260
#> GSM99529 6 0.0000 0.8164 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM99531 6 0.6225 0.1839 0.000 0.000 0.276 0.256 0.012 0.456
#> GSM99533 6 0.5442 0.3001 0.008 0.000 0.012 0.372 0.068 0.540
#> GSM99535 6 0.0713 0.7977 0.028 0.000 0.000 0.000 0.000 0.972
#> GSM99537 1 0.3766 0.5266 0.684 0.000 0.000 0.304 0.012 0.000
#> GSM99539 6 0.3996 -0.0816 0.000 0.484 0.000 0.000 0.004 0.512
#> GSM99541 4 0.1151 0.5856 0.032 0.000 0.000 0.956 0.012 0.000
#> GSM99543 6 0.4247 0.4866 0.000 0.000 0.000 0.040 0.296 0.664
#> GSM99545 2 0.3151 0.5925 0.000 0.748 0.000 0.000 0.252 0.000
#> GSM99547 6 0.3658 0.5569 0.032 0.000 0.000 0.216 0.000 0.752
#> GSM99549 5 0.1594 0.8719 0.000 0.016 0.000 0.000 0.932 0.052
#> GSM99551 6 0.1501 0.7796 0.000 0.000 0.000 0.076 0.000 0.924
#> GSM99553 3 0.0000 0.9764 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM99555 2 0.0146 0.8710 0.000 0.996 0.000 0.000 0.004 0.000
#> GSM99557 2 0.3455 0.7240 0.000 0.800 0.000 0.000 0.144 0.056
#> GSM99559 3 0.0547 0.9560 0.000 0.000 0.980 0.000 0.000 0.020
#> GSM99561 2 0.1787 0.8262 0.000 0.920 0.000 0.004 0.068 0.008
#> GSM99563 3 0.0146 0.9747 0.000 0.000 0.996 0.004 0.000 0.000
#> GSM99565 2 0.0000 0.8723 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM99573 5 0.1616 0.9101 0.000 0.048 0.000 0.000 0.932 0.020
#> GSM99577 4 0.0909 0.5857 0.020 0.000 0.000 0.968 0.012 0.000
#> GSM99579 6 0.0000 0.8164 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM99581 3 0.0000 0.9764 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM99583 6 0.0000 0.8164 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM99585 2 0.3864 0.0843 0.000 0.520 0.000 0.000 0.000 0.480
#> GSM99587 1 0.0363 0.8747 0.988 0.000 0.000 0.012 0.000 0.000
#> GSM99589 6 0.0363 0.8112 0.000 0.012 0.000 0.000 0.000 0.988
#> GSM99591 2 0.0000 0.8723 0.000 1.000 0.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 disease.state(p) cell.type(p) k
#> SD:pam 82 4.33e-02 0.094209 2
#> SD:pam 82 1.21e-04 0.002308 3
#> SD:pam 77 6.54e-06 0.000508 4
#> SD:pam 70 2.45e-05 0.000822 5
#> SD:pam 75 1.64e-04 0.006370 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 21512 rows and 85 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.978 0.923 0.957 0.3557 0.624 0.624
#> 3 3 0.951 0.912 0.965 0.8866 0.645 0.456
#> 4 4 0.798 0.807 0.852 0.0631 0.906 0.731
#> 5 5 0.890 0.878 0.918 0.0708 0.911 0.711
#> 6 6 0.814 0.742 0.862 0.0497 0.971 0.881
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
#> GSM99497 2 0.0000 0.893 0.000 1.000
#> GSM99503 1 0.0376 0.972 0.996 0.004
#> GSM99505 1 0.0376 0.972 0.996 0.004
#> GSM99507 2 0.0000 0.893 0.000 1.000
#> GSM99567 2 0.0000 0.893 0.000 1.000
#> GSM99575 1 0.0376 0.972 0.996 0.004
#> GSM99593 2 0.0000 0.893 0.000 1.000
#> GSM99595 2 0.0000 0.893 0.000 1.000
#> GSM99469 1 0.0376 0.972 0.996 0.004
#> GSM99499 1 0.0376 0.972 0.996 0.004
#> GSM99501 1 0.0376 0.972 0.996 0.004
#> GSM99509 2 0.0000 0.893 0.000 1.000
#> GSM99569 2 0.3274 0.864 0.060 0.940
#> GSM99597 2 0.2043 0.880 0.032 0.968
#> GSM99601 1 0.2236 0.976 0.964 0.036
#> GSM99459 1 0.0376 0.972 0.996 0.004
#> GSM99461 1 0.0376 0.972 0.996 0.004
#> GSM99511 2 0.0000 0.893 0.000 1.000
#> GSM99513 2 0.0000 0.893 0.000 1.000
#> GSM99515 2 0.0000 0.893 0.000 1.000
#> GSM99517 1 0.0376 0.972 0.996 0.004
#> GSM99519 1 0.0376 0.972 0.996 0.004
#> GSM99521 2 0.0000 0.893 0.000 1.000
#> GSM99523 2 0.9775 0.378 0.412 0.588
#> GSM99571 1 0.0376 0.972 0.996 0.004
#> GSM99599 1 0.0376 0.972 0.996 0.004
#> GSM99433 1 0.2236 0.976 0.964 0.036
#> GSM99435 2 0.0000 0.893 0.000 1.000
#> GSM99437 1 0.2236 0.976 0.964 0.036
#> GSM99439 1 0.2236 0.976 0.964 0.036
#> GSM99441 1 0.0376 0.972 0.996 0.004
#> GSM99443 1 0.2236 0.976 0.964 0.036
#> GSM99445 1 0.2236 0.976 0.964 0.036
#> GSM99447 1 0.2236 0.976 0.964 0.036
#> GSM99449 2 0.6887 0.751 0.184 0.816
#> GSM99451 2 0.0000 0.893 0.000 1.000
#> GSM99453 1 0.0376 0.972 0.996 0.004
#> GSM99455 1 0.0376 0.972 0.996 0.004
#> GSM99457 1 0.0376 0.972 0.996 0.004
#> GSM99463 1 0.2236 0.976 0.964 0.036
#> GSM99465 1 0.0376 0.972 0.996 0.004
#> GSM99467 1 0.2236 0.976 0.964 0.036
#> GSM99471 1 0.0376 0.972 0.996 0.004
#> GSM99473 1 0.0000 0.971 1.000 0.000
#> GSM99475 2 0.9661 0.420 0.392 0.608
#> GSM99477 1 0.2236 0.976 0.964 0.036
#> GSM99479 1 0.2236 0.976 0.964 0.036
#> GSM99481 1 0.0376 0.972 0.996 0.004
#> GSM99483 1 0.0376 0.972 0.996 0.004
#> GSM99485 1 0.2236 0.976 0.964 0.036
#> GSM99487 1 0.2236 0.976 0.964 0.036
#> GSM99489 1 0.2236 0.976 0.964 0.036
#> GSM99491 1 0.2236 0.976 0.964 0.036
#> GSM99493 1 0.0376 0.972 0.996 0.004
#> GSM99495 1 0.2236 0.976 0.964 0.036
#> GSM99525 1 0.0376 0.972 0.996 0.004
#> GSM99527 1 0.3274 0.961 0.940 0.060
#> GSM99529 1 0.2236 0.976 0.964 0.036
#> GSM99531 1 0.5178 0.895 0.884 0.116
#> GSM99533 1 0.4690 0.916 0.900 0.100
#> GSM99535 1 0.2236 0.976 0.964 0.036
#> GSM99537 1 0.0376 0.972 0.996 0.004
#> GSM99539 1 0.3114 0.961 0.944 0.056
#> GSM99541 1 0.0376 0.972 0.996 0.004
#> GSM99543 1 0.2236 0.976 0.964 0.036
#> GSM99545 1 0.2778 0.968 0.952 0.048
#> GSM99547 1 0.2423 0.975 0.960 0.040
#> GSM99549 1 0.2236 0.976 0.964 0.036
#> GSM99551 1 0.0376 0.972 0.996 0.004
#> GSM99553 2 0.9795 0.362 0.416 0.584
#> GSM99555 1 0.2236 0.976 0.964 0.036
#> GSM99557 1 0.2236 0.976 0.964 0.036
#> GSM99559 2 0.9988 0.171 0.480 0.520
#> GSM99561 1 0.2236 0.976 0.964 0.036
#> GSM99563 2 0.0000 0.893 0.000 1.000
#> GSM99565 1 0.2236 0.976 0.964 0.036
#> GSM99573 1 0.2236 0.976 0.964 0.036
#> GSM99577 1 0.0376 0.972 0.996 0.004
#> GSM99579 1 0.2236 0.976 0.964 0.036
#> GSM99581 2 0.2948 0.869 0.052 0.948
#> GSM99583 1 0.2236 0.976 0.964 0.036
#> GSM99585 1 0.2236 0.976 0.964 0.036
#> GSM99587 1 0.0376 0.972 0.996 0.004
#> GSM99589 1 0.2236 0.976 0.964 0.036
#> GSM99591 1 0.2236 0.976 0.964 0.036
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM99497 3 0.0000 0.9433 0.000 0.000 1.000
#> GSM99503 1 0.0000 0.9833 1.000 0.000 0.000
#> GSM99505 1 0.0237 0.9794 0.996 0.000 0.004
#> GSM99507 3 0.0000 0.9433 0.000 0.000 1.000
#> GSM99567 3 0.0000 0.9433 0.000 0.000 1.000
#> GSM99575 1 0.0000 0.9833 1.000 0.000 0.000
#> GSM99593 3 0.0000 0.9433 0.000 0.000 1.000
#> GSM99595 3 0.0000 0.9433 0.000 0.000 1.000
#> GSM99469 1 0.0000 0.9833 1.000 0.000 0.000
#> GSM99499 1 0.0000 0.9833 1.000 0.000 0.000
#> GSM99501 1 0.0000 0.9833 1.000 0.000 0.000
#> GSM99509 3 0.0000 0.9433 0.000 0.000 1.000
#> GSM99569 3 0.0000 0.9433 0.000 0.000 1.000
#> GSM99597 3 0.0000 0.9433 0.000 0.000 1.000
#> GSM99601 2 0.0000 0.9595 0.000 1.000 0.000
#> GSM99459 1 0.0000 0.9833 1.000 0.000 0.000
#> GSM99461 1 0.0000 0.9833 1.000 0.000 0.000
#> GSM99511 3 0.0000 0.9433 0.000 0.000 1.000
#> GSM99513 3 0.0000 0.9433 0.000 0.000 1.000
#> GSM99515 3 0.0000 0.9433 0.000 0.000 1.000
#> GSM99517 1 0.0000 0.9833 1.000 0.000 0.000
#> GSM99519 1 0.0000 0.9833 1.000 0.000 0.000
#> GSM99521 3 0.0000 0.9433 0.000 0.000 1.000
#> GSM99523 3 0.0747 0.9337 0.016 0.000 0.984
#> GSM99571 1 0.0000 0.9833 1.000 0.000 0.000
#> GSM99599 1 0.0000 0.9833 1.000 0.000 0.000
#> GSM99433 2 0.0424 0.9536 0.000 0.992 0.008
#> GSM99435 3 0.0000 0.9433 0.000 0.000 1.000
#> GSM99437 2 0.0000 0.9595 0.000 1.000 0.000
#> GSM99439 2 0.0000 0.9595 0.000 1.000 0.000
#> GSM99441 1 0.0000 0.9833 1.000 0.000 0.000
#> GSM99443 2 0.0000 0.9595 0.000 1.000 0.000
#> GSM99445 2 0.0000 0.9595 0.000 1.000 0.000
#> GSM99447 2 0.0000 0.9595 0.000 1.000 0.000
#> GSM99449 3 0.0237 0.9408 0.000 0.004 0.996
#> GSM99451 3 0.0000 0.9433 0.000 0.000 1.000
#> GSM99453 1 0.0000 0.9833 1.000 0.000 0.000
#> GSM99455 1 0.0000 0.9833 1.000 0.000 0.000
#> GSM99457 1 0.0000 0.9833 1.000 0.000 0.000
#> GSM99463 2 0.0000 0.9595 0.000 1.000 0.000
#> GSM99465 1 0.6180 0.2281 0.584 0.000 0.416
#> GSM99467 2 0.0000 0.9595 0.000 1.000 0.000
#> GSM99471 1 0.0000 0.9833 1.000 0.000 0.000
#> GSM99473 1 0.0000 0.9833 1.000 0.000 0.000
#> GSM99475 3 0.0000 0.9433 0.000 0.000 1.000
#> GSM99477 2 0.6305 0.0109 0.000 0.516 0.484
#> GSM99479 2 0.1163 0.9377 0.000 0.972 0.028
#> GSM99481 1 0.0000 0.9833 1.000 0.000 0.000
#> GSM99483 1 0.0000 0.9833 1.000 0.000 0.000
#> GSM99485 2 0.0000 0.9595 0.000 1.000 0.000
#> GSM99487 2 0.0000 0.9595 0.000 1.000 0.000
#> GSM99489 2 0.0000 0.9595 0.000 1.000 0.000
#> GSM99491 2 0.0000 0.9595 0.000 1.000 0.000
#> GSM99493 1 0.0000 0.9833 1.000 0.000 0.000
#> GSM99495 2 0.0000 0.9595 0.000 1.000 0.000
#> GSM99525 1 0.0000 0.9833 1.000 0.000 0.000
#> GSM99527 3 0.2537 0.8770 0.000 0.080 0.920
#> GSM99529 2 0.5650 0.5166 0.000 0.688 0.312
#> GSM99531 3 0.1643 0.9129 0.044 0.000 0.956
#> GSM99533 3 0.2261 0.8909 0.068 0.000 0.932
#> GSM99535 2 0.1964 0.9099 0.056 0.944 0.000
#> GSM99537 1 0.0000 0.9833 1.000 0.000 0.000
#> GSM99539 2 0.3482 0.8354 0.000 0.872 0.128
#> GSM99541 1 0.0000 0.9833 1.000 0.000 0.000
#> GSM99543 2 0.0000 0.9595 0.000 1.000 0.000
#> GSM99545 2 0.2959 0.8665 0.000 0.900 0.100
#> GSM99547 3 0.9463 0.3745 0.244 0.256 0.500
#> GSM99549 2 0.0000 0.9595 0.000 1.000 0.000
#> GSM99551 1 0.0000 0.9833 1.000 0.000 0.000
#> GSM99553 3 0.0000 0.9433 0.000 0.000 1.000
#> GSM99555 2 0.0000 0.9595 0.000 1.000 0.000
#> GSM99557 2 0.0000 0.9595 0.000 1.000 0.000
#> GSM99559 3 0.5016 0.6660 0.000 0.240 0.760
#> GSM99561 2 0.0000 0.9595 0.000 1.000 0.000
#> GSM99563 3 0.0000 0.9433 0.000 0.000 1.000
#> GSM99565 2 0.0000 0.9595 0.000 1.000 0.000
#> GSM99573 2 0.0000 0.9595 0.000 1.000 0.000
#> GSM99577 1 0.0000 0.9833 1.000 0.000 0.000
#> GSM99579 2 0.0000 0.9595 0.000 1.000 0.000
#> GSM99581 3 0.0000 0.9433 0.000 0.000 1.000
#> GSM99583 3 0.7895 0.1407 0.056 0.436 0.508
#> GSM99585 2 0.0000 0.9595 0.000 1.000 0.000
#> GSM99587 1 0.0000 0.9833 1.000 0.000 0.000
#> GSM99589 2 0.0000 0.9595 0.000 1.000 0.000
#> GSM99591 2 0.0000 0.9595 0.000 1.000 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM99497 3 0.0000 0.9529 0.000 0.000 1.000 0.000
#> GSM99503 1 0.4994 0.9883 0.520 0.000 0.000 0.480
#> GSM99505 1 0.5290 0.9693 0.516 0.000 0.008 0.476
#> GSM99507 3 0.0000 0.9529 0.000 0.000 1.000 0.000
#> GSM99567 3 0.0000 0.9529 0.000 0.000 1.000 0.000
#> GSM99575 1 0.4994 0.9883 0.520 0.000 0.000 0.480
#> GSM99593 3 0.0000 0.9529 0.000 0.000 1.000 0.000
#> GSM99595 3 0.0000 0.9529 0.000 0.000 1.000 0.000
#> GSM99469 1 0.4994 0.9883 0.520 0.000 0.000 0.480
#> GSM99499 1 0.4994 0.9883 0.520 0.000 0.000 0.480
#> GSM99501 1 0.4994 0.9883 0.520 0.000 0.000 0.480
#> GSM99509 3 0.0000 0.9529 0.000 0.000 1.000 0.000
#> GSM99569 3 0.0000 0.9529 0.000 0.000 1.000 0.000
#> GSM99597 3 0.0000 0.9529 0.000 0.000 1.000 0.000
#> GSM99601 2 0.1716 0.8476 0.064 0.936 0.000 0.000
#> GSM99459 1 0.4994 0.9883 0.520 0.000 0.000 0.480
#> GSM99461 1 0.4994 0.9883 0.520 0.000 0.000 0.480
#> GSM99511 3 0.0000 0.9529 0.000 0.000 1.000 0.000
#> GSM99513 3 0.0000 0.9529 0.000 0.000 1.000 0.000
#> GSM99515 3 0.0000 0.9529 0.000 0.000 1.000 0.000
#> GSM99517 1 0.4994 0.9883 0.520 0.000 0.000 0.480
#> GSM99519 1 0.4994 0.9883 0.520 0.000 0.000 0.480
#> GSM99521 3 0.0000 0.9529 0.000 0.000 1.000 0.000
#> GSM99523 3 0.0657 0.9455 0.004 0.012 0.984 0.000
#> GSM99571 4 0.4008 0.0204 0.244 0.000 0.000 0.756
#> GSM99599 1 0.4994 0.9883 0.520 0.000 0.000 0.480
#> GSM99433 2 0.1042 0.8553 0.008 0.972 0.020 0.000
#> GSM99435 3 0.0000 0.9529 0.000 0.000 1.000 0.000
#> GSM99437 2 0.0188 0.8583 0.004 0.996 0.000 0.000
#> GSM99439 2 0.4830 0.6734 0.392 0.608 0.000 0.000
#> GSM99441 1 0.4994 0.9883 0.520 0.000 0.000 0.480
#> GSM99443 2 0.0592 0.8581 0.016 0.984 0.000 0.000
#> GSM99445 2 0.1637 0.8488 0.060 0.940 0.000 0.000
#> GSM99447 2 0.0000 0.8580 0.000 1.000 0.000 0.000
#> GSM99449 3 0.1004 0.9364 0.004 0.024 0.972 0.000
#> GSM99451 3 0.0000 0.9529 0.000 0.000 1.000 0.000
#> GSM99453 4 0.0000 0.7319 0.000 0.000 0.000 1.000
#> GSM99455 4 0.0000 0.7319 0.000 0.000 0.000 1.000
#> GSM99457 4 0.0188 0.7289 0.004 0.000 0.000 0.996
#> GSM99463 2 0.4830 0.6734 0.392 0.608 0.000 0.000
#> GSM99465 3 0.9245 0.2060 0.228 0.212 0.440 0.120
#> GSM99467 2 0.1211 0.8492 0.040 0.960 0.000 0.000
#> GSM99471 4 0.6546 0.0941 0.080 0.396 0.000 0.524
#> GSM99473 1 0.6082 0.8538 0.480 0.044 0.000 0.476
#> GSM99475 3 0.0188 0.9514 0.000 0.004 0.996 0.000
#> GSM99477 2 0.4599 0.7579 0.088 0.800 0.112 0.000
#> GSM99479 2 0.2081 0.8330 0.084 0.916 0.000 0.000
#> GSM99481 1 0.4994 0.9883 0.520 0.000 0.000 0.480
#> GSM99483 4 0.0000 0.7319 0.000 0.000 0.000 1.000
#> GSM99485 2 0.0000 0.8580 0.000 1.000 0.000 0.000
#> GSM99487 2 0.0188 0.8583 0.004 0.996 0.000 0.000
#> GSM99489 2 0.3649 0.7905 0.204 0.796 0.000 0.000
#> GSM99491 2 0.0336 0.8583 0.008 0.992 0.000 0.000
#> GSM99493 4 0.0000 0.7319 0.000 0.000 0.000 1.000
#> GSM99495 2 0.4830 0.6734 0.392 0.608 0.000 0.000
#> GSM99525 4 0.4994 -0.9078 0.480 0.000 0.000 0.520
#> GSM99527 3 0.5113 0.7246 0.088 0.152 0.760 0.000
#> GSM99529 2 0.2473 0.8308 0.080 0.908 0.012 0.000
#> GSM99531 3 0.0779 0.9426 0.004 0.016 0.980 0.000
#> GSM99533 3 0.0992 0.9416 0.004 0.012 0.976 0.008
#> GSM99535 2 0.2412 0.8307 0.084 0.908 0.000 0.008
#> GSM99537 1 0.4994 0.9883 0.520 0.000 0.000 0.480
#> GSM99539 2 0.4053 0.6929 0.004 0.768 0.228 0.000
#> GSM99541 1 0.5163 0.9798 0.516 0.000 0.004 0.480
#> GSM99543 2 0.3401 0.8132 0.152 0.840 0.000 0.008
#> GSM99545 2 0.5173 0.5336 0.020 0.660 0.320 0.000
#> GSM99547 2 0.7279 0.2252 0.088 0.484 0.408 0.020
#> GSM99549 2 0.4817 0.6739 0.388 0.612 0.000 0.000
#> GSM99551 4 0.1489 0.6864 0.004 0.044 0.000 0.952
#> GSM99553 3 0.0188 0.9514 0.000 0.004 0.996 0.000
#> GSM99555 2 0.0469 0.8583 0.012 0.988 0.000 0.000
#> GSM99557 2 0.2647 0.8271 0.120 0.880 0.000 0.000
#> GSM99559 3 0.3791 0.7041 0.004 0.200 0.796 0.000
#> GSM99561 2 0.0336 0.8589 0.008 0.992 0.000 0.000
#> GSM99563 3 0.0000 0.9529 0.000 0.000 1.000 0.000
#> GSM99565 2 0.0188 0.8583 0.004 0.996 0.000 0.000
#> GSM99573 2 0.4817 0.6739 0.388 0.612 0.000 0.000
#> GSM99577 4 0.1510 0.6986 0.016 0.028 0.000 0.956
#> GSM99579 2 0.0592 0.8581 0.016 0.984 0.000 0.000
#> GSM99581 3 0.0469 0.9468 0.000 0.012 0.988 0.000
#> GSM99583 2 0.7031 0.3761 0.092 0.536 0.360 0.012
#> GSM99585 2 0.2149 0.8312 0.088 0.912 0.000 0.000
#> GSM99587 4 0.0000 0.7319 0.000 0.000 0.000 1.000
#> GSM99589 2 0.0000 0.8580 0.000 1.000 0.000 0.000
#> GSM99591 2 0.0707 0.8576 0.020 0.980 0.000 0.000
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM99497 3 0.0000 0.943 0.000 0.000 1.000 0.000 0.000
#> GSM99503 1 0.0000 0.951 1.000 0.000 0.000 0.000 0.000
#> GSM99505 1 0.0162 0.950 0.996 0.000 0.004 0.000 0.000
#> GSM99507 3 0.0162 0.943 0.000 0.000 0.996 0.000 0.004
#> GSM99567 3 0.0290 0.941 0.000 0.000 0.992 0.000 0.008
#> GSM99575 1 0.0000 0.951 1.000 0.000 0.000 0.000 0.000
#> GSM99593 3 0.0162 0.943 0.000 0.000 0.996 0.000 0.004
#> GSM99595 3 0.0404 0.940 0.000 0.000 0.988 0.000 0.012
#> GSM99469 1 0.0000 0.951 1.000 0.000 0.000 0.000 0.000
#> GSM99499 1 0.0162 0.950 0.996 0.000 0.000 0.004 0.000
#> GSM99501 1 0.0000 0.951 1.000 0.000 0.000 0.000 0.000
#> GSM99509 3 0.0162 0.943 0.000 0.000 0.996 0.000 0.004
#> GSM99569 3 0.0000 0.943 0.000 0.000 1.000 0.000 0.000
#> GSM99597 3 0.0000 0.943 0.000 0.000 1.000 0.000 0.000
#> GSM99601 2 0.1478 0.885 0.000 0.936 0.000 0.000 0.064
#> GSM99459 1 0.0880 0.929 0.968 0.000 0.000 0.032 0.000
#> GSM99461 1 0.1478 0.898 0.936 0.000 0.000 0.064 0.000
#> GSM99511 3 0.0404 0.940 0.000 0.000 0.988 0.000 0.012
#> GSM99513 3 0.0404 0.940 0.000 0.000 0.988 0.000 0.012
#> GSM99515 3 0.0162 0.943 0.000 0.000 0.996 0.000 0.004
#> GSM99517 1 0.0000 0.951 1.000 0.000 0.000 0.000 0.000
#> GSM99519 1 0.0000 0.951 1.000 0.000 0.000 0.000 0.000
#> GSM99521 3 0.0162 0.943 0.000 0.000 0.996 0.000 0.004
#> GSM99523 3 0.0000 0.943 0.000 0.000 1.000 0.000 0.000
#> GSM99571 4 0.3752 0.777 0.292 0.000 0.000 0.708 0.000
#> GSM99599 1 0.1197 0.924 0.952 0.000 0.000 0.048 0.000
#> GSM99433 2 0.1043 0.870 0.000 0.960 0.040 0.000 0.000
#> GSM99435 3 0.0404 0.940 0.000 0.000 0.988 0.000 0.012
#> GSM99437 2 0.0000 0.898 0.000 1.000 0.000 0.000 0.000
#> GSM99439 5 0.0609 1.000 0.000 0.020 0.000 0.000 0.980
#> GSM99441 1 0.1270 0.921 0.948 0.000 0.000 0.052 0.000
#> GSM99443 2 0.1043 0.894 0.000 0.960 0.000 0.000 0.040
#> GSM99445 2 0.1851 0.869 0.000 0.912 0.000 0.000 0.088
#> GSM99447 2 0.0000 0.898 0.000 1.000 0.000 0.000 0.000
#> GSM99449 3 0.0000 0.943 0.000 0.000 1.000 0.000 0.000
#> GSM99451 3 0.0162 0.943 0.000 0.000 0.996 0.000 0.004
#> GSM99453 4 0.2424 0.944 0.132 0.000 0.000 0.868 0.000
#> GSM99455 4 0.2424 0.944 0.132 0.000 0.000 0.868 0.000
#> GSM99457 4 0.2561 0.937 0.144 0.000 0.000 0.856 0.000
#> GSM99463 5 0.0609 1.000 0.000 0.020 0.000 0.000 0.980
#> GSM99465 3 0.6170 0.335 0.336 0.000 0.528 0.132 0.004
#> GSM99467 2 0.0162 0.897 0.000 0.996 0.000 0.004 0.000
#> GSM99471 4 0.4016 0.743 0.272 0.012 0.000 0.716 0.000
#> GSM99473 1 0.2179 0.884 0.888 0.000 0.000 0.112 0.000
#> GSM99475 3 0.0000 0.943 0.000 0.000 1.000 0.000 0.000
#> GSM99477 2 0.0613 0.893 0.000 0.984 0.008 0.004 0.004
#> GSM99479 2 0.0324 0.896 0.000 0.992 0.000 0.004 0.004
#> GSM99481 1 0.1197 0.924 0.952 0.000 0.000 0.048 0.000
#> GSM99483 4 0.2424 0.944 0.132 0.000 0.000 0.868 0.000
#> GSM99485 2 0.0794 0.898 0.000 0.972 0.000 0.000 0.028
#> GSM99487 2 0.0000 0.898 0.000 1.000 0.000 0.000 0.000
#> GSM99489 2 0.4291 0.239 0.000 0.536 0.000 0.000 0.464
#> GSM99491 2 0.0880 0.897 0.000 0.968 0.000 0.000 0.032
#> GSM99493 4 0.2424 0.944 0.132 0.000 0.000 0.868 0.000
#> GSM99495 5 0.0609 1.000 0.000 0.020 0.000 0.000 0.980
#> GSM99525 1 0.3612 0.550 0.732 0.000 0.000 0.268 0.000
#> GSM99527 3 0.4000 0.785 0.000 0.064 0.800 0.132 0.004
#> GSM99529 2 0.1544 0.869 0.000 0.932 0.000 0.068 0.000
#> GSM99531 3 0.0000 0.943 0.000 0.000 1.000 0.000 0.000
#> GSM99533 3 0.0162 0.941 0.004 0.000 0.996 0.000 0.000
#> GSM99535 2 0.2970 0.795 0.000 0.828 0.000 0.168 0.004
#> GSM99537 1 0.0609 0.943 0.980 0.000 0.000 0.020 0.000
#> GSM99539 2 0.4171 0.281 0.000 0.604 0.396 0.000 0.000
#> GSM99541 1 0.0162 0.950 0.996 0.000 0.004 0.000 0.000
#> GSM99543 2 0.4682 0.333 0.000 0.564 0.000 0.016 0.420
#> GSM99545 3 0.5490 0.537 0.000 0.228 0.644 0.000 0.128
#> GSM99547 3 0.4150 0.786 0.008 0.056 0.800 0.132 0.004
#> GSM99549 5 0.0609 1.000 0.000 0.020 0.000 0.000 0.980
#> GSM99551 4 0.2020 0.909 0.100 0.000 0.000 0.900 0.000
#> GSM99553 3 0.0000 0.943 0.000 0.000 1.000 0.000 0.000
#> GSM99555 2 0.0880 0.898 0.000 0.968 0.000 0.000 0.032
#> GSM99557 2 0.3039 0.768 0.000 0.808 0.000 0.000 0.192
#> GSM99559 3 0.0000 0.943 0.000 0.000 1.000 0.000 0.000
#> GSM99561 2 0.0880 0.898 0.000 0.968 0.000 0.000 0.032
#> GSM99563 3 0.0162 0.943 0.000 0.000 0.996 0.000 0.004
#> GSM99565 2 0.0000 0.898 0.000 1.000 0.000 0.000 0.000
#> GSM99573 5 0.0609 1.000 0.000 0.020 0.000 0.000 0.980
#> GSM99577 4 0.2424 0.944 0.132 0.000 0.000 0.868 0.000
#> GSM99579 2 0.1544 0.882 0.000 0.932 0.000 0.000 0.068
#> GSM99581 3 0.0000 0.943 0.000 0.000 1.000 0.000 0.000
#> GSM99583 3 0.4610 0.733 0.000 0.112 0.756 0.128 0.004
#> GSM99585 2 0.0324 0.896 0.000 0.992 0.000 0.004 0.004
#> GSM99587 4 0.2424 0.944 0.132 0.000 0.000 0.868 0.000
#> GSM99589 2 0.0000 0.898 0.000 1.000 0.000 0.000 0.000
#> GSM99591 2 0.1043 0.894 0.000 0.960 0.000 0.000 0.040
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM99497 3 0.2191 0.8018 0.000 0.000 0.876 0.120 0.000 0.004
#> GSM99503 1 0.0000 0.9381 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99505 1 0.0260 0.9377 0.992 0.000 0.000 0.008 0.000 0.000
#> GSM99507 3 0.1700 0.8299 0.000 0.000 0.916 0.080 0.000 0.004
#> GSM99567 3 0.0603 0.8453 0.000 0.000 0.980 0.016 0.000 0.004
#> GSM99575 1 0.0000 0.9381 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99593 3 0.0713 0.8447 0.000 0.000 0.972 0.028 0.000 0.000
#> GSM99595 3 0.1265 0.8384 0.000 0.000 0.948 0.044 0.000 0.008
#> GSM99469 1 0.0000 0.9381 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99499 1 0.0260 0.9377 0.992 0.000 0.000 0.008 0.000 0.000
#> GSM99501 1 0.0000 0.9381 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99509 3 0.1219 0.8415 0.000 0.000 0.948 0.048 0.000 0.004
#> GSM99569 3 0.2489 0.7967 0.000 0.000 0.860 0.128 0.000 0.012
#> GSM99597 3 0.0972 0.8436 0.000 0.000 0.964 0.028 0.000 0.008
#> GSM99601 2 0.1204 0.7805 0.000 0.944 0.000 0.000 0.056 0.000
#> GSM99459 1 0.0713 0.9221 0.972 0.000 0.000 0.028 0.000 0.000
#> GSM99461 1 0.1075 0.9035 0.952 0.000 0.000 0.048 0.000 0.000
#> GSM99511 3 0.1528 0.8375 0.000 0.000 0.936 0.048 0.000 0.016
#> GSM99513 3 0.1531 0.8318 0.000 0.000 0.928 0.068 0.000 0.004
#> GSM99515 3 0.2212 0.8077 0.000 0.000 0.880 0.112 0.000 0.008
#> GSM99517 1 0.0000 0.9381 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99519 1 0.0260 0.9363 0.992 0.000 0.000 0.008 0.000 0.000
#> GSM99521 3 0.0405 0.8467 0.000 0.000 0.988 0.008 0.000 0.004
#> GSM99523 3 0.3619 0.6618 0.000 0.000 0.744 0.232 0.000 0.024
#> GSM99571 6 0.3489 0.6715 0.288 0.000 0.000 0.004 0.000 0.708
#> GSM99599 1 0.1531 0.9011 0.928 0.000 0.000 0.004 0.000 0.068
#> GSM99433 2 0.4067 0.6548 0.000 0.728 0.060 0.212 0.000 0.000
#> GSM99435 3 0.1492 0.8410 0.000 0.000 0.940 0.036 0.000 0.024
#> GSM99437 2 0.0146 0.7863 0.000 0.996 0.000 0.000 0.000 0.004
#> GSM99439 5 0.0000 0.8467 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM99441 1 0.1531 0.9011 0.928 0.000 0.000 0.004 0.000 0.068
#> GSM99443 2 0.1007 0.7833 0.000 0.956 0.000 0.000 0.044 0.000
#> GSM99445 2 0.1610 0.7683 0.000 0.916 0.000 0.000 0.084 0.000
#> GSM99447 2 0.1285 0.7828 0.000 0.944 0.000 0.052 0.000 0.004
#> GSM99449 3 0.2147 0.8284 0.000 0.000 0.896 0.084 0.000 0.020
#> GSM99451 3 0.2039 0.8251 0.000 0.000 0.904 0.076 0.000 0.020
#> GSM99453 6 0.1204 0.9143 0.056 0.000 0.000 0.000 0.000 0.944
#> GSM99455 6 0.1267 0.9132 0.060 0.000 0.000 0.000 0.000 0.940
#> GSM99457 6 0.2048 0.8735 0.120 0.000 0.000 0.000 0.000 0.880
#> GSM99463 5 0.0000 0.8467 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM99465 4 0.5303 0.3793 0.232 0.000 0.172 0.596 0.000 0.000
#> GSM99467 2 0.2969 0.7037 0.000 0.776 0.000 0.224 0.000 0.000
#> GSM99471 6 0.4767 0.6707 0.168 0.000 0.000 0.156 0.000 0.676
#> GSM99473 1 0.3513 0.7910 0.796 0.000 0.000 0.144 0.000 0.060
#> GSM99475 3 0.3071 0.7410 0.000 0.000 0.804 0.180 0.000 0.016
#> GSM99477 2 0.4229 0.4182 0.000 0.548 0.016 0.436 0.000 0.000
#> GSM99479 2 0.3592 0.5958 0.000 0.656 0.000 0.344 0.000 0.000
#> GSM99481 1 0.1531 0.9011 0.928 0.000 0.000 0.004 0.000 0.068
#> GSM99483 6 0.1204 0.9143 0.056 0.000 0.000 0.000 0.000 0.944
#> GSM99485 2 0.2959 0.7771 0.000 0.852 0.000 0.104 0.036 0.008
#> GSM99487 2 0.0146 0.7863 0.000 0.996 0.000 0.000 0.000 0.004
#> GSM99489 2 0.3789 0.2324 0.000 0.584 0.000 0.000 0.416 0.000
#> GSM99491 2 0.1010 0.7860 0.000 0.960 0.000 0.004 0.036 0.000
#> GSM99493 6 0.1204 0.9143 0.056 0.000 0.000 0.000 0.000 0.944
#> GSM99495 5 0.0000 0.8467 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM99525 1 0.3620 0.4297 0.648 0.000 0.000 0.000 0.000 0.352
#> GSM99527 3 0.4445 0.4167 0.004 0.044 0.656 0.296 0.000 0.000
#> GSM99529 2 0.4184 0.3421 0.000 0.500 0.000 0.488 0.000 0.012
#> GSM99531 3 0.3073 0.7174 0.000 0.000 0.788 0.204 0.000 0.008
#> GSM99533 3 0.3424 0.7165 0.004 0.000 0.780 0.196 0.000 0.020
#> GSM99535 2 0.5022 0.3578 0.000 0.496 0.000 0.432 0.000 0.072
#> GSM99537 1 0.0692 0.9304 0.976 0.000 0.000 0.004 0.000 0.020
#> GSM99539 2 0.5875 0.0356 0.000 0.476 0.288 0.236 0.000 0.000
#> GSM99541 1 0.0146 0.9376 0.996 0.000 0.000 0.004 0.000 0.000
#> GSM99543 5 0.6168 -0.1898 0.000 0.416 0.000 0.140 0.416 0.028
#> GSM99545 3 0.6738 0.0406 0.000 0.196 0.508 0.204 0.092 0.000
#> GSM99547 4 0.4812 0.1054 0.004 0.044 0.432 0.520 0.000 0.000
#> GSM99549 5 0.0000 0.8467 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM99551 6 0.1572 0.8831 0.028 0.000 0.000 0.036 0.000 0.936
#> GSM99553 3 0.2070 0.8164 0.000 0.000 0.892 0.100 0.000 0.008
#> GSM99555 2 0.1245 0.7899 0.000 0.952 0.000 0.016 0.032 0.000
#> GSM99557 2 0.2793 0.6607 0.000 0.800 0.000 0.000 0.200 0.000
#> GSM99559 3 0.1387 0.8418 0.000 0.000 0.932 0.068 0.000 0.000
#> GSM99561 2 0.2999 0.7707 0.000 0.836 0.000 0.124 0.040 0.000
#> GSM99563 3 0.1745 0.8360 0.000 0.000 0.920 0.068 0.000 0.012
#> GSM99565 2 0.0146 0.7863 0.000 0.996 0.000 0.000 0.000 0.004
#> GSM99573 5 0.0000 0.8467 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM99577 6 0.1528 0.9040 0.048 0.000 0.000 0.016 0.000 0.936
#> GSM99579 2 0.1802 0.7778 0.000 0.916 0.000 0.012 0.072 0.000
#> GSM99581 3 0.2623 0.7913 0.000 0.000 0.852 0.132 0.000 0.016
#> GSM99583 4 0.4995 0.2542 0.004 0.220 0.092 0.672 0.000 0.012
#> GSM99585 2 0.3409 0.6424 0.000 0.700 0.000 0.300 0.000 0.000
#> GSM99587 6 0.1204 0.9143 0.056 0.000 0.000 0.000 0.000 0.944
#> GSM99589 2 0.2178 0.7557 0.000 0.868 0.000 0.132 0.000 0.000
#> GSM99591 2 0.1075 0.7825 0.000 0.952 0.000 0.000 0.048 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 disease.state(p) cell.type(p) k
#> SD:mclust 81 2.21e-04 0.000578 2
#> SD:mclust 81 8.96e-05 0.002797 3
#> SD:mclust 79 8.14e-07 0.000184 4
#> SD:mclust 81 8.96e-05 0.013674 5
#> SD:mclust 73 4.37e-05 0.008239 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 21512 rows and 85 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.855 0.902 0.961 0.5016 0.495 0.495
#> 3 3 1.000 0.954 0.979 0.3435 0.717 0.487
#> 4 4 0.704 0.700 0.832 0.0968 0.931 0.796
#> 5 5 0.701 0.653 0.799 0.0624 0.917 0.713
#> 6 6 0.736 0.618 0.787 0.0366 0.960 0.829
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
#> GSM99497 1 0.8763 0.5643 0.704 0.296
#> GSM99503 1 0.0000 0.9703 1.000 0.000
#> GSM99505 1 0.0000 0.9703 1.000 0.000
#> GSM99507 1 0.1843 0.9475 0.972 0.028
#> GSM99567 2 0.5059 0.8489 0.112 0.888
#> GSM99575 1 0.0000 0.9703 1.000 0.000
#> GSM99593 2 0.0376 0.9412 0.004 0.996
#> GSM99595 1 0.3274 0.9181 0.940 0.060
#> GSM99469 1 0.0000 0.9703 1.000 0.000
#> GSM99499 1 0.0000 0.9703 1.000 0.000
#> GSM99501 1 0.0000 0.9703 1.000 0.000
#> GSM99509 1 0.0000 0.9703 1.000 0.000
#> GSM99569 1 0.0000 0.9703 1.000 0.000
#> GSM99597 1 0.0000 0.9703 1.000 0.000
#> GSM99601 2 0.0000 0.9438 0.000 1.000
#> GSM99459 1 0.0000 0.9703 1.000 0.000
#> GSM99461 1 0.0000 0.9703 1.000 0.000
#> GSM99511 1 0.9881 0.1869 0.564 0.436
#> GSM99513 2 0.6048 0.8092 0.148 0.852
#> GSM99515 1 0.0000 0.9703 1.000 0.000
#> GSM99517 1 0.0000 0.9703 1.000 0.000
#> GSM99519 1 0.0000 0.9703 1.000 0.000
#> GSM99521 1 0.5294 0.8509 0.880 0.120
#> GSM99523 1 0.0000 0.9703 1.000 0.000
#> GSM99571 1 0.0000 0.9703 1.000 0.000
#> GSM99599 1 0.0000 0.9703 1.000 0.000
#> GSM99433 2 0.0000 0.9438 0.000 1.000
#> GSM99435 2 0.5629 0.8271 0.132 0.868
#> GSM99437 2 0.0000 0.9438 0.000 1.000
#> GSM99439 2 0.0000 0.9438 0.000 1.000
#> GSM99441 1 0.0000 0.9703 1.000 0.000
#> GSM99443 2 0.0000 0.9438 0.000 1.000
#> GSM99445 2 0.0000 0.9438 0.000 1.000
#> GSM99447 2 0.0000 0.9438 0.000 1.000
#> GSM99449 2 0.0000 0.9438 0.000 1.000
#> GSM99451 1 0.0000 0.9703 1.000 0.000
#> GSM99453 1 0.0000 0.9703 1.000 0.000
#> GSM99455 1 0.0000 0.9703 1.000 0.000
#> GSM99457 1 0.0000 0.9703 1.000 0.000
#> GSM99463 2 0.0000 0.9438 0.000 1.000
#> GSM99465 1 0.0000 0.9703 1.000 0.000
#> GSM99467 2 0.0000 0.9438 0.000 1.000
#> GSM99471 1 0.0000 0.9703 1.000 0.000
#> GSM99473 1 0.0000 0.9703 1.000 0.000
#> GSM99475 1 0.3584 0.9098 0.932 0.068
#> GSM99477 2 0.0000 0.9438 0.000 1.000
#> GSM99479 2 0.0000 0.9438 0.000 1.000
#> GSM99481 1 0.0000 0.9703 1.000 0.000
#> GSM99483 1 0.0000 0.9703 1.000 0.000
#> GSM99485 2 0.0000 0.9438 0.000 1.000
#> GSM99487 2 0.0000 0.9438 0.000 1.000
#> GSM99489 2 0.0000 0.9438 0.000 1.000
#> GSM99491 2 0.0000 0.9438 0.000 1.000
#> GSM99493 1 0.0000 0.9703 1.000 0.000
#> GSM99495 2 0.0000 0.9438 0.000 1.000
#> GSM99525 1 0.0000 0.9703 1.000 0.000
#> GSM99527 2 0.9795 0.3166 0.416 0.584
#> GSM99529 2 0.0672 0.9386 0.008 0.992
#> GSM99531 1 0.0000 0.9703 1.000 0.000
#> GSM99533 1 0.0000 0.9703 1.000 0.000
#> GSM99535 2 0.2423 0.9141 0.040 0.960
#> GSM99537 1 0.0000 0.9703 1.000 0.000
#> GSM99539 2 0.0000 0.9438 0.000 1.000
#> GSM99541 1 0.0000 0.9703 1.000 0.000
#> GSM99543 2 0.0000 0.9438 0.000 1.000
#> GSM99545 2 0.0000 0.9438 0.000 1.000
#> GSM99547 1 0.6712 0.7751 0.824 0.176
#> GSM99549 2 0.0000 0.9438 0.000 1.000
#> GSM99551 1 0.0000 0.9703 1.000 0.000
#> GSM99553 2 0.9933 0.2072 0.452 0.548
#> GSM99555 2 0.0000 0.9438 0.000 1.000
#> GSM99557 2 0.0000 0.9438 0.000 1.000
#> GSM99559 2 0.0000 0.9438 0.000 1.000
#> GSM99561 2 0.0000 0.9438 0.000 1.000
#> GSM99563 1 0.0376 0.9672 0.996 0.004
#> GSM99565 2 0.0000 0.9438 0.000 1.000
#> GSM99573 2 0.0000 0.9438 0.000 1.000
#> GSM99577 1 0.0000 0.9703 1.000 0.000
#> GSM99579 2 0.0000 0.9438 0.000 1.000
#> GSM99581 2 0.9209 0.5112 0.336 0.664
#> GSM99583 2 1.0000 0.0423 0.496 0.504
#> GSM99585 2 0.0000 0.9438 0.000 1.000
#> GSM99587 1 0.0000 0.9703 1.000 0.000
#> GSM99589 2 0.0000 0.9438 0.000 1.000
#> GSM99591 2 0.0000 0.9438 0.000 1.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM99497 3 0.0000 0.966 0.000 0.000 1.000
#> GSM99503 1 0.0000 0.982 1.000 0.000 0.000
#> GSM99505 3 0.5882 0.462 0.348 0.000 0.652
#> GSM99507 3 0.0000 0.966 0.000 0.000 1.000
#> GSM99567 3 0.0000 0.966 0.000 0.000 1.000
#> GSM99575 1 0.0000 0.982 1.000 0.000 0.000
#> GSM99593 3 0.0000 0.966 0.000 0.000 1.000
#> GSM99595 3 0.0000 0.966 0.000 0.000 1.000
#> GSM99469 1 0.0000 0.982 1.000 0.000 0.000
#> GSM99499 1 0.0747 0.969 0.984 0.000 0.016
#> GSM99501 1 0.0424 0.976 0.992 0.000 0.008
#> GSM99509 3 0.0000 0.966 0.000 0.000 1.000
#> GSM99569 3 0.0000 0.966 0.000 0.000 1.000
#> GSM99597 3 0.0000 0.966 0.000 0.000 1.000
#> GSM99601 2 0.0000 0.990 0.000 1.000 0.000
#> GSM99459 1 0.0000 0.982 1.000 0.000 0.000
#> GSM99461 1 0.0237 0.979 0.996 0.000 0.004
#> GSM99511 3 0.0000 0.966 0.000 0.000 1.000
#> GSM99513 3 0.0000 0.966 0.000 0.000 1.000
#> GSM99515 3 0.0000 0.966 0.000 0.000 1.000
#> GSM99517 1 0.0000 0.982 1.000 0.000 0.000
#> GSM99519 1 0.0000 0.982 1.000 0.000 0.000
#> GSM99521 3 0.0000 0.966 0.000 0.000 1.000
#> GSM99523 3 0.0000 0.966 0.000 0.000 1.000
#> GSM99571 1 0.0000 0.982 1.000 0.000 0.000
#> GSM99599 1 0.0000 0.982 1.000 0.000 0.000
#> GSM99433 2 0.1964 0.944 0.000 0.944 0.056
#> GSM99435 3 0.0000 0.966 0.000 0.000 1.000
#> GSM99437 2 0.0000 0.990 0.000 1.000 0.000
#> GSM99439 2 0.0000 0.990 0.000 1.000 0.000
#> GSM99441 1 0.0000 0.982 1.000 0.000 0.000
#> GSM99443 2 0.0000 0.990 0.000 1.000 0.000
#> GSM99445 2 0.0000 0.990 0.000 1.000 0.000
#> GSM99447 2 0.0000 0.990 0.000 1.000 0.000
#> GSM99449 3 0.0000 0.966 0.000 0.000 1.000
#> GSM99451 3 0.0000 0.966 0.000 0.000 1.000
#> GSM99453 1 0.0000 0.982 1.000 0.000 0.000
#> GSM99455 1 0.0000 0.982 1.000 0.000 0.000
#> GSM99457 1 0.0000 0.982 1.000 0.000 0.000
#> GSM99463 2 0.0000 0.990 0.000 1.000 0.000
#> GSM99465 3 0.0237 0.963 0.004 0.000 0.996
#> GSM99467 2 0.0000 0.990 0.000 1.000 0.000
#> GSM99471 1 0.0000 0.982 1.000 0.000 0.000
#> GSM99473 1 0.0000 0.982 1.000 0.000 0.000
#> GSM99475 3 0.0000 0.966 0.000 0.000 1.000
#> GSM99477 3 0.0424 0.960 0.000 0.008 0.992
#> GSM99479 2 0.1643 0.956 0.000 0.956 0.044
#> GSM99481 1 0.0000 0.982 1.000 0.000 0.000
#> GSM99483 1 0.0000 0.982 1.000 0.000 0.000
#> GSM99485 2 0.0000 0.990 0.000 1.000 0.000
#> GSM99487 2 0.0000 0.990 0.000 1.000 0.000
#> GSM99489 2 0.0000 0.990 0.000 1.000 0.000
#> GSM99491 2 0.0000 0.990 0.000 1.000 0.000
#> GSM99493 1 0.0000 0.982 1.000 0.000 0.000
#> GSM99495 2 0.0000 0.990 0.000 1.000 0.000
#> GSM99525 1 0.0000 0.982 1.000 0.000 0.000
#> GSM99527 3 0.0424 0.960 0.000 0.008 0.992
#> GSM99529 2 0.0892 0.976 0.000 0.980 0.020
#> GSM99531 3 0.0000 0.966 0.000 0.000 1.000
#> GSM99533 3 0.1411 0.936 0.036 0.000 0.964
#> GSM99535 2 0.1163 0.967 0.028 0.972 0.000
#> GSM99537 1 0.0000 0.982 1.000 0.000 0.000
#> GSM99539 3 0.5706 0.522 0.000 0.320 0.680
#> GSM99541 1 0.1964 0.929 0.944 0.000 0.056
#> GSM99543 2 0.0000 0.990 0.000 1.000 0.000
#> GSM99545 2 0.3038 0.889 0.000 0.896 0.104
#> GSM99547 1 0.8790 0.415 0.572 0.160 0.268
#> GSM99549 2 0.0000 0.990 0.000 1.000 0.000
#> GSM99551 1 0.0000 0.982 1.000 0.000 0.000
#> GSM99553 3 0.0000 0.966 0.000 0.000 1.000
#> GSM99555 2 0.0000 0.990 0.000 1.000 0.000
#> GSM99557 2 0.0000 0.990 0.000 1.000 0.000
#> GSM99559 3 0.0000 0.966 0.000 0.000 1.000
#> GSM99561 2 0.0000 0.990 0.000 1.000 0.000
#> GSM99563 3 0.0000 0.966 0.000 0.000 1.000
#> GSM99565 2 0.0000 0.990 0.000 1.000 0.000
#> GSM99573 2 0.0000 0.990 0.000 1.000 0.000
#> GSM99577 1 0.0000 0.982 1.000 0.000 0.000
#> GSM99579 2 0.0000 0.990 0.000 1.000 0.000
#> GSM99581 3 0.0000 0.966 0.000 0.000 1.000
#> GSM99583 3 0.6148 0.754 0.148 0.076 0.776
#> GSM99585 2 0.1289 0.966 0.000 0.968 0.032
#> GSM99587 1 0.0000 0.982 1.000 0.000 0.000
#> GSM99589 2 0.0000 0.990 0.000 1.000 0.000
#> GSM99591 2 0.0000 0.990 0.000 1.000 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM99497 3 0.1474 0.7811 0.000 0.000 0.948 0.052
#> GSM99503 1 0.0376 0.9601 0.992 0.000 0.004 0.004
#> GSM99505 3 0.4905 0.3132 0.364 0.000 0.632 0.004
#> GSM99507 3 0.0592 0.7910 0.000 0.000 0.984 0.016
#> GSM99567 3 0.1118 0.7948 0.000 0.000 0.964 0.036
#> GSM99575 1 0.0376 0.9601 0.992 0.000 0.004 0.004
#> GSM99593 3 0.1940 0.7965 0.000 0.000 0.924 0.076
#> GSM99595 3 0.2530 0.7860 0.000 0.000 0.888 0.112
#> GSM99469 1 0.0000 0.9607 1.000 0.000 0.000 0.000
#> GSM99499 1 0.3706 0.7906 0.848 0.000 0.112 0.040
#> GSM99501 1 0.0188 0.9605 0.996 0.000 0.004 0.000
#> GSM99509 3 0.2149 0.7905 0.000 0.000 0.912 0.088
#> GSM99569 3 0.0817 0.7920 0.000 0.000 0.976 0.024
#> GSM99597 3 0.3172 0.7724 0.000 0.000 0.840 0.160
#> GSM99601 2 0.2704 0.7578 0.000 0.876 0.000 0.124
#> GSM99459 1 0.0188 0.9604 0.996 0.000 0.000 0.004
#> GSM99461 1 0.1389 0.9278 0.952 0.000 0.000 0.048
#> GSM99511 3 0.4222 0.7255 0.000 0.000 0.728 0.272
#> GSM99513 3 0.3975 0.7355 0.000 0.000 0.760 0.240
#> GSM99515 3 0.1557 0.7784 0.000 0.000 0.944 0.056
#> GSM99517 1 0.0376 0.9601 0.992 0.000 0.004 0.004
#> GSM99519 1 0.0336 0.9598 0.992 0.000 0.000 0.008
#> GSM99521 3 0.2647 0.7868 0.000 0.000 0.880 0.120
#> GSM99523 3 0.3024 0.7588 0.000 0.000 0.852 0.148
#> GSM99571 1 0.0524 0.9606 0.988 0.000 0.004 0.008
#> GSM99599 1 0.0376 0.9601 0.992 0.000 0.004 0.004
#> GSM99433 2 0.6650 0.2055 0.000 0.484 0.084 0.432
#> GSM99435 3 0.4250 0.7279 0.000 0.000 0.724 0.276
#> GSM99437 2 0.2281 0.7556 0.000 0.904 0.000 0.096
#> GSM99439 2 0.4697 0.4997 0.000 0.644 0.000 0.356
#> GSM99441 1 0.0000 0.9607 1.000 0.000 0.000 0.000
#> GSM99443 2 0.1022 0.7803 0.000 0.968 0.000 0.032
#> GSM99445 2 0.0817 0.7816 0.000 0.976 0.000 0.024
#> GSM99447 2 0.4477 0.6365 0.000 0.688 0.000 0.312
#> GSM99449 3 0.2973 0.7705 0.000 0.000 0.856 0.144
#> GSM99451 3 0.4356 0.7188 0.000 0.000 0.708 0.292
#> GSM99453 1 0.1302 0.9390 0.956 0.000 0.000 0.044
#> GSM99455 1 0.0707 0.9550 0.980 0.000 0.000 0.020
#> GSM99457 1 0.1211 0.9418 0.960 0.000 0.000 0.040
#> GSM99463 2 0.3873 0.6760 0.000 0.772 0.000 0.228
#> GSM99465 3 0.5751 0.6615 0.016 0.036 0.684 0.264
#> GSM99467 2 0.3024 0.7194 0.000 0.852 0.000 0.148
#> GSM99471 1 0.0188 0.9603 0.996 0.000 0.000 0.004
#> GSM99473 1 0.3501 0.7742 0.848 0.132 0.000 0.020
#> GSM99475 3 0.4916 0.5274 0.000 0.000 0.576 0.424
#> GSM99477 3 0.7525 0.2965 0.000 0.232 0.492 0.276
#> GSM99479 2 0.3913 0.6968 0.000 0.824 0.028 0.148
#> GSM99481 1 0.0188 0.9604 0.996 0.000 0.000 0.004
#> GSM99483 1 0.0336 0.9594 0.992 0.000 0.000 0.008
#> GSM99485 2 0.0707 0.7803 0.000 0.980 0.000 0.020
#> GSM99487 2 0.2973 0.7271 0.000 0.856 0.000 0.144
#> GSM99489 2 0.2704 0.7535 0.000 0.876 0.000 0.124
#> GSM99491 2 0.0469 0.7783 0.000 0.988 0.000 0.012
#> GSM99493 1 0.0592 0.9570 0.984 0.000 0.000 0.016
#> GSM99495 2 0.4277 0.6215 0.000 0.720 0.000 0.280
#> GSM99525 1 0.0000 0.9607 1.000 0.000 0.000 0.000
#> GSM99527 3 0.5345 0.5977 0.004 0.008 0.584 0.404
#> GSM99529 2 0.4398 0.6709 0.004 0.820 0.072 0.104
#> GSM99531 4 0.5143 -0.3119 0.004 0.000 0.456 0.540
#> GSM99533 3 0.5606 0.3229 0.020 0.000 0.500 0.480
#> GSM99535 2 0.3421 0.7297 0.088 0.868 0.000 0.044
#> GSM99537 1 0.0336 0.9594 0.992 0.000 0.000 0.008
#> GSM99539 3 0.6308 0.5832 0.000 0.136 0.656 0.208
#> GSM99541 1 0.3996 0.7563 0.836 0.000 0.104 0.060
#> GSM99543 2 0.4040 0.6573 0.000 0.752 0.000 0.248
#> GSM99545 4 0.5512 0.3622 0.000 0.172 0.100 0.728
#> GSM99547 4 0.8571 0.2431 0.328 0.044 0.200 0.428
#> GSM99549 4 0.4961 -0.1091 0.000 0.448 0.000 0.552
#> GSM99551 4 0.5395 0.3560 0.352 0.016 0.004 0.628
#> GSM99553 3 0.2216 0.7767 0.000 0.000 0.908 0.092
#> GSM99555 2 0.2530 0.7716 0.000 0.888 0.000 0.112
#> GSM99557 2 0.2760 0.7514 0.000 0.872 0.000 0.128
#> GSM99559 3 0.1940 0.7736 0.000 0.000 0.924 0.076
#> GSM99561 2 0.4804 0.4442 0.000 0.616 0.000 0.384
#> GSM99563 3 0.2704 0.7897 0.000 0.000 0.876 0.124
#> GSM99565 2 0.2149 0.7631 0.000 0.912 0.000 0.088
#> GSM99573 4 0.4998 -0.2232 0.000 0.488 0.000 0.512
#> GSM99577 4 0.6358 0.1579 0.440 0.008 0.044 0.508
#> GSM99579 2 0.0921 0.7758 0.000 0.972 0.000 0.028
#> GSM99581 3 0.1867 0.7853 0.000 0.000 0.928 0.072
#> GSM99583 2 0.9306 -0.0439 0.128 0.380 0.332 0.160
#> GSM99585 2 0.4422 0.6053 0.000 0.736 0.008 0.256
#> GSM99587 1 0.0921 0.9511 0.972 0.000 0.000 0.028
#> GSM99589 2 0.1302 0.7785 0.000 0.956 0.000 0.044
#> GSM99591 2 0.0707 0.7805 0.000 0.980 0.000 0.020
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM99497 3 0.1697 8.31e-01 0.000 0.000 0.932 0.060 0.008
#> GSM99503 1 0.0000 9.23e-01 1.000 0.000 0.000 0.000 0.000
#> GSM99505 3 0.2930 6.71e-01 0.164 0.000 0.832 0.000 0.004
#> GSM99507 3 0.1704 8.30e-01 0.000 0.000 0.928 0.068 0.004
#> GSM99567 3 0.0566 8.31e-01 0.000 0.000 0.984 0.012 0.004
#> GSM99575 1 0.0162 9.23e-01 0.996 0.000 0.004 0.000 0.000
#> GSM99593 3 0.1300 8.33e-01 0.000 0.000 0.956 0.028 0.016
#> GSM99595 3 0.2438 8.25e-01 0.000 0.000 0.900 0.060 0.040
#> GSM99469 1 0.0290 9.22e-01 0.992 0.000 0.000 0.008 0.000
#> GSM99499 1 0.6253 2.94e-01 0.552 0.000 0.340 0.068 0.040
#> GSM99501 1 0.1369 9.09e-01 0.956 0.000 0.008 0.028 0.008
#> GSM99509 3 0.2879 7.99e-01 0.000 0.000 0.868 0.100 0.032
#> GSM99569 3 0.3209 7.47e-01 0.000 0.000 0.812 0.180 0.008
#> GSM99597 3 0.6036 3.48e-01 0.000 0.000 0.548 0.308 0.144
#> GSM99601 2 0.1952 7.43e-01 0.000 0.912 0.000 0.004 0.084
#> GSM99459 1 0.0162 9.23e-01 0.996 0.000 0.000 0.004 0.000
#> GSM99461 1 0.2329 8.32e-01 0.876 0.000 0.000 0.124 0.000
#> GSM99511 3 0.4409 6.87e-01 0.000 0.000 0.752 0.176 0.072
#> GSM99513 3 0.3644 7.79e-01 0.000 0.000 0.824 0.096 0.080
#> GSM99515 3 0.0404 8.30e-01 0.000 0.000 0.988 0.000 0.012
#> GSM99517 1 0.0000 9.23e-01 1.000 0.000 0.000 0.000 0.000
#> GSM99519 1 0.1197 9.06e-01 0.952 0.000 0.000 0.048 0.000
#> GSM99521 3 0.5470 4.60e-01 0.000 0.000 0.612 0.296 0.092
#> GSM99523 3 0.2408 8.06e-01 0.000 0.000 0.892 0.092 0.016
#> GSM99571 1 0.0162 9.23e-01 0.996 0.000 0.004 0.000 0.000
#> GSM99599 1 0.0000 9.23e-01 1.000 0.000 0.000 0.000 0.000
#> GSM99433 5 0.6642 4.17e-02 0.000 0.168 0.008 0.408 0.416
#> GSM99435 4 0.6024 4.88e-01 0.000 0.000 0.288 0.560 0.152
#> GSM99437 2 0.2628 7.23e-01 0.000 0.884 0.000 0.088 0.028
#> GSM99439 5 0.4557 5.31e-05 0.000 0.476 0.000 0.008 0.516
#> GSM99441 1 0.0000 9.23e-01 1.000 0.000 0.000 0.000 0.000
#> GSM99443 2 0.0992 7.55e-01 0.000 0.968 0.000 0.008 0.024
#> GSM99445 2 0.0955 7.54e-01 0.000 0.968 0.000 0.004 0.028
#> GSM99447 2 0.6122 1.38e-01 0.000 0.512 0.000 0.140 0.348
#> GSM99449 3 0.2818 7.73e-01 0.000 0.000 0.856 0.132 0.012
#> GSM99451 4 0.5887 5.70e-01 0.000 0.000 0.240 0.596 0.164
#> GSM99453 1 0.1942 8.93e-01 0.920 0.000 0.012 0.000 0.068
#> GSM99455 1 0.1251 9.12e-01 0.956 0.000 0.008 0.000 0.036
#> GSM99457 1 0.2879 8.37e-01 0.868 0.000 0.000 0.032 0.100
#> GSM99463 2 0.4306 4.56e-01 0.000 0.660 0.000 0.012 0.328
#> GSM99465 4 0.4007 5.19e-01 0.004 0.044 0.128 0.812 0.012
#> GSM99467 2 0.3427 6.93e-01 0.000 0.844 0.004 0.096 0.056
#> GSM99471 1 0.0000 9.23e-01 1.000 0.000 0.000 0.000 0.000
#> GSM99473 1 0.2748 8.21e-01 0.880 0.096 0.000 0.008 0.016
#> GSM99475 4 0.6050 5.45e-01 0.000 0.000 0.144 0.544 0.312
#> GSM99477 4 0.6985 1.72e-01 0.000 0.344 0.132 0.480 0.044
#> GSM99479 2 0.4403 6.40e-01 0.000 0.776 0.012 0.148 0.064
#> GSM99481 1 0.0000 9.23e-01 1.000 0.000 0.000 0.000 0.000
#> GSM99483 1 0.0671 9.20e-01 0.980 0.000 0.004 0.000 0.016
#> GSM99485 2 0.1579 7.55e-01 0.000 0.944 0.000 0.024 0.032
#> GSM99487 2 0.3242 7.05e-01 0.000 0.844 0.000 0.116 0.040
#> GSM99489 2 0.2773 6.94e-01 0.000 0.836 0.000 0.000 0.164
#> GSM99491 2 0.2300 7.37e-01 0.000 0.904 0.000 0.072 0.024
#> GSM99493 1 0.0771 9.19e-01 0.976 0.000 0.000 0.004 0.020
#> GSM99495 2 0.4425 3.01e-01 0.000 0.600 0.000 0.008 0.392
#> GSM99525 1 0.0000 9.23e-01 1.000 0.000 0.000 0.000 0.000
#> GSM99527 4 0.5272 5.58e-01 0.000 0.004 0.104 0.680 0.212
#> GSM99529 4 0.6770 1.20e-01 0.000 0.356 0.056 0.500 0.088
#> GSM99531 4 0.6162 4.02e-01 0.000 0.000 0.132 0.436 0.432
#> GSM99533 4 0.5724 5.28e-01 0.000 0.000 0.112 0.584 0.304
#> GSM99535 2 0.4032 6.81e-01 0.088 0.820 0.000 0.024 0.068
#> GSM99537 1 0.1117 9.13e-01 0.964 0.000 0.000 0.016 0.020
#> GSM99539 4 0.5979 5.46e-01 0.000 0.024 0.116 0.636 0.224
#> GSM99541 1 0.6308 2.38e-01 0.548 0.000 0.028 0.332 0.092
#> GSM99543 2 0.4183 4.70e-01 0.000 0.668 0.000 0.008 0.324
#> GSM99545 5 0.4777 1.92e-01 0.000 0.040 0.012 0.240 0.708
#> GSM99547 4 0.8516 2.53e-01 0.084 0.032 0.256 0.400 0.228
#> GSM99549 5 0.3690 5.24e-01 0.000 0.224 0.000 0.012 0.764
#> GSM99551 5 0.5084 2.38e-01 0.144 0.004 0.000 0.140 0.712
#> GSM99553 3 0.2913 7.90e-01 0.000 0.004 0.876 0.080 0.040
#> GSM99555 2 0.3496 7.12e-01 0.000 0.832 0.004 0.040 0.124
#> GSM99557 2 0.2329 7.24e-01 0.000 0.876 0.000 0.000 0.124
#> GSM99559 3 0.0912 8.32e-01 0.000 0.000 0.972 0.016 0.012
#> GSM99561 5 0.5420 2.38e-01 0.000 0.416 0.000 0.060 0.524
#> GSM99563 3 0.2189 8.10e-01 0.000 0.000 0.904 0.084 0.012
#> GSM99565 2 0.2927 7.26e-01 0.000 0.868 0.000 0.092 0.040
#> GSM99573 5 0.3949 4.52e-01 0.000 0.300 0.004 0.000 0.696
#> GSM99577 5 0.5112 1.79e-01 0.256 0.000 0.000 0.080 0.664
#> GSM99579 2 0.2144 7.40e-01 0.000 0.912 0.000 0.068 0.020
#> GSM99581 3 0.3381 7.50e-01 0.000 0.000 0.808 0.176 0.016
#> GSM99583 2 0.7648 2.36e-01 0.036 0.516 0.268 0.128 0.052
#> GSM99585 2 0.5441 3.66e-01 0.000 0.572 0.020 0.376 0.032
#> GSM99587 1 0.1638 8.99e-01 0.932 0.000 0.000 0.004 0.064
#> GSM99589 2 0.2462 7.31e-01 0.000 0.880 0.000 0.008 0.112
#> GSM99591 2 0.0798 7.55e-01 0.000 0.976 0.000 0.008 0.016
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM99497 3 0.2527 0.7346 0.000 0.000 0.832 0.000 0.000 0.168
#> GSM99503 1 0.0000 0.8959 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99505 3 0.2182 0.7391 0.076 0.000 0.900 0.000 0.004 0.020
#> GSM99507 3 0.2520 0.7426 0.000 0.000 0.844 0.004 0.000 0.152
#> GSM99567 3 0.0717 0.7728 0.000 0.000 0.976 0.000 0.016 0.008
#> GSM99575 1 0.0405 0.8958 0.988 0.000 0.004 0.000 0.000 0.008
#> GSM99593 3 0.1408 0.7732 0.000 0.000 0.944 0.020 0.000 0.036
#> GSM99595 3 0.2056 0.7697 0.000 0.000 0.904 0.004 0.012 0.080
#> GSM99469 1 0.3409 0.7294 0.780 0.000 0.028 0.000 0.000 0.192
#> GSM99499 3 0.5962 0.0864 0.248 0.000 0.488 0.000 0.004 0.260
#> GSM99501 1 0.4827 0.4814 0.632 0.000 0.092 0.000 0.000 0.276
#> GSM99509 3 0.2669 0.7381 0.000 0.000 0.836 0.008 0.000 0.156
#> GSM99569 3 0.3601 0.5499 0.000 0.000 0.684 0.004 0.000 0.312
#> GSM99597 6 0.4365 0.2723 0.000 0.000 0.332 0.024 0.008 0.636
#> GSM99601 2 0.1901 0.7152 0.000 0.912 0.000 0.004 0.076 0.008
#> GSM99459 1 0.1194 0.8873 0.956 0.000 0.000 0.032 0.004 0.008
#> GSM99461 1 0.4468 0.4364 0.612 0.000 0.000 0.356 0.016 0.016
#> GSM99511 3 0.4447 0.6549 0.000 0.000 0.764 0.080 0.052 0.104
#> GSM99513 3 0.3634 0.7113 0.000 0.000 0.820 0.028 0.060 0.092
#> GSM99515 3 0.0891 0.7732 0.000 0.000 0.968 0.000 0.008 0.024
#> GSM99517 1 0.0146 0.8960 0.996 0.000 0.000 0.000 0.000 0.004
#> GSM99519 1 0.1429 0.8808 0.940 0.000 0.000 0.052 0.004 0.004
#> GSM99521 3 0.5824 0.1170 0.000 0.000 0.516 0.112 0.024 0.348
#> GSM99523 3 0.3099 0.7233 0.000 0.000 0.848 0.044 0.012 0.096
#> GSM99571 1 0.0146 0.8964 0.996 0.000 0.004 0.000 0.000 0.000
#> GSM99599 1 0.0000 0.8959 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99433 4 0.3492 0.6392 0.000 0.028 0.004 0.816 0.136 0.016
#> GSM99435 4 0.3098 0.6397 0.000 0.000 0.056 0.860 0.052 0.032
#> GSM99437 2 0.3616 0.6778 0.000 0.824 0.000 0.048 0.088 0.040
#> GSM99439 5 0.4070 0.0651 0.000 0.424 0.000 0.004 0.568 0.004
#> GSM99441 1 0.0146 0.8961 0.996 0.000 0.000 0.000 0.000 0.004
#> GSM99443 2 0.2113 0.7176 0.000 0.908 0.000 0.004 0.060 0.028
#> GSM99445 2 0.1700 0.7200 0.000 0.928 0.000 0.000 0.048 0.024
#> GSM99447 2 0.6601 -0.1374 0.000 0.348 0.000 0.336 0.292 0.024
#> GSM99449 3 0.3652 0.6934 0.000 0.000 0.808 0.056 0.016 0.120
#> GSM99451 4 0.2113 0.6513 0.000 0.000 0.032 0.912 0.048 0.008
#> GSM99453 1 0.1668 0.8757 0.928 0.000 0.004 0.000 0.060 0.008
#> GSM99455 1 0.0692 0.8948 0.976 0.000 0.000 0.000 0.020 0.004
#> GSM99457 1 0.3814 0.7726 0.808 0.000 0.000 0.096 0.064 0.032
#> GSM99463 2 0.3927 0.4617 0.000 0.644 0.000 0.000 0.344 0.012
#> GSM99465 4 0.3334 0.6194 0.008 0.004 0.012 0.844 0.032 0.100
#> GSM99467 2 0.3850 0.6577 0.000 0.792 0.000 0.016 0.064 0.128
#> GSM99471 1 0.0653 0.8944 0.980 0.012 0.000 0.000 0.004 0.004
#> GSM99473 1 0.1615 0.8575 0.928 0.064 0.000 0.000 0.004 0.004
#> GSM99475 4 0.4478 0.5735 0.000 0.000 0.028 0.744 0.152 0.076
#> GSM99477 4 0.7219 0.3118 0.000 0.260 0.044 0.496 0.084 0.116
#> GSM99479 2 0.4383 0.5702 0.000 0.700 0.004 0.016 0.028 0.252
#> GSM99481 1 0.0000 0.8959 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99483 1 0.0291 0.8961 0.992 0.000 0.000 0.000 0.004 0.004
#> GSM99485 2 0.1863 0.7210 0.000 0.920 0.000 0.000 0.036 0.044
#> GSM99487 2 0.5025 0.5971 0.000 0.720 0.000 0.096 0.096 0.088
#> GSM99489 2 0.3309 0.6625 0.000 0.800 0.000 0.004 0.172 0.024
#> GSM99491 2 0.2201 0.7128 0.000 0.896 0.000 0.000 0.028 0.076
#> GSM99493 1 0.1555 0.8821 0.940 0.000 0.000 0.008 0.012 0.040
#> GSM99495 2 0.4039 0.2680 0.000 0.568 0.000 0.000 0.424 0.008
#> GSM99525 1 0.0291 0.8961 0.992 0.000 0.000 0.000 0.004 0.004
#> GSM99527 4 0.1963 0.6580 0.000 0.004 0.012 0.924 0.044 0.016
#> GSM99529 6 0.4681 0.4286 0.000 0.168 0.044 0.044 0.008 0.736
#> GSM99531 6 0.6619 0.2385 0.000 0.004 0.072 0.260 0.148 0.516
#> GSM99533 4 0.5323 0.4576 0.000 0.000 0.024 0.648 0.124 0.204
#> GSM99535 2 0.5183 0.5500 0.148 0.692 0.000 0.004 0.124 0.032
#> GSM99537 1 0.1350 0.8878 0.952 0.000 0.000 0.020 0.008 0.020
#> GSM99539 4 0.5385 0.3387 0.000 0.008 0.036 0.612 0.048 0.296
#> GSM99541 1 0.6542 0.1971 0.488 0.000 0.008 0.240 0.028 0.236
#> GSM99543 2 0.4308 0.5134 0.000 0.676 0.000 0.004 0.280 0.040
#> GSM99545 4 0.4958 0.2306 0.000 0.016 0.008 0.492 0.464 0.020
#> GSM99547 4 0.6057 0.5507 0.024 0.020 0.028 0.656 0.152 0.120
#> GSM99549 5 0.3669 0.5366 0.000 0.140 0.000 0.044 0.800 0.016
#> GSM99551 5 0.6288 0.1445 0.080 0.012 0.000 0.248 0.576 0.084
#> GSM99553 3 0.2869 0.7406 0.000 0.000 0.832 0.000 0.020 0.148
#> GSM99555 2 0.3959 0.6494 0.000 0.760 0.000 0.004 0.172 0.064
#> GSM99557 2 0.2968 0.6599 0.000 0.816 0.000 0.000 0.168 0.016
#> GSM99559 3 0.2288 0.7597 0.000 0.004 0.876 0.000 0.004 0.116
#> GSM99561 5 0.6462 0.2742 0.000 0.372 0.000 0.056 0.440 0.132
#> GSM99563 3 0.3565 0.7008 0.000 0.000 0.816 0.056 0.016 0.112
#> GSM99565 2 0.4439 0.6537 0.000 0.772 0.004 0.052 0.100 0.072
#> GSM99573 5 0.3231 0.5342 0.000 0.200 0.000 0.016 0.784 0.000
#> GSM99577 5 0.7299 0.0833 0.212 0.004 0.024 0.088 0.496 0.176
#> GSM99579 2 0.2633 0.7004 0.000 0.864 0.000 0.004 0.020 0.112
#> GSM99581 3 0.3264 0.7457 0.000 0.000 0.820 0.040 0.004 0.136
#> GSM99583 2 0.6819 0.3148 0.032 0.544 0.172 0.008 0.032 0.212
#> GSM99585 4 0.6747 0.3617 0.000 0.256 0.012 0.524 0.088 0.120
#> GSM99587 1 0.2606 0.8492 0.888 0.000 0.000 0.020 0.048 0.044
#> GSM99589 2 0.2905 0.6843 0.000 0.836 0.008 0.000 0.144 0.012
#> GSM99591 2 0.1642 0.7221 0.000 0.936 0.000 0.004 0.032 0.028
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 disease.state(p) cell.type(p) k
#> SD:NMF 81 0.000494 0.00254 2
#> SD:NMF 83 0.000507 0.00764 3
#> SD:NMF 71 0.000686 0.00989 4
#> SD:NMF 63 0.000460 0.01625 5
#> SD:NMF 64 0.000207 0.01155 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 21512 rows and 85 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 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.445 0.852 0.898 0.4203 0.580 0.580
#> 3 3 0.565 0.767 0.882 0.5420 0.734 0.549
#> 4 4 0.582 0.611 0.823 0.0777 0.974 0.924
#> 5 5 0.564 0.523 0.772 0.0590 0.915 0.752
#> 6 6 0.620 0.621 0.787 0.0395 0.962 0.865
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
#> GSM99497 2 0.6531 0.8758 0.168 0.832
#> GSM99503 1 0.0000 0.9263 1.000 0.000
#> GSM99505 1 0.4298 0.8855 0.912 0.088
#> GSM99507 2 0.6531 0.8758 0.168 0.832
#> GSM99567 2 0.6531 0.8758 0.168 0.832
#> GSM99575 1 0.0000 0.9263 1.000 0.000
#> GSM99593 2 0.6531 0.8758 0.168 0.832
#> GSM99595 2 0.6531 0.8758 0.168 0.832
#> GSM99469 1 0.3114 0.9069 0.944 0.056
#> GSM99499 1 0.4298 0.8855 0.912 0.088
#> GSM99501 1 0.3114 0.9069 0.944 0.056
#> GSM99509 2 0.7139 0.8591 0.196 0.804
#> GSM99569 2 0.6801 0.8702 0.180 0.820
#> GSM99597 2 0.7219 0.8558 0.200 0.800
#> GSM99601 2 0.0000 0.8668 0.000 1.000
#> GSM99459 2 1.0000 0.2427 0.496 0.504
#> GSM99461 2 0.9580 0.5830 0.380 0.620
#> GSM99511 2 0.6712 0.8721 0.176 0.824
#> GSM99513 2 0.6712 0.8721 0.176 0.824
#> GSM99515 2 0.6623 0.8741 0.172 0.828
#> GSM99517 1 0.0000 0.9263 1.000 0.000
#> GSM99519 1 0.9833 0.0459 0.576 0.424
#> GSM99521 2 0.6438 0.8772 0.164 0.836
#> GSM99523 2 0.6801 0.8702 0.180 0.820
#> GSM99571 1 0.0000 0.9263 1.000 0.000
#> GSM99599 1 0.0000 0.9263 1.000 0.000
#> GSM99433 2 0.2603 0.8818 0.044 0.956
#> GSM99435 2 0.6712 0.8721 0.176 0.824
#> GSM99437 2 0.1184 0.8736 0.016 0.984
#> GSM99439 2 0.0000 0.8668 0.000 1.000
#> GSM99441 1 0.0000 0.9263 1.000 0.000
#> GSM99443 2 0.0000 0.8668 0.000 1.000
#> GSM99445 2 0.0000 0.8668 0.000 1.000
#> GSM99447 2 0.0938 0.8721 0.012 0.988
#> GSM99449 2 0.5737 0.8835 0.136 0.864
#> GSM99451 2 0.6801 0.8703 0.180 0.820
#> GSM99453 1 0.0000 0.9263 1.000 0.000
#> GSM99455 1 0.0000 0.9263 1.000 0.000
#> GSM99457 1 0.0000 0.9263 1.000 0.000
#> GSM99463 2 0.0000 0.8668 0.000 1.000
#> GSM99465 2 0.9209 0.6721 0.336 0.664
#> GSM99467 2 0.4161 0.8859 0.084 0.916
#> GSM99471 1 0.5842 0.8258 0.860 0.140
#> GSM99473 1 0.7376 0.7033 0.792 0.208
#> GSM99475 2 0.6973 0.8655 0.188 0.812
#> GSM99477 2 0.4161 0.8863 0.084 0.916
#> GSM99479 2 0.4161 0.8863 0.084 0.916
#> GSM99481 1 0.0000 0.9263 1.000 0.000
#> GSM99483 1 0.0000 0.9263 1.000 0.000
#> GSM99485 2 0.4562 0.8693 0.096 0.904
#> GSM99487 2 0.1184 0.8736 0.016 0.984
#> GSM99489 2 0.0000 0.8668 0.000 1.000
#> GSM99491 2 0.0000 0.8668 0.000 1.000
#> GSM99493 1 0.0000 0.9263 1.000 0.000
#> GSM99495 2 0.0000 0.8668 0.000 1.000
#> GSM99525 1 0.4690 0.8704 0.900 0.100
#> GSM99527 2 0.7674 0.8337 0.224 0.776
#> GSM99529 2 0.4562 0.8853 0.096 0.904
#> GSM99531 2 0.8813 0.7363 0.300 0.700
#> GSM99533 2 0.6973 0.8655 0.188 0.812
#> GSM99535 2 0.8713 0.6756 0.292 0.708
#> GSM99537 1 0.0000 0.9263 1.000 0.000
#> GSM99539 2 0.2603 0.8821 0.044 0.956
#> GSM99541 1 0.3879 0.8937 0.924 0.076
#> GSM99543 2 0.1414 0.8658 0.020 0.980
#> GSM99545 2 0.5178 0.8865 0.116 0.884
#> GSM99547 2 0.8443 0.7806 0.272 0.728
#> GSM99549 2 0.0000 0.8668 0.000 1.000
#> GSM99551 1 0.5408 0.8459 0.876 0.124
#> GSM99553 2 0.6343 0.8797 0.160 0.840
#> GSM99555 2 0.0000 0.8668 0.000 1.000
#> GSM99557 2 0.0000 0.8668 0.000 1.000
#> GSM99559 2 0.5737 0.8835 0.136 0.864
#> GSM99561 2 0.1633 0.8766 0.024 0.976
#> GSM99563 2 0.6712 0.8721 0.176 0.824
#> GSM99565 2 0.0000 0.8668 0.000 1.000
#> GSM99573 2 0.0000 0.8668 0.000 1.000
#> GSM99577 1 0.3879 0.8937 0.924 0.076
#> GSM99579 2 0.1633 0.8763 0.024 0.976
#> GSM99581 2 0.6623 0.8741 0.172 0.828
#> GSM99583 2 0.6973 0.8445 0.188 0.812
#> GSM99585 2 0.4562 0.8879 0.096 0.904
#> GSM99587 1 0.0000 0.9263 1.000 0.000
#> GSM99589 2 0.3431 0.8840 0.064 0.936
#> GSM99591 2 0.0000 0.8668 0.000 1.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM99497 3 0.0424 0.8521 0.000 0.008 0.992
#> GSM99503 1 0.0237 0.9331 0.996 0.000 0.004
#> GSM99505 1 0.3267 0.8856 0.884 0.000 0.116
#> GSM99507 3 0.0424 0.8521 0.000 0.008 0.992
#> GSM99567 3 0.0424 0.8521 0.000 0.008 0.992
#> GSM99575 1 0.0237 0.9331 0.996 0.000 0.004
#> GSM99593 3 0.0424 0.8521 0.000 0.008 0.992
#> GSM99595 3 0.0424 0.8521 0.000 0.008 0.992
#> GSM99469 1 0.2537 0.9083 0.920 0.000 0.080
#> GSM99499 1 0.3267 0.8856 0.884 0.000 0.116
#> GSM99501 1 0.2537 0.9083 0.920 0.000 0.080
#> GSM99509 3 0.0892 0.8498 0.020 0.000 0.980
#> GSM99569 3 0.0237 0.8530 0.004 0.000 0.996
#> GSM99597 3 0.1031 0.8479 0.024 0.000 0.976
#> GSM99601 2 0.2165 0.8232 0.000 0.936 0.064
#> GSM99459 3 0.5905 0.4479 0.352 0.000 0.648
#> GSM99461 3 0.4887 0.6789 0.228 0.000 0.772
#> GSM99511 3 0.0000 0.8521 0.000 0.000 1.000
#> GSM99513 3 0.0000 0.8521 0.000 0.000 1.000
#> GSM99515 3 0.0237 0.8523 0.000 0.004 0.996
#> GSM99517 1 0.0237 0.9331 0.996 0.000 0.004
#> GSM99519 3 0.6244 0.2144 0.440 0.000 0.560
#> GSM99521 3 0.0747 0.8497 0.000 0.016 0.984
#> GSM99523 3 0.0237 0.8530 0.004 0.000 0.996
#> GSM99571 1 0.0237 0.9331 0.996 0.000 0.004
#> GSM99599 1 0.0237 0.9331 0.996 0.000 0.004
#> GSM99433 2 0.6126 0.5187 0.000 0.600 0.400
#> GSM99435 3 0.0000 0.8521 0.000 0.000 1.000
#> GSM99437 2 0.5178 0.7254 0.000 0.744 0.256
#> GSM99439 2 0.0424 0.8107 0.000 0.992 0.008
#> GSM99441 1 0.0747 0.9309 0.984 0.000 0.016
#> GSM99443 2 0.0237 0.8099 0.000 0.996 0.004
#> GSM99445 2 0.0237 0.8099 0.000 0.996 0.004
#> GSM99447 2 0.4555 0.7740 0.000 0.800 0.200
#> GSM99449 3 0.2959 0.7936 0.000 0.100 0.900
#> GSM99451 3 0.0424 0.8529 0.008 0.000 0.992
#> GSM99453 1 0.0237 0.9331 0.996 0.000 0.004
#> GSM99455 1 0.0237 0.9331 0.996 0.000 0.004
#> GSM99457 1 0.0237 0.9331 0.996 0.000 0.004
#> GSM99463 2 0.0000 0.8076 0.000 1.000 0.000
#> GSM99465 3 0.4178 0.7443 0.172 0.000 0.828
#> GSM99467 2 0.6724 0.4575 0.012 0.568 0.420
#> GSM99471 1 0.4473 0.8199 0.828 0.008 0.164
#> GSM99473 1 0.5285 0.6962 0.752 0.004 0.244
#> GSM99475 3 0.0747 0.8512 0.016 0.000 0.984
#> GSM99477 2 0.6598 0.4472 0.008 0.564 0.428
#> GSM99479 2 0.6598 0.4472 0.008 0.564 0.428
#> GSM99481 1 0.0237 0.9331 0.996 0.000 0.004
#> GSM99483 1 0.0237 0.9331 0.996 0.000 0.004
#> GSM99485 2 0.7189 0.6392 0.052 0.656 0.292
#> GSM99487 2 0.5178 0.7254 0.000 0.744 0.256
#> GSM99489 2 0.0000 0.8076 0.000 1.000 0.000
#> GSM99491 2 0.2165 0.8240 0.000 0.936 0.064
#> GSM99493 1 0.0237 0.9331 0.996 0.000 0.004
#> GSM99495 2 0.0000 0.8076 0.000 1.000 0.000
#> GSM99525 1 0.3272 0.8838 0.892 0.004 0.104
#> GSM99527 3 0.3276 0.8199 0.068 0.024 0.908
#> GSM99529 2 0.6881 0.5133 0.020 0.592 0.388
#> GSM99531 3 0.3412 0.7855 0.124 0.000 0.876
#> GSM99533 3 0.0747 0.8512 0.016 0.000 0.984
#> GSM99535 3 0.9811 -0.1317 0.240 0.380 0.380
#> GSM99537 1 0.1529 0.9250 0.960 0.000 0.040
#> GSM99539 3 0.5497 0.4801 0.000 0.292 0.708
#> GSM99541 1 0.3752 0.8562 0.856 0.000 0.144
#> GSM99543 2 0.1636 0.8123 0.016 0.964 0.020
#> GSM99545 3 0.2066 0.8233 0.000 0.060 0.940
#> GSM99547 3 0.4342 0.7835 0.120 0.024 0.856
#> GSM99549 2 0.1765 0.8116 0.004 0.956 0.040
#> GSM99551 1 0.4531 0.8055 0.824 0.008 0.168
#> GSM99553 3 0.5156 0.6165 0.008 0.216 0.776
#> GSM99555 2 0.3038 0.8181 0.000 0.896 0.104
#> GSM99557 2 0.2066 0.8232 0.000 0.940 0.060
#> GSM99559 3 0.3038 0.7900 0.000 0.104 0.896
#> GSM99561 2 0.4504 0.7764 0.000 0.804 0.196
#> GSM99563 3 0.0000 0.8521 0.000 0.000 1.000
#> GSM99565 2 0.3038 0.8181 0.000 0.896 0.104
#> GSM99573 2 0.1525 0.8129 0.004 0.964 0.032
#> GSM99577 1 0.3816 0.8515 0.852 0.000 0.148
#> GSM99579 2 0.3752 0.8037 0.000 0.856 0.144
#> GSM99581 3 0.1643 0.8344 0.000 0.044 0.956
#> GSM99583 3 0.8452 0.0837 0.096 0.372 0.532
#> GSM99585 3 0.6540 0.0821 0.008 0.408 0.584
#> GSM99587 1 0.0237 0.9331 0.996 0.000 0.004
#> GSM99589 2 0.6735 0.4406 0.012 0.564 0.424
#> GSM99591 2 0.2066 0.8236 0.000 0.940 0.060
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM99497 3 0.0657 0.6514 0.000 0.012 0.984 0.004
#> GSM99503 1 0.0000 0.9031 1.000 0.000 0.000 0.000
#> GSM99505 1 0.3497 0.8385 0.860 0.000 0.104 0.036
#> GSM99507 3 0.0657 0.6514 0.000 0.012 0.984 0.004
#> GSM99567 3 0.0657 0.6514 0.000 0.012 0.984 0.004
#> GSM99575 1 0.0000 0.9031 1.000 0.000 0.000 0.000
#> GSM99593 3 0.0804 0.6504 0.000 0.012 0.980 0.008
#> GSM99595 3 0.0657 0.6514 0.000 0.012 0.984 0.004
#> GSM99469 1 0.2892 0.8678 0.896 0.000 0.068 0.036
#> GSM99499 1 0.3497 0.8385 0.860 0.000 0.104 0.036
#> GSM99501 1 0.2892 0.8678 0.896 0.000 0.068 0.036
#> GSM99509 3 0.2530 0.5838 0.008 0.008 0.912 0.072
#> GSM99569 3 0.0188 0.6481 0.000 0.000 0.996 0.004
#> GSM99597 3 0.3246 0.5110 0.008 0.008 0.868 0.116
#> GSM99601 2 0.2089 0.7466 0.000 0.932 0.020 0.048
#> GSM99459 3 0.7103 -0.1758 0.296 0.000 0.544 0.160
#> GSM99461 3 0.6539 0.0283 0.172 0.004 0.652 0.172
#> GSM99511 3 0.0469 0.6457 0.000 0.000 0.988 0.012
#> GSM99513 3 0.0469 0.6457 0.000 0.000 0.988 0.012
#> GSM99515 3 0.0336 0.6509 0.000 0.008 0.992 0.000
#> GSM99517 1 0.0000 0.9031 1.000 0.000 0.000 0.000
#> GSM99519 3 0.7292 -0.2434 0.388 0.000 0.460 0.152
#> GSM99521 3 0.1182 0.6477 0.000 0.016 0.968 0.016
#> GSM99523 3 0.0188 0.6481 0.000 0.000 0.996 0.004
#> GSM99571 1 0.1022 0.8998 0.968 0.000 0.000 0.032
#> GSM99599 1 0.0000 0.9031 1.000 0.000 0.000 0.000
#> GSM99433 2 0.5773 0.4925 0.000 0.620 0.336 0.044
#> GSM99435 3 0.1118 0.6329 0.000 0.000 0.964 0.036
#> GSM99437 2 0.4617 0.6622 0.000 0.764 0.204 0.032
#> GSM99439 2 0.3528 0.7121 0.000 0.808 0.000 0.192
#> GSM99441 1 0.0921 0.8968 0.972 0.000 0.000 0.028
#> GSM99443 2 0.2589 0.7319 0.000 0.884 0.000 0.116
#> GSM99445 2 0.2589 0.7319 0.000 0.884 0.000 0.116
#> GSM99447 2 0.4174 0.7112 0.000 0.816 0.140 0.044
#> GSM99449 3 0.3205 0.5623 0.000 0.104 0.872 0.024
#> GSM99451 3 0.2198 0.6057 0.008 0.000 0.920 0.072
#> GSM99453 1 0.1022 0.8998 0.968 0.000 0.000 0.032
#> GSM99455 1 0.1022 0.8998 0.968 0.000 0.000 0.032
#> GSM99457 1 0.1389 0.8977 0.952 0.000 0.000 0.048
#> GSM99463 2 0.3649 0.7043 0.000 0.796 0.000 0.204
#> GSM99465 3 0.6140 0.1190 0.116 0.004 0.684 0.196
#> GSM99467 2 0.6091 0.4697 0.000 0.596 0.344 0.060
#> GSM99471 1 0.4880 0.7595 0.796 0.016 0.132 0.056
#> GSM99473 1 0.5315 0.5959 0.724 0.004 0.224 0.048
#> GSM99475 3 0.4049 0.3377 0.008 0.000 0.780 0.212
#> GSM99477 2 0.6054 0.4629 0.000 0.592 0.352 0.056
#> GSM99479 2 0.6054 0.4629 0.000 0.592 0.352 0.056
#> GSM99481 1 0.0336 0.9019 0.992 0.000 0.000 0.008
#> GSM99483 1 0.1022 0.8998 0.968 0.000 0.000 0.032
#> GSM99485 2 0.6200 0.6023 0.032 0.692 0.220 0.056
#> GSM99487 2 0.4617 0.6622 0.000 0.764 0.204 0.032
#> GSM99489 2 0.3726 0.7001 0.000 0.788 0.000 0.212
#> GSM99491 2 0.2256 0.7471 0.000 0.924 0.020 0.056
#> GSM99493 1 0.1389 0.8977 0.952 0.000 0.000 0.048
#> GSM99495 2 0.3764 0.6984 0.000 0.784 0.000 0.216
#> GSM99525 1 0.3748 0.8347 0.860 0.008 0.088 0.044
#> GSM99527 3 0.4996 0.4753 0.060 0.028 0.800 0.112
#> GSM99529 2 0.6503 0.5256 0.008 0.620 0.288 0.084
#> GSM99531 4 0.5992 0.0000 0.040 0.000 0.444 0.516
#> GSM99533 3 0.4049 0.3377 0.008 0.000 0.780 0.212
#> GSM99535 2 0.9428 0.0441 0.212 0.388 0.280 0.120
#> GSM99537 1 0.1824 0.8871 0.936 0.000 0.004 0.060
#> GSM99539 3 0.7353 -0.1168 0.000 0.288 0.516 0.196
#> GSM99541 1 0.4168 0.8195 0.828 0.000 0.080 0.092
#> GSM99543 2 0.4535 0.6896 0.016 0.744 0.000 0.240
#> GSM99545 3 0.4956 0.3450 0.000 0.056 0.756 0.188
#> GSM99547 3 0.5835 0.3949 0.096 0.036 0.752 0.116
#> GSM99549 2 0.4134 0.6845 0.000 0.740 0.000 0.260
#> GSM99551 1 0.5350 0.7401 0.744 0.008 0.060 0.188
#> GSM99553 3 0.4652 0.3529 0.004 0.220 0.756 0.020
#> GSM99555 2 0.2660 0.7402 0.000 0.908 0.056 0.036
#> GSM99557 2 0.2089 0.7466 0.000 0.932 0.020 0.048
#> GSM99559 3 0.3307 0.5581 0.000 0.104 0.868 0.028
#> GSM99561 2 0.4688 0.7114 0.000 0.792 0.128 0.080
#> GSM99563 3 0.0469 0.6457 0.000 0.000 0.988 0.012
#> GSM99565 2 0.2660 0.7402 0.000 0.908 0.056 0.036
#> GSM99573 2 0.4040 0.6916 0.000 0.752 0.000 0.248
#> GSM99577 1 0.4235 0.8141 0.824 0.000 0.084 0.092
#> GSM99579 2 0.3107 0.7389 0.000 0.884 0.080 0.036
#> GSM99581 3 0.1722 0.6278 0.000 0.048 0.944 0.008
#> GSM99583 3 0.8236 -0.0715 0.068 0.396 0.436 0.100
#> GSM99585 3 0.6949 -0.0862 0.008 0.440 0.468 0.084
#> GSM99587 1 0.1389 0.8977 0.952 0.000 0.000 0.048
#> GSM99589 2 0.6263 0.4300 0.008 0.580 0.364 0.048
#> GSM99591 2 0.2174 0.7467 0.000 0.928 0.020 0.052
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM99497 3 0.0566 0.7068 0.000 0.012 0.984 0.004 0.000
#> GSM99503 1 0.0000 0.8705 1.000 0.000 0.000 0.000 0.000
#> GSM99505 1 0.3427 0.8125 0.844 0.000 0.096 0.056 0.004
#> GSM99507 3 0.0566 0.7068 0.000 0.012 0.984 0.004 0.000
#> GSM99567 3 0.0566 0.7068 0.000 0.012 0.984 0.004 0.000
#> GSM99575 1 0.0000 0.8705 1.000 0.000 0.000 0.000 0.000
#> GSM99593 3 0.0693 0.7056 0.000 0.012 0.980 0.008 0.000
#> GSM99595 3 0.0566 0.7068 0.000 0.012 0.984 0.004 0.000
#> GSM99469 1 0.2819 0.8388 0.884 0.000 0.060 0.052 0.004
#> GSM99499 1 0.3427 0.8125 0.844 0.000 0.096 0.056 0.004
#> GSM99501 1 0.2819 0.8388 0.884 0.000 0.060 0.052 0.004
#> GSM99509 3 0.2673 0.6507 0.000 0.008 0.892 0.072 0.028
#> GSM99569 3 0.0404 0.7060 0.000 0.000 0.988 0.012 0.000
#> GSM99597 3 0.3412 0.6027 0.000 0.008 0.848 0.096 0.048
#> GSM99601 2 0.2237 0.3206 0.000 0.904 0.004 0.008 0.084
#> GSM99459 3 0.7259 -0.0547 0.264 0.004 0.408 0.308 0.016
#> GSM99461 3 0.6769 0.0954 0.136 0.008 0.500 0.340 0.016
#> GSM99511 3 0.0609 0.7043 0.000 0.000 0.980 0.020 0.000
#> GSM99513 3 0.0609 0.7043 0.000 0.000 0.980 0.020 0.000
#> GSM99515 3 0.0290 0.7070 0.000 0.008 0.992 0.000 0.000
#> GSM99517 1 0.0000 0.8705 1.000 0.000 0.000 0.000 0.000
#> GSM99519 1 0.7265 -0.1354 0.360 0.004 0.324 0.300 0.012
#> GSM99521 3 0.1106 0.7006 0.000 0.024 0.964 0.012 0.000
#> GSM99523 3 0.0404 0.7060 0.000 0.000 0.988 0.012 0.000
#> GSM99571 1 0.1399 0.8648 0.952 0.000 0.000 0.028 0.020
#> GSM99599 1 0.0000 0.8705 1.000 0.000 0.000 0.000 0.000
#> GSM99433 2 0.5539 0.4368 0.000 0.640 0.284 0.036 0.040
#> GSM99435 3 0.1544 0.6833 0.000 0.000 0.932 0.068 0.000
#> GSM99437 2 0.3583 0.5089 0.000 0.808 0.168 0.016 0.008
#> GSM99439 2 0.4201 -0.6710 0.000 0.592 0.000 0.000 0.408
#> GSM99441 1 0.1041 0.8639 0.964 0.000 0.000 0.032 0.004
#> GSM99443 2 0.3280 0.0981 0.000 0.812 0.000 0.012 0.176
#> GSM99445 2 0.3280 0.0981 0.000 0.812 0.000 0.012 0.176
#> GSM99447 2 0.3507 0.4825 0.000 0.840 0.112 0.012 0.036
#> GSM99449 3 0.3031 0.5973 0.000 0.128 0.852 0.016 0.004
#> GSM99451 3 0.3242 0.5581 0.000 0.000 0.816 0.172 0.012
#> GSM99453 1 0.1399 0.8648 0.952 0.000 0.000 0.028 0.020
#> GSM99455 1 0.1399 0.8648 0.952 0.000 0.000 0.028 0.020
#> GSM99457 1 0.1918 0.8625 0.928 0.000 0.000 0.036 0.036
#> GSM99463 2 0.4559 -0.8217 0.000 0.512 0.000 0.008 0.480
#> GSM99465 3 0.6288 0.1450 0.080 0.008 0.528 0.368 0.016
#> GSM99467 2 0.5934 0.4782 0.000 0.620 0.252 0.112 0.016
#> GSM99471 1 0.5105 0.7472 0.768 0.016 0.084 0.096 0.036
#> GSM99473 1 0.5399 0.6226 0.704 0.004 0.180 0.096 0.016
#> GSM99475 3 0.4971 -0.1932 0.000 0.000 0.512 0.460 0.028
#> GSM99477 2 0.5646 0.4672 0.000 0.628 0.268 0.096 0.008
#> GSM99479 2 0.5646 0.4672 0.000 0.628 0.268 0.096 0.008
#> GSM99481 1 0.0404 0.8691 0.988 0.000 0.000 0.012 0.000
#> GSM99483 1 0.1399 0.8648 0.952 0.000 0.000 0.028 0.020
#> GSM99485 2 0.6496 0.4623 0.028 0.668 0.144 0.104 0.056
#> GSM99487 2 0.3583 0.5089 0.000 0.808 0.168 0.016 0.008
#> GSM99489 5 0.4546 0.8835 0.000 0.460 0.000 0.008 0.532
#> GSM99491 2 0.2517 0.3100 0.000 0.884 0.004 0.008 0.104
#> GSM99493 1 0.1918 0.8625 0.928 0.000 0.000 0.036 0.036
#> GSM99495 5 0.4542 0.8859 0.000 0.456 0.000 0.008 0.536
#> GSM99525 1 0.4061 0.8047 0.832 0.008 0.064 0.064 0.032
#> GSM99527 3 0.5666 0.3548 0.020 0.044 0.640 0.284 0.012
#> GSM99529 2 0.6498 0.4790 0.008 0.624 0.188 0.144 0.036
#> GSM99531 4 0.7315 0.3002 0.024 0.000 0.308 0.384 0.284
#> GSM99533 3 0.4971 -0.1932 0.000 0.000 0.512 0.460 0.028
#> GSM99535 2 0.9187 0.0584 0.180 0.376 0.184 0.200 0.060
#> GSM99537 1 0.1924 0.8548 0.924 0.000 0.004 0.064 0.008
#> GSM99539 4 0.7533 0.2665 0.000 0.312 0.304 0.348 0.036
#> GSM99541 1 0.4051 0.7972 0.816 0.000 0.068 0.096 0.020
#> GSM99543 5 0.4994 0.8669 0.016 0.396 0.000 0.012 0.576
#> GSM99545 3 0.5976 -0.2498 0.000 0.056 0.500 0.420 0.024
#> GSM99547 3 0.6447 0.2974 0.048 0.052 0.604 0.276 0.020
#> GSM99549 5 0.4504 0.8682 0.000 0.428 0.000 0.008 0.564
#> GSM99551 1 0.5200 0.6814 0.688 0.000 0.000 0.156 0.156
#> GSM99553 3 0.4117 0.3469 0.004 0.240 0.740 0.012 0.004
#> GSM99555 2 0.1195 0.4288 0.000 0.960 0.028 0.012 0.000
#> GSM99557 2 0.1952 0.3251 0.000 0.912 0.004 0.000 0.084
#> GSM99559 3 0.3078 0.5927 0.000 0.132 0.848 0.016 0.004
#> GSM99561 2 0.5459 0.2279 0.000 0.716 0.076 0.052 0.156
#> GSM99563 3 0.0609 0.7043 0.000 0.000 0.980 0.020 0.000
#> GSM99565 2 0.1195 0.4288 0.000 0.960 0.028 0.012 0.000
#> GSM99573 5 0.4443 0.8464 0.000 0.472 0.000 0.004 0.524
#> GSM99577 1 0.4112 0.7932 0.812 0.000 0.072 0.096 0.020
#> GSM99579 2 0.3333 0.3888 0.000 0.856 0.008 0.076 0.060
#> GSM99581 3 0.1557 0.6779 0.000 0.052 0.940 0.008 0.000
#> GSM99583 2 0.8072 0.0822 0.056 0.416 0.340 0.152 0.036
#> GSM99585 2 0.6553 0.1227 0.004 0.464 0.376 0.152 0.004
#> GSM99587 1 0.1918 0.8625 0.928 0.000 0.000 0.036 0.036
#> GSM99589 2 0.5710 0.3980 0.004 0.608 0.320 0.032 0.036
#> GSM99591 2 0.2339 0.3075 0.000 0.892 0.004 0.004 0.100
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM99497 3 0.0291 0.7568 0.000 0.004 0.992 0.004 0.000 0.000
#> GSM99503 1 0.0000 0.8341 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99505 1 0.3374 0.7786 0.836 0.000 0.096 0.032 0.000 0.036
#> GSM99507 3 0.0291 0.7568 0.000 0.004 0.992 0.004 0.000 0.000
#> GSM99567 3 0.0291 0.7568 0.000 0.004 0.992 0.004 0.000 0.000
#> GSM99575 1 0.0000 0.8341 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99593 3 0.0405 0.7552 0.000 0.004 0.988 0.008 0.000 0.000
#> GSM99595 3 0.0291 0.7568 0.000 0.004 0.992 0.004 0.000 0.000
#> GSM99469 1 0.2816 0.8045 0.876 0.000 0.060 0.028 0.000 0.036
#> GSM99499 1 0.3374 0.7786 0.836 0.000 0.096 0.032 0.000 0.036
#> GSM99501 1 0.2816 0.8045 0.876 0.000 0.060 0.028 0.000 0.036
#> GSM99509 3 0.3004 0.6685 0.000 0.008 0.860 0.048 0.004 0.080
#> GSM99569 3 0.0632 0.7559 0.000 0.000 0.976 0.024 0.000 0.000
#> GSM99597 3 0.3641 0.6138 0.000 0.008 0.816 0.060 0.008 0.108
#> GSM99601 2 0.2445 0.5648 0.000 0.868 0.000 0.004 0.120 0.008
#> GSM99459 3 0.7557 -0.0494 0.248 0.008 0.384 0.232 0.000 0.128
#> GSM99461 3 0.7068 0.1429 0.116 0.008 0.468 0.276 0.000 0.132
#> GSM99511 3 0.0806 0.7540 0.000 0.000 0.972 0.020 0.000 0.008
#> GSM99513 3 0.0806 0.7540 0.000 0.000 0.972 0.020 0.000 0.008
#> GSM99515 3 0.0291 0.7568 0.000 0.004 0.992 0.004 0.000 0.000
#> GSM99517 1 0.0000 0.8341 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99519 1 0.7581 -0.1651 0.344 0.008 0.300 0.228 0.000 0.120
#> GSM99521 3 0.0951 0.7504 0.000 0.008 0.968 0.020 0.000 0.004
#> GSM99523 3 0.0547 0.7560 0.000 0.000 0.980 0.020 0.000 0.000
#> GSM99571 1 0.1285 0.8252 0.944 0.000 0.000 0.004 0.000 0.052
#> GSM99599 1 0.0000 0.8341 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99433 2 0.5718 0.5248 0.000 0.612 0.268 0.068 0.032 0.020
#> GSM99435 3 0.1838 0.7218 0.000 0.000 0.916 0.068 0.000 0.016
#> GSM99437 2 0.3325 0.6552 0.000 0.816 0.152 0.016 0.008 0.008
#> GSM99439 5 0.4273 0.6183 0.000 0.348 0.000 0.012 0.628 0.012
#> GSM99441 1 0.1003 0.8283 0.964 0.000 0.000 0.016 0.000 0.020
#> GSM99443 2 0.3352 0.4668 0.000 0.776 0.000 0.008 0.208 0.008
#> GSM99445 2 0.3352 0.4668 0.000 0.776 0.000 0.008 0.208 0.008
#> GSM99447 2 0.3728 0.6452 0.000 0.820 0.104 0.016 0.044 0.016
#> GSM99449 3 0.2804 0.6535 0.000 0.120 0.852 0.024 0.004 0.000
#> GSM99451 3 0.3606 0.3813 0.000 0.000 0.728 0.256 0.000 0.016
#> GSM99453 1 0.1285 0.8252 0.944 0.000 0.000 0.004 0.000 0.052
#> GSM99455 1 0.1285 0.8252 0.944 0.000 0.000 0.004 0.000 0.052
#> GSM99457 1 0.2823 0.7611 0.796 0.000 0.000 0.000 0.000 0.204
#> GSM99463 5 0.3404 0.7673 0.000 0.248 0.000 0.004 0.744 0.004
#> GSM99465 3 0.6678 0.1988 0.060 0.008 0.496 0.288 0.000 0.148
#> GSM99467 2 0.5695 0.5847 0.000 0.620 0.228 0.112 0.004 0.036
#> GSM99471 1 0.4985 0.6975 0.744 0.020 0.076 0.060 0.000 0.100
#> GSM99473 1 0.5182 0.5808 0.700 0.008 0.172 0.056 0.000 0.064
#> GSM99475 4 0.4396 0.6360 0.000 0.000 0.352 0.612 0.000 0.036
#> GSM99477 2 0.5304 0.5769 0.000 0.632 0.248 0.096 0.000 0.024
#> GSM99479 2 0.5304 0.5769 0.000 0.632 0.248 0.096 0.000 0.024
#> GSM99481 1 0.0405 0.8329 0.988 0.000 0.000 0.008 0.000 0.004
#> GSM99483 1 0.1285 0.8252 0.944 0.000 0.000 0.004 0.000 0.052
#> GSM99485 2 0.6441 0.6161 0.028 0.656 0.124 0.088 0.040 0.064
#> GSM99487 2 0.3325 0.6552 0.000 0.816 0.152 0.016 0.008 0.008
#> GSM99489 5 0.2377 0.8229 0.000 0.124 0.000 0.004 0.868 0.004
#> GSM99491 2 0.2615 0.5664 0.000 0.852 0.000 0.004 0.136 0.008
#> GSM99493 1 0.2823 0.7611 0.796 0.000 0.000 0.000 0.000 0.204
#> GSM99495 5 0.2333 0.8224 0.000 0.120 0.000 0.004 0.872 0.004
#> GSM99525 1 0.3907 0.7638 0.816 0.012 0.060 0.032 0.000 0.080
#> GSM99527 3 0.5628 0.4152 0.004 0.040 0.608 0.268 0.000 0.080
#> GSM99529 2 0.6348 0.6016 0.000 0.612 0.160 0.136 0.024 0.068
#> GSM99531 6 0.5843 0.0000 0.004 0.000 0.200 0.148 0.036 0.612
#> GSM99533 4 0.4446 0.6296 0.000 0.000 0.348 0.612 0.000 0.040
#> GSM99535 2 0.8941 0.2198 0.156 0.372 0.160 0.164 0.028 0.120
#> GSM99537 1 0.2052 0.8192 0.912 0.000 0.004 0.028 0.000 0.056
#> GSM99539 4 0.7028 0.1463 0.000 0.276 0.192 0.456 0.012 0.064
#> GSM99541 1 0.3977 0.7633 0.804 0.000 0.064 0.036 0.004 0.092
#> GSM99543 5 0.2570 0.7890 0.012 0.076 0.000 0.012 0.888 0.012
#> GSM99545 4 0.4634 0.6288 0.000 0.036 0.352 0.604 0.000 0.008
#> GSM99547 3 0.6389 0.3640 0.032 0.052 0.568 0.264 0.000 0.084
#> GSM99549 5 0.3210 0.7773 0.000 0.096 0.000 0.020 0.844 0.040
#> GSM99551 1 0.5651 0.4173 0.528 0.004 0.000 0.076 0.024 0.368
#> GSM99553 3 0.4037 0.4066 0.000 0.236 0.724 0.032 0.000 0.008
#> GSM99555 2 0.1710 0.6236 0.000 0.940 0.020 0.008 0.020 0.012
#> GSM99557 2 0.1910 0.5748 0.000 0.892 0.000 0.000 0.108 0.000
#> GSM99559 3 0.2926 0.6469 0.000 0.124 0.844 0.028 0.004 0.000
#> GSM99561 2 0.6701 0.2035 0.000 0.540 0.036 0.092 0.268 0.064
#> GSM99563 3 0.0806 0.7540 0.000 0.000 0.972 0.020 0.000 0.008
#> GSM99565 2 0.1710 0.6236 0.000 0.940 0.020 0.008 0.020 0.012
#> GSM99573 5 0.3893 0.7795 0.000 0.172 0.000 0.016 0.772 0.040
#> GSM99577 1 0.4033 0.7598 0.800 0.000 0.068 0.036 0.004 0.092
#> GSM99579 2 0.3579 0.6035 0.000 0.828 0.000 0.064 0.072 0.036
#> GSM99581 3 0.1434 0.7294 0.000 0.048 0.940 0.012 0.000 0.000
#> GSM99583 2 0.7729 0.2956 0.044 0.412 0.316 0.136 0.008 0.084
#> GSM99585 2 0.6267 0.3284 0.004 0.472 0.344 0.156 0.000 0.024
#> GSM99587 1 0.2823 0.7611 0.796 0.000 0.000 0.000 0.000 0.204
#> GSM99589 2 0.5540 0.5252 0.000 0.604 0.296 0.056 0.028 0.016
#> GSM99591 2 0.2278 0.5661 0.000 0.868 0.000 0.004 0.128 0.000
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
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 disease.state(p) cell.type(p) k
#> CV:hclust 83 0.404736 0.70924 2
#> CV:hclust 75 0.001850 0.03342 3
#> CV:hclust 65 0.000108 0.00377 4
#> CV:hclust 50 0.014691 0.28742 5
#> CV:hclust 68 0.000116 0.01830 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 21512 rows and 85 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.572 0.629 0.849 0.4640 0.519 0.519
#> 3 3 0.977 0.935 0.950 0.4323 0.726 0.511
#> 4 4 0.774 0.684 0.847 0.1026 0.954 0.866
#> 5 5 0.746 0.784 0.840 0.0609 0.900 0.686
#> 6 6 0.793 0.703 0.830 0.0430 0.961 0.833
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
#> GSM99497 2 0.9983 0.274 0.476 0.524
#> GSM99503 1 0.0000 0.887 1.000 0.000
#> GSM99505 1 0.1184 0.871 0.984 0.016
#> GSM99507 2 0.9983 0.274 0.476 0.524
#> GSM99567 2 0.9983 0.274 0.476 0.524
#> GSM99575 1 0.0000 0.887 1.000 0.000
#> GSM99593 2 0.9983 0.274 0.476 0.524
#> GSM99595 2 0.9983 0.274 0.476 0.524
#> GSM99469 1 0.0000 0.887 1.000 0.000
#> GSM99499 1 0.0000 0.887 1.000 0.000
#> GSM99501 1 0.0000 0.887 1.000 0.000
#> GSM99509 2 0.9993 0.254 0.484 0.516
#> GSM99569 2 0.9993 0.254 0.484 0.516
#> GSM99597 2 0.9996 0.241 0.488 0.512
#> GSM99601 2 0.1633 0.754 0.024 0.976
#> GSM99459 1 0.0000 0.887 1.000 0.000
#> GSM99461 1 0.0000 0.887 1.000 0.000
#> GSM99511 2 0.9983 0.274 0.476 0.524
#> GSM99513 2 0.9983 0.274 0.476 0.524
#> GSM99515 2 0.9988 0.264 0.480 0.520
#> GSM99517 1 0.0000 0.887 1.000 0.000
#> GSM99519 1 0.0000 0.887 1.000 0.000
#> GSM99521 2 0.9988 0.264 0.480 0.520
#> GSM99523 1 0.9983 -0.161 0.524 0.476
#> GSM99571 1 0.0000 0.887 1.000 0.000
#> GSM99599 1 0.0000 0.887 1.000 0.000
#> GSM99433 2 0.0000 0.746 0.000 1.000
#> GSM99435 2 0.9983 0.274 0.476 0.524
#> GSM99437 2 0.1633 0.754 0.024 0.976
#> GSM99439 2 0.1633 0.754 0.024 0.976
#> GSM99441 1 0.0000 0.887 1.000 0.000
#> GSM99443 2 0.1633 0.754 0.024 0.976
#> GSM99445 2 0.1633 0.754 0.024 0.976
#> GSM99447 2 0.1633 0.754 0.024 0.976
#> GSM99449 2 0.0000 0.746 0.000 1.000
#> GSM99451 2 0.9993 0.254 0.484 0.516
#> GSM99453 1 0.0000 0.887 1.000 0.000
#> GSM99455 1 0.0000 0.887 1.000 0.000
#> GSM99457 1 0.0000 0.887 1.000 0.000
#> GSM99463 2 0.1633 0.754 0.024 0.976
#> GSM99465 1 0.8713 0.424 0.708 0.292
#> GSM99467 2 0.1633 0.754 0.024 0.976
#> GSM99471 1 0.0000 0.887 1.000 0.000
#> GSM99473 1 0.0000 0.887 1.000 0.000
#> GSM99475 2 0.9993 0.254 0.484 0.516
#> GSM99477 2 0.0000 0.746 0.000 1.000
#> GSM99479 2 0.1633 0.754 0.024 0.976
#> GSM99481 1 0.0000 0.887 1.000 0.000
#> GSM99483 1 0.0000 0.887 1.000 0.000
#> GSM99485 2 0.1633 0.754 0.024 0.976
#> GSM99487 2 0.1633 0.754 0.024 0.976
#> GSM99489 2 0.1633 0.754 0.024 0.976
#> GSM99491 2 0.1633 0.754 0.024 0.976
#> GSM99493 1 0.0000 0.887 1.000 0.000
#> GSM99495 2 0.1633 0.754 0.024 0.976
#> GSM99525 1 0.0000 0.887 1.000 0.000
#> GSM99527 2 0.9998 0.252 0.492 0.508
#> GSM99529 2 0.6531 0.665 0.168 0.832
#> GSM99531 1 0.9996 -0.200 0.512 0.488
#> GSM99533 1 0.9170 0.341 0.668 0.332
#> GSM99535 2 0.6247 0.644 0.156 0.844
#> GSM99537 1 0.0000 0.887 1.000 0.000
#> GSM99539 2 0.0000 0.746 0.000 1.000
#> GSM99541 1 0.0938 0.875 0.988 0.012
#> GSM99543 2 0.2236 0.746 0.036 0.964
#> GSM99545 2 0.0000 0.746 0.000 1.000
#> GSM99547 1 0.9996 -0.257 0.512 0.488
#> GSM99549 2 0.1633 0.754 0.024 0.976
#> GSM99551 1 0.0000 0.887 1.000 0.000
#> GSM99553 2 0.9983 0.274 0.476 0.524
#> GSM99555 2 0.1633 0.754 0.024 0.976
#> GSM99557 2 0.1633 0.754 0.024 0.976
#> GSM99559 2 0.0000 0.746 0.000 1.000
#> GSM99561 2 0.1633 0.754 0.024 0.976
#> GSM99563 2 0.9993 0.254 0.484 0.516
#> GSM99565 2 0.0938 0.750 0.012 0.988
#> GSM99573 2 0.1633 0.754 0.024 0.976
#> GSM99577 1 0.0000 0.887 1.000 0.000
#> GSM99579 2 0.1633 0.754 0.024 0.976
#> GSM99581 2 0.9983 0.274 0.476 0.524
#> GSM99583 1 1.0000 -0.278 0.504 0.496
#> GSM99585 2 0.1633 0.754 0.024 0.976
#> GSM99587 1 0.0000 0.887 1.000 0.000
#> GSM99589 2 0.1633 0.754 0.024 0.976
#> GSM99591 2 0.1633 0.754 0.024 0.976
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM99497 3 0.2773 0.9501 0.048 0.024 0.928
#> GSM99503 1 0.0000 0.9937 1.000 0.000 0.000
#> GSM99505 1 0.0000 0.9937 1.000 0.000 0.000
#> GSM99507 3 0.2773 0.9501 0.048 0.024 0.928
#> GSM99567 3 0.2773 0.9501 0.048 0.024 0.928
#> GSM99575 1 0.0000 0.9937 1.000 0.000 0.000
#> GSM99593 3 0.2773 0.9501 0.048 0.024 0.928
#> GSM99595 3 0.2773 0.9501 0.048 0.024 0.928
#> GSM99469 1 0.0000 0.9937 1.000 0.000 0.000
#> GSM99499 1 0.0000 0.9937 1.000 0.000 0.000
#> GSM99501 1 0.0000 0.9937 1.000 0.000 0.000
#> GSM99509 3 0.2773 0.9501 0.048 0.024 0.928
#> GSM99569 3 0.2773 0.9501 0.048 0.024 0.928
#> GSM99597 3 0.2773 0.9501 0.048 0.024 0.928
#> GSM99601 2 0.0424 0.9623 0.000 0.992 0.008
#> GSM99459 1 0.0000 0.9937 1.000 0.000 0.000
#> GSM99461 1 0.0000 0.9937 1.000 0.000 0.000
#> GSM99511 3 0.2773 0.9501 0.048 0.024 0.928
#> GSM99513 3 0.2773 0.9501 0.048 0.024 0.928
#> GSM99515 3 0.2773 0.9501 0.048 0.024 0.928
#> GSM99517 1 0.0000 0.9937 1.000 0.000 0.000
#> GSM99519 1 0.0000 0.9937 1.000 0.000 0.000
#> GSM99521 3 0.2663 0.9487 0.044 0.024 0.932
#> GSM99523 3 0.2584 0.9394 0.064 0.008 0.928
#> GSM99571 1 0.0000 0.9937 1.000 0.000 0.000
#> GSM99599 1 0.0000 0.9937 1.000 0.000 0.000
#> GSM99433 2 0.2066 0.9112 0.000 0.940 0.060
#> GSM99435 3 0.2663 0.9487 0.044 0.024 0.932
#> GSM99437 2 0.0000 0.9633 0.000 1.000 0.000
#> GSM99439 2 0.1529 0.9533 0.000 0.960 0.040
#> GSM99441 1 0.0000 0.9937 1.000 0.000 0.000
#> GSM99443 2 0.0000 0.9633 0.000 1.000 0.000
#> GSM99445 2 0.0000 0.9633 0.000 1.000 0.000
#> GSM99447 2 0.0000 0.9633 0.000 1.000 0.000
#> GSM99449 3 0.2356 0.9127 0.000 0.072 0.928
#> GSM99451 3 0.2527 0.9479 0.044 0.020 0.936
#> GSM99453 1 0.0747 0.9902 0.984 0.000 0.016
#> GSM99455 1 0.0747 0.9902 0.984 0.000 0.016
#> GSM99457 1 0.1031 0.9876 0.976 0.000 0.024
#> GSM99463 2 0.1529 0.9533 0.000 0.960 0.040
#> GSM99465 3 0.5541 0.7267 0.252 0.008 0.740
#> GSM99467 2 0.0237 0.9624 0.000 0.996 0.004
#> GSM99471 1 0.0892 0.9890 0.980 0.000 0.020
#> GSM99473 1 0.0237 0.9918 0.996 0.000 0.004
#> GSM99475 3 0.2527 0.9479 0.044 0.020 0.936
#> GSM99477 3 0.6204 0.3478 0.000 0.424 0.576
#> GSM99479 2 0.1031 0.9500 0.000 0.976 0.024
#> GSM99481 1 0.0000 0.9937 1.000 0.000 0.000
#> GSM99483 1 0.0747 0.9902 0.984 0.000 0.016
#> GSM99485 2 0.0237 0.9624 0.000 0.996 0.004
#> GSM99487 2 0.0000 0.9633 0.000 1.000 0.000
#> GSM99489 2 0.1529 0.9533 0.000 0.960 0.040
#> GSM99491 2 0.0000 0.9633 0.000 1.000 0.000
#> GSM99493 1 0.1031 0.9876 0.976 0.000 0.024
#> GSM99495 2 0.1529 0.9533 0.000 0.960 0.040
#> GSM99525 1 0.0592 0.9915 0.988 0.000 0.012
#> GSM99527 3 0.2773 0.9462 0.048 0.024 0.928
#> GSM99529 2 0.6305 -0.0731 0.000 0.516 0.484
#> GSM99531 3 0.2063 0.9407 0.044 0.008 0.948
#> GSM99533 3 0.2063 0.9407 0.044 0.008 0.948
#> GSM99535 2 0.2998 0.8950 0.068 0.916 0.016
#> GSM99537 1 0.0424 0.9921 0.992 0.000 0.008
#> GSM99539 3 0.4291 0.8107 0.000 0.180 0.820
#> GSM99541 1 0.0424 0.9921 0.992 0.000 0.008
#> GSM99543 2 0.1964 0.9450 0.000 0.944 0.056
#> GSM99545 3 0.5138 0.6650 0.000 0.252 0.748
#> GSM99547 3 0.3722 0.9169 0.088 0.024 0.888
#> GSM99549 2 0.1529 0.9533 0.000 0.960 0.040
#> GSM99551 1 0.1289 0.9834 0.968 0.000 0.032
#> GSM99553 3 0.2773 0.9501 0.048 0.024 0.928
#> GSM99555 2 0.0000 0.9633 0.000 1.000 0.000
#> GSM99557 2 0.0592 0.9616 0.000 0.988 0.012
#> GSM99559 3 0.2356 0.9127 0.000 0.072 0.928
#> GSM99561 2 0.1031 0.9585 0.000 0.976 0.024
#> GSM99563 3 0.2773 0.9501 0.048 0.024 0.928
#> GSM99565 2 0.0000 0.9633 0.000 1.000 0.000
#> GSM99573 2 0.1529 0.9533 0.000 0.960 0.040
#> GSM99577 1 0.0892 0.9889 0.980 0.000 0.020
#> GSM99579 2 0.0237 0.9624 0.000 0.996 0.004
#> GSM99581 3 0.2773 0.9501 0.048 0.024 0.928
#> GSM99583 3 0.5136 0.8513 0.044 0.132 0.824
#> GSM99585 2 0.0000 0.9633 0.000 1.000 0.000
#> GSM99587 1 0.1031 0.9876 0.976 0.000 0.024
#> GSM99589 2 0.0000 0.9633 0.000 1.000 0.000
#> GSM99591 2 0.0000 0.9633 0.000 1.000 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM99497 3 0.0000 0.7659 0.000 0.000 1.000 0.000
#> GSM99503 1 0.0000 0.9245 1.000 0.000 0.000 0.000
#> GSM99505 1 0.1624 0.9073 0.952 0.000 0.028 0.020
#> GSM99507 3 0.0000 0.7659 0.000 0.000 1.000 0.000
#> GSM99567 3 0.0000 0.7659 0.000 0.000 1.000 0.000
#> GSM99575 1 0.0000 0.9245 1.000 0.000 0.000 0.000
#> GSM99593 3 0.0000 0.7659 0.000 0.000 1.000 0.000
#> GSM99595 3 0.0000 0.7659 0.000 0.000 1.000 0.000
#> GSM99469 1 0.0707 0.9219 0.980 0.000 0.000 0.020
#> GSM99499 1 0.0707 0.9219 0.980 0.000 0.000 0.020
#> GSM99501 1 0.0707 0.9219 0.980 0.000 0.000 0.020
#> GSM99509 3 0.0000 0.7659 0.000 0.000 1.000 0.000
#> GSM99569 3 0.0592 0.7489 0.000 0.000 0.984 0.016
#> GSM99597 3 0.0592 0.7493 0.000 0.000 0.984 0.016
#> GSM99601 2 0.2647 0.7921 0.000 0.880 0.000 0.120
#> GSM99459 1 0.0921 0.9200 0.972 0.000 0.000 0.028
#> GSM99461 1 0.0921 0.9200 0.972 0.000 0.000 0.028
#> GSM99511 3 0.0000 0.7659 0.000 0.000 1.000 0.000
#> GSM99513 3 0.0000 0.7659 0.000 0.000 1.000 0.000
#> GSM99515 3 0.0000 0.7659 0.000 0.000 1.000 0.000
#> GSM99517 1 0.0000 0.9245 1.000 0.000 0.000 0.000
#> GSM99519 1 0.0921 0.9200 0.972 0.000 0.000 0.028
#> GSM99521 3 0.0469 0.7560 0.000 0.000 0.988 0.012
#> GSM99523 3 0.0188 0.7620 0.000 0.000 0.996 0.004
#> GSM99571 1 0.1302 0.9187 0.956 0.000 0.000 0.044
#> GSM99599 1 0.0188 0.9245 0.996 0.000 0.000 0.004
#> GSM99433 2 0.4290 0.6625 0.000 0.772 0.016 0.212
#> GSM99435 3 0.4500 0.2214 0.000 0.000 0.684 0.316
#> GSM99437 2 0.0707 0.8010 0.000 0.980 0.000 0.020
#> GSM99439 2 0.4679 0.6787 0.000 0.648 0.000 0.352
#> GSM99441 1 0.0188 0.9245 0.996 0.000 0.000 0.004
#> GSM99443 2 0.1389 0.7999 0.000 0.952 0.000 0.048
#> GSM99445 2 0.2011 0.7957 0.000 0.920 0.000 0.080
#> GSM99447 2 0.1022 0.8016 0.000 0.968 0.000 0.032
#> GSM99449 3 0.0000 0.7659 0.000 0.000 1.000 0.000
#> GSM99451 3 0.4746 0.0750 0.000 0.000 0.632 0.368
#> GSM99453 1 0.2704 0.8924 0.876 0.000 0.000 0.124
#> GSM99455 1 0.2704 0.8924 0.876 0.000 0.000 0.124
#> GSM99457 1 0.3444 0.8592 0.816 0.000 0.000 0.184
#> GSM99463 2 0.4661 0.6791 0.000 0.652 0.000 0.348
#> GSM99465 4 0.8041 0.4320 0.192 0.016 0.368 0.424
#> GSM99467 2 0.1867 0.7820 0.000 0.928 0.000 0.072
#> GSM99471 1 0.2868 0.8887 0.864 0.000 0.000 0.136
#> GSM99473 1 0.0817 0.9211 0.976 0.000 0.000 0.024
#> GSM99475 3 0.4804 0.0240 0.000 0.000 0.616 0.384
#> GSM99477 2 0.5994 0.4897 0.000 0.692 0.152 0.156
#> GSM99479 2 0.3052 0.7366 0.000 0.860 0.004 0.136
#> GSM99481 1 0.0188 0.9245 0.996 0.000 0.000 0.004
#> GSM99483 1 0.2647 0.8941 0.880 0.000 0.000 0.120
#> GSM99485 2 0.1302 0.7960 0.000 0.956 0.000 0.044
#> GSM99487 2 0.0592 0.8008 0.000 0.984 0.000 0.016
#> GSM99489 2 0.4605 0.6820 0.000 0.664 0.000 0.336
#> GSM99491 2 0.1474 0.7995 0.000 0.948 0.000 0.052
#> GSM99493 1 0.3444 0.8592 0.816 0.000 0.000 0.184
#> GSM99495 2 0.4661 0.6791 0.000 0.652 0.000 0.348
#> GSM99525 1 0.2216 0.9041 0.908 0.000 0.000 0.092
#> GSM99527 3 0.6501 -0.4423 0.004 0.060 0.480 0.456
#> GSM99529 2 0.6310 0.2328 0.000 0.576 0.072 0.352
#> GSM99531 3 0.4877 -0.0520 0.000 0.000 0.592 0.408
#> GSM99533 3 0.5172 -0.0804 0.008 0.000 0.588 0.404
#> GSM99535 2 0.3108 0.7576 0.016 0.872 0.000 0.112
#> GSM99537 1 0.0469 0.9253 0.988 0.000 0.000 0.012
#> GSM99539 3 0.7110 -0.5274 0.000 0.128 0.460 0.412
#> GSM99541 1 0.1867 0.9014 0.928 0.000 0.000 0.072
#> GSM99543 2 0.4898 0.6536 0.000 0.584 0.000 0.416
#> GSM99545 4 0.7225 0.4702 0.000 0.160 0.328 0.512
#> GSM99547 3 0.6724 -0.4720 0.004 0.076 0.468 0.452
#> GSM99549 2 0.4713 0.6739 0.000 0.640 0.000 0.360
#> GSM99551 1 0.4998 0.3692 0.512 0.000 0.000 0.488
#> GSM99553 3 0.0000 0.7659 0.000 0.000 1.000 0.000
#> GSM99555 2 0.1211 0.8022 0.000 0.960 0.000 0.040
#> GSM99557 2 0.3486 0.7633 0.000 0.812 0.000 0.188
#> GSM99559 3 0.0000 0.7659 0.000 0.000 1.000 0.000
#> GSM99561 2 0.4134 0.7489 0.000 0.740 0.000 0.260
#> GSM99563 3 0.0000 0.7659 0.000 0.000 1.000 0.000
#> GSM99565 2 0.0817 0.8011 0.000 0.976 0.000 0.024
#> GSM99573 2 0.4713 0.6739 0.000 0.640 0.000 0.360
#> GSM99577 1 0.3569 0.8557 0.804 0.000 0.000 0.196
#> GSM99579 2 0.1637 0.7997 0.000 0.940 0.000 0.060
#> GSM99581 3 0.0000 0.7659 0.000 0.000 1.000 0.000
#> GSM99583 2 0.7953 -0.1872 0.008 0.456 0.268 0.268
#> GSM99585 2 0.3400 0.7069 0.000 0.820 0.000 0.180
#> GSM99587 1 0.3444 0.8592 0.816 0.000 0.000 0.184
#> GSM99589 2 0.1118 0.7952 0.000 0.964 0.000 0.036
#> GSM99591 2 0.2011 0.7957 0.000 0.920 0.000 0.080
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM99497 3 0.0000 0.994 0.000 0.000 1.000 0.000 0.000
#> GSM99503 1 0.0000 0.860 1.000 0.000 0.000 0.000 0.000
#> GSM99505 1 0.1484 0.838 0.944 0.000 0.048 0.000 0.008
#> GSM99507 3 0.0000 0.994 0.000 0.000 1.000 0.000 0.000
#> GSM99567 3 0.0000 0.994 0.000 0.000 1.000 0.000 0.000
#> GSM99575 1 0.0000 0.860 1.000 0.000 0.000 0.000 0.000
#> GSM99593 3 0.0000 0.994 0.000 0.000 1.000 0.000 0.000
#> GSM99595 3 0.0000 0.994 0.000 0.000 1.000 0.000 0.000
#> GSM99469 1 0.0510 0.858 0.984 0.000 0.000 0.000 0.016
#> GSM99499 1 0.0290 0.860 0.992 0.000 0.000 0.000 0.008
#> GSM99501 1 0.0510 0.858 0.984 0.000 0.000 0.000 0.016
#> GSM99509 3 0.0162 0.994 0.000 0.000 0.996 0.000 0.004
#> GSM99569 3 0.0324 0.992 0.000 0.000 0.992 0.004 0.004
#> GSM99597 3 0.0162 0.992 0.000 0.000 0.996 0.000 0.004
#> GSM99601 2 0.3912 0.447 0.000 0.752 0.000 0.020 0.228
#> GSM99459 1 0.2782 0.816 0.880 0.000 0.000 0.072 0.048
#> GSM99461 1 0.2782 0.816 0.880 0.000 0.000 0.072 0.048
#> GSM99511 3 0.0451 0.991 0.000 0.000 0.988 0.004 0.008
#> GSM99513 3 0.0451 0.991 0.000 0.000 0.988 0.004 0.008
#> GSM99515 3 0.0000 0.994 0.000 0.000 1.000 0.000 0.000
#> GSM99517 1 0.0000 0.860 1.000 0.000 0.000 0.000 0.000
#> GSM99519 1 0.2654 0.819 0.888 0.000 0.000 0.064 0.048
#> GSM99521 3 0.0510 0.979 0.000 0.000 0.984 0.016 0.000
#> GSM99523 3 0.0486 0.989 0.004 0.000 0.988 0.004 0.004
#> GSM99571 1 0.2770 0.840 0.880 0.000 0.000 0.044 0.076
#> GSM99599 1 0.0290 0.860 0.992 0.000 0.000 0.000 0.008
#> GSM99433 2 0.4589 0.527 0.000 0.704 0.000 0.248 0.048
#> GSM99435 4 0.4418 0.675 0.000 0.000 0.332 0.652 0.016
#> GSM99437 2 0.2388 0.727 0.000 0.900 0.000 0.028 0.072
#> GSM99439 5 0.4150 0.946 0.000 0.388 0.000 0.000 0.612
#> GSM99441 1 0.0404 0.861 0.988 0.000 0.000 0.000 0.012
#> GSM99443 2 0.2017 0.711 0.000 0.912 0.000 0.008 0.080
#> GSM99445 2 0.2806 0.614 0.000 0.844 0.000 0.004 0.152
#> GSM99447 2 0.2325 0.730 0.000 0.904 0.000 0.028 0.068
#> GSM99449 3 0.0290 0.992 0.000 0.000 0.992 0.000 0.008
#> GSM99451 4 0.3521 0.793 0.000 0.000 0.232 0.764 0.004
#> GSM99453 1 0.4909 0.773 0.716 0.000 0.000 0.120 0.164
#> GSM99455 1 0.4909 0.773 0.716 0.000 0.000 0.120 0.164
#> GSM99457 1 0.6000 0.656 0.572 0.000 0.000 0.160 0.268
#> GSM99463 5 0.4182 0.950 0.000 0.400 0.000 0.000 0.600
#> GSM99465 4 0.6277 0.639 0.216 0.008 0.056 0.644 0.076
#> GSM99467 2 0.2077 0.723 0.000 0.920 0.000 0.040 0.040
#> GSM99471 1 0.4944 0.790 0.724 0.004 0.000 0.116 0.156
#> GSM99473 1 0.1626 0.846 0.940 0.000 0.000 0.016 0.044
#> GSM99475 4 0.3421 0.811 0.000 0.000 0.204 0.788 0.008
#> GSM99477 2 0.4372 0.634 0.000 0.804 0.068 0.084 0.044
#> GSM99479 2 0.2370 0.714 0.000 0.904 0.000 0.056 0.040
#> GSM99481 1 0.0404 0.861 0.988 0.000 0.000 0.000 0.012
#> GSM99483 1 0.4827 0.776 0.724 0.000 0.000 0.116 0.160
#> GSM99485 2 0.0898 0.735 0.000 0.972 0.000 0.008 0.020
#> GSM99487 2 0.2193 0.733 0.000 0.912 0.000 0.028 0.060
#> GSM99489 5 0.4350 0.939 0.000 0.408 0.000 0.004 0.588
#> GSM99491 2 0.0798 0.737 0.000 0.976 0.000 0.008 0.016
#> GSM99493 1 0.5929 0.665 0.584 0.000 0.000 0.156 0.260
#> GSM99495 5 0.4182 0.950 0.000 0.400 0.000 0.000 0.600
#> GSM99525 1 0.3682 0.819 0.820 0.000 0.000 0.072 0.108
#> GSM99527 4 0.4311 0.815 0.000 0.024 0.144 0.788 0.044
#> GSM99529 2 0.4918 0.514 0.000 0.716 0.008 0.204 0.072
#> GSM99531 4 0.3513 0.818 0.000 0.000 0.180 0.800 0.020
#> GSM99533 4 0.3209 0.819 0.000 0.000 0.180 0.812 0.008
#> GSM99535 2 0.3223 0.681 0.016 0.868 0.000 0.052 0.064
#> GSM99537 1 0.1725 0.857 0.936 0.000 0.000 0.044 0.020
#> GSM99539 4 0.5242 0.758 0.000 0.112 0.132 0.728 0.028
#> GSM99541 1 0.3477 0.796 0.824 0.000 0.000 0.136 0.040
#> GSM99543 5 0.4604 0.828 0.000 0.428 0.000 0.012 0.560
#> GSM99545 4 0.5561 0.740 0.000 0.068 0.108 0.720 0.104
#> GSM99547 4 0.4800 0.796 0.000 0.036 0.136 0.764 0.064
#> GSM99549 5 0.4299 0.943 0.000 0.388 0.000 0.004 0.608
#> GSM99551 4 0.6517 0.222 0.172 0.008 0.000 0.508 0.312
#> GSM99553 3 0.0000 0.994 0.000 0.000 1.000 0.000 0.000
#> GSM99555 2 0.2351 0.716 0.000 0.896 0.000 0.016 0.088
#> GSM99557 2 0.4288 -0.343 0.000 0.612 0.000 0.004 0.384
#> GSM99559 3 0.0000 0.994 0.000 0.000 1.000 0.000 0.000
#> GSM99561 2 0.4592 -0.198 0.000 0.644 0.000 0.024 0.332
#> GSM99563 3 0.0451 0.991 0.000 0.000 0.988 0.004 0.008
#> GSM99565 2 0.2362 0.725 0.000 0.900 0.000 0.024 0.076
#> GSM99573 5 0.4299 0.943 0.000 0.388 0.000 0.004 0.608
#> GSM99577 1 0.5731 0.722 0.624 0.000 0.000 0.180 0.196
#> GSM99579 2 0.0992 0.736 0.000 0.968 0.000 0.008 0.024
#> GSM99581 3 0.0162 0.994 0.000 0.000 0.996 0.000 0.004
#> GSM99583 2 0.6380 0.471 0.012 0.672 0.104 0.128 0.084
#> GSM99585 2 0.3485 0.680 0.000 0.828 0.000 0.124 0.048
#> GSM99587 1 0.5929 0.665 0.584 0.000 0.000 0.156 0.260
#> GSM99589 2 0.0162 0.740 0.000 0.996 0.000 0.004 0.000
#> GSM99591 2 0.2629 0.644 0.000 0.860 0.000 0.004 0.136
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM99497 3 0.0000 0.9817 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM99503 1 0.0363 0.7106 0.988 0.000 0.000 0.000 0.000 0.012
#> GSM99505 1 0.2357 0.6743 0.904 0.000 0.048 0.004 0.012 0.032
#> GSM99507 3 0.0000 0.9817 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM99567 3 0.0000 0.9817 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM99575 1 0.0363 0.7106 0.988 0.000 0.000 0.000 0.000 0.012
#> GSM99593 3 0.0000 0.9817 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM99595 3 0.0000 0.9817 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM99469 1 0.1707 0.6998 0.928 0.000 0.000 0.004 0.012 0.056
#> GSM99499 1 0.1332 0.7071 0.952 0.000 0.000 0.008 0.012 0.028
#> GSM99501 1 0.1707 0.6998 0.928 0.000 0.000 0.004 0.012 0.056
#> GSM99509 3 0.0405 0.9805 0.000 0.000 0.988 0.000 0.004 0.008
#> GSM99569 3 0.0692 0.9776 0.000 0.000 0.976 0.000 0.004 0.020
#> GSM99597 3 0.0260 0.9805 0.000 0.000 0.992 0.000 0.000 0.008
#> GSM99601 2 0.5053 0.3776 0.000 0.564 0.000 0.012 0.368 0.056
#> GSM99459 1 0.3861 0.6096 0.804 0.000 0.000 0.036 0.056 0.104
#> GSM99461 1 0.3861 0.6096 0.804 0.000 0.000 0.036 0.056 0.104
#> GSM99511 3 0.1692 0.9568 0.000 0.000 0.932 0.008 0.012 0.048
#> GSM99513 3 0.1692 0.9568 0.000 0.000 0.932 0.008 0.012 0.048
#> GSM99515 3 0.0000 0.9817 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM99517 1 0.0363 0.7106 0.988 0.000 0.000 0.000 0.000 0.012
#> GSM99519 1 0.3861 0.6096 0.804 0.000 0.000 0.036 0.056 0.104
#> GSM99521 3 0.0458 0.9724 0.000 0.000 0.984 0.016 0.000 0.000
#> GSM99523 3 0.1296 0.9681 0.000 0.000 0.952 0.004 0.012 0.032
#> GSM99571 1 0.2653 0.5453 0.844 0.000 0.000 0.000 0.012 0.144
#> GSM99599 1 0.0458 0.7091 0.984 0.000 0.000 0.000 0.000 0.016
#> GSM99433 2 0.5507 0.5260 0.000 0.636 0.000 0.228 0.052 0.084
#> GSM99435 4 0.4355 0.7507 0.000 0.008 0.164 0.748 0.008 0.072
#> GSM99437 2 0.3433 0.7422 0.000 0.816 0.000 0.012 0.132 0.040
#> GSM99439 5 0.2653 0.8403 0.000 0.100 0.000 0.004 0.868 0.028
#> GSM99441 1 0.0458 0.7091 0.984 0.000 0.000 0.000 0.000 0.016
#> GSM99443 2 0.3878 0.7122 0.000 0.764 0.000 0.004 0.176 0.056
#> GSM99445 2 0.4802 0.5033 0.000 0.620 0.000 0.008 0.316 0.056
#> GSM99447 2 0.4029 0.7402 0.000 0.784 0.000 0.032 0.132 0.052
#> GSM99449 3 0.0881 0.9759 0.000 0.000 0.972 0.008 0.008 0.012
#> GSM99451 4 0.1686 0.8378 0.000 0.000 0.064 0.924 0.000 0.012
#> GSM99453 1 0.4219 -0.1203 0.620 0.000 0.000 0.008 0.012 0.360
#> GSM99455 1 0.4219 -0.1203 0.620 0.000 0.000 0.008 0.012 0.360
#> GSM99457 6 0.4475 0.6984 0.448 0.000 0.000 0.008 0.016 0.528
#> GSM99463 5 0.1910 0.8411 0.000 0.108 0.000 0.000 0.892 0.000
#> GSM99465 4 0.7227 0.4660 0.216 0.036 0.004 0.500 0.056 0.188
#> GSM99467 2 0.1572 0.7508 0.000 0.936 0.000 0.028 0.000 0.036
#> GSM99471 1 0.4537 -0.0233 0.612 0.012 0.000 0.008 0.012 0.356
#> GSM99473 1 0.2499 0.6748 0.880 0.004 0.000 0.004 0.016 0.096
#> GSM99475 4 0.2272 0.8358 0.000 0.000 0.056 0.900 0.004 0.040
#> GSM99477 2 0.2756 0.7376 0.000 0.880 0.012 0.060 0.004 0.044
#> GSM99479 2 0.2000 0.7435 0.000 0.916 0.004 0.032 0.000 0.048
#> GSM99481 1 0.0458 0.7091 0.984 0.000 0.000 0.000 0.000 0.016
#> GSM99483 1 0.4062 -0.0495 0.640 0.000 0.000 0.004 0.012 0.344
#> GSM99485 2 0.2341 0.7557 0.000 0.900 0.000 0.012 0.032 0.056
#> GSM99487 2 0.3307 0.7478 0.000 0.828 0.000 0.012 0.120 0.040
#> GSM99489 5 0.2890 0.8247 0.000 0.128 0.000 0.004 0.844 0.024
#> GSM99491 2 0.2957 0.7218 0.000 0.844 0.000 0.004 0.120 0.032
#> GSM99493 6 0.4486 0.6973 0.464 0.000 0.000 0.008 0.016 0.512
#> GSM99495 5 0.1910 0.8411 0.000 0.108 0.000 0.000 0.892 0.000
#> GSM99525 1 0.3656 0.2871 0.728 0.000 0.000 0.004 0.012 0.256
#> GSM99527 4 0.3947 0.7977 0.000 0.044 0.016 0.804 0.020 0.116
#> GSM99529 2 0.4063 0.6567 0.004 0.768 0.004 0.080 0.000 0.144
#> GSM99531 4 0.2900 0.8284 0.000 0.000 0.044 0.860 0.008 0.088
#> GSM99533 4 0.2452 0.8326 0.000 0.000 0.044 0.892 0.008 0.056
#> GSM99535 2 0.3260 0.7306 0.016 0.848 0.000 0.012 0.028 0.096
#> GSM99537 1 0.1167 0.7073 0.960 0.000 0.000 0.012 0.008 0.020
#> GSM99539 4 0.3222 0.8226 0.000 0.044 0.024 0.864 0.020 0.048
#> GSM99541 1 0.4187 0.5804 0.776 0.000 0.000 0.084 0.028 0.112
#> GSM99543 5 0.4257 0.7394 0.000 0.204 0.000 0.008 0.728 0.060
#> GSM99545 4 0.2723 0.8197 0.000 0.024 0.020 0.892 0.040 0.024
#> GSM99547 4 0.5201 0.7247 0.000 0.128 0.012 0.692 0.020 0.148
#> GSM99549 5 0.3297 0.8342 0.000 0.100 0.000 0.008 0.832 0.060
#> GSM99551 6 0.5381 0.3948 0.136 0.008 0.000 0.184 0.016 0.656
#> GSM99553 3 0.0000 0.9817 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM99555 2 0.3699 0.7309 0.000 0.788 0.000 0.012 0.160 0.040
#> GSM99557 5 0.4441 0.4737 0.000 0.344 0.000 0.004 0.620 0.032
#> GSM99559 3 0.0000 0.9817 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM99561 5 0.5673 0.3406 0.000 0.412 0.000 0.020 0.476 0.092
#> GSM99563 3 0.1692 0.9568 0.000 0.000 0.932 0.008 0.012 0.048
#> GSM99565 2 0.3680 0.7349 0.000 0.796 0.000 0.016 0.148 0.040
#> GSM99573 5 0.3297 0.8342 0.000 0.100 0.000 0.008 0.832 0.060
#> GSM99577 1 0.5031 -0.3060 0.504 0.000 0.000 0.040 0.016 0.440
#> GSM99579 2 0.3017 0.7202 0.000 0.848 0.000 0.004 0.096 0.052
#> GSM99581 3 0.0881 0.9759 0.000 0.000 0.972 0.008 0.008 0.012
#> GSM99583 2 0.3510 0.7004 0.000 0.832 0.028 0.040 0.004 0.096
#> GSM99585 2 0.3721 0.7177 0.000 0.804 0.000 0.100 0.012 0.084
#> GSM99587 6 0.4486 0.6973 0.464 0.000 0.000 0.008 0.016 0.512
#> GSM99589 2 0.2123 0.7621 0.000 0.908 0.000 0.008 0.064 0.020
#> GSM99591 2 0.4686 0.5524 0.000 0.648 0.000 0.008 0.288 0.056
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 disease.state(p) cell.type(p) k
#> CV:kmeans 60 3.72e-04 0.001303 2
#> CV:kmeans 83 8.28e-04 0.016801 3
#> CV:kmeans 71 8.08e-06 0.000365 4
#> CV:kmeans 80 1.13e-06 0.000638 5
#> CV:kmeans 74 5.67e-08 0.000144 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 21512 rows and 85 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 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.611 0.731 0.898 0.4977 0.497 0.497
#> 3 3 0.951 0.940 0.974 0.3476 0.766 0.559
#> 4 4 0.811 0.818 0.900 0.0938 0.935 0.806
#> 5 5 0.686 0.648 0.796 0.0646 0.977 0.917
#> 6 6 0.658 0.464 0.660 0.0424 0.934 0.756
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
#> GSM99497 1 1.0000 0.1551 0.504 0.496
#> GSM99503 1 0.0000 0.8491 1.000 0.000
#> GSM99505 1 0.0000 0.8491 1.000 0.000
#> GSM99507 1 0.9996 0.1799 0.512 0.488
#> GSM99567 1 1.0000 0.1417 0.500 0.500
#> GSM99575 1 0.0000 0.8491 1.000 0.000
#> GSM99593 2 0.6438 0.7146 0.164 0.836
#> GSM99595 1 1.0000 0.1551 0.504 0.496
#> GSM99469 1 0.0000 0.8491 1.000 0.000
#> GSM99499 1 0.0000 0.8491 1.000 0.000
#> GSM99501 1 0.0000 0.8491 1.000 0.000
#> GSM99509 1 0.9754 0.3756 0.592 0.408
#> GSM99569 1 0.9580 0.4279 0.620 0.380
#> GSM99597 1 0.9323 0.4825 0.652 0.348
#> GSM99601 2 0.0000 0.9021 0.000 1.000
#> GSM99459 1 0.0000 0.8491 1.000 0.000
#> GSM99461 1 0.0000 0.8491 1.000 0.000
#> GSM99511 1 0.9977 0.2266 0.528 0.472
#> GSM99513 2 1.0000 -0.1822 0.500 0.500
#> GSM99515 1 0.9977 0.2265 0.528 0.472
#> GSM99517 1 0.0000 0.8491 1.000 0.000
#> GSM99519 1 0.0000 0.8491 1.000 0.000
#> GSM99521 1 0.9933 0.2783 0.548 0.452
#> GSM99523 1 0.0000 0.8491 1.000 0.000
#> GSM99571 1 0.0000 0.8491 1.000 0.000
#> GSM99599 1 0.0000 0.8491 1.000 0.000
#> GSM99433 2 0.0000 0.9021 0.000 1.000
#> GSM99435 2 0.9427 0.3076 0.360 0.640
#> GSM99437 2 0.0000 0.9021 0.000 1.000
#> GSM99439 2 0.0000 0.9021 0.000 1.000
#> GSM99441 1 0.0000 0.8491 1.000 0.000
#> GSM99443 2 0.0000 0.9021 0.000 1.000
#> GSM99445 2 0.0000 0.9021 0.000 1.000
#> GSM99447 2 0.0000 0.9021 0.000 1.000
#> GSM99449 2 0.0000 0.9021 0.000 1.000
#> GSM99451 1 0.5059 0.7704 0.888 0.112
#> GSM99453 1 0.0000 0.8491 1.000 0.000
#> GSM99455 1 0.0000 0.8491 1.000 0.000
#> GSM99457 1 0.0000 0.8491 1.000 0.000
#> GSM99463 2 0.0000 0.9021 0.000 1.000
#> GSM99465 1 0.0000 0.8491 1.000 0.000
#> GSM99467 2 0.0000 0.9021 0.000 1.000
#> GSM99471 1 0.0000 0.8491 1.000 0.000
#> GSM99473 1 0.0000 0.8491 1.000 0.000
#> GSM99475 1 0.5946 0.7445 0.856 0.144
#> GSM99477 2 0.0000 0.9021 0.000 1.000
#> GSM99479 2 0.0000 0.9021 0.000 1.000
#> GSM99481 1 0.0000 0.8491 1.000 0.000
#> GSM99483 1 0.0000 0.8491 1.000 0.000
#> GSM99485 2 0.0000 0.9021 0.000 1.000
#> GSM99487 2 0.0000 0.9021 0.000 1.000
#> GSM99489 2 0.0000 0.9021 0.000 1.000
#> GSM99491 2 0.0000 0.9021 0.000 1.000
#> GSM99493 1 0.0000 0.8491 1.000 0.000
#> GSM99495 2 0.0000 0.9021 0.000 1.000
#> GSM99525 1 0.0000 0.8491 1.000 0.000
#> GSM99527 1 0.8713 0.5172 0.708 0.292
#> GSM99529 2 0.0672 0.8950 0.008 0.992
#> GSM99531 1 0.0000 0.8491 1.000 0.000
#> GSM99533 1 0.0000 0.8491 1.000 0.000
#> GSM99535 2 0.9732 0.2753 0.404 0.596
#> GSM99537 1 0.0000 0.8491 1.000 0.000
#> GSM99539 2 0.0000 0.9021 0.000 1.000
#> GSM99541 1 0.0000 0.8491 1.000 0.000
#> GSM99543 2 0.9754 0.2663 0.408 0.592
#> GSM99545 2 0.0000 0.9021 0.000 1.000
#> GSM99547 1 0.7950 0.5875 0.760 0.240
#> GSM99549 2 0.0000 0.9021 0.000 1.000
#> GSM99551 1 0.0000 0.8491 1.000 0.000
#> GSM99553 2 0.8813 0.4651 0.300 0.700
#> GSM99555 2 0.0000 0.9021 0.000 1.000
#> GSM99557 2 0.0000 0.9021 0.000 1.000
#> GSM99559 2 0.0000 0.9021 0.000 1.000
#> GSM99561 2 0.0000 0.9021 0.000 1.000
#> GSM99563 1 0.9775 0.3677 0.588 0.412
#> GSM99565 2 0.0000 0.9021 0.000 1.000
#> GSM99573 2 0.0000 0.9021 0.000 1.000
#> GSM99577 1 0.0000 0.8491 1.000 0.000
#> GSM99579 2 0.0000 0.9021 0.000 1.000
#> GSM99581 2 0.9896 0.0403 0.440 0.560
#> GSM99583 2 0.9608 0.3263 0.384 0.616
#> GSM99585 2 0.0000 0.9021 0.000 1.000
#> GSM99587 1 0.0000 0.8491 1.000 0.000
#> GSM99589 2 0.0000 0.9021 0.000 1.000
#> GSM99591 2 0.0000 0.9021 0.000 1.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM99497 3 0.0000 0.974 0.000 0.000 1.000
#> GSM99503 1 0.0000 0.984 1.000 0.000 0.000
#> GSM99505 1 0.0000 0.984 1.000 0.000 0.000
#> GSM99507 3 0.0000 0.974 0.000 0.000 1.000
#> GSM99567 3 0.0000 0.974 0.000 0.000 1.000
#> GSM99575 1 0.0000 0.984 1.000 0.000 0.000
#> GSM99593 3 0.0000 0.974 0.000 0.000 1.000
#> GSM99595 3 0.0000 0.974 0.000 0.000 1.000
#> GSM99469 1 0.0000 0.984 1.000 0.000 0.000
#> GSM99499 1 0.0000 0.984 1.000 0.000 0.000
#> GSM99501 1 0.0000 0.984 1.000 0.000 0.000
#> GSM99509 3 0.0000 0.974 0.000 0.000 1.000
#> GSM99569 3 0.0000 0.974 0.000 0.000 1.000
#> GSM99597 3 0.0000 0.974 0.000 0.000 1.000
#> GSM99601 2 0.0000 0.960 0.000 1.000 0.000
#> GSM99459 1 0.0000 0.984 1.000 0.000 0.000
#> GSM99461 1 0.0000 0.984 1.000 0.000 0.000
#> GSM99511 3 0.0000 0.974 0.000 0.000 1.000
#> GSM99513 3 0.0000 0.974 0.000 0.000 1.000
#> GSM99515 3 0.0000 0.974 0.000 0.000 1.000
#> GSM99517 1 0.0000 0.984 1.000 0.000 0.000
#> GSM99519 1 0.0000 0.984 1.000 0.000 0.000
#> GSM99521 3 0.0000 0.974 0.000 0.000 1.000
#> GSM99523 3 0.0000 0.974 0.000 0.000 1.000
#> GSM99571 1 0.0000 0.984 1.000 0.000 0.000
#> GSM99599 1 0.0000 0.984 1.000 0.000 0.000
#> GSM99433 2 0.0000 0.960 0.000 1.000 0.000
#> GSM99435 3 0.0000 0.974 0.000 0.000 1.000
#> GSM99437 2 0.0000 0.960 0.000 1.000 0.000
#> GSM99439 2 0.0000 0.960 0.000 1.000 0.000
#> GSM99441 1 0.0000 0.984 1.000 0.000 0.000
#> GSM99443 2 0.0000 0.960 0.000 1.000 0.000
#> GSM99445 2 0.0000 0.960 0.000 1.000 0.000
#> GSM99447 2 0.0000 0.960 0.000 1.000 0.000
#> GSM99449 3 0.0000 0.974 0.000 0.000 1.000
#> GSM99451 3 0.0000 0.974 0.000 0.000 1.000
#> GSM99453 1 0.0000 0.984 1.000 0.000 0.000
#> GSM99455 1 0.0000 0.984 1.000 0.000 0.000
#> GSM99457 1 0.0000 0.984 1.000 0.000 0.000
#> GSM99463 2 0.0000 0.960 0.000 1.000 0.000
#> GSM99465 1 0.4555 0.746 0.800 0.000 0.200
#> GSM99467 2 0.0000 0.960 0.000 1.000 0.000
#> GSM99471 1 0.0000 0.984 1.000 0.000 0.000
#> GSM99473 1 0.0000 0.984 1.000 0.000 0.000
#> GSM99475 3 0.0000 0.974 0.000 0.000 1.000
#> GSM99477 2 0.1289 0.934 0.000 0.968 0.032
#> GSM99479 2 0.0000 0.960 0.000 1.000 0.000
#> GSM99481 1 0.0000 0.984 1.000 0.000 0.000
#> GSM99483 1 0.0000 0.984 1.000 0.000 0.000
#> GSM99485 2 0.0000 0.960 0.000 1.000 0.000
#> GSM99487 2 0.0000 0.960 0.000 1.000 0.000
#> GSM99489 2 0.0000 0.960 0.000 1.000 0.000
#> GSM99491 2 0.0000 0.960 0.000 1.000 0.000
#> GSM99493 1 0.0000 0.984 1.000 0.000 0.000
#> GSM99495 2 0.0000 0.960 0.000 1.000 0.000
#> GSM99525 1 0.0000 0.984 1.000 0.000 0.000
#> GSM99527 3 0.6841 0.683 0.200 0.076 0.724
#> GSM99529 2 0.0592 0.951 0.000 0.988 0.012
#> GSM99531 3 0.0747 0.962 0.016 0.000 0.984
#> GSM99533 3 0.5397 0.613 0.280 0.000 0.720
#> GSM99535 2 0.4291 0.767 0.180 0.820 0.000
#> GSM99537 1 0.0000 0.984 1.000 0.000 0.000
#> GSM99539 2 0.5138 0.662 0.000 0.748 0.252
#> GSM99541 1 0.0000 0.984 1.000 0.000 0.000
#> GSM99543 2 0.0000 0.960 0.000 1.000 0.000
#> GSM99545 2 0.5016 0.680 0.000 0.760 0.240
#> GSM99547 1 0.6388 0.705 0.752 0.064 0.184
#> GSM99549 2 0.0000 0.960 0.000 1.000 0.000
#> GSM99551 1 0.0000 0.984 1.000 0.000 0.000
#> GSM99553 3 0.0000 0.974 0.000 0.000 1.000
#> GSM99555 2 0.0000 0.960 0.000 1.000 0.000
#> GSM99557 2 0.0000 0.960 0.000 1.000 0.000
#> GSM99559 3 0.1163 0.950 0.000 0.028 0.972
#> GSM99561 2 0.0000 0.960 0.000 1.000 0.000
#> GSM99563 3 0.0000 0.974 0.000 0.000 1.000
#> GSM99565 2 0.0000 0.960 0.000 1.000 0.000
#> GSM99573 2 0.0000 0.960 0.000 1.000 0.000
#> GSM99577 1 0.0000 0.984 1.000 0.000 0.000
#> GSM99579 2 0.0000 0.960 0.000 1.000 0.000
#> GSM99581 3 0.0000 0.974 0.000 0.000 1.000
#> GSM99583 2 0.8211 0.204 0.404 0.520 0.076
#> GSM99585 2 0.0000 0.960 0.000 1.000 0.000
#> GSM99587 1 0.0000 0.984 1.000 0.000 0.000
#> GSM99589 2 0.0000 0.960 0.000 1.000 0.000
#> GSM99591 2 0.0000 0.960 0.000 1.000 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM99497 3 0.0000 0.948 0.000 0.000 1.000 0.000
#> GSM99503 1 0.0188 0.936 0.996 0.000 0.000 0.004
#> GSM99505 1 0.2401 0.856 0.904 0.000 0.092 0.004
#> GSM99507 3 0.0000 0.948 0.000 0.000 1.000 0.000
#> GSM99567 3 0.0000 0.948 0.000 0.000 1.000 0.000
#> GSM99575 1 0.0188 0.936 0.996 0.000 0.000 0.004
#> GSM99593 3 0.0336 0.948 0.000 0.000 0.992 0.008
#> GSM99595 3 0.0336 0.948 0.000 0.000 0.992 0.008
#> GSM99469 1 0.0188 0.936 0.996 0.000 0.000 0.004
#> GSM99499 1 0.0188 0.936 0.996 0.000 0.000 0.004
#> GSM99501 1 0.0188 0.936 0.996 0.000 0.000 0.004
#> GSM99509 3 0.0188 0.948 0.000 0.000 0.996 0.004
#> GSM99569 3 0.0376 0.948 0.004 0.000 0.992 0.004
#> GSM99597 3 0.1824 0.907 0.004 0.000 0.936 0.060
#> GSM99601 2 0.0817 0.877 0.000 0.976 0.000 0.024
#> GSM99459 1 0.2149 0.891 0.912 0.000 0.000 0.088
#> GSM99461 1 0.2589 0.867 0.884 0.000 0.000 0.116
#> GSM99511 3 0.1637 0.912 0.000 0.000 0.940 0.060
#> GSM99513 3 0.0469 0.947 0.000 0.000 0.988 0.012
#> GSM99515 3 0.0000 0.948 0.000 0.000 1.000 0.000
#> GSM99517 1 0.0188 0.936 0.996 0.000 0.000 0.004
#> GSM99519 1 0.2149 0.892 0.912 0.000 0.000 0.088
#> GSM99521 3 0.2281 0.869 0.000 0.000 0.904 0.096
#> GSM99523 3 0.0657 0.944 0.004 0.000 0.984 0.012
#> GSM99571 1 0.0336 0.936 0.992 0.000 0.000 0.008
#> GSM99599 1 0.0000 0.936 1.000 0.000 0.000 0.000
#> GSM99433 2 0.4594 0.673 0.000 0.712 0.008 0.280
#> GSM99435 3 0.4907 0.202 0.000 0.000 0.580 0.420
#> GSM99437 2 0.1389 0.873 0.000 0.952 0.000 0.048
#> GSM99439 2 0.1792 0.862 0.000 0.932 0.000 0.068
#> GSM99441 1 0.0000 0.936 1.000 0.000 0.000 0.000
#> GSM99443 2 0.0921 0.876 0.000 0.972 0.000 0.028
#> GSM99445 2 0.0469 0.876 0.000 0.988 0.000 0.012
#> GSM99447 2 0.2081 0.865 0.000 0.916 0.000 0.084
#> GSM99449 3 0.0336 0.948 0.000 0.000 0.992 0.008
#> GSM99451 4 0.4564 0.466 0.000 0.000 0.328 0.672
#> GSM99453 1 0.1118 0.931 0.964 0.000 0.000 0.036
#> GSM99455 1 0.1211 0.930 0.960 0.000 0.000 0.040
#> GSM99457 1 0.1867 0.918 0.928 0.000 0.000 0.072
#> GSM99463 2 0.1474 0.868 0.000 0.948 0.000 0.052
#> GSM99465 4 0.6611 0.357 0.356 0.004 0.080 0.560
#> GSM99467 2 0.1940 0.860 0.000 0.924 0.000 0.076
#> GSM99471 1 0.1302 0.931 0.956 0.000 0.000 0.044
#> GSM99473 1 0.0336 0.935 0.992 0.000 0.000 0.008
#> GSM99475 4 0.3052 0.693 0.004 0.000 0.136 0.860
#> GSM99477 2 0.5770 0.631 0.000 0.712 0.148 0.140
#> GSM99479 2 0.2197 0.857 0.000 0.916 0.004 0.080
#> GSM99481 1 0.0000 0.936 1.000 0.000 0.000 0.000
#> GSM99483 1 0.1022 0.932 0.968 0.000 0.000 0.032
#> GSM99485 2 0.1302 0.870 0.000 0.956 0.000 0.044
#> GSM99487 2 0.1474 0.872 0.000 0.948 0.000 0.052
#> GSM99489 2 0.1118 0.872 0.000 0.964 0.000 0.036
#> GSM99491 2 0.0336 0.876 0.000 0.992 0.000 0.008
#> GSM99493 1 0.1302 0.929 0.956 0.000 0.000 0.044
#> GSM99495 2 0.1389 0.869 0.000 0.952 0.000 0.048
#> GSM99525 1 0.0469 0.935 0.988 0.000 0.000 0.012
#> GSM99527 4 0.2807 0.718 0.020 0.024 0.044 0.912
#> GSM99529 2 0.5879 0.365 0.008 0.596 0.028 0.368
#> GSM99531 4 0.5022 0.634 0.044 0.000 0.220 0.736
#> GSM99533 4 0.3464 0.714 0.056 0.000 0.076 0.868
#> GSM99535 2 0.5495 0.612 0.176 0.728 0.000 0.096
#> GSM99537 1 0.1474 0.928 0.948 0.000 0.000 0.052
#> GSM99539 4 0.5530 0.370 0.000 0.336 0.032 0.632
#> GSM99541 1 0.3873 0.745 0.772 0.000 0.000 0.228
#> GSM99543 2 0.3495 0.809 0.016 0.844 0.000 0.140
#> GSM99545 4 0.5228 0.423 0.000 0.312 0.024 0.664
#> GSM99547 4 0.6933 0.652 0.180 0.072 0.076 0.672
#> GSM99549 2 0.3311 0.796 0.000 0.828 0.000 0.172
#> GSM99551 1 0.5212 0.304 0.572 0.008 0.000 0.420
#> GSM99553 3 0.0779 0.942 0.000 0.004 0.980 0.016
#> GSM99555 2 0.1022 0.877 0.000 0.968 0.000 0.032
#> GSM99557 2 0.0817 0.874 0.000 0.976 0.000 0.024
#> GSM99559 3 0.2124 0.890 0.000 0.028 0.932 0.040
#> GSM99561 2 0.3444 0.787 0.000 0.816 0.000 0.184
#> GSM99563 3 0.0592 0.946 0.000 0.000 0.984 0.016
#> GSM99565 2 0.1474 0.875 0.000 0.948 0.000 0.052
#> GSM99573 2 0.2647 0.841 0.000 0.880 0.000 0.120
#> GSM99577 1 0.3266 0.826 0.832 0.000 0.000 0.168
#> GSM99579 2 0.0921 0.873 0.000 0.972 0.000 0.028
#> GSM99581 3 0.0336 0.948 0.000 0.000 0.992 0.008
#> GSM99583 2 0.9894 -0.279 0.284 0.300 0.200 0.216
#> GSM99585 2 0.3569 0.773 0.000 0.804 0.000 0.196
#> GSM99587 1 0.1389 0.927 0.952 0.000 0.000 0.048
#> GSM99589 2 0.0817 0.877 0.000 0.976 0.000 0.024
#> GSM99591 2 0.0336 0.876 0.000 0.992 0.000 0.008
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM99497 3 0.0000 0.9308 0.000 0.000 1.000 0.000 0.000
#> GSM99503 1 0.0162 0.8423 0.996 0.000 0.000 0.000 0.004
#> GSM99505 1 0.3218 0.7565 0.848 0.000 0.124 0.012 0.016
#> GSM99507 3 0.0162 0.9322 0.000 0.000 0.996 0.004 0.000
#> GSM99567 3 0.0324 0.9324 0.000 0.000 0.992 0.004 0.004
#> GSM99575 1 0.0290 0.8418 0.992 0.000 0.000 0.000 0.008
#> GSM99593 3 0.1106 0.9335 0.000 0.000 0.964 0.024 0.012
#> GSM99595 3 0.0451 0.9329 0.000 0.000 0.988 0.008 0.004
#> GSM99469 1 0.1195 0.8391 0.960 0.000 0.000 0.012 0.028
#> GSM99499 1 0.2381 0.8487 0.908 0.000 0.004 0.036 0.052
#> GSM99501 1 0.1483 0.8377 0.952 0.000 0.008 0.012 0.028
#> GSM99509 3 0.0912 0.9339 0.000 0.000 0.972 0.016 0.012
#> GSM99569 3 0.1982 0.9235 0.012 0.000 0.932 0.028 0.028
#> GSM99597 3 0.2784 0.8639 0.004 0.000 0.872 0.108 0.016
#> GSM99601 2 0.1732 0.6456 0.000 0.920 0.000 0.000 0.080
#> GSM99459 1 0.3159 0.7934 0.856 0.000 0.000 0.056 0.088
#> GSM99461 1 0.3697 0.7645 0.820 0.000 0.000 0.080 0.100
#> GSM99511 3 0.2927 0.8775 0.000 0.000 0.868 0.092 0.040
#> GSM99513 3 0.2124 0.9177 0.000 0.000 0.916 0.056 0.028
#> GSM99515 3 0.0162 0.9321 0.000 0.000 0.996 0.004 0.000
#> GSM99517 1 0.0609 0.8412 0.980 0.000 0.000 0.000 0.020
#> GSM99519 1 0.2983 0.7975 0.868 0.000 0.000 0.056 0.076
#> GSM99521 3 0.3081 0.8108 0.000 0.000 0.832 0.156 0.012
#> GSM99523 3 0.2027 0.9128 0.040 0.000 0.928 0.008 0.024
#> GSM99571 1 0.2450 0.8443 0.896 0.000 0.000 0.028 0.076
#> GSM99599 1 0.0162 0.8441 0.996 0.000 0.000 0.000 0.004
#> GSM99433 2 0.6557 0.2334 0.000 0.528 0.012 0.180 0.280
#> GSM99435 4 0.5691 0.0880 0.000 0.000 0.444 0.476 0.080
#> GSM99437 2 0.3395 0.5266 0.000 0.764 0.000 0.000 0.236
#> GSM99439 2 0.3488 0.5963 0.000 0.808 0.000 0.024 0.168
#> GSM99441 1 0.0693 0.8468 0.980 0.000 0.000 0.012 0.008
#> GSM99443 2 0.2773 0.5878 0.000 0.836 0.000 0.000 0.164
#> GSM99445 2 0.1851 0.6284 0.000 0.912 0.000 0.000 0.088
#> GSM99447 2 0.4755 0.5422 0.000 0.696 0.000 0.060 0.244
#> GSM99449 3 0.2370 0.9042 0.000 0.000 0.904 0.040 0.056
#> GSM99451 4 0.4054 0.5344 0.000 0.000 0.224 0.748 0.028
#> GSM99453 1 0.4412 0.8033 0.756 0.000 0.000 0.080 0.164
#> GSM99455 1 0.4457 0.8044 0.756 0.000 0.000 0.092 0.152
#> GSM99457 1 0.5016 0.7724 0.704 0.000 0.000 0.120 0.176
#> GSM99463 2 0.2771 0.6195 0.000 0.860 0.000 0.012 0.128
#> GSM99465 4 0.7822 0.2416 0.336 0.000 0.076 0.376 0.212
#> GSM99467 2 0.4321 0.1981 0.000 0.600 0.000 0.004 0.396
#> GSM99471 1 0.4680 0.8032 0.752 0.008 0.000 0.088 0.152
#> GSM99473 1 0.2017 0.8358 0.912 0.000 0.000 0.008 0.080
#> GSM99475 4 0.1943 0.5998 0.000 0.000 0.056 0.924 0.020
#> GSM99477 5 0.6466 -0.0040 0.000 0.428 0.068 0.044 0.460
#> GSM99479 2 0.4640 0.1042 0.000 0.584 0.000 0.016 0.400
#> GSM99481 1 0.1444 0.8487 0.948 0.000 0.000 0.012 0.040
#> GSM99483 1 0.4317 0.8085 0.764 0.000 0.000 0.076 0.160
#> GSM99485 2 0.3607 0.4980 0.000 0.752 0.000 0.004 0.244
#> GSM99487 2 0.3661 0.4678 0.000 0.724 0.000 0.000 0.276
#> GSM99489 2 0.2124 0.6398 0.000 0.900 0.000 0.004 0.096
#> GSM99491 2 0.2848 0.5993 0.000 0.840 0.000 0.004 0.156
#> GSM99493 1 0.4428 0.8032 0.756 0.000 0.000 0.084 0.160
#> GSM99495 2 0.2886 0.6120 0.000 0.844 0.000 0.008 0.148
#> GSM99525 1 0.2964 0.8362 0.856 0.000 0.000 0.024 0.120
#> GSM99527 4 0.4324 0.5595 0.012 0.016 0.008 0.756 0.208
#> GSM99529 2 0.7524 -0.3361 0.020 0.372 0.012 0.244 0.352
#> GSM99531 4 0.4498 0.5635 0.020 0.000 0.092 0.784 0.104
#> GSM99533 4 0.2149 0.5866 0.028 0.000 0.012 0.924 0.036
#> GSM99535 2 0.6690 0.0759 0.140 0.540 0.000 0.032 0.288
#> GSM99537 1 0.3301 0.8365 0.848 0.000 0.000 0.080 0.072
#> GSM99539 4 0.6883 0.2710 0.000 0.228 0.056 0.564 0.152
#> GSM99541 1 0.5010 0.6701 0.676 0.000 0.000 0.248 0.076
#> GSM99543 2 0.4701 0.4879 0.004 0.700 0.000 0.044 0.252
#> GSM99545 4 0.6271 0.2733 0.000 0.240 0.008 0.572 0.180
#> GSM99547 4 0.7209 0.3708 0.132 0.028 0.020 0.492 0.328
#> GSM99549 2 0.4136 0.5658 0.000 0.764 0.000 0.048 0.188
#> GSM99551 1 0.6964 0.2327 0.388 0.008 0.000 0.352 0.252
#> GSM99553 3 0.1682 0.9187 0.000 0.004 0.940 0.012 0.044
#> GSM99555 2 0.3048 0.6219 0.000 0.820 0.000 0.004 0.176
#> GSM99557 2 0.2020 0.6391 0.000 0.900 0.000 0.000 0.100
#> GSM99559 3 0.3340 0.8336 0.000 0.048 0.860 0.016 0.076
#> GSM99561 2 0.5158 0.5197 0.000 0.676 0.000 0.100 0.224
#> GSM99563 3 0.1725 0.9260 0.000 0.000 0.936 0.044 0.020
#> GSM99565 2 0.3461 0.5617 0.000 0.772 0.000 0.004 0.224
#> GSM99573 2 0.4129 0.5698 0.000 0.756 0.000 0.040 0.204
#> GSM99577 1 0.5904 0.6772 0.600 0.000 0.000 0.196 0.204
#> GSM99579 2 0.3010 0.5637 0.000 0.824 0.000 0.004 0.172
#> GSM99581 3 0.1493 0.9304 0.000 0.000 0.948 0.028 0.024
#> GSM99583 5 0.9474 0.2575 0.168 0.212 0.160 0.104 0.356
#> GSM99585 2 0.5523 0.1397 0.000 0.572 0.000 0.080 0.348
#> GSM99587 1 0.4662 0.7924 0.736 0.000 0.000 0.096 0.168
#> GSM99589 2 0.2536 0.6397 0.000 0.868 0.000 0.004 0.128
#> GSM99591 2 0.2020 0.6263 0.000 0.900 0.000 0.000 0.100
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM99497 3 0.0291 0.87152 0.000 0.000 0.992 0.004 0.004 0.000
#> GSM99503 1 0.0458 0.68169 0.984 0.000 0.000 0.000 0.000 0.016
#> GSM99505 1 0.4166 0.50760 0.768 0.000 0.144 0.012 0.004 0.072
#> GSM99507 3 0.0767 0.87224 0.000 0.000 0.976 0.012 0.004 0.008
#> GSM99567 3 0.0551 0.87398 0.000 0.000 0.984 0.004 0.004 0.008
#> GSM99575 1 0.0790 0.67990 0.968 0.000 0.000 0.000 0.000 0.032
#> GSM99593 3 0.1767 0.87519 0.000 0.000 0.932 0.036 0.012 0.020
#> GSM99595 3 0.1148 0.87628 0.000 0.000 0.960 0.020 0.004 0.016
#> GSM99469 1 0.2573 0.65069 0.872 0.000 0.000 0.012 0.012 0.104
#> GSM99499 1 0.3190 0.66107 0.820 0.000 0.004 0.020 0.004 0.152
#> GSM99501 1 0.2400 0.64309 0.872 0.000 0.000 0.008 0.004 0.116
#> GSM99509 3 0.2144 0.87188 0.000 0.000 0.908 0.040 0.004 0.048
#> GSM99569 3 0.3856 0.80866 0.016 0.000 0.796 0.052 0.004 0.132
#> GSM99597 3 0.4002 0.76309 0.004 0.000 0.784 0.104 0.008 0.100
#> GSM99601 2 0.4004 -0.01173 0.000 0.656 0.000 0.004 0.328 0.012
#> GSM99459 1 0.4828 0.44693 0.700 0.000 0.000 0.052 0.044 0.204
#> GSM99461 1 0.5007 0.43482 0.672 0.000 0.000 0.068 0.032 0.228
#> GSM99511 3 0.4157 0.80437 0.000 0.000 0.772 0.124 0.020 0.084
#> GSM99513 3 0.3356 0.85306 0.000 0.000 0.840 0.064 0.024 0.072
#> GSM99515 3 0.0881 0.87312 0.000 0.000 0.972 0.008 0.008 0.012
#> GSM99517 1 0.1364 0.67928 0.944 0.000 0.000 0.004 0.004 0.048
#> GSM99519 1 0.4357 0.52043 0.748 0.000 0.000 0.052 0.032 0.168
#> GSM99521 3 0.4426 0.63365 0.000 0.000 0.696 0.248 0.016 0.040
#> GSM99523 3 0.3709 0.84584 0.032 0.000 0.832 0.048 0.016 0.072
#> GSM99571 1 0.2092 0.68101 0.876 0.000 0.000 0.000 0.000 0.124
#> GSM99599 1 0.0790 0.68872 0.968 0.000 0.000 0.000 0.000 0.032
#> GSM99433 2 0.7056 0.00994 0.000 0.456 0.024 0.160 0.304 0.056
#> GSM99435 4 0.6364 0.02907 0.000 0.016 0.420 0.436 0.048 0.080
#> GSM99437 2 0.2034 0.39396 0.000 0.912 0.000 0.004 0.060 0.024
#> GSM99439 5 0.4015 0.59321 0.000 0.396 0.000 0.004 0.596 0.004
#> GSM99441 1 0.1588 0.69141 0.924 0.000 0.000 0.000 0.004 0.072
#> GSM99443 2 0.2773 0.34006 0.000 0.836 0.000 0.004 0.152 0.008
#> GSM99445 2 0.3875 0.21031 0.000 0.716 0.000 0.008 0.260 0.016
#> GSM99447 2 0.5174 -0.03909 0.000 0.600 0.000 0.048 0.320 0.032
#> GSM99449 3 0.3768 0.84510 0.000 0.024 0.832 0.052 0.032 0.060
#> GSM99451 4 0.4511 0.44752 0.000 0.008 0.208 0.724 0.024 0.036
#> GSM99453 1 0.3827 0.56949 0.680 0.000 0.000 0.008 0.004 0.308
#> GSM99455 1 0.4147 0.55572 0.660 0.000 0.000 0.008 0.016 0.316
#> GSM99457 1 0.4483 0.51877 0.636 0.000 0.000 0.040 0.004 0.320
#> GSM99463 5 0.3966 0.51724 0.000 0.444 0.000 0.004 0.552 0.000
#> GSM99465 6 0.8049 0.02661 0.276 0.028 0.024 0.276 0.064 0.332
#> GSM99467 2 0.4613 0.39166 0.000 0.704 0.000 0.012 0.204 0.080
#> GSM99471 1 0.5848 0.36528 0.552 0.000 0.000 0.052 0.080 0.316
#> GSM99473 1 0.3667 0.59273 0.788 0.000 0.000 0.012 0.036 0.164
#> GSM99475 4 0.3126 0.46748 0.000 0.000 0.072 0.856 0.028 0.044
#> GSM99477 2 0.5780 0.35547 0.000 0.660 0.028 0.036 0.164 0.112
#> GSM99479 2 0.5664 0.36005 0.000 0.604 0.000 0.028 0.232 0.136
#> GSM99481 1 0.1556 0.69087 0.920 0.000 0.000 0.000 0.000 0.080
#> GSM99483 1 0.3575 0.59683 0.708 0.000 0.000 0.000 0.008 0.284
#> GSM99485 2 0.4986 0.31644 0.000 0.620 0.000 0.012 0.300 0.068
#> GSM99487 2 0.1719 0.41145 0.000 0.932 0.000 0.004 0.032 0.032
#> GSM99489 2 0.4386 -0.37786 0.000 0.516 0.000 0.004 0.464 0.016
#> GSM99491 2 0.4358 0.30315 0.000 0.680 0.000 0.012 0.276 0.032
#> GSM99493 1 0.3729 0.56863 0.692 0.000 0.000 0.012 0.000 0.296
#> GSM99495 5 0.4056 0.58220 0.000 0.416 0.000 0.004 0.576 0.004
#> GSM99525 1 0.3650 0.63888 0.756 0.000 0.000 0.004 0.024 0.216
#> GSM99527 4 0.6112 0.30332 0.008 0.052 0.012 0.600 0.076 0.252
#> GSM99529 2 0.7906 0.14649 0.012 0.336 0.004 0.192 0.288 0.168
#> GSM99531 4 0.6277 0.32692 0.024 0.000 0.120 0.608 0.056 0.192
#> GSM99533 4 0.3140 0.37233 0.032 0.000 0.008 0.848 0.008 0.104
#> GSM99535 5 0.8076 0.04302 0.172 0.304 0.000 0.032 0.312 0.180
#> GSM99537 1 0.3974 0.62587 0.752 0.000 0.000 0.056 0.004 0.188
#> GSM99539 4 0.7093 0.32132 0.000 0.204 0.044 0.508 0.196 0.048
#> GSM99541 1 0.5763 0.15094 0.564 0.000 0.000 0.228 0.012 0.196
#> GSM99543 5 0.6410 0.41352 0.008 0.276 0.000 0.056 0.536 0.124
#> GSM99545 4 0.6191 0.18921 0.000 0.164 0.016 0.504 0.308 0.008
#> GSM99547 4 0.8767 -0.03095 0.112 0.064 0.036 0.332 0.180 0.276
#> GSM99549 5 0.4810 0.60900 0.000 0.324 0.000 0.028 0.620 0.028
#> GSM99551 6 0.7036 0.08519 0.280 0.000 0.000 0.208 0.088 0.424
#> GSM99553 3 0.3031 0.84141 0.000 0.008 0.872 0.032 0.044 0.044
#> GSM99555 2 0.3986 0.22513 0.000 0.732 0.000 0.008 0.228 0.032
#> GSM99557 2 0.4432 -0.26768 0.000 0.544 0.000 0.004 0.432 0.020
#> GSM99559 3 0.4744 0.71093 0.000 0.088 0.768 0.040 0.064 0.040
#> GSM99561 5 0.5916 0.36815 0.000 0.404 0.000 0.080 0.472 0.044
#> GSM99563 3 0.3097 0.85794 0.000 0.000 0.852 0.064 0.012 0.072
#> GSM99565 2 0.2838 0.35515 0.000 0.852 0.000 0.004 0.116 0.028
#> GSM99573 5 0.4874 0.59703 0.000 0.344 0.000 0.032 0.600 0.024
#> GSM99577 1 0.6321 0.03154 0.432 0.000 0.000 0.148 0.036 0.384
#> GSM99579 2 0.4608 0.29451 0.000 0.656 0.000 0.012 0.288 0.044
#> GSM99581 3 0.2862 0.86646 0.000 0.000 0.872 0.052 0.020 0.056
#> GSM99583 2 0.9426 -0.08470 0.112 0.280 0.096 0.080 0.196 0.236
#> GSM99585 2 0.6062 0.30624 0.000 0.616 0.000 0.116 0.144 0.124
#> GSM99587 1 0.4008 0.54726 0.672 0.000 0.000 0.016 0.004 0.308
#> GSM99589 2 0.5057 -0.07865 0.000 0.568 0.020 0.008 0.376 0.028
#> GSM99591 2 0.3596 0.25296 0.000 0.748 0.000 0.004 0.232 0.016
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
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 disease.state(p) cell.type(p) k
#> CV:skmeans 67 6.21e-03 0.017600 2
#> CV:skmeans 84 8.79e-05 0.002744 3
#> CV:skmeans 77 4.30e-06 0.000611 4
#> CV:skmeans 68 8.96e-05 0.006704 5
#> CV:skmeans 44 1.41e-02 0.186373 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 21512 rows and 85 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'CV' method.
#> Subgroups are detected by 'pam' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 3.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
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.608 0.897 0.933 0.4420 0.570 0.570
#> 3 3 1.000 0.944 0.977 0.5173 0.743 0.556
#> 4 4 0.871 0.840 0.935 0.1241 0.883 0.664
#> 5 5 0.811 0.755 0.890 0.0397 0.967 0.868
#> 6 6 0.803 0.730 0.870 0.0241 0.956 0.809
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
#> GSM99497 2 0.7376 0.835 0.208 0.792
#> GSM99503 1 0.0000 0.982 1.000 0.000
#> GSM99505 1 0.0000 0.982 1.000 0.000
#> GSM99507 2 0.7376 0.835 0.208 0.792
#> GSM99567 2 0.7376 0.835 0.208 0.792
#> GSM99575 1 0.0000 0.982 1.000 0.000
#> GSM99593 2 0.7376 0.835 0.208 0.792
#> GSM99595 2 0.7376 0.835 0.208 0.792
#> GSM99469 1 0.0000 0.982 1.000 0.000
#> GSM99499 1 0.0000 0.982 1.000 0.000
#> GSM99501 1 0.0000 0.982 1.000 0.000
#> GSM99509 2 0.7376 0.835 0.208 0.792
#> GSM99569 2 0.7376 0.835 0.208 0.792
#> GSM99597 2 0.7376 0.835 0.208 0.792
#> GSM99601 2 0.0000 0.899 0.000 1.000
#> GSM99459 1 0.0000 0.982 1.000 0.000
#> GSM99461 1 0.0000 0.982 1.000 0.000
#> GSM99511 2 0.7376 0.835 0.208 0.792
#> GSM99513 2 0.7299 0.838 0.204 0.796
#> GSM99515 2 0.7376 0.835 0.208 0.792
#> GSM99517 1 0.0000 0.982 1.000 0.000
#> GSM99519 1 0.0000 0.982 1.000 0.000
#> GSM99521 2 0.7376 0.835 0.208 0.792
#> GSM99523 2 0.9552 0.582 0.376 0.624
#> GSM99571 1 0.0000 0.982 1.000 0.000
#> GSM99599 1 0.0000 0.982 1.000 0.000
#> GSM99433 2 0.0000 0.899 0.000 1.000
#> GSM99435 2 0.6247 0.857 0.156 0.844
#> GSM99437 2 0.0000 0.899 0.000 1.000
#> GSM99439 2 0.0000 0.899 0.000 1.000
#> GSM99441 1 0.0000 0.982 1.000 0.000
#> GSM99443 2 0.0000 0.899 0.000 1.000
#> GSM99445 2 0.0000 0.899 0.000 1.000
#> GSM99447 2 0.0000 0.899 0.000 1.000
#> GSM99449 2 0.0000 0.899 0.000 1.000
#> GSM99451 2 0.7219 0.840 0.200 0.800
#> GSM99453 1 0.0000 0.982 1.000 0.000
#> GSM99455 1 0.0000 0.982 1.000 0.000
#> GSM99457 1 0.0000 0.982 1.000 0.000
#> GSM99463 2 0.0000 0.899 0.000 1.000
#> GSM99465 2 0.7453 0.831 0.212 0.788
#> GSM99467 2 0.0000 0.899 0.000 1.000
#> GSM99471 1 0.6343 0.781 0.840 0.160
#> GSM99473 1 0.7453 0.698 0.788 0.212
#> GSM99475 2 0.7299 0.838 0.204 0.796
#> GSM99477 2 0.0000 0.899 0.000 1.000
#> GSM99479 2 0.0000 0.899 0.000 1.000
#> GSM99481 1 0.0000 0.982 1.000 0.000
#> GSM99483 1 0.0000 0.982 1.000 0.000
#> GSM99485 2 0.0672 0.898 0.008 0.992
#> GSM99487 2 0.0000 0.899 0.000 1.000
#> GSM99489 2 0.0000 0.899 0.000 1.000
#> GSM99491 2 0.0000 0.899 0.000 1.000
#> GSM99493 1 0.0000 0.982 1.000 0.000
#> GSM99495 2 0.0000 0.899 0.000 1.000
#> GSM99525 1 0.0000 0.982 1.000 0.000
#> GSM99527 2 0.3584 0.885 0.068 0.932
#> GSM99529 2 0.0000 0.899 0.000 1.000
#> GSM99531 2 0.7219 0.840 0.200 0.800
#> GSM99533 2 0.7674 0.819 0.224 0.776
#> GSM99535 2 0.2423 0.878 0.040 0.960
#> GSM99537 1 0.0000 0.982 1.000 0.000
#> GSM99539 2 0.0000 0.899 0.000 1.000
#> GSM99541 1 0.0000 0.982 1.000 0.000
#> GSM99543 2 0.0376 0.898 0.004 0.996
#> GSM99545 2 0.0000 0.899 0.000 1.000
#> GSM99547 2 0.0672 0.898 0.008 0.992
#> GSM99549 2 0.0000 0.899 0.000 1.000
#> GSM99551 2 0.7453 0.832 0.212 0.788
#> GSM99553 2 0.7219 0.840 0.200 0.800
#> GSM99555 2 0.0000 0.899 0.000 1.000
#> GSM99557 2 0.0000 0.899 0.000 1.000
#> GSM99559 2 0.2948 0.889 0.052 0.948
#> GSM99561 2 0.0000 0.899 0.000 1.000
#> GSM99563 2 0.8499 0.756 0.276 0.724
#> GSM99565 2 0.0000 0.899 0.000 1.000
#> GSM99573 2 0.0000 0.899 0.000 1.000
#> GSM99577 1 0.1184 0.966 0.984 0.016
#> GSM99579 2 0.0000 0.899 0.000 1.000
#> GSM99581 2 0.7219 0.840 0.200 0.800
#> GSM99583 2 0.7219 0.840 0.200 0.800
#> GSM99585 2 0.0000 0.899 0.000 1.000
#> GSM99587 1 0.0000 0.982 1.000 0.000
#> GSM99589 2 0.0000 0.899 0.000 1.000
#> GSM99591 2 0.0000 0.899 0.000 1.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM99497 3 0.0000 0.9683 0.000 0.000 1.000
#> GSM99503 1 0.0000 0.9629 1.000 0.000 0.000
#> GSM99505 1 0.6305 0.0562 0.516 0.000 0.484
#> GSM99507 3 0.0000 0.9683 0.000 0.000 1.000
#> GSM99567 3 0.0000 0.9683 0.000 0.000 1.000
#> GSM99575 1 0.0000 0.9629 1.000 0.000 0.000
#> GSM99593 3 0.0000 0.9683 0.000 0.000 1.000
#> GSM99595 3 0.0000 0.9683 0.000 0.000 1.000
#> GSM99469 1 0.0000 0.9629 1.000 0.000 0.000
#> GSM99499 1 0.5948 0.4312 0.640 0.000 0.360
#> GSM99501 1 0.0000 0.9629 1.000 0.000 0.000
#> GSM99509 3 0.0000 0.9683 0.000 0.000 1.000
#> GSM99569 3 0.0000 0.9683 0.000 0.000 1.000
#> GSM99597 3 0.0000 0.9683 0.000 0.000 1.000
#> GSM99601 2 0.0000 0.9921 0.000 1.000 0.000
#> GSM99459 1 0.0000 0.9629 1.000 0.000 0.000
#> GSM99461 1 0.0000 0.9629 1.000 0.000 0.000
#> GSM99511 3 0.0000 0.9683 0.000 0.000 1.000
#> GSM99513 3 0.0000 0.9683 0.000 0.000 1.000
#> GSM99515 3 0.0000 0.9683 0.000 0.000 1.000
#> GSM99517 1 0.0000 0.9629 1.000 0.000 0.000
#> GSM99519 1 0.0000 0.9629 1.000 0.000 0.000
#> GSM99521 3 0.0000 0.9683 0.000 0.000 1.000
#> GSM99523 3 0.0000 0.9683 0.000 0.000 1.000
#> GSM99571 1 0.0000 0.9629 1.000 0.000 0.000
#> GSM99599 1 0.0000 0.9629 1.000 0.000 0.000
#> GSM99433 2 0.0000 0.9921 0.000 1.000 0.000
#> GSM99435 3 0.0000 0.9683 0.000 0.000 1.000
#> GSM99437 2 0.0000 0.9921 0.000 1.000 0.000
#> GSM99439 2 0.0000 0.9921 0.000 1.000 0.000
#> GSM99441 1 0.0000 0.9629 1.000 0.000 0.000
#> GSM99443 2 0.0000 0.9921 0.000 1.000 0.000
#> GSM99445 2 0.0000 0.9921 0.000 1.000 0.000
#> GSM99447 2 0.0000 0.9921 0.000 1.000 0.000
#> GSM99449 3 0.0424 0.9636 0.000 0.008 0.992
#> GSM99451 3 0.0237 0.9661 0.000 0.004 0.996
#> GSM99453 1 0.0000 0.9629 1.000 0.000 0.000
#> GSM99455 1 0.0000 0.9629 1.000 0.000 0.000
#> GSM99457 1 0.0000 0.9629 1.000 0.000 0.000
#> GSM99463 2 0.0000 0.9921 0.000 1.000 0.000
#> GSM99465 3 0.7862 0.6103 0.184 0.148 0.668
#> GSM99467 2 0.0000 0.9921 0.000 1.000 0.000
#> GSM99471 1 0.0237 0.9597 0.996 0.004 0.000
#> GSM99473 1 0.0424 0.9562 0.992 0.008 0.000
#> GSM99475 3 0.1031 0.9505 0.000 0.024 0.976
#> GSM99477 2 0.0000 0.9921 0.000 1.000 0.000
#> GSM99479 2 0.0000 0.9921 0.000 1.000 0.000
#> GSM99481 1 0.0000 0.9629 1.000 0.000 0.000
#> GSM99483 1 0.0000 0.9629 1.000 0.000 0.000
#> GSM99485 2 0.0000 0.9921 0.000 1.000 0.000
#> GSM99487 2 0.0000 0.9921 0.000 1.000 0.000
#> GSM99489 2 0.0000 0.9921 0.000 1.000 0.000
#> GSM99491 2 0.0000 0.9921 0.000 1.000 0.000
#> GSM99493 1 0.0000 0.9629 1.000 0.000 0.000
#> GSM99495 2 0.0000 0.9921 0.000 1.000 0.000
#> GSM99525 1 0.0000 0.9629 1.000 0.000 0.000
#> GSM99527 2 0.0000 0.9921 0.000 1.000 0.000
#> GSM99529 3 0.5859 0.4923 0.000 0.344 0.656
#> GSM99531 3 0.0592 0.9607 0.000 0.012 0.988
#> GSM99533 3 0.1999 0.9326 0.036 0.012 0.952
#> GSM99535 2 0.0747 0.9786 0.016 0.984 0.000
#> GSM99537 1 0.0000 0.9629 1.000 0.000 0.000
#> GSM99539 2 0.1411 0.9609 0.000 0.964 0.036
#> GSM99541 1 0.0000 0.9629 1.000 0.000 0.000
#> GSM99543 2 0.0000 0.9921 0.000 1.000 0.000
#> GSM99545 2 0.2066 0.9363 0.000 0.940 0.060
#> GSM99547 2 0.0747 0.9786 0.016 0.984 0.000
#> GSM99549 2 0.0000 0.9921 0.000 1.000 0.000
#> GSM99551 1 0.2806 0.9031 0.928 0.040 0.032
#> GSM99553 3 0.0000 0.9683 0.000 0.000 1.000
#> GSM99555 2 0.0000 0.9921 0.000 1.000 0.000
#> GSM99557 2 0.0000 0.9921 0.000 1.000 0.000
#> GSM99559 3 0.0000 0.9683 0.000 0.000 1.000
#> GSM99561 2 0.0000 0.9921 0.000 1.000 0.000
#> GSM99563 3 0.0000 0.9683 0.000 0.000 1.000
#> GSM99565 2 0.0000 0.9921 0.000 1.000 0.000
#> GSM99573 2 0.0000 0.9921 0.000 1.000 0.000
#> GSM99577 1 0.0237 0.9599 0.996 0.000 0.004
#> GSM99579 2 0.0000 0.9921 0.000 1.000 0.000
#> GSM99581 3 0.0000 0.9683 0.000 0.000 1.000
#> GSM99583 3 0.0592 0.9607 0.000 0.012 0.988
#> GSM99585 2 0.0000 0.9921 0.000 1.000 0.000
#> GSM99587 1 0.0000 0.9629 1.000 0.000 0.000
#> GSM99589 2 0.3116 0.8762 0.000 0.892 0.108
#> GSM99591 2 0.0000 0.9921 0.000 1.000 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM99497 3 0.0000 0.94700 0.000 0.000 1.000 0.000
#> GSM99503 1 0.0000 0.94624 1.000 0.000 0.000 0.000
#> GSM99505 1 0.4996 0.10315 0.516 0.000 0.484 0.000
#> GSM99507 3 0.0000 0.94700 0.000 0.000 1.000 0.000
#> GSM99567 3 0.0000 0.94700 0.000 0.000 1.000 0.000
#> GSM99575 1 0.0000 0.94624 1.000 0.000 0.000 0.000
#> GSM99593 3 0.0000 0.94700 0.000 0.000 1.000 0.000
#> GSM99595 3 0.0000 0.94700 0.000 0.000 1.000 0.000
#> GSM99469 1 0.0000 0.94624 1.000 0.000 0.000 0.000
#> GSM99499 1 0.4713 0.45130 0.640 0.000 0.360 0.000
#> GSM99501 1 0.0000 0.94624 1.000 0.000 0.000 0.000
#> GSM99509 3 0.0000 0.94700 0.000 0.000 1.000 0.000
#> GSM99569 3 0.0000 0.94700 0.000 0.000 1.000 0.000
#> GSM99597 3 0.0000 0.94700 0.000 0.000 1.000 0.000
#> GSM99601 2 0.0000 0.89918 0.000 1.000 0.000 0.000
#> GSM99459 1 0.0000 0.94624 1.000 0.000 0.000 0.000
#> GSM99461 1 0.0000 0.94624 1.000 0.000 0.000 0.000
#> GSM99511 3 0.0000 0.94700 0.000 0.000 1.000 0.000
#> GSM99513 3 0.0000 0.94700 0.000 0.000 1.000 0.000
#> GSM99515 3 0.0000 0.94700 0.000 0.000 1.000 0.000
#> GSM99517 1 0.0000 0.94624 1.000 0.000 0.000 0.000
#> GSM99519 1 0.0000 0.94624 1.000 0.000 0.000 0.000
#> GSM99521 3 0.0000 0.94700 0.000 0.000 1.000 0.000
#> GSM99523 3 0.0000 0.94700 0.000 0.000 1.000 0.000
#> GSM99571 1 0.0000 0.94624 1.000 0.000 0.000 0.000
#> GSM99599 1 0.0000 0.94624 1.000 0.000 0.000 0.000
#> GSM99433 2 0.2469 0.84230 0.000 0.892 0.000 0.108
#> GSM99435 3 0.3172 0.79398 0.000 0.000 0.840 0.160
#> GSM99437 2 0.0000 0.89918 0.000 1.000 0.000 0.000
#> GSM99439 2 0.0000 0.89918 0.000 1.000 0.000 0.000
#> GSM99441 1 0.0000 0.94624 1.000 0.000 0.000 0.000
#> GSM99443 2 0.0000 0.89918 0.000 1.000 0.000 0.000
#> GSM99445 2 0.0000 0.89918 0.000 1.000 0.000 0.000
#> GSM99447 2 0.2149 0.85914 0.000 0.912 0.000 0.088
#> GSM99449 3 0.0336 0.94035 0.000 0.008 0.992 0.000
#> GSM99451 3 0.4661 0.48784 0.000 0.000 0.652 0.348
#> GSM99453 1 0.0000 0.94624 1.000 0.000 0.000 0.000
#> GSM99455 1 0.0000 0.94624 1.000 0.000 0.000 0.000
#> GSM99457 1 0.0000 0.94624 1.000 0.000 0.000 0.000
#> GSM99463 2 0.0336 0.89745 0.000 0.992 0.000 0.008
#> GSM99465 4 0.0336 0.89864 0.008 0.000 0.000 0.992
#> GSM99467 4 0.0000 0.90224 0.000 0.000 0.000 1.000
#> GSM99471 1 0.3356 0.76581 0.824 0.000 0.000 0.176
#> GSM99473 1 0.3726 0.71229 0.788 0.000 0.000 0.212
#> GSM99475 3 0.6071 0.02256 0.000 0.044 0.504 0.452
#> GSM99477 4 0.0000 0.90224 0.000 0.000 0.000 1.000
#> GSM99479 4 0.0000 0.90224 0.000 0.000 0.000 1.000
#> GSM99481 1 0.0000 0.94624 1.000 0.000 0.000 0.000
#> GSM99483 1 0.0000 0.94624 1.000 0.000 0.000 0.000
#> GSM99485 4 0.0000 0.90224 0.000 0.000 0.000 1.000
#> GSM99487 2 0.0000 0.89918 0.000 1.000 0.000 0.000
#> GSM99489 2 0.0000 0.89918 0.000 1.000 0.000 0.000
#> GSM99491 2 0.1302 0.88335 0.000 0.956 0.000 0.044
#> GSM99493 1 0.0000 0.94624 1.000 0.000 0.000 0.000
#> GSM99495 2 0.0000 0.89918 0.000 1.000 0.000 0.000
#> GSM99525 1 0.0000 0.94624 1.000 0.000 0.000 0.000
#> GSM99527 4 0.4907 0.19678 0.000 0.420 0.000 0.580
#> GSM99529 4 0.0000 0.90224 0.000 0.000 0.000 1.000
#> GSM99531 4 0.4996 -0.00918 0.000 0.000 0.484 0.516
#> GSM99533 4 0.0779 0.89158 0.016 0.000 0.004 0.980
#> GSM99535 4 0.3972 0.68953 0.008 0.204 0.000 0.788
#> GSM99537 1 0.0000 0.94624 1.000 0.000 0.000 0.000
#> GSM99539 2 0.4098 0.73678 0.000 0.784 0.012 0.204
#> GSM99541 1 0.0000 0.94624 1.000 0.000 0.000 0.000
#> GSM99543 4 0.0469 0.89785 0.000 0.012 0.000 0.988
#> GSM99545 2 0.1890 0.86392 0.000 0.936 0.056 0.008
#> GSM99547 4 0.1637 0.86408 0.000 0.060 0.000 0.940
#> GSM99549 2 0.4972 0.17593 0.000 0.544 0.000 0.456
#> GSM99551 4 0.0000 0.90224 0.000 0.000 0.000 1.000
#> GSM99553 3 0.0000 0.94700 0.000 0.000 1.000 0.000
#> GSM99555 2 0.0000 0.89918 0.000 1.000 0.000 0.000
#> GSM99557 2 0.2814 0.82872 0.000 0.868 0.000 0.132
#> GSM99559 3 0.0336 0.94092 0.000 0.000 0.992 0.008
#> GSM99561 2 0.2647 0.83669 0.000 0.880 0.000 0.120
#> GSM99563 3 0.0000 0.94700 0.000 0.000 1.000 0.000
#> GSM99565 2 0.0000 0.89918 0.000 1.000 0.000 0.000
#> GSM99573 2 0.4941 0.24772 0.000 0.564 0.000 0.436
#> GSM99577 1 0.0779 0.93132 0.980 0.000 0.004 0.016
#> GSM99579 4 0.0000 0.90224 0.000 0.000 0.000 1.000
#> GSM99581 3 0.0000 0.94700 0.000 0.000 1.000 0.000
#> GSM99583 4 0.0188 0.90055 0.000 0.000 0.004 0.996
#> GSM99585 2 0.4193 0.64572 0.000 0.732 0.000 0.268
#> GSM99587 1 0.0000 0.94624 1.000 0.000 0.000 0.000
#> GSM99589 4 0.1792 0.85769 0.000 0.068 0.000 0.932
#> GSM99591 2 0.0000 0.89918 0.000 1.000 0.000 0.000
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM99497 3 0.0000 0.9617 0.000 0.000 1.000 0.000 0.000
#> GSM99503 1 0.0000 0.8384 1.000 0.000 0.000 0.000 0.000
#> GSM99505 1 0.4304 0.1032 0.516 0.000 0.484 0.000 0.000
#> GSM99507 3 0.0000 0.9617 0.000 0.000 1.000 0.000 0.000
#> GSM99567 3 0.0000 0.9617 0.000 0.000 1.000 0.000 0.000
#> GSM99575 1 0.0000 0.8384 1.000 0.000 0.000 0.000 0.000
#> GSM99593 3 0.0000 0.9617 0.000 0.000 1.000 0.000 0.000
#> GSM99595 3 0.0000 0.9617 0.000 0.000 1.000 0.000 0.000
#> GSM99469 1 0.0000 0.8384 1.000 0.000 0.000 0.000 0.000
#> GSM99499 1 0.5297 0.2659 0.580 0.000 0.360 0.060 0.000
#> GSM99501 1 0.0000 0.8384 1.000 0.000 0.000 0.000 0.000
#> GSM99509 3 0.0000 0.9617 0.000 0.000 1.000 0.000 0.000
#> GSM99569 3 0.0000 0.9617 0.000 0.000 1.000 0.000 0.000
#> GSM99597 3 0.0000 0.9617 0.000 0.000 1.000 0.000 0.000
#> GSM99601 2 0.0000 0.8770 0.000 1.000 0.000 0.000 0.000
#> GSM99459 1 0.3999 0.4803 0.656 0.000 0.000 0.344 0.000
#> GSM99461 1 0.3999 0.4810 0.656 0.000 0.000 0.344 0.000
#> GSM99511 3 0.0000 0.9617 0.000 0.000 1.000 0.000 0.000
#> GSM99513 3 0.0000 0.9617 0.000 0.000 1.000 0.000 0.000
#> GSM99515 3 0.0000 0.9617 0.000 0.000 1.000 0.000 0.000
#> GSM99517 1 0.0000 0.8384 1.000 0.000 0.000 0.000 0.000
#> GSM99519 1 0.2813 0.7103 0.832 0.000 0.000 0.168 0.000
#> GSM99521 3 0.0000 0.9617 0.000 0.000 1.000 0.000 0.000
#> GSM99523 3 0.0000 0.9617 0.000 0.000 1.000 0.000 0.000
#> GSM99571 1 0.0000 0.8384 1.000 0.000 0.000 0.000 0.000
#> GSM99599 1 0.0000 0.8384 1.000 0.000 0.000 0.000 0.000
#> GSM99433 2 0.2127 0.8302 0.000 0.892 0.000 0.000 0.108
#> GSM99435 3 0.2732 0.7665 0.000 0.000 0.840 0.000 0.160
#> GSM99437 2 0.0000 0.8770 0.000 1.000 0.000 0.000 0.000
#> GSM99439 2 0.1478 0.8662 0.000 0.936 0.000 0.064 0.000
#> GSM99441 1 0.0000 0.8384 1.000 0.000 0.000 0.000 0.000
#> GSM99443 2 0.0000 0.8770 0.000 1.000 0.000 0.000 0.000
#> GSM99445 2 0.0000 0.8770 0.000 1.000 0.000 0.000 0.000
#> GSM99447 2 0.1851 0.8452 0.000 0.912 0.000 0.000 0.088
#> GSM99449 3 0.0290 0.9529 0.000 0.008 0.992 0.000 0.000
#> GSM99451 3 0.6200 0.1504 0.000 0.000 0.540 0.180 0.280
#> GSM99453 1 0.0000 0.8384 1.000 0.000 0.000 0.000 0.000
#> GSM99455 1 0.0000 0.8384 1.000 0.000 0.000 0.000 0.000
#> GSM99457 1 0.4101 0.4359 0.628 0.000 0.000 0.372 0.000
#> GSM99463 2 0.1697 0.8675 0.000 0.932 0.000 0.060 0.008
#> GSM99465 5 0.4299 0.2738 0.004 0.000 0.000 0.388 0.608
#> GSM99467 5 0.0000 0.8878 0.000 0.000 0.000 0.000 1.000
#> GSM99471 1 0.3304 0.6593 0.816 0.000 0.000 0.016 0.168
#> GSM99473 1 0.3210 0.5991 0.788 0.000 0.000 0.000 0.212
#> GSM99475 4 0.5829 0.4138 0.000 0.008 0.200 0.636 0.156
#> GSM99477 5 0.0000 0.8878 0.000 0.000 0.000 0.000 1.000
#> GSM99479 5 0.0000 0.8878 0.000 0.000 0.000 0.000 1.000
#> GSM99481 1 0.0000 0.8384 1.000 0.000 0.000 0.000 0.000
#> GSM99483 1 0.0000 0.8384 1.000 0.000 0.000 0.000 0.000
#> GSM99485 5 0.0000 0.8878 0.000 0.000 0.000 0.000 1.000
#> GSM99487 2 0.0000 0.8770 0.000 1.000 0.000 0.000 0.000
#> GSM99489 2 0.1270 0.8695 0.000 0.948 0.000 0.052 0.000
#> GSM99491 2 0.1121 0.8673 0.000 0.956 0.000 0.000 0.044
#> GSM99493 1 0.0000 0.8384 1.000 0.000 0.000 0.000 0.000
#> GSM99495 2 0.1478 0.8662 0.000 0.936 0.000 0.064 0.000
#> GSM99525 1 0.0000 0.8384 1.000 0.000 0.000 0.000 0.000
#> GSM99527 4 0.6433 0.0504 0.000 0.184 0.000 0.464 0.352
#> GSM99529 5 0.0000 0.8878 0.000 0.000 0.000 0.000 1.000
#> GSM99531 4 0.6813 0.2525 0.000 0.000 0.320 0.364 0.316
#> GSM99533 4 0.4682 0.1468 0.016 0.000 0.000 0.564 0.420
#> GSM99535 5 0.3805 0.6430 0.008 0.192 0.000 0.016 0.784
#> GSM99537 1 0.3857 0.4661 0.688 0.000 0.000 0.312 0.000
#> GSM99539 2 0.3530 0.7241 0.000 0.784 0.012 0.000 0.204
#> GSM99541 4 0.3816 0.3065 0.304 0.000 0.000 0.696 0.000
#> GSM99543 5 0.2136 0.8335 0.000 0.008 0.000 0.088 0.904
#> GSM99545 2 0.2775 0.8447 0.000 0.888 0.036 0.068 0.008
#> GSM99547 5 0.2946 0.7931 0.000 0.044 0.000 0.088 0.868
#> GSM99549 2 0.5505 0.1328 0.000 0.484 0.000 0.064 0.452
#> GSM99551 5 0.1341 0.8554 0.000 0.000 0.000 0.056 0.944
#> GSM99553 3 0.0000 0.9617 0.000 0.000 1.000 0.000 0.000
#> GSM99555 2 0.0000 0.8770 0.000 1.000 0.000 0.000 0.000
#> GSM99557 2 0.2424 0.8149 0.000 0.868 0.000 0.000 0.132
#> GSM99559 3 0.0290 0.9537 0.000 0.000 0.992 0.000 0.008
#> GSM99561 2 0.3012 0.8250 0.000 0.860 0.000 0.036 0.104
#> GSM99563 3 0.0000 0.9617 0.000 0.000 1.000 0.000 0.000
#> GSM99565 2 0.0000 0.8770 0.000 1.000 0.000 0.000 0.000
#> GSM99573 2 0.5478 0.2408 0.000 0.516 0.000 0.064 0.420
#> GSM99577 4 0.4037 0.3339 0.288 0.000 0.004 0.704 0.004
#> GSM99579 5 0.0000 0.8878 0.000 0.000 0.000 0.000 1.000
#> GSM99581 3 0.0000 0.9617 0.000 0.000 1.000 0.000 0.000
#> GSM99583 5 0.0162 0.8845 0.000 0.000 0.004 0.000 0.996
#> GSM99585 2 0.3612 0.6490 0.000 0.732 0.000 0.000 0.268
#> GSM99587 1 0.0703 0.8245 0.976 0.000 0.000 0.024 0.000
#> GSM99589 5 0.1544 0.8354 0.000 0.068 0.000 0.000 0.932
#> GSM99591 2 0.0000 0.8770 0.000 1.000 0.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
#> GSM99497 3 0.0000 0.965 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM99503 1 0.0000 0.859 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99505 1 0.3866 0.108 0.516 0.000 0.484 0.000 0.000 0.000
#> GSM99507 3 0.0000 0.965 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM99567 3 0.0000 0.965 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM99575 1 0.0000 0.859 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99593 3 0.0000 0.965 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM99595 3 0.0000 0.965 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM99469 1 0.0000 0.859 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99499 1 0.5044 0.267 0.576 0.000 0.360 0.040 0.024 0.000
#> GSM99501 1 0.0000 0.859 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99509 3 0.0000 0.965 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM99569 3 0.0000 0.965 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM99597 3 0.0000 0.965 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM99601 2 0.0000 0.819 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM99459 4 0.3672 0.629 0.368 0.000 0.000 0.632 0.000 0.000
#> GSM99461 4 0.3684 0.624 0.372 0.000 0.000 0.628 0.000 0.000
#> GSM99511 3 0.0000 0.965 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM99513 3 0.0000 0.965 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM99515 3 0.0000 0.965 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM99517 1 0.0000 0.859 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99519 1 0.3309 0.389 0.720 0.000 0.000 0.280 0.000 0.000
#> GSM99521 3 0.0000 0.965 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM99523 3 0.0000 0.965 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM99571 1 0.0000 0.859 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99599 1 0.0000 0.859 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99433 2 0.1910 0.771 0.000 0.892 0.000 0.000 0.000 0.108
#> GSM99435 3 0.2454 0.783 0.000 0.000 0.840 0.000 0.000 0.160
#> GSM99437 2 0.0000 0.819 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM99439 2 0.3706 0.514 0.000 0.620 0.000 0.000 0.380 0.000
#> GSM99441 1 0.0000 0.859 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99443 2 0.0000 0.819 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM99445 2 0.0000 0.819 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM99447 2 0.1663 0.773 0.000 0.912 0.000 0.000 0.000 0.088
#> GSM99449 3 0.0260 0.957 0.000 0.008 0.992 0.000 0.000 0.000
#> GSM99451 3 0.6226 0.284 0.000 0.000 0.552 0.120 0.068 0.260
#> GSM99453 1 0.0146 0.856 0.996 0.000 0.000 0.004 0.000 0.000
#> GSM99455 1 0.0000 0.859 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99457 4 0.3890 0.575 0.400 0.000 0.000 0.596 0.004 0.000
#> GSM99463 2 0.3742 0.554 0.000 0.648 0.000 0.000 0.348 0.004
#> GSM99465 4 0.3636 0.342 0.004 0.000 0.000 0.676 0.000 0.320
#> GSM99467 6 0.0000 0.840 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM99471 1 0.3053 0.641 0.812 0.000 0.000 0.020 0.000 0.168
#> GSM99473 1 0.2883 0.588 0.788 0.000 0.000 0.000 0.000 0.212
#> GSM99475 5 0.6367 0.194 0.000 0.000 0.108 0.248 0.548 0.096
#> GSM99477 6 0.0000 0.840 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM99479 6 0.0000 0.840 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM99481 1 0.0000 0.859 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99483 1 0.0000 0.859 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99485 6 0.0000 0.840 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM99487 2 0.0000 0.819 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM99489 2 0.2823 0.712 0.000 0.796 0.000 0.000 0.204 0.000
#> GSM99491 2 0.1007 0.809 0.000 0.956 0.000 0.000 0.000 0.044
#> GSM99493 1 0.0000 0.859 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99495 2 0.3717 0.508 0.000 0.616 0.000 0.000 0.384 0.000
#> GSM99525 1 0.0000 0.859 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99527 4 0.4300 0.370 0.000 0.080 0.000 0.712 0.000 0.208
#> GSM99529 6 0.0000 0.840 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM99531 6 0.7264 -0.128 0.000 0.000 0.328 0.220 0.104 0.348
#> GSM99533 5 0.6004 0.243 0.016 0.000 0.000 0.188 0.520 0.276
#> GSM99535 6 0.3499 0.588 0.008 0.196 0.000 0.004 0.012 0.780
#> GSM99537 1 0.3746 0.559 0.760 0.000 0.000 0.192 0.048 0.000
#> GSM99539 2 0.3171 0.622 0.000 0.784 0.012 0.000 0.000 0.204
#> GSM99541 4 0.4030 0.589 0.172 0.000 0.000 0.748 0.080 0.000
#> GSM99543 6 0.3455 0.677 0.000 0.000 0.000 0.056 0.144 0.800
#> GSM99545 2 0.4134 0.551 0.000 0.640 0.016 0.000 0.340 0.004
#> GSM99547 6 0.3083 0.702 0.000 0.040 0.000 0.132 0.000 0.828
#> GSM99549 5 0.7130 0.264 0.000 0.228 0.000 0.132 0.452 0.188
#> GSM99551 6 0.1984 0.786 0.000 0.000 0.000 0.056 0.032 0.912
#> GSM99553 3 0.0000 0.965 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM99555 2 0.0146 0.818 0.000 0.996 0.000 0.000 0.004 0.000
#> GSM99557 2 0.2320 0.740 0.000 0.864 0.000 0.000 0.004 0.132
#> GSM99559 3 0.0260 0.957 0.000 0.000 0.992 0.000 0.000 0.008
#> GSM99561 2 0.3200 0.750 0.000 0.840 0.000 0.008 0.060 0.092
#> GSM99563 3 0.0000 0.965 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM99565 2 0.0000 0.819 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM99573 5 0.6100 0.142 0.000 0.304 0.000 0.000 0.384 0.312
#> GSM99577 4 0.3963 0.589 0.164 0.000 0.000 0.756 0.080 0.000
#> GSM99579 6 0.0000 0.840 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM99581 3 0.0000 0.965 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM99583 6 0.0146 0.837 0.000 0.000 0.004 0.000 0.000 0.996
#> GSM99585 2 0.3244 0.508 0.000 0.732 0.000 0.000 0.000 0.268
#> GSM99587 1 0.0820 0.836 0.972 0.000 0.000 0.016 0.012 0.000
#> GSM99589 6 0.1387 0.790 0.000 0.068 0.000 0.000 0.000 0.932
#> GSM99591 2 0.0000 0.819 0.000 1.000 0.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 disease.state(p) cell.type(p) k
#> CV:pam 85 7.00e-02 0.174948 2
#> CV:pam 82 1.12e-04 0.002131 3
#> CV:pam 77 8.47e-06 0.000634 4
#> CV:pam 69 1.36e-05 0.001571 5
#> CV:pam 74 5.45e-05 0.003282 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 21512 rows and 85 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'CV' method.
#> Subgroups are detected by 'mclust' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 2.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
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.974 0.916 0.943 0.3576 0.636 0.636
#> 3 3 0.847 0.894 0.949 0.8659 0.601 0.413
#> 4 4 0.685 0.758 0.863 0.0594 0.936 0.813
#> 5 5 0.899 0.865 0.938 0.0858 0.926 0.754
#> 6 6 0.771 0.719 0.853 0.0523 0.934 0.731
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
#> GSM99497 2 0.0000 0.9182 0.000 1.000
#> GSM99503 1 0.2603 0.9455 0.956 0.044
#> GSM99505 1 0.2603 0.9455 0.956 0.044
#> GSM99507 2 0.0000 0.9182 0.000 1.000
#> GSM99567 2 0.0000 0.9182 0.000 1.000
#> GSM99575 1 0.2603 0.9455 0.956 0.044
#> GSM99593 2 0.0000 0.9182 0.000 1.000
#> GSM99595 2 0.0000 0.9182 0.000 1.000
#> GSM99469 1 0.2603 0.9455 0.956 0.044
#> GSM99499 1 0.2603 0.9455 0.956 0.044
#> GSM99501 1 0.2603 0.9455 0.956 0.044
#> GSM99509 2 0.0000 0.9182 0.000 1.000
#> GSM99569 2 0.0938 0.9125 0.012 0.988
#> GSM99597 2 0.3431 0.8748 0.064 0.936
#> GSM99601 1 0.2948 0.9518 0.948 0.052
#> GSM99459 1 0.2603 0.9455 0.956 0.044
#> GSM99461 1 0.2603 0.9455 0.956 0.044
#> GSM99511 2 0.0000 0.9182 0.000 1.000
#> GSM99513 2 0.0000 0.9182 0.000 1.000
#> GSM99515 2 0.0000 0.9182 0.000 1.000
#> GSM99517 1 0.2603 0.9455 0.956 0.044
#> GSM99519 1 0.2603 0.9455 0.956 0.044
#> GSM99521 2 0.0000 0.9182 0.000 1.000
#> GSM99523 2 0.8813 0.5620 0.300 0.700
#> GSM99571 1 0.2603 0.9455 0.956 0.044
#> GSM99599 1 0.2603 0.9455 0.956 0.044
#> GSM99433 1 0.2948 0.9518 0.948 0.052
#> GSM99435 2 0.0000 0.9182 0.000 1.000
#> GSM99437 1 0.2948 0.9518 0.948 0.052
#> GSM99439 1 0.2948 0.9518 0.948 0.052
#> GSM99441 1 0.2603 0.9455 0.956 0.044
#> GSM99443 1 0.2948 0.9518 0.948 0.052
#> GSM99445 1 0.2948 0.9518 0.948 0.052
#> GSM99447 1 0.2948 0.9518 0.948 0.052
#> GSM99449 2 0.6531 0.7724 0.168 0.832
#> GSM99451 2 0.1184 0.9100 0.016 0.984
#> GSM99453 1 0.2603 0.9455 0.956 0.044
#> GSM99455 1 0.2603 0.9455 0.956 0.044
#> GSM99457 1 0.2603 0.9455 0.956 0.044
#> GSM99463 1 0.2948 0.9518 0.948 0.052
#> GSM99465 1 0.2603 0.9455 0.956 0.044
#> GSM99467 1 0.2948 0.9518 0.948 0.052
#> GSM99471 1 0.2603 0.9455 0.956 0.044
#> GSM99473 1 0.0672 0.9437 0.992 0.008
#> GSM99475 1 0.7139 0.8373 0.804 0.196
#> GSM99477 1 0.2948 0.9518 0.948 0.052
#> GSM99479 1 0.2948 0.9518 0.948 0.052
#> GSM99481 1 0.2603 0.9455 0.956 0.044
#> GSM99483 1 0.2603 0.9455 0.956 0.044
#> GSM99485 1 0.2948 0.9518 0.948 0.052
#> GSM99487 1 0.2948 0.9518 0.948 0.052
#> GSM99489 1 0.2948 0.9518 0.948 0.052
#> GSM99491 1 0.2948 0.9518 0.948 0.052
#> GSM99493 1 0.2603 0.9455 0.956 0.044
#> GSM99495 1 0.2948 0.9518 0.948 0.052
#> GSM99525 1 0.2603 0.9455 0.956 0.044
#> GSM99527 1 0.4431 0.9447 0.908 0.092
#> GSM99529 1 0.2778 0.9518 0.952 0.048
#> GSM99531 1 0.4815 0.9390 0.896 0.104
#> GSM99533 1 0.4298 0.9454 0.912 0.088
#> GSM99535 1 0.2423 0.9515 0.960 0.040
#> GSM99537 1 0.2603 0.9455 0.956 0.044
#> GSM99539 1 0.2948 0.9518 0.948 0.052
#> GSM99541 1 0.2603 0.9455 0.956 0.044
#> GSM99543 1 0.2423 0.9515 0.960 0.040
#> GSM99545 1 0.2948 0.9518 0.948 0.052
#> GSM99547 1 0.3584 0.9505 0.932 0.068
#> GSM99549 1 0.2948 0.9518 0.948 0.052
#> GSM99551 1 0.2603 0.9455 0.956 0.044
#> GSM99553 2 0.9996 -0.0435 0.488 0.512
#> GSM99555 1 0.2948 0.9518 0.948 0.052
#> GSM99557 1 0.2948 0.9518 0.948 0.052
#> GSM99559 2 0.9686 0.4141 0.396 0.604
#> GSM99561 1 0.2948 0.9518 0.948 0.052
#> GSM99563 2 0.0000 0.9182 0.000 1.000
#> GSM99565 1 0.2948 0.9518 0.948 0.052
#> GSM99573 1 0.2948 0.9518 0.948 0.052
#> GSM99577 1 0.2603 0.9455 0.956 0.044
#> GSM99579 1 0.2948 0.9518 0.948 0.052
#> GSM99581 2 0.0000 0.9182 0.000 1.000
#> GSM99583 1 0.2778 0.9524 0.952 0.048
#> GSM99585 1 0.2948 0.9518 0.948 0.052
#> GSM99587 1 0.2603 0.9455 0.956 0.044
#> GSM99589 1 0.2948 0.9518 0.948 0.052
#> GSM99591 1 0.2948 0.9518 0.948 0.052
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM99497 3 0.0000 0.873 0.000 0.000 1.000
#> GSM99503 1 0.0000 0.998 1.000 0.000 0.000
#> GSM99505 1 0.1289 0.962 0.968 0.000 0.032
#> GSM99507 3 0.0000 0.873 0.000 0.000 1.000
#> GSM99567 3 0.0000 0.873 0.000 0.000 1.000
#> GSM99575 1 0.0000 0.998 1.000 0.000 0.000
#> GSM99593 3 0.0000 0.873 0.000 0.000 1.000
#> GSM99595 3 0.0000 0.873 0.000 0.000 1.000
#> GSM99469 1 0.0000 0.998 1.000 0.000 0.000
#> GSM99499 1 0.0000 0.998 1.000 0.000 0.000
#> GSM99501 1 0.0000 0.998 1.000 0.000 0.000
#> GSM99509 3 0.0000 0.873 0.000 0.000 1.000
#> GSM99569 3 0.0000 0.873 0.000 0.000 1.000
#> GSM99597 3 0.0000 0.873 0.000 0.000 1.000
#> GSM99601 2 0.0000 0.967 0.000 1.000 0.000
#> GSM99459 1 0.0000 0.998 1.000 0.000 0.000
#> GSM99461 1 0.0000 0.998 1.000 0.000 0.000
#> GSM99511 3 0.0000 0.873 0.000 0.000 1.000
#> GSM99513 3 0.0000 0.873 0.000 0.000 1.000
#> GSM99515 3 0.0000 0.873 0.000 0.000 1.000
#> GSM99517 1 0.0000 0.998 1.000 0.000 0.000
#> GSM99519 1 0.0000 0.998 1.000 0.000 0.000
#> GSM99521 3 0.0000 0.873 0.000 0.000 1.000
#> GSM99523 3 0.4682 0.747 0.192 0.004 0.804
#> GSM99571 1 0.0000 0.998 1.000 0.000 0.000
#> GSM99599 1 0.0000 0.998 1.000 0.000 0.000
#> GSM99433 2 0.1411 0.933 0.000 0.964 0.036
#> GSM99435 3 0.0000 0.873 0.000 0.000 1.000
#> GSM99437 2 0.0000 0.967 0.000 1.000 0.000
#> GSM99439 2 0.0000 0.967 0.000 1.000 0.000
#> GSM99441 1 0.0000 0.998 1.000 0.000 0.000
#> GSM99443 2 0.0000 0.967 0.000 1.000 0.000
#> GSM99445 2 0.0000 0.967 0.000 1.000 0.000
#> GSM99447 2 0.0000 0.967 0.000 1.000 0.000
#> GSM99449 3 0.5098 0.680 0.000 0.248 0.752
#> GSM99451 3 0.0000 0.873 0.000 0.000 1.000
#> GSM99453 1 0.0000 0.998 1.000 0.000 0.000
#> GSM99455 1 0.0000 0.998 1.000 0.000 0.000
#> GSM99457 1 0.0000 0.998 1.000 0.000 0.000
#> GSM99463 2 0.0000 0.967 0.000 1.000 0.000
#> GSM99465 3 0.6345 0.441 0.400 0.004 0.596
#> GSM99467 2 0.0000 0.967 0.000 1.000 0.000
#> GSM99471 1 0.0000 0.998 1.000 0.000 0.000
#> GSM99473 1 0.0000 0.998 1.000 0.000 0.000
#> GSM99475 3 0.3910 0.812 0.020 0.104 0.876
#> GSM99477 3 0.6286 0.253 0.000 0.464 0.536
#> GSM99479 2 0.0000 0.967 0.000 1.000 0.000
#> GSM99481 1 0.0000 0.998 1.000 0.000 0.000
#> GSM99483 1 0.0000 0.998 1.000 0.000 0.000
#> GSM99485 2 0.0000 0.967 0.000 1.000 0.000
#> GSM99487 2 0.0000 0.967 0.000 1.000 0.000
#> GSM99489 2 0.0000 0.967 0.000 1.000 0.000
#> GSM99491 2 0.0000 0.967 0.000 1.000 0.000
#> GSM99493 1 0.0000 0.998 1.000 0.000 0.000
#> GSM99495 2 0.0000 0.967 0.000 1.000 0.000
#> GSM99525 1 0.0000 0.998 1.000 0.000 0.000
#> GSM99527 3 0.6796 0.520 0.024 0.344 0.632
#> GSM99529 2 0.6168 0.148 0.000 0.588 0.412
#> GSM99531 3 0.5921 0.722 0.212 0.032 0.756
#> GSM99533 3 0.6209 0.506 0.368 0.004 0.628
#> GSM99535 2 0.0592 0.955 0.012 0.988 0.000
#> GSM99537 1 0.0000 0.998 1.000 0.000 0.000
#> GSM99539 2 0.5138 0.617 0.000 0.748 0.252
#> GSM99541 1 0.0000 0.998 1.000 0.000 0.000
#> GSM99543 2 0.0000 0.967 0.000 1.000 0.000
#> GSM99545 2 0.3116 0.850 0.000 0.892 0.108
#> GSM99547 3 0.8631 0.627 0.220 0.180 0.600
#> GSM99549 2 0.0000 0.967 0.000 1.000 0.000
#> GSM99551 1 0.0747 0.979 0.984 0.016 0.000
#> GSM99553 3 0.0000 0.873 0.000 0.000 1.000
#> GSM99555 2 0.0000 0.967 0.000 1.000 0.000
#> GSM99557 2 0.0000 0.967 0.000 1.000 0.000
#> GSM99559 3 0.5216 0.665 0.000 0.260 0.740
#> GSM99561 2 0.0000 0.967 0.000 1.000 0.000
#> GSM99563 3 0.0000 0.873 0.000 0.000 1.000
#> GSM99565 2 0.0000 0.967 0.000 1.000 0.000
#> GSM99573 2 0.0000 0.967 0.000 1.000 0.000
#> GSM99577 1 0.0000 0.998 1.000 0.000 0.000
#> GSM99579 2 0.0000 0.967 0.000 1.000 0.000
#> GSM99581 3 0.0000 0.873 0.000 0.000 1.000
#> GSM99583 3 0.8853 0.574 0.176 0.252 0.572
#> GSM99585 2 0.0000 0.967 0.000 1.000 0.000
#> GSM99587 1 0.0000 0.998 1.000 0.000 0.000
#> GSM99589 2 0.0000 0.967 0.000 1.000 0.000
#> GSM99591 2 0.0000 0.967 0.000 1.000 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM99497 3 0.0336 0.852 0.000 0.000 0.992 0.008
#> GSM99503 1 0.4866 0.851 0.596 0.000 0.000 0.404
#> GSM99505 1 0.7205 0.731 0.504 0.000 0.152 0.344
#> GSM99507 3 0.0336 0.852 0.000 0.000 0.992 0.008
#> GSM99567 3 0.0336 0.852 0.000 0.000 0.992 0.008
#> GSM99575 1 0.4866 0.851 0.596 0.000 0.000 0.404
#> GSM99593 3 0.0336 0.852 0.000 0.000 0.992 0.008
#> GSM99595 3 0.0336 0.852 0.000 0.000 0.992 0.008
#> GSM99469 1 0.4855 0.851 0.600 0.000 0.000 0.400
#> GSM99499 1 0.4804 0.850 0.616 0.000 0.000 0.384
#> GSM99501 1 0.4866 0.851 0.596 0.000 0.000 0.404
#> GSM99509 3 0.0336 0.852 0.000 0.000 0.992 0.008
#> GSM99569 3 0.0376 0.851 0.000 0.004 0.992 0.004
#> GSM99597 3 0.0469 0.852 0.000 0.000 0.988 0.012
#> GSM99601 2 0.0188 0.861 0.000 0.996 0.000 0.004
#> GSM99459 1 0.4866 0.851 0.596 0.000 0.000 0.404
#> GSM99461 1 0.4877 0.850 0.592 0.000 0.000 0.408
#> GSM99511 3 0.0188 0.852 0.000 0.000 0.996 0.004
#> GSM99513 3 0.0469 0.852 0.000 0.000 0.988 0.012
#> GSM99515 3 0.0336 0.852 0.000 0.000 0.992 0.008
#> GSM99517 1 0.4866 0.851 0.596 0.000 0.000 0.404
#> GSM99519 1 0.4866 0.851 0.596 0.000 0.000 0.404
#> GSM99521 3 0.0336 0.852 0.000 0.000 0.992 0.008
#> GSM99523 3 0.3720 0.795 0.016 0.100 0.860 0.024
#> GSM99571 1 0.4454 0.836 0.692 0.000 0.000 0.308
#> GSM99599 1 0.4843 0.851 0.604 0.000 0.000 0.396
#> GSM99433 2 0.4446 0.374 0.000 0.776 0.196 0.028
#> GSM99435 3 0.0188 0.852 0.000 0.000 0.996 0.004
#> GSM99437 2 0.0000 0.862 0.000 1.000 0.000 0.000
#> GSM99439 4 0.4961 0.988 0.000 0.448 0.000 0.552
#> GSM99441 1 0.4843 0.851 0.604 0.000 0.000 0.396
#> GSM99443 2 0.0188 0.861 0.000 0.996 0.000 0.004
#> GSM99445 2 0.0188 0.861 0.000 0.996 0.000 0.004
#> GSM99447 2 0.0469 0.858 0.000 0.988 0.000 0.012
#> GSM99449 3 0.3836 0.748 0.000 0.168 0.816 0.016
#> GSM99451 3 0.0188 0.852 0.000 0.000 0.996 0.004
#> GSM99453 1 0.0469 0.713 0.988 0.000 0.000 0.012
#> GSM99455 1 0.0000 0.720 1.000 0.000 0.000 0.000
#> GSM99457 1 0.0000 0.720 1.000 0.000 0.000 0.000
#> GSM99463 4 0.4981 0.964 0.000 0.464 0.000 0.536
#> GSM99465 3 0.8860 0.343 0.160 0.208 0.504 0.128
#> GSM99467 2 0.0336 0.860 0.000 0.992 0.000 0.008
#> GSM99471 1 0.5697 0.448 0.656 0.292 0.000 0.052
#> GSM99473 1 0.6618 0.750 0.604 0.124 0.000 0.272
#> GSM99475 3 0.4013 0.784 0.012 0.108 0.844 0.036
#> GSM99477 2 0.2282 0.766 0.000 0.924 0.052 0.024
#> GSM99479 2 0.0895 0.847 0.000 0.976 0.004 0.020
#> GSM99481 1 0.4843 0.851 0.604 0.000 0.000 0.396
#> GSM99483 1 0.0336 0.716 0.992 0.000 0.000 0.008
#> GSM99485 2 0.0336 0.860 0.000 0.992 0.000 0.008
#> GSM99487 2 0.0000 0.862 0.000 1.000 0.000 0.000
#> GSM99489 2 0.1716 0.783 0.000 0.936 0.000 0.064
#> GSM99491 2 0.0000 0.862 0.000 1.000 0.000 0.000
#> GSM99493 1 0.0469 0.713 0.988 0.000 0.000 0.012
#> GSM99495 4 0.4967 0.985 0.000 0.452 0.000 0.548
#> GSM99525 1 0.4543 0.843 0.676 0.000 0.000 0.324
#> GSM99527 3 0.5552 0.627 0.008 0.236 0.708 0.048
#> GSM99529 2 0.1798 0.815 0.000 0.944 0.016 0.040
#> GSM99531 3 0.4357 0.774 0.020 0.116 0.828 0.036
#> GSM99533 3 0.5361 0.747 0.048 0.112 0.784 0.056
#> GSM99535 2 0.2297 0.791 0.024 0.928 0.004 0.044
#> GSM99537 1 0.4804 0.852 0.616 0.000 0.000 0.384
#> GSM99539 3 0.5755 0.146 0.000 0.444 0.528 0.028
#> GSM99541 1 0.6111 0.828 0.616 0.004 0.056 0.324
#> GSM99543 2 0.5152 -0.176 0.020 0.664 0.000 0.316
#> GSM99545 2 0.7614 -0.438 0.000 0.468 0.232 0.300
#> GSM99547 3 0.7230 0.328 0.056 0.344 0.552 0.048
#> GSM99549 4 0.4961 0.988 0.000 0.448 0.000 0.552
#> GSM99551 1 0.3793 0.626 0.844 0.112 0.000 0.044
#> GSM99553 3 0.0895 0.847 0.000 0.020 0.976 0.004
#> GSM99555 2 0.0188 0.861 0.000 0.996 0.000 0.004
#> GSM99557 2 0.0707 0.845 0.000 0.980 0.000 0.020
#> GSM99559 3 0.4204 0.715 0.000 0.192 0.788 0.020
#> GSM99561 2 0.3907 0.307 0.000 0.768 0.000 0.232
#> GSM99563 3 0.0336 0.852 0.000 0.000 0.992 0.008
#> GSM99565 2 0.0000 0.862 0.000 1.000 0.000 0.000
#> GSM99573 4 0.4961 0.988 0.000 0.448 0.000 0.552
#> GSM99577 1 0.3497 0.656 0.860 0.104 0.000 0.036
#> GSM99579 2 0.0000 0.862 0.000 1.000 0.000 0.000
#> GSM99581 3 0.1576 0.836 0.000 0.048 0.948 0.004
#> GSM99583 3 0.6738 0.166 0.024 0.420 0.512 0.044
#> GSM99585 2 0.0779 0.851 0.000 0.980 0.004 0.016
#> GSM99587 1 0.0469 0.713 0.988 0.000 0.000 0.012
#> GSM99589 2 0.0000 0.862 0.000 1.000 0.000 0.000
#> GSM99591 2 0.0000 0.862 0.000 1.000 0.000 0.000
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM99497 3 0.0451 0.9499 0.000 0.000 0.988 0.004 0.008
#> GSM99503 1 0.0000 0.9176 1.000 0.000 0.000 0.000 0.000
#> GSM99505 1 0.0566 0.9113 0.984 0.000 0.012 0.000 0.004
#> GSM99507 3 0.0451 0.9499 0.000 0.000 0.988 0.004 0.008
#> GSM99567 3 0.0162 0.9505 0.000 0.000 0.996 0.000 0.004
#> GSM99575 1 0.0000 0.9176 1.000 0.000 0.000 0.000 0.000
#> GSM99593 3 0.0162 0.9505 0.000 0.000 0.996 0.000 0.004
#> GSM99595 3 0.0162 0.9505 0.000 0.000 0.996 0.000 0.004
#> GSM99469 1 0.0000 0.9176 1.000 0.000 0.000 0.000 0.000
#> GSM99499 1 0.0963 0.9003 0.964 0.000 0.000 0.036 0.000
#> GSM99501 1 0.0000 0.9176 1.000 0.000 0.000 0.000 0.000
#> GSM99509 3 0.0000 0.9509 0.000 0.000 1.000 0.000 0.000
#> GSM99569 3 0.0566 0.9497 0.000 0.000 0.984 0.004 0.012
#> GSM99597 3 0.0290 0.9508 0.000 0.000 0.992 0.000 0.008
#> GSM99601 2 0.0609 0.9137 0.000 0.980 0.000 0.000 0.020
#> GSM99459 1 0.0290 0.9157 0.992 0.000 0.000 0.008 0.000
#> GSM99461 1 0.0290 0.9157 0.992 0.000 0.000 0.008 0.000
#> GSM99511 3 0.0290 0.9500 0.000 0.000 0.992 0.000 0.008
#> GSM99513 3 0.0290 0.9500 0.000 0.000 0.992 0.000 0.008
#> GSM99515 3 0.0451 0.9499 0.000 0.000 0.988 0.004 0.008
#> GSM99517 1 0.0000 0.9176 1.000 0.000 0.000 0.000 0.000
#> GSM99519 1 0.0290 0.9157 0.992 0.000 0.000 0.008 0.000
#> GSM99521 3 0.0162 0.9505 0.000 0.000 0.996 0.000 0.004
#> GSM99523 3 0.1026 0.9449 0.004 0.000 0.968 0.004 0.024
#> GSM99571 1 0.3895 0.5415 0.680 0.000 0.000 0.320 0.000
#> GSM99599 1 0.0162 0.9172 0.996 0.000 0.000 0.004 0.000
#> GSM99433 2 0.4181 0.4929 0.000 0.712 0.268 0.000 0.020
#> GSM99435 3 0.0290 0.9500 0.000 0.000 0.992 0.000 0.008
#> GSM99437 2 0.0000 0.9209 0.000 1.000 0.000 0.000 0.000
#> GSM99439 5 0.0609 0.8200 0.000 0.020 0.000 0.000 0.980
#> GSM99441 1 0.0290 0.9163 0.992 0.000 0.000 0.008 0.000
#> GSM99443 2 0.0404 0.9182 0.000 0.988 0.000 0.000 0.012
#> GSM99445 2 0.0290 0.9196 0.000 0.992 0.000 0.000 0.008
#> GSM99447 2 0.1341 0.8841 0.000 0.944 0.000 0.000 0.056
#> GSM99449 3 0.0740 0.9480 0.000 0.008 0.980 0.004 0.008
#> GSM99451 3 0.0162 0.9507 0.000 0.000 0.996 0.000 0.004
#> GSM99453 4 0.0510 0.9740 0.016 0.000 0.000 0.984 0.000
#> GSM99455 4 0.0880 0.9728 0.032 0.000 0.000 0.968 0.000
#> GSM99457 4 0.0510 0.9740 0.016 0.000 0.000 0.984 0.000
#> GSM99463 5 0.1121 0.8107 0.000 0.044 0.000 0.000 0.956
#> GSM99465 1 0.4667 0.5317 0.696 0.008 0.272 0.012 0.012
#> GSM99467 2 0.0000 0.9209 0.000 1.000 0.000 0.000 0.000
#> GSM99471 4 0.2243 0.9293 0.056 0.012 0.000 0.916 0.016
#> GSM99473 1 0.0613 0.9141 0.984 0.004 0.000 0.008 0.004
#> GSM99475 3 0.1059 0.9428 0.000 0.008 0.968 0.004 0.020
#> GSM99477 2 0.0912 0.9069 0.000 0.972 0.012 0.000 0.016
#> GSM99479 2 0.0404 0.9164 0.000 0.988 0.000 0.000 0.012
#> GSM99481 1 0.0162 0.9172 0.996 0.000 0.000 0.004 0.000
#> GSM99483 4 0.0880 0.9728 0.032 0.000 0.000 0.968 0.000
#> GSM99485 2 0.0000 0.9209 0.000 1.000 0.000 0.000 0.000
#> GSM99487 2 0.0000 0.9209 0.000 1.000 0.000 0.000 0.000
#> GSM99489 2 0.3913 0.4850 0.000 0.676 0.000 0.000 0.324
#> GSM99491 2 0.0000 0.9209 0.000 1.000 0.000 0.000 0.000
#> GSM99493 4 0.0703 0.9751 0.024 0.000 0.000 0.976 0.000
#> GSM99495 5 0.0794 0.8187 0.000 0.028 0.000 0.000 0.972
#> GSM99525 1 0.3424 0.6787 0.760 0.000 0.000 0.240 0.000
#> GSM99527 3 0.3279 0.8258 0.004 0.116 0.852 0.012 0.016
#> GSM99529 2 0.0510 0.9144 0.000 0.984 0.000 0.000 0.016
#> GSM99531 3 0.1220 0.9408 0.004 0.008 0.964 0.004 0.020
#> GSM99533 3 0.1692 0.9317 0.008 0.008 0.948 0.016 0.020
#> GSM99535 2 0.1605 0.8870 0.004 0.944 0.000 0.040 0.012
#> GSM99537 1 0.3395 0.6833 0.764 0.000 0.000 0.236 0.000
#> GSM99539 3 0.3852 0.6882 0.000 0.220 0.760 0.000 0.020
#> GSM99541 1 0.2116 0.8456 0.912 0.000 0.076 0.008 0.004
#> GSM99543 5 0.5329 0.4076 0.000 0.336 0.000 0.068 0.596
#> GSM99545 5 0.6152 0.3642 0.000 0.152 0.324 0.000 0.524
#> GSM99547 3 0.4271 0.7621 0.004 0.148 0.792 0.036 0.020
#> GSM99549 5 0.0609 0.8200 0.000 0.020 0.000 0.000 0.980
#> GSM99551 4 0.1200 0.9604 0.012 0.008 0.000 0.964 0.016
#> GSM99553 3 0.0451 0.9495 0.000 0.008 0.988 0.000 0.004
#> GSM99555 2 0.0290 0.9199 0.000 0.992 0.000 0.000 0.008
#> GSM99557 2 0.2127 0.8318 0.000 0.892 0.000 0.000 0.108
#> GSM99559 3 0.0960 0.9441 0.000 0.008 0.972 0.004 0.016
#> GSM99561 2 0.4304 -0.0333 0.000 0.516 0.000 0.000 0.484
#> GSM99563 3 0.0000 0.9509 0.000 0.000 1.000 0.000 0.000
#> GSM99565 2 0.0000 0.9209 0.000 1.000 0.000 0.000 0.000
#> GSM99573 5 0.0609 0.8200 0.000 0.020 0.000 0.000 0.980
#> GSM99577 4 0.1306 0.9628 0.016 0.008 0.000 0.960 0.016
#> GSM99579 2 0.0162 0.9205 0.000 0.996 0.000 0.000 0.004
#> GSM99581 3 0.0566 0.9497 0.000 0.000 0.984 0.004 0.012
#> GSM99583 3 0.4297 0.6746 0.004 0.220 0.748 0.012 0.016
#> GSM99585 2 0.0404 0.9164 0.000 0.988 0.000 0.000 0.012
#> GSM99587 4 0.0510 0.9740 0.016 0.000 0.000 0.984 0.000
#> GSM99589 2 0.0000 0.9209 0.000 1.000 0.000 0.000 0.000
#> GSM99591 2 0.0290 0.9196 0.000 0.992 0.000 0.000 0.008
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM99497 3 0.0508 0.7148 0.000 0.000 0.984 0.012 0.000 0.004
#> GSM99503 1 0.0000 0.8953 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99505 1 0.1462 0.8639 0.936 0.000 0.000 0.056 0.000 0.008
#> GSM99507 3 0.0291 0.7256 0.000 0.000 0.992 0.004 0.000 0.004
#> GSM99567 3 0.2520 0.7633 0.000 0.000 0.844 0.152 0.000 0.004
#> GSM99575 1 0.0000 0.8953 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99593 3 0.2340 0.7641 0.000 0.000 0.852 0.148 0.000 0.000
#> GSM99595 3 0.2902 0.7439 0.000 0.000 0.800 0.196 0.000 0.004
#> GSM99469 1 0.0000 0.8953 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99499 1 0.1265 0.8789 0.948 0.000 0.000 0.008 0.000 0.044
#> GSM99501 1 0.0000 0.8953 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99509 3 0.2482 0.7639 0.000 0.000 0.848 0.148 0.000 0.004
#> GSM99569 3 0.1267 0.7066 0.000 0.000 0.940 0.060 0.000 0.000
#> GSM99597 3 0.3175 0.7057 0.000 0.000 0.744 0.256 0.000 0.000
#> GSM99601 2 0.0260 0.8595 0.000 0.992 0.000 0.000 0.008 0.000
#> GSM99459 1 0.0508 0.8931 0.984 0.000 0.000 0.012 0.000 0.004
#> GSM99461 1 0.0508 0.8931 0.984 0.000 0.000 0.012 0.000 0.004
#> GSM99511 3 0.3371 0.6475 0.000 0.000 0.708 0.292 0.000 0.000
#> GSM99513 3 0.3706 0.4862 0.000 0.000 0.620 0.380 0.000 0.000
#> GSM99515 3 0.0291 0.7256 0.000 0.000 0.992 0.004 0.000 0.004
#> GSM99517 1 0.0000 0.8953 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99519 1 0.0508 0.8931 0.984 0.000 0.000 0.012 0.000 0.004
#> GSM99521 3 0.2597 0.7563 0.000 0.000 0.824 0.176 0.000 0.000
#> GSM99523 3 0.2631 0.6108 0.000 0.000 0.840 0.152 0.000 0.008
#> GSM99571 1 0.3446 0.5717 0.692 0.000 0.000 0.000 0.000 0.308
#> GSM99599 1 0.0146 0.8950 0.996 0.000 0.000 0.000 0.000 0.004
#> GSM99433 4 0.4874 -0.0544 0.000 0.472 0.020 0.484 0.024 0.000
#> GSM99435 3 0.3151 0.6979 0.000 0.000 0.748 0.252 0.000 0.000
#> GSM99437 2 0.0000 0.8597 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM99439 5 0.0000 0.7856 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM99441 1 0.0458 0.8928 0.984 0.000 0.000 0.000 0.000 0.016
#> GSM99443 2 0.0146 0.8590 0.000 0.996 0.000 0.000 0.004 0.000
#> GSM99445 2 0.0146 0.8590 0.000 0.996 0.000 0.000 0.004 0.000
#> GSM99447 2 0.1418 0.8459 0.000 0.944 0.000 0.024 0.032 0.000
#> GSM99449 3 0.2178 0.6384 0.000 0.000 0.868 0.132 0.000 0.000
#> GSM99451 3 0.3843 0.3108 0.000 0.000 0.548 0.452 0.000 0.000
#> GSM99453 6 0.0363 0.8881 0.012 0.000 0.000 0.000 0.000 0.988
#> GSM99455 6 0.0692 0.8864 0.020 0.000 0.000 0.004 0.000 0.976
#> GSM99457 6 0.0363 0.8881 0.012 0.000 0.000 0.000 0.000 0.988
#> GSM99463 5 0.0713 0.7817 0.000 0.028 0.000 0.000 0.972 0.000
#> GSM99465 1 0.6213 0.0835 0.408 0.000 0.372 0.208 0.000 0.012
#> GSM99467 2 0.1204 0.8523 0.000 0.944 0.000 0.056 0.000 0.000
#> GSM99471 6 0.4308 0.6804 0.040 0.000 0.000 0.280 0.004 0.676
#> GSM99473 1 0.2848 0.7541 0.816 0.000 0.000 0.176 0.000 0.008
#> GSM99475 4 0.3448 0.5110 0.000 0.000 0.280 0.716 0.000 0.004
#> GSM99477 2 0.4039 0.6884 0.000 0.732 0.060 0.208 0.000 0.000
#> GSM99479 2 0.2730 0.7517 0.000 0.808 0.000 0.192 0.000 0.000
#> GSM99481 1 0.0260 0.8948 0.992 0.000 0.000 0.000 0.000 0.008
#> GSM99483 6 0.0692 0.8864 0.020 0.000 0.000 0.004 0.000 0.976
#> GSM99485 2 0.1007 0.8559 0.000 0.956 0.000 0.044 0.000 0.000
#> GSM99487 2 0.0146 0.8603 0.000 0.996 0.000 0.004 0.000 0.000
#> GSM99489 2 0.3592 0.3963 0.000 0.656 0.000 0.000 0.344 0.000
#> GSM99491 2 0.0458 0.8601 0.000 0.984 0.000 0.016 0.000 0.000
#> GSM99493 6 0.0363 0.8881 0.012 0.000 0.000 0.000 0.000 0.988
#> GSM99495 5 0.0458 0.7858 0.000 0.016 0.000 0.000 0.984 0.000
#> GSM99525 1 0.2527 0.7775 0.832 0.000 0.000 0.000 0.000 0.168
#> GSM99527 4 0.3279 0.6278 0.000 0.028 0.148 0.816 0.000 0.008
#> GSM99529 2 0.3668 0.6224 0.000 0.668 0.000 0.328 0.000 0.004
#> GSM99531 4 0.3512 0.5262 0.000 0.000 0.272 0.720 0.000 0.008
#> GSM99533 4 0.3490 0.5304 0.000 0.000 0.268 0.724 0.000 0.008
#> GSM99535 2 0.4290 0.5484 0.000 0.612 0.000 0.364 0.004 0.020
#> GSM99537 1 0.3126 0.6481 0.752 0.000 0.000 0.000 0.000 0.248
#> GSM99539 4 0.5617 0.5903 0.000 0.208 0.156 0.612 0.024 0.000
#> GSM99541 1 0.1745 0.8571 0.920 0.000 0.000 0.068 0.000 0.012
#> GSM99543 5 0.6081 0.3640 0.000 0.160 0.000 0.308 0.508 0.024
#> GSM99545 4 0.5474 0.5911 0.000 0.112 0.072 0.672 0.144 0.000
#> GSM99547 4 0.2345 0.6221 0.000 0.028 0.052 0.904 0.004 0.012
#> GSM99549 5 0.0260 0.7854 0.000 0.000 0.000 0.008 0.992 0.000
#> GSM99551 6 0.2994 0.7665 0.000 0.000 0.000 0.208 0.004 0.788
#> GSM99553 3 0.3747 0.5027 0.000 0.000 0.604 0.396 0.000 0.000
#> GSM99555 2 0.0260 0.8577 0.000 0.992 0.000 0.000 0.008 0.000
#> GSM99557 2 0.1863 0.7968 0.000 0.896 0.000 0.000 0.104 0.000
#> GSM99559 3 0.2454 0.6500 0.000 0.000 0.840 0.160 0.000 0.000
#> GSM99561 5 0.5743 0.0124 0.000 0.404 0.000 0.168 0.428 0.000
#> GSM99563 3 0.2135 0.7639 0.000 0.000 0.872 0.128 0.000 0.000
#> GSM99565 2 0.0000 0.8597 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM99573 5 0.0260 0.7854 0.000 0.000 0.000 0.008 0.992 0.000
#> GSM99577 6 0.2871 0.7762 0.000 0.000 0.000 0.192 0.004 0.804
#> GSM99579 2 0.0547 0.8598 0.000 0.980 0.000 0.020 0.000 0.000
#> GSM99581 3 0.2092 0.6533 0.000 0.000 0.876 0.124 0.000 0.000
#> GSM99583 2 0.6019 0.1228 0.000 0.428 0.140 0.416 0.004 0.012
#> GSM99585 2 0.2631 0.7649 0.000 0.820 0.000 0.180 0.000 0.000
#> GSM99587 6 0.0363 0.8881 0.012 0.000 0.000 0.000 0.000 0.988
#> GSM99589 2 0.1387 0.8494 0.000 0.932 0.000 0.068 0.000 0.000
#> GSM99591 2 0.0000 0.8597 0.000 1.000 0.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 disease.state(p) cell.type(p) k
#> CV:mclust 83 8.14e-05 0.000280 2
#> CV:mclust 82 2.32e-04 0.006109 3
#> CV:mclust 76 8.60e-04 0.035540 4
#> CV:mclust 80 5.55e-05 0.009539 5
#> CV:mclust 77 8.74e-07 0.000705 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 21512 rows and 85 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.830 0.900 0.958 0.5021 0.495 0.495
#> 3 3 0.999 0.944 0.975 0.3414 0.714 0.484
#> 4 4 0.750 0.754 0.867 0.1011 0.901 0.710
#> 5 5 0.715 0.660 0.812 0.0616 0.930 0.745
#> 6 6 0.710 0.596 0.768 0.0398 0.962 0.836
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
#> GSM99497 2 0.9833 0.281 0.424 0.576
#> GSM99503 1 0.0000 0.960 1.000 0.000
#> GSM99505 1 0.0000 0.960 1.000 0.000
#> GSM99507 1 0.8267 0.648 0.740 0.260
#> GSM99567 2 0.4022 0.889 0.080 0.920
#> GSM99575 1 0.0000 0.960 1.000 0.000
#> GSM99593 2 0.0376 0.946 0.004 0.996
#> GSM99595 1 0.9635 0.358 0.612 0.388
#> GSM99469 1 0.0000 0.960 1.000 0.000
#> GSM99499 1 0.0000 0.960 1.000 0.000
#> GSM99501 1 0.0000 0.960 1.000 0.000
#> GSM99509 1 0.1414 0.946 0.980 0.020
#> GSM99569 1 0.1414 0.946 0.980 0.020
#> GSM99597 1 0.0000 0.960 1.000 0.000
#> GSM99601 2 0.0000 0.948 0.000 1.000
#> GSM99459 1 0.0000 0.960 1.000 0.000
#> GSM99461 1 0.0000 0.960 1.000 0.000
#> GSM99511 2 0.8909 0.570 0.308 0.692
#> GSM99513 2 0.4161 0.885 0.084 0.916
#> GSM99515 1 0.2778 0.921 0.952 0.048
#> GSM99517 1 0.0000 0.960 1.000 0.000
#> GSM99519 1 0.0000 0.960 1.000 0.000
#> GSM99521 1 0.8813 0.569 0.700 0.300
#> GSM99523 1 0.0000 0.960 1.000 0.000
#> GSM99571 1 0.0000 0.960 1.000 0.000
#> GSM99599 1 0.0000 0.960 1.000 0.000
#> GSM99433 2 0.0000 0.948 0.000 1.000
#> GSM99435 2 0.1184 0.938 0.016 0.984
#> GSM99437 2 0.0000 0.948 0.000 1.000
#> GSM99439 2 0.0000 0.948 0.000 1.000
#> GSM99441 1 0.0000 0.960 1.000 0.000
#> GSM99443 2 0.0000 0.948 0.000 1.000
#> GSM99445 2 0.0000 0.948 0.000 1.000
#> GSM99447 2 0.0000 0.948 0.000 1.000
#> GSM99449 2 0.0000 0.948 0.000 1.000
#> GSM99451 1 0.0672 0.955 0.992 0.008
#> GSM99453 1 0.0000 0.960 1.000 0.000
#> GSM99455 1 0.0000 0.960 1.000 0.000
#> GSM99457 1 0.0000 0.960 1.000 0.000
#> GSM99463 2 0.0000 0.948 0.000 1.000
#> GSM99465 1 0.0672 0.955 0.992 0.008
#> GSM99467 2 0.0000 0.948 0.000 1.000
#> GSM99471 1 0.0000 0.960 1.000 0.000
#> GSM99473 1 0.0000 0.960 1.000 0.000
#> GSM99475 1 0.8909 0.548 0.692 0.308
#> GSM99477 2 0.0000 0.948 0.000 1.000
#> GSM99479 2 0.0000 0.948 0.000 1.000
#> GSM99481 1 0.0000 0.960 1.000 0.000
#> GSM99483 1 0.0000 0.960 1.000 0.000
#> GSM99485 2 0.0000 0.948 0.000 1.000
#> GSM99487 2 0.0000 0.948 0.000 1.000
#> GSM99489 2 0.0000 0.948 0.000 1.000
#> GSM99491 2 0.0000 0.948 0.000 1.000
#> GSM99493 1 0.0000 0.960 1.000 0.000
#> GSM99495 2 0.0000 0.948 0.000 1.000
#> GSM99525 1 0.0000 0.960 1.000 0.000
#> GSM99527 2 0.6623 0.793 0.172 0.828
#> GSM99529 2 0.0672 0.944 0.008 0.992
#> GSM99531 1 0.0938 0.952 0.988 0.012
#> GSM99533 1 0.0000 0.960 1.000 0.000
#> GSM99535 2 0.0672 0.944 0.008 0.992
#> GSM99537 1 0.0000 0.960 1.000 0.000
#> GSM99539 2 0.0000 0.948 0.000 1.000
#> GSM99541 1 0.0000 0.960 1.000 0.000
#> GSM99543 2 0.0000 0.948 0.000 1.000
#> GSM99545 2 0.0000 0.948 0.000 1.000
#> GSM99547 2 0.9896 0.238 0.440 0.560
#> GSM99549 2 0.0000 0.948 0.000 1.000
#> GSM99551 1 0.0000 0.960 1.000 0.000
#> GSM99553 2 0.5842 0.829 0.140 0.860
#> GSM99555 2 0.0000 0.948 0.000 1.000
#> GSM99557 2 0.0000 0.948 0.000 1.000
#> GSM99559 2 0.0000 0.948 0.000 1.000
#> GSM99561 2 0.0000 0.948 0.000 1.000
#> GSM99563 1 0.5408 0.842 0.876 0.124
#> GSM99565 2 0.0000 0.948 0.000 1.000
#> GSM99573 2 0.0000 0.948 0.000 1.000
#> GSM99577 1 0.0000 0.960 1.000 0.000
#> GSM99579 2 0.0000 0.948 0.000 1.000
#> GSM99581 2 0.5629 0.838 0.132 0.868
#> GSM99583 2 0.8813 0.590 0.300 0.700
#> GSM99585 2 0.0000 0.948 0.000 1.000
#> GSM99587 1 0.0000 0.960 1.000 0.000
#> GSM99589 2 0.0000 0.948 0.000 1.000
#> GSM99591 2 0.0000 0.948 0.000 1.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM99497 3 0.0000 0.951 0.000 0.000 1.000
#> GSM99503 1 0.0000 0.998 1.000 0.000 0.000
#> GSM99505 3 0.5431 0.614 0.284 0.000 0.716
#> GSM99507 3 0.0000 0.951 0.000 0.000 1.000
#> GSM99567 3 0.0000 0.951 0.000 0.000 1.000
#> GSM99575 1 0.0000 0.998 1.000 0.000 0.000
#> GSM99593 3 0.0000 0.951 0.000 0.000 1.000
#> GSM99595 3 0.0000 0.951 0.000 0.000 1.000
#> GSM99469 1 0.0000 0.998 1.000 0.000 0.000
#> GSM99499 1 0.0592 0.987 0.988 0.000 0.012
#> GSM99501 1 0.0000 0.998 1.000 0.000 0.000
#> GSM99509 3 0.0000 0.951 0.000 0.000 1.000
#> GSM99569 3 0.0000 0.951 0.000 0.000 1.000
#> GSM99597 3 0.0000 0.951 0.000 0.000 1.000
#> GSM99601 2 0.0000 0.977 0.000 1.000 0.000
#> GSM99459 1 0.0000 0.998 1.000 0.000 0.000
#> GSM99461 1 0.0000 0.998 1.000 0.000 0.000
#> GSM99511 3 0.0000 0.951 0.000 0.000 1.000
#> GSM99513 3 0.0000 0.951 0.000 0.000 1.000
#> GSM99515 3 0.0000 0.951 0.000 0.000 1.000
#> GSM99517 1 0.0000 0.998 1.000 0.000 0.000
#> GSM99519 1 0.0000 0.998 1.000 0.000 0.000
#> GSM99521 3 0.0000 0.951 0.000 0.000 1.000
#> GSM99523 3 0.0000 0.951 0.000 0.000 1.000
#> GSM99571 1 0.0000 0.998 1.000 0.000 0.000
#> GSM99599 1 0.0000 0.998 1.000 0.000 0.000
#> GSM99433 2 0.1860 0.932 0.000 0.948 0.052
#> GSM99435 3 0.0000 0.951 0.000 0.000 1.000
#> GSM99437 2 0.0000 0.977 0.000 1.000 0.000
#> GSM99439 2 0.0000 0.977 0.000 1.000 0.000
#> GSM99441 1 0.0000 0.998 1.000 0.000 0.000
#> GSM99443 2 0.0000 0.977 0.000 1.000 0.000
#> GSM99445 2 0.0000 0.977 0.000 1.000 0.000
#> GSM99447 2 0.0000 0.977 0.000 1.000 0.000
#> GSM99449 3 0.0000 0.951 0.000 0.000 1.000
#> GSM99451 3 0.0000 0.951 0.000 0.000 1.000
#> GSM99453 1 0.0000 0.998 1.000 0.000 0.000
#> GSM99455 1 0.0000 0.998 1.000 0.000 0.000
#> GSM99457 1 0.0000 0.998 1.000 0.000 0.000
#> GSM99463 2 0.0000 0.977 0.000 1.000 0.000
#> GSM99465 3 0.0892 0.937 0.020 0.000 0.980
#> GSM99467 2 0.0000 0.977 0.000 1.000 0.000
#> GSM99471 1 0.0237 0.995 0.996 0.004 0.000
#> GSM99473 1 0.0000 0.998 1.000 0.000 0.000
#> GSM99475 3 0.0000 0.951 0.000 0.000 1.000
#> GSM99477 3 0.1529 0.921 0.000 0.040 0.960
#> GSM99479 2 0.0424 0.971 0.000 0.992 0.008
#> GSM99481 1 0.0000 0.998 1.000 0.000 0.000
#> GSM99483 1 0.0000 0.998 1.000 0.000 0.000
#> GSM99485 2 0.0000 0.977 0.000 1.000 0.000
#> GSM99487 2 0.0000 0.977 0.000 1.000 0.000
#> GSM99489 2 0.0000 0.977 0.000 1.000 0.000
#> GSM99491 2 0.0000 0.977 0.000 1.000 0.000
#> GSM99493 1 0.0000 0.998 1.000 0.000 0.000
#> GSM99495 2 0.0000 0.977 0.000 1.000 0.000
#> GSM99525 1 0.0000 0.998 1.000 0.000 0.000
#> GSM99527 3 0.3183 0.883 0.016 0.076 0.908
#> GSM99529 2 0.0000 0.977 0.000 1.000 0.000
#> GSM99531 3 0.0237 0.948 0.004 0.000 0.996
#> GSM99533 3 0.4842 0.713 0.224 0.000 0.776
#> GSM99535 2 0.0000 0.977 0.000 1.000 0.000
#> GSM99537 1 0.0000 0.998 1.000 0.000 0.000
#> GSM99539 3 0.5058 0.671 0.000 0.244 0.756
#> GSM99541 1 0.1289 0.966 0.968 0.000 0.032
#> GSM99543 2 0.0000 0.977 0.000 1.000 0.000
#> GSM99545 2 0.2448 0.906 0.000 0.924 0.076
#> GSM99547 2 0.8984 0.215 0.368 0.496 0.136
#> GSM99549 2 0.0000 0.977 0.000 1.000 0.000
#> GSM99551 1 0.0237 0.995 0.996 0.004 0.000
#> GSM99553 3 0.0000 0.951 0.000 0.000 1.000
#> GSM99555 2 0.0000 0.977 0.000 1.000 0.000
#> GSM99557 2 0.0000 0.977 0.000 1.000 0.000
#> GSM99559 3 0.0000 0.951 0.000 0.000 1.000
#> GSM99561 2 0.0000 0.977 0.000 1.000 0.000
#> GSM99563 3 0.0000 0.951 0.000 0.000 1.000
#> GSM99565 2 0.0000 0.977 0.000 1.000 0.000
#> GSM99573 2 0.0000 0.977 0.000 1.000 0.000
#> GSM99577 1 0.0000 0.998 1.000 0.000 0.000
#> GSM99579 2 0.0000 0.977 0.000 1.000 0.000
#> GSM99581 3 0.0000 0.951 0.000 0.000 1.000
#> GSM99583 3 0.9471 0.308 0.208 0.308 0.484
#> GSM99585 2 0.1529 0.944 0.000 0.960 0.040
#> GSM99587 1 0.0000 0.998 1.000 0.000 0.000
#> GSM99589 2 0.0000 0.977 0.000 1.000 0.000
#> GSM99591 2 0.0000 0.977 0.000 1.000 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM99497 3 0.0592 0.8243 0.000 0.000 0.984 0.016
#> GSM99503 1 0.0000 0.9630 1.000 0.000 0.000 0.000
#> GSM99505 3 0.3569 0.6581 0.196 0.000 0.804 0.000
#> GSM99507 3 0.0921 0.8281 0.000 0.000 0.972 0.028
#> GSM99567 3 0.1867 0.8314 0.000 0.000 0.928 0.072
#> GSM99575 1 0.0000 0.9630 1.000 0.000 0.000 0.000
#> GSM99593 3 0.1792 0.8312 0.000 0.000 0.932 0.068
#> GSM99595 3 0.2868 0.8162 0.000 0.000 0.864 0.136
#> GSM99469 1 0.0000 0.9630 1.000 0.000 0.000 0.000
#> GSM99499 1 0.2483 0.9016 0.916 0.000 0.052 0.032
#> GSM99501 1 0.0000 0.9630 1.000 0.000 0.000 0.000
#> GSM99509 3 0.2647 0.8212 0.000 0.000 0.880 0.120
#> GSM99569 3 0.0592 0.8247 0.000 0.000 0.984 0.016
#> GSM99597 3 0.3649 0.7829 0.000 0.000 0.796 0.204
#> GSM99601 2 0.1867 0.8251 0.000 0.928 0.000 0.072
#> GSM99459 1 0.0336 0.9606 0.992 0.000 0.000 0.008
#> GSM99461 1 0.0817 0.9526 0.976 0.000 0.000 0.024
#> GSM99511 3 0.3907 0.7597 0.000 0.000 0.768 0.232
#> GSM99513 3 0.4040 0.7373 0.000 0.000 0.752 0.248
#> GSM99515 3 0.0469 0.8220 0.000 0.000 0.988 0.012
#> GSM99517 1 0.0000 0.9630 1.000 0.000 0.000 0.000
#> GSM99519 1 0.0336 0.9603 0.992 0.000 0.000 0.008
#> GSM99521 3 0.3024 0.8100 0.000 0.000 0.852 0.148
#> GSM99523 3 0.1716 0.8004 0.000 0.000 0.936 0.064
#> GSM99571 1 0.0188 0.9624 0.996 0.000 0.000 0.004
#> GSM99599 1 0.0000 0.9630 1.000 0.000 0.000 0.000
#> GSM99433 4 0.5933 0.0850 0.000 0.464 0.036 0.500
#> GSM99435 3 0.3907 0.7601 0.000 0.000 0.768 0.232
#> GSM99437 2 0.1557 0.8297 0.000 0.944 0.000 0.056
#> GSM99439 2 0.4855 0.3008 0.000 0.600 0.000 0.400
#> GSM99441 1 0.0000 0.9630 1.000 0.000 0.000 0.000
#> GSM99443 2 0.0336 0.8469 0.000 0.992 0.000 0.008
#> GSM99445 2 0.0000 0.8468 0.000 1.000 0.000 0.000
#> GSM99447 2 0.4250 0.6071 0.000 0.724 0.000 0.276
#> GSM99449 3 0.1792 0.8034 0.000 0.000 0.932 0.068
#> GSM99451 3 0.4304 0.7118 0.000 0.000 0.716 0.284
#> GSM99453 1 0.2345 0.9002 0.900 0.000 0.000 0.100
#> GSM99455 1 0.1637 0.9348 0.940 0.000 0.000 0.060
#> GSM99457 1 0.2011 0.9190 0.920 0.000 0.000 0.080
#> GSM99463 2 0.4040 0.6419 0.000 0.752 0.000 0.248
#> GSM99465 3 0.5309 0.6661 0.032 0.052 0.776 0.140
#> GSM99467 2 0.2342 0.8094 0.000 0.912 0.008 0.080
#> GSM99471 1 0.0336 0.9615 0.992 0.000 0.000 0.008
#> GSM99473 1 0.2048 0.9042 0.928 0.064 0.000 0.008
#> GSM99475 4 0.4564 0.2637 0.000 0.000 0.328 0.672
#> GSM99477 3 0.6954 0.3011 0.000 0.280 0.568 0.152
#> GSM99479 2 0.3080 0.7858 0.000 0.880 0.024 0.096
#> GSM99481 1 0.0000 0.9630 1.000 0.000 0.000 0.000
#> GSM99483 1 0.0469 0.9602 0.988 0.000 0.000 0.012
#> GSM99485 2 0.0592 0.8458 0.000 0.984 0.000 0.016
#> GSM99487 2 0.2149 0.8103 0.000 0.912 0.000 0.088
#> GSM99489 2 0.2011 0.8201 0.000 0.920 0.000 0.080
#> GSM99491 2 0.0707 0.8428 0.000 0.980 0.000 0.020
#> GSM99493 1 0.0707 0.9574 0.980 0.000 0.000 0.020
#> GSM99495 2 0.4277 0.5886 0.000 0.720 0.000 0.280
#> GSM99525 1 0.0000 0.9630 1.000 0.000 0.000 0.000
#> GSM99527 3 0.6046 0.4302 0.012 0.024 0.544 0.420
#> GSM99529 2 0.1970 0.8294 0.000 0.932 0.008 0.060
#> GSM99531 4 0.4250 0.3838 0.000 0.000 0.276 0.724
#> GSM99533 4 0.4792 0.2918 0.008 0.000 0.312 0.680
#> GSM99535 2 0.1042 0.8457 0.008 0.972 0.000 0.020
#> GSM99537 1 0.0188 0.9624 0.996 0.000 0.000 0.004
#> GSM99539 3 0.6374 0.4807 0.000 0.084 0.592 0.324
#> GSM99541 1 0.5063 0.6890 0.768 0.000 0.124 0.108
#> GSM99543 2 0.4134 0.6251 0.000 0.740 0.000 0.260
#> GSM99545 4 0.4344 0.6247 0.000 0.108 0.076 0.816
#> GSM99547 4 0.8260 0.5375 0.180 0.188 0.076 0.556
#> GSM99549 4 0.4164 0.5274 0.000 0.264 0.000 0.736
#> GSM99551 4 0.4824 0.6178 0.144 0.076 0.000 0.780
#> GSM99553 3 0.1940 0.8317 0.000 0.000 0.924 0.076
#> GSM99555 2 0.1557 0.8321 0.000 0.944 0.000 0.056
#> GSM99557 2 0.2216 0.8117 0.000 0.908 0.000 0.092
#> GSM99559 3 0.1022 0.8145 0.000 0.000 0.968 0.032
#> GSM99561 4 0.5000 -0.0202 0.000 0.496 0.000 0.504
#> GSM99563 3 0.1940 0.8315 0.000 0.000 0.924 0.076
#> GSM99565 2 0.1211 0.8401 0.000 0.960 0.000 0.040
#> GSM99573 4 0.4500 0.4619 0.000 0.316 0.000 0.684
#> GSM99577 4 0.5317 0.5505 0.200 0.008 0.052 0.740
#> GSM99579 2 0.0336 0.8471 0.000 0.992 0.000 0.008
#> GSM99581 3 0.1302 0.8121 0.000 0.000 0.956 0.044
#> GSM99583 2 0.8596 0.2121 0.136 0.512 0.252 0.100
#> GSM99585 2 0.3606 0.7450 0.000 0.840 0.020 0.140
#> GSM99587 1 0.2216 0.9102 0.908 0.000 0.000 0.092
#> GSM99589 2 0.0817 0.8477 0.000 0.976 0.000 0.024
#> GSM99591 2 0.0336 0.8471 0.000 0.992 0.000 0.008
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM99497 3 0.1282 0.8423 0.000 0.000 0.952 0.044 0.004
#> GSM99503 1 0.0451 0.9250 0.988 0.000 0.004 0.008 0.000
#> GSM99505 3 0.2408 0.7931 0.092 0.000 0.892 0.016 0.000
#> GSM99507 3 0.1121 0.8424 0.000 0.000 0.956 0.044 0.000
#> GSM99567 3 0.1216 0.8456 0.000 0.000 0.960 0.020 0.020
#> GSM99575 1 0.0912 0.9233 0.972 0.000 0.016 0.012 0.000
#> GSM99593 3 0.0992 0.8468 0.000 0.000 0.968 0.024 0.008
#> GSM99595 3 0.1579 0.8434 0.000 0.000 0.944 0.024 0.032
#> GSM99469 1 0.0609 0.9245 0.980 0.000 0.000 0.020 0.000
#> GSM99499 3 0.5785 0.1050 0.452 0.000 0.480 0.052 0.016
#> GSM99501 1 0.0912 0.9219 0.972 0.000 0.012 0.016 0.000
#> GSM99509 3 0.2470 0.8196 0.000 0.000 0.884 0.104 0.012
#> GSM99569 3 0.2488 0.8084 0.000 0.000 0.872 0.124 0.004
#> GSM99597 3 0.4503 0.6404 0.000 0.000 0.704 0.256 0.040
#> GSM99601 2 0.1952 0.7827 0.000 0.912 0.000 0.004 0.084
#> GSM99459 1 0.1205 0.9185 0.956 0.000 0.000 0.040 0.004
#> GSM99461 1 0.2629 0.8525 0.860 0.000 0.000 0.136 0.004
#> GSM99511 3 0.3749 0.7903 0.000 0.000 0.816 0.104 0.080
#> GSM99513 3 0.3169 0.8131 0.000 0.000 0.856 0.060 0.084
#> GSM99515 3 0.0798 0.8454 0.000 0.000 0.976 0.016 0.008
#> GSM99517 1 0.0404 0.9244 0.988 0.000 0.000 0.012 0.000
#> GSM99519 1 0.2338 0.8777 0.884 0.000 0.000 0.112 0.004
#> GSM99521 3 0.4980 0.5794 0.000 0.000 0.676 0.252 0.072
#> GSM99523 3 0.2669 0.8178 0.000 0.000 0.876 0.104 0.020
#> GSM99571 1 0.0693 0.9242 0.980 0.000 0.008 0.012 0.000
#> GSM99599 1 0.0290 0.9244 0.992 0.000 0.000 0.008 0.000
#> GSM99433 5 0.6406 0.2608 0.000 0.168 0.008 0.288 0.536
#> GSM99435 4 0.6388 0.3990 0.000 0.000 0.312 0.496 0.192
#> GSM99437 2 0.2707 0.7569 0.000 0.860 0.000 0.132 0.008
#> GSM99439 5 0.4306 -0.1022 0.000 0.492 0.000 0.000 0.508
#> GSM99441 1 0.0000 0.9242 1.000 0.000 0.000 0.000 0.000
#> GSM99443 2 0.0898 0.7973 0.000 0.972 0.000 0.008 0.020
#> GSM99445 2 0.0579 0.7977 0.000 0.984 0.000 0.008 0.008
#> GSM99447 2 0.5546 0.3085 0.000 0.576 0.000 0.084 0.340
#> GSM99449 3 0.2921 0.7969 0.000 0.004 0.844 0.148 0.004
#> GSM99451 4 0.6059 0.4853 0.000 0.000 0.184 0.572 0.244
#> GSM99453 1 0.3307 0.8380 0.848 0.000 0.024 0.012 0.116
#> GSM99455 1 0.1830 0.9035 0.932 0.000 0.004 0.012 0.052
#> GSM99457 1 0.3409 0.8296 0.836 0.000 0.000 0.052 0.112
#> GSM99463 2 0.3816 0.5431 0.000 0.696 0.000 0.000 0.304
#> GSM99465 4 0.3831 0.4484 0.004 0.036 0.096 0.836 0.028
#> GSM99467 2 0.2911 0.7521 0.000 0.852 0.004 0.136 0.008
#> GSM99471 1 0.0324 0.9250 0.992 0.000 0.000 0.004 0.004
#> GSM99473 1 0.2393 0.8660 0.900 0.080 0.000 0.016 0.004
#> GSM99475 4 0.5302 0.3484 0.000 0.000 0.052 0.536 0.412
#> GSM99477 4 0.6376 0.1118 0.000 0.356 0.152 0.488 0.004
#> GSM99479 2 0.3320 0.7352 0.000 0.828 0.008 0.152 0.012
#> GSM99481 1 0.0290 0.9240 0.992 0.000 0.000 0.008 0.000
#> GSM99483 1 0.0960 0.9223 0.972 0.000 0.004 0.008 0.016
#> GSM99485 2 0.1082 0.7970 0.000 0.964 0.000 0.008 0.028
#> GSM99487 2 0.3183 0.7399 0.000 0.828 0.000 0.156 0.016
#> GSM99489 2 0.2068 0.7774 0.000 0.904 0.000 0.004 0.092
#> GSM99491 2 0.2179 0.7748 0.000 0.896 0.000 0.100 0.004
#> GSM99493 1 0.0798 0.9226 0.976 0.000 0.000 0.008 0.016
#> GSM99495 2 0.4015 0.4558 0.000 0.652 0.000 0.000 0.348
#> GSM99525 1 0.0404 0.9246 0.988 0.000 0.000 0.012 0.000
#> GSM99527 4 0.5287 0.4835 0.000 0.004 0.080 0.656 0.260
#> GSM99529 4 0.5602 -0.1005 0.004 0.452 0.012 0.496 0.036
#> GSM99531 5 0.5744 -0.2085 0.000 0.000 0.092 0.380 0.528
#> GSM99533 4 0.5289 0.4231 0.000 0.000 0.064 0.596 0.340
#> GSM99535 2 0.2766 0.7689 0.056 0.892 0.000 0.012 0.040
#> GSM99537 1 0.2067 0.8978 0.920 0.000 0.000 0.048 0.032
#> GSM99539 4 0.5748 0.4650 0.000 0.016 0.088 0.628 0.268
#> GSM99541 1 0.6905 -0.0571 0.436 0.000 0.036 0.400 0.128
#> GSM99543 2 0.3783 0.6077 0.000 0.740 0.000 0.008 0.252
#> GSM99545 5 0.4015 0.2829 0.000 0.012 0.016 0.204 0.768
#> GSM99547 5 0.7772 0.0512 0.024 0.068 0.120 0.332 0.456
#> GSM99549 5 0.3003 0.5012 0.000 0.188 0.000 0.000 0.812
#> GSM99551 5 0.3639 0.3882 0.056 0.004 0.004 0.100 0.836
#> GSM99553 3 0.2527 0.8249 0.004 0.004 0.900 0.072 0.020
#> GSM99555 2 0.2824 0.7788 0.000 0.880 0.008 0.024 0.088
#> GSM99557 2 0.2179 0.7727 0.000 0.896 0.000 0.004 0.100
#> GSM99559 3 0.1281 0.8447 0.000 0.000 0.956 0.032 0.012
#> GSM99561 5 0.5480 0.3254 0.000 0.368 0.000 0.072 0.560
#> GSM99563 3 0.2193 0.8278 0.000 0.000 0.900 0.092 0.008
#> GSM99565 2 0.2388 0.7861 0.000 0.900 0.000 0.072 0.028
#> GSM99573 5 0.3671 0.4912 0.000 0.236 0.000 0.008 0.756
#> GSM99577 5 0.5325 0.3112 0.168 0.000 0.032 0.084 0.716
#> GSM99579 2 0.2130 0.7843 0.000 0.908 0.000 0.080 0.012
#> GSM99581 3 0.3521 0.7359 0.000 0.000 0.764 0.232 0.004
#> GSM99583 2 0.7570 0.1416 0.044 0.456 0.360 0.104 0.036
#> GSM99585 2 0.4781 0.4319 0.000 0.592 0.008 0.388 0.012
#> GSM99587 1 0.2293 0.8885 0.900 0.000 0.000 0.016 0.084
#> GSM99589 2 0.1571 0.7925 0.000 0.936 0.000 0.004 0.060
#> GSM99591 2 0.1082 0.7959 0.000 0.964 0.000 0.028 0.008
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM99497 3 0.3023 0.6969 0.000 0.000 0.768 0.000 0.000 0.232
#> GSM99503 1 0.0520 0.9047 0.984 0.000 0.008 0.000 0.000 0.008
#> GSM99505 3 0.2542 0.7531 0.044 0.000 0.876 0.000 0.000 0.080
#> GSM99507 3 0.2823 0.7171 0.000 0.000 0.796 0.000 0.000 0.204
#> GSM99567 3 0.1542 0.7601 0.000 0.000 0.936 0.004 0.008 0.052
#> GSM99575 1 0.0717 0.9041 0.976 0.000 0.008 0.000 0.000 0.016
#> GSM99593 3 0.1138 0.7660 0.000 0.000 0.960 0.012 0.004 0.024
#> GSM99595 3 0.2489 0.7548 0.000 0.000 0.860 0.000 0.012 0.128
#> GSM99469 1 0.3194 0.7812 0.808 0.000 0.020 0.000 0.004 0.168
#> GSM99499 3 0.6175 0.2581 0.172 0.000 0.508 0.000 0.028 0.292
#> GSM99501 1 0.4770 0.5476 0.652 0.000 0.080 0.000 0.004 0.264
#> GSM99509 3 0.3969 0.6416 0.000 0.000 0.700 0.012 0.012 0.276
#> GSM99569 3 0.3984 0.5620 0.000 0.000 0.648 0.016 0.000 0.336
#> GSM99597 6 0.4744 -0.0931 0.000 0.000 0.376 0.016 0.028 0.580
#> GSM99601 2 0.2728 0.7395 0.000 0.872 0.000 0.008 0.080 0.040
#> GSM99459 1 0.1528 0.8904 0.936 0.000 0.000 0.048 0.000 0.016
#> GSM99461 1 0.3731 0.7106 0.756 0.000 0.000 0.212 0.008 0.024
#> GSM99511 3 0.3883 0.6650 0.000 0.000 0.804 0.056 0.040 0.100
#> GSM99513 3 0.2774 0.7239 0.000 0.000 0.872 0.012 0.040 0.076
#> GSM99515 3 0.0964 0.7594 0.000 0.000 0.968 0.012 0.004 0.016
#> GSM99517 1 0.0603 0.9039 0.980 0.000 0.004 0.000 0.000 0.016
#> GSM99519 1 0.2527 0.8579 0.876 0.000 0.000 0.084 0.000 0.040
#> GSM99521 3 0.6209 0.0929 0.000 0.000 0.464 0.168 0.024 0.344
#> GSM99523 3 0.2247 0.7436 0.000 0.000 0.904 0.024 0.012 0.060
#> GSM99571 1 0.0748 0.9047 0.976 0.000 0.004 0.000 0.004 0.016
#> GSM99599 1 0.0405 0.9039 0.988 0.000 0.004 0.000 0.000 0.008
#> GSM99433 4 0.4614 0.3435 0.000 0.044 0.000 0.680 0.256 0.020
#> GSM99435 4 0.3872 0.4943 0.000 0.000 0.084 0.808 0.044 0.064
#> GSM99437 2 0.3552 0.7075 0.000 0.832 0.000 0.060 0.048 0.060
#> GSM99439 5 0.4158 0.0217 0.000 0.416 0.000 0.004 0.572 0.008
#> GSM99441 1 0.0508 0.9030 0.984 0.000 0.000 0.000 0.004 0.012
#> GSM99443 2 0.2174 0.7421 0.000 0.912 0.000 0.016 0.036 0.036
#> GSM99445 2 0.0972 0.7432 0.000 0.964 0.000 0.000 0.028 0.008
#> GSM99447 2 0.6734 -0.1025 0.000 0.364 0.000 0.268 0.332 0.036
#> GSM99449 3 0.3666 0.6688 0.000 0.000 0.812 0.080 0.016 0.092
#> GSM99451 4 0.3188 0.5233 0.000 0.000 0.032 0.852 0.076 0.040
#> GSM99453 1 0.3813 0.7661 0.768 0.000 0.016 0.000 0.188 0.028
#> GSM99455 1 0.2449 0.8723 0.884 0.000 0.004 0.004 0.092 0.016
#> GSM99457 1 0.4516 0.7193 0.744 0.000 0.000 0.112 0.120 0.024
#> GSM99463 2 0.4034 0.4441 0.000 0.624 0.000 0.004 0.364 0.008
#> GSM99465 4 0.4911 0.4175 0.004 0.016 0.020 0.704 0.044 0.212
#> GSM99467 2 0.3994 0.6882 0.000 0.796 0.004 0.040 0.040 0.120
#> GSM99471 1 0.0984 0.9041 0.968 0.008 0.000 0.000 0.012 0.012
#> GSM99473 1 0.0692 0.9021 0.976 0.020 0.000 0.000 0.000 0.004
#> GSM99475 4 0.4422 0.4358 0.000 0.000 0.000 0.700 0.212 0.088
#> GSM99477 4 0.7780 0.1096 0.000 0.336 0.088 0.380 0.068 0.128
#> GSM99479 2 0.4171 0.6644 0.000 0.764 0.008 0.028 0.028 0.172
#> GSM99481 1 0.0146 0.9038 0.996 0.000 0.000 0.000 0.000 0.004
#> GSM99483 1 0.0870 0.9029 0.972 0.000 0.004 0.000 0.012 0.012
#> GSM99485 2 0.1720 0.7458 0.000 0.928 0.000 0.000 0.032 0.040
#> GSM99487 2 0.4983 0.6392 0.000 0.728 0.008 0.136 0.064 0.064
#> GSM99489 2 0.3125 0.6991 0.000 0.828 0.000 0.004 0.136 0.032
#> GSM99491 2 0.3036 0.7107 0.000 0.840 0.000 0.008 0.028 0.124
#> GSM99493 1 0.1498 0.8960 0.940 0.000 0.000 0.000 0.032 0.028
#> GSM99495 2 0.4165 0.3188 0.000 0.568 0.000 0.004 0.420 0.008
#> GSM99525 1 0.0862 0.9039 0.972 0.000 0.004 0.000 0.008 0.016
#> GSM99527 4 0.1493 0.5344 0.004 0.000 0.000 0.936 0.056 0.004
#> GSM99529 6 0.4998 0.2773 0.000 0.184 0.032 0.052 0.020 0.712
#> GSM99531 6 0.6550 -0.0821 0.000 0.000 0.028 0.296 0.256 0.420
#> GSM99533 4 0.4937 0.4190 0.000 0.000 0.004 0.668 0.164 0.164
#> GSM99535 2 0.5006 0.6586 0.072 0.732 0.000 0.016 0.132 0.048
#> GSM99537 1 0.2434 0.8702 0.892 0.000 0.000 0.064 0.008 0.036
#> GSM99539 4 0.5247 0.2690 0.000 0.004 0.020 0.588 0.056 0.332
#> GSM99541 4 0.7183 0.0372 0.324 0.000 0.004 0.360 0.072 0.240
#> GSM99543 2 0.4780 0.4424 0.000 0.612 0.000 0.004 0.324 0.060
#> GSM99545 5 0.4536 -0.1162 0.000 0.000 0.004 0.476 0.496 0.024
#> GSM99547 4 0.6707 0.3199 0.000 0.036 0.072 0.568 0.216 0.108
#> GSM99549 5 0.3011 0.5639 0.000 0.100 0.000 0.036 0.852 0.012
#> GSM99551 5 0.5217 0.3222 0.028 0.004 0.000 0.244 0.652 0.072
#> GSM99553 3 0.2805 0.7447 0.000 0.000 0.828 0.000 0.012 0.160
#> GSM99555 2 0.4910 0.6726 0.000 0.724 0.012 0.032 0.160 0.072
#> GSM99557 2 0.3243 0.6841 0.000 0.812 0.000 0.004 0.156 0.028
#> GSM99559 3 0.2288 0.7598 0.000 0.004 0.876 0.000 0.004 0.116
#> GSM99561 5 0.5803 0.4429 0.000 0.208 0.000 0.028 0.592 0.172
#> GSM99563 3 0.3086 0.7049 0.000 0.000 0.852 0.056 0.012 0.080
#> GSM99565 2 0.4742 0.6683 0.000 0.744 0.000 0.084 0.080 0.092
#> GSM99573 5 0.3062 0.5559 0.000 0.160 0.000 0.024 0.816 0.000
#> GSM99577 5 0.6195 0.3190 0.096 0.004 0.024 0.068 0.636 0.172
#> GSM99579 2 0.3161 0.7051 0.000 0.828 0.000 0.008 0.028 0.136
#> GSM99581 3 0.4646 0.6330 0.000 0.000 0.692 0.084 0.008 0.216
#> GSM99583 2 0.7302 0.2967 0.040 0.492 0.184 0.020 0.028 0.236
#> GSM99585 4 0.6961 0.1252 0.000 0.340 0.040 0.464 0.064 0.092
#> GSM99587 1 0.2984 0.8427 0.848 0.000 0.000 0.004 0.104 0.044
#> GSM99589 2 0.2062 0.7308 0.000 0.900 0.004 0.000 0.088 0.008
#> GSM99591 2 0.0935 0.7422 0.000 0.964 0.000 0.004 0.000 0.032
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
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 disease.state(p) cell.type(p) k
#> CV:NMF 82 9.73e-04 0.00450 2
#> CV:NMF 83 2.65e-04 0.00326 3
#> CV:NMF 74 9.03e-05 0.00338 4
#> CV:NMF 61 2.37e-04 0.00794 5
#> CV:NMF 60 1.23e-03 0.03401 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 21512 rows and 85 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'MAD' method.
#> Subgroups are detected by 'hclust' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 3.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
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.296 0.330 0.567 0.4327 0.738 0.738
#> 3 3 0.590 0.803 0.890 0.5118 0.466 0.332
#> 4 4 0.567 0.639 0.802 0.1058 0.945 0.834
#> 5 5 0.622 0.626 0.797 0.0605 0.935 0.781
#> 6 6 0.669 0.634 0.779 0.0337 0.954 0.812
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
#> GSM99497 1 0.0000 0.4613 1.000 0.000
#> GSM99503 1 0.9977 0.5370 0.528 0.472
#> GSM99505 1 0.9881 0.5437 0.564 0.436
#> GSM99507 1 0.0000 0.4613 1.000 0.000
#> GSM99567 1 0.0000 0.4613 1.000 0.000
#> GSM99575 1 0.9977 0.5370 0.528 0.472
#> GSM99593 1 0.0672 0.4604 0.992 0.008
#> GSM99595 1 0.0000 0.4613 1.000 0.000
#> GSM99469 1 0.9922 0.5422 0.552 0.448
#> GSM99499 1 0.9881 0.5437 0.564 0.436
#> GSM99501 1 0.9922 0.5422 0.552 0.448
#> GSM99509 1 0.0000 0.4613 1.000 0.000
#> GSM99569 1 0.0938 0.4704 0.988 0.012
#> GSM99597 1 0.0000 0.4613 1.000 0.000
#> GSM99601 2 0.9977 0.9967 0.472 0.528
#> GSM99459 1 0.8713 0.5371 0.708 0.292
#> GSM99461 1 0.5842 0.5138 0.860 0.140
#> GSM99511 1 0.0000 0.4613 1.000 0.000
#> GSM99513 1 0.0000 0.4613 1.000 0.000
#> GSM99515 1 0.0000 0.4613 1.000 0.000
#> GSM99517 1 0.9977 0.5370 0.528 0.472
#> GSM99519 1 0.9000 0.5391 0.684 0.316
#> GSM99521 1 0.0376 0.4644 0.996 0.004
#> GSM99523 1 0.0938 0.4704 0.988 0.012
#> GSM99571 1 0.9977 0.5370 0.528 0.472
#> GSM99599 1 0.9977 0.5370 0.528 0.472
#> GSM99433 1 0.9358 -0.5699 0.648 0.352
#> GSM99435 1 0.1414 0.4553 0.980 0.020
#> GSM99437 1 0.9993 -0.9104 0.516 0.484
#> GSM99439 2 0.9977 0.9967 0.472 0.528
#> GSM99441 1 0.9977 0.5370 0.528 0.472
#> GSM99443 2 0.9977 0.9967 0.472 0.528
#> GSM99445 2 0.9977 0.9967 0.472 0.528
#> GSM99447 1 0.9850 -0.7839 0.572 0.428
#> GSM99449 1 0.5178 0.2593 0.884 0.116
#> GSM99451 1 0.1633 0.4762 0.976 0.024
#> GSM99453 1 0.9977 0.5370 0.528 0.472
#> GSM99455 1 0.9977 0.5370 0.528 0.472
#> GSM99457 1 0.9977 0.5370 0.528 0.472
#> GSM99463 2 0.9977 0.9967 0.472 0.528
#> GSM99465 1 0.5519 0.5111 0.872 0.128
#> GSM99467 1 0.9608 -0.6366 0.616 0.384
#> GSM99471 1 0.9775 0.5434 0.588 0.412
#> GSM99473 1 0.9795 0.5437 0.584 0.416
#> GSM99475 1 0.0938 0.4695 0.988 0.012
#> GSM99477 1 0.9754 -0.7116 0.592 0.408
#> GSM99479 1 0.9661 -0.6575 0.608 0.392
#> GSM99481 1 0.9977 0.5370 0.528 0.472
#> GSM99483 1 0.9977 0.5370 0.528 0.472
#> GSM99485 1 0.9795 -0.6102 0.584 0.416
#> GSM99487 1 0.9993 -0.9104 0.516 0.484
#> GSM99489 2 0.9977 0.9967 0.472 0.528
#> GSM99491 1 0.9988 -0.8637 0.520 0.480
#> GSM99493 1 0.9977 0.5370 0.528 0.472
#> GSM99495 2 0.9977 0.9967 0.472 0.528
#> GSM99525 1 0.9909 0.5428 0.556 0.444
#> GSM99527 1 0.3879 0.4929 0.924 0.076
#> GSM99529 1 0.8861 -0.2666 0.696 0.304
#> GSM99531 1 0.1184 0.4718 0.984 0.016
#> GSM99533 1 0.1843 0.4781 0.972 0.028
#> GSM99535 1 0.9393 0.1188 0.644 0.356
#> GSM99537 1 0.9977 0.5370 0.528 0.472
#> GSM99539 1 0.6973 0.0299 0.812 0.188
#> GSM99541 1 0.9944 0.5407 0.544 0.456
#> GSM99543 1 0.9993 -0.7556 0.516 0.484
#> GSM99545 1 0.6801 0.0590 0.820 0.180
#> GSM99547 1 0.6048 0.5054 0.852 0.148
#> GSM99549 2 0.9977 0.9967 0.472 0.528
#> GSM99551 1 0.9933 0.5399 0.548 0.452
#> GSM99553 1 0.2603 0.3982 0.956 0.044
#> GSM99555 2 0.9977 0.9967 0.472 0.528
#> GSM99557 2 0.9993 0.9773 0.484 0.516
#> GSM99559 1 0.5178 0.2593 0.884 0.116
#> GSM99561 1 0.9993 -0.9025 0.516 0.484
#> GSM99563 1 0.0000 0.4613 1.000 0.000
#> GSM99565 2 0.9977 0.9967 0.472 0.528
#> GSM99573 2 0.9977 0.9967 0.472 0.528
#> GSM99577 1 0.9933 0.5413 0.548 0.452
#> GSM99579 1 0.9983 -0.8318 0.524 0.476
#> GSM99581 1 0.2603 0.3978 0.956 0.044
#> GSM99583 1 0.9393 -0.3866 0.644 0.356
#> GSM99585 1 0.9909 -0.8078 0.556 0.444
#> GSM99587 1 0.9977 0.5370 0.528 0.472
#> GSM99589 1 0.9710 -0.6796 0.600 0.400
#> GSM99591 2 0.9988 0.9840 0.480 0.520
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM99497 3 0.0000 0.9032 0.000 0.000 1.000
#> GSM99503 1 0.0000 0.9250 1.000 0.000 0.000
#> GSM99505 1 0.3619 0.8559 0.864 0.000 0.136
#> GSM99507 3 0.0000 0.9032 0.000 0.000 1.000
#> GSM99567 3 0.0000 0.9032 0.000 0.000 1.000
#> GSM99575 1 0.0000 0.9250 1.000 0.000 0.000
#> GSM99593 3 0.0475 0.9030 0.004 0.004 0.992
#> GSM99595 3 0.0000 0.9032 0.000 0.000 1.000
#> GSM99469 1 0.2878 0.8880 0.904 0.000 0.096
#> GSM99499 1 0.3619 0.8559 0.864 0.000 0.136
#> GSM99501 1 0.2878 0.8880 0.904 0.000 0.096
#> GSM99509 3 0.0000 0.9032 0.000 0.000 1.000
#> GSM99569 3 0.0747 0.9019 0.016 0.000 0.984
#> GSM99597 3 0.0000 0.9032 0.000 0.000 1.000
#> GSM99601 2 0.1289 0.8163 0.000 0.968 0.032
#> GSM99459 3 0.6302 0.0274 0.480 0.000 0.520
#> GSM99461 3 0.4452 0.7524 0.192 0.000 0.808
#> GSM99511 3 0.0000 0.9032 0.000 0.000 1.000
#> GSM99513 3 0.0000 0.9032 0.000 0.000 1.000
#> GSM99515 3 0.0000 0.9032 0.000 0.000 1.000
#> GSM99517 1 0.0000 0.9250 1.000 0.000 0.000
#> GSM99519 1 0.6307 0.0248 0.512 0.000 0.488
#> GSM99521 3 0.0424 0.9030 0.008 0.000 0.992
#> GSM99523 3 0.0747 0.9019 0.016 0.000 0.984
#> GSM99571 1 0.0000 0.9250 1.000 0.000 0.000
#> GSM99599 1 0.0000 0.9250 1.000 0.000 0.000
#> GSM99433 2 0.6252 0.4186 0.000 0.556 0.444
#> GSM99435 3 0.1015 0.9006 0.008 0.012 0.980
#> GSM99437 2 0.4291 0.7871 0.000 0.820 0.180
#> GSM99439 2 0.0000 0.8102 0.000 1.000 0.000
#> GSM99441 1 0.0000 0.9250 1.000 0.000 0.000
#> GSM99443 2 0.0000 0.8102 0.000 1.000 0.000
#> GSM99445 2 0.0000 0.8102 0.000 1.000 0.000
#> GSM99447 2 0.5623 0.7128 0.004 0.716 0.280
#> GSM99449 3 0.4062 0.7578 0.000 0.164 0.836
#> GSM99451 3 0.1529 0.8909 0.040 0.000 0.960
#> GSM99453 1 0.0000 0.9250 1.000 0.000 0.000
#> GSM99455 1 0.0000 0.9250 1.000 0.000 0.000
#> GSM99457 1 0.0000 0.9250 1.000 0.000 0.000
#> GSM99463 2 0.0000 0.8102 0.000 1.000 0.000
#> GSM99465 3 0.4121 0.7788 0.168 0.000 0.832
#> GSM99467 2 0.6543 0.6345 0.016 0.640 0.344
#> GSM99471 1 0.4270 0.8508 0.860 0.024 0.116
#> GSM99473 1 0.4099 0.8366 0.852 0.008 0.140
#> GSM99475 3 0.0747 0.9015 0.016 0.000 0.984
#> GSM99477 2 0.6033 0.6470 0.004 0.660 0.336
#> GSM99479 2 0.6448 0.6246 0.012 0.636 0.352
#> GSM99481 1 0.0000 0.9250 1.000 0.000 0.000
#> GSM99483 1 0.0000 0.9250 1.000 0.000 0.000
#> GSM99485 2 0.7076 0.7019 0.060 0.684 0.256
#> GSM99487 2 0.4291 0.7871 0.000 0.820 0.180
#> GSM99489 2 0.0000 0.8102 0.000 1.000 0.000
#> GSM99491 2 0.3610 0.8101 0.016 0.888 0.096
#> GSM99493 1 0.0000 0.9250 1.000 0.000 0.000
#> GSM99495 2 0.0000 0.8102 0.000 1.000 0.000
#> GSM99525 1 0.2682 0.8941 0.920 0.004 0.076
#> GSM99527 3 0.3272 0.8391 0.104 0.004 0.892
#> GSM99529 2 0.7708 0.4406 0.048 0.528 0.424
#> GSM99531 3 0.0892 0.9003 0.020 0.000 0.980
#> GSM99533 3 0.1643 0.8885 0.044 0.000 0.956
#> GSM99535 2 0.9836 0.3259 0.268 0.420 0.312
#> GSM99537 1 0.0592 0.9225 0.988 0.000 0.012
#> GSM99539 3 0.4654 0.6791 0.000 0.208 0.792
#> GSM99541 1 0.2625 0.8948 0.916 0.000 0.084
#> GSM99543 2 0.5093 0.7781 0.076 0.836 0.088
#> GSM99545 3 0.4452 0.7114 0.000 0.192 0.808
#> GSM99547 3 0.5726 0.7109 0.216 0.024 0.760
#> GSM99549 2 0.0237 0.8116 0.000 0.996 0.004
#> GSM99551 1 0.3832 0.8674 0.880 0.020 0.100
#> GSM99553 3 0.2448 0.8508 0.000 0.076 0.924
#> GSM99555 2 0.2796 0.8158 0.000 0.908 0.092
#> GSM99557 2 0.1411 0.8166 0.000 0.964 0.036
#> GSM99559 3 0.4062 0.7578 0.000 0.164 0.836
#> GSM99561 2 0.3272 0.8167 0.004 0.892 0.104
#> GSM99563 3 0.0000 0.9032 0.000 0.000 1.000
#> GSM99565 2 0.2796 0.8158 0.000 0.908 0.092
#> GSM99573 2 0.0237 0.8116 0.000 0.996 0.004
#> GSM99577 1 0.3116 0.8795 0.892 0.000 0.108
#> GSM99579 2 0.4873 0.7949 0.024 0.824 0.152
#> GSM99581 3 0.2448 0.8507 0.000 0.076 0.924
#> GSM99583 2 0.8130 0.4724 0.072 0.528 0.400
#> GSM99585 2 0.5553 0.7230 0.004 0.724 0.272
#> GSM99587 1 0.0000 0.9250 1.000 0.000 0.000
#> GSM99589 2 0.6172 0.6769 0.012 0.680 0.308
#> GSM99591 2 0.0592 0.8116 0.000 0.988 0.012
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM99497 3 0.0188 0.8632 0.000 0.004 0.996 0.000
#> GSM99503 1 0.0000 0.9024 1.000 0.000 0.000 0.000
#> GSM99505 1 0.3745 0.8448 0.852 0.000 0.088 0.060
#> GSM99507 3 0.0188 0.8632 0.000 0.004 0.996 0.000
#> GSM99567 3 0.0188 0.8632 0.000 0.004 0.996 0.000
#> GSM99575 1 0.0000 0.9024 1.000 0.000 0.000 0.000
#> GSM99593 3 0.0779 0.8632 0.000 0.016 0.980 0.004
#> GSM99595 3 0.0188 0.8632 0.000 0.004 0.996 0.000
#> GSM99469 1 0.3009 0.8686 0.892 0.000 0.056 0.052
#> GSM99499 1 0.3745 0.8448 0.852 0.000 0.088 0.060
#> GSM99501 1 0.3009 0.8686 0.892 0.000 0.056 0.052
#> GSM99509 3 0.1661 0.8571 0.000 0.004 0.944 0.052
#> GSM99569 3 0.1489 0.8587 0.004 0.000 0.952 0.044
#> GSM99597 3 0.2654 0.8371 0.000 0.004 0.888 0.108
#> GSM99601 2 0.3873 0.0797 0.000 0.772 0.000 0.228
#> GSM99459 1 0.8321 0.0335 0.404 0.028 0.372 0.196
#> GSM99461 3 0.7498 0.6138 0.108 0.052 0.604 0.236
#> GSM99511 3 0.0000 0.8630 0.000 0.000 1.000 0.000
#> GSM99513 3 0.0000 0.8630 0.000 0.000 1.000 0.000
#> GSM99515 3 0.0188 0.8632 0.000 0.004 0.996 0.000
#> GSM99517 1 0.0000 0.9024 1.000 0.000 0.000 0.000
#> GSM99519 1 0.8161 0.1537 0.444 0.024 0.344 0.188
#> GSM99521 3 0.0967 0.8638 0.004 0.004 0.976 0.016
#> GSM99523 3 0.1489 0.8587 0.004 0.000 0.952 0.044
#> GSM99571 1 0.0000 0.9024 1.000 0.000 0.000 0.000
#> GSM99599 1 0.0000 0.9024 1.000 0.000 0.000 0.000
#> GSM99433 2 0.5517 0.3962 0.000 0.648 0.316 0.036
#> GSM99435 3 0.3088 0.8462 0.000 0.052 0.888 0.060
#> GSM99437 2 0.2300 0.4911 0.000 0.920 0.064 0.016
#> GSM99439 2 0.5000 -0.7959 0.000 0.504 0.000 0.496
#> GSM99441 1 0.0000 0.9024 1.000 0.000 0.000 0.000
#> GSM99443 2 0.4697 -0.3721 0.000 0.644 0.000 0.356
#> GSM99445 2 0.4697 -0.3721 0.000 0.644 0.000 0.356
#> GSM99447 2 0.4290 0.5033 0.000 0.800 0.164 0.036
#> GSM99449 3 0.4399 0.7044 0.000 0.224 0.760 0.016
#> GSM99451 3 0.3138 0.8494 0.024 0.020 0.896 0.060
#> GSM99453 1 0.0000 0.9024 1.000 0.000 0.000 0.000
#> GSM99455 1 0.0000 0.9024 1.000 0.000 0.000 0.000
#> GSM99457 1 0.0707 0.8978 0.980 0.000 0.000 0.020
#> GSM99463 4 0.4981 0.8471 0.000 0.464 0.000 0.536
#> GSM99465 3 0.7203 0.6422 0.084 0.052 0.624 0.240
#> GSM99467 2 0.5143 0.5082 0.000 0.752 0.172 0.076
#> GSM99471 1 0.4331 0.8265 0.832 0.020 0.040 0.108
#> GSM99473 1 0.4620 0.8217 0.824 0.024 0.080 0.072
#> GSM99475 3 0.3736 0.8246 0.004 0.024 0.844 0.128
#> GSM99477 2 0.4500 0.5073 0.000 0.776 0.192 0.032
#> GSM99479 2 0.5030 0.5057 0.000 0.752 0.188 0.060
#> GSM99481 1 0.0000 0.9024 1.000 0.000 0.000 0.000
#> GSM99483 1 0.0000 0.9024 1.000 0.000 0.000 0.000
#> GSM99485 2 0.6347 0.4421 0.028 0.688 0.076 0.208
#> GSM99487 2 0.2300 0.4911 0.000 0.920 0.064 0.016
#> GSM99489 4 0.4967 0.8583 0.000 0.452 0.000 0.548
#> GSM99491 2 0.4741 0.0604 0.000 0.668 0.004 0.328
#> GSM99493 1 0.0000 0.9024 1.000 0.000 0.000 0.000
#> GSM99495 4 0.4955 0.8625 0.000 0.444 0.000 0.556
#> GSM99525 1 0.3225 0.8655 0.892 0.016 0.032 0.060
#> GSM99527 3 0.6411 0.7317 0.048 0.080 0.708 0.164
#> GSM99529 2 0.7392 0.3923 0.008 0.560 0.204 0.228
#> GSM99531 3 0.3992 0.7938 0.004 0.008 0.800 0.188
#> GSM99533 3 0.4386 0.8204 0.024 0.028 0.824 0.124
#> GSM99535 2 0.9167 0.2368 0.220 0.452 0.116 0.212
#> GSM99537 1 0.0657 0.8995 0.984 0.000 0.004 0.012
#> GSM99539 3 0.6308 0.5841 0.000 0.232 0.648 0.120
#> GSM99541 1 0.2578 0.8763 0.912 0.000 0.052 0.036
#> GSM99543 4 0.5720 0.5881 0.052 0.296 0.000 0.652
#> GSM99545 3 0.6084 0.6273 0.000 0.204 0.676 0.120
#> GSM99547 3 0.8166 0.5665 0.152 0.112 0.584 0.152
#> GSM99549 4 0.4961 0.8501 0.000 0.448 0.000 0.552
#> GSM99551 1 0.4226 0.8329 0.844 0.028 0.040 0.088
#> GSM99553 3 0.3554 0.7963 0.000 0.136 0.844 0.020
#> GSM99555 2 0.2563 0.4020 0.000 0.908 0.020 0.072
#> GSM99557 2 0.4605 -0.2265 0.000 0.664 0.000 0.336
#> GSM99559 3 0.4399 0.7044 0.000 0.224 0.760 0.016
#> GSM99561 2 0.5069 0.0391 0.000 0.664 0.016 0.320
#> GSM99563 3 0.0000 0.8630 0.000 0.000 1.000 0.000
#> GSM99565 2 0.2563 0.4020 0.000 0.908 0.020 0.072
#> GSM99573 4 0.4961 0.8522 0.000 0.448 0.000 0.552
#> GSM99577 1 0.3071 0.8640 0.888 0.000 0.068 0.044
#> GSM99579 2 0.4194 0.3663 0.000 0.764 0.008 0.228
#> GSM99581 3 0.3280 0.8017 0.000 0.124 0.860 0.016
#> GSM99583 2 0.7323 0.4485 0.040 0.628 0.184 0.148
#> GSM99585 2 0.3695 0.5131 0.000 0.828 0.156 0.016
#> GSM99587 1 0.0000 0.9024 1.000 0.000 0.000 0.000
#> GSM99589 2 0.6621 0.4323 0.000 0.628 0.188 0.184
#> GSM99591 2 0.4661 -0.3013 0.000 0.652 0.000 0.348
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM99497 3 0.0324 0.7393 0.000 0.004 0.992 0.004 0.000
#> GSM99503 1 0.0000 0.9156 1.000 0.000 0.000 0.000 0.000
#> GSM99505 1 0.3301 0.7981 0.848 0.000 0.072 0.080 0.000
#> GSM99507 3 0.0324 0.7393 0.000 0.004 0.992 0.004 0.000
#> GSM99567 3 0.0324 0.7393 0.000 0.004 0.992 0.004 0.000
#> GSM99575 1 0.0000 0.9156 1.000 0.000 0.000 0.000 0.000
#> GSM99593 3 0.1117 0.7372 0.000 0.016 0.964 0.020 0.000
#> GSM99595 3 0.0324 0.7393 0.000 0.004 0.992 0.004 0.000
#> GSM99469 1 0.2645 0.8434 0.888 0.000 0.044 0.068 0.000
#> GSM99499 1 0.3301 0.7981 0.848 0.000 0.072 0.080 0.000
#> GSM99501 1 0.2645 0.8434 0.888 0.000 0.044 0.068 0.000
#> GSM99509 3 0.2719 0.6647 0.000 0.004 0.852 0.144 0.000
#> GSM99569 3 0.1410 0.7180 0.000 0.000 0.940 0.060 0.000
#> GSM99597 3 0.3814 0.5235 0.000 0.004 0.720 0.276 0.000
#> GSM99601 2 0.4528 0.0997 0.000 0.548 0.000 0.008 0.444
#> GSM99459 4 0.6806 0.5241 0.356 0.020 0.160 0.464 0.000
#> GSM99461 4 0.5815 0.4973 0.048 0.036 0.316 0.600 0.000
#> GSM99511 3 0.0000 0.7384 0.000 0.000 1.000 0.000 0.000
#> GSM99513 3 0.0000 0.7384 0.000 0.000 1.000 0.000 0.000
#> GSM99515 3 0.0162 0.7385 0.000 0.004 0.996 0.000 0.000
#> GSM99517 1 0.0000 0.9156 1.000 0.000 0.000 0.000 0.000
#> GSM99519 4 0.6917 0.4420 0.404 0.020 0.172 0.404 0.000
#> GSM99521 3 0.1740 0.7300 0.000 0.012 0.932 0.056 0.000
#> GSM99523 3 0.1410 0.7180 0.000 0.000 0.940 0.060 0.000
#> GSM99571 1 0.0000 0.9156 1.000 0.000 0.000 0.000 0.000
#> GSM99599 1 0.0000 0.9156 1.000 0.000 0.000 0.000 0.000
#> GSM99433 2 0.6542 0.5213 0.000 0.592 0.248 0.056 0.104
#> GSM99435 3 0.4226 0.6176 0.000 0.060 0.764 0.176 0.000
#> GSM99437 2 0.4021 0.6283 0.000 0.800 0.036 0.016 0.148
#> GSM99439 5 0.2773 0.6768 0.000 0.112 0.000 0.020 0.868
#> GSM99441 1 0.0000 0.9156 1.000 0.000 0.000 0.000 0.000
#> GSM99443 5 0.4264 0.3824 0.000 0.376 0.000 0.004 0.620
#> GSM99445 5 0.4264 0.3824 0.000 0.376 0.000 0.004 0.620
#> GSM99447 2 0.5291 0.6365 0.000 0.724 0.120 0.028 0.128
#> GSM99449 3 0.5172 0.5570 0.000 0.204 0.712 0.044 0.040
#> GSM99451 3 0.4305 0.6101 0.008 0.040 0.760 0.192 0.000
#> GSM99453 1 0.0000 0.9156 1.000 0.000 0.000 0.000 0.000
#> GSM99455 1 0.0000 0.9156 1.000 0.000 0.000 0.000 0.000
#> GSM99457 1 0.0794 0.9035 0.972 0.000 0.000 0.028 0.000
#> GSM99463 5 0.1877 0.6944 0.000 0.064 0.000 0.012 0.924
#> GSM99465 4 0.5423 0.4536 0.024 0.036 0.324 0.616 0.000
#> GSM99467 2 0.4940 0.6438 0.000 0.764 0.112 0.068 0.056
#> GSM99471 1 0.4445 0.7273 0.792 0.080 0.016 0.108 0.004
#> GSM99473 1 0.4624 0.7163 0.792 0.048 0.056 0.100 0.004
#> GSM99475 3 0.5269 0.5260 0.000 0.072 0.648 0.276 0.004
#> GSM99477 2 0.5695 0.6422 0.000 0.708 0.128 0.072 0.092
#> GSM99479 2 0.5188 0.6421 0.000 0.744 0.128 0.064 0.064
#> GSM99481 1 0.0000 0.9156 1.000 0.000 0.000 0.000 0.000
#> GSM99483 1 0.0000 0.9156 1.000 0.000 0.000 0.000 0.000
#> GSM99485 2 0.4671 0.5693 0.008 0.780 0.016 0.112 0.084
#> GSM99487 2 0.4021 0.6283 0.000 0.800 0.036 0.016 0.148
#> GSM99489 5 0.0992 0.6948 0.000 0.024 0.000 0.008 0.968
#> GSM99491 2 0.4686 0.0713 0.000 0.596 0.000 0.020 0.384
#> GSM99493 1 0.0000 0.9156 1.000 0.000 0.000 0.000 0.000
#> GSM99495 5 0.1106 0.6936 0.000 0.024 0.000 0.012 0.964
#> GSM99525 1 0.3326 0.8131 0.860 0.044 0.016 0.080 0.000
#> GSM99527 3 0.5900 -0.0760 0.008 0.076 0.468 0.448 0.000
#> GSM99529 2 0.6085 0.5073 0.000 0.652 0.104 0.196 0.048
#> GSM99531 3 0.4648 0.2000 0.000 0.012 0.524 0.464 0.000
#> GSM99533 3 0.5542 0.5009 0.008 0.068 0.632 0.288 0.004
#> GSM99535 2 0.7875 0.2911 0.168 0.532 0.056 0.192 0.052
#> GSM99537 1 0.0510 0.9094 0.984 0.000 0.000 0.016 0.000
#> GSM99539 3 0.7308 0.3342 0.000 0.264 0.492 0.188 0.056
#> GSM99541 1 0.2228 0.8638 0.912 0.000 0.040 0.048 0.000
#> GSM99543 5 0.4752 0.5427 0.044 0.124 0.000 0.060 0.772
#> GSM99545 3 0.7220 0.3742 0.000 0.232 0.520 0.188 0.060
#> GSM99547 3 0.7571 -0.2859 0.104 0.116 0.412 0.368 0.000
#> GSM99549 5 0.2504 0.6838 0.000 0.064 0.000 0.040 0.896
#> GSM99551 1 0.3849 0.7460 0.808 0.052 0.004 0.136 0.000
#> GSM99553 3 0.3355 0.6667 0.000 0.132 0.832 0.036 0.000
#> GSM99555 2 0.4074 0.5544 0.000 0.752 0.012 0.012 0.224
#> GSM99557 5 0.4410 0.2207 0.000 0.440 0.000 0.004 0.556
#> GSM99559 3 0.5172 0.5570 0.000 0.204 0.712 0.044 0.040
#> GSM99561 2 0.5443 0.0520 0.000 0.504 0.000 0.060 0.436
#> GSM99563 3 0.0000 0.7384 0.000 0.000 1.000 0.000 0.000
#> GSM99565 2 0.4074 0.5544 0.000 0.752 0.012 0.012 0.224
#> GSM99573 5 0.2569 0.6842 0.000 0.068 0.000 0.040 0.892
#> GSM99577 1 0.2806 0.8414 0.888 0.008 0.052 0.052 0.000
#> GSM99579 2 0.3760 0.5068 0.000 0.784 0.000 0.028 0.188
#> GSM99581 3 0.3051 0.6756 0.000 0.120 0.852 0.028 0.000
#> GSM99583 2 0.5179 0.5892 0.008 0.728 0.116 0.140 0.008
#> GSM99585 2 0.4905 0.6473 0.000 0.760 0.104 0.032 0.104
#> GSM99587 1 0.0000 0.9156 1.000 0.000 0.000 0.000 0.000
#> GSM99589 2 0.6639 0.4951 0.000 0.592 0.136 0.052 0.220
#> GSM99591 5 0.4350 0.3043 0.000 0.408 0.000 0.004 0.588
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM99497 3 0.0291 0.7826 0.000 0.004 0.992 0.000 0.000 0.004
#> GSM99503 1 0.0000 0.9086 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99505 1 0.3233 0.8081 0.832 0.000 0.060 0.104 0.000 0.004
#> GSM99507 3 0.0291 0.7826 0.000 0.004 0.992 0.000 0.000 0.004
#> GSM99567 3 0.0291 0.7826 0.000 0.004 0.992 0.000 0.000 0.004
#> GSM99575 1 0.0000 0.9086 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99593 3 0.1452 0.7671 0.000 0.020 0.948 0.012 0.000 0.020
#> GSM99595 3 0.0291 0.7826 0.000 0.004 0.992 0.000 0.000 0.004
#> GSM99469 1 0.2651 0.8446 0.872 0.000 0.036 0.088 0.000 0.004
#> GSM99499 1 0.3233 0.8081 0.832 0.000 0.060 0.104 0.000 0.004
#> GSM99501 1 0.2651 0.8446 0.872 0.000 0.036 0.088 0.000 0.004
#> GSM99509 3 0.3535 0.5876 0.000 0.004 0.800 0.144 0.000 0.052
#> GSM99569 3 0.1327 0.7486 0.000 0.000 0.936 0.064 0.000 0.000
#> GSM99597 3 0.5028 0.3072 0.000 0.004 0.636 0.248 0.000 0.112
#> GSM99601 2 0.4348 0.0840 0.000 0.560 0.000 0.000 0.416 0.024
#> GSM99459 4 0.5162 0.3742 0.336 0.008 0.080 0.576 0.000 0.000
#> GSM99461 4 0.3883 0.4885 0.024 0.020 0.196 0.760 0.000 0.000
#> GSM99511 3 0.0000 0.7819 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM99513 3 0.0000 0.7819 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM99515 3 0.0146 0.7820 0.000 0.004 0.996 0.000 0.000 0.000
#> GSM99517 1 0.0000 0.9086 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99519 4 0.5658 0.2992 0.380 0.012 0.112 0.496 0.000 0.000
#> GSM99521 3 0.2434 0.7256 0.000 0.016 0.896 0.056 0.000 0.032
#> GSM99523 3 0.1327 0.7486 0.000 0.000 0.936 0.064 0.000 0.000
#> GSM99571 1 0.0146 0.9080 0.996 0.000 0.000 0.000 0.000 0.004
#> GSM99599 1 0.0000 0.9086 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99433 2 0.5646 0.4676 0.000 0.660 0.180 0.020 0.032 0.108
#> GSM99435 3 0.4995 0.3956 0.000 0.044 0.704 0.164 0.000 0.088
#> GSM99437 2 0.2775 0.6517 0.000 0.884 0.016 0.012 0.060 0.028
#> GSM99439 5 0.3249 0.6696 0.000 0.096 0.000 0.008 0.836 0.060
#> GSM99441 1 0.0000 0.9086 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99443 5 0.3965 0.3914 0.000 0.388 0.000 0.000 0.604 0.008
#> GSM99445 5 0.3965 0.3914 0.000 0.388 0.000 0.000 0.604 0.008
#> GSM99447 2 0.4196 0.6553 0.000 0.796 0.092 0.012 0.060 0.040
#> GSM99449 3 0.4930 0.3885 0.000 0.248 0.676 0.028 0.012 0.036
#> GSM99451 3 0.5000 0.2770 0.000 0.012 0.672 0.192 0.000 0.124
#> GSM99453 1 0.0000 0.9086 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99455 1 0.0000 0.9086 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99457 1 0.2074 0.8777 0.912 0.004 0.000 0.036 0.000 0.048
#> GSM99463 5 0.2250 0.6888 0.000 0.064 0.000 0.000 0.896 0.040
#> GSM99465 4 0.3455 0.4720 0.000 0.020 0.200 0.776 0.000 0.004
#> GSM99467 2 0.4087 0.6582 0.000 0.796 0.092 0.036 0.004 0.072
#> GSM99471 1 0.4534 0.7286 0.764 0.028 0.004 0.068 0.008 0.128
#> GSM99473 1 0.4556 0.7327 0.772 0.016 0.040 0.092 0.000 0.080
#> GSM99475 6 0.6152 0.6795 0.000 0.036 0.420 0.120 0.000 0.424
#> GSM99477 2 0.4311 0.6554 0.000 0.788 0.104 0.048 0.016 0.044
#> GSM99479 2 0.4024 0.6541 0.000 0.800 0.100 0.040 0.004 0.056
#> GSM99481 1 0.0000 0.9086 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99483 1 0.0260 0.9077 0.992 0.000 0.000 0.000 0.000 0.008
#> GSM99485 2 0.5076 0.5836 0.000 0.692 0.000 0.052 0.072 0.184
#> GSM99487 2 0.2775 0.6517 0.000 0.884 0.016 0.012 0.060 0.028
#> GSM99489 5 0.1418 0.6883 0.000 0.032 0.000 0.000 0.944 0.024
#> GSM99491 2 0.5260 0.1424 0.000 0.552 0.000 0.008 0.356 0.084
#> GSM99493 1 0.1010 0.8982 0.960 0.000 0.000 0.004 0.000 0.036
#> GSM99495 5 0.1564 0.6873 0.000 0.024 0.000 0.000 0.936 0.040
#> GSM99525 1 0.3380 0.8112 0.840 0.016 0.004 0.060 0.000 0.080
#> GSM99527 4 0.5856 0.1977 0.000 0.048 0.356 0.520 0.000 0.076
#> GSM99529 2 0.6780 0.5170 0.000 0.564 0.052 0.152 0.044 0.188
#> GSM99531 4 0.5977 -0.0419 0.000 0.004 0.296 0.476 0.000 0.224
#> GSM99533 6 0.6174 0.6636 0.000 0.020 0.408 0.164 0.000 0.408
#> GSM99535 2 0.7756 0.3249 0.140 0.464 0.008 0.148 0.032 0.208
#> GSM99537 1 0.0790 0.9010 0.968 0.000 0.000 0.032 0.000 0.000
#> GSM99539 6 0.6603 0.6887 0.000 0.244 0.288 0.012 0.016 0.440
#> GSM99541 1 0.2070 0.8698 0.896 0.000 0.012 0.092 0.000 0.000
#> GSM99543 5 0.4511 0.5660 0.032 0.048 0.000 0.008 0.748 0.164
#> GSM99545 6 0.6493 0.7255 0.000 0.208 0.320 0.004 0.024 0.444
#> GSM99547 4 0.7452 0.2932 0.072 0.084 0.312 0.444 0.000 0.088
#> GSM99549 5 0.2979 0.6671 0.000 0.032 0.000 0.008 0.848 0.112
#> GSM99551 1 0.4640 0.6876 0.728 0.020 0.000 0.124 0.000 0.128
#> GSM99553 3 0.3621 0.6170 0.000 0.132 0.808 0.024 0.000 0.036
#> GSM99555 2 0.3734 0.5806 0.000 0.784 0.012 0.000 0.164 0.040
#> GSM99557 5 0.4574 0.2186 0.000 0.440 0.000 0.000 0.524 0.036
#> GSM99559 3 0.4930 0.3885 0.000 0.248 0.676 0.028 0.012 0.036
#> GSM99561 2 0.5969 0.0933 0.000 0.476 0.000 0.024 0.376 0.124
#> GSM99563 3 0.0000 0.7819 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM99565 2 0.3663 0.5871 0.000 0.792 0.012 0.000 0.156 0.040
#> GSM99573 5 0.3120 0.6662 0.000 0.040 0.000 0.008 0.840 0.112
#> GSM99577 1 0.2737 0.8494 0.868 0.000 0.024 0.096 0.000 0.012
#> GSM99579 2 0.4606 0.5333 0.000 0.716 0.000 0.012 0.172 0.100
#> GSM99581 3 0.3354 0.6322 0.000 0.128 0.824 0.020 0.000 0.028
#> GSM99583 2 0.5709 0.6053 0.000 0.656 0.088 0.088 0.004 0.164
#> GSM99585 2 0.3356 0.6643 0.000 0.852 0.072 0.036 0.024 0.016
#> GSM99587 1 0.0935 0.8997 0.964 0.000 0.000 0.004 0.000 0.032
#> GSM99589 2 0.6505 0.5038 0.000 0.600 0.104 0.032 0.184 0.080
#> GSM99591 5 0.4212 0.2953 0.000 0.424 0.000 0.000 0.560 0.016
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
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 disease.state(p) cell.type(p) k
#> MAD:hclust 42 0.068429 0.13416 2
#> MAD:hclust 79 0.001102 0.02263 3
#> MAD:hclust 64 0.043717 0.47335 4
#> MAD:hclust 68 0.000748 0.01928 5
#> MAD:hclust 64 0.000015 0.00403 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 21512 rows and 85 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 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.569 0.698 0.861 0.4629 0.531 0.531
#> 3 3 1.000 0.953 0.963 0.4425 0.739 0.533
#> 4 4 0.747 0.700 0.837 0.1092 0.933 0.799
#> 5 5 0.730 0.697 0.776 0.0593 0.908 0.683
#> 6 6 0.715 0.606 0.749 0.0414 0.938 0.730
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
#> GSM99497 2 0.9881 0.450 0.436 0.564
#> GSM99503 1 0.0000 0.923 1.000 0.000
#> GSM99505 1 0.1414 0.902 0.980 0.020
#> GSM99507 2 0.9881 0.450 0.436 0.564
#> GSM99567 2 0.9866 0.454 0.432 0.568
#> GSM99575 1 0.0000 0.923 1.000 0.000
#> GSM99593 2 0.9866 0.454 0.432 0.568
#> GSM99595 2 0.9881 0.450 0.436 0.564
#> GSM99469 1 0.0000 0.923 1.000 0.000
#> GSM99499 1 0.0376 0.920 0.996 0.004
#> GSM99501 1 0.0000 0.923 1.000 0.000
#> GSM99509 2 0.9881 0.450 0.436 0.564
#> GSM99569 2 0.9881 0.450 0.436 0.564
#> GSM99597 2 0.9896 0.441 0.440 0.560
#> GSM99601 2 0.1414 0.768 0.020 0.980
#> GSM99459 1 0.0000 0.923 1.000 0.000
#> GSM99461 1 0.0000 0.923 1.000 0.000
#> GSM99511 2 0.9881 0.450 0.436 0.564
#> GSM99513 2 0.9881 0.450 0.436 0.564
#> GSM99515 2 0.9881 0.450 0.436 0.564
#> GSM99517 1 0.0000 0.923 1.000 0.000
#> GSM99519 1 0.0000 0.923 1.000 0.000
#> GSM99521 2 0.9881 0.450 0.436 0.564
#> GSM99523 1 0.9922 -0.133 0.552 0.448
#> GSM99571 1 0.0000 0.923 1.000 0.000
#> GSM99599 1 0.0000 0.923 1.000 0.000
#> GSM99433 2 0.0000 0.762 0.000 1.000
#> GSM99435 2 0.9881 0.450 0.436 0.564
#> GSM99437 2 0.1414 0.768 0.020 0.980
#> GSM99439 2 0.1414 0.768 0.020 0.980
#> GSM99441 1 0.0000 0.923 1.000 0.000
#> GSM99443 2 0.1414 0.768 0.020 0.980
#> GSM99445 2 0.1414 0.768 0.020 0.980
#> GSM99447 2 0.1414 0.768 0.020 0.980
#> GSM99449 2 0.0000 0.762 0.000 1.000
#> GSM99451 2 0.9881 0.450 0.436 0.564
#> GSM99453 1 0.0000 0.923 1.000 0.000
#> GSM99455 1 0.0000 0.923 1.000 0.000
#> GSM99457 1 0.0000 0.923 1.000 0.000
#> GSM99463 2 0.1414 0.768 0.020 0.980
#> GSM99465 1 0.7883 0.559 0.764 0.236
#> GSM99467 2 0.1414 0.768 0.020 0.980
#> GSM99471 1 0.0000 0.923 1.000 0.000
#> GSM99473 1 0.0000 0.923 1.000 0.000
#> GSM99475 2 0.9881 0.450 0.436 0.564
#> GSM99477 2 0.0000 0.762 0.000 1.000
#> GSM99479 2 0.1414 0.768 0.020 0.980
#> GSM99481 1 0.0000 0.923 1.000 0.000
#> GSM99483 1 0.0000 0.923 1.000 0.000
#> GSM99485 2 0.1414 0.768 0.020 0.980
#> GSM99487 2 0.1414 0.768 0.020 0.980
#> GSM99489 2 0.1414 0.768 0.020 0.980
#> GSM99491 2 0.1414 0.768 0.020 0.980
#> GSM99493 1 0.0000 0.923 1.000 0.000
#> GSM99495 2 0.1414 0.768 0.020 0.980
#> GSM99525 1 0.0000 0.923 1.000 0.000
#> GSM99527 2 0.9881 0.450 0.436 0.564
#> GSM99529 2 0.6438 0.697 0.164 0.836
#> GSM99531 2 0.9896 0.441 0.440 0.560
#> GSM99533 1 0.9970 -0.204 0.532 0.468
#> GSM99535 2 0.6048 0.681 0.148 0.852
#> GSM99537 1 0.0000 0.923 1.000 0.000
#> GSM99539 2 0.0000 0.762 0.000 1.000
#> GSM99541 1 0.0938 0.911 0.988 0.012
#> GSM99543 2 0.3431 0.737 0.064 0.936
#> GSM99545 2 0.0000 0.762 0.000 1.000
#> GSM99547 1 0.9993 -0.309 0.516 0.484
#> GSM99549 2 0.1414 0.768 0.020 0.980
#> GSM99551 1 0.0000 0.923 1.000 0.000
#> GSM99553 2 0.9881 0.450 0.436 0.564
#> GSM99555 2 0.1414 0.768 0.020 0.980
#> GSM99557 2 0.1414 0.768 0.020 0.980
#> GSM99559 2 0.0000 0.762 0.000 1.000
#> GSM99561 2 0.1414 0.768 0.020 0.980
#> GSM99563 2 0.9881 0.450 0.436 0.564
#> GSM99565 2 0.0938 0.766 0.012 0.988
#> GSM99573 2 0.1414 0.768 0.020 0.980
#> GSM99577 1 0.0000 0.923 1.000 0.000
#> GSM99579 2 0.1414 0.768 0.020 0.980
#> GSM99581 2 0.9881 0.450 0.436 0.564
#> GSM99583 2 0.9944 0.435 0.456 0.544
#> GSM99585 2 0.1414 0.768 0.020 0.980
#> GSM99587 1 0.0000 0.923 1.000 0.000
#> GSM99589 2 0.1414 0.768 0.020 0.980
#> GSM99591 2 0.1414 0.768 0.020 0.980
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM99497 3 0.1711 0.9686 0.032 0.008 0.960
#> GSM99503 1 0.0000 0.9958 1.000 0.000 0.000
#> GSM99505 1 0.0000 0.9958 1.000 0.000 0.000
#> GSM99507 3 0.1711 0.9686 0.032 0.008 0.960
#> GSM99567 3 0.1711 0.9686 0.032 0.008 0.960
#> GSM99575 1 0.0000 0.9958 1.000 0.000 0.000
#> GSM99593 3 0.1711 0.9686 0.032 0.008 0.960
#> GSM99595 3 0.1711 0.9686 0.032 0.008 0.960
#> GSM99469 1 0.0000 0.9958 1.000 0.000 0.000
#> GSM99499 1 0.0000 0.9958 1.000 0.000 0.000
#> GSM99501 1 0.0000 0.9958 1.000 0.000 0.000
#> GSM99509 3 0.1711 0.9686 0.032 0.008 0.960
#> GSM99569 3 0.1711 0.9686 0.032 0.008 0.960
#> GSM99597 3 0.1711 0.9686 0.032 0.008 0.960
#> GSM99601 2 0.0747 0.9693 0.000 0.984 0.016
#> GSM99459 1 0.0000 0.9958 1.000 0.000 0.000
#> GSM99461 1 0.0000 0.9958 1.000 0.000 0.000
#> GSM99511 3 0.1711 0.9686 0.032 0.008 0.960
#> GSM99513 3 0.1711 0.9686 0.032 0.008 0.960
#> GSM99515 3 0.1711 0.9686 0.032 0.008 0.960
#> GSM99517 1 0.0000 0.9958 1.000 0.000 0.000
#> GSM99519 1 0.0000 0.9958 1.000 0.000 0.000
#> GSM99521 3 0.1711 0.9686 0.032 0.008 0.960
#> GSM99523 3 0.1753 0.9538 0.048 0.000 0.952
#> GSM99571 1 0.0661 0.9938 0.988 0.008 0.004
#> GSM99599 1 0.0000 0.9958 1.000 0.000 0.000
#> GSM99433 2 0.1163 0.9588 0.000 0.972 0.028
#> GSM99435 3 0.1711 0.9686 0.032 0.008 0.960
#> GSM99437 2 0.0424 0.9699 0.000 0.992 0.008
#> GSM99439 2 0.1411 0.9652 0.000 0.964 0.036
#> GSM99441 1 0.0000 0.9958 1.000 0.000 0.000
#> GSM99443 2 0.0592 0.9699 0.000 0.988 0.012
#> GSM99445 2 0.0592 0.9699 0.000 0.988 0.012
#> GSM99447 2 0.0424 0.9699 0.000 0.992 0.008
#> GSM99449 3 0.1529 0.9391 0.000 0.040 0.960
#> GSM99451 3 0.1711 0.9686 0.032 0.008 0.960
#> GSM99453 1 0.0661 0.9938 0.988 0.008 0.004
#> GSM99455 1 0.0661 0.9938 0.988 0.008 0.004
#> GSM99457 1 0.0848 0.9923 0.984 0.008 0.008
#> GSM99463 2 0.1411 0.9652 0.000 0.964 0.036
#> GSM99465 3 0.2066 0.9452 0.060 0.000 0.940
#> GSM99467 2 0.0592 0.9699 0.000 0.988 0.012
#> GSM99471 1 0.0661 0.9938 0.988 0.008 0.004
#> GSM99473 1 0.0000 0.9958 1.000 0.000 0.000
#> GSM99475 3 0.1711 0.9686 0.032 0.008 0.960
#> GSM99477 3 0.4887 0.7028 0.000 0.228 0.772
#> GSM99479 2 0.1860 0.9412 0.000 0.948 0.052
#> GSM99481 1 0.0000 0.9958 1.000 0.000 0.000
#> GSM99483 1 0.0661 0.9938 0.988 0.008 0.004
#> GSM99485 2 0.0592 0.9699 0.000 0.988 0.012
#> GSM99487 2 0.0424 0.9699 0.000 0.992 0.008
#> GSM99489 2 0.1529 0.9653 0.000 0.960 0.040
#> GSM99491 2 0.0592 0.9699 0.000 0.988 0.012
#> GSM99493 1 0.0848 0.9923 0.984 0.008 0.008
#> GSM99495 2 0.1411 0.9652 0.000 0.964 0.036
#> GSM99525 1 0.0661 0.9938 0.988 0.008 0.004
#> GSM99527 3 0.1711 0.9686 0.032 0.008 0.960
#> GSM99529 3 0.6307 0.0269 0.000 0.488 0.512
#> GSM99531 3 0.1711 0.9686 0.032 0.008 0.960
#> GSM99533 3 0.1711 0.9686 0.032 0.008 0.960
#> GSM99535 2 0.1765 0.9362 0.040 0.956 0.004
#> GSM99537 1 0.0000 0.9958 1.000 0.000 0.000
#> GSM99539 2 0.5926 0.4309 0.000 0.644 0.356
#> GSM99541 1 0.0000 0.9958 1.000 0.000 0.000
#> GSM99543 2 0.1289 0.9612 0.000 0.968 0.032
#> GSM99545 2 0.3686 0.8680 0.000 0.860 0.140
#> GSM99547 3 0.2063 0.9597 0.044 0.008 0.948
#> GSM99549 2 0.1411 0.9652 0.000 0.964 0.036
#> GSM99551 1 0.0848 0.9923 0.984 0.008 0.008
#> GSM99553 3 0.1711 0.9686 0.032 0.008 0.960
#> GSM99555 2 0.0424 0.9699 0.000 0.992 0.008
#> GSM99557 2 0.1529 0.9653 0.000 0.960 0.040
#> GSM99559 3 0.1411 0.9389 0.000 0.036 0.964
#> GSM99561 2 0.1411 0.9652 0.000 0.964 0.036
#> GSM99563 3 0.1711 0.9686 0.032 0.008 0.960
#> GSM99565 2 0.0424 0.9699 0.000 0.992 0.008
#> GSM99573 2 0.1411 0.9652 0.000 0.964 0.036
#> GSM99577 1 0.0661 0.9938 0.988 0.008 0.004
#> GSM99579 2 0.0592 0.9699 0.000 0.988 0.012
#> GSM99581 3 0.1711 0.9686 0.032 0.008 0.960
#> GSM99583 3 0.1751 0.9654 0.028 0.012 0.960
#> GSM99585 2 0.0592 0.9699 0.000 0.988 0.012
#> GSM99587 1 0.0848 0.9923 0.984 0.008 0.008
#> GSM99589 2 0.0592 0.9699 0.000 0.988 0.012
#> GSM99591 2 0.0592 0.9699 0.000 0.988 0.012
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM99497 3 0.0336 0.8565 0.000 0.000 0.992 0.008
#> GSM99503 1 0.0000 0.9043 1.000 0.000 0.000 0.000
#> GSM99505 1 0.1474 0.9001 0.948 0.000 0.000 0.052
#> GSM99507 3 0.0336 0.8565 0.000 0.000 0.992 0.008
#> GSM99567 3 0.0188 0.8574 0.000 0.000 0.996 0.004
#> GSM99575 1 0.0000 0.9043 1.000 0.000 0.000 0.000
#> GSM99593 3 0.0188 0.8574 0.000 0.000 0.996 0.004
#> GSM99595 3 0.0188 0.8574 0.000 0.000 0.996 0.004
#> GSM99469 1 0.1474 0.9001 0.948 0.000 0.000 0.052
#> GSM99499 1 0.1474 0.9001 0.948 0.000 0.000 0.052
#> GSM99501 1 0.1474 0.9001 0.948 0.000 0.000 0.052
#> GSM99509 3 0.0188 0.8567 0.000 0.000 0.996 0.004
#> GSM99569 3 0.0469 0.8564 0.000 0.000 0.988 0.012
#> GSM99597 3 0.0469 0.8562 0.000 0.000 0.988 0.012
#> GSM99601 2 0.1716 0.7833 0.000 0.936 0.000 0.064
#> GSM99459 1 0.1867 0.8930 0.928 0.000 0.000 0.072
#> GSM99461 1 0.1867 0.8930 0.928 0.000 0.000 0.072
#> GSM99511 3 0.0336 0.8563 0.000 0.000 0.992 0.008
#> GSM99513 3 0.0336 0.8563 0.000 0.000 0.992 0.008
#> GSM99515 3 0.0188 0.8573 0.000 0.000 0.996 0.004
#> GSM99517 1 0.0000 0.9043 1.000 0.000 0.000 0.000
#> GSM99519 1 0.1716 0.8962 0.936 0.000 0.000 0.064
#> GSM99521 3 0.1022 0.8407 0.000 0.000 0.968 0.032
#> GSM99523 3 0.0469 0.8550 0.000 0.000 0.988 0.012
#> GSM99571 1 0.3074 0.8744 0.848 0.000 0.000 0.152
#> GSM99599 1 0.0469 0.9050 0.988 0.000 0.000 0.012
#> GSM99433 2 0.4977 0.1552 0.000 0.540 0.000 0.460
#> GSM99435 3 0.4746 0.3334 0.000 0.000 0.632 0.368
#> GSM99437 2 0.2530 0.7708 0.000 0.888 0.000 0.112
#> GSM99439 2 0.3266 0.7448 0.000 0.832 0.000 0.168
#> GSM99441 1 0.0469 0.9050 0.988 0.000 0.000 0.012
#> GSM99443 2 0.0336 0.7891 0.000 0.992 0.000 0.008
#> GSM99445 2 0.0707 0.7879 0.000 0.980 0.000 0.020
#> GSM99447 2 0.2704 0.7703 0.000 0.876 0.000 0.124
#> GSM99449 3 0.0336 0.8569 0.000 0.000 0.992 0.008
#> GSM99451 3 0.4898 0.2320 0.000 0.000 0.584 0.416
#> GSM99453 1 0.3172 0.8715 0.840 0.000 0.000 0.160
#> GSM99455 1 0.3172 0.8715 0.840 0.000 0.000 0.160
#> GSM99457 1 0.3356 0.8646 0.824 0.000 0.000 0.176
#> GSM99463 2 0.3172 0.7450 0.000 0.840 0.000 0.160
#> GSM99465 4 0.7005 0.3724 0.172 0.000 0.256 0.572
#> GSM99467 2 0.5050 0.2922 0.000 0.588 0.004 0.408
#> GSM99471 1 0.4356 0.7970 0.708 0.000 0.000 0.292
#> GSM99473 1 0.2081 0.8955 0.916 0.000 0.000 0.084
#> GSM99475 3 0.4967 0.1384 0.000 0.000 0.548 0.452
#> GSM99477 4 0.7495 0.3574 0.000 0.368 0.184 0.448
#> GSM99479 2 0.5105 0.2325 0.000 0.564 0.004 0.432
#> GSM99481 1 0.0469 0.9050 0.988 0.000 0.000 0.012
#> GSM99483 1 0.3172 0.8715 0.840 0.000 0.000 0.160
#> GSM99485 2 0.2647 0.7649 0.000 0.880 0.000 0.120
#> GSM99487 2 0.2530 0.7708 0.000 0.888 0.000 0.112
#> GSM99489 2 0.3123 0.7459 0.000 0.844 0.000 0.156
#> GSM99491 2 0.1940 0.7828 0.000 0.924 0.000 0.076
#> GSM99493 1 0.3356 0.8646 0.824 0.000 0.000 0.176
#> GSM99495 2 0.3172 0.7450 0.000 0.840 0.000 0.160
#> GSM99525 1 0.3172 0.8715 0.840 0.000 0.000 0.160
#> GSM99527 4 0.4925 0.1551 0.000 0.000 0.428 0.572
#> GSM99529 4 0.6058 0.4225 0.000 0.308 0.068 0.624
#> GSM99531 3 0.4994 0.0571 0.000 0.000 0.520 0.480
#> GSM99533 3 0.4998 0.0286 0.000 0.000 0.512 0.488
#> GSM99535 2 0.4647 0.5864 0.008 0.704 0.000 0.288
#> GSM99537 1 0.1389 0.9057 0.952 0.000 0.000 0.048
#> GSM99539 4 0.7227 0.3005 0.000 0.368 0.148 0.484
#> GSM99541 1 0.2589 0.8655 0.884 0.000 0.000 0.116
#> GSM99543 2 0.4382 0.6452 0.000 0.704 0.000 0.296
#> GSM99545 4 0.6532 -0.0733 0.000 0.420 0.076 0.504
#> GSM99547 4 0.4837 0.3304 0.004 0.000 0.348 0.648
#> GSM99549 2 0.3266 0.7448 0.000 0.832 0.000 0.168
#> GSM99551 4 0.4877 -0.2690 0.408 0.000 0.000 0.592
#> GSM99553 3 0.0336 0.8565 0.000 0.000 0.992 0.008
#> GSM99555 2 0.1389 0.7898 0.000 0.952 0.000 0.048
#> GSM99557 2 0.2921 0.7542 0.000 0.860 0.000 0.140
#> GSM99559 3 0.1398 0.8190 0.000 0.004 0.956 0.040
#> GSM99561 2 0.3837 0.7549 0.000 0.776 0.000 0.224
#> GSM99563 3 0.0336 0.8563 0.000 0.000 0.992 0.008
#> GSM99565 2 0.2469 0.7747 0.000 0.892 0.000 0.108
#> GSM99573 2 0.3266 0.7448 0.000 0.832 0.000 0.168
#> GSM99577 1 0.4477 0.7859 0.688 0.000 0.000 0.312
#> GSM99579 2 0.2408 0.7732 0.000 0.896 0.000 0.104
#> GSM99581 3 0.0188 0.8573 0.000 0.000 0.996 0.004
#> GSM99583 4 0.6810 0.5088 0.000 0.156 0.248 0.596
#> GSM99585 2 0.4907 0.2752 0.000 0.580 0.000 0.420
#> GSM99587 1 0.3356 0.8646 0.824 0.000 0.000 0.176
#> GSM99589 2 0.1637 0.7868 0.000 0.940 0.000 0.060
#> GSM99591 2 0.0707 0.7879 0.000 0.980 0.000 0.020
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM99497 3 0.0000 0.9780 0.000 0.000 1.000 0.000 0.000
#> GSM99503 1 0.0162 0.8524 0.996 0.000 0.000 0.004 0.000
#> GSM99505 1 0.2390 0.8434 0.908 0.000 0.004 0.044 0.044
#> GSM99507 3 0.0000 0.9780 0.000 0.000 1.000 0.000 0.000
#> GSM99567 3 0.0000 0.9780 0.000 0.000 1.000 0.000 0.000
#> GSM99575 1 0.0162 0.8524 0.996 0.000 0.000 0.004 0.000
#> GSM99593 3 0.0000 0.9780 0.000 0.000 1.000 0.000 0.000
#> GSM99595 3 0.0000 0.9780 0.000 0.000 1.000 0.000 0.000
#> GSM99469 1 0.2729 0.8357 0.884 0.000 0.000 0.060 0.056
#> GSM99499 1 0.2304 0.8430 0.908 0.000 0.000 0.048 0.044
#> GSM99501 1 0.2588 0.8380 0.892 0.000 0.000 0.060 0.048
#> GSM99509 3 0.0000 0.9780 0.000 0.000 1.000 0.000 0.000
#> GSM99569 3 0.1216 0.9651 0.000 0.000 0.960 0.020 0.020
#> GSM99597 3 0.0579 0.9716 0.000 0.000 0.984 0.008 0.008
#> GSM99601 2 0.4517 -0.2257 0.000 0.600 0.000 0.012 0.388
#> GSM99459 1 0.3791 0.8027 0.812 0.000 0.000 0.112 0.076
#> GSM99461 1 0.3840 0.7998 0.808 0.000 0.000 0.116 0.076
#> GSM99511 3 0.1216 0.9646 0.000 0.000 0.960 0.020 0.020
#> GSM99513 3 0.1216 0.9646 0.000 0.000 0.960 0.020 0.020
#> GSM99515 3 0.0000 0.9780 0.000 0.000 1.000 0.000 0.000
#> GSM99517 1 0.0324 0.8525 0.992 0.000 0.000 0.004 0.004
#> GSM99519 1 0.3517 0.8140 0.832 0.000 0.000 0.100 0.068
#> GSM99521 3 0.1197 0.9361 0.000 0.000 0.952 0.048 0.000
#> GSM99523 3 0.1117 0.9665 0.000 0.000 0.964 0.020 0.016
#> GSM99571 1 0.3346 0.8277 0.844 0.000 0.000 0.064 0.092
#> GSM99599 1 0.0898 0.8524 0.972 0.000 0.000 0.008 0.020
#> GSM99433 2 0.5539 0.1012 0.000 0.500 0.008 0.444 0.048
#> GSM99435 4 0.4482 0.5469 0.000 0.000 0.376 0.612 0.012
#> GSM99437 2 0.2712 0.5510 0.000 0.880 0.000 0.032 0.088
#> GSM99439 5 0.4356 0.8990 0.000 0.340 0.000 0.012 0.648
#> GSM99441 1 0.0898 0.8524 0.972 0.000 0.000 0.008 0.020
#> GSM99443 2 0.3480 0.2880 0.000 0.752 0.000 0.000 0.248
#> GSM99445 2 0.4066 0.0156 0.000 0.672 0.000 0.004 0.324
#> GSM99447 2 0.3578 0.5136 0.000 0.820 0.000 0.048 0.132
#> GSM99449 3 0.0727 0.9670 0.000 0.012 0.980 0.004 0.004
#> GSM99451 4 0.4401 0.6179 0.000 0.000 0.328 0.656 0.016
#> GSM99453 1 0.4219 0.8021 0.772 0.000 0.000 0.072 0.156
#> GSM99455 1 0.4219 0.8021 0.772 0.000 0.000 0.072 0.156
#> GSM99457 1 0.5059 0.7674 0.700 0.000 0.000 0.124 0.176
#> GSM99463 5 0.3983 0.9001 0.000 0.340 0.000 0.000 0.660
#> GSM99465 4 0.5910 0.6215 0.108 0.008 0.088 0.708 0.088
#> GSM99467 2 0.4042 0.5428 0.000 0.756 0.000 0.212 0.032
#> GSM99471 1 0.6241 0.7012 0.616 0.024 0.000 0.168 0.192
#> GSM99473 1 0.3186 0.8343 0.864 0.008 0.000 0.048 0.080
#> GSM99475 4 0.4063 0.6712 0.000 0.000 0.280 0.708 0.012
#> GSM99477 2 0.5312 0.4123 0.000 0.672 0.064 0.248 0.016
#> GSM99479 2 0.4104 0.5389 0.000 0.748 0.000 0.220 0.032
#> GSM99481 1 0.0898 0.8524 0.972 0.000 0.000 0.008 0.020
#> GSM99483 1 0.4179 0.8026 0.776 0.000 0.000 0.072 0.152
#> GSM99485 2 0.3269 0.5290 0.000 0.848 0.000 0.056 0.096
#> GSM99487 2 0.2654 0.5533 0.000 0.884 0.000 0.032 0.084
#> GSM99489 5 0.4299 0.8638 0.000 0.388 0.000 0.004 0.608
#> GSM99491 2 0.2351 0.5138 0.000 0.896 0.000 0.016 0.088
#> GSM99493 1 0.4819 0.7756 0.724 0.000 0.000 0.112 0.164
#> GSM99495 5 0.3983 0.9001 0.000 0.340 0.000 0.000 0.660
#> GSM99525 1 0.4138 0.8046 0.780 0.000 0.000 0.072 0.148
#> GSM99527 4 0.4741 0.7017 0.000 0.048 0.172 0.752 0.028
#> GSM99529 4 0.5497 0.1799 0.000 0.380 0.008 0.560 0.052
#> GSM99531 4 0.4054 0.6929 0.000 0.000 0.248 0.732 0.020
#> GSM99533 4 0.3700 0.6971 0.000 0.000 0.240 0.752 0.008
#> GSM99535 2 0.3868 0.5356 0.000 0.800 0.000 0.140 0.060
#> GSM99537 1 0.2221 0.8467 0.912 0.000 0.000 0.052 0.036
#> GSM99539 4 0.6131 0.4228 0.000 0.288 0.064 0.600 0.048
#> GSM99541 1 0.3995 0.7838 0.788 0.000 0.000 0.152 0.060
#> GSM99543 5 0.5550 0.5689 0.000 0.400 0.000 0.072 0.528
#> GSM99545 4 0.6919 0.3104 0.000 0.216 0.032 0.528 0.224
#> GSM99547 4 0.5296 0.6320 0.000 0.136 0.100 0.728 0.036
#> GSM99549 5 0.4540 0.8956 0.000 0.340 0.000 0.020 0.640
#> GSM99551 4 0.6194 0.1632 0.208 0.008 0.000 0.588 0.196
#> GSM99553 3 0.0000 0.9780 0.000 0.000 1.000 0.000 0.000
#> GSM99555 2 0.3476 0.4722 0.000 0.804 0.000 0.020 0.176
#> GSM99557 5 0.4367 0.8272 0.000 0.416 0.000 0.004 0.580
#> GSM99559 3 0.1205 0.9331 0.000 0.040 0.956 0.004 0.000
#> GSM99561 2 0.5237 0.2046 0.000 0.664 0.000 0.100 0.236
#> GSM99563 3 0.1117 0.9665 0.000 0.000 0.964 0.020 0.016
#> GSM99565 2 0.3229 0.5237 0.000 0.840 0.000 0.032 0.128
#> GSM99573 5 0.4540 0.8956 0.000 0.340 0.000 0.020 0.640
#> GSM99577 1 0.6038 0.7085 0.576 0.000 0.000 0.240 0.184
#> GSM99579 2 0.3237 0.5128 0.000 0.848 0.000 0.048 0.104
#> GSM99581 3 0.0324 0.9766 0.000 0.000 0.992 0.004 0.004
#> GSM99583 2 0.6726 0.0748 0.000 0.508 0.080 0.352 0.060
#> GSM99585 2 0.3750 0.5351 0.000 0.756 0.000 0.232 0.012
#> GSM99587 1 0.4819 0.7756 0.724 0.000 0.000 0.112 0.164
#> GSM99589 2 0.2519 0.5048 0.000 0.884 0.000 0.016 0.100
#> GSM99591 2 0.4066 0.0156 0.000 0.672 0.000 0.004 0.324
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM99497 3 0.0146 0.9438 0.000 0.004 0.996 0.000 0.000 0.000
#> GSM99503 1 0.1958 0.6715 0.896 0.000 0.000 0.000 0.004 0.100
#> GSM99505 1 0.0964 0.7234 0.968 0.000 0.000 0.012 0.004 0.016
#> GSM99507 3 0.0146 0.9438 0.000 0.004 0.996 0.000 0.000 0.000
#> GSM99567 3 0.0000 0.9439 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM99575 1 0.1958 0.6715 0.896 0.000 0.000 0.000 0.004 0.100
#> GSM99593 3 0.0260 0.9435 0.000 0.000 0.992 0.008 0.000 0.000
#> GSM99595 3 0.0000 0.9439 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM99469 1 0.1577 0.7185 0.940 0.000 0.000 0.016 0.008 0.036
#> GSM99499 1 0.0964 0.7234 0.968 0.000 0.000 0.012 0.004 0.016
#> GSM99501 1 0.1577 0.7185 0.940 0.000 0.000 0.016 0.008 0.036
#> GSM99509 3 0.0260 0.9434 0.000 0.000 0.992 0.008 0.000 0.000
#> GSM99569 3 0.2775 0.9073 0.000 0.004 0.884 0.032 0.032 0.048
#> GSM99597 3 0.1285 0.9347 0.004 0.008 0.960 0.008 0.008 0.012
#> GSM99601 5 0.5183 0.0565 0.000 0.456 0.000 0.024 0.480 0.040
#> GSM99459 1 0.3260 0.6669 0.848 0.000 0.000 0.056 0.028 0.068
#> GSM99461 1 0.3260 0.6669 0.848 0.000 0.000 0.056 0.028 0.068
#> GSM99511 3 0.2981 0.8967 0.000 0.000 0.868 0.040 0.040 0.052
#> GSM99513 3 0.2981 0.8967 0.000 0.000 0.868 0.040 0.040 0.052
#> GSM99515 3 0.0146 0.9438 0.000 0.004 0.996 0.000 0.000 0.000
#> GSM99517 1 0.2118 0.6649 0.888 0.000 0.000 0.000 0.008 0.104
#> GSM99519 1 0.2897 0.6869 0.872 0.000 0.000 0.048 0.028 0.052
#> GSM99521 3 0.2234 0.8272 0.000 0.004 0.872 0.124 0.000 0.000
#> GSM99523 3 0.2911 0.8986 0.000 0.000 0.872 0.036 0.040 0.052
#> GSM99571 1 0.4067 -0.5291 0.548 0.000 0.000 0.000 0.008 0.444
#> GSM99599 1 0.2593 0.6088 0.844 0.000 0.000 0.000 0.008 0.148
#> GSM99433 2 0.5384 0.0817 0.000 0.516 0.000 0.404 0.044 0.036
#> GSM99435 4 0.4377 0.7091 0.000 0.036 0.228 0.716 0.004 0.016
#> GSM99437 2 0.4282 0.4611 0.000 0.736 0.000 0.036 0.200 0.028
#> GSM99439 5 0.3687 0.7892 0.000 0.164 0.000 0.032 0.788 0.016
#> GSM99441 1 0.2593 0.6088 0.844 0.000 0.000 0.000 0.008 0.148
#> GSM99443 2 0.5006 0.1594 0.000 0.548 0.000 0.008 0.388 0.056
#> GSM99445 2 0.4753 -0.0209 0.000 0.496 0.000 0.000 0.456 0.048
#> GSM99447 2 0.4927 0.4545 0.000 0.700 0.000 0.080 0.184 0.036
#> GSM99449 3 0.1036 0.9309 0.000 0.008 0.964 0.024 0.000 0.004
#> GSM99451 4 0.3262 0.7575 0.000 0.004 0.180 0.800 0.004 0.012
#> GSM99453 6 0.3864 0.6397 0.480 0.000 0.000 0.000 0.000 0.520
#> GSM99455 6 0.3864 0.6397 0.480 0.000 0.000 0.000 0.000 0.520
#> GSM99457 6 0.5253 0.6471 0.388 0.000 0.000 0.020 0.056 0.536
#> GSM99463 5 0.2963 0.7979 0.000 0.152 0.000 0.016 0.828 0.004
#> GSM99465 4 0.7070 0.4072 0.316 0.056 0.016 0.488 0.028 0.096
#> GSM99467 2 0.3407 0.5406 0.000 0.832 0.008 0.088 0.004 0.068
#> GSM99471 6 0.5834 0.5092 0.320 0.064 0.000 0.040 0.012 0.564
#> GSM99473 1 0.3880 0.6228 0.788 0.024 0.000 0.008 0.024 0.156
#> GSM99475 4 0.2655 0.7749 0.008 0.000 0.140 0.848 0.000 0.004
#> GSM99477 2 0.4395 0.5188 0.000 0.760 0.052 0.152 0.008 0.028
#> GSM99479 2 0.3552 0.5367 0.000 0.820 0.008 0.100 0.004 0.068
#> GSM99481 1 0.2593 0.6088 0.844 0.000 0.000 0.000 0.008 0.148
#> GSM99483 6 0.4093 0.6389 0.476 0.000 0.000 0.000 0.008 0.516
#> GSM99485 2 0.4936 0.4759 0.000 0.700 0.000 0.024 0.152 0.124
#> GSM99487 2 0.4161 0.4762 0.000 0.752 0.000 0.036 0.184 0.028
#> GSM99489 5 0.3354 0.7646 0.000 0.168 0.000 0.000 0.796 0.036
#> GSM99491 2 0.4354 0.4318 0.000 0.704 0.000 0.008 0.236 0.052
#> GSM99493 6 0.5110 0.6638 0.380 0.000 0.000 0.016 0.052 0.552
#> GSM99495 5 0.2963 0.7979 0.000 0.152 0.000 0.016 0.828 0.004
#> GSM99525 6 0.4093 0.6282 0.476 0.000 0.000 0.000 0.008 0.516
#> GSM99527 4 0.4223 0.7247 0.004 0.084 0.028 0.804 0.024 0.056
#> GSM99529 2 0.6526 0.0422 0.004 0.460 0.012 0.368 0.032 0.124
#> GSM99531 4 0.3886 0.7717 0.020 0.004 0.132 0.804 0.012 0.028
#> GSM99533 4 0.3167 0.7752 0.016 0.004 0.120 0.840 0.000 0.020
#> GSM99535 2 0.4937 0.4970 0.000 0.712 0.000 0.076 0.052 0.160
#> GSM99537 1 0.1148 0.7213 0.960 0.000 0.000 0.020 0.004 0.016
#> GSM99539 4 0.4744 0.5993 0.000 0.176 0.008 0.728 0.048 0.040
#> GSM99541 1 0.3186 0.6317 0.836 0.000 0.000 0.100 0.004 0.060
#> GSM99543 5 0.5831 0.4421 0.000 0.252 0.000 0.032 0.580 0.136
#> GSM99545 4 0.4927 0.5610 0.000 0.096 0.004 0.716 0.152 0.032
#> GSM99547 4 0.5478 0.6195 0.004 0.188 0.012 0.672 0.028 0.096
#> GSM99549 5 0.4170 0.7733 0.000 0.168 0.000 0.040 0.760 0.032
#> GSM99551 6 0.6496 0.2202 0.100 0.032 0.000 0.240 0.056 0.572
#> GSM99553 3 0.0146 0.9438 0.000 0.004 0.996 0.000 0.000 0.000
#> GSM99555 2 0.4590 0.3456 0.000 0.660 0.000 0.024 0.288 0.028
#> GSM99557 5 0.3658 0.7210 0.000 0.216 0.000 0.000 0.752 0.032
#> GSM99559 3 0.1562 0.9095 0.000 0.024 0.940 0.032 0.000 0.004
#> GSM99561 2 0.6256 0.0563 0.000 0.488 0.000 0.088 0.352 0.072
#> GSM99563 3 0.2911 0.8978 0.000 0.000 0.872 0.036 0.040 0.052
#> GSM99565 2 0.4608 0.4267 0.000 0.700 0.000 0.040 0.228 0.032
#> GSM99573 5 0.4235 0.7713 0.000 0.168 0.000 0.044 0.756 0.032
#> GSM99577 1 0.5885 -0.4471 0.428 0.004 0.000 0.132 0.008 0.428
#> GSM99579 2 0.4406 0.4598 0.000 0.728 0.000 0.008 0.176 0.088
#> GSM99581 3 0.0767 0.9422 0.000 0.000 0.976 0.012 0.004 0.008
#> GSM99583 2 0.5845 0.3763 0.004 0.652 0.056 0.164 0.008 0.116
#> GSM99585 2 0.3492 0.5313 0.000 0.788 0.000 0.176 0.004 0.032
#> GSM99587 6 0.5110 0.6638 0.380 0.000 0.000 0.016 0.052 0.552
#> GSM99589 2 0.4985 0.4429 0.000 0.668 0.000 0.028 0.236 0.068
#> GSM99591 2 0.4753 -0.0209 0.000 0.496 0.000 0.000 0.456 0.048
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
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 disease.state(p) cell.type(p) k
#> MAD:kmeans 61 5.18e-04 0.00180 2
#> MAD:kmeans 83 5.12e-04 0.01152 3
#> MAD:kmeans 68 9.13e-05 0.00696 4
#> MAD:kmeans 72 1.53e-05 0.00468 5
#> MAD:kmeans 62 5.20e-06 0.00484 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 21512 rows and 85 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 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.630 0.776 0.911 0.4983 0.497 0.497
#> 3 3 0.984 0.960 0.982 0.3456 0.754 0.542
#> 4 4 0.777 0.796 0.878 0.0917 0.950 0.850
#> 5 5 0.698 0.656 0.807 0.0625 0.954 0.840
#> 6 6 0.668 0.578 0.736 0.0395 0.991 0.965
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
#> GSM99497 2 0.9608 0.45092 0.384 0.616
#> GSM99503 1 0.0000 0.92781 1.000 0.000
#> GSM99505 1 0.0000 0.92781 1.000 0.000
#> GSM99507 2 0.9635 0.44217 0.388 0.612
#> GSM99567 2 0.9460 0.48913 0.364 0.636
#> GSM99575 1 0.0000 0.92781 1.000 0.000
#> GSM99593 2 0.6801 0.72883 0.180 0.820
#> GSM99595 2 0.9608 0.45092 0.384 0.616
#> GSM99469 1 0.0000 0.92781 1.000 0.000
#> GSM99499 1 0.0000 0.92781 1.000 0.000
#> GSM99501 1 0.0000 0.92781 1.000 0.000
#> GSM99509 1 0.9988 -0.07138 0.520 0.480
#> GSM99569 1 0.9209 0.40535 0.664 0.336
#> GSM99597 1 0.8661 0.52036 0.712 0.288
#> GSM99601 2 0.0000 0.86181 0.000 1.000
#> GSM99459 1 0.0000 0.92781 1.000 0.000
#> GSM99461 1 0.0000 0.92781 1.000 0.000
#> GSM99511 2 0.9580 0.45855 0.380 0.620
#> GSM99513 2 0.9491 0.48122 0.368 0.632
#> GSM99515 2 0.9710 0.41395 0.400 0.600
#> GSM99517 1 0.0000 0.92781 1.000 0.000
#> GSM99519 1 0.0000 0.92781 1.000 0.000
#> GSM99521 2 0.9635 0.44247 0.388 0.612
#> GSM99523 1 0.0000 0.92781 1.000 0.000
#> GSM99571 1 0.0000 0.92781 1.000 0.000
#> GSM99599 1 0.0000 0.92781 1.000 0.000
#> GSM99433 2 0.0000 0.86181 0.000 1.000
#> GSM99435 2 0.9129 0.54614 0.328 0.672
#> GSM99437 2 0.0000 0.86181 0.000 1.000
#> GSM99439 2 0.0000 0.86181 0.000 1.000
#> GSM99441 1 0.0000 0.92781 1.000 0.000
#> GSM99443 2 0.0000 0.86181 0.000 1.000
#> GSM99445 2 0.0000 0.86181 0.000 1.000
#> GSM99447 2 0.0000 0.86181 0.000 1.000
#> GSM99449 2 0.0000 0.86181 0.000 1.000
#> GSM99451 1 0.1843 0.90455 0.972 0.028
#> GSM99453 1 0.0000 0.92781 1.000 0.000
#> GSM99455 1 0.0000 0.92781 1.000 0.000
#> GSM99457 1 0.0000 0.92781 1.000 0.000
#> GSM99463 2 0.0000 0.86181 0.000 1.000
#> GSM99465 1 0.0000 0.92781 1.000 0.000
#> GSM99467 2 0.0000 0.86181 0.000 1.000
#> GSM99471 1 0.0000 0.92781 1.000 0.000
#> GSM99473 1 0.0000 0.92781 1.000 0.000
#> GSM99475 1 0.8608 0.53284 0.716 0.284
#> GSM99477 2 0.0000 0.86181 0.000 1.000
#> GSM99479 2 0.0000 0.86181 0.000 1.000
#> GSM99481 1 0.0000 0.92781 1.000 0.000
#> GSM99483 1 0.0000 0.92781 1.000 0.000
#> GSM99485 2 0.0000 0.86181 0.000 1.000
#> GSM99487 2 0.0000 0.86181 0.000 1.000
#> GSM99489 2 0.0000 0.86181 0.000 1.000
#> GSM99491 2 0.0000 0.86181 0.000 1.000
#> GSM99493 1 0.0000 0.92781 1.000 0.000
#> GSM99495 2 0.0000 0.86181 0.000 1.000
#> GSM99525 1 0.0000 0.92781 1.000 0.000
#> GSM99527 1 0.5737 0.79691 0.864 0.136
#> GSM99529 2 0.0938 0.85420 0.012 0.988
#> GSM99531 1 0.1843 0.90427 0.972 0.028
#> GSM99533 1 0.0000 0.92781 1.000 0.000
#> GSM99535 2 0.9944 0.14882 0.456 0.544
#> GSM99537 1 0.0000 0.92781 1.000 0.000
#> GSM99539 2 0.0000 0.86181 0.000 1.000
#> GSM99541 1 0.0000 0.92781 1.000 0.000
#> GSM99543 2 0.9977 0.10167 0.472 0.528
#> GSM99545 2 0.0000 0.86181 0.000 1.000
#> GSM99547 1 0.7056 0.70420 0.808 0.192
#> GSM99549 2 0.0000 0.86181 0.000 1.000
#> GSM99551 1 0.0000 0.92781 1.000 0.000
#> GSM99553 2 0.5737 0.76893 0.136 0.864
#> GSM99555 2 0.0000 0.86181 0.000 1.000
#> GSM99557 2 0.0000 0.86181 0.000 1.000
#> GSM99559 2 0.0000 0.86181 0.000 1.000
#> GSM99561 2 0.0000 0.86181 0.000 1.000
#> GSM99563 1 0.9963 -0.00877 0.536 0.464
#> GSM99565 2 0.0000 0.86181 0.000 1.000
#> GSM99573 2 0.0000 0.86181 0.000 1.000
#> GSM99577 1 0.0000 0.92781 1.000 0.000
#> GSM99579 2 0.0000 0.86181 0.000 1.000
#> GSM99581 2 0.8443 0.62645 0.272 0.728
#> GSM99583 2 0.9896 0.20667 0.440 0.560
#> GSM99585 2 0.0000 0.86181 0.000 1.000
#> GSM99587 1 0.0000 0.92781 1.000 0.000
#> GSM99589 2 0.0000 0.86181 0.000 1.000
#> GSM99591 2 0.0000 0.86181 0.000 1.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM99497 3 0.0000 0.983 0.000 0.000 1.000
#> GSM99503 1 0.0000 0.987 1.000 0.000 0.000
#> GSM99505 1 0.0000 0.987 1.000 0.000 0.000
#> GSM99507 3 0.0000 0.983 0.000 0.000 1.000
#> GSM99567 3 0.0000 0.983 0.000 0.000 1.000
#> GSM99575 1 0.0000 0.987 1.000 0.000 0.000
#> GSM99593 3 0.0000 0.983 0.000 0.000 1.000
#> GSM99595 3 0.0000 0.983 0.000 0.000 1.000
#> GSM99469 1 0.0000 0.987 1.000 0.000 0.000
#> GSM99499 1 0.0000 0.987 1.000 0.000 0.000
#> GSM99501 1 0.0000 0.987 1.000 0.000 0.000
#> GSM99509 3 0.0000 0.983 0.000 0.000 1.000
#> GSM99569 3 0.0000 0.983 0.000 0.000 1.000
#> GSM99597 3 0.0000 0.983 0.000 0.000 1.000
#> GSM99601 2 0.0000 0.976 0.000 1.000 0.000
#> GSM99459 1 0.0000 0.987 1.000 0.000 0.000
#> GSM99461 1 0.0000 0.987 1.000 0.000 0.000
#> GSM99511 3 0.0000 0.983 0.000 0.000 1.000
#> GSM99513 3 0.0000 0.983 0.000 0.000 1.000
#> GSM99515 3 0.0000 0.983 0.000 0.000 1.000
#> GSM99517 1 0.0000 0.987 1.000 0.000 0.000
#> GSM99519 1 0.0000 0.987 1.000 0.000 0.000
#> GSM99521 3 0.0000 0.983 0.000 0.000 1.000
#> GSM99523 3 0.0000 0.983 0.000 0.000 1.000
#> GSM99571 1 0.0000 0.987 1.000 0.000 0.000
#> GSM99599 1 0.0000 0.987 1.000 0.000 0.000
#> GSM99433 2 0.0000 0.976 0.000 1.000 0.000
#> GSM99435 3 0.0000 0.983 0.000 0.000 1.000
#> GSM99437 2 0.0000 0.976 0.000 1.000 0.000
#> GSM99439 2 0.0000 0.976 0.000 1.000 0.000
#> GSM99441 1 0.0000 0.987 1.000 0.000 0.000
#> GSM99443 2 0.0000 0.976 0.000 1.000 0.000
#> GSM99445 2 0.0000 0.976 0.000 1.000 0.000
#> GSM99447 2 0.0000 0.976 0.000 1.000 0.000
#> GSM99449 3 0.0000 0.983 0.000 0.000 1.000
#> GSM99451 3 0.0000 0.983 0.000 0.000 1.000
#> GSM99453 1 0.0000 0.987 1.000 0.000 0.000
#> GSM99455 1 0.0000 0.987 1.000 0.000 0.000
#> GSM99457 1 0.0000 0.987 1.000 0.000 0.000
#> GSM99463 2 0.0000 0.976 0.000 1.000 0.000
#> GSM99465 1 0.3267 0.865 0.884 0.000 0.116
#> GSM99467 2 0.0000 0.976 0.000 1.000 0.000
#> GSM99471 1 0.0000 0.987 1.000 0.000 0.000
#> GSM99473 1 0.0000 0.987 1.000 0.000 0.000
#> GSM99475 3 0.0000 0.983 0.000 0.000 1.000
#> GSM99477 2 0.1163 0.952 0.000 0.972 0.028
#> GSM99479 2 0.0000 0.976 0.000 1.000 0.000
#> GSM99481 1 0.0000 0.987 1.000 0.000 0.000
#> GSM99483 1 0.0000 0.987 1.000 0.000 0.000
#> GSM99485 2 0.0000 0.976 0.000 1.000 0.000
#> GSM99487 2 0.0000 0.976 0.000 1.000 0.000
#> GSM99489 2 0.0000 0.976 0.000 1.000 0.000
#> GSM99491 2 0.0000 0.976 0.000 1.000 0.000
#> GSM99493 1 0.0000 0.987 1.000 0.000 0.000
#> GSM99495 2 0.0000 0.976 0.000 1.000 0.000
#> GSM99525 1 0.0000 0.987 1.000 0.000 0.000
#> GSM99527 3 0.4575 0.804 0.160 0.012 0.828
#> GSM99529 2 0.0000 0.976 0.000 1.000 0.000
#> GSM99531 3 0.0000 0.983 0.000 0.000 1.000
#> GSM99533 3 0.3752 0.834 0.144 0.000 0.856
#> GSM99535 2 0.4062 0.795 0.164 0.836 0.000
#> GSM99537 1 0.0000 0.987 1.000 0.000 0.000
#> GSM99539 2 0.0892 0.960 0.000 0.980 0.020
#> GSM99541 1 0.0000 0.987 1.000 0.000 0.000
#> GSM99543 2 0.0592 0.966 0.012 0.988 0.000
#> GSM99545 2 0.0424 0.970 0.000 0.992 0.008
#> GSM99547 1 0.6613 0.692 0.740 0.072 0.188
#> GSM99549 2 0.0000 0.976 0.000 1.000 0.000
#> GSM99551 1 0.0000 0.987 1.000 0.000 0.000
#> GSM99553 3 0.0000 0.983 0.000 0.000 1.000
#> GSM99555 2 0.0000 0.976 0.000 1.000 0.000
#> GSM99557 2 0.0000 0.976 0.000 1.000 0.000
#> GSM99559 3 0.2165 0.923 0.000 0.064 0.936
#> GSM99561 2 0.0000 0.976 0.000 1.000 0.000
#> GSM99563 3 0.0000 0.983 0.000 0.000 1.000
#> GSM99565 2 0.0000 0.976 0.000 1.000 0.000
#> GSM99573 2 0.0000 0.976 0.000 1.000 0.000
#> GSM99577 1 0.0000 0.987 1.000 0.000 0.000
#> GSM99579 2 0.0000 0.976 0.000 1.000 0.000
#> GSM99581 3 0.0000 0.983 0.000 0.000 1.000
#> GSM99583 2 0.9273 0.172 0.364 0.472 0.164
#> GSM99585 2 0.0000 0.976 0.000 1.000 0.000
#> GSM99587 1 0.0000 0.987 1.000 0.000 0.000
#> GSM99589 2 0.0000 0.976 0.000 1.000 0.000
#> GSM99591 2 0.0000 0.976 0.000 1.000 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM99497 3 0.0000 0.903 0.000 0.000 1.000 0.000
#> GSM99503 1 0.0188 0.955 0.996 0.000 0.000 0.004
#> GSM99505 1 0.1576 0.916 0.948 0.000 0.048 0.004
#> GSM99507 3 0.0000 0.903 0.000 0.000 1.000 0.000
#> GSM99567 3 0.0000 0.903 0.000 0.000 1.000 0.000
#> GSM99575 1 0.0188 0.955 0.996 0.000 0.000 0.004
#> GSM99593 3 0.0469 0.902 0.000 0.000 0.988 0.012
#> GSM99595 3 0.0000 0.903 0.000 0.000 1.000 0.000
#> GSM99469 1 0.0336 0.954 0.992 0.000 0.000 0.008
#> GSM99499 1 0.0188 0.955 0.996 0.000 0.000 0.004
#> GSM99501 1 0.0469 0.954 0.988 0.000 0.000 0.012
#> GSM99509 3 0.0000 0.903 0.000 0.000 1.000 0.000
#> GSM99569 3 0.0707 0.899 0.000 0.000 0.980 0.020
#> GSM99597 3 0.1211 0.883 0.000 0.000 0.960 0.040
#> GSM99601 2 0.1211 0.854 0.000 0.960 0.000 0.040
#> GSM99459 1 0.2216 0.900 0.908 0.000 0.000 0.092
#> GSM99461 1 0.2149 0.904 0.912 0.000 0.000 0.088
#> GSM99511 3 0.1637 0.869 0.000 0.000 0.940 0.060
#> GSM99513 3 0.0921 0.894 0.000 0.000 0.972 0.028
#> GSM99515 3 0.0000 0.903 0.000 0.000 1.000 0.000
#> GSM99517 1 0.0188 0.955 0.996 0.000 0.000 0.004
#> GSM99519 1 0.1557 0.930 0.944 0.000 0.000 0.056
#> GSM99521 3 0.2589 0.799 0.000 0.000 0.884 0.116
#> GSM99523 3 0.0469 0.902 0.000 0.000 0.988 0.012
#> GSM99571 1 0.0592 0.953 0.984 0.000 0.000 0.016
#> GSM99599 1 0.0000 0.955 1.000 0.000 0.000 0.000
#> GSM99433 2 0.4500 0.703 0.000 0.684 0.000 0.316
#> GSM99435 3 0.4877 0.193 0.000 0.000 0.592 0.408
#> GSM99437 2 0.2973 0.834 0.000 0.856 0.000 0.144
#> GSM99439 2 0.1022 0.846 0.000 0.968 0.000 0.032
#> GSM99441 1 0.0188 0.955 0.996 0.000 0.000 0.004
#> GSM99443 2 0.2149 0.850 0.000 0.912 0.000 0.088
#> GSM99445 2 0.1389 0.851 0.000 0.952 0.000 0.048
#> GSM99447 2 0.2760 0.838 0.000 0.872 0.000 0.128
#> GSM99449 3 0.1256 0.883 0.000 0.008 0.964 0.028
#> GSM99451 3 0.5000 -0.148 0.000 0.000 0.500 0.500
#> GSM99453 1 0.0592 0.953 0.984 0.000 0.000 0.016
#> GSM99455 1 0.0592 0.953 0.984 0.000 0.000 0.016
#> GSM99457 1 0.1211 0.946 0.960 0.000 0.000 0.040
#> GSM99463 2 0.0817 0.847 0.000 0.976 0.000 0.024
#> GSM99465 4 0.5980 0.329 0.396 0.000 0.044 0.560
#> GSM99467 2 0.4406 0.754 0.000 0.700 0.000 0.300
#> GSM99471 1 0.2011 0.911 0.920 0.000 0.000 0.080
#> GSM99473 1 0.0592 0.952 0.984 0.000 0.000 0.016
#> GSM99475 4 0.4925 0.221 0.000 0.000 0.428 0.572
#> GSM99477 2 0.7091 0.462 0.000 0.508 0.136 0.356
#> GSM99479 2 0.4632 0.743 0.000 0.688 0.004 0.308
#> GSM99481 1 0.0000 0.955 1.000 0.000 0.000 0.000
#> GSM99483 1 0.0707 0.952 0.980 0.000 0.000 0.020
#> GSM99485 2 0.2647 0.834 0.000 0.880 0.000 0.120
#> GSM99487 2 0.3123 0.829 0.000 0.844 0.000 0.156
#> GSM99489 2 0.0469 0.851 0.000 0.988 0.000 0.012
#> GSM99491 2 0.2216 0.849 0.000 0.908 0.000 0.092
#> GSM99493 1 0.0592 0.953 0.984 0.000 0.000 0.016
#> GSM99495 2 0.1022 0.846 0.000 0.968 0.000 0.032
#> GSM99525 1 0.0592 0.954 0.984 0.000 0.000 0.016
#> GSM99527 4 0.5433 0.571 0.040 0.060 0.124 0.776
#> GSM99529 2 0.5602 0.362 0.000 0.508 0.020 0.472
#> GSM99531 4 0.6148 0.327 0.052 0.000 0.408 0.540
#> GSM99533 4 0.6275 0.582 0.136 0.000 0.204 0.660
#> GSM99535 2 0.5766 0.674 0.104 0.704 0.000 0.192
#> GSM99537 1 0.0592 0.953 0.984 0.000 0.000 0.016
#> GSM99539 2 0.5427 0.398 0.000 0.568 0.016 0.416
#> GSM99541 1 0.2973 0.829 0.856 0.000 0.000 0.144
#> GSM99543 2 0.3372 0.810 0.036 0.868 0.000 0.096
#> GSM99545 2 0.4866 0.470 0.000 0.596 0.000 0.404
#> GSM99547 4 0.6663 0.530 0.268 0.028 0.068 0.636
#> GSM99549 2 0.1302 0.844 0.000 0.956 0.000 0.044
#> GSM99551 1 0.4250 0.622 0.724 0.000 0.000 0.276
#> GSM99553 3 0.0336 0.901 0.000 0.000 0.992 0.008
#> GSM99555 2 0.2281 0.846 0.000 0.904 0.000 0.096
#> GSM99557 2 0.0592 0.851 0.000 0.984 0.000 0.016
#> GSM99559 3 0.4046 0.696 0.000 0.048 0.828 0.124
#> GSM99561 2 0.2281 0.841 0.000 0.904 0.000 0.096
#> GSM99563 3 0.0592 0.900 0.000 0.000 0.984 0.016
#> GSM99565 2 0.2921 0.834 0.000 0.860 0.000 0.140
#> GSM99573 2 0.1302 0.844 0.000 0.956 0.000 0.044
#> GSM99577 1 0.1792 0.926 0.932 0.000 0.000 0.068
#> GSM99579 2 0.2589 0.837 0.000 0.884 0.000 0.116
#> GSM99581 3 0.0000 0.903 0.000 0.000 1.000 0.000
#> GSM99583 4 0.9495 0.319 0.176 0.200 0.204 0.420
#> GSM99585 2 0.4382 0.744 0.000 0.704 0.000 0.296
#> GSM99587 1 0.0592 0.953 0.984 0.000 0.000 0.016
#> GSM99589 2 0.1022 0.854 0.000 0.968 0.000 0.032
#> GSM99591 2 0.1474 0.852 0.000 0.948 0.000 0.052
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM99497 3 0.0000 0.87859 0.000 0.000 1.000 0.000 0.000
#> GSM99503 1 0.0992 0.88524 0.968 0.000 0.000 0.024 0.008
#> GSM99505 1 0.2919 0.86068 0.888 0.000 0.044 0.044 0.024
#> GSM99507 3 0.0000 0.87859 0.000 0.000 1.000 0.000 0.000
#> GSM99567 3 0.0162 0.87845 0.000 0.000 0.996 0.000 0.004
#> GSM99575 1 0.0992 0.88370 0.968 0.000 0.000 0.024 0.008
#> GSM99593 3 0.1668 0.87706 0.000 0.000 0.940 0.028 0.032
#> GSM99595 3 0.0290 0.87956 0.000 0.000 0.992 0.000 0.008
#> GSM99469 1 0.2304 0.87179 0.908 0.000 0.000 0.048 0.044
#> GSM99499 1 0.1907 0.88581 0.928 0.000 0.000 0.044 0.028
#> GSM99501 1 0.2228 0.87276 0.912 0.000 0.000 0.048 0.040
#> GSM99509 3 0.0794 0.88029 0.000 0.000 0.972 0.028 0.000
#> GSM99569 3 0.2344 0.86363 0.000 0.000 0.904 0.064 0.032
#> GSM99597 3 0.2951 0.80854 0.000 0.000 0.860 0.112 0.028
#> GSM99601 2 0.2329 0.63573 0.000 0.876 0.000 0.000 0.124
#> GSM99459 1 0.3075 0.84742 0.860 0.000 0.000 0.092 0.048
#> GSM99461 1 0.3437 0.83077 0.832 0.000 0.000 0.120 0.048
#> GSM99511 3 0.3012 0.82398 0.000 0.000 0.852 0.124 0.024
#> GSM99513 3 0.2351 0.85847 0.000 0.000 0.896 0.088 0.016
#> GSM99515 3 0.0324 0.87947 0.000 0.000 0.992 0.004 0.004
#> GSM99517 1 0.0912 0.88550 0.972 0.000 0.000 0.016 0.012
#> GSM99519 1 0.3226 0.84388 0.852 0.000 0.000 0.088 0.060
#> GSM99521 3 0.3438 0.73902 0.000 0.000 0.808 0.172 0.020
#> GSM99523 3 0.2162 0.87055 0.008 0.000 0.916 0.064 0.012
#> GSM99571 1 0.1310 0.88476 0.956 0.000 0.000 0.024 0.020
#> GSM99599 1 0.0162 0.88558 0.996 0.000 0.000 0.004 0.000
#> GSM99433 2 0.6040 0.22775 0.000 0.560 0.000 0.156 0.284
#> GSM99435 3 0.5677 0.00605 0.000 0.000 0.496 0.424 0.080
#> GSM99437 2 0.4310 0.32523 0.000 0.604 0.000 0.004 0.392
#> GSM99439 2 0.0865 0.63412 0.000 0.972 0.000 0.004 0.024
#> GSM99441 1 0.0912 0.88836 0.972 0.000 0.000 0.012 0.016
#> GSM99443 2 0.3612 0.54747 0.000 0.732 0.000 0.000 0.268
#> GSM99445 2 0.3231 0.60625 0.000 0.800 0.000 0.004 0.196
#> GSM99447 2 0.3967 0.50461 0.000 0.724 0.000 0.012 0.264
#> GSM99449 3 0.2609 0.85068 0.000 0.008 0.896 0.028 0.068
#> GSM99451 4 0.5221 0.25981 0.000 0.000 0.400 0.552 0.048
#> GSM99453 1 0.2782 0.86367 0.880 0.000 0.000 0.072 0.048
#> GSM99455 1 0.2645 0.86784 0.888 0.000 0.000 0.068 0.044
#> GSM99457 1 0.3075 0.86464 0.860 0.000 0.000 0.092 0.048
#> GSM99463 2 0.0566 0.64063 0.000 0.984 0.000 0.004 0.012
#> GSM99465 4 0.6657 0.44425 0.280 0.000 0.032 0.548 0.140
#> GSM99467 5 0.4067 0.50835 0.000 0.300 0.000 0.008 0.692
#> GSM99471 1 0.4569 0.78956 0.772 0.016 0.000 0.080 0.132
#> GSM99473 1 0.2632 0.87515 0.888 0.000 0.000 0.040 0.072
#> GSM99475 4 0.4024 0.59814 0.000 0.000 0.220 0.752 0.028
#> GSM99477 5 0.5710 0.52024 0.000 0.244 0.076 0.028 0.652
#> GSM99479 5 0.4161 0.52344 0.000 0.280 0.000 0.016 0.704
#> GSM99481 1 0.0510 0.88689 0.984 0.000 0.000 0.000 0.016
#> GSM99483 1 0.2520 0.87170 0.896 0.000 0.000 0.056 0.048
#> GSM99485 2 0.4455 0.22578 0.000 0.588 0.000 0.008 0.404
#> GSM99487 2 0.4367 0.26436 0.000 0.580 0.000 0.004 0.416
#> GSM99489 2 0.1768 0.63869 0.000 0.924 0.000 0.004 0.072
#> GSM99491 2 0.3838 0.53209 0.000 0.716 0.000 0.004 0.280
#> GSM99493 1 0.2554 0.87337 0.892 0.000 0.000 0.072 0.036
#> GSM99495 2 0.0566 0.63816 0.000 0.984 0.000 0.004 0.012
#> GSM99525 1 0.2291 0.87635 0.908 0.000 0.000 0.036 0.056
#> GSM99527 4 0.4908 0.56614 0.032 0.020 0.036 0.768 0.144
#> GSM99529 5 0.6550 0.38256 0.000 0.236 0.004 0.252 0.508
#> GSM99531 4 0.5544 0.55325 0.016 0.004 0.272 0.648 0.060
#> GSM99533 4 0.3018 0.61671 0.024 0.000 0.080 0.876 0.020
#> GSM99535 2 0.6817 0.07757 0.096 0.536 0.000 0.064 0.304
#> GSM99537 1 0.2017 0.88183 0.912 0.000 0.000 0.080 0.008
#> GSM99539 2 0.6916 0.06464 0.000 0.488 0.024 0.304 0.184
#> GSM99541 1 0.4378 0.71556 0.716 0.000 0.000 0.248 0.036
#> GSM99543 2 0.4156 0.49249 0.020 0.792 0.000 0.036 0.152
#> GSM99545 2 0.5769 0.14743 0.000 0.556 0.000 0.340 0.104
#> GSM99547 4 0.7799 0.37463 0.208 0.024 0.044 0.472 0.252
#> GSM99549 2 0.1168 0.63016 0.000 0.960 0.000 0.008 0.032
#> GSM99551 1 0.6162 0.32301 0.520 0.008 0.000 0.360 0.112
#> GSM99553 3 0.1626 0.86934 0.000 0.000 0.940 0.016 0.044
#> GSM99555 2 0.3790 0.52545 0.000 0.724 0.000 0.004 0.272
#> GSM99557 2 0.1952 0.63848 0.000 0.912 0.000 0.004 0.084
#> GSM99559 3 0.4575 0.61842 0.000 0.040 0.736 0.012 0.212
#> GSM99561 2 0.3413 0.59122 0.000 0.832 0.000 0.044 0.124
#> GSM99563 3 0.2006 0.86898 0.000 0.000 0.916 0.072 0.012
#> GSM99565 2 0.4299 0.34448 0.000 0.608 0.000 0.004 0.388
#> GSM99573 2 0.1331 0.62684 0.000 0.952 0.000 0.008 0.040
#> GSM99577 1 0.4987 0.69938 0.684 0.000 0.000 0.236 0.080
#> GSM99579 2 0.4238 0.36461 0.000 0.628 0.000 0.004 0.368
#> GSM99581 3 0.1836 0.87888 0.000 0.000 0.932 0.036 0.032
#> GSM99583 5 0.8008 0.28778 0.092 0.092 0.140 0.116 0.560
#> GSM99585 5 0.5808 0.21249 0.000 0.392 0.000 0.096 0.512
#> GSM99587 1 0.2654 0.86988 0.888 0.000 0.000 0.064 0.048
#> GSM99589 2 0.3398 0.59833 0.000 0.780 0.000 0.004 0.216
#> GSM99591 2 0.3521 0.58571 0.000 0.764 0.000 0.004 0.232
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM99497 3 0.1226 0.81029 0.000 0.000 0.952 0.004 NA 0.004
#> GSM99503 1 0.0458 0.81576 0.984 0.000 0.000 0.000 NA 0.000
#> GSM99505 1 0.3686 0.76939 0.824 0.000 0.068 0.028 NA 0.004
#> GSM99507 3 0.1074 0.80898 0.000 0.000 0.960 0.000 NA 0.012
#> GSM99567 3 0.0551 0.80813 0.000 0.000 0.984 0.004 NA 0.008
#> GSM99575 1 0.0858 0.81435 0.968 0.000 0.000 0.004 NA 0.000
#> GSM99593 3 0.2426 0.80720 0.000 0.000 0.896 0.044 NA 0.012
#> GSM99595 3 0.1536 0.81206 0.000 0.000 0.944 0.020 NA 0.012
#> GSM99469 1 0.2474 0.80233 0.884 0.000 0.000 0.032 NA 0.004
#> GSM99499 1 0.2545 0.81512 0.884 0.000 0.004 0.020 NA 0.008
#> GSM99501 1 0.2398 0.80005 0.888 0.000 0.000 0.028 NA 0.004
#> GSM99509 3 0.1938 0.81122 0.000 0.000 0.920 0.020 NA 0.008
#> GSM99569 3 0.4795 0.74169 0.004 0.000 0.736 0.092 NA 0.040
#> GSM99597 3 0.4793 0.68353 0.004 0.000 0.728 0.140 NA 0.028
#> GSM99601 2 0.2950 0.58194 0.000 0.828 0.000 0.000 NA 0.148
#> GSM99459 1 0.4518 0.69977 0.736 0.000 0.000 0.124 NA 0.016
#> GSM99461 1 0.4372 0.70398 0.740 0.000 0.000 0.128 NA 0.008
#> GSM99511 3 0.5082 0.68657 0.000 0.000 0.696 0.132 NA 0.036
#> GSM99513 3 0.4064 0.76801 0.000 0.000 0.784 0.068 NA 0.028
#> GSM99515 3 0.1409 0.81048 0.000 0.000 0.948 0.008 NA 0.012
#> GSM99517 1 0.1010 0.81770 0.960 0.000 0.000 0.004 NA 0.000
#> GSM99519 1 0.3673 0.75887 0.804 0.000 0.000 0.100 NA 0.008
#> GSM99521 3 0.4087 0.70424 0.000 0.000 0.768 0.156 NA 0.020
#> GSM99523 3 0.4366 0.76735 0.020 0.000 0.784 0.068 NA 0.028
#> GSM99571 1 0.1863 0.81365 0.896 0.000 0.000 0.000 NA 0.000
#> GSM99599 1 0.0865 0.81930 0.964 0.000 0.000 0.000 NA 0.000
#> GSM99433 2 0.6686 0.08055 0.000 0.464 0.000 0.128 NA 0.320
#> GSM99435 3 0.6753 0.00554 0.000 0.000 0.416 0.364 NA 0.080
#> GSM99437 2 0.4564 0.13107 0.000 0.500 0.000 0.008 NA 0.472
#> GSM99439 2 0.1225 0.59414 0.000 0.952 0.000 0.000 NA 0.012
#> GSM99441 1 0.1003 0.82032 0.964 0.000 0.000 0.004 NA 0.004
#> GSM99443 2 0.4139 0.45545 0.000 0.644 0.000 0.008 NA 0.336
#> GSM99445 2 0.3838 0.54001 0.000 0.732 0.000 0.008 NA 0.240
#> GSM99447 2 0.5293 0.35928 0.000 0.620 0.000 0.036 NA 0.280
#> GSM99449 3 0.4295 0.73382 0.000 0.016 0.784 0.024 NA 0.108
#> GSM99451 4 0.5640 0.30212 0.000 0.000 0.308 0.564 NA 0.024
#> GSM99453 1 0.3445 0.76618 0.744 0.000 0.000 0.012 NA 0.000
#> GSM99455 1 0.3368 0.76936 0.756 0.000 0.000 0.012 NA 0.000
#> GSM99457 1 0.4255 0.76177 0.732 0.000 0.000 0.064 NA 0.008
#> GSM99463 2 0.1605 0.60492 0.000 0.936 0.000 0.004 NA 0.044
#> GSM99465 4 0.7662 0.38573 0.256 0.000 0.024 0.392 NA 0.100
#> GSM99467 6 0.4745 0.50247 0.000 0.180 0.004 0.028 NA 0.720
#> GSM99471 1 0.5433 0.60711 0.588 0.004 0.000 0.048 NA 0.040
#> GSM99473 1 0.3310 0.78291 0.816 0.000 0.000 0.020 NA 0.016
#> GSM99475 4 0.4492 0.54181 0.000 0.000 0.196 0.720 NA 0.016
#> GSM99477 6 0.5581 0.50763 0.000 0.124 0.064 0.036 NA 0.700
#> GSM99479 6 0.4420 0.50456 0.000 0.172 0.004 0.020 NA 0.744
#> GSM99481 1 0.0713 0.81949 0.972 0.000 0.000 0.000 NA 0.000
#> GSM99483 1 0.3076 0.77019 0.760 0.000 0.000 0.000 NA 0.000
#> GSM99485 2 0.5402 0.13745 0.000 0.484 0.000 0.020 NA 0.432
#> GSM99487 6 0.4962 -0.20412 0.000 0.460 0.000 0.012 NA 0.488
#> GSM99489 2 0.2163 0.59798 0.000 0.892 0.000 0.000 NA 0.092
#> GSM99491 2 0.4749 0.38953 0.000 0.592 0.000 0.012 NA 0.360
#> GSM99493 1 0.3109 0.79561 0.812 0.000 0.000 0.016 NA 0.004
#> GSM99495 2 0.1341 0.59947 0.000 0.948 0.000 0.000 NA 0.024
#> GSM99525 1 0.2964 0.78269 0.792 0.000 0.000 0.004 NA 0.000
#> GSM99527 4 0.5816 0.50313 0.008 0.012 0.016 0.632 NA 0.148
#> GSM99529 6 0.7219 0.29626 0.004 0.128 0.004 0.220 NA 0.476
#> GSM99531 4 0.6252 0.54436 0.020 0.000 0.184 0.596 NA 0.040
#> GSM99533 4 0.3656 0.57030 0.036 0.000 0.048 0.840 NA 0.024
#> GSM99535 2 0.7245 0.09862 0.076 0.460 0.000 0.020 NA 0.204
#> GSM99537 1 0.3108 0.81317 0.844 0.000 0.000 0.076 NA 0.004
#> GSM99539 2 0.7214 -0.00365 0.000 0.412 0.024 0.332 NA 0.172
#> GSM99541 1 0.5157 0.61887 0.648 0.000 0.000 0.216 NA 0.012
#> GSM99543 2 0.4973 0.47722 0.008 0.716 0.000 0.028 NA 0.100
#> GSM99545 2 0.6077 0.26094 0.000 0.576 0.004 0.264 NA 0.084
#> GSM99547 4 0.8330 0.34461 0.116 0.040 0.016 0.336 NA 0.200
#> GSM99549 2 0.2113 0.58287 0.000 0.908 0.000 0.004 NA 0.028
#> GSM99551 1 0.6900 0.25704 0.420 0.008 0.000 0.220 NA 0.044
#> GSM99553 3 0.3286 0.77872 0.000 0.000 0.848 0.040 NA 0.044
#> GSM99555 2 0.4327 0.47543 0.000 0.688 0.000 0.004 NA 0.260
#> GSM99557 2 0.2750 0.59204 0.000 0.844 0.000 0.000 NA 0.136
#> GSM99559 3 0.6327 0.43709 0.000 0.076 0.604 0.024 NA 0.204
#> GSM99561 2 0.4472 0.53784 0.000 0.764 0.000 0.064 NA 0.100
#> GSM99563 3 0.3513 0.78609 0.000 0.000 0.824 0.056 NA 0.020
#> GSM99565 2 0.4875 0.23756 0.000 0.544 0.000 0.008 NA 0.404
#> GSM99573 2 0.2065 0.58824 0.000 0.912 0.000 0.004 NA 0.032
#> GSM99577 1 0.5805 0.57420 0.548 0.000 0.000 0.176 NA 0.012
#> GSM99579 2 0.5438 0.21990 0.000 0.500 0.000 0.016 NA 0.408
#> GSM99581 3 0.3083 0.80735 0.000 0.000 0.860 0.052 NA 0.028
#> GSM99583 6 0.8518 0.13277 0.080 0.052 0.104 0.096 NA 0.420
#> GSM99585 6 0.5994 0.23657 0.000 0.288 0.000 0.084 NA 0.560
#> GSM99587 1 0.3221 0.78814 0.792 0.000 0.000 0.020 NA 0.000
#> GSM99589 2 0.4309 0.55015 0.000 0.720 0.004 0.016 NA 0.228
#> GSM99591 2 0.3764 0.53170 0.000 0.724 0.000 0.008 NA 0.256
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 disease.state(p) cell.type(p) k
#> MAD:skmeans 71 2.21e-03 0.00742 2
#> MAD:skmeans 84 8.79e-05 0.00274 3
#> MAD:skmeans 75 1.29e-05 0.00149 4
#> MAD:skmeans 67 3.74e-04 0.03610 5
#> MAD:skmeans 62 7.39e-04 0.05509 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 21512 rows and 85 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 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.955 0.971 0.4296 0.580 0.580
#> 3 3 1.000 0.966 0.985 0.5619 0.720 0.529
#> 4 4 0.887 0.868 0.938 0.1235 0.881 0.656
#> 5 5 0.824 0.784 0.879 0.0503 0.957 0.828
#> 6 6 0.828 0.729 0.855 0.0314 0.951 0.776
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
#> GSM99497 2 0.3733 0.945 0.072 0.928
#> GSM99503 1 0.0000 0.995 1.000 0.000
#> GSM99505 1 0.0000 0.995 1.000 0.000
#> GSM99507 2 0.3733 0.945 0.072 0.928
#> GSM99567 2 0.3733 0.945 0.072 0.928
#> GSM99575 1 0.0000 0.995 1.000 0.000
#> GSM99593 2 0.3733 0.945 0.072 0.928
#> GSM99595 2 0.3733 0.945 0.072 0.928
#> GSM99469 1 0.0000 0.995 1.000 0.000
#> GSM99499 1 0.0000 0.995 1.000 0.000
#> GSM99501 1 0.0000 0.995 1.000 0.000
#> GSM99509 2 0.3733 0.945 0.072 0.928
#> GSM99569 2 0.3733 0.945 0.072 0.928
#> GSM99597 2 0.3733 0.945 0.072 0.928
#> GSM99601 2 0.0000 0.960 0.000 1.000
#> GSM99459 1 0.0000 0.995 1.000 0.000
#> GSM99461 1 0.0000 0.995 1.000 0.000
#> GSM99511 2 0.3879 0.942 0.076 0.924
#> GSM99513 2 0.3879 0.942 0.076 0.924
#> GSM99515 2 0.3879 0.942 0.076 0.924
#> GSM99517 1 0.0000 0.995 1.000 0.000
#> GSM99519 1 0.0000 0.995 1.000 0.000
#> GSM99521 2 0.3733 0.945 0.072 0.928
#> GSM99523 2 0.6801 0.833 0.180 0.820
#> GSM99571 1 0.0000 0.995 1.000 0.000
#> GSM99599 1 0.0000 0.995 1.000 0.000
#> GSM99433 2 0.0000 0.960 0.000 1.000
#> GSM99435 2 0.3733 0.945 0.072 0.928
#> GSM99437 2 0.0000 0.960 0.000 1.000
#> GSM99439 2 0.0000 0.960 0.000 1.000
#> GSM99441 1 0.0000 0.995 1.000 0.000
#> GSM99443 2 0.0000 0.960 0.000 1.000
#> GSM99445 2 0.0000 0.960 0.000 1.000
#> GSM99447 2 0.0000 0.960 0.000 1.000
#> GSM99449 2 0.0000 0.960 0.000 1.000
#> GSM99451 2 0.3733 0.945 0.072 0.928
#> GSM99453 1 0.0000 0.995 1.000 0.000
#> GSM99455 1 0.0000 0.995 1.000 0.000
#> GSM99457 1 0.0000 0.995 1.000 0.000
#> GSM99463 2 0.0000 0.960 0.000 1.000
#> GSM99465 2 0.3584 0.946 0.068 0.932
#> GSM99467 2 0.0000 0.960 0.000 1.000
#> GSM99471 2 0.9850 0.338 0.428 0.572
#> GSM99473 1 0.5737 0.850 0.864 0.136
#> GSM99475 2 0.3733 0.945 0.072 0.928
#> GSM99477 2 0.0000 0.960 0.000 1.000
#> GSM99479 2 0.0000 0.960 0.000 1.000
#> GSM99481 1 0.0000 0.995 1.000 0.000
#> GSM99483 1 0.0000 0.995 1.000 0.000
#> GSM99485 2 0.0000 0.960 0.000 1.000
#> GSM99487 2 0.0000 0.960 0.000 1.000
#> GSM99489 2 0.0000 0.960 0.000 1.000
#> GSM99491 2 0.0000 0.960 0.000 1.000
#> GSM99493 1 0.0000 0.995 1.000 0.000
#> GSM99495 2 0.0000 0.960 0.000 1.000
#> GSM99525 1 0.0000 0.995 1.000 0.000
#> GSM99527 2 0.1184 0.957 0.016 0.984
#> GSM99529 2 0.0000 0.960 0.000 1.000
#> GSM99531 2 0.3733 0.945 0.072 0.928
#> GSM99533 2 0.3733 0.945 0.072 0.928
#> GSM99535 2 0.0000 0.960 0.000 1.000
#> GSM99537 1 0.0000 0.995 1.000 0.000
#> GSM99539 2 0.0000 0.960 0.000 1.000
#> GSM99541 1 0.0000 0.995 1.000 0.000
#> GSM99543 2 0.0938 0.957 0.012 0.988
#> GSM99545 2 0.0000 0.960 0.000 1.000
#> GSM99547 2 0.0672 0.959 0.008 0.992
#> GSM99549 2 0.0000 0.960 0.000 1.000
#> GSM99551 2 0.4431 0.930 0.092 0.908
#> GSM99553 2 0.3733 0.945 0.072 0.928
#> GSM99555 2 0.0000 0.960 0.000 1.000
#> GSM99557 2 0.0000 0.960 0.000 1.000
#> GSM99559 2 0.0376 0.959 0.004 0.996
#> GSM99561 2 0.0000 0.960 0.000 1.000
#> GSM99563 2 0.4690 0.923 0.100 0.900
#> GSM99565 2 0.0000 0.960 0.000 1.000
#> GSM99573 2 0.0000 0.960 0.000 1.000
#> GSM99577 1 0.0000 0.995 1.000 0.000
#> GSM99579 2 0.0000 0.960 0.000 1.000
#> GSM99581 2 0.3733 0.945 0.072 0.928
#> GSM99583 2 0.3733 0.945 0.072 0.928
#> GSM99585 2 0.0000 0.960 0.000 1.000
#> GSM99587 1 0.0000 0.995 1.000 0.000
#> GSM99589 2 0.0000 0.960 0.000 1.000
#> GSM99591 2 0.0000 0.960 0.000 1.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM99497 3 0.0000 0.979 0.000 0.000 1.000
#> GSM99503 1 0.0000 0.972 1.000 0.000 0.000
#> GSM99505 1 0.6008 0.419 0.628 0.000 0.372
#> GSM99507 3 0.0000 0.979 0.000 0.000 1.000
#> GSM99567 3 0.0000 0.979 0.000 0.000 1.000
#> GSM99575 1 0.0000 0.972 1.000 0.000 0.000
#> GSM99593 3 0.0000 0.979 0.000 0.000 1.000
#> GSM99595 3 0.0000 0.979 0.000 0.000 1.000
#> GSM99469 1 0.0000 0.972 1.000 0.000 0.000
#> GSM99499 1 0.5706 0.535 0.680 0.000 0.320
#> GSM99501 1 0.0000 0.972 1.000 0.000 0.000
#> GSM99509 3 0.0000 0.979 0.000 0.000 1.000
#> GSM99569 3 0.0000 0.979 0.000 0.000 1.000
#> GSM99597 3 0.0000 0.979 0.000 0.000 1.000
#> GSM99601 2 0.0000 0.998 0.000 1.000 0.000
#> GSM99459 1 0.0000 0.972 1.000 0.000 0.000
#> GSM99461 1 0.0000 0.972 1.000 0.000 0.000
#> GSM99511 3 0.0000 0.979 0.000 0.000 1.000
#> GSM99513 3 0.0000 0.979 0.000 0.000 1.000
#> GSM99515 3 0.0000 0.979 0.000 0.000 1.000
#> GSM99517 1 0.0000 0.972 1.000 0.000 0.000
#> GSM99519 1 0.0000 0.972 1.000 0.000 0.000
#> GSM99521 3 0.0000 0.979 0.000 0.000 1.000
#> GSM99523 3 0.0237 0.977 0.004 0.000 0.996
#> GSM99571 1 0.0000 0.972 1.000 0.000 0.000
#> GSM99599 1 0.0000 0.972 1.000 0.000 0.000
#> GSM99433 2 0.0000 0.998 0.000 1.000 0.000
#> GSM99435 3 0.0237 0.977 0.000 0.004 0.996
#> GSM99437 2 0.0000 0.998 0.000 1.000 0.000
#> GSM99439 2 0.0000 0.998 0.000 1.000 0.000
#> GSM99441 1 0.0000 0.972 1.000 0.000 0.000
#> GSM99443 2 0.0000 0.998 0.000 1.000 0.000
#> GSM99445 2 0.0000 0.998 0.000 1.000 0.000
#> GSM99447 2 0.0000 0.998 0.000 1.000 0.000
#> GSM99449 3 0.1964 0.932 0.000 0.056 0.944
#> GSM99451 3 0.0237 0.977 0.000 0.004 0.996
#> GSM99453 1 0.0000 0.972 1.000 0.000 0.000
#> GSM99455 1 0.0000 0.972 1.000 0.000 0.000
#> GSM99457 1 0.0000 0.972 1.000 0.000 0.000
#> GSM99463 2 0.0000 0.998 0.000 1.000 0.000
#> GSM99465 3 0.5610 0.749 0.028 0.196 0.776
#> GSM99467 2 0.0000 0.998 0.000 1.000 0.000
#> GSM99471 1 0.0237 0.968 0.996 0.004 0.000
#> GSM99473 1 0.0000 0.972 1.000 0.000 0.000
#> GSM99475 3 0.0000 0.979 0.000 0.000 1.000
#> GSM99477 2 0.0000 0.998 0.000 1.000 0.000
#> GSM99479 2 0.0000 0.998 0.000 1.000 0.000
#> GSM99481 1 0.0000 0.972 1.000 0.000 0.000
#> GSM99483 1 0.0000 0.972 1.000 0.000 0.000
#> GSM99485 2 0.0000 0.998 0.000 1.000 0.000
#> GSM99487 2 0.0000 0.998 0.000 1.000 0.000
#> GSM99489 2 0.0000 0.998 0.000 1.000 0.000
#> GSM99491 2 0.0000 0.998 0.000 1.000 0.000
#> GSM99493 1 0.0000 0.972 1.000 0.000 0.000
#> GSM99495 2 0.0000 0.998 0.000 1.000 0.000
#> GSM99525 1 0.0000 0.972 1.000 0.000 0.000
#> GSM99527 2 0.1015 0.983 0.008 0.980 0.012
#> GSM99529 3 0.4062 0.813 0.000 0.164 0.836
#> GSM99531 3 0.0237 0.977 0.000 0.004 0.996
#> GSM99533 3 0.1267 0.959 0.024 0.004 0.972
#> GSM99535 2 0.0000 0.998 0.000 1.000 0.000
#> GSM99537 1 0.0000 0.972 1.000 0.000 0.000
#> GSM99539 2 0.0000 0.998 0.000 1.000 0.000
#> GSM99541 1 0.0000 0.972 1.000 0.000 0.000
#> GSM99543 2 0.0747 0.984 0.016 0.984 0.000
#> GSM99545 2 0.0000 0.998 0.000 1.000 0.000
#> GSM99547 2 0.0592 0.988 0.012 0.988 0.000
#> GSM99549 2 0.0000 0.998 0.000 1.000 0.000
#> GSM99551 1 0.0592 0.961 0.988 0.012 0.000
#> GSM99553 3 0.0000 0.979 0.000 0.000 1.000
#> GSM99555 2 0.0000 0.998 0.000 1.000 0.000
#> GSM99557 2 0.0000 0.998 0.000 1.000 0.000
#> GSM99559 3 0.0000 0.979 0.000 0.000 1.000
#> GSM99561 2 0.0000 0.998 0.000 1.000 0.000
#> GSM99563 3 0.0000 0.979 0.000 0.000 1.000
#> GSM99565 2 0.0000 0.998 0.000 1.000 0.000
#> GSM99573 2 0.0000 0.998 0.000 1.000 0.000
#> GSM99577 1 0.0000 0.972 1.000 0.000 0.000
#> GSM99579 2 0.0000 0.998 0.000 1.000 0.000
#> GSM99581 3 0.0000 0.979 0.000 0.000 1.000
#> GSM99583 3 0.0237 0.977 0.000 0.004 0.996
#> GSM99585 2 0.0000 0.998 0.000 1.000 0.000
#> GSM99587 1 0.0000 0.972 1.000 0.000 0.000
#> GSM99589 2 0.0892 0.979 0.000 0.980 0.020
#> GSM99591 2 0.0000 0.998 0.000 1.000 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM99497 3 0.0000 0.923 0.000 0.000 1.000 0.000
#> GSM99503 1 0.0000 0.951 1.000 0.000 0.000 0.000
#> GSM99505 1 0.4761 0.423 0.628 0.000 0.372 0.000
#> GSM99507 3 0.0000 0.923 0.000 0.000 1.000 0.000
#> GSM99567 3 0.0000 0.923 0.000 0.000 1.000 0.000
#> GSM99575 1 0.0000 0.951 1.000 0.000 0.000 0.000
#> GSM99593 3 0.0000 0.923 0.000 0.000 1.000 0.000
#> GSM99595 3 0.0000 0.923 0.000 0.000 1.000 0.000
#> GSM99469 1 0.0000 0.951 1.000 0.000 0.000 0.000
#> GSM99499 1 0.4522 0.538 0.680 0.000 0.320 0.000
#> GSM99501 1 0.0000 0.951 1.000 0.000 0.000 0.000
#> GSM99509 3 0.0000 0.923 0.000 0.000 1.000 0.000
#> GSM99569 3 0.0000 0.923 0.000 0.000 1.000 0.000
#> GSM99597 3 0.0000 0.923 0.000 0.000 1.000 0.000
#> GSM99601 2 0.0000 0.936 0.000 1.000 0.000 0.000
#> GSM99459 1 0.1302 0.935 0.956 0.000 0.000 0.044
#> GSM99461 1 0.1302 0.935 0.956 0.000 0.000 0.044
#> GSM99511 3 0.0000 0.923 0.000 0.000 1.000 0.000
#> GSM99513 3 0.0000 0.923 0.000 0.000 1.000 0.000
#> GSM99515 3 0.0000 0.923 0.000 0.000 1.000 0.000
#> GSM99517 1 0.0000 0.951 1.000 0.000 0.000 0.000
#> GSM99519 1 0.1302 0.935 0.956 0.000 0.000 0.044
#> GSM99521 3 0.0188 0.922 0.000 0.000 0.996 0.004
#> GSM99523 3 0.0336 0.918 0.008 0.000 0.992 0.000
#> GSM99571 1 0.0000 0.951 1.000 0.000 0.000 0.000
#> GSM99599 1 0.0000 0.951 1.000 0.000 0.000 0.000
#> GSM99433 2 0.0336 0.934 0.000 0.992 0.000 0.008
#> GSM99435 3 0.4304 0.637 0.000 0.000 0.716 0.284
#> GSM99437 2 0.0000 0.936 0.000 1.000 0.000 0.000
#> GSM99439 2 0.0000 0.936 0.000 1.000 0.000 0.000
#> GSM99441 1 0.0000 0.951 1.000 0.000 0.000 0.000
#> GSM99443 2 0.0000 0.936 0.000 1.000 0.000 0.000
#> GSM99445 2 0.0000 0.936 0.000 1.000 0.000 0.000
#> GSM99447 2 0.4624 0.481 0.000 0.660 0.000 0.340
#> GSM99449 3 0.1557 0.881 0.000 0.056 0.944 0.000
#> GSM99451 3 0.4790 0.467 0.000 0.000 0.620 0.380
#> GSM99453 1 0.0000 0.951 1.000 0.000 0.000 0.000
#> GSM99455 1 0.0000 0.951 1.000 0.000 0.000 0.000
#> GSM99457 1 0.1302 0.935 0.956 0.000 0.000 0.044
#> GSM99463 2 0.2011 0.886 0.000 0.920 0.000 0.080
#> GSM99465 4 0.0000 0.896 0.000 0.000 0.000 1.000
#> GSM99467 4 0.1302 0.906 0.000 0.044 0.000 0.956
#> GSM99471 4 0.4855 0.302 0.400 0.000 0.000 0.600
#> GSM99473 1 0.2921 0.822 0.860 0.000 0.000 0.140
#> GSM99475 3 0.4888 0.341 0.000 0.000 0.588 0.412
#> GSM99477 4 0.1302 0.906 0.000 0.044 0.000 0.956
#> GSM99479 4 0.1302 0.906 0.000 0.044 0.000 0.956
#> GSM99481 1 0.0000 0.951 1.000 0.000 0.000 0.000
#> GSM99483 1 0.0000 0.951 1.000 0.000 0.000 0.000
#> GSM99485 4 0.1302 0.906 0.000 0.044 0.000 0.956
#> GSM99487 2 0.0000 0.936 0.000 1.000 0.000 0.000
#> GSM99489 2 0.0000 0.936 0.000 1.000 0.000 0.000
#> GSM99491 2 0.1118 0.920 0.000 0.964 0.000 0.036
#> GSM99493 1 0.0000 0.951 1.000 0.000 0.000 0.000
#> GSM99495 2 0.0000 0.936 0.000 1.000 0.000 0.000
#> GSM99525 1 0.0000 0.951 1.000 0.000 0.000 0.000
#> GSM99527 4 0.3266 0.766 0.000 0.168 0.000 0.832
#> GSM99529 4 0.1398 0.889 0.000 0.004 0.040 0.956
#> GSM99531 3 0.3123 0.803 0.000 0.000 0.844 0.156
#> GSM99533 4 0.0817 0.888 0.000 0.000 0.024 0.976
#> GSM99535 4 0.4624 0.483 0.000 0.340 0.000 0.660
#> GSM99537 1 0.0188 0.950 0.996 0.000 0.000 0.004
#> GSM99539 2 0.3172 0.802 0.000 0.840 0.000 0.160
#> GSM99541 1 0.1302 0.935 0.956 0.000 0.000 0.044
#> GSM99543 4 0.1302 0.906 0.000 0.044 0.000 0.956
#> GSM99545 2 0.0000 0.936 0.000 1.000 0.000 0.000
#> GSM99547 4 0.0000 0.896 0.000 0.000 0.000 1.000
#> GSM99549 2 0.0592 0.931 0.000 0.984 0.000 0.016
#> GSM99551 4 0.0469 0.893 0.012 0.000 0.000 0.988
#> GSM99553 3 0.0188 0.922 0.000 0.000 0.996 0.004
#> GSM99555 2 0.0000 0.936 0.000 1.000 0.000 0.000
#> GSM99557 2 0.4382 0.595 0.000 0.704 0.000 0.296
#> GSM99559 3 0.3873 0.697 0.000 0.000 0.772 0.228
#> GSM99561 2 0.1022 0.923 0.000 0.968 0.000 0.032
#> GSM99563 3 0.0000 0.923 0.000 0.000 1.000 0.000
#> GSM99565 2 0.0000 0.936 0.000 1.000 0.000 0.000
#> GSM99573 2 0.1022 0.923 0.000 0.968 0.000 0.032
#> GSM99577 1 0.1302 0.935 0.956 0.000 0.000 0.044
#> GSM99579 4 0.1302 0.906 0.000 0.044 0.000 0.956
#> GSM99581 3 0.0188 0.922 0.000 0.000 0.996 0.004
#> GSM99583 4 0.1302 0.885 0.000 0.000 0.044 0.956
#> GSM99585 2 0.3907 0.706 0.000 0.768 0.000 0.232
#> GSM99587 1 0.0000 0.951 1.000 0.000 0.000 0.000
#> GSM99589 4 0.2011 0.882 0.000 0.080 0.000 0.920
#> GSM99591 2 0.0000 0.936 0.000 1.000 0.000 0.000
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM99497 3 0.0000 0.908 0.000 0.000 1.000 0.000 0.000
#> GSM99503 1 0.0000 0.903 1.000 0.000 0.000 0.000 0.000
#> GSM99505 1 0.4470 0.322 0.616 0.000 0.372 0.000 0.012
#> GSM99507 3 0.0000 0.908 0.000 0.000 1.000 0.000 0.000
#> GSM99567 3 0.0000 0.908 0.000 0.000 1.000 0.000 0.000
#> GSM99575 1 0.0000 0.903 1.000 0.000 0.000 0.000 0.000
#> GSM99593 3 0.0000 0.908 0.000 0.000 1.000 0.000 0.000
#> GSM99595 3 0.0000 0.908 0.000 0.000 1.000 0.000 0.000
#> GSM99469 1 0.1197 0.859 0.952 0.000 0.000 0.000 0.048
#> GSM99499 1 0.4165 0.416 0.672 0.000 0.320 0.000 0.008
#> GSM99501 1 0.0162 0.900 0.996 0.000 0.000 0.000 0.004
#> GSM99509 3 0.0000 0.908 0.000 0.000 1.000 0.000 0.000
#> GSM99569 3 0.0000 0.908 0.000 0.000 1.000 0.000 0.000
#> GSM99597 3 0.0000 0.908 0.000 0.000 1.000 0.000 0.000
#> GSM99601 2 0.1410 0.855 0.000 0.940 0.000 0.000 0.060
#> GSM99459 5 0.3876 0.798 0.316 0.000 0.000 0.000 0.684
#> GSM99461 5 0.3857 0.801 0.312 0.000 0.000 0.000 0.688
#> GSM99511 3 0.0000 0.908 0.000 0.000 1.000 0.000 0.000
#> GSM99513 3 0.0000 0.908 0.000 0.000 1.000 0.000 0.000
#> GSM99515 3 0.0000 0.908 0.000 0.000 1.000 0.000 0.000
#> GSM99517 1 0.0000 0.903 1.000 0.000 0.000 0.000 0.000
#> GSM99519 5 0.3983 0.776 0.340 0.000 0.000 0.000 0.660
#> GSM99521 3 0.0162 0.907 0.000 0.000 0.996 0.004 0.000
#> GSM99523 3 0.0451 0.901 0.008 0.000 0.988 0.000 0.004
#> GSM99571 1 0.0000 0.903 1.000 0.000 0.000 0.000 0.000
#> GSM99599 1 0.0000 0.903 1.000 0.000 0.000 0.000 0.000
#> GSM99433 2 0.0451 0.856 0.000 0.988 0.000 0.008 0.004
#> GSM99435 3 0.3707 0.625 0.000 0.000 0.716 0.284 0.000
#> GSM99437 2 0.0000 0.855 0.000 1.000 0.000 0.000 0.000
#> GSM99439 2 0.3715 0.815 0.000 0.736 0.000 0.004 0.260
#> GSM99441 1 0.0000 0.903 1.000 0.000 0.000 0.000 0.000
#> GSM99443 2 0.0000 0.855 0.000 1.000 0.000 0.000 0.000
#> GSM99445 2 0.0290 0.856 0.000 0.992 0.000 0.000 0.008
#> GSM99447 2 0.4196 0.402 0.000 0.640 0.000 0.356 0.004
#> GSM99449 3 0.1341 0.868 0.000 0.056 0.944 0.000 0.000
#> GSM99451 3 0.6809 -0.064 0.000 0.000 0.364 0.304 0.332
#> GSM99453 1 0.0162 0.900 0.996 0.000 0.000 0.000 0.004
#> GSM99455 1 0.0000 0.903 1.000 0.000 0.000 0.000 0.000
#> GSM99457 5 0.3983 0.778 0.340 0.000 0.000 0.000 0.660
#> GSM99463 2 0.4301 0.807 0.000 0.712 0.000 0.028 0.260
#> GSM99465 5 0.3857 0.407 0.000 0.000 0.000 0.312 0.688
#> GSM99467 4 0.0162 0.868 0.000 0.004 0.000 0.996 0.000
#> GSM99471 4 0.5626 0.197 0.336 0.000 0.000 0.572 0.092
#> GSM99473 1 0.4334 0.593 0.768 0.000 0.000 0.092 0.140
#> GSM99475 3 0.5396 0.329 0.000 0.000 0.560 0.376 0.064
#> GSM99477 4 0.0162 0.868 0.000 0.004 0.000 0.996 0.000
#> GSM99479 4 0.0162 0.868 0.000 0.004 0.000 0.996 0.000
#> GSM99481 1 0.0000 0.903 1.000 0.000 0.000 0.000 0.000
#> GSM99483 1 0.0162 0.900 0.996 0.000 0.000 0.000 0.004
#> GSM99485 4 0.0000 0.868 0.000 0.000 0.000 1.000 0.000
#> GSM99487 2 0.0000 0.855 0.000 1.000 0.000 0.000 0.000
#> GSM99489 2 0.3491 0.827 0.000 0.768 0.000 0.004 0.228
#> GSM99491 2 0.0963 0.849 0.000 0.964 0.000 0.036 0.000
#> GSM99493 1 0.0000 0.903 1.000 0.000 0.000 0.000 0.000
#> GSM99495 2 0.3715 0.815 0.000 0.736 0.000 0.004 0.260
#> GSM99525 1 0.0000 0.903 1.000 0.000 0.000 0.000 0.000
#> GSM99527 5 0.4693 0.465 0.000 0.056 0.000 0.244 0.700
#> GSM99529 4 0.0000 0.868 0.000 0.000 0.000 1.000 0.000
#> GSM99531 3 0.3846 0.761 0.000 0.000 0.800 0.144 0.056
#> GSM99533 4 0.4403 0.215 0.000 0.000 0.004 0.560 0.436
#> GSM99535 4 0.4118 0.410 0.000 0.336 0.000 0.660 0.004
#> GSM99537 1 0.2773 0.711 0.836 0.000 0.000 0.000 0.164
#> GSM99539 2 0.2690 0.759 0.000 0.844 0.000 0.156 0.000
#> GSM99541 5 0.3636 0.796 0.272 0.000 0.000 0.000 0.728
#> GSM99543 4 0.1908 0.812 0.000 0.000 0.000 0.908 0.092
#> GSM99545 2 0.3561 0.817 0.000 0.740 0.000 0.000 0.260
#> GSM99547 4 0.0703 0.859 0.000 0.000 0.000 0.976 0.024
#> GSM99549 2 0.4040 0.813 0.000 0.724 0.000 0.016 0.260
#> GSM99551 4 0.1502 0.842 0.004 0.000 0.000 0.940 0.056
#> GSM99553 3 0.0162 0.907 0.000 0.000 0.996 0.004 0.000
#> GSM99555 2 0.0000 0.855 0.000 1.000 0.000 0.000 0.000
#> GSM99557 2 0.3774 0.602 0.000 0.704 0.000 0.296 0.000
#> GSM99559 3 0.3366 0.681 0.000 0.000 0.768 0.232 0.000
#> GSM99561 2 0.3496 0.833 0.000 0.788 0.000 0.012 0.200
#> GSM99563 3 0.0000 0.908 0.000 0.000 1.000 0.000 0.000
#> GSM99565 2 0.0000 0.855 0.000 1.000 0.000 0.000 0.000
#> GSM99573 2 0.4132 0.811 0.000 0.720 0.000 0.020 0.260
#> GSM99577 5 0.3774 0.789 0.296 0.000 0.000 0.000 0.704
#> GSM99579 4 0.0162 0.868 0.000 0.004 0.000 0.996 0.000
#> GSM99581 3 0.0162 0.907 0.000 0.000 0.996 0.004 0.000
#> GSM99583 4 0.0162 0.867 0.000 0.000 0.004 0.996 0.000
#> GSM99585 2 0.3480 0.657 0.000 0.752 0.000 0.248 0.000
#> GSM99587 1 0.0000 0.903 1.000 0.000 0.000 0.000 0.000
#> GSM99589 4 0.1043 0.850 0.000 0.040 0.000 0.960 0.000
#> GSM99591 2 0.0000 0.855 0.000 1.000 0.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
#> GSM99497 3 0.0000 0.917 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM99503 1 0.0000 0.905 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99505 1 0.4573 0.392 0.584 0.000 0.372 0.044 0.000 0.000
#> GSM99507 3 0.0000 0.917 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM99567 3 0.0000 0.917 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM99575 1 0.0000 0.905 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99593 3 0.0000 0.917 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM99595 3 0.0000 0.917 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM99469 1 0.2092 0.808 0.876 0.000 0.000 0.124 0.000 0.000
#> GSM99499 1 0.4078 0.503 0.656 0.000 0.320 0.024 0.000 0.000
#> GSM99501 1 0.0547 0.894 0.980 0.000 0.000 0.020 0.000 0.000
#> GSM99509 3 0.0000 0.917 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM99569 3 0.0000 0.917 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM99597 3 0.0000 0.917 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM99601 2 0.3860 0.424 0.000 0.528 0.000 0.000 0.472 0.000
#> GSM99459 4 0.1663 0.886 0.088 0.000 0.000 0.912 0.000 0.000
#> GSM99461 4 0.1765 0.887 0.096 0.000 0.000 0.904 0.000 0.000
#> GSM99511 3 0.0260 0.915 0.000 0.008 0.992 0.000 0.000 0.000
#> GSM99513 3 0.0260 0.915 0.000 0.008 0.992 0.000 0.000 0.000
#> GSM99515 3 0.0000 0.917 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM99517 1 0.0000 0.905 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99519 4 0.2730 0.804 0.192 0.000 0.000 0.808 0.000 0.000
#> GSM99521 3 0.0291 0.915 0.000 0.004 0.992 0.000 0.000 0.004
#> GSM99523 3 0.0976 0.902 0.008 0.008 0.968 0.016 0.000 0.000
#> GSM99571 1 0.0000 0.905 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99599 1 0.0000 0.905 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99433 2 0.3993 0.561 0.000 0.592 0.000 0.000 0.400 0.008
#> GSM99435 3 0.3690 0.606 0.000 0.012 0.700 0.000 0.000 0.288
#> GSM99437 2 0.3737 0.570 0.000 0.608 0.000 0.000 0.392 0.000
#> GSM99439 5 0.0865 0.841 0.000 0.036 0.000 0.000 0.964 0.000
#> GSM99441 1 0.0000 0.905 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99443 2 0.3737 0.570 0.000 0.608 0.000 0.000 0.392 0.000
#> GSM99445 2 0.3765 0.557 0.000 0.596 0.000 0.000 0.404 0.000
#> GSM99447 2 0.5697 0.267 0.000 0.476 0.000 0.000 0.168 0.356
#> GSM99449 3 0.1267 0.878 0.000 0.060 0.940 0.000 0.000 0.000
#> GSM99451 3 0.7366 -0.143 0.000 0.108 0.328 0.276 0.000 0.288
#> GSM99453 1 0.0260 0.901 0.992 0.000 0.000 0.008 0.000 0.000
#> GSM99455 1 0.0000 0.905 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99457 4 0.2135 0.876 0.128 0.000 0.000 0.872 0.000 0.000
#> GSM99463 5 0.0146 0.851 0.000 0.004 0.000 0.000 0.996 0.000
#> GSM99465 4 0.1663 0.844 0.000 0.000 0.000 0.912 0.000 0.088
#> GSM99467 6 0.0000 0.888 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM99471 6 0.5791 0.322 0.252 0.004 0.000 0.216 0.000 0.528
#> GSM99473 1 0.4127 0.647 0.740 0.000 0.000 0.172 0.000 0.088
#> GSM99475 2 0.6881 -0.325 0.000 0.392 0.368 0.084 0.000 0.156
#> GSM99477 6 0.0000 0.888 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM99479 6 0.0000 0.888 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM99481 1 0.0000 0.905 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99483 1 0.0260 0.901 0.992 0.000 0.000 0.008 0.000 0.000
#> GSM99485 6 0.0000 0.888 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM99487 2 0.3737 0.570 0.000 0.608 0.000 0.000 0.392 0.000
#> GSM99489 5 0.2854 0.574 0.000 0.208 0.000 0.000 0.792 0.000
#> GSM99491 2 0.4500 0.547 0.000 0.572 0.000 0.000 0.392 0.036
#> GSM99493 1 0.0000 0.905 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99495 5 0.0000 0.850 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM99525 1 0.0146 0.903 0.996 0.000 0.000 0.004 0.000 0.000
#> GSM99527 4 0.1411 0.855 0.000 0.004 0.000 0.936 0.000 0.060
#> GSM99529 6 0.0000 0.888 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM99531 3 0.5561 0.615 0.000 0.128 0.668 0.088 0.000 0.116
#> GSM99533 2 0.6169 -0.450 0.000 0.392 0.004 0.348 0.000 0.256
#> GSM99535 6 0.5065 0.423 0.000 0.196 0.000 0.012 0.128 0.664
#> GSM99537 1 0.4162 0.646 0.744 0.120 0.000 0.136 0.000 0.000
#> GSM99539 2 0.5453 0.454 0.000 0.556 0.000 0.000 0.284 0.160
#> GSM99541 4 0.2815 0.833 0.032 0.120 0.000 0.848 0.000 0.000
#> GSM99543 6 0.4120 0.695 0.000 0.000 0.000 0.068 0.204 0.728
#> GSM99545 5 0.1501 0.824 0.000 0.076 0.000 0.000 0.924 0.000
#> GSM99547 6 0.0713 0.874 0.000 0.000 0.000 0.028 0.000 0.972
#> GSM99549 5 0.0260 0.842 0.000 0.000 0.000 0.000 0.992 0.008
#> GSM99551 6 0.2048 0.822 0.000 0.000 0.000 0.120 0.000 0.880
#> GSM99553 3 0.0146 0.915 0.000 0.000 0.996 0.000 0.000 0.004
#> GSM99555 2 0.3737 0.570 0.000 0.608 0.000 0.000 0.392 0.000
#> GSM99557 2 0.6104 0.245 0.000 0.372 0.000 0.000 0.336 0.292
#> GSM99559 3 0.2996 0.677 0.000 0.000 0.772 0.000 0.000 0.228
#> GSM99561 5 0.3584 0.307 0.000 0.308 0.000 0.000 0.688 0.004
#> GSM99563 3 0.0260 0.915 0.000 0.008 0.992 0.000 0.000 0.000
#> GSM99565 2 0.3737 0.570 0.000 0.608 0.000 0.000 0.392 0.000
#> GSM99573 5 0.0000 0.850 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM99577 4 0.3088 0.830 0.048 0.120 0.000 0.832 0.000 0.000
#> GSM99579 6 0.0000 0.888 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM99581 3 0.0405 0.914 0.000 0.008 0.988 0.000 0.000 0.004
#> GSM99583 6 0.0000 0.888 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM99585 2 0.5919 0.364 0.000 0.464 0.000 0.000 0.288 0.248
#> GSM99587 1 0.0000 0.905 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99589 6 0.0865 0.869 0.000 0.036 0.000 0.000 0.000 0.964
#> GSM99591 2 0.3737 0.570 0.000 0.608 0.000 0.000 0.392 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 disease.state(p) cell.type(p) k
#> MAD:pam 84 5.21e-02 0.136642 2
#> MAD:pam 84 1.29e-04 0.002434 3
#> MAD:pam 79 9.46e-06 0.000695 4
#> MAD:pam 75 8.38e-05 0.001914 5
#> MAD:pam 73 2.43e-04 0.012672 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 21512 rows and 85 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'MAD' method.
#> Subgroups are detected by 'mclust' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 5.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 1.000 0.940 0.969 0.3687 0.624 0.624
#> 3 3 0.969 0.961 0.982 0.8092 0.687 0.507
#> 4 4 0.826 0.857 0.903 0.0650 0.938 0.818
#> 5 5 0.936 0.914 0.952 0.0884 0.888 0.644
#> 6 6 0.898 0.805 0.910 0.0393 0.961 0.836
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 5
#> attr(,"optional")
#> [1] 2 3
There is also optional best \(k\) = 2 3 that is worth to check.
Following shows the table of the partitions (You need to click the show/hide
code output link to see it). The membership matrix (columns with name p*
)
is inferred by
clue::cl_consensus()
function with the SE
method. Basically the value in the membership matrix
represents the probability to belong to a certain group. The finall class
label for an item is determined with the group with highest probability it
belongs to.
In get_classes()
function, the entropy is calculated from the membership
matrix and the silhouette score is calculated from the consensus matrix.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> GSM99497 1 0.0000 0.935 1.000 0.000
#> GSM99503 2 0.0000 0.976 0.000 1.000
#> GSM99505 2 0.0000 0.976 0.000 1.000
#> GSM99507 1 0.0000 0.935 1.000 0.000
#> GSM99567 1 0.0000 0.935 1.000 0.000
#> GSM99575 2 0.0000 0.976 0.000 1.000
#> GSM99593 1 0.0000 0.935 1.000 0.000
#> GSM99595 1 0.0000 0.935 1.000 0.000
#> GSM99469 2 0.0000 0.976 0.000 1.000
#> GSM99499 2 0.0000 0.976 0.000 1.000
#> GSM99501 2 0.0000 0.976 0.000 1.000
#> GSM99509 1 0.0000 0.935 1.000 0.000
#> GSM99569 1 0.0672 0.932 0.992 0.008
#> GSM99597 1 0.0000 0.935 1.000 0.000
#> GSM99601 2 0.2043 0.976 0.032 0.968
#> GSM99459 2 0.0000 0.976 0.000 1.000
#> GSM99461 2 0.0000 0.976 0.000 1.000
#> GSM99511 1 0.0000 0.935 1.000 0.000
#> GSM99513 1 0.0000 0.935 1.000 0.000
#> GSM99515 1 0.0000 0.935 1.000 0.000
#> GSM99517 2 0.0000 0.976 0.000 1.000
#> GSM99519 2 0.0000 0.976 0.000 1.000
#> GSM99521 1 0.0000 0.935 1.000 0.000
#> GSM99523 1 0.9358 0.481 0.648 0.352
#> GSM99571 2 0.0000 0.976 0.000 1.000
#> GSM99599 2 0.0000 0.976 0.000 1.000
#> GSM99433 2 0.2043 0.976 0.032 0.968
#> GSM99435 1 0.0000 0.935 1.000 0.000
#> GSM99437 2 0.2043 0.976 0.032 0.968
#> GSM99439 2 0.2043 0.976 0.032 0.968
#> GSM99441 2 0.0000 0.976 0.000 1.000
#> GSM99443 2 0.2043 0.976 0.032 0.968
#> GSM99445 2 0.2043 0.976 0.032 0.968
#> GSM99447 2 0.2043 0.976 0.032 0.968
#> GSM99449 1 0.9358 0.479 0.648 0.352
#> GSM99451 1 0.0672 0.932 0.992 0.008
#> GSM99453 2 0.0000 0.976 0.000 1.000
#> GSM99455 2 0.0000 0.976 0.000 1.000
#> GSM99457 2 0.0000 0.976 0.000 1.000
#> GSM99463 2 0.2043 0.976 0.032 0.968
#> GSM99465 2 0.0376 0.976 0.004 0.996
#> GSM99467 2 0.2043 0.976 0.032 0.968
#> GSM99471 2 0.0000 0.976 0.000 1.000
#> GSM99473 2 0.0000 0.976 0.000 1.000
#> GSM99475 1 0.2603 0.906 0.956 0.044
#> GSM99477 2 0.2043 0.976 0.032 0.968
#> GSM99479 2 0.2043 0.976 0.032 0.968
#> GSM99481 2 0.0000 0.976 0.000 1.000
#> GSM99483 2 0.0000 0.976 0.000 1.000
#> GSM99485 2 0.2043 0.976 0.032 0.968
#> GSM99487 2 0.2043 0.976 0.032 0.968
#> GSM99489 2 0.2043 0.976 0.032 0.968
#> GSM99491 2 0.2043 0.976 0.032 0.968
#> GSM99493 2 0.0000 0.976 0.000 1.000
#> GSM99495 2 0.2043 0.976 0.032 0.968
#> GSM99525 2 0.0000 0.976 0.000 1.000
#> GSM99527 2 0.3114 0.957 0.056 0.944
#> GSM99529 2 0.2043 0.976 0.032 0.968
#> GSM99531 1 0.9896 0.233 0.560 0.440
#> GSM99533 2 0.3431 0.937 0.064 0.936
#> GSM99535 2 0.0000 0.976 0.000 1.000
#> GSM99537 2 0.0000 0.976 0.000 1.000
#> GSM99539 2 0.2043 0.976 0.032 0.968
#> GSM99541 2 0.0000 0.976 0.000 1.000
#> GSM99543 2 0.0000 0.976 0.000 1.000
#> GSM99545 2 0.2043 0.976 0.032 0.968
#> GSM99547 2 0.0938 0.976 0.012 0.988
#> GSM99549 2 0.2043 0.976 0.032 0.968
#> GSM99551 2 0.0000 0.976 0.000 1.000
#> GSM99553 1 0.1414 0.925 0.980 0.020
#> GSM99555 2 0.2043 0.976 0.032 0.968
#> GSM99557 2 0.2043 0.976 0.032 0.968
#> GSM99559 2 0.9129 0.505 0.328 0.672
#> GSM99561 2 0.2043 0.976 0.032 0.968
#> GSM99563 1 0.0000 0.935 1.000 0.000
#> GSM99565 2 0.2043 0.976 0.032 0.968
#> GSM99573 2 0.2043 0.976 0.032 0.968
#> GSM99577 2 0.0000 0.976 0.000 1.000
#> GSM99579 2 0.2043 0.976 0.032 0.968
#> GSM99581 1 0.1184 0.928 0.984 0.016
#> GSM99583 2 0.1843 0.976 0.028 0.972
#> GSM99585 2 0.2043 0.976 0.032 0.968
#> GSM99587 2 0.0000 0.976 0.000 1.000
#> GSM99589 2 0.2043 0.976 0.032 0.968
#> GSM99591 2 0.2043 0.976 0.032 0.968
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM99497 3 0.0000 0.980 0.000 0.000 1.000
#> GSM99503 1 0.0000 0.994 1.000 0.000 0.000
#> GSM99505 1 0.0000 0.994 1.000 0.000 0.000
#> GSM99507 3 0.0000 0.980 0.000 0.000 1.000
#> GSM99567 3 0.0000 0.980 0.000 0.000 1.000
#> GSM99575 1 0.0000 0.994 1.000 0.000 0.000
#> GSM99593 3 0.0000 0.980 0.000 0.000 1.000
#> GSM99595 3 0.0000 0.980 0.000 0.000 1.000
#> GSM99469 1 0.0000 0.994 1.000 0.000 0.000
#> GSM99499 1 0.0000 0.994 1.000 0.000 0.000
#> GSM99501 1 0.0000 0.994 1.000 0.000 0.000
#> GSM99509 3 0.0000 0.980 0.000 0.000 1.000
#> GSM99569 3 0.0000 0.980 0.000 0.000 1.000
#> GSM99597 3 0.0000 0.980 0.000 0.000 1.000
#> GSM99601 2 0.0000 0.971 0.000 1.000 0.000
#> GSM99459 1 0.0000 0.994 1.000 0.000 0.000
#> GSM99461 1 0.0000 0.994 1.000 0.000 0.000
#> GSM99511 3 0.0000 0.980 0.000 0.000 1.000
#> GSM99513 3 0.0000 0.980 0.000 0.000 1.000
#> GSM99515 3 0.0000 0.980 0.000 0.000 1.000
#> GSM99517 1 0.0000 0.994 1.000 0.000 0.000
#> GSM99519 1 0.0000 0.994 1.000 0.000 0.000
#> GSM99521 3 0.0000 0.980 0.000 0.000 1.000
#> GSM99523 3 0.0237 0.977 0.004 0.000 0.996
#> GSM99571 1 0.0000 0.994 1.000 0.000 0.000
#> GSM99599 1 0.0000 0.994 1.000 0.000 0.000
#> GSM99433 2 0.0000 0.971 0.000 1.000 0.000
#> GSM99435 3 0.0000 0.980 0.000 0.000 1.000
#> GSM99437 2 0.0000 0.971 0.000 1.000 0.000
#> GSM99439 2 0.0000 0.971 0.000 1.000 0.000
#> GSM99441 1 0.0000 0.994 1.000 0.000 0.000
#> GSM99443 2 0.0000 0.971 0.000 1.000 0.000
#> GSM99445 2 0.0000 0.971 0.000 1.000 0.000
#> GSM99447 2 0.0000 0.971 0.000 1.000 0.000
#> GSM99449 3 0.2356 0.914 0.000 0.072 0.928
#> GSM99451 3 0.0000 0.980 0.000 0.000 1.000
#> GSM99453 1 0.0000 0.994 1.000 0.000 0.000
#> GSM99455 1 0.0000 0.994 1.000 0.000 0.000
#> GSM99457 1 0.0000 0.994 1.000 0.000 0.000
#> GSM99463 2 0.0000 0.971 0.000 1.000 0.000
#> GSM99465 1 0.3816 0.816 0.852 0.000 0.148
#> GSM99467 2 0.0000 0.971 0.000 1.000 0.000
#> GSM99471 1 0.0000 0.994 1.000 0.000 0.000
#> GSM99473 1 0.0000 0.994 1.000 0.000 0.000
#> GSM99475 3 0.0000 0.980 0.000 0.000 1.000
#> GSM99477 2 0.3192 0.866 0.000 0.888 0.112
#> GSM99479 2 0.0000 0.971 0.000 1.000 0.000
#> GSM99481 1 0.0000 0.994 1.000 0.000 0.000
#> GSM99483 1 0.0000 0.994 1.000 0.000 0.000
#> GSM99485 2 0.0000 0.971 0.000 1.000 0.000
#> GSM99487 2 0.0000 0.971 0.000 1.000 0.000
#> GSM99489 2 0.0000 0.971 0.000 1.000 0.000
#> GSM99491 2 0.0000 0.971 0.000 1.000 0.000
#> GSM99493 1 0.0000 0.994 1.000 0.000 0.000
#> GSM99495 2 0.0000 0.971 0.000 1.000 0.000
#> GSM99525 1 0.0000 0.994 1.000 0.000 0.000
#> GSM99527 3 0.4796 0.715 0.000 0.220 0.780
#> GSM99529 2 0.0892 0.956 0.000 0.980 0.020
#> GSM99531 3 0.0000 0.980 0.000 0.000 1.000
#> GSM99533 3 0.3619 0.838 0.136 0.000 0.864
#> GSM99535 2 0.0592 0.962 0.012 0.988 0.000
#> GSM99537 1 0.0000 0.994 1.000 0.000 0.000
#> GSM99539 2 0.0592 0.963 0.000 0.988 0.012
#> GSM99541 1 0.0000 0.994 1.000 0.000 0.000
#> GSM99543 2 0.0000 0.971 0.000 1.000 0.000
#> GSM99545 2 0.0237 0.969 0.000 0.996 0.004
#> GSM99547 2 0.8138 0.579 0.204 0.644 0.152
#> GSM99549 2 0.0000 0.971 0.000 1.000 0.000
#> GSM99551 1 0.0000 0.994 1.000 0.000 0.000
#> GSM99553 3 0.0000 0.980 0.000 0.000 1.000
#> GSM99555 2 0.0000 0.971 0.000 1.000 0.000
#> GSM99557 2 0.0000 0.971 0.000 1.000 0.000
#> GSM99559 2 0.5431 0.621 0.000 0.716 0.284
#> GSM99561 2 0.0000 0.971 0.000 1.000 0.000
#> GSM99563 3 0.0000 0.980 0.000 0.000 1.000
#> GSM99565 2 0.0000 0.971 0.000 1.000 0.000
#> GSM99573 2 0.0000 0.971 0.000 1.000 0.000
#> GSM99577 1 0.0000 0.994 1.000 0.000 0.000
#> GSM99579 2 0.0000 0.971 0.000 1.000 0.000
#> GSM99581 3 0.0000 0.980 0.000 0.000 1.000
#> GSM99583 2 0.4390 0.816 0.012 0.840 0.148
#> GSM99585 2 0.0000 0.971 0.000 1.000 0.000
#> GSM99587 1 0.0000 0.994 1.000 0.000 0.000
#> GSM99589 2 0.0000 0.971 0.000 1.000 0.000
#> GSM99591 2 0.0000 0.971 0.000 1.000 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM99497 3 0.0000 0.971 0.000 0.000 1.000 0.000
#> GSM99503 1 0.0000 0.902 1.000 0.000 0.000 0.000
#> GSM99505 1 0.0000 0.902 1.000 0.000 0.000 0.000
#> GSM99507 3 0.0000 0.971 0.000 0.000 1.000 0.000
#> GSM99567 3 0.0000 0.971 0.000 0.000 1.000 0.000
#> GSM99575 1 0.0000 0.902 1.000 0.000 0.000 0.000
#> GSM99593 3 0.0000 0.971 0.000 0.000 1.000 0.000
#> GSM99595 3 0.0000 0.971 0.000 0.000 1.000 0.000
#> GSM99469 1 0.0000 0.902 1.000 0.000 0.000 0.000
#> GSM99499 1 0.0188 0.898 0.996 0.000 0.000 0.004
#> GSM99501 1 0.0000 0.902 1.000 0.000 0.000 0.000
#> GSM99509 3 0.0000 0.971 0.000 0.000 1.000 0.000
#> GSM99569 3 0.0336 0.968 0.000 0.000 0.992 0.008
#> GSM99597 3 0.0000 0.971 0.000 0.000 1.000 0.000
#> GSM99601 2 0.0188 0.901 0.000 0.996 0.000 0.004
#> GSM99459 1 0.0000 0.902 1.000 0.000 0.000 0.000
#> GSM99461 1 0.0000 0.902 1.000 0.000 0.000 0.000
#> GSM99511 3 0.0000 0.971 0.000 0.000 1.000 0.000
#> GSM99513 3 0.0000 0.971 0.000 0.000 1.000 0.000
#> GSM99515 3 0.0000 0.971 0.000 0.000 1.000 0.000
#> GSM99517 1 0.0000 0.902 1.000 0.000 0.000 0.000
#> GSM99519 1 0.0000 0.902 1.000 0.000 0.000 0.000
#> GSM99521 3 0.0000 0.971 0.000 0.000 1.000 0.000
#> GSM99523 3 0.0992 0.958 0.012 0.004 0.976 0.008
#> GSM99571 4 0.4454 0.909 0.308 0.000 0.000 0.692
#> GSM99599 1 0.0000 0.902 1.000 0.000 0.000 0.000
#> GSM99433 2 0.0376 0.902 0.000 0.992 0.004 0.004
#> GSM99435 3 0.0188 0.970 0.000 0.000 0.996 0.004
#> GSM99437 2 0.0336 0.901 0.000 0.992 0.000 0.008
#> GSM99439 2 0.3942 0.801 0.000 0.764 0.000 0.236
#> GSM99441 1 0.0188 0.898 0.996 0.000 0.000 0.004
#> GSM99443 2 0.0188 0.901 0.000 0.996 0.000 0.004
#> GSM99445 2 0.0188 0.901 0.000 0.996 0.000 0.004
#> GSM99447 2 0.0336 0.901 0.000 0.992 0.000 0.008
#> GSM99449 3 0.2976 0.832 0.000 0.120 0.872 0.008
#> GSM99451 3 0.0336 0.968 0.000 0.000 0.992 0.008
#> GSM99453 4 0.4356 0.919 0.292 0.000 0.000 0.708
#> GSM99455 4 0.4356 0.919 0.292 0.000 0.000 0.708
#> GSM99457 4 0.4585 0.889 0.332 0.000 0.000 0.668
#> GSM99463 2 0.3942 0.801 0.000 0.764 0.000 0.236
#> GSM99465 1 0.8401 0.114 0.484 0.272 0.200 0.044
#> GSM99467 2 0.1211 0.895 0.000 0.960 0.000 0.040
#> GSM99471 2 0.6783 0.119 0.388 0.512 0.000 0.100
#> GSM99473 1 0.1302 0.822 0.956 0.044 0.000 0.000
#> GSM99475 3 0.0524 0.966 0.000 0.004 0.988 0.008
#> GSM99477 2 0.1767 0.890 0.000 0.944 0.012 0.044
#> GSM99479 2 0.1302 0.894 0.000 0.956 0.000 0.044
#> GSM99481 1 0.0000 0.902 1.000 0.000 0.000 0.000
#> GSM99483 4 0.4356 0.919 0.292 0.000 0.000 0.708
#> GSM99485 2 0.0469 0.901 0.000 0.988 0.000 0.012
#> GSM99487 2 0.0707 0.900 0.000 0.980 0.000 0.020
#> GSM99489 2 0.1637 0.890 0.000 0.940 0.000 0.060
#> GSM99491 2 0.0817 0.899 0.000 0.976 0.000 0.024
#> GSM99493 4 0.4356 0.919 0.292 0.000 0.000 0.708
#> GSM99495 2 0.3942 0.801 0.000 0.764 0.000 0.236
#> GSM99525 1 0.4907 -0.384 0.580 0.000 0.000 0.420
#> GSM99527 3 0.5130 0.663 0.004 0.212 0.740 0.044
#> GSM99529 2 0.1489 0.893 0.000 0.952 0.004 0.044
#> GSM99531 3 0.0524 0.966 0.000 0.004 0.988 0.008
#> GSM99533 3 0.2933 0.878 0.080 0.012 0.896 0.012
#> GSM99535 2 0.2060 0.887 0.016 0.932 0.000 0.052
#> GSM99537 1 0.0000 0.902 1.000 0.000 0.000 0.000
#> GSM99539 2 0.2596 0.871 0.000 0.908 0.068 0.024
#> GSM99541 1 0.0000 0.902 1.000 0.000 0.000 0.000
#> GSM99543 2 0.3224 0.860 0.016 0.864 0.000 0.120
#> GSM99545 2 0.4008 0.837 0.000 0.820 0.032 0.148
#> GSM99547 2 0.7164 0.624 0.096 0.640 0.212 0.052
#> GSM99549 2 0.3942 0.801 0.000 0.764 0.000 0.236
#> GSM99551 4 0.6859 0.686 0.380 0.108 0.000 0.512
#> GSM99553 3 0.0000 0.971 0.000 0.000 1.000 0.000
#> GSM99555 2 0.0336 0.901 0.000 0.992 0.000 0.008
#> GSM99557 2 0.0921 0.899 0.000 0.972 0.000 0.028
#> GSM99559 2 0.4990 0.522 0.000 0.640 0.352 0.008
#> GSM99561 2 0.1302 0.895 0.000 0.956 0.000 0.044
#> GSM99563 3 0.0000 0.971 0.000 0.000 1.000 0.000
#> GSM99565 2 0.0188 0.901 0.000 0.996 0.000 0.004
#> GSM99573 2 0.3942 0.801 0.000 0.764 0.000 0.236
#> GSM99577 4 0.6443 0.728 0.400 0.072 0.000 0.528
#> GSM99579 2 0.0592 0.900 0.000 0.984 0.000 0.016
#> GSM99581 3 0.0336 0.968 0.000 0.000 0.992 0.008
#> GSM99583 2 0.5903 0.701 0.032 0.712 0.212 0.044
#> GSM99585 2 0.1302 0.894 0.000 0.956 0.000 0.044
#> GSM99587 4 0.4356 0.919 0.292 0.000 0.000 0.708
#> GSM99589 2 0.0188 0.901 0.000 0.996 0.000 0.004
#> GSM99591 2 0.0188 0.901 0.000 0.996 0.000 0.004
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM99497 3 0.0000 0.9706 0.000 0.000 1.000 0.000 0.000
#> GSM99503 1 0.0000 0.9756 1.000 0.000 0.000 0.000 0.000
#> GSM99505 1 0.0000 0.9756 1.000 0.000 0.000 0.000 0.000
#> GSM99507 3 0.0000 0.9706 0.000 0.000 1.000 0.000 0.000
#> GSM99567 3 0.0000 0.9706 0.000 0.000 1.000 0.000 0.000
#> GSM99575 1 0.0000 0.9756 1.000 0.000 0.000 0.000 0.000
#> GSM99593 3 0.0000 0.9706 0.000 0.000 1.000 0.000 0.000
#> GSM99595 3 0.0000 0.9706 0.000 0.000 1.000 0.000 0.000
#> GSM99469 1 0.0000 0.9756 1.000 0.000 0.000 0.000 0.000
#> GSM99499 1 0.0000 0.9756 1.000 0.000 0.000 0.000 0.000
#> GSM99501 1 0.0000 0.9756 1.000 0.000 0.000 0.000 0.000
#> GSM99509 3 0.0000 0.9706 0.000 0.000 1.000 0.000 0.000
#> GSM99569 3 0.0451 0.9687 0.000 0.000 0.988 0.004 0.008
#> GSM99597 3 0.0000 0.9706 0.000 0.000 1.000 0.000 0.000
#> GSM99601 2 0.1478 0.9117 0.000 0.936 0.000 0.000 0.064
#> GSM99459 1 0.0000 0.9756 1.000 0.000 0.000 0.000 0.000
#> GSM99461 1 0.0000 0.9756 1.000 0.000 0.000 0.000 0.000
#> GSM99511 3 0.0000 0.9706 0.000 0.000 1.000 0.000 0.000
#> GSM99513 3 0.0000 0.9706 0.000 0.000 1.000 0.000 0.000
#> GSM99515 3 0.0000 0.9706 0.000 0.000 1.000 0.000 0.000
#> GSM99517 1 0.0162 0.9741 0.996 0.000 0.000 0.004 0.000
#> GSM99519 1 0.0000 0.9756 1.000 0.000 0.000 0.000 0.000
#> GSM99521 3 0.0162 0.9700 0.000 0.000 0.996 0.004 0.000
#> GSM99523 3 0.0932 0.9610 0.004 0.000 0.972 0.004 0.020
#> GSM99571 4 0.0404 0.9694 0.012 0.000 0.000 0.988 0.000
#> GSM99599 1 0.1197 0.9473 0.952 0.000 0.000 0.048 0.000
#> GSM99433 2 0.0290 0.9206 0.000 0.992 0.008 0.000 0.000
#> GSM99435 3 0.0324 0.9695 0.000 0.000 0.992 0.004 0.004
#> GSM99437 2 0.0000 0.9208 0.000 1.000 0.000 0.000 0.000
#> GSM99439 5 0.1121 0.8599 0.000 0.044 0.000 0.000 0.956
#> GSM99441 1 0.1121 0.9502 0.956 0.000 0.000 0.044 0.000
#> GSM99443 2 0.1270 0.9158 0.000 0.948 0.000 0.000 0.052
#> GSM99445 2 0.1270 0.9158 0.000 0.948 0.000 0.000 0.052
#> GSM99447 2 0.0510 0.9208 0.000 0.984 0.000 0.000 0.016
#> GSM99449 3 0.0579 0.9662 0.000 0.008 0.984 0.000 0.008
#> GSM99451 3 0.0566 0.9671 0.000 0.000 0.984 0.004 0.012
#> GSM99453 4 0.0404 0.9694 0.012 0.000 0.000 0.988 0.000
#> GSM99455 4 0.0404 0.9694 0.012 0.000 0.000 0.988 0.000
#> GSM99457 4 0.0880 0.9609 0.032 0.000 0.000 0.968 0.000
#> GSM99463 5 0.1121 0.8599 0.000 0.044 0.000 0.000 0.956
#> GSM99465 1 0.3105 0.8283 0.864 0.000 0.088 0.004 0.044
#> GSM99467 2 0.0880 0.9114 0.000 0.968 0.000 0.000 0.032
#> GSM99471 4 0.1753 0.9482 0.032 0.000 0.000 0.936 0.032
#> GSM99473 1 0.1907 0.9321 0.928 0.000 0.000 0.044 0.028
#> GSM99475 3 0.0566 0.9671 0.000 0.000 0.984 0.004 0.012
#> GSM99477 2 0.1043 0.9071 0.000 0.960 0.000 0.000 0.040
#> GSM99479 2 0.1043 0.9071 0.000 0.960 0.000 0.000 0.040
#> GSM99481 1 0.1121 0.9502 0.956 0.000 0.000 0.044 0.000
#> GSM99483 4 0.0404 0.9694 0.012 0.000 0.000 0.988 0.000
#> GSM99485 2 0.1197 0.9190 0.000 0.952 0.000 0.000 0.048
#> GSM99487 2 0.0290 0.9197 0.000 0.992 0.000 0.000 0.008
#> GSM99489 2 0.3774 0.5991 0.000 0.704 0.000 0.000 0.296
#> GSM99491 2 0.0703 0.9223 0.000 0.976 0.000 0.000 0.024
#> GSM99493 4 0.0404 0.9694 0.012 0.000 0.000 0.988 0.000
#> GSM99495 5 0.1121 0.8599 0.000 0.044 0.000 0.000 0.956
#> GSM99525 4 0.1851 0.9089 0.088 0.000 0.000 0.912 0.000
#> GSM99527 3 0.3053 0.8748 0.000 0.076 0.872 0.008 0.044
#> GSM99529 2 0.1282 0.9023 0.000 0.952 0.000 0.004 0.044
#> GSM99531 3 0.0671 0.9652 0.000 0.000 0.980 0.004 0.016
#> GSM99533 3 0.2562 0.9037 0.060 0.000 0.900 0.008 0.032
#> GSM99535 2 0.3056 0.8596 0.000 0.864 0.000 0.068 0.068
#> GSM99537 1 0.0162 0.9739 0.996 0.000 0.000 0.004 0.000
#> GSM99539 2 0.2230 0.7934 0.000 0.884 0.116 0.000 0.000
#> GSM99541 1 0.0000 0.9756 1.000 0.000 0.000 0.000 0.000
#> GSM99543 5 0.6037 -0.0474 0.000 0.440 0.000 0.116 0.444
#> GSM99545 5 0.4558 0.7251 0.000 0.168 0.088 0.000 0.744
#> GSM99547 3 0.4018 0.8540 0.032 0.048 0.844 0.032 0.044
#> GSM99549 5 0.1121 0.8599 0.000 0.044 0.000 0.000 0.956
#> GSM99551 4 0.1753 0.9482 0.032 0.000 0.000 0.936 0.032
#> GSM99553 3 0.0000 0.9706 0.000 0.000 1.000 0.000 0.000
#> GSM99555 2 0.1478 0.9113 0.000 0.936 0.000 0.000 0.064
#> GSM99557 2 0.2852 0.8092 0.000 0.828 0.000 0.000 0.172
#> GSM99559 3 0.1106 0.9514 0.000 0.024 0.964 0.000 0.012
#> GSM99561 2 0.3210 0.7458 0.000 0.788 0.000 0.000 0.212
#> GSM99563 3 0.0000 0.9706 0.000 0.000 1.000 0.000 0.000
#> GSM99565 2 0.0290 0.9218 0.000 0.992 0.000 0.000 0.008
#> GSM99573 5 0.1121 0.8599 0.000 0.044 0.000 0.000 0.956
#> GSM99577 4 0.1753 0.9482 0.032 0.000 0.000 0.936 0.032
#> GSM99579 2 0.1121 0.9180 0.000 0.956 0.000 0.000 0.044
#> GSM99581 3 0.0324 0.9695 0.000 0.000 0.992 0.004 0.004
#> GSM99583 3 0.4077 0.7658 0.004 0.156 0.792 0.004 0.044
#> GSM99585 2 0.1043 0.9071 0.000 0.960 0.000 0.000 0.040
#> GSM99587 4 0.0404 0.9694 0.012 0.000 0.000 0.988 0.000
#> GSM99589 2 0.0162 0.9214 0.000 0.996 0.000 0.000 0.004
#> GSM99591 2 0.1270 0.9158 0.000 0.948 0.000 0.000 0.052
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM99497 3 0.0458 0.9483 0.000 0.000 0.984 0.016 0.000 0.000
#> GSM99503 1 0.0000 0.9830 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99505 1 0.0000 0.9830 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99507 3 0.0260 0.9494 0.000 0.000 0.992 0.008 0.000 0.000
#> GSM99567 3 0.0363 0.9476 0.000 0.000 0.988 0.012 0.000 0.000
#> GSM99575 1 0.0000 0.9830 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99593 3 0.0146 0.9493 0.000 0.000 0.996 0.004 0.000 0.000
#> GSM99595 3 0.0260 0.9485 0.000 0.000 0.992 0.008 0.000 0.000
#> GSM99469 1 0.0000 0.9830 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99499 1 0.0146 0.9812 0.996 0.000 0.000 0.000 0.000 0.004
#> GSM99501 1 0.0000 0.9830 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99509 3 0.0363 0.9476 0.000 0.000 0.988 0.012 0.000 0.000
#> GSM99569 3 0.1075 0.9407 0.000 0.000 0.952 0.048 0.000 0.000
#> GSM99597 3 0.0260 0.9497 0.000 0.000 0.992 0.008 0.000 0.000
#> GSM99601 2 0.0865 0.7634 0.000 0.964 0.000 0.000 0.036 0.000
#> GSM99459 1 0.0000 0.9830 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99461 1 0.0000 0.9830 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99511 3 0.0260 0.9485 0.000 0.000 0.992 0.008 0.000 0.000
#> GSM99513 3 0.0260 0.9485 0.000 0.000 0.992 0.008 0.000 0.000
#> GSM99515 3 0.0363 0.9490 0.000 0.000 0.988 0.012 0.000 0.000
#> GSM99517 1 0.0000 0.9830 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99519 1 0.0000 0.9830 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99521 3 0.0146 0.9494 0.000 0.000 0.996 0.004 0.000 0.000
#> GSM99523 3 0.1556 0.9241 0.000 0.000 0.920 0.080 0.000 0.000
#> GSM99571 6 0.0000 0.9355 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM99599 1 0.1267 0.9382 0.940 0.000 0.000 0.000 0.000 0.060
#> GSM99433 2 0.3663 0.6256 0.000 0.776 0.040 0.180 0.004 0.000
#> GSM99435 3 0.0000 0.9494 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM99437 2 0.0000 0.7718 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM99439 5 0.0000 0.9430 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM99441 1 0.1141 0.9460 0.948 0.000 0.000 0.000 0.000 0.052
#> GSM99443 2 0.0260 0.7723 0.000 0.992 0.000 0.000 0.008 0.000
#> GSM99445 2 0.0260 0.7723 0.000 0.992 0.000 0.000 0.008 0.000
#> GSM99447 2 0.2542 0.7370 0.000 0.876 0.000 0.080 0.044 0.000
#> GSM99449 3 0.0937 0.9430 0.000 0.000 0.960 0.040 0.000 0.000
#> GSM99451 3 0.0547 0.9483 0.000 0.000 0.980 0.020 0.000 0.000
#> GSM99453 6 0.0000 0.9355 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM99455 6 0.0000 0.9355 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM99457 6 0.0865 0.9143 0.036 0.000 0.000 0.000 0.000 0.964
#> GSM99463 5 0.0000 0.9430 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM99465 4 0.3905 0.3043 0.316 0.000 0.016 0.668 0.000 0.000
#> GSM99467 2 0.3578 0.3608 0.000 0.660 0.000 0.340 0.000 0.000
#> GSM99471 6 0.3023 0.8010 0.004 0.000 0.000 0.212 0.000 0.784
#> GSM99473 1 0.1757 0.9045 0.916 0.000 0.000 0.076 0.000 0.008
#> GSM99475 3 0.0790 0.9442 0.000 0.000 0.968 0.032 0.000 0.000
#> GSM99477 4 0.3717 0.3897 0.000 0.384 0.000 0.616 0.000 0.000
#> GSM99479 4 0.3847 0.2095 0.000 0.456 0.000 0.544 0.000 0.000
#> GSM99481 1 0.0713 0.9654 0.972 0.000 0.000 0.000 0.000 0.028
#> GSM99483 6 0.0000 0.9355 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM99485 2 0.2278 0.7175 0.000 0.868 0.000 0.128 0.004 0.000
#> GSM99487 2 0.0146 0.7719 0.000 0.996 0.000 0.004 0.000 0.000
#> GSM99489 2 0.2902 0.6128 0.000 0.800 0.000 0.004 0.196 0.000
#> GSM99491 2 0.0146 0.7723 0.000 0.996 0.000 0.000 0.004 0.000
#> GSM99493 6 0.0000 0.9355 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM99495 5 0.0000 0.9430 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM99525 6 0.1663 0.8663 0.088 0.000 0.000 0.000 0.000 0.912
#> GSM99527 3 0.2941 0.7704 0.000 0.000 0.780 0.220 0.000 0.000
#> GSM99529 4 0.3076 0.5242 0.000 0.240 0.000 0.760 0.000 0.000
#> GSM99531 3 0.0937 0.9415 0.000 0.000 0.960 0.040 0.000 0.000
#> GSM99533 3 0.2135 0.8730 0.000 0.000 0.872 0.128 0.000 0.000
#> GSM99535 2 0.4504 0.2324 0.000 0.540 0.000 0.432 0.004 0.024
#> GSM99537 1 0.0146 0.9809 0.996 0.000 0.000 0.000 0.000 0.004
#> GSM99539 2 0.5296 0.2675 0.000 0.600 0.184 0.216 0.000 0.000
#> GSM99541 1 0.0000 0.9830 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99543 2 0.7366 -0.0878 0.000 0.328 0.000 0.276 0.288 0.108
#> GSM99545 5 0.4274 0.6586 0.000 0.144 0.056 0.036 0.764 0.000
#> GSM99547 3 0.4217 0.2877 0.004 0.000 0.524 0.464 0.000 0.008
#> GSM99549 5 0.0000 0.9430 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM99551 6 0.2772 0.8282 0.004 0.000 0.000 0.180 0.000 0.816
#> GSM99553 3 0.0547 0.9482 0.000 0.000 0.980 0.020 0.000 0.000
#> GSM99555 2 0.1480 0.7657 0.000 0.940 0.000 0.020 0.040 0.000
#> GSM99557 2 0.1644 0.7439 0.000 0.920 0.000 0.004 0.076 0.000
#> GSM99559 3 0.1471 0.9241 0.000 0.004 0.932 0.064 0.000 0.000
#> GSM99561 2 0.4721 0.5352 0.000 0.672 0.000 0.116 0.212 0.000
#> GSM99563 3 0.0458 0.9483 0.000 0.000 0.984 0.016 0.000 0.000
#> GSM99565 2 0.0146 0.7722 0.000 0.996 0.000 0.000 0.004 0.000
#> GSM99573 5 0.0000 0.9430 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM99577 6 0.1858 0.8886 0.004 0.000 0.000 0.092 0.000 0.904
#> GSM99579 2 0.0777 0.7693 0.000 0.972 0.000 0.024 0.004 0.000
#> GSM99581 3 0.0937 0.9422 0.000 0.000 0.960 0.040 0.000 0.000
#> GSM99583 4 0.2445 0.4373 0.004 0.008 0.120 0.868 0.000 0.000
#> GSM99585 2 0.3864 -0.1681 0.000 0.520 0.000 0.480 0.000 0.000
#> GSM99587 6 0.0000 0.9355 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM99589 2 0.2346 0.7176 0.000 0.868 0.000 0.124 0.008 0.000
#> GSM99591 2 0.0260 0.7723 0.000 0.992 0.000 0.000 0.008 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 disease.state(p) cell.type(p) k
#> MAD:mclust 82 4.93e-04 0.001302 2
#> MAD:mclust 85 2.13e-05 0.000834 3
#> MAD:mclust 82 6.88e-07 0.000135 4
#> MAD:mclust 84 2.30e-05 0.005193 5
#> MAD:mclust 75 1.19e-04 0.029763 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 21512 rows and 85 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.745 0.859 0.944 0.5003 0.494 0.494
#> 3 3 1.000 0.948 0.978 0.3464 0.714 0.483
#> 4 4 0.748 0.732 0.845 0.0938 0.940 0.822
#> 5 5 0.691 0.647 0.795 0.0648 0.915 0.711
#> 6 6 0.724 0.611 0.780 0.0406 0.951 0.791
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
#> GSM99497 2 0.999 0.0379 0.484 0.516
#> GSM99503 1 0.000 0.9365 1.000 0.000
#> GSM99505 1 0.000 0.9365 1.000 0.000
#> GSM99507 1 0.904 0.5319 0.680 0.320
#> GSM99567 2 0.595 0.8111 0.144 0.856
#> GSM99575 1 0.000 0.9365 1.000 0.000
#> GSM99593 2 0.118 0.9271 0.016 0.984
#> GSM99595 1 0.975 0.3159 0.592 0.408
#> GSM99469 1 0.000 0.9365 1.000 0.000
#> GSM99499 1 0.000 0.9365 1.000 0.000
#> GSM99501 1 0.000 0.9365 1.000 0.000
#> GSM99509 1 0.574 0.8186 0.864 0.136
#> GSM99569 1 0.278 0.9015 0.952 0.048
#> GSM99597 1 0.000 0.9365 1.000 0.000
#> GSM99601 2 0.000 0.9379 0.000 1.000
#> GSM99459 1 0.000 0.9365 1.000 0.000
#> GSM99461 1 0.000 0.9365 1.000 0.000
#> GSM99511 2 0.943 0.4338 0.360 0.640
#> GSM99513 2 0.662 0.7754 0.172 0.828
#> GSM99515 1 0.605 0.8044 0.852 0.148
#> GSM99517 1 0.000 0.9365 1.000 0.000
#> GSM99519 1 0.000 0.9365 1.000 0.000
#> GSM99521 1 0.988 0.2205 0.564 0.436
#> GSM99523 1 0.000 0.9365 1.000 0.000
#> GSM99571 1 0.000 0.9365 1.000 0.000
#> GSM99599 1 0.000 0.9365 1.000 0.000
#> GSM99433 2 0.000 0.9379 0.000 1.000
#> GSM99435 2 0.295 0.8994 0.052 0.948
#> GSM99437 2 0.000 0.9379 0.000 1.000
#> GSM99439 2 0.000 0.9379 0.000 1.000
#> GSM99441 1 0.000 0.9365 1.000 0.000
#> GSM99443 2 0.000 0.9379 0.000 1.000
#> GSM99445 2 0.000 0.9379 0.000 1.000
#> GSM99447 2 0.000 0.9379 0.000 1.000
#> GSM99449 2 0.000 0.9379 0.000 1.000
#> GSM99451 1 0.000 0.9365 1.000 0.000
#> GSM99453 1 0.000 0.9365 1.000 0.000
#> GSM99455 1 0.000 0.9365 1.000 0.000
#> GSM99457 1 0.000 0.9365 1.000 0.000
#> GSM99463 2 0.000 0.9379 0.000 1.000
#> GSM99465 1 0.000 0.9365 1.000 0.000
#> GSM99467 2 0.000 0.9379 0.000 1.000
#> GSM99471 1 0.000 0.9365 1.000 0.000
#> GSM99473 1 0.000 0.9365 1.000 0.000
#> GSM99475 1 0.991 0.2037 0.556 0.444
#> GSM99477 2 0.000 0.9379 0.000 1.000
#> GSM99479 2 0.000 0.9379 0.000 1.000
#> GSM99481 1 0.000 0.9365 1.000 0.000
#> GSM99483 1 0.000 0.9365 1.000 0.000
#> GSM99485 2 0.000 0.9379 0.000 1.000
#> GSM99487 2 0.000 0.9379 0.000 1.000
#> GSM99489 2 0.000 0.9379 0.000 1.000
#> GSM99491 2 0.000 0.9379 0.000 1.000
#> GSM99493 1 0.000 0.9365 1.000 0.000
#> GSM99495 2 0.000 0.9379 0.000 1.000
#> GSM99525 1 0.000 0.9365 1.000 0.000
#> GSM99527 2 0.996 0.1225 0.464 0.536
#> GSM99529 2 0.000 0.9379 0.000 1.000
#> GSM99531 1 0.224 0.9109 0.964 0.036
#> GSM99533 1 0.000 0.9365 1.000 0.000
#> GSM99535 2 0.184 0.9183 0.028 0.972
#> GSM99537 1 0.000 0.9365 1.000 0.000
#> GSM99539 2 0.000 0.9379 0.000 1.000
#> GSM99541 1 0.000 0.9365 1.000 0.000
#> GSM99543 2 0.000 0.9379 0.000 1.000
#> GSM99545 2 0.000 0.9379 0.000 1.000
#> GSM99547 1 0.866 0.5804 0.712 0.288
#> GSM99549 2 0.000 0.9379 0.000 1.000
#> GSM99551 1 0.000 0.9365 1.000 0.000
#> GSM99553 2 0.574 0.8196 0.136 0.864
#> GSM99555 2 0.000 0.9379 0.000 1.000
#> GSM99557 2 0.000 0.9379 0.000 1.000
#> GSM99559 2 0.000 0.9379 0.000 1.000
#> GSM99561 2 0.000 0.9379 0.000 1.000
#> GSM99563 1 0.518 0.8393 0.884 0.116
#> GSM99565 2 0.000 0.9379 0.000 1.000
#> GSM99573 2 0.000 0.9379 0.000 1.000
#> GSM99577 1 0.000 0.9365 1.000 0.000
#> GSM99579 2 0.000 0.9379 0.000 1.000
#> GSM99581 2 0.634 0.7914 0.160 0.840
#> GSM99583 2 0.952 0.4121 0.372 0.628
#> GSM99585 2 0.000 0.9379 0.000 1.000
#> GSM99587 1 0.000 0.9365 1.000 0.000
#> GSM99589 2 0.000 0.9379 0.000 1.000
#> GSM99591 2 0.000 0.9379 0.000 1.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM99497 3 0.0000 0.956 0.000 0.000 1.000
#> GSM99503 1 0.0237 0.978 0.996 0.000 0.004
#> GSM99505 3 0.5882 0.457 0.348 0.000 0.652
#> GSM99507 3 0.0000 0.956 0.000 0.000 1.000
#> GSM99567 3 0.0000 0.956 0.000 0.000 1.000
#> GSM99575 1 0.0237 0.978 0.996 0.000 0.004
#> GSM99593 3 0.0000 0.956 0.000 0.000 1.000
#> GSM99595 3 0.0000 0.956 0.000 0.000 1.000
#> GSM99469 1 0.0237 0.978 0.996 0.000 0.004
#> GSM99499 1 0.0747 0.968 0.984 0.000 0.016
#> GSM99501 1 0.0424 0.975 0.992 0.000 0.008
#> GSM99509 3 0.0000 0.956 0.000 0.000 1.000
#> GSM99569 3 0.0000 0.956 0.000 0.000 1.000
#> GSM99597 3 0.0000 0.956 0.000 0.000 1.000
#> GSM99601 2 0.0000 0.997 0.000 1.000 0.000
#> GSM99459 1 0.0237 0.978 0.996 0.000 0.004
#> GSM99461 1 0.0237 0.978 0.996 0.000 0.004
#> GSM99511 3 0.0000 0.956 0.000 0.000 1.000
#> GSM99513 3 0.0000 0.956 0.000 0.000 1.000
#> GSM99515 3 0.0000 0.956 0.000 0.000 1.000
#> GSM99517 1 0.0000 0.979 1.000 0.000 0.000
#> GSM99519 1 0.0237 0.978 0.996 0.000 0.004
#> GSM99521 3 0.0000 0.956 0.000 0.000 1.000
#> GSM99523 3 0.0000 0.956 0.000 0.000 1.000
#> GSM99571 1 0.0000 0.979 1.000 0.000 0.000
#> GSM99599 1 0.0000 0.979 1.000 0.000 0.000
#> GSM99433 2 0.1860 0.944 0.000 0.948 0.052
#> GSM99435 3 0.0000 0.956 0.000 0.000 1.000
#> GSM99437 2 0.0000 0.997 0.000 1.000 0.000
#> GSM99439 2 0.0000 0.997 0.000 1.000 0.000
#> GSM99441 1 0.0000 0.979 1.000 0.000 0.000
#> GSM99443 2 0.0000 0.997 0.000 1.000 0.000
#> GSM99445 2 0.0000 0.997 0.000 1.000 0.000
#> GSM99447 2 0.0000 0.997 0.000 1.000 0.000
#> GSM99449 3 0.0000 0.956 0.000 0.000 1.000
#> GSM99451 3 0.0000 0.956 0.000 0.000 1.000
#> GSM99453 1 0.0000 0.979 1.000 0.000 0.000
#> GSM99455 1 0.0000 0.979 1.000 0.000 0.000
#> GSM99457 1 0.0000 0.979 1.000 0.000 0.000
#> GSM99463 2 0.0000 0.997 0.000 1.000 0.000
#> GSM99465 3 0.0000 0.956 0.000 0.000 1.000
#> GSM99467 2 0.0000 0.997 0.000 1.000 0.000
#> GSM99471 1 0.0000 0.979 1.000 0.000 0.000
#> GSM99473 1 0.0000 0.979 1.000 0.000 0.000
#> GSM99475 3 0.0000 0.956 0.000 0.000 1.000
#> GSM99477 3 0.1163 0.934 0.000 0.028 0.972
#> GSM99479 2 0.0000 0.997 0.000 1.000 0.000
#> GSM99481 1 0.0000 0.979 1.000 0.000 0.000
#> GSM99483 1 0.0000 0.979 1.000 0.000 0.000
#> GSM99485 2 0.0000 0.997 0.000 1.000 0.000
#> GSM99487 2 0.0000 0.997 0.000 1.000 0.000
#> GSM99489 2 0.0000 0.997 0.000 1.000 0.000
#> GSM99491 2 0.0000 0.997 0.000 1.000 0.000
#> GSM99493 1 0.0000 0.979 1.000 0.000 0.000
#> GSM99495 2 0.0000 0.997 0.000 1.000 0.000
#> GSM99525 1 0.0000 0.979 1.000 0.000 0.000
#> GSM99527 3 0.0000 0.956 0.000 0.000 1.000
#> GSM99529 2 0.0237 0.993 0.000 0.996 0.004
#> GSM99531 3 0.0000 0.956 0.000 0.000 1.000
#> GSM99533 3 0.1163 0.933 0.028 0.000 0.972
#> GSM99535 2 0.0592 0.986 0.012 0.988 0.000
#> GSM99537 1 0.0000 0.979 1.000 0.000 0.000
#> GSM99539 3 0.6274 0.171 0.000 0.456 0.544
#> GSM99541 1 0.1753 0.936 0.952 0.000 0.048
#> GSM99543 2 0.0000 0.997 0.000 1.000 0.000
#> GSM99545 2 0.0892 0.979 0.000 0.980 0.020
#> GSM99547 1 0.8754 0.317 0.532 0.344 0.124
#> GSM99549 2 0.0000 0.997 0.000 1.000 0.000
#> GSM99551 1 0.0000 0.979 1.000 0.000 0.000
#> GSM99553 3 0.0000 0.956 0.000 0.000 1.000
#> GSM99555 2 0.0000 0.997 0.000 1.000 0.000
#> GSM99557 2 0.0000 0.997 0.000 1.000 0.000
#> GSM99559 3 0.0237 0.953 0.000 0.004 0.996
#> GSM99561 2 0.0000 0.997 0.000 1.000 0.000
#> GSM99563 3 0.0000 0.956 0.000 0.000 1.000
#> GSM99565 2 0.0000 0.997 0.000 1.000 0.000
#> GSM99573 2 0.0000 0.997 0.000 1.000 0.000
#> GSM99577 1 0.0000 0.979 1.000 0.000 0.000
#> GSM99579 2 0.0000 0.997 0.000 1.000 0.000
#> GSM99581 3 0.0000 0.956 0.000 0.000 1.000
#> GSM99583 3 0.8148 0.593 0.156 0.200 0.644
#> GSM99585 2 0.0000 0.997 0.000 1.000 0.000
#> GSM99587 1 0.0000 0.979 1.000 0.000 0.000
#> GSM99589 2 0.0000 0.997 0.000 1.000 0.000
#> GSM99591 2 0.0000 0.997 0.000 1.000 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM99497 3 0.2530 0.818 0.000 0.000 0.888 0.112
#> GSM99503 1 0.0000 0.972 1.000 0.000 0.000 0.000
#> GSM99505 3 0.4539 0.559 0.272 0.000 0.720 0.008
#> GSM99507 3 0.1792 0.827 0.000 0.000 0.932 0.068
#> GSM99567 3 0.0817 0.833 0.000 0.000 0.976 0.024
#> GSM99575 1 0.0000 0.972 1.000 0.000 0.000 0.000
#> GSM99593 3 0.0592 0.833 0.000 0.000 0.984 0.016
#> GSM99595 3 0.1867 0.819 0.000 0.000 0.928 0.072
#> GSM99469 1 0.0336 0.970 0.992 0.000 0.000 0.008
#> GSM99499 1 0.2021 0.907 0.932 0.000 0.056 0.012
#> GSM99501 1 0.0469 0.969 0.988 0.000 0.000 0.012
#> GSM99509 3 0.0469 0.833 0.000 0.000 0.988 0.012
#> GSM99569 3 0.2647 0.816 0.000 0.000 0.880 0.120
#> GSM99597 3 0.1389 0.828 0.000 0.000 0.952 0.048
#> GSM99601 2 0.2814 0.719 0.000 0.868 0.000 0.132
#> GSM99459 1 0.0707 0.964 0.980 0.000 0.000 0.020
#> GSM99461 1 0.0469 0.969 0.988 0.000 0.000 0.012
#> GSM99511 3 0.2921 0.785 0.000 0.000 0.860 0.140
#> GSM99513 3 0.3610 0.737 0.000 0.000 0.800 0.200
#> GSM99515 3 0.2469 0.819 0.000 0.000 0.892 0.108
#> GSM99517 1 0.0000 0.972 1.000 0.000 0.000 0.000
#> GSM99519 1 0.0817 0.961 0.976 0.000 0.000 0.024
#> GSM99521 3 0.0817 0.832 0.000 0.000 0.976 0.024
#> GSM99523 3 0.3266 0.794 0.000 0.000 0.832 0.168
#> GSM99571 1 0.0000 0.972 1.000 0.000 0.000 0.000
#> GSM99599 1 0.0000 0.972 1.000 0.000 0.000 0.000
#> GSM99433 2 0.5766 0.342 0.000 0.564 0.032 0.404
#> GSM99435 3 0.1557 0.831 0.000 0.000 0.944 0.056
#> GSM99437 2 0.2216 0.699 0.000 0.908 0.000 0.092
#> GSM99439 2 0.4996 0.192 0.000 0.516 0.000 0.484
#> GSM99441 1 0.0000 0.972 1.000 0.000 0.000 0.000
#> GSM99443 2 0.1118 0.735 0.000 0.964 0.000 0.036
#> GSM99445 2 0.1022 0.735 0.000 0.968 0.000 0.032
#> GSM99447 2 0.4477 0.554 0.000 0.688 0.000 0.312
#> GSM99449 3 0.2868 0.810 0.000 0.000 0.864 0.136
#> GSM99451 3 0.1792 0.824 0.000 0.000 0.932 0.068
#> GSM99453 1 0.2918 0.845 0.876 0.000 0.008 0.116
#> GSM99455 1 0.1305 0.945 0.960 0.000 0.004 0.036
#> GSM99457 1 0.0592 0.967 0.984 0.000 0.000 0.016
#> GSM99463 2 0.4697 0.495 0.000 0.644 0.000 0.356
#> GSM99465 3 0.7234 0.515 0.012 0.132 0.564 0.292
#> GSM99467 2 0.3311 0.642 0.000 0.828 0.000 0.172
#> GSM99471 1 0.0000 0.972 1.000 0.000 0.000 0.000
#> GSM99473 1 0.2670 0.881 0.908 0.052 0.000 0.040
#> GSM99475 3 0.4164 0.677 0.000 0.000 0.736 0.264
#> GSM99477 3 0.7875 0.187 0.000 0.328 0.384 0.288
#> GSM99479 2 0.3569 0.618 0.000 0.804 0.000 0.196
#> GSM99481 1 0.0188 0.971 0.996 0.000 0.000 0.004
#> GSM99483 1 0.0188 0.971 0.996 0.000 0.000 0.004
#> GSM99485 2 0.2589 0.724 0.000 0.884 0.000 0.116
#> GSM99487 2 0.2589 0.685 0.000 0.884 0.000 0.116
#> GSM99489 2 0.3074 0.710 0.000 0.848 0.000 0.152
#> GSM99491 2 0.1716 0.712 0.000 0.936 0.000 0.064
#> GSM99493 1 0.0000 0.972 1.000 0.000 0.000 0.000
#> GSM99495 2 0.4804 0.446 0.000 0.616 0.000 0.384
#> GSM99525 1 0.0000 0.972 1.000 0.000 0.000 0.000
#> GSM99527 3 0.3855 0.788 0.004 0.012 0.820 0.164
#> GSM99529 2 0.2958 0.687 0.004 0.876 0.004 0.116
#> GSM99531 3 0.4804 0.491 0.000 0.000 0.616 0.384
#> GSM99533 3 0.4164 0.677 0.000 0.000 0.736 0.264
#> GSM99535 2 0.3320 0.707 0.056 0.876 0.000 0.068
#> GSM99537 1 0.0188 0.971 0.996 0.000 0.000 0.004
#> GSM99539 3 0.6415 0.397 0.000 0.288 0.612 0.100
#> GSM99541 1 0.2635 0.871 0.904 0.000 0.076 0.020
#> GSM99543 2 0.4781 0.521 0.004 0.660 0.000 0.336
#> GSM99545 4 0.5911 0.457 0.000 0.196 0.112 0.692
#> GSM99547 4 0.9203 0.494 0.336 0.184 0.100 0.380
#> GSM99549 4 0.4624 0.300 0.000 0.340 0.000 0.660
#> GSM99551 4 0.6389 0.393 0.404 0.032 0.020 0.544
#> GSM99553 3 0.1211 0.833 0.000 0.000 0.960 0.040
#> GSM99555 2 0.2868 0.717 0.000 0.864 0.000 0.136
#> GSM99557 2 0.3266 0.700 0.000 0.832 0.000 0.168
#> GSM99559 3 0.2589 0.816 0.000 0.000 0.884 0.116
#> GSM99561 2 0.4933 0.339 0.000 0.568 0.000 0.432
#> GSM99563 3 0.0921 0.833 0.000 0.000 0.972 0.028
#> GSM99565 2 0.1389 0.730 0.000 0.952 0.000 0.048
#> GSM99573 4 0.4877 0.328 0.000 0.328 0.008 0.664
#> GSM99577 4 0.6909 0.379 0.364 0.000 0.116 0.520
#> GSM99579 2 0.1302 0.726 0.000 0.956 0.000 0.044
#> GSM99581 3 0.3024 0.805 0.000 0.000 0.852 0.148
#> GSM99583 2 0.8805 0.122 0.072 0.468 0.236 0.224
#> GSM99585 2 0.3356 0.639 0.000 0.824 0.000 0.176
#> GSM99587 1 0.0592 0.965 0.984 0.000 0.000 0.016
#> GSM99589 2 0.3074 0.710 0.000 0.848 0.000 0.152
#> GSM99591 2 0.0336 0.731 0.000 0.992 0.000 0.008
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM99497 3 0.2344 0.8185 0.000 0.000 0.904 0.064 0.032
#> GSM99503 1 0.0486 0.9110 0.988 0.000 0.004 0.004 0.004
#> GSM99505 3 0.3080 0.7047 0.140 0.000 0.844 0.008 0.008
#> GSM99507 3 0.2171 0.8192 0.000 0.000 0.912 0.064 0.024
#> GSM99567 3 0.1281 0.8257 0.000 0.000 0.956 0.012 0.032
#> GSM99575 1 0.0451 0.9115 0.988 0.000 0.008 0.004 0.000
#> GSM99593 3 0.1893 0.8208 0.000 0.000 0.928 0.048 0.024
#> GSM99595 3 0.2782 0.8136 0.000 0.000 0.880 0.048 0.072
#> GSM99469 1 0.1412 0.9009 0.952 0.000 0.008 0.036 0.004
#> GSM99499 1 0.6169 0.2470 0.536 0.000 0.352 0.096 0.016
#> GSM99501 1 0.2971 0.8518 0.880 0.000 0.032 0.072 0.016
#> GSM99509 3 0.3427 0.7858 0.000 0.000 0.836 0.108 0.056
#> GSM99569 3 0.3690 0.7181 0.000 0.000 0.780 0.200 0.020
#> GSM99597 3 0.5793 0.3494 0.000 0.000 0.548 0.348 0.104
#> GSM99601 2 0.1732 0.7473 0.000 0.920 0.000 0.000 0.080
#> GSM99459 1 0.1270 0.8993 0.948 0.000 0.000 0.052 0.000
#> GSM99461 1 0.2329 0.8438 0.876 0.000 0.000 0.124 0.000
#> GSM99511 3 0.4237 0.7041 0.000 0.000 0.772 0.076 0.152
#> GSM99513 3 0.3841 0.7205 0.000 0.000 0.780 0.032 0.188
#> GSM99515 3 0.0912 0.8235 0.000 0.000 0.972 0.012 0.016
#> GSM99517 1 0.0324 0.9112 0.992 0.000 0.004 0.004 0.000
#> GSM99519 1 0.1671 0.8878 0.924 0.000 0.000 0.076 0.000
#> GSM99521 3 0.5630 0.3784 0.000 0.000 0.580 0.324 0.096
#> GSM99523 3 0.2325 0.8100 0.000 0.000 0.904 0.068 0.028
#> GSM99571 1 0.0162 0.9116 0.996 0.000 0.004 0.000 0.000
#> GSM99599 1 0.0000 0.9111 1.000 0.000 0.000 0.000 0.000
#> GSM99433 5 0.7176 0.1491 0.000 0.248 0.020 0.324 0.408
#> GSM99435 4 0.6523 0.4241 0.000 0.000 0.332 0.460 0.208
#> GSM99437 2 0.2921 0.7143 0.000 0.856 0.000 0.124 0.020
#> GSM99439 5 0.4305 0.0929 0.000 0.488 0.000 0.000 0.512
#> GSM99441 1 0.0000 0.9111 1.000 0.000 0.000 0.000 0.000
#> GSM99443 2 0.1082 0.7587 0.000 0.964 0.000 0.008 0.028
#> GSM99445 2 0.0290 0.7585 0.000 0.992 0.000 0.000 0.008
#> GSM99447 2 0.5724 0.2501 0.000 0.584 0.000 0.112 0.304
#> GSM99449 3 0.2653 0.7931 0.000 0.000 0.880 0.096 0.024
#> GSM99451 4 0.6454 0.4741 0.000 0.000 0.304 0.488 0.208
#> GSM99453 1 0.2629 0.8549 0.880 0.000 0.004 0.012 0.104
#> GSM99455 1 0.1285 0.9043 0.956 0.000 0.004 0.004 0.036
#> GSM99457 1 0.2233 0.8653 0.904 0.000 0.000 0.016 0.080
#> GSM99463 2 0.3983 0.3840 0.000 0.660 0.000 0.000 0.340
#> GSM99465 4 0.3265 0.4890 0.004 0.032 0.096 0.860 0.008
#> GSM99467 2 0.3669 0.6835 0.000 0.816 0.000 0.128 0.056
#> GSM99471 1 0.0324 0.9113 0.992 0.004 0.000 0.004 0.000
#> GSM99473 1 0.2142 0.8703 0.920 0.048 0.000 0.028 0.004
#> GSM99475 4 0.6458 0.5130 0.004 0.000 0.160 0.464 0.372
#> GSM99477 4 0.6789 0.0055 0.000 0.380 0.116 0.468 0.036
#> GSM99479 2 0.4096 0.6413 0.000 0.772 0.000 0.176 0.052
#> GSM99481 1 0.0162 0.9107 0.996 0.000 0.000 0.004 0.000
#> GSM99483 1 0.0693 0.9106 0.980 0.000 0.000 0.008 0.012
#> GSM99485 2 0.1877 0.7494 0.000 0.924 0.000 0.012 0.064
#> GSM99487 2 0.3399 0.6899 0.000 0.812 0.000 0.168 0.020
#> GSM99489 2 0.2358 0.7329 0.000 0.888 0.000 0.008 0.104
#> GSM99491 2 0.1557 0.7490 0.000 0.940 0.000 0.052 0.008
#> GSM99493 1 0.0290 0.9110 0.992 0.000 0.000 0.000 0.008
#> GSM99495 2 0.4182 0.2046 0.000 0.600 0.000 0.000 0.400
#> GSM99525 1 0.0162 0.9115 0.996 0.000 0.000 0.000 0.004
#> GSM99527 4 0.5844 0.5439 0.000 0.000 0.184 0.608 0.208
#> GSM99529 4 0.6282 0.1318 0.004 0.360 0.036 0.540 0.060
#> GSM99531 4 0.6309 0.4663 0.000 0.000 0.160 0.472 0.368
#> GSM99533 4 0.6069 0.5318 0.004 0.000 0.136 0.564 0.296
#> GSM99535 2 0.3120 0.7288 0.052 0.872 0.000 0.012 0.064
#> GSM99537 1 0.1800 0.8935 0.932 0.000 0.000 0.048 0.020
#> GSM99539 4 0.6386 0.4743 0.000 0.092 0.072 0.628 0.208
#> GSM99541 1 0.6959 -0.0917 0.436 0.000 0.036 0.392 0.136
#> GSM99543 2 0.4401 0.4361 0.004 0.684 0.000 0.016 0.296
#> GSM99545 5 0.4375 0.3328 0.000 0.084 0.024 0.096 0.796
#> GSM99547 4 0.9081 0.1830 0.136 0.044 0.212 0.308 0.300
#> GSM99549 5 0.3884 0.5328 0.000 0.288 0.000 0.004 0.708
#> GSM99551 5 0.5185 0.2300 0.220 0.004 0.000 0.092 0.684
#> GSM99553 3 0.2446 0.8159 0.000 0.000 0.900 0.056 0.044
#> GSM99555 2 0.3122 0.7244 0.000 0.852 0.004 0.024 0.120
#> GSM99557 2 0.2612 0.7191 0.000 0.868 0.000 0.008 0.124
#> GSM99559 3 0.1743 0.8241 0.000 0.004 0.940 0.028 0.028
#> GSM99561 5 0.5281 0.3678 0.000 0.400 0.000 0.052 0.548
#> GSM99563 3 0.2248 0.7993 0.000 0.000 0.900 0.088 0.012
#> GSM99565 2 0.2653 0.7366 0.000 0.880 0.000 0.096 0.024
#> GSM99573 5 0.3990 0.5094 0.000 0.308 0.000 0.004 0.688
#> GSM99577 5 0.5960 0.1292 0.256 0.000 0.032 0.084 0.628
#> GSM99579 2 0.2359 0.7455 0.000 0.904 0.000 0.060 0.036
#> GSM99581 3 0.2964 0.8036 0.000 0.000 0.856 0.120 0.024
#> GSM99583 2 0.7766 0.3203 0.040 0.540 0.208 0.144 0.068
#> GSM99585 2 0.5048 0.4660 0.000 0.612 0.016 0.352 0.020
#> GSM99587 1 0.0955 0.9070 0.968 0.000 0.000 0.004 0.028
#> GSM99589 2 0.2445 0.7306 0.000 0.884 0.004 0.004 0.108
#> GSM99591 2 0.0865 0.7569 0.000 0.972 0.000 0.024 0.004
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM99497 3 0.2454 0.7311 0.000 0.000 0.840 0.000 0.000 0.160
#> GSM99503 1 0.0260 0.8779 0.992 0.000 0.000 0.000 0.000 0.008
#> GSM99505 3 0.1785 0.7815 0.048 0.000 0.928 0.000 0.008 0.016
#> GSM99507 3 0.2146 0.7658 0.000 0.000 0.880 0.000 0.004 0.116
#> GSM99567 3 0.1321 0.7952 0.000 0.000 0.952 0.004 0.024 0.020
#> GSM99575 1 0.0551 0.8780 0.984 0.000 0.008 0.004 0.000 0.004
#> GSM99593 3 0.2259 0.7887 0.000 0.000 0.908 0.032 0.020 0.040
#> GSM99595 3 0.2320 0.7845 0.000 0.000 0.892 0.004 0.024 0.080
#> GSM99469 1 0.4117 0.6285 0.716 0.000 0.056 0.000 0.000 0.228
#> GSM99499 3 0.6590 -0.2188 0.304 0.000 0.368 0.004 0.016 0.308
#> GSM99501 1 0.5334 0.1984 0.512 0.000 0.112 0.000 0.000 0.376
#> GSM99509 3 0.2882 0.7099 0.000 0.000 0.812 0.000 0.008 0.180
#> GSM99569 3 0.4052 0.3299 0.000 0.000 0.628 0.016 0.000 0.356
#> GSM99597 6 0.4267 0.5633 0.000 0.000 0.272 0.012 0.028 0.688
#> GSM99601 2 0.1442 0.7576 0.000 0.944 0.000 0.004 0.040 0.012
#> GSM99459 1 0.2112 0.8377 0.896 0.000 0.000 0.088 0.000 0.016
#> GSM99461 1 0.4275 0.3957 0.592 0.000 0.000 0.388 0.004 0.016
#> GSM99511 3 0.4085 0.7042 0.000 0.000 0.792 0.044 0.088 0.076
#> GSM99513 3 0.3344 0.7398 0.000 0.000 0.828 0.008 0.104 0.060
#> GSM99515 3 0.0862 0.7944 0.000 0.000 0.972 0.004 0.008 0.016
#> GSM99517 1 0.0405 0.8778 0.988 0.000 0.000 0.004 0.000 0.008
#> GSM99519 1 0.2619 0.8347 0.880 0.000 0.000 0.072 0.008 0.040
#> GSM99521 6 0.5981 0.4149 0.000 0.000 0.368 0.076 0.056 0.500
#> GSM99523 3 0.2898 0.7672 0.000 0.000 0.868 0.056 0.016 0.060
#> GSM99571 1 0.0508 0.8783 0.984 0.000 0.004 0.000 0.000 0.012
#> GSM99599 1 0.0000 0.8776 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99433 4 0.4215 0.5226 0.000 0.016 0.008 0.704 0.260 0.012
#> GSM99435 4 0.5084 0.5561 0.000 0.000 0.056 0.676 0.216 0.052
#> GSM99437 2 0.3755 0.6837 0.000 0.768 0.000 0.192 0.012 0.028
#> GSM99439 5 0.4325 0.0700 0.000 0.480 0.000 0.008 0.504 0.008
#> GSM99441 1 0.0260 0.8775 0.992 0.000 0.000 0.000 0.000 0.008
#> GSM99443 2 0.1605 0.7614 0.000 0.940 0.000 0.032 0.016 0.012
#> GSM99445 2 0.0767 0.7641 0.000 0.976 0.000 0.012 0.008 0.004
#> GSM99447 4 0.6500 -0.0148 0.000 0.244 0.000 0.408 0.324 0.024
#> GSM99449 3 0.3486 0.7221 0.000 0.000 0.820 0.048 0.016 0.116
#> GSM99451 4 0.5577 0.5354 0.000 0.000 0.080 0.640 0.212 0.068
#> GSM99453 1 0.2704 0.8236 0.868 0.000 0.012 0.000 0.100 0.020
#> GSM99455 1 0.0935 0.8740 0.964 0.000 0.000 0.000 0.032 0.004
#> GSM99457 1 0.3343 0.7713 0.824 0.000 0.000 0.032 0.128 0.016
#> GSM99463 2 0.4093 0.3860 0.000 0.656 0.000 0.012 0.324 0.008
#> GSM99465 4 0.3415 0.4883 0.004 0.000 0.024 0.820 0.016 0.136
#> GSM99467 2 0.4258 0.6804 0.000 0.756 0.004 0.148 0.008 0.084
#> GSM99471 1 0.0405 0.8786 0.988 0.000 0.000 0.000 0.008 0.004
#> GSM99473 1 0.1065 0.8717 0.964 0.020 0.000 0.008 0.000 0.008
#> GSM99475 4 0.6119 0.4373 0.000 0.000 0.028 0.476 0.356 0.140
#> GSM99477 4 0.5744 0.3295 0.000 0.220 0.056 0.640 0.016 0.068
#> GSM99479 2 0.4278 0.6745 0.000 0.748 0.000 0.140 0.008 0.104
#> GSM99481 1 0.0260 0.8775 0.992 0.000 0.000 0.000 0.000 0.008
#> GSM99483 1 0.0725 0.8776 0.976 0.000 0.000 0.000 0.012 0.012
#> GSM99485 2 0.1485 0.7617 0.000 0.944 0.000 0.004 0.028 0.024
#> GSM99487 2 0.4759 0.5958 0.000 0.668 0.000 0.252 0.012 0.068
#> GSM99489 2 0.2207 0.7334 0.000 0.900 0.000 0.008 0.076 0.016
#> GSM99491 2 0.2414 0.7526 0.000 0.896 0.000 0.036 0.012 0.056
#> GSM99493 1 0.0622 0.8772 0.980 0.000 0.000 0.000 0.008 0.012
#> GSM99495 2 0.4371 0.3040 0.000 0.620 0.000 0.016 0.352 0.012
#> GSM99525 1 0.0146 0.8779 0.996 0.000 0.000 0.000 0.000 0.004
#> GSM99527 4 0.3559 0.5640 0.004 0.000 0.008 0.792 0.172 0.024
#> GSM99529 6 0.4470 0.4742 0.000 0.140 0.052 0.016 0.028 0.764
#> GSM99531 6 0.6031 0.3570 0.000 0.000 0.064 0.116 0.236 0.584
#> GSM99533 4 0.6145 0.4035 0.000 0.000 0.012 0.476 0.284 0.228
#> GSM99535 2 0.3960 0.7147 0.068 0.820 0.000 0.040 0.048 0.024
#> GSM99537 1 0.2115 0.8541 0.916 0.000 0.000 0.020 0.032 0.032
#> GSM99539 4 0.6712 0.1253 0.000 0.020 0.020 0.388 0.184 0.388
#> GSM99541 1 0.7650 -0.2021 0.348 0.000 0.008 0.264 0.132 0.248
#> GSM99543 2 0.4266 0.4771 0.000 0.700 0.000 0.008 0.252 0.040
#> GSM99545 5 0.4599 0.1358 0.000 0.040 0.008 0.236 0.700 0.016
#> GSM99547 4 0.6996 0.3841 0.024 0.016 0.064 0.536 0.252 0.108
#> GSM99549 5 0.3398 0.5654 0.000 0.252 0.000 0.008 0.740 0.000
#> GSM99551 5 0.4799 0.2360 0.104 0.004 0.000 0.144 0.724 0.024
#> GSM99553 3 0.2612 0.7755 0.000 0.000 0.868 0.008 0.016 0.108
#> GSM99555 2 0.4323 0.7085 0.000 0.776 0.000 0.060 0.092 0.072
#> GSM99557 2 0.2315 0.7284 0.000 0.892 0.000 0.008 0.084 0.016
#> GSM99559 3 0.2053 0.7872 0.000 0.024 0.916 0.004 0.004 0.052
#> GSM99561 5 0.5046 0.5151 0.000 0.256 0.000 0.020 0.648 0.076
#> GSM99563 3 0.3008 0.7584 0.000 0.000 0.864 0.036 0.032 0.068
#> GSM99565 2 0.4429 0.6587 0.000 0.732 0.000 0.188 0.024 0.056
#> GSM99573 5 0.3946 0.5343 0.000 0.284 0.004 0.012 0.696 0.004
#> GSM99577 5 0.5608 0.1904 0.152 0.000 0.016 0.016 0.644 0.172
#> GSM99579 2 0.3062 0.7321 0.000 0.844 0.000 0.024 0.016 0.116
#> GSM99581 3 0.2984 0.7561 0.000 0.000 0.848 0.044 0.004 0.104
#> GSM99583 2 0.7670 0.2452 0.024 0.468 0.200 0.092 0.016 0.200
#> GSM99585 4 0.5293 0.2338 0.000 0.296 0.008 0.612 0.016 0.068
#> GSM99587 1 0.1297 0.8695 0.948 0.000 0.000 0.000 0.040 0.012
#> GSM99589 2 0.2239 0.7380 0.000 0.900 0.000 0.008 0.072 0.020
#> GSM99591 2 0.0603 0.7649 0.000 0.980 0.000 0.016 0.004 0.000
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)
An example of the output of tb
is:
#> which_row fdr mean_1 mean_2 scaled_mean_1 scaled_mean_2 km
#> 1 38 0.042760348 8.373488 9.131774 -0.5533452 0.5164555 1
#> 2 40 0.018707592 7.106213 8.469186 -0.6173731 0.5762149 1
#> 3 55 0.019134737 10.221463 11.207825 -0.6159697 0.5749050 1
#> 4 59 0.006059896 5.921854 7.869574 -0.6899429 0.6439467 1
#> 5 60 0.018055526 8.928898 10.211722 -0.6204761 0.5791110 1
#> 6 98 0.009384629 15.714769 14.887706 0.6635654 -0.6193277 2
...
The columns in tb
are:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.km
: Row groups if k-means clustering is applied to rows.UMAP plot which shows how samples are separated.
dimension_reduction(res, k = 2, method = "UMAP")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.
test_to_known_factors(res)
#> n disease.state(p) cell.type(p) k
#> MAD:NMF 78 0.001072 0.004258 2
#> MAD:NMF 82 0.000391 0.006181 3
#> MAD:NMF 70 0.000905 0.009286 4
#> MAD:NMF 61 0.000882 0.026639 5
#> MAD:NMF 61 0.001078 0.000967 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 21512 rows and 85 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.330 0.630 0.813 0.4219 0.510 0.510
#> 3 3 0.531 0.725 0.859 0.4498 0.691 0.469
#> 4 4 0.581 0.656 0.797 0.1741 0.845 0.588
#> 5 5 0.639 0.639 0.775 0.0711 0.949 0.809
#> 6 6 0.673 0.599 0.767 0.0420 0.966 0.852
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
#> GSM99497 1 0.9170 0.6806 0.668 0.332
#> GSM99503 1 0.0000 0.7005 1.000 0.000
#> GSM99505 1 0.0672 0.7032 0.992 0.008
#> GSM99507 1 0.9170 0.6806 0.668 0.332
#> GSM99567 1 0.9170 0.6806 0.668 0.332
#> GSM99575 1 0.0000 0.7005 1.000 0.000
#> GSM99593 1 0.9209 0.6750 0.664 0.336
#> GSM99595 1 0.9170 0.6806 0.668 0.332
#> GSM99469 1 0.0672 0.7032 0.992 0.008
#> GSM99499 1 0.0672 0.7032 0.992 0.008
#> GSM99501 1 0.0672 0.7032 0.992 0.008
#> GSM99509 1 0.9170 0.6806 0.668 0.332
#> GSM99569 1 0.9170 0.6806 0.668 0.332
#> GSM99597 1 0.9170 0.6806 0.668 0.332
#> GSM99601 2 0.0376 0.7876 0.004 0.996
#> GSM99459 1 0.9044 0.6861 0.680 0.320
#> GSM99461 1 0.9044 0.6861 0.680 0.320
#> GSM99511 1 0.9170 0.6806 0.668 0.332
#> GSM99513 1 0.9170 0.6806 0.668 0.332
#> GSM99515 1 0.9170 0.6806 0.668 0.332
#> GSM99517 1 0.0000 0.7005 1.000 0.000
#> GSM99519 1 0.9044 0.6861 0.680 0.320
#> GSM99521 1 0.9170 0.6806 0.668 0.332
#> GSM99523 1 0.9170 0.6806 0.668 0.332
#> GSM99571 1 0.0000 0.7005 1.000 0.000
#> GSM99599 1 0.0000 0.7005 1.000 0.000
#> GSM99433 2 0.4815 0.7629 0.104 0.896
#> GSM99435 1 0.9286 0.6624 0.656 0.344
#> GSM99437 2 0.1414 0.7904 0.020 0.980
#> GSM99439 2 0.0000 0.7860 0.000 1.000
#> GSM99441 1 0.0000 0.7005 1.000 0.000
#> GSM99443 2 0.0000 0.7860 0.000 1.000
#> GSM99445 2 0.0000 0.7860 0.000 1.000
#> GSM99447 2 0.2778 0.7844 0.048 0.952
#> GSM99449 2 0.9933 -0.0474 0.452 0.548
#> GSM99451 1 0.9286 0.6622 0.656 0.344
#> GSM99453 1 0.0000 0.7005 1.000 0.000
#> GSM99455 1 0.0000 0.7005 1.000 0.000
#> GSM99457 1 0.0000 0.7005 1.000 0.000
#> GSM99463 2 0.0000 0.7860 0.000 1.000
#> GSM99465 1 0.9087 0.6847 0.676 0.324
#> GSM99467 2 0.9954 -0.0783 0.460 0.540
#> GSM99471 1 0.9209 0.5310 0.664 0.336
#> GSM99473 1 0.9209 0.5310 0.664 0.336
#> GSM99475 1 0.9170 0.6806 0.668 0.332
#> GSM99477 2 0.9954 -0.0783 0.460 0.540
#> GSM99479 2 0.9963 -0.0984 0.464 0.536
#> GSM99481 1 0.0000 0.7005 1.000 0.000
#> GSM99483 1 0.0000 0.7005 1.000 0.000
#> GSM99485 2 0.5178 0.7540 0.116 0.884
#> GSM99487 2 0.1414 0.7904 0.020 0.980
#> GSM99489 2 0.0000 0.7860 0.000 1.000
#> GSM99491 2 0.5294 0.7506 0.120 0.880
#> GSM99493 1 0.0000 0.7005 1.000 0.000
#> GSM99495 2 0.0000 0.7860 0.000 1.000
#> GSM99525 1 0.6712 0.6824 0.824 0.176
#> GSM99527 1 0.9552 0.6010 0.624 0.376
#> GSM99529 2 0.9963 -0.1029 0.464 0.536
#> GSM99531 1 0.9087 0.6847 0.676 0.324
#> GSM99533 1 0.9170 0.6806 0.668 0.332
#> GSM99535 2 0.8386 0.5333 0.268 0.732
#> GSM99537 1 0.0672 0.7032 0.992 0.008
#> GSM99539 2 0.4690 0.7650 0.100 0.900
#> GSM99541 1 0.0938 0.7037 0.988 0.012
#> GSM99543 2 0.1633 0.7877 0.024 0.976
#> GSM99545 2 0.1414 0.7899 0.020 0.980
#> GSM99547 2 0.9954 -0.0663 0.460 0.540
#> GSM99549 2 0.0000 0.7860 0.000 1.000
#> GSM99551 1 0.8144 0.5693 0.748 0.252
#> GSM99553 1 0.9977 0.3217 0.528 0.472
#> GSM99555 2 0.0938 0.7894 0.012 0.988
#> GSM99557 2 0.0376 0.7876 0.004 0.996
#> GSM99559 2 0.9909 -0.0114 0.444 0.556
#> GSM99561 2 0.5178 0.7540 0.116 0.884
#> GSM99563 1 0.9170 0.6806 0.668 0.332
#> GSM99565 2 0.1414 0.7904 0.020 0.980
#> GSM99573 2 0.0000 0.7860 0.000 1.000
#> GSM99577 1 0.0938 0.7037 0.988 0.012
#> GSM99579 2 0.5294 0.7506 0.120 0.880
#> GSM99581 1 0.9881 0.4449 0.564 0.436
#> GSM99583 2 0.9944 -0.0570 0.456 0.544
#> GSM99585 2 0.4815 0.7629 0.104 0.896
#> GSM99587 1 0.0000 0.7005 1.000 0.000
#> GSM99589 2 0.5408 0.7466 0.124 0.876
#> GSM99591 2 0.0000 0.7860 0.000 1.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM99497 3 0.0747 0.8651 0.016 0.000 0.984
#> GSM99503 1 0.0000 0.8528 1.000 0.000 0.000
#> GSM99505 1 0.5835 0.6209 0.660 0.000 0.340
#> GSM99507 3 0.0747 0.8651 0.016 0.000 0.984
#> GSM99567 3 0.0747 0.8651 0.016 0.000 0.984
#> GSM99575 1 0.0000 0.8528 1.000 0.000 0.000
#> GSM99593 3 0.0592 0.8637 0.012 0.000 0.988
#> GSM99595 3 0.0747 0.8651 0.016 0.000 0.984
#> GSM99469 1 0.5835 0.6209 0.660 0.000 0.340
#> GSM99499 1 0.5835 0.6209 0.660 0.000 0.340
#> GSM99501 1 0.5835 0.6209 0.660 0.000 0.340
#> GSM99509 3 0.0747 0.8651 0.016 0.000 0.984
#> GSM99569 3 0.0747 0.8651 0.016 0.000 0.984
#> GSM99597 3 0.0747 0.8651 0.016 0.000 0.984
#> GSM99601 2 0.1643 0.7442 0.000 0.956 0.044
#> GSM99459 3 0.1753 0.8461 0.048 0.000 0.952
#> GSM99461 3 0.1753 0.8461 0.048 0.000 0.952
#> GSM99511 3 0.0747 0.8651 0.016 0.000 0.984
#> GSM99513 3 0.0747 0.8651 0.016 0.000 0.984
#> GSM99515 3 0.0747 0.8651 0.016 0.000 0.984
#> GSM99517 1 0.0000 0.8528 1.000 0.000 0.000
#> GSM99519 3 0.1860 0.8430 0.052 0.000 0.948
#> GSM99521 3 0.0747 0.8651 0.016 0.000 0.984
#> GSM99523 3 0.0747 0.8651 0.016 0.000 0.984
#> GSM99571 1 0.0000 0.8528 1.000 0.000 0.000
#> GSM99599 1 0.0000 0.8528 1.000 0.000 0.000
#> GSM99433 2 0.6267 0.4588 0.000 0.548 0.452
#> GSM99435 3 0.0237 0.8602 0.004 0.000 0.996
#> GSM99437 2 0.5968 0.5978 0.000 0.636 0.364
#> GSM99439 2 0.0000 0.7353 0.000 1.000 0.000
#> GSM99441 1 0.0000 0.8528 1.000 0.000 0.000
#> GSM99443 2 0.0000 0.7353 0.000 1.000 0.000
#> GSM99445 2 0.0000 0.7353 0.000 1.000 0.000
#> GSM99447 2 0.4750 0.7025 0.000 0.784 0.216
#> GSM99449 3 0.4555 0.6840 0.000 0.200 0.800
#> GSM99451 3 0.0237 0.8601 0.004 0.000 0.996
#> GSM99453 1 0.0000 0.8528 1.000 0.000 0.000
#> GSM99455 1 0.0000 0.8528 1.000 0.000 0.000
#> GSM99457 1 0.0000 0.8528 1.000 0.000 0.000
#> GSM99463 2 0.0000 0.7353 0.000 1.000 0.000
#> GSM99465 3 0.1163 0.8588 0.028 0.000 0.972
#> GSM99467 3 0.4452 0.6983 0.000 0.192 0.808
#> GSM99471 3 0.8278 0.5117 0.248 0.132 0.620
#> GSM99473 3 0.8278 0.5117 0.248 0.132 0.620
#> GSM99475 3 0.0747 0.8651 0.016 0.000 0.984
#> GSM99477 3 0.4452 0.6983 0.000 0.192 0.808
#> GSM99479 3 0.4733 0.6996 0.004 0.196 0.800
#> GSM99481 1 0.0000 0.8528 1.000 0.000 0.000
#> GSM99483 1 0.0000 0.8528 1.000 0.000 0.000
#> GSM99485 2 0.6225 0.4841 0.000 0.568 0.432
#> GSM99487 2 0.5968 0.5978 0.000 0.636 0.364
#> GSM99489 2 0.0000 0.7353 0.000 1.000 0.000
#> GSM99491 2 0.6260 0.4527 0.000 0.552 0.448
#> GSM99493 1 0.0000 0.8528 1.000 0.000 0.000
#> GSM99495 2 0.0000 0.7353 0.000 1.000 0.000
#> GSM99525 1 0.6523 0.6225 0.724 0.048 0.228
#> GSM99527 3 0.1163 0.8456 0.000 0.028 0.972
#> GSM99529 3 0.5171 0.6960 0.012 0.204 0.784
#> GSM99531 3 0.1031 0.8607 0.024 0.000 0.976
#> GSM99533 3 0.0747 0.8651 0.016 0.000 0.984
#> GSM99535 3 0.6553 0.0503 0.008 0.412 0.580
#> GSM99537 1 0.3941 0.7862 0.844 0.000 0.156
#> GSM99539 2 0.6140 0.5423 0.000 0.596 0.404
#> GSM99541 1 0.5968 0.5848 0.636 0.000 0.364
#> GSM99543 2 0.1289 0.7371 0.000 0.968 0.032
#> GSM99545 2 0.4346 0.7186 0.000 0.816 0.184
#> GSM99547 3 0.4963 0.6821 0.008 0.200 0.792
#> GSM99549 2 0.0000 0.7353 0.000 1.000 0.000
#> GSM99551 3 0.9489 0.0920 0.352 0.192 0.456
#> GSM99553 3 0.4411 0.7684 0.016 0.140 0.844
#> GSM99555 2 0.4002 0.7250 0.000 0.840 0.160
#> GSM99557 2 0.1289 0.7431 0.000 0.968 0.032
#> GSM99559 3 0.4654 0.6722 0.000 0.208 0.792
#> GSM99561 2 0.6274 0.4414 0.000 0.544 0.456
#> GSM99563 3 0.0747 0.8651 0.016 0.000 0.984
#> GSM99565 2 0.5968 0.5978 0.000 0.636 0.364
#> GSM99573 2 0.0000 0.7353 0.000 1.000 0.000
#> GSM99577 1 0.5948 0.5914 0.640 0.000 0.360
#> GSM99579 2 0.6260 0.4527 0.000 0.552 0.448
#> GSM99581 3 0.3539 0.8020 0.012 0.100 0.888
#> GSM99583 3 0.4834 0.6801 0.004 0.204 0.792
#> GSM99585 2 0.6267 0.4588 0.000 0.548 0.452
#> GSM99587 1 0.0000 0.8528 1.000 0.000 0.000
#> GSM99589 2 0.6204 0.4989 0.000 0.576 0.424
#> GSM99591 2 0.0000 0.7353 0.000 1.000 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM99497 3 0.0336 0.8444 0.000 0.000 0.992 0.008
#> GSM99503 1 0.0000 0.8462 1.000 0.000 0.000 0.000
#> GSM99505 1 0.5807 0.6083 0.636 0.000 0.312 0.052
#> GSM99507 3 0.0336 0.8444 0.000 0.000 0.992 0.008
#> GSM99567 3 0.0336 0.8444 0.000 0.000 0.992 0.008
#> GSM99575 1 0.0000 0.8462 1.000 0.000 0.000 0.000
#> GSM99593 3 0.1022 0.8400 0.000 0.000 0.968 0.032
#> GSM99595 3 0.0592 0.8443 0.000 0.000 0.984 0.016
#> GSM99469 1 0.5807 0.6083 0.636 0.000 0.312 0.052
#> GSM99499 1 0.5807 0.6083 0.636 0.000 0.312 0.052
#> GSM99501 1 0.5807 0.6083 0.636 0.000 0.312 0.052
#> GSM99509 3 0.0469 0.8440 0.000 0.000 0.988 0.012
#> GSM99569 3 0.0000 0.8438 0.000 0.000 1.000 0.000
#> GSM99597 3 0.1302 0.8365 0.000 0.000 0.956 0.044
#> GSM99601 2 0.3157 0.7562 0.000 0.852 0.004 0.144
#> GSM99459 3 0.3806 0.7631 0.020 0.000 0.824 0.156
#> GSM99461 3 0.3806 0.7631 0.020 0.000 0.824 0.156
#> GSM99511 3 0.0592 0.8420 0.000 0.000 0.984 0.016
#> GSM99513 3 0.0592 0.8420 0.000 0.000 0.984 0.016
#> GSM99515 3 0.0336 0.8444 0.000 0.000 0.992 0.008
#> GSM99517 1 0.0000 0.8462 1.000 0.000 0.000 0.000
#> GSM99519 3 0.3862 0.7623 0.024 0.000 0.824 0.152
#> GSM99521 3 0.1940 0.8340 0.000 0.000 0.924 0.076
#> GSM99523 3 0.0000 0.8438 0.000 0.000 1.000 0.000
#> GSM99571 1 0.0000 0.8462 1.000 0.000 0.000 0.000
#> GSM99599 1 0.0000 0.8462 1.000 0.000 0.000 0.000
#> GSM99433 4 0.6820 0.5365 0.000 0.364 0.108 0.528
#> GSM99435 3 0.2345 0.7936 0.000 0.000 0.900 0.100
#> GSM99437 4 0.6755 0.3991 0.000 0.448 0.092 0.460
#> GSM99439 2 0.0592 0.8551 0.000 0.984 0.000 0.016
#> GSM99441 1 0.0000 0.8462 1.000 0.000 0.000 0.000
#> GSM99443 2 0.0000 0.8577 0.000 1.000 0.000 0.000
#> GSM99445 2 0.0000 0.8577 0.000 1.000 0.000 0.000
#> GSM99447 2 0.5423 0.3499 0.000 0.640 0.028 0.332
#> GSM99449 3 0.6371 -0.1354 0.000 0.064 0.508 0.428
#> GSM99451 3 0.2647 0.7998 0.000 0.000 0.880 0.120
#> GSM99453 1 0.0000 0.8462 1.000 0.000 0.000 0.000
#> GSM99455 1 0.0000 0.8462 1.000 0.000 0.000 0.000
#> GSM99457 1 0.0000 0.8462 1.000 0.000 0.000 0.000
#> GSM99463 2 0.0000 0.8577 0.000 1.000 0.000 0.000
#> GSM99465 3 0.3172 0.7765 0.000 0.000 0.840 0.160
#> GSM99467 4 0.5865 0.3503 0.000 0.036 0.412 0.552
#> GSM99471 4 0.6676 0.3241 0.244 0.012 0.108 0.636
#> GSM99473 4 0.6676 0.3241 0.244 0.012 0.108 0.636
#> GSM99475 3 0.2814 0.8134 0.000 0.000 0.868 0.132
#> GSM99477 4 0.5865 0.3503 0.000 0.036 0.412 0.552
#> GSM99479 4 0.5924 0.3629 0.000 0.040 0.404 0.556
#> GSM99481 1 0.0000 0.8462 1.000 0.000 0.000 0.000
#> GSM99483 1 0.0000 0.8462 1.000 0.000 0.000 0.000
#> GSM99485 4 0.6617 0.5218 0.000 0.380 0.088 0.532
#> GSM99487 4 0.6755 0.3991 0.000 0.448 0.092 0.460
#> GSM99489 2 0.0000 0.8577 0.000 1.000 0.000 0.000
#> GSM99491 4 0.6637 0.5380 0.000 0.368 0.092 0.540
#> GSM99493 1 0.0000 0.8462 1.000 0.000 0.000 0.000
#> GSM99495 2 0.0000 0.8577 0.000 1.000 0.000 0.000
#> GSM99525 1 0.5606 0.5554 0.724 0.008 0.068 0.200
#> GSM99527 3 0.3710 0.6815 0.000 0.004 0.804 0.192
#> GSM99529 4 0.5883 0.4707 0.000 0.060 0.300 0.640
#> GSM99531 3 0.3123 0.7830 0.000 0.000 0.844 0.156
#> GSM99533 3 0.2814 0.8134 0.000 0.000 0.868 0.132
#> GSM99535 4 0.6393 0.5561 0.008 0.236 0.100 0.656
#> GSM99537 1 0.3760 0.7749 0.836 0.000 0.136 0.028
#> GSM99539 4 0.6745 0.4378 0.000 0.428 0.092 0.480
#> GSM99541 1 0.5973 0.5729 0.612 0.000 0.332 0.056
#> GSM99543 2 0.1474 0.8344 0.000 0.948 0.000 0.052
#> GSM99545 2 0.5085 0.4503 0.000 0.676 0.020 0.304
#> GSM99547 4 0.5868 0.4876 0.008 0.040 0.308 0.644
#> GSM99549 2 0.2345 0.7865 0.000 0.900 0.000 0.100
#> GSM99551 4 0.5823 -0.0803 0.348 0.000 0.044 0.608
#> GSM99553 3 0.6178 -0.0575 0.004 0.040 0.484 0.472
#> GSM99555 2 0.4910 0.5016 0.000 0.704 0.020 0.276
#> GSM99557 2 0.2760 0.7767 0.000 0.872 0.000 0.128
#> GSM99559 3 0.6384 -0.1717 0.000 0.064 0.496 0.440
#> GSM99561 4 0.6575 0.5451 0.000 0.348 0.092 0.560
#> GSM99563 3 0.0000 0.8438 0.000 0.000 1.000 0.000
#> GSM99565 4 0.6755 0.3991 0.000 0.448 0.092 0.460
#> GSM99573 2 0.0592 0.8551 0.000 0.984 0.000 0.016
#> GSM99577 1 0.5955 0.5802 0.616 0.000 0.328 0.056
#> GSM99579 4 0.6637 0.5380 0.000 0.368 0.092 0.540
#> GSM99581 3 0.5213 0.3856 0.000 0.020 0.652 0.328
#> GSM99583 4 0.4810 0.5337 0.004 0.036 0.196 0.764
#> GSM99585 4 0.6773 0.5356 0.000 0.364 0.104 0.532
#> GSM99587 1 0.0000 0.8462 1.000 0.000 0.000 0.000
#> GSM99589 4 0.6785 0.4777 0.000 0.420 0.096 0.484
#> GSM99591 2 0.0000 0.8577 0.000 1.000 0.000 0.000
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM99497 3 0.0693 0.819 0.000 0.012 0.980 0.008 0.000
#> GSM99503 1 0.0162 0.781 0.996 0.000 0.000 0.004 0.000
#> GSM99505 1 0.5659 0.495 0.632 0.000 0.204 0.164 0.000
#> GSM99507 3 0.0693 0.819 0.000 0.012 0.980 0.008 0.000
#> GSM99567 3 0.0609 0.817 0.000 0.020 0.980 0.000 0.000
#> GSM99575 1 0.0162 0.781 0.996 0.000 0.000 0.004 0.000
#> GSM99593 3 0.2068 0.804 0.000 0.092 0.904 0.004 0.000
#> GSM99595 3 0.1211 0.820 0.000 0.024 0.960 0.016 0.000
#> GSM99469 1 0.5659 0.495 0.632 0.000 0.204 0.164 0.000
#> GSM99499 1 0.5659 0.495 0.632 0.000 0.204 0.164 0.000
#> GSM99501 1 0.5659 0.495 0.632 0.000 0.204 0.164 0.000
#> GSM99509 3 0.1012 0.819 0.000 0.012 0.968 0.020 0.000
#> GSM99569 3 0.0000 0.819 0.000 0.000 1.000 0.000 0.000
#> GSM99597 3 0.2074 0.798 0.000 0.000 0.896 0.104 0.000
#> GSM99601 5 0.3242 0.700 0.000 0.216 0.000 0.000 0.784
#> GSM99459 3 0.4697 0.586 0.020 0.000 0.592 0.388 0.000
#> GSM99461 3 0.4697 0.586 0.020 0.000 0.592 0.388 0.000
#> GSM99511 3 0.1549 0.814 0.000 0.040 0.944 0.016 0.000
#> GSM99513 3 0.1549 0.814 0.000 0.040 0.944 0.016 0.000
#> GSM99515 3 0.0693 0.819 0.000 0.012 0.980 0.008 0.000
#> GSM99517 1 0.0162 0.781 0.996 0.000 0.000 0.004 0.000
#> GSM99519 3 0.4768 0.585 0.024 0.000 0.592 0.384 0.000
#> GSM99521 3 0.3051 0.802 0.000 0.076 0.864 0.060 0.000
#> GSM99523 3 0.0000 0.819 0.000 0.000 1.000 0.000 0.000
#> GSM99571 1 0.0000 0.782 1.000 0.000 0.000 0.000 0.000
#> GSM99599 1 0.0162 0.781 0.996 0.000 0.000 0.004 0.000
#> GSM99433 2 0.4193 0.570 0.000 0.720 0.024 0.000 0.256
#> GSM99435 3 0.3639 0.755 0.000 0.144 0.812 0.044 0.000
#> GSM99437 2 0.4451 0.466 0.000 0.644 0.016 0.000 0.340
#> GSM99439 5 0.1216 0.829 0.000 0.020 0.000 0.020 0.960
#> GSM99441 1 0.0000 0.782 1.000 0.000 0.000 0.000 0.000
#> GSM99443 5 0.0290 0.835 0.000 0.008 0.000 0.000 0.992
#> GSM99445 5 0.0290 0.835 0.000 0.008 0.000 0.000 0.992
#> GSM99447 5 0.4730 0.296 0.000 0.416 0.012 0.004 0.568
#> GSM99449 2 0.4517 0.357 0.000 0.616 0.372 0.008 0.004
#> GSM99451 3 0.3888 0.762 0.000 0.120 0.804 0.076 0.000
#> GSM99453 1 0.0000 0.782 1.000 0.000 0.000 0.000 0.000
#> GSM99455 1 0.0000 0.782 1.000 0.000 0.000 0.000 0.000
#> GSM99457 1 0.0000 0.782 1.000 0.000 0.000 0.000 0.000
#> GSM99463 5 0.0162 0.834 0.000 0.004 0.000 0.000 0.996
#> GSM99465 3 0.4161 0.602 0.000 0.000 0.608 0.392 0.000
#> GSM99467 2 0.3635 0.503 0.000 0.748 0.248 0.004 0.000
#> GSM99471 4 0.6642 0.835 0.232 0.252 0.008 0.508 0.000
#> GSM99473 4 0.6642 0.835 0.232 0.252 0.008 0.508 0.000
#> GSM99475 3 0.4965 0.675 0.000 0.052 0.644 0.304 0.000
#> GSM99477 2 0.3635 0.503 0.000 0.748 0.248 0.004 0.000
#> GSM99479 2 0.4114 0.490 0.000 0.732 0.244 0.024 0.000
#> GSM99481 1 0.0000 0.782 1.000 0.000 0.000 0.000 0.000
#> GSM99483 1 0.0000 0.782 1.000 0.000 0.000 0.000 0.000
#> GSM99485 2 0.4818 0.554 0.000 0.676 0.012 0.028 0.284
#> GSM99487 2 0.4451 0.466 0.000 0.644 0.016 0.000 0.340
#> GSM99489 5 0.0162 0.834 0.000 0.004 0.000 0.000 0.996
#> GSM99491 2 0.4382 0.580 0.000 0.736 0.012 0.024 0.228
#> GSM99493 1 0.0000 0.782 1.000 0.000 0.000 0.000 0.000
#> GSM99495 5 0.0162 0.834 0.000 0.004 0.000 0.000 0.996
#> GSM99525 1 0.5083 0.246 0.712 0.136 0.004 0.148 0.000
#> GSM99527 3 0.4693 0.623 0.000 0.244 0.700 0.056 0.000
#> GSM99529 2 0.5033 0.419 0.000 0.716 0.156 0.124 0.004
#> GSM99531 3 0.4302 0.511 0.000 0.000 0.520 0.480 0.000
#> GSM99533 3 0.4965 0.675 0.000 0.052 0.644 0.304 0.000
#> GSM99535 2 0.6339 0.202 0.000 0.544 0.016 0.316 0.124
#> GSM99537 1 0.3535 0.672 0.832 0.000 0.080 0.088 0.000
#> GSM99539 2 0.4941 0.476 0.000 0.640 0.016 0.020 0.324
#> GSM99541 1 0.5847 0.467 0.608 0.000 0.204 0.188 0.000
#> GSM99543 5 0.2795 0.751 0.000 0.064 0.000 0.056 0.880
#> GSM99545 5 0.5126 0.430 0.000 0.356 0.004 0.040 0.600
#> GSM99547 2 0.6056 0.168 0.000 0.552 0.152 0.296 0.000
#> GSM99549 5 0.2424 0.769 0.000 0.000 0.000 0.132 0.868
#> GSM99551 4 0.5710 0.635 0.340 0.076 0.008 0.576 0.000
#> GSM99553 2 0.5953 0.248 0.000 0.540 0.336 0.124 0.000
#> GSM99555 5 0.4639 0.450 0.000 0.344 0.012 0.008 0.636
#> GSM99557 5 0.2966 0.728 0.000 0.184 0.000 0.000 0.816
#> GSM99559 2 0.4419 0.416 0.000 0.644 0.344 0.008 0.004
#> GSM99561 2 0.4110 0.574 0.000 0.736 0.012 0.008 0.244
#> GSM99563 3 0.0000 0.819 0.000 0.000 1.000 0.000 0.000
#> GSM99565 2 0.4451 0.466 0.000 0.644 0.016 0.000 0.340
#> GSM99573 5 0.1216 0.829 0.000 0.020 0.000 0.020 0.960
#> GSM99577 1 0.5819 0.474 0.612 0.000 0.200 0.188 0.000
#> GSM99579 2 0.4382 0.580 0.000 0.736 0.012 0.024 0.228
#> GSM99581 3 0.5065 0.121 0.000 0.420 0.544 0.036 0.000
#> GSM99583 2 0.5509 0.163 0.000 0.564 0.076 0.360 0.000
#> GSM99585 2 0.4260 0.568 0.000 0.720 0.020 0.004 0.256
#> GSM99587 1 0.0000 0.782 1.000 0.000 0.000 0.000 0.000
#> GSM99589 2 0.4669 0.535 0.000 0.692 0.012 0.024 0.272
#> GSM99591 5 0.0290 0.835 0.000 0.008 0.000 0.000 0.992
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM99497 3 0.0508 0.7526 0.000 0.004 0.984 0.012 0.000 0.000
#> GSM99503 1 0.0146 0.8180 0.996 0.000 0.000 0.004 0.000 0.000
#> GSM99505 1 0.4628 0.5790 0.632 0.000 0.052 0.312 0.000 0.004
#> GSM99507 3 0.0508 0.7526 0.000 0.004 0.984 0.012 0.000 0.000
#> GSM99567 3 0.0405 0.7538 0.000 0.008 0.988 0.004 0.000 0.000
#> GSM99575 1 0.0146 0.8180 0.996 0.000 0.000 0.004 0.000 0.000
#> GSM99593 3 0.2450 0.7183 0.000 0.116 0.868 0.016 0.000 0.000
#> GSM99595 3 0.1074 0.7522 0.000 0.012 0.960 0.028 0.000 0.000
#> GSM99469 1 0.4628 0.5790 0.632 0.000 0.052 0.312 0.000 0.004
#> GSM99499 1 0.4628 0.5790 0.632 0.000 0.052 0.312 0.000 0.004
#> GSM99501 1 0.4628 0.5790 0.632 0.000 0.052 0.312 0.000 0.004
#> GSM99509 3 0.1082 0.7408 0.000 0.004 0.956 0.040 0.000 0.000
#> GSM99569 3 0.0622 0.7510 0.000 0.000 0.980 0.012 0.000 0.008
#> GSM99597 3 0.3230 0.5184 0.000 0.000 0.776 0.212 0.000 0.012
#> GSM99601 5 0.3468 0.5887 0.000 0.284 0.000 0.004 0.712 0.000
#> GSM99459 4 0.4064 0.9156 0.020 0.000 0.336 0.644 0.000 0.000
#> GSM99461 4 0.4064 0.9156 0.020 0.000 0.336 0.644 0.000 0.000
#> GSM99511 3 0.2265 0.7420 0.000 0.056 0.904 0.028 0.000 0.012
#> GSM99513 3 0.2265 0.7420 0.000 0.056 0.904 0.028 0.000 0.012
#> GSM99515 3 0.0508 0.7526 0.000 0.004 0.984 0.012 0.000 0.000
#> GSM99517 1 0.0146 0.8180 0.996 0.000 0.000 0.004 0.000 0.000
#> GSM99519 4 0.4139 0.9117 0.024 0.000 0.336 0.640 0.000 0.000
#> GSM99521 3 0.3175 0.7015 0.000 0.088 0.832 0.080 0.000 0.000
#> GSM99523 3 0.0622 0.7510 0.000 0.000 0.980 0.012 0.000 0.008
#> GSM99571 1 0.0000 0.8187 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99599 1 0.0146 0.8180 0.996 0.000 0.000 0.004 0.000 0.000
#> GSM99433 2 0.3053 0.5920 0.000 0.812 0.012 0.004 0.172 0.000
#> GSM99435 3 0.4590 0.6272 0.000 0.168 0.728 0.080 0.000 0.024
#> GSM99437 2 0.3536 0.5084 0.000 0.736 0.004 0.008 0.252 0.000
#> GSM99439 5 0.3961 0.7024 0.000 0.028 0.000 0.036 0.776 0.160
#> GSM99441 1 0.0000 0.8187 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99443 5 0.0363 0.7538 0.000 0.012 0.000 0.000 0.988 0.000
#> GSM99445 5 0.0260 0.7537 0.000 0.008 0.000 0.000 0.992 0.000
#> GSM99447 5 0.4227 0.1977 0.000 0.492 0.000 0.004 0.496 0.008
#> GSM99449 2 0.4339 0.3746 0.000 0.648 0.316 0.032 0.000 0.004
#> GSM99451 3 0.4754 0.6182 0.000 0.136 0.720 0.120 0.000 0.024
#> GSM99453 1 0.0000 0.8187 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99455 1 0.0000 0.8187 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99457 1 0.0000 0.8187 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99463 5 0.0405 0.7532 0.000 0.004 0.000 0.000 0.988 0.008
#> GSM99465 4 0.3592 0.8927 0.000 0.000 0.344 0.656 0.000 0.000
#> GSM99467 2 0.3739 0.5128 0.000 0.776 0.176 0.040 0.000 0.008
#> GSM99471 6 0.7084 0.7036 0.232 0.132 0.000 0.176 0.000 0.460
#> GSM99473 6 0.7084 0.7036 0.232 0.132 0.000 0.176 0.000 0.460
#> GSM99475 3 0.5581 -0.2607 0.000 0.044 0.464 0.444 0.000 0.048
#> GSM99477 2 0.3739 0.5128 0.000 0.776 0.176 0.040 0.000 0.008
#> GSM99479 2 0.4206 0.5028 0.000 0.756 0.172 0.036 0.000 0.036
#> GSM99481 1 0.0000 0.8187 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99483 1 0.0000 0.8187 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99485 2 0.3858 0.5556 0.000 0.732 0.000 0.004 0.236 0.028
#> GSM99487 2 0.3536 0.5084 0.000 0.736 0.004 0.008 0.252 0.000
#> GSM99489 5 0.0405 0.7532 0.000 0.004 0.000 0.000 0.988 0.008
#> GSM99491 2 0.4180 0.5701 0.000 0.752 0.000 0.004 0.112 0.132
#> GSM99493 1 0.0000 0.8187 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99495 5 0.0405 0.7532 0.000 0.004 0.000 0.000 0.988 0.008
#> GSM99525 1 0.4411 0.3945 0.712 0.080 0.000 0.004 0.000 0.204
#> GSM99527 3 0.5649 0.4487 0.000 0.264 0.588 0.124 0.000 0.024
#> GSM99529 2 0.5351 0.4189 0.000 0.688 0.084 0.100 0.000 0.128
#> GSM99531 4 0.3073 0.7381 0.000 0.000 0.204 0.788 0.000 0.008
#> GSM99533 3 0.5581 -0.2607 0.000 0.044 0.464 0.444 0.000 0.048
#> GSM99535 6 0.4486 -0.0282 0.000 0.384 0.000 0.004 0.028 0.584
#> GSM99537 1 0.2821 0.7309 0.832 0.000 0.016 0.152 0.000 0.000
#> GSM99539 2 0.3934 0.5006 0.000 0.728 0.000 0.012 0.240 0.020
#> GSM99541 1 0.4594 0.5518 0.608 0.000 0.052 0.340 0.000 0.000
#> GSM99543 5 0.4743 0.4786 0.000 0.008 0.000 0.044 0.600 0.348
#> GSM99545 5 0.5285 0.3175 0.000 0.416 0.000 0.036 0.512 0.036
#> GSM99547 2 0.5766 -0.0645 0.000 0.476 0.088 0.028 0.000 0.408
#> GSM99549 5 0.5000 0.5296 0.000 0.000 0.000 0.088 0.580 0.332
#> GSM99551 6 0.6049 0.4898 0.340 0.004 0.000 0.220 0.000 0.436
#> GSM99553 2 0.6701 0.2440 0.000 0.492 0.276 0.096 0.000 0.136
#> GSM99555 5 0.4178 0.3440 0.000 0.428 0.000 0.004 0.560 0.008
#> GSM99557 5 0.3488 0.6230 0.000 0.244 0.000 0.004 0.744 0.008
#> GSM99559 2 0.4216 0.4236 0.000 0.676 0.288 0.032 0.000 0.004
#> GSM99561 2 0.2810 0.5939 0.000 0.832 0.000 0.004 0.156 0.008
#> GSM99563 3 0.0622 0.7510 0.000 0.000 0.980 0.012 0.000 0.008
#> GSM99565 2 0.3536 0.5084 0.000 0.736 0.004 0.008 0.252 0.000
#> GSM99573 5 0.3961 0.7024 0.000 0.028 0.000 0.036 0.776 0.160
#> GSM99577 1 0.4580 0.5573 0.612 0.000 0.052 0.336 0.000 0.000
#> GSM99579 2 0.4180 0.5701 0.000 0.752 0.000 0.004 0.112 0.132
#> GSM99581 3 0.5011 0.0899 0.000 0.420 0.508 0.072 0.000 0.000
#> GSM99583 2 0.6256 0.1019 0.000 0.516 0.040 0.160 0.000 0.284
#> GSM99585 2 0.3096 0.5903 0.000 0.812 0.008 0.004 0.172 0.004
#> GSM99587 1 0.0000 0.8187 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99589 2 0.4771 0.5261 0.000 0.688 0.000 0.004 0.144 0.164
#> GSM99591 5 0.0363 0.7537 0.000 0.012 0.000 0.000 0.988 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 disease.state(p) cell.type(p) k
#> ATC:hclust 75 7.09e-05 0.000379 2
#> ATC:hclust 76 8.89e-03 0.085844 3
#> ATC:hclust 66 3.90e-04 0.016753 4
#> ATC:hclust 62 3.70e-04 0.029071 5
#> ATC:hclust 68 4.01e-05 0.001757 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 21512 rows and 85 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'ATC' method.
#> Subgroups are detected by 'kmeans' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 3.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 0.644 0.936 0.951 0.4732 0.525 0.525
#> 3 3 1.000 0.989 0.994 0.4243 0.757 0.556
#> 4 4 0.757 0.756 0.824 0.0951 0.876 0.654
#> 5 5 0.703 0.650 0.770 0.0623 0.936 0.765
#> 6 6 0.720 0.520 0.716 0.0461 0.919 0.681
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
#> GSM99497 1 0.644 0.888 0.836 0.164
#> GSM99503 1 0.000 0.916 1.000 0.000
#> GSM99505 1 0.000 0.916 1.000 0.000
#> GSM99507 1 0.644 0.888 0.836 0.164
#> GSM99567 1 0.644 0.888 0.836 0.164
#> GSM99575 1 0.000 0.916 1.000 0.000
#> GSM99593 1 0.662 0.882 0.828 0.172
#> GSM99595 1 0.644 0.888 0.836 0.164
#> GSM99469 1 0.000 0.916 1.000 0.000
#> GSM99499 1 0.000 0.916 1.000 0.000
#> GSM99501 1 0.000 0.916 1.000 0.000
#> GSM99509 1 0.584 0.898 0.860 0.140
#> GSM99569 1 0.584 0.898 0.860 0.140
#> GSM99597 1 0.184 0.914 0.972 0.028
#> GSM99601 2 0.000 1.000 0.000 1.000
#> GSM99459 1 0.000 0.916 1.000 0.000
#> GSM99461 1 0.000 0.916 1.000 0.000
#> GSM99511 1 0.644 0.888 0.836 0.164
#> GSM99513 1 0.644 0.888 0.836 0.164
#> GSM99515 1 0.644 0.888 0.836 0.164
#> GSM99517 1 0.000 0.916 1.000 0.000
#> GSM99519 1 0.000 0.916 1.000 0.000
#> GSM99521 1 0.644 0.888 0.836 0.164
#> GSM99523 1 0.402 0.909 0.920 0.080
#> GSM99571 1 0.000 0.916 1.000 0.000
#> GSM99599 1 0.000 0.916 1.000 0.000
#> GSM99433 2 0.000 1.000 0.000 1.000
#> GSM99435 1 0.689 0.871 0.816 0.184
#> GSM99437 2 0.000 1.000 0.000 1.000
#> GSM99439 2 0.000 1.000 0.000 1.000
#> GSM99441 1 0.000 0.916 1.000 0.000
#> GSM99443 2 0.000 1.000 0.000 1.000
#> GSM99445 2 0.000 1.000 0.000 1.000
#> GSM99447 2 0.000 1.000 0.000 1.000
#> GSM99449 2 0.000 1.000 0.000 1.000
#> GSM99451 1 0.644 0.888 0.836 0.164
#> GSM99453 1 0.000 0.916 1.000 0.000
#> GSM99455 1 0.000 0.916 1.000 0.000
#> GSM99457 1 0.000 0.916 1.000 0.000
#> GSM99463 2 0.000 1.000 0.000 1.000
#> GSM99465 1 0.584 0.898 0.860 0.140
#> GSM99467 2 0.000 1.000 0.000 1.000
#> GSM99471 1 0.388 0.910 0.924 0.076
#> GSM99473 1 0.000 0.916 1.000 0.000
#> GSM99475 1 0.644 0.888 0.836 0.164
#> GSM99477 2 0.000 1.000 0.000 1.000
#> GSM99479 2 0.000 1.000 0.000 1.000
#> GSM99481 1 0.000 0.916 1.000 0.000
#> GSM99483 1 0.000 0.916 1.000 0.000
#> GSM99485 2 0.000 1.000 0.000 1.000
#> GSM99487 2 0.000 1.000 0.000 1.000
#> GSM99489 2 0.000 1.000 0.000 1.000
#> GSM99491 2 0.000 1.000 0.000 1.000
#> GSM99493 1 0.000 0.916 1.000 0.000
#> GSM99495 2 0.000 1.000 0.000 1.000
#> GSM99525 1 0.000 0.916 1.000 0.000
#> GSM99527 1 0.671 0.878 0.824 0.176
#> GSM99529 1 0.671 0.878 0.824 0.176
#> GSM99531 1 0.494 0.905 0.892 0.108
#> GSM99533 1 0.605 0.895 0.852 0.148
#> GSM99535 2 0.000 1.000 0.000 1.000
#> GSM99537 1 0.000 0.916 1.000 0.000
#> GSM99539 2 0.000 1.000 0.000 1.000
#> GSM99541 1 0.000 0.916 1.000 0.000
#> GSM99543 2 0.000 1.000 0.000 1.000
#> GSM99545 2 0.000 1.000 0.000 1.000
#> GSM99547 1 0.939 0.611 0.644 0.356
#> GSM99549 2 0.000 1.000 0.000 1.000
#> GSM99551 1 0.000 0.916 1.000 0.000
#> GSM99553 1 0.644 0.888 0.836 0.164
#> GSM99555 2 0.000 1.000 0.000 1.000
#> GSM99557 2 0.000 1.000 0.000 1.000
#> GSM99559 2 0.000 1.000 0.000 1.000
#> GSM99561 2 0.000 1.000 0.000 1.000
#> GSM99563 1 0.584 0.898 0.860 0.140
#> GSM99565 2 0.000 1.000 0.000 1.000
#> GSM99573 2 0.000 1.000 0.000 1.000
#> GSM99577 1 0.000 0.916 1.000 0.000
#> GSM99579 2 0.000 1.000 0.000 1.000
#> GSM99581 1 0.644 0.888 0.836 0.164
#> GSM99583 1 0.653 0.885 0.832 0.168
#> GSM99585 2 0.000 1.000 0.000 1.000
#> GSM99587 1 0.000 0.916 1.000 0.000
#> GSM99589 2 0.000 1.000 0.000 1.000
#> GSM99591 2 0.000 1.000 0.000 1.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM99497 3 0.0000 1.000 0.000 0.000 1.000
#> GSM99503 1 0.0000 0.986 1.000 0.000 0.000
#> GSM99505 1 0.1289 0.966 0.968 0.000 0.032
#> GSM99507 3 0.0000 1.000 0.000 0.000 1.000
#> GSM99567 3 0.0000 1.000 0.000 0.000 1.000
#> GSM99575 1 0.0000 0.986 1.000 0.000 0.000
#> GSM99593 3 0.0000 1.000 0.000 0.000 1.000
#> GSM99595 3 0.0000 1.000 0.000 0.000 1.000
#> GSM99469 1 0.0000 0.986 1.000 0.000 0.000
#> GSM99499 1 0.0000 0.986 1.000 0.000 0.000
#> GSM99501 1 0.0000 0.986 1.000 0.000 0.000
#> GSM99509 3 0.0000 1.000 0.000 0.000 1.000
#> GSM99569 3 0.0000 1.000 0.000 0.000 1.000
#> GSM99597 3 0.0000 1.000 0.000 0.000 1.000
#> GSM99601 2 0.0000 0.996 0.000 1.000 0.000
#> GSM99459 1 0.1289 0.966 0.968 0.000 0.032
#> GSM99461 1 0.1289 0.966 0.968 0.000 0.032
#> GSM99511 3 0.0000 1.000 0.000 0.000 1.000
#> GSM99513 3 0.0000 1.000 0.000 0.000 1.000
#> GSM99515 3 0.0000 1.000 0.000 0.000 1.000
#> GSM99517 1 0.0000 0.986 1.000 0.000 0.000
#> GSM99519 1 0.1289 0.966 0.968 0.000 0.032
#> GSM99521 3 0.0000 1.000 0.000 0.000 1.000
#> GSM99523 3 0.0000 1.000 0.000 0.000 1.000
#> GSM99571 1 0.0000 0.986 1.000 0.000 0.000
#> GSM99599 1 0.0000 0.986 1.000 0.000 0.000
#> GSM99433 2 0.0000 0.996 0.000 1.000 0.000
#> GSM99435 3 0.0000 1.000 0.000 0.000 1.000
#> GSM99437 2 0.0000 0.996 0.000 1.000 0.000
#> GSM99439 2 0.0000 0.996 0.000 1.000 0.000
#> GSM99441 1 0.0000 0.986 1.000 0.000 0.000
#> GSM99443 2 0.0000 0.996 0.000 1.000 0.000
#> GSM99445 2 0.0000 0.996 0.000 1.000 0.000
#> GSM99447 2 0.0000 0.996 0.000 1.000 0.000
#> GSM99449 3 0.0000 1.000 0.000 0.000 1.000
#> GSM99451 3 0.0000 1.000 0.000 0.000 1.000
#> GSM99453 1 0.0000 0.986 1.000 0.000 0.000
#> GSM99455 1 0.0000 0.986 1.000 0.000 0.000
#> GSM99457 1 0.0000 0.986 1.000 0.000 0.000
#> GSM99463 2 0.0000 0.996 0.000 1.000 0.000
#> GSM99465 3 0.0000 1.000 0.000 0.000 1.000
#> GSM99467 2 0.1163 0.969 0.000 0.972 0.028
#> GSM99471 1 0.4555 0.754 0.800 0.000 0.200
#> GSM99473 1 0.0000 0.986 1.000 0.000 0.000
#> GSM99475 3 0.0000 1.000 0.000 0.000 1.000
#> GSM99477 3 0.0000 1.000 0.000 0.000 1.000
#> GSM99479 2 0.2796 0.900 0.000 0.908 0.092
#> GSM99481 1 0.0000 0.986 1.000 0.000 0.000
#> GSM99483 1 0.0000 0.986 1.000 0.000 0.000
#> GSM99485 2 0.0000 0.996 0.000 1.000 0.000
#> GSM99487 2 0.0000 0.996 0.000 1.000 0.000
#> GSM99489 2 0.0000 0.996 0.000 1.000 0.000
#> GSM99491 2 0.0000 0.996 0.000 1.000 0.000
#> GSM99493 1 0.0000 0.986 1.000 0.000 0.000
#> GSM99495 2 0.0000 0.996 0.000 1.000 0.000
#> GSM99525 1 0.0000 0.986 1.000 0.000 0.000
#> GSM99527 3 0.0000 1.000 0.000 0.000 1.000
#> GSM99529 3 0.0000 1.000 0.000 0.000 1.000
#> GSM99531 3 0.0000 1.000 0.000 0.000 1.000
#> GSM99533 3 0.0000 1.000 0.000 0.000 1.000
#> GSM99535 2 0.0000 0.996 0.000 1.000 0.000
#> GSM99537 1 0.0000 0.986 1.000 0.000 0.000
#> GSM99539 2 0.0000 0.996 0.000 1.000 0.000
#> GSM99541 1 0.1289 0.966 0.968 0.000 0.032
#> GSM99543 2 0.0000 0.996 0.000 1.000 0.000
#> GSM99545 2 0.0000 0.996 0.000 1.000 0.000
#> GSM99547 3 0.0237 0.996 0.000 0.004 0.996
#> GSM99549 2 0.0000 0.996 0.000 1.000 0.000
#> GSM99551 1 0.0000 0.986 1.000 0.000 0.000
#> GSM99553 3 0.0000 1.000 0.000 0.000 1.000
#> GSM99555 2 0.0000 0.996 0.000 1.000 0.000
#> GSM99557 2 0.0000 0.996 0.000 1.000 0.000
#> GSM99559 3 0.0000 1.000 0.000 0.000 1.000
#> GSM99561 2 0.0000 0.996 0.000 1.000 0.000
#> GSM99563 3 0.0000 1.000 0.000 0.000 1.000
#> GSM99565 2 0.0000 0.996 0.000 1.000 0.000
#> GSM99573 2 0.0000 0.996 0.000 1.000 0.000
#> GSM99577 1 0.0000 0.986 1.000 0.000 0.000
#> GSM99579 2 0.0000 0.996 0.000 1.000 0.000
#> GSM99581 3 0.0000 1.000 0.000 0.000 1.000
#> GSM99583 3 0.0000 1.000 0.000 0.000 1.000
#> GSM99585 2 0.0000 0.996 0.000 1.000 0.000
#> GSM99587 1 0.0000 0.986 1.000 0.000 0.000
#> GSM99589 2 0.0000 0.996 0.000 1.000 0.000
#> GSM99591 2 0.0000 0.996 0.000 1.000 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM99497 3 0.0188 0.9495 0.000 0.000 0.996 0.004
#> GSM99503 1 0.0921 0.8879 0.972 0.000 0.000 0.028
#> GSM99505 1 0.3398 0.8564 0.872 0.000 0.068 0.060
#> GSM99507 3 0.0188 0.9495 0.000 0.000 0.996 0.004
#> GSM99567 3 0.0000 0.9495 0.000 0.000 1.000 0.000
#> GSM99575 1 0.0921 0.8879 0.972 0.000 0.000 0.028
#> GSM99593 3 0.0336 0.9483 0.000 0.000 0.992 0.008
#> GSM99595 3 0.0000 0.9495 0.000 0.000 1.000 0.000
#> GSM99469 1 0.1716 0.8801 0.936 0.000 0.000 0.064
#> GSM99499 1 0.1637 0.8805 0.940 0.000 0.000 0.060
#> GSM99501 1 0.1824 0.8800 0.936 0.000 0.004 0.060
#> GSM99509 3 0.0188 0.9495 0.000 0.000 0.996 0.004
#> GSM99569 3 0.0336 0.9496 0.000 0.000 0.992 0.008
#> GSM99597 3 0.1389 0.9255 0.000 0.000 0.952 0.048
#> GSM99601 2 0.4977 -0.7389 0.000 0.540 0.000 0.460
#> GSM99459 1 0.4139 0.8356 0.816 0.000 0.040 0.144
#> GSM99461 1 0.4174 0.8348 0.816 0.000 0.044 0.140
#> GSM99511 3 0.0469 0.9483 0.000 0.000 0.988 0.012
#> GSM99513 3 0.0469 0.9483 0.000 0.000 0.988 0.012
#> GSM99515 3 0.0188 0.9495 0.000 0.000 0.996 0.004
#> GSM99517 1 0.0921 0.8879 0.972 0.000 0.000 0.028
#> GSM99519 1 0.4123 0.8370 0.820 0.000 0.044 0.136
#> GSM99521 3 0.0336 0.9489 0.000 0.000 0.992 0.008
#> GSM99523 3 0.0469 0.9491 0.000 0.000 0.988 0.012
#> GSM99571 1 0.3444 0.8642 0.816 0.000 0.000 0.184
#> GSM99599 1 0.1302 0.8878 0.956 0.000 0.000 0.044
#> GSM99433 2 0.1661 0.6436 0.000 0.944 0.004 0.052
#> GSM99435 3 0.1970 0.9250 0.000 0.008 0.932 0.060
#> GSM99437 2 0.2704 0.4638 0.000 0.876 0.000 0.124
#> GSM99439 4 0.4855 0.9726 0.000 0.400 0.000 0.600
#> GSM99441 1 0.1302 0.8878 0.956 0.000 0.000 0.044
#> GSM99443 4 0.4999 0.8264 0.000 0.492 0.000 0.508
#> GSM99445 4 0.4916 0.9518 0.000 0.424 0.000 0.576
#> GSM99447 2 0.0336 0.6347 0.000 0.992 0.000 0.008
#> GSM99449 2 0.6336 0.0803 0.000 0.480 0.460 0.060
#> GSM99451 3 0.1635 0.9337 0.000 0.008 0.948 0.044
#> GSM99453 1 0.3486 0.8630 0.812 0.000 0.000 0.188
#> GSM99455 1 0.3172 0.8667 0.840 0.000 0.000 0.160
#> GSM99457 1 0.3444 0.8642 0.816 0.000 0.000 0.184
#> GSM99463 4 0.4855 0.9726 0.000 0.400 0.000 0.600
#> GSM99465 3 0.3636 0.8540 0.000 0.008 0.820 0.172
#> GSM99467 2 0.1978 0.6392 0.000 0.928 0.004 0.068
#> GSM99471 1 0.8301 0.4731 0.480 0.240 0.032 0.248
#> GSM99473 1 0.4418 0.8308 0.784 0.032 0.000 0.184
#> GSM99475 3 0.1890 0.9275 0.000 0.008 0.936 0.056
#> GSM99477 2 0.6299 0.4179 0.000 0.600 0.320 0.080
#> GSM99479 2 0.2255 0.6365 0.000 0.920 0.012 0.068
#> GSM99481 1 0.1716 0.8859 0.936 0.000 0.000 0.064
#> GSM99483 1 0.3172 0.8667 0.840 0.000 0.000 0.160
#> GSM99485 2 0.0469 0.6368 0.000 0.988 0.000 0.012
#> GSM99487 2 0.0469 0.6319 0.000 0.988 0.000 0.012
#> GSM99489 4 0.4855 0.9726 0.000 0.400 0.000 0.600
#> GSM99491 2 0.0336 0.6347 0.000 0.992 0.000 0.008
#> GSM99493 1 0.3444 0.8642 0.816 0.000 0.000 0.184
#> GSM99495 4 0.4855 0.9726 0.000 0.400 0.000 0.600
#> GSM99525 1 0.2973 0.8744 0.856 0.000 0.000 0.144
#> GSM99527 3 0.6506 0.5174 0.000 0.240 0.628 0.132
#> GSM99529 2 0.7126 0.3891 0.000 0.552 0.272 0.176
#> GSM99531 3 0.2704 0.8809 0.000 0.000 0.876 0.124
#> GSM99533 3 0.3351 0.8680 0.000 0.008 0.844 0.148
#> GSM99535 2 0.1211 0.6341 0.000 0.960 0.000 0.040
#> GSM99537 1 0.1637 0.8857 0.940 0.000 0.000 0.060
#> GSM99539 2 0.1398 0.6441 0.000 0.956 0.004 0.040
#> GSM99541 1 0.4181 0.8362 0.820 0.000 0.052 0.128
#> GSM99543 2 0.4972 -0.7139 0.000 0.544 0.000 0.456
#> GSM99545 2 0.2466 0.5397 0.000 0.900 0.004 0.096
#> GSM99547 2 0.6685 0.3848 0.000 0.568 0.324 0.108
#> GSM99549 4 0.4855 0.9726 0.000 0.400 0.000 0.600
#> GSM99551 1 0.3726 0.8576 0.788 0.000 0.000 0.212
#> GSM99553 3 0.2032 0.9154 0.000 0.028 0.936 0.036
#> GSM99555 2 0.3266 0.3523 0.000 0.832 0.000 0.168
#> GSM99557 4 0.4855 0.9726 0.000 0.400 0.000 0.600
#> GSM99559 2 0.5985 0.3905 0.000 0.596 0.352 0.052
#> GSM99561 2 0.0000 0.6384 0.000 1.000 0.000 0.000
#> GSM99563 3 0.0469 0.9491 0.000 0.000 0.988 0.012
#> GSM99565 2 0.2704 0.4638 0.000 0.876 0.000 0.124
#> GSM99573 4 0.4855 0.9726 0.000 0.400 0.000 0.600
#> GSM99577 1 0.2704 0.8750 0.876 0.000 0.000 0.124
#> GSM99579 2 0.0336 0.6347 0.000 0.992 0.000 0.008
#> GSM99581 3 0.0469 0.9493 0.000 0.000 0.988 0.012
#> GSM99583 2 0.6619 0.3825 0.000 0.568 0.332 0.100
#> GSM99585 2 0.1637 0.6426 0.000 0.940 0.000 0.060
#> GSM99587 1 0.3444 0.8642 0.816 0.000 0.000 0.184
#> GSM99589 2 0.0707 0.6242 0.000 0.980 0.000 0.020
#> GSM99591 4 0.4916 0.9518 0.000 0.424 0.000 0.576
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM99497 3 0.0162 0.89697 0.000 0.000 0.996 0.004 0.000
#> GSM99503 1 0.4298 0.27518 0.640 0.000 0.000 0.352 0.008
#> GSM99505 1 0.3586 0.48119 0.828 0.000 0.076 0.096 0.000
#> GSM99507 3 0.0162 0.89697 0.000 0.000 0.996 0.004 0.000
#> GSM99567 3 0.0162 0.89697 0.000 0.000 0.996 0.004 0.000
#> GSM99575 1 0.4298 0.27518 0.640 0.000 0.000 0.352 0.008
#> GSM99593 3 0.0992 0.89485 0.000 0.008 0.968 0.024 0.000
#> GSM99595 3 0.0290 0.89702 0.000 0.000 0.992 0.008 0.000
#> GSM99469 1 0.2605 0.50001 0.852 0.000 0.000 0.148 0.000
#> GSM99499 1 0.2648 0.49729 0.848 0.000 0.000 0.152 0.000
#> GSM99501 1 0.2605 0.50001 0.852 0.000 0.000 0.148 0.000
#> GSM99509 3 0.0162 0.89697 0.000 0.000 0.996 0.004 0.000
#> GSM99569 3 0.0451 0.89662 0.000 0.000 0.988 0.008 0.004
#> GSM99597 3 0.0960 0.89229 0.016 0.000 0.972 0.004 0.008
#> GSM99601 5 0.5028 0.46497 0.000 0.400 0.000 0.036 0.564
#> GSM99459 1 0.2073 0.46028 0.932 0.004 0.020 0.020 0.024
#> GSM99461 1 0.1871 0.46631 0.940 0.004 0.020 0.012 0.024
#> GSM99511 3 0.1116 0.89379 0.000 0.004 0.964 0.028 0.004
#> GSM99513 3 0.1116 0.89379 0.000 0.004 0.964 0.028 0.004
#> GSM99515 3 0.0162 0.89697 0.000 0.000 0.996 0.004 0.000
#> GSM99517 1 0.4298 0.27518 0.640 0.000 0.000 0.352 0.008
#> GSM99519 1 0.1758 0.46857 0.944 0.004 0.020 0.008 0.024
#> GSM99521 3 0.1043 0.89067 0.000 0.000 0.960 0.040 0.000
#> GSM99523 3 0.1074 0.89232 0.016 0.000 0.968 0.012 0.004
#> GSM99571 4 0.4446 0.57465 0.400 0.000 0.000 0.592 0.008
#> GSM99599 1 0.4504 0.00108 0.564 0.000 0.000 0.428 0.008
#> GSM99433 2 0.1018 0.81333 0.000 0.968 0.000 0.016 0.016
#> GSM99435 3 0.3705 0.84256 0.004 0.044 0.832 0.112 0.008
#> GSM99437 2 0.3449 0.71045 0.000 0.812 0.000 0.024 0.164
#> GSM99439 5 0.2470 0.89418 0.000 0.104 0.000 0.012 0.884
#> GSM99441 1 0.4504 0.00108 0.564 0.000 0.000 0.428 0.008
#> GSM99443 5 0.4249 0.70441 0.000 0.296 0.000 0.016 0.688
#> GSM99445 5 0.3141 0.87727 0.000 0.152 0.000 0.016 0.832
#> GSM99447 2 0.2079 0.80460 0.000 0.916 0.000 0.020 0.064
#> GSM99449 2 0.4925 0.40722 0.004 0.628 0.340 0.024 0.004
#> GSM99451 3 0.3391 0.85040 0.004 0.028 0.848 0.112 0.008
#> GSM99453 4 0.4538 0.60011 0.364 0.000 0.000 0.620 0.016
#> GSM99455 4 0.4787 0.53770 0.432 0.000 0.000 0.548 0.020
#> GSM99457 4 0.4630 0.59360 0.396 0.000 0.000 0.588 0.016
#> GSM99463 5 0.2074 0.89457 0.000 0.104 0.000 0.000 0.896
#> GSM99465 3 0.6709 0.60968 0.268 0.012 0.584 0.088 0.048
#> GSM99467 2 0.1518 0.80532 0.004 0.944 0.000 0.048 0.004
#> GSM99471 4 0.6605 0.06508 0.300 0.152 0.000 0.528 0.020
#> GSM99473 1 0.4857 0.19860 0.684 0.024 0.000 0.272 0.020
#> GSM99475 3 0.4189 0.83080 0.008 0.028 0.808 0.128 0.028
#> GSM99477 2 0.3423 0.74218 0.004 0.852 0.096 0.040 0.008
#> GSM99479 2 0.1518 0.80532 0.004 0.944 0.000 0.048 0.004
#> GSM99481 1 0.4811 -0.15137 0.528 0.000 0.000 0.452 0.020
#> GSM99483 4 0.4787 0.53770 0.432 0.000 0.000 0.548 0.020
#> GSM99485 2 0.2863 0.80619 0.000 0.876 0.000 0.064 0.060
#> GSM99487 2 0.2104 0.80346 0.000 0.916 0.000 0.024 0.060
#> GSM99489 5 0.2074 0.89457 0.000 0.104 0.000 0.000 0.896
#> GSM99491 2 0.2726 0.80454 0.000 0.884 0.000 0.052 0.064
#> GSM99493 4 0.4630 0.59360 0.396 0.000 0.000 0.588 0.016
#> GSM99495 5 0.2074 0.89457 0.000 0.104 0.000 0.000 0.896
#> GSM99525 1 0.4826 -0.42693 0.508 0.000 0.000 0.472 0.020
#> GSM99527 3 0.9014 0.19536 0.148 0.284 0.348 0.176 0.044
#> GSM99529 2 0.8013 0.42837 0.160 0.488 0.080 0.244 0.028
#> GSM99531 3 0.6084 0.64684 0.248 0.000 0.624 0.092 0.036
#> GSM99533 3 0.6680 0.67971 0.196 0.020 0.624 0.120 0.040
#> GSM99535 2 0.4276 0.73917 0.000 0.764 0.000 0.168 0.068
#> GSM99537 1 0.3910 0.40570 0.720 0.000 0.000 0.272 0.008
#> GSM99539 2 0.1579 0.81104 0.000 0.944 0.000 0.032 0.024
#> GSM99541 1 0.2591 0.42997 0.904 0.000 0.044 0.032 0.020
#> GSM99543 5 0.5434 0.68120 0.000 0.232 0.000 0.120 0.648
#> GSM99545 2 0.2446 0.80610 0.000 0.900 0.000 0.044 0.056
#> GSM99547 2 0.5029 0.67879 0.004 0.736 0.076 0.168 0.016
#> GSM99549 5 0.2905 0.88618 0.000 0.096 0.000 0.036 0.868
#> GSM99551 4 0.5085 0.32452 0.300 0.008 0.000 0.648 0.044
#> GSM99553 3 0.2664 0.85217 0.004 0.040 0.892 0.064 0.000
#> GSM99555 2 0.3954 0.66260 0.000 0.772 0.000 0.036 0.192
#> GSM99557 5 0.2873 0.89202 0.000 0.120 0.000 0.020 0.860
#> GSM99559 2 0.3396 0.72372 0.004 0.832 0.136 0.028 0.000
#> GSM99561 2 0.2446 0.81287 0.000 0.900 0.000 0.056 0.044
#> GSM99563 3 0.0566 0.89622 0.000 0.000 0.984 0.012 0.004
#> GSM99565 2 0.3602 0.69146 0.000 0.796 0.000 0.024 0.180
#> GSM99573 5 0.2824 0.88729 0.000 0.096 0.000 0.032 0.872
#> GSM99577 1 0.3278 0.43917 0.824 0.000 0.000 0.156 0.020
#> GSM99579 2 0.2928 0.80261 0.000 0.872 0.000 0.064 0.064
#> GSM99581 3 0.0162 0.89749 0.004 0.000 0.996 0.000 0.000
#> GSM99583 2 0.5410 0.64496 0.008 0.672 0.080 0.236 0.004
#> GSM99585 2 0.0566 0.81388 0.000 0.984 0.000 0.004 0.012
#> GSM99587 4 0.4630 0.59360 0.396 0.000 0.000 0.588 0.016
#> GSM99589 2 0.3043 0.79885 0.000 0.864 0.000 0.056 0.080
#> GSM99591 5 0.3141 0.87727 0.000 0.152 0.000 0.016 0.832
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM99497 3 0.0000 0.8206 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM99503 1 0.0000 0.5121 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99505 1 0.4152 0.3119 0.664 0.000 0.032 0.000 0.000 0.304
#> GSM99507 3 0.0000 0.8206 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM99567 3 0.0000 0.8206 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM99575 1 0.0000 0.5121 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99593 3 0.1838 0.8031 0.000 0.000 0.916 0.068 0.000 0.016
#> GSM99595 3 0.0146 0.8208 0.000 0.000 0.996 0.004 0.000 0.000
#> GSM99469 1 0.3428 0.3529 0.696 0.000 0.000 0.000 0.000 0.304
#> GSM99499 1 0.3428 0.3529 0.696 0.000 0.000 0.000 0.000 0.304
#> GSM99501 1 0.3428 0.3529 0.696 0.000 0.000 0.000 0.000 0.304
#> GSM99509 3 0.0436 0.8202 0.000 0.000 0.988 0.004 0.004 0.004
#> GSM99569 3 0.1401 0.8147 0.000 0.000 0.948 0.028 0.004 0.020
#> GSM99597 3 0.0520 0.8189 0.000 0.000 0.984 0.008 0.000 0.008
#> GSM99601 2 0.4848 -0.1237 0.000 0.488 0.000 0.012 0.468 0.032
#> GSM99459 1 0.4953 0.0175 0.504 0.000 0.004 0.044 0.004 0.444
#> GSM99461 1 0.4953 0.0175 0.504 0.000 0.004 0.044 0.004 0.444
#> GSM99511 3 0.2380 0.8043 0.000 0.000 0.892 0.068 0.004 0.036
#> GSM99513 3 0.2380 0.8043 0.000 0.000 0.892 0.068 0.004 0.036
#> GSM99515 3 0.0000 0.8206 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM99517 1 0.0000 0.5121 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99519 1 0.4897 0.0264 0.508 0.000 0.004 0.040 0.004 0.444
#> GSM99521 3 0.2793 0.7264 0.000 0.000 0.800 0.200 0.000 0.000
#> GSM99523 3 0.2113 0.7940 0.000 0.000 0.908 0.028 0.004 0.060
#> GSM99571 1 0.3634 0.4530 0.644 0.000 0.000 0.000 0.000 0.356
#> GSM99599 1 0.2378 0.5203 0.848 0.000 0.000 0.000 0.000 0.152
#> GSM99433 2 0.1779 0.6987 0.000 0.920 0.000 0.064 0.000 0.016
#> GSM99435 3 0.5063 0.4951 0.000 0.024 0.544 0.396 0.000 0.036
#> GSM99437 2 0.3102 0.6433 0.000 0.816 0.000 0.000 0.156 0.028
#> GSM99439 5 0.1313 0.8654 0.000 0.028 0.000 0.016 0.952 0.004
#> GSM99441 1 0.2378 0.5203 0.848 0.000 0.000 0.000 0.000 0.152
#> GSM99443 5 0.4177 0.5792 0.000 0.304 0.000 0.008 0.668 0.020
#> GSM99445 5 0.3196 0.8103 0.000 0.156 0.000 0.008 0.816 0.020
#> GSM99447 2 0.2351 0.7154 0.000 0.900 0.000 0.052 0.036 0.012
#> GSM99449 2 0.5717 0.2237 0.000 0.572 0.256 0.156 0.000 0.016
#> GSM99451 3 0.4713 0.5584 0.000 0.016 0.592 0.364 0.000 0.028
#> GSM99453 1 0.5210 0.4093 0.544 0.000 0.000 0.076 0.008 0.372
#> GSM99455 1 0.5333 0.3935 0.480 0.000 0.000 0.080 0.008 0.432
#> GSM99457 1 0.4776 0.4380 0.600 0.000 0.000 0.040 0.012 0.348
#> GSM99463 5 0.0713 0.8674 0.000 0.028 0.000 0.000 0.972 0.000
#> GSM99465 6 0.6551 -0.1357 0.008 0.000 0.316 0.328 0.008 0.340
#> GSM99467 2 0.3303 0.6305 0.000 0.776 0.004 0.212 0.004 0.004
#> GSM99471 4 0.6345 0.1136 0.096 0.056 0.000 0.504 0.008 0.336
#> GSM99473 4 0.6629 -0.1601 0.320 0.012 0.000 0.340 0.008 0.320
#> GSM99475 3 0.4970 0.4845 0.000 0.012 0.536 0.408 0.000 0.044
#> GSM99477 2 0.3834 0.5886 0.000 0.748 0.028 0.216 0.000 0.008
#> GSM99479 2 0.3303 0.6305 0.000 0.776 0.004 0.212 0.004 0.004
#> GSM99481 1 0.3301 0.5034 0.788 0.000 0.000 0.024 0.000 0.188
#> GSM99483 1 0.5333 0.3935 0.480 0.000 0.000 0.080 0.008 0.432
#> GSM99485 2 0.3696 0.6872 0.000 0.796 0.000 0.148 0.036 0.020
#> GSM99487 2 0.1498 0.7113 0.000 0.940 0.000 0.000 0.032 0.028
#> GSM99489 5 0.0713 0.8674 0.000 0.028 0.000 0.000 0.972 0.000
#> GSM99491 2 0.3019 0.7085 0.000 0.856 0.000 0.092 0.032 0.020
#> GSM99493 1 0.4454 0.4420 0.616 0.000 0.000 0.032 0.004 0.348
#> GSM99495 5 0.0713 0.8674 0.000 0.028 0.000 0.000 0.972 0.000
#> GSM99525 1 0.5333 0.3860 0.480 0.000 0.000 0.080 0.008 0.432
#> GSM99527 4 0.6851 0.1596 0.000 0.172 0.148 0.528 0.004 0.148
#> GSM99529 4 0.5468 0.3392 0.000 0.252 0.032 0.628 0.004 0.084
#> GSM99531 3 0.6077 0.1410 0.000 0.000 0.448 0.300 0.004 0.248
#> GSM99533 3 0.6249 0.2117 0.000 0.012 0.400 0.400 0.004 0.184
#> GSM99535 2 0.5350 0.4782 0.000 0.600 0.000 0.304 0.040 0.056
#> GSM99537 1 0.1863 0.4566 0.896 0.000 0.000 0.000 0.000 0.104
#> GSM99539 2 0.2636 0.6694 0.000 0.860 0.000 0.120 0.004 0.016
#> GSM99541 6 0.5455 -0.2422 0.436 0.000 0.004 0.104 0.000 0.456
#> GSM99543 5 0.5518 0.5681 0.000 0.156 0.000 0.128 0.660 0.056
#> GSM99545 2 0.3904 0.6734 0.000 0.792 0.000 0.132 0.044 0.032
#> GSM99547 2 0.4888 0.1151 0.000 0.496 0.008 0.460 0.004 0.032
#> GSM99549 5 0.2841 0.8406 0.000 0.028 0.000 0.072 0.872 0.028
#> GSM99551 6 0.6180 -0.2443 0.208 0.000 0.000 0.300 0.016 0.476
#> GSM99553 3 0.3494 0.5794 0.000 0.012 0.736 0.252 0.000 0.000
#> GSM99555 2 0.4324 0.5907 0.000 0.736 0.000 0.036 0.196 0.032
#> GSM99557 5 0.2114 0.8576 0.000 0.076 0.000 0.012 0.904 0.008
#> GSM99559 2 0.4366 0.5562 0.000 0.720 0.068 0.204 0.000 0.008
#> GSM99561 2 0.2432 0.7128 0.000 0.892 0.000 0.072 0.020 0.016
#> GSM99563 3 0.1552 0.8137 0.000 0.000 0.940 0.036 0.004 0.020
#> GSM99565 2 0.3245 0.6298 0.000 0.800 0.000 0.000 0.172 0.028
#> GSM99573 5 0.2681 0.8442 0.000 0.028 0.000 0.072 0.880 0.020
#> GSM99577 1 0.5103 0.1883 0.532 0.000 0.000 0.072 0.004 0.392
#> GSM99579 2 0.3327 0.7013 0.000 0.832 0.000 0.112 0.036 0.020
#> GSM99581 3 0.0458 0.8216 0.000 0.000 0.984 0.016 0.000 0.000
#> GSM99583 4 0.5120 -0.1575 0.000 0.444 0.024 0.496 0.000 0.036
#> GSM99585 2 0.1524 0.7031 0.000 0.932 0.000 0.060 0.000 0.008
#> GSM99587 1 0.4776 0.4380 0.600 0.000 0.000 0.040 0.012 0.348
#> GSM99589 2 0.3997 0.6856 0.000 0.756 0.000 0.188 0.044 0.012
#> GSM99591 5 0.3196 0.8103 0.000 0.156 0.000 0.008 0.816 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 disease.state(p) cell.type(p) k
#> ATC:kmeans 85 5.65e-05 3.19e-04 2
#> ATC:kmeans 85 4.83e-04 1.10e-02 3
#> ATC:kmeans 73 2.48e-04 1.77e-02 4
#> ATC:kmeans 63 4.04e-06 1.50e-06 5
#> ATC:kmeans 52 5.13e-07 7.59e-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", "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 21512 rows and 85 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'ATC' method.
#> Subgroups are detected by 'skmeans' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 3.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
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.957 0.984 0.5003 0.500 0.500
#> 3 3 1.000 0.973 0.989 0.3338 0.788 0.594
#> 4 4 0.867 0.853 0.918 0.0990 0.920 0.762
#> 5 5 0.773 0.655 0.827 0.0558 0.970 0.886
#> 6 6 0.763 0.729 0.818 0.0410 0.900 0.610
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
#> GSM99497 1 0.000 0.9861 1.000 0.000
#> GSM99503 1 0.000 0.9861 1.000 0.000
#> GSM99505 1 0.000 0.9861 1.000 0.000
#> GSM99507 1 0.000 0.9861 1.000 0.000
#> GSM99567 1 0.000 0.9861 1.000 0.000
#> GSM99575 1 0.000 0.9861 1.000 0.000
#> GSM99593 1 0.991 0.1710 0.556 0.444
#> GSM99595 1 0.000 0.9861 1.000 0.000
#> GSM99469 1 0.000 0.9861 1.000 0.000
#> GSM99499 1 0.000 0.9861 1.000 0.000
#> GSM99501 1 0.000 0.9861 1.000 0.000
#> GSM99509 1 0.000 0.9861 1.000 0.000
#> GSM99569 1 0.000 0.9861 1.000 0.000
#> GSM99597 1 0.000 0.9861 1.000 0.000
#> GSM99601 2 0.000 0.9806 0.000 1.000
#> GSM99459 1 0.000 0.9861 1.000 0.000
#> GSM99461 1 0.000 0.9861 1.000 0.000
#> GSM99511 1 0.000 0.9861 1.000 0.000
#> GSM99513 1 0.000 0.9861 1.000 0.000
#> GSM99515 1 0.000 0.9861 1.000 0.000
#> GSM99517 1 0.000 0.9861 1.000 0.000
#> GSM99519 1 0.000 0.9861 1.000 0.000
#> GSM99521 1 0.000 0.9861 1.000 0.000
#> GSM99523 1 0.000 0.9861 1.000 0.000
#> GSM99571 1 0.000 0.9861 1.000 0.000
#> GSM99599 1 0.000 0.9861 1.000 0.000
#> GSM99433 2 0.000 0.9806 0.000 1.000
#> GSM99435 2 0.745 0.7228 0.212 0.788
#> GSM99437 2 0.000 0.9806 0.000 1.000
#> GSM99439 2 0.000 0.9806 0.000 1.000
#> GSM99441 1 0.000 0.9861 1.000 0.000
#> GSM99443 2 0.000 0.9806 0.000 1.000
#> GSM99445 2 0.000 0.9806 0.000 1.000
#> GSM99447 2 0.000 0.9806 0.000 1.000
#> GSM99449 2 0.000 0.9806 0.000 1.000
#> GSM99451 1 0.000 0.9861 1.000 0.000
#> GSM99453 1 0.000 0.9861 1.000 0.000
#> GSM99455 1 0.000 0.9861 1.000 0.000
#> GSM99457 1 0.000 0.9861 1.000 0.000
#> GSM99463 2 0.000 0.9806 0.000 1.000
#> GSM99465 1 0.000 0.9861 1.000 0.000
#> GSM99467 2 0.000 0.9806 0.000 1.000
#> GSM99471 1 0.671 0.7774 0.824 0.176
#> GSM99473 1 0.000 0.9861 1.000 0.000
#> GSM99475 1 0.000 0.9861 1.000 0.000
#> GSM99477 2 0.000 0.9806 0.000 1.000
#> GSM99479 2 0.000 0.9806 0.000 1.000
#> GSM99481 1 0.000 0.9861 1.000 0.000
#> GSM99483 1 0.000 0.9861 1.000 0.000
#> GSM99485 2 0.000 0.9806 0.000 1.000
#> GSM99487 2 0.000 0.9806 0.000 1.000
#> GSM99489 2 0.000 0.9806 0.000 1.000
#> GSM99491 2 0.000 0.9806 0.000 1.000
#> GSM99493 1 0.000 0.9861 1.000 0.000
#> GSM99495 2 0.000 0.9806 0.000 1.000
#> GSM99525 1 0.000 0.9861 1.000 0.000
#> GSM99527 2 0.000 0.9806 0.000 1.000
#> GSM99529 2 0.000 0.9806 0.000 1.000
#> GSM99531 1 0.000 0.9861 1.000 0.000
#> GSM99533 1 0.000 0.9861 1.000 0.000
#> GSM99535 2 0.000 0.9806 0.000 1.000
#> GSM99537 1 0.000 0.9861 1.000 0.000
#> GSM99539 2 0.000 0.9806 0.000 1.000
#> GSM99541 1 0.000 0.9861 1.000 0.000
#> GSM99543 2 0.000 0.9806 0.000 1.000
#> GSM99545 2 0.000 0.9806 0.000 1.000
#> GSM99547 2 0.000 0.9806 0.000 1.000
#> GSM99549 2 0.000 0.9806 0.000 1.000
#> GSM99551 1 0.000 0.9861 1.000 0.000
#> GSM99553 2 1.000 0.0234 0.492 0.508
#> GSM99555 2 0.000 0.9806 0.000 1.000
#> GSM99557 2 0.000 0.9806 0.000 1.000
#> GSM99559 2 0.000 0.9806 0.000 1.000
#> GSM99561 2 0.000 0.9806 0.000 1.000
#> GSM99563 1 0.000 0.9861 1.000 0.000
#> GSM99565 2 0.000 0.9806 0.000 1.000
#> GSM99573 2 0.000 0.9806 0.000 1.000
#> GSM99577 1 0.000 0.9861 1.000 0.000
#> GSM99579 2 0.000 0.9806 0.000 1.000
#> GSM99581 1 0.000 0.9861 1.000 0.000
#> GSM99583 2 0.000 0.9806 0.000 1.000
#> GSM99585 2 0.000 0.9806 0.000 1.000
#> GSM99587 1 0.000 0.9861 1.000 0.000
#> GSM99589 2 0.000 0.9806 0.000 1.000
#> GSM99591 2 0.000 0.9806 0.000 1.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM99497 3 0.0000 0.980 0 0.000 1.000
#> GSM99503 1 0.0000 1.000 1 0.000 0.000
#> GSM99505 1 0.0000 1.000 1 0.000 0.000
#> GSM99507 3 0.0000 0.980 0 0.000 1.000
#> GSM99567 3 0.0000 0.980 0 0.000 1.000
#> GSM99575 1 0.0000 1.000 1 0.000 0.000
#> GSM99593 3 0.0000 0.980 0 0.000 1.000
#> GSM99595 3 0.0000 0.980 0 0.000 1.000
#> GSM99469 1 0.0000 1.000 1 0.000 0.000
#> GSM99499 1 0.0000 1.000 1 0.000 0.000
#> GSM99501 1 0.0000 1.000 1 0.000 0.000
#> GSM99509 3 0.0000 0.980 0 0.000 1.000
#> GSM99569 3 0.0000 0.980 0 0.000 1.000
#> GSM99597 3 0.0000 0.980 0 0.000 1.000
#> GSM99601 2 0.0000 0.984 0 1.000 0.000
#> GSM99459 1 0.0000 1.000 1 0.000 0.000
#> GSM99461 1 0.0000 1.000 1 0.000 0.000
#> GSM99511 3 0.0000 0.980 0 0.000 1.000
#> GSM99513 3 0.0000 0.980 0 0.000 1.000
#> GSM99515 3 0.0000 0.980 0 0.000 1.000
#> GSM99517 1 0.0000 1.000 1 0.000 0.000
#> GSM99519 1 0.0000 1.000 1 0.000 0.000
#> GSM99521 3 0.0000 0.980 0 0.000 1.000
#> GSM99523 3 0.0000 0.980 0 0.000 1.000
#> GSM99571 1 0.0000 1.000 1 0.000 0.000
#> GSM99599 1 0.0000 1.000 1 0.000 0.000
#> GSM99433 2 0.0000 0.984 0 1.000 0.000
#> GSM99435 3 0.0000 0.980 0 0.000 1.000
#> GSM99437 2 0.0000 0.984 0 1.000 0.000
#> GSM99439 2 0.0000 0.984 0 1.000 0.000
#> GSM99441 1 0.0000 1.000 1 0.000 0.000
#> GSM99443 2 0.0000 0.984 0 1.000 0.000
#> GSM99445 2 0.0000 0.984 0 1.000 0.000
#> GSM99447 2 0.0000 0.984 0 1.000 0.000
#> GSM99449 3 0.5706 0.523 0 0.320 0.680
#> GSM99451 3 0.0000 0.980 0 0.000 1.000
#> GSM99453 1 0.0000 1.000 1 0.000 0.000
#> GSM99455 1 0.0000 1.000 1 0.000 0.000
#> GSM99457 1 0.0000 1.000 1 0.000 0.000
#> GSM99463 2 0.0000 0.984 0 1.000 0.000
#> GSM99465 3 0.0000 0.980 0 0.000 1.000
#> GSM99467 2 0.0000 0.984 0 1.000 0.000
#> GSM99471 1 0.0000 1.000 1 0.000 0.000
#> GSM99473 1 0.0000 1.000 1 0.000 0.000
#> GSM99475 3 0.0000 0.980 0 0.000 1.000
#> GSM99477 2 0.5327 0.624 0 0.728 0.272
#> GSM99479 2 0.0000 0.984 0 1.000 0.000
#> GSM99481 1 0.0000 1.000 1 0.000 0.000
#> GSM99483 1 0.0000 1.000 1 0.000 0.000
#> GSM99485 2 0.0000 0.984 0 1.000 0.000
#> GSM99487 2 0.0000 0.984 0 1.000 0.000
#> GSM99489 2 0.0000 0.984 0 1.000 0.000
#> GSM99491 2 0.0000 0.984 0 1.000 0.000
#> GSM99493 1 0.0000 1.000 1 0.000 0.000
#> GSM99495 2 0.0000 0.984 0 1.000 0.000
#> GSM99525 1 0.0000 1.000 1 0.000 0.000
#> GSM99527 3 0.3267 0.860 0 0.116 0.884
#> GSM99529 2 0.0592 0.973 0 0.988 0.012
#> GSM99531 3 0.0000 0.980 0 0.000 1.000
#> GSM99533 3 0.0000 0.980 0 0.000 1.000
#> GSM99535 2 0.0000 0.984 0 1.000 0.000
#> GSM99537 1 0.0000 1.000 1 0.000 0.000
#> GSM99539 2 0.0000 0.984 0 1.000 0.000
#> GSM99541 1 0.0000 1.000 1 0.000 0.000
#> GSM99543 2 0.0000 0.984 0 1.000 0.000
#> GSM99545 2 0.0000 0.984 0 1.000 0.000
#> GSM99547 2 0.0000 0.984 0 1.000 0.000
#> GSM99549 2 0.0000 0.984 0 1.000 0.000
#> GSM99551 1 0.0000 1.000 1 0.000 0.000
#> GSM99553 3 0.0000 0.980 0 0.000 1.000
#> GSM99555 2 0.0000 0.984 0 1.000 0.000
#> GSM99557 2 0.0000 0.984 0 1.000 0.000
#> GSM99559 2 0.4842 0.708 0 0.776 0.224
#> GSM99561 2 0.0000 0.984 0 1.000 0.000
#> GSM99563 3 0.0000 0.980 0 0.000 1.000
#> GSM99565 2 0.0000 0.984 0 1.000 0.000
#> GSM99573 2 0.0000 0.984 0 1.000 0.000
#> GSM99577 1 0.0000 1.000 1 0.000 0.000
#> GSM99579 2 0.0000 0.984 0 1.000 0.000
#> GSM99581 3 0.0000 0.980 0 0.000 1.000
#> GSM99583 2 0.0000 0.984 0 1.000 0.000
#> GSM99585 2 0.0000 0.984 0 1.000 0.000
#> GSM99587 1 0.0000 1.000 1 0.000 0.000
#> GSM99589 2 0.0000 0.984 0 1.000 0.000
#> GSM99591 2 0.0000 0.984 0 1.000 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM99497 3 0.0000 0.934364 0.000 0.000 1.000 0.000
#> GSM99503 1 0.0000 0.983424 1.000 0.000 0.000 0.000
#> GSM99505 1 0.0000 0.983424 1.000 0.000 0.000 0.000
#> GSM99507 3 0.0000 0.934364 0.000 0.000 1.000 0.000
#> GSM99567 3 0.0000 0.934364 0.000 0.000 1.000 0.000
#> GSM99575 1 0.0000 0.983424 1.000 0.000 0.000 0.000
#> GSM99593 3 0.1022 0.925997 0.000 0.000 0.968 0.032
#> GSM99595 3 0.0000 0.934364 0.000 0.000 1.000 0.000
#> GSM99469 1 0.0000 0.983424 1.000 0.000 0.000 0.000
#> GSM99499 1 0.0000 0.983424 1.000 0.000 0.000 0.000
#> GSM99501 1 0.0000 0.983424 1.000 0.000 0.000 0.000
#> GSM99509 3 0.0000 0.934364 0.000 0.000 1.000 0.000
#> GSM99569 3 0.0000 0.934364 0.000 0.000 1.000 0.000
#> GSM99597 3 0.0000 0.934364 0.000 0.000 1.000 0.000
#> GSM99601 2 0.0469 0.895333 0.000 0.988 0.000 0.012
#> GSM99459 1 0.1637 0.945825 0.940 0.000 0.000 0.060
#> GSM99461 1 0.1637 0.945825 0.940 0.000 0.000 0.060
#> GSM99511 3 0.0592 0.930958 0.000 0.000 0.984 0.016
#> GSM99513 3 0.0188 0.933708 0.000 0.000 0.996 0.004
#> GSM99515 3 0.0000 0.934364 0.000 0.000 1.000 0.000
#> GSM99517 1 0.0000 0.983424 1.000 0.000 0.000 0.000
#> GSM99519 1 0.1637 0.945825 0.940 0.000 0.000 0.060
#> GSM99521 3 0.1022 0.925905 0.000 0.000 0.968 0.032
#> GSM99523 3 0.0000 0.934364 0.000 0.000 1.000 0.000
#> GSM99571 1 0.0707 0.981914 0.980 0.000 0.000 0.020
#> GSM99599 1 0.0000 0.983424 1.000 0.000 0.000 0.000
#> GSM99433 4 0.5000 0.285241 0.000 0.500 0.000 0.500
#> GSM99435 3 0.4250 0.755971 0.000 0.000 0.724 0.276
#> GSM99437 2 0.4877 0.019373 0.000 0.592 0.000 0.408
#> GSM99439 2 0.0000 0.896566 0.000 1.000 0.000 0.000
#> GSM99441 1 0.0000 0.983424 1.000 0.000 0.000 0.000
#> GSM99443 2 0.0707 0.893021 0.000 0.980 0.000 0.020
#> GSM99445 2 0.0707 0.893021 0.000 0.980 0.000 0.020
#> GSM99447 2 0.1557 0.857539 0.000 0.944 0.000 0.056
#> GSM99449 4 0.5807 0.707054 0.000 0.132 0.160 0.708
#> GSM99451 3 0.3610 0.834551 0.000 0.000 0.800 0.200
#> GSM99453 1 0.0707 0.981914 0.980 0.000 0.000 0.020
#> GSM99455 1 0.0707 0.981914 0.980 0.000 0.000 0.020
#> GSM99457 1 0.0707 0.981914 0.980 0.000 0.000 0.020
#> GSM99463 2 0.0000 0.896566 0.000 1.000 0.000 0.000
#> GSM99465 3 0.3975 0.800406 0.000 0.000 0.760 0.240
#> GSM99467 4 0.4431 0.707632 0.000 0.304 0.000 0.696
#> GSM99471 1 0.1004 0.978134 0.972 0.004 0.000 0.024
#> GSM99473 1 0.0000 0.983424 1.000 0.000 0.000 0.000
#> GSM99475 3 0.3444 0.847521 0.000 0.000 0.816 0.184
#> GSM99477 4 0.3934 0.740312 0.000 0.116 0.048 0.836
#> GSM99479 4 0.4431 0.707632 0.000 0.304 0.000 0.696
#> GSM99481 1 0.0000 0.983424 1.000 0.000 0.000 0.000
#> GSM99483 1 0.0707 0.981914 0.980 0.000 0.000 0.020
#> GSM99485 2 0.0592 0.894112 0.000 0.984 0.000 0.016
#> GSM99487 2 0.4888 -0.000567 0.000 0.588 0.000 0.412
#> GSM99489 2 0.0000 0.896566 0.000 1.000 0.000 0.000
#> GSM99491 2 0.1940 0.848498 0.000 0.924 0.000 0.076
#> GSM99493 1 0.0707 0.981914 0.980 0.000 0.000 0.020
#> GSM99495 2 0.0000 0.896566 0.000 1.000 0.000 0.000
#> GSM99525 1 0.0707 0.981914 0.980 0.000 0.000 0.020
#> GSM99527 4 0.4248 0.409290 0.000 0.012 0.220 0.768
#> GSM99529 4 0.4776 0.673151 0.000 0.272 0.016 0.712
#> GSM99531 3 0.2921 0.870215 0.000 0.000 0.860 0.140
#> GSM99533 3 0.3907 0.814073 0.000 0.000 0.768 0.232
#> GSM99535 2 0.0188 0.894186 0.000 0.996 0.000 0.004
#> GSM99537 1 0.0000 0.983424 1.000 0.000 0.000 0.000
#> GSM99539 2 0.3074 0.747301 0.000 0.848 0.000 0.152
#> GSM99541 1 0.1867 0.935830 0.928 0.000 0.000 0.072
#> GSM99543 2 0.0188 0.894186 0.000 0.996 0.000 0.004
#> GSM99545 2 0.0000 0.896566 0.000 1.000 0.000 0.000
#> GSM99547 4 0.3837 0.738610 0.000 0.224 0.000 0.776
#> GSM99549 2 0.0000 0.896566 0.000 1.000 0.000 0.000
#> GSM99551 1 0.0707 0.981914 0.980 0.000 0.000 0.020
#> GSM99553 3 0.3172 0.793235 0.000 0.000 0.840 0.160
#> GSM99555 2 0.1389 0.862366 0.000 0.952 0.000 0.048
#> GSM99557 2 0.0000 0.896566 0.000 1.000 0.000 0.000
#> GSM99559 4 0.5787 0.741843 0.000 0.244 0.076 0.680
#> GSM99561 2 0.1302 0.877285 0.000 0.956 0.000 0.044
#> GSM99563 3 0.0000 0.934364 0.000 0.000 1.000 0.000
#> GSM99565 2 0.4866 0.036811 0.000 0.596 0.000 0.404
#> GSM99573 2 0.0000 0.896566 0.000 1.000 0.000 0.000
#> GSM99577 1 0.0707 0.981914 0.980 0.000 0.000 0.020
#> GSM99579 2 0.1637 0.863985 0.000 0.940 0.000 0.060
#> GSM99581 3 0.0469 0.932284 0.000 0.000 0.988 0.012
#> GSM99583 4 0.3208 0.746909 0.000 0.148 0.004 0.848
#> GSM99585 4 0.4907 0.519557 0.000 0.420 0.000 0.580
#> GSM99587 1 0.0707 0.981914 0.980 0.000 0.000 0.020
#> GSM99589 2 0.0000 0.896566 0.000 1.000 0.000 0.000
#> GSM99591 2 0.0707 0.893021 0.000 0.980 0.000 0.020
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM99497 3 0.0000 0.8471 0.000 0.000 1.000 0.000 0.000
#> GSM99503 1 0.3774 0.7488 0.704 0.000 0.000 0.296 0.000
#> GSM99505 1 0.4183 0.7237 0.668 0.000 0.008 0.324 0.000
#> GSM99507 3 0.0000 0.8471 0.000 0.000 1.000 0.000 0.000
#> GSM99567 3 0.0000 0.8471 0.000 0.000 1.000 0.000 0.000
#> GSM99575 1 0.3796 0.7470 0.700 0.000 0.000 0.300 0.000
#> GSM99593 3 0.2685 0.8056 0.000 0.000 0.880 0.092 0.028
#> GSM99595 3 0.0162 0.8473 0.000 0.000 0.996 0.004 0.000
#> GSM99469 1 0.3895 0.7330 0.680 0.000 0.000 0.320 0.000
#> GSM99499 1 0.3796 0.7467 0.700 0.000 0.000 0.300 0.000
#> GSM99501 1 0.3913 0.7298 0.676 0.000 0.000 0.324 0.000
#> GSM99509 3 0.0000 0.8471 0.000 0.000 1.000 0.000 0.000
#> GSM99569 3 0.0609 0.8464 0.000 0.000 0.980 0.020 0.000
#> GSM99597 3 0.0510 0.8446 0.000 0.000 0.984 0.016 0.000
#> GSM99601 2 0.0880 0.8595 0.000 0.968 0.000 0.000 0.032
#> GSM99459 1 0.4307 0.4237 0.504 0.000 0.000 0.496 0.000
#> GSM99461 4 0.4307 -0.5406 0.496 0.000 0.000 0.504 0.000
#> GSM99511 3 0.2824 0.7999 0.000 0.000 0.864 0.116 0.020
#> GSM99513 3 0.1894 0.8286 0.000 0.000 0.920 0.072 0.008
#> GSM99515 3 0.0000 0.8471 0.000 0.000 1.000 0.000 0.000
#> GSM99517 1 0.3774 0.7488 0.704 0.000 0.000 0.296 0.000
#> GSM99519 1 0.4307 0.4132 0.500 0.000 0.000 0.500 0.000
#> GSM99521 3 0.2873 0.7737 0.000 0.000 0.856 0.128 0.016
#> GSM99523 3 0.0771 0.8460 0.000 0.000 0.976 0.020 0.004
#> GSM99571 1 0.0162 0.7568 0.996 0.000 0.000 0.004 0.000
#> GSM99599 1 0.3424 0.7667 0.760 0.000 0.000 0.240 0.000
#> GSM99433 5 0.4738 0.1215 0.000 0.464 0.000 0.016 0.520
#> GSM99435 3 0.6194 0.3285 0.000 0.000 0.472 0.388 0.140
#> GSM99437 2 0.4557 -0.0342 0.000 0.516 0.000 0.008 0.476
#> GSM99439 2 0.0000 0.8612 0.000 1.000 0.000 0.000 0.000
#> GSM99441 1 0.3395 0.7676 0.764 0.000 0.000 0.236 0.000
#> GSM99443 2 0.1544 0.8508 0.000 0.932 0.000 0.000 0.068
#> GSM99445 2 0.1410 0.8520 0.000 0.940 0.000 0.000 0.060
#> GSM99447 2 0.1478 0.8344 0.000 0.936 0.000 0.000 0.064
#> GSM99449 5 0.5030 0.6312 0.000 0.064 0.144 0.044 0.748
#> GSM99451 3 0.5770 0.4288 0.000 0.000 0.532 0.372 0.096
#> GSM99453 1 0.0000 0.7557 1.000 0.000 0.000 0.000 0.000
#> GSM99455 1 0.0000 0.7557 1.000 0.000 0.000 0.000 0.000
#> GSM99457 1 0.0000 0.7557 1.000 0.000 0.000 0.000 0.000
#> GSM99463 2 0.0000 0.8612 0.000 1.000 0.000 0.000 0.000
#> GSM99465 4 0.4946 0.0495 0.000 0.000 0.300 0.648 0.052
#> GSM99467 5 0.3053 0.7401 0.000 0.164 0.000 0.008 0.828
#> GSM99471 1 0.1579 0.7053 0.944 0.000 0.000 0.024 0.032
#> GSM99473 1 0.4026 0.7579 0.736 0.000 0.000 0.244 0.020
#> GSM99475 3 0.5524 0.3914 0.000 0.000 0.516 0.416 0.068
#> GSM99477 5 0.1949 0.7131 0.000 0.040 0.012 0.016 0.932
#> GSM99479 5 0.3053 0.7401 0.000 0.164 0.000 0.008 0.828
#> GSM99481 1 0.3395 0.7676 0.764 0.000 0.000 0.236 0.000
#> GSM99483 1 0.0000 0.7557 1.000 0.000 0.000 0.000 0.000
#> GSM99485 2 0.1704 0.8478 0.000 0.928 0.000 0.004 0.068
#> GSM99487 2 0.4560 -0.0691 0.000 0.508 0.000 0.008 0.484
#> GSM99489 2 0.0000 0.8612 0.000 1.000 0.000 0.000 0.000
#> GSM99491 2 0.2763 0.7788 0.000 0.848 0.000 0.004 0.148
#> GSM99493 1 0.0000 0.7557 1.000 0.000 0.000 0.000 0.000
#> GSM99495 2 0.0000 0.8612 0.000 1.000 0.000 0.000 0.000
#> GSM99525 1 0.0000 0.7557 1.000 0.000 0.000 0.000 0.000
#> GSM99527 4 0.5887 -0.0847 0.000 0.004 0.100 0.552 0.344
#> GSM99529 5 0.6313 0.4670 0.000 0.120 0.020 0.296 0.564
#> GSM99531 3 0.5047 0.1849 0.000 0.000 0.496 0.472 0.032
#> GSM99533 4 0.5066 -0.1303 0.000 0.000 0.344 0.608 0.048
#> GSM99535 2 0.1444 0.8328 0.000 0.948 0.000 0.012 0.040
#> GSM99537 1 0.3913 0.7298 0.676 0.000 0.000 0.324 0.000
#> GSM99539 2 0.4163 0.6433 0.000 0.740 0.000 0.032 0.228
#> GSM99541 4 0.4294 -0.4844 0.468 0.000 0.000 0.532 0.000
#> GSM99543 2 0.0992 0.8435 0.000 0.968 0.000 0.008 0.024
#> GSM99545 2 0.1106 0.8514 0.000 0.964 0.000 0.012 0.024
#> GSM99547 5 0.4981 0.6481 0.000 0.172 0.000 0.120 0.708
#> GSM99549 2 0.0000 0.8612 0.000 1.000 0.000 0.000 0.000
#> GSM99551 1 0.0162 0.7528 0.996 0.000 0.000 0.000 0.004
#> GSM99553 3 0.3286 0.7150 0.004 0.004 0.828 0.008 0.156
#> GSM99555 2 0.1341 0.8388 0.000 0.944 0.000 0.000 0.056
#> GSM99557 2 0.0000 0.8612 0.000 1.000 0.000 0.000 0.000
#> GSM99559 5 0.4010 0.7315 0.000 0.116 0.088 0.000 0.796
#> GSM99561 2 0.1952 0.8374 0.000 0.912 0.000 0.004 0.084
#> GSM99563 3 0.0771 0.8460 0.000 0.000 0.976 0.020 0.004
#> GSM99565 2 0.4555 -0.0188 0.000 0.520 0.000 0.008 0.472
#> GSM99573 2 0.0000 0.8612 0.000 1.000 0.000 0.000 0.000
#> GSM99577 1 0.1197 0.7554 0.952 0.000 0.000 0.048 0.000
#> GSM99579 2 0.2536 0.7997 0.000 0.868 0.000 0.004 0.128
#> GSM99581 3 0.1195 0.8425 0.000 0.000 0.960 0.028 0.012
#> GSM99583 5 0.2654 0.7074 0.000 0.040 0.008 0.056 0.896
#> GSM99585 5 0.4651 0.4063 0.000 0.372 0.000 0.020 0.608
#> GSM99587 1 0.0000 0.7557 1.000 0.000 0.000 0.000 0.000
#> GSM99589 2 0.0000 0.8612 0.000 1.000 0.000 0.000 0.000
#> GSM99591 2 0.1410 0.8520 0.000 0.940 0.000 0.000 0.060
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM99497 3 0.0146 0.9018 0.000 0.000 0.996 0.000 0.000 0.004
#> GSM99503 1 0.0363 0.8147 0.988 0.000 0.000 0.000 0.000 0.012
#> GSM99505 1 0.0837 0.8032 0.972 0.000 0.020 0.004 0.000 0.004
#> GSM99507 3 0.0291 0.9010 0.000 0.000 0.992 0.004 0.000 0.004
#> GSM99567 3 0.0146 0.9018 0.000 0.000 0.996 0.000 0.000 0.004
#> GSM99575 1 0.0363 0.8147 0.988 0.000 0.000 0.000 0.000 0.012
#> GSM99593 3 0.3232 0.7728 0.000 0.016 0.824 0.140 0.000 0.020
#> GSM99595 3 0.0692 0.9001 0.000 0.000 0.976 0.020 0.000 0.004
#> GSM99469 1 0.0000 0.8162 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99499 1 0.0260 0.8156 0.992 0.000 0.000 0.000 0.000 0.008
#> GSM99501 1 0.0146 0.8157 0.996 0.000 0.000 0.000 0.000 0.004
#> GSM99509 3 0.0405 0.9017 0.000 0.000 0.988 0.008 0.000 0.004
#> GSM99569 3 0.1092 0.8970 0.000 0.000 0.960 0.020 0.000 0.020
#> GSM99597 3 0.0935 0.8965 0.000 0.000 0.964 0.032 0.000 0.004
#> GSM99601 5 0.1605 0.8846 0.000 0.032 0.000 0.012 0.940 0.016
#> GSM99459 1 0.3466 0.6935 0.816 0.004 0.000 0.084 0.000 0.096
#> GSM99461 1 0.3516 0.6901 0.812 0.004 0.000 0.088 0.000 0.096
#> GSM99511 3 0.3819 0.7386 0.000 0.016 0.784 0.156 0.000 0.044
#> GSM99513 3 0.2776 0.8286 0.000 0.004 0.860 0.104 0.000 0.032
#> GSM99515 3 0.0146 0.9018 0.000 0.000 0.996 0.000 0.000 0.004
#> GSM99517 1 0.0363 0.8147 0.988 0.000 0.000 0.000 0.000 0.012
#> GSM99519 1 0.3325 0.6961 0.820 0.000 0.000 0.084 0.000 0.096
#> GSM99521 3 0.3341 0.6491 0.000 0.004 0.776 0.208 0.000 0.012
#> GSM99523 3 0.1636 0.8877 0.004 0.000 0.936 0.024 0.000 0.036
#> GSM99571 6 0.3857 0.8555 0.468 0.000 0.000 0.000 0.000 0.532
#> GSM99599 1 0.1141 0.7789 0.948 0.000 0.000 0.000 0.000 0.052
#> GSM99433 2 0.5043 0.3154 0.000 0.520 0.000 0.024 0.424 0.032
#> GSM99435 4 0.5465 0.6287 0.000 0.076 0.272 0.612 0.000 0.040
#> GSM99437 2 0.4795 0.2273 0.000 0.504 0.000 0.016 0.456 0.024
#> GSM99439 5 0.0146 0.8900 0.000 0.000 0.000 0.000 0.996 0.004
#> GSM99441 1 0.1663 0.7337 0.912 0.000 0.000 0.000 0.000 0.088
#> GSM99443 5 0.2058 0.8731 0.000 0.072 0.000 0.008 0.908 0.012
#> GSM99445 5 0.2036 0.8724 0.000 0.064 0.000 0.008 0.912 0.016
#> GSM99447 5 0.2804 0.8109 0.000 0.108 0.000 0.016 0.860 0.016
#> GSM99449 2 0.5225 0.3754 0.000 0.712 0.140 0.092 0.024 0.032
#> GSM99451 4 0.4863 0.5848 0.000 0.032 0.320 0.620 0.000 0.028
#> GSM99453 6 0.3727 0.9043 0.388 0.000 0.000 0.000 0.000 0.612
#> GSM99455 6 0.3727 0.9043 0.388 0.000 0.000 0.000 0.000 0.612
#> GSM99457 6 0.4083 0.8645 0.460 0.000 0.000 0.008 0.000 0.532
#> GSM99463 5 0.0146 0.8900 0.000 0.000 0.000 0.000 0.996 0.004
#> GSM99465 4 0.6176 0.6727 0.056 0.044 0.112 0.644 0.000 0.144
#> GSM99467 2 0.2532 0.5975 0.000 0.884 0.000 0.008 0.076 0.032
#> GSM99471 6 0.3448 0.7737 0.280 0.000 0.000 0.004 0.000 0.716
#> GSM99473 1 0.3494 0.4833 0.736 0.000 0.000 0.012 0.000 0.252
#> GSM99475 4 0.3329 0.7174 0.000 0.004 0.220 0.768 0.000 0.008
#> GSM99477 2 0.1232 0.5341 0.000 0.956 0.000 0.024 0.004 0.016
#> GSM99479 2 0.2828 0.5939 0.000 0.872 0.000 0.020 0.072 0.036
#> GSM99481 1 0.1714 0.7275 0.908 0.000 0.000 0.000 0.000 0.092
#> GSM99483 6 0.3672 0.8931 0.368 0.000 0.000 0.000 0.000 0.632
#> GSM99485 5 0.2532 0.8580 0.000 0.080 0.000 0.012 0.884 0.024
#> GSM99487 2 0.4775 0.2953 0.000 0.528 0.000 0.016 0.432 0.024
#> GSM99489 5 0.0000 0.8899 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM99491 5 0.3934 0.6884 0.000 0.204 0.000 0.016 0.752 0.028
#> GSM99493 6 0.4086 0.8588 0.464 0.000 0.000 0.008 0.000 0.528
#> GSM99495 5 0.0146 0.8900 0.000 0.000 0.000 0.000 0.996 0.004
#> GSM99525 6 0.3659 0.8892 0.364 0.000 0.000 0.000 0.000 0.636
#> GSM99527 4 0.4493 0.5876 0.000 0.176 0.016 0.728 0.000 0.080
#> GSM99529 2 0.6681 -0.0664 0.008 0.452 0.012 0.372 0.040 0.116
#> GSM99531 4 0.5341 0.6471 0.016 0.004 0.268 0.620 0.000 0.092
#> GSM99533 4 0.3017 0.7379 0.000 0.000 0.108 0.840 0.000 0.052
#> GSM99535 5 0.1801 0.8590 0.000 0.016 0.000 0.004 0.924 0.056
#> GSM99537 1 0.0000 0.8162 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99539 5 0.5485 0.4910 0.000 0.208 0.000 0.104 0.644 0.044
#> GSM99541 1 0.3468 0.6780 0.804 0.000 0.000 0.128 0.000 0.068
#> GSM99543 5 0.0865 0.8733 0.000 0.000 0.000 0.000 0.964 0.036
#> GSM99545 5 0.2328 0.8591 0.000 0.044 0.000 0.032 0.904 0.020
#> GSM99547 2 0.5794 0.4515 0.000 0.640 0.000 0.144 0.136 0.080
#> GSM99549 5 0.0363 0.8888 0.000 0.000 0.000 0.000 0.988 0.012
#> GSM99551 6 0.3965 0.9019 0.388 0.000 0.000 0.008 0.000 0.604
#> GSM99553 3 0.3562 0.7420 0.000 0.100 0.824 0.036 0.000 0.040
#> GSM99555 5 0.2182 0.8433 0.000 0.076 0.000 0.004 0.900 0.020
#> GSM99557 5 0.0146 0.8900 0.000 0.000 0.000 0.000 0.996 0.004
#> GSM99559 2 0.4240 0.5656 0.000 0.800 0.060 0.028 0.080 0.032
#> GSM99561 5 0.3210 0.8184 0.000 0.108 0.000 0.020 0.840 0.032
#> GSM99563 3 0.1176 0.8961 0.000 0.000 0.956 0.024 0.000 0.020
#> GSM99565 2 0.4798 0.2045 0.000 0.496 0.000 0.016 0.464 0.024
#> GSM99573 5 0.0508 0.8877 0.000 0.000 0.000 0.004 0.984 0.012
#> GSM99577 1 0.3975 -0.5265 0.600 0.000 0.000 0.008 0.000 0.392
#> GSM99579 5 0.3542 0.7651 0.000 0.156 0.000 0.016 0.800 0.028
#> GSM99581 3 0.1693 0.8818 0.000 0.004 0.932 0.044 0.000 0.020
#> GSM99583 2 0.3473 0.5164 0.000 0.824 0.000 0.076 0.012 0.088
#> GSM99585 2 0.4721 0.5458 0.000 0.664 0.000 0.028 0.272 0.036
#> GSM99587 6 0.4076 0.8734 0.452 0.000 0.000 0.008 0.000 0.540
#> GSM99589 5 0.0405 0.8896 0.000 0.000 0.000 0.008 0.988 0.004
#> GSM99591 5 0.2036 0.8724 0.000 0.064 0.000 0.008 0.912 0.016
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
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 disease.state(p) cell.type(p) k
#> ATC:skmeans 83 3.44e-06 2.20e-05 2
#> ATC:skmeans 85 2.80e-05 1.05e-03 3
#> ATC:skmeans 80 1.04e-04 7.44e-03 4
#> ATC:skmeans 68 3.04e-06 5.30e-04 5
#> ATC:skmeans 75 3.51e-08 7.99e-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", "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 21512 rows and 85 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 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.817 0.908 0.959 0.4880 0.503 0.503
#> 3 3 1.000 0.963 0.981 0.3791 0.681 0.444
#> 4 4 0.937 0.924 0.967 0.1173 0.840 0.563
#> 5 5 0.899 0.869 0.932 0.0450 0.964 0.857
#> 6 6 0.858 0.806 0.902 0.0336 0.962 0.829
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 4
#> attr(,"optional")
#> [1] 3
There is also optional best \(k\) = 3 that is worth to check.
Following shows the table of the partitions (You need to click the show/hide
code output link to see it). The membership matrix (columns with name p*
)
is inferred by
clue::cl_consensus()
function with the SE
method. Basically the value in the membership matrix
represents the probability to belong to a certain group. The finall class
label for an item is determined with the group with highest probability it
belongs to.
In get_classes()
function, the entropy is calculated from the membership
matrix and the silhouette score is calculated from the consensus matrix.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> GSM99497 1 0.7453 0.7731 0.788 0.212
#> GSM99503 1 0.0000 0.9281 1.000 0.000
#> GSM99505 1 0.0000 0.9281 1.000 0.000
#> GSM99507 1 0.7815 0.7475 0.768 0.232
#> GSM99567 1 0.7745 0.7530 0.772 0.228
#> GSM99575 1 0.0000 0.9281 1.000 0.000
#> GSM99593 2 0.0000 0.9759 0.000 1.000
#> GSM99595 2 0.9909 0.0839 0.444 0.556
#> GSM99469 1 0.0000 0.9281 1.000 0.000
#> GSM99499 1 0.0000 0.9281 1.000 0.000
#> GSM99501 1 0.0000 0.9281 1.000 0.000
#> GSM99509 1 0.6623 0.8168 0.828 0.172
#> GSM99569 1 0.6623 0.8168 0.828 0.172
#> GSM99597 1 0.6623 0.8168 0.828 0.172
#> GSM99601 2 0.0000 0.9759 0.000 1.000
#> GSM99459 1 0.0000 0.9281 1.000 0.000
#> GSM99461 1 0.0000 0.9281 1.000 0.000
#> GSM99511 2 0.0376 0.9719 0.004 0.996
#> GSM99513 2 0.6887 0.7406 0.184 0.816
#> GSM99515 1 0.9460 0.5093 0.636 0.364
#> GSM99517 1 0.0000 0.9281 1.000 0.000
#> GSM99519 1 0.0000 0.9281 1.000 0.000
#> GSM99521 2 0.0000 0.9759 0.000 1.000
#> GSM99523 1 0.0000 0.9281 1.000 0.000
#> GSM99571 1 0.0000 0.9281 1.000 0.000
#> GSM99599 1 0.0000 0.9281 1.000 0.000
#> GSM99433 2 0.0000 0.9759 0.000 1.000
#> GSM99435 2 0.0000 0.9759 0.000 1.000
#> GSM99437 2 0.0000 0.9759 0.000 1.000
#> GSM99439 2 0.0000 0.9759 0.000 1.000
#> GSM99441 1 0.0000 0.9281 1.000 0.000
#> GSM99443 2 0.0000 0.9759 0.000 1.000
#> GSM99445 2 0.0000 0.9759 0.000 1.000
#> GSM99447 2 0.0000 0.9759 0.000 1.000
#> GSM99449 2 0.0000 0.9759 0.000 1.000
#> GSM99451 2 0.0000 0.9759 0.000 1.000
#> GSM99453 1 0.0000 0.9281 1.000 0.000
#> GSM99455 1 0.0000 0.9281 1.000 0.000
#> GSM99457 1 0.0000 0.9281 1.000 0.000
#> GSM99463 2 0.0000 0.9759 0.000 1.000
#> GSM99465 1 0.9944 0.2613 0.544 0.456
#> GSM99467 2 0.0000 0.9759 0.000 1.000
#> GSM99471 2 0.0000 0.9759 0.000 1.000
#> GSM99473 1 0.3114 0.8940 0.944 0.056
#> GSM99475 2 0.0000 0.9759 0.000 1.000
#> GSM99477 2 0.0000 0.9759 0.000 1.000
#> GSM99479 2 0.0000 0.9759 0.000 1.000
#> GSM99481 1 0.0000 0.9281 1.000 0.000
#> GSM99483 1 0.0000 0.9281 1.000 0.000
#> GSM99485 2 0.0000 0.9759 0.000 1.000
#> GSM99487 2 0.0000 0.9759 0.000 1.000
#> GSM99489 2 0.0000 0.9759 0.000 1.000
#> GSM99491 2 0.0000 0.9759 0.000 1.000
#> GSM99493 1 0.0000 0.9281 1.000 0.000
#> GSM99495 2 0.0000 0.9759 0.000 1.000
#> GSM99525 1 0.0000 0.9281 1.000 0.000
#> GSM99527 2 0.0000 0.9759 0.000 1.000
#> GSM99529 2 0.0000 0.9759 0.000 1.000
#> GSM99531 1 0.6623 0.8168 0.828 0.172
#> GSM99533 1 0.6623 0.8168 0.828 0.172
#> GSM99535 2 0.0000 0.9759 0.000 1.000
#> GSM99537 1 0.0000 0.9281 1.000 0.000
#> GSM99539 2 0.0000 0.9759 0.000 1.000
#> GSM99541 1 0.0000 0.9281 1.000 0.000
#> GSM99543 2 0.0000 0.9759 0.000 1.000
#> GSM99545 2 0.0000 0.9759 0.000 1.000
#> GSM99547 2 0.0000 0.9759 0.000 1.000
#> GSM99549 2 0.0000 0.9759 0.000 1.000
#> GSM99551 2 0.9635 0.2804 0.388 0.612
#> GSM99553 2 0.0000 0.9759 0.000 1.000
#> GSM99555 2 0.0000 0.9759 0.000 1.000
#> GSM99557 2 0.0000 0.9759 0.000 1.000
#> GSM99559 2 0.0000 0.9759 0.000 1.000
#> GSM99561 2 0.0000 0.9759 0.000 1.000
#> GSM99563 1 0.3114 0.8992 0.944 0.056
#> GSM99565 2 0.0000 0.9759 0.000 1.000
#> GSM99573 2 0.0000 0.9759 0.000 1.000
#> GSM99577 1 0.0000 0.9281 1.000 0.000
#> GSM99579 2 0.0000 0.9759 0.000 1.000
#> GSM99581 2 0.0000 0.9759 0.000 1.000
#> GSM99583 2 0.0000 0.9759 0.000 1.000
#> GSM99585 2 0.0000 0.9759 0.000 1.000
#> GSM99587 1 0.0000 0.9281 1.000 0.000
#> GSM99589 2 0.0000 0.9759 0.000 1.000
#> GSM99591 2 0.0000 0.9759 0.000 1.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM99497 3 0.0000 0.965 0.000 0.000 1.000
#> GSM99503 1 0.0000 0.981 1.000 0.000 0.000
#> GSM99505 1 0.0000 0.981 1.000 0.000 0.000
#> GSM99507 3 0.0000 0.965 0.000 0.000 1.000
#> GSM99567 3 0.0000 0.965 0.000 0.000 1.000
#> GSM99575 1 0.0000 0.981 1.000 0.000 0.000
#> GSM99593 3 0.0000 0.965 0.000 0.000 1.000
#> GSM99595 3 0.0000 0.965 0.000 0.000 1.000
#> GSM99469 1 0.0000 0.981 1.000 0.000 0.000
#> GSM99499 1 0.0000 0.981 1.000 0.000 0.000
#> GSM99501 1 0.0000 0.981 1.000 0.000 0.000
#> GSM99509 3 0.0424 0.963 0.008 0.000 0.992
#> GSM99569 3 0.0424 0.963 0.008 0.000 0.992
#> GSM99597 3 0.0424 0.963 0.008 0.000 0.992
#> GSM99601 2 0.0000 0.997 0.000 1.000 0.000
#> GSM99459 1 0.0000 0.981 1.000 0.000 0.000
#> GSM99461 1 0.0000 0.981 1.000 0.000 0.000
#> GSM99511 3 0.0000 0.965 0.000 0.000 1.000
#> GSM99513 3 0.0000 0.965 0.000 0.000 1.000
#> GSM99515 3 0.0000 0.965 0.000 0.000 1.000
#> GSM99517 1 0.0000 0.981 1.000 0.000 0.000
#> GSM99519 1 0.0000 0.981 1.000 0.000 0.000
#> GSM99521 3 0.0000 0.965 0.000 0.000 1.000
#> GSM99523 3 0.0424 0.963 0.008 0.000 0.992
#> GSM99571 1 0.0000 0.981 1.000 0.000 0.000
#> GSM99599 1 0.0000 0.981 1.000 0.000 0.000
#> GSM99433 2 0.0424 0.995 0.000 0.992 0.008
#> GSM99435 3 0.0000 0.965 0.000 0.000 1.000
#> GSM99437 2 0.0000 0.997 0.000 1.000 0.000
#> GSM99439 2 0.0000 0.997 0.000 1.000 0.000
#> GSM99441 1 0.0000 0.981 1.000 0.000 0.000
#> GSM99443 2 0.0000 0.997 0.000 1.000 0.000
#> GSM99445 2 0.0000 0.997 0.000 1.000 0.000
#> GSM99447 2 0.0237 0.996 0.000 0.996 0.004
#> GSM99449 3 0.1289 0.952 0.000 0.032 0.968
#> GSM99451 3 0.0000 0.965 0.000 0.000 1.000
#> GSM99453 1 0.0000 0.981 1.000 0.000 0.000
#> GSM99455 1 0.0000 0.981 1.000 0.000 0.000
#> GSM99457 1 0.0000 0.981 1.000 0.000 0.000
#> GSM99463 2 0.0000 0.997 0.000 1.000 0.000
#> GSM99465 3 0.0424 0.963 0.008 0.000 0.992
#> GSM99467 2 0.0424 0.995 0.000 0.992 0.008
#> GSM99471 1 0.6402 0.704 0.744 0.056 0.200
#> GSM99473 1 0.0592 0.970 0.988 0.012 0.000
#> GSM99475 3 0.0000 0.965 0.000 0.000 1.000
#> GSM99477 3 0.1289 0.952 0.000 0.032 0.968
#> GSM99479 2 0.0424 0.995 0.000 0.992 0.008
#> GSM99481 1 0.0000 0.981 1.000 0.000 0.000
#> GSM99483 1 0.0000 0.981 1.000 0.000 0.000
#> GSM99485 2 0.0424 0.995 0.000 0.992 0.008
#> GSM99487 2 0.0237 0.996 0.000 0.996 0.004
#> GSM99489 2 0.0000 0.997 0.000 1.000 0.000
#> GSM99491 2 0.0424 0.995 0.000 0.992 0.008
#> GSM99493 1 0.0000 0.981 1.000 0.000 0.000
#> GSM99495 2 0.0000 0.997 0.000 1.000 0.000
#> GSM99525 1 0.0000 0.981 1.000 0.000 0.000
#> GSM99527 3 0.1289 0.952 0.000 0.032 0.968
#> GSM99529 3 0.1289 0.952 0.000 0.032 0.968
#> GSM99531 3 0.0424 0.963 0.008 0.000 0.992
#> GSM99533 3 0.0424 0.963 0.008 0.000 0.992
#> GSM99535 2 0.0424 0.995 0.000 0.992 0.008
#> GSM99537 1 0.0000 0.981 1.000 0.000 0.000
#> GSM99539 2 0.0237 0.996 0.000 0.996 0.004
#> GSM99541 1 0.0592 0.972 0.988 0.000 0.012
#> GSM99543 2 0.0424 0.995 0.000 0.992 0.008
#> GSM99545 2 0.0000 0.997 0.000 1.000 0.000
#> GSM99547 3 0.9438 0.348 0.244 0.252 0.504
#> GSM99549 2 0.0000 0.997 0.000 1.000 0.000
#> GSM99551 1 0.5901 0.725 0.768 0.040 0.192
#> GSM99553 3 0.1289 0.952 0.000 0.032 0.968
#> GSM99555 2 0.0000 0.997 0.000 1.000 0.000
#> GSM99557 2 0.0000 0.997 0.000 1.000 0.000
#> GSM99559 3 0.4654 0.743 0.000 0.208 0.792
#> GSM99561 2 0.0424 0.995 0.000 0.992 0.008
#> GSM99563 3 0.0424 0.963 0.008 0.000 0.992
#> GSM99565 2 0.0000 0.997 0.000 1.000 0.000
#> GSM99573 2 0.0000 0.997 0.000 1.000 0.000
#> GSM99577 1 0.0000 0.981 1.000 0.000 0.000
#> GSM99579 2 0.0424 0.995 0.000 0.992 0.008
#> GSM99581 3 0.1031 0.956 0.000 0.024 0.976
#> GSM99583 3 0.1289 0.952 0.000 0.032 0.968
#> GSM99585 2 0.0424 0.995 0.000 0.992 0.008
#> GSM99587 1 0.0000 0.981 1.000 0.000 0.000
#> GSM99589 2 0.0424 0.995 0.000 0.992 0.008
#> GSM99591 2 0.0000 0.997 0.000 1.000 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM99497 3 0.0000 0.975 0.000 0.000 1.000 0.000
#> GSM99503 1 0.0000 0.991 1.000 0.000 0.000 0.000
#> GSM99505 1 0.0000 0.991 1.000 0.000 0.000 0.000
#> GSM99507 3 0.0000 0.975 0.000 0.000 1.000 0.000
#> GSM99567 3 0.0000 0.975 0.000 0.000 1.000 0.000
#> GSM99575 1 0.0000 0.991 1.000 0.000 0.000 0.000
#> GSM99593 3 0.0000 0.975 0.000 0.000 1.000 0.000
#> GSM99595 3 0.0000 0.975 0.000 0.000 1.000 0.000
#> GSM99469 1 0.0000 0.991 1.000 0.000 0.000 0.000
#> GSM99499 1 0.0000 0.991 1.000 0.000 0.000 0.000
#> GSM99501 1 0.0000 0.991 1.000 0.000 0.000 0.000
#> GSM99509 3 0.0000 0.975 0.000 0.000 1.000 0.000
#> GSM99569 3 0.0000 0.975 0.000 0.000 1.000 0.000
#> GSM99597 3 0.0000 0.975 0.000 0.000 1.000 0.000
#> GSM99601 2 0.0000 0.937 0.000 1.000 0.000 0.000
#> GSM99459 1 0.0000 0.991 1.000 0.000 0.000 0.000
#> GSM99461 1 0.0000 0.991 1.000 0.000 0.000 0.000
#> GSM99511 3 0.0000 0.975 0.000 0.000 1.000 0.000
#> GSM99513 3 0.0000 0.975 0.000 0.000 1.000 0.000
#> GSM99515 3 0.0000 0.975 0.000 0.000 1.000 0.000
#> GSM99517 1 0.0000 0.991 1.000 0.000 0.000 0.000
#> GSM99519 1 0.0000 0.991 1.000 0.000 0.000 0.000
#> GSM99521 3 0.0000 0.975 0.000 0.000 1.000 0.000
#> GSM99523 3 0.0000 0.975 0.000 0.000 1.000 0.000
#> GSM99571 1 0.0000 0.991 1.000 0.000 0.000 0.000
#> GSM99599 1 0.0000 0.991 1.000 0.000 0.000 0.000
#> GSM99433 4 0.0000 0.935 0.000 0.000 0.000 1.000
#> GSM99435 3 0.3528 0.768 0.000 0.000 0.808 0.192
#> GSM99437 4 0.4040 0.660 0.000 0.248 0.000 0.752
#> GSM99439 2 0.0000 0.937 0.000 1.000 0.000 0.000
#> GSM99441 1 0.0000 0.991 1.000 0.000 0.000 0.000
#> GSM99443 2 0.0000 0.937 0.000 1.000 0.000 0.000
#> GSM99445 2 0.0000 0.937 0.000 1.000 0.000 0.000
#> GSM99447 4 0.0592 0.928 0.000 0.016 0.000 0.984
#> GSM99449 4 0.0000 0.935 0.000 0.000 0.000 1.000
#> GSM99451 3 0.0000 0.975 0.000 0.000 1.000 0.000
#> GSM99453 1 0.0000 0.991 1.000 0.000 0.000 0.000
#> GSM99455 1 0.0000 0.991 1.000 0.000 0.000 0.000
#> GSM99457 1 0.0000 0.991 1.000 0.000 0.000 0.000
#> GSM99463 2 0.0000 0.937 0.000 1.000 0.000 0.000
#> GSM99465 3 0.0707 0.960 0.000 0.000 0.980 0.020
#> GSM99467 4 0.0000 0.935 0.000 0.000 0.000 1.000
#> GSM99471 4 0.4193 0.627 0.268 0.000 0.000 0.732
#> GSM99473 1 0.3024 0.820 0.852 0.000 0.000 0.148
#> GSM99475 3 0.1637 0.922 0.000 0.000 0.940 0.060
#> GSM99477 4 0.0000 0.935 0.000 0.000 0.000 1.000
#> GSM99479 4 0.0000 0.935 0.000 0.000 0.000 1.000
#> GSM99481 1 0.0000 0.991 1.000 0.000 0.000 0.000
#> GSM99483 1 0.0000 0.991 1.000 0.000 0.000 0.000
#> GSM99485 2 0.4916 0.277 0.000 0.576 0.000 0.424
#> GSM99487 4 0.2216 0.866 0.000 0.092 0.000 0.908
#> GSM99489 2 0.0000 0.937 0.000 1.000 0.000 0.000
#> GSM99491 4 0.0000 0.935 0.000 0.000 0.000 1.000
#> GSM99493 1 0.0000 0.991 1.000 0.000 0.000 0.000
#> GSM99495 2 0.0000 0.937 0.000 1.000 0.000 0.000
#> GSM99525 1 0.0000 0.991 1.000 0.000 0.000 0.000
#> GSM99527 4 0.2081 0.870 0.000 0.000 0.084 0.916
#> GSM99529 4 0.0000 0.935 0.000 0.000 0.000 1.000
#> GSM99531 3 0.0000 0.975 0.000 0.000 1.000 0.000
#> GSM99533 3 0.0000 0.975 0.000 0.000 1.000 0.000
#> GSM99535 4 0.0000 0.935 0.000 0.000 0.000 1.000
#> GSM99537 1 0.0000 0.991 1.000 0.000 0.000 0.000
#> GSM99539 4 0.0707 0.926 0.000 0.020 0.000 0.980
#> GSM99541 1 0.1211 0.952 0.960 0.000 0.040 0.000
#> GSM99543 2 0.3400 0.761 0.000 0.820 0.000 0.180
#> GSM99545 2 0.0000 0.937 0.000 1.000 0.000 0.000
#> GSM99547 4 0.0000 0.935 0.000 0.000 0.000 1.000
#> GSM99549 2 0.0000 0.937 0.000 1.000 0.000 0.000
#> GSM99551 4 0.3219 0.830 0.020 0.000 0.112 0.868
#> GSM99553 4 0.0000 0.935 0.000 0.000 0.000 1.000
#> GSM99555 2 0.0336 0.932 0.000 0.992 0.000 0.008
#> GSM99557 2 0.0000 0.937 0.000 1.000 0.000 0.000
#> GSM99559 4 0.0000 0.935 0.000 0.000 0.000 1.000
#> GSM99561 4 0.4643 0.435 0.000 0.344 0.000 0.656
#> GSM99563 3 0.0000 0.975 0.000 0.000 1.000 0.000
#> GSM99565 2 0.4164 0.616 0.000 0.736 0.000 0.264
#> GSM99573 2 0.0000 0.937 0.000 1.000 0.000 0.000
#> GSM99577 1 0.0000 0.991 1.000 0.000 0.000 0.000
#> GSM99579 4 0.1302 0.908 0.000 0.044 0.000 0.956
#> GSM99581 3 0.3400 0.779 0.000 0.000 0.820 0.180
#> GSM99583 4 0.0000 0.935 0.000 0.000 0.000 1.000
#> GSM99585 4 0.0000 0.935 0.000 0.000 0.000 1.000
#> GSM99587 1 0.0000 0.991 1.000 0.000 0.000 0.000
#> GSM99589 4 0.0000 0.935 0.000 0.000 0.000 1.000
#> GSM99591 2 0.0000 0.937 0.000 1.000 0.000 0.000
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM99497 3 0.0510 0.963 0.000 0.000 0.984 0.016 0.000
#> GSM99503 1 0.2471 0.875 0.864 0.000 0.000 0.136 0.000
#> GSM99505 1 0.2179 0.881 0.888 0.000 0.000 0.112 0.000
#> GSM99507 3 0.0510 0.963 0.000 0.000 0.984 0.016 0.000
#> GSM99567 3 0.0510 0.963 0.000 0.000 0.984 0.016 0.000
#> GSM99575 1 0.2471 0.875 0.864 0.000 0.000 0.136 0.000
#> GSM99593 3 0.0510 0.963 0.000 0.000 0.984 0.016 0.000
#> GSM99595 3 0.0510 0.963 0.000 0.000 0.984 0.016 0.000
#> GSM99469 1 0.0000 0.897 1.000 0.000 0.000 0.000 0.000
#> GSM99499 1 0.0000 0.897 1.000 0.000 0.000 0.000 0.000
#> GSM99501 1 0.0000 0.897 1.000 0.000 0.000 0.000 0.000
#> GSM99509 3 0.0000 0.962 0.000 0.000 1.000 0.000 0.000
#> GSM99569 3 0.0162 0.961 0.004 0.000 0.996 0.000 0.000
#> GSM99597 3 0.0324 0.962 0.004 0.000 0.992 0.004 0.000
#> GSM99601 5 0.0162 0.921 0.000 0.000 0.000 0.004 0.996
#> GSM99459 1 0.0510 0.892 0.984 0.000 0.000 0.016 0.000
#> GSM99461 1 0.0000 0.897 1.000 0.000 0.000 0.000 0.000
#> GSM99511 3 0.0000 0.962 0.000 0.000 1.000 0.000 0.000
#> GSM99513 3 0.0000 0.962 0.000 0.000 1.000 0.000 0.000
#> GSM99515 3 0.0510 0.963 0.000 0.000 0.984 0.016 0.000
#> GSM99517 1 0.2471 0.875 0.864 0.000 0.000 0.136 0.000
#> GSM99519 1 0.0000 0.897 1.000 0.000 0.000 0.000 0.000
#> GSM99521 3 0.0510 0.963 0.000 0.000 0.984 0.016 0.000
#> GSM99523 3 0.0000 0.962 0.000 0.000 1.000 0.000 0.000
#> GSM99571 1 0.2516 0.872 0.860 0.000 0.000 0.140 0.000
#> GSM99599 1 0.2471 0.875 0.864 0.000 0.000 0.136 0.000
#> GSM99433 2 0.0000 0.933 0.000 1.000 0.000 0.000 0.000
#> GSM99435 3 0.3003 0.752 0.000 0.188 0.812 0.000 0.000
#> GSM99437 2 0.3607 0.654 0.000 0.752 0.000 0.004 0.244
#> GSM99439 5 0.0000 0.922 0.000 0.000 0.000 0.000 1.000
#> GSM99441 1 0.2471 0.875 0.864 0.000 0.000 0.136 0.000
#> GSM99443 5 0.0000 0.922 0.000 0.000 0.000 0.000 1.000
#> GSM99445 5 0.0000 0.922 0.000 0.000 0.000 0.000 1.000
#> GSM99447 2 0.0510 0.924 0.000 0.984 0.000 0.000 0.016
#> GSM99449 2 0.0000 0.933 0.000 1.000 0.000 0.000 0.000
#> GSM99451 3 0.0000 0.962 0.000 0.000 1.000 0.000 0.000
#> GSM99453 4 0.0609 0.823 0.020 0.000 0.000 0.980 0.000
#> GSM99455 1 0.3210 0.834 0.788 0.000 0.000 0.212 0.000
#> GSM99457 4 0.2020 0.832 0.100 0.000 0.000 0.900 0.000
#> GSM99463 5 0.0000 0.922 0.000 0.000 0.000 0.000 1.000
#> GSM99465 3 0.0771 0.949 0.004 0.020 0.976 0.000 0.000
#> GSM99467 2 0.0000 0.933 0.000 1.000 0.000 0.000 0.000
#> GSM99471 2 0.4973 0.402 0.320 0.632 0.000 0.048 0.000
#> GSM99473 1 0.2450 0.826 0.900 0.052 0.000 0.048 0.000
#> GSM99475 3 0.1732 0.888 0.000 0.080 0.920 0.000 0.000
#> GSM99477 2 0.0000 0.933 0.000 1.000 0.000 0.000 0.000
#> GSM99479 2 0.0000 0.933 0.000 1.000 0.000 0.000 0.000
#> GSM99481 4 0.4304 -0.037 0.484 0.000 0.000 0.516 0.000
#> GSM99483 1 0.1732 0.857 0.920 0.000 0.000 0.080 0.000
#> GSM99485 5 0.4235 0.274 0.000 0.424 0.000 0.000 0.576
#> GSM99487 2 0.2068 0.854 0.000 0.904 0.000 0.004 0.092
#> GSM99489 5 0.0000 0.922 0.000 0.000 0.000 0.000 1.000
#> GSM99491 2 0.0000 0.933 0.000 1.000 0.000 0.000 0.000
#> GSM99493 4 0.1544 0.835 0.068 0.000 0.000 0.932 0.000
#> GSM99495 5 0.0000 0.922 0.000 0.000 0.000 0.000 1.000
#> GSM99525 1 0.1197 0.875 0.952 0.000 0.000 0.048 0.000
#> GSM99527 2 0.1270 0.888 0.000 0.948 0.052 0.000 0.000
#> GSM99529 2 0.0000 0.933 0.000 1.000 0.000 0.000 0.000
#> GSM99531 3 0.0510 0.963 0.000 0.000 0.984 0.016 0.000
#> GSM99533 3 0.1106 0.948 0.024 0.000 0.964 0.012 0.000
#> GSM99535 2 0.0000 0.933 0.000 1.000 0.000 0.000 0.000
#> GSM99537 1 0.2424 0.876 0.868 0.000 0.000 0.132 0.000
#> GSM99539 2 0.0609 0.922 0.000 0.980 0.000 0.000 0.020
#> GSM99541 1 0.0671 0.892 0.980 0.000 0.004 0.016 0.000
#> GSM99543 5 0.2929 0.734 0.000 0.180 0.000 0.000 0.820
#> GSM99545 5 0.0162 0.921 0.000 0.000 0.000 0.004 0.996
#> GSM99547 2 0.0000 0.933 0.000 1.000 0.000 0.000 0.000
#> GSM99549 5 0.0000 0.922 0.000 0.000 0.000 0.000 1.000
#> GSM99551 4 0.3124 0.735 0.136 0.004 0.016 0.844 0.000
#> GSM99553 2 0.0000 0.933 0.000 1.000 0.000 0.000 0.000
#> GSM99555 5 0.0451 0.915 0.000 0.008 0.000 0.004 0.988
#> GSM99557 5 0.0000 0.922 0.000 0.000 0.000 0.000 1.000
#> GSM99559 2 0.0000 0.933 0.000 1.000 0.000 0.000 0.000
#> GSM99561 2 0.4151 0.429 0.000 0.652 0.000 0.004 0.344
#> GSM99563 3 0.0000 0.962 0.000 0.000 1.000 0.000 0.000
#> GSM99565 5 0.3741 0.609 0.000 0.264 0.000 0.004 0.732
#> GSM99573 5 0.0000 0.922 0.000 0.000 0.000 0.000 1.000
#> GSM99577 1 0.1410 0.870 0.940 0.000 0.000 0.060 0.000
#> GSM99579 2 0.1121 0.903 0.000 0.956 0.000 0.000 0.044
#> GSM99581 3 0.2929 0.752 0.000 0.180 0.820 0.000 0.000
#> GSM99583 2 0.0000 0.933 0.000 1.000 0.000 0.000 0.000
#> GSM99585 2 0.0000 0.933 0.000 1.000 0.000 0.000 0.000
#> GSM99587 4 0.1544 0.835 0.068 0.000 0.000 0.932 0.000
#> GSM99589 2 0.0000 0.933 0.000 1.000 0.000 0.000 0.000
#> GSM99591 5 0.0162 0.921 0.000 0.000 0.000 0.004 0.996
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM99497 3 0.2197 0.896 0.000 0.000 0.900 0.056 0.000 0.044
#> GSM99503 1 0.3440 0.758 0.776 0.000 0.000 0.028 0.000 0.196
#> GSM99505 1 0.1141 0.816 0.948 0.000 0.000 0.000 0.000 0.052
#> GSM99507 3 0.2197 0.896 0.000 0.000 0.900 0.056 0.000 0.044
#> GSM99567 3 0.2197 0.896 0.000 0.000 0.900 0.056 0.000 0.044
#> GSM99575 1 0.3440 0.758 0.776 0.000 0.000 0.028 0.000 0.196
#> GSM99593 3 0.2197 0.896 0.000 0.000 0.900 0.056 0.000 0.044
#> GSM99595 3 0.2197 0.896 0.000 0.000 0.900 0.056 0.000 0.044
#> GSM99469 1 0.0000 0.826 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99499 1 0.0000 0.826 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99501 1 0.0000 0.826 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99509 3 0.0260 0.891 0.000 0.000 0.992 0.008 0.000 0.000
#> GSM99569 3 0.3986 -0.052 0.464 0.000 0.532 0.004 0.000 0.000
#> GSM99597 1 0.4570 0.394 0.600 0.000 0.364 0.020 0.000 0.016
#> GSM99601 5 0.1265 0.896 0.000 0.000 0.000 0.044 0.948 0.008
#> GSM99459 1 0.0146 0.824 0.996 0.000 0.000 0.004 0.000 0.000
#> GSM99461 1 0.0000 0.826 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99511 3 0.0146 0.890 0.000 0.000 0.996 0.004 0.000 0.000
#> GSM99513 3 0.0146 0.890 0.000 0.000 0.996 0.004 0.000 0.000
#> GSM99515 3 0.2197 0.896 0.000 0.000 0.900 0.056 0.000 0.044
#> GSM99517 1 0.3440 0.758 0.776 0.000 0.000 0.028 0.000 0.196
#> GSM99519 1 0.0000 0.826 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99521 3 0.2197 0.896 0.000 0.000 0.900 0.056 0.000 0.044
#> GSM99523 3 0.1531 0.855 0.068 0.000 0.928 0.004 0.000 0.000
#> GSM99571 4 0.5440 0.318 0.224 0.000 0.000 0.576 0.000 0.200
#> GSM99599 1 0.3440 0.758 0.776 0.000 0.000 0.028 0.000 0.196
#> GSM99433 2 0.0935 0.919 0.000 0.964 0.000 0.032 0.000 0.004
#> GSM99435 3 0.2946 0.741 0.000 0.184 0.808 0.004 0.000 0.004
#> GSM99437 2 0.4245 0.627 0.000 0.716 0.000 0.048 0.228 0.008
#> GSM99439 5 0.0000 0.903 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM99441 1 0.3440 0.758 0.776 0.000 0.000 0.028 0.000 0.196
#> GSM99443 5 0.0865 0.900 0.000 0.000 0.000 0.036 0.964 0.000
#> GSM99445 5 0.0937 0.900 0.000 0.000 0.000 0.040 0.960 0.000
#> GSM99447 2 0.0458 0.932 0.000 0.984 0.000 0.000 0.016 0.000
#> GSM99449 2 0.0000 0.940 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM99451 3 0.0000 0.891 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM99453 4 0.3190 0.651 0.008 0.000 0.000 0.772 0.000 0.220
#> GSM99455 4 0.2568 0.760 0.056 0.000 0.000 0.876 0.000 0.068
#> GSM99457 6 0.1387 0.835 0.068 0.000 0.000 0.000 0.000 0.932
#> GSM99463 5 0.0000 0.903 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM99465 3 0.0692 0.884 0.000 0.020 0.976 0.004 0.000 0.000
#> GSM99467 2 0.0000 0.940 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM99471 4 0.2320 0.658 0.004 0.132 0.000 0.864 0.000 0.000
#> GSM99473 1 0.4563 0.411 0.628 0.056 0.000 0.316 0.000 0.000
#> GSM99475 3 0.1152 0.870 0.000 0.044 0.952 0.004 0.000 0.000
#> GSM99477 2 0.0000 0.940 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM99479 2 0.0000 0.940 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM99481 6 0.3312 0.679 0.180 0.000 0.000 0.028 0.000 0.792
#> GSM99483 4 0.1910 0.764 0.108 0.000 0.000 0.892 0.000 0.000
#> GSM99485 5 0.3810 0.290 0.000 0.428 0.000 0.000 0.572 0.000
#> GSM99487 2 0.3016 0.816 0.000 0.852 0.000 0.048 0.092 0.008
#> GSM99489 5 0.0000 0.903 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM99491 2 0.0000 0.940 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM99493 6 0.1141 0.839 0.052 0.000 0.000 0.000 0.000 0.948
#> GSM99495 5 0.0000 0.903 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM99525 4 0.2178 0.753 0.132 0.000 0.000 0.868 0.000 0.000
#> GSM99527 2 0.1858 0.853 0.000 0.904 0.092 0.004 0.000 0.000
#> GSM99529 2 0.0000 0.940 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM99531 3 0.2197 0.896 0.000 0.000 0.900 0.056 0.000 0.044
#> GSM99533 3 0.1787 0.895 0.016 0.000 0.932 0.020 0.000 0.032
#> GSM99535 2 0.0000 0.940 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM99537 1 0.2300 0.791 0.856 0.000 0.000 0.000 0.000 0.144
#> GSM99539 2 0.0547 0.929 0.000 0.980 0.000 0.000 0.020 0.000
#> GSM99541 1 0.0146 0.824 0.996 0.000 0.000 0.004 0.000 0.000
#> GSM99543 5 0.2664 0.723 0.000 0.184 0.000 0.000 0.816 0.000
#> GSM99545 5 0.1333 0.894 0.000 0.000 0.000 0.048 0.944 0.008
#> GSM99547 2 0.0000 0.940 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM99549 5 0.0000 0.903 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM99551 6 0.4077 0.524 0.060 0.000 0.008 0.180 0.000 0.752
#> GSM99553 2 0.0000 0.940 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM99555 5 0.1523 0.893 0.000 0.008 0.000 0.044 0.940 0.008
#> GSM99557 5 0.0000 0.903 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM99559 2 0.0000 0.940 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM99561 2 0.4788 0.329 0.000 0.600 0.000 0.048 0.344 0.008
#> GSM99563 3 0.0146 0.890 0.000 0.000 0.996 0.004 0.000 0.000
#> GSM99565 5 0.4455 0.578 0.000 0.264 0.000 0.048 0.680 0.008
#> GSM99573 5 0.0000 0.903 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM99577 1 0.3076 0.601 0.760 0.000 0.000 0.240 0.000 0.000
#> GSM99579 2 0.0937 0.913 0.000 0.960 0.000 0.000 0.040 0.000
#> GSM99581 3 0.2772 0.705 0.000 0.180 0.816 0.004 0.000 0.000
#> GSM99583 2 0.0000 0.940 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM99585 2 0.0000 0.940 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM99587 6 0.1141 0.839 0.052 0.000 0.000 0.000 0.000 0.948
#> GSM99589 2 0.0000 0.940 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM99591 5 0.1010 0.900 0.000 0.000 0.000 0.036 0.960 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 disease.state(p) cell.type(p) k
#> ATC:pam 82 3.78e-05 0.000221 2
#> ATC:pam 84 3.89e-04 0.009260 3
#> ATC:pam 83 7.02e-06 0.000812 4
#> ATC:pam 81 1.94e-06 0.000717 5
#> ATC:pam 79 4.10e-07 0.000236 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 21512 rows and 85 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'ATC' method.
#> Subgroups are detected by 'mclust' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 3.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
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.449 0.771 0.822 0.3950 0.662 0.662
#> 3 3 0.860 0.875 0.946 0.6761 0.651 0.485
#> 4 4 0.736 0.738 0.857 0.0988 0.901 0.726
#> 5 5 0.808 0.795 0.891 0.0663 0.913 0.705
#> 6 6 0.792 0.691 0.839 0.0390 0.967 0.858
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
#> GSM99497 1 0.9129 0.997 0.672 0.328
#> GSM99503 2 0.9522 0.732 0.372 0.628
#> GSM99505 2 0.9522 0.732 0.372 0.628
#> GSM99507 1 0.9129 0.997 0.672 0.328
#> GSM99567 1 0.9129 0.997 0.672 0.328
#> GSM99575 2 0.9522 0.732 0.372 0.628
#> GSM99593 1 0.9129 0.997 0.672 0.328
#> GSM99595 1 0.9129 0.997 0.672 0.328
#> GSM99469 2 0.9522 0.732 0.372 0.628
#> GSM99499 2 0.9522 0.732 0.372 0.628
#> GSM99501 2 0.9522 0.732 0.372 0.628
#> GSM99509 1 0.9129 0.997 0.672 0.328
#> GSM99569 1 0.9129 0.997 0.672 0.328
#> GSM99597 1 0.9129 0.997 0.672 0.328
#> GSM99601 2 0.0000 0.743 0.000 1.000
#> GSM99459 2 0.9491 0.732 0.368 0.632
#> GSM99461 2 0.9491 0.732 0.368 0.632
#> GSM99511 1 0.9129 0.997 0.672 0.328
#> GSM99513 1 0.9129 0.997 0.672 0.328
#> GSM99515 1 0.9129 0.997 0.672 0.328
#> GSM99517 2 0.9522 0.732 0.372 0.628
#> GSM99519 2 0.9491 0.732 0.368 0.632
#> GSM99521 1 0.9129 0.997 0.672 0.328
#> GSM99523 2 0.4431 0.665 0.092 0.908
#> GSM99571 2 0.9522 0.732 0.372 0.628
#> GSM99599 2 0.9522 0.732 0.372 0.628
#> GSM99433 2 0.0000 0.743 0.000 1.000
#> GSM99435 1 0.9170 0.992 0.668 0.332
#> GSM99437 2 0.0000 0.743 0.000 1.000
#> GSM99439 2 0.0000 0.743 0.000 1.000
#> GSM99441 2 0.9522 0.732 0.372 0.628
#> GSM99443 2 0.0000 0.743 0.000 1.000
#> GSM99445 2 0.0000 0.743 0.000 1.000
#> GSM99447 2 0.0000 0.743 0.000 1.000
#> GSM99449 2 0.0000 0.743 0.000 1.000
#> GSM99451 1 0.9170 0.992 0.668 0.332
#> GSM99453 2 0.9522 0.732 0.372 0.628
#> GSM99455 2 0.9522 0.732 0.372 0.628
#> GSM99457 2 0.9522 0.732 0.372 0.628
#> GSM99463 2 0.0000 0.743 0.000 1.000
#> GSM99465 2 0.5737 0.743 0.136 0.864
#> GSM99467 2 0.0000 0.743 0.000 1.000
#> GSM99471 2 0.9427 0.732 0.360 0.640
#> GSM99473 2 0.9427 0.732 0.360 0.640
#> GSM99475 1 0.9129 0.997 0.672 0.328
#> GSM99477 2 0.0000 0.743 0.000 1.000
#> GSM99479 2 0.0000 0.743 0.000 1.000
#> GSM99481 2 0.9522 0.732 0.372 0.628
#> GSM99483 2 0.9522 0.732 0.372 0.628
#> GSM99485 2 0.0000 0.743 0.000 1.000
#> GSM99487 2 0.0000 0.743 0.000 1.000
#> GSM99489 2 0.0000 0.743 0.000 1.000
#> GSM99491 2 0.0000 0.743 0.000 1.000
#> GSM99493 2 0.9522 0.732 0.372 0.628
#> GSM99495 2 0.0000 0.743 0.000 1.000
#> GSM99525 2 0.9522 0.732 0.372 0.628
#> GSM99527 2 0.1184 0.744 0.016 0.984
#> GSM99529 2 0.0000 0.743 0.000 1.000
#> GSM99531 1 0.9129 0.997 0.672 0.328
#> GSM99533 1 0.8813 0.953 0.700 0.300
#> GSM99535 2 0.7453 0.745 0.212 0.788
#> GSM99537 2 0.9522 0.732 0.372 0.628
#> GSM99539 2 0.0000 0.743 0.000 1.000
#> GSM99541 2 0.9522 0.732 0.372 0.628
#> GSM99543 2 0.7453 0.745 0.212 0.788
#> GSM99545 2 0.0000 0.743 0.000 1.000
#> GSM99547 2 0.7219 0.746 0.200 0.800
#> GSM99549 2 0.0000 0.743 0.000 1.000
#> GSM99551 2 0.9491 0.732 0.368 0.632
#> GSM99553 2 0.7815 0.335 0.232 0.768
#> GSM99555 2 0.0000 0.743 0.000 1.000
#> GSM99557 2 0.0000 0.743 0.000 1.000
#> GSM99559 2 0.0376 0.741 0.004 0.996
#> GSM99561 2 0.0000 0.743 0.000 1.000
#> GSM99563 1 0.9129 0.997 0.672 0.328
#> GSM99565 2 0.0000 0.743 0.000 1.000
#> GSM99573 2 0.0000 0.743 0.000 1.000
#> GSM99577 2 0.9522 0.732 0.372 0.628
#> GSM99579 2 0.0000 0.743 0.000 1.000
#> GSM99581 2 0.9933 -0.607 0.452 0.548
#> GSM99583 2 0.5946 0.747 0.144 0.856
#> GSM99585 2 0.0000 0.743 0.000 1.000
#> GSM99587 2 0.9522 0.732 0.372 0.628
#> GSM99589 2 0.0000 0.743 0.000 1.000
#> GSM99591 2 0.0000 0.743 0.000 1.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM99497 3 0.0000 0.985 0.000 0.000 1.000
#> GSM99503 1 0.0000 0.960 1.000 0.000 0.000
#> GSM99505 1 0.4750 0.737 0.784 0.000 0.216
#> GSM99507 3 0.0000 0.985 0.000 0.000 1.000
#> GSM99567 3 0.0000 0.985 0.000 0.000 1.000
#> GSM99575 1 0.0000 0.960 1.000 0.000 0.000
#> GSM99593 3 0.0000 0.985 0.000 0.000 1.000
#> GSM99595 3 0.0000 0.985 0.000 0.000 1.000
#> GSM99469 1 0.0000 0.960 1.000 0.000 0.000
#> GSM99499 1 0.0000 0.960 1.000 0.000 0.000
#> GSM99501 1 0.0000 0.960 1.000 0.000 0.000
#> GSM99509 3 0.0000 0.985 0.000 0.000 1.000
#> GSM99569 3 0.0000 0.985 0.000 0.000 1.000
#> GSM99597 3 0.0000 0.985 0.000 0.000 1.000
#> GSM99601 2 0.0000 0.898 0.000 1.000 0.000
#> GSM99459 1 0.2878 0.882 0.904 0.000 0.096
#> GSM99461 1 0.4796 0.731 0.780 0.000 0.220
#> GSM99511 3 0.0000 0.985 0.000 0.000 1.000
#> GSM99513 3 0.0000 0.985 0.000 0.000 1.000
#> GSM99515 3 0.0000 0.985 0.000 0.000 1.000
#> GSM99517 1 0.0000 0.960 1.000 0.000 0.000
#> GSM99519 1 0.3267 0.862 0.884 0.000 0.116
#> GSM99521 3 0.0000 0.985 0.000 0.000 1.000
#> GSM99523 3 0.0000 0.985 0.000 0.000 1.000
#> GSM99571 1 0.0000 0.960 1.000 0.000 0.000
#> GSM99599 1 0.0000 0.960 1.000 0.000 0.000
#> GSM99433 2 0.0000 0.898 0.000 1.000 0.000
#> GSM99435 3 0.0237 0.981 0.000 0.004 0.996
#> GSM99437 2 0.0000 0.898 0.000 1.000 0.000
#> GSM99439 2 0.0000 0.898 0.000 1.000 0.000
#> GSM99441 1 0.0000 0.960 1.000 0.000 0.000
#> GSM99443 2 0.0000 0.898 0.000 1.000 0.000
#> GSM99445 2 0.0000 0.898 0.000 1.000 0.000
#> GSM99447 2 0.0000 0.898 0.000 1.000 0.000
#> GSM99449 2 0.6126 0.418 0.000 0.600 0.400
#> GSM99451 3 0.0000 0.985 0.000 0.000 1.000
#> GSM99453 1 0.0000 0.960 1.000 0.000 0.000
#> GSM99455 1 0.0000 0.960 1.000 0.000 0.000
#> GSM99457 1 0.0000 0.960 1.000 0.000 0.000
#> GSM99463 2 0.0000 0.898 0.000 1.000 0.000
#> GSM99465 2 0.7063 0.238 0.020 0.516 0.464
#> GSM99467 2 0.0000 0.898 0.000 1.000 0.000
#> GSM99471 1 0.0000 0.960 1.000 0.000 0.000
#> GSM99473 1 0.1289 0.932 0.968 0.032 0.000
#> GSM99475 3 0.0000 0.985 0.000 0.000 1.000
#> GSM99477 2 0.5431 0.613 0.000 0.716 0.284
#> GSM99479 2 0.0000 0.898 0.000 1.000 0.000
#> GSM99481 1 0.0000 0.960 1.000 0.000 0.000
#> GSM99483 1 0.0000 0.960 1.000 0.000 0.000
#> GSM99485 2 0.0000 0.898 0.000 1.000 0.000
#> GSM99487 2 0.0000 0.898 0.000 1.000 0.000
#> GSM99489 2 0.0000 0.898 0.000 1.000 0.000
#> GSM99491 2 0.0000 0.898 0.000 1.000 0.000
#> GSM99493 1 0.0000 0.960 1.000 0.000 0.000
#> GSM99495 2 0.0000 0.898 0.000 1.000 0.000
#> GSM99525 1 0.0000 0.960 1.000 0.000 0.000
#> GSM99527 2 0.6489 0.286 0.004 0.540 0.456
#> GSM99529 2 0.6295 0.248 0.000 0.528 0.472
#> GSM99531 3 0.0000 0.985 0.000 0.000 1.000
#> GSM99533 3 0.0000 0.985 0.000 0.000 1.000
#> GSM99535 2 0.2680 0.844 0.068 0.924 0.008
#> GSM99537 1 0.0000 0.960 1.000 0.000 0.000
#> GSM99539 2 0.0000 0.898 0.000 1.000 0.000
#> GSM99541 1 0.5254 0.657 0.736 0.000 0.264
#> GSM99543 2 0.2680 0.844 0.068 0.924 0.008
#> GSM99545 2 0.0000 0.898 0.000 1.000 0.000
#> GSM99547 2 0.5982 0.549 0.004 0.668 0.328
#> GSM99549 2 0.0000 0.898 0.000 1.000 0.000
#> GSM99551 1 0.0000 0.960 1.000 0.000 0.000
#> GSM99553 3 0.3482 0.834 0.000 0.128 0.872
#> GSM99555 2 0.0000 0.898 0.000 1.000 0.000
#> GSM99557 2 0.0000 0.898 0.000 1.000 0.000
#> GSM99559 2 0.6295 0.246 0.000 0.528 0.472
#> GSM99561 2 0.0000 0.898 0.000 1.000 0.000
#> GSM99563 3 0.0000 0.985 0.000 0.000 1.000
#> GSM99565 2 0.0000 0.898 0.000 1.000 0.000
#> GSM99573 2 0.0000 0.898 0.000 1.000 0.000
#> GSM99577 1 0.0000 0.960 1.000 0.000 0.000
#> GSM99579 2 0.0000 0.898 0.000 1.000 0.000
#> GSM99581 3 0.3340 0.845 0.000 0.120 0.880
#> GSM99583 2 0.6209 0.481 0.004 0.628 0.368
#> GSM99585 2 0.0237 0.895 0.004 0.996 0.000
#> GSM99587 1 0.0000 0.960 1.000 0.000 0.000
#> GSM99589 2 0.0000 0.898 0.000 1.000 0.000
#> GSM99591 2 0.0000 0.898 0.000 1.000 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM99497 3 0.0000 0.951 0.000 0.000 1.000 0.000
#> GSM99503 1 0.0188 0.878 0.996 0.000 0.000 0.004
#> GSM99505 1 0.3048 0.813 0.876 0.000 0.108 0.016
#> GSM99507 3 0.0000 0.951 0.000 0.000 1.000 0.000
#> GSM99567 3 0.0000 0.951 0.000 0.000 1.000 0.000
#> GSM99575 1 0.0000 0.878 1.000 0.000 0.000 0.000
#> GSM99593 3 0.0000 0.951 0.000 0.000 1.000 0.000
#> GSM99595 3 0.0000 0.951 0.000 0.000 1.000 0.000
#> GSM99469 1 0.0469 0.876 0.988 0.000 0.000 0.012
#> GSM99499 1 0.0592 0.876 0.984 0.000 0.000 0.016
#> GSM99501 1 0.0592 0.876 0.984 0.000 0.000 0.016
#> GSM99509 3 0.0000 0.951 0.000 0.000 1.000 0.000
#> GSM99569 3 0.0000 0.951 0.000 0.000 1.000 0.000
#> GSM99597 3 0.0000 0.951 0.000 0.000 1.000 0.000
#> GSM99601 2 0.4134 0.165 0.000 0.740 0.000 0.260
#> GSM99459 1 0.2530 0.849 0.896 0.004 0.000 0.100
#> GSM99461 1 0.4475 0.796 0.816 0.004 0.080 0.100
#> GSM99511 3 0.0000 0.951 0.000 0.000 1.000 0.000
#> GSM99513 3 0.0000 0.951 0.000 0.000 1.000 0.000
#> GSM99515 3 0.0000 0.951 0.000 0.000 1.000 0.000
#> GSM99517 1 0.0188 0.878 0.996 0.000 0.000 0.004
#> GSM99519 1 0.2861 0.848 0.892 0.004 0.012 0.092
#> GSM99521 3 0.0000 0.951 0.000 0.000 1.000 0.000
#> GSM99523 3 0.0336 0.948 0.000 0.008 0.992 0.000
#> GSM99571 1 0.4008 0.852 0.756 0.000 0.000 0.244
#> GSM99599 1 0.2011 0.873 0.920 0.000 0.000 0.080
#> GSM99433 2 0.0000 0.717 0.000 1.000 0.000 0.000
#> GSM99435 3 0.0779 0.943 0.000 0.016 0.980 0.004
#> GSM99437 2 0.0000 0.717 0.000 1.000 0.000 0.000
#> GSM99439 4 0.4790 0.950 0.000 0.380 0.000 0.620
#> GSM99441 1 0.2345 0.874 0.900 0.000 0.000 0.100
#> GSM99443 2 0.4925 -0.512 0.000 0.572 0.000 0.428
#> GSM99445 2 0.4967 -0.583 0.000 0.548 0.000 0.452
#> GSM99447 2 0.0000 0.717 0.000 1.000 0.000 0.000
#> GSM99449 2 0.5126 0.158 0.000 0.552 0.444 0.004
#> GSM99451 3 0.0804 0.944 0.000 0.012 0.980 0.008
#> GSM99453 1 0.4008 0.852 0.756 0.000 0.000 0.244
#> GSM99455 1 0.4008 0.852 0.756 0.000 0.000 0.244
#> GSM99457 1 0.4008 0.852 0.756 0.000 0.000 0.244
#> GSM99463 4 0.4790 0.950 0.000 0.380 0.000 0.620
#> GSM99465 3 0.4830 0.778 0.036 0.136 0.800 0.028
#> GSM99467 2 0.0188 0.716 0.000 0.996 0.000 0.004
#> GSM99471 1 0.5491 0.799 0.688 0.052 0.000 0.260
#> GSM99473 1 0.2888 0.838 0.872 0.004 0.000 0.124
#> GSM99475 3 0.0927 0.942 0.000 0.016 0.976 0.008
#> GSM99477 2 0.3768 0.523 0.000 0.808 0.184 0.008
#> GSM99479 2 0.0188 0.716 0.000 0.996 0.000 0.004
#> GSM99481 1 0.2011 0.873 0.920 0.000 0.000 0.080
#> GSM99483 1 0.4008 0.852 0.756 0.000 0.000 0.244
#> GSM99485 2 0.0592 0.706 0.000 0.984 0.000 0.016
#> GSM99487 2 0.0000 0.717 0.000 1.000 0.000 0.000
#> GSM99489 4 0.4790 0.950 0.000 0.380 0.000 0.620
#> GSM99491 2 0.0000 0.717 0.000 1.000 0.000 0.000
#> GSM99493 1 0.4008 0.852 0.756 0.000 0.000 0.244
#> GSM99495 4 0.4790 0.950 0.000 0.380 0.000 0.620
#> GSM99525 1 0.3356 0.865 0.824 0.000 0.000 0.176
#> GSM99527 3 0.4900 0.666 0.000 0.236 0.732 0.032
#> GSM99529 2 0.4857 0.379 0.000 0.668 0.324 0.008
#> GSM99531 3 0.0188 0.950 0.000 0.004 0.996 0.000
#> GSM99533 3 0.1297 0.935 0.000 0.020 0.964 0.016
#> GSM99535 2 0.3142 0.590 0.008 0.860 0.000 0.132
#> GSM99537 1 0.0188 0.878 0.996 0.000 0.000 0.004
#> GSM99539 2 0.0000 0.717 0.000 1.000 0.000 0.000
#> GSM99541 1 0.4542 0.690 0.752 0.000 0.228 0.020
#> GSM99543 4 0.4973 0.756 0.008 0.348 0.000 0.644
#> GSM99545 2 0.0524 0.713 0.000 0.988 0.004 0.008
#> GSM99547 2 0.4459 0.505 0.000 0.780 0.188 0.032
#> GSM99549 4 0.4730 0.928 0.000 0.364 0.000 0.636
#> GSM99551 1 0.4277 0.831 0.720 0.000 0.000 0.280
#> GSM99553 3 0.2281 0.863 0.000 0.096 0.904 0.000
#> GSM99555 2 0.1302 0.676 0.000 0.956 0.000 0.044
#> GSM99557 2 0.4998 -0.685 0.000 0.512 0.000 0.488
#> GSM99559 2 0.4866 0.307 0.000 0.596 0.404 0.000
#> GSM99561 2 0.0000 0.717 0.000 1.000 0.000 0.000
#> GSM99563 3 0.0000 0.951 0.000 0.000 1.000 0.000
#> GSM99565 2 0.0000 0.717 0.000 1.000 0.000 0.000
#> GSM99573 4 0.4817 0.939 0.000 0.388 0.000 0.612
#> GSM99577 1 0.3356 0.866 0.824 0.000 0.000 0.176
#> GSM99579 2 0.0336 0.712 0.000 0.992 0.000 0.008
#> GSM99581 3 0.0336 0.947 0.000 0.008 0.992 0.000
#> GSM99583 3 0.5237 0.438 0.000 0.356 0.628 0.016
#> GSM99585 2 0.0469 0.711 0.000 0.988 0.000 0.012
#> GSM99587 1 0.4008 0.852 0.756 0.000 0.000 0.244
#> GSM99589 2 0.0707 0.702 0.000 0.980 0.000 0.020
#> GSM99591 2 0.4933 -0.524 0.000 0.568 0.000 0.432
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM99497 3 0.0000 0.954 0.000 0.000 1.000 0.000 0.000
#> GSM99503 1 0.3816 0.796 0.696 0.000 0.000 0.304 0.000
#> GSM99505 1 0.3489 0.848 0.784 0.000 0.004 0.208 0.004
#> GSM99507 3 0.0000 0.954 0.000 0.000 1.000 0.000 0.000
#> GSM99567 3 0.0000 0.954 0.000 0.000 1.000 0.000 0.000
#> GSM99575 1 0.3730 0.816 0.712 0.000 0.000 0.288 0.000
#> GSM99593 3 0.0000 0.954 0.000 0.000 1.000 0.000 0.000
#> GSM99595 3 0.0000 0.954 0.000 0.000 1.000 0.000 0.000
#> GSM99469 1 0.3242 0.848 0.784 0.000 0.000 0.216 0.000
#> GSM99499 1 0.3242 0.848 0.784 0.000 0.000 0.216 0.000
#> GSM99501 1 0.3242 0.848 0.784 0.000 0.000 0.216 0.000
#> GSM99509 3 0.0000 0.954 0.000 0.000 1.000 0.000 0.000
#> GSM99569 3 0.0451 0.952 0.000 0.008 0.988 0.000 0.004
#> GSM99597 3 0.0000 0.954 0.000 0.000 1.000 0.000 0.000
#> GSM99601 2 0.3109 0.712 0.000 0.800 0.000 0.000 0.200
#> GSM99459 1 0.1478 0.787 0.936 0.000 0.000 0.064 0.000
#> GSM99461 1 0.1478 0.787 0.936 0.000 0.000 0.064 0.000
#> GSM99511 3 0.0000 0.954 0.000 0.000 1.000 0.000 0.000
#> GSM99513 3 0.0000 0.954 0.000 0.000 1.000 0.000 0.000
#> GSM99515 3 0.0000 0.954 0.000 0.000 1.000 0.000 0.000
#> GSM99517 1 0.3730 0.816 0.712 0.000 0.000 0.288 0.000
#> GSM99519 1 0.1478 0.787 0.936 0.000 0.000 0.064 0.000
#> GSM99521 3 0.0324 0.953 0.000 0.004 0.992 0.000 0.004
#> GSM99523 3 0.1618 0.937 0.008 0.008 0.944 0.000 0.040
#> GSM99571 4 0.0000 0.794 0.000 0.000 0.000 1.000 0.000
#> GSM99599 4 0.4297 -0.280 0.472 0.000 0.000 0.528 0.000
#> GSM99433 2 0.0000 0.877 0.000 1.000 0.000 0.000 0.000
#> GSM99435 3 0.0579 0.952 0.000 0.008 0.984 0.000 0.008
#> GSM99437 2 0.0290 0.874 0.000 0.992 0.000 0.000 0.008
#> GSM99439 5 0.1270 0.931 0.000 0.052 0.000 0.000 0.948
#> GSM99441 4 0.4283 -0.227 0.456 0.000 0.000 0.544 0.000
#> GSM99443 2 0.3796 0.567 0.000 0.700 0.000 0.000 0.300
#> GSM99445 2 0.4045 0.458 0.000 0.644 0.000 0.000 0.356
#> GSM99447 2 0.0162 0.876 0.004 0.996 0.000 0.000 0.000
#> GSM99449 3 0.3835 0.655 0.000 0.260 0.732 0.000 0.008
#> GSM99451 3 0.1538 0.939 0.008 0.008 0.948 0.000 0.036
#> GSM99453 4 0.0000 0.794 0.000 0.000 0.000 1.000 0.000
#> GSM99455 4 0.0000 0.794 0.000 0.000 0.000 1.000 0.000
#> GSM99457 4 0.0000 0.794 0.000 0.000 0.000 1.000 0.000
#> GSM99463 5 0.1121 0.931 0.000 0.044 0.000 0.000 0.956
#> GSM99465 3 0.3997 0.832 0.136 0.024 0.808 0.000 0.032
#> GSM99467 2 0.0000 0.877 0.000 1.000 0.000 0.000 0.000
#> GSM99471 4 0.3953 0.660 0.148 0.060 0.000 0.792 0.000
#> GSM99473 1 0.2771 0.785 0.860 0.012 0.000 0.128 0.000
#> GSM99475 3 0.1251 0.942 0.000 0.008 0.956 0.000 0.036
#> GSM99477 2 0.4100 0.646 0.044 0.764 0.192 0.000 0.000
#> GSM99479 2 0.0000 0.877 0.000 1.000 0.000 0.000 0.000
#> GSM99481 4 0.4297 -0.280 0.472 0.000 0.000 0.528 0.000
#> GSM99483 4 0.0000 0.794 0.000 0.000 0.000 1.000 0.000
#> GSM99485 2 0.0324 0.875 0.004 0.992 0.000 0.000 0.004
#> GSM99487 2 0.0000 0.877 0.000 1.000 0.000 0.000 0.000
#> GSM99489 5 0.1121 0.931 0.000 0.044 0.000 0.000 0.956
#> GSM99491 2 0.0000 0.877 0.000 1.000 0.000 0.000 0.000
#> GSM99493 4 0.0000 0.794 0.000 0.000 0.000 1.000 0.000
#> GSM99495 5 0.1121 0.931 0.000 0.044 0.000 0.000 0.956
#> GSM99525 4 0.1608 0.757 0.072 0.000 0.000 0.928 0.000
#> GSM99527 3 0.4850 0.779 0.092 0.112 0.764 0.000 0.032
#> GSM99529 2 0.3064 0.782 0.000 0.856 0.108 0.000 0.036
#> GSM99531 3 0.1251 0.942 0.000 0.008 0.956 0.000 0.036
#> GSM99533 3 0.3018 0.885 0.084 0.008 0.872 0.000 0.036
#> GSM99535 2 0.3906 0.748 0.112 0.804 0.000 0.000 0.084
#> GSM99537 1 0.3707 0.819 0.716 0.000 0.000 0.284 0.000
#> GSM99539 2 0.0000 0.877 0.000 1.000 0.000 0.000 0.000
#> GSM99541 1 0.5163 0.633 0.692 0.000 0.156 0.152 0.000
#> GSM99543 5 0.2773 0.844 0.112 0.020 0.000 0.000 0.868
#> GSM99545 2 0.0162 0.876 0.000 0.996 0.000 0.000 0.004
#> GSM99547 2 0.2308 0.834 0.048 0.912 0.004 0.000 0.036
#> GSM99549 5 0.1341 0.928 0.000 0.056 0.000 0.000 0.944
#> GSM99551 4 0.2648 0.713 0.152 0.000 0.000 0.848 0.000
#> GSM99553 3 0.1357 0.922 0.000 0.048 0.948 0.000 0.004
#> GSM99555 2 0.0510 0.871 0.000 0.984 0.000 0.000 0.016
#> GSM99557 5 0.3636 0.632 0.000 0.272 0.000 0.000 0.728
#> GSM99559 2 0.4211 0.459 0.000 0.636 0.360 0.000 0.004
#> GSM99561 2 0.0000 0.877 0.000 1.000 0.000 0.000 0.000
#> GSM99563 3 0.0000 0.954 0.000 0.000 1.000 0.000 0.000
#> GSM99565 2 0.0162 0.876 0.000 0.996 0.000 0.000 0.004
#> GSM99573 5 0.1341 0.928 0.000 0.056 0.000 0.000 0.944
#> GSM99577 4 0.2020 0.739 0.100 0.000 0.000 0.900 0.000
#> GSM99579 2 0.0290 0.874 0.000 0.992 0.000 0.000 0.008
#> GSM99581 3 0.0451 0.952 0.000 0.008 0.988 0.000 0.004
#> GSM99583 2 0.5332 0.522 0.032 0.660 0.272 0.000 0.036
#> GSM99585 2 0.0000 0.877 0.000 1.000 0.000 0.000 0.000
#> GSM99587 4 0.0000 0.794 0.000 0.000 0.000 1.000 0.000
#> GSM99589 2 0.0771 0.871 0.004 0.976 0.000 0.000 0.020
#> GSM99591 2 0.3837 0.554 0.000 0.692 0.000 0.000 0.308
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM99497 3 0.0146 0.9293 0.000 0.000 0.996 0.004 0.000 0.000
#> GSM99503 1 0.2793 0.8837 0.800 0.000 0.000 0.000 0.000 0.200
#> GSM99505 1 0.2491 0.8958 0.836 0.000 0.000 0.000 0.000 0.164
#> GSM99507 3 0.0146 0.9293 0.000 0.000 0.996 0.004 0.000 0.000
#> GSM99567 3 0.0146 0.9293 0.000 0.000 0.996 0.004 0.000 0.000
#> GSM99575 1 0.2762 0.8855 0.804 0.000 0.000 0.000 0.000 0.196
#> GSM99593 3 0.0000 0.9299 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM99595 3 0.0146 0.9293 0.000 0.000 0.996 0.004 0.000 0.000
#> GSM99469 1 0.2491 0.8958 0.836 0.000 0.000 0.000 0.000 0.164
#> GSM99499 1 0.2491 0.8958 0.836 0.000 0.000 0.000 0.000 0.164
#> GSM99501 1 0.2491 0.8958 0.836 0.000 0.000 0.000 0.000 0.164
#> GSM99509 3 0.0000 0.9299 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM99569 3 0.0713 0.9224 0.000 0.000 0.972 0.028 0.000 0.000
#> GSM99597 3 0.0000 0.9299 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM99601 2 0.5238 0.4429 0.000 0.592 0.000 0.140 0.268 0.000
#> GSM99459 1 0.3066 0.8676 0.832 0.000 0.000 0.044 0.000 0.124
#> GSM99461 1 0.3041 0.8705 0.832 0.000 0.000 0.040 0.000 0.128
#> GSM99511 3 0.0000 0.9299 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM99513 3 0.0000 0.9299 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM99515 3 0.0146 0.9293 0.000 0.000 0.996 0.004 0.000 0.000
#> GSM99517 1 0.2793 0.8837 0.800 0.000 0.000 0.000 0.000 0.200
#> GSM99519 1 0.3041 0.8705 0.832 0.000 0.000 0.040 0.000 0.128
#> GSM99521 3 0.0713 0.9218 0.000 0.000 0.972 0.028 0.000 0.000
#> GSM99523 3 0.1285 0.9080 0.004 0.000 0.944 0.052 0.000 0.000
#> GSM99571 6 0.0000 0.7851 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM99599 6 0.3847 -0.1044 0.456 0.000 0.000 0.000 0.000 0.544
#> GSM99433 2 0.0458 0.7376 0.000 0.984 0.000 0.016 0.000 0.000
#> GSM99435 3 0.2838 0.7467 0.000 0.004 0.808 0.188 0.000 0.000
#> GSM99437 2 0.1765 0.7232 0.000 0.904 0.000 0.096 0.000 0.000
#> GSM99439 5 0.0000 0.8857 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM99441 6 0.3804 0.0130 0.424 0.000 0.000 0.000 0.000 0.576
#> GSM99443 2 0.5571 0.3331 0.004 0.532 0.000 0.140 0.324 0.000
#> GSM99445 2 0.5621 0.2897 0.004 0.512 0.000 0.140 0.344 0.000
#> GSM99447 2 0.0363 0.7418 0.000 0.988 0.000 0.012 0.000 0.000
#> GSM99449 2 0.6044 -0.4541 0.000 0.376 0.372 0.252 0.000 0.000
#> GSM99451 3 0.2668 0.7777 0.004 0.000 0.828 0.168 0.000 0.000
#> GSM99453 6 0.0405 0.7855 0.008 0.000 0.000 0.004 0.000 0.988
#> GSM99455 6 0.0405 0.7855 0.008 0.000 0.000 0.004 0.000 0.988
#> GSM99457 6 0.0000 0.7851 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM99463 5 0.0000 0.8857 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM99465 4 0.4727 0.3740 0.056 0.000 0.368 0.576 0.000 0.000
#> GSM99467 2 0.1556 0.7013 0.000 0.920 0.000 0.080 0.000 0.000
#> GSM99471 6 0.5240 0.5714 0.160 0.020 0.000 0.160 0.000 0.660
#> GSM99473 1 0.4131 0.4744 0.688 0.000 0.000 0.272 0.000 0.040
#> GSM99475 3 0.2697 0.7531 0.000 0.000 0.812 0.188 0.000 0.000
#> GSM99477 4 0.4344 0.2332 0.000 0.336 0.036 0.628 0.000 0.000
#> GSM99479 2 0.1663 0.6960 0.000 0.912 0.000 0.088 0.000 0.000
#> GSM99481 6 0.3847 -0.1044 0.456 0.000 0.000 0.000 0.000 0.544
#> GSM99483 6 0.0405 0.7855 0.008 0.000 0.000 0.004 0.000 0.988
#> GSM99485 2 0.0790 0.7409 0.000 0.968 0.000 0.032 0.000 0.000
#> GSM99487 2 0.1267 0.7362 0.000 0.940 0.000 0.060 0.000 0.000
#> GSM99489 5 0.0146 0.8844 0.000 0.000 0.000 0.004 0.996 0.000
#> GSM99491 2 0.1007 0.7408 0.000 0.956 0.000 0.044 0.000 0.000
#> GSM99493 6 0.0000 0.7851 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM99495 5 0.0000 0.8857 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM99525 6 0.1492 0.7659 0.036 0.000 0.000 0.024 0.000 0.940
#> GSM99527 4 0.6316 0.4999 0.032 0.160 0.364 0.444 0.000 0.000
#> GSM99529 2 0.4453 0.1644 0.000 0.568 0.032 0.400 0.000 0.000
#> GSM99531 3 0.0937 0.9162 0.000 0.000 0.960 0.040 0.000 0.000
#> GSM99533 3 0.2945 0.7671 0.020 0.000 0.824 0.156 0.000 0.000
#> GSM99535 2 0.4401 0.5842 0.144 0.736 0.000 0.112 0.008 0.000
#> GSM99537 1 0.2793 0.8837 0.800 0.000 0.000 0.000 0.000 0.200
#> GSM99539 2 0.0547 0.7366 0.000 0.980 0.000 0.020 0.000 0.000
#> GSM99541 1 0.4356 0.7100 0.724 0.000 0.140 0.000 0.000 0.136
#> GSM99543 5 0.5220 0.6378 0.144 0.076 0.000 0.084 0.696 0.000
#> GSM99545 2 0.0000 0.7404 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM99547 2 0.4049 0.3735 0.020 0.648 0.000 0.332 0.000 0.000
#> GSM99549 5 0.0291 0.8842 0.000 0.004 0.000 0.004 0.992 0.000
#> GSM99551 6 0.4737 0.5891 0.160 0.000 0.000 0.160 0.000 0.680
#> GSM99553 3 0.1265 0.8790 0.000 0.044 0.948 0.008 0.000 0.000
#> GSM99555 2 0.2146 0.7173 0.000 0.880 0.000 0.116 0.004 0.000
#> GSM99557 5 0.4837 0.4036 0.000 0.288 0.000 0.088 0.624 0.000
#> GSM99559 2 0.5398 0.0546 0.000 0.580 0.240 0.180 0.000 0.000
#> GSM99561 2 0.0547 0.7366 0.000 0.980 0.000 0.020 0.000 0.000
#> GSM99563 3 0.0146 0.9294 0.000 0.000 0.996 0.004 0.000 0.000
#> GSM99565 2 0.1814 0.7215 0.000 0.900 0.000 0.100 0.000 0.000
#> GSM99573 5 0.0291 0.8842 0.000 0.004 0.000 0.004 0.992 0.000
#> GSM99577 6 0.3274 0.6969 0.096 0.000 0.000 0.080 0.000 0.824
#> GSM99579 2 0.1327 0.7378 0.000 0.936 0.000 0.064 0.000 0.000
#> GSM99581 3 0.1863 0.8593 0.000 0.000 0.896 0.104 0.000 0.000
#> GSM99583 2 0.5608 -0.0577 0.020 0.504 0.088 0.388 0.000 0.000
#> GSM99585 2 0.0858 0.7326 0.004 0.968 0.000 0.028 0.000 0.000
#> GSM99587 6 0.0000 0.7851 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM99589 2 0.0547 0.7420 0.000 0.980 0.000 0.020 0.000 0.000
#> GSM99591 2 0.5571 0.3331 0.004 0.532 0.000 0.140 0.324 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 disease.state(p) cell.type(p) k
#> ATC:mclust 83 7.63e-04 0.001601 2
#> ATC:mclust 79 1.68e-05 0.000680 3
#> ATC:mclust 76 1.55e-04 0.012491 4
#> ATC:mclust 80 1.29e-06 0.000632 5
#> ATC:mclust 68 4.57e-07 0.000324 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 21512 rows and 85 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 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.927 0.942 0.976 0.4955 0.503 0.503
#> 3 3 0.982 0.951 0.977 0.3569 0.741 0.524
#> 4 4 0.758 0.670 0.857 0.0771 0.978 0.933
#> 5 5 0.715 0.648 0.814 0.0586 0.904 0.714
#> 6 6 0.728 0.664 0.800 0.0441 0.916 0.693
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 3
#> attr(,"optional")
#> [1] 2
There is also optional best \(k\) = 2 that is worth to check.
Following shows the table of the partitions (You need to click the show/hide
code output link to see it). The membership matrix (columns with name p*
)
is inferred by
clue::cl_consensus()
function with the SE
method. Basically the value in the membership matrix
represents the probability to belong to a certain group. The finall class
label for an item is determined with the group with highest probability it
belongs to.
In get_classes()
function, the entropy is calculated from the membership
matrix and the silhouette score is calculated from the consensus matrix.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> GSM99497 1 0.0000 0.9800 1.000 0.000
#> GSM99503 1 0.0000 0.9800 1.000 0.000
#> GSM99505 1 0.0000 0.9800 1.000 0.000
#> GSM99507 1 0.0000 0.9800 1.000 0.000
#> GSM99567 1 0.0000 0.9800 1.000 0.000
#> GSM99575 1 0.0000 0.9800 1.000 0.000
#> GSM99593 1 0.9963 0.0918 0.536 0.464
#> GSM99595 1 0.0000 0.9800 1.000 0.000
#> GSM99469 1 0.0000 0.9800 1.000 0.000
#> GSM99499 1 0.0000 0.9800 1.000 0.000
#> GSM99501 1 0.0000 0.9800 1.000 0.000
#> GSM99509 1 0.0000 0.9800 1.000 0.000
#> GSM99569 1 0.0000 0.9800 1.000 0.000
#> GSM99597 1 0.0000 0.9800 1.000 0.000
#> GSM99601 2 0.0000 0.9678 0.000 1.000
#> GSM99459 1 0.0000 0.9800 1.000 0.000
#> GSM99461 1 0.0000 0.9800 1.000 0.000
#> GSM99511 1 0.0000 0.9800 1.000 0.000
#> GSM99513 1 0.0000 0.9800 1.000 0.000
#> GSM99515 1 0.0000 0.9800 1.000 0.000
#> GSM99517 1 0.0000 0.9800 1.000 0.000
#> GSM99519 1 0.0000 0.9800 1.000 0.000
#> GSM99521 1 0.0376 0.9767 0.996 0.004
#> GSM99523 1 0.0000 0.9800 1.000 0.000
#> GSM99571 1 0.0000 0.9800 1.000 0.000
#> GSM99599 1 0.0000 0.9800 1.000 0.000
#> GSM99433 2 0.0000 0.9678 0.000 1.000
#> GSM99435 2 0.7528 0.7336 0.216 0.784
#> GSM99437 2 0.0000 0.9678 0.000 1.000
#> GSM99439 2 0.0000 0.9678 0.000 1.000
#> GSM99441 1 0.0000 0.9800 1.000 0.000
#> GSM99443 2 0.0000 0.9678 0.000 1.000
#> GSM99445 2 0.0000 0.9678 0.000 1.000
#> GSM99447 2 0.0000 0.9678 0.000 1.000
#> GSM99449 2 0.0000 0.9678 0.000 1.000
#> GSM99451 1 0.0000 0.9800 1.000 0.000
#> GSM99453 1 0.0000 0.9800 1.000 0.000
#> GSM99455 1 0.0000 0.9800 1.000 0.000
#> GSM99457 1 0.0000 0.9800 1.000 0.000
#> GSM99463 2 0.0000 0.9678 0.000 1.000
#> GSM99465 1 0.0000 0.9800 1.000 0.000
#> GSM99467 2 0.0000 0.9678 0.000 1.000
#> GSM99471 1 0.1414 0.9624 0.980 0.020
#> GSM99473 1 0.0000 0.9800 1.000 0.000
#> GSM99475 1 0.4690 0.8781 0.900 0.100
#> GSM99477 2 0.0000 0.9678 0.000 1.000
#> GSM99479 2 0.0000 0.9678 0.000 1.000
#> GSM99481 1 0.0000 0.9800 1.000 0.000
#> GSM99483 1 0.0000 0.9800 1.000 0.000
#> GSM99485 2 0.0000 0.9678 0.000 1.000
#> GSM99487 2 0.0000 0.9678 0.000 1.000
#> GSM99489 2 0.0000 0.9678 0.000 1.000
#> GSM99491 2 0.0000 0.9678 0.000 1.000
#> GSM99493 1 0.0000 0.9800 1.000 0.000
#> GSM99495 2 0.0000 0.9678 0.000 1.000
#> GSM99525 1 0.0000 0.9800 1.000 0.000
#> GSM99527 2 0.6343 0.8116 0.160 0.840
#> GSM99529 2 0.6973 0.7749 0.188 0.812
#> GSM99531 1 0.0000 0.9800 1.000 0.000
#> GSM99533 1 0.0000 0.9800 1.000 0.000
#> GSM99535 2 0.0000 0.9678 0.000 1.000
#> GSM99537 1 0.0000 0.9800 1.000 0.000
#> GSM99539 2 0.0000 0.9678 0.000 1.000
#> GSM99541 1 0.0000 0.9800 1.000 0.000
#> GSM99543 2 0.0000 0.9678 0.000 1.000
#> GSM99545 2 0.0000 0.9678 0.000 1.000
#> GSM99547 2 0.5629 0.8439 0.132 0.868
#> GSM99549 2 0.0000 0.9678 0.000 1.000
#> GSM99551 1 0.0000 0.9800 1.000 0.000
#> GSM99553 1 0.7745 0.6940 0.772 0.228
#> GSM99555 2 0.0000 0.9678 0.000 1.000
#> GSM99557 2 0.0000 0.9678 0.000 1.000
#> GSM99559 2 0.0000 0.9678 0.000 1.000
#> GSM99561 2 0.0000 0.9678 0.000 1.000
#> GSM99563 1 0.0000 0.9800 1.000 0.000
#> GSM99565 2 0.0000 0.9678 0.000 1.000
#> GSM99573 2 0.0000 0.9678 0.000 1.000
#> GSM99577 1 0.0000 0.9800 1.000 0.000
#> GSM99579 2 0.0000 0.9678 0.000 1.000
#> GSM99581 1 0.3879 0.9054 0.924 0.076
#> GSM99583 2 0.9815 0.2906 0.420 0.580
#> GSM99585 2 0.0000 0.9678 0.000 1.000
#> GSM99587 1 0.0000 0.9800 1.000 0.000
#> GSM99589 2 0.0000 0.9678 0.000 1.000
#> GSM99591 2 0.0000 0.9678 0.000 1.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM99497 3 0.0000 0.989 0.000 0.000 1.000
#> GSM99503 1 0.0000 0.947 1.000 0.000 0.000
#> GSM99505 1 0.6192 0.346 0.580 0.000 0.420
#> GSM99507 3 0.0000 0.989 0.000 0.000 1.000
#> GSM99567 3 0.0000 0.989 0.000 0.000 1.000
#> GSM99575 1 0.0237 0.945 0.996 0.000 0.004
#> GSM99593 3 0.0000 0.989 0.000 0.000 1.000
#> GSM99595 3 0.0000 0.989 0.000 0.000 1.000
#> GSM99469 1 0.0000 0.947 1.000 0.000 0.000
#> GSM99499 1 0.0000 0.947 1.000 0.000 0.000
#> GSM99501 1 0.0747 0.937 0.984 0.000 0.016
#> GSM99509 3 0.0000 0.989 0.000 0.000 1.000
#> GSM99569 3 0.0000 0.989 0.000 0.000 1.000
#> GSM99597 3 0.0000 0.989 0.000 0.000 1.000
#> GSM99601 2 0.0000 0.991 0.000 1.000 0.000
#> GSM99459 1 0.2261 0.896 0.932 0.000 0.068
#> GSM99461 1 0.5431 0.642 0.716 0.000 0.284
#> GSM99511 3 0.0000 0.989 0.000 0.000 1.000
#> GSM99513 3 0.0000 0.989 0.000 0.000 1.000
#> GSM99515 3 0.0000 0.989 0.000 0.000 1.000
#> GSM99517 1 0.0000 0.947 1.000 0.000 0.000
#> GSM99519 1 0.5497 0.629 0.708 0.000 0.292
#> GSM99521 3 0.0000 0.989 0.000 0.000 1.000
#> GSM99523 3 0.0000 0.989 0.000 0.000 1.000
#> GSM99571 1 0.0000 0.947 1.000 0.000 0.000
#> GSM99599 1 0.0000 0.947 1.000 0.000 0.000
#> GSM99433 2 0.0237 0.988 0.000 0.996 0.004
#> GSM99435 3 0.0000 0.989 0.000 0.000 1.000
#> GSM99437 2 0.0000 0.991 0.000 1.000 0.000
#> GSM99439 2 0.0000 0.991 0.000 1.000 0.000
#> GSM99441 1 0.0000 0.947 1.000 0.000 0.000
#> GSM99443 2 0.0000 0.991 0.000 1.000 0.000
#> GSM99445 2 0.0000 0.991 0.000 1.000 0.000
#> GSM99447 2 0.0000 0.991 0.000 1.000 0.000
#> GSM99449 3 0.0000 0.989 0.000 0.000 1.000
#> GSM99451 3 0.0000 0.989 0.000 0.000 1.000
#> GSM99453 1 0.0000 0.947 1.000 0.000 0.000
#> GSM99455 1 0.0000 0.947 1.000 0.000 0.000
#> GSM99457 1 0.0000 0.947 1.000 0.000 0.000
#> GSM99463 2 0.0000 0.991 0.000 1.000 0.000
#> GSM99465 3 0.0000 0.989 0.000 0.000 1.000
#> GSM99467 2 0.1289 0.965 0.000 0.968 0.032
#> GSM99471 1 0.0592 0.938 0.988 0.012 0.000
#> GSM99473 1 0.0000 0.947 1.000 0.000 0.000
#> GSM99475 3 0.0000 0.989 0.000 0.000 1.000
#> GSM99477 3 0.0000 0.989 0.000 0.000 1.000
#> GSM99479 2 0.3412 0.864 0.000 0.876 0.124
#> GSM99481 1 0.0000 0.947 1.000 0.000 0.000
#> GSM99483 1 0.0000 0.947 1.000 0.000 0.000
#> GSM99485 2 0.0000 0.991 0.000 1.000 0.000
#> GSM99487 2 0.0000 0.991 0.000 1.000 0.000
#> GSM99489 2 0.0000 0.991 0.000 1.000 0.000
#> GSM99491 2 0.0000 0.991 0.000 1.000 0.000
#> GSM99493 1 0.0000 0.947 1.000 0.000 0.000
#> GSM99495 2 0.0000 0.991 0.000 1.000 0.000
#> GSM99525 1 0.0000 0.947 1.000 0.000 0.000
#> GSM99527 3 0.0000 0.989 0.000 0.000 1.000
#> GSM99529 3 0.2356 0.913 0.000 0.072 0.928
#> GSM99531 3 0.0237 0.985 0.004 0.000 0.996
#> GSM99533 3 0.0000 0.989 0.000 0.000 1.000
#> GSM99535 2 0.0000 0.991 0.000 1.000 0.000
#> GSM99537 1 0.0000 0.947 1.000 0.000 0.000
#> GSM99539 2 0.2261 0.929 0.000 0.932 0.068
#> GSM99541 1 0.5098 0.697 0.752 0.000 0.248
#> GSM99543 2 0.0000 0.991 0.000 1.000 0.000
#> GSM99545 2 0.0000 0.991 0.000 1.000 0.000
#> GSM99547 2 0.1015 0.977 0.012 0.980 0.008
#> GSM99549 2 0.0000 0.991 0.000 1.000 0.000
#> GSM99551 1 0.0000 0.947 1.000 0.000 0.000
#> GSM99553 3 0.0000 0.989 0.000 0.000 1.000
#> GSM99555 2 0.0000 0.991 0.000 1.000 0.000
#> GSM99557 2 0.0000 0.991 0.000 1.000 0.000
#> GSM99559 3 0.0000 0.989 0.000 0.000 1.000
#> GSM99561 2 0.0000 0.991 0.000 1.000 0.000
#> GSM99563 3 0.0000 0.989 0.000 0.000 1.000
#> GSM99565 2 0.0000 0.991 0.000 1.000 0.000
#> GSM99573 2 0.0000 0.991 0.000 1.000 0.000
#> GSM99577 1 0.0000 0.947 1.000 0.000 0.000
#> GSM99579 2 0.0000 0.991 0.000 1.000 0.000
#> GSM99581 3 0.0000 0.989 0.000 0.000 1.000
#> GSM99583 3 0.6383 0.739 0.104 0.128 0.768
#> GSM99585 2 0.0747 0.979 0.000 0.984 0.016
#> GSM99587 1 0.0000 0.947 1.000 0.000 0.000
#> GSM99589 2 0.0000 0.991 0.000 1.000 0.000
#> GSM99591 2 0.0000 0.991 0.000 1.000 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM99497 3 0.1389 0.7869 0.000 0.000 0.952 0.048
#> GSM99503 1 0.0000 0.9318 1.000 0.000 0.000 0.000
#> GSM99505 3 0.5057 0.3085 0.340 0.000 0.648 0.012
#> GSM99507 3 0.0469 0.7892 0.000 0.000 0.988 0.012
#> GSM99567 3 0.0707 0.7853 0.000 0.000 0.980 0.020
#> GSM99575 1 0.0000 0.9318 1.000 0.000 0.000 0.000
#> GSM99593 3 0.0336 0.7882 0.000 0.000 0.992 0.008
#> GSM99595 3 0.1867 0.7632 0.000 0.000 0.928 0.072
#> GSM99469 1 0.0000 0.9318 1.000 0.000 0.000 0.000
#> GSM99499 1 0.0000 0.9318 1.000 0.000 0.000 0.000
#> GSM99501 1 0.0188 0.9302 0.996 0.000 0.000 0.004
#> GSM99509 3 0.0000 0.7872 0.000 0.000 1.000 0.000
#> GSM99569 3 0.2011 0.7765 0.000 0.000 0.920 0.080
#> GSM99597 3 0.0592 0.7861 0.000 0.000 0.984 0.016
#> GSM99601 2 0.0000 0.7600 0.000 1.000 0.000 0.000
#> GSM99459 1 0.4571 0.6699 0.736 0.004 0.008 0.252
#> GSM99461 1 0.4631 0.6573 0.728 0.004 0.008 0.260
#> GSM99511 3 0.1302 0.7816 0.000 0.000 0.956 0.044
#> GSM99513 3 0.2081 0.7553 0.000 0.000 0.916 0.084
#> GSM99515 3 0.1211 0.7892 0.000 0.000 0.960 0.040
#> GSM99517 1 0.0000 0.9318 1.000 0.000 0.000 0.000
#> GSM99519 1 0.4049 0.7311 0.780 0.000 0.008 0.212
#> GSM99521 3 0.0921 0.7896 0.000 0.000 0.972 0.028
#> GSM99523 3 0.3219 0.7126 0.000 0.000 0.836 0.164
#> GSM99571 1 0.0000 0.9318 1.000 0.000 0.000 0.000
#> GSM99599 1 0.0000 0.9318 1.000 0.000 0.000 0.000
#> GSM99433 2 0.4679 0.6142 0.000 0.772 0.044 0.184
#> GSM99435 3 0.2149 0.7618 0.000 0.000 0.912 0.088
#> GSM99437 2 0.4730 0.3642 0.000 0.636 0.000 0.364
#> GSM99439 2 0.2281 0.7237 0.000 0.904 0.000 0.096
#> GSM99441 1 0.0000 0.9318 1.000 0.000 0.000 0.000
#> GSM99443 2 0.0592 0.7575 0.000 0.984 0.000 0.016
#> GSM99445 2 0.0188 0.7599 0.000 0.996 0.000 0.004
#> GSM99447 2 0.0921 0.7569 0.000 0.972 0.000 0.028
#> GSM99449 3 0.3486 0.6835 0.000 0.000 0.812 0.188
#> GSM99451 3 0.3311 0.6677 0.000 0.000 0.828 0.172
#> GSM99453 1 0.1118 0.9174 0.964 0.000 0.000 0.036
#> GSM99455 1 0.0592 0.9260 0.984 0.000 0.000 0.016
#> GSM99457 1 0.0000 0.9318 1.000 0.000 0.000 0.000
#> GSM99463 2 0.1557 0.7479 0.000 0.944 0.000 0.056
#> GSM99465 3 0.5147 -0.0714 0.000 0.004 0.536 0.460
#> GSM99467 2 0.4933 0.1542 0.000 0.568 0.000 0.432
#> GSM99471 1 0.2124 0.8774 0.924 0.068 0.000 0.008
#> GSM99473 1 0.3370 0.8350 0.872 0.048 0.000 0.080
#> GSM99475 3 0.2408 0.7667 0.000 0.000 0.896 0.104
#> GSM99477 3 0.6337 -0.3471 0.000 0.060 0.476 0.464
#> GSM99479 2 0.4917 0.3672 0.000 0.656 0.008 0.336
#> GSM99481 1 0.0000 0.9318 1.000 0.000 0.000 0.000
#> GSM99483 1 0.0188 0.9306 0.996 0.000 0.000 0.004
#> GSM99485 2 0.0000 0.7600 0.000 1.000 0.000 0.000
#> GSM99487 2 0.4866 0.2565 0.000 0.596 0.000 0.404
#> GSM99489 2 0.1118 0.7551 0.000 0.964 0.000 0.036
#> GSM99491 2 0.4382 0.4872 0.000 0.704 0.000 0.296
#> GSM99493 1 0.0000 0.9318 1.000 0.000 0.000 0.000
#> GSM99495 2 0.1474 0.7498 0.000 0.948 0.000 0.052
#> GSM99525 1 0.0000 0.9318 1.000 0.000 0.000 0.000
#> GSM99527 3 0.5768 -0.1696 0.000 0.028 0.516 0.456
#> GSM99529 3 0.7751 -0.6114 0.000 0.344 0.416 0.240
#> GSM99531 3 0.2662 0.7737 0.016 0.000 0.900 0.084
#> GSM99533 3 0.4755 0.6085 0.040 0.000 0.760 0.200
#> GSM99535 2 0.0188 0.7599 0.000 0.996 0.000 0.004
#> GSM99537 1 0.0000 0.9318 1.000 0.000 0.000 0.000
#> GSM99539 2 0.3323 0.6948 0.000 0.876 0.060 0.064
#> GSM99541 1 0.4889 0.3889 0.636 0.000 0.360 0.004
#> GSM99543 2 0.1474 0.7498 0.000 0.948 0.000 0.052
#> GSM99545 2 0.5827 0.3439 0.000 0.568 0.036 0.396
#> GSM99547 2 0.5143 0.3466 0.012 0.628 0.000 0.360
#> GSM99549 2 0.4977 0.3198 0.000 0.540 0.000 0.460
#> GSM99551 1 0.3172 0.8201 0.840 0.000 0.000 0.160
#> GSM99553 3 0.2704 0.7255 0.000 0.000 0.876 0.124
#> GSM99555 2 0.0336 0.7593 0.000 0.992 0.000 0.008
#> GSM99557 2 0.0592 0.7588 0.000 0.984 0.000 0.016
#> GSM99559 3 0.1211 0.7893 0.000 0.000 0.960 0.040
#> GSM99561 2 0.3486 0.6435 0.000 0.812 0.000 0.188
#> GSM99563 3 0.1389 0.7896 0.000 0.000 0.952 0.048
#> GSM99565 2 0.3528 0.6421 0.000 0.808 0.000 0.192
#> GSM99573 2 0.4406 0.5241 0.000 0.700 0.000 0.300
#> GSM99577 1 0.1305 0.9151 0.960 0.000 0.004 0.036
#> GSM99579 2 0.3024 0.6703 0.000 0.852 0.000 0.148
#> GSM99581 3 0.2760 0.7380 0.000 0.000 0.872 0.128
#> GSM99583 4 0.8238 0.0000 0.020 0.256 0.276 0.448
#> GSM99585 2 0.5126 0.0946 0.000 0.552 0.004 0.444
#> GSM99587 1 0.0000 0.9318 1.000 0.000 0.000 0.000
#> GSM99589 2 0.1022 0.7569 0.000 0.968 0.000 0.032
#> GSM99591 2 0.0188 0.7599 0.000 0.996 0.000 0.004
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM99497 3 0.2616 0.71582 0.000 0.000 0.888 0.076 0.036
#> GSM99503 1 0.0162 0.94267 0.996 0.000 0.000 0.004 0.000
#> GSM99505 3 0.4047 0.32904 0.320 0.000 0.676 0.000 0.004
#> GSM99507 3 0.2735 0.71263 0.000 0.000 0.880 0.084 0.036
#> GSM99567 3 0.1981 0.71066 0.000 0.000 0.924 0.028 0.048
#> GSM99575 1 0.0162 0.94267 0.996 0.000 0.000 0.004 0.000
#> GSM99593 3 0.3289 0.70258 0.000 0.000 0.844 0.108 0.048
#> GSM99595 3 0.3710 0.65758 0.000 0.000 0.808 0.048 0.144
#> GSM99469 1 0.0162 0.94299 0.996 0.000 0.000 0.004 0.000
#> GSM99499 1 0.0162 0.94280 0.996 0.000 0.004 0.000 0.000
#> GSM99501 1 0.0000 0.94274 1.000 0.000 0.000 0.000 0.000
#> GSM99509 3 0.2351 0.71594 0.000 0.000 0.896 0.088 0.016
#> GSM99569 3 0.2873 0.70171 0.000 0.000 0.860 0.120 0.020
#> GSM99597 3 0.6326 0.02040 0.000 0.000 0.460 0.380 0.160
#> GSM99601 2 0.0162 0.71135 0.000 0.996 0.000 0.000 0.004
#> GSM99459 1 0.2395 0.88249 0.904 0.000 0.008 0.016 0.072
#> GSM99461 1 0.3316 0.84771 0.860 0.000 0.012 0.072 0.056
#> GSM99511 3 0.3033 0.69603 0.000 0.000 0.864 0.052 0.084
#> GSM99513 3 0.2871 0.69725 0.000 0.000 0.872 0.040 0.088
#> GSM99515 3 0.1117 0.71452 0.000 0.000 0.964 0.020 0.016
#> GSM99517 1 0.0000 0.94274 1.000 0.000 0.000 0.000 0.000
#> GSM99519 1 0.4095 0.68612 0.748 0.000 0.008 0.228 0.016
#> GSM99521 3 0.5927 0.00659 0.000 0.000 0.468 0.428 0.104
#> GSM99523 3 0.3354 0.68328 0.000 0.000 0.844 0.088 0.068
#> GSM99571 1 0.0324 0.94247 0.992 0.000 0.000 0.004 0.004
#> GSM99599 1 0.0000 0.94274 1.000 0.000 0.000 0.000 0.000
#> GSM99433 2 0.5687 0.45484 0.000 0.620 0.008 0.276 0.096
#> GSM99435 3 0.5535 0.28793 0.000 0.000 0.536 0.392 0.072
#> GSM99437 2 0.4757 0.63231 0.000 0.732 0.000 0.148 0.120
#> GSM99439 2 0.2230 0.61750 0.000 0.884 0.000 0.000 0.116
#> GSM99441 1 0.0000 0.94274 1.000 0.000 0.000 0.000 0.000
#> GSM99443 2 0.1661 0.71550 0.000 0.940 0.000 0.036 0.024
#> GSM99445 2 0.0324 0.71316 0.000 0.992 0.000 0.004 0.004
#> GSM99447 2 0.3410 0.65795 0.000 0.840 0.000 0.092 0.068
#> GSM99449 3 0.4347 0.61898 0.000 0.008 0.780 0.136 0.076
#> GSM99451 3 0.5285 0.38061 0.000 0.000 0.584 0.356 0.060
#> GSM99453 1 0.0798 0.93932 0.976 0.000 0.000 0.008 0.016
#> GSM99455 1 0.0932 0.93768 0.972 0.000 0.004 0.004 0.020
#> GSM99457 1 0.1106 0.93473 0.964 0.000 0.000 0.024 0.012
#> GSM99463 2 0.1205 0.69145 0.000 0.956 0.000 0.004 0.040
#> GSM99465 4 0.4214 0.57175 0.004 0.000 0.152 0.780 0.064
#> GSM99467 2 0.6525 0.50597 0.000 0.604 0.044 0.200 0.152
#> GSM99471 1 0.2333 0.89566 0.916 0.052 0.004 0.016 0.012
#> GSM99473 1 0.1461 0.92007 0.952 0.028 0.000 0.004 0.016
#> GSM99475 4 0.6408 0.34442 0.000 0.000 0.272 0.508 0.220
#> GSM99477 4 0.7745 0.08804 0.000 0.100 0.348 0.404 0.148
#> GSM99479 2 0.4961 0.63628 0.000 0.748 0.028 0.080 0.144
#> GSM99481 1 0.0162 0.94267 0.996 0.000 0.000 0.004 0.000
#> GSM99483 1 0.0613 0.94101 0.984 0.000 0.004 0.004 0.008
#> GSM99485 2 0.1310 0.70349 0.000 0.956 0.000 0.024 0.020
#> GSM99487 2 0.5278 0.60479 0.000 0.700 0.008 0.156 0.136
#> GSM99489 2 0.1117 0.70120 0.000 0.964 0.000 0.016 0.020
#> GSM99491 2 0.3810 0.67357 0.000 0.812 0.000 0.100 0.088
#> GSM99493 1 0.0579 0.94160 0.984 0.000 0.000 0.008 0.008
#> GSM99495 2 0.1124 0.69387 0.000 0.960 0.000 0.004 0.036
#> GSM99525 1 0.0324 0.94229 0.992 0.000 0.004 0.004 0.000
#> GSM99527 4 0.4888 0.51454 0.000 0.004 0.160 0.728 0.108
#> GSM99529 4 0.6471 0.48223 0.008 0.148 0.084 0.656 0.104
#> GSM99531 4 0.5301 0.52361 0.008 0.000 0.200 0.688 0.104
#> GSM99533 4 0.4407 0.56407 0.016 0.000 0.180 0.764 0.040
#> GSM99535 2 0.1442 0.71564 0.004 0.952 0.000 0.032 0.012
#> GSM99537 1 0.0404 0.94105 0.988 0.000 0.000 0.012 0.000
#> GSM99539 4 0.3969 0.25549 0.000 0.304 0.004 0.692 0.000
#> GSM99541 4 0.6142 0.39501 0.304 0.000 0.128 0.560 0.008
#> GSM99543 2 0.2353 0.65282 0.004 0.908 0.000 0.028 0.060
#> GSM99545 5 0.5605 0.79541 0.000 0.316 0.028 0.044 0.612
#> GSM99547 3 0.9163 -0.23222 0.040 0.288 0.296 0.204 0.172
#> GSM99549 5 0.4425 0.77752 0.000 0.392 0.000 0.008 0.600
#> GSM99551 1 0.4956 0.55441 0.644 0.004 0.000 0.040 0.312
#> GSM99553 3 0.2984 0.67873 0.000 0.000 0.860 0.032 0.108
#> GSM99555 2 0.3420 0.67606 0.000 0.840 0.000 0.076 0.084
#> GSM99557 2 0.0566 0.70694 0.000 0.984 0.000 0.004 0.012
#> GSM99559 3 0.2917 0.71103 0.000 0.028 0.888 0.052 0.032
#> GSM99561 2 0.5232 0.11885 0.000 0.500 0.000 0.456 0.044
#> GSM99563 3 0.1965 0.71216 0.000 0.000 0.924 0.052 0.024
#> GSM99565 2 0.4365 0.65206 0.000 0.768 0.000 0.116 0.116
#> GSM99573 2 0.4510 -0.46234 0.000 0.560 0.000 0.008 0.432
#> GSM99577 1 0.4487 0.73845 0.756 0.000 0.000 0.104 0.140
#> GSM99579 2 0.4284 0.54208 0.000 0.736 0.000 0.224 0.040
#> GSM99581 3 0.4024 0.59979 0.000 0.000 0.752 0.220 0.028
#> GSM99583 2 0.8713 0.18479 0.040 0.420 0.156 0.244 0.140
#> GSM99585 2 0.6108 0.51777 0.000 0.620 0.020 0.220 0.140
#> GSM99587 1 0.0798 0.93973 0.976 0.000 0.000 0.008 0.016
#> GSM99589 2 0.1095 0.70784 0.000 0.968 0.008 0.012 0.012
#> GSM99591 2 0.0290 0.71336 0.000 0.992 0.000 0.008 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM99497 3 0.2724 0.84541 0.000 0.000 0.880 0.064 0.024 0.032
#> GSM99503 1 0.0146 0.91986 0.996 0.000 0.000 0.000 0.000 0.004
#> GSM99505 3 0.3479 0.62976 0.212 0.000 0.768 0.012 0.000 0.008
#> GSM99507 3 0.2333 0.84972 0.000 0.000 0.884 0.092 0.024 0.000
#> GSM99567 3 0.2103 0.85406 0.000 0.000 0.916 0.024 0.040 0.020
#> GSM99575 1 0.0146 0.91986 0.996 0.000 0.000 0.000 0.000 0.004
#> GSM99593 3 0.3872 0.81042 0.000 0.000 0.808 0.084 0.044 0.064
#> GSM99595 3 0.3628 0.82097 0.000 0.000 0.824 0.052 0.084 0.040
#> GSM99469 1 0.0146 0.92027 0.996 0.000 0.000 0.000 0.000 0.004
#> GSM99499 1 0.1010 0.90556 0.960 0.000 0.036 0.000 0.000 0.004
#> GSM99501 1 0.0405 0.91955 0.988 0.000 0.008 0.004 0.000 0.000
#> GSM99509 3 0.2257 0.85653 0.000 0.000 0.904 0.060 0.020 0.016
#> GSM99569 3 0.3005 0.83464 0.000 0.000 0.848 0.108 0.008 0.036
#> GSM99597 4 0.6111 0.00994 0.000 0.000 0.404 0.448 0.108 0.040
#> GSM99601 2 0.1434 0.77629 0.000 0.940 0.000 0.000 0.012 0.048
#> GSM99459 1 0.2501 0.85341 0.872 0.000 0.004 0.016 0.000 0.108
#> GSM99461 1 0.3455 0.74732 0.784 0.000 0.000 0.036 0.000 0.180
#> GSM99511 3 0.3856 0.78763 0.000 0.000 0.804 0.028 0.076 0.092
#> GSM99513 3 0.3033 0.83173 0.000 0.000 0.856 0.012 0.076 0.056
#> GSM99515 3 0.1180 0.85495 0.000 0.000 0.960 0.012 0.012 0.016
#> GSM99517 1 0.0146 0.91972 0.996 0.000 0.000 0.004 0.000 0.000
#> GSM99519 1 0.3630 0.70883 0.756 0.000 0.000 0.212 0.000 0.032
#> GSM99521 4 0.4805 0.39378 0.000 0.000 0.300 0.636 0.048 0.016
#> GSM99523 3 0.2456 0.85315 0.000 0.000 0.892 0.048 0.008 0.052
#> GSM99571 1 0.0291 0.92018 0.992 0.000 0.000 0.004 0.000 0.004
#> GSM99599 1 0.0146 0.91972 0.996 0.000 0.000 0.004 0.000 0.000
#> GSM99433 6 0.6101 0.42952 0.000 0.164 0.008 0.088 0.116 0.624
#> GSM99435 4 0.7285 0.31621 0.000 0.000 0.204 0.396 0.124 0.276
#> GSM99437 2 0.3727 0.41494 0.000 0.612 0.000 0.000 0.000 0.388
#> GSM99439 2 0.2350 0.72530 0.000 0.880 0.000 0.000 0.100 0.020
#> GSM99441 1 0.0000 0.91969 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM99443 2 0.1967 0.76440 0.000 0.904 0.000 0.000 0.012 0.084
#> GSM99445 2 0.0692 0.77796 0.000 0.976 0.000 0.004 0.000 0.020
#> GSM99447 2 0.5278 0.04476 0.000 0.488 0.000 0.000 0.100 0.412
#> GSM99449 3 0.3352 0.78317 0.000 0.000 0.812 0.032 0.008 0.148
#> GSM99451 4 0.7045 0.29762 0.000 0.000 0.244 0.384 0.072 0.300
#> GSM99453 1 0.1078 0.91490 0.964 0.000 0.000 0.016 0.012 0.008
#> GSM99455 1 0.1520 0.90918 0.948 0.000 0.008 0.020 0.016 0.008
#> GSM99457 1 0.2554 0.86117 0.876 0.000 0.000 0.000 0.048 0.076
#> GSM99463 2 0.0935 0.77283 0.000 0.964 0.000 0.004 0.032 0.000
#> GSM99465 4 0.4347 0.44205 0.000 0.000 0.040 0.668 0.004 0.288
#> GSM99467 2 0.5332 0.13644 0.000 0.496 0.040 0.020 0.008 0.436
#> GSM99471 1 0.5682 0.60131 0.696 0.140 0.004 0.056 0.056 0.048
#> GSM99473 1 0.0935 0.90852 0.964 0.032 0.000 0.004 0.000 0.000
#> GSM99475 4 0.4781 0.55386 0.000 0.000 0.052 0.724 0.160 0.064
#> GSM99477 6 0.4615 0.47837 0.000 0.044 0.168 0.056 0.000 0.732
#> GSM99479 2 0.4352 0.63331 0.000 0.732 0.020 0.020 0.016 0.212
#> GSM99481 1 0.0632 0.91620 0.976 0.000 0.000 0.000 0.000 0.024
#> GSM99483 1 0.1086 0.91523 0.964 0.000 0.000 0.012 0.012 0.012
#> GSM99485 2 0.2078 0.75753 0.000 0.916 0.000 0.032 0.012 0.040
#> GSM99487 2 0.3976 0.42491 0.000 0.612 0.004 0.004 0.000 0.380
#> GSM99489 2 0.0837 0.77147 0.000 0.972 0.000 0.004 0.004 0.020
#> GSM99491 2 0.2547 0.74216 0.000 0.868 0.000 0.016 0.004 0.112
#> GSM99493 1 0.1196 0.91012 0.952 0.000 0.000 0.000 0.008 0.040
#> GSM99495 2 0.1218 0.77160 0.000 0.956 0.000 0.004 0.028 0.012
#> GSM99525 1 0.1332 0.90948 0.952 0.000 0.000 0.028 0.008 0.012
#> GSM99527 6 0.5294 0.07611 0.000 0.004 0.048 0.336 0.028 0.584
#> GSM99529 4 0.5047 0.47873 0.000 0.092 0.028 0.744 0.076 0.060
#> GSM99531 4 0.2562 0.56557 0.008 0.000 0.032 0.896 0.048 0.016
#> GSM99533 4 0.2918 0.56155 0.000 0.000 0.032 0.864 0.020 0.084
#> GSM99535 2 0.2126 0.76444 0.004 0.904 0.000 0.000 0.020 0.072
#> GSM99537 1 0.0622 0.91887 0.980 0.000 0.000 0.008 0.000 0.012
#> GSM99539 4 0.4183 0.49776 0.000 0.104 0.000 0.768 0.016 0.112
#> GSM99541 4 0.3545 0.39134 0.236 0.000 0.008 0.748 0.000 0.008
#> GSM99543 2 0.1901 0.74594 0.000 0.924 0.000 0.008 0.040 0.028
#> GSM99545 5 0.4870 0.45868 0.000 0.136 0.004 0.056 0.732 0.072
#> GSM99547 6 0.6131 0.46066 0.032 0.120 0.104 0.012 0.064 0.668
#> GSM99549 5 0.4251 0.55152 0.000 0.208 0.000 0.000 0.716 0.076
#> GSM99551 5 0.6441 0.23868 0.300 0.012 0.004 0.000 0.416 0.268
#> GSM99553 3 0.3049 0.82091 0.000 0.000 0.864 0.044 0.052 0.040
#> GSM99555 2 0.4424 0.46840 0.000 0.632 0.000 0.000 0.044 0.324
#> GSM99557 2 0.0603 0.77800 0.000 0.980 0.000 0.000 0.016 0.004
#> GSM99559 3 0.2965 0.83990 0.000 0.016 0.864 0.092 0.012 0.016
#> GSM99561 4 0.6267 -0.19109 0.000 0.388 0.000 0.408 0.020 0.184
#> GSM99563 3 0.1624 0.85466 0.000 0.000 0.936 0.012 0.008 0.044
#> GSM99565 2 0.3975 0.25591 0.000 0.544 0.000 0.000 0.004 0.452
#> GSM99573 5 0.4787 0.44743 0.000 0.336 0.000 0.000 0.596 0.068
#> GSM99577 1 0.4795 0.65811 0.712 0.004 0.000 0.128 0.144 0.012
#> GSM99579 2 0.3526 0.69405 0.000 0.828 0.000 0.088 0.028 0.056
#> GSM99581 3 0.3678 0.68424 0.000 0.000 0.752 0.220 0.004 0.024
#> GSM99583 6 0.6656 0.22363 0.048 0.356 0.072 0.044 0.000 0.480
#> GSM99585 6 0.5109 0.29499 0.000 0.376 0.008 0.048 0.008 0.560
#> GSM99587 1 0.1863 0.89417 0.920 0.000 0.000 0.000 0.036 0.044
#> GSM99589 2 0.0870 0.77301 0.000 0.972 0.012 0.000 0.012 0.004
#> GSM99591 2 0.0508 0.77815 0.000 0.984 0.000 0.000 0.004 0.012
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
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 disease.state(p) cell.type(p) k
#> ATC:NMF 83 6.46e-06 4.04e-05 2
#> ATC:NMF 84 3.89e-04 6.14e-03 3
#> ATC:NMF 69 1.03e-03 1.38e-02 4
#> ATC:NMF 70 1.86e-04 1.00e-02 5
#> ATC:NMF 61 1.68e-03 3.80e-02 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