Date: 2019-12-25 20:55:53 CET, cola version: 1.3.2
Document is loading...
All available functions which can be applied to this res_list
object:
res_list
#> A 'ConsensusPartitionList' object with 24 methods.
#> On a matrix with 51941 rows and 79 columns.
#> Top rows are extracted by 'SD, CV, MAD, ATC' methods.
#> Subgroups are detected by 'hclust, kmeans, skmeans, pam, mclust, NMF' method.
#> Number of partitions are tried for k = 2, 3, 4, 5, 6.
#> Performed in total 30000 partitions by row resampling.
#>
#> Following methods can be applied to this 'ConsensusPartitionList' object:
#> [1] "cola_report" "collect_classes" "collect_plots" "collect_stats"
#> [5] "colnames" "functional_enrichment" "get_anno_col" "get_anno"
#> [9] "get_classes" "get_matrix" "get_membership" "get_stats"
#> [13] "is_best_k" "is_stable_k" "ncol" "nrow"
#> [17] "rownames" "show" "suggest_best_k" "test_to_known_factors"
#> [21] "top_rows_heatmap" "top_rows_overlap"
#>
#> You can get result for a single method by, e.g. object["SD", "hclust"] or object["SD:hclust"]
#> or a subset of methods by object[c("SD", "CV")], c("hclust", "kmeans")]
The call of run_all_consensus_partition_methods()
was:
#> run_all_consensus_partition_methods(data = mat, mc.cores = 4, anno = anno)
Dimension of the input matrix:
mat = get_matrix(res_list)
dim(mat)
#> [1] 51941 79
The density distribution for each sample is visualized as in one column in the following heatmap. The clustering is based on the distance which is the Kolmogorov-Smirnov statistic between two distributions.
library(ComplexHeatmap)
densityHeatmap(mat, top_annotation = HeatmapAnnotation(df = get_anno(res_list),
col = get_anno_col(res_list)), ylab = "value", cluster_columns = TRUE, show_column_names = FALSE,
mc.cores = 4)
Folowing table shows the best k
(number of partitions) for each combination
of top-value methods and partition methods. Clicking on the method name in
the table goes to the section for a single combination of methods.
The cola vignette explains the definition of the metrics used for determining the best number of partitions.
suggest_best_k(res_list)
The best k | 1-PAC | Mean silhouette | Concordance | Optional k | ||
---|---|---|---|---|---|---|
SD:kmeans | 2 | 1.000 | 0.977 | 0.987 | ** | |
SD:skmeans | 2 | 1.000 | 0.990 | 0.995 | ** | |
CV:kmeans | 2 | 1.000 | 0.970 | 0.989 | ** | |
CV:skmeans | 2 | 1.000 | 0.975 | 0.990 | ** | |
MAD:skmeans | 2 | 1.000 | 0.981 | 0.992 | ** | |
MAD:mclust | 2 | 1.000 | 0.966 | 0.986 | ** | |
ATC:skmeans | 6 | 0.995 | 0.956 | 0.971 | ** | 4 |
MAD:kmeans | 2 | 0.973 | 0.957 | 0.980 | ** | |
SD:NMF | 2 | 0.973 | 0.955 | 0.980 | ** | |
SD:mclust | 2 | 0.948 | 0.956 | 0.982 | * | |
CV:NMF | 2 | 0.947 | 0.954 | 0.978 | * | |
MAD:hclust | 2 | 0.945 | 0.937 | 0.974 | * | |
ATC:mclust | 6 | 0.927 | 0.947 | 0.957 | * | 2,3,4,5 |
ATC:pam | 6 | 0.908 | 0.822 | 0.921 | * | 2,3,5 |
MAD:NMF | 2 | 0.897 | 0.947 | 0.977 | ||
CV:hclust | 2 | 0.868 | 0.921 | 0.964 | ||
ATC:NMF | 3 | 0.823 | 0.877 | 0.944 | ||
ATC:kmeans | 4 | 0.810 | 0.920 | 0.933 | ||
SD:pam | 3 | 0.738 | 0.806 | 0.907 | ||
SD:hclust | 2 | 0.693 | 0.916 | 0.956 | ||
CV:mclust | 2 | 0.692 | 0.950 | 0.967 | ||
CV:pam | 3 | 0.655 | 0.733 | 0.888 | ||
MAD:pam | 2 | 0.554 | 0.893 | 0.937 | ||
ATC:hclust | 2 | 0.496 | 0.787 | 0.898 |
**: 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.973 0.955 0.980 0.504 0.498 0.498
#> CV:NMF 2 0.947 0.954 0.978 0.503 0.498 0.498
#> MAD:NMF 2 0.897 0.947 0.977 0.503 0.498 0.498
#> ATC:NMF 2 0.706 0.857 0.940 0.502 0.494 0.494
#> SD:skmeans 2 1.000 0.990 0.995 0.506 0.494 0.494
#> CV:skmeans 2 1.000 0.975 0.990 0.506 0.494 0.494
#> MAD:skmeans 2 1.000 0.981 0.992 0.506 0.494 0.494
#> ATC:skmeans 2 0.697 0.811 0.930 0.505 0.496 0.496
#> SD:mclust 2 0.948 0.956 0.982 0.497 0.503 0.503
#> CV:mclust 2 0.692 0.950 0.967 0.494 0.503 0.503
#> MAD:mclust 2 1.000 0.966 0.986 0.498 0.503 0.503
#> ATC:mclust 2 1.000 0.999 1.000 0.500 0.500 0.500
#> SD:kmeans 2 1.000 0.977 0.987 0.505 0.494 0.494
#> CV:kmeans 2 1.000 0.970 0.989 0.506 0.494 0.494
#> MAD:kmeans 2 0.973 0.957 0.980 0.505 0.494 0.494
#> ATC:kmeans 2 0.702 0.858 0.928 0.495 0.503 0.503
#> SD:pam 2 0.645 0.885 0.940 0.448 0.553 0.553
#> CV:pam 2 0.565 0.814 0.916 0.437 0.553 0.553
#> MAD:pam 2 0.554 0.893 0.937 0.462 0.553 0.553
#> ATC:pam 2 1.000 0.971 0.989 0.495 0.503 0.503
#> SD:hclust 2 0.693 0.916 0.956 0.494 0.507 0.507
#> CV:hclust 2 0.868 0.921 0.964 0.497 0.500 0.500
#> MAD:hclust 2 0.945 0.937 0.974 0.496 0.507 0.507
#> ATC:hclust 2 0.496 0.787 0.898 0.415 0.572 0.572
get_stats(res_list, k = 3)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> SD:NMF 3 0.741 0.869 0.929 0.285 0.783 0.591
#> CV:NMF 3 0.725 0.793 0.911 0.302 0.764 0.563
#> MAD:NMF 3 0.766 0.869 0.933 0.289 0.783 0.591
#> ATC:NMF 3 0.823 0.877 0.944 0.328 0.710 0.481
#> SD:skmeans 3 0.774 0.856 0.915 0.274 0.817 0.645
#> CV:skmeans 3 0.834 0.898 0.933 0.273 0.803 0.620
#> MAD:skmeans 3 0.770 0.825 0.900 0.273 0.784 0.591
#> ATC:skmeans 3 0.704 0.931 0.947 0.300 0.758 0.552
#> SD:mclust 3 0.800 0.832 0.920 0.153 0.899 0.809
#> CV:mclust 3 0.792 0.778 0.870 0.226 0.810 0.638
#> MAD:mclust 3 0.746 0.766 0.889 0.208 0.830 0.682
#> ATC:mclust 3 1.000 0.998 0.999 0.290 0.855 0.709
#> SD:kmeans 3 0.606 0.617 0.777 0.266 0.796 0.606
#> CV:kmeans 3 0.617 0.741 0.824 0.281 0.812 0.635
#> MAD:kmeans 3 0.609 0.648 0.765 0.275 0.796 0.606
#> ATC:kmeans 3 0.581 0.648 0.752 0.321 0.741 0.536
#> SD:pam 3 0.738 0.806 0.907 0.467 0.744 0.559
#> CV:pam 3 0.655 0.733 0.888 0.517 0.724 0.526
#> MAD:pam 3 0.576 0.818 0.893 0.418 0.790 0.621
#> ATC:pam 3 1.000 0.969 0.983 0.282 0.824 0.663
#> SD:hclust 3 0.638 0.609 0.807 0.250 0.834 0.679
#> CV:hclust 3 0.685 0.780 0.871 0.285 0.825 0.655
#> MAD:hclust 3 0.658 0.611 0.814 0.252 0.810 0.634
#> ATC:hclust 3 0.545 0.703 0.846 0.310 0.912 0.849
get_stats(res_list, k = 4)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> SD:NMF 4 0.706 0.753 0.863 0.1067 0.859 0.628
#> CV:NMF 4 0.714 0.745 0.864 0.0920 0.835 0.574
#> MAD:NMF 4 0.721 0.775 0.877 0.1104 0.847 0.599
#> ATC:NMF 4 0.849 0.847 0.935 0.1261 0.746 0.391
#> SD:skmeans 4 0.685 0.799 0.848 0.1158 0.907 0.746
#> CV:skmeans 4 0.686 0.756 0.835 0.1100 0.918 0.771
#> MAD:skmeans 4 0.682 0.804 0.852 0.1130 0.920 0.776
#> ATC:skmeans 4 1.000 0.990 0.995 0.1325 0.848 0.597
#> SD:mclust 4 0.762 0.794 0.842 0.1839 0.849 0.671
#> CV:mclust 4 0.767 0.784 0.854 0.1159 0.876 0.684
#> MAD:mclust 4 0.807 0.833 0.889 0.1474 0.864 0.674
#> ATC:mclust 4 1.000 0.970 0.989 0.0687 0.952 0.866
#> SD:kmeans 4 0.527 0.510 0.702 0.1252 0.846 0.614
#> CV:kmeans 4 0.540 0.534 0.741 0.1233 0.908 0.745
#> MAD:kmeans 4 0.550 0.568 0.680 0.1221 0.881 0.687
#> ATC:kmeans 4 0.810 0.920 0.933 0.1338 0.825 0.555
#> SD:pam 4 0.767 0.793 0.886 0.1147 0.881 0.673
#> CV:pam 4 0.706 0.727 0.871 0.1088 0.900 0.711
#> MAD:pam 4 0.769 0.805 0.905 0.1225 0.896 0.706
#> ATC:pam 4 0.834 0.832 0.927 0.1812 0.823 0.552
#> SD:hclust 4 0.622 0.500 0.714 0.1013 0.833 0.590
#> CV:hclust 4 0.594 0.605 0.741 0.1042 0.958 0.878
#> MAD:hclust 4 0.669 0.621 0.735 0.1072 0.888 0.707
#> ATC:hclust 4 0.754 0.767 0.877 0.3039 0.787 0.582
get_stats(res_list, k = 5)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> SD:NMF 5 0.693 0.658 0.811 0.0584 0.888 0.642
#> CV:NMF 5 0.693 0.682 0.830 0.0623 0.858 0.561
#> MAD:NMF 5 0.674 0.658 0.823 0.0589 0.869 0.587
#> ATC:NMF 5 0.685 0.700 0.815 0.0654 0.887 0.593
#> SD:skmeans 5 0.660 0.669 0.790 0.0894 0.913 0.701
#> CV:skmeans 5 0.665 0.521 0.777 0.0880 0.956 0.850
#> MAD:skmeans 5 0.668 0.643 0.786 0.0945 0.931 0.761
#> ATC:skmeans 5 0.890 0.921 0.935 0.0774 0.929 0.730
#> SD:mclust 5 0.517 0.628 0.722 0.1005 0.963 0.886
#> CV:mclust 5 0.631 0.609 0.784 0.1101 0.945 0.820
#> MAD:mclust 5 0.630 0.592 0.782 0.1118 0.930 0.770
#> ATC:mclust 5 1.000 0.985 0.994 0.1240 0.871 0.611
#> SD:kmeans 5 0.555 0.463 0.634 0.0770 0.856 0.567
#> CV:kmeans 5 0.569 0.518 0.692 0.0704 0.843 0.507
#> MAD:kmeans 5 0.556 0.478 0.693 0.0758 0.842 0.531
#> ATC:kmeans 5 0.827 0.693 0.803 0.0683 0.930 0.736
#> SD:pam 5 0.726 0.486 0.741 0.0510 0.895 0.637
#> CV:pam 5 0.702 0.684 0.800 0.0632 0.914 0.683
#> MAD:pam 5 0.743 0.715 0.817 0.0425 0.975 0.909
#> ATC:pam 5 0.975 0.944 0.972 0.0499 0.950 0.805
#> SD:hclust 5 0.661 0.633 0.803 0.0631 0.912 0.727
#> CV:hclust 5 0.627 0.573 0.750 0.0747 0.904 0.682
#> MAD:hclust 5 0.633 0.633 0.761 0.0717 0.883 0.671
#> ATC:hclust 5 0.835 0.747 0.852 0.0897 0.903 0.690
get_stats(res_list, k = 6)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> SD:NMF 6 0.606 0.515 0.719 0.0514 0.982 0.930
#> CV:NMF 6 0.609 0.528 0.716 0.0511 0.956 0.825
#> MAD:NMF 6 0.608 0.524 0.716 0.0462 0.931 0.740
#> ATC:NMF 6 0.678 0.632 0.765 0.0373 0.941 0.720
#> SD:skmeans 6 0.665 0.523 0.687 0.0419 0.948 0.752
#> CV:skmeans 6 0.680 0.572 0.729 0.0451 0.893 0.616
#> MAD:skmeans 6 0.668 0.536 0.738 0.0403 0.949 0.781
#> ATC:skmeans 6 0.995 0.956 0.971 0.0391 0.950 0.760
#> SD:mclust 6 0.797 0.756 0.884 0.0906 0.824 0.460
#> CV:mclust 6 0.723 0.646 0.829 0.0772 0.816 0.407
#> MAD:mclust 6 0.738 0.781 0.863 0.0558 0.812 0.380
#> ATC:mclust 6 0.927 0.947 0.957 0.0553 0.938 0.736
#> SD:kmeans 6 0.612 0.560 0.694 0.0534 0.914 0.641
#> CV:kmeans 6 0.622 0.603 0.726 0.0494 0.918 0.640
#> MAD:kmeans 6 0.603 0.510 0.688 0.0536 0.916 0.646
#> ATC:kmeans 6 0.842 0.855 0.862 0.0425 0.925 0.666
#> SD:pam 6 0.757 0.779 0.882 0.0470 0.860 0.489
#> CV:pam 6 0.754 0.683 0.849 0.0373 0.954 0.788
#> MAD:pam 6 0.747 0.745 0.858 0.0474 0.928 0.723
#> ATC:pam 6 0.908 0.822 0.921 0.0427 0.904 0.606
#> SD:hclust 6 0.654 0.552 0.727 0.0893 0.886 0.604
#> CV:hclust 6 0.661 0.514 0.743 0.0582 0.883 0.547
#> MAD:hclust 6 0.664 0.572 0.695 0.0617 0.877 0.591
#> ATC:hclust 6 0.796 0.722 0.814 0.0444 0.957 0.816
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 gender(p) agent(p) k
#> SD:NMF 78 1.000 0.2561 2
#> CV:NMF 78 1.000 0.2561 2
#> MAD:NMF 77 1.000 0.3005 2
#> ATC:NMF 75 0.728 0.1337 2
#> SD:skmeans 79 0.739 0.4331 2
#> CV:skmeans 77 0.913 0.4221 2
#> MAD:skmeans 78 0.821 0.4968 2
#> ATC:skmeans 68 1.000 0.0536 2
#> SD:mclust 77 0.717 0.1995 2
#> CV:mclust 78 0.819 0.2536 2
#> MAD:mclust 78 0.819 0.2536 2
#> ATC:mclust 79 0.208 0.4204 2
#> SD:kmeans 79 0.739 0.4331 2
#> CV:kmeans 78 0.830 0.3644 2
#> MAD:kmeans 78 0.821 0.4968 2
#> ATC:kmeans 75 1.000 0.1248 2
#> SD:pam 77 1.000 0.4151 2
#> CV:pam 72 0.792 0.0898 2
#> MAD:pam 79 1.000 0.4254 2
#> ATC:pam 78 1.000 0.0667 2
#> SD:hclust 78 0.846 0.3593 2
#> CV:hclust 76 0.841 0.6435 2
#> MAD:hclust 77 0.767 0.4108 2
#> ATC:hclust 67 0.632 0.5423 2
test_to_known_factors(res_list, k = 3)
#> n gender(p) agent(p) k
#> SD:NMF 78 0.4830 0.1368 3
#> CV:NMF 71 0.3209 0.0573 3
#> MAD:NMF 75 0.2977 0.3461 3
#> ATC:NMF 74 0.4184 0.7008 3
#> SD:skmeans 76 0.2908 0.2947 3
#> CV:skmeans 77 0.3344 0.2880 3
#> MAD:skmeans 74 0.3251 0.2599 3
#> ATC:skmeans 79 0.5740 0.1408 3
#> SD:mclust 76 0.4376 0.0317 3
#> CV:mclust 69 0.1391 0.1956 3
#> MAD:mclust 71 0.2565 0.4195 3
#> ATC:mclust 79 0.3314 0.0383 3
#> SD:kmeans 60 0.6418 0.0861 3
#> CV:kmeans 68 0.3431 0.3333 3
#> MAD:kmeans 63 0.5190 0.2579 3
#> ATC:kmeans 63 0.0654 0.1568 3
#> SD:pam 69 0.1755 0.3318 3
#> CV:pam 66 0.0886 0.0817 3
#> MAD:pam 75 0.1762 0.1723 3
#> ATC:pam 79 0.6226 0.0921 3
#> SD:hclust 58 0.2032 0.1244 3
#> CV:hclust 71 0.7030 0.2166 3
#> MAD:hclust 56 0.2123 0.2217 3
#> ATC:hclust 64 0.2027 0.4735 3
test_to_known_factors(res_list, k = 4)
#> n gender(p) agent(p) k
#> SD:NMF 72 0.5649 0.2147 4
#> CV:NMF 72 0.4083 0.3062 4
#> MAD:NMF 73 0.5377 0.2503 4
#> ATC:NMF 72 0.8982 0.1976 4
#> SD:skmeans 75 0.6635 0.3287 4
#> CV:skmeans 72 0.4021 0.4961 4
#> MAD:skmeans 75 0.3697 0.4779 4
#> ATC:skmeans 79 0.0884 0.3980 4
#> SD:mclust 71 0.3130 0.0797 4
#> CV:mclust 70 0.8043 0.0414 4
#> MAD:mclust 74 0.6715 0.0749 4
#> ATC:mclust 78 0.3262 0.0794 4
#> SD:kmeans 51 0.5009 0.1722 4
#> CV:kmeans 52 0.5305 0.4298 4
#> MAD:kmeans 56 0.4118 0.2566 4
#> ATC:kmeans 79 0.0884 0.3980 4
#> SD:pam 72 0.2936 0.3520 4
#> CV:pam 67 0.1345 0.1200 4
#> MAD:pam 71 0.4652 0.0727 4
#> ATC:pam 72 0.0348 0.1149 4
#> SD:hclust 44 1.0000 0.1637 4
#> CV:hclust 58 0.6874 0.4673 4
#> MAD:hclust 52 0.7054 0.1944 4
#> ATC:hclust 67 0.2327 0.7634 4
test_to_known_factors(res_list, k = 5)
#> n gender(p) agent(p) k
#> SD:NMF 63 0.1818 0.4504 5
#> CV:NMF 66 0.3731 0.4044 5
#> MAD:NMF 63 0.1064 0.2657 5
#> ATC:NMF 70 0.8445 0.2113 5
#> SD:skmeans 65 0.6543 0.1453 5
#> CV:skmeans 51 0.2973 0.7152 5
#> MAD:skmeans 66 0.6565 0.1016 5
#> ATC:skmeans 78 0.1621 0.4022 5
#> SD:mclust 67 0.3779 0.0772 5
#> CV:mclust 59 0.8276 0.0105 5
#> MAD:mclust 57 0.5141 0.1352 5
#> ATC:mclust 79 0.5598 0.5422 5
#> SD:kmeans 36 0.3657 0.7783 5
#> CV:kmeans 52 0.3002 0.5270 5
#> MAD:kmeans 50 0.7827 0.1082 5
#> ATC:kmeans 59 0.2578 0.2333 5
#> SD:pam 53 0.1419 0.1141 5
#> CV:pam 67 0.1471 0.2421 5
#> MAD:pam 73 0.4130 0.1500 5
#> ATC:pam 78 0.1460 0.1134 5
#> SD:hclust 58 0.5259 0.0375 5
#> CV:hclust 59 0.9293 0.0913 5
#> MAD:hclust 55 0.9723 0.1352 5
#> ATC:hclust 68 0.0742 0.8420 5
test_to_known_factors(res_list, k = 6)
#> n gender(p) agent(p) k
#> SD:NMF 54 0.0693 0.1887 6
#> CV:NMF 56 0.1553 0.1874 6
#> MAD:NMF 57 0.0804 0.1595 6
#> ATC:NMF 62 0.7342 0.0893 6
#> SD:skmeans 51 0.5108 0.1316 6
#> CV:skmeans 48 0.2867 0.5158 6
#> MAD:skmeans 47 0.3701 0.6289 6
#> ATC:skmeans 78 0.1557 0.3109 6
#> SD:mclust 67 0.7310 0.1808 6
#> CV:mclust 67 0.5507 0.3280 6
#> MAD:mclust 77 0.2515 0.1792 6
#> ATC:mclust 79 0.5163 0.8457 6
#> SD:kmeans 57 0.6394 0.1055 6
#> CV:kmeans 64 0.6072 0.7255 6
#> MAD:kmeans 53 0.7251 0.3272 6
#> ATC:kmeans 77 0.1052 0.3813 6
#> SD:pam 72 0.1968 0.0238 6
#> CV:pam 70 0.0726 0.0242 6
#> MAD:pam 74 0.1994 0.0218 6
#> ATC:pam 71 0.2061 0.2250 6
#> SD:hclust 54 0.8867 0.0647 6
#> CV:hclust 46 0.9392 0.1416 6
#> MAD:hclust 59 0.9278 0.1153 6
#> ATC:hclust 68 0.0966 0.8806 6
The object with results only for a single top-value method and a single partition method can be extracted as:
res = res_list["SD", "hclust"]
# you can also extract it by
# res = res_list["SD:hclust"]
A summary of res
and all the functions that can be applied to it:
res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#> On a matrix with 51941 rows and 79 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'SD' method.
#> Subgroups are detected by 'hclust' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 2.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 0.693 0.916 0.956 0.4938 0.507 0.507
#> 3 3 0.638 0.609 0.807 0.2501 0.834 0.679
#> 4 4 0.622 0.500 0.714 0.1013 0.833 0.590
#> 5 5 0.661 0.633 0.803 0.0631 0.912 0.727
#> 6 6 0.654 0.552 0.727 0.0893 0.886 0.604
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
#> GSM447401 2 0.0000 0.935 0.000 1.000
#> GSM447411 1 0.0376 0.979 0.996 0.004
#> GSM447413 2 0.0000 0.935 0.000 1.000
#> GSM447415 1 0.0000 0.981 1.000 0.000
#> GSM447416 2 0.0000 0.935 0.000 1.000
#> GSM447425 2 0.0000 0.935 0.000 1.000
#> GSM447430 2 0.0000 0.935 0.000 1.000
#> GSM447435 1 0.0376 0.979 0.996 0.004
#> GSM447440 1 0.0376 0.979 0.996 0.004
#> GSM447444 1 0.5519 0.853 0.872 0.128
#> GSM447448 1 0.4298 0.902 0.912 0.088
#> GSM447449 2 0.1414 0.930 0.020 0.980
#> GSM447450 1 0.0376 0.979 0.996 0.004
#> GSM447452 2 0.0000 0.935 0.000 1.000
#> GSM447458 2 0.3114 0.911 0.056 0.944
#> GSM447461 2 0.6712 0.822 0.176 0.824
#> GSM447464 1 0.0000 0.981 1.000 0.000
#> GSM447468 1 0.0000 0.981 1.000 0.000
#> GSM447472 1 0.0000 0.981 1.000 0.000
#> GSM447400 1 0.0000 0.981 1.000 0.000
#> GSM447402 2 0.0938 0.932 0.012 0.988
#> GSM447403 1 0.0000 0.981 1.000 0.000
#> GSM447405 2 0.9963 0.232 0.464 0.536
#> GSM447418 2 0.0000 0.935 0.000 1.000
#> GSM447422 2 0.1184 0.931 0.016 0.984
#> GSM447424 2 0.0000 0.935 0.000 1.000
#> GSM447427 2 0.0000 0.935 0.000 1.000
#> GSM447428 1 0.0000 0.981 1.000 0.000
#> GSM447429 1 0.0000 0.981 1.000 0.000
#> GSM447431 2 0.0000 0.935 0.000 1.000
#> GSM447432 2 0.1414 0.930 0.020 0.980
#> GSM447434 2 0.8443 0.682 0.272 0.728
#> GSM447442 2 0.1184 0.931 0.016 0.984
#> GSM447451 2 0.6712 0.822 0.176 0.824
#> GSM447462 1 0.0000 0.981 1.000 0.000
#> GSM447463 1 0.0000 0.981 1.000 0.000
#> GSM447467 2 0.9491 0.503 0.368 0.632
#> GSM447469 2 0.0376 0.934 0.004 0.996
#> GSM447473 1 0.0000 0.981 1.000 0.000
#> GSM447404 1 0.0000 0.981 1.000 0.000
#> GSM447406 2 0.0000 0.935 0.000 1.000
#> GSM447407 2 0.0000 0.935 0.000 1.000
#> GSM447409 1 0.0376 0.979 0.996 0.004
#> GSM447412 2 0.0000 0.935 0.000 1.000
#> GSM447426 2 0.0000 0.935 0.000 1.000
#> GSM447433 1 0.0376 0.979 0.996 0.004
#> GSM447439 2 0.0000 0.935 0.000 1.000
#> GSM447441 2 0.0000 0.935 0.000 1.000
#> GSM447443 1 0.0000 0.981 1.000 0.000
#> GSM447445 1 0.0376 0.979 0.996 0.004
#> GSM447446 1 0.4939 0.880 0.892 0.108
#> GSM447453 1 0.0000 0.981 1.000 0.000
#> GSM447455 2 0.0938 0.932 0.012 0.988
#> GSM447456 2 0.7745 0.757 0.228 0.772
#> GSM447459 2 0.0000 0.935 0.000 1.000
#> GSM447466 1 0.0000 0.981 1.000 0.000
#> GSM447470 2 0.6973 0.809 0.188 0.812
#> GSM447474 1 0.0000 0.981 1.000 0.000
#> GSM447475 2 0.6712 0.822 0.176 0.824
#> GSM447398 2 0.6531 0.828 0.168 0.832
#> GSM447399 2 0.0000 0.935 0.000 1.000
#> GSM447408 2 0.4690 0.881 0.100 0.900
#> GSM447410 2 0.4690 0.881 0.100 0.900
#> GSM447414 2 0.0000 0.935 0.000 1.000
#> GSM447417 2 0.0938 0.932 0.012 0.988
#> GSM447419 1 0.0000 0.981 1.000 0.000
#> GSM447420 1 0.0000 0.981 1.000 0.000
#> GSM447421 1 0.0000 0.981 1.000 0.000
#> GSM447423 2 0.0000 0.935 0.000 1.000
#> GSM447436 1 0.4939 0.880 0.892 0.108
#> GSM447437 1 0.0000 0.981 1.000 0.000
#> GSM447438 2 0.6973 0.806 0.188 0.812
#> GSM447447 1 0.4690 0.888 0.900 0.100
#> GSM447454 2 0.0000 0.935 0.000 1.000
#> GSM447457 2 0.0000 0.935 0.000 1.000
#> GSM447460 2 0.0938 0.932 0.012 0.988
#> GSM447465 2 0.0000 0.935 0.000 1.000
#> GSM447471 1 0.0000 0.981 1.000 0.000
#> GSM447476 2 0.4690 0.881 0.100 0.900
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM447401 3 0.5733 0.2443 0.000 0.324 0.676
#> GSM447411 1 0.0892 0.9490 0.980 0.020 0.000
#> GSM447413 3 0.0424 0.6147 0.000 0.008 0.992
#> GSM447415 1 0.0237 0.9511 0.996 0.004 0.000
#> GSM447416 3 0.0424 0.6147 0.000 0.008 0.992
#> GSM447425 2 0.6154 0.1600 0.000 0.592 0.408
#> GSM447430 3 0.6095 0.0288 0.000 0.392 0.608
#> GSM447435 1 0.0892 0.9490 0.980 0.020 0.000
#> GSM447440 1 0.0892 0.9490 0.980 0.020 0.000
#> GSM447444 1 0.4920 0.8240 0.840 0.108 0.052
#> GSM447448 1 0.3293 0.8831 0.900 0.088 0.012
#> GSM447449 3 0.5202 0.3827 0.008 0.220 0.772
#> GSM447450 1 0.0892 0.9490 0.980 0.020 0.000
#> GSM447452 2 0.6154 0.1600 0.000 0.592 0.408
#> GSM447458 2 0.7674 0.3978 0.044 0.480 0.476
#> GSM447461 2 0.7438 0.6175 0.040 0.568 0.392
#> GSM447464 1 0.0747 0.9508 0.984 0.016 0.000
#> GSM447468 1 0.0747 0.9508 0.984 0.016 0.000
#> GSM447472 1 0.0747 0.9508 0.984 0.016 0.000
#> GSM447400 1 0.0747 0.9508 0.984 0.016 0.000
#> GSM447402 3 0.6451 -0.2869 0.004 0.436 0.560
#> GSM447403 1 0.0424 0.9502 0.992 0.008 0.000
#> GSM447405 1 0.9544 -0.1889 0.440 0.364 0.196
#> GSM447418 3 0.0424 0.6147 0.000 0.008 0.992
#> GSM447422 3 0.5012 0.4148 0.008 0.204 0.788
#> GSM447424 3 0.0424 0.6147 0.000 0.008 0.992
#> GSM447427 3 0.0424 0.6147 0.000 0.008 0.992
#> GSM447428 1 0.0892 0.9497 0.980 0.020 0.000
#> GSM447429 1 0.0592 0.9510 0.988 0.012 0.000
#> GSM447431 3 0.3038 0.5305 0.000 0.104 0.896
#> GSM447432 3 0.5247 0.3743 0.008 0.224 0.768
#> GSM447434 3 0.7465 0.1036 0.272 0.072 0.656
#> GSM447442 3 0.5012 0.4148 0.008 0.204 0.788
#> GSM447451 2 0.7438 0.6175 0.040 0.568 0.392
#> GSM447462 1 0.0747 0.9508 0.984 0.016 0.000
#> GSM447463 1 0.0747 0.9493 0.984 0.016 0.000
#> GSM447467 3 0.9984 -0.1968 0.336 0.308 0.356
#> GSM447469 3 0.6189 -0.0661 0.004 0.364 0.632
#> GSM447473 1 0.0424 0.9502 0.992 0.008 0.000
#> GSM447404 1 0.0424 0.9502 0.992 0.008 0.000
#> GSM447406 3 0.6095 0.0288 0.000 0.392 0.608
#> GSM447407 2 0.6192 0.1522 0.000 0.580 0.420
#> GSM447409 1 0.0892 0.9490 0.980 0.020 0.000
#> GSM447412 3 0.0424 0.6147 0.000 0.008 0.992
#> GSM447426 3 0.5733 0.2443 0.000 0.324 0.676
#> GSM447433 1 0.1163 0.9491 0.972 0.028 0.000
#> GSM447439 3 0.6095 0.0288 0.000 0.392 0.608
#> GSM447441 3 0.3038 0.5305 0.000 0.104 0.896
#> GSM447443 1 0.0747 0.9508 0.984 0.016 0.000
#> GSM447445 1 0.1129 0.9486 0.976 0.020 0.004
#> GSM447446 1 0.4413 0.8485 0.860 0.104 0.036
#> GSM447453 1 0.0237 0.9511 0.996 0.004 0.000
#> GSM447455 3 0.5618 0.3611 0.008 0.260 0.732
#> GSM447456 2 0.7770 0.5584 0.088 0.640 0.272
#> GSM447459 3 0.6095 0.0288 0.000 0.392 0.608
#> GSM447466 1 0.0747 0.9493 0.984 0.016 0.000
#> GSM447470 2 0.7685 0.6169 0.052 0.564 0.384
#> GSM447474 1 0.0892 0.9497 0.980 0.020 0.000
#> GSM447475 2 0.7163 0.5968 0.040 0.628 0.332
#> GSM447398 2 0.7622 0.5986 0.060 0.608 0.332
#> GSM447399 3 0.2356 0.5676 0.000 0.072 0.928
#> GSM447408 2 0.6274 0.5487 0.000 0.544 0.456
#> GSM447410 2 0.6274 0.5487 0.000 0.544 0.456
#> GSM447414 3 0.0000 0.6137 0.000 0.000 1.000
#> GSM447417 3 0.6451 -0.2869 0.004 0.436 0.560
#> GSM447419 1 0.0747 0.9508 0.984 0.016 0.000
#> GSM447420 1 0.0892 0.9497 0.980 0.020 0.000
#> GSM447421 1 0.0747 0.9508 0.984 0.016 0.000
#> GSM447423 3 0.0237 0.6138 0.000 0.004 0.996
#> GSM447436 1 0.4413 0.8485 0.860 0.104 0.036
#> GSM447437 1 0.0747 0.9493 0.984 0.016 0.000
#> GSM447438 2 0.8215 0.5730 0.080 0.540 0.380
#> GSM447447 1 0.4335 0.8545 0.864 0.100 0.036
#> GSM447454 3 0.0424 0.6128 0.000 0.008 0.992
#> GSM447457 3 0.0237 0.6138 0.000 0.004 0.996
#> GSM447460 3 0.3375 0.5409 0.008 0.100 0.892
#> GSM447465 3 0.0424 0.6147 0.000 0.008 0.992
#> GSM447471 1 0.0424 0.9502 0.992 0.008 0.000
#> GSM447476 2 0.6274 0.5487 0.000 0.544 0.456
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM447401 3 0.0524 0.07462 0.000 0.008 0.988 0.004
#> GSM447411 1 0.2055 0.93268 0.936 0.008 0.008 0.048
#> GSM447413 3 0.7815 0.53788 0.000 0.256 0.392 0.352
#> GSM447415 1 0.0937 0.94366 0.976 0.012 0.000 0.012
#> GSM447416 3 0.7815 0.53788 0.000 0.256 0.392 0.352
#> GSM447425 3 0.5417 -0.20538 0.000 0.016 0.572 0.412
#> GSM447430 4 0.4855 0.26554 0.000 0.400 0.000 0.600
#> GSM447435 1 0.2140 0.93067 0.932 0.008 0.008 0.052
#> GSM447440 1 0.2140 0.93067 0.932 0.008 0.008 0.052
#> GSM447444 1 0.4235 0.80737 0.792 0.188 0.004 0.016
#> GSM447448 1 0.3400 0.87207 0.856 0.128 0.004 0.012
#> GSM447449 2 0.7476 0.16627 0.000 0.504 0.260 0.236
#> GSM447450 1 0.2140 0.93067 0.932 0.008 0.008 0.052
#> GSM447452 3 0.5417 -0.20538 0.000 0.016 0.572 0.412
#> GSM447458 2 0.3907 0.26044 0.008 0.808 0.004 0.180
#> GSM447461 2 0.1637 0.37832 0.000 0.940 0.060 0.000
#> GSM447464 1 0.1022 0.94403 0.968 0.032 0.000 0.000
#> GSM447468 1 0.1118 0.94350 0.964 0.036 0.000 0.000
#> GSM447472 1 0.1118 0.94350 0.964 0.036 0.000 0.000
#> GSM447400 1 0.1022 0.94403 0.968 0.032 0.000 0.000
#> GSM447402 4 0.4866 0.00855 0.000 0.404 0.000 0.596
#> GSM447403 1 0.0657 0.94193 0.984 0.000 0.004 0.012
#> GSM447405 4 0.7627 -0.03219 0.388 0.204 0.000 0.408
#> GSM447418 3 0.7815 0.53788 0.000 0.256 0.392 0.352
#> GSM447422 2 0.7557 0.13217 0.000 0.488 0.260 0.252
#> GSM447424 3 0.7815 0.53788 0.000 0.256 0.392 0.352
#> GSM447427 3 0.7815 0.53788 0.000 0.256 0.392 0.352
#> GSM447428 1 0.1211 0.94254 0.960 0.040 0.000 0.000
#> GSM447429 1 0.1004 0.94440 0.972 0.024 0.000 0.004
#> GSM447431 4 0.7880 -0.42303 0.000 0.344 0.284 0.372
#> GSM447432 2 0.7456 0.17393 0.000 0.508 0.256 0.236
#> GSM447434 3 0.8878 -0.06640 0.264 0.328 0.360 0.048
#> GSM447442 2 0.7557 0.13217 0.000 0.488 0.260 0.252
#> GSM447451 2 0.1637 0.37832 0.000 0.940 0.060 0.000
#> GSM447462 1 0.1022 0.94403 0.968 0.032 0.000 0.000
#> GSM447463 1 0.1743 0.93283 0.940 0.000 0.004 0.056
#> GSM447467 2 0.7139 0.08839 0.308 0.548 0.140 0.004
#> GSM447469 4 0.4585 0.08340 0.000 0.332 0.000 0.668
#> GSM447473 1 0.0657 0.94193 0.984 0.000 0.004 0.012
#> GSM447404 1 0.0657 0.94193 0.984 0.000 0.004 0.012
#> GSM447406 4 0.4843 0.26851 0.000 0.396 0.000 0.604
#> GSM447407 4 0.5414 0.16726 0.000 0.020 0.376 0.604
#> GSM447409 1 0.2010 0.93180 0.932 0.004 0.004 0.060
#> GSM447412 3 0.7815 0.53788 0.000 0.256 0.392 0.352
#> GSM447426 3 0.0524 0.07462 0.000 0.008 0.988 0.004
#> GSM447433 1 0.2441 0.93391 0.920 0.020 0.004 0.056
#> GSM447439 4 0.4843 0.26851 0.000 0.396 0.000 0.604
#> GSM447441 4 0.7880 -0.42303 0.000 0.344 0.284 0.372
#> GSM447443 1 0.1118 0.94350 0.964 0.036 0.000 0.000
#> GSM447445 1 0.2570 0.92724 0.916 0.028 0.004 0.052
#> GSM447446 1 0.3577 0.84276 0.832 0.156 0.000 0.012
#> GSM447453 1 0.0937 0.94445 0.976 0.012 0.000 0.012
#> GSM447455 2 0.7138 0.19336 0.000 0.552 0.180 0.268
#> GSM447456 2 0.2450 0.28062 0.016 0.912 0.000 0.072
#> GSM447459 4 0.4855 0.26554 0.000 0.400 0.000 0.600
#> GSM447466 1 0.2076 0.93060 0.932 0.004 0.008 0.056
#> GSM447470 2 0.2021 0.37409 0.012 0.932 0.056 0.000
#> GSM447474 1 0.1211 0.94254 0.960 0.040 0.000 0.000
#> GSM447475 2 0.0000 0.34583 0.000 1.000 0.000 0.000
#> GSM447398 2 0.2469 0.31117 0.000 0.892 0.000 0.108
#> GSM447399 2 0.7832 -0.32279 0.000 0.380 0.360 0.260
#> GSM447408 2 0.4898 0.12373 0.000 0.584 0.000 0.416
#> GSM447410 2 0.4898 0.12373 0.000 0.584 0.000 0.416
#> GSM447414 3 0.7847 0.52316 0.000 0.268 0.384 0.348
#> GSM447417 4 0.4866 0.00855 0.000 0.404 0.000 0.596
#> GSM447419 1 0.1118 0.94350 0.964 0.036 0.000 0.000
#> GSM447420 1 0.1211 0.94254 0.960 0.040 0.000 0.000
#> GSM447421 1 0.1022 0.94403 0.968 0.032 0.000 0.000
#> GSM447423 3 0.7847 0.52606 0.000 0.268 0.384 0.348
#> GSM447436 1 0.3577 0.84276 0.832 0.156 0.000 0.012
#> GSM447437 1 0.1743 0.93283 0.940 0.000 0.004 0.056
#> GSM447438 2 0.5925 0.08396 0.036 0.512 0.000 0.452
#> GSM447447 1 0.3450 0.84790 0.836 0.156 0.000 0.008
#> GSM447454 3 0.7860 0.51456 0.000 0.276 0.384 0.340
#> GSM447457 3 0.7847 0.52606 0.000 0.268 0.384 0.348
#> GSM447460 2 0.7872 -0.31901 0.000 0.376 0.280 0.344
#> GSM447465 3 0.7815 0.53788 0.000 0.256 0.392 0.352
#> GSM447471 1 0.0657 0.94193 0.984 0.000 0.004 0.012
#> GSM447476 2 0.4898 0.12373 0.000 0.584 0.000 0.416
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM447401 5 0.2929 0.6140 0.000 0.000 0.180 0.000 0.820
#> GSM447411 1 0.2842 0.9029 0.888 0.012 0.000 0.044 0.056
#> GSM447413 3 0.0162 0.7681 0.000 0.000 0.996 0.004 0.000
#> GSM447415 1 0.0867 0.9205 0.976 0.008 0.000 0.008 0.008
#> GSM447416 3 0.0000 0.7689 0.000 0.000 1.000 0.000 0.000
#> GSM447425 5 0.4219 0.5531 0.000 0.000 0.000 0.416 0.584
#> GSM447430 4 0.5836 0.3412 0.000 0.316 0.004 0.576 0.104
#> GSM447435 1 0.2916 0.9007 0.884 0.012 0.000 0.048 0.056
#> GSM447440 1 0.2916 0.9007 0.884 0.012 0.000 0.048 0.056
#> GSM447444 1 0.3875 0.7871 0.792 0.180 0.008 0.012 0.008
#> GSM447448 1 0.3163 0.8471 0.852 0.124 0.004 0.012 0.008
#> GSM447449 3 0.5547 0.2759 0.008 0.404 0.536 0.052 0.000
#> GSM447450 1 0.2916 0.9007 0.884 0.012 0.000 0.048 0.056
#> GSM447452 5 0.4219 0.5531 0.000 0.000 0.000 0.416 0.584
#> GSM447458 2 0.4735 0.4386 0.016 0.752 0.176 0.052 0.004
#> GSM447461 2 0.2411 0.5823 0.008 0.884 0.108 0.000 0.000
#> GSM447464 1 0.0865 0.9193 0.972 0.024 0.000 0.004 0.000
#> GSM447468 1 0.0955 0.9188 0.968 0.028 0.000 0.004 0.000
#> GSM447472 1 0.0955 0.9188 0.968 0.028 0.000 0.004 0.000
#> GSM447400 1 0.0865 0.9193 0.972 0.024 0.000 0.004 0.000
#> GSM447402 4 0.6580 -0.1798 0.000 0.348 0.168 0.476 0.008
#> GSM447403 1 0.1717 0.9153 0.936 0.004 0.000 0.008 0.052
#> GSM447405 4 0.6585 -0.0609 0.360 0.212 0.000 0.428 0.000
#> GSM447418 3 0.0324 0.7694 0.000 0.004 0.992 0.004 0.000
#> GSM447422 3 0.5516 0.3130 0.008 0.388 0.552 0.052 0.000
#> GSM447424 3 0.0162 0.7681 0.000 0.000 0.996 0.004 0.000
#> GSM447427 3 0.0162 0.7692 0.000 0.004 0.996 0.000 0.000
#> GSM447428 1 0.1041 0.9178 0.964 0.032 0.000 0.004 0.000
#> GSM447429 1 0.0798 0.9197 0.976 0.016 0.000 0.008 0.000
#> GSM447431 3 0.3052 0.6889 0.000 0.036 0.876 0.016 0.072
#> GSM447432 3 0.5554 0.2668 0.008 0.408 0.532 0.052 0.000
#> GSM447434 3 0.6599 0.0506 0.264 0.272 0.464 0.000 0.000
#> GSM447442 3 0.5516 0.3130 0.008 0.388 0.552 0.052 0.000
#> GSM447451 2 0.2411 0.5823 0.008 0.884 0.108 0.000 0.000
#> GSM447462 1 0.0865 0.9193 0.972 0.024 0.000 0.004 0.000
#> GSM447463 1 0.2734 0.9031 0.892 0.008 0.000 0.048 0.052
#> GSM447467 2 0.6325 0.1425 0.316 0.504 0.180 0.000 0.000
#> GSM447469 4 0.6754 -0.1072 0.000 0.276 0.236 0.480 0.008
#> GSM447473 1 0.1717 0.9153 0.936 0.004 0.000 0.008 0.052
#> GSM447404 1 0.1717 0.9153 0.936 0.004 0.000 0.008 0.052
#> GSM447406 4 0.5913 0.3454 0.000 0.304 0.004 0.576 0.116
#> GSM447407 4 0.4299 -0.4962 0.000 0.000 0.004 0.608 0.388
#> GSM447409 1 0.3319 0.8948 0.864 0.020 0.000 0.064 0.052
#> GSM447412 3 0.0000 0.7689 0.000 0.000 1.000 0.000 0.000
#> GSM447426 5 0.2929 0.6140 0.000 0.000 0.180 0.000 0.820
#> GSM447433 1 0.3596 0.8978 0.852 0.036 0.000 0.060 0.052
#> GSM447439 4 0.5913 0.3454 0.000 0.304 0.004 0.576 0.116
#> GSM447441 3 0.3052 0.6889 0.000 0.036 0.876 0.016 0.072
#> GSM447443 1 0.0955 0.9188 0.968 0.028 0.000 0.004 0.000
#> GSM447445 1 0.3323 0.9002 0.868 0.040 0.000 0.048 0.044
#> GSM447446 1 0.3535 0.7968 0.808 0.164 0.000 0.028 0.000
#> GSM447453 1 0.0981 0.9206 0.972 0.012 0.000 0.008 0.008
#> GSM447455 3 0.5604 0.1650 0.008 0.460 0.480 0.052 0.000
#> GSM447456 2 0.1779 0.5123 0.008 0.940 0.008 0.040 0.004
#> GSM447459 4 0.5836 0.3412 0.000 0.316 0.004 0.576 0.104
#> GSM447466 1 0.2987 0.9003 0.880 0.012 0.000 0.052 0.056
#> GSM447470 2 0.2669 0.5804 0.020 0.876 0.104 0.000 0.000
#> GSM447474 1 0.1041 0.9178 0.964 0.032 0.000 0.004 0.000
#> GSM447475 2 0.1408 0.5700 0.008 0.948 0.044 0.000 0.000
#> GSM447398 2 0.2664 0.5518 0.000 0.892 0.064 0.040 0.004
#> GSM447399 3 0.3741 0.5500 0.000 0.264 0.732 0.004 0.000
#> GSM447408 2 0.5527 0.3513 0.000 0.540 0.072 0.388 0.000
#> GSM447410 2 0.5527 0.3513 0.000 0.540 0.072 0.388 0.000
#> GSM447414 3 0.0566 0.7702 0.000 0.012 0.984 0.004 0.000
#> GSM447417 4 0.6580 -0.1798 0.000 0.348 0.168 0.476 0.008
#> GSM447419 1 0.0955 0.9188 0.968 0.028 0.000 0.004 0.000
#> GSM447420 1 0.1041 0.9178 0.964 0.032 0.000 0.004 0.000
#> GSM447421 1 0.0865 0.9193 0.972 0.024 0.000 0.004 0.000
#> GSM447423 3 0.0510 0.7703 0.000 0.016 0.984 0.000 0.000
#> GSM447436 1 0.3535 0.7968 0.808 0.164 0.000 0.028 0.000
#> GSM447437 1 0.2734 0.9031 0.892 0.008 0.000 0.048 0.052
#> GSM447438 2 0.5850 0.2931 0.012 0.484 0.064 0.440 0.000
#> GSM447447 1 0.3449 0.8024 0.812 0.164 0.000 0.024 0.000
#> GSM447454 3 0.0703 0.7687 0.000 0.024 0.976 0.000 0.000
#> GSM447457 3 0.0510 0.7703 0.000 0.016 0.984 0.000 0.000
#> GSM447460 3 0.2621 0.7154 0.008 0.112 0.876 0.004 0.000
#> GSM447465 3 0.0162 0.7681 0.000 0.000 0.996 0.004 0.000
#> GSM447471 1 0.1717 0.9153 0.936 0.004 0.000 0.008 0.052
#> GSM447476 2 0.5527 0.3513 0.000 0.540 0.072 0.388 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM447401 4 0.6066 0.2699 0.128 0.000 0.060 0.580 0.232 0.000
#> GSM447411 1 0.4147 0.7168 0.552 0.012 0.000 0.000 0.000 0.436
#> GSM447413 3 0.0146 0.7874 0.000 0.000 0.996 0.000 0.004 0.000
#> GSM447415 6 0.3126 0.3709 0.248 0.000 0.000 0.000 0.000 0.752
#> GSM447416 3 0.0000 0.7880 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM447425 4 0.0146 0.4862 0.000 0.000 0.000 0.996 0.004 0.000
#> GSM447430 5 0.3596 0.9834 0.000 0.232 0.004 0.016 0.748 0.000
#> GSM447435 1 0.4161 0.7040 0.540 0.012 0.000 0.000 0.000 0.448
#> GSM447440 1 0.4161 0.7040 0.540 0.012 0.000 0.000 0.000 0.448
#> GSM447444 6 0.4425 0.5285 0.132 0.152 0.000 0.000 0.000 0.716
#> GSM447448 6 0.4972 0.4075 0.256 0.116 0.000 0.000 0.000 0.628
#> GSM447449 3 0.5114 0.1397 0.000 0.444 0.492 0.000 0.052 0.012
#> GSM447450 1 0.4161 0.7040 0.540 0.012 0.000 0.000 0.000 0.448
#> GSM447452 4 0.0146 0.4862 0.000 0.000 0.000 0.996 0.004 0.000
#> GSM447458 2 0.4010 0.4708 0.008 0.792 0.128 0.000 0.052 0.020
#> GSM447461 2 0.2790 0.5591 0.012 0.868 0.088 0.000 0.000 0.032
#> GSM447464 6 0.1957 0.6977 0.112 0.000 0.000 0.000 0.000 0.888
#> GSM447468 6 0.0000 0.7545 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM447472 6 0.0000 0.7545 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM447400 6 0.1814 0.7047 0.100 0.000 0.000 0.000 0.000 0.900
#> GSM447402 4 0.7716 0.0255 0.100 0.296 0.124 0.420 0.060 0.000
#> GSM447403 1 0.3765 0.6785 0.596 0.000 0.000 0.000 0.000 0.404
#> GSM447405 1 0.7068 -0.2571 0.368 0.096 0.000 0.360 0.000 0.176
#> GSM447418 3 0.0291 0.7883 0.000 0.004 0.992 0.000 0.004 0.000
#> GSM447422 3 0.5098 0.1919 0.000 0.424 0.512 0.000 0.052 0.012
#> GSM447424 3 0.0146 0.7874 0.000 0.000 0.996 0.000 0.004 0.000
#> GSM447427 3 0.0146 0.7882 0.000 0.004 0.996 0.000 0.000 0.000
#> GSM447428 6 0.0291 0.7520 0.004 0.004 0.000 0.000 0.000 0.992
#> GSM447429 6 0.2597 0.6023 0.176 0.000 0.000 0.000 0.000 0.824
#> GSM447431 3 0.2398 0.7072 0.000 0.020 0.876 0.000 0.104 0.000
#> GSM447432 3 0.5116 0.1286 0.000 0.448 0.488 0.000 0.052 0.012
#> GSM447434 3 0.7001 0.0510 0.080 0.232 0.428 0.000 0.000 0.260
#> GSM447442 3 0.5098 0.1919 0.000 0.424 0.512 0.000 0.052 0.012
#> GSM447451 2 0.2790 0.5591 0.012 0.868 0.088 0.000 0.000 0.032
#> GSM447462 6 0.1814 0.7047 0.100 0.000 0.000 0.000 0.000 0.900
#> GSM447463 1 0.3727 0.7237 0.612 0.000 0.000 0.000 0.000 0.388
#> GSM447467 2 0.6280 0.2395 0.036 0.492 0.160 0.000 0.000 0.312
#> GSM447469 4 0.7944 0.0964 0.100 0.216 0.200 0.420 0.064 0.000
#> GSM447473 1 0.3765 0.6785 0.596 0.000 0.000 0.000 0.000 0.404
#> GSM447404 1 0.3727 0.6905 0.612 0.000 0.000 0.000 0.000 0.388
#> GSM447406 5 0.3488 0.9835 0.000 0.216 0.004 0.016 0.764 0.000
#> GSM447407 4 0.2902 0.3695 0.000 0.000 0.004 0.800 0.196 0.000
#> GSM447409 1 0.3741 0.6974 0.672 0.008 0.000 0.000 0.000 0.320
#> GSM447412 3 0.0146 0.7882 0.000 0.004 0.996 0.000 0.000 0.000
#> GSM447426 4 0.6066 0.2699 0.128 0.000 0.060 0.580 0.232 0.000
#> GSM447433 1 0.4256 0.5944 0.564 0.012 0.000 0.000 0.004 0.420
#> GSM447439 5 0.3488 0.9835 0.000 0.216 0.004 0.016 0.764 0.000
#> GSM447441 3 0.2398 0.7072 0.000 0.020 0.876 0.000 0.104 0.000
#> GSM447443 6 0.0000 0.7545 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM447445 1 0.4292 0.5901 0.588 0.024 0.000 0.000 0.000 0.388
#> GSM447446 6 0.4230 0.5304 0.292 0.024 0.000 0.004 0.004 0.676
#> GSM447453 6 0.3595 0.3517 0.288 0.008 0.000 0.000 0.000 0.704
#> GSM447455 2 0.5114 -0.1333 0.000 0.492 0.444 0.000 0.052 0.012
#> GSM447456 2 0.2011 0.4653 0.064 0.912 0.000 0.000 0.004 0.020
#> GSM447459 5 0.3596 0.9834 0.000 0.232 0.004 0.016 0.748 0.000
#> GSM447466 1 0.3769 0.7298 0.640 0.004 0.000 0.000 0.000 0.356
#> GSM447470 2 0.2948 0.5561 0.012 0.860 0.084 0.000 0.000 0.044
#> GSM447474 6 0.0508 0.7536 0.012 0.004 0.000 0.000 0.000 0.984
#> GSM447475 2 0.1777 0.5409 0.012 0.932 0.024 0.000 0.000 0.032
#> GSM447398 2 0.1700 0.5114 0.048 0.928 0.024 0.000 0.000 0.000
#> GSM447399 3 0.4443 0.5086 0.068 0.232 0.696 0.000 0.004 0.000
#> GSM447408 2 0.6291 0.1562 0.092 0.488 0.028 0.368 0.024 0.000
#> GSM447410 2 0.6291 0.1562 0.092 0.488 0.028 0.368 0.024 0.000
#> GSM447414 3 0.0508 0.7875 0.000 0.012 0.984 0.000 0.004 0.000
#> GSM447417 4 0.7716 0.0255 0.100 0.296 0.124 0.420 0.060 0.000
#> GSM447419 6 0.0000 0.7545 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM447420 6 0.0508 0.7536 0.012 0.004 0.000 0.000 0.000 0.984
#> GSM447421 6 0.1957 0.6977 0.112 0.000 0.000 0.000 0.000 0.888
#> GSM447423 3 0.0547 0.7867 0.000 0.020 0.980 0.000 0.000 0.000
#> GSM447436 6 0.4248 0.5266 0.296 0.024 0.000 0.004 0.004 0.672
#> GSM447437 1 0.3727 0.7237 0.612 0.000 0.000 0.000 0.000 0.388
#> GSM447438 2 0.7090 0.0798 0.160 0.416 0.028 0.360 0.016 0.020
#> GSM447447 6 0.3927 0.5582 0.260 0.024 0.000 0.000 0.004 0.712
#> GSM447454 3 0.0713 0.7847 0.000 0.028 0.972 0.000 0.000 0.000
#> GSM447457 3 0.0547 0.7867 0.000 0.020 0.980 0.000 0.000 0.000
#> GSM447460 3 0.2408 0.7147 0.000 0.108 0.876 0.000 0.004 0.012
#> GSM447465 3 0.0146 0.7874 0.000 0.000 0.996 0.000 0.004 0.000
#> GSM447471 1 0.3765 0.6785 0.596 0.000 0.000 0.000 0.000 0.404
#> GSM447476 2 0.6291 0.1562 0.092 0.488 0.028 0.368 0.024 0.000
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)
An example of the output of tb
is:
#> which_row fdr mean_1 mean_2 scaled_mean_1 scaled_mean_2 km
#> 1 38 0.042760348 8.373488 9.131774 -0.5533452 0.5164555 1
#> 2 40 0.018707592 7.106213 8.469186 -0.6173731 0.5762149 1
#> 3 55 0.019134737 10.221463 11.207825 -0.6159697 0.5749050 1
#> 4 59 0.006059896 5.921854 7.869574 -0.6899429 0.6439467 1
#> 5 60 0.018055526 8.928898 10.211722 -0.6204761 0.5791110 1
#> 6 98 0.009384629 15.714769 14.887706 0.6635654 -0.6193277 2
...
The columns in tb
are:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.km
: Row groups if k-means clustering is applied to rows.UMAP plot which shows how samples are separated.
dimension_reduction(res, k = 2, method = "UMAP")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.
test_to_known_factors(res)
#> n gender(p) agent(p) k
#> SD:hclust 78 0.846 0.3593 2
#> SD:hclust 58 0.203 0.1244 3
#> SD:hclust 44 1.000 0.1637 4
#> SD:hclust 58 0.526 0.0375 5
#> SD:hclust 54 0.887 0.0647 6
If matrix rows can be associated to genes, consider to use functional_enrichment(res,
...)
to perform function enrichment for the signature genes. See this vignette for more detailed explanations.
The object with results only for a single top-value method and a single partition method can be extracted as:
res = res_list["SD", "kmeans"]
# you can also extract it by
# res = res_list["SD:kmeans"]
A summary of res
and all the functions that can be applied to it:
res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#> On a matrix with 51941 rows and 79 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'SD' method.
#> Subgroups are detected by 'kmeans' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 2.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
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.977 0.987 0.5053 0.494 0.494
#> 3 3 0.606 0.617 0.777 0.2664 0.796 0.606
#> 4 4 0.527 0.510 0.702 0.1252 0.846 0.614
#> 5 5 0.555 0.463 0.634 0.0770 0.856 0.567
#> 6 6 0.612 0.560 0.694 0.0534 0.914 0.641
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
#> GSM447401 2 0.0672 0.987 0.008 0.992
#> GSM447411 1 0.0376 0.989 0.996 0.004
#> GSM447413 2 0.0672 0.987 0.008 0.992
#> GSM447415 1 0.0000 0.988 1.000 0.000
#> GSM447416 2 0.0672 0.987 0.008 0.992
#> GSM447425 2 0.0000 0.987 0.000 1.000
#> GSM447430 2 0.0000 0.987 0.000 1.000
#> GSM447435 1 0.0376 0.989 0.996 0.004
#> GSM447440 1 0.0376 0.989 0.996 0.004
#> GSM447444 1 0.0376 0.989 0.996 0.004
#> GSM447448 1 0.0376 0.989 0.996 0.004
#> GSM447449 2 0.0376 0.987 0.004 0.996
#> GSM447450 1 0.0376 0.989 0.996 0.004
#> GSM447452 2 0.0000 0.987 0.000 1.000
#> GSM447458 2 0.0376 0.987 0.004 0.996
#> GSM447461 2 0.0376 0.987 0.004 0.996
#> GSM447464 1 0.0376 0.989 0.996 0.004
#> GSM447468 1 0.0000 0.988 1.000 0.000
#> GSM447472 1 0.0376 0.989 0.996 0.004
#> GSM447400 1 0.0000 0.988 1.000 0.000
#> GSM447402 2 0.0000 0.987 0.000 1.000
#> GSM447403 1 0.0000 0.988 1.000 0.000
#> GSM447405 1 0.0672 0.987 0.992 0.008
#> GSM447418 2 0.0672 0.987 0.008 0.992
#> GSM447422 2 0.0672 0.987 0.008 0.992
#> GSM447424 2 0.0672 0.987 0.008 0.992
#> GSM447427 2 0.0672 0.987 0.008 0.992
#> GSM447428 1 0.2948 0.942 0.948 0.052
#> GSM447429 1 0.0000 0.988 1.000 0.000
#> GSM447431 2 0.0672 0.987 0.008 0.992
#> GSM447432 2 0.0376 0.987 0.004 0.996
#> GSM447434 1 0.0000 0.988 1.000 0.000
#> GSM447442 2 0.0376 0.987 0.004 0.996
#> GSM447451 2 0.0376 0.987 0.004 0.996
#> GSM447462 1 0.0000 0.988 1.000 0.000
#> GSM447463 1 0.0376 0.989 0.996 0.004
#> GSM447467 1 0.3431 0.933 0.936 0.064
#> GSM447469 2 0.0000 0.987 0.000 1.000
#> GSM447473 1 0.0000 0.988 1.000 0.000
#> GSM447404 1 0.0000 0.988 1.000 0.000
#> GSM447406 2 0.0000 0.987 0.000 1.000
#> GSM447407 2 0.0000 0.987 0.000 1.000
#> GSM447409 1 0.0672 0.987 0.992 0.008
#> GSM447412 2 0.0672 0.987 0.008 0.992
#> GSM447426 2 0.0672 0.987 0.008 0.992
#> GSM447433 1 0.0672 0.987 0.992 0.008
#> GSM447439 2 0.0000 0.987 0.000 1.000
#> GSM447441 2 0.0376 0.987 0.004 0.996
#> GSM447443 1 0.0000 0.988 1.000 0.000
#> GSM447445 1 0.0376 0.989 0.996 0.004
#> GSM447446 1 0.0672 0.987 0.992 0.008
#> GSM447453 1 0.0376 0.989 0.996 0.004
#> GSM447455 2 0.0376 0.987 0.004 0.996
#> GSM447456 1 0.7674 0.715 0.776 0.224
#> GSM447459 2 0.0000 0.987 0.000 1.000
#> GSM447466 1 0.0376 0.989 0.996 0.004
#> GSM447470 1 0.0376 0.989 0.996 0.004
#> GSM447474 1 0.0376 0.989 0.996 0.004
#> GSM447475 2 0.6973 0.773 0.188 0.812
#> GSM447398 2 0.0376 0.987 0.004 0.996
#> GSM447399 2 0.0672 0.987 0.008 0.992
#> GSM447408 2 0.0000 0.987 0.000 1.000
#> GSM447410 2 0.0000 0.987 0.000 1.000
#> GSM447414 2 0.0672 0.987 0.008 0.992
#> GSM447417 2 0.0000 0.987 0.000 1.000
#> GSM447419 1 0.0000 0.988 1.000 0.000
#> GSM447420 1 0.0000 0.988 1.000 0.000
#> GSM447421 1 0.0000 0.988 1.000 0.000
#> GSM447423 2 0.0672 0.987 0.008 0.992
#> GSM447436 1 0.0672 0.987 0.992 0.008
#> GSM447437 1 0.0376 0.989 0.996 0.004
#> GSM447438 2 0.0000 0.987 0.000 1.000
#> GSM447447 1 0.0376 0.989 0.996 0.004
#> GSM447454 2 0.0672 0.987 0.008 0.992
#> GSM447457 2 0.0672 0.987 0.008 0.992
#> GSM447460 2 0.0376 0.987 0.004 0.996
#> GSM447465 2 0.0672 0.987 0.008 0.992
#> GSM447471 1 0.0000 0.988 1.000 0.000
#> GSM447476 2 0.6973 0.769 0.188 0.812
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM447401 3 0.5138 0.49686 0.000 0.252 0.748
#> GSM447411 1 0.0000 0.93091 1.000 0.000 0.000
#> GSM447413 3 0.5363 0.54950 0.000 0.276 0.724
#> GSM447415 1 0.1529 0.92447 0.960 0.000 0.040
#> GSM447416 3 0.6079 0.59832 0.000 0.388 0.612
#> GSM447425 2 0.4978 0.53765 0.004 0.780 0.216
#> GSM447430 2 0.4121 0.56390 0.000 0.832 0.168
#> GSM447435 1 0.0000 0.93091 1.000 0.000 0.000
#> GSM447440 1 0.2625 0.92648 0.916 0.000 0.084
#> GSM447444 1 0.4399 0.88452 0.812 0.000 0.188
#> GSM447448 1 0.3686 0.90574 0.860 0.000 0.140
#> GSM447449 2 0.5926 -0.01135 0.000 0.644 0.356
#> GSM447450 1 0.0747 0.93220 0.984 0.000 0.016
#> GSM447452 2 0.4605 0.54137 0.000 0.796 0.204
#> GSM447458 2 0.6205 0.15904 0.008 0.656 0.336
#> GSM447461 2 0.6095 0.11559 0.000 0.608 0.392
#> GSM447464 1 0.2165 0.92934 0.936 0.000 0.064
#> GSM447468 1 0.2066 0.92293 0.940 0.000 0.060
#> GSM447472 1 0.4062 0.89785 0.836 0.000 0.164
#> GSM447400 1 0.3551 0.92156 0.868 0.000 0.132
#> GSM447402 2 0.1031 0.57274 0.000 0.976 0.024
#> GSM447403 1 0.1411 0.92535 0.964 0.000 0.036
#> GSM447405 1 0.3941 0.89657 0.844 0.000 0.156
#> GSM447418 3 0.6168 0.59647 0.000 0.412 0.588
#> GSM447422 3 0.6192 0.59328 0.000 0.420 0.580
#> GSM447424 3 0.5497 0.56708 0.000 0.292 0.708
#> GSM447427 3 0.6180 0.59560 0.000 0.416 0.584
#> GSM447428 3 0.5881 0.25794 0.256 0.016 0.728
#> GSM447429 1 0.2261 0.92713 0.932 0.000 0.068
#> GSM447431 3 0.6126 0.59928 0.000 0.400 0.600
#> GSM447432 2 0.5650 0.13244 0.000 0.688 0.312
#> GSM447434 1 0.4399 0.89259 0.812 0.000 0.188
#> GSM447442 2 0.5650 0.13244 0.000 0.688 0.312
#> GSM447451 3 0.6309 -0.02016 0.000 0.496 0.504
#> GSM447462 1 0.3816 0.91709 0.852 0.000 0.148
#> GSM447463 1 0.0237 0.93155 0.996 0.000 0.004
#> GSM447467 3 0.9575 0.12827 0.320 0.216 0.464
#> GSM447469 2 0.3482 0.57175 0.000 0.872 0.128
#> GSM447473 1 0.1411 0.92535 0.964 0.000 0.036
#> GSM447404 1 0.1411 0.92535 0.964 0.000 0.036
#> GSM447406 2 0.4121 0.56390 0.000 0.832 0.168
#> GSM447407 2 0.4346 0.55534 0.000 0.816 0.184
#> GSM447409 1 0.0237 0.93004 0.996 0.000 0.004
#> GSM447412 3 0.6154 0.59541 0.000 0.408 0.592
#> GSM447426 3 0.5138 0.49686 0.000 0.252 0.748
#> GSM447433 1 0.3482 0.90916 0.872 0.000 0.128
#> GSM447439 2 0.4002 0.56714 0.000 0.840 0.160
#> GSM447441 2 0.5905 -0.02452 0.000 0.648 0.352
#> GSM447443 1 0.2711 0.92718 0.912 0.000 0.088
#> GSM447445 1 0.0237 0.93155 0.996 0.000 0.004
#> GSM447446 1 0.3116 0.91585 0.892 0.000 0.108
#> GSM447453 1 0.0000 0.93091 1.000 0.000 0.000
#> GSM447455 2 0.5650 0.13244 0.000 0.688 0.312
#> GSM447456 2 0.9342 -0.00377 0.380 0.452 0.168
#> GSM447459 2 0.4121 0.56390 0.000 0.832 0.168
#> GSM447466 1 0.0424 0.92928 0.992 0.000 0.008
#> GSM447470 1 0.4346 0.88691 0.816 0.000 0.184
#> GSM447474 1 0.4399 0.88623 0.812 0.000 0.188
#> GSM447475 3 0.7295 -0.09873 0.028 0.484 0.488
#> GSM447398 2 0.4399 0.49133 0.000 0.812 0.188
#> GSM447399 2 0.5760 0.11829 0.000 0.672 0.328
#> GSM447408 2 0.0000 0.57306 0.000 1.000 0.000
#> GSM447410 2 0.1860 0.56501 0.000 0.948 0.052
#> GSM447414 3 0.5465 0.55937 0.000 0.288 0.712
#> GSM447417 2 0.0592 0.57465 0.000 0.988 0.012
#> GSM447419 1 0.4605 0.89492 0.796 0.000 0.204
#> GSM447420 3 0.6267 -0.31158 0.452 0.000 0.548
#> GSM447421 1 0.2625 0.92733 0.916 0.000 0.084
#> GSM447423 3 0.6168 0.58856 0.000 0.412 0.588
#> GSM447436 1 0.2165 0.92866 0.936 0.000 0.064
#> GSM447437 1 0.0000 0.93091 1.000 0.000 0.000
#> GSM447438 2 0.3686 0.51153 0.000 0.860 0.140
#> GSM447447 1 0.3686 0.90569 0.860 0.000 0.140
#> GSM447454 3 0.6204 0.57663 0.000 0.424 0.576
#> GSM447457 3 0.6180 0.57195 0.000 0.416 0.584
#> GSM447460 3 0.6308 0.06828 0.000 0.492 0.508
#> GSM447465 3 0.5497 0.56708 0.000 0.292 0.708
#> GSM447471 1 0.1411 0.92535 0.964 0.000 0.036
#> GSM447476 2 0.5947 0.42493 0.052 0.776 0.172
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM447401 2 0.7722 0.40917 0.000 0.428 0.336 0.236
#> GSM447411 1 0.2530 0.66564 0.896 0.000 0.100 0.004
#> GSM447413 2 0.6897 0.53876 0.000 0.584 0.256 0.160
#> GSM447415 1 0.0804 0.65115 0.980 0.000 0.008 0.012
#> GSM447416 2 0.5491 0.60364 0.000 0.688 0.260 0.052
#> GSM447425 4 0.4387 0.72606 0.000 0.052 0.144 0.804
#> GSM447430 4 0.2149 0.78686 0.000 0.088 0.000 0.912
#> GSM447435 1 0.2530 0.66564 0.896 0.000 0.100 0.004
#> GSM447440 1 0.4567 0.58345 0.716 0.000 0.276 0.008
#> GSM447444 3 0.5167 -0.28306 0.488 0.000 0.508 0.004
#> GSM447448 1 0.4964 0.43190 0.616 0.000 0.380 0.004
#> GSM447449 2 0.4337 0.52763 0.000 0.808 0.052 0.140
#> GSM447450 1 0.3591 0.65920 0.824 0.000 0.168 0.008
#> GSM447452 4 0.3383 0.74166 0.000 0.052 0.076 0.872
#> GSM447458 2 0.6079 0.38934 0.004 0.692 0.120 0.184
#> GSM447461 2 0.5535 0.42928 0.000 0.720 0.088 0.192
#> GSM447464 1 0.4728 0.53681 0.752 0.000 0.216 0.032
#> GSM447468 1 0.3606 0.60143 0.840 0.000 0.140 0.020
#> GSM447472 1 0.5143 0.26324 0.540 0.000 0.456 0.004
#> GSM447400 1 0.5193 0.42942 0.656 0.000 0.324 0.020
#> GSM447402 4 0.6592 0.70824 0.000 0.260 0.128 0.612
#> GSM447403 1 0.1042 0.65370 0.972 0.000 0.008 0.020
#> GSM447405 1 0.5372 0.34640 0.544 0.000 0.444 0.012
#> GSM447418 2 0.4690 0.61470 0.000 0.724 0.260 0.016
#> GSM447422 2 0.4690 0.61470 0.000 0.724 0.260 0.016
#> GSM447424 2 0.6740 0.54921 0.000 0.600 0.256 0.144
#> GSM447427 2 0.4576 0.61468 0.000 0.728 0.260 0.012
#> GSM447428 3 0.7172 0.14720 0.132 0.304 0.556 0.008
#> GSM447429 1 0.4163 0.56618 0.792 0.000 0.188 0.020
#> GSM447431 2 0.5845 0.61114 0.000 0.672 0.252 0.076
#> GSM447432 2 0.4462 0.48983 0.000 0.792 0.044 0.164
#> GSM447434 1 0.5070 0.27426 0.580 0.000 0.416 0.004
#> GSM447442 2 0.4624 0.50321 0.000 0.784 0.052 0.164
#> GSM447451 2 0.6295 0.38527 0.000 0.656 0.212 0.132
#> GSM447462 1 0.5233 0.41675 0.648 0.000 0.332 0.020
#> GSM447463 1 0.2714 0.66553 0.884 0.000 0.112 0.004
#> GSM447467 3 0.6735 0.12894 0.060 0.444 0.484 0.012
#> GSM447469 4 0.5412 0.75155 0.000 0.168 0.096 0.736
#> GSM447473 1 0.1042 0.65370 0.972 0.000 0.008 0.020
#> GSM447404 1 0.0779 0.65149 0.980 0.000 0.004 0.016
#> GSM447406 4 0.2149 0.78686 0.000 0.088 0.000 0.912
#> GSM447407 4 0.2596 0.77429 0.000 0.068 0.024 0.908
#> GSM447409 1 0.2675 0.66481 0.892 0.000 0.100 0.008
#> GSM447412 2 0.4485 0.61371 0.000 0.740 0.248 0.012
#> GSM447426 2 0.7722 0.40917 0.000 0.428 0.336 0.236
#> GSM447433 1 0.5290 0.41424 0.584 0.000 0.404 0.012
#> GSM447439 4 0.2345 0.78870 0.000 0.100 0.000 0.900
#> GSM447441 2 0.3545 0.53197 0.000 0.828 0.008 0.164
#> GSM447443 1 0.4933 0.46272 0.688 0.000 0.296 0.016
#> GSM447445 1 0.3105 0.66572 0.856 0.000 0.140 0.004
#> GSM447446 1 0.5364 0.42868 0.592 0.000 0.392 0.016
#> GSM447453 1 0.3208 0.66038 0.848 0.000 0.148 0.004
#> GSM447455 2 0.4378 0.49679 0.000 0.796 0.040 0.164
#> GSM447456 3 0.9490 0.15220 0.124 0.260 0.384 0.232
#> GSM447459 4 0.2149 0.78686 0.000 0.088 0.000 0.912
#> GSM447466 1 0.2611 0.66860 0.896 0.000 0.096 0.008
#> GSM447470 3 0.5165 -0.28211 0.484 0.000 0.512 0.004
#> GSM447474 3 0.5396 -0.28045 0.464 0.000 0.524 0.012
#> GSM447475 2 0.7007 0.25801 0.004 0.556 0.316 0.124
#> GSM447398 2 0.6894 -0.00993 0.000 0.536 0.120 0.344
#> GSM447399 2 0.4284 0.52565 0.000 0.780 0.020 0.200
#> GSM447408 4 0.5420 0.71099 0.000 0.272 0.044 0.684
#> GSM447410 4 0.5905 0.65715 0.000 0.304 0.060 0.636
#> GSM447414 2 0.6781 0.54666 0.000 0.596 0.256 0.148
#> GSM447417 4 0.5940 0.73442 0.000 0.240 0.088 0.672
#> GSM447419 1 0.5217 0.30366 0.608 0.000 0.380 0.012
#> GSM447420 3 0.7122 0.23196 0.296 0.120 0.572 0.012
#> GSM447421 1 0.5083 0.50336 0.716 0.000 0.248 0.036
#> GSM447423 2 0.4516 0.61265 0.000 0.736 0.252 0.012
#> GSM447436 1 0.5069 0.51223 0.664 0.000 0.320 0.016
#> GSM447437 1 0.2593 0.66676 0.892 0.000 0.104 0.004
#> GSM447438 4 0.6719 0.63030 0.000 0.240 0.152 0.608
#> GSM447447 1 0.5203 0.39599 0.576 0.000 0.416 0.008
#> GSM447454 2 0.0921 0.60220 0.000 0.972 0.028 0.000
#> GSM447457 2 0.0921 0.60220 0.000 0.972 0.028 0.000
#> GSM447460 2 0.5859 0.48898 0.000 0.652 0.064 0.284
#> GSM447465 2 0.5080 0.58078 0.000 0.764 0.092 0.144
#> GSM447471 1 0.1042 0.65370 0.972 0.000 0.008 0.020
#> GSM447476 4 0.7508 0.60132 0.012 0.204 0.228 0.556
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM447401 3 0.6014 0.5678 0.000 0.044 0.652 0.208 0.096
#> GSM447411 1 0.0865 0.4981 0.972 0.000 0.024 0.000 0.004
#> GSM447413 3 0.5670 0.7472 0.000 0.148 0.672 0.164 0.016
#> GSM447415 1 0.4661 0.3449 0.736 0.000 0.036 0.020 0.208
#> GSM447416 3 0.4430 0.7826 0.000 0.256 0.708 0.036 0.000
#> GSM447425 4 0.5258 0.6442 0.000 0.048 0.072 0.732 0.148
#> GSM447430 4 0.3321 0.7165 0.000 0.136 0.032 0.832 0.000
#> GSM447435 1 0.0865 0.4981 0.972 0.000 0.024 0.000 0.004
#> GSM447440 1 0.4523 0.3778 0.776 0.036 0.040 0.000 0.148
#> GSM447444 1 0.5816 -0.0530 0.508 0.056 0.016 0.000 0.420
#> GSM447448 1 0.5536 0.1550 0.596 0.044 0.020 0.000 0.340
#> GSM447449 2 0.2669 0.6952 0.000 0.876 0.104 0.020 0.000
#> GSM447450 1 0.2654 0.4737 0.896 0.008 0.040 0.000 0.056
#> GSM447452 4 0.4764 0.6785 0.000 0.080 0.080 0.780 0.060
#> GSM447458 2 0.3190 0.6864 0.024 0.880 0.060 0.024 0.012
#> GSM447461 2 0.2283 0.6793 0.000 0.916 0.008 0.036 0.040
#> GSM447464 1 0.5826 -0.2145 0.564 0.000 0.060 0.020 0.356
#> GSM447468 1 0.5841 -0.0855 0.524 0.000 0.048 0.024 0.404
#> GSM447472 1 0.5440 -0.2255 0.476 0.048 0.004 0.000 0.472
#> GSM447400 5 0.5685 0.4956 0.380 0.004 0.048 0.012 0.556
#> GSM447402 4 0.6819 0.5881 0.000 0.324 0.048 0.516 0.112
#> GSM447403 1 0.5057 0.3066 0.688 0.000 0.036 0.024 0.252
#> GSM447405 1 0.7920 0.1594 0.396 0.036 0.064 0.112 0.392
#> GSM447418 3 0.3741 0.7732 0.000 0.264 0.732 0.004 0.000
#> GSM447422 3 0.3752 0.7554 0.000 0.292 0.708 0.000 0.000
#> GSM447424 3 0.4959 0.7637 0.000 0.160 0.712 0.128 0.000
#> GSM447427 3 0.3636 0.7678 0.000 0.272 0.728 0.000 0.000
#> GSM447428 5 0.6728 0.0423 0.064 0.068 0.420 0.000 0.448
#> GSM447429 1 0.5266 -0.3053 0.496 0.000 0.020 0.016 0.468
#> GSM447431 3 0.5873 0.6520 0.000 0.328 0.584 0.064 0.024
#> GSM447432 2 0.2351 0.6999 0.000 0.896 0.088 0.016 0.000
#> GSM447434 5 0.5647 0.2898 0.388 0.048 0.016 0.000 0.548
#> GSM447442 2 0.2573 0.6961 0.000 0.880 0.104 0.016 0.000
#> GSM447451 2 0.2783 0.6543 0.000 0.868 0.012 0.004 0.116
#> GSM447462 5 0.5685 0.4994 0.380 0.004 0.048 0.012 0.556
#> GSM447463 1 0.1277 0.4884 0.960 0.004 0.004 0.004 0.028
#> GSM447467 2 0.5485 0.4488 0.092 0.652 0.008 0.000 0.248
#> GSM447469 4 0.6585 0.6598 0.000 0.232 0.096 0.600 0.072
#> GSM447473 1 0.5057 0.3066 0.688 0.000 0.036 0.024 0.252
#> GSM447404 1 0.4733 0.3365 0.728 0.000 0.032 0.024 0.216
#> GSM447406 4 0.3321 0.7165 0.000 0.136 0.032 0.832 0.000
#> GSM447407 4 0.3218 0.7111 0.000 0.096 0.032 0.860 0.012
#> GSM447409 1 0.2728 0.4886 0.896 0.000 0.048 0.016 0.040
#> GSM447412 3 0.4251 0.7485 0.000 0.316 0.672 0.000 0.012
#> GSM447426 3 0.6014 0.5678 0.000 0.044 0.652 0.208 0.096
#> GSM447433 1 0.7693 0.1932 0.440 0.032 0.052 0.112 0.364
#> GSM447439 4 0.3197 0.7174 0.000 0.140 0.024 0.836 0.000
#> GSM447441 2 0.4320 0.6519 0.000 0.792 0.132 0.052 0.024
#> GSM447443 5 0.5244 0.4481 0.360 0.000 0.024 0.020 0.596
#> GSM447445 1 0.1710 0.4932 0.940 0.004 0.016 0.000 0.040
#> GSM447446 1 0.7847 0.1916 0.424 0.032 0.064 0.112 0.368
#> GSM447453 1 0.3322 0.4791 0.848 0.000 0.044 0.004 0.104
#> GSM447455 2 0.2519 0.6974 0.000 0.884 0.100 0.016 0.000
#> GSM447456 2 0.7020 0.3352 0.120 0.564 0.016 0.044 0.256
#> GSM447459 4 0.3321 0.7165 0.000 0.136 0.032 0.832 0.000
#> GSM447466 1 0.1393 0.4871 0.956 0.000 0.012 0.008 0.024
#> GSM447470 1 0.5651 -0.1768 0.492 0.056 0.008 0.000 0.444
#> GSM447474 5 0.5859 0.2634 0.460 0.028 0.032 0.004 0.476
#> GSM447475 2 0.3894 0.5896 0.036 0.800 0.008 0.000 0.156
#> GSM447398 2 0.3581 0.5707 0.008 0.840 0.004 0.108 0.040
#> GSM447399 2 0.4659 0.6207 0.000 0.752 0.168 0.068 0.012
#> GSM447408 4 0.4930 0.6036 0.000 0.388 0.000 0.580 0.032
#> GSM447410 4 0.5735 0.5451 0.000 0.432 0.004 0.492 0.072
#> GSM447414 3 0.5477 0.7602 0.000 0.160 0.692 0.132 0.016
#> GSM447417 4 0.6161 0.6539 0.000 0.300 0.040 0.588 0.072
#> GSM447419 5 0.4694 0.4966 0.292 0.012 0.020 0.000 0.676
#> GSM447420 5 0.6607 0.4069 0.148 0.028 0.240 0.004 0.580
#> GSM447421 5 0.5952 0.3845 0.420 0.000 0.060 0.020 0.500
#> GSM447423 3 0.4135 0.7283 0.000 0.340 0.656 0.000 0.004
#> GSM447436 1 0.7748 0.2413 0.480 0.032 0.064 0.112 0.312
#> GSM447437 1 0.0324 0.4970 0.992 0.000 0.004 0.000 0.004
#> GSM447438 4 0.6526 0.5141 0.000 0.416 0.016 0.444 0.124
#> GSM447447 1 0.6195 0.1542 0.540 0.040 0.024 0.020 0.376
#> GSM447454 2 0.3452 0.4754 0.000 0.756 0.244 0.000 0.000
#> GSM447457 2 0.3607 0.4700 0.000 0.752 0.244 0.000 0.004
#> GSM447460 2 0.5838 0.4397 0.000 0.644 0.192 0.152 0.012
#> GSM447465 2 0.6124 -0.1733 0.000 0.460 0.412 0.128 0.000
#> GSM447471 1 0.5057 0.3066 0.688 0.000 0.036 0.024 0.252
#> GSM447476 4 0.6945 0.4985 0.000 0.324 0.024 0.472 0.180
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM447401 3 0.522 0.6165 0.000 0.004 0.692 0.164 0.096 0.044
#> GSM447411 1 0.145 0.6485 0.948 0.000 0.012 0.000 0.024 0.016
#> GSM447413 3 0.407 0.8069 0.000 0.056 0.804 0.096 0.020 0.024
#> GSM447415 1 0.486 0.3902 0.632 0.000 0.016 0.000 0.052 0.300
#> GSM447416 3 0.296 0.8247 0.000 0.108 0.852 0.032 0.004 0.004
#> GSM447425 4 0.496 0.4728 0.000 0.004 0.028 0.568 0.380 0.020
#> GSM447430 4 0.146 0.6996 0.000 0.044 0.016 0.940 0.000 0.000
#> GSM447435 1 0.163 0.6477 0.940 0.000 0.020 0.000 0.024 0.016
#> GSM447440 1 0.424 0.5351 0.784 0.012 0.020 0.000 0.080 0.104
#> GSM447444 6 0.690 0.2082 0.364 0.052 0.004 0.000 0.204 0.376
#> GSM447448 1 0.611 0.0627 0.536 0.028 0.000 0.000 0.244 0.192
#> GSM447449 2 0.306 0.7344 0.000 0.836 0.132 0.020 0.012 0.000
#> GSM447450 1 0.346 0.5862 0.836 0.004 0.020 0.000 0.056 0.084
#> GSM447452 4 0.310 0.6383 0.000 0.004 0.028 0.852 0.100 0.016
#> GSM447458 2 0.251 0.7501 0.004 0.896 0.064 0.012 0.020 0.004
#> GSM447461 2 0.231 0.7135 0.000 0.892 0.004 0.004 0.088 0.012
#> GSM447464 6 0.526 0.3443 0.428 0.000 0.020 0.000 0.052 0.500
#> GSM447468 6 0.491 0.4370 0.280 0.000 0.016 0.004 0.052 0.648
#> GSM447472 6 0.603 0.4347 0.316 0.020 0.008 0.000 0.128 0.528
#> GSM447400 6 0.397 0.6185 0.152 0.012 0.012 0.000 0.040 0.784
#> GSM447402 4 0.663 0.4372 0.000 0.256 0.016 0.372 0.348 0.008
#> GSM447403 1 0.586 0.3525 0.548 0.000 0.012 0.008 0.132 0.300
#> GSM447405 5 0.579 0.6407 0.240 0.016 0.000 0.008 0.592 0.144
#> GSM447418 3 0.291 0.8123 0.000 0.140 0.840 0.008 0.008 0.004
#> GSM447422 3 0.345 0.7443 0.000 0.224 0.760 0.000 0.012 0.004
#> GSM447424 3 0.305 0.8148 0.000 0.072 0.848 0.076 0.000 0.004
#> GSM447427 3 0.288 0.8078 0.000 0.152 0.832 0.000 0.008 0.008
#> GSM447428 6 0.615 0.1546 0.024 0.028 0.416 0.000 0.072 0.460
#> GSM447429 6 0.424 0.4444 0.308 0.000 0.004 0.000 0.028 0.660
#> GSM447431 3 0.548 0.7409 0.000 0.160 0.696 0.048 0.056 0.040
#> GSM447432 2 0.221 0.7515 0.000 0.900 0.080 0.008 0.008 0.004
#> GSM447434 6 0.596 0.5119 0.216 0.028 0.004 0.000 0.168 0.584
#> GSM447442 2 0.284 0.7388 0.000 0.848 0.128 0.012 0.012 0.000
#> GSM447451 2 0.304 0.6897 0.000 0.832 0.008 0.000 0.140 0.020
#> GSM447462 6 0.408 0.6206 0.156 0.012 0.012 0.000 0.044 0.776
#> GSM447463 1 0.126 0.6499 0.956 0.004 0.004 0.000 0.008 0.028
#> GSM447467 2 0.414 0.6180 0.020 0.780 0.004 0.000 0.072 0.124
#> GSM447469 4 0.681 0.5815 0.000 0.156 0.112 0.524 0.204 0.004
#> GSM447473 1 0.586 0.3525 0.548 0.000 0.012 0.008 0.132 0.300
#> GSM447404 1 0.555 0.3864 0.588 0.000 0.012 0.008 0.100 0.292
#> GSM447406 4 0.175 0.6978 0.000 0.044 0.016 0.932 0.004 0.004
#> GSM447407 4 0.242 0.6826 0.000 0.024 0.016 0.900 0.056 0.004
#> GSM447409 1 0.252 0.5885 0.876 0.000 0.008 0.000 0.100 0.016
#> GSM447412 3 0.390 0.7863 0.000 0.188 0.764 0.000 0.024 0.024
#> GSM447426 3 0.522 0.6165 0.000 0.004 0.692 0.164 0.096 0.044
#> GSM447433 5 0.607 0.6393 0.296 0.012 0.004 0.012 0.544 0.132
#> GSM447439 4 0.161 0.6988 0.000 0.044 0.016 0.936 0.004 0.000
#> GSM447441 2 0.540 0.6622 0.000 0.680 0.192 0.024 0.072 0.032
#> GSM447443 6 0.391 0.6073 0.128 0.000 0.008 0.004 0.072 0.788
#> GSM447445 1 0.228 0.6223 0.904 0.004 0.004 0.000 0.052 0.036
#> GSM447446 5 0.600 0.6283 0.292 0.012 0.004 0.008 0.548 0.136
#> GSM447453 1 0.370 0.5015 0.784 0.000 0.012 0.000 0.168 0.036
#> GSM447455 2 0.262 0.7460 0.000 0.868 0.108 0.012 0.012 0.000
#> GSM447456 2 0.702 0.3232 0.120 0.532 0.004 0.024 0.228 0.092
#> GSM447459 4 0.146 0.6996 0.000 0.044 0.016 0.940 0.000 0.000
#> GSM447466 1 0.169 0.6450 0.932 0.000 0.008 0.000 0.012 0.048
#> GSM447470 6 0.632 0.3793 0.364 0.044 0.004 0.000 0.116 0.472
#> GSM447474 6 0.541 0.4998 0.308 0.028 0.004 0.000 0.064 0.596
#> GSM447475 2 0.325 0.6764 0.008 0.832 0.004 0.000 0.124 0.032
#> GSM447398 2 0.385 0.6303 0.000 0.796 0.000 0.080 0.108 0.016
#> GSM447399 2 0.571 0.5872 0.000 0.640 0.228 0.072 0.032 0.028
#> GSM447408 4 0.503 0.6088 0.000 0.264 0.000 0.628 0.104 0.004
#> GSM447410 4 0.609 0.4812 0.000 0.348 0.000 0.440 0.204 0.008
#> GSM447414 3 0.453 0.8022 0.000 0.076 0.780 0.080 0.036 0.028
#> GSM447417 4 0.617 0.6143 0.000 0.184 0.036 0.564 0.212 0.004
#> GSM447419 6 0.428 0.6123 0.116 0.004 0.012 0.000 0.104 0.764
#> GSM447420 6 0.511 0.5340 0.056 0.020 0.152 0.000 0.052 0.720
#> GSM447421 6 0.420 0.5868 0.176 0.000 0.020 0.000 0.052 0.752
#> GSM447423 3 0.357 0.7434 0.000 0.240 0.744 0.000 0.008 0.008
#> GSM447436 5 0.578 0.5649 0.348 0.016 0.004 0.008 0.540 0.084
#> GSM447437 1 0.112 0.6502 0.960 0.000 0.004 0.000 0.008 0.028
#> GSM447438 4 0.632 0.3832 0.000 0.340 0.000 0.364 0.288 0.008
#> GSM447447 1 0.655 -0.2382 0.472 0.040 0.004 0.000 0.308 0.176
#> GSM447454 2 0.285 0.7052 0.000 0.840 0.140 0.000 0.016 0.004
#> GSM447457 2 0.308 0.6995 0.000 0.828 0.144 0.000 0.020 0.008
#> GSM447460 2 0.586 0.5031 0.000 0.600 0.264 0.088 0.028 0.020
#> GSM447465 2 0.532 0.1452 0.000 0.484 0.432 0.076 0.004 0.004
#> GSM447471 1 0.586 0.3525 0.548 0.000 0.012 0.008 0.132 0.300
#> GSM447476 5 0.652 -0.4214 0.004 0.284 0.004 0.300 0.400 0.008
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)
An example of the output of tb
is:
#> which_row fdr mean_1 mean_2 scaled_mean_1 scaled_mean_2 km
#> 1 38 0.042760348 8.373488 9.131774 -0.5533452 0.5164555 1
#> 2 40 0.018707592 7.106213 8.469186 -0.6173731 0.5762149 1
#> 3 55 0.019134737 10.221463 11.207825 -0.6159697 0.5749050 1
#> 4 59 0.006059896 5.921854 7.869574 -0.6899429 0.6439467 1
#> 5 60 0.018055526 8.928898 10.211722 -0.6204761 0.5791110 1
#> 6 98 0.009384629 15.714769 14.887706 0.6635654 -0.6193277 2
...
The columns in tb
are:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.km
: Row groups if k-means clustering is applied to rows.UMAP plot which shows how samples are separated.
dimension_reduction(res, k = 2, method = "UMAP")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.
test_to_known_factors(res)
#> n gender(p) agent(p) k
#> SD:kmeans 79 0.739 0.4331 2
#> SD:kmeans 60 0.642 0.0861 3
#> SD:kmeans 51 0.501 0.1722 4
#> SD:kmeans 36 0.366 0.7783 5
#> SD:kmeans 57 0.639 0.1055 6
If matrix rows can be associated to genes, consider to use functional_enrichment(res,
...)
to perform function enrichment for the signature genes. See this vignette for more detailed explanations.
The object with results only for a single top-value method and a single partition method can be extracted as:
res = res_list["SD", "skmeans"]
# you can also extract it by
# res = res_list["SD:skmeans"]
A summary of res
and all the functions that can be applied to it:
res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#> On a matrix with 51941 rows and 79 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'SD' method.
#> Subgroups are detected by 'skmeans' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 2.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
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.990 0.995 0.5063 0.494 0.494
#> 3 3 0.774 0.856 0.915 0.2742 0.817 0.645
#> 4 4 0.685 0.799 0.848 0.1158 0.907 0.746
#> 5 5 0.660 0.669 0.790 0.0894 0.913 0.701
#> 6 6 0.665 0.523 0.687 0.0419 0.948 0.752
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
#> GSM447401 2 0.0000 0.991 0.000 1.000
#> GSM447411 1 0.0000 1.000 1.000 0.000
#> GSM447413 2 0.0000 0.991 0.000 1.000
#> GSM447415 1 0.0000 1.000 1.000 0.000
#> GSM447416 2 0.0000 0.991 0.000 1.000
#> GSM447425 2 0.0000 0.991 0.000 1.000
#> GSM447430 2 0.0000 0.991 0.000 1.000
#> GSM447435 1 0.0000 1.000 1.000 0.000
#> GSM447440 1 0.0000 1.000 1.000 0.000
#> GSM447444 1 0.0000 1.000 1.000 0.000
#> GSM447448 1 0.0000 1.000 1.000 0.000
#> GSM447449 2 0.0000 0.991 0.000 1.000
#> GSM447450 1 0.0000 1.000 1.000 0.000
#> GSM447452 2 0.0000 0.991 0.000 1.000
#> GSM447458 2 0.0000 0.991 0.000 1.000
#> GSM447461 2 0.0000 0.991 0.000 1.000
#> GSM447464 1 0.0000 1.000 1.000 0.000
#> GSM447468 1 0.0000 1.000 1.000 0.000
#> GSM447472 1 0.0000 1.000 1.000 0.000
#> GSM447400 1 0.0000 1.000 1.000 0.000
#> GSM447402 2 0.0000 0.991 0.000 1.000
#> GSM447403 1 0.0000 1.000 1.000 0.000
#> GSM447405 1 0.0000 1.000 1.000 0.000
#> GSM447418 2 0.0000 0.991 0.000 1.000
#> GSM447422 2 0.0000 0.991 0.000 1.000
#> GSM447424 2 0.0000 0.991 0.000 1.000
#> GSM447427 2 0.0000 0.991 0.000 1.000
#> GSM447428 1 0.0000 1.000 1.000 0.000
#> GSM447429 1 0.0000 1.000 1.000 0.000
#> GSM447431 2 0.0000 0.991 0.000 1.000
#> GSM447432 2 0.0000 0.991 0.000 1.000
#> GSM447434 1 0.0000 1.000 1.000 0.000
#> GSM447442 2 0.0000 0.991 0.000 1.000
#> GSM447451 2 0.0000 0.991 0.000 1.000
#> GSM447462 1 0.0000 1.000 1.000 0.000
#> GSM447463 1 0.0000 1.000 1.000 0.000
#> GSM447467 1 0.0000 1.000 1.000 0.000
#> GSM447469 2 0.0000 0.991 0.000 1.000
#> GSM447473 1 0.0000 1.000 1.000 0.000
#> GSM447404 1 0.0000 1.000 1.000 0.000
#> GSM447406 2 0.0000 0.991 0.000 1.000
#> GSM447407 2 0.0000 0.991 0.000 1.000
#> GSM447409 1 0.0000 1.000 1.000 0.000
#> GSM447412 2 0.0000 0.991 0.000 1.000
#> GSM447426 2 0.0000 0.991 0.000 1.000
#> GSM447433 1 0.0000 1.000 1.000 0.000
#> GSM447439 2 0.0000 0.991 0.000 1.000
#> GSM447441 2 0.0000 0.991 0.000 1.000
#> GSM447443 1 0.0000 1.000 1.000 0.000
#> GSM447445 1 0.0000 1.000 1.000 0.000
#> GSM447446 1 0.0000 1.000 1.000 0.000
#> GSM447453 1 0.0000 1.000 1.000 0.000
#> GSM447455 2 0.0000 0.991 0.000 1.000
#> GSM447456 1 0.0376 0.996 0.996 0.004
#> GSM447459 2 0.0000 0.991 0.000 1.000
#> GSM447466 1 0.0000 1.000 1.000 0.000
#> GSM447470 1 0.0000 1.000 1.000 0.000
#> GSM447474 1 0.0000 1.000 1.000 0.000
#> GSM447475 2 0.7139 0.762 0.196 0.804
#> GSM447398 2 0.0000 0.991 0.000 1.000
#> GSM447399 2 0.0000 0.991 0.000 1.000
#> GSM447408 2 0.0000 0.991 0.000 1.000
#> GSM447410 2 0.0000 0.991 0.000 1.000
#> GSM447414 2 0.0000 0.991 0.000 1.000
#> GSM447417 2 0.0000 0.991 0.000 1.000
#> GSM447419 1 0.0000 1.000 1.000 0.000
#> GSM447420 1 0.0000 1.000 1.000 0.000
#> GSM447421 1 0.0000 1.000 1.000 0.000
#> GSM447423 2 0.0000 0.991 0.000 1.000
#> GSM447436 1 0.0000 1.000 1.000 0.000
#> GSM447437 1 0.0000 1.000 1.000 0.000
#> GSM447438 2 0.0000 0.991 0.000 1.000
#> GSM447447 1 0.0000 1.000 1.000 0.000
#> GSM447454 2 0.0000 0.991 0.000 1.000
#> GSM447457 2 0.0000 0.991 0.000 1.000
#> GSM447460 2 0.0000 0.991 0.000 1.000
#> GSM447465 2 0.0000 0.991 0.000 1.000
#> GSM447471 1 0.0000 1.000 1.000 0.000
#> GSM447476 2 0.6343 0.814 0.160 0.840
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM447401 3 0.0000 0.841 0.000 0.000 1.000
#> GSM447411 1 0.0000 0.974 1.000 0.000 0.000
#> GSM447413 3 0.0000 0.841 0.000 0.000 1.000
#> GSM447415 1 0.0000 0.974 1.000 0.000 0.000
#> GSM447416 3 0.0000 0.841 0.000 0.000 1.000
#> GSM447425 2 0.4555 0.881 0.000 0.800 0.200
#> GSM447430 2 0.4555 0.881 0.000 0.800 0.200
#> GSM447435 1 0.0000 0.974 1.000 0.000 0.000
#> GSM447440 1 0.0000 0.974 1.000 0.000 0.000
#> GSM447444 1 0.0000 0.974 1.000 0.000 0.000
#> GSM447448 1 0.0000 0.974 1.000 0.000 0.000
#> GSM447449 3 0.2066 0.820 0.000 0.060 0.940
#> GSM447450 1 0.0000 0.974 1.000 0.000 0.000
#> GSM447452 2 0.4555 0.881 0.000 0.800 0.200
#> GSM447458 3 0.5882 0.344 0.000 0.348 0.652
#> GSM447461 3 0.5591 0.727 0.000 0.304 0.696
#> GSM447464 1 0.0000 0.974 1.000 0.000 0.000
#> GSM447468 1 0.0000 0.974 1.000 0.000 0.000
#> GSM447472 1 0.0000 0.974 1.000 0.000 0.000
#> GSM447400 1 0.0000 0.974 1.000 0.000 0.000
#> GSM447402 2 0.4555 0.881 0.000 0.800 0.200
#> GSM447403 1 0.0000 0.974 1.000 0.000 0.000
#> GSM447405 1 0.5216 0.646 0.740 0.260 0.000
#> GSM447418 3 0.0000 0.841 0.000 0.000 1.000
#> GSM447422 3 0.0000 0.841 0.000 0.000 1.000
#> GSM447424 3 0.0000 0.841 0.000 0.000 1.000
#> GSM447427 3 0.0000 0.841 0.000 0.000 1.000
#> GSM447428 3 0.5905 0.457 0.352 0.000 0.648
#> GSM447429 1 0.0000 0.974 1.000 0.000 0.000
#> GSM447431 3 0.0592 0.841 0.000 0.012 0.988
#> GSM447432 3 0.3038 0.791 0.000 0.104 0.896
#> GSM447434 1 0.0000 0.974 1.000 0.000 0.000
#> GSM447442 3 0.2959 0.794 0.000 0.100 0.900
#> GSM447451 3 0.5178 0.756 0.000 0.256 0.744
#> GSM447462 1 0.0000 0.974 1.000 0.000 0.000
#> GSM447463 1 0.0000 0.974 1.000 0.000 0.000
#> GSM447467 3 0.5956 0.534 0.324 0.004 0.672
#> GSM447469 2 0.4605 0.877 0.000 0.796 0.204
#> GSM447473 1 0.0000 0.974 1.000 0.000 0.000
#> GSM447404 1 0.0000 0.974 1.000 0.000 0.000
#> GSM447406 2 0.4555 0.881 0.000 0.800 0.200
#> GSM447407 2 0.4555 0.881 0.000 0.800 0.200
#> GSM447409 1 0.0000 0.974 1.000 0.000 0.000
#> GSM447412 3 0.4235 0.778 0.000 0.176 0.824
#> GSM447426 3 0.0000 0.841 0.000 0.000 1.000
#> GSM447433 1 0.4887 0.699 0.772 0.228 0.000
#> GSM447439 2 0.4555 0.881 0.000 0.800 0.200
#> GSM447441 3 0.5138 0.759 0.000 0.252 0.748
#> GSM447443 1 0.0000 0.974 1.000 0.000 0.000
#> GSM447445 1 0.0000 0.974 1.000 0.000 0.000
#> GSM447446 1 0.0000 0.974 1.000 0.000 0.000
#> GSM447453 1 0.0000 0.974 1.000 0.000 0.000
#> GSM447455 3 0.3038 0.791 0.000 0.104 0.896
#> GSM447456 2 0.5363 0.588 0.276 0.724 0.000
#> GSM447459 2 0.4555 0.881 0.000 0.800 0.200
#> GSM447466 1 0.0000 0.974 1.000 0.000 0.000
#> GSM447470 1 0.0000 0.974 1.000 0.000 0.000
#> GSM447474 1 0.0000 0.974 1.000 0.000 0.000
#> GSM447475 3 0.5529 0.734 0.000 0.296 0.704
#> GSM447398 2 0.0000 0.802 0.000 1.000 0.000
#> GSM447399 3 0.5016 0.600 0.000 0.240 0.760
#> GSM447408 2 0.0000 0.802 0.000 1.000 0.000
#> GSM447410 2 0.0000 0.802 0.000 1.000 0.000
#> GSM447414 3 0.0000 0.841 0.000 0.000 1.000
#> GSM447417 2 0.4555 0.881 0.000 0.800 0.200
#> GSM447419 1 0.0000 0.974 1.000 0.000 0.000
#> GSM447420 1 0.5760 0.485 0.672 0.000 0.328
#> GSM447421 1 0.0000 0.974 1.000 0.000 0.000
#> GSM447423 3 0.4555 0.763 0.000 0.200 0.800
#> GSM447436 1 0.0000 0.974 1.000 0.000 0.000
#> GSM447437 1 0.0000 0.974 1.000 0.000 0.000
#> GSM447438 2 0.0000 0.802 0.000 1.000 0.000
#> GSM447447 1 0.0000 0.974 1.000 0.000 0.000
#> GSM447454 3 0.4504 0.766 0.000 0.196 0.804
#> GSM447457 3 0.4555 0.763 0.000 0.200 0.800
#> GSM447460 3 0.2066 0.820 0.000 0.060 0.940
#> GSM447465 3 0.0000 0.841 0.000 0.000 1.000
#> GSM447471 1 0.0000 0.974 1.000 0.000 0.000
#> GSM447476 2 0.0000 0.802 0.000 1.000 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM447401 3 0.3356 0.815 0.000 0.000 0.824 0.176
#> GSM447411 1 0.0524 0.903 0.988 0.008 0.000 0.004
#> GSM447413 3 0.3123 0.823 0.000 0.000 0.844 0.156
#> GSM447415 1 0.0336 0.905 0.992 0.008 0.000 0.000
#> GSM447416 3 0.2868 0.827 0.000 0.000 0.864 0.136
#> GSM447425 4 0.0927 0.896 0.000 0.008 0.016 0.976
#> GSM447430 4 0.1406 0.897 0.000 0.024 0.016 0.960
#> GSM447435 1 0.0336 0.904 0.992 0.008 0.000 0.000
#> GSM447440 1 0.0657 0.905 0.984 0.012 0.004 0.000
#> GSM447444 1 0.2915 0.885 0.892 0.028 0.080 0.000
#> GSM447448 1 0.0992 0.901 0.976 0.012 0.008 0.004
#> GSM447449 2 0.6362 0.729 0.000 0.656 0.176 0.168
#> GSM447450 1 0.0937 0.905 0.976 0.012 0.012 0.000
#> GSM447452 4 0.0779 0.899 0.000 0.004 0.016 0.980
#> GSM447458 2 0.5998 0.748 0.000 0.684 0.116 0.200
#> GSM447461 2 0.3570 0.752 0.000 0.860 0.092 0.048
#> GSM447464 1 0.4669 0.834 0.796 0.100 0.104 0.000
#> GSM447468 1 0.3081 0.879 0.888 0.048 0.064 0.000
#> GSM447472 1 0.1488 0.904 0.956 0.012 0.032 0.000
#> GSM447400 1 0.4953 0.819 0.776 0.120 0.104 0.000
#> GSM447402 4 0.1256 0.892 0.000 0.008 0.028 0.964
#> GSM447403 1 0.0992 0.903 0.976 0.012 0.008 0.004
#> GSM447405 1 0.5214 0.433 0.624 0.004 0.008 0.364
#> GSM447418 3 0.2760 0.825 0.000 0.000 0.872 0.128
#> GSM447422 3 0.2760 0.825 0.000 0.000 0.872 0.128
#> GSM447424 3 0.2868 0.827 0.000 0.000 0.864 0.136
#> GSM447427 3 0.2704 0.825 0.000 0.000 0.876 0.124
#> GSM447428 3 0.4215 0.564 0.072 0.104 0.824 0.000
#> GSM447429 1 0.4727 0.832 0.792 0.108 0.100 0.000
#> GSM447431 3 0.4491 0.795 0.000 0.060 0.800 0.140
#> GSM447432 2 0.6204 0.749 0.000 0.672 0.164 0.164
#> GSM447434 1 0.1082 0.904 0.972 0.020 0.004 0.004
#> GSM447442 2 0.6282 0.741 0.000 0.664 0.176 0.160
#> GSM447451 2 0.3525 0.751 0.000 0.860 0.100 0.040
#> GSM447462 1 0.4953 0.819 0.776 0.120 0.104 0.000
#> GSM447463 1 0.1182 0.904 0.968 0.016 0.016 0.000
#> GSM447467 2 0.4898 0.608 0.072 0.772 0.156 0.000
#> GSM447469 4 0.2101 0.874 0.000 0.012 0.060 0.928
#> GSM447473 1 0.1124 0.903 0.972 0.012 0.012 0.004
#> GSM447404 1 0.1059 0.905 0.972 0.012 0.016 0.000
#> GSM447406 4 0.1798 0.884 0.000 0.040 0.016 0.944
#> GSM447407 4 0.0779 0.899 0.000 0.004 0.016 0.980
#> GSM447409 1 0.0524 0.903 0.988 0.004 0.000 0.008
#> GSM447412 3 0.3521 0.781 0.000 0.084 0.864 0.052
#> GSM447426 3 0.3356 0.815 0.000 0.000 0.824 0.176
#> GSM447433 1 0.4800 0.494 0.656 0.004 0.000 0.340
#> GSM447439 4 0.1406 0.897 0.000 0.024 0.016 0.960
#> GSM447441 2 0.4507 0.750 0.000 0.788 0.168 0.044
#> GSM447443 1 0.4488 0.839 0.808 0.096 0.096 0.000
#> GSM447445 1 0.0672 0.905 0.984 0.008 0.008 0.000
#> GSM447446 1 0.2597 0.857 0.904 0.004 0.008 0.084
#> GSM447453 1 0.0376 0.904 0.992 0.004 0.000 0.004
#> GSM447455 2 0.6204 0.749 0.000 0.672 0.164 0.164
#> GSM447456 2 0.5521 0.586 0.240 0.704 0.004 0.052
#> GSM447459 4 0.1406 0.897 0.000 0.024 0.016 0.960
#> GSM447466 1 0.0804 0.905 0.980 0.012 0.008 0.000
#> GSM447470 1 0.3617 0.869 0.860 0.076 0.064 0.000
#> GSM447474 1 0.5171 0.812 0.760 0.128 0.112 0.000
#> GSM447475 2 0.3056 0.746 0.004 0.892 0.072 0.032
#> GSM447398 2 0.3105 0.679 0.000 0.856 0.004 0.140
#> GSM447399 3 0.6454 0.496 0.000 0.084 0.572 0.344
#> GSM447408 4 0.3400 0.787 0.000 0.180 0.000 0.820
#> GSM447410 4 0.3688 0.769 0.000 0.208 0.000 0.792
#> GSM447414 3 0.2973 0.825 0.000 0.000 0.856 0.144
#> GSM447417 4 0.1059 0.897 0.000 0.012 0.016 0.972
#> GSM447419 1 0.5728 0.747 0.708 0.104 0.188 0.000
#> GSM447420 3 0.6265 0.346 0.220 0.124 0.656 0.000
#> GSM447421 1 0.4953 0.819 0.776 0.120 0.104 0.000
#> GSM447423 3 0.2921 0.727 0.000 0.140 0.860 0.000
#> GSM447436 1 0.2597 0.857 0.904 0.004 0.008 0.084
#> GSM447437 1 0.0336 0.904 0.992 0.008 0.000 0.000
#> GSM447438 4 0.3764 0.765 0.000 0.216 0.000 0.784
#> GSM447447 1 0.1516 0.904 0.960 0.016 0.016 0.008
#> GSM447454 3 0.4222 0.604 0.000 0.272 0.728 0.000
#> GSM447457 3 0.4356 0.570 0.000 0.292 0.708 0.000
#> GSM447460 2 0.7220 0.517 0.000 0.532 0.292 0.176
#> GSM447465 3 0.5266 0.738 0.000 0.108 0.752 0.140
#> GSM447471 1 0.0992 0.903 0.976 0.012 0.008 0.004
#> GSM447476 4 0.3569 0.769 0.000 0.196 0.000 0.804
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM447401 3 0.2561 0.830 0.000 0.000 0.856 0.144 0.000
#> GSM447411 1 0.3586 0.669 0.736 0.000 0.000 0.000 0.264
#> GSM447413 3 0.2424 0.837 0.000 0.000 0.868 0.132 0.000
#> GSM447415 1 0.4294 0.472 0.532 0.000 0.000 0.000 0.468
#> GSM447416 3 0.1608 0.848 0.000 0.000 0.928 0.072 0.000
#> GSM447425 4 0.2780 0.847 0.112 0.008 0.004 0.872 0.004
#> GSM447430 4 0.0324 0.883 0.000 0.004 0.004 0.992 0.000
#> GSM447435 1 0.3612 0.667 0.732 0.000 0.000 0.000 0.268
#> GSM447440 1 0.3816 0.648 0.696 0.000 0.000 0.000 0.304
#> GSM447444 1 0.4715 0.523 0.672 0.020 0.012 0.000 0.296
#> GSM447448 1 0.3048 0.671 0.820 0.004 0.000 0.000 0.176
#> GSM447449 2 0.4499 0.787 0.000 0.764 0.096 0.136 0.004
#> GSM447450 1 0.3857 0.642 0.688 0.000 0.000 0.000 0.312
#> GSM447452 4 0.1093 0.882 0.020 0.004 0.004 0.968 0.004
#> GSM447458 2 0.4269 0.790 0.000 0.780 0.076 0.140 0.004
#> GSM447461 2 0.2842 0.761 0.000 0.888 0.012 0.056 0.044
#> GSM447464 5 0.3662 0.535 0.252 0.004 0.000 0.000 0.744
#> GSM447468 5 0.3949 0.204 0.332 0.000 0.000 0.000 0.668
#> GSM447472 1 0.4688 0.418 0.532 0.008 0.004 0.000 0.456
#> GSM447400 5 0.2193 0.661 0.092 0.008 0.000 0.000 0.900
#> GSM447402 4 0.3833 0.836 0.096 0.016 0.044 0.836 0.008
#> GSM447403 1 0.4367 0.494 0.580 0.004 0.000 0.000 0.416
#> GSM447405 1 0.4303 0.401 0.784 0.008 0.000 0.132 0.076
#> GSM447418 3 0.1124 0.846 0.000 0.004 0.960 0.036 0.000
#> GSM447422 3 0.1830 0.840 0.000 0.028 0.932 0.040 0.000
#> GSM447424 3 0.1544 0.850 0.000 0.000 0.932 0.068 0.000
#> GSM447427 3 0.0404 0.841 0.000 0.000 0.988 0.012 0.000
#> GSM447428 3 0.4755 0.533 0.028 0.008 0.672 0.000 0.292
#> GSM447429 5 0.2732 0.628 0.160 0.000 0.000 0.000 0.840
#> GSM447431 3 0.4112 0.795 0.000 0.048 0.800 0.136 0.016
#> GSM447432 2 0.4164 0.795 0.000 0.784 0.120 0.096 0.000
#> GSM447434 1 0.4304 0.388 0.516 0.000 0.000 0.000 0.484
#> GSM447442 2 0.4499 0.786 0.000 0.764 0.136 0.096 0.004
#> GSM447451 2 0.2654 0.767 0.000 0.900 0.016 0.040 0.044
#> GSM447462 5 0.2358 0.657 0.104 0.008 0.000 0.000 0.888
#> GSM447463 1 0.3983 0.589 0.660 0.000 0.000 0.000 0.340
#> GSM447467 2 0.4356 0.739 0.012 0.776 0.056 0.000 0.156
#> GSM447469 4 0.3418 0.842 0.056 0.004 0.084 0.852 0.004
#> GSM447473 1 0.4367 0.494 0.580 0.004 0.000 0.000 0.416
#> GSM447404 1 0.4294 0.473 0.532 0.000 0.000 0.000 0.468
#> GSM447406 4 0.0486 0.882 0.000 0.004 0.004 0.988 0.004
#> GSM447407 4 0.0994 0.883 0.016 0.004 0.004 0.972 0.004
#> GSM447409 1 0.3266 0.679 0.796 0.004 0.000 0.000 0.200
#> GSM447412 3 0.1469 0.838 0.000 0.036 0.948 0.016 0.000
#> GSM447426 3 0.2561 0.830 0.000 0.000 0.856 0.144 0.000
#> GSM447433 1 0.1914 0.549 0.932 0.004 0.000 0.032 0.032
#> GSM447439 4 0.0486 0.882 0.000 0.004 0.004 0.988 0.004
#> GSM447441 2 0.5008 0.757 0.000 0.744 0.152 0.072 0.032
#> GSM447443 5 0.3585 0.570 0.220 0.004 0.004 0.000 0.772
#> GSM447445 1 0.3561 0.656 0.740 0.000 0.000 0.000 0.260
#> GSM447446 1 0.1455 0.557 0.952 0.008 0.000 0.008 0.032
#> GSM447453 1 0.2966 0.676 0.816 0.000 0.000 0.000 0.184
#> GSM447455 2 0.4411 0.791 0.000 0.772 0.128 0.096 0.004
#> GSM447456 2 0.6519 0.500 0.264 0.588 0.000 0.076 0.072
#> GSM447459 4 0.0324 0.883 0.000 0.004 0.004 0.992 0.000
#> GSM447466 1 0.3837 0.649 0.692 0.000 0.000 0.000 0.308
#> GSM447470 5 0.4452 -0.184 0.496 0.004 0.000 0.000 0.500
#> GSM447474 5 0.3947 0.516 0.236 0.008 0.008 0.000 0.748
#> GSM447475 2 0.1699 0.773 0.004 0.944 0.008 0.008 0.036
#> GSM447398 2 0.3237 0.723 0.000 0.848 0.000 0.104 0.048
#> GSM447399 3 0.6204 0.356 0.000 0.124 0.488 0.384 0.004
#> GSM447408 4 0.2953 0.815 0.000 0.144 0.000 0.844 0.012
#> GSM447410 4 0.3985 0.766 0.000 0.196 0.004 0.772 0.028
#> GSM447414 3 0.2228 0.847 0.000 0.004 0.900 0.092 0.004
#> GSM447417 4 0.1948 0.873 0.056 0.004 0.004 0.928 0.008
#> GSM447419 5 0.5280 0.503 0.248 0.008 0.076 0.000 0.668
#> GSM447420 5 0.5438 0.273 0.056 0.008 0.340 0.000 0.596
#> GSM447421 5 0.2304 0.657 0.100 0.008 0.000 0.000 0.892
#> GSM447423 3 0.1197 0.829 0.000 0.048 0.952 0.000 0.000
#> GSM447436 1 0.2362 0.546 0.900 0.008 0.000 0.008 0.084
#> GSM447437 1 0.3612 0.668 0.732 0.000 0.000 0.000 0.268
#> GSM447438 4 0.4537 0.748 0.016 0.204 0.000 0.744 0.036
#> GSM447447 1 0.2753 0.597 0.856 0.008 0.000 0.000 0.136
#> GSM447454 3 0.3196 0.726 0.000 0.192 0.804 0.000 0.004
#> GSM447457 3 0.3838 0.593 0.000 0.280 0.716 0.000 0.004
#> GSM447460 2 0.6300 0.456 0.000 0.552 0.284 0.156 0.008
#> GSM447465 3 0.4326 0.754 0.000 0.140 0.776 0.080 0.004
#> GSM447471 1 0.4367 0.494 0.580 0.004 0.000 0.000 0.416
#> GSM447476 4 0.5498 0.749 0.096 0.200 0.000 0.684 0.020
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM447401 3 0.2558 0.759 0.000 0.000 0.840 0.156 0.004 0.000
#> GSM447411 5 0.3966 0.588 0.444 0.000 0.000 0.000 0.552 0.004
#> GSM447413 3 0.1957 0.786 0.000 0.000 0.888 0.112 0.000 0.000
#> GSM447415 1 0.6063 0.238 0.388 0.000 0.000 0.000 0.348 0.264
#> GSM447416 3 0.1226 0.800 0.000 0.004 0.952 0.040 0.000 0.004
#> GSM447425 4 0.3452 0.727 0.256 0.004 0.000 0.736 0.004 0.000
#> GSM447430 4 0.0291 0.846 0.000 0.000 0.000 0.992 0.004 0.004
#> GSM447435 5 0.3950 0.602 0.432 0.000 0.000 0.000 0.564 0.004
#> GSM447440 5 0.4728 0.648 0.392 0.000 0.000 0.000 0.556 0.052
#> GSM447444 5 0.5236 0.242 0.372 0.004 0.000 0.000 0.536 0.088
#> GSM447448 1 0.4199 -0.325 0.568 0.000 0.000 0.000 0.416 0.016
#> GSM447449 2 0.6830 0.698 0.000 0.596 0.088 0.100 0.140 0.076
#> GSM447450 5 0.4948 0.649 0.360 0.000 0.000 0.000 0.564 0.076
#> GSM447452 4 0.1082 0.846 0.040 0.000 0.000 0.956 0.004 0.000
#> GSM447458 2 0.6583 0.706 0.000 0.620 0.084 0.096 0.132 0.068
#> GSM447461 2 0.3062 0.659 0.000 0.868 0.004 0.044 0.044 0.040
#> GSM447464 6 0.5059 0.251 0.080 0.000 0.000 0.000 0.392 0.528
#> GSM447468 6 0.6095 -0.157 0.292 0.000 0.000 0.000 0.324 0.384
#> GSM447472 5 0.6062 -0.307 0.304 0.000 0.000 0.000 0.408 0.288
#> GSM447400 6 0.3254 0.616 0.048 0.000 0.000 0.000 0.136 0.816
#> GSM447402 4 0.4446 0.745 0.208 0.008 0.028 0.728 0.028 0.000
#> GSM447403 1 0.6050 0.296 0.412 0.000 0.000 0.000 0.312 0.276
#> GSM447405 1 0.2541 0.269 0.892 0.000 0.000 0.032 0.052 0.024
#> GSM447418 3 0.1121 0.796 0.000 0.004 0.964 0.008 0.016 0.008
#> GSM447422 3 0.2292 0.777 0.000 0.008 0.908 0.008 0.048 0.028
#> GSM447424 3 0.0865 0.801 0.000 0.000 0.964 0.036 0.000 0.000
#> GSM447427 3 0.0000 0.797 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM447428 3 0.5669 0.467 0.040 0.000 0.608 0.000 0.108 0.244
#> GSM447429 6 0.4887 0.519 0.156 0.000 0.000 0.000 0.184 0.660
#> GSM447431 3 0.5537 0.598 0.000 0.160 0.672 0.116 0.040 0.012
#> GSM447432 2 0.6180 0.706 0.000 0.644 0.128 0.040 0.128 0.060
#> GSM447434 1 0.6082 0.274 0.396 0.000 0.000 0.000 0.312 0.292
#> GSM447442 2 0.6729 0.696 0.000 0.596 0.132 0.056 0.144 0.072
#> GSM447451 2 0.3165 0.662 0.004 0.868 0.008 0.036 0.052 0.032
#> GSM447462 6 0.3210 0.612 0.036 0.000 0.000 0.000 0.152 0.812
#> GSM447463 5 0.5135 0.638 0.368 0.000 0.000 0.000 0.540 0.092
#> GSM447467 2 0.5554 0.680 0.004 0.604 0.012 0.000 0.244 0.136
#> GSM447469 4 0.4205 0.771 0.084 0.012 0.104 0.784 0.016 0.000
#> GSM447473 1 0.6050 0.296 0.412 0.000 0.000 0.000 0.312 0.276
#> GSM447404 1 0.6101 0.256 0.372 0.000 0.000 0.000 0.340 0.288
#> GSM447406 4 0.0291 0.846 0.000 0.000 0.000 0.992 0.004 0.004
#> GSM447407 4 0.0937 0.846 0.040 0.000 0.000 0.960 0.000 0.000
#> GSM447409 1 0.3890 -0.382 0.596 0.000 0.000 0.000 0.400 0.004
#> GSM447412 3 0.0767 0.799 0.000 0.008 0.976 0.012 0.004 0.000
#> GSM447426 3 0.2558 0.759 0.000 0.000 0.840 0.156 0.004 0.000
#> GSM447433 1 0.2019 0.199 0.900 0.000 0.000 0.012 0.088 0.000
#> GSM447439 4 0.0405 0.845 0.000 0.000 0.000 0.988 0.008 0.004
#> GSM447441 2 0.5400 0.643 0.000 0.704 0.136 0.088 0.048 0.024
#> GSM447443 6 0.5486 0.378 0.188 0.000 0.000 0.000 0.248 0.564
#> GSM447445 5 0.4726 0.616 0.424 0.000 0.000 0.000 0.528 0.048
#> GSM447446 1 0.0692 0.255 0.976 0.000 0.000 0.000 0.020 0.004
#> GSM447453 1 0.3862 -0.389 0.608 0.000 0.000 0.000 0.388 0.004
#> GSM447455 2 0.6599 0.699 0.000 0.608 0.132 0.056 0.140 0.064
#> GSM447456 2 0.7514 0.282 0.172 0.464 0.000 0.092 0.232 0.040
#> GSM447459 4 0.0291 0.846 0.000 0.000 0.000 0.992 0.004 0.004
#> GSM447466 5 0.4913 0.653 0.364 0.000 0.000 0.000 0.564 0.072
#> GSM447470 5 0.5769 0.384 0.220 0.000 0.000 0.000 0.504 0.276
#> GSM447474 6 0.4891 0.305 0.060 0.004 0.000 0.000 0.360 0.576
#> GSM447475 2 0.2533 0.689 0.000 0.884 0.000 0.004 0.056 0.056
#> GSM447398 2 0.3591 0.593 0.000 0.812 0.000 0.120 0.052 0.016
#> GSM447399 3 0.7207 0.177 0.000 0.096 0.416 0.364 0.088 0.036
#> GSM447408 4 0.2846 0.789 0.000 0.140 0.000 0.840 0.016 0.004
#> GSM447410 4 0.3902 0.728 0.000 0.212 0.000 0.748 0.028 0.012
#> GSM447414 3 0.2058 0.794 0.000 0.000 0.908 0.072 0.008 0.012
#> GSM447417 4 0.2174 0.832 0.088 0.008 0.000 0.896 0.008 0.000
#> GSM447419 6 0.6275 0.353 0.188 0.000 0.040 0.000 0.244 0.528
#> GSM447420 6 0.5235 0.344 0.020 0.000 0.276 0.000 0.084 0.620
#> GSM447421 6 0.3235 0.616 0.052 0.000 0.000 0.000 0.128 0.820
#> GSM447423 3 0.1861 0.782 0.000 0.036 0.928 0.000 0.016 0.020
#> GSM447436 1 0.0547 0.275 0.980 0.000 0.000 0.000 0.000 0.020
#> GSM447437 5 0.4381 0.622 0.440 0.000 0.000 0.000 0.536 0.024
#> GSM447438 4 0.4982 0.685 0.036 0.228 0.000 0.684 0.044 0.008
#> GSM447447 1 0.3816 -0.057 0.728 0.000 0.000 0.000 0.240 0.032
#> GSM447454 3 0.4815 0.596 0.000 0.220 0.692 0.000 0.044 0.044
#> GSM447457 3 0.5678 0.361 0.000 0.304 0.576 0.000 0.060 0.060
#> GSM447460 2 0.7389 0.372 0.000 0.460 0.288 0.120 0.084 0.048
#> GSM447465 3 0.5084 0.639 0.000 0.160 0.720 0.056 0.028 0.036
#> GSM447471 1 0.6050 0.296 0.412 0.000 0.000 0.000 0.312 0.276
#> GSM447476 4 0.5871 0.701 0.160 0.184 0.000 0.616 0.032 0.008
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)
An example of the output of tb
is:
#> which_row fdr mean_1 mean_2 scaled_mean_1 scaled_mean_2 km
#> 1 38 0.042760348 8.373488 9.131774 -0.5533452 0.5164555 1
#> 2 40 0.018707592 7.106213 8.469186 -0.6173731 0.5762149 1
#> 3 55 0.019134737 10.221463 11.207825 -0.6159697 0.5749050 1
#> 4 59 0.006059896 5.921854 7.869574 -0.6899429 0.6439467 1
#> 5 60 0.018055526 8.928898 10.211722 -0.6204761 0.5791110 1
#> 6 98 0.009384629 15.714769 14.887706 0.6635654 -0.6193277 2
...
The columns in tb
are:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.km
: Row groups if k-means clustering is applied to rows.UMAP plot which shows how samples are separated.
dimension_reduction(res, k = 2, method = "UMAP")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.
test_to_known_factors(res)
#> n gender(p) agent(p) k
#> SD:skmeans 79 0.739 0.433 2
#> SD:skmeans 76 0.291 0.295 3
#> SD:skmeans 75 0.664 0.329 4
#> SD:skmeans 65 0.654 0.145 5
#> SD:skmeans 51 0.511 0.132 6
If matrix rows can be associated to genes, consider to use functional_enrichment(res,
...)
to perform function enrichment for the signature genes. See this vignette for more detailed explanations.
The object with results only for a single top-value method and a single partition method can be extracted as:
res = res_list["SD", "pam"]
# you can also extract it by
# res = res_list["SD:pam"]
A summary of res
and all the functions that can be applied to it:
res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#> On a matrix with 51941 rows and 79 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.645 0.885 0.940 0.448 0.553 0.553
#> 3 3 0.738 0.806 0.907 0.467 0.744 0.559
#> 4 4 0.767 0.793 0.886 0.115 0.881 0.673
#> 5 5 0.726 0.486 0.741 0.051 0.895 0.637
#> 6 6 0.757 0.779 0.882 0.047 0.860 0.489
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
#> GSM447401 2 0.0000 0.921 0.000 1.000
#> GSM447411 1 0.0000 0.949 1.000 0.000
#> GSM447413 2 0.0000 0.921 0.000 1.000
#> GSM447415 1 0.0000 0.949 1.000 0.000
#> GSM447416 2 0.0000 0.921 0.000 1.000
#> GSM447425 2 0.0376 0.921 0.004 0.996
#> GSM447430 2 0.0000 0.921 0.000 1.000
#> GSM447435 1 0.0000 0.949 1.000 0.000
#> GSM447440 2 0.7883 0.777 0.236 0.764
#> GSM447444 2 0.7219 0.817 0.200 0.800
#> GSM447448 2 0.7299 0.813 0.204 0.796
#> GSM447449 2 0.0000 0.921 0.000 1.000
#> GSM447450 1 0.0000 0.949 1.000 0.000
#> GSM447452 2 0.0000 0.921 0.000 1.000
#> GSM447458 2 0.0376 0.921 0.004 0.996
#> GSM447461 2 0.0672 0.919 0.008 0.992
#> GSM447464 1 0.0000 0.949 1.000 0.000
#> GSM447468 1 0.0000 0.949 1.000 0.000
#> GSM447472 1 0.1843 0.929 0.972 0.028
#> GSM447400 1 0.0000 0.949 1.000 0.000
#> GSM447402 2 0.0000 0.921 0.000 1.000
#> GSM447403 1 0.0000 0.949 1.000 0.000
#> GSM447405 2 0.7299 0.813 0.204 0.796
#> GSM447418 2 0.0000 0.921 0.000 1.000
#> GSM447422 2 0.0000 0.921 0.000 1.000
#> GSM447424 2 0.0000 0.921 0.000 1.000
#> GSM447427 2 0.0000 0.921 0.000 1.000
#> GSM447428 2 0.7139 0.819 0.196 0.804
#> GSM447429 1 0.1633 0.933 0.976 0.024
#> GSM447431 2 0.0000 0.921 0.000 1.000
#> GSM447432 2 0.0000 0.921 0.000 1.000
#> GSM447434 1 0.9608 0.293 0.616 0.384
#> GSM447442 2 0.0000 0.921 0.000 1.000
#> GSM447451 2 0.7219 0.817 0.200 0.800
#> GSM447462 2 0.7299 0.813 0.204 0.796
#> GSM447463 1 0.0000 0.949 1.000 0.000
#> GSM447467 2 0.5946 0.853 0.144 0.856
#> GSM447469 2 0.0000 0.921 0.000 1.000
#> GSM447473 1 0.0000 0.949 1.000 0.000
#> GSM447404 1 0.0000 0.949 1.000 0.000
#> GSM447406 2 0.0000 0.921 0.000 1.000
#> GSM447407 2 0.0376 0.921 0.004 0.996
#> GSM447409 1 0.0000 0.949 1.000 0.000
#> GSM447412 2 0.6148 0.848 0.152 0.848
#> GSM447426 2 0.0000 0.921 0.000 1.000
#> GSM447433 1 0.9635 0.277 0.612 0.388
#> GSM447439 2 0.0000 0.921 0.000 1.000
#> GSM447441 2 0.0000 0.921 0.000 1.000
#> GSM447443 1 0.0000 0.949 1.000 0.000
#> GSM447445 1 0.0000 0.949 1.000 0.000
#> GSM447446 1 0.0000 0.949 1.000 0.000
#> GSM447453 1 0.0000 0.949 1.000 0.000
#> GSM447455 2 0.0000 0.921 0.000 1.000
#> GSM447456 2 0.7299 0.813 0.204 0.796
#> GSM447459 2 0.0000 0.921 0.000 1.000
#> GSM447466 1 0.0000 0.949 1.000 0.000
#> GSM447470 2 0.7299 0.813 0.204 0.796
#> GSM447474 2 0.7299 0.813 0.204 0.796
#> GSM447475 2 0.7139 0.820 0.196 0.804
#> GSM447398 2 0.7139 0.820 0.196 0.804
#> GSM447399 2 0.0000 0.921 0.000 1.000
#> GSM447408 2 0.0000 0.921 0.000 1.000
#> GSM447410 2 0.1414 0.914 0.020 0.980
#> GSM447414 2 0.0000 0.921 0.000 1.000
#> GSM447417 2 0.0376 0.921 0.004 0.996
#> GSM447419 1 0.7674 0.678 0.776 0.224
#> GSM447420 2 0.7299 0.813 0.204 0.796
#> GSM447421 1 0.2043 0.927 0.968 0.032
#> GSM447423 2 0.0000 0.921 0.000 1.000
#> GSM447436 1 0.2043 0.927 0.968 0.032
#> GSM447437 1 0.0000 0.949 1.000 0.000
#> GSM447438 2 0.7219 0.817 0.200 0.800
#> GSM447447 2 0.7745 0.786 0.228 0.772
#> GSM447454 2 0.0376 0.921 0.004 0.996
#> GSM447457 2 0.0000 0.921 0.000 1.000
#> GSM447460 2 0.0000 0.921 0.000 1.000
#> GSM447465 2 0.0000 0.921 0.000 1.000
#> GSM447471 1 0.0000 0.949 1.000 0.000
#> GSM447476 2 0.7139 0.820 0.196 0.804
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM447401 3 0.0237 0.901 0.000 0.004 0.996
#> GSM447411 1 0.0000 0.969 1.000 0.000 0.000
#> GSM447413 3 0.0424 0.903 0.000 0.008 0.992
#> GSM447415 1 0.0000 0.969 1.000 0.000 0.000
#> GSM447416 3 0.2878 0.837 0.000 0.096 0.904
#> GSM447425 2 0.6282 0.582 0.012 0.664 0.324
#> GSM447430 2 0.6140 0.459 0.000 0.596 0.404
#> GSM447435 1 0.0000 0.969 1.000 0.000 0.000
#> GSM447440 2 0.2448 0.800 0.076 0.924 0.000
#> GSM447444 2 0.0592 0.839 0.012 0.988 0.000
#> GSM447448 2 0.0592 0.839 0.012 0.988 0.000
#> GSM447449 3 0.3686 0.792 0.000 0.140 0.860
#> GSM447450 1 0.0000 0.969 1.000 0.000 0.000
#> GSM447452 3 0.0592 0.894 0.000 0.012 0.988
#> GSM447458 2 0.4915 0.734 0.012 0.804 0.184
#> GSM447461 2 0.0592 0.839 0.012 0.988 0.000
#> GSM447464 1 0.0000 0.969 1.000 0.000 0.000
#> GSM447468 1 0.0000 0.969 1.000 0.000 0.000
#> GSM447472 1 0.4796 0.719 0.780 0.220 0.000
#> GSM447400 1 0.1643 0.935 0.956 0.000 0.044
#> GSM447402 2 0.5926 0.457 0.000 0.644 0.356
#> GSM447403 1 0.0000 0.969 1.000 0.000 0.000
#> GSM447405 2 0.0592 0.839 0.012 0.988 0.000
#> GSM447418 3 0.0424 0.903 0.000 0.008 0.992
#> GSM447422 3 0.0424 0.903 0.000 0.008 0.992
#> GSM447424 3 0.0424 0.903 0.000 0.008 0.992
#> GSM447427 3 0.1529 0.886 0.000 0.040 0.960
#> GSM447428 3 0.5926 0.491 0.000 0.356 0.644
#> GSM447429 1 0.1529 0.937 0.960 0.040 0.000
#> GSM447431 2 0.2878 0.796 0.000 0.904 0.096
#> GSM447432 2 0.4750 0.704 0.000 0.784 0.216
#> GSM447434 2 0.6180 0.245 0.416 0.584 0.000
#> GSM447442 3 0.0424 0.903 0.000 0.008 0.992
#> GSM447451 2 0.0592 0.839 0.012 0.988 0.000
#> GSM447462 2 0.4702 0.700 0.212 0.788 0.000
#> GSM447463 1 0.0000 0.969 1.000 0.000 0.000
#> GSM447467 2 0.0592 0.839 0.012 0.988 0.000
#> GSM447469 3 0.1031 0.894 0.000 0.024 0.976
#> GSM447473 1 0.0000 0.969 1.000 0.000 0.000
#> GSM447404 1 0.0000 0.969 1.000 0.000 0.000
#> GSM447406 2 0.6140 0.459 0.000 0.596 0.404
#> GSM447407 2 0.6168 0.443 0.000 0.588 0.412
#> GSM447409 1 0.0000 0.969 1.000 0.000 0.000
#> GSM447412 2 0.0592 0.836 0.000 0.988 0.012
#> GSM447426 3 0.0237 0.901 0.000 0.004 0.996
#> GSM447433 2 0.6565 0.252 0.416 0.576 0.008
#> GSM447439 2 0.4654 0.711 0.000 0.792 0.208
#> GSM447441 2 0.0237 0.837 0.000 0.996 0.004
#> GSM447443 1 0.4121 0.794 0.832 0.168 0.000
#> GSM447445 1 0.0000 0.969 1.000 0.000 0.000
#> GSM447446 1 0.0000 0.969 1.000 0.000 0.000
#> GSM447453 1 0.0000 0.969 1.000 0.000 0.000
#> GSM447455 2 0.6168 0.448 0.000 0.588 0.412
#> GSM447456 2 0.0592 0.839 0.012 0.988 0.000
#> GSM447459 2 0.5926 0.533 0.000 0.644 0.356
#> GSM447466 1 0.0000 0.969 1.000 0.000 0.000
#> GSM447470 2 0.0592 0.839 0.012 0.988 0.000
#> GSM447474 2 0.0592 0.839 0.012 0.988 0.000
#> GSM447475 2 0.0592 0.839 0.012 0.988 0.000
#> GSM447398 2 0.0424 0.839 0.008 0.992 0.000
#> GSM447399 3 0.0424 0.903 0.000 0.008 0.992
#> GSM447408 2 0.0237 0.836 0.000 0.996 0.004
#> GSM447410 2 0.0237 0.836 0.000 0.996 0.004
#> GSM447414 3 0.0424 0.903 0.000 0.008 0.992
#> GSM447417 3 0.1163 0.887 0.000 0.028 0.972
#> GSM447419 3 0.8773 0.394 0.128 0.336 0.536
#> GSM447420 2 0.0592 0.839 0.012 0.988 0.000
#> GSM447421 1 0.2550 0.924 0.936 0.024 0.040
#> GSM447423 3 0.5926 0.491 0.000 0.356 0.644
#> GSM447436 1 0.2165 0.913 0.936 0.064 0.000
#> GSM447437 1 0.0000 0.969 1.000 0.000 0.000
#> GSM447438 2 0.0000 0.837 0.000 1.000 0.000
#> GSM447447 2 0.2165 0.816 0.064 0.936 0.000
#> GSM447454 2 0.1182 0.837 0.012 0.976 0.012
#> GSM447457 2 0.0592 0.836 0.000 0.988 0.012
#> GSM447460 2 0.5968 0.526 0.000 0.636 0.364
#> GSM447465 3 0.0424 0.903 0.000 0.008 0.992
#> GSM447471 1 0.0000 0.969 1.000 0.000 0.000
#> GSM447476 2 0.0237 0.836 0.000 0.996 0.004
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM447401 3 0.1637 0.706 0.000 0.000 0.940 0.060
#> GSM447411 1 0.0188 0.952 0.996 0.000 0.000 0.004
#> GSM447413 3 0.3528 0.848 0.000 0.000 0.808 0.192
#> GSM447415 1 0.0000 0.952 1.000 0.000 0.000 0.000
#> GSM447416 3 0.3831 0.701 0.000 0.204 0.792 0.004
#> GSM447425 4 0.0188 0.797 0.000 0.000 0.004 0.996
#> GSM447430 4 0.0188 0.797 0.000 0.000 0.004 0.996
#> GSM447435 1 0.1209 0.948 0.964 0.032 0.000 0.004
#> GSM447440 2 0.1489 0.825 0.044 0.952 0.000 0.004
#> GSM447444 2 0.0188 0.855 0.000 0.996 0.000 0.004
#> GSM447448 2 0.0188 0.855 0.000 0.996 0.000 0.004
#> GSM447449 3 0.3649 0.847 0.000 0.000 0.796 0.204
#> GSM447450 1 0.1489 0.943 0.952 0.044 0.000 0.004
#> GSM447452 4 0.3688 0.696 0.000 0.000 0.208 0.792
#> GSM447458 2 0.7159 0.322 0.000 0.556 0.244 0.200
#> GSM447461 2 0.0000 0.856 0.000 1.000 0.000 0.000
#> GSM447464 1 0.1302 0.945 0.956 0.044 0.000 0.000
#> GSM447468 1 0.0188 0.952 0.996 0.000 0.000 0.004
#> GSM447472 1 0.4313 0.678 0.736 0.260 0.000 0.004
#> GSM447400 1 0.2400 0.932 0.924 0.044 0.028 0.004
#> GSM447402 4 0.2021 0.760 0.000 0.012 0.056 0.932
#> GSM447403 1 0.0000 0.952 1.000 0.000 0.000 0.000
#> GSM447405 2 0.0188 0.856 0.004 0.996 0.000 0.000
#> GSM447418 3 0.3649 0.847 0.000 0.000 0.796 0.204
#> GSM447422 3 0.3649 0.847 0.000 0.000 0.796 0.204
#> GSM447424 3 0.3486 0.848 0.000 0.000 0.812 0.188
#> GSM447427 3 0.3791 0.847 0.000 0.004 0.796 0.200
#> GSM447428 3 0.3982 0.685 0.000 0.220 0.776 0.004
#> GSM447429 1 0.1022 0.937 0.968 0.032 0.000 0.000
#> GSM447431 2 0.4468 0.638 0.000 0.752 0.016 0.232
#> GSM447432 2 0.7249 0.281 0.000 0.540 0.260 0.200
#> GSM447434 2 0.5070 0.173 0.416 0.580 0.000 0.004
#> GSM447442 3 0.3649 0.847 0.000 0.000 0.796 0.204
#> GSM447451 2 0.0000 0.856 0.000 1.000 0.000 0.000
#> GSM447462 2 0.3791 0.665 0.200 0.796 0.000 0.004
#> GSM447463 1 0.1302 0.945 0.956 0.044 0.000 0.000
#> GSM447467 2 0.0000 0.856 0.000 1.000 0.000 0.000
#> GSM447469 4 0.4220 0.467 0.000 0.004 0.248 0.748
#> GSM447473 1 0.0000 0.952 1.000 0.000 0.000 0.000
#> GSM447404 1 0.0000 0.952 1.000 0.000 0.000 0.000
#> GSM447406 4 0.0707 0.798 0.000 0.000 0.020 0.980
#> GSM447407 4 0.0707 0.798 0.000 0.000 0.020 0.980
#> GSM447409 1 0.0000 0.952 1.000 0.000 0.000 0.000
#> GSM447412 2 0.1302 0.840 0.000 0.956 0.044 0.000
#> GSM447426 3 0.0000 0.745 0.000 0.000 1.000 0.000
#> GSM447433 4 0.6850 0.387 0.108 0.376 0.000 0.516
#> GSM447439 4 0.0804 0.799 0.000 0.008 0.012 0.980
#> GSM447441 2 0.1302 0.838 0.000 0.956 0.000 0.044
#> GSM447443 1 0.3908 0.747 0.784 0.212 0.000 0.004
#> GSM447445 1 0.1302 0.945 0.956 0.044 0.000 0.000
#> GSM447446 1 0.0376 0.952 0.992 0.004 0.000 0.004
#> GSM447453 1 0.0000 0.952 1.000 0.000 0.000 0.000
#> GSM447455 2 0.6886 0.412 0.000 0.596 0.200 0.204
#> GSM447456 2 0.0000 0.856 0.000 1.000 0.000 0.000
#> GSM447459 4 0.0707 0.798 0.000 0.000 0.020 0.980
#> GSM447466 1 0.0592 0.952 0.984 0.016 0.000 0.000
#> GSM447470 2 0.0000 0.856 0.000 1.000 0.000 0.000
#> GSM447474 2 0.0000 0.856 0.000 1.000 0.000 0.000
#> GSM447475 2 0.0000 0.856 0.000 1.000 0.000 0.000
#> GSM447398 2 0.1302 0.838 0.000 0.956 0.000 0.044
#> GSM447399 3 0.3528 0.848 0.000 0.000 0.808 0.192
#> GSM447408 4 0.4382 0.622 0.000 0.296 0.000 0.704
#> GSM447410 4 0.4382 0.622 0.000 0.296 0.000 0.704
#> GSM447414 3 0.3486 0.848 0.000 0.000 0.812 0.188
#> GSM447417 4 0.0188 0.797 0.000 0.000 0.004 0.996
#> GSM447419 3 0.6848 0.399 0.100 0.348 0.548 0.004
#> GSM447420 2 0.0000 0.856 0.000 1.000 0.000 0.000
#> GSM447421 1 0.1913 0.933 0.940 0.040 0.020 0.000
#> GSM447423 3 0.3688 0.698 0.000 0.208 0.792 0.000
#> GSM447436 1 0.1302 0.927 0.956 0.044 0.000 0.000
#> GSM447437 1 0.1211 0.946 0.960 0.040 0.000 0.000
#> GSM447438 2 0.1302 0.838 0.000 0.956 0.000 0.044
#> GSM447447 2 0.1389 0.831 0.048 0.952 0.000 0.000
#> GSM447454 2 0.2111 0.828 0.000 0.932 0.044 0.024
#> GSM447457 2 0.1302 0.840 0.000 0.956 0.044 0.000
#> GSM447460 2 0.5307 0.625 0.000 0.736 0.076 0.188
#> GSM447465 3 0.3486 0.848 0.000 0.000 0.812 0.188
#> GSM447471 1 0.0000 0.952 1.000 0.000 0.000 0.000
#> GSM447476 4 0.4356 0.623 0.000 0.292 0.000 0.708
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM447401 5 0.4201 -0.1574 0.000 0.000 0.408 0.000 0.592
#> GSM447411 1 0.4219 0.7104 0.584 0.416 0.000 0.000 0.000
#> GSM447413 3 0.0963 0.7865 0.000 0.000 0.964 0.036 0.000
#> GSM447415 1 0.4210 0.7105 0.588 0.412 0.000 0.000 0.000
#> GSM447416 3 0.1195 0.7571 0.000 0.028 0.960 0.012 0.000
#> GSM447425 4 0.4658 -0.1968 0.000 0.000 0.016 0.576 0.408
#> GSM447430 4 0.4658 -0.1968 0.000 0.000 0.016 0.576 0.408
#> GSM447435 1 0.4278 0.7041 0.548 0.452 0.000 0.000 0.000
#> GSM447440 2 0.0000 0.3310 0.000 1.000 0.000 0.000 0.000
#> GSM447444 2 0.4219 0.7919 0.000 0.584 0.000 0.416 0.000
#> GSM447448 2 0.4210 0.7899 0.000 0.588 0.000 0.412 0.000
#> GSM447449 3 0.2966 0.7689 0.000 0.000 0.816 0.184 0.000
#> GSM447450 1 0.4448 0.6894 0.516 0.480 0.000 0.004 0.000
#> GSM447452 5 0.0162 0.2942 0.000 0.000 0.000 0.004 0.996
#> GSM447458 4 0.5901 -0.0830 0.000 0.148 0.268 0.584 0.000
#> GSM447461 2 0.4227 0.7926 0.000 0.580 0.000 0.420 0.000
#> GSM447464 1 0.2773 0.7634 0.836 0.164 0.000 0.000 0.000
#> GSM447468 1 0.4367 0.7105 0.580 0.416 0.000 0.004 0.000
#> GSM447472 2 0.3857 -0.4253 0.312 0.688 0.000 0.000 0.000
#> GSM447400 1 0.1544 0.7584 0.932 0.068 0.000 0.000 0.000
#> GSM447402 4 0.4806 -0.1944 0.000 0.004 0.016 0.572 0.408
#> GSM447403 1 0.0000 0.7732 1.000 0.000 0.000 0.000 0.000
#> GSM447405 2 0.4375 0.7915 0.004 0.576 0.000 0.420 0.000
#> GSM447418 3 0.2966 0.7689 0.000 0.000 0.816 0.184 0.000
#> GSM447422 3 0.2966 0.7689 0.000 0.000 0.816 0.184 0.000
#> GSM447424 3 0.0000 0.7773 0.000 0.000 1.000 0.000 0.000
#> GSM447427 3 0.2966 0.7689 0.000 0.000 0.816 0.184 0.000
#> GSM447428 3 0.3455 0.6443 0.000 0.208 0.784 0.008 0.000
#> GSM447429 1 0.0000 0.7732 1.000 0.000 0.000 0.000 0.000
#> GSM447431 4 0.4714 -0.4164 0.000 0.324 0.032 0.644 0.000
#> GSM447432 4 0.5940 -0.0636 0.000 0.144 0.284 0.572 0.000
#> GSM447434 2 0.1809 0.2820 0.060 0.928 0.000 0.012 0.000
#> GSM447442 3 0.2966 0.7689 0.000 0.000 0.816 0.184 0.000
#> GSM447451 2 0.4227 0.7926 0.000 0.580 0.000 0.420 0.000
#> GSM447462 4 0.6500 -0.5514 0.188 0.400 0.000 0.412 0.000
#> GSM447463 1 0.4297 0.6954 0.528 0.472 0.000 0.000 0.000
#> GSM447467 2 0.4227 0.7926 0.000 0.580 0.000 0.420 0.000
#> GSM447469 5 0.6734 0.1602 0.000 0.000 0.256 0.356 0.388
#> GSM447473 1 0.0000 0.7732 1.000 0.000 0.000 0.000 0.000
#> GSM447404 1 0.0000 0.7732 1.000 0.000 0.000 0.000 0.000
#> GSM447406 5 0.6554 0.2789 0.000 0.000 0.200 0.392 0.408
#> GSM447407 5 0.6554 0.2789 0.000 0.000 0.200 0.392 0.408
#> GSM447409 1 0.0000 0.7732 1.000 0.000 0.000 0.000 0.000
#> GSM447412 2 0.5425 0.7380 0.000 0.520 0.060 0.420 0.000
#> GSM447426 5 0.4201 -0.1574 0.000 0.000 0.408 0.000 0.592
#> GSM447433 2 0.3983 0.0483 0.052 0.784 0.000 0.164 0.000
#> GSM447439 4 0.6021 -0.3186 0.000 0.000 0.116 0.476 0.408
#> GSM447441 2 0.4448 0.7401 0.000 0.516 0.004 0.480 0.000
#> GSM447443 1 0.3491 0.5917 0.768 0.228 0.000 0.004 0.000
#> GSM447445 1 0.4440 0.6955 0.528 0.468 0.000 0.004 0.000
#> GSM447446 1 0.0290 0.7729 0.992 0.008 0.000 0.000 0.000
#> GSM447453 1 0.1478 0.7749 0.936 0.064 0.000 0.000 0.000
#> GSM447455 4 0.5950 -0.1572 0.000 0.188 0.220 0.592 0.000
#> GSM447456 2 0.4227 0.7926 0.000 0.580 0.000 0.420 0.000
#> GSM447459 5 0.6554 0.2789 0.000 0.000 0.200 0.392 0.408
#> GSM447466 1 0.4256 0.7082 0.564 0.436 0.000 0.000 0.000
#> GSM447470 2 0.4219 0.7919 0.000 0.584 0.000 0.416 0.000
#> GSM447474 2 0.4227 0.7906 0.000 0.580 0.000 0.420 0.000
#> GSM447475 2 0.4227 0.7926 0.000 0.580 0.000 0.420 0.000
#> GSM447398 2 0.4302 0.7426 0.000 0.520 0.000 0.480 0.000
#> GSM447399 3 0.0609 0.7846 0.000 0.000 0.980 0.020 0.000
#> GSM447408 4 0.6518 -0.0589 0.000 0.192 0.000 0.412 0.396
#> GSM447410 4 0.6518 -0.0589 0.000 0.192 0.000 0.412 0.396
#> GSM447414 3 0.0000 0.7773 0.000 0.000 1.000 0.000 0.000
#> GSM447417 4 0.4658 -0.1968 0.000 0.000 0.016 0.576 0.408
#> GSM447419 3 0.5867 0.3543 0.096 0.352 0.548 0.004 0.000
#> GSM447420 2 0.4235 0.7918 0.000 0.576 0.000 0.424 0.000
#> GSM447421 1 0.0510 0.7724 0.984 0.016 0.000 0.000 0.000
#> GSM447423 3 0.3391 0.6579 0.000 0.188 0.800 0.012 0.000
#> GSM447436 1 0.0000 0.7732 1.000 0.000 0.000 0.000 0.000
#> GSM447437 1 0.4294 0.6977 0.532 0.468 0.000 0.000 0.000
#> GSM447438 2 0.4302 0.7426 0.000 0.520 0.000 0.480 0.000
#> GSM447447 2 0.5250 0.7493 0.048 0.536 0.000 0.416 0.000
#> GSM447454 2 0.5498 0.7115 0.000 0.496 0.064 0.440 0.000
#> GSM447457 2 0.5425 0.7380 0.000 0.520 0.060 0.420 0.000
#> GSM447460 4 0.6738 -0.4469 0.000 0.320 0.272 0.408 0.000
#> GSM447465 3 0.0000 0.7773 0.000 0.000 1.000 0.000 0.000
#> GSM447471 1 0.0000 0.7732 1.000 0.000 0.000 0.000 0.000
#> GSM447476 4 0.6518 -0.0589 0.000 0.192 0.000 0.412 0.396
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM447401 5 0.0000 0.9888 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM447411 1 0.1957 0.7865 0.888 0.000 0.000 0.000 0.000 0.112
#> GSM447413 3 0.1007 0.8145 0.000 0.000 0.956 0.044 0.000 0.000
#> GSM447415 1 0.2762 0.7800 0.804 0.000 0.000 0.000 0.000 0.196
#> GSM447416 3 0.0632 0.7954 0.000 0.024 0.976 0.000 0.000 0.000
#> GSM447425 4 0.0000 0.7808 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM447430 4 0.0000 0.7808 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM447435 1 0.2416 0.7908 0.844 0.000 0.000 0.000 0.000 0.156
#> GSM447440 1 0.1714 0.7478 0.908 0.092 0.000 0.000 0.000 0.000
#> GSM447444 2 0.1204 0.8604 0.056 0.944 0.000 0.000 0.000 0.000
#> GSM447448 2 0.2135 0.8075 0.128 0.872 0.000 0.000 0.000 0.000
#> GSM447449 3 0.2793 0.7982 0.000 0.000 0.800 0.200 0.000 0.000
#> GSM447450 1 0.0000 0.7508 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM447452 5 0.0632 0.9772 0.000 0.000 0.000 0.024 0.976 0.000
#> GSM447458 2 0.5557 0.3891 0.000 0.552 0.248 0.200 0.000 0.000
#> GSM447461 2 0.0000 0.8813 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM447464 6 0.2048 0.8045 0.120 0.000 0.000 0.000 0.000 0.880
#> GSM447468 1 0.0865 0.7664 0.964 0.000 0.000 0.000 0.000 0.036
#> GSM447472 1 0.2901 0.7126 0.840 0.128 0.000 0.000 0.000 0.032
#> GSM447400 6 0.1814 0.8652 0.100 0.000 0.000 0.000 0.000 0.900
#> GSM447402 4 0.0405 0.7779 0.000 0.004 0.008 0.988 0.000 0.000
#> GSM447403 6 0.0000 0.9342 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM447405 2 0.0000 0.8813 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM447418 3 0.2793 0.7982 0.000 0.000 0.800 0.200 0.000 0.000
#> GSM447422 3 0.2793 0.7982 0.000 0.000 0.800 0.200 0.000 0.000
#> GSM447424 3 0.0000 0.8047 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM447427 3 0.2793 0.7982 0.000 0.000 0.800 0.200 0.000 0.000
#> GSM447428 3 0.3624 0.7117 0.060 0.156 0.784 0.000 0.000 0.000
#> GSM447429 6 0.0000 0.9342 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM447431 2 0.2854 0.7244 0.000 0.792 0.000 0.208 0.000 0.000
#> GSM447432 2 0.5640 0.3405 0.000 0.532 0.268 0.200 0.000 0.000
#> GSM447434 1 0.3619 0.4827 0.680 0.316 0.000 0.000 0.000 0.004
#> GSM447442 3 0.2793 0.7982 0.000 0.000 0.800 0.200 0.000 0.000
#> GSM447451 2 0.0000 0.8813 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM447462 2 0.3971 0.7216 0.184 0.748 0.000 0.000 0.000 0.068
#> GSM447463 1 0.2793 0.7807 0.800 0.000 0.000 0.000 0.000 0.200
#> GSM447467 2 0.0000 0.8813 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM447469 4 0.3050 0.4966 0.000 0.000 0.236 0.764 0.000 0.000
#> GSM447473 6 0.0000 0.9342 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM447404 6 0.0000 0.9342 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM447406 4 0.2793 0.7464 0.000 0.000 0.200 0.800 0.000 0.000
#> GSM447407 4 0.2793 0.7464 0.000 0.000 0.200 0.800 0.000 0.000
#> GSM447409 6 0.0000 0.9342 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM447412 2 0.0000 0.8813 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM447426 5 0.0000 0.9888 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM447433 1 0.1910 0.7248 0.892 0.108 0.000 0.000 0.000 0.000
#> GSM447439 4 0.1910 0.7809 0.000 0.000 0.108 0.892 0.000 0.000
#> GSM447441 2 0.0146 0.8804 0.000 0.996 0.004 0.000 0.000 0.000
#> GSM447443 6 0.3770 0.6934 0.244 0.028 0.000 0.000 0.000 0.728
#> GSM447445 1 0.3330 0.6745 0.716 0.000 0.000 0.000 0.000 0.284
#> GSM447446 6 0.1863 0.8591 0.104 0.000 0.000 0.000 0.000 0.896
#> GSM447453 1 0.3868 -0.0154 0.508 0.000 0.000 0.000 0.000 0.492
#> GSM447455 2 0.5304 0.4867 0.000 0.600 0.200 0.200 0.000 0.000
#> GSM447456 2 0.0000 0.8813 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM447459 4 0.2793 0.7464 0.000 0.000 0.200 0.800 0.000 0.000
#> GSM447466 1 0.2730 0.7818 0.808 0.000 0.000 0.000 0.000 0.192
#> GSM447470 2 0.1204 0.8670 0.056 0.944 0.000 0.000 0.000 0.000
#> GSM447474 2 0.1556 0.8522 0.080 0.920 0.000 0.000 0.000 0.000
#> GSM447475 2 0.0000 0.8813 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM447398 2 0.0000 0.8813 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM447399 3 0.1564 0.7975 0.040 0.000 0.936 0.024 0.000 0.000
#> GSM447408 4 0.2941 0.6914 0.000 0.220 0.000 0.780 0.000 0.000
#> GSM447410 4 0.2941 0.6914 0.000 0.220 0.000 0.780 0.000 0.000
#> GSM447414 3 0.0000 0.8047 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM447417 4 0.0000 0.7808 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM447419 3 0.6385 0.4292 0.128 0.232 0.552 0.000 0.000 0.088
#> GSM447420 2 0.1501 0.8534 0.076 0.924 0.000 0.000 0.000 0.000
#> GSM447421 6 0.0260 0.9290 0.008 0.000 0.000 0.000 0.000 0.992
#> GSM447423 3 0.2793 0.7030 0.000 0.200 0.800 0.000 0.000 0.000
#> GSM447436 6 0.0000 0.9342 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM447437 1 0.3023 0.7645 0.768 0.000 0.000 0.000 0.000 0.232
#> GSM447438 2 0.0000 0.8813 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM447447 2 0.1682 0.8534 0.020 0.928 0.000 0.000 0.000 0.052
#> GSM447454 2 0.0632 0.8748 0.000 0.976 0.000 0.024 0.000 0.000
#> GSM447457 2 0.0000 0.8813 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM447460 2 0.2941 0.7117 0.000 0.780 0.220 0.000 0.000 0.000
#> GSM447465 3 0.0000 0.8047 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM447471 6 0.0000 0.9342 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM447476 4 0.3133 0.6932 0.008 0.212 0.000 0.780 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 gender(p) agent(p) k
#> SD:pam 77 1.000 0.4151 2
#> SD:pam 69 0.176 0.3318 3
#> SD:pam 72 0.294 0.3520 4
#> SD:pam 53 0.142 0.1141 5
#> SD:pam 72 0.197 0.0238 6
If matrix rows can be associated to genes, consider to use functional_enrichment(res,
...)
to perform function enrichment for the signature genes. See this vignette for more detailed explanations.
The object with results only for a single top-value method and a single partition method can be extracted as:
res = res_list["SD", "mclust"]
# you can also extract it by
# res = res_list["SD:mclust"]
A summary of res
and all the functions that can be applied to it:
res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#> On a matrix with 51941 rows and 79 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'SD' method.
#> Subgroups are detected by 'mclust' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 2.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
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.948 0.956 0.982 0.4967 0.503 0.503
#> 3 3 0.800 0.832 0.920 0.1531 0.899 0.809
#> 4 4 0.762 0.794 0.842 0.1839 0.849 0.671
#> 5 5 0.517 0.628 0.722 0.1005 0.963 0.886
#> 6 6 0.797 0.756 0.884 0.0906 0.824 0.460
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
#> GSM447401 2 0.0000 0.981 0.000 1.000
#> GSM447411 1 0.0000 0.981 1.000 0.000
#> GSM447413 2 0.0000 0.981 0.000 1.000
#> GSM447415 1 0.0000 0.981 1.000 0.000
#> GSM447416 2 0.0000 0.981 0.000 1.000
#> GSM447425 2 0.0000 0.981 0.000 1.000
#> GSM447430 2 0.0000 0.981 0.000 1.000
#> GSM447435 1 0.0000 0.981 1.000 0.000
#> GSM447440 1 0.0000 0.981 1.000 0.000
#> GSM447444 1 0.0000 0.981 1.000 0.000
#> GSM447448 1 0.0000 0.981 1.000 0.000
#> GSM447449 2 0.0000 0.981 0.000 1.000
#> GSM447450 1 0.0000 0.981 1.000 0.000
#> GSM447452 2 0.0000 0.981 0.000 1.000
#> GSM447458 2 0.0000 0.981 0.000 1.000
#> GSM447461 2 0.0000 0.981 0.000 1.000
#> GSM447464 1 0.0000 0.981 1.000 0.000
#> GSM447468 1 0.0000 0.981 1.000 0.000
#> GSM447472 1 0.0000 0.981 1.000 0.000
#> GSM447400 1 0.0000 0.981 1.000 0.000
#> GSM447402 2 0.0000 0.981 0.000 1.000
#> GSM447403 1 0.0000 0.981 1.000 0.000
#> GSM447405 1 0.7219 0.745 0.800 0.200
#> GSM447418 2 0.0000 0.981 0.000 1.000
#> GSM447422 2 0.0000 0.981 0.000 1.000
#> GSM447424 2 0.0000 0.981 0.000 1.000
#> GSM447427 2 0.0000 0.981 0.000 1.000
#> GSM447428 2 0.7219 0.746 0.200 0.800
#> GSM447429 1 0.0000 0.981 1.000 0.000
#> GSM447431 2 0.0000 0.981 0.000 1.000
#> GSM447432 2 0.0000 0.981 0.000 1.000
#> GSM447434 1 0.0000 0.981 1.000 0.000
#> GSM447442 2 0.0000 0.981 0.000 1.000
#> GSM447451 2 0.0000 0.981 0.000 1.000
#> GSM447462 1 0.1184 0.968 0.984 0.016
#> GSM447463 1 0.0000 0.981 1.000 0.000
#> GSM447467 2 0.0938 0.970 0.012 0.988
#> GSM447469 2 0.0000 0.981 0.000 1.000
#> GSM447473 1 0.0000 0.981 1.000 0.000
#> GSM447404 1 0.0000 0.981 1.000 0.000
#> GSM447406 2 0.0000 0.981 0.000 1.000
#> GSM447407 2 0.0000 0.981 0.000 1.000
#> GSM447409 1 0.0000 0.981 1.000 0.000
#> GSM447412 2 0.0000 0.981 0.000 1.000
#> GSM447426 2 0.0000 0.981 0.000 1.000
#> GSM447433 1 0.2043 0.953 0.968 0.032
#> GSM447439 2 0.0000 0.981 0.000 1.000
#> GSM447441 2 0.0000 0.981 0.000 1.000
#> GSM447443 1 0.0000 0.981 1.000 0.000
#> GSM447445 1 0.0000 0.981 1.000 0.000
#> GSM447446 1 0.0000 0.981 1.000 0.000
#> GSM447453 1 0.0000 0.981 1.000 0.000
#> GSM447455 2 0.0000 0.981 0.000 1.000
#> GSM447456 2 0.7219 0.746 0.200 0.800
#> GSM447459 2 0.0000 0.981 0.000 1.000
#> GSM447466 1 0.0000 0.981 1.000 0.000
#> GSM447470 1 0.0000 0.981 1.000 0.000
#> GSM447474 1 0.0672 0.975 0.992 0.008
#> GSM447475 2 0.0000 0.981 0.000 1.000
#> GSM447398 2 0.0000 0.981 0.000 1.000
#> GSM447399 2 0.0000 0.981 0.000 1.000
#> GSM447408 2 0.0000 0.981 0.000 1.000
#> GSM447410 2 0.0000 0.981 0.000 1.000
#> GSM447414 2 0.0000 0.981 0.000 1.000
#> GSM447417 2 0.0000 0.981 0.000 1.000
#> GSM447419 1 0.9358 0.450 0.648 0.352
#> GSM447420 2 0.9710 0.329 0.400 0.600
#> GSM447421 1 0.0000 0.981 1.000 0.000
#> GSM447423 2 0.0000 0.981 0.000 1.000
#> GSM447436 1 0.0000 0.981 1.000 0.000
#> GSM447437 1 0.0000 0.981 1.000 0.000
#> GSM447438 2 0.0000 0.981 0.000 1.000
#> GSM447447 1 0.0000 0.981 1.000 0.000
#> GSM447454 2 0.0000 0.981 0.000 1.000
#> GSM447457 2 0.0000 0.981 0.000 1.000
#> GSM447460 2 0.0000 0.981 0.000 1.000
#> GSM447465 2 0.0000 0.981 0.000 1.000
#> GSM447471 1 0.0000 0.981 1.000 0.000
#> GSM447476 2 0.0000 0.981 0.000 1.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM447401 3 0.5098 0.8861 0.000 0.248 0.752
#> GSM447411 1 0.0000 0.9703 1.000 0.000 0.000
#> GSM447413 2 0.3412 0.7591 0.000 0.876 0.124
#> GSM447415 1 0.0000 0.9703 1.000 0.000 0.000
#> GSM447416 2 0.5968 0.5208 0.000 0.636 0.364
#> GSM447425 3 0.5968 0.8804 0.000 0.364 0.636
#> GSM447430 2 0.0237 0.8317 0.000 0.996 0.004
#> GSM447435 1 0.0000 0.9703 1.000 0.000 0.000
#> GSM447440 1 0.0000 0.9703 1.000 0.000 0.000
#> GSM447444 1 0.0000 0.9703 1.000 0.000 0.000
#> GSM447448 1 0.0000 0.9703 1.000 0.000 0.000
#> GSM447449 2 0.0829 0.8344 0.004 0.984 0.012
#> GSM447450 1 0.0237 0.9677 0.996 0.004 0.000
#> GSM447452 3 0.5968 0.8804 0.000 0.364 0.636
#> GSM447458 2 0.0592 0.8341 0.012 0.988 0.000
#> GSM447461 2 0.0592 0.8341 0.012 0.988 0.000
#> GSM447464 1 0.0000 0.9703 1.000 0.000 0.000
#> GSM447468 1 0.0000 0.9703 1.000 0.000 0.000
#> GSM447472 1 0.0000 0.9703 1.000 0.000 0.000
#> GSM447400 1 0.0000 0.9703 1.000 0.000 0.000
#> GSM447402 2 0.0000 0.8330 0.000 1.000 0.000
#> GSM447403 1 0.0000 0.9703 1.000 0.000 0.000
#> GSM447405 1 0.3412 0.8186 0.876 0.124 0.000
#> GSM447418 2 0.5968 0.5208 0.000 0.636 0.364
#> GSM447422 2 0.5968 0.5208 0.000 0.636 0.364
#> GSM447424 2 0.5968 0.5208 0.000 0.636 0.364
#> GSM447427 2 0.5968 0.5208 0.000 0.636 0.364
#> GSM447428 1 0.8047 0.3589 0.632 0.256 0.112
#> GSM447429 1 0.0237 0.9676 0.996 0.000 0.004
#> GSM447431 2 0.2229 0.8147 0.012 0.944 0.044
#> GSM447432 2 0.0592 0.8341 0.012 0.988 0.000
#> GSM447434 1 0.0000 0.9703 1.000 0.000 0.000
#> GSM447442 2 0.0592 0.8341 0.012 0.988 0.000
#> GSM447451 2 0.0829 0.8341 0.012 0.984 0.004
#> GSM447462 1 0.0000 0.9703 1.000 0.000 0.000
#> GSM447463 1 0.0000 0.9703 1.000 0.000 0.000
#> GSM447467 2 0.5591 0.3065 0.304 0.696 0.000
#> GSM447469 2 0.0661 0.8348 0.004 0.988 0.008
#> GSM447473 1 0.0000 0.9703 1.000 0.000 0.000
#> GSM447404 1 0.0000 0.9703 1.000 0.000 0.000
#> GSM447406 2 0.0237 0.8317 0.000 0.996 0.004
#> GSM447407 2 0.0892 0.8197 0.000 0.980 0.020
#> GSM447409 1 0.0592 0.9614 0.988 0.012 0.000
#> GSM447412 2 0.5968 0.5208 0.000 0.636 0.364
#> GSM447426 3 0.5098 0.8861 0.000 0.248 0.752
#> GSM447433 1 0.1964 0.9165 0.944 0.056 0.000
#> GSM447439 2 0.0237 0.8317 0.000 0.996 0.004
#> GSM447441 2 0.0829 0.8341 0.012 0.984 0.004
#> GSM447443 1 0.0000 0.9703 1.000 0.000 0.000
#> GSM447445 1 0.0000 0.9703 1.000 0.000 0.000
#> GSM447446 1 0.0592 0.9614 0.988 0.012 0.000
#> GSM447453 1 0.0424 0.9645 0.992 0.008 0.000
#> GSM447455 2 0.0592 0.8341 0.012 0.988 0.000
#> GSM447456 2 0.5988 0.0593 0.368 0.632 0.000
#> GSM447459 2 0.0237 0.8317 0.000 0.996 0.004
#> GSM447466 1 0.0000 0.9703 1.000 0.000 0.000
#> GSM447470 1 0.0000 0.9703 1.000 0.000 0.000
#> GSM447474 1 0.0000 0.9703 1.000 0.000 0.000
#> GSM447475 2 0.0592 0.8341 0.012 0.988 0.000
#> GSM447398 2 0.0424 0.8341 0.008 0.992 0.000
#> GSM447399 2 0.0661 0.8348 0.004 0.988 0.008
#> GSM447408 2 0.0000 0.8330 0.000 1.000 0.000
#> GSM447410 2 0.0000 0.8330 0.000 1.000 0.000
#> GSM447414 2 0.5650 0.5764 0.000 0.688 0.312
#> GSM447417 2 0.0000 0.8330 0.000 1.000 0.000
#> GSM447419 1 0.0237 0.9676 0.996 0.000 0.004
#> GSM447420 1 0.5774 0.5901 0.748 0.232 0.020
#> GSM447421 1 0.0424 0.9655 0.992 0.000 0.008
#> GSM447423 2 0.5968 0.5208 0.000 0.636 0.364
#> GSM447436 1 0.0424 0.9645 0.992 0.008 0.000
#> GSM447437 1 0.0000 0.9703 1.000 0.000 0.000
#> GSM447438 2 0.0000 0.8330 0.000 1.000 0.000
#> GSM447447 1 0.0000 0.9703 1.000 0.000 0.000
#> GSM447454 2 0.1482 0.8290 0.012 0.968 0.020
#> GSM447457 2 0.3539 0.7716 0.012 0.888 0.100
#> GSM447460 2 0.0829 0.8344 0.004 0.984 0.012
#> GSM447465 2 0.3500 0.7629 0.004 0.880 0.116
#> GSM447471 1 0.0000 0.9703 1.000 0.000 0.000
#> GSM447476 2 0.0892 0.8177 0.020 0.980 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM447401 3 0.3870 0.3569 0.000 0.004 0.788 0.208
#> GSM447411 1 0.0469 0.9502 0.988 0.000 0.000 0.012
#> GSM447413 3 0.5948 0.7802 0.000 0.160 0.696 0.144
#> GSM447415 1 0.0469 0.9502 0.988 0.000 0.000 0.012
#> GSM447416 3 0.5759 0.8031 0.000 0.232 0.688 0.080
#> GSM447425 4 0.4535 0.4963 0.000 0.004 0.292 0.704
#> GSM447430 4 0.4621 0.7325 0.000 0.284 0.008 0.708
#> GSM447435 1 0.0592 0.9495 0.984 0.000 0.000 0.016
#> GSM447440 1 0.0336 0.9525 0.992 0.000 0.000 0.008
#> GSM447444 1 0.1022 0.9500 0.968 0.000 0.000 0.032
#> GSM447448 1 0.0469 0.9518 0.988 0.000 0.000 0.012
#> GSM447449 2 0.2760 0.7615 0.000 0.872 0.000 0.128
#> GSM447450 1 0.0188 0.9519 0.996 0.000 0.000 0.004
#> GSM447452 4 0.4632 0.4912 0.000 0.004 0.308 0.688
#> GSM447458 2 0.0336 0.8278 0.000 0.992 0.000 0.008
#> GSM447461 2 0.0000 0.8273 0.000 1.000 0.000 0.000
#> GSM447464 1 0.1474 0.9463 0.948 0.000 0.000 0.052
#> GSM447468 1 0.0707 0.9515 0.980 0.000 0.000 0.020
#> GSM447472 1 0.1716 0.9433 0.936 0.000 0.000 0.064
#> GSM447400 1 0.1867 0.9400 0.928 0.000 0.000 0.072
#> GSM447402 2 0.5000 -0.3258 0.000 0.504 0.000 0.496
#> GSM447403 1 0.0469 0.9502 0.988 0.000 0.000 0.012
#> GSM447405 1 0.0817 0.9499 0.976 0.000 0.000 0.024
#> GSM447418 3 0.5963 0.7975 0.000 0.196 0.688 0.116
#> GSM447422 3 0.5693 0.8016 0.000 0.240 0.688 0.072
#> GSM447424 3 0.5897 0.7859 0.000 0.164 0.700 0.136
#> GSM447427 3 0.5491 0.7939 0.000 0.260 0.688 0.052
#> GSM447428 1 0.6232 0.0256 0.484 0.008 0.472 0.036
#> GSM447429 1 0.1118 0.9507 0.964 0.000 0.000 0.036
#> GSM447431 2 0.3895 0.7439 0.000 0.832 0.036 0.132
#> GSM447432 2 0.0000 0.8273 0.000 1.000 0.000 0.000
#> GSM447434 1 0.1716 0.9433 0.936 0.000 0.000 0.064
#> GSM447442 2 0.1389 0.8158 0.000 0.952 0.000 0.048
#> GSM447451 2 0.0469 0.8238 0.000 0.988 0.000 0.012
#> GSM447462 1 0.1637 0.9437 0.940 0.000 0.000 0.060
#> GSM447463 1 0.1302 0.9479 0.956 0.000 0.000 0.044
#> GSM447467 2 0.5325 0.4626 0.204 0.728 0.000 0.068
#> GSM447469 2 0.3726 0.6805 0.000 0.788 0.000 0.212
#> GSM447473 1 0.0707 0.9507 0.980 0.000 0.000 0.020
#> GSM447404 1 0.0592 0.9497 0.984 0.000 0.000 0.016
#> GSM447406 4 0.3528 0.7601 0.000 0.192 0.000 0.808
#> GSM447407 4 0.3444 0.7551 0.000 0.184 0.000 0.816
#> GSM447409 1 0.0779 0.9512 0.980 0.000 0.004 0.016
#> GSM447412 3 0.5088 0.7730 0.000 0.288 0.688 0.024
#> GSM447426 3 0.3870 0.3569 0.000 0.004 0.788 0.208
#> GSM447433 1 0.0707 0.9509 0.980 0.000 0.000 0.020
#> GSM447439 4 0.4420 0.7634 0.000 0.240 0.012 0.748
#> GSM447441 2 0.1284 0.8255 0.000 0.964 0.012 0.024
#> GSM447443 1 0.1211 0.9502 0.960 0.000 0.000 0.040
#> GSM447445 1 0.0707 0.9520 0.980 0.000 0.000 0.020
#> GSM447446 1 0.0592 0.9495 0.984 0.000 0.000 0.016
#> GSM447453 1 0.0592 0.9495 0.984 0.000 0.000 0.016
#> GSM447455 2 0.0592 0.8280 0.000 0.984 0.000 0.016
#> GSM447456 2 0.5003 0.5465 0.148 0.768 0.000 0.084
#> GSM447459 4 0.4621 0.7325 0.000 0.284 0.008 0.708
#> GSM447466 1 0.1118 0.9500 0.964 0.000 0.000 0.036
#> GSM447470 1 0.1867 0.9400 0.928 0.000 0.000 0.072
#> GSM447474 1 0.1867 0.9400 0.928 0.000 0.000 0.072
#> GSM447475 2 0.0707 0.8191 0.000 0.980 0.000 0.020
#> GSM447398 2 0.0469 0.8277 0.000 0.988 0.000 0.012
#> GSM447399 2 0.2647 0.7703 0.000 0.880 0.000 0.120
#> GSM447408 2 0.4679 0.2630 0.000 0.648 0.000 0.352
#> GSM447410 2 0.0921 0.8238 0.000 0.972 0.000 0.028
#> GSM447414 3 0.5902 0.7834 0.000 0.160 0.700 0.140
#> GSM447417 4 0.4454 0.6990 0.000 0.308 0.000 0.692
#> GSM447419 1 0.1792 0.9417 0.932 0.000 0.000 0.068
#> GSM447420 1 0.5607 0.6924 0.716 0.004 0.208 0.072
#> GSM447421 1 0.1557 0.9452 0.944 0.000 0.000 0.056
#> GSM447423 3 0.4477 0.7496 0.000 0.312 0.688 0.000
#> GSM447436 1 0.0592 0.9495 0.984 0.000 0.000 0.016
#> GSM447437 1 0.1389 0.9476 0.952 0.000 0.000 0.048
#> GSM447438 2 0.0921 0.8239 0.000 0.972 0.000 0.028
#> GSM447447 1 0.1792 0.9416 0.932 0.000 0.000 0.068
#> GSM447454 2 0.0657 0.8258 0.000 0.984 0.012 0.004
#> GSM447457 2 0.1474 0.7968 0.000 0.948 0.052 0.000
#> GSM447460 2 0.3708 0.7335 0.000 0.832 0.020 0.148
#> GSM447465 3 0.6855 0.6605 0.000 0.292 0.572 0.136
#> GSM447471 1 0.0336 0.9512 0.992 0.000 0.000 0.008
#> GSM447476 2 0.3942 0.5844 0.000 0.764 0.000 0.236
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM447401 5 0.3612 0.645 0.000 0.000 0.228 0.008 0.764
#> GSM447411 1 0.4003 0.725 0.704 0.000 0.000 0.288 0.008
#> GSM447413 3 0.0290 0.644 0.000 0.008 0.992 0.000 0.000
#> GSM447415 1 0.5850 0.657 0.476 0.000 0.000 0.428 0.096
#> GSM447416 3 0.2648 0.731 0.000 0.152 0.848 0.000 0.000
#> GSM447425 5 0.6276 0.477 0.012 0.068 0.024 0.324 0.572
#> GSM447430 4 0.6040 0.914 0.000 0.156 0.284 0.560 0.000
#> GSM447435 1 0.3766 0.725 0.728 0.004 0.000 0.268 0.000
#> GSM447440 1 0.2812 0.725 0.876 0.024 0.000 0.096 0.004
#> GSM447444 1 0.4879 0.717 0.716 0.004 0.000 0.200 0.080
#> GSM447448 1 0.3250 0.728 0.820 0.004 0.000 0.168 0.008
#> GSM447449 2 0.6261 0.456 0.156 0.488 0.356 0.000 0.000
#> GSM447450 1 0.5546 0.671 0.648 0.176 0.000 0.176 0.000
#> GSM447452 5 0.5831 0.485 0.000 0.068 0.020 0.324 0.588
#> GSM447458 2 0.3044 0.742 0.148 0.840 0.004 0.008 0.000
#> GSM447461 2 0.2732 0.739 0.160 0.840 0.000 0.000 0.000
#> GSM447464 1 0.1124 0.709 0.960 0.004 0.000 0.036 0.000
#> GSM447468 1 0.5622 0.673 0.508 0.000 0.000 0.416 0.076
#> GSM447472 1 0.1857 0.721 0.928 0.004 0.000 0.060 0.008
#> GSM447400 1 0.2911 0.627 0.852 0.008 0.000 0.004 0.136
#> GSM447402 2 0.6670 -0.429 0.012 0.500 0.060 0.384 0.044
#> GSM447403 1 0.5431 0.679 0.516 0.000 0.000 0.424 0.060
#> GSM447405 1 0.4138 0.706 0.616 0.000 0.000 0.384 0.000
#> GSM447418 3 0.1732 0.723 0.000 0.080 0.920 0.000 0.000
#> GSM447422 3 0.2813 0.726 0.000 0.168 0.832 0.000 0.000
#> GSM447424 3 0.1478 0.715 0.000 0.064 0.936 0.000 0.000
#> GSM447427 3 0.3074 0.711 0.000 0.196 0.804 0.000 0.000
#> GSM447428 3 0.8563 -0.241 0.268 0.004 0.336 0.216 0.176
#> GSM447429 1 0.7115 0.504 0.532 0.000 0.120 0.080 0.268
#> GSM447431 2 0.6692 0.372 0.160 0.468 0.360 0.008 0.004
#> GSM447432 2 0.2890 0.740 0.160 0.836 0.004 0.000 0.000
#> GSM447434 1 0.3216 0.652 0.852 0.012 0.000 0.020 0.116
#> GSM447442 2 0.3804 0.735 0.160 0.796 0.044 0.000 0.000
#> GSM447451 2 0.2773 0.739 0.164 0.836 0.000 0.000 0.000
#> GSM447462 1 0.4283 0.550 0.780 0.080 0.000 0.004 0.136
#> GSM447463 1 0.1484 0.709 0.944 0.008 0.000 0.048 0.000
#> GSM447467 2 0.4946 0.610 0.300 0.648 0.000 0.000 0.052
#> GSM447469 2 0.7960 0.334 0.120 0.400 0.340 0.136 0.004
#> GSM447473 1 0.5889 0.655 0.472 0.000 0.000 0.428 0.100
#> GSM447404 1 0.5889 0.655 0.472 0.000 0.000 0.428 0.100
#> GSM447406 4 0.6681 0.921 0.000 0.176 0.256 0.544 0.024
#> GSM447407 4 0.6846 0.882 0.000 0.196 0.220 0.548 0.036
#> GSM447409 1 0.4425 0.707 0.600 0.000 0.000 0.392 0.008
#> GSM447412 3 0.3210 0.696 0.000 0.212 0.788 0.000 0.000
#> GSM447426 5 0.3612 0.645 0.000 0.000 0.228 0.008 0.764
#> GSM447433 1 0.4963 0.701 0.608 0.040 0.000 0.352 0.000
#> GSM447439 4 0.6040 0.914 0.000 0.156 0.284 0.560 0.000
#> GSM447441 2 0.3599 0.741 0.160 0.812 0.020 0.008 0.000
#> GSM447443 1 0.5533 0.683 0.580 0.000 0.000 0.336 0.084
#> GSM447445 1 0.1908 0.723 0.908 0.000 0.000 0.092 0.000
#> GSM447446 1 0.4138 0.707 0.616 0.000 0.000 0.384 0.000
#> GSM447453 1 0.4481 0.700 0.576 0.000 0.000 0.416 0.008
#> GSM447455 2 0.3123 0.740 0.160 0.828 0.012 0.000 0.000
#> GSM447456 2 0.3863 0.514 0.200 0.772 0.000 0.028 0.000
#> GSM447459 4 0.6063 0.924 0.000 0.176 0.256 0.568 0.000
#> GSM447466 1 0.1628 0.714 0.936 0.000 0.000 0.056 0.008
#> GSM447470 1 0.3264 0.626 0.840 0.024 0.000 0.004 0.132
#> GSM447474 1 0.3340 0.625 0.840 0.032 0.000 0.004 0.124
#> GSM447475 2 0.3074 0.728 0.196 0.804 0.000 0.000 0.000
#> GSM447398 2 0.0510 0.638 0.000 0.984 0.000 0.016 0.000
#> GSM447399 2 0.5879 0.591 0.148 0.612 0.236 0.004 0.000
#> GSM447408 2 0.4572 0.216 0.000 0.684 0.036 0.280 0.000
#> GSM447410 2 0.1300 0.624 0.000 0.956 0.016 0.028 0.000
#> GSM447414 3 0.1341 0.708 0.000 0.056 0.944 0.000 0.000
#> GSM447417 4 0.6211 0.848 0.000 0.256 0.176 0.564 0.004
#> GSM447419 1 0.6994 0.518 0.552 0.000 0.120 0.076 0.252
#> GSM447420 1 0.6700 0.338 0.540 0.000 0.260 0.024 0.176
#> GSM447421 1 0.6686 0.492 0.564 0.000 0.120 0.048 0.268
#> GSM447423 3 0.4042 0.675 0.000 0.212 0.756 0.000 0.032
#> GSM447436 1 0.4150 0.709 0.612 0.000 0.000 0.388 0.000
#> GSM447437 1 0.1430 0.712 0.944 0.004 0.000 0.052 0.000
#> GSM447438 2 0.2983 0.587 0.000 0.868 0.056 0.076 0.000
#> GSM447447 1 0.0613 0.700 0.984 0.004 0.000 0.004 0.008
#> GSM447454 2 0.5162 0.662 0.160 0.692 0.148 0.000 0.000
#> GSM447457 2 0.4573 0.701 0.164 0.744 0.092 0.000 0.000
#> GSM447460 3 0.6342 -0.235 0.120 0.364 0.504 0.012 0.000
#> GSM447465 3 0.2284 0.709 0.004 0.096 0.896 0.004 0.000
#> GSM447471 1 0.4507 0.705 0.580 0.004 0.000 0.412 0.004
#> GSM447476 2 0.4805 0.474 0.120 0.764 0.016 0.096 0.004
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM447401 5 0.0000 0.98365 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM447411 1 0.3986 -0.05090 0.532 0.004 0.000 0.000 0.000 0.464
#> GSM447413 3 0.2053 0.84369 0.000 0.004 0.888 0.108 0.000 0.000
#> GSM447415 1 0.0146 0.84889 0.996 0.004 0.000 0.000 0.000 0.000
#> GSM447416 3 0.0000 0.88668 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM447425 5 0.0632 0.98341 0.000 0.000 0.000 0.024 0.976 0.000
#> GSM447430 4 0.0458 0.76519 0.000 0.000 0.016 0.984 0.000 0.000
#> GSM447435 6 0.3804 0.37525 0.424 0.000 0.000 0.000 0.000 0.576
#> GSM447440 6 0.2300 0.82866 0.144 0.000 0.000 0.000 0.000 0.856
#> GSM447444 1 0.4338 0.24921 0.560 0.004 0.000 0.016 0.000 0.420
#> GSM447448 6 0.2964 0.75977 0.204 0.000 0.000 0.004 0.000 0.792
#> GSM447449 3 0.2176 0.86023 0.000 0.024 0.896 0.080 0.000 0.000
#> GSM447450 6 0.2838 0.80390 0.188 0.000 0.000 0.004 0.000 0.808
#> GSM447452 5 0.0632 0.98341 0.000 0.000 0.000 0.024 0.976 0.000
#> GSM447458 2 0.0692 0.84261 0.000 0.976 0.020 0.004 0.000 0.000
#> GSM447461 2 0.0146 0.84200 0.000 0.996 0.004 0.000 0.000 0.000
#> GSM447464 6 0.1327 0.87813 0.064 0.000 0.000 0.000 0.000 0.936
#> GSM447468 1 0.0146 0.84889 0.996 0.004 0.000 0.000 0.000 0.000
#> GSM447472 6 0.2946 0.76523 0.176 0.000 0.000 0.012 0.000 0.812
#> GSM447400 6 0.0508 0.87406 0.012 0.004 0.000 0.000 0.000 0.984
#> GSM447402 4 0.3707 0.72249 0.000 0.136 0.080 0.784 0.000 0.000
#> GSM447403 1 0.0291 0.84897 0.992 0.004 0.000 0.000 0.000 0.004
#> GSM447405 1 0.1549 0.82699 0.936 0.000 0.000 0.020 0.000 0.044
#> GSM447418 3 0.0000 0.88668 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM447422 3 0.0260 0.88661 0.000 0.008 0.992 0.000 0.000 0.000
#> GSM447424 3 0.0000 0.88668 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM447427 3 0.0713 0.88331 0.000 0.028 0.972 0.000 0.000 0.000
#> GSM447428 1 0.5071 0.49416 0.616 0.000 0.300 0.016 0.000 0.068
#> GSM447429 6 0.1411 0.87426 0.060 0.000 0.004 0.000 0.000 0.936
#> GSM447431 3 0.3881 0.31486 0.000 0.396 0.600 0.004 0.000 0.000
#> GSM447432 2 0.1141 0.83859 0.000 0.948 0.052 0.000 0.000 0.000
#> GSM447434 6 0.1411 0.87162 0.060 0.004 0.000 0.000 0.000 0.936
#> GSM447442 2 0.2631 0.72208 0.000 0.820 0.180 0.000 0.000 0.000
#> GSM447451 2 0.0146 0.84200 0.000 0.996 0.004 0.000 0.000 0.000
#> GSM447462 6 0.1563 0.84684 0.012 0.056 0.000 0.000 0.000 0.932
#> GSM447463 6 0.1327 0.87813 0.064 0.000 0.000 0.000 0.000 0.936
#> GSM447467 2 0.3998 -0.00469 0.000 0.504 0.004 0.000 0.000 0.492
#> GSM447469 4 0.3629 0.60692 0.000 0.012 0.276 0.712 0.000 0.000
#> GSM447473 1 0.0146 0.84889 0.996 0.004 0.000 0.000 0.000 0.000
#> GSM447404 1 0.0146 0.84889 0.996 0.004 0.000 0.000 0.000 0.000
#> GSM447406 4 0.0458 0.76519 0.000 0.000 0.016 0.984 0.000 0.000
#> GSM447407 4 0.0458 0.76519 0.000 0.000 0.016 0.984 0.000 0.000
#> GSM447409 1 0.0508 0.84705 0.984 0.000 0.000 0.004 0.000 0.012
#> GSM447412 3 0.2260 0.82032 0.000 0.140 0.860 0.000 0.000 0.000
#> GSM447426 5 0.0000 0.98365 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM447433 1 0.1480 0.82951 0.940 0.000 0.000 0.020 0.000 0.040
#> GSM447439 4 0.0458 0.76519 0.000 0.000 0.016 0.984 0.000 0.000
#> GSM447441 2 0.1700 0.82022 0.000 0.916 0.080 0.004 0.000 0.000
#> GSM447443 1 0.2311 0.79341 0.880 0.000 0.000 0.016 0.000 0.104
#> GSM447445 6 0.2003 0.86290 0.116 0.000 0.000 0.000 0.000 0.884
#> GSM447446 1 0.1003 0.84138 0.964 0.000 0.000 0.016 0.000 0.020
#> GSM447453 1 0.0000 0.84865 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM447455 2 0.1644 0.82310 0.000 0.920 0.076 0.004 0.000 0.000
#> GSM447456 2 0.1493 0.81212 0.000 0.936 0.004 0.004 0.000 0.056
#> GSM447459 4 0.0458 0.76519 0.000 0.000 0.016 0.984 0.000 0.000
#> GSM447466 6 0.1327 0.87813 0.064 0.000 0.000 0.000 0.000 0.936
#> GSM447470 6 0.0508 0.87406 0.012 0.004 0.000 0.000 0.000 0.984
#> GSM447474 6 0.0508 0.87406 0.012 0.004 0.000 0.000 0.000 0.984
#> GSM447475 2 0.0291 0.84122 0.000 0.992 0.004 0.000 0.000 0.004
#> GSM447398 2 0.0291 0.83999 0.000 0.992 0.004 0.004 0.000 0.000
#> GSM447399 3 0.1082 0.88317 0.000 0.040 0.956 0.004 0.000 0.000
#> GSM447408 4 0.3975 0.45788 0.000 0.392 0.008 0.600 0.000 0.000
#> GSM447410 2 0.3830 0.09560 0.000 0.620 0.004 0.376 0.000 0.000
#> GSM447414 3 0.0291 0.88666 0.000 0.004 0.992 0.004 0.000 0.000
#> GSM447417 4 0.2003 0.75940 0.000 0.044 0.044 0.912 0.000 0.000
#> GSM447419 1 0.5911 0.46695 0.532 0.000 0.168 0.016 0.000 0.284
#> GSM447420 6 0.3499 0.43089 0.000 0.000 0.320 0.000 0.000 0.680
#> GSM447421 6 0.0405 0.87019 0.008 0.000 0.004 0.000 0.000 0.988
#> GSM447423 3 0.2219 0.82168 0.000 0.136 0.864 0.000 0.000 0.000
#> GSM447436 1 0.0622 0.84799 0.980 0.000 0.000 0.012 0.000 0.008
#> GSM447437 6 0.1327 0.87813 0.064 0.000 0.000 0.000 0.000 0.936
#> GSM447438 4 0.3930 0.41122 0.000 0.420 0.004 0.576 0.000 0.000
#> GSM447447 6 0.0458 0.87541 0.016 0.000 0.000 0.000 0.000 0.984
#> GSM447454 3 0.3221 0.66936 0.000 0.264 0.736 0.000 0.000 0.000
#> GSM447457 2 0.1075 0.84004 0.000 0.952 0.048 0.000 0.000 0.000
#> GSM447460 3 0.2491 0.83686 0.000 0.020 0.868 0.112 0.000 0.000
#> GSM447465 3 0.0405 0.88669 0.000 0.008 0.988 0.004 0.000 0.000
#> GSM447471 1 0.0260 0.84892 0.992 0.000 0.000 0.000 0.000 0.008
#> GSM447476 4 0.5927 0.22125 0.000 0.396 0.004 0.420 0.000 0.180
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 gender(p) agent(p) k
#> SD:mclust 77 0.717 0.1995 2
#> SD:mclust 76 0.438 0.0317 3
#> SD:mclust 71 0.313 0.0797 4
#> SD:mclust 67 0.378 0.0772 5
#> SD:mclust 67 0.731 0.1808 6
If matrix rows can be associated to genes, consider to use functional_enrichment(res,
...)
to perform function enrichment for the signature genes. See this vignette for more detailed explanations.
The object with results only for a single top-value method and a single partition method can be extracted as:
res = res_list["SD", "NMF"]
# you can also extract it by
# res = res_list["SD:NMF"]
A summary of res
and all the functions that can be applied to it:
res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#> On a matrix with 51941 rows and 79 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'SD' method.
#> Subgroups are detected by 'NMF' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 2.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
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.973 0.955 0.980 0.5036 0.498 0.498
#> 3 3 0.741 0.869 0.929 0.2850 0.783 0.591
#> 4 4 0.706 0.753 0.863 0.1067 0.859 0.628
#> 5 5 0.693 0.658 0.811 0.0584 0.888 0.642
#> 6 6 0.606 0.515 0.719 0.0514 0.982 0.930
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
#> GSM447401 2 0.0000 0.966 0.000 1.000
#> GSM447411 1 0.0000 0.994 1.000 0.000
#> GSM447413 2 0.0000 0.966 0.000 1.000
#> GSM447415 1 0.0000 0.994 1.000 0.000
#> GSM447416 2 0.0000 0.966 0.000 1.000
#> GSM447425 2 0.0000 0.966 0.000 1.000
#> GSM447430 2 0.0000 0.966 0.000 1.000
#> GSM447435 1 0.0000 0.994 1.000 0.000
#> GSM447440 1 0.0000 0.994 1.000 0.000
#> GSM447444 1 0.0000 0.994 1.000 0.000
#> GSM447448 1 0.0000 0.994 1.000 0.000
#> GSM447449 2 0.0000 0.966 0.000 1.000
#> GSM447450 1 0.0000 0.994 1.000 0.000
#> GSM447452 2 0.0000 0.966 0.000 1.000
#> GSM447458 2 0.0000 0.966 0.000 1.000
#> GSM447461 2 0.0000 0.966 0.000 1.000
#> GSM447464 1 0.0000 0.994 1.000 0.000
#> GSM447468 1 0.0000 0.994 1.000 0.000
#> GSM447472 1 0.0000 0.994 1.000 0.000
#> GSM447400 1 0.0000 0.994 1.000 0.000
#> GSM447402 2 0.1184 0.955 0.016 0.984
#> GSM447403 1 0.0000 0.994 1.000 0.000
#> GSM447405 1 0.0000 0.994 1.000 0.000
#> GSM447418 2 0.0000 0.966 0.000 1.000
#> GSM447422 2 0.0000 0.966 0.000 1.000
#> GSM447424 2 0.0000 0.966 0.000 1.000
#> GSM447427 2 0.0000 0.966 0.000 1.000
#> GSM447428 2 0.8081 0.691 0.248 0.752
#> GSM447429 1 0.0000 0.994 1.000 0.000
#> GSM447431 2 0.0000 0.966 0.000 1.000
#> GSM447432 2 0.0000 0.966 0.000 1.000
#> GSM447434 1 0.0000 0.994 1.000 0.000
#> GSM447442 2 0.0000 0.966 0.000 1.000
#> GSM447451 2 0.0938 0.958 0.012 0.988
#> GSM447462 1 0.0000 0.994 1.000 0.000
#> GSM447463 1 0.0000 0.994 1.000 0.000
#> GSM447467 2 0.8861 0.594 0.304 0.696
#> GSM447469 2 0.0000 0.966 0.000 1.000
#> GSM447473 1 0.0000 0.994 1.000 0.000
#> GSM447404 1 0.0000 0.994 1.000 0.000
#> GSM447406 2 0.0000 0.966 0.000 1.000
#> GSM447407 2 0.0000 0.966 0.000 1.000
#> GSM447409 1 0.0000 0.994 1.000 0.000
#> GSM447412 2 0.0000 0.966 0.000 1.000
#> GSM447426 2 0.0000 0.966 0.000 1.000
#> GSM447433 1 0.0000 0.994 1.000 0.000
#> GSM447439 2 0.0000 0.966 0.000 1.000
#> GSM447441 2 0.0000 0.966 0.000 1.000
#> GSM447443 1 0.0000 0.994 1.000 0.000
#> GSM447445 1 0.0000 0.994 1.000 0.000
#> GSM447446 1 0.0000 0.994 1.000 0.000
#> GSM447453 1 0.0000 0.994 1.000 0.000
#> GSM447455 2 0.0000 0.966 0.000 1.000
#> GSM447456 1 0.3584 0.926 0.932 0.068
#> GSM447459 2 0.0000 0.966 0.000 1.000
#> GSM447466 1 0.0000 0.994 1.000 0.000
#> GSM447470 1 0.0000 0.994 1.000 0.000
#> GSM447474 1 0.0000 0.994 1.000 0.000
#> GSM447475 2 0.7299 0.755 0.204 0.796
#> GSM447398 2 0.3584 0.910 0.068 0.932
#> GSM447399 2 0.0000 0.966 0.000 1.000
#> GSM447408 2 0.0000 0.966 0.000 1.000
#> GSM447410 2 0.0000 0.966 0.000 1.000
#> GSM447414 2 0.0000 0.966 0.000 1.000
#> GSM447417 2 0.0000 0.966 0.000 1.000
#> GSM447419 1 0.2236 0.960 0.964 0.036
#> GSM447420 2 0.9866 0.287 0.432 0.568
#> GSM447421 1 0.0000 0.994 1.000 0.000
#> GSM447423 2 0.0000 0.966 0.000 1.000
#> GSM447436 1 0.0000 0.994 1.000 0.000
#> GSM447437 1 0.0000 0.994 1.000 0.000
#> GSM447438 2 0.4815 0.875 0.104 0.896
#> GSM447447 1 0.0000 0.994 1.000 0.000
#> GSM447454 2 0.0000 0.966 0.000 1.000
#> GSM447457 2 0.0000 0.966 0.000 1.000
#> GSM447460 2 0.0000 0.966 0.000 1.000
#> GSM447465 2 0.0000 0.966 0.000 1.000
#> GSM447471 1 0.0000 0.994 1.000 0.000
#> GSM447476 1 0.4298 0.902 0.912 0.088
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM447401 3 0.0000 0.853 0.000 0.000 1.000
#> GSM447411 1 0.0000 0.976 1.000 0.000 0.000
#> GSM447413 3 0.0000 0.853 0.000 0.000 1.000
#> GSM447415 1 0.0000 0.976 1.000 0.000 0.000
#> GSM447416 3 0.3619 0.824 0.000 0.136 0.864
#> GSM447425 2 0.4235 0.822 0.000 0.824 0.176
#> GSM447430 2 0.1163 0.880 0.000 0.972 0.028
#> GSM447435 1 0.0000 0.976 1.000 0.000 0.000
#> GSM447440 1 0.0000 0.976 1.000 0.000 0.000
#> GSM447444 1 0.0747 0.963 0.984 0.000 0.016
#> GSM447448 1 0.0000 0.976 1.000 0.000 0.000
#> GSM447449 2 0.5058 0.772 0.000 0.756 0.244
#> GSM447450 1 0.0000 0.976 1.000 0.000 0.000
#> GSM447452 2 0.3941 0.835 0.000 0.844 0.156
#> GSM447458 2 0.3412 0.845 0.000 0.876 0.124
#> GSM447461 2 0.0747 0.883 0.016 0.984 0.000
#> GSM447464 1 0.0000 0.976 1.000 0.000 0.000
#> GSM447468 1 0.0000 0.976 1.000 0.000 0.000
#> GSM447472 1 0.0000 0.976 1.000 0.000 0.000
#> GSM447400 1 0.0000 0.976 1.000 0.000 0.000
#> GSM447402 2 0.5731 0.803 0.088 0.804 0.108
#> GSM447403 1 0.0000 0.976 1.000 0.000 0.000
#> GSM447405 1 0.0000 0.976 1.000 0.000 0.000
#> GSM447418 3 0.0237 0.854 0.000 0.004 0.996
#> GSM447422 3 0.1289 0.858 0.000 0.032 0.968
#> GSM447424 3 0.1643 0.857 0.000 0.044 0.956
#> GSM447427 3 0.1163 0.858 0.000 0.028 0.972
#> GSM447428 3 0.0747 0.851 0.016 0.000 0.984
#> GSM447429 1 0.4062 0.794 0.836 0.000 0.164
#> GSM447431 3 0.4796 0.733 0.000 0.220 0.780
#> GSM447432 2 0.3816 0.832 0.000 0.852 0.148
#> GSM447434 1 0.0000 0.976 1.000 0.000 0.000
#> GSM447442 2 0.4235 0.811 0.000 0.824 0.176
#> GSM447451 2 0.3039 0.864 0.044 0.920 0.036
#> GSM447462 1 0.0237 0.973 0.996 0.000 0.004
#> GSM447463 1 0.0000 0.976 1.000 0.000 0.000
#> GSM447467 1 0.3528 0.871 0.892 0.016 0.092
#> GSM447469 2 0.3816 0.832 0.000 0.852 0.148
#> GSM447473 1 0.0000 0.976 1.000 0.000 0.000
#> GSM447404 1 0.0000 0.976 1.000 0.000 0.000
#> GSM447406 2 0.0237 0.885 0.000 0.996 0.004
#> GSM447407 2 0.1031 0.881 0.000 0.976 0.024
#> GSM447409 1 0.0000 0.976 1.000 0.000 0.000
#> GSM447412 3 0.2711 0.850 0.000 0.088 0.912
#> GSM447426 3 0.0000 0.853 0.000 0.000 1.000
#> GSM447433 1 0.0237 0.973 0.996 0.004 0.000
#> GSM447439 2 0.0237 0.885 0.000 0.996 0.004
#> GSM447441 2 0.0892 0.880 0.000 0.980 0.020
#> GSM447443 1 0.0000 0.976 1.000 0.000 0.000
#> GSM447445 1 0.0000 0.976 1.000 0.000 0.000
#> GSM447446 1 0.3192 0.863 0.888 0.112 0.000
#> GSM447453 1 0.0000 0.976 1.000 0.000 0.000
#> GSM447455 2 0.0892 0.883 0.000 0.980 0.020
#> GSM447456 2 0.5835 0.519 0.340 0.660 0.000
#> GSM447459 2 0.0592 0.884 0.000 0.988 0.012
#> GSM447466 1 0.0000 0.976 1.000 0.000 0.000
#> GSM447470 1 0.0000 0.976 1.000 0.000 0.000
#> GSM447474 1 0.0000 0.976 1.000 0.000 0.000
#> GSM447475 2 0.4931 0.707 0.212 0.784 0.004
#> GSM447398 2 0.0237 0.885 0.004 0.996 0.000
#> GSM447399 2 0.1964 0.862 0.000 0.944 0.056
#> GSM447408 2 0.0000 0.885 0.000 1.000 0.000
#> GSM447410 2 0.0000 0.885 0.000 1.000 0.000
#> GSM447414 3 0.2356 0.855 0.000 0.072 0.928
#> GSM447417 2 0.0000 0.885 0.000 1.000 0.000
#> GSM447419 3 0.5216 0.641 0.260 0.000 0.740
#> GSM447420 3 0.5968 0.442 0.364 0.000 0.636
#> GSM447421 1 0.4842 0.698 0.776 0.000 0.224
#> GSM447423 3 0.2878 0.847 0.000 0.096 0.904
#> GSM447436 1 0.2356 0.908 0.928 0.072 0.000
#> GSM447437 1 0.0000 0.976 1.000 0.000 0.000
#> GSM447438 2 0.0000 0.885 0.000 1.000 0.000
#> GSM447447 1 0.0000 0.976 1.000 0.000 0.000
#> GSM447454 3 0.5926 0.603 0.000 0.356 0.644
#> GSM447457 3 0.5859 0.622 0.000 0.344 0.656
#> GSM447460 2 0.5254 0.539 0.000 0.736 0.264
#> GSM447465 3 0.5397 0.662 0.000 0.280 0.720
#> GSM447471 1 0.0000 0.976 1.000 0.000 0.000
#> GSM447476 2 0.3816 0.780 0.148 0.852 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM447401 3 0.1867 0.7318 0.000 0.000 0.928 0.072
#> GSM447411 1 0.0000 0.9514 1.000 0.000 0.000 0.000
#> GSM447413 3 0.1004 0.7593 0.000 0.004 0.972 0.024
#> GSM447415 1 0.0000 0.9514 1.000 0.000 0.000 0.000
#> GSM447416 3 0.4780 0.7542 0.000 0.096 0.788 0.116
#> GSM447425 4 0.3486 0.6637 0.000 0.000 0.188 0.812
#> GSM447430 4 0.1284 0.7341 0.000 0.024 0.012 0.964
#> GSM447435 1 0.0000 0.9514 1.000 0.000 0.000 0.000
#> GSM447440 1 0.0000 0.9514 1.000 0.000 0.000 0.000
#> GSM447444 1 0.0469 0.9479 0.988 0.000 0.012 0.000
#> GSM447448 1 0.0000 0.9514 1.000 0.000 0.000 0.000
#> GSM447449 2 0.5990 0.6182 0.000 0.692 0.164 0.144
#> GSM447450 1 0.0000 0.9514 1.000 0.000 0.000 0.000
#> GSM447452 4 0.3444 0.6660 0.000 0.000 0.184 0.816
#> GSM447458 2 0.0927 0.7603 0.000 0.976 0.016 0.008
#> GSM447461 2 0.3208 0.7635 0.004 0.848 0.000 0.148
#> GSM447464 1 0.0336 0.9493 0.992 0.000 0.008 0.000
#> GSM447468 1 0.0336 0.9493 0.992 0.000 0.008 0.000
#> GSM447472 1 0.0336 0.9493 0.992 0.000 0.008 0.000
#> GSM447400 1 0.0927 0.9378 0.976 0.016 0.008 0.000
#> GSM447402 4 0.4468 0.6583 0.020 0.164 0.016 0.800
#> GSM447403 1 0.0000 0.9514 1.000 0.000 0.000 0.000
#> GSM447405 1 0.4955 0.0762 0.556 0.000 0.000 0.444
#> GSM447418 3 0.3810 0.8052 0.000 0.188 0.804 0.008
#> GSM447422 3 0.4624 0.7043 0.000 0.340 0.660 0.000
#> GSM447424 3 0.3569 0.8044 0.000 0.196 0.804 0.000
#> GSM447427 3 0.4134 0.7856 0.000 0.260 0.740 0.000
#> GSM447428 3 0.2796 0.7639 0.092 0.016 0.892 0.000
#> GSM447429 1 0.0707 0.9427 0.980 0.000 0.020 0.000
#> GSM447431 2 0.1256 0.7547 0.000 0.964 0.028 0.008
#> GSM447432 2 0.0592 0.7581 0.000 0.984 0.016 0.000
#> GSM447434 1 0.0000 0.9514 1.000 0.000 0.000 0.000
#> GSM447442 2 0.0817 0.7541 0.000 0.976 0.024 0.000
#> GSM447451 2 0.3757 0.7566 0.020 0.828 0.000 0.152
#> GSM447462 1 0.2198 0.8795 0.920 0.072 0.008 0.000
#> GSM447463 1 0.0336 0.9493 0.992 0.000 0.008 0.000
#> GSM447467 2 0.4826 0.4589 0.264 0.716 0.020 0.000
#> GSM447469 4 0.4988 0.6017 0.000 0.288 0.020 0.692
#> GSM447473 1 0.0336 0.9493 0.992 0.000 0.008 0.000
#> GSM447404 1 0.0000 0.9514 1.000 0.000 0.000 0.000
#> GSM447406 4 0.3726 0.6268 0.000 0.212 0.000 0.788
#> GSM447407 4 0.0524 0.7333 0.000 0.008 0.004 0.988
#> GSM447409 1 0.0188 0.9497 0.996 0.000 0.000 0.004
#> GSM447412 3 0.4164 0.7879 0.000 0.264 0.736 0.000
#> GSM447426 3 0.1637 0.7392 0.000 0.000 0.940 0.060
#> GSM447433 4 0.4967 0.2083 0.452 0.000 0.000 0.548
#> GSM447439 4 0.2814 0.6977 0.000 0.132 0.000 0.868
#> GSM447441 2 0.3219 0.7551 0.000 0.836 0.000 0.164
#> GSM447443 1 0.0188 0.9505 0.996 0.000 0.004 0.000
#> GSM447445 1 0.0188 0.9497 0.996 0.000 0.000 0.004
#> GSM447446 4 0.4103 0.5848 0.256 0.000 0.000 0.744
#> GSM447453 1 0.0188 0.9497 0.996 0.000 0.000 0.004
#> GSM447455 2 0.1474 0.7770 0.000 0.948 0.000 0.052
#> GSM447456 2 0.5884 0.3700 0.364 0.592 0.000 0.044
#> GSM447459 4 0.1489 0.7326 0.000 0.044 0.004 0.952
#> GSM447466 1 0.0000 0.9514 1.000 0.000 0.000 0.000
#> GSM447470 1 0.0927 0.9397 0.976 0.016 0.008 0.000
#> GSM447474 1 0.0336 0.9478 0.992 0.008 0.000 0.000
#> GSM447475 2 0.4050 0.6888 0.144 0.820 0.000 0.036
#> GSM447398 2 0.3710 0.7374 0.004 0.804 0.000 0.192
#> GSM447399 2 0.3355 0.7594 0.000 0.836 0.004 0.160
#> GSM447408 4 0.4103 0.5719 0.000 0.256 0.000 0.744
#> GSM447410 2 0.5158 0.1758 0.004 0.524 0.000 0.472
#> GSM447414 3 0.4904 0.7890 0.000 0.216 0.744 0.040
#> GSM447417 4 0.1637 0.7296 0.000 0.060 0.000 0.940
#> GSM447419 3 0.5337 0.6070 0.260 0.044 0.696 0.000
#> GSM447420 3 0.5590 0.6317 0.244 0.064 0.692 0.000
#> GSM447421 1 0.2867 0.8444 0.884 0.012 0.104 0.000
#> GSM447423 3 0.4382 0.7617 0.000 0.296 0.704 0.000
#> GSM447436 1 0.5000 -0.1126 0.504 0.000 0.000 0.496
#> GSM447437 1 0.0000 0.9514 1.000 0.000 0.000 0.000
#> GSM447438 4 0.4509 0.5109 0.004 0.288 0.000 0.708
#> GSM447447 1 0.0188 0.9497 0.996 0.000 0.000 0.004
#> GSM447454 2 0.4130 0.7664 0.000 0.828 0.064 0.108
#> GSM447457 2 0.2814 0.6439 0.000 0.868 0.132 0.000
#> GSM447460 2 0.4088 0.7085 0.000 0.764 0.004 0.232
#> GSM447465 2 0.4019 0.5542 0.000 0.792 0.196 0.012
#> GSM447471 1 0.0000 0.9514 1.000 0.000 0.000 0.000
#> GSM447476 4 0.5746 0.4797 0.348 0.040 0.000 0.612
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM447401 3 0.2891 0.7361 0.000 0.000 0.824 0.000 0.176
#> GSM447411 1 0.0451 0.8934 0.988 0.008 0.000 0.000 0.004
#> GSM447413 3 0.3264 0.7719 0.000 0.020 0.836 0.004 0.140
#> GSM447415 1 0.0162 0.8932 0.996 0.000 0.000 0.000 0.004
#> GSM447416 3 0.2720 0.7758 0.000 0.020 0.880 0.096 0.004
#> GSM447425 5 0.1503 0.6526 0.000 0.020 0.020 0.008 0.952
#> GSM447430 4 0.4668 0.3467 0.000 0.008 0.008 0.600 0.384
#> GSM447435 1 0.0693 0.8926 0.980 0.008 0.000 0.000 0.012
#> GSM447440 1 0.1757 0.8771 0.936 0.048 0.000 0.004 0.012
#> GSM447444 1 0.5869 0.0158 0.484 0.428 0.004 0.000 0.084
#> GSM447448 1 0.1845 0.8693 0.928 0.056 0.000 0.000 0.016
#> GSM447449 2 0.4420 0.5106 0.000 0.712 0.016 0.012 0.260
#> GSM447450 1 0.0671 0.8928 0.980 0.016 0.004 0.000 0.000
#> GSM447452 5 0.2450 0.6381 0.000 0.000 0.052 0.048 0.900
#> GSM447458 2 0.3009 0.6672 0.016 0.876 0.000 0.028 0.080
#> GSM447461 4 0.4181 0.5791 0.000 0.240 0.016 0.736 0.008
#> GSM447464 1 0.1412 0.8868 0.952 0.036 0.008 0.000 0.004
#> GSM447468 1 0.0162 0.8939 0.996 0.000 0.004 0.000 0.000
#> GSM447472 1 0.2110 0.8502 0.912 0.072 0.000 0.000 0.016
#> GSM447400 1 0.1752 0.8809 0.936 0.052 0.004 0.004 0.004
#> GSM447402 5 0.4566 0.6134 0.032 0.172 0.012 0.016 0.768
#> GSM447403 1 0.0324 0.8931 0.992 0.004 0.000 0.000 0.004
#> GSM447405 1 0.5840 0.4474 0.636 0.016 0.000 0.112 0.236
#> GSM447418 2 0.4074 0.3817 0.000 0.636 0.364 0.000 0.000
#> GSM447422 2 0.2852 0.6499 0.000 0.828 0.172 0.000 0.000
#> GSM447424 3 0.1965 0.7949 0.000 0.096 0.904 0.000 0.000
#> GSM447427 3 0.2773 0.7653 0.000 0.164 0.836 0.000 0.000
#> GSM447428 3 0.2861 0.7782 0.076 0.016 0.884 0.000 0.024
#> GSM447429 1 0.0771 0.8942 0.976 0.004 0.020 0.000 0.000
#> GSM447431 4 0.4699 0.5771 0.000 0.236 0.016 0.716 0.032
#> GSM447432 2 0.3163 0.6859 0.000 0.864 0.012 0.092 0.032
#> GSM447434 1 0.0486 0.8939 0.988 0.004 0.000 0.004 0.004
#> GSM447442 2 0.2499 0.6790 0.000 0.908 0.040 0.016 0.036
#> GSM447451 4 0.4565 0.5933 0.044 0.196 0.008 0.748 0.004
#> GSM447462 1 0.3168 0.8185 0.856 0.116 0.008 0.016 0.004
#> GSM447463 1 0.1518 0.8844 0.944 0.048 0.004 0.000 0.004
#> GSM447467 2 0.1956 0.6759 0.052 0.928 0.012 0.000 0.008
#> GSM447469 2 0.6094 0.2620 0.000 0.572 0.064 0.036 0.328
#> GSM447473 1 0.0162 0.8938 0.996 0.004 0.000 0.000 0.000
#> GSM447404 1 0.0960 0.8924 0.972 0.016 0.004 0.000 0.008
#> GSM447406 4 0.2575 0.6508 0.000 0.012 0.004 0.884 0.100
#> GSM447407 5 0.3857 0.4085 0.000 0.000 0.000 0.312 0.688
#> GSM447409 1 0.0960 0.8918 0.972 0.016 0.000 0.004 0.008
#> GSM447412 3 0.3269 0.7935 0.000 0.096 0.848 0.056 0.000
#> GSM447426 3 0.2690 0.7495 0.000 0.000 0.844 0.000 0.156
#> GSM447433 1 0.5898 0.1284 0.512 0.028 0.012 0.024 0.424
#> GSM447439 4 0.3812 0.5881 0.000 0.020 0.004 0.780 0.196
#> GSM447441 4 0.3439 0.6101 0.000 0.188 0.008 0.800 0.004
#> GSM447443 1 0.1074 0.8924 0.968 0.016 0.012 0.000 0.004
#> GSM447445 1 0.1153 0.8909 0.964 0.024 0.008 0.000 0.004
#> GSM447446 5 0.4194 0.4751 0.260 0.016 0.000 0.004 0.720
#> GSM447453 1 0.1041 0.8915 0.964 0.004 0.000 0.000 0.032
#> GSM447455 2 0.2193 0.6912 0.000 0.900 0.008 0.092 0.000
#> GSM447456 4 0.5274 0.2854 0.336 0.040 0.000 0.612 0.012
#> GSM447459 4 0.3636 0.4862 0.000 0.000 0.000 0.728 0.272
#> GSM447466 1 0.0727 0.8928 0.980 0.012 0.004 0.000 0.004
#> GSM447470 1 0.3340 0.7771 0.824 0.156 0.016 0.000 0.004
#> GSM447474 1 0.2386 0.8664 0.916 0.048 0.016 0.012 0.008
#> GSM447475 2 0.5854 0.5197 0.092 0.652 0.016 0.232 0.008
#> GSM447398 4 0.3078 0.6642 0.000 0.132 0.004 0.848 0.016
#> GSM447399 4 0.4039 0.5368 0.000 0.268 0.008 0.720 0.004
#> GSM447408 4 0.2952 0.6383 0.000 0.020 0.008 0.868 0.104
#> GSM447410 4 0.1503 0.6661 0.000 0.020 0.008 0.952 0.020
#> GSM447414 3 0.4717 0.7216 0.000 0.144 0.736 0.120 0.000
#> GSM447417 5 0.6898 0.0904 0.000 0.336 0.008 0.236 0.420
#> GSM447419 3 0.5356 0.5125 0.272 0.064 0.652 0.000 0.012
#> GSM447420 3 0.4999 0.5702 0.228 0.048 0.708 0.008 0.008
#> GSM447421 1 0.3008 0.8312 0.868 0.036 0.092 0.000 0.004
#> GSM447423 3 0.2624 0.7932 0.000 0.116 0.872 0.012 0.000
#> GSM447436 1 0.4908 0.2513 0.560 0.020 0.000 0.004 0.416
#> GSM447437 1 0.0671 0.8917 0.980 0.016 0.000 0.000 0.004
#> GSM447438 4 0.2251 0.6642 0.008 0.024 0.000 0.916 0.052
#> GSM447447 2 0.6187 0.1187 0.412 0.480 0.012 0.000 0.096
#> GSM447454 2 0.6355 0.2527 0.000 0.492 0.132 0.368 0.008
#> GSM447457 2 0.4552 0.6530 0.004 0.768 0.068 0.152 0.008
#> GSM447460 2 0.4633 0.4725 0.000 0.632 0.004 0.348 0.016
#> GSM447465 2 0.4319 0.6757 0.000 0.784 0.064 0.140 0.012
#> GSM447471 1 0.0566 0.8923 0.984 0.012 0.000 0.000 0.004
#> GSM447476 4 0.7565 0.0288 0.284 0.040 0.012 0.464 0.200
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM447401 6 0.4516 -0.1520 0.000 0.000 0.400 0.000 0.036 0.564
#> GSM447411 1 0.0632 0.7607 0.976 0.000 0.000 0.000 0.024 0.000
#> GSM447413 3 0.4875 0.6406 0.000 0.056 0.740 0.032 0.028 0.144
#> GSM447415 1 0.0713 0.7625 0.972 0.000 0.000 0.000 0.028 0.000
#> GSM447416 3 0.3441 0.6871 0.000 0.000 0.832 0.076 0.072 0.020
#> GSM447425 6 0.3956 0.2222 0.000 0.088 0.000 0.000 0.152 0.760
#> GSM447430 4 0.4926 0.3810 0.000 0.012 0.000 0.580 0.048 0.360
#> GSM447435 1 0.1265 0.7590 0.948 0.000 0.000 0.008 0.044 0.000
#> GSM447440 1 0.3161 0.7280 0.848 0.040 0.000 0.020 0.092 0.000
#> GSM447444 1 0.5851 0.3401 0.552 0.312 0.000 0.000 0.092 0.044
#> GSM447448 1 0.2753 0.7422 0.872 0.072 0.000 0.008 0.048 0.000
#> GSM447449 2 0.3816 0.5170 0.000 0.792 0.000 0.008 0.096 0.104
#> GSM447450 1 0.2214 0.7432 0.892 0.012 0.000 0.004 0.092 0.000
#> GSM447452 6 0.1129 0.3917 0.000 0.012 0.004 0.012 0.008 0.964
#> GSM447458 2 0.2933 0.5979 0.008 0.860 0.000 0.004 0.096 0.032
#> GSM447461 4 0.6483 0.3915 0.044 0.212 0.004 0.520 0.220 0.000
#> GSM447464 1 0.3066 0.7131 0.832 0.044 0.000 0.000 0.124 0.000
#> GSM447468 1 0.1007 0.7641 0.956 0.000 0.000 0.000 0.044 0.000
#> GSM447472 1 0.3322 0.7345 0.832 0.052 0.000 0.012 0.104 0.000
#> GSM447400 1 0.4527 0.6888 0.680 0.056 0.008 0.000 0.256 0.000
#> GSM447402 5 0.6337 0.0452 0.000 0.332 0.000 0.008 0.348 0.312
#> GSM447403 1 0.2416 0.7400 0.844 0.000 0.000 0.000 0.156 0.000
#> GSM447405 1 0.6816 0.1385 0.448 0.004 0.000 0.080 0.332 0.136
#> GSM447418 2 0.4187 0.4289 0.000 0.624 0.356 0.000 0.016 0.004
#> GSM447422 2 0.3263 0.5709 0.000 0.800 0.176 0.004 0.020 0.000
#> GSM447424 3 0.0717 0.7180 0.000 0.016 0.976 0.000 0.000 0.008
#> GSM447427 3 0.1644 0.7160 0.000 0.076 0.920 0.000 0.004 0.000
#> GSM447428 3 0.3664 0.6858 0.080 0.016 0.832 0.000 0.024 0.048
#> GSM447429 1 0.3588 0.7302 0.788 0.000 0.060 0.000 0.152 0.000
#> GSM447431 4 0.4853 0.5857 0.000 0.136 0.048 0.732 0.080 0.004
#> GSM447432 2 0.4164 0.5652 0.004 0.772 0.012 0.084 0.128 0.000
#> GSM447434 1 0.3158 0.7424 0.812 0.000 0.004 0.020 0.164 0.000
#> GSM447442 2 0.1251 0.5994 0.000 0.956 0.012 0.000 0.024 0.008
#> GSM447451 4 0.4114 0.6151 0.024 0.124 0.004 0.784 0.064 0.000
#> GSM447462 1 0.5205 0.5628 0.668 0.096 0.004 0.024 0.208 0.000
#> GSM447463 1 0.3103 0.7259 0.836 0.064 0.000 0.000 0.100 0.000
#> GSM447467 2 0.2312 0.6021 0.008 0.896 0.004 0.000 0.080 0.012
#> GSM447469 2 0.5925 0.1345 0.000 0.560 0.040 0.004 0.300 0.096
#> GSM447473 1 0.2941 0.7179 0.780 0.000 0.000 0.000 0.220 0.000
#> GSM447404 1 0.2697 0.7281 0.812 0.000 0.000 0.000 0.188 0.000
#> GSM447406 4 0.1594 0.6393 0.000 0.000 0.000 0.932 0.016 0.052
#> GSM447407 6 0.3434 0.3088 0.000 0.000 0.004 0.140 0.048 0.808
#> GSM447409 1 0.2793 0.7239 0.800 0.000 0.000 0.000 0.200 0.000
#> GSM447412 3 0.2326 0.7195 0.000 0.028 0.900 0.060 0.012 0.000
#> GSM447426 3 0.4594 0.1174 0.000 0.000 0.484 0.000 0.036 0.480
#> GSM447433 1 0.6319 -0.0301 0.388 0.000 0.000 0.016 0.380 0.216
#> GSM447439 4 0.3411 0.6206 0.000 0.044 0.000 0.836 0.032 0.088
#> GSM447441 4 0.4078 0.5892 0.000 0.144 0.012 0.768 0.076 0.000
#> GSM447443 1 0.3394 0.7077 0.752 0.000 0.012 0.000 0.236 0.000
#> GSM447445 1 0.1196 0.7622 0.952 0.008 0.000 0.000 0.040 0.000
#> GSM447446 6 0.6388 -0.1962 0.296 0.012 0.000 0.000 0.312 0.380
#> GSM447453 1 0.3104 0.6840 0.800 0.000 0.000 0.000 0.016 0.184
#> GSM447455 2 0.2341 0.6088 0.000 0.904 0.008 0.056 0.024 0.008
#> GSM447456 4 0.6037 0.0645 0.420 0.032 0.000 0.436 0.112 0.000
#> GSM447459 4 0.4727 0.5168 0.000 0.000 0.004 0.692 0.132 0.172
#> GSM447466 1 0.1204 0.7584 0.944 0.000 0.000 0.000 0.056 0.000
#> GSM447470 1 0.4175 0.6459 0.740 0.156 0.000 0.000 0.104 0.000
#> GSM447474 1 0.3878 0.6356 0.736 0.032 0.004 0.000 0.228 0.000
#> GSM447475 2 0.6437 0.4259 0.084 0.568 0.012 0.100 0.236 0.000
#> GSM447398 4 0.3671 0.6248 0.024 0.068 0.000 0.816 0.092 0.000
#> GSM447399 4 0.4466 0.5628 0.000 0.088 0.044 0.760 0.108 0.000
#> GSM447408 4 0.4339 0.5043 0.000 0.008 0.004 0.700 0.252 0.036
#> GSM447410 4 0.3818 0.5352 0.000 0.004 0.004 0.720 0.260 0.012
#> GSM447414 3 0.4495 0.6423 0.000 0.064 0.744 0.156 0.036 0.000
#> GSM447417 2 0.7158 -0.0624 0.000 0.420 0.004 0.148 0.312 0.116
#> GSM447419 3 0.5991 0.3515 0.292 0.036 0.544 0.000 0.128 0.000
#> GSM447420 3 0.5697 0.4702 0.196 0.016 0.604 0.000 0.180 0.004
#> GSM447421 1 0.6073 0.4547 0.568 0.052 0.248 0.000 0.132 0.000
#> GSM447423 3 0.2752 0.7112 0.000 0.036 0.864 0.004 0.096 0.000
#> GSM447436 1 0.6575 -0.0165 0.404 0.028 0.000 0.004 0.364 0.200
#> GSM447437 1 0.1910 0.7538 0.892 0.000 0.000 0.000 0.108 0.000
#> GSM447438 4 0.3103 0.6069 0.008 0.004 0.000 0.836 0.132 0.020
#> GSM447447 2 0.6402 -0.0310 0.224 0.468 0.000 0.000 0.280 0.028
#> GSM447454 2 0.7464 0.2453 0.000 0.388 0.192 0.232 0.188 0.000
#> GSM447457 2 0.5456 0.5245 0.000 0.648 0.052 0.088 0.212 0.000
#> GSM447460 2 0.5642 0.2486 0.000 0.488 0.004 0.404 0.092 0.012
#> GSM447465 2 0.4218 0.5909 0.000 0.780 0.064 0.108 0.048 0.000
#> GSM447471 1 0.2793 0.7265 0.800 0.000 0.000 0.000 0.200 0.000
#> GSM447476 5 0.6416 0.1711 0.088 0.044 0.000 0.288 0.548 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 gender(p) agent(p) k
#> SD:NMF 78 1.0000 0.256 2
#> SD:NMF 78 0.4830 0.137 3
#> SD:NMF 72 0.5649 0.215 4
#> SD:NMF 63 0.1818 0.450 5
#> SD:NMF 54 0.0693 0.189 6
If matrix rows can be associated to genes, consider to use functional_enrichment(res,
...)
to perform function enrichment for the signature genes. See this vignette for more detailed explanations.
The object with results only for a single top-value method and a single partition method can be extracted as:
res = res_list["CV", "hclust"]
# you can also extract it by
# res = res_list["CV:hclust"]
A summary of res
and all the functions that can be applied to it:
res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#> On a matrix with 51941 rows and 79 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'CV' method.
#> Subgroups are detected by 'hclust' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 2.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 0.868 0.921 0.964 0.4968 0.500 0.500
#> 3 3 0.685 0.780 0.871 0.2851 0.825 0.655
#> 4 4 0.594 0.605 0.741 0.1042 0.958 0.878
#> 5 5 0.627 0.573 0.750 0.0747 0.904 0.682
#> 6 6 0.661 0.514 0.743 0.0582 0.883 0.547
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
#> GSM447401 2 0.0000 0.963 0.000 1.000
#> GSM447411 1 0.0000 0.960 1.000 0.000
#> GSM447413 2 0.0000 0.963 0.000 1.000
#> GSM447415 1 0.0000 0.960 1.000 0.000
#> GSM447416 2 0.0000 0.963 0.000 1.000
#> GSM447425 2 0.0000 0.963 0.000 1.000
#> GSM447430 2 0.0000 0.963 0.000 1.000
#> GSM447435 1 0.0000 0.960 1.000 0.000
#> GSM447440 1 0.0000 0.960 1.000 0.000
#> GSM447444 1 0.9427 0.427 0.640 0.360
#> GSM447448 1 0.6148 0.806 0.848 0.152
#> GSM447449 2 0.0938 0.960 0.012 0.988
#> GSM447450 1 0.0000 0.960 1.000 0.000
#> GSM447452 2 0.0000 0.963 0.000 1.000
#> GSM447458 2 0.4161 0.910 0.084 0.916
#> GSM447461 2 0.4562 0.899 0.096 0.904
#> GSM447464 1 0.0000 0.960 1.000 0.000
#> GSM447468 1 0.0000 0.960 1.000 0.000
#> GSM447472 1 0.0000 0.960 1.000 0.000
#> GSM447400 1 0.0000 0.960 1.000 0.000
#> GSM447402 2 0.0000 0.963 0.000 1.000
#> GSM447403 1 0.0000 0.960 1.000 0.000
#> GSM447405 1 0.7950 0.680 0.760 0.240
#> GSM447418 2 0.0000 0.963 0.000 1.000
#> GSM447422 2 0.0938 0.960 0.012 0.988
#> GSM447424 2 0.0000 0.963 0.000 1.000
#> GSM447427 2 0.0000 0.963 0.000 1.000
#> GSM447428 1 0.0000 0.960 1.000 0.000
#> GSM447429 1 0.0000 0.960 1.000 0.000
#> GSM447431 2 0.0000 0.963 0.000 1.000
#> GSM447432 2 0.0938 0.960 0.012 0.988
#> GSM447434 2 0.7745 0.717 0.228 0.772
#> GSM447442 2 0.0938 0.960 0.012 0.988
#> GSM447451 2 0.5059 0.884 0.112 0.888
#> GSM447462 1 0.0000 0.960 1.000 0.000
#> GSM447463 1 0.0000 0.960 1.000 0.000
#> GSM447467 1 0.9866 0.218 0.568 0.432
#> GSM447469 2 0.0000 0.963 0.000 1.000
#> GSM447473 1 0.0000 0.960 1.000 0.000
#> GSM447404 1 0.0000 0.960 1.000 0.000
#> GSM447406 2 0.0000 0.963 0.000 1.000
#> GSM447407 2 0.0000 0.963 0.000 1.000
#> GSM447409 1 0.0000 0.960 1.000 0.000
#> GSM447412 2 0.0000 0.963 0.000 1.000
#> GSM447426 2 0.0000 0.963 0.000 1.000
#> GSM447433 1 0.1633 0.944 0.976 0.024
#> GSM447439 2 0.0000 0.963 0.000 1.000
#> GSM447441 2 0.0000 0.963 0.000 1.000
#> GSM447443 1 0.0000 0.960 1.000 0.000
#> GSM447445 1 0.0672 0.955 0.992 0.008
#> GSM447446 1 0.1633 0.944 0.976 0.024
#> GSM447453 1 0.0000 0.960 1.000 0.000
#> GSM447455 2 0.0938 0.960 0.012 0.988
#> GSM447456 2 0.6148 0.838 0.152 0.848
#> GSM447459 2 0.0000 0.963 0.000 1.000
#> GSM447466 1 0.0000 0.960 1.000 0.000
#> GSM447470 2 0.6887 0.797 0.184 0.816
#> GSM447474 1 0.0000 0.960 1.000 0.000
#> GSM447475 2 0.4562 0.899 0.096 0.904
#> GSM447398 2 0.3879 0.916 0.076 0.924
#> GSM447399 2 0.1414 0.955 0.020 0.980
#> GSM447408 2 0.0938 0.959 0.012 0.988
#> GSM447410 2 0.2043 0.948 0.032 0.968
#> GSM447414 2 0.0000 0.963 0.000 1.000
#> GSM447417 2 0.0000 0.963 0.000 1.000
#> GSM447419 1 0.0000 0.960 1.000 0.000
#> GSM447420 1 0.0000 0.960 1.000 0.000
#> GSM447421 1 0.0000 0.960 1.000 0.000
#> GSM447423 2 0.0000 0.963 0.000 1.000
#> GSM447436 1 0.1633 0.944 0.976 0.024
#> GSM447437 1 0.0000 0.960 1.000 0.000
#> GSM447438 2 0.9286 0.494 0.344 0.656
#> GSM447447 1 0.1633 0.944 0.976 0.024
#> GSM447454 2 0.0672 0.961 0.008 0.992
#> GSM447457 2 0.0000 0.963 0.000 1.000
#> GSM447460 2 0.0938 0.960 0.012 0.988
#> GSM447465 2 0.0000 0.963 0.000 1.000
#> GSM447471 1 0.0000 0.960 1.000 0.000
#> GSM447476 2 0.2043 0.948 0.032 0.968
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM447401 3 0.0747 0.7818 0.000 0.016 0.984
#> GSM447411 1 0.0000 0.9487 1.000 0.000 0.000
#> GSM447413 3 0.2356 0.8402 0.000 0.072 0.928
#> GSM447415 1 0.0000 0.9487 1.000 0.000 0.000
#> GSM447416 3 0.2448 0.8397 0.000 0.076 0.924
#> GSM447425 2 0.5678 0.6915 0.000 0.684 0.316
#> GSM447430 2 0.4842 0.7225 0.000 0.776 0.224
#> GSM447435 1 0.0000 0.9487 1.000 0.000 0.000
#> GSM447440 1 0.0000 0.9487 1.000 0.000 0.000
#> GSM447444 1 0.6460 0.2778 0.556 0.440 0.004
#> GSM447448 1 0.5070 0.7494 0.772 0.224 0.004
#> GSM447449 3 0.6079 0.4884 0.000 0.388 0.612
#> GSM447450 1 0.0000 0.9487 1.000 0.000 0.000
#> GSM447452 2 0.5678 0.6915 0.000 0.684 0.316
#> GSM447458 2 0.4618 0.7426 0.024 0.840 0.136
#> GSM447461 2 0.1399 0.7269 0.004 0.968 0.028
#> GSM447464 1 0.1289 0.9491 0.968 0.032 0.000
#> GSM447468 1 0.1529 0.9484 0.960 0.040 0.000
#> GSM447472 1 0.1529 0.9484 0.960 0.040 0.000
#> GSM447400 1 0.1529 0.9484 0.960 0.040 0.000
#> GSM447402 2 0.4750 0.7249 0.000 0.784 0.216
#> GSM447403 1 0.0000 0.9487 1.000 0.000 0.000
#> GSM447405 1 0.5953 0.6267 0.708 0.280 0.012
#> GSM447418 3 0.2356 0.8402 0.000 0.072 0.928
#> GSM447422 3 0.6008 0.5242 0.000 0.372 0.628
#> GSM447424 3 0.2356 0.8402 0.000 0.072 0.928
#> GSM447427 3 0.2356 0.8402 0.000 0.072 0.928
#> GSM447428 1 0.1860 0.9438 0.948 0.052 0.000
#> GSM447429 1 0.1163 0.9492 0.972 0.028 0.000
#> GSM447431 3 0.2356 0.8402 0.000 0.072 0.928
#> GSM447432 3 0.6291 0.2531 0.000 0.468 0.532
#> GSM447434 2 0.9034 0.4512 0.200 0.556 0.244
#> GSM447442 3 0.6008 0.5242 0.000 0.372 0.628
#> GSM447451 2 0.2050 0.7215 0.020 0.952 0.028
#> GSM447462 1 0.1529 0.9484 0.960 0.040 0.000
#> GSM447463 1 0.0237 0.9492 0.996 0.004 0.000
#> GSM447467 2 0.6518 -0.0754 0.484 0.512 0.004
#> GSM447469 2 0.4750 0.7273 0.000 0.784 0.216
#> GSM447473 1 0.0000 0.9487 1.000 0.000 0.000
#> GSM447404 1 0.0000 0.9487 1.000 0.000 0.000
#> GSM447406 2 0.4796 0.7242 0.000 0.780 0.220
#> GSM447407 2 0.5216 0.7025 0.000 0.740 0.260
#> GSM447409 1 0.0000 0.9487 1.000 0.000 0.000
#> GSM447412 3 0.2448 0.8397 0.000 0.076 0.924
#> GSM447426 3 0.0747 0.7818 0.000 0.016 0.984
#> GSM447433 1 0.2066 0.9293 0.940 0.060 0.000
#> GSM447439 2 0.4796 0.7242 0.000 0.780 0.220
#> GSM447441 3 0.2356 0.8402 0.000 0.072 0.928
#> GSM447443 1 0.1529 0.9484 0.960 0.040 0.000
#> GSM447445 1 0.1964 0.9318 0.944 0.056 0.000
#> GSM447446 1 0.2625 0.9251 0.916 0.084 0.000
#> GSM447453 1 0.0000 0.9487 1.000 0.000 0.000
#> GSM447455 3 0.6307 0.1732 0.000 0.488 0.512
#> GSM447456 2 0.2301 0.6935 0.060 0.936 0.004
#> GSM447459 2 0.4842 0.7225 0.000 0.776 0.224
#> GSM447466 1 0.0000 0.9487 1.000 0.000 0.000
#> GSM447470 2 0.3933 0.6727 0.092 0.880 0.028
#> GSM447474 1 0.1529 0.9484 0.960 0.040 0.000
#> GSM447475 2 0.1267 0.7275 0.004 0.972 0.024
#> GSM447398 2 0.1267 0.7361 0.004 0.972 0.024
#> GSM447399 2 0.6314 0.3970 0.004 0.604 0.392
#> GSM447408 2 0.2878 0.7487 0.000 0.904 0.096
#> GSM447410 2 0.3445 0.7512 0.016 0.896 0.088
#> GSM447414 3 0.3816 0.7961 0.000 0.148 0.852
#> GSM447417 2 0.4750 0.7249 0.000 0.784 0.216
#> GSM447419 1 0.1529 0.9484 0.960 0.040 0.000
#> GSM447420 1 0.1529 0.9484 0.960 0.040 0.000
#> GSM447421 1 0.1289 0.9491 0.968 0.032 0.000
#> GSM447423 3 0.2448 0.8397 0.000 0.076 0.924
#> GSM447436 1 0.2356 0.9299 0.928 0.072 0.000
#> GSM447437 1 0.0237 0.9492 0.996 0.004 0.000
#> GSM447438 2 0.6852 0.4545 0.300 0.664 0.036
#> GSM447447 1 0.2625 0.9251 0.916 0.084 0.000
#> GSM447454 3 0.4235 0.7820 0.000 0.176 0.824
#> GSM447457 3 0.2448 0.8397 0.000 0.076 0.924
#> GSM447460 3 0.5621 0.6244 0.000 0.308 0.692
#> GSM447465 3 0.2356 0.8402 0.000 0.072 0.928
#> GSM447471 1 0.0000 0.9487 1.000 0.000 0.000
#> GSM447476 2 0.3445 0.7512 0.016 0.896 0.088
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM447401 3 0.4040 0.6152 0.000 0.000 0.752 0.248
#> GSM447411 1 0.2412 0.8115 0.908 0.008 0.000 0.084
#> GSM447413 3 0.0188 0.8227 0.000 0.000 0.996 0.004
#> GSM447415 1 0.1042 0.8314 0.972 0.008 0.000 0.020
#> GSM447416 3 0.0376 0.8231 0.000 0.004 0.992 0.004
#> GSM447425 4 0.4720 0.4751 0.000 0.324 0.004 0.672
#> GSM447430 2 0.7558 -0.6517 0.000 0.428 0.192 0.380
#> GSM447435 1 0.3037 0.8088 0.880 0.020 0.000 0.100
#> GSM447440 1 0.3037 0.8088 0.880 0.020 0.000 0.100
#> GSM447444 1 0.6875 0.1975 0.500 0.420 0.016 0.064
#> GSM447448 1 0.5432 0.6581 0.716 0.216 0.000 0.068
#> GSM447449 3 0.5599 0.5466 0.000 0.276 0.672 0.052
#> GSM447450 1 0.3037 0.8088 0.880 0.020 0.000 0.100
#> GSM447452 4 0.4720 0.4751 0.000 0.324 0.004 0.672
#> GSM447458 2 0.5354 0.2336 0.008 0.736 0.204 0.052
#> GSM447461 2 0.2149 0.4214 0.000 0.912 0.088 0.000
#> GSM447464 1 0.4234 0.8286 0.816 0.052 0.000 0.132
#> GSM447468 1 0.4656 0.8256 0.792 0.072 0.000 0.136
#> GSM447472 1 0.4656 0.8256 0.792 0.072 0.000 0.136
#> GSM447400 1 0.4462 0.8265 0.804 0.064 0.000 0.132
#> GSM447402 4 0.7608 0.6710 0.000 0.364 0.204 0.432
#> GSM447403 1 0.2611 0.8063 0.896 0.008 0.000 0.096
#> GSM447405 1 0.7377 0.5104 0.520 0.264 0.000 0.216
#> GSM447418 3 0.0000 0.8238 0.000 0.000 1.000 0.000
#> GSM447422 3 0.5491 0.5697 0.000 0.260 0.688 0.052
#> GSM447424 3 0.0188 0.8227 0.000 0.000 0.996 0.004
#> GSM447427 3 0.0000 0.8238 0.000 0.000 1.000 0.000
#> GSM447428 1 0.4856 0.8208 0.780 0.084 0.000 0.136
#> GSM447429 1 0.4037 0.8292 0.824 0.040 0.000 0.136
#> GSM447431 3 0.0000 0.8238 0.000 0.000 1.000 0.000
#> GSM447432 3 0.5943 0.3748 0.000 0.360 0.592 0.048
#> GSM447434 2 0.7573 0.2473 0.160 0.568 0.248 0.024
#> GSM447442 3 0.5491 0.5697 0.000 0.260 0.688 0.052
#> GSM447451 2 0.3833 0.4153 0.008 0.856 0.088 0.048
#> GSM447462 1 0.4462 0.8265 0.804 0.064 0.000 0.132
#> GSM447463 1 0.1677 0.8246 0.948 0.012 0.000 0.040
#> GSM447467 2 0.6884 -0.0272 0.428 0.492 0.016 0.064
#> GSM447469 4 0.7638 0.6484 0.000 0.372 0.208 0.420
#> GSM447473 1 0.2611 0.8063 0.896 0.008 0.000 0.096
#> GSM447404 1 0.2611 0.8063 0.896 0.008 0.000 0.096
#> GSM447406 4 0.7566 0.5966 0.000 0.392 0.192 0.416
#> GSM447407 4 0.7426 0.6759 0.000 0.324 0.188 0.488
#> GSM447409 1 0.3099 0.8014 0.876 0.020 0.000 0.104
#> GSM447412 3 0.0188 0.8239 0.000 0.004 0.996 0.000
#> GSM447426 3 0.4040 0.6152 0.000 0.000 0.752 0.248
#> GSM447433 1 0.4667 0.7916 0.796 0.096 0.000 0.108
#> GSM447439 4 0.7566 0.5966 0.000 0.392 0.192 0.416
#> GSM447441 3 0.0000 0.8238 0.000 0.000 1.000 0.000
#> GSM447443 1 0.4656 0.8256 0.792 0.072 0.000 0.136
#> GSM447445 1 0.3037 0.8203 0.888 0.076 0.000 0.036
#> GSM447446 1 0.5613 0.7951 0.724 0.120 0.000 0.156
#> GSM447453 1 0.1042 0.8319 0.972 0.020 0.000 0.008
#> GSM447455 3 0.6009 0.3188 0.000 0.380 0.572 0.048
#> GSM447456 2 0.1247 0.4037 0.012 0.968 0.016 0.004
#> GSM447459 2 0.7558 -0.6517 0.000 0.428 0.192 0.380
#> GSM447466 1 0.2546 0.8078 0.900 0.008 0.000 0.092
#> GSM447470 2 0.3940 0.3995 0.052 0.864 0.040 0.044
#> GSM447474 1 0.4656 0.8256 0.792 0.072 0.000 0.136
#> GSM447475 2 0.2081 0.4207 0.000 0.916 0.084 0.000
#> GSM447398 2 0.2081 0.3963 0.000 0.916 0.084 0.000
#> GSM447399 2 0.5586 0.0669 0.000 0.528 0.452 0.020
#> GSM447408 2 0.6238 -0.2037 0.000 0.620 0.084 0.296
#> GSM447410 2 0.6194 -0.0971 0.000 0.628 0.084 0.288
#> GSM447414 3 0.1940 0.7847 0.000 0.076 0.924 0.000
#> GSM447417 4 0.7608 0.6710 0.000 0.364 0.204 0.432
#> GSM447419 1 0.4656 0.8256 0.792 0.072 0.000 0.136
#> GSM447420 1 0.4656 0.8256 0.792 0.072 0.000 0.136
#> GSM447421 1 0.4234 0.8286 0.816 0.052 0.000 0.132
#> GSM447423 3 0.0188 0.8239 0.000 0.004 0.996 0.000
#> GSM447436 1 0.5452 0.8014 0.736 0.108 0.000 0.156
#> GSM447437 1 0.1677 0.8246 0.948 0.012 0.000 0.040
#> GSM447438 2 0.8813 0.1379 0.148 0.424 0.084 0.344
#> GSM447447 1 0.5613 0.7951 0.724 0.120 0.000 0.156
#> GSM447454 3 0.2408 0.7750 0.000 0.104 0.896 0.000
#> GSM447457 3 0.0188 0.8239 0.000 0.004 0.996 0.000
#> GSM447460 3 0.4959 0.6362 0.000 0.196 0.752 0.052
#> GSM447465 3 0.0188 0.8227 0.000 0.000 0.996 0.004
#> GSM447471 1 0.2611 0.8063 0.896 0.008 0.000 0.096
#> GSM447476 2 0.6194 -0.0971 0.000 0.628 0.084 0.288
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM447401 3 0.5708 0.4604 0.000 0.044 0.584 0.028 0.344
#> GSM447411 5 0.4278 0.8809 0.452 0.000 0.000 0.000 0.548
#> GSM447413 3 0.0162 0.8089 0.000 0.004 0.996 0.000 0.000
#> GSM447415 1 0.3636 0.1722 0.728 0.000 0.000 0.000 0.272
#> GSM447416 3 0.0290 0.8095 0.000 0.008 0.992 0.000 0.000
#> GSM447425 4 0.5404 0.6326 0.000 0.152 0.000 0.664 0.184
#> GSM447430 4 0.3751 0.6589 0.000 0.212 0.004 0.772 0.012
#> GSM447435 5 0.4242 0.9205 0.428 0.000 0.000 0.000 0.572
#> GSM447440 5 0.4242 0.9205 0.428 0.000 0.000 0.000 0.572
#> GSM447444 1 0.6517 0.1431 0.484 0.396 0.000 0.040 0.080
#> GSM447448 1 0.6538 0.1883 0.600 0.188 0.000 0.040 0.172
#> GSM447449 3 0.5441 0.5158 0.000 0.280 0.624 0.096 0.000
#> GSM447450 5 0.4242 0.9205 0.428 0.000 0.000 0.000 0.572
#> GSM447452 4 0.5404 0.6326 0.000 0.152 0.000 0.664 0.184
#> GSM447458 2 0.4845 0.4827 0.020 0.752 0.144 0.084 0.000
#> GSM447461 2 0.2208 0.5905 0.012 0.916 0.060 0.012 0.000
#> GSM447464 1 0.0703 0.7091 0.976 0.000 0.000 0.000 0.024
#> GSM447468 1 0.0000 0.7195 1.000 0.000 0.000 0.000 0.000
#> GSM447472 1 0.0000 0.7195 1.000 0.000 0.000 0.000 0.000
#> GSM447400 1 0.0404 0.7158 0.988 0.000 0.000 0.000 0.012
#> GSM447402 4 0.5263 0.5926 0.000 0.176 0.144 0.680 0.000
#> GSM447403 5 0.4192 0.9344 0.404 0.000 0.000 0.000 0.596
#> GSM447405 1 0.6099 0.3857 0.664 0.176 0.000 0.076 0.084
#> GSM447418 3 0.0000 0.8099 0.000 0.000 1.000 0.000 0.000
#> GSM447422 3 0.5331 0.5366 0.000 0.268 0.640 0.092 0.000
#> GSM447424 3 0.0162 0.8089 0.000 0.004 0.996 0.000 0.000
#> GSM447427 3 0.0000 0.8099 0.000 0.000 1.000 0.000 0.000
#> GSM447428 1 0.0404 0.7143 0.988 0.012 0.000 0.000 0.000
#> GSM447429 1 0.1341 0.6776 0.944 0.000 0.000 0.000 0.056
#> GSM447431 3 0.0000 0.8099 0.000 0.000 1.000 0.000 0.000
#> GSM447432 3 0.5682 0.3505 0.000 0.372 0.540 0.088 0.000
#> GSM447434 2 0.6966 0.3947 0.204 0.532 0.232 0.028 0.004
#> GSM447442 3 0.5331 0.5366 0.000 0.268 0.640 0.092 0.000
#> GSM447451 2 0.3135 0.5848 0.028 0.876 0.060 0.036 0.000
#> GSM447462 1 0.0404 0.7158 0.988 0.000 0.000 0.000 0.012
#> GSM447463 1 0.4294 -0.6675 0.532 0.000 0.000 0.000 0.468
#> GSM447467 2 0.6358 -0.0268 0.428 0.468 0.000 0.040 0.064
#> GSM447469 4 0.5550 0.5688 0.000 0.188 0.148 0.660 0.004
#> GSM447473 5 0.4192 0.9344 0.404 0.000 0.000 0.000 0.596
#> GSM447404 5 0.4192 0.9344 0.404 0.000 0.000 0.000 0.596
#> GSM447406 4 0.3280 0.6587 0.000 0.160 0.004 0.824 0.012
#> GSM447407 4 0.3779 0.6895 0.000 0.124 0.004 0.816 0.056
#> GSM447409 5 0.4114 0.9028 0.376 0.000 0.000 0.000 0.624
#> GSM447412 3 0.0162 0.8096 0.000 0.004 0.996 0.000 0.000
#> GSM447426 3 0.5708 0.4604 0.000 0.044 0.584 0.028 0.344
#> GSM447433 5 0.5250 0.7694 0.404 0.040 0.000 0.004 0.552
#> GSM447439 4 0.3280 0.6587 0.000 0.160 0.004 0.824 0.012
#> GSM447441 3 0.0000 0.8099 0.000 0.000 1.000 0.000 0.000
#> GSM447443 1 0.0162 0.7185 0.996 0.000 0.000 0.000 0.004
#> GSM447445 1 0.5378 -0.4732 0.548 0.060 0.000 0.000 0.392
#> GSM447446 1 0.2569 0.6632 0.896 0.032 0.000 0.004 0.068
#> GSM447453 1 0.3684 0.1593 0.720 0.000 0.000 0.000 0.280
#> GSM447455 3 0.5369 0.3525 0.000 0.388 0.552 0.060 0.000
#> GSM447456 2 0.2363 0.5621 0.052 0.912 0.000 0.024 0.012
#> GSM447459 4 0.3751 0.6589 0.000 0.212 0.004 0.772 0.012
#> GSM447466 5 0.4210 0.9330 0.412 0.000 0.000 0.000 0.588
#> GSM447470 2 0.3745 0.5621 0.096 0.840 0.024 0.036 0.004
#> GSM447474 1 0.0000 0.7195 1.000 0.000 0.000 0.000 0.000
#> GSM447475 2 0.2139 0.5902 0.012 0.920 0.056 0.012 0.000
#> GSM447398 2 0.2074 0.5718 0.000 0.920 0.044 0.036 0.000
#> GSM447399 2 0.4948 0.1118 0.000 0.536 0.436 0.028 0.000
#> GSM447408 2 0.5175 0.0175 0.000 0.548 0.044 0.408 0.000
#> GSM447410 2 0.5669 0.1532 0.000 0.576 0.044 0.356 0.024
#> GSM447414 3 0.1671 0.7781 0.000 0.076 0.924 0.000 0.000
#> GSM447417 4 0.5263 0.5926 0.000 0.176 0.144 0.680 0.000
#> GSM447419 1 0.0000 0.7195 1.000 0.000 0.000 0.000 0.000
#> GSM447420 1 0.0000 0.7195 1.000 0.000 0.000 0.000 0.000
#> GSM447421 1 0.0703 0.7091 0.976 0.000 0.000 0.000 0.024
#> GSM447423 3 0.0404 0.8077 0.000 0.012 0.988 0.000 0.000
#> GSM447436 1 0.2610 0.6660 0.892 0.028 0.000 0.004 0.076
#> GSM447437 1 0.4294 -0.6675 0.532 0.000 0.000 0.000 0.468
#> GSM447438 2 0.8030 0.1402 0.312 0.396 0.044 0.224 0.024
#> GSM447447 1 0.2569 0.6632 0.896 0.032 0.000 0.004 0.068
#> GSM447454 3 0.2179 0.7610 0.000 0.112 0.888 0.000 0.000
#> GSM447457 3 0.0404 0.8077 0.000 0.012 0.988 0.000 0.000
#> GSM447460 3 0.4272 0.6455 0.000 0.196 0.752 0.052 0.000
#> GSM447465 3 0.0162 0.8089 0.000 0.004 0.996 0.000 0.000
#> GSM447471 5 0.4192 0.9344 0.404 0.000 0.000 0.000 0.596
#> GSM447476 2 0.5669 0.1532 0.000 0.576 0.044 0.356 0.024
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM447401 5 0.3198 0.4200 0.000 0.000 0.260 0.000 0.740 0.000
#> GSM447411 1 0.1910 0.8129 0.892 0.000 0.000 0.000 0.000 0.108
#> GSM447413 3 0.0260 0.7855 0.000 0.000 0.992 0.000 0.008 0.000
#> GSM447415 1 0.3747 0.3896 0.604 0.000 0.000 0.000 0.000 0.396
#> GSM447416 3 0.0405 0.7865 0.000 0.004 0.988 0.000 0.008 0.000
#> GSM447425 5 0.6010 0.1384 0.000 0.360 0.000 0.240 0.400 0.000
#> GSM447430 4 0.5067 0.4381 0.000 0.436 0.000 0.488 0.076 0.000
#> GSM447435 1 0.1663 0.8217 0.912 0.000 0.000 0.000 0.000 0.088
#> GSM447440 1 0.1663 0.8217 0.912 0.000 0.000 0.000 0.000 0.088
#> GSM447444 6 0.7086 0.1857 0.108 0.136 0.000 0.296 0.008 0.452
#> GSM447448 1 0.6823 0.0529 0.392 0.044 0.000 0.184 0.008 0.372
#> GSM447449 3 0.5865 0.5312 0.000 0.156 0.584 0.236 0.012 0.012
#> GSM447450 1 0.1663 0.8217 0.912 0.000 0.000 0.000 0.000 0.088
#> GSM447452 5 0.6010 0.1384 0.000 0.360 0.000 0.240 0.400 0.000
#> GSM447458 4 0.5871 -0.3401 0.000 0.380 0.100 0.496 0.012 0.012
#> GSM447461 2 0.4866 0.3238 0.000 0.552 0.024 0.404 0.004 0.016
#> GSM447464 6 0.1714 0.7646 0.092 0.000 0.000 0.000 0.000 0.908
#> GSM447468 6 0.1204 0.7879 0.056 0.000 0.000 0.000 0.000 0.944
#> GSM447472 6 0.1141 0.7879 0.052 0.000 0.000 0.000 0.000 0.948
#> GSM447400 6 0.1501 0.7836 0.076 0.000 0.000 0.000 0.000 0.924
#> GSM447402 2 0.7210 -0.1106 0.000 0.468 0.100 0.260 0.156 0.016
#> GSM447403 1 0.0865 0.8218 0.964 0.000 0.000 0.000 0.000 0.036
#> GSM447405 6 0.6240 0.1902 0.336 0.240 0.000 0.004 0.004 0.416
#> GSM447418 3 0.0000 0.7867 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM447422 3 0.5780 0.5504 0.000 0.156 0.600 0.220 0.012 0.012
#> GSM447424 3 0.0260 0.7855 0.000 0.000 0.992 0.000 0.008 0.000
#> GSM447427 3 0.0000 0.7867 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM447428 6 0.1333 0.7851 0.048 0.008 0.000 0.000 0.000 0.944
#> GSM447429 6 0.2854 0.6708 0.208 0.000 0.000 0.000 0.000 0.792
#> GSM447431 3 0.0000 0.7867 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM447432 3 0.6333 0.3820 0.000 0.208 0.496 0.272 0.012 0.012
#> GSM447434 2 0.8192 0.1579 0.032 0.280 0.232 0.280 0.000 0.176
#> GSM447442 3 0.5780 0.5504 0.000 0.156 0.600 0.220 0.012 0.012
#> GSM447451 2 0.5183 0.2909 0.000 0.480 0.024 0.456 0.000 0.040
#> GSM447462 6 0.1501 0.7819 0.076 0.000 0.000 0.000 0.000 0.924
#> GSM447463 1 0.2697 0.7583 0.812 0.000 0.000 0.000 0.000 0.188
#> GSM447467 6 0.7221 0.0107 0.092 0.172 0.000 0.332 0.008 0.396
#> GSM447469 2 0.7187 -0.0869 0.000 0.476 0.108 0.256 0.144 0.016
#> GSM447473 1 0.0865 0.8218 0.964 0.000 0.000 0.000 0.000 0.036
#> GSM447404 1 0.0865 0.8218 0.964 0.000 0.000 0.000 0.000 0.036
#> GSM447406 4 0.5190 0.4183 0.000 0.376 0.000 0.528 0.096 0.000
#> GSM447407 4 0.5937 -0.1516 0.000 0.368 0.000 0.416 0.216 0.000
#> GSM447409 1 0.0260 0.8049 0.992 0.000 0.000 0.000 0.000 0.008
#> GSM447412 3 0.0260 0.7873 0.000 0.008 0.992 0.000 0.000 0.000
#> GSM447426 5 0.3198 0.4200 0.000 0.000 0.260 0.000 0.740 0.000
#> GSM447433 1 0.3194 0.7064 0.828 0.032 0.000 0.008 0.000 0.132
#> GSM447439 4 0.5190 0.4183 0.000 0.376 0.000 0.528 0.096 0.000
#> GSM447441 3 0.0000 0.7867 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM447443 6 0.1267 0.7878 0.060 0.000 0.000 0.000 0.000 0.940
#> GSM447445 1 0.4586 0.6768 0.712 0.008 0.000 0.064 0.008 0.208
#> GSM447446 6 0.3820 0.5505 0.284 0.008 0.000 0.008 0.000 0.700
#> GSM447453 1 0.3737 0.3981 0.608 0.000 0.000 0.000 0.000 0.392
#> GSM447455 3 0.6102 0.4437 0.000 0.172 0.540 0.264 0.012 0.012
#> GSM447456 2 0.5134 0.2910 0.012 0.520 0.000 0.412 0.000 0.056
#> GSM447459 4 0.5067 0.4381 0.000 0.436 0.000 0.488 0.076 0.000
#> GSM447466 1 0.1007 0.8233 0.956 0.000 0.000 0.000 0.000 0.044
#> GSM447470 4 0.6287 -0.3887 0.016 0.400 0.024 0.460 0.004 0.096
#> GSM447474 6 0.1204 0.7876 0.056 0.000 0.000 0.000 0.000 0.944
#> GSM447475 2 0.4801 0.3242 0.000 0.552 0.020 0.408 0.004 0.016
#> GSM447398 2 0.3765 0.3176 0.000 0.596 0.000 0.404 0.000 0.000
#> GSM447399 3 0.6004 0.0171 0.000 0.284 0.436 0.280 0.000 0.000
#> GSM447408 2 0.0909 0.1693 0.000 0.968 0.000 0.012 0.020 0.000
#> GSM447410 2 0.0725 0.2136 0.012 0.976 0.000 0.000 0.000 0.012
#> GSM447414 3 0.1765 0.7671 0.000 0.024 0.924 0.052 0.000 0.000
#> GSM447417 2 0.7210 -0.1106 0.000 0.468 0.100 0.260 0.156 0.016
#> GSM447419 6 0.1141 0.7879 0.052 0.000 0.000 0.000 0.000 0.948
#> GSM447420 6 0.1204 0.7876 0.056 0.000 0.000 0.000 0.000 0.944
#> GSM447421 6 0.1714 0.7646 0.092 0.000 0.000 0.000 0.000 0.908
#> GSM447423 3 0.0458 0.7858 0.000 0.016 0.984 0.000 0.000 0.000
#> GSM447436 6 0.3791 0.5302 0.300 0.008 0.000 0.004 0.000 0.688
#> GSM447437 1 0.2697 0.7583 0.812 0.000 0.000 0.000 0.000 0.188
#> GSM447438 2 0.3988 0.1203 0.012 0.660 0.000 0.000 0.004 0.324
#> GSM447447 6 0.3820 0.5505 0.284 0.008 0.000 0.008 0.000 0.700
#> GSM447454 3 0.2451 0.7492 0.000 0.060 0.884 0.056 0.000 0.000
#> GSM447457 3 0.0458 0.7858 0.000 0.016 0.984 0.000 0.000 0.000
#> GSM447460 3 0.4386 0.6721 0.000 0.060 0.752 0.164 0.012 0.012
#> GSM447465 3 0.0260 0.7855 0.000 0.000 0.992 0.000 0.008 0.000
#> GSM447471 1 0.0865 0.8218 0.964 0.000 0.000 0.000 0.000 0.036
#> GSM447476 2 0.0725 0.2136 0.012 0.976 0.000 0.000 0.000 0.012
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
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 gender(p) agent(p) k
#> CV:hclust 76 0.841 0.6435 2
#> CV:hclust 71 0.703 0.2166 3
#> CV:hclust 58 0.687 0.4673 4
#> CV:hclust 59 0.929 0.0913 5
#> CV:hclust 46 0.939 0.1416 6
If matrix rows can be associated to genes, consider to use functional_enrichment(res,
...)
to perform function enrichment for the signature genes. See this vignette for more detailed explanations.
The object with results only for a single top-value method and a single partition method can be extracted as:
res = res_list["CV", "kmeans"]
# you can also extract it by
# res = res_list["CV:kmeans"]
A summary of res
and all the functions that can be applied to it:
res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#> On a matrix with 51941 rows and 79 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'CV' method.
#> Subgroups are detected by 'kmeans' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 2.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
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.970 0.989 0.5056 0.494 0.494
#> 3 3 0.617 0.741 0.824 0.2807 0.812 0.635
#> 4 4 0.540 0.534 0.741 0.1233 0.908 0.745
#> 5 5 0.569 0.518 0.692 0.0704 0.843 0.507
#> 6 6 0.622 0.603 0.726 0.0494 0.918 0.640
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
#> GSM447401 2 0.0000 0.992 0.000 1.000
#> GSM447411 1 0.0000 0.984 1.000 0.000
#> GSM447413 2 0.0000 0.992 0.000 1.000
#> GSM447415 1 0.0000 0.984 1.000 0.000
#> GSM447416 2 0.0000 0.992 0.000 1.000
#> GSM447425 2 0.0000 0.992 0.000 1.000
#> GSM447430 2 0.0000 0.992 0.000 1.000
#> GSM447435 1 0.0000 0.984 1.000 0.000
#> GSM447440 1 0.0000 0.984 1.000 0.000
#> GSM447444 1 0.0000 0.984 1.000 0.000
#> GSM447448 1 0.0000 0.984 1.000 0.000
#> GSM447449 2 0.0000 0.992 0.000 1.000
#> GSM447450 1 0.0000 0.984 1.000 0.000
#> GSM447452 2 0.0000 0.992 0.000 1.000
#> GSM447458 2 0.0000 0.992 0.000 1.000
#> GSM447461 2 0.0000 0.992 0.000 1.000
#> GSM447464 1 0.0000 0.984 1.000 0.000
#> GSM447468 1 0.0000 0.984 1.000 0.000
#> GSM447472 1 0.0000 0.984 1.000 0.000
#> GSM447400 1 0.0000 0.984 1.000 0.000
#> GSM447402 2 0.0000 0.992 0.000 1.000
#> GSM447403 1 0.0000 0.984 1.000 0.000
#> GSM447405 1 0.0000 0.984 1.000 0.000
#> GSM447418 2 0.0000 0.992 0.000 1.000
#> GSM447422 2 0.0000 0.992 0.000 1.000
#> GSM447424 2 0.0000 0.992 0.000 1.000
#> GSM447427 2 0.0000 0.992 0.000 1.000
#> GSM447428 1 0.9954 0.143 0.540 0.460
#> GSM447429 1 0.0000 0.984 1.000 0.000
#> GSM447431 2 0.0000 0.992 0.000 1.000
#> GSM447432 2 0.0000 0.992 0.000 1.000
#> GSM447434 1 0.0000 0.984 1.000 0.000
#> GSM447442 2 0.0000 0.992 0.000 1.000
#> GSM447451 2 0.0376 0.988 0.004 0.996
#> GSM447462 1 0.0000 0.984 1.000 0.000
#> GSM447463 1 0.0000 0.984 1.000 0.000
#> GSM447467 1 0.5294 0.854 0.880 0.120
#> GSM447469 2 0.0000 0.992 0.000 1.000
#> GSM447473 1 0.0000 0.984 1.000 0.000
#> GSM447404 1 0.0000 0.984 1.000 0.000
#> GSM447406 2 0.0000 0.992 0.000 1.000
#> GSM447407 2 0.0000 0.992 0.000 1.000
#> GSM447409 1 0.0000 0.984 1.000 0.000
#> GSM447412 2 0.0000 0.992 0.000 1.000
#> GSM447426 2 0.0000 0.992 0.000 1.000
#> GSM447433 1 0.0000 0.984 1.000 0.000
#> GSM447439 2 0.0000 0.992 0.000 1.000
#> GSM447441 2 0.0000 0.992 0.000 1.000
#> GSM447443 1 0.0000 0.984 1.000 0.000
#> GSM447445 1 0.0000 0.984 1.000 0.000
#> GSM447446 1 0.0000 0.984 1.000 0.000
#> GSM447453 1 0.0000 0.984 1.000 0.000
#> GSM447455 2 0.0000 0.992 0.000 1.000
#> GSM447456 1 0.0000 0.984 1.000 0.000
#> GSM447459 2 0.0000 0.992 0.000 1.000
#> GSM447466 1 0.0000 0.984 1.000 0.000
#> GSM447470 1 0.0000 0.984 1.000 0.000
#> GSM447474 1 0.0000 0.984 1.000 0.000
#> GSM447475 2 0.3274 0.931 0.060 0.940
#> GSM447398 2 0.0000 0.992 0.000 1.000
#> GSM447399 2 0.0000 0.992 0.000 1.000
#> GSM447408 2 0.0000 0.992 0.000 1.000
#> GSM447410 2 0.0000 0.992 0.000 1.000
#> GSM447414 2 0.0000 0.992 0.000 1.000
#> GSM447417 2 0.0000 0.992 0.000 1.000
#> GSM447419 1 0.0000 0.984 1.000 0.000
#> GSM447420 1 0.0000 0.984 1.000 0.000
#> GSM447421 1 0.0000 0.984 1.000 0.000
#> GSM447423 2 0.0000 0.992 0.000 1.000
#> GSM447436 1 0.0000 0.984 1.000 0.000
#> GSM447437 1 0.0000 0.984 1.000 0.000
#> GSM447438 2 0.0000 0.992 0.000 1.000
#> GSM447447 1 0.0000 0.984 1.000 0.000
#> GSM447454 2 0.0000 0.992 0.000 1.000
#> GSM447457 2 0.0000 0.992 0.000 1.000
#> GSM447460 2 0.0000 0.992 0.000 1.000
#> GSM447465 2 0.0000 0.992 0.000 1.000
#> GSM447471 1 0.0000 0.984 1.000 0.000
#> GSM447476 2 0.8327 0.637 0.264 0.736
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM447401 3 0.3038 0.718 0.000 0.104 0.896
#> GSM447411 1 0.1031 0.910 0.976 0.024 0.000
#> GSM447413 3 0.2959 0.723 0.000 0.100 0.900
#> GSM447415 1 0.1163 0.907 0.972 0.028 0.000
#> GSM447416 3 0.0892 0.759 0.000 0.020 0.980
#> GSM447425 2 0.5443 0.769 0.004 0.736 0.260
#> GSM447430 2 0.5397 0.775 0.000 0.720 0.280
#> GSM447435 1 0.1031 0.910 0.976 0.024 0.000
#> GSM447440 1 0.2066 0.913 0.940 0.060 0.000
#> GSM447444 1 0.4931 0.856 0.784 0.212 0.004
#> GSM447448 1 0.3686 0.895 0.860 0.140 0.000
#> GSM447449 3 0.1860 0.738 0.000 0.052 0.948
#> GSM447450 1 0.1411 0.912 0.964 0.036 0.000
#> GSM447452 2 0.5363 0.773 0.000 0.724 0.276
#> GSM447458 2 0.6286 0.439 0.000 0.536 0.464
#> GSM447461 3 0.6168 0.218 0.000 0.412 0.588
#> GSM447464 1 0.2066 0.908 0.940 0.060 0.000
#> GSM447468 1 0.1643 0.908 0.956 0.044 0.000
#> GSM447472 1 0.4178 0.882 0.828 0.172 0.000
#> GSM447400 1 0.3941 0.897 0.844 0.156 0.000
#> GSM447402 2 0.5706 0.739 0.000 0.680 0.320
#> GSM447403 1 0.1163 0.907 0.972 0.028 0.000
#> GSM447405 1 0.4235 0.879 0.824 0.176 0.000
#> GSM447418 3 0.0000 0.760 0.000 0.000 1.000
#> GSM447422 3 0.0000 0.760 0.000 0.000 1.000
#> GSM447424 3 0.2448 0.737 0.000 0.076 0.924
#> GSM447427 3 0.0892 0.758 0.000 0.020 0.980
#> GSM447428 3 0.7692 0.465 0.108 0.224 0.668
#> GSM447429 1 0.1753 0.908 0.952 0.048 0.000
#> GSM447431 3 0.0747 0.759 0.000 0.016 0.984
#> GSM447432 3 0.5560 0.302 0.000 0.300 0.700
#> GSM447434 1 0.4452 0.872 0.808 0.192 0.000
#> GSM447442 3 0.5529 0.256 0.000 0.296 0.704
#> GSM447451 3 0.5785 0.485 0.000 0.332 0.668
#> GSM447462 1 0.4002 0.897 0.840 0.160 0.000
#> GSM447463 1 0.1031 0.910 0.976 0.024 0.000
#> GSM447467 3 0.9787 0.118 0.328 0.248 0.424
#> GSM447469 2 0.5650 0.770 0.000 0.688 0.312
#> GSM447473 1 0.1163 0.907 0.972 0.028 0.000
#> GSM447404 1 0.1163 0.907 0.972 0.028 0.000
#> GSM447406 2 0.5397 0.775 0.000 0.720 0.280
#> GSM447407 2 0.5363 0.773 0.000 0.724 0.276
#> GSM447409 1 0.1031 0.910 0.976 0.024 0.000
#> GSM447412 3 0.1289 0.754 0.000 0.032 0.968
#> GSM447426 3 0.3038 0.718 0.000 0.104 0.896
#> GSM447433 1 0.4399 0.877 0.812 0.188 0.000
#> GSM447439 2 0.5397 0.775 0.000 0.720 0.280
#> GSM447441 3 0.1289 0.749 0.000 0.032 0.968
#> GSM447443 1 0.3551 0.902 0.868 0.132 0.000
#> GSM447445 1 0.1031 0.910 0.976 0.024 0.000
#> GSM447446 1 0.3482 0.899 0.872 0.128 0.000
#> GSM447453 1 0.0592 0.911 0.988 0.012 0.000
#> GSM447455 3 0.5529 0.256 0.000 0.296 0.704
#> GSM447456 2 0.6062 0.303 0.276 0.708 0.016
#> GSM447459 2 0.5397 0.775 0.000 0.720 0.280
#> GSM447466 1 0.1031 0.910 0.976 0.024 0.000
#> GSM447470 1 0.4978 0.856 0.780 0.216 0.004
#> GSM447474 1 0.4931 0.859 0.784 0.212 0.004
#> GSM447475 3 0.6683 0.145 0.008 0.492 0.500
#> GSM447398 2 0.4842 0.678 0.000 0.776 0.224
#> GSM447399 2 0.6309 0.501 0.000 0.500 0.500
#> GSM447408 2 0.5926 0.740 0.000 0.644 0.356
#> GSM447410 2 0.5497 0.725 0.000 0.708 0.292
#> GSM447414 3 0.2796 0.729 0.000 0.092 0.908
#> GSM447417 2 0.5882 0.759 0.000 0.652 0.348
#> GSM447419 1 0.4504 0.879 0.804 0.196 0.000
#> GSM447420 1 0.9728 0.180 0.408 0.224 0.368
#> GSM447421 1 0.2066 0.908 0.940 0.060 0.000
#> GSM447423 3 0.1529 0.751 0.000 0.040 0.960
#> GSM447436 1 0.2356 0.911 0.928 0.072 0.000
#> GSM447437 1 0.1031 0.910 0.976 0.024 0.000
#> GSM447438 2 0.4346 0.639 0.000 0.816 0.184
#> GSM447447 1 0.4291 0.878 0.820 0.180 0.000
#> GSM447454 3 0.1411 0.753 0.000 0.036 0.964
#> GSM447457 3 0.1964 0.741 0.000 0.056 0.944
#> GSM447460 3 0.3482 0.715 0.000 0.128 0.872
#> GSM447465 3 0.2537 0.736 0.000 0.080 0.920
#> GSM447471 1 0.1163 0.907 0.972 0.028 0.000
#> GSM447476 2 0.4563 0.572 0.036 0.852 0.112
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM447401 3 0.4364 0.6315 0.000 0.056 0.808 0.136
#> GSM447411 1 0.0804 0.7139 0.980 0.012 0.000 0.008
#> GSM447413 3 0.2281 0.7010 0.000 0.000 0.904 0.096
#> GSM447415 1 0.2675 0.7074 0.892 0.100 0.000 0.008
#> GSM447416 3 0.0188 0.7431 0.000 0.000 0.996 0.004
#> GSM447425 4 0.4419 0.7622 0.000 0.104 0.084 0.812
#> GSM447430 4 0.2466 0.7858 0.000 0.004 0.096 0.900
#> GSM447435 1 0.0804 0.7139 0.980 0.012 0.000 0.008
#> GSM447440 1 0.3271 0.6863 0.856 0.132 0.000 0.012
#> GSM447444 2 0.5147 -0.1923 0.460 0.536 0.000 0.004
#> GSM447448 1 0.5110 0.4668 0.636 0.352 0.000 0.012
#> GSM447449 3 0.5052 0.6374 0.000 0.244 0.720 0.036
#> GSM447450 1 0.2179 0.7121 0.924 0.064 0.000 0.012
#> GSM447452 4 0.3117 0.7749 0.000 0.028 0.092 0.880
#> GSM447458 2 0.8749 -0.3271 0.036 0.340 0.324 0.300
#> GSM447461 3 0.7679 0.2178 0.000 0.376 0.408 0.216
#> GSM447464 1 0.4638 0.6750 0.776 0.180 0.000 0.044
#> GSM447468 1 0.4361 0.6772 0.772 0.208 0.000 0.020
#> GSM447472 1 0.5172 0.3965 0.588 0.404 0.000 0.008
#> GSM447400 1 0.5873 0.4696 0.548 0.416 0.000 0.036
#> GSM447402 4 0.6162 0.7435 0.000 0.168 0.156 0.676
#> GSM447403 1 0.2882 0.7083 0.892 0.084 0.000 0.024
#> GSM447405 1 0.5657 0.3283 0.540 0.436 0.000 0.024
#> GSM447418 3 0.0000 0.7437 0.000 0.000 1.000 0.000
#> GSM447422 3 0.0000 0.7437 0.000 0.000 1.000 0.000
#> GSM447424 3 0.1557 0.7233 0.000 0.000 0.944 0.056
#> GSM447427 3 0.0469 0.7434 0.000 0.000 0.988 0.012
#> GSM447428 3 0.6309 -0.0954 0.048 0.452 0.496 0.004
#> GSM447429 1 0.5131 0.6257 0.692 0.280 0.000 0.028
#> GSM447431 3 0.0927 0.7437 0.000 0.008 0.976 0.016
#> GSM447432 3 0.7474 0.3259 0.000 0.280 0.500 0.220
#> GSM447434 1 0.5167 0.2811 0.508 0.488 0.000 0.004
#> GSM447442 3 0.7315 0.3398 0.000 0.252 0.532 0.216
#> GSM447451 2 0.5905 0.0417 0.000 0.636 0.304 0.060
#> GSM447462 1 0.5873 0.4693 0.548 0.416 0.000 0.036
#> GSM447463 1 0.1406 0.7144 0.960 0.024 0.000 0.016
#> GSM447467 2 0.5652 0.3609 0.068 0.756 0.144 0.032
#> GSM447469 4 0.5556 0.7578 0.000 0.092 0.188 0.720
#> GSM447473 1 0.2882 0.7083 0.892 0.084 0.000 0.024
#> GSM447404 1 0.2742 0.7064 0.900 0.076 0.000 0.024
#> GSM447406 4 0.2466 0.7858 0.000 0.004 0.096 0.900
#> GSM447407 4 0.3015 0.7753 0.000 0.024 0.092 0.884
#> GSM447409 1 0.0672 0.7126 0.984 0.008 0.000 0.008
#> GSM447412 3 0.2060 0.7305 0.000 0.052 0.932 0.016
#> GSM447426 3 0.4364 0.6315 0.000 0.056 0.808 0.136
#> GSM447433 1 0.5523 0.3903 0.596 0.380 0.000 0.024
#> GSM447439 4 0.2466 0.7858 0.000 0.004 0.096 0.900
#> GSM447441 3 0.4745 0.6703 0.000 0.208 0.756 0.036
#> GSM447443 1 0.5337 0.4737 0.564 0.424 0.000 0.012
#> GSM447445 1 0.1706 0.7083 0.948 0.036 0.000 0.016
#> GSM447446 1 0.5386 0.4356 0.612 0.368 0.000 0.020
#> GSM447453 1 0.2635 0.6983 0.904 0.076 0.000 0.020
#> GSM447455 3 0.7315 0.3398 0.000 0.252 0.532 0.216
#> GSM447456 2 0.6747 0.1446 0.140 0.596 0.000 0.264
#> GSM447459 4 0.2466 0.7858 0.000 0.004 0.096 0.900
#> GSM447466 1 0.2111 0.7146 0.932 0.044 0.000 0.024
#> GSM447470 2 0.5155 -0.1967 0.468 0.528 0.000 0.004
#> GSM447474 2 0.5161 -0.2338 0.476 0.520 0.000 0.004
#> GSM447475 2 0.5963 0.1639 0.008 0.676 0.252 0.064
#> GSM447398 4 0.7090 0.4833 0.000 0.372 0.132 0.496
#> GSM447399 4 0.7677 0.1705 0.000 0.216 0.372 0.412
#> GSM447408 4 0.5226 0.7550 0.000 0.076 0.180 0.744
#> GSM447410 4 0.6065 0.7171 0.000 0.176 0.140 0.684
#> GSM447414 3 0.1716 0.7195 0.000 0.000 0.936 0.064
#> GSM447417 4 0.5672 0.7655 0.000 0.100 0.188 0.712
#> GSM447419 2 0.5399 -0.3712 0.468 0.520 0.000 0.012
#> GSM447420 2 0.7277 0.2185 0.184 0.556 0.256 0.004
#> GSM447421 1 0.5736 0.5787 0.628 0.328 0.000 0.044
#> GSM447423 3 0.1975 0.7321 0.000 0.048 0.936 0.016
#> GSM447436 1 0.5085 0.5211 0.676 0.304 0.000 0.020
#> GSM447437 1 0.1297 0.7135 0.964 0.020 0.000 0.016
#> GSM447438 4 0.6172 0.6498 0.000 0.284 0.084 0.632
#> GSM447447 1 0.5838 0.3060 0.524 0.444 0.000 0.032
#> GSM447454 3 0.4690 0.6640 0.000 0.260 0.724 0.016
#> GSM447457 3 0.4630 0.6683 0.000 0.252 0.732 0.016
#> GSM447460 3 0.5582 0.6794 0.000 0.168 0.724 0.108
#> GSM447465 3 0.4037 0.7247 0.000 0.112 0.832 0.056
#> GSM447471 1 0.2882 0.7083 0.892 0.084 0.000 0.024
#> GSM447476 4 0.6275 0.6143 0.008 0.316 0.060 0.616
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM447401 3 0.659 0.6728 0.000 0.200 0.600 0.152 0.048
#> GSM447411 1 0.131 0.6221 0.956 0.000 0.024 0.000 0.020
#> GSM447413 3 0.582 0.8200 0.000 0.316 0.584 0.092 0.008
#> GSM447415 1 0.338 0.5874 0.840 0.000 0.056 0.000 0.104
#> GSM447416 3 0.469 0.8527 0.000 0.392 0.592 0.008 0.008
#> GSM447425 4 0.415 0.7311 0.000 0.016 0.064 0.804 0.116
#> GSM447430 4 0.149 0.7700 0.000 0.040 0.008 0.948 0.004
#> GSM447435 1 0.112 0.6219 0.964 0.000 0.020 0.000 0.016
#> GSM447440 1 0.389 0.4988 0.796 0.004 0.040 0.000 0.160
#> GSM447444 5 0.499 0.4587 0.340 0.044 0.000 0.000 0.616
#> GSM447448 1 0.527 0.0365 0.552 0.000 0.052 0.000 0.396
#> GSM447449 2 0.247 0.5444 0.000 0.896 0.072 0.032 0.000
#> GSM447450 1 0.355 0.5537 0.832 0.004 0.048 0.000 0.116
#> GSM447452 4 0.269 0.7611 0.000 0.028 0.028 0.900 0.044
#> GSM447458 2 0.415 0.6438 0.000 0.804 0.012 0.092 0.092
#> GSM447461 2 0.480 0.6321 0.000 0.772 0.040 0.084 0.104
#> GSM447464 1 0.573 0.1547 0.612 0.000 0.112 0.004 0.272
#> GSM447468 1 0.584 -0.1096 0.516 0.000 0.100 0.000 0.384
#> GSM447472 5 0.504 0.3857 0.452 0.000 0.032 0.000 0.516
#> GSM447400 5 0.570 0.4331 0.380 0.000 0.088 0.000 0.532
#> GSM447402 4 0.711 0.6668 0.000 0.200 0.096 0.564 0.140
#> GSM447403 1 0.364 0.5871 0.832 0.004 0.084 0.000 0.080
#> GSM447405 5 0.700 0.0597 0.360 0.008 0.140 0.024 0.468
#> GSM447418 3 0.490 0.8501 0.000 0.400 0.576 0.008 0.016
#> GSM447422 3 0.494 0.8383 0.000 0.420 0.556 0.008 0.016
#> GSM447424 3 0.552 0.8413 0.000 0.348 0.584 0.060 0.008
#> GSM447427 3 0.465 0.8468 0.000 0.404 0.580 0.000 0.016
#> GSM447428 5 0.650 0.1041 0.044 0.072 0.408 0.000 0.476
#> GSM447429 1 0.571 0.0353 0.544 0.000 0.092 0.000 0.364
#> GSM447431 3 0.583 0.7908 0.000 0.408 0.520 0.052 0.020
#> GSM447432 2 0.212 0.6346 0.000 0.912 0.008 0.076 0.004
#> GSM447434 5 0.552 0.4635 0.400 0.012 0.044 0.000 0.544
#> GSM447442 2 0.327 0.6103 0.000 0.848 0.056 0.096 0.000
#> GSM447451 2 0.541 0.5709 0.000 0.676 0.052 0.032 0.240
#> GSM447462 5 0.566 0.4454 0.364 0.000 0.088 0.000 0.548
#> GSM447463 1 0.143 0.6177 0.944 0.000 0.004 0.000 0.052
#> GSM447467 2 0.491 0.4117 0.016 0.572 0.008 0.000 0.404
#> GSM447469 4 0.632 0.6763 0.000 0.172 0.088 0.648 0.092
#> GSM447473 1 0.364 0.5871 0.832 0.004 0.084 0.000 0.080
#> GSM447404 1 0.340 0.5918 0.848 0.004 0.076 0.000 0.072
#> GSM447406 4 0.149 0.7700 0.000 0.040 0.008 0.948 0.004
#> GSM447407 4 0.268 0.7624 0.000 0.032 0.024 0.900 0.044
#> GSM447409 1 0.199 0.6175 0.928 0.004 0.040 0.000 0.028
#> GSM447412 3 0.470 0.8258 0.000 0.432 0.552 0.000 0.016
#> GSM447426 3 0.659 0.6728 0.000 0.200 0.600 0.152 0.048
#> GSM447433 5 0.688 0.0215 0.408 0.004 0.132 0.024 0.432
#> GSM447439 4 0.128 0.7716 0.000 0.044 0.000 0.952 0.004
#> GSM447441 2 0.304 0.4967 0.000 0.864 0.104 0.024 0.008
#> GSM447443 5 0.574 0.3756 0.404 0.000 0.088 0.000 0.508
#> GSM447445 1 0.245 0.5906 0.896 0.000 0.028 0.000 0.076
#> GSM447446 1 0.679 -0.0239 0.436 0.000 0.140 0.024 0.400
#> GSM447453 1 0.389 0.5423 0.800 0.000 0.064 0.000 0.136
#> GSM447455 2 0.285 0.6237 0.000 0.872 0.036 0.092 0.000
#> GSM447456 2 0.843 0.2499 0.076 0.372 0.048 0.144 0.360
#> GSM447459 4 0.149 0.7700 0.000 0.040 0.008 0.948 0.004
#> GSM447466 1 0.140 0.6177 0.952 0.000 0.024 0.000 0.024
#> GSM447470 5 0.464 0.5087 0.324 0.028 0.000 0.000 0.648
#> GSM447474 5 0.544 0.5262 0.320 0.016 0.048 0.000 0.616
#> GSM447475 2 0.556 0.5504 0.000 0.652 0.052 0.032 0.264
#> GSM447398 2 0.662 0.3102 0.000 0.560 0.032 0.264 0.144
#> GSM447399 2 0.588 0.4845 0.000 0.632 0.092 0.252 0.024
#> GSM447408 4 0.479 0.6924 0.000 0.212 0.032 0.728 0.028
#> GSM447410 4 0.657 0.5837 0.000 0.256 0.044 0.580 0.120
#> GSM447414 3 0.555 0.8378 0.000 0.340 0.588 0.064 0.008
#> GSM447417 4 0.580 0.7391 0.000 0.156 0.060 0.692 0.092
#> GSM447419 5 0.550 0.4771 0.340 0.000 0.080 0.000 0.580
#> GSM447420 5 0.594 0.4242 0.084 0.032 0.252 0.000 0.632
#> GSM447421 1 0.616 -0.1876 0.472 0.000 0.116 0.004 0.408
#> GSM447423 3 0.485 0.7828 0.000 0.424 0.552 0.000 0.024
#> GSM447436 1 0.665 0.1611 0.516 0.000 0.140 0.024 0.320
#> GSM447437 1 0.128 0.6175 0.952 0.000 0.004 0.000 0.044
#> GSM447438 4 0.717 0.5483 0.000 0.204 0.068 0.540 0.188
#> GSM447447 1 0.596 -0.1414 0.456 0.000 0.092 0.004 0.448
#> GSM447454 2 0.298 0.5307 0.000 0.860 0.108 0.000 0.032
#> GSM447457 2 0.285 0.5142 0.000 0.868 0.104 0.000 0.028
#> GSM447460 2 0.448 0.3658 0.000 0.764 0.144 0.088 0.004
#> GSM447465 2 0.519 -0.0981 0.000 0.660 0.272 0.060 0.008
#> GSM447471 1 0.364 0.5871 0.832 0.004 0.084 0.000 0.080
#> GSM447476 4 0.760 0.5357 0.000 0.184 0.088 0.480 0.248
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM447401 3 0.5563 0.653 0.000 0.020 0.684 0.100 0.148 0.048
#> GSM447411 1 0.1363 0.713 0.952 0.004 0.004 0.000 0.028 0.012
#> GSM447413 3 0.2351 0.820 0.000 0.000 0.900 0.036 0.052 0.012
#> GSM447415 1 0.4253 0.655 0.752 0.016 0.004 0.000 0.052 0.176
#> GSM447416 3 0.0767 0.835 0.000 0.012 0.976 0.000 0.008 0.004
#> GSM447425 4 0.4310 0.615 0.000 0.016 0.000 0.656 0.312 0.016
#> GSM447430 4 0.0520 0.740 0.000 0.008 0.008 0.984 0.000 0.000
#> GSM447435 1 0.1553 0.713 0.944 0.008 0.004 0.000 0.032 0.012
#> GSM447440 1 0.4365 0.565 0.772 0.024 0.008 0.000 0.108 0.088
#> GSM447444 6 0.7035 0.196 0.216 0.152 0.000 0.000 0.156 0.476
#> GSM447448 1 0.6489 -0.295 0.492 0.044 0.000 0.000 0.252 0.212
#> GSM447449 2 0.4060 0.617 0.000 0.680 0.296 0.008 0.016 0.000
#> GSM447450 1 0.3964 0.608 0.800 0.016 0.008 0.000 0.096 0.080
#> GSM447452 4 0.1728 0.727 0.000 0.004 0.000 0.924 0.064 0.008
#> GSM447458 2 0.3930 0.687 0.004 0.804 0.124 0.036 0.024 0.008
#> GSM447461 2 0.3884 0.668 0.000 0.820 0.088 0.024 0.032 0.036
#> GSM447464 6 0.5120 0.402 0.408 0.008 0.004 0.000 0.052 0.528
#> GSM447468 6 0.4410 0.665 0.216 0.016 0.000 0.000 0.052 0.716
#> GSM447472 6 0.5692 0.520 0.300 0.036 0.000 0.000 0.092 0.572
#> GSM447400 6 0.3187 0.686 0.188 0.000 0.004 0.000 0.012 0.796
#> GSM447402 4 0.6823 0.533 0.000 0.264 0.020 0.404 0.296 0.016
#> GSM447403 1 0.5004 0.608 0.696 0.028 0.000 0.000 0.120 0.156
#> GSM447405 5 0.6028 0.855 0.224 0.044 0.000 0.000 0.576 0.156
#> GSM447418 3 0.0964 0.831 0.000 0.016 0.968 0.000 0.012 0.004
#> GSM447422 3 0.1801 0.812 0.000 0.056 0.924 0.000 0.016 0.004
#> GSM447424 3 0.0653 0.832 0.000 0.004 0.980 0.012 0.000 0.004
#> GSM447427 3 0.1078 0.832 0.000 0.016 0.964 0.000 0.012 0.008
#> GSM447428 6 0.5573 0.206 0.004 0.048 0.408 0.000 0.036 0.504
#> GSM447429 6 0.4466 0.471 0.352 0.004 0.000 0.000 0.032 0.612
#> GSM447431 3 0.3442 0.792 0.000 0.036 0.848 0.020 0.072 0.024
#> GSM447432 2 0.3781 0.679 0.000 0.772 0.184 0.028 0.016 0.000
#> GSM447434 6 0.5772 0.591 0.184 0.068 0.000 0.000 0.116 0.632
#> GSM447442 2 0.4290 0.643 0.000 0.696 0.260 0.028 0.016 0.000
#> GSM447451 2 0.3276 0.655 0.000 0.856 0.056 0.008 0.028 0.052
#> GSM447462 6 0.3352 0.687 0.180 0.004 0.004 0.000 0.016 0.796
#> GSM447463 1 0.0862 0.714 0.972 0.004 0.000 0.000 0.008 0.016
#> GSM447467 2 0.4029 0.575 0.012 0.772 0.016 0.000 0.028 0.172
#> GSM447469 4 0.7189 0.542 0.000 0.124 0.168 0.500 0.192 0.016
#> GSM447473 1 0.5004 0.608 0.696 0.028 0.000 0.000 0.120 0.156
#> GSM447404 1 0.4447 0.632 0.744 0.020 0.000 0.000 0.092 0.144
#> GSM447406 4 0.0976 0.734 0.000 0.008 0.008 0.968 0.016 0.000
#> GSM447407 4 0.1526 0.732 0.000 0.004 0.008 0.944 0.036 0.008
#> GSM447409 1 0.2100 0.665 0.884 0.004 0.000 0.000 0.112 0.000
#> GSM447412 3 0.3024 0.790 0.000 0.088 0.856 0.000 0.040 0.016
#> GSM447426 3 0.5563 0.653 0.000 0.020 0.684 0.100 0.148 0.048
#> GSM447433 5 0.5973 0.854 0.256 0.040 0.000 0.000 0.568 0.136
#> GSM447439 4 0.0520 0.740 0.000 0.008 0.008 0.984 0.000 0.000
#> GSM447441 2 0.5490 0.524 0.000 0.564 0.352 0.016 0.044 0.024
#> GSM447443 6 0.4081 0.679 0.172 0.016 0.000 0.000 0.052 0.760
#> GSM447445 1 0.2455 0.648 0.888 0.016 0.000 0.000 0.080 0.016
#> GSM447446 5 0.6017 0.859 0.252 0.036 0.000 0.000 0.560 0.152
#> GSM447453 1 0.5053 0.274 0.652 0.020 0.004 0.000 0.260 0.064
#> GSM447455 2 0.4150 0.659 0.000 0.720 0.236 0.028 0.016 0.000
#> GSM447456 2 0.7633 0.235 0.136 0.508 0.000 0.088 0.128 0.140
#> GSM447459 4 0.0520 0.740 0.000 0.008 0.008 0.984 0.000 0.000
#> GSM447466 1 0.1257 0.714 0.952 0.000 0.000 0.000 0.028 0.020
#> GSM447470 6 0.5877 0.495 0.216 0.092 0.000 0.000 0.080 0.612
#> GSM447474 6 0.4475 0.601 0.192 0.052 0.000 0.000 0.028 0.728
#> GSM447475 2 0.3151 0.651 0.000 0.864 0.048 0.008 0.028 0.052
#> GSM447398 2 0.5407 0.478 0.004 0.704 0.024 0.156 0.068 0.044
#> GSM447399 2 0.7129 0.483 0.000 0.452 0.312 0.144 0.064 0.028
#> GSM447408 4 0.4702 0.644 0.000 0.228 0.012 0.696 0.056 0.008
#> GSM447410 4 0.6445 0.419 0.000 0.368 0.016 0.448 0.148 0.020
#> GSM447414 3 0.2095 0.823 0.000 0.004 0.916 0.016 0.052 0.012
#> GSM447417 4 0.6112 0.660 0.000 0.160 0.036 0.604 0.184 0.016
#> GSM447419 6 0.4132 0.674 0.144 0.028 0.000 0.000 0.056 0.772
#> GSM447420 6 0.4351 0.567 0.036 0.048 0.112 0.000 0.020 0.784
#> GSM447421 6 0.4563 0.613 0.232 0.012 0.004 0.000 0.052 0.700
#> GSM447423 3 0.2734 0.736 0.000 0.148 0.840 0.000 0.004 0.008
#> GSM447436 5 0.5581 0.708 0.356 0.032 0.000 0.000 0.540 0.072
#> GSM447437 1 0.0748 0.714 0.976 0.004 0.000 0.000 0.004 0.016
#> GSM447438 4 0.6499 0.373 0.000 0.384 0.000 0.388 0.196 0.032
#> GSM447447 5 0.6773 0.719 0.316 0.056 0.000 0.000 0.424 0.204
#> GSM447454 2 0.4022 0.584 0.000 0.688 0.288 0.000 0.008 0.016
#> GSM447457 2 0.4165 0.561 0.000 0.664 0.308 0.000 0.004 0.024
#> GSM447460 2 0.5133 0.391 0.000 0.528 0.416 0.024 0.024 0.008
#> GSM447465 3 0.4034 0.192 0.000 0.336 0.648 0.012 0.000 0.004
#> GSM447471 1 0.5004 0.608 0.696 0.028 0.000 0.000 0.120 0.156
#> GSM447476 2 0.6753 -0.463 0.000 0.344 0.000 0.340 0.280 0.036
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 gender(p) agent(p) k
#> CV:kmeans 78 0.830 0.364 2
#> CV:kmeans 68 0.343 0.333 3
#> CV:kmeans 52 0.531 0.430 4
#> CV:kmeans 52 0.300 0.527 5
#> CV:kmeans 64 0.607 0.725 6
If matrix rows can be associated to genes, consider to use functional_enrichment(res,
...)
to perform function enrichment for the signature genes. See this vignette for more detailed explanations.
The object with results only for a single top-value method and a single partition method can be extracted as:
res = res_list["CV", "skmeans"]
# you can also extract it by
# res = res_list["CV:skmeans"]
A summary of res
and all the functions that can be applied to it:
res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#> On a matrix with 51941 rows and 79 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'CV' method.
#> Subgroups are detected by 'skmeans' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 2.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
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.975 0.990 0.5063 0.494 0.494
#> 3 3 0.834 0.898 0.933 0.2732 0.803 0.620
#> 4 4 0.686 0.756 0.835 0.1100 0.918 0.771
#> 5 5 0.665 0.521 0.777 0.0880 0.956 0.850
#> 6 6 0.680 0.572 0.729 0.0451 0.893 0.616
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
#> GSM447401 2 0.0000 1.000 0.000 1.000
#> GSM447411 1 0.0000 0.980 1.000 0.000
#> GSM447413 2 0.0000 1.000 0.000 1.000
#> GSM447415 1 0.0000 0.980 1.000 0.000
#> GSM447416 2 0.0000 1.000 0.000 1.000
#> GSM447425 2 0.0000 1.000 0.000 1.000
#> GSM447430 2 0.0000 1.000 0.000 1.000
#> GSM447435 1 0.0000 0.980 1.000 0.000
#> GSM447440 1 0.0000 0.980 1.000 0.000
#> GSM447444 1 0.0000 0.980 1.000 0.000
#> GSM447448 1 0.0000 0.980 1.000 0.000
#> GSM447449 2 0.0000 1.000 0.000 1.000
#> GSM447450 1 0.0000 0.980 1.000 0.000
#> GSM447452 2 0.0000 1.000 0.000 1.000
#> GSM447458 2 0.0000 1.000 0.000 1.000
#> GSM447461 2 0.0000 1.000 0.000 1.000
#> GSM447464 1 0.0000 0.980 1.000 0.000
#> GSM447468 1 0.0000 0.980 1.000 0.000
#> GSM447472 1 0.0000 0.980 1.000 0.000
#> GSM447400 1 0.0000 0.980 1.000 0.000
#> GSM447402 2 0.0000 1.000 0.000 1.000
#> GSM447403 1 0.0000 0.980 1.000 0.000
#> GSM447405 1 0.0000 0.980 1.000 0.000
#> GSM447418 2 0.0000 1.000 0.000 1.000
#> GSM447422 2 0.0000 1.000 0.000 1.000
#> GSM447424 2 0.0000 1.000 0.000 1.000
#> GSM447427 2 0.0000 1.000 0.000 1.000
#> GSM447428 1 0.9358 0.462 0.648 0.352
#> GSM447429 1 0.0000 0.980 1.000 0.000
#> GSM447431 2 0.0000 1.000 0.000 1.000
#> GSM447432 2 0.0000 1.000 0.000 1.000
#> GSM447434 1 0.0000 0.980 1.000 0.000
#> GSM447442 2 0.0000 1.000 0.000 1.000
#> GSM447451 2 0.0000 1.000 0.000 1.000
#> GSM447462 1 0.0000 0.980 1.000 0.000
#> GSM447463 1 0.0000 0.980 1.000 0.000
#> GSM447467 1 0.0000 0.980 1.000 0.000
#> GSM447469 2 0.0000 1.000 0.000 1.000
#> GSM447473 1 0.0000 0.980 1.000 0.000
#> GSM447404 1 0.0000 0.980 1.000 0.000
#> GSM447406 2 0.0000 1.000 0.000 1.000
#> GSM447407 2 0.0000 1.000 0.000 1.000
#> GSM447409 1 0.0000 0.980 1.000 0.000
#> GSM447412 2 0.0000 1.000 0.000 1.000
#> GSM447426 2 0.0000 1.000 0.000 1.000
#> GSM447433 1 0.0000 0.980 1.000 0.000
#> GSM447439 2 0.0000 1.000 0.000 1.000
#> GSM447441 2 0.0000 1.000 0.000 1.000
#> GSM447443 1 0.0000 0.980 1.000 0.000
#> GSM447445 1 0.0000 0.980 1.000 0.000
#> GSM447446 1 0.0000 0.980 1.000 0.000
#> GSM447453 1 0.0000 0.980 1.000 0.000
#> GSM447455 2 0.0000 1.000 0.000 1.000
#> GSM447456 1 0.0000 0.980 1.000 0.000
#> GSM447459 2 0.0000 1.000 0.000 1.000
#> GSM447466 1 0.0000 0.980 1.000 0.000
#> GSM447470 1 0.0000 0.980 1.000 0.000
#> GSM447474 1 0.0000 0.980 1.000 0.000
#> GSM447475 2 0.0938 0.988 0.012 0.988
#> GSM447398 2 0.0000 1.000 0.000 1.000
#> GSM447399 2 0.0000 1.000 0.000 1.000
#> GSM447408 2 0.0000 1.000 0.000 1.000
#> GSM447410 2 0.0000 1.000 0.000 1.000
#> GSM447414 2 0.0000 1.000 0.000 1.000
#> GSM447417 2 0.0000 1.000 0.000 1.000
#> GSM447419 1 0.0000 0.980 1.000 0.000
#> GSM447420 1 0.0000 0.980 1.000 0.000
#> GSM447421 1 0.0000 0.980 1.000 0.000
#> GSM447423 2 0.0000 1.000 0.000 1.000
#> GSM447436 1 0.0000 0.980 1.000 0.000
#> GSM447437 1 0.0000 0.980 1.000 0.000
#> GSM447438 2 0.0000 1.000 0.000 1.000
#> GSM447447 1 0.0000 0.980 1.000 0.000
#> GSM447454 2 0.0000 1.000 0.000 1.000
#> GSM447457 2 0.0000 1.000 0.000 1.000
#> GSM447460 2 0.0000 1.000 0.000 1.000
#> GSM447465 2 0.0000 1.000 0.000 1.000
#> GSM447471 1 0.0000 0.980 1.000 0.000
#> GSM447476 1 0.9754 0.318 0.592 0.408
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM447401 3 0.0000 0.902 0.000 0.000 1.000
#> GSM447411 1 0.0000 0.985 1.000 0.000 0.000
#> GSM447413 3 0.0000 0.902 0.000 0.000 1.000
#> GSM447415 1 0.0000 0.985 1.000 0.000 0.000
#> GSM447416 3 0.0237 0.902 0.000 0.004 0.996
#> GSM447425 2 0.4504 0.888 0.000 0.804 0.196
#> GSM447430 2 0.4504 0.888 0.000 0.804 0.196
#> GSM447435 1 0.0000 0.985 1.000 0.000 0.000
#> GSM447440 1 0.0000 0.985 1.000 0.000 0.000
#> GSM447444 1 0.0000 0.985 1.000 0.000 0.000
#> GSM447448 1 0.0000 0.985 1.000 0.000 0.000
#> GSM447449 3 0.0237 0.901 0.000 0.004 0.996
#> GSM447450 1 0.0000 0.985 1.000 0.000 0.000
#> GSM447452 2 0.4504 0.888 0.000 0.804 0.196
#> GSM447458 2 0.5431 0.802 0.000 0.716 0.284
#> GSM447461 3 0.4887 0.792 0.000 0.228 0.772
#> GSM447464 1 0.0000 0.985 1.000 0.000 0.000
#> GSM447468 1 0.0000 0.985 1.000 0.000 0.000
#> GSM447472 1 0.0000 0.985 1.000 0.000 0.000
#> GSM447400 1 0.0000 0.985 1.000 0.000 0.000
#> GSM447402 2 0.4452 0.887 0.000 0.808 0.192
#> GSM447403 1 0.0000 0.985 1.000 0.000 0.000
#> GSM447405 1 0.0424 0.978 0.992 0.008 0.000
#> GSM447418 3 0.0000 0.902 0.000 0.000 1.000
#> GSM447422 3 0.0000 0.902 0.000 0.000 1.000
#> GSM447424 3 0.0000 0.902 0.000 0.000 1.000
#> GSM447427 3 0.0000 0.902 0.000 0.000 1.000
#> GSM447428 3 0.4555 0.710 0.200 0.000 0.800
#> GSM447429 1 0.0000 0.985 1.000 0.000 0.000
#> GSM447431 3 0.0237 0.902 0.000 0.004 0.996
#> GSM447432 3 0.1411 0.879 0.000 0.036 0.964
#> GSM447434 1 0.0000 0.985 1.000 0.000 0.000
#> GSM447442 3 0.3340 0.787 0.000 0.120 0.880
#> GSM447451 3 0.4555 0.802 0.000 0.200 0.800
#> GSM447462 1 0.0000 0.985 1.000 0.000 0.000
#> GSM447463 1 0.0000 0.985 1.000 0.000 0.000
#> GSM447467 3 0.5659 0.644 0.248 0.012 0.740
#> GSM447469 2 0.4555 0.885 0.000 0.800 0.200
#> GSM447473 1 0.0000 0.985 1.000 0.000 0.000
#> GSM447404 1 0.0000 0.985 1.000 0.000 0.000
#> GSM447406 2 0.4504 0.888 0.000 0.804 0.196
#> GSM447407 2 0.4504 0.888 0.000 0.804 0.196
#> GSM447409 1 0.0000 0.985 1.000 0.000 0.000
#> GSM447412 3 0.2261 0.883 0.000 0.068 0.932
#> GSM447426 3 0.0000 0.902 0.000 0.000 1.000
#> GSM447433 1 0.1031 0.962 0.976 0.024 0.000
#> GSM447439 2 0.4504 0.888 0.000 0.804 0.196
#> GSM447441 3 0.3038 0.867 0.000 0.104 0.896
#> GSM447443 1 0.0000 0.985 1.000 0.000 0.000
#> GSM447445 1 0.0000 0.985 1.000 0.000 0.000
#> GSM447446 1 0.0000 0.985 1.000 0.000 0.000
#> GSM447453 1 0.0000 0.985 1.000 0.000 0.000
#> GSM447455 3 0.2878 0.819 0.000 0.096 0.904
#> GSM447456 2 0.5760 0.495 0.328 0.672 0.000
#> GSM447459 2 0.4504 0.888 0.000 0.804 0.196
#> GSM447466 1 0.0000 0.985 1.000 0.000 0.000
#> GSM447470 1 0.0000 0.985 1.000 0.000 0.000
#> GSM447474 1 0.0000 0.985 1.000 0.000 0.000
#> GSM447475 3 0.4842 0.794 0.000 0.224 0.776
#> GSM447398 2 0.0000 0.812 0.000 1.000 0.000
#> GSM447399 2 0.5621 0.769 0.000 0.692 0.308
#> GSM447408 2 0.0000 0.812 0.000 1.000 0.000
#> GSM447410 2 0.0000 0.812 0.000 1.000 0.000
#> GSM447414 3 0.0000 0.902 0.000 0.000 1.000
#> GSM447417 2 0.4504 0.888 0.000 0.804 0.196
#> GSM447419 1 0.0000 0.985 1.000 0.000 0.000
#> GSM447420 1 0.6168 0.247 0.588 0.000 0.412
#> GSM447421 1 0.0000 0.985 1.000 0.000 0.000
#> GSM447423 3 0.3752 0.846 0.000 0.144 0.856
#> GSM447436 1 0.0000 0.985 1.000 0.000 0.000
#> GSM447437 1 0.0000 0.985 1.000 0.000 0.000
#> GSM447438 2 0.0000 0.812 0.000 1.000 0.000
#> GSM447447 1 0.0000 0.985 1.000 0.000 0.000
#> GSM447454 3 0.3752 0.846 0.000 0.144 0.856
#> GSM447457 3 0.3752 0.846 0.000 0.144 0.856
#> GSM447460 3 0.0000 0.902 0.000 0.000 1.000
#> GSM447465 3 0.0000 0.902 0.000 0.000 1.000
#> GSM447471 1 0.0000 0.985 1.000 0.000 0.000
#> GSM447476 2 0.0000 0.812 0.000 1.000 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM447401 3 0.1474 0.7742 0.000 0.000 0.948 0.052
#> GSM447411 1 0.0000 0.9157 1.000 0.000 0.000 0.000
#> GSM447413 3 0.1389 0.7775 0.000 0.000 0.952 0.048
#> GSM447415 1 0.0469 0.9162 0.988 0.012 0.000 0.000
#> GSM447416 3 0.0817 0.7862 0.000 0.000 0.976 0.024
#> GSM447425 4 0.3485 0.8458 0.000 0.028 0.116 0.856
#> GSM447430 4 0.2589 0.8551 0.000 0.000 0.116 0.884
#> GSM447435 1 0.0000 0.9157 1.000 0.000 0.000 0.000
#> GSM447440 1 0.0188 0.9162 0.996 0.004 0.000 0.000
#> GSM447444 1 0.3688 0.8411 0.792 0.208 0.000 0.000
#> GSM447448 1 0.0592 0.9138 0.984 0.016 0.000 0.000
#> GSM447449 2 0.5923 0.6276 0.000 0.580 0.376 0.044
#> GSM447450 1 0.0188 0.9162 0.996 0.004 0.000 0.000
#> GSM447452 4 0.2773 0.8544 0.000 0.004 0.116 0.880
#> GSM447458 2 0.6683 0.6487 0.000 0.620 0.204 0.176
#> GSM447461 2 0.5993 0.6763 0.000 0.692 0.160 0.148
#> GSM447464 1 0.3444 0.8572 0.816 0.184 0.000 0.000
#> GSM447468 1 0.2868 0.8802 0.864 0.136 0.000 0.000
#> GSM447472 1 0.2081 0.9016 0.916 0.084 0.000 0.000
#> GSM447400 1 0.3873 0.8294 0.772 0.228 0.000 0.000
#> GSM447402 4 0.3581 0.8445 0.000 0.032 0.116 0.852
#> GSM447403 1 0.0469 0.9162 0.988 0.012 0.000 0.000
#> GSM447405 1 0.3587 0.8279 0.856 0.040 0.000 0.104
#> GSM447418 3 0.0188 0.7870 0.000 0.004 0.996 0.000
#> GSM447422 3 0.0188 0.7870 0.000 0.004 0.996 0.000
#> GSM447424 3 0.0336 0.7875 0.000 0.000 0.992 0.008
#> GSM447427 3 0.0336 0.7862 0.000 0.008 0.992 0.000
#> GSM447428 3 0.5880 0.4594 0.088 0.232 0.680 0.000
#> GSM447429 1 0.3610 0.8476 0.800 0.200 0.000 0.000
#> GSM447431 3 0.1624 0.7743 0.000 0.020 0.952 0.028
#> GSM447432 2 0.6054 0.6677 0.000 0.592 0.352 0.056
#> GSM447434 1 0.0592 0.9160 0.984 0.016 0.000 0.000
#> GSM447442 2 0.6412 0.6818 0.000 0.592 0.320 0.088
#> GSM447451 2 0.6098 0.6590 0.000 0.676 0.200 0.124
#> GSM447462 1 0.3942 0.8236 0.764 0.236 0.000 0.000
#> GSM447463 1 0.0707 0.9152 0.980 0.020 0.000 0.000
#> GSM447467 2 0.3745 0.5403 0.060 0.852 0.088 0.000
#> GSM447469 4 0.3271 0.8433 0.000 0.012 0.132 0.856
#> GSM447473 1 0.0469 0.9162 0.988 0.012 0.000 0.000
#> GSM447404 1 0.0469 0.9162 0.988 0.012 0.000 0.000
#> GSM447406 4 0.2918 0.8518 0.000 0.008 0.116 0.876
#> GSM447407 4 0.2773 0.8544 0.000 0.004 0.116 0.880
#> GSM447409 1 0.0188 0.9159 0.996 0.004 0.000 0.000
#> GSM447412 3 0.1209 0.7698 0.000 0.004 0.964 0.032
#> GSM447426 3 0.1474 0.7742 0.000 0.000 0.948 0.052
#> GSM447433 1 0.3674 0.8145 0.848 0.036 0.000 0.116
#> GSM447439 4 0.2589 0.8551 0.000 0.000 0.116 0.884
#> GSM447441 2 0.6489 0.5806 0.000 0.548 0.372 0.080
#> GSM447443 1 0.3172 0.8694 0.840 0.160 0.000 0.000
#> GSM447445 1 0.0592 0.9143 0.984 0.016 0.000 0.000
#> GSM447446 1 0.2408 0.8802 0.920 0.036 0.000 0.044
#> GSM447453 1 0.0469 0.9138 0.988 0.012 0.000 0.000
#> GSM447455 2 0.6412 0.6794 0.000 0.592 0.320 0.088
#> GSM447456 2 0.7734 0.1796 0.284 0.444 0.000 0.272
#> GSM447459 4 0.2589 0.8551 0.000 0.000 0.116 0.884
#> GSM447466 1 0.0188 0.9162 0.996 0.004 0.000 0.000
#> GSM447470 1 0.3356 0.8643 0.824 0.176 0.000 0.000
#> GSM447474 1 0.4072 0.8087 0.748 0.252 0.000 0.000
#> GSM447475 2 0.5770 0.6741 0.000 0.712 0.148 0.140
#> GSM447398 4 0.4996 -0.0657 0.000 0.484 0.000 0.516
#> GSM447399 4 0.5903 0.4984 0.000 0.052 0.332 0.616
#> GSM447408 4 0.1389 0.7628 0.000 0.048 0.000 0.952
#> GSM447410 4 0.2281 0.7352 0.000 0.096 0.000 0.904
#> GSM447414 3 0.0921 0.7844 0.000 0.000 0.972 0.028
#> GSM447417 4 0.2918 0.8538 0.000 0.008 0.116 0.876
#> GSM447419 1 0.5727 0.7552 0.704 0.200 0.096 0.000
#> GSM447420 3 0.7434 0.2359 0.232 0.256 0.512 0.000
#> GSM447421 1 0.3873 0.8294 0.772 0.228 0.000 0.000
#> GSM447423 3 0.2342 0.7194 0.000 0.008 0.912 0.080
#> GSM447436 1 0.2500 0.8807 0.916 0.040 0.000 0.044
#> GSM447437 1 0.0469 0.9151 0.988 0.012 0.000 0.000
#> GSM447438 4 0.2281 0.7352 0.000 0.096 0.000 0.904
#> GSM447447 1 0.1302 0.9066 0.956 0.044 0.000 0.000
#> GSM447454 3 0.5226 0.5373 0.000 0.180 0.744 0.076
#> GSM447457 3 0.5593 0.4684 0.000 0.212 0.708 0.080
#> GSM447460 3 0.6080 -0.4285 0.000 0.468 0.488 0.044
#> GSM447465 3 0.3672 0.6067 0.000 0.164 0.824 0.012
#> GSM447471 1 0.0469 0.9162 0.988 0.012 0.000 0.000
#> GSM447476 4 0.2589 0.7295 0.000 0.116 0.000 0.884
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM447401 3 0.2358 0.80373 0.000 0.000 0.888 0.104 0.008
#> GSM447411 1 0.3003 0.53997 0.812 0.000 0.000 0.000 0.188
#> GSM447413 3 0.1671 0.82525 0.000 0.000 0.924 0.076 0.000
#> GSM447415 1 0.1043 0.51601 0.960 0.000 0.000 0.000 0.040
#> GSM447416 3 0.0932 0.83951 0.000 0.004 0.972 0.020 0.004
#> GSM447425 4 0.3064 0.83438 0.000 0.000 0.036 0.856 0.108
#> GSM447430 4 0.1124 0.87001 0.000 0.004 0.036 0.960 0.000
#> GSM447435 1 0.2891 0.54103 0.824 0.000 0.000 0.000 0.176
#> GSM447440 1 0.3003 0.53703 0.812 0.000 0.000 0.000 0.188
#> GSM447444 5 0.5218 -0.35123 0.448 0.028 0.000 0.008 0.516
#> GSM447448 1 0.3999 0.43922 0.656 0.000 0.000 0.000 0.344
#> GSM447449 2 0.4938 0.69977 0.000 0.740 0.168 0.068 0.024
#> GSM447450 1 0.3074 0.53447 0.804 0.000 0.000 0.000 0.196
#> GSM447452 4 0.1568 0.87062 0.000 0.000 0.036 0.944 0.020
#> GSM447458 2 0.4689 0.70765 0.000 0.772 0.096 0.108 0.024
#> GSM447461 2 0.2067 0.68604 0.000 0.928 0.028 0.012 0.032
#> GSM447464 1 0.4238 -0.00619 0.628 0.000 0.000 0.004 0.368
#> GSM447468 1 0.2966 0.28967 0.816 0.000 0.000 0.000 0.184
#> GSM447472 1 0.2136 0.46884 0.904 0.000 0.000 0.008 0.088
#> GSM447400 1 0.4276 -0.11735 0.616 0.000 0.000 0.004 0.380
#> GSM447402 4 0.3319 0.83480 0.000 0.008 0.040 0.852 0.100
#> GSM447403 1 0.0510 0.52242 0.984 0.000 0.000 0.000 0.016
#> GSM447405 1 0.4924 0.29042 0.552 0.000 0.000 0.028 0.420
#> GSM447418 3 0.0981 0.83741 0.000 0.008 0.972 0.012 0.008
#> GSM447422 3 0.1200 0.83593 0.000 0.012 0.964 0.016 0.008
#> GSM447424 3 0.0609 0.83997 0.000 0.000 0.980 0.020 0.000
#> GSM447427 3 0.0162 0.83734 0.000 0.004 0.996 0.000 0.000
#> GSM447428 3 0.5098 0.39378 0.032 0.004 0.640 0.008 0.316
#> GSM447429 1 0.3876 0.06768 0.684 0.000 0.000 0.000 0.316
#> GSM447431 3 0.2788 0.80169 0.000 0.040 0.888 0.064 0.008
#> GSM447432 2 0.4462 0.70945 0.000 0.768 0.168 0.044 0.020
#> GSM447434 1 0.1197 0.50856 0.952 0.000 0.000 0.000 0.048
#> GSM447442 2 0.4624 0.70594 0.000 0.756 0.176 0.044 0.024
#> GSM447451 2 0.2036 0.68606 0.000 0.928 0.036 0.008 0.028
#> GSM447462 1 0.4489 -0.17473 0.572 0.000 0.000 0.008 0.420
#> GSM447463 1 0.3561 0.50800 0.740 0.000 0.000 0.000 0.260
#> GSM447467 2 0.4418 0.64751 0.020 0.760 0.016 0.008 0.196
#> GSM447469 4 0.3412 0.83031 0.000 0.008 0.096 0.848 0.048
#> GSM447473 1 0.0510 0.52242 0.984 0.000 0.000 0.000 0.016
#> GSM447404 1 0.0290 0.52305 0.992 0.000 0.000 0.000 0.008
#> GSM447406 4 0.1285 0.86943 0.000 0.004 0.036 0.956 0.004
#> GSM447407 4 0.1568 0.87062 0.000 0.000 0.036 0.944 0.020
#> GSM447409 1 0.3109 0.53887 0.800 0.000 0.000 0.000 0.200
#> GSM447412 3 0.0807 0.83628 0.000 0.012 0.976 0.012 0.000
#> GSM447426 3 0.2358 0.80373 0.000 0.000 0.888 0.104 0.008
#> GSM447433 1 0.4905 0.28663 0.500 0.000 0.000 0.024 0.476
#> GSM447439 4 0.1202 0.87018 0.000 0.004 0.032 0.960 0.004
#> GSM447441 2 0.4669 0.58504 0.000 0.692 0.272 0.024 0.012
#> GSM447443 1 0.3741 0.13401 0.732 0.000 0.000 0.004 0.264
#> GSM447445 1 0.3816 0.47261 0.696 0.000 0.000 0.000 0.304
#> GSM447446 1 0.4552 0.30316 0.524 0.000 0.000 0.008 0.468
#> GSM447453 1 0.4030 0.42715 0.648 0.000 0.000 0.000 0.352
#> GSM447455 2 0.4609 0.70367 0.000 0.756 0.172 0.056 0.016
#> GSM447456 2 0.8509 -0.01028 0.248 0.312 0.000 0.256 0.184
#> GSM447459 4 0.1124 0.87001 0.000 0.004 0.036 0.960 0.000
#> GSM447466 1 0.2732 0.54126 0.840 0.000 0.000 0.000 0.160
#> GSM447470 1 0.5049 0.22470 0.548 0.016 0.000 0.012 0.424
#> GSM447474 5 0.4902 -0.05676 0.460 0.008 0.000 0.012 0.520
#> GSM447475 2 0.0898 0.68947 0.000 0.972 0.000 0.008 0.020
#> GSM447398 2 0.4817 -0.02225 0.000 0.572 0.000 0.404 0.024
#> GSM447399 4 0.5666 0.39385 0.000 0.068 0.328 0.592 0.012
#> GSM447408 4 0.2286 0.81628 0.000 0.108 0.000 0.888 0.004
#> GSM447410 4 0.3231 0.76211 0.000 0.196 0.000 0.800 0.004
#> GSM447414 3 0.1331 0.83670 0.000 0.008 0.952 0.040 0.000
#> GSM447417 4 0.2152 0.86452 0.000 0.004 0.032 0.920 0.044
#> GSM447419 1 0.5014 -0.07550 0.628 0.000 0.032 0.008 0.332
#> GSM447420 5 0.6997 0.05680 0.172 0.008 0.388 0.012 0.420
#> GSM447421 1 0.4341 -0.15161 0.592 0.000 0.000 0.004 0.404
#> GSM447423 3 0.0880 0.82129 0.000 0.032 0.968 0.000 0.000
#> GSM447436 1 0.4425 0.31166 0.544 0.000 0.000 0.004 0.452
#> GSM447437 1 0.3534 0.50714 0.744 0.000 0.000 0.000 0.256
#> GSM447438 4 0.3530 0.75052 0.000 0.204 0.000 0.784 0.012
#> GSM447447 1 0.4403 0.34858 0.560 0.000 0.000 0.004 0.436
#> GSM447454 3 0.4178 0.51727 0.000 0.292 0.696 0.004 0.008
#> GSM447457 3 0.4390 0.14263 0.000 0.428 0.568 0.000 0.004
#> GSM447460 2 0.5668 0.39689 0.000 0.564 0.360 0.068 0.008
#> GSM447465 3 0.4794 0.42507 0.000 0.308 0.656 0.032 0.004
#> GSM447471 1 0.0510 0.52242 0.984 0.000 0.000 0.000 0.016
#> GSM447476 4 0.4747 0.73978 0.000 0.196 0.000 0.720 0.084
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM447401 3 0.2745 0.80205 0.000 0.000 0.860 0.112 0.020 0.008
#> GSM447411 1 0.0520 0.48691 0.984 0.000 0.000 0.000 0.008 0.008
#> GSM447413 3 0.2145 0.82903 0.000 0.004 0.904 0.076 0.012 0.004
#> GSM447415 1 0.4091 0.48925 0.732 0.000 0.000 0.000 0.068 0.200
#> GSM447416 3 0.0767 0.83834 0.000 0.000 0.976 0.008 0.012 0.004
#> GSM447425 4 0.3545 0.74083 0.000 0.000 0.008 0.748 0.236 0.008
#> GSM447430 4 0.0405 0.83348 0.000 0.000 0.008 0.988 0.004 0.000
#> GSM447435 1 0.0914 0.49299 0.968 0.000 0.000 0.000 0.016 0.016
#> GSM447440 1 0.1865 0.48131 0.920 0.000 0.000 0.000 0.040 0.040
#> GSM447444 1 0.6463 -0.14776 0.508 0.056 0.000 0.000 0.268 0.168
#> GSM447448 1 0.4223 0.16996 0.704 0.000 0.000 0.000 0.236 0.060
#> GSM447449 2 0.3697 0.72307 0.000 0.812 0.104 0.068 0.012 0.004
#> GSM447450 1 0.1794 0.48668 0.924 0.000 0.000 0.000 0.040 0.036
#> GSM447452 4 0.1655 0.83195 0.000 0.000 0.008 0.932 0.052 0.008
#> GSM447458 2 0.3665 0.72133 0.000 0.820 0.068 0.092 0.012 0.008
#> GSM447461 2 0.5128 0.64152 0.000 0.696 0.020 0.020 0.188 0.076
#> GSM447464 6 0.3971 0.47792 0.448 0.000 0.000 0.000 0.004 0.548
#> GSM447468 1 0.4948 0.08824 0.564 0.000 0.000 0.000 0.076 0.360
#> GSM447472 1 0.5208 0.34991 0.608 0.000 0.000 0.000 0.156 0.236
#> GSM447400 6 0.3265 0.70233 0.248 0.000 0.000 0.000 0.004 0.748
#> GSM447402 4 0.3952 0.73709 0.000 0.024 0.004 0.740 0.224 0.008
#> GSM447403 1 0.4403 0.47536 0.708 0.000 0.000 0.000 0.096 0.196
#> GSM447405 5 0.4498 0.83193 0.428 0.000 0.000 0.004 0.544 0.024
#> GSM447418 3 0.1708 0.83460 0.000 0.040 0.932 0.024 0.004 0.000
#> GSM447422 3 0.2309 0.81439 0.000 0.084 0.888 0.028 0.000 0.000
#> GSM447424 3 0.0632 0.84025 0.000 0.000 0.976 0.024 0.000 0.000
#> GSM447427 3 0.0508 0.83685 0.000 0.012 0.984 0.000 0.004 0.000
#> GSM447428 3 0.5187 0.46469 0.016 0.004 0.608 0.000 0.064 0.308
#> GSM447429 6 0.4107 0.64438 0.280 0.000 0.000 0.000 0.036 0.684
#> GSM447431 3 0.3683 0.79005 0.000 0.020 0.836 0.064 0.048 0.032
#> GSM447432 2 0.3641 0.72229 0.000 0.812 0.120 0.052 0.004 0.012
#> GSM447434 1 0.4668 0.46617 0.680 0.000 0.000 0.000 0.116 0.204
#> GSM447442 2 0.3463 0.72132 0.000 0.816 0.120 0.056 0.000 0.008
#> GSM447451 2 0.5422 0.63988 0.000 0.668 0.040 0.012 0.204 0.076
#> GSM447462 6 0.3073 0.69859 0.204 0.000 0.000 0.000 0.008 0.788
#> GSM447463 1 0.2451 0.42433 0.884 0.000 0.000 0.000 0.060 0.056
#> GSM447467 2 0.3817 0.67615 0.000 0.796 0.012 0.000 0.088 0.104
#> GSM447469 4 0.3860 0.79117 0.000 0.040 0.036 0.812 0.104 0.008
#> GSM447473 1 0.4403 0.47536 0.708 0.000 0.000 0.000 0.096 0.196
#> GSM447404 1 0.4321 0.48187 0.712 0.000 0.000 0.000 0.084 0.204
#> GSM447406 4 0.0520 0.83286 0.000 0.000 0.008 0.984 0.008 0.000
#> GSM447407 4 0.1523 0.83231 0.000 0.000 0.008 0.940 0.044 0.008
#> GSM447409 1 0.2212 0.35934 0.880 0.000 0.000 0.000 0.112 0.008
#> GSM447412 3 0.0748 0.83936 0.000 0.000 0.976 0.004 0.016 0.004
#> GSM447426 3 0.2633 0.80269 0.000 0.000 0.864 0.112 0.020 0.004
#> GSM447433 5 0.4126 0.87283 0.480 0.000 0.000 0.004 0.512 0.004
#> GSM447439 4 0.0405 0.83348 0.000 0.000 0.008 0.988 0.004 0.000
#> GSM447441 2 0.6689 0.49518 0.000 0.500 0.312 0.024 0.112 0.052
#> GSM447443 6 0.4991 0.22452 0.456 0.000 0.000 0.000 0.068 0.476
#> GSM447445 1 0.3229 0.26841 0.816 0.000 0.000 0.000 0.140 0.044
#> GSM447446 5 0.4172 0.91162 0.460 0.000 0.000 0.000 0.528 0.012
#> GSM447453 1 0.3900 -0.08751 0.728 0.000 0.000 0.000 0.232 0.040
#> GSM447455 2 0.3718 0.71762 0.000 0.796 0.128 0.068 0.000 0.008
#> GSM447456 1 0.8598 -0.15649 0.336 0.184 0.000 0.152 0.216 0.112
#> GSM447459 4 0.0260 0.83366 0.000 0.000 0.008 0.992 0.000 0.000
#> GSM447466 1 0.1719 0.50650 0.924 0.000 0.000 0.000 0.016 0.060
#> GSM447470 1 0.5222 -0.15885 0.500 0.004 0.000 0.000 0.080 0.416
#> GSM447474 6 0.4280 0.55281 0.232 0.004 0.000 0.000 0.056 0.708
#> GSM447475 2 0.3991 0.66123 0.000 0.772 0.000 0.012 0.152 0.064
#> GSM447398 2 0.7032 -0.00789 0.000 0.364 0.000 0.348 0.212 0.076
#> GSM447399 4 0.5561 0.37635 0.000 0.064 0.292 0.604 0.020 0.020
#> GSM447408 4 0.2106 0.79927 0.000 0.064 0.000 0.904 0.032 0.000
#> GSM447410 4 0.4292 0.70568 0.000 0.136 0.000 0.752 0.100 0.012
#> GSM447414 3 0.2143 0.83232 0.000 0.016 0.916 0.048 0.012 0.008
#> GSM447417 4 0.2632 0.81900 0.000 0.024 0.008 0.884 0.076 0.008
#> GSM447419 6 0.5713 0.55730 0.284 0.000 0.016 0.000 0.140 0.560
#> GSM447420 6 0.4571 0.46386 0.028 0.004 0.212 0.000 0.040 0.716
#> GSM447421 6 0.3342 0.70579 0.228 0.000 0.000 0.000 0.012 0.760
#> GSM447423 3 0.1408 0.82226 0.000 0.020 0.944 0.000 0.036 0.000
#> GSM447436 5 0.4250 0.91097 0.456 0.000 0.000 0.000 0.528 0.016
#> GSM447437 1 0.2350 0.40699 0.888 0.000 0.000 0.000 0.076 0.036
#> GSM447438 4 0.4942 0.67166 0.000 0.144 0.000 0.700 0.132 0.024
#> GSM447447 1 0.4985 -0.65858 0.528 0.000 0.000 0.000 0.400 0.072
#> GSM447454 3 0.4325 0.63554 0.000 0.200 0.728 0.000 0.060 0.012
#> GSM447457 3 0.4720 0.44654 0.000 0.300 0.640 0.000 0.048 0.012
#> GSM447460 2 0.5624 0.39628 0.000 0.548 0.340 0.092 0.012 0.008
#> GSM447465 3 0.4268 0.58761 0.000 0.240 0.712 0.036 0.004 0.008
#> GSM447471 1 0.4403 0.47536 0.708 0.000 0.000 0.000 0.096 0.196
#> GSM447476 4 0.5007 0.68812 0.000 0.132 0.000 0.652 0.212 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 gender(p) agent(p) k
#> CV:skmeans 77 0.913 0.422 2
#> CV:skmeans 77 0.334 0.288 3
#> CV:skmeans 72 0.402 0.496 4
#> CV:skmeans 51 0.297 0.715 5
#> CV:skmeans 48 0.287 0.516 6
If matrix rows can be associated to genes, consider to use functional_enrichment(res,
...)
to perform function enrichment for the signature genes. See this vignette for more detailed explanations.
The object with results only for a single top-value method and a single partition method can be extracted as:
res = res_list["CV", "pam"]
# you can also extract it by
# res = res_list["CV:pam"]
A summary of res
and all the functions that can be applied to it:
res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#> On a matrix with 51941 rows and 79 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.565 0.814 0.916 0.4373 0.553 0.553
#> 3 3 0.655 0.733 0.888 0.5173 0.724 0.526
#> 4 4 0.706 0.727 0.871 0.1088 0.900 0.711
#> 5 5 0.702 0.684 0.800 0.0632 0.914 0.683
#> 6 6 0.754 0.683 0.849 0.0373 0.954 0.788
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
#> GSM447401 2 0.0000 0.902 0.000 1.000
#> GSM447411 1 0.0000 0.880 1.000 0.000
#> GSM447413 2 0.0000 0.902 0.000 1.000
#> GSM447415 1 0.0000 0.880 1.000 0.000
#> GSM447416 2 0.0000 0.902 0.000 1.000
#> GSM447425 2 0.0938 0.899 0.012 0.988
#> GSM447430 2 0.0938 0.898 0.012 0.988
#> GSM447435 1 0.0000 0.880 1.000 0.000
#> GSM447440 1 0.9922 0.121 0.552 0.448
#> GSM447444 2 0.7453 0.778 0.212 0.788
#> GSM447448 2 0.8144 0.727 0.252 0.748
#> GSM447449 2 0.0000 0.902 0.000 1.000
#> GSM447450 1 0.0000 0.880 1.000 0.000
#> GSM447452 2 0.0000 0.902 0.000 1.000
#> GSM447458 2 0.0672 0.901 0.008 0.992
#> GSM447461 2 0.0672 0.901 0.008 0.992
#> GSM447464 1 0.0000 0.880 1.000 0.000
#> GSM447468 1 0.0000 0.880 1.000 0.000
#> GSM447472 1 0.6623 0.721 0.828 0.172
#> GSM447400 1 0.0000 0.880 1.000 0.000
#> GSM447402 2 0.0000 0.902 0.000 1.000
#> GSM447403 1 0.0000 0.880 1.000 0.000
#> GSM447405 2 0.7453 0.778 0.212 0.788
#> GSM447418 2 0.0000 0.902 0.000 1.000
#> GSM447422 2 0.0000 0.902 0.000 1.000
#> GSM447424 2 0.0000 0.902 0.000 1.000
#> GSM447427 2 0.0000 0.902 0.000 1.000
#> GSM447428 2 0.7219 0.787 0.200 0.800
#> GSM447429 1 0.9522 0.360 0.628 0.372
#> GSM447431 2 0.0000 0.902 0.000 1.000
#> GSM447432 2 0.0000 0.902 0.000 1.000
#> GSM447434 1 0.9608 0.330 0.616 0.384
#> GSM447442 2 0.0376 0.901 0.004 0.996
#> GSM447451 2 0.7376 0.782 0.208 0.792
#> GSM447462 2 0.7815 0.757 0.232 0.768
#> GSM447463 1 0.0000 0.880 1.000 0.000
#> GSM447467 2 0.7299 0.785 0.204 0.796
#> GSM447469 2 0.0000 0.902 0.000 1.000
#> GSM447473 1 0.0000 0.880 1.000 0.000
#> GSM447404 1 0.0000 0.880 1.000 0.000
#> GSM447406 2 0.0000 0.902 0.000 1.000
#> GSM447407 2 0.0000 0.902 0.000 1.000
#> GSM447409 1 0.0000 0.880 1.000 0.000
#> GSM447412 2 0.6887 0.798 0.184 0.816
#> GSM447426 2 0.0000 0.902 0.000 1.000
#> GSM447433 1 0.9491 0.372 0.632 0.368
#> GSM447439 2 0.0938 0.899 0.012 0.988
#> GSM447441 2 0.0000 0.902 0.000 1.000
#> GSM447443 1 0.0000 0.880 1.000 0.000
#> GSM447445 1 0.0376 0.877 0.996 0.004
#> GSM447446 1 0.0000 0.880 1.000 0.000
#> GSM447453 1 0.0672 0.874 0.992 0.008
#> GSM447455 2 0.0000 0.902 0.000 1.000
#> GSM447456 2 0.7453 0.778 0.212 0.788
#> GSM447459 2 0.0000 0.902 0.000 1.000
#> GSM447466 1 0.0000 0.880 1.000 0.000
#> GSM447470 2 0.7453 0.778 0.212 0.788
#> GSM447474 2 0.7453 0.778 0.212 0.788
#> GSM447475 2 0.7376 0.782 0.208 0.792
#> GSM447398 2 0.7602 0.771 0.220 0.780
#> GSM447399 2 0.0672 0.899 0.008 0.992
#> GSM447408 2 0.0000 0.902 0.000 1.000
#> GSM447410 2 0.1184 0.898 0.016 0.984
#> GSM447414 2 0.0376 0.901 0.004 0.996
#> GSM447417 2 0.0000 0.902 0.000 1.000
#> GSM447419 2 0.9850 0.327 0.428 0.572
#> GSM447420 2 0.7376 0.782 0.208 0.792
#> GSM447421 1 0.9460 0.376 0.636 0.364
#> GSM447423 2 0.0000 0.902 0.000 1.000
#> GSM447436 1 0.9732 0.268 0.596 0.404
#> GSM447437 1 0.0000 0.880 1.000 0.000
#> GSM447438 2 0.7453 0.778 0.212 0.788
#> GSM447447 2 0.7453 0.778 0.212 0.788
#> GSM447454 2 0.0672 0.901 0.008 0.992
#> GSM447457 2 0.0000 0.902 0.000 1.000
#> GSM447460 2 0.0000 0.902 0.000 1.000
#> GSM447465 2 0.0000 0.902 0.000 1.000
#> GSM447471 1 0.0000 0.880 1.000 0.000
#> GSM447476 2 0.7602 0.771 0.220 0.780
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM447401 3 0.0000 0.8680 0.000 0.000 1.000
#> GSM447411 1 0.0000 0.9161 1.000 0.000 0.000
#> GSM447413 3 0.0000 0.8680 0.000 0.000 1.000
#> GSM447415 1 0.0000 0.9161 1.000 0.000 0.000
#> GSM447416 3 0.4750 0.6819 0.000 0.216 0.784
#> GSM447425 2 0.5202 0.6557 0.008 0.772 0.220
#> GSM447430 2 0.6126 0.3425 0.000 0.600 0.400
#> GSM447435 1 0.0000 0.9161 1.000 0.000 0.000
#> GSM447440 2 0.6140 0.2729 0.404 0.596 0.000
#> GSM447444 2 0.0747 0.8223 0.016 0.984 0.000
#> GSM447448 2 0.4235 0.7184 0.176 0.824 0.000
#> GSM447449 3 0.0237 0.8679 0.000 0.004 0.996
#> GSM447450 1 0.0000 0.9161 1.000 0.000 0.000
#> GSM447452 3 0.0747 0.8628 0.000 0.016 0.984
#> GSM447458 3 0.6664 0.0573 0.008 0.464 0.528
#> GSM447461 2 0.0848 0.8225 0.008 0.984 0.008
#> GSM447464 1 0.0000 0.9161 1.000 0.000 0.000
#> GSM447468 1 0.0000 0.9161 1.000 0.000 0.000
#> GSM447472 1 0.6008 0.3833 0.628 0.372 0.000
#> GSM447400 1 0.0237 0.9131 0.996 0.004 0.000
#> GSM447402 2 0.5465 0.5553 0.000 0.712 0.288
#> GSM447403 1 0.0000 0.9161 1.000 0.000 0.000
#> GSM447405 2 0.0747 0.8223 0.016 0.984 0.000
#> GSM447418 3 0.0000 0.8680 0.000 0.000 1.000
#> GSM447422 3 0.0000 0.8680 0.000 0.000 1.000
#> GSM447424 3 0.0747 0.8651 0.000 0.016 0.984
#> GSM447427 3 0.1031 0.8627 0.000 0.024 0.976
#> GSM447428 3 0.5291 0.6235 0.000 0.268 0.732
#> GSM447429 1 0.6339 0.3596 0.632 0.360 0.008
#> GSM447431 3 0.2448 0.8322 0.000 0.076 0.924
#> GSM447432 3 0.3619 0.7896 0.000 0.136 0.864
#> GSM447434 2 0.6180 0.2224 0.416 0.584 0.000
#> GSM447442 3 0.0237 0.8679 0.000 0.004 0.996
#> GSM447451 2 0.0848 0.8225 0.008 0.984 0.008
#> GSM447462 2 0.4654 0.6830 0.208 0.792 0.000
#> GSM447463 1 0.0000 0.9161 1.000 0.000 0.000
#> GSM447467 2 0.0848 0.8225 0.008 0.984 0.008
#> GSM447469 3 0.4654 0.6849 0.000 0.208 0.792
#> GSM447473 1 0.0000 0.9161 1.000 0.000 0.000
#> GSM447404 1 0.0000 0.9161 1.000 0.000 0.000
#> GSM447406 3 0.4605 0.6960 0.000 0.204 0.796
#> GSM447407 3 0.6286 0.0632 0.000 0.464 0.536
#> GSM447409 1 0.0000 0.9161 1.000 0.000 0.000
#> GSM447412 2 0.0892 0.8190 0.000 0.980 0.020
#> GSM447426 3 0.0892 0.8636 0.000 0.020 0.980
#> GSM447433 2 0.6244 0.1652 0.440 0.560 0.000
#> GSM447439 2 0.4842 0.6489 0.000 0.776 0.224
#> GSM447441 2 0.0424 0.8206 0.000 0.992 0.008
#> GSM447443 1 0.2261 0.8561 0.932 0.068 0.000
#> GSM447445 1 0.0000 0.9161 1.000 0.000 0.000
#> GSM447446 1 0.0000 0.9161 1.000 0.000 0.000
#> GSM447453 1 0.0000 0.9161 1.000 0.000 0.000
#> GSM447455 2 0.6215 0.2945 0.000 0.572 0.428
#> GSM447456 2 0.0747 0.8223 0.016 0.984 0.000
#> GSM447459 2 0.5291 0.5964 0.000 0.732 0.268
#> GSM447466 1 0.0000 0.9161 1.000 0.000 0.000
#> GSM447470 2 0.0747 0.8223 0.016 0.984 0.000
#> GSM447474 2 0.0747 0.8223 0.016 0.984 0.000
#> GSM447475 2 0.0848 0.8225 0.008 0.984 0.008
#> GSM447398 2 0.0747 0.8223 0.016 0.984 0.000
#> GSM447399 3 0.0000 0.8680 0.000 0.000 1.000
#> GSM447408 2 0.0000 0.8205 0.000 1.000 0.000
#> GSM447410 2 0.0000 0.8205 0.000 1.000 0.000
#> GSM447414 3 0.0000 0.8680 0.000 0.000 1.000
#> GSM447417 3 0.0892 0.8635 0.000 0.020 0.980
#> GSM447419 2 0.9532 -0.0226 0.192 0.432 0.376
#> GSM447420 2 0.0848 0.8225 0.008 0.984 0.008
#> GSM447421 1 0.7831 0.4524 0.632 0.280 0.088
#> GSM447423 3 0.5291 0.6235 0.000 0.268 0.732
#> GSM447436 1 0.6140 0.2658 0.596 0.404 0.000
#> GSM447437 1 0.0000 0.9161 1.000 0.000 0.000
#> GSM447438 2 0.0000 0.8205 0.000 1.000 0.000
#> GSM447447 2 0.1860 0.8094 0.052 0.948 0.000
#> GSM447454 2 0.3826 0.7551 0.008 0.868 0.124
#> GSM447457 2 0.0747 0.8195 0.000 0.984 0.016
#> GSM447460 2 0.6062 0.4092 0.000 0.616 0.384
#> GSM447465 3 0.0000 0.8680 0.000 0.000 1.000
#> GSM447471 1 0.0000 0.9161 1.000 0.000 0.000
#> GSM447476 2 0.0237 0.8199 0.000 0.996 0.004
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM447401 3 0.3764 0.7273 0.000 0.000 0.784 0.216
#> GSM447411 1 0.0000 0.8934 1.000 0.000 0.000 0.000
#> GSM447413 3 0.0921 0.8254 0.000 0.000 0.972 0.028
#> GSM447415 1 0.0000 0.8934 1.000 0.000 0.000 0.000
#> GSM447416 3 0.4500 0.6890 0.000 0.192 0.776 0.032
#> GSM447425 4 0.3726 0.8535 0.000 0.000 0.212 0.788
#> GSM447430 4 0.3610 0.8571 0.000 0.000 0.200 0.800
#> GSM447435 1 0.1389 0.8820 0.952 0.048 0.000 0.000
#> GSM447440 2 0.4866 0.2629 0.404 0.596 0.000 0.000
#> GSM447444 2 0.0000 0.8210 0.000 1.000 0.000 0.000
#> GSM447448 2 0.3172 0.7145 0.160 0.840 0.000 0.000
#> GSM447449 3 0.0000 0.8265 0.000 0.000 1.000 0.000
#> GSM447450 1 0.1557 0.8785 0.944 0.056 0.000 0.000
#> GSM447452 4 0.0469 0.7508 0.000 0.000 0.012 0.988
#> GSM447458 3 0.4907 0.1791 0.000 0.420 0.580 0.000
#> GSM447461 2 0.0000 0.8210 0.000 1.000 0.000 0.000
#> GSM447464 1 0.0592 0.8917 0.984 0.016 0.000 0.000
#> GSM447468 1 0.0000 0.8934 1.000 0.000 0.000 0.000
#> GSM447472 1 0.4790 0.3689 0.620 0.380 0.000 0.000
#> GSM447400 1 0.1637 0.8761 0.940 0.060 0.000 0.000
#> GSM447402 4 0.4319 0.8402 0.000 0.012 0.228 0.760
#> GSM447403 1 0.0000 0.8934 1.000 0.000 0.000 0.000
#> GSM447405 2 0.0707 0.8170 0.020 0.980 0.000 0.000
#> GSM447418 3 0.0188 0.8269 0.000 0.000 0.996 0.004
#> GSM447422 3 0.0000 0.8265 0.000 0.000 1.000 0.000
#> GSM447424 3 0.1356 0.8250 0.000 0.008 0.960 0.032
#> GSM447427 3 0.0469 0.8271 0.000 0.012 0.988 0.000
#> GSM447428 3 0.3726 0.6771 0.000 0.212 0.788 0.000
#> GSM447429 1 0.4776 0.3370 0.624 0.376 0.000 0.000
#> GSM447431 3 0.2859 0.7441 0.000 0.008 0.880 0.112
#> GSM447432 3 0.2081 0.7710 0.000 0.084 0.916 0.000
#> GSM447434 2 0.4898 0.2203 0.416 0.584 0.000 0.000
#> GSM447442 3 0.0000 0.8265 0.000 0.000 1.000 0.000
#> GSM447451 2 0.0000 0.8210 0.000 1.000 0.000 0.000
#> GSM447462 2 0.3528 0.6608 0.192 0.808 0.000 0.000
#> GSM447463 1 0.1557 0.8785 0.944 0.056 0.000 0.000
#> GSM447467 2 0.0000 0.8210 0.000 1.000 0.000 0.000
#> GSM447469 3 0.6702 -0.2821 0.000 0.088 0.476 0.436
#> GSM447473 1 0.0000 0.8934 1.000 0.000 0.000 0.000
#> GSM447404 1 0.0000 0.8934 1.000 0.000 0.000 0.000
#> GSM447406 4 0.3400 0.8570 0.000 0.000 0.180 0.820
#> GSM447407 4 0.3400 0.8570 0.000 0.000 0.180 0.820
#> GSM447409 1 0.0000 0.8934 1.000 0.000 0.000 0.000
#> GSM447412 2 0.1743 0.7955 0.000 0.940 0.056 0.004
#> GSM447426 3 0.3726 0.7293 0.000 0.000 0.788 0.212
#> GSM447433 2 0.5105 0.1756 0.432 0.564 0.000 0.004
#> GSM447439 4 0.3569 0.8579 0.000 0.000 0.196 0.804
#> GSM447441 2 0.1637 0.7939 0.000 0.940 0.000 0.060
#> GSM447443 1 0.2704 0.8152 0.876 0.124 0.000 0.000
#> GSM447445 1 0.1557 0.8785 0.944 0.056 0.000 0.000
#> GSM447446 1 0.0000 0.8934 1.000 0.000 0.000 0.000
#> GSM447453 1 0.0188 0.8934 0.996 0.004 0.000 0.000
#> GSM447455 2 0.4898 0.2747 0.000 0.584 0.416 0.000
#> GSM447456 2 0.0000 0.8210 0.000 1.000 0.000 0.000
#> GSM447459 4 0.3400 0.8570 0.000 0.000 0.180 0.820
#> GSM447466 1 0.0336 0.8929 0.992 0.008 0.000 0.000
#> GSM447470 2 0.0000 0.8210 0.000 1.000 0.000 0.000
#> GSM447474 2 0.0000 0.8210 0.000 1.000 0.000 0.000
#> GSM447475 2 0.0000 0.8210 0.000 1.000 0.000 0.000
#> GSM447398 2 0.1557 0.7948 0.000 0.944 0.000 0.056
#> GSM447399 3 0.0188 0.8272 0.000 0.000 0.996 0.004
#> GSM447408 4 0.3975 0.6933 0.000 0.240 0.000 0.760
#> GSM447410 4 0.4193 0.6591 0.000 0.268 0.000 0.732
#> GSM447414 3 0.1022 0.8242 0.000 0.000 0.968 0.032
#> GSM447417 4 0.3726 0.8535 0.000 0.000 0.212 0.788
#> GSM447419 2 0.7443 -0.0122 0.172 0.436 0.392 0.000
#> GSM447420 2 0.0000 0.8210 0.000 1.000 0.000 0.000
#> GSM447421 1 0.6362 0.4109 0.616 0.288 0.096 0.000
#> GSM447423 3 0.3726 0.6771 0.000 0.212 0.788 0.000
#> GSM447436 1 0.4888 0.2436 0.588 0.412 0.000 0.000
#> GSM447437 1 0.1118 0.8865 0.964 0.036 0.000 0.000
#> GSM447438 2 0.1557 0.7948 0.000 0.944 0.000 0.056
#> GSM447447 2 0.1118 0.8081 0.036 0.964 0.000 0.000
#> GSM447454 2 0.3355 0.7098 0.000 0.836 0.160 0.004
#> GSM447457 2 0.1557 0.7965 0.000 0.944 0.056 0.000
#> GSM447460 2 0.5364 0.4365 0.000 0.652 0.320 0.028
#> GSM447465 3 0.0707 0.8266 0.000 0.000 0.980 0.020
#> GSM447471 1 0.0000 0.8934 1.000 0.000 0.000 0.000
#> GSM447476 4 0.3975 0.6933 0.000 0.240 0.000 0.760
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM447401 3 0.5644 0.55172 0.000 0.000 0.584 0.100 0.316
#> GSM447411 5 0.4192 0.57140 0.404 0.000 0.000 0.000 0.596
#> GSM447413 3 0.1043 0.78687 0.000 0.000 0.960 0.040 0.000
#> GSM447415 5 0.4300 0.52668 0.476 0.000 0.000 0.000 0.524
#> GSM447416 3 0.4022 0.72967 0.000 0.100 0.796 0.104 0.000
#> GSM447425 4 0.2852 0.85015 0.000 0.000 0.172 0.828 0.000
#> GSM447430 4 0.2605 0.86016 0.000 0.000 0.148 0.852 0.000
#> GSM447435 5 0.4803 0.57181 0.444 0.020 0.000 0.000 0.536
#> GSM447440 5 0.4401 0.47080 0.016 0.328 0.000 0.000 0.656
#> GSM447444 2 0.1410 0.86168 0.000 0.940 0.000 0.000 0.060
#> GSM447448 2 0.4064 0.73411 0.092 0.792 0.000 0.000 0.116
#> GSM447449 3 0.0000 0.78600 0.000 0.000 1.000 0.000 0.000
#> GSM447450 5 0.4898 0.55787 0.248 0.068 0.000 0.000 0.684
#> GSM447452 4 0.3837 0.62030 0.000 0.000 0.000 0.692 0.308
#> GSM447458 3 0.4227 0.12293 0.000 0.420 0.580 0.000 0.000
#> GSM447461 2 0.1121 0.88051 0.000 0.956 0.000 0.044 0.000
#> GSM447464 1 0.4235 -0.00952 0.656 0.008 0.000 0.000 0.336
#> GSM447468 5 0.5043 0.47273 0.356 0.044 0.000 0.000 0.600
#> GSM447472 5 0.5886 0.47655 0.176 0.224 0.000 0.000 0.600
#> GSM447400 1 0.4199 0.56842 0.772 0.068 0.000 0.000 0.160
#> GSM447402 4 0.3769 0.83858 0.000 0.032 0.180 0.788 0.000
#> GSM447403 1 0.0000 0.76233 1.000 0.000 0.000 0.000 0.000
#> GSM447405 2 0.0290 0.89162 0.008 0.992 0.000 0.000 0.000
#> GSM447418 3 0.0162 0.78620 0.000 0.000 0.996 0.004 0.000
#> GSM447422 3 0.0000 0.78600 0.000 0.000 1.000 0.000 0.000
#> GSM447424 3 0.1831 0.78093 0.000 0.004 0.920 0.076 0.000
#> GSM447427 3 0.0290 0.78741 0.000 0.008 0.992 0.000 0.000
#> GSM447428 3 0.4025 0.69113 0.000 0.132 0.792 0.000 0.076
#> GSM447429 1 0.1831 0.70738 0.920 0.076 0.000 0.000 0.004
#> GSM447431 3 0.2338 0.72709 0.000 0.004 0.884 0.112 0.000
#> GSM447432 3 0.1792 0.74669 0.000 0.084 0.916 0.000 0.000
#> GSM447434 5 0.5599 0.41774 0.092 0.328 0.000 0.000 0.580
#> GSM447442 3 0.0000 0.78600 0.000 0.000 1.000 0.000 0.000
#> GSM447451 2 0.0290 0.89215 0.000 0.992 0.000 0.008 0.000
#> GSM447462 2 0.4199 0.70242 0.068 0.772 0.000 0.000 0.160
#> GSM447463 5 0.4867 0.57768 0.432 0.024 0.000 0.000 0.544
#> GSM447467 2 0.0000 0.89277 0.000 1.000 0.000 0.000 0.000
#> GSM447469 3 0.5771 -0.21449 0.000 0.088 0.480 0.432 0.000
#> GSM447473 1 0.0000 0.76233 1.000 0.000 0.000 0.000 0.000
#> GSM447404 1 0.0000 0.76233 1.000 0.000 0.000 0.000 0.000
#> GSM447406 4 0.1792 0.85764 0.000 0.000 0.084 0.916 0.000
#> GSM447407 4 0.1792 0.85764 0.000 0.000 0.084 0.916 0.000
#> GSM447409 1 0.0000 0.76233 1.000 0.000 0.000 0.000 0.000
#> GSM447412 2 0.1704 0.86690 0.000 0.928 0.068 0.004 0.000
#> GSM447426 3 0.5644 0.55172 0.000 0.000 0.584 0.100 0.316
#> GSM447433 5 0.4404 0.49084 0.024 0.292 0.000 0.000 0.684
#> GSM447439 4 0.2561 0.86119 0.000 0.000 0.144 0.856 0.000
#> GSM447441 2 0.1608 0.86788 0.000 0.928 0.000 0.072 0.000
#> GSM447443 1 0.4666 0.52048 0.732 0.088 0.000 0.000 0.180
#> GSM447445 5 0.4890 0.56366 0.452 0.024 0.000 0.000 0.524
#> GSM447446 1 0.3112 0.66620 0.856 0.044 0.000 0.000 0.100
#> GSM447453 1 0.4616 0.37835 0.676 0.036 0.000 0.000 0.288
#> GSM447455 2 0.4359 0.35142 0.000 0.584 0.412 0.004 0.000
#> GSM447456 2 0.0000 0.89277 0.000 1.000 0.000 0.000 0.000
#> GSM447459 4 0.1792 0.85764 0.000 0.000 0.084 0.916 0.000
#> GSM447466 5 0.4552 0.54264 0.468 0.008 0.000 0.000 0.524
#> GSM447470 2 0.0000 0.89277 0.000 1.000 0.000 0.000 0.000
#> GSM447474 2 0.0000 0.89277 0.000 1.000 0.000 0.000 0.000
#> GSM447475 2 0.0000 0.89277 0.000 1.000 0.000 0.000 0.000
#> GSM447398 2 0.2304 0.86837 0.000 0.908 0.000 0.044 0.048
#> GSM447399 3 0.1704 0.76758 0.000 0.000 0.928 0.004 0.068
#> GSM447408 4 0.3177 0.75548 0.000 0.208 0.000 0.792 0.000
#> GSM447410 4 0.3395 0.72600 0.000 0.236 0.000 0.764 0.000
#> GSM447414 3 0.1671 0.78028 0.000 0.000 0.924 0.076 0.000
#> GSM447417 4 0.2732 0.85668 0.000 0.000 0.160 0.840 0.000
#> GSM447419 3 0.8383 0.00912 0.212 0.304 0.324 0.000 0.160
#> GSM447420 2 0.0000 0.89277 0.000 1.000 0.000 0.000 0.000
#> GSM447421 1 0.0963 0.74604 0.964 0.036 0.000 0.000 0.000
#> GSM447423 3 0.2732 0.71864 0.000 0.160 0.840 0.000 0.000
#> GSM447436 1 0.3508 0.45128 0.748 0.252 0.000 0.000 0.000
#> GSM447437 5 0.4735 0.55478 0.460 0.016 0.000 0.000 0.524
#> GSM447438 2 0.1544 0.86817 0.000 0.932 0.000 0.068 0.000
#> GSM447447 2 0.2171 0.84458 0.024 0.912 0.000 0.000 0.064
#> GSM447454 2 0.2983 0.83498 0.000 0.864 0.096 0.040 0.000
#> GSM447457 2 0.1544 0.86749 0.000 0.932 0.068 0.000 0.000
#> GSM447460 2 0.5051 0.55913 0.000 0.664 0.264 0.072 0.000
#> GSM447465 3 0.1478 0.78285 0.000 0.000 0.936 0.064 0.000
#> GSM447471 1 0.0000 0.76233 1.000 0.000 0.000 0.000 0.000
#> GSM447476 4 0.4064 0.76270 0.000 0.092 0.000 0.792 0.116
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM447401 5 0.0000 0.9517 0.000 0.000 0.000 0.000 1.0 0.000
#> GSM447411 1 0.2854 0.5959 0.792 0.000 0.000 0.000 0.0 0.208
#> GSM447413 3 0.2048 0.8591 0.000 0.000 0.880 0.120 0.0 0.000
#> GSM447415 1 0.3717 0.5169 0.616 0.000 0.000 0.000 0.0 0.384
#> GSM447416 3 0.0777 0.7997 0.000 0.024 0.972 0.004 0.0 0.000
#> GSM447425 4 0.0146 0.7718 0.000 0.000 0.004 0.996 0.0 0.000
#> GSM447430 4 0.0146 0.7718 0.000 0.000 0.004 0.996 0.0 0.000
#> GSM447435 1 0.3563 0.5538 0.664 0.000 0.000 0.000 0.0 0.336
#> GSM447440 1 0.1387 0.5988 0.932 0.068 0.000 0.000 0.0 0.000
#> GSM447444 2 0.2300 0.7761 0.144 0.856 0.000 0.000 0.0 0.000
#> GSM447448 2 0.3797 0.6148 0.292 0.692 0.000 0.000 0.0 0.016
#> GSM447449 3 0.2562 0.8608 0.000 0.000 0.828 0.172 0.0 0.000
#> GSM447450 1 0.0000 0.6137 1.000 0.000 0.000 0.000 0.0 0.000
#> GSM447452 5 0.1814 0.8961 0.000 0.000 0.000 0.100 0.9 0.000
#> GSM447458 2 0.5765 -0.1268 0.000 0.420 0.408 0.172 0.0 0.000
#> GSM447461 2 0.0000 0.8630 0.000 1.000 0.000 0.000 0.0 0.000
#> GSM447464 6 0.3592 0.1743 0.344 0.000 0.000 0.000 0.0 0.656
#> GSM447468 1 0.1610 0.5784 0.916 0.000 0.000 0.000 0.0 0.084
#> GSM447472 1 0.1753 0.5769 0.912 0.004 0.000 0.000 0.0 0.084
#> GSM447400 6 0.3684 0.3957 0.372 0.000 0.000 0.000 0.0 0.628
#> GSM447402 4 0.1649 0.7511 0.000 0.036 0.032 0.932 0.0 0.000
#> GSM447403 6 0.0000 0.7386 0.000 0.000 0.000 0.000 0.0 1.000
#> GSM447405 2 0.0000 0.8630 0.000 1.000 0.000 0.000 0.0 0.000
#> GSM447418 3 0.2562 0.8608 0.000 0.000 0.828 0.172 0.0 0.000
#> GSM447422 3 0.2562 0.8608 0.000 0.000 0.828 0.172 0.0 0.000
#> GSM447424 3 0.0146 0.8119 0.000 0.000 0.996 0.004 0.0 0.000
#> GSM447427 3 0.2562 0.8608 0.000 0.000 0.828 0.172 0.0 0.000
#> GSM447428 3 0.3351 0.7372 0.160 0.040 0.800 0.000 0.0 0.000
#> GSM447429 6 0.1644 0.6923 0.004 0.076 0.000 0.000 0.0 0.920
#> GSM447431 3 0.3288 0.7824 0.000 0.000 0.724 0.276 0.0 0.000
#> GSM447432 3 0.4079 0.8000 0.000 0.084 0.744 0.172 0.0 0.000
#> GSM447434 1 0.2786 0.5382 0.860 0.056 0.000 0.000 0.0 0.084
#> GSM447442 3 0.2562 0.8608 0.000 0.000 0.828 0.172 0.0 0.000
#> GSM447451 2 0.0000 0.8630 0.000 1.000 0.000 0.000 0.0 0.000
#> GSM447462 2 0.3717 0.5146 0.384 0.616 0.000 0.000 0.0 0.000
#> GSM447463 1 0.3607 0.5449 0.652 0.000 0.000 0.000 0.0 0.348
#> GSM447467 2 0.0000 0.8630 0.000 1.000 0.000 0.000 0.0 0.000
#> GSM447469 4 0.4947 0.1782 0.000 0.088 0.316 0.596 0.0 0.000
#> GSM447473 6 0.0000 0.7386 0.000 0.000 0.000 0.000 0.0 1.000
#> GSM447404 6 0.0000 0.7386 0.000 0.000 0.000 0.000 0.0 1.000
#> GSM447406 4 0.2562 0.7203 0.000 0.000 0.172 0.828 0.0 0.000
#> GSM447407 4 0.2562 0.7203 0.000 0.000 0.172 0.828 0.0 0.000
#> GSM447409 6 0.0000 0.7386 0.000 0.000 0.000 0.000 0.0 1.000
#> GSM447412 2 0.0000 0.8630 0.000 1.000 0.000 0.000 0.0 0.000
#> GSM447426 5 0.0000 0.9517 0.000 0.000 0.000 0.000 1.0 0.000
#> GSM447433 1 0.0000 0.6137 1.000 0.000 0.000 0.000 0.0 0.000
#> GSM447439 4 0.0000 0.7723 0.000 0.000 0.000 1.000 0.0 0.000
#> GSM447441 2 0.0458 0.8565 0.000 0.984 0.016 0.000 0.0 0.000
#> GSM447443 6 0.3782 0.3456 0.412 0.000 0.000 0.000 0.0 0.588
#> GSM447445 1 0.3717 0.5169 0.616 0.000 0.000 0.000 0.0 0.384
#> GSM447446 6 0.2793 0.5993 0.200 0.000 0.000 0.000 0.0 0.800
#> GSM447453 6 0.3797 0.2245 0.420 0.000 0.000 0.000 0.0 0.580
#> GSM447455 2 0.5356 0.3903 0.000 0.584 0.248 0.168 0.0 0.000
#> GSM447456 2 0.0146 0.8617 0.004 0.996 0.000 0.000 0.0 0.000
#> GSM447459 4 0.2562 0.7203 0.000 0.000 0.172 0.828 0.0 0.000
#> GSM447466 1 0.3717 0.5169 0.616 0.000 0.000 0.000 0.0 0.384
#> GSM447470 2 0.0000 0.8630 0.000 1.000 0.000 0.000 0.0 0.000
#> GSM447474 2 0.0000 0.8630 0.000 1.000 0.000 0.000 0.0 0.000
#> GSM447475 2 0.0000 0.8630 0.000 1.000 0.000 0.000 0.0 0.000
#> GSM447398 2 0.1714 0.8048 0.092 0.908 0.000 0.000 0.0 0.000
#> GSM447399 3 0.4893 0.7236 0.172 0.000 0.660 0.168 0.0 0.000
#> GSM447408 4 0.3076 0.6370 0.000 0.240 0.000 0.760 0.0 0.000
#> GSM447410 4 0.3244 0.6091 0.000 0.268 0.000 0.732 0.0 0.000
#> GSM447414 3 0.0146 0.8119 0.000 0.000 0.996 0.004 0.0 0.000
#> GSM447417 4 0.0146 0.7718 0.000 0.000 0.004 0.996 0.0 0.000
#> GSM447419 1 0.7190 -0.0411 0.384 0.116 0.324 0.000 0.0 0.176
#> GSM447420 2 0.0000 0.8630 0.000 1.000 0.000 0.000 0.0 0.000
#> GSM447421 6 0.0865 0.7242 0.000 0.036 0.000 0.000 0.0 0.964
#> GSM447423 3 0.2597 0.7402 0.000 0.176 0.824 0.000 0.0 0.000
#> GSM447436 6 0.3151 0.4932 0.000 0.252 0.000 0.000 0.0 0.748
#> GSM447437 1 0.3717 0.5169 0.616 0.000 0.000 0.000 0.0 0.384
#> GSM447438 2 0.0000 0.8630 0.000 1.000 0.000 0.000 0.0 0.000
#> GSM447447 2 0.2494 0.7825 0.120 0.864 0.000 0.000 0.0 0.016
#> GSM447454 2 0.1714 0.8054 0.000 0.908 0.000 0.092 0.0 0.000
#> GSM447457 2 0.0000 0.8630 0.000 1.000 0.000 0.000 0.0 0.000
#> GSM447460 2 0.3668 0.5792 0.000 0.668 0.328 0.004 0.0 0.000
#> GSM447465 3 0.0146 0.8119 0.000 0.000 0.996 0.004 0.0 0.000
#> GSM447471 6 0.0000 0.7386 0.000 0.000 0.000 0.000 0.0 1.000
#> GSM447476 4 0.3746 0.6325 0.192 0.048 0.000 0.760 0.0 0.000
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)
An example of the output of tb
is:
#> which_row fdr mean_1 mean_2 scaled_mean_1 scaled_mean_2 km
#> 1 38 0.042760348 8.373488 9.131774 -0.5533452 0.5164555 1
#> 2 40 0.018707592 7.106213 8.469186 -0.6173731 0.5762149 1
#> 3 55 0.019134737 10.221463 11.207825 -0.6159697 0.5749050 1
#> 4 59 0.006059896 5.921854 7.869574 -0.6899429 0.6439467 1
#> 5 60 0.018055526 8.928898 10.211722 -0.6204761 0.5791110 1
#> 6 98 0.009384629 15.714769 14.887706 0.6635654 -0.6193277 2
...
The columns in tb
are:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.km
: Row groups if k-means clustering is applied to rows.UMAP plot which shows how samples are separated.
dimension_reduction(res, k = 2, method = "UMAP")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.
test_to_known_factors(res)
#> n gender(p) agent(p) k
#> CV:pam 72 0.7925 0.0898 2
#> CV:pam 66 0.0886 0.0817 3
#> CV:pam 67 0.1345 0.1200 4
#> CV:pam 67 0.1471 0.2421 5
#> CV:pam 70 0.0726 0.0242 6
If matrix rows can be associated to genes, consider to use functional_enrichment(res,
...)
to perform function enrichment for the signature genes. See this vignette for more detailed explanations.
The object with results only for a single top-value method and a single partition method can be extracted as:
res = res_list["CV", "mclust"]
# you can also extract it by
# res = res_list["CV:mclust"]
A summary of res
and all the functions that can be applied to it:
res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#> On a matrix with 51941 rows and 79 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.692 0.950 0.967 0.4936 0.503 0.503
#> 3 3 0.792 0.778 0.870 0.2264 0.810 0.638
#> 4 4 0.767 0.784 0.854 0.1159 0.876 0.684
#> 5 5 0.631 0.609 0.784 0.1101 0.945 0.820
#> 6 6 0.723 0.646 0.829 0.0772 0.816 0.407
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
#> GSM447401 2 0.0000 0.940 0.000 1.000
#> GSM447411 1 0.0000 1.000 1.000 0.000
#> GSM447413 2 0.0000 0.940 0.000 1.000
#> GSM447415 1 0.0000 1.000 1.000 0.000
#> GSM447416 2 0.0000 0.940 0.000 1.000
#> GSM447425 2 0.0000 0.940 0.000 1.000
#> GSM447430 2 0.0000 0.940 0.000 1.000
#> GSM447435 1 0.0000 1.000 1.000 0.000
#> GSM447440 1 0.0000 1.000 1.000 0.000
#> GSM447444 1 0.0000 1.000 1.000 0.000
#> GSM447448 1 0.0000 1.000 1.000 0.000
#> GSM447449 2 0.0000 0.940 0.000 1.000
#> GSM447450 1 0.0000 1.000 1.000 0.000
#> GSM447452 2 0.0000 0.940 0.000 1.000
#> GSM447458 2 0.5178 0.906 0.116 0.884
#> GSM447461 2 0.5178 0.906 0.116 0.884
#> GSM447464 1 0.0000 1.000 1.000 0.000
#> GSM447468 1 0.0000 1.000 1.000 0.000
#> GSM447472 1 0.0000 1.000 1.000 0.000
#> GSM447400 1 0.0000 1.000 1.000 0.000
#> GSM447402 2 0.5178 0.906 0.116 0.884
#> GSM447403 1 0.0000 1.000 1.000 0.000
#> GSM447405 1 0.0000 1.000 1.000 0.000
#> GSM447418 2 0.0000 0.940 0.000 1.000
#> GSM447422 2 0.0000 0.940 0.000 1.000
#> GSM447424 2 0.0000 0.940 0.000 1.000
#> GSM447427 2 0.0000 0.940 0.000 1.000
#> GSM447428 2 0.5842 0.887 0.140 0.860
#> GSM447429 1 0.0000 1.000 1.000 0.000
#> GSM447431 2 0.0000 0.940 0.000 1.000
#> GSM447432 2 0.5178 0.906 0.116 0.884
#> GSM447434 1 0.0000 1.000 1.000 0.000
#> GSM447442 2 0.0000 0.940 0.000 1.000
#> GSM447451 2 0.5408 0.901 0.124 0.876
#> GSM447462 1 0.0000 1.000 1.000 0.000
#> GSM447463 1 0.0000 1.000 1.000 0.000
#> GSM447467 2 0.5629 0.894 0.132 0.868
#> GSM447469 2 0.0000 0.940 0.000 1.000
#> GSM447473 1 0.0000 1.000 1.000 0.000
#> GSM447404 1 0.0000 1.000 1.000 0.000
#> GSM447406 2 0.0000 0.940 0.000 1.000
#> GSM447407 2 0.0000 0.940 0.000 1.000
#> GSM447409 1 0.0000 1.000 1.000 0.000
#> GSM447412 2 0.5178 0.906 0.116 0.884
#> GSM447426 2 0.0000 0.940 0.000 1.000
#> GSM447433 1 0.0000 1.000 1.000 0.000
#> GSM447439 2 0.0000 0.940 0.000 1.000
#> GSM447441 2 0.0000 0.940 0.000 1.000
#> GSM447443 1 0.0000 1.000 1.000 0.000
#> GSM447445 1 0.0000 1.000 1.000 0.000
#> GSM447446 1 0.0000 1.000 1.000 0.000
#> GSM447453 1 0.0000 1.000 1.000 0.000
#> GSM447455 2 0.0000 0.940 0.000 1.000
#> GSM447456 2 0.7528 0.798 0.216 0.784
#> GSM447459 2 0.0000 0.940 0.000 1.000
#> GSM447466 1 0.0000 1.000 1.000 0.000
#> GSM447470 1 0.0000 1.000 1.000 0.000
#> GSM447474 1 0.0000 1.000 1.000 0.000
#> GSM447475 2 0.5408 0.901 0.124 0.876
#> GSM447398 2 0.5178 0.906 0.116 0.884
#> GSM447399 2 0.0000 0.940 0.000 1.000
#> GSM447408 2 0.0000 0.940 0.000 1.000
#> GSM447410 2 0.5294 0.904 0.120 0.880
#> GSM447414 2 0.0000 0.940 0.000 1.000
#> GSM447417 2 0.0000 0.940 0.000 1.000
#> GSM447419 1 0.0376 0.996 0.996 0.004
#> GSM447420 2 0.9775 0.425 0.412 0.588
#> GSM447421 1 0.0000 1.000 1.000 0.000
#> GSM447423 2 0.5178 0.906 0.116 0.884
#> GSM447436 1 0.0000 1.000 1.000 0.000
#> GSM447437 1 0.0000 1.000 1.000 0.000
#> GSM447438 2 0.5408 0.901 0.124 0.876
#> GSM447447 1 0.0000 1.000 1.000 0.000
#> GSM447454 2 0.5178 0.906 0.116 0.884
#> GSM447457 2 0.5178 0.906 0.116 0.884
#> GSM447460 2 0.0000 0.940 0.000 1.000
#> GSM447465 2 0.0000 0.940 0.000 1.000
#> GSM447471 1 0.0000 1.000 1.000 0.000
#> GSM447476 2 0.5519 0.898 0.128 0.872
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM447401 3 0.6291 0.2521 0.000 0.468 0.532
#> GSM447411 1 0.0000 0.9759 1.000 0.000 0.000
#> GSM447413 3 0.0592 0.7757 0.000 0.012 0.988
#> GSM447415 1 0.0000 0.9759 1.000 0.000 0.000
#> GSM447416 3 0.0000 0.7847 0.000 0.000 1.000
#> GSM447425 2 0.0000 0.3867 0.000 1.000 0.000
#> GSM447430 2 0.6274 0.7960 0.000 0.544 0.456
#> GSM447435 1 0.0000 0.9759 1.000 0.000 0.000
#> GSM447440 1 0.0000 0.9759 1.000 0.000 0.000
#> GSM447444 1 0.0000 0.9759 1.000 0.000 0.000
#> GSM447448 1 0.0000 0.9759 1.000 0.000 0.000
#> GSM447449 3 0.0592 0.7820 0.000 0.012 0.988
#> GSM447450 1 0.0000 0.9759 1.000 0.000 0.000
#> GSM447452 2 0.0000 0.3867 0.000 1.000 0.000
#> GSM447458 3 0.6483 -0.6305 0.004 0.452 0.544
#> GSM447461 3 0.2945 0.7158 0.004 0.088 0.908
#> GSM447464 1 0.0000 0.9759 1.000 0.000 0.000
#> GSM447468 1 0.0000 0.9759 1.000 0.000 0.000
#> GSM447472 1 0.0000 0.9759 1.000 0.000 0.000
#> GSM447400 1 0.0000 0.9759 1.000 0.000 0.000
#> GSM447402 2 0.6291 0.7937 0.000 0.532 0.468
#> GSM447403 1 0.0000 0.9759 1.000 0.000 0.000
#> GSM447405 1 0.0237 0.9729 0.996 0.004 0.000
#> GSM447418 3 0.0000 0.7847 0.000 0.000 1.000
#> GSM447422 3 0.0000 0.7847 0.000 0.000 1.000
#> GSM447424 3 0.0000 0.7847 0.000 0.000 1.000
#> GSM447427 3 0.0000 0.7847 0.000 0.000 1.000
#> GSM447428 3 0.6274 0.0329 0.456 0.000 0.544
#> GSM447429 1 0.0000 0.9759 1.000 0.000 0.000
#> GSM447431 3 0.0829 0.7815 0.004 0.012 0.984
#> GSM447432 3 0.2772 0.7268 0.004 0.080 0.916
#> GSM447434 1 0.0000 0.9759 1.000 0.000 0.000
#> GSM447442 3 0.3573 0.6579 0.004 0.120 0.876
#> GSM447451 3 0.2590 0.7361 0.004 0.072 0.924
#> GSM447462 1 0.0000 0.9759 1.000 0.000 0.000
#> GSM447463 1 0.0000 0.9759 1.000 0.000 0.000
#> GSM447467 1 0.5835 0.3722 0.660 0.000 0.340
#> GSM447469 2 0.6295 0.7894 0.000 0.528 0.472
#> GSM447473 1 0.0000 0.9759 1.000 0.000 0.000
#> GSM447404 1 0.0000 0.9759 1.000 0.000 0.000
#> GSM447406 2 0.6274 0.7960 0.000 0.544 0.456
#> GSM447407 2 0.6244 0.7830 0.000 0.560 0.440
#> GSM447409 1 0.0237 0.9729 0.996 0.004 0.000
#> GSM447412 3 0.0000 0.7847 0.000 0.000 1.000
#> GSM447426 3 0.6291 0.2521 0.000 0.468 0.532
#> GSM447433 1 0.0237 0.9729 0.996 0.004 0.000
#> GSM447439 2 0.6274 0.7960 0.000 0.544 0.456
#> GSM447441 3 0.2096 0.7554 0.004 0.052 0.944
#> GSM447443 1 0.0000 0.9759 1.000 0.000 0.000
#> GSM447445 1 0.0000 0.9759 1.000 0.000 0.000
#> GSM447446 1 0.0237 0.9729 0.996 0.004 0.000
#> GSM447453 1 0.0000 0.9759 1.000 0.000 0.000
#> GSM447455 3 0.3272 0.6891 0.004 0.104 0.892
#> GSM447456 2 0.9423 0.3828 0.304 0.492 0.204
#> GSM447459 2 0.6274 0.7960 0.000 0.544 0.456
#> GSM447466 1 0.0000 0.9759 1.000 0.000 0.000
#> GSM447470 1 0.0000 0.9759 1.000 0.000 0.000
#> GSM447474 1 0.0000 0.9759 1.000 0.000 0.000
#> GSM447475 3 0.2860 0.7216 0.004 0.084 0.912
#> GSM447398 2 0.6505 0.7888 0.004 0.528 0.468
#> GSM447399 3 0.6168 -0.5070 0.000 0.412 0.588
#> GSM447408 2 0.6291 0.7937 0.000 0.532 0.468
#> GSM447410 2 0.6291 0.7937 0.000 0.532 0.468
#> GSM447414 3 0.0000 0.7847 0.000 0.000 1.000
#> GSM447417 2 0.6291 0.7937 0.000 0.532 0.468
#> GSM447419 1 0.0000 0.9759 1.000 0.000 0.000
#> GSM447420 1 0.6026 0.3981 0.624 0.000 0.376
#> GSM447421 1 0.0000 0.9759 1.000 0.000 0.000
#> GSM447423 3 0.0000 0.7847 0.000 0.000 1.000
#> GSM447436 1 0.0237 0.9729 0.996 0.004 0.000
#> GSM447437 1 0.0000 0.9759 1.000 0.000 0.000
#> GSM447438 2 0.6291 0.7937 0.000 0.532 0.468
#> GSM447447 1 0.0000 0.9759 1.000 0.000 0.000
#> GSM447454 3 0.0829 0.7814 0.004 0.012 0.984
#> GSM447457 3 0.0237 0.7831 0.004 0.000 0.996
#> GSM447460 3 0.1964 0.7531 0.000 0.056 0.944
#> GSM447465 3 0.0000 0.7847 0.000 0.000 1.000
#> GSM447471 1 0.0000 0.9759 1.000 0.000 0.000
#> GSM447476 2 0.7922 0.7174 0.060 0.532 0.408
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM447401 3 0.3557 0.3742 0.000 0.036 0.856 0.108
#> GSM447411 1 0.1247 0.9730 0.968 0.004 0.016 0.012
#> GSM447413 3 0.6571 0.7420 0.000 0.264 0.612 0.124
#> GSM447415 1 0.0779 0.9740 0.980 0.000 0.016 0.004
#> GSM447416 3 0.6232 0.7585 0.000 0.332 0.596 0.072
#> GSM447425 4 0.4538 0.6054 0.000 0.024 0.216 0.760
#> GSM447430 4 0.4281 0.7604 0.000 0.180 0.028 0.792
#> GSM447435 1 0.0967 0.9743 0.976 0.004 0.016 0.004
#> GSM447440 1 0.0469 0.9746 0.988 0.012 0.000 0.000
#> GSM447444 1 0.0712 0.9738 0.984 0.004 0.004 0.008
#> GSM447448 1 0.0376 0.9750 0.992 0.004 0.000 0.004
#> GSM447449 2 0.3732 0.7078 0.000 0.852 0.056 0.092
#> GSM447450 1 0.0712 0.9765 0.984 0.004 0.004 0.008
#> GSM447452 4 0.4807 0.5999 0.000 0.024 0.248 0.728
#> GSM447458 2 0.0921 0.7972 0.000 0.972 0.000 0.028
#> GSM447461 2 0.0188 0.7997 0.000 0.996 0.000 0.004
#> GSM447464 1 0.0524 0.9753 0.988 0.008 0.000 0.004
#> GSM447468 1 0.0376 0.9752 0.992 0.000 0.004 0.004
#> GSM447472 1 0.0712 0.9738 0.984 0.004 0.004 0.008
#> GSM447400 1 0.0992 0.9713 0.976 0.012 0.004 0.008
#> GSM447402 4 0.4955 0.4246 0.000 0.444 0.000 0.556
#> GSM447403 1 0.1042 0.9723 0.972 0.000 0.020 0.008
#> GSM447405 1 0.0672 0.9739 0.984 0.000 0.008 0.008
#> GSM447418 3 0.6430 0.7599 0.000 0.312 0.596 0.092
#> GSM447422 3 0.6187 0.7562 0.000 0.336 0.596 0.068
#> GSM447424 3 0.6214 0.7565 0.000 0.272 0.636 0.092
#> GSM447427 3 0.5742 0.7338 0.000 0.368 0.596 0.036
#> GSM447428 3 0.6502 0.2322 0.404 0.064 0.528 0.004
#> GSM447429 1 0.0336 0.9755 0.992 0.000 0.008 0.000
#> GSM447431 2 0.2928 0.7594 0.000 0.896 0.052 0.052
#> GSM447432 2 0.0188 0.7997 0.000 0.996 0.000 0.004
#> GSM447434 1 0.0859 0.9728 0.980 0.008 0.004 0.008
#> GSM447442 2 0.0921 0.7979 0.000 0.972 0.000 0.028
#> GSM447451 2 0.0188 0.7995 0.000 0.996 0.004 0.000
#> GSM447462 1 0.1796 0.9537 0.948 0.032 0.004 0.016
#> GSM447463 1 0.1124 0.9740 0.972 0.012 0.012 0.004
#> GSM447467 2 0.4020 0.5973 0.156 0.820 0.008 0.016
#> GSM447469 2 0.4941 0.0224 0.000 0.564 0.000 0.436
#> GSM447473 1 0.1151 0.9716 0.968 0.000 0.024 0.008
#> GSM447404 1 0.1151 0.9716 0.968 0.000 0.024 0.008
#> GSM447406 4 0.3219 0.7639 0.000 0.164 0.000 0.836
#> GSM447407 4 0.2466 0.7476 0.000 0.096 0.004 0.900
#> GSM447409 1 0.1284 0.9698 0.964 0.000 0.024 0.012
#> GSM447412 3 0.5376 0.7020 0.000 0.396 0.588 0.016
#> GSM447426 3 0.3557 0.3742 0.000 0.036 0.856 0.108
#> GSM447433 1 0.0927 0.9722 0.976 0.000 0.008 0.016
#> GSM447439 4 0.4446 0.7514 0.000 0.196 0.028 0.776
#> GSM447441 2 0.1022 0.7959 0.000 0.968 0.032 0.000
#> GSM447443 1 0.0672 0.9749 0.984 0.000 0.008 0.008
#> GSM447445 1 0.0967 0.9743 0.976 0.004 0.016 0.004
#> GSM447446 1 0.0804 0.9732 0.980 0.000 0.012 0.008
#> GSM447453 1 0.0895 0.9734 0.976 0.000 0.020 0.004
#> GSM447455 2 0.0336 0.8002 0.000 0.992 0.000 0.008
#> GSM447456 2 0.5677 0.4134 0.216 0.708 0.004 0.072
#> GSM447459 4 0.3812 0.7625 0.000 0.140 0.028 0.832
#> GSM447466 1 0.1262 0.9729 0.968 0.008 0.016 0.008
#> GSM447470 1 0.1631 0.9615 0.956 0.020 0.008 0.016
#> GSM447474 1 0.1471 0.9627 0.960 0.024 0.004 0.012
#> GSM447475 2 0.0592 0.7979 0.016 0.984 0.000 0.000
#> GSM447398 2 0.1792 0.7709 0.000 0.932 0.000 0.068
#> GSM447399 2 0.2530 0.7558 0.000 0.888 0.000 0.112
#> GSM447408 4 0.4941 0.4414 0.000 0.436 0.000 0.564
#> GSM447410 2 0.4917 0.2524 0.000 0.656 0.008 0.336
#> GSM447414 3 0.6445 0.7604 0.000 0.304 0.600 0.096
#> GSM447417 4 0.4454 0.6203 0.000 0.308 0.000 0.692
#> GSM447419 1 0.0524 0.9745 0.988 0.000 0.008 0.004
#> GSM447420 1 0.4824 0.6618 0.744 0.024 0.228 0.004
#> GSM447421 1 0.0657 0.9737 0.984 0.000 0.012 0.004
#> GSM447423 3 0.5600 0.7269 0.000 0.376 0.596 0.028
#> GSM447436 1 0.0672 0.9739 0.984 0.000 0.008 0.008
#> GSM447437 1 0.1114 0.9738 0.972 0.008 0.016 0.004
#> GSM447438 2 0.4220 0.5071 0.000 0.748 0.004 0.248
#> GSM447447 1 0.0712 0.9738 0.984 0.004 0.004 0.008
#> GSM447454 2 0.1118 0.7793 0.000 0.964 0.036 0.000
#> GSM447457 2 0.1637 0.7550 0.000 0.940 0.060 0.000
#> GSM447460 2 0.3758 0.7195 0.000 0.848 0.048 0.104
#> GSM447465 3 0.6519 0.7390 0.000 0.320 0.584 0.096
#> GSM447471 1 0.0895 0.9734 0.976 0.000 0.020 0.004
#> GSM447476 2 0.6032 -0.1100 0.028 0.536 0.008 0.428
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM447401 3 0.6031 0.4170 0.000 0.000 0.576 0.180 0.244
#> GSM447411 1 0.0609 0.7061 0.980 0.000 0.000 0.000 0.020
#> GSM447413 3 0.2520 0.8056 0.000 0.056 0.896 0.048 0.000
#> GSM447415 1 0.2929 0.4900 0.820 0.000 0.000 0.000 0.180
#> GSM447416 3 0.2605 0.8362 0.000 0.148 0.852 0.000 0.000
#> GSM447425 4 0.3234 0.6825 0.000 0.000 0.084 0.852 0.064
#> GSM447430 4 0.3043 0.8024 0.000 0.056 0.080 0.864 0.000
#> GSM447435 1 0.0510 0.7177 0.984 0.000 0.000 0.000 0.016
#> GSM447440 1 0.1410 0.7147 0.940 0.000 0.000 0.000 0.060
#> GSM447444 1 0.3774 0.3346 0.704 0.000 0.000 0.000 0.296
#> GSM447448 1 0.1478 0.7108 0.936 0.000 0.000 0.000 0.064
#> GSM447449 2 0.4675 0.4603 0.000 0.600 0.380 0.020 0.000
#> GSM447450 1 0.1270 0.7155 0.948 0.000 0.000 0.000 0.052
#> GSM447452 4 0.3234 0.6825 0.000 0.000 0.084 0.852 0.064
#> GSM447458 2 0.2260 0.7230 0.000 0.908 0.028 0.064 0.000
#> GSM447461 2 0.0162 0.7317 0.000 0.996 0.004 0.000 0.000
#> GSM447464 1 0.2648 0.6540 0.848 0.000 0.000 0.000 0.152
#> GSM447468 1 0.0703 0.7111 0.976 0.000 0.000 0.000 0.024
#> GSM447472 1 0.2813 0.6337 0.832 0.000 0.000 0.000 0.168
#> GSM447400 1 0.4235 0.1063 0.576 0.000 0.000 0.000 0.424
#> GSM447402 4 0.5181 0.5328 0.000 0.360 0.052 0.588 0.000
#> GSM447403 1 0.2561 0.5764 0.856 0.000 0.000 0.000 0.144
#> GSM447405 1 0.1282 0.7087 0.952 0.000 0.000 0.004 0.044
#> GSM447418 3 0.2074 0.8383 0.000 0.104 0.896 0.000 0.000
#> GSM447422 3 0.2471 0.8390 0.000 0.136 0.864 0.000 0.000
#> GSM447424 3 0.2074 0.8383 0.000 0.104 0.896 0.000 0.000
#> GSM447427 3 0.2929 0.8184 0.000 0.180 0.820 0.000 0.000
#> GSM447428 5 0.7443 0.5396 0.320 0.000 0.276 0.032 0.372
#> GSM447429 5 0.4171 0.6323 0.396 0.000 0.000 0.000 0.604
#> GSM447431 2 0.4854 0.5746 0.000 0.648 0.308 0.044 0.000
#> GSM447432 2 0.1043 0.7390 0.000 0.960 0.040 0.000 0.000
#> GSM447434 1 0.4015 0.3408 0.652 0.000 0.000 0.000 0.348
#> GSM447442 2 0.1671 0.7337 0.000 0.924 0.076 0.000 0.000
#> GSM447451 2 0.2599 0.7342 0.000 0.904 0.028 0.044 0.024
#> GSM447462 1 0.4403 0.0560 0.560 0.004 0.000 0.000 0.436
#> GSM447463 1 0.2648 0.6529 0.848 0.000 0.000 0.000 0.152
#> GSM447467 2 0.5009 0.4385 0.060 0.652 0.000 0.000 0.288
#> GSM447469 4 0.6317 0.3283 0.000 0.332 0.172 0.496 0.000
#> GSM447473 1 0.3143 0.4690 0.796 0.000 0.000 0.000 0.204
#> GSM447404 1 0.3143 0.4690 0.796 0.000 0.000 0.000 0.204
#> GSM447406 4 0.3043 0.8024 0.000 0.056 0.080 0.864 0.000
#> GSM447407 4 0.2974 0.8009 0.000 0.052 0.080 0.868 0.000
#> GSM447409 1 0.0794 0.7059 0.972 0.000 0.000 0.000 0.028
#> GSM447412 3 0.3039 0.8081 0.000 0.192 0.808 0.000 0.000
#> GSM447426 3 0.6031 0.4170 0.000 0.000 0.576 0.180 0.244
#> GSM447433 1 0.1774 0.7005 0.932 0.000 0.000 0.016 0.052
#> GSM447439 4 0.3176 0.8008 0.000 0.064 0.080 0.856 0.000
#> GSM447441 2 0.4168 0.6668 0.000 0.756 0.200 0.044 0.000
#> GSM447443 1 0.3730 0.4184 0.712 0.000 0.000 0.000 0.288
#> GSM447445 1 0.2329 0.6847 0.876 0.000 0.000 0.000 0.124
#> GSM447446 1 0.0880 0.7149 0.968 0.000 0.000 0.000 0.032
#> GSM447453 1 0.0000 0.7134 1.000 0.000 0.000 0.000 0.000
#> GSM447455 2 0.1197 0.7398 0.000 0.952 0.048 0.000 0.000
#> GSM447456 2 0.5662 0.5280 0.048 0.692 0.000 0.080 0.180
#> GSM447459 4 0.3043 0.8024 0.000 0.056 0.080 0.864 0.000
#> GSM447466 1 0.2813 0.6558 0.832 0.000 0.000 0.000 0.168
#> GSM447470 1 0.4617 0.0299 0.552 0.012 0.000 0.000 0.436
#> GSM447474 1 0.4510 0.0608 0.560 0.008 0.000 0.000 0.432
#> GSM447475 2 0.2464 0.7229 0.000 0.904 0.004 0.044 0.048
#> GSM447398 2 0.1732 0.7104 0.000 0.920 0.000 0.080 0.000
#> GSM447399 2 0.3682 0.7012 0.000 0.820 0.108 0.072 0.000
#> GSM447408 4 0.4219 0.4440 0.000 0.416 0.000 0.584 0.000
#> GSM447410 2 0.4060 0.2290 0.000 0.640 0.000 0.360 0.000
#> GSM447414 3 0.2074 0.8383 0.000 0.104 0.896 0.000 0.000
#> GSM447417 4 0.4355 0.7405 0.000 0.164 0.076 0.760 0.000
#> GSM447419 5 0.4278 0.5314 0.452 0.000 0.000 0.000 0.548
#> GSM447420 5 0.7065 0.6144 0.272 0.000 0.172 0.044 0.512
#> GSM447421 5 0.4088 0.6392 0.368 0.000 0.000 0.000 0.632
#> GSM447423 3 0.3039 0.8081 0.000 0.192 0.808 0.000 0.000
#> GSM447436 1 0.0290 0.7153 0.992 0.000 0.000 0.000 0.008
#> GSM447437 1 0.2648 0.6529 0.848 0.000 0.000 0.000 0.152
#> GSM447438 2 0.4161 0.4319 0.000 0.704 0.000 0.280 0.016
#> GSM447447 1 0.3774 0.4722 0.704 0.000 0.000 0.000 0.296
#> GSM447454 2 0.3487 0.6523 0.000 0.780 0.212 0.008 0.000
#> GSM447457 2 0.3452 0.6148 0.000 0.756 0.244 0.000 0.000
#> GSM447460 2 0.5113 0.5540 0.000 0.620 0.324 0.056 0.000
#> GSM447465 3 0.2690 0.7999 0.000 0.156 0.844 0.000 0.000
#> GSM447471 1 0.0609 0.7075 0.980 0.000 0.000 0.000 0.020
#> GSM447476 2 0.5629 0.0189 0.024 0.548 0.000 0.392 0.036
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM447401 5 0.0000 0.7873 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM447411 1 0.3857 -0.3606 0.532 0.000 0.000 0.000 0.000 0.468
#> GSM447413 3 0.0363 0.8142 0.000 0.000 0.988 0.012 0.000 0.000
#> GSM447415 1 0.1204 0.8140 0.944 0.000 0.000 0.000 0.000 0.056
#> GSM447416 3 0.0260 0.8190 0.000 0.008 0.992 0.000 0.000 0.000
#> GSM447425 5 0.3464 0.7323 0.000 0.000 0.000 0.312 0.688 0.000
#> GSM447430 4 0.0363 0.6969 0.000 0.000 0.012 0.988 0.000 0.000
#> GSM447435 6 0.3854 0.4657 0.464 0.000 0.000 0.000 0.000 0.536
#> GSM447440 6 0.4057 0.5449 0.388 0.000 0.000 0.012 0.000 0.600
#> GSM447444 6 0.3201 0.5974 0.208 0.000 0.000 0.012 0.000 0.780
#> GSM447448 6 0.4066 0.5257 0.392 0.000 0.000 0.012 0.000 0.596
#> GSM447449 3 0.2020 0.7784 0.000 0.096 0.896 0.008 0.000 0.000
#> GSM447450 6 0.4294 0.5029 0.428 0.000 0.000 0.020 0.000 0.552
#> GSM447452 5 0.3446 0.7355 0.000 0.000 0.000 0.308 0.692 0.000
#> GSM447458 2 0.1327 0.8042 0.000 0.936 0.064 0.000 0.000 0.000
#> GSM447461 2 0.0146 0.8079 0.000 0.996 0.004 0.000 0.000 0.000
#> GSM447464 6 0.3482 0.6471 0.316 0.000 0.000 0.000 0.000 0.684
#> GSM447468 1 0.0508 0.8485 0.984 0.000 0.000 0.004 0.000 0.012
#> GSM447472 6 0.3287 0.6656 0.220 0.000 0.000 0.012 0.000 0.768
#> GSM447400 6 0.0935 0.6920 0.032 0.004 0.000 0.000 0.000 0.964
#> GSM447402 4 0.4455 0.6333 0.000 0.240 0.076 0.684 0.000 0.000
#> GSM447403 1 0.0260 0.8467 0.992 0.000 0.000 0.000 0.000 0.008
#> GSM447405 1 0.2094 0.8173 0.900 0.000 0.000 0.020 0.000 0.080
#> GSM447418 3 0.0146 0.8157 0.000 0.000 0.996 0.004 0.000 0.000
#> GSM447422 3 0.0260 0.8187 0.000 0.008 0.992 0.000 0.000 0.000
#> GSM447424 3 0.0000 0.8172 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM447427 3 0.0458 0.8179 0.000 0.016 0.984 0.000 0.000 0.000
#> GSM447428 3 0.5978 0.2474 0.184 0.000 0.504 0.012 0.000 0.300
#> GSM447429 6 0.3161 0.6453 0.216 0.000 0.008 0.000 0.000 0.776
#> GSM447431 3 0.3659 0.3648 0.000 0.364 0.636 0.000 0.000 0.000
#> GSM447432 2 0.1204 0.8103 0.000 0.944 0.056 0.000 0.000 0.000
#> GSM447434 6 0.1531 0.7003 0.068 0.000 0.000 0.004 0.000 0.928
#> GSM447442 2 0.2730 0.7088 0.000 0.808 0.192 0.000 0.000 0.000
#> GSM447451 2 0.0000 0.8072 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM447462 6 0.0291 0.6840 0.004 0.004 0.000 0.000 0.000 0.992
#> GSM447463 6 0.3725 0.6455 0.316 0.008 0.000 0.000 0.000 0.676
#> GSM447467 6 0.3672 0.2708 0.000 0.368 0.000 0.000 0.000 0.632
#> GSM447469 4 0.3337 0.5437 0.000 0.004 0.260 0.736 0.000 0.000
#> GSM447473 1 0.0000 0.8432 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM447404 1 0.0000 0.8432 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM447406 4 0.0458 0.6999 0.000 0.000 0.016 0.984 0.000 0.000
#> GSM447407 4 0.0363 0.6969 0.000 0.000 0.012 0.988 0.000 0.000
#> GSM447409 1 0.1049 0.8426 0.960 0.000 0.000 0.008 0.000 0.032
#> GSM447412 3 0.2260 0.7417 0.000 0.140 0.860 0.000 0.000 0.000
#> GSM447426 5 0.0000 0.7873 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM447433 1 0.2094 0.8173 0.900 0.000 0.000 0.020 0.000 0.080
#> GSM447439 4 0.0458 0.6999 0.000 0.000 0.016 0.984 0.000 0.000
#> GSM447441 2 0.3309 0.5575 0.000 0.720 0.280 0.000 0.000 0.000
#> GSM447443 1 0.3518 0.5795 0.732 0.000 0.000 0.012 0.000 0.256
#> GSM447445 6 0.3607 0.6199 0.348 0.000 0.000 0.000 0.000 0.652
#> GSM447446 1 0.1867 0.8284 0.916 0.000 0.000 0.020 0.000 0.064
#> GSM447453 1 0.0692 0.8485 0.976 0.000 0.000 0.004 0.000 0.020
#> GSM447455 2 0.1501 0.8041 0.000 0.924 0.076 0.000 0.000 0.000
#> GSM447456 2 0.2265 0.7399 0.024 0.896 0.000 0.004 0.000 0.076
#> GSM447459 4 0.0458 0.6999 0.000 0.000 0.016 0.984 0.000 0.000
#> GSM447466 6 0.3515 0.6434 0.324 0.000 0.000 0.000 0.000 0.676
#> GSM447470 6 0.0291 0.6840 0.004 0.004 0.000 0.000 0.000 0.992
#> GSM447474 6 0.0291 0.6840 0.004 0.004 0.000 0.000 0.000 0.992
#> GSM447475 2 0.0000 0.8072 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM447398 2 0.0405 0.8044 0.000 0.988 0.004 0.008 0.000 0.000
#> GSM447399 3 0.5922 -0.0447 0.000 0.352 0.432 0.216 0.000 0.000
#> GSM447408 4 0.4037 0.5120 0.000 0.380 0.012 0.608 0.000 0.000
#> GSM447410 2 0.3966 -0.2523 0.000 0.552 0.004 0.444 0.000 0.000
#> GSM447414 3 0.0000 0.8172 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM447417 4 0.2433 0.6972 0.000 0.072 0.044 0.884 0.000 0.000
#> GSM447419 1 0.4389 0.2335 0.536 0.000 0.008 0.012 0.000 0.444
#> GSM447420 6 0.4492 0.2542 0.036 0.004 0.340 0.000 0.000 0.620
#> GSM447421 6 0.2431 0.6650 0.132 0.000 0.008 0.000 0.000 0.860
#> GSM447423 3 0.2092 0.7542 0.000 0.124 0.876 0.000 0.000 0.000
#> GSM447436 1 0.0891 0.8477 0.968 0.000 0.000 0.008 0.000 0.024
#> GSM447437 6 0.3482 0.6471 0.316 0.000 0.000 0.000 0.000 0.684
#> GSM447438 4 0.3999 0.2968 0.000 0.496 0.004 0.500 0.000 0.000
#> GSM447447 6 0.2278 0.7046 0.128 0.004 0.000 0.000 0.000 0.868
#> GSM447454 3 0.3756 0.3648 0.000 0.400 0.600 0.000 0.000 0.000
#> GSM447457 2 0.3266 0.5674 0.000 0.728 0.272 0.000 0.000 0.000
#> GSM447460 3 0.1267 0.8019 0.000 0.060 0.940 0.000 0.000 0.000
#> GSM447465 3 0.0260 0.8180 0.000 0.008 0.992 0.000 0.000 0.000
#> GSM447471 1 0.0777 0.8480 0.972 0.000 0.000 0.004 0.000 0.024
#> GSM447476 4 0.4899 0.3496 0.000 0.452 0.000 0.488 0.000 0.060
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 gender(p) agent(p) k
#> CV:mclust 78 0.819 0.2536 2
#> CV:mclust 69 0.139 0.1956 3
#> CV:mclust 70 0.804 0.0414 4
#> CV:mclust 59 0.828 0.0105 5
#> CV:mclust 67 0.551 0.3280 6
If matrix rows can be associated to genes, consider to use functional_enrichment(res,
...)
to perform function enrichment for the signature genes. See this vignette for more detailed explanations.
The object with results only for a single top-value method and a single partition method can be extracted as:
res = res_list["CV", "NMF"]
# you can also extract it by
# res = res_list["CV:NMF"]
A summary of res
and all the functions that can be applied to it:
res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#> On a matrix with 51941 rows and 79 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'CV' method.
#> Subgroups are detected by 'NMF' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 2.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
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.947 0.954 0.978 0.5032 0.498 0.498
#> 3 3 0.725 0.793 0.911 0.3017 0.764 0.563
#> 4 4 0.714 0.745 0.864 0.0920 0.835 0.574
#> 5 5 0.693 0.682 0.830 0.0623 0.858 0.561
#> 6 6 0.609 0.528 0.716 0.0511 0.956 0.825
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
#> GSM447401 2 0.0000 0.962 0.000 1.000
#> GSM447411 1 0.0000 0.995 1.000 0.000
#> GSM447413 2 0.0000 0.962 0.000 1.000
#> GSM447415 1 0.0000 0.995 1.000 0.000
#> GSM447416 2 0.0000 0.962 0.000 1.000
#> GSM447425 2 0.0000 0.962 0.000 1.000
#> GSM447430 2 0.0000 0.962 0.000 1.000
#> GSM447435 1 0.0000 0.995 1.000 0.000
#> GSM447440 1 0.0000 0.995 1.000 0.000
#> GSM447444 1 0.0672 0.989 0.992 0.008
#> GSM447448 1 0.0000 0.995 1.000 0.000
#> GSM447449 2 0.0000 0.962 0.000 1.000
#> GSM447450 1 0.0000 0.995 1.000 0.000
#> GSM447452 2 0.0000 0.962 0.000 1.000
#> GSM447458 2 0.0000 0.962 0.000 1.000
#> GSM447461 2 0.0000 0.962 0.000 1.000
#> GSM447464 1 0.0000 0.995 1.000 0.000
#> GSM447468 1 0.0000 0.995 1.000 0.000
#> GSM447472 1 0.0000 0.995 1.000 0.000
#> GSM447400 1 0.0000 0.995 1.000 0.000
#> GSM447402 2 0.0376 0.959 0.004 0.996
#> GSM447403 1 0.0000 0.995 1.000 0.000
#> GSM447405 1 0.0000 0.995 1.000 0.000
#> GSM447418 2 0.0000 0.962 0.000 1.000
#> GSM447422 2 0.0000 0.962 0.000 1.000
#> GSM447424 2 0.0000 0.962 0.000 1.000
#> GSM447427 2 0.0000 0.962 0.000 1.000
#> GSM447428 2 0.7219 0.768 0.200 0.800
#> GSM447429 1 0.0000 0.995 1.000 0.000
#> GSM447431 2 0.0000 0.962 0.000 1.000
#> GSM447432 2 0.0000 0.962 0.000 1.000
#> GSM447434 1 0.0000 0.995 1.000 0.000
#> GSM447442 2 0.0000 0.962 0.000 1.000
#> GSM447451 2 0.2236 0.934 0.036 0.964
#> GSM447462 1 0.0000 0.995 1.000 0.000
#> GSM447463 1 0.0000 0.995 1.000 0.000
#> GSM447467 2 0.8813 0.613 0.300 0.700
#> GSM447469 2 0.0000 0.962 0.000 1.000
#> GSM447473 1 0.0000 0.995 1.000 0.000
#> GSM447404 1 0.0000 0.995 1.000 0.000
#> GSM447406 2 0.0000 0.962 0.000 1.000
#> GSM447407 2 0.0000 0.962 0.000 1.000
#> GSM447409 1 0.0000 0.995 1.000 0.000
#> GSM447412 2 0.0000 0.962 0.000 1.000
#> GSM447426 2 0.0000 0.962 0.000 1.000
#> GSM447433 1 0.0000 0.995 1.000 0.000
#> GSM447439 2 0.0000 0.962 0.000 1.000
#> GSM447441 2 0.0000 0.962 0.000 1.000
#> GSM447443 1 0.0000 0.995 1.000 0.000
#> GSM447445 1 0.0000 0.995 1.000 0.000
#> GSM447446 1 0.0000 0.995 1.000 0.000
#> GSM447453 1 0.0000 0.995 1.000 0.000
#> GSM447455 2 0.0000 0.962 0.000 1.000
#> GSM447456 1 0.1414 0.979 0.980 0.020
#> GSM447459 2 0.0000 0.962 0.000 1.000
#> GSM447466 1 0.0000 0.995 1.000 0.000
#> GSM447470 1 0.1843 0.972 0.972 0.028
#> GSM447474 1 0.0376 0.992 0.996 0.004
#> GSM447475 2 0.7883 0.719 0.236 0.764
#> GSM447398 2 0.7602 0.742 0.220 0.780
#> GSM447399 2 0.0000 0.962 0.000 1.000
#> GSM447408 2 0.0000 0.962 0.000 1.000
#> GSM447410 2 0.0376 0.959 0.004 0.996
#> GSM447414 2 0.0000 0.962 0.000 1.000
#> GSM447417 2 0.0000 0.962 0.000 1.000
#> GSM447419 1 0.0938 0.986 0.988 0.012
#> GSM447420 2 0.9552 0.453 0.376 0.624
#> GSM447421 1 0.0000 0.995 1.000 0.000
#> GSM447423 2 0.0000 0.962 0.000 1.000
#> GSM447436 1 0.2778 0.951 0.952 0.048
#> GSM447437 1 0.0000 0.995 1.000 0.000
#> GSM447438 2 0.6973 0.783 0.188 0.812
#> GSM447447 1 0.0000 0.995 1.000 0.000
#> GSM447454 2 0.0000 0.962 0.000 1.000
#> GSM447457 2 0.0000 0.962 0.000 1.000
#> GSM447460 2 0.0000 0.962 0.000 1.000
#> GSM447465 2 0.0000 0.962 0.000 1.000
#> GSM447471 1 0.0000 0.995 1.000 0.000
#> GSM447476 1 0.2423 0.960 0.960 0.040
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM447401 3 0.0000 0.90356 0.000 0.000 1.000
#> GSM447411 1 0.0000 0.92122 1.000 0.000 0.000
#> GSM447413 3 0.0000 0.90356 0.000 0.000 1.000
#> GSM447415 1 0.0000 0.92122 1.000 0.000 0.000
#> GSM447416 3 0.3038 0.83647 0.000 0.104 0.896
#> GSM447425 2 0.4062 0.78959 0.000 0.836 0.164
#> GSM447430 2 0.0000 0.85627 0.000 1.000 0.000
#> GSM447435 1 0.0000 0.92122 1.000 0.000 0.000
#> GSM447440 1 0.0000 0.92122 1.000 0.000 0.000
#> GSM447444 1 0.0000 0.92122 1.000 0.000 0.000
#> GSM447448 1 0.0000 0.92122 1.000 0.000 0.000
#> GSM447449 2 0.6045 0.52418 0.000 0.620 0.380
#> GSM447450 1 0.0000 0.92122 1.000 0.000 0.000
#> GSM447452 2 0.1964 0.84302 0.000 0.944 0.056
#> GSM447458 2 0.4504 0.76513 0.000 0.804 0.196
#> GSM447461 2 0.0747 0.85220 0.016 0.984 0.000
#> GSM447464 1 0.0000 0.92122 1.000 0.000 0.000
#> GSM447468 1 0.0000 0.92122 1.000 0.000 0.000
#> GSM447472 1 0.0000 0.92122 1.000 0.000 0.000
#> GSM447400 1 0.0000 0.92122 1.000 0.000 0.000
#> GSM447402 2 0.5598 0.77982 0.052 0.800 0.148
#> GSM447403 1 0.0000 0.92122 1.000 0.000 0.000
#> GSM447405 1 0.0000 0.92122 1.000 0.000 0.000
#> GSM447418 3 0.0000 0.90356 0.000 0.000 1.000
#> GSM447422 3 0.0000 0.90356 0.000 0.000 1.000
#> GSM447424 3 0.0000 0.90356 0.000 0.000 1.000
#> GSM447427 3 0.0000 0.90356 0.000 0.000 1.000
#> GSM447428 3 0.0000 0.90356 0.000 0.000 1.000
#> GSM447429 1 0.5327 0.61207 0.728 0.000 0.272
#> GSM447431 3 0.0237 0.90294 0.000 0.004 0.996
#> GSM447432 2 0.6225 0.40064 0.000 0.568 0.432
#> GSM447434 1 0.0000 0.92122 1.000 0.000 0.000
#> GSM447442 3 0.6308 -0.25626 0.000 0.492 0.508
#> GSM447451 2 0.6380 0.72050 0.164 0.760 0.076
#> GSM447462 1 0.1860 0.87868 0.948 0.000 0.052
#> GSM447463 1 0.0000 0.92122 1.000 0.000 0.000
#> GSM447467 1 0.6154 0.32344 0.592 0.000 0.408
#> GSM447469 2 0.4605 0.76040 0.000 0.796 0.204
#> GSM447473 1 0.0000 0.92122 1.000 0.000 0.000
#> GSM447404 1 0.0000 0.92122 1.000 0.000 0.000
#> GSM447406 2 0.0000 0.85627 0.000 1.000 0.000
#> GSM447407 2 0.0000 0.85627 0.000 1.000 0.000
#> GSM447409 1 0.0000 0.92122 1.000 0.000 0.000
#> GSM447412 3 0.0424 0.90214 0.000 0.008 0.992
#> GSM447426 3 0.0000 0.90356 0.000 0.000 1.000
#> GSM447433 1 0.1411 0.89328 0.964 0.036 0.000
#> GSM447439 2 0.0000 0.85627 0.000 1.000 0.000
#> GSM447441 2 0.4452 0.72203 0.000 0.808 0.192
#> GSM447443 1 0.0000 0.92122 1.000 0.000 0.000
#> GSM447445 1 0.0000 0.92122 1.000 0.000 0.000
#> GSM447446 1 0.6280 0.11007 0.540 0.460 0.000
#> GSM447453 1 0.0000 0.92122 1.000 0.000 0.000
#> GSM447455 2 0.1289 0.85132 0.000 0.968 0.032
#> GSM447456 2 0.6180 0.27935 0.416 0.584 0.000
#> GSM447459 2 0.0000 0.85627 0.000 1.000 0.000
#> GSM447466 1 0.0000 0.92122 1.000 0.000 0.000
#> GSM447470 1 0.0000 0.92122 1.000 0.000 0.000
#> GSM447474 1 0.0000 0.92122 1.000 0.000 0.000
#> GSM447475 1 0.9088 -0.00356 0.464 0.396 0.140
#> GSM447398 2 0.0237 0.85559 0.004 0.996 0.000
#> GSM447399 2 0.3816 0.77078 0.000 0.852 0.148
#> GSM447408 2 0.0000 0.85627 0.000 1.000 0.000
#> GSM447410 2 0.0000 0.85627 0.000 1.000 0.000
#> GSM447414 3 0.0424 0.90136 0.000 0.008 0.992
#> GSM447417 2 0.0000 0.85627 0.000 1.000 0.000
#> GSM447419 3 0.5327 0.58350 0.272 0.000 0.728
#> GSM447420 3 0.4702 0.68444 0.212 0.000 0.788
#> GSM447421 1 0.6111 0.35582 0.604 0.000 0.396
#> GSM447423 3 0.0424 0.90214 0.000 0.008 0.992
#> GSM447436 1 0.5905 0.42341 0.648 0.352 0.000
#> GSM447437 1 0.0000 0.92122 1.000 0.000 0.000
#> GSM447438 2 0.0000 0.85627 0.000 1.000 0.000
#> GSM447447 1 0.0000 0.92122 1.000 0.000 0.000
#> GSM447454 3 0.4351 0.76512 0.004 0.168 0.828
#> GSM447457 3 0.2711 0.84887 0.000 0.088 0.912
#> GSM447460 2 0.4605 0.70967 0.000 0.796 0.204
#> GSM447465 3 0.0747 0.89897 0.000 0.016 0.984
#> GSM447471 1 0.0000 0.92122 1.000 0.000 0.000
#> GSM447476 2 0.4931 0.67446 0.232 0.768 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM447401 3 0.2281 0.7048 0.000 0.000 0.904 0.096
#> GSM447411 1 0.0000 0.9650 1.000 0.000 0.000 0.000
#> GSM447413 3 0.0592 0.7419 0.000 0.000 0.984 0.016
#> GSM447415 1 0.0000 0.9650 1.000 0.000 0.000 0.000
#> GSM447416 3 0.4356 0.7116 0.000 0.048 0.804 0.148
#> GSM447425 4 0.3444 0.6474 0.000 0.000 0.184 0.816
#> GSM447430 4 0.1610 0.7031 0.000 0.016 0.032 0.952
#> GSM447435 1 0.0000 0.9650 1.000 0.000 0.000 0.000
#> GSM447440 1 0.0000 0.9650 1.000 0.000 0.000 0.000
#> GSM447444 1 0.0921 0.9447 0.972 0.028 0.000 0.000
#> GSM447448 1 0.0000 0.9650 1.000 0.000 0.000 0.000
#> GSM447449 2 0.4824 0.6637 0.000 0.780 0.076 0.144
#> GSM447450 1 0.0000 0.9650 1.000 0.000 0.000 0.000
#> GSM447452 4 0.3444 0.6474 0.000 0.000 0.184 0.816
#> GSM447458 2 0.0804 0.7556 0.000 0.980 0.008 0.012
#> GSM447461 2 0.3157 0.7436 0.004 0.852 0.000 0.144
#> GSM447464 1 0.0000 0.9650 1.000 0.000 0.000 0.000
#> GSM447468 1 0.0000 0.9650 1.000 0.000 0.000 0.000
#> GSM447472 1 0.0000 0.9650 1.000 0.000 0.000 0.000
#> GSM447400 1 0.0469 0.9575 0.988 0.012 0.000 0.000
#> GSM447402 4 0.4843 0.6543 0.072 0.108 0.016 0.804
#> GSM447403 1 0.0000 0.9650 1.000 0.000 0.000 0.000
#> GSM447405 1 0.4981 -0.0832 0.536 0.000 0.000 0.464
#> GSM447418 3 0.3764 0.7774 0.000 0.216 0.784 0.000
#> GSM447422 3 0.4888 0.5102 0.000 0.412 0.588 0.000
#> GSM447424 3 0.3444 0.7806 0.000 0.184 0.816 0.000
#> GSM447427 3 0.3801 0.7757 0.000 0.220 0.780 0.000
#> GSM447428 3 0.3521 0.7547 0.084 0.052 0.864 0.000
#> GSM447429 1 0.0817 0.9468 0.976 0.000 0.024 0.000
#> GSM447431 2 0.4406 0.3271 0.000 0.700 0.300 0.000
#> GSM447432 2 0.0779 0.7539 0.000 0.980 0.016 0.004
#> GSM447434 1 0.0000 0.9650 1.000 0.000 0.000 0.000
#> GSM447442 2 0.1452 0.7447 0.000 0.956 0.036 0.008
#> GSM447451 2 0.4231 0.7187 0.096 0.824 0.000 0.080
#> GSM447462 1 0.0817 0.9478 0.976 0.024 0.000 0.000
#> GSM447463 1 0.0469 0.9586 0.988 0.012 0.000 0.000
#> GSM447467 2 0.4059 0.5737 0.200 0.788 0.012 0.000
#> GSM447469 4 0.4098 0.5896 0.000 0.204 0.012 0.784
#> GSM447473 1 0.0000 0.9650 1.000 0.000 0.000 0.000
#> GSM447404 1 0.0000 0.9650 1.000 0.000 0.000 0.000
#> GSM447406 4 0.3801 0.6088 0.000 0.220 0.000 0.780
#> GSM447407 4 0.0188 0.7031 0.000 0.000 0.004 0.996
#> GSM447409 1 0.0000 0.9650 1.000 0.000 0.000 0.000
#> GSM447412 3 0.3764 0.7782 0.000 0.216 0.784 0.000
#> GSM447426 3 0.1792 0.7211 0.000 0.000 0.932 0.068
#> GSM447433 4 0.4996 0.1871 0.484 0.000 0.000 0.516
#> GSM447439 4 0.3172 0.6570 0.000 0.160 0.000 0.840
#> GSM447441 2 0.3172 0.7343 0.000 0.840 0.000 0.160
#> GSM447443 1 0.0000 0.9650 1.000 0.000 0.000 0.000
#> GSM447445 1 0.0188 0.9629 0.996 0.004 0.000 0.000
#> GSM447446 4 0.4040 0.5966 0.248 0.000 0.000 0.752
#> GSM447453 1 0.0000 0.9650 1.000 0.000 0.000 0.000
#> GSM447455 2 0.1211 0.7667 0.000 0.960 0.000 0.040
#> GSM447456 2 0.4925 0.2560 0.428 0.572 0.000 0.000
#> GSM447459 4 0.1022 0.7023 0.000 0.032 0.000 0.968
#> GSM447466 1 0.0000 0.9650 1.000 0.000 0.000 0.000
#> GSM447470 1 0.3266 0.7738 0.832 0.168 0.000 0.000
#> GSM447474 1 0.0469 0.9582 0.988 0.012 0.000 0.000
#> GSM447475 2 0.4123 0.6919 0.136 0.820 0.000 0.044
#> GSM447398 2 0.3444 0.7171 0.000 0.816 0.000 0.184
#> GSM447399 2 0.4040 0.6517 0.000 0.752 0.000 0.248
#> GSM447408 4 0.3873 0.6072 0.000 0.228 0.000 0.772
#> GSM447410 4 0.4356 0.5169 0.000 0.292 0.000 0.708
#> GSM447414 3 0.4661 0.7361 0.000 0.256 0.728 0.016
#> GSM447417 4 0.1792 0.6960 0.000 0.068 0.000 0.932
#> GSM447419 3 0.5085 0.4052 0.376 0.008 0.616 0.000
#> GSM447420 3 0.4158 0.6272 0.224 0.008 0.768 0.000
#> GSM447421 1 0.2081 0.8837 0.916 0.000 0.084 0.000
#> GSM447423 3 0.4103 0.7537 0.000 0.256 0.744 0.000
#> GSM447436 4 0.4981 0.2389 0.464 0.000 0.000 0.536
#> GSM447437 1 0.0000 0.9650 1.000 0.000 0.000 0.000
#> GSM447438 4 0.4134 0.5683 0.000 0.260 0.000 0.740
#> GSM447447 1 0.0921 0.9447 0.972 0.028 0.000 0.000
#> GSM447454 2 0.3687 0.7483 0.000 0.856 0.080 0.064
#> GSM447457 2 0.3266 0.6180 0.000 0.832 0.168 0.000
#> GSM447460 2 0.4188 0.6849 0.000 0.752 0.004 0.244
#> GSM447465 2 0.3853 0.6461 0.000 0.820 0.160 0.020
#> GSM447471 1 0.0000 0.9650 1.000 0.000 0.000 0.000
#> GSM447476 4 0.5398 0.3977 0.404 0.016 0.000 0.580
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM447401 3 0.3534 0.7255 0.000 0.000 0.744 0.000 0.256
#> GSM447411 1 0.0404 0.8960 0.988 0.012 0.000 0.000 0.000
#> GSM447413 3 0.3655 0.7803 0.000 0.036 0.804 0.000 0.160
#> GSM447415 1 0.0162 0.8963 0.996 0.004 0.000 0.000 0.000
#> GSM447416 3 0.2881 0.7743 0.000 0.012 0.860 0.124 0.004
#> GSM447425 5 0.1106 0.6656 0.000 0.024 0.000 0.012 0.964
#> GSM447430 4 0.4235 0.5099 0.000 0.008 0.000 0.656 0.336
#> GSM447435 1 0.0671 0.8960 0.980 0.016 0.000 0.004 0.000
#> GSM447440 1 0.2264 0.8669 0.912 0.060 0.004 0.024 0.000
#> GSM447444 2 0.5663 0.2192 0.412 0.508 0.000 0.000 0.080
#> GSM447448 1 0.0955 0.8947 0.968 0.028 0.000 0.000 0.004
#> GSM447449 2 0.3183 0.6372 0.000 0.828 0.016 0.000 0.156
#> GSM447450 1 0.0671 0.8957 0.980 0.016 0.000 0.004 0.000
#> GSM447452 5 0.1502 0.6534 0.000 0.004 0.000 0.056 0.940
#> GSM447458 2 0.2047 0.6929 0.012 0.928 0.000 0.020 0.040
#> GSM447461 4 0.4270 0.6767 0.004 0.248 0.016 0.728 0.004
#> GSM447464 1 0.1492 0.8874 0.948 0.040 0.008 0.004 0.000
#> GSM447468 1 0.0404 0.8960 0.988 0.012 0.000 0.000 0.000
#> GSM447472 1 0.1952 0.8516 0.912 0.084 0.000 0.004 0.000
#> GSM447400 1 0.1862 0.8809 0.932 0.048 0.016 0.004 0.000
#> GSM447402 5 0.3972 0.5710 0.016 0.212 0.008 0.000 0.764
#> GSM447403 1 0.0613 0.8952 0.984 0.004 0.000 0.004 0.008
#> GSM447405 1 0.4822 0.3559 0.628 0.008 0.000 0.020 0.344
#> GSM447418 2 0.4307 0.0404 0.000 0.504 0.496 0.000 0.000
#> GSM447422 2 0.2970 0.6625 0.000 0.828 0.168 0.000 0.004
#> GSM447424 3 0.1205 0.8097 0.000 0.040 0.956 0.000 0.004
#> GSM447427 3 0.1965 0.7962 0.000 0.096 0.904 0.000 0.000
#> GSM447428 3 0.2541 0.7947 0.068 0.020 0.900 0.000 0.012
#> GSM447429 1 0.1492 0.8842 0.948 0.000 0.040 0.004 0.008
#> GSM447431 4 0.4438 0.6606 0.000 0.224 0.040 0.732 0.004
#> GSM447432 2 0.2086 0.6930 0.000 0.924 0.020 0.048 0.008
#> GSM447434 1 0.1444 0.8853 0.948 0.012 0.000 0.040 0.000
#> GSM447442 2 0.1369 0.6978 0.000 0.956 0.028 0.008 0.008
#> GSM447451 4 0.5481 0.2880 0.048 0.384 0.004 0.560 0.004
#> GSM447462 1 0.2830 0.8463 0.884 0.080 0.020 0.016 0.000
#> GSM447463 1 0.1544 0.8700 0.932 0.068 0.000 0.000 0.000
#> GSM447467 2 0.1721 0.6951 0.020 0.944 0.020 0.000 0.016
#> GSM447469 2 0.5633 0.1578 0.000 0.512 0.056 0.008 0.424
#> GSM447473 1 0.0613 0.8952 0.984 0.004 0.000 0.004 0.008
#> GSM447404 1 0.0740 0.8944 0.980 0.008 0.000 0.004 0.008
#> GSM447406 4 0.1502 0.7656 0.000 0.004 0.000 0.940 0.056
#> GSM447407 5 0.3109 0.5478 0.000 0.000 0.000 0.200 0.800
#> GSM447409 1 0.0981 0.8957 0.972 0.012 0.000 0.008 0.008
#> GSM447412 3 0.1997 0.8121 0.000 0.040 0.924 0.036 0.000
#> GSM447426 3 0.3452 0.7356 0.000 0.000 0.756 0.000 0.244
#> GSM447433 1 0.5265 -0.0992 0.496 0.028 0.004 0.004 0.468
#> GSM447439 4 0.1740 0.7625 0.000 0.012 0.000 0.932 0.056
#> GSM447441 4 0.3544 0.6649 0.000 0.200 0.008 0.788 0.004
#> GSM447443 1 0.1143 0.8954 0.968 0.012 0.008 0.004 0.008
#> GSM447445 1 0.1059 0.8962 0.968 0.020 0.004 0.000 0.008
#> GSM447446 5 0.3944 0.6032 0.212 0.020 0.000 0.004 0.764
#> GSM447453 1 0.0865 0.8948 0.972 0.004 0.000 0.000 0.024
#> GSM447455 2 0.2929 0.6668 0.000 0.840 0.008 0.152 0.000
#> GSM447456 4 0.4925 0.3216 0.324 0.044 0.000 0.632 0.000
#> GSM447459 4 0.3661 0.5717 0.000 0.000 0.000 0.724 0.276
#> GSM447466 1 0.1074 0.8949 0.968 0.016 0.012 0.004 0.000
#> GSM447470 1 0.3934 0.6470 0.748 0.236 0.012 0.004 0.000
#> GSM447474 1 0.1471 0.8893 0.952 0.024 0.020 0.004 0.000
#> GSM447475 2 0.5524 0.5769 0.096 0.696 0.020 0.184 0.004
#> GSM447398 4 0.1981 0.7668 0.016 0.064 0.000 0.920 0.000
#> GSM447399 4 0.2439 0.7496 0.000 0.120 0.000 0.876 0.004
#> GSM447408 4 0.2647 0.7554 0.000 0.024 0.008 0.892 0.076
#> GSM447410 4 0.1597 0.7705 0.000 0.024 0.008 0.948 0.020
#> GSM447414 3 0.3981 0.7567 0.000 0.060 0.800 0.136 0.004
#> GSM447417 2 0.6719 0.3506 0.000 0.476 0.008 0.208 0.308
#> GSM447419 3 0.5448 0.3674 0.340 0.076 0.584 0.000 0.000
#> GSM447420 3 0.3684 0.6761 0.172 0.024 0.800 0.004 0.000
#> GSM447421 1 0.3425 0.8022 0.840 0.044 0.112 0.004 0.000
#> GSM447423 3 0.1197 0.8116 0.000 0.048 0.952 0.000 0.000
#> GSM447436 5 0.5008 0.2073 0.428 0.024 0.000 0.004 0.544
#> GSM447437 1 0.0613 0.8952 0.984 0.004 0.000 0.004 0.008
#> GSM447438 4 0.1934 0.7691 0.000 0.020 0.008 0.932 0.040
#> GSM447447 2 0.5864 0.2570 0.364 0.548 0.004 0.004 0.080
#> GSM447454 2 0.5674 0.4839 0.004 0.624 0.092 0.276 0.004
#> GSM447457 2 0.3838 0.6834 0.000 0.804 0.148 0.044 0.004
#> GSM447460 2 0.4114 0.5732 0.000 0.712 0.000 0.272 0.016
#> GSM447465 2 0.4442 0.6787 0.000 0.784 0.084 0.116 0.016
#> GSM447471 1 0.0613 0.8952 0.984 0.004 0.000 0.004 0.008
#> GSM447476 1 0.7367 0.0673 0.500 0.040 0.008 0.236 0.216
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM447401 6 0.3899 0.2464 0.000 0.000 0.364 0.000 0.008 0.628
#> GSM447411 1 0.0713 0.7300 0.972 0.000 0.000 0.000 0.028 0.000
#> GSM447413 3 0.5368 0.6640 0.000 0.088 0.724 0.076 0.040 0.072
#> GSM447415 1 0.0632 0.7274 0.976 0.000 0.000 0.000 0.024 0.000
#> GSM447416 3 0.3230 0.7310 0.000 0.000 0.844 0.084 0.056 0.016
#> GSM447425 6 0.4565 0.2811 0.000 0.072 0.000 0.004 0.244 0.680
#> GSM447430 4 0.4880 0.3757 0.000 0.016 0.000 0.540 0.032 0.412
#> GSM447435 1 0.1327 0.7280 0.936 0.000 0.000 0.000 0.064 0.000
#> GSM447440 1 0.3802 0.6628 0.788 0.056 0.000 0.012 0.144 0.000
#> GSM447444 2 0.5068 -0.0311 0.456 0.484 0.000 0.000 0.048 0.012
#> GSM447448 1 0.3039 0.6901 0.848 0.088 0.000 0.000 0.060 0.004
#> GSM447449 2 0.2995 0.6208 0.000 0.860 0.008 0.008 0.092 0.032
#> GSM447450 1 0.2790 0.7002 0.840 0.020 0.000 0.000 0.140 0.000
#> GSM447452 6 0.0603 0.4837 0.000 0.004 0.000 0.000 0.016 0.980
#> GSM447458 2 0.1812 0.6370 0.000 0.912 0.000 0.000 0.080 0.008
#> GSM447461 4 0.5973 0.5088 0.020 0.204 0.000 0.568 0.204 0.004
#> GSM447464 1 0.3608 0.6545 0.788 0.064 0.000 0.000 0.148 0.000
#> GSM447468 1 0.0713 0.7304 0.972 0.000 0.000 0.000 0.028 0.000
#> GSM447472 1 0.3042 0.6926 0.836 0.032 0.000 0.004 0.128 0.000
#> GSM447400 1 0.4087 0.6637 0.744 0.064 0.000 0.004 0.188 0.000
#> GSM447402 5 0.6033 -0.1640 0.000 0.248 0.000 0.000 0.388 0.364
#> GSM447403 1 0.2416 0.6776 0.844 0.000 0.000 0.000 0.156 0.000
#> GSM447405 1 0.5842 -0.0862 0.548 0.000 0.000 0.024 0.296 0.132
#> GSM447418 2 0.4456 0.2032 0.000 0.524 0.448 0.000 0.028 0.000
#> GSM447422 2 0.3595 0.5743 0.000 0.772 0.200 0.004 0.020 0.004
#> GSM447424 3 0.1116 0.7649 0.000 0.028 0.960 0.000 0.004 0.008
#> GSM447427 3 0.1588 0.7624 0.000 0.072 0.924 0.004 0.000 0.000
#> GSM447428 3 0.3362 0.7212 0.084 0.016 0.848 0.000 0.020 0.032
#> GSM447429 1 0.3544 0.6566 0.800 0.000 0.080 0.000 0.120 0.000
#> GSM447431 4 0.4948 0.6361 0.000 0.176 0.036 0.716 0.060 0.012
#> GSM447432 2 0.3300 0.6061 0.000 0.832 0.004 0.052 0.108 0.004
#> GSM447434 1 0.3544 0.6645 0.800 0.000 0.000 0.080 0.120 0.000
#> GSM447442 2 0.0993 0.6414 0.000 0.964 0.012 0.000 0.024 0.000
#> GSM447451 4 0.5672 0.5130 0.024 0.216 0.000 0.616 0.140 0.004
#> GSM447462 1 0.4540 0.5943 0.720 0.080 0.004 0.008 0.188 0.000
#> GSM447463 1 0.2728 0.7111 0.860 0.040 0.000 0.000 0.100 0.000
#> GSM447467 2 0.1340 0.6403 0.008 0.948 0.004 0.000 0.040 0.000
#> GSM447469 2 0.5933 0.2674 0.000 0.516 0.020 0.004 0.340 0.120
#> GSM447473 1 0.2697 0.6607 0.812 0.000 0.000 0.000 0.188 0.000
#> GSM447404 1 0.2527 0.6661 0.832 0.000 0.000 0.000 0.168 0.000
#> GSM447406 4 0.1444 0.7158 0.000 0.000 0.000 0.928 0.000 0.072
#> GSM447407 6 0.1908 0.4626 0.000 0.000 0.000 0.096 0.004 0.900
#> GSM447409 1 0.2664 0.6642 0.816 0.000 0.000 0.000 0.184 0.000
#> GSM447412 3 0.2265 0.7687 0.000 0.024 0.900 0.068 0.008 0.000
#> GSM447426 6 0.4010 0.1537 0.000 0.000 0.408 0.000 0.008 0.584
#> GSM447433 5 0.6071 0.3825 0.404 0.008 0.000 0.004 0.420 0.164
#> GSM447439 4 0.3276 0.7046 0.000 0.020 0.000 0.844 0.068 0.068
#> GSM447441 4 0.4012 0.6386 0.000 0.144 0.004 0.772 0.076 0.004
#> GSM447443 1 0.4032 0.5977 0.740 0.000 0.068 0.000 0.192 0.000
#> GSM447445 1 0.2060 0.7306 0.900 0.016 0.000 0.000 0.084 0.000
#> GSM447446 6 0.6474 -0.5196 0.296 0.016 0.000 0.000 0.328 0.360
#> GSM447453 1 0.3915 0.5180 0.736 0.008 0.000 0.000 0.028 0.228
#> GSM447455 2 0.3721 0.6310 0.000 0.816 0.024 0.104 0.052 0.004
#> GSM447456 1 0.6652 -0.0511 0.404 0.052 0.000 0.392 0.148 0.004
#> GSM447459 4 0.4616 0.5195 0.000 0.000 0.000 0.624 0.060 0.316
#> GSM447466 1 0.1866 0.7228 0.908 0.008 0.000 0.000 0.084 0.000
#> GSM447470 1 0.4900 0.5301 0.680 0.176 0.000 0.008 0.136 0.000
#> GSM447474 1 0.3960 0.6306 0.752 0.032 0.004 0.008 0.204 0.000
#> GSM447475 2 0.6705 0.3710 0.060 0.496 0.000 0.192 0.248 0.004
#> GSM447398 4 0.2939 0.7080 0.012 0.032 0.000 0.856 0.100 0.000
#> GSM447399 4 0.3720 0.6937 0.000 0.032 0.036 0.820 0.104 0.008
#> GSM447408 4 0.4139 0.6574 0.000 0.004 0.000 0.700 0.260 0.036
#> GSM447410 4 0.3738 0.6468 0.000 0.000 0.000 0.704 0.280 0.016
#> GSM447414 3 0.3798 0.7313 0.000 0.040 0.800 0.128 0.032 0.000
#> GSM447417 2 0.6722 0.3252 0.000 0.456 0.000 0.132 0.324 0.088
#> GSM447419 3 0.5962 0.2923 0.324 0.028 0.532 0.004 0.112 0.000
#> GSM447420 3 0.5006 0.5820 0.132 0.012 0.700 0.004 0.148 0.004
#> GSM447421 1 0.6111 0.3979 0.576 0.056 0.220 0.000 0.148 0.000
#> GSM447423 3 0.2076 0.7669 0.000 0.016 0.912 0.012 0.060 0.000
#> GSM447436 5 0.6265 0.4561 0.360 0.016 0.000 0.000 0.420 0.204
#> GSM447437 1 0.2092 0.6977 0.876 0.000 0.000 0.000 0.124 0.000
#> GSM447438 4 0.3616 0.6850 0.012 0.000 0.000 0.780 0.184 0.024
#> GSM447447 2 0.6029 -0.1660 0.248 0.396 0.000 0.000 0.356 0.000
#> GSM447454 2 0.7624 0.1303 0.000 0.344 0.180 0.292 0.180 0.004
#> GSM447457 2 0.5732 0.5827 0.000 0.644 0.120 0.056 0.176 0.004
#> GSM447460 2 0.5283 0.4512 0.000 0.608 0.012 0.304 0.064 0.012
#> GSM447465 2 0.4561 0.6257 0.000 0.756 0.064 0.108 0.072 0.000
#> GSM447471 1 0.2597 0.6718 0.824 0.000 0.000 0.000 0.176 0.000
#> GSM447476 5 0.6794 0.3644 0.200 0.044 0.000 0.168 0.548 0.040
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
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 gender(p) agent(p) k
#> CV:NMF 78 1.000 0.2561 2
#> CV:NMF 71 0.321 0.0573 3
#> CV:NMF 72 0.408 0.3062 4
#> CV:NMF 66 0.373 0.4044 5
#> CV:NMF 56 0.155 0.1874 6
If matrix rows can be associated to genes, consider to use functional_enrichment(res,
...)
to perform function enrichment for the signature genes. See this vignette for more detailed explanations.
The object with results only for a single top-value method and a single partition method can be extracted as:
res = res_list["MAD", "hclust"]
# you can also extract it by
# res = res_list["MAD:hclust"]
A summary of res
and all the functions that can be applied to it:
res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#> On a matrix with 51941 rows and 79 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'MAD' method.
#> Subgroups are detected by 'hclust' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 2.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 0.945 0.937 0.974 0.4957 0.507 0.507
#> 3 3 0.658 0.611 0.814 0.2520 0.810 0.634
#> 4 4 0.669 0.621 0.735 0.1072 0.888 0.707
#> 5 5 0.633 0.633 0.761 0.0717 0.883 0.671
#> 6 6 0.664 0.572 0.695 0.0617 0.877 0.591
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 2
Following shows the table of the partitions (You need to click the show/hide
code output link to see it). The membership matrix (columns with name p*
)
is inferred by
clue::cl_consensus()
function with the SE
method. Basically the value in the membership matrix
represents the probability to belong to a certain group. The finall class
label for an item is determined with the group with highest probability it
belongs to.
In get_classes()
function, the entropy is calculated from the membership
matrix and the silhouette score is calculated from the consensus matrix.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> GSM447401 2 0.0000 0.9641 0.000 1.000
#> GSM447411 1 0.0000 0.9842 1.000 0.000
#> GSM447413 2 0.0000 0.9641 0.000 1.000
#> GSM447415 1 0.0000 0.9842 1.000 0.000
#> GSM447416 2 0.0000 0.9641 0.000 1.000
#> GSM447425 2 0.0000 0.9641 0.000 1.000
#> GSM447430 2 0.0000 0.9641 0.000 1.000
#> GSM447435 1 0.0000 0.9842 1.000 0.000
#> GSM447440 1 0.0000 0.9842 1.000 0.000
#> GSM447444 1 0.7528 0.7178 0.784 0.216
#> GSM447448 1 0.4939 0.8753 0.892 0.108
#> GSM447449 2 0.0000 0.9641 0.000 1.000
#> GSM447450 1 0.0000 0.9842 1.000 0.000
#> GSM447452 2 0.0000 0.9641 0.000 1.000
#> GSM447458 2 0.0672 0.9599 0.008 0.992
#> GSM447461 2 0.1633 0.9495 0.024 0.976
#> GSM447464 1 0.0000 0.9842 1.000 0.000
#> GSM447468 1 0.0000 0.9842 1.000 0.000
#> GSM447472 1 0.0000 0.9842 1.000 0.000
#> GSM447400 1 0.0000 0.9842 1.000 0.000
#> GSM447402 2 0.0000 0.9641 0.000 1.000
#> GSM447403 1 0.0000 0.9842 1.000 0.000
#> GSM447405 2 0.9970 0.1449 0.468 0.532
#> GSM447418 2 0.0000 0.9641 0.000 1.000
#> GSM447422 2 0.0000 0.9641 0.000 1.000
#> GSM447424 2 0.0000 0.9641 0.000 1.000
#> GSM447427 2 0.0000 0.9641 0.000 1.000
#> GSM447428 1 0.0000 0.9842 1.000 0.000
#> GSM447429 1 0.0000 0.9842 1.000 0.000
#> GSM447431 2 0.0000 0.9641 0.000 1.000
#> GSM447432 2 0.0376 0.9621 0.004 0.996
#> GSM447434 2 0.7453 0.7304 0.212 0.788
#> GSM447442 2 0.0000 0.9641 0.000 1.000
#> GSM447451 2 0.1633 0.9495 0.024 0.976
#> GSM447462 1 0.0000 0.9842 1.000 0.000
#> GSM447463 1 0.0000 0.9842 1.000 0.000
#> GSM447467 2 0.9998 0.0616 0.492 0.508
#> GSM447469 2 0.0000 0.9641 0.000 1.000
#> GSM447473 1 0.0000 0.9842 1.000 0.000
#> GSM447404 1 0.0000 0.9842 1.000 0.000
#> GSM447406 2 0.0000 0.9641 0.000 1.000
#> GSM447407 2 0.0000 0.9641 0.000 1.000
#> GSM447409 1 0.0000 0.9842 1.000 0.000
#> GSM447412 2 0.0000 0.9641 0.000 1.000
#> GSM447426 2 0.0000 0.9641 0.000 1.000
#> GSM447433 1 0.0376 0.9815 0.996 0.004
#> GSM447439 2 0.0000 0.9641 0.000 1.000
#> GSM447441 2 0.0000 0.9641 0.000 1.000
#> GSM447443 1 0.0000 0.9842 1.000 0.000
#> GSM447445 1 0.0672 0.9785 0.992 0.008
#> GSM447446 1 0.2778 0.9452 0.952 0.048
#> GSM447453 1 0.0000 0.9842 1.000 0.000
#> GSM447455 2 0.0376 0.9621 0.004 0.996
#> GSM447456 2 0.3114 0.9227 0.056 0.944
#> GSM447459 2 0.0000 0.9641 0.000 1.000
#> GSM447466 1 0.0000 0.9842 1.000 0.000
#> GSM447470 2 0.3879 0.9043 0.076 0.924
#> GSM447474 1 0.0000 0.9842 1.000 0.000
#> GSM447475 2 0.1633 0.9495 0.024 0.976
#> GSM447398 2 0.0672 0.9599 0.008 0.992
#> GSM447399 2 0.0000 0.9641 0.000 1.000
#> GSM447408 2 0.0000 0.9641 0.000 1.000
#> GSM447410 2 0.0000 0.9641 0.000 1.000
#> GSM447414 2 0.0000 0.9641 0.000 1.000
#> GSM447417 2 0.0000 0.9641 0.000 1.000
#> GSM447419 1 0.0000 0.9842 1.000 0.000
#> GSM447420 1 0.0000 0.9842 1.000 0.000
#> GSM447421 1 0.0000 0.9842 1.000 0.000
#> GSM447423 2 0.0000 0.9641 0.000 1.000
#> GSM447436 1 0.2778 0.9452 0.952 0.048
#> GSM447437 1 0.0000 0.9842 1.000 0.000
#> GSM447438 2 0.5737 0.8321 0.136 0.864
#> GSM447447 1 0.2603 0.9488 0.956 0.044
#> GSM447454 2 0.0000 0.9641 0.000 1.000
#> GSM447457 2 0.0000 0.9641 0.000 1.000
#> GSM447460 2 0.0000 0.9641 0.000 1.000
#> GSM447465 2 0.0000 0.9641 0.000 1.000
#> GSM447471 1 0.0000 0.9842 1.000 0.000
#> GSM447476 2 0.2603 0.9324 0.044 0.956
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM447401 3 0.5397 0.378 0.000 0.280 0.720
#> GSM447411 1 0.0592 0.958 0.988 0.012 0.000
#> GSM447413 3 0.0237 0.643 0.000 0.004 0.996
#> GSM447415 1 0.0424 0.959 0.992 0.008 0.000
#> GSM447416 3 0.0237 0.643 0.000 0.004 0.996
#> GSM447425 2 0.5291 0.350 0.000 0.732 0.268
#> GSM447430 2 0.6274 0.424 0.000 0.544 0.456
#> GSM447435 1 0.0237 0.960 0.996 0.004 0.000
#> GSM447440 1 0.0237 0.960 0.996 0.004 0.000
#> GSM447444 1 0.6291 0.700 0.768 0.152 0.080
#> GSM447448 1 0.3500 0.851 0.880 0.116 0.004
#> GSM447449 3 0.6274 -0.313 0.000 0.456 0.544
#> GSM447450 1 0.0237 0.960 0.996 0.004 0.000
#> GSM447452 2 0.5291 0.350 0.000 0.732 0.268
#> GSM447458 2 0.6252 0.482 0.000 0.556 0.444
#> GSM447461 2 0.5728 0.614 0.008 0.720 0.272
#> GSM447464 1 0.0592 0.960 0.988 0.012 0.000
#> GSM447468 1 0.0592 0.960 0.988 0.012 0.000
#> GSM447472 1 0.0592 0.960 0.988 0.012 0.000
#> GSM447400 1 0.0592 0.960 0.988 0.012 0.000
#> GSM447402 2 0.6309 0.416 0.000 0.504 0.496
#> GSM447403 1 0.0424 0.959 0.992 0.008 0.000
#> GSM447405 2 0.8277 0.120 0.456 0.468 0.076
#> GSM447418 3 0.0000 0.643 0.000 0.000 1.000
#> GSM447422 3 0.6244 -0.283 0.000 0.440 0.560
#> GSM447424 3 0.0000 0.643 0.000 0.000 1.000
#> GSM447427 3 0.0000 0.643 0.000 0.000 1.000
#> GSM447428 1 0.0592 0.960 0.988 0.012 0.000
#> GSM447429 1 0.0592 0.960 0.988 0.012 0.000
#> GSM447431 3 0.0747 0.635 0.000 0.016 0.984
#> GSM447432 3 0.6291 -0.342 0.000 0.468 0.532
#> GSM447434 2 0.9606 0.379 0.204 0.428 0.368
#> GSM447442 3 0.6244 -0.283 0.000 0.440 0.560
#> GSM447451 2 0.5728 0.614 0.008 0.720 0.272
#> GSM447462 1 0.0592 0.960 0.988 0.012 0.000
#> GSM447463 1 0.0592 0.958 0.988 0.012 0.000
#> GSM447467 1 0.8859 -0.113 0.480 0.400 0.120
#> GSM447469 3 0.6302 -0.425 0.000 0.480 0.520
#> GSM447473 1 0.0424 0.959 0.992 0.008 0.000
#> GSM447404 1 0.0424 0.959 0.992 0.008 0.000
#> GSM447406 2 0.6274 0.424 0.000 0.544 0.456
#> GSM447407 2 0.5529 0.363 0.000 0.704 0.296
#> GSM447409 1 0.0424 0.959 0.992 0.008 0.000
#> GSM447412 3 0.0424 0.641 0.000 0.008 0.992
#> GSM447426 3 0.5397 0.378 0.000 0.280 0.720
#> GSM447433 1 0.0592 0.960 0.988 0.012 0.000
#> GSM447439 2 0.6274 0.424 0.000 0.544 0.456
#> GSM447441 3 0.1031 0.634 0.000 0.024 0.976
#> GSM447443 1 0.0592 0.960 0.988 0.012 0.000
#> GSM447445 1 0.0747 0.957 0.984 0.016 0.000
#> GSM447446 1 0.2066 0.929 0.940 0.060 0.000
#> GSM447453 1 0.0000 0.960 1.000 0.000 0.000
#> GSM447455 3 0.6291 -0.337 0.000 0.468 0.532
#> GSM447456 2 0.6443 0.602 0.040 0.720 0.240
#> GSM447459 2 0.6274 0.424 0.000 0.544 0.456
#> GSM447466 1 0.0592 0.958 0.988 0.012 0.000
#> GSM447470 2 0.6887 0.590 0.060 0.704 0.236
#> GSM447474 1 0.0592 0.960 0.988 0.012 0.000
#> GSM447475 2 0.5728 0.614 0.008 0.720 0.272
#> GSM447398 2 0.5465 0.611 0.000 0.712 0.288
#> GSM447399 3 0.6192 -0.259 0.000 0.420 0.580
#> GSM447408 2 0.5835 0.598 0.000 0.660 0.340
#> GSM447410 2 0.5835 0.598 0.000 0.660 0.340
#> GSM447414 3 0.2066 0.591 0.000 0.060 0.940
#> GSM447417 2 0.6309 0.416 0.000 0.504 0.496
#> GSM447419 1 0.0592 0.960 0.988 0.012 0.000
#> GSM447420 1 0.0592 0.960 0.988 0.012 0.000
#> GSM447421 1 0.0592 0.960 0.988 0.012 0.000
#> GSM447423 3 0.0237 0.643 0.000 0.004 0.996
#> GSM447436 1 0.2066 0.929 0.940 0.060 0.000
#> GSM447437 1 0.0592 0.958 0.988 0.012 0.000
#> GSM447438 2 0.8492 0.518 0.132 0.592 0.276
#> GSM447447 1 0.1964 0.932 0.944 0.056 0.000
#> GSM447454 3 0.1289 0.624 0.000 0.032 0.968
#> GSM447457 3 0.0237 0.643 0.000 0.004 0.996
#> GSM447460 3 0.6062 -0.163 0.000 0.384 0.616
#> GSM447465 3 0.0000 0.643 0.000 0.000 1.000
#> GSM447471 1 0.0424 0.959 0.992 0.008 0.000
#> GSM447476 2 0.7238 0.604 0.044 0.628 0.328
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM447401 3 0.3486 0.37099 0.000 0.188 0.812 0.000
#> GSM447411 1 0.1211 0.92558 0.960 0.040 0.000 0.000
#> GSM447413 3 0.4356 0.88044 0.000 0.000 0.708 0.292
#> GSM447415 1 0.1118 0.92600 0.964 0.036 0.000 0.000
#> GSM447416 3 0.4382 0.88146 0.000 0.000 0.704 0.296
#> GSM447425 4 0.7503 0.16475 0.000 0.212 0.300 0.488
#> GSM447430 4 0.5596 0.14958 0.000 0.332 0.036 0.632
#> GSM447435 1 0.0188 0.93092 0.996 0.004 0.000 0.000
#> GSM447440 1 0.0188 0.93092 0.996 0.004 0.000 0.000
#> GSM447444 1 0.5187 0.70157 0.768 0.124 0.004 0.104
#> GSM447448 1 0.3080 0.85391 0.880 0.096 0.000 0.024
#> GSM447449 4 0.6273 0.05944 0.000 0.248 0.108 0.644
#> GSM447450 1 0.0188 0.93092 0.996 0.004 0.000 0.000
#> GSM447452 4 0.7503 0.16475 0.000 0.212 0.300 0.488
#> GSM447458 4 0.5112 -0.34739 0.000 0.384 0.008 0.608
#> GSM447461 2 0.5539 0.91804 0.008 0.552 0.008 0.432
#> GSM447464 1 0.1557 0.93095 0.944 0.056 0.000 0.000
#> GSM447468 1 0.1474 0.93049 0.948 0.052 0.000 0.000
#> GSM447472 1 0.1474 0.93049 0.948 0.052 0.000 0.000
#> GSM447400 1 0.1557 0.93095 0.944 0.056 0.000 0.000
#> GSM447402 4 0.0779 0.27264 0.000 0.016 0.004 0.980
#> GSM447403 1 0.1389 0.92270 0.952 0.048 0.000 0.000
#> GSM447405 4 0.7605 0.00881 0.384 0.200 0.000 0.416
#> GSM447418 3 0.4356 0.88129 0.000 0.000 0.708 0.292
#> GSM447422 4 0.6469 0.09118 0.000 0.248 0.124 0.628
#> GSM447424 3 0.4356 0.88151 0.000 0.000 0.708 0.292
#> GSM447427 3 0.4382 0.88119 0.000 0.000 0.704 0.296
#> GSM447428 1 0.1474 0.93049 0.948 0.052 0.000 0.000
#> GSM447429 1 0.2011 0.92774 0.920 0.080 0.000 0.000
#> GSM447431 3 0.5062 0.86911 0.000 0.020 0.680 0.300
#> GSM447432 4 0.6383 -0.03002 0.000 0.292 0.096 0.612
#> GSM447434 4 0.9272 -0.25307 0.204 0.264 0.112 0.420
#> GSM447442 4 0.6469 0.09118 0.000 0.248 0.124 0.628
#> GSM447451 2 0.5421 0.91398 0.008 0.548 0.004 0.440
#> GSM447462 1 0.1557 0.93095 0.944 0.056 0.000 0.000
#> GSM447463 1 0.1474 0.92192 0.948 0.052 0.000 0.000
#> GSM447467 1 0.7836 -0.08434 0.480 0.316 0.012 0.192
#> GSM447469 4 0.2589 0.27202 0.000 0.044 0.044 0.912
#> GSM447473 1 0.1389 0.92270 0.952 0.048 0.000 0.000
#> GSM447404 1 0.1389 0.92270 0.952 0.048 0.000 0.000
#> GSM447406 4 0.5666 0.14042 0.000 0.348 0.036 0.616
#> GSM447407 4 0.6286 0.25147 0.000 0.200 0.140 0.660
#> GSM447409 1 0.1867 0.91697 0.928 0.072 0.000 0.000
#> GSM447412 3 0.4431 0.87980 0.000 0.000 0.696 0.304
#> GSM447426 3 0.3486 0.37099 0.000 0.188 0.812 0.000
#> GSM447433 1 0.1661 0.92372 0.944 0.052 0.000 0.004
#> GSM447439 4 0.5666 0.14042 0.000 0.348 0.036 0.616
#> GSM447441 3 0.5184 0.86266 0.000 0.024 0.672 0.304
#> GSM447443 1 0.1474 0.93049 0.948 0.052 0.000 0.000
#> GSM447445 1 0.0657 0.93033 0.984 0.012 0.000 0.004
#> GSM447446 1 0.3032 0.88791 0.868 0.124 0.000 0.008
#> GSM447453 1 0.0000 0.93110 1.000 0.000 0.000 0.000
#> GSM447455 4 0.6501 -0.04974 0.000 0.316 0.096 0.588
#> GSM447456 2 0.6086 0.87029 0.040 0.556 0.004 0.400
#> GSM447459 4 0.5596 0.14958 0.000 0.332 0.036 0.632
#> GSM447466 1 0.1118 0.92674 0.964 0.036 0.000 0.000
#> GSM447470 2 0.6423 0.83205 0.060 0.540 0.004 0.396
#> GSM447474 1 0.1474 0.93049 0.948 0.052 0.000 0.000
#> GSM447475 2 0.5539 0.91804 0.008 0.552 0.008 0.432
#> GSM447398 2 0.5137 0.86427 0.000 0.544 0.004 0.452
#> GSM447399 4 0.6630 0.04802 0.000 0.252 0.136 0.612
#> GSM447408 4 0.3764 -0.06494 0.000 0.216 0.000 0.784
#> GSM447410 4 0.3764 -0.06494 0.000 0.216 0.000 0.784
#> GSM447414 3 0.5764 0.80888 0.000 0.052 0.644 0.304
#> GSM447417 4 0.0779 0.27264 0.000 0.016 0.004 0.980
#> GSM447419 1 0.1474 0.93049 0.948 0.052 0.000 0.000
#> GSM447420 1 0.1474 0.93049 0.948 0.052 0.000 0.000
#> GSM447421 1 0.1557 0.93095 0.944 0.056 0.000 0.000
#> GSM447423 3 0.4406 0.88091 0.000 0.000 0.700 0.300
#> GSM447436 1 0.3032 0.88791 0.868 0.124 0.000 0.008
#> GSM447437 1 0.1474 0.92192 0.948 0.052 0.000 0.000
#> GSM447438 4 0.5905 -0.02940 0.060 0.304 0.000 0.636
#> GSM447447 1 0.2976 0.89053 0.872 0.120 0.000 0.008
#> GSM447454 3 0.5069 0.84414 0.000 0.016 0.664 0.320
#> GSM447457 3 0.4406 0.88091 0.000 0.000 0.700 0.300
#> GSM447460 4 0.7415 0.15967 0.000 0.216 0.272 0.512
#> GSM447465 3 0.4356 0.88151 0.000 0.000 0.708 0.292
#> GSM447471 1 0.1389 0.92270 0.952 0.048 0.000 0.000
#> GSM447476 4 0.4711 -0.05188 0.024 0.236 0.000 0.740
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM447401 5 0.6500 1.00000 0.000 0.028 0.304 0.120 0.548
#> GSM447411 1 0.3838 0.80516 0.716 0.004 0.000 0.000 0.280
#> GSM447413 3 0.0693 0.90341 0.000 0.000 0.980 0.008 0.012
#> GSM447415 1 0.2891 0.82995 0.824 0.000 0.000 0.000 0.176
#> GSM447416 3 0.0290 0.90964 0.000 0.000 0.992 0.000 0.008
#> GSM447425 4 0.5234 0.01507 0.000 0.044 0.000 0.496 0.460
#> GSM447430 4 0.5470 0.42605 0.000 0.268 0.104 0.628 0.000
#> GSM447435 1 0.3333 0.82523 0.788 0.004 0.000 0.000 0.208
#> GSM447440 1 0.3333 0.82523 0.788 0.004 0.000 0.000 0.208
#> GSM447444 1 0.5099 0.62859 0.696 0.232 0.004 0.008 0.060
#> GSM447448 1 0.4314 0.77549 0.780 0.124 0.000 0.004 0.092
#> GSM447449 2 0.6049 0.45857 0.000 0.580 0.320 0.068 0.032
#> GSM447450 1 0.3333 0.82523 0.788 0.004 0.000 0.000 0.208
#> GSM447452 4 0.5234 0.01507 0.000 0.044 0.000 0.496 0.460
#> GSM447458 2 0.3519 0.50499 0.000 0.776 0.216 0.008 0.000
#> GSM447461 2 0.1124 0.53544 0.004 0.960 0.036 0.000 0.000
#> GSM447464 1 0.1243 0.83343 0.960 0.008 0.000 0.004 0.028
#> GSM447468 1 0.1074 0.83222 0.968 0.012 0.000 0.004 0.016
#> GSM447472 1 0.0968 0.82507 0.972 0.012 0.000 0.012 0.004
#> GSM447400 1 0.1243 0.83343 0.960 0.008 0.000 0.004 0.028
#> GSM447402 4 0.8128 0.09253 0.000 0.284 0.220 0.380 0.116
#> GSM447403 1 0.3774 0.79911 0.704 0.000 0.000 0.000 0.296
#> GSM447405 1 0.8302 -0.15644 0.372 0.220 0.000 0.256 0.152
#> GSM447418 3 0.0324 0.90775 0.000 0.000 0.992 0.004 0.004
#> GSM447422 2 0.6168 0.44086 0.000 0.556 0.340 0.072 0.032
#> GSM447424 3 0.0451 0.90754 0.000 0.000 0.988 0.004 0.008
#> GSM447427 3 0.0000 0.90935 0.000 0.000 1.000 0.000 0.000
#> GSM447428 1 0.0854 0.82618 0.976 0.012 0.000 0.008 0.004
#> GSM447429 1 0.2230 0.82932 0.884 0.000 0.000 0.000 0.116
#> GSM447431 3 0.0932 0.89575 0.000 0.004 0.972 0.020 0.004
#> GSM447432 2 0.5272 0.47728 0.000 0.624 0.312 0.060 0.004
#> GSM447434 2 0.7347 0.36911 0.180 0.580 0.152 0.056 0.032
#> GSM447442 2 0.6168 0.44086 0.000 0.556 0.340 0.072 0.032
#> GSM447451 2 0.1202 0.53553 0.004 0.960 0.032 0.004 0.000
#> GSM447462 1 0.1243 0.83343 0.960 0.008 0.000 0.004 0.028
#> GSM447463 1 0.3949 0.79721 0.696 0.004 0.000 0.000 0.300
#> GSM447467 2 0.6792 0.05120 0.412 0.468 0.016 0.044 0.060
#> GSM447469 4 0.8073 0.01399 0.000 0.308 0.260 0.340 0.092
#> GSM447473 1 0.3774 0.79911 0.704 0.000 0.000 0.000 0.296
#> GSM447404 1 0.3774 0.79911 0.704 0.000 0.000 0.000 0.296
#> GSM447406 4 0.5512 0.41973 0.000 0.276 0.104 0.620 0.000
#> GSM447407 4 0.6324 0.21168 0.000 0.016 0.104 0.492 0.388
#> GSM447409 1 0.4522 0.78337 0.660 0.000 0.000 0.024 0.316
#> GSM447412 3 0.0451 0.90840 0.000 0.008 0.988 0.000 0.004
#> GSM447426 5 0.6500 1.00000 0.000 0.028 0.304 0.120 0.548
#> GSM447433 1 0.4615 0.80775 0.736 0.020 0.000 0.032 0.212
#> GSM447439 4 0.5512 0.41973 0.000 0.276 0.104 0.620 0.000
#> GSM447441 3 0.1173 0.89236 0.000 0.012 0.964 0.020 0.004
#> GSM447443 1 0.0727 0.82949 0.980 0.012 0.000 0.004 0.004
#> GSM447445 1 0.3513 0.83229 0.800 0.020 0.000 0.000 0.180
#> GSM447446 1 0.3385 0.76666 0.864 0.056 0.000 0.044 0.036
#> GSM447453 1 0.2286 0.83857 0.888 0.004 0.000 0.000 0.108
#> GSM447455 2 0.5152 0.47154 0.000 0.632 0.312 0.052 0.004
#> GSM447456 2 0.1041 0.50584 0.032 0.964 0.000 0.004 0.000
#> GSM447459 4 0.5470 0.42605 0.000 0.268 0.104 0.628 0.000
#> GSM447466 1 0.3814 0.80694 0.720 0.004 0.000 0.000 0.276
#> GSM447470 2 0.1270 0.50103 0.052 0.948 0.000 0.000 0.000
#> GSM447474 1 0.0727 0.82949 0.980 0.012 0.000 0.004 0.004
#> GSM447475 2 0.1124 0.53544 0.004 0.960 0.036 0.000 0.000
#> GSM447398 2 0.1357 0.53494 0.000 0.948 0.048 0.004 0.000
#> GSM447399 2 0.5869 0.40107 0.000 0.564 0.356 0.052 0.028
#> GSM447408 2 0.7063 0.25550 0.000 0.536 0.084 0.272 0.108
#> GSM447410 2 0.7063 0.25550 0.000 0.536 0.084 0.272 0.108
#> GSM447414 3 0.1571 0.84473 0.000 0.060 0.936 0.004 0.000
#> GSM447417 4 0.8128 0.09253 0.000 0.284 0.220 0.380 0.116
#> GSM447419 1 0.0968 0.82507 0.972 0.012 0.000 0.012 0.004
#> GSM447420 1 0.0727 0.82949 0.980 0.012 0.000 0.004 0.004
#> GSM447421 1 0.1243 0.83343 0.960 0.008 0.000 0.004 0.028
#> GSM447423 3 0.0290 0.90826 0.000 0.008 0.992 0.000 0.000
#> GSM447436 1 0.3385 0.76666 0.864 0.056 0.000 0.044 0.036
#> GSM447437 1 0.3949 0.79721 0.696 0.004 0.000 0.000 0.300
#> GSM447438 2 0.8542 0.18525 0.076 0.452 0.076 0.256 0.140
#> GSM447447 1 0.3305 0.76974 0.868 0.056 0.000 0.044 0.032
#> GSM447454 3 0.1197 0.86899 0.000 0.048 0.952 0.000 0.000
#> GSM447457 3 0.0290 0.90826 0.000 0.008 0.992 0.000 0.000
#> GSM447460 3 0.6076 -0.00809 0.000 0.344 0.560 0.064 0.032
#> GSM447465 3 0.0451 0.90754 0.000 0.000 0.988 0.004 0.008
#> GSM447471 1 0.3774 0.79911 0.704 0.000 0.000 0.000 0.296
#> GSM447476 2 0.7507 0.24784 0.012 0.516 0.080 0.268 0.124
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM447401 5 0.0937 0.5391 0.000 0.000 0.040 0.000 0.960 0.000
#> GSM447411 1 0.0858 0.7059 0.968 0.004 0.000 0.000 0.000 0.028
#> GSM447413 3 0.0653 0.9241 0.000 0.000 0.980 0.004 0.012 0.004
#> GSM447415 1 0.3309 0.2539 0.720 0.000 0.000 0.000 0.000 0.280
#> GSM447416 3 0.0291 0.9276 0.000 0.000 0.992 0.000 0.004 0.004
#> GSM447425 5 0.6302 0.4579 0.000 0.040 0.000 0.256 0.520 0.184
#> GSM447430 4 0.2149 0.7868 0.000 0.104 0.004 0.888 0.000 0.004
#> GSM447435 1 0.2191 0.6594 0.876 0.004 0.000 0.000 0.000 0.120
#> GSM447440 1 0.2191 0.6594 0.876 0.004 0.000 0.000 0.000 0.120
#> GSM447444 6 0.5768 0.3213 0.316 0.196 0.000 0.000 0.000 0.488
#> GSM447448 1 0.5422 -0.2924 0.448 0.116 0.000 0.000 0.000 0.436
#> GSM447449 2 0.5589 0.5706 0.000 0.620 0.240 0.028 0.004 0.108
#> GSM447450 1 0.2191 0.6594 0.876 0.004 0.000 0.000 0.000 0.120
#> GSM447452 5 0.6302 0.4579 0.000 0.040 0.000 0.256 0.520 0.184
#> GSM447458 2 0.4551 0.5739 0.000 0.748 0.136 0.044 0.000 0.072
#> GSM447461 2 0.1442 0.5377 0.000 0.944 0.004 0.040 0.000 0.012
#> GSM447464 6 0.3867 0.6950 0.488 0.000 0.000 0.000 0.000 0.512
#> GSM447468 6 0.3854 0.7210 0.464 0.000 0.000 0.000 0.000 0.536
#> GSM447472 6 0.3823 0.7280 0.436 0.000 0.000 0.000 0.000 0.564
#> GSM447400 6 0.3867 0.6950 0.488 0.000 0.000 0.000 0.000 0.512
#> GSM447402 2 0.8163 0.2869 0.000 0.296 0.136 0.248 0.040 0.280
#> GSM447403 1 0.1204 0.7103 0.944 0.000 0.000 0.000 0.000 0.056
#> GSM447405 6 0.6439 -0.1866 0.072 0.212 0.000 0.096 0.028 0.592
#> GSM447418 3 0.0260 0.9270 0.000 0.000 0.992 0.000 0.008 0.000
#> GSM447422 2 0.5763 0.5602 0.000 0.592 0.260 0.028 0.004 0.116
#> GSM447424 3 0.0405 0.9266 0.000 0.000 0.988 0.004 0.008 0.000
#> GSM447427 3 0.0000 0.9270 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM447428 6 0.3828 0.7282 0.440 0.000 0.000 0.000 0.000 0.560
#> GSM447429 1 0.3659 -0.3110 0.636 0.000 0.000 0.000 0.000 0.364
#> GSM447431 3 0.0777 0.9187 0.000 0.000 0.972 0.024 0.000 0.004
#> GSM447432 2 0.5219 0.5743 0.000 0.656 0.232 0.024 0.004 0.084
#> GSM447434 2 0.6434 0.4599 0.024 0.528 0.112 0.036 0.000 0.300
#> GSM447442 2 0.5763 0.5602 0.000 0.592 0.260 0.028 0.004 0.116
#> GSM447451 2 0.1225 0.5398 0.000 0.952 0.000 0.036 0.000 0.012
#> GSM447462 6 0.3867 0.6950 0.488 0.000 0.000 0.000 0.000 0.512
#> GSM447463 1 0.0405 0.7138 0.988 0.004 0.000 0.000 0.000 0.008
#> GSM447467 2 0.6214 0.0262 0.244 0.472 0.008 0.004 0.000 0.272
#> GSM447469 2 0.8047 0.3248 0.000 0.300 0.196 0.212 0.020 0.272
#> GSM447473 1 0.1204 0.7103 0.944 0.000 0.000 0.000 0.000 0.056
#> GSM447404 1 0.1204 0.7103 0.944 0.000 0.000 0.000 0.000 0.056
#> GSM447406 4 0.2053 0.7854 0.000 0.108 0.004 0.888 0.000 0.000
#> GSM447407 4 0.6633 -0.3889 0.000 0.040 0.004 0.444 0.328 0.184
#> GSM447409 1 0.2048 0.6625 0.880 0.000 0.000 0.000 0.000 0.120
#> GSM447412 3 0.0508 0.9257 0.000 0.012 0.984 0.000 0.000 0.004
#> GSM447426 5 0.0937 0.5391 0.000 0.000 0.040 0.000 0.960 0.000
#> GSM447433 1 0.3575 0.5050 0.708 0.008 0.000 0.000 0.000 0.284
#> GSM447439 4 0.2053 0.7854 0.000 0.108 0.004 0.888 0.000 0.000
#> GSM447441 3 0.1036 0.9172 0.000 0.008 0.964 0.024 0.000 0.004
#> GSM447443 6 0.3843 0.7285 0.452 0.000 0.000 0.000 0.000 0.548
#> GSM447445 1 0.3606 0.4910 0.728 0.016 0.000 0.000 0.000 0.256
#> GSM447446 6 0.3905 0.5426 0.316 0.016 0.000 0.000 0.000 0.668
#> GSM447453 1 0.3804 -0.2059 0.576 0.000 0.000 0.000 0.000 0.424
#> GSM447455 2 0.5097 0.5622 0.000 0.648 0.248 0.020 0.000 0.084
#> GSM447456 2 0.2070 0.5154 0.000 0.908 0.000 0.048 0.000 0.044
#> GSM447459 4 0.2149 0.7868 0.000 0.104 0.004 0.888 0.000 0.004
#> GSM447466 1 0.0858 0.7079 0.968 0.004 0.000 0.000 0.000 0.028
#> GSM447470 2 0.2380 0.5161 0.016 0.900 0.000 0.036 0.000 0.048
#> GSM447474 6 0.3843 0.7285 0.452 0.000 0.000 0.000 0.000 0.548
#> GSM447475 2 0.1442 0.5377 0.000 0.944 0.004 0.040 0.000 0.012
#> GSM447398 2 0.1152 0.5398 0.000 0.952 0.004 0.044 0.000 0.000
#> GSM447399 2 0.6060 0.5077 0.000 0.524 0.316 0.040 0.000 0.120
#> GSM447408 2 0.6039 0.4255 0.000 0.560 0.004 0.152 0.028 0.256
#> GSM447410 2 0.6039 0.4255 0.000 0.560 0.004 0.152 0.028 0.256
#> GSM447414 3 0.1411 0.8847 0.000 0.060 0.936 0.004 0.000 0.000
#> GSM447417 2 0.8163 0.2869 0.000 0.296 0.136 0.248 0.040 0.280
#> GSM447419 6 0.3823 0.7280 0.436 0.000 0.000 0.000 0.000 0.564
#> GSM447420 6 0.3843 0.7285 0.452 0.000 0.000 0.000 0.000 0.548
#> GSM447421 6 0.3867 0.6950 0.488 0.000 0.000 0.000 0.000 0.512
#> GSM447423 3 0.0790 0.9158 0.000 0.032 0.968 0.000 0.000 0.000
#> GSM447436 6 0.3905 0.5426 0.316 0.016 0.000 0.000 0.000 0.668
#> GSM447437 1 0.0405 0.7138 0.988 0.004 0.000 0.000 0.000 0.008
#> GSM447438 2 0.5996 0.3090 0.000 0.468 0.004 0.100 0.028 0.400
#> GSM447447 6 0.3905 0.5501 0.316 0.016 0.000 0.000 0.000 0.668
#> GSM447454 3 0.1501 0.8789 0.000 0.076 0.924 0.000 0.000 0.000
#> GSM447457 3 0.0790 0.9158 0.000 0.032 0.968 0.000 0.000 0.000
#> GSM447460 3 0.5156 0.0971 0.000 0.376 0.560 0.024 0.004 0.036
#> GSM447465 3 0.0405 0.9266 0.000 0.000 0.988 0.004 0.008 0.000
#> GSM447471 1 0.1204 0.7103 0.944 0.000 0.000 0.000 0.000 0.056
#> GSM447476 2 0.5896 0.4099 0.000 0.548 0.000 0.132 0.028 0.292
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 gender(p) agent(p) k
#> MAD:hclust 77 0.767 0.411 2
#> MAD:hclust 56 0.212 0.222 3
#> MAD:hclust 52 0.705 0.194 4
#> MAD:hclust 55 0.972 0.135 5
#> MAD:hclust 59 0.928 0.115 6
If matrix rows can be associated to genes, consider to use functional_enrichment(res,
...)
to perform function enrichment for the signature genes. See this vignette for more detailed explanations.
The object with results only for a single top-value method and a single partition method can be extracted as:
res = res_list["MAD", "kmeans"]
# you can also extract it by
# res = res_list["MAD:kmeans"]
A summary of res
and all the functions that can be applied to it:
res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#> On a matrix with 51941 rows and 79 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'MAD' method.
#> Subgroups are detected by 'kmeans' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 2.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
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.973 0.957 0.980 0.5046 0.494 0.494
#> 3 3 0.609 0.648 0.765 0.2753 0.796 0.606
#> 4 4 0.550 0.568 0.680 0.1221 0.881 0.687
#> 5 5 0.556 0.478 0.693 0.0758 0.842 0.531
#> 6 6 0.603 0.510 0.688 0.0536 0.916 0.646
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
#> GSM447401 2 0.0672 0.981 0.008 0.992
#> GSM447411 1 0.0376 0.979 0.996 0.004
#> GSM447413 2 0.0672 0.981 0.008 0.992
#> GSM447415 1 0.0000 0.978 1.000 0.000
#> GSM447416 2 0.0672 0.981 0.008 0.992
#> GSM447425 2 0.0000 0.981 0.000 1.000
#> GSM447430 2 0.0000 0.981 0.000 1.000
#> GSM447435 1 0.0376 0.979 0.996 0.004
#> GSM447440 1 0.0376 0.979 0.996 0.004
#> GSM447444 1 0.0376 0.979 0.996 0.004
#> GSM447448 1 0.0376 0.979 0.996 0.004
#> GSM447449 2 0.0376 0.982 0.004 0.996
#> GSM447450 1 0.0376 0.979 0.996 0.004
#> GSM447452 2 0.0000 0.981 0.000 1.000
#> GSM447458 2 0.0376 0.982 0.004 0.996
#> GSM447461 2 0.0376 0.982 0.004 0.996
#> GSM447464 1 0.0376 0.979 0.996 0.004
#> GSM447468 1 0.0000 0.978 1.000 0.000
#> GSM447472 1 0.0376 0.979 0.996 0.004
#> GSM447400 1 0.0000 0.978 1.000 0.000
#> GSM447402 2 0.0000 0.981 0.000 1.000
#> GSM447403 1 0.0000 0.978 1.000 0.000
#> GSM447405 1 0.0672 0.977 0.992 0.008
#> GSM447418 2 0.0672 0.981 0.008 0.992
#> GSM447422 2 0.0672 0.981 0.008 0.992
#> GSM447424 2 0.0672 0.981 0.008 0.992
#> GSM447427 2 0.0672 0.981 0.008 0.992
#> GSM447428 1 0.7453 0.735 0.788 0.212
#> GSM447429 1 0.0000 0.978 1.000 0.000
#> GSM447431 2 0.0672 0.981 0.008 0.992
#> GSM447432 2 0.0376 0.982 0.004 0.996
#> GSM447434 1 0.0000 0.978 1.000 0.000
#> GSM447442 2 0.0376 0.982 0.004 0.996
#> GSM447451 2 0.0376 0.982 0.004 0.996
#> GSM447462 1 0.0000 0.978 1.000 0.000
#> GSM447463 1 0.0376 0.979 0.996 0.004
#> GSM447467 1 0.7528 0.734 0.784 0.216
#> GSM447469 2 0.0000 0.981 0.000 1.000
#> GSM447473 1 0.0000 0.978 1.000 0.000
#> GSM447404 1 0.0000 0.978 1.000 0.000
#> GSM447406 2 0.0000 0.981 0.000 1.000
#> GSM447407 2 0.0000 0.981 0.000 1.000
#> GSM447409 1 0.0672 0.977 0.992 0.008
#> GSM447412 2 0.0672 0.981 0.008 0.992
#> GSM447426 2 0.0672 0.981 0.008 0.992
#> GSM447433 1 0.0672 0.977 0.992 0.008
#> GSM447439 2 0.0000 0.981 0.000 1.000
#> GSM447441 2 0.0376 0.982 0.004 0.996
#> GSM447443 1 0.0000 0.978 1.000 0.000
#> GSM447445 1 0.0376 0.979 0.996 0.004
#> GSM447446 1 0.0672 0.977 0.992 0.008
#> GSM447453 1 0.0376 0.979 0.996 0.004
#> GSM447455 2 0.0376 0.982 0.004 0.996
#> GSM447456 1 0.8207 0.667 0.744 0.256
#> GSM447459 2 0.0000 0.981 0.000 1.000
#> GSM447466 1 0.0376 0.979 0.996 0.004
#> GSM447470 1 0.0376 0.979 0.996 0.004
#> GSM447474 1 0.0376 0.979 0.996 0.004
#> GSM447475 2 0.6247 0.807 0.156 0.844
#> GSM447398 2 0.0376 0.982 0.004 0.996
#> GSM447399 2 0.0376 0.980 0.004 0.996
#> GSM447408 2 0.0000 0.981 0.000 1.000
#> GSM447410 2 0.0000 0.981 0.000 1.000
#> GSM447414 2 0.0672 0.981 0.008 0.992
#> GSM447417 2 0.0000 0.981 0.000 1.000
#> GSM447419 1 0.0000 0.978 1.000 0.000
#> GSM447420 1 0.0000 0.978 1.000 0.000
#> GSM447421 1 0.0000 0.978 1.000 0.000
#> GSM447423 2 0.0672 0.981 0.008 0.992
#> GSM447436 1 0.0672 0.977 0.992 0.008
#> GSM447437 1 0.0376 0.979 0.996 0.004
#> GSM447438 2 0.0000 0.981 0.000 1.000
#> GSM447447 1 0.0376 0.979 0.996 0.004
#> GSM447454 2 0.0376 0.982 0.004 0.996
#> GSM447457 2 0.0376 0.982 0.004 0.996
#> GSM447460 2 0.0376 0.982 0.004 0.996
#> GSM447465 2 0.0376 0.982 0.004 0.996
#> GSM447471 1 0.0000 0.978 1.000 0.000
#> GSM447476 2 0.9922 0.149 0.448 0.552
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM447401 3 0.6026 0.5588 0.000 0.376 0.624
#> GSM447411 1 0.0237 0.9383 0.996 0.000 0.004
#> GSM447413 3 0.6026 0.5870 0.000 0.376 0.624
#> GSM447415 1 0.1643 0.9333 0.956 0.000 0.044
#> GSM447416 3 0.5591 0.6172 0.000 0.304 0.696
#> GSM447425 2 0.1989 0.6080 0.004 0.948 0.048
#> GSM447430 2 0.1031 0.6247 0.000 0.976 0.024
#> GSM447435 1 0.0237 0.9383 0.996 0.000 0.004
#> GSM447440 1 0.1753 0.9383 0.952 0.000 0.048
#> GSM447444 1 0.4002 0.8958 0.840 0.000 0.160
#> GSM447448 1 0.3412 0.9112 0.876 0.000 0.124
#> GSM447449 2 0.6225 0.2220 0.000 0.568 0.432
#> GSM447450 1 0.0424 0.9390 0.992 0.000 0.008
#> GSM447452 2 0.1529 0.6118 0.000 0.960 0.040
#> GSM447458 2 0.6608 0.3408 0.008 0.560 0.432
#> GSM447461 3 0.6291 -0.2445 0.000 0.468 0.532
#> GSM447464 1 0.1529 0.9382 0.960 0.000 0.040
#> GSM447468 1 0.1860 0.9326 0.948 0.000 0.052
#> GSM447472 1 0.3686 0.9060 0.860 0.000 0.140
#> GSM447400 1 0.3038 0.9310 0.896 0.000 0.104
#> GSM447402 2 0.4121 0.6224 0.000 0.832 0.168
#> GSM447403 1 0.1411 0.9350 0.964 0.000 0.036
#> GSM447405 1 0.3983 0.9021 0.852 0.004 0.144
#> GSM447418 3 0.5327 0.6189 0.000 0.272 0.728
#> GSM447422 3 0.4887 0.6112 0.000 0.228 0.772
#> GSM447424 3 0.5968 0.5954 0.000 0.364 0.636
#> GSM447427 3 0.4887 0.6112 0.000 0.228 0.772
#> GSM447428 3 0.5461 0.3036 0.244 0.008 0.748
#> GSM447429 1 0.2356 0.9345 0.928 0.000 0.072
#> GSM447431 3 0.5431 0.6209 0.000 0.284 0.716
#> GSM447432 2 0.6252 0.2393 0.000 0.556 0.444
#> GSM447434 1 0.4178 0.9018 0.828 0.000 0.172
#> GSM447442 2 0.6244 0.2400 0.000 0.560 0.440
#> GSM447451 3 0.6168 -0.1872 0.000 0.412 0.588
#> GSM447462 1 0.3192 0.9290 0.888 0.000 0.112
#> GSM447463 1 0.0237 0.9383 0.996 0.000 0.004
#> GSM447467 3 0.9021 -0.0558 0.184 0.264 0.552
#> GSM447469 2 0.1753 0.6300 0.000 0.952 0.048
#> GSM447473 1 0.1411 0.9350 0.964 0.000 0.036
#> GSM447404 1 0.1529 0.9340 0.960 0.000 0.040
#> GSM447406 2 0.1031 0.6247 0.000 0.976 0.024
#> GSM447407 2 0.1411 0.6145 0.000 0.964 0.036
#> GSM447409 1 0.0424 0.9380 0.992 0.000 0.008
#> GSM447412 3 0.4796 0.6091 0.000 0.220 0.780
#> GSM447426 3 0.6026 0.5588 0.000 0.376 0.624
#> GSM447433 1 0.3500 0.9125 0.880 0.004 0.116
#> GSM447439 2 0.1031 0.6247 0.000 0.976 0.024
#> GSM447441 2 0.6260 0.2174 0.000 0.552 0.448
#> GSM447443 1 0.2448 0.9347 0.924 0.000 0.076
#> GSM447445 1 0.0592 0.9382 0.988 0.000 0.012
#> GSM447446 1 0.3349 0.9177 0.888 0.004 0.108
#> GSM447453 1 0.0747 0.9385 0.984 0.000 0.016
#> GSM447455 2 0.6244 0.2400 0.000 0.560 0.440
#> GSM447456 2 0.9048 0.2484 0.288 0.540 0.172
#> GSM447459 2 0.1031 0.6247 0.000 0.976 0.024
#> GSM447466 1 0.0237 0.9383 0.996 0.000 0.004
#> GSM447470 1 0.4002 0.8958 0.840 0.000 0.160
#> GSM447474 1 0.4062 0.8952 0.836 0.000 0.164
#> GSM447475 3 0.6769 -0.1911 0.016 0.392 0.592
#> GSM447398 2 0.5754 0.5578 0.004 0.700 0.296
#> GSM447399 2 0.5254 0.4603 0.000 0.736 0.264
#> GSM447408 2 0.4002 0.6220 0.000 0.840 0.160
#> GSM447410 2 0.4555 0.6138 0.000 0.800 0.200
#> GSM447414 3 0.5988 0.5929 0.000 0.368 0.632
#> GSM447417 2 0.3412 0.6334 0.000 0.876 0.124
#> GSM447419 1 0.4346 0.9017 0.816 0.000 0.184
#> GSM447420 3 0.6204 -0.1954 0.424 0.000 0.576
#> GSM447421 1 0.2356 0.9345 0.928 0.000 0.072
#> GSM447423 3 0.4796 0.6091 0.000 0.220 0.780
#> GSM447436 1 0.2200 0.9364 0.940 0.004 0.056
#> GSM447437 1 0.0237 0.9383 0.996 0.000 0.004
#> GSM447438 2 0.5397 0.5620 0.000 0.720 0.280
#> GSM447447 1 0.3482 0.9098 0.872 0.000 0.128
#> GSM447454 3 0.5397 0.5490 0.000 0.280 0.720
#> GSM447457 3 0.5363 0.5478 0.000 0.276 0.724
#> GSM447460 2 0.5760 0.1788 0.000 0.672 0.328
#> GSM447465 3 0.5968 0.5954 0.000 0.364 0.636
#> GSM447471 1 0.1411 0.9350 0.964 0.000 0.036
#> GSM447476 2 0.7451 0.4677 0.060 0.636 0.304
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM447401 3 0.5432 0.4682 0.000 0.068 0.716 0.216
#> GSM447411 1 0.0000 0.8023 1.000 0.000 0.000 0.000
#> GSM447413 3 0.2868 0.5549 0.000 0.000 0.864 0.136
#> GSM447415 1 0.3545 0.7786 0.828 0.164 0.000 0.008
#> GSM447416 3 0.1398 0.5868 0.000 0.004 0.956 0.040
#> GSM447425 4 0.4094 0.7023 0.000 0.116 0.056 0.828
#> GSM447430 4 0.2329 0.7555 0.000 0.012 0.072 0.916
#> GSM447435 1 0.0000 0.8023 1.000 0.000 0.000 0.000
#> GSM447440 1 0.2342 0.8113 0.912 0.080 0.000 0.008
#> GSM447444 1 0.4679 0.7172 0.648 0.352 0.000 0.000
#> GSM447448 1 0.4482 0.7587 0.728 0.264 0.000 0.008
#> GSM447449 3 0.7429 -0.0518 0.000 0.308 0.496 0.196
#> GSM447450 1 0.1452 0.8097 0.956 0.036 0.000 0.008
#> GSM447452 4 0.3547 0.7105 0.000 0.072 0.064 0.864
#> GSM447458 2 0.8480 0.3413 0.028 0.404 0.324 0.244
#> GSM447461 2 0.7698 0.2696 0.000 0.420 0.356 0.224
#> GSM447464 1 0.3047 0.8135 0.872 0.116 0.000 0.012
#> GSM447468 1 0.4420 0.7750 0.748 0.240 0.000 0.012
#> GSM447472 1 0.4690 0.7754 0.712 0.276 0.000 0.012
#> GSM447400 1 0.5093 0.7675 0.640 0.348 0.000 0.012
#> GSM447402 4 0.6245 0.6207 0.000 0.164 0.168 0.668
#> GSM447403 1 0.3808 0.7794 0.812 0.176 0.000 0.012
#> GSM447405 1 0.5339 0.7083 0.624 0.356 0.000 0.020
#> GSM447418 3 0.0707 0.5873 0.000 0.000 0.980 0.020
#> GSM447422 3 0.0000 0.5834 0.000 0.000 1.000 0.000
#> GSM447424 3 0.2149 0.5757 0.000 0.000 0.912 0.088
#> GSM447427 3 0.0000 0.5834 0.000 0.000 1.000 0.000
#> GSM447428 3 0.6951 0.0377 0.132 0.324 0.544 0.000
#> GSM447429 1 0.4482 0.7778 0.728 0.264 0.000 0.008
#> GSM447431 3 0.2142 0.5853 0.000 0.016 0.928 0.056
#> GSM447432 3 0.7687 -0.2101 0.000 0.348 0.428 0.224
#> GSM447434 1 0.5236 0.7288 0.560 0.432 0.000 0.008
#> GSM447442 3 0.7530 -0.1002 0.000 0.308 0.480 0.212
#> GSM447451 2 0.7282 0.3731 0.000 0.512 0.316 0.172
#> GSM447462 1 0.5127 0.7650 0.632 0.356 0.000 0.012
#> GSM447463 1 0.1109 0.8017 0.968 0.028 0.000 0.004
#> GSM447467 2 0.7616 0.4332 0.152 0.628 0.140 0.080
#> GSM447469 4 0.5288 0.6876 0.000 0.068 0.200 0.732
#> GSM447473 1 0.3808 0.7794 0.812 0.176 0.000 0.012
#> GSM447404 1 0.3591 0.7780 0.824 0.168 0.000 0.008
#> GSM447406 4 0.2473 0.7531 0.000 0.012 0.080 0.908
#> GSM447407 4 0.2521 0.7369 0.000 0.024 0.064 0.912
#> GSM447409 1 0.1302 0.8008 0.956 0.044 0.000 0.000
#> GSM447412 3 0.1545 0.5701 0.000 0.040 0.952 0.008
#> GSM447426 3 0.5432 0.4682 0.000 0.068 0.716 0.216
#> GSM447433 1 0.4908 0.7284 0.692 0.292 0.000 0.016
#> GSM447439 4 0.2255 0.7555 0.000 0.012 0.068 0.920
#> GSM447441 3 0.7576 -0.0851 0.000 0.324 0.464 0.212
#> GSM447443 1 0.5143 0.7664 0.628 0.360 0.000 0.012
#> GSM447445 1 0.2198 0.8026 0.920 0.072 0.000 0.008
#> GSM447446 1 0.4988 0.7337 0.692 0.288 0.000 0.020
#> GSM447453 1 0.2466 0.7982 0.900 0.096 0.000 0.004
#> GSM447455 3 0.7613 -0.1653 0.000 0.340 0.448 0.212
#> GSM447456 2 0.7221 0.3511 0.180 0.564 0.004 0.252
#> GSM447459 4 0.2473 0.7531 0.000 0.012 0.080 0.908
#> GSM447466 1 0.0592 0.8013 0.984 0.016 0.000 0.000
#> GSM447470 1 0.4800 0.7260 0.656 0.340 0.000 0.004
#> GSM447474 1 0.4800 0.7267 0.656 0.340 0.000 0.004
#> GSM447475 2 0.7564 0.4792 0.032 0.592 0.196 0.180
#> GSM447398 2 0.7497 0.1780 0.000 0.424 0.180 0.396
#> GSM447399 3 0.7171 0.0775 0.000 0.136 0.464 0.400
#> GSM447408 4 0.5700 0.6218 0.000 0.120 0.164 0.716
#> GSM447410 4 0.6401 0.5312 0.000 0.172 0.176 0.652
#> GSM447414 3 0.2530 0.5666 0.000 0.000 0.888 0.112
#> GSM447417 4 0.5220 0.6834 0.000 0.092 0.156 0.752
#> GSM447419 1 0.5329 0.7386 0.568 0.420 0.000 0.012
#> GSM447420 2 0.7792 -0.2414 0.260 0.416 0.324 0.000
#> GSM447421 1 0.4844 0.7746 0.688 0.300 0.000 0.012
#> GSM447423 3 0.1824 0.5568 0.000 0.060 0.936 0.004
#> GSM447436 1 0.4576 0.7689 0.748 0.232 0.000 0.020
#> GSM447437 1 0.0817 0.8001 0.976 0.024 0.000 0.000
#> GSM447438 4 0.6542 0.4702 0.000 0.252 0.128 0.620
#> GSM447447 1 0.4584 0.7415 0.696 0.300 0.000 0.004
#> GSM447454 3 0.5793 0.1922 0.000 0.360 0.600 0.040
#> GSM447457 3 0.5762 0.2012 0.000 0.352 0.608 0.040
#> GSM447460 3 0.7547 0.2151 0.000 0.236 0.488 0.276
#> GSM447465 3 0.5681 0.4765 0.000 0.208 0.704 0.088
#> GSM447471 1 0.3808 0.7794 0.812 0.176 0.000 0.012
#> GSM447476 4 0.6607 0.3884 0.016 0.340 0.060 0.584
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM447401 3 0.4528 0.6001 0.000 0.004 0.756 0.160 0.080
#> GSM447411 1 0.0451 0.5246 0.988 0.004 0.000 0.008 0.000
#> GSM447413 3 0.3644 0.7548 0.000 0.084 0.844 0.048 0.024
#> GSM447415 1 0.4933 0.1095 0.700 0.004 0.016 0.032 0.248
#> GSM447416 3 0.2536 0.7694 0.000 0.128 0.868 0.000 0.004
#> GSM447425 4 0.5089 0.6519 0.000 0.068 0.104 0.756 0.072
#> GSM447430 4 0.6331 0.7336 0.000 0.192 0.144 0.624 0.040
#> GSM447435 1 0.0451 0.5246 0.988 0.004 0.000 0.008 0.000
#> GSM447440 1 0.3346 0.4877 0.856 0.016 0.000 0.036 0.092
#> GSM447444 1 0.6070 0.0416 0.496 0.052 0.004 0.024 0.424
#> GSM447448 1 0.5482 0.3540 0.648 0.028 0.000 0.048 0.276
#> GSM447449 2 0.4065 0.6551 0.000 0.792 0.160 0.016 0.032
#> GSM447450 1 0.2707 0.4984 0.888 0.008 0.000 0.024 0.080
#> GSM447452 4 0.5508 0.6893 0.000 0.088 0.132 0.720 0.060
#> GSM447458 2 0.2981 0.6670 0.004 0.884 0.064 0.012 0.036
#> GSM447461 2 0.2283 0.6554 0.000 0.916 0.036 0.008 0.040
#> GSM447464 1 0.5004 -0.1159 0.648 0.004 0.008 0.028 0.312
#> GSM447468 5 0.5695 0.4821 0.468 0.004 0.016 0.036 0.476
#> GSM447472 1 0.5755 -0.1192 0.544 0.024 0.008 0.028 0.396
#> GSM447400 5 0.4948 0.6911 0.356 0.000 0.008 0.024 0.612
#> GSM447402 4 0.5792 0.5239 0.000 0.356 0.024 0.568 0.052
#> GSM447403 1 0.5510 0.1637 0.680 0.008 0.020 0.060 0.232
#> GSM447405 1 0.7422 0.2812 0.440 0.036 0.004 0.212 0.308
#> GSM447418 3 0.3336 0.7634 0.000 0.144 0.832 0.008 0.016
#> GSM447422 3 0.3660 0.7504 0.000 0.176 0.800 0.008 0.016
#> GSM447424 3 0.2136 0.7656 0.000 0.088 0.904 0.008 0.000
#> GSM447427 3 0.3443 0.7537 0.000 0.164 0.816 0.008 0.012
#> GSM447428 3 0.6793 0.0155 0.072 0.040 0.460 0.012 0.416
#> GSM447429 5 0.5096 0.5652 0.472 0.000 0.012 0.016 0.500
#> GSM447431 3 0.4832 0.6849 0.000 0.192 0.736 0.024 0.048
#> GSM447432 2 0.2900 0.6708 0.000 0.876 0.092 0.012 0.020
#> GSM447434 5 0.5674 0.5979 0.320 0.020 0.004 0.048 0.608
#> GSM447442 2 0.3812 0.6635 0.000 0.816 0.136 0.016 0.032
#> GSM447451 2 0.3047 0.6561 0.000 0.868 0.044 0.004 0.084
#> GSM447462 5 0.5056 0.6902 0.344 0.004 0.008 0.024 0.620
#> GSM447463 1 0.1483 0.5254 0.952 0.008 0.000 0.012 0.028
#> GSM447467 2 0.5262 0.5011 0.056 0.692 0.008 0.012 0.232
#> GSM447469 4 0.6630 0.6466 0.000 0.216 0.200 0.560 0.024
#> GSM447473 1 0.5510 0.1637 0.680 0.008 0.020 0.060 0.232
#> GSM447404 1 0.5331 0.1776 0.696 0.008 0.020 0.052 0.224
#> GSM447406 4 0.6398 0.7324 0.000 0.192 0.144 0.620 0.044
#> GSM447407 4 0.5283 0.7249 0.000 0.112 0.144 0.720 0.024
#> GSM447409 1 0.1903 0.5154 0.936 0.004 0.004 0.028 0.028
#> GSM447412 3 0.3696 0.7342 0.000 0.212 0.772 0.000 0.016
#> GSM447426 3 0.4528 0.6001 0.000 0.004 0.756 0.160 0.080
#> GSM447433 1 0.7082 0.3435 0.504 0.028 0.004 0.196 0.268
#> GSM447439 4 0.6323 0.7332 0.000 0.196 0.140 0.624 0.040
#> GSM447441 2 0.4255 0.6324 0.000 0.772 0.180 0.032 0.016
#> GSM447443 5 0.5155 0.6660 0.340 0.004 0.016 0.020 0.620
#> GSM447445 1 0.3344 0.5155 0.848 0.012 0.000 0.028 0.112
#> GSM447446 1 0.7096 0.3435 0.504 0.028 0.004 0.204 0.260
#> GSM447453 1 0.3850 0.5149 0.816 0.012 0.000 0.044 0.128
#> GSM447455 2 0.3675 0.6679 0.000 0.828 0.124 0.016 0.032
#> GSM447456 2 0.6379 0.3904 0.120 0.624 0.000 0.052 0.204
#> GSM447459 4 0.6331 0.7336 0.000 0.192 0.144 0.624 0.040
#> GSM447466 1 0.1143 0.5135 0.968 0.008 0.004 0.008 0.012
#> GSM447470 1 0.5758 -0.1020 0.476 0.040 0.004 0.016 0.464
#> GSM447474 5 0.5290 0.1958 0.448 0.024 0.004 0.008 0.516
#> GSM447475 2 0.3392 0.6123 0.004 0.832 0.012 0.008 0.144
#> GSM447398 2 0.2795 0.5879 0.000 0.880 0.000 0.064 0.056
#> GSM447399 2 0.7260 0.0944 0.000 0.444 0.316 0.204 0.036
#> GSM447408 4 0.5144 0.4860 0.000 0.448 0.008 0.520 0.024
#> GSM447410 2 0.5536 -0.4011 0.000 0.504 0.008 0.440 0.048
#> GSM447414 3 0.2947 0.7618 0.000 0.088 0.876 0.016 0.020
#> GSM447417 4 0.5614 0.6288 0.000 0.312 0.056 0.612 0.020
#> GSM447419 5 0.5067 0.6654 0.312 0.008 0.016 0.016 0.648
#> GSM447420 5 0.6392 0.3804 0.120 0.028 0.228 0.008 0.616
#> GSM447421 5 0.5182 0.6707 0.384 0.000 0.008 0.032 0.576
#> GSM447423 3 0.3612 0.7181 0.000 0.228 0.764 0.000 0.008
#> GSM447436 1 0.6780 0.3738 0.564 0.028 0.004 0.208 0.196
#> GSM447437 1 0.0727 0.5290 0.980 0.004 0.000 0.004 0.012
#> GSM447438 2 0.5683 -0.3839 0.000 0.500 0.004 0.428 0.068
#> GSM447447 1 0.6545 0.3529 0.560 0.036 0.004 0.096 0.304
#> GSM447454 2 0.3551 0.5505 0.000 0.772 0.220 0.000 0.008
#> GSM447457 2 0.3690 0.5514 0.000 0.764 0.224 0.000 0.012
#> GSM447460 2 0.5344 0.3426 0.000 0.580 0.372 0.032 0.016
#> GSM447465 3 0.4610 0.0800 0.000 0.432 0.556 0.012 0.000
#> GSM447471 1 0.5510 0.1637 0.680 0.008 0.020 0.060 0.232
#> GSM447476 4 0.6397 0.3513 0.008 0.368 0.008 0.508 0.108
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM447401 3 0.5526 0.62826 0.000 0.000 0.636 0.192 0.140 0.032
#> GSM447411 1 0.0837 0.55496 0.972 0.000 0.004 0.000 0.004 0.020
#> GSM447413 3 0.4440 0.79895 0.000 0.032 0.772 0.132 0.040 0.024
#> GSM447415 1 0.5136 0.26144 0.604 0.016 0.008 0.000 0.048 0.324
#> GSM447416 3 0.3099 0.82263 0.000 0.096 0.848 0.044 0.012 0.000
#> GSM447425 4 0.4829 0.49187 0.000 0.024 0.012 0.608 0.344 0.012
#> GSM447430 4 0.1594 0.68027 0.000 0.052 0.016 0.932 0.000 0.000
#> GSM447435 1 0.0777 0.55616 0.972 0.000 0.004 0.000 0.000 0.024
#> GSM447440 1 0.3777 0.49822 0.816 0.016 0.012 0.000 0.056 0.100
#> GSM447444 1 0.7295 -0.10264 0.384 0.060 0.016 0.000 0.244 0.296
#> GSM447448 1 0.5936 0.00192 0.548 0.028 0.004 0.000 0.304 0.116
#> GSM447449 2 0.4336 0.71490 0.000 0.776 0.128 0.052 0.032 0.012
#> GSM447450 1 0.3075 0.52887 0.856 0.004 0.012 0.000 0.040 0.088
#> GSM447452 4 0.2752 0.63129 0.000 0.020 0.012 0.864 0.104 0.000
#> GSM447458 2 0.3404 0.73425 0.004 0.856 0.060 0.028 0.036 0.016
#> GSM447461 2 0.2607 0.71175 0.000 0.892 0.012 0.036 0.052 0.008
#> GSM447464 1 0.4500 -0.15762 0.492 0.000 0.012 0.000 0.012 0.484
#> GSM447468 6 0.5001 0.56186 0.228 0.016 0.008 0.000 0.072 0.676
#> GSM447472 6 0.6444 0.25447 0.336 0.024 0.008 0.000 0.172 0.460
#> GSM447400 6 0.2833 0.65745 0.148 0.000 0.012 0.000 0.004 0.836
#> GSM447402 4 0.6779 0.43136 0.000 0.212 0.028 0.408 0.340 0.012
#> GSM447403 1 0.6423 0.29336 0.540 0.024 0.032 0.000 0.128 0.276
#> GSM447405 5 0.6215 0.58895 0.260 0.028 0.004 0.020 0.576 0.112
#> GSM447418 3 0.3325 0.80955 0.000 0.084 0.848 0.036 0.024 0.008
#> GSM447422 3 0.3443 0.78820 0.000 0.128 0.824 0.016 0.024 0.008
#> GSM447424 3 0.2702 0.81315 0.000 0.036 0.868 0.092 0.000 0.004
#> GSM447427 3 0.2748 0.79728 0.000 0.120 0.856 0.000 0.016 0.008
#> GSM447428 6 0.6071 0.13371 0.008 0.028 0.420 0.000 0.096 0.448
#> GSM447429 6 0.3536 0.56372 0.252 0.004 0.000 0.000 0.008 0.736
#> GSM447431 3 0.5965 0.69829 0.000 0.152 0.652 0.112 0.060 0.024
#> GSM447432 2 0.3198 0.74093 0.000 0.852 0.092 0.020 0.028 0.008
#> GSM447434 6 0.5824 0.57909 0.132 0.024 0.012 0.000 0.220 0.612
#> GSM447442 2 0.4133 0.72401 0.000 0.792 0.120 0.040 0.036 0.012
#> GSM447451 2 0.2349 0.71318 0.000 0.892 0.008 0.000 0.080 0.020
#> GSM447462 6 0.2865 0.65762 0.140 0.000 0.012 0.000 0.008 0.840
#> GSM447463 1 0.1257 0.54312 0.952 0.000 0.000 0.000 0.020 0.028
#> GSM447467 2 0.4594 0.62807 0.024 0.752 0.008 0.000 0.108 0.108
#> GSM447469 4 0.6761 0.60625 0.000 0.124 0.100 0.568 0.184 0.024
#> GSM447473 1 0.6423 0.29336 0.540 0.024 0.032 0.000 0.128 0.276
#> GSM447404 1 0.6291 0.30906 0.560 0.024 0.032 0.000 0.116 0.268
#> GSM447406 4 0.1738 0.67909 0.000 0.052 0.016 0.928 0.004 0.000
#> GSM447407 4 0.2462 0.65562 0.000 0.032 0.012 0.892 0.064 0.000
#> GSM447409 1 0.2678 0.51496 0.860 0.004 0.000 0.000 0.116 0.020
#> GSM447412 3 0.3953 0.77295 0.000 0.188 0.764 0.004 0.028 0.016
#> GSM447426 3 0.5526 0.62826 0.000 0.000 0.636 0.192 0.140 0.032
#> GSM447433 5 0.5982 0.58220 0.324 0.012 0.012 0.020 0.556 0.076
#> GSM447439 4 0.1594 0.68027 0.000 0.052 0.016 0.932 0.000 0.000
#> GSM447441 2 0.4560 0.71254 0.000 0.748 0.152 0.048 0.048 0.004
#> GSM447443 6 0.4826 0.64830 0.112 0.016 0.016 0.000 0.124 0.732
#> GSM447445 1 0.2959 0.46560 0.852 0.000 0.008 0.000 0.104 0.036
#> GSM447446 5 0.5771 0.58622 0.320 0.016 0.000 0.020 0.564 0.080
#> GSM447453 1 0.4020 0.32506 0.744 0.000 0.008 0.000 0.204 0.044
#> GSM447455 2 0.3808 0.73361 0.000 0.812 0.116 0.028 0.032 0.012
#> GSM447456 2 0.7082 0.32894 0.128 0.544 0.012 0.036 0.220 0.060
#> GSM447459 4 0.1594 0.68027 0.000 0.052 0.016 0.932 0.000 0.000
#> GSM447466 1 0.1793 0.55293 0.928 0.004 0.000 0.000 0.036 0.032
#> GSM447470 1 0.6910 -0.13427 0.392 0.044 0.016 0.000 0.168 0.380
#> GSM447474 6 0.6205 0.32601 0.304 0.032 0.020 0.000 0.100 0.544
#> GSM447475 2 0.2697 0.70471 0.004 0.872 0.004 0.000 0.092 0.028
#> GSM447398 2 0.3829 0.61204 0.000 0.792 0.000 0.124 0.072 0.012
#> GSM447399 4 0.7335 -0.11649 0.000 0.324 0.280 0.328 0.044 0.024
#> GSM447408 4 0.5658 0.57452 0.000 0.280 0.008 0.588 0.108 0.016
#> GSM447410 4 0.6153 0.40721 0.000 0.388 0.008 0.452 0.136 0.016
#> GSM447414 3 0.4279 0.80577 0.000 0.036 0.792 0.104 0.044 0.024
#> GSM447417 4 0.6283 0.61859 0.000 0.168 0.040 0.592 0.180 0.020
#> GSM447419 6 0.4367 0.65719 0.108 0.004 0.016 0.000 0.112 0.760
#> GSM447420 6 0.5552 0.51656 0.028 0.024 0.196 0.000 0.088 0.664
#> GSM447421 6 0.2982 0.64932 0.152 0.000 0.012 0.000 0.008 0.828
#> GSM447423 3 0.3301 0.74308 0.000 0.216 0.772 0.000 0.008 0.004
#> GSM447436 5 0.5757 0.47654 0.392 0.016 0.000 0.020 0.508 0.064
#> GSM447437 1 0.0820 0.54473 0.972 0.000 0.000 0.000 0.016 0.012
#> GSM447438 4 0.6283 0.37529 0.000 0.384 0.000 0.408 0.188 0.020
#> GSM447447 1 0.6192 -0.38665 0.428 0.024 0.012 0.000 0.428 0.108
#> GSM447454 2 0.3721 0.69546 0.000 0.784 0.168 0.000 0.032 0.016
#> GSM447457 2 0.3372 0.69222 0.000 0.796 0.176 0.000 0.008 0.020
#> GSM447460 2 0.5836 0.45019 0.000 0.568 0.280 0.128 0.016 0.008
#> GSM447465 2 0.5451 0.13678 0.000 0.456 0.444 0.092 0.000 0.008
#> GSM447471 1 0.6423 0.29336 0.540 0.024 0.032 0.000 0.128 0.276
#> GSM447476 5 0.6639 -0.40323 0.000 0.276 0.004 0.332 0.368 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 gender(p) agent(p) k
#> MAD:kmeans 78 0.821 0.497 2
#> MAD:kmeans 63 0.519 0.258 3
#> MAD:kmeans 56 0.412 0.257 4
#> MAD:kmeans 50 0.783 0.108 5
#> MAD:kmeans 53 0.725 0.327 6
If matrix rows can be associated to genes, consider to use functional_enrichment(res,
...)
to perform function enrichment for the signature genes. See this vignette for more detailed explanations.
The object with results only for a single top-value method and a single partition method can be extracted as:
res = res_list["MAD", "skmeans"]
# you can also extract it by
# res = res_list["MAD:skmeans"]
A summary of res
and all the functions that can be applied to it:
res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#> On a matrix with 51941 rows and 79 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'MAD' method.
#> Subgroups are detected by 'skmeans' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 2.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
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.981 0.992 0.5065 0.494 0.494
#> 3 3 0.770 0.825 0.900 0.2726 0.784 0.591
#> 4 4 0.682 0.804 0.852 0.1130 0.920 0.776
#> 5 5 0.668 0.643 0.786 0.0945 0.931 0.761
#> 6 6 0.668 0.536 0.738 0.0403 0.949 0.781
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
#> GSM447401 2 0.0000 0.997 0.000 1.000
#> GSM447411 1 0.0000 0.986 1.000 0.000
#> GSM447413 2 0.0000 0.997 0.000 1.000
#> GSM447415 1 0.0000 0.986 1.000 0.000
#> GSM447416 2 0.0000 0.997 0.000 1.000
#> GSM447425 2 0.0000 0.997 0.000 1.000
#> GSM447430 2 0.0000 0.997 0.000 1.000
#> GSM447435 1 0.0000 0.986 1.000 0.000
#> GSM447440 1 0.0000 0.986 1.000 0.000
#> GSM447444 1 0.0000 0.986 1.000 0.000
#> GSM447448 1 0.0000 0.986 1.000 0.000
#> GSM447449 2 0.0000 0.997 0.000 1.000
#> GSM447450 1 0.0000 0.986 1.000 0.000
#> GSM447452 2 0.0000 0.997 0.000 1.000
#> GSM447458 2 0.0000 0.997 0.000 1.000
#> GSM447461 2 0.0000 0.997 0.000 1.000
#> GSM447464 1 0.0000 0.986 1.000 0.000
#> GSM447468 1 0.0000 0.986 1.000 0.000
#> GSM447472 1 0.0000 0.986 1.000 0.000
#> GSM447400 1 0.0000 0.986 1.000 0.000
#> GSM447402 2 0.0000 0.997 0.000 1.000
#> GSM447403 1 0.0000 0.986 1.000 0.000
#> GSM447405 1 0.0000 0.986 1.000 0.000
#> GSM447418 2 0.0000 0.997 0.000 1.000
#> GSM447422 2 0.0000 0.997 0.000 1.000
#> GSM447424 2 0.0000 0.997 0.000 1.000
#> GSM447427 2 0.0000 0.997 0.000 1.000
#> GSM447428 1 0.5629 0.846 0.868 0.132
#> GSM447429 1 0.0000 0.986 1.000 0.000
#> GSM447431 2 0.0000 0.997 0.000 1.000
#> GSM447432 2 0.0000 0.997 0.000 1.000
#> GSM447434 1 0.0000 0.986 1.000 0.000
#> GSM447442 2 0.0000 0.997 0.000 1.000
#> GSM447451 2 0.0000 0.997 0.000 1.000
#> GSM447462 1 0.0000 0.986 1.000 0.000
#> GSM447463 1 0.0000 0.986 1.000 0.000
#> GSM447467 1 0.2423 0.949 0.960 0.040
#> GSM447469 2 0.0000 0.997 0.000 1.000
#> GSM447473 1 0.0000 0.986 1.000 0.000
#> GSM447404 1 0.0000 0.986 1.000 0.000
#> GSM447406 2 0.0000 0.997 0.000 1.000
#> GSM447407 2 0.0000 0.997 0.000 1.000
#> GSM447409 1 0.0000 0.986 1.000 0.000
#> GSM447412 2 0.0000 0.997 0.000 1.000
#> GSM447426 2 0.0000 0.997 0.000 1.000
#> GSM447433 1 0.0000 0.986 1.000 0.000
#> GSM447439 2 0.0000 0.997 0.000 1.000
#> GSM447441 2 0.0000 0.997 0.000 1.000
#> GSM447443 1 0.0000 0.986 1.000 0.000
#> GSM447445 1 0.0000 0.986 1.000 0.000
#> GSM447446 1 0.0000 0.986 1.000 0.000
#> GSM447453 1 0.0000 0.986 1.000 0.000
#> GSM447455 2 0.0000 0.997 0.000 1.000
#> GSM447456 1 0.0938 0.976 0.988 0.012
#> GSM447459 2 0.0000 0.997 0.000 1.000
#> GSM447466 1 0.0000 0.986 1.000 0.000
#> GSM447470 1 0.0000 0.986 1.000 0.000
#> GSM447474 1 0.0000 0.986 1.000 0.000
#> GSM447475 2 0.5178 0.866 0.116 0.884
#> GSM447398 2 0.0000 0.997 0.000 1.000
#> GSM447399 2 0.0000 0.997 0.000 1.000
#> GSM447408 2 0.0000 0.997 0.000 1.000
#> GSM447410 2 0.0000 0.997 0.000 1.000
#> GSM447414 2 0.0000 0.997 0.000 1.000
#> GSM447417 2 0.0000 0.997 0.000 1.000
#> GSM447419 1 0.0000 0.986 1.000 0.000
#> GSM447420 1 0.0000 0.986 1.000 0.000
#> GSM447421 1 0.0000 0.986 1.000 0.000
#> GSM447423 2 0.0000 0.997 0.000 1.000
#> GSM447436 1 0.0000 0.986 1.000 0.000
#> GSM447437 1 0.0000 0.986 1.000 0.000
#> GSM447438 2 0.0000 0.997 0.000 1.000
#> GSM447447 1 0.0000 0.986 1.000 0.000
#> GSM447454 2 0.0000 0.997 0.000 1.000
#> GSM447457 2 0.0000 0.997 0.000 1.000
#> GSM447460 2 0.0000 0.997 0.000 1.000
#> GSM447465 2 0.0000 0.997 0.000 1.000
#> GSM447471 1 0.0000 0.986 1.000 0.000
#> GSM447476 1 0.9286 0.476 0.656 0.344
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM447401 3 0.0000 0.764 0.000 0.000 1.000
#> GSM447411 1 0.0000 0.998 1.000 0.000 0.000
#> GSM447413 3 0.0000 0.764 0.000 0.000 1.000
#> GSM447415 1 0.0000 0.998 1.000 0.000 0.000
#> GSM447416 3 0.0000 0.764 0.000 0.000 1.000
#> GSM447425 2 0.4605 0.865 0.000 0.796 0.204
#> GSM447430 2 0.4605 0.865 0.000 0.796 0.204
#> GSM447435 1 0.0000 0.998 1.000 0.000 0.000
#> GSM447440 1 0.0000 0.998 1.000 0.000 0.000
#> GSM447444 1 0.0237 0.997 0.996 0.004 0.000
#> GSM447448 1 0.0000 0.998 1.000 0.000 0.000
#> GSM447449 3 0.4235 0.645 0.000 0.176 0.824
#> GSM447450 1 0.0000 0.998 1.000 0.000 0.000
#> GSM447452 2 0.4605 0.865 0.000 0.796 0.204
#> GSM447458 2 0.5882 0.672 0.000 0.652 0.348
#> GSM447461 3 0.6302 0.441 0.000 0.480 0.520
#> GSM447464 1 0.0237 0.997 0.996 0.004 0.000
#> GSM447468 1 0.0237 0.997 0.996 0.004 0.000
#> GSM447472 1 0.0000 0.998 1.000 0.000 0.000
#> GSM447400 1 0.0237 0.997 0.996 0.004 0.000
#> GSM447402 2 0.4605 0.865 0.000 0.796 0.204
#> GSM447403 1 0.0000 0.998 1.000 0.000 0.000
#> GSM447405 1 0.0747 0.984 0.984 0.016 0.000
#> GSM447418 3 0.0000 0.764 0.000 0.000 1.000
#> GSM447422 3 0.0000 0.764 0.000 0.000 1.000
#> GSM447424 3 0.0000 0.764 0.000 0.000 1.000
#> GSM447427 3 0.0000 0.764 0.000 0.000 1.000
#> GSM447428 3 0.5754 0.512 0.296 0.004 0.700
#> GSM447429 1 0.0237 0.997 0.996 0.004 0.000
#> GSM447431 3 0.0237 0.764 0.000 0.004 0.996
#> GSM447432 3 0.5397 0.494 0.000 0.280 0.720
#> GSM447434 1 0.0000 0.998 1.000 0.000 0.000
#> GSM447442 3 0.5327 0.507 0.000 0.272 0.728
#> GSM447451 3 0.6062 0.586 0.000 0.384 0.616
#> GSM447462 1 0.0237 0.997 0.996 0.004 0.000
#> GSM447463 1 0.0000 0.998 1.000 0.000 0.000
#> GSM447467 3 0.7181 0.203 0.468 0.024 0.508
#> GSM447469 2 0.4654 0.861 0.000 0.792 0.208
#> GSM447473 1 0.0000 0.998 1.000 0.000 0.000
#> GSM447404 1 0.0000 0.998 1.000 0.000 0.000
#> GSM447406 2 0.4605 0.865 0.000 0.796 0.204
#> GSM447407 2 0.4605 0.865 0.000 0.796 0.204
#> GSM447409 1 0.0000 0.998 1.000 0.000 0.000
#> GSM447412 3 0.3267 0.729 0.000 0.116 0.884
#> GSM447426 3 0.0000 0.764 0.000 0.000 1.000
#> GSM447433 1 0.0592 0.988 0.988 0.012 0.000
#> GSM447439 2 0.4605 0.865 0.000 0.796 0.204
#> GSM447441 3 0.5968 0.601 0.000 0.364 0.636
#> GSM447443 1 0.0237 0.997 0.996 0.004 0.000
#> GSM447445 1 0.0000 0.998 1.000 0.000 0.000
#> GSM447446 1 0.0000 0.998 1.000 0.000 0.000
#> GSM447453 1 0.0000 0.998 1.000 0.000 0.000
#> GSM447455 3 0.5363 0.500 0.000 0.276 0.724
#> GSM447456 2 0.5098 0.582 0.248 0.752 0.000
#> GSM447459 2 0.4605 0.865 0.000 0.796 0.204
#> GSM447466 1 0.0000 0.998 1.000 0.000 0.000
#> GSM447470 1 0.0000 0.998 1.000 0.000 0.000
#> GSM447474 1 0.0237 0.997 0.996 0.004 0.000
#> GSM447475 3 0.6302 0.441 0.000 0.480 0.520
#> GSM447398 2 0.0237 0.773 0.000 0.996 0.004
#> GSM447399 2 0.6026 0.646 0.000 0.624 0.376
#> GSM447408 2 0.0424 0.774 0.000 0.992 0.008
#> GSM447410 2 0.0237 0.773 0.000 0.996 0.004
#> GSM447414 3 0.0000 0.764 0.000 0.000 1.000
#> GSM447417 2 0.4605 0.865 0.000 0.796 0.204
#> GSM447419 1 0.0237 0.997 0.996 0.004 0.000
#> GSM447420 3 0.6518 0.108 0.484 0.004 0.512
#> GSM447421 1 0.0237 0.997 0.996 0.004 0.000
#> GSM447423 3 0.4235 0.699 0.000 0.176 0.824
#> GSM447436 1 0.0000 0.998 1.000 0.000 0.000
#> GSM447437 1 0.0000 0.998 1.000 0.000 0.000
#> GSM447438 2 0.0237 0.773 0.000 0.996 0.004
#> GSM447447 1 0.0000 0.998 1.000 0.000 0.000
#> GSM447454 3 0.4291 0.696 0.000 0.180 0.820
#> GSM447457 3 0.4235 0.699 0.000 0.176 0.824
#> GSM447460 3 0.4235 0.645 0.000 0.176 0.824
#> GSM447465 3 0.0000 0.764 0.000 0.000 1.000
#> GSM447471 1 0.0000 0.998 1.000 0.000 0.000
#> GSM447476 2 0.0237 0.770 0.004 0.996 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM447401 3 0.3444 0.815 0.000 0.000 0.816 0.184
#> GSM447411 1 0.0779 0.925 0.980 0.016 0.004 0.000
#> GSM447413 3 0.3356 0.818 0.000 0.000 0.824 0.176
#> GSM447415 1 0.1004 0.924 0.972 0.024 0.004 0.000
#> GSM447416 3 0.3172 0.820 0.000 0.000 0.840 0.160
#> GSM447425 4 0.0707 0.859 0.000 0.020 0.000 0.980
#> GSM447430 4 0.1211 0.868 0.000 0.040 0.000 0.960
#> GSM447435 1 0.1059 0.926 0.972 0.016 0.012 0.000
#> GSM447440 1 0.1174 0.926 0.968 0.020 0.012 0.000
#> GSM447444 1 0.3991 0.887 0.832 0.048 0.120 0.000
#> GSM447448 1 0.1356 0.923 0.960 0.032 0.008 0.000
#> GSM447449 2 0.6449 0.730 0.000 0.640 0.140 0.220
#> GSM447450 1 0.1297 0.926 0.964 0.020 0.016 0.000
#> GSM447452 4 0.0188 0.867 0.000 0.004 0.000 0.996
#> GSM447458 2 0.5687 0.741 0.000 0.684 0.068 0.248
#> GSM447461 2 0.3144 0.745 0.000 0.884 0.072 0.044
#> GSM447464 1 0.3674 0.886 0.852 0.044 0.104 0.000
#> GSM447468 1 0.3144 0.902 0.884 0.044 0.072 0.000
#> GSM447472 1 0.1767 0.924 0.944 0.012 0.044 0.000
#> GSM447400 1 0.4144 0.876 0.828 0.068 0.104 0.000
#> GSM447402 4 0.1724 0.846 0.000 0.020 0.032 0.948
#> GSM447403 1 0.1004 0.924 0.972 0.024 0.004 0.000
#> GSM447405 1 0.4419 0.771 0.792 0.028 0.004 0.176
#> GSM447418 3 0.2814 0.815 0.000 0.000 0.868 0.132
#> GSM447422 3 0.2814 0.815 0.000 0.000 0.868 0.132
#> GSM447424 3 0.3219 0.820 0.000 0.000 0.836 0.164
#> GSM447427 3 0.2760 0.814 0.000 0.000 0.872 0.128
#> GSM447428 3 0.3266 0.617 0.084 0.040 0.876 0.000
#> GSM447429 1 0.3820 0.886 0.848 0.064 0.088 0.000
#> GSM447431 3 0.4552 0.790 0.000 0.044 0.784 0.172
#> GSM447432 2 0.6295 0.746 0.000 0.656 0.132 0.212
#> GSM447434 1 0.1209 0.924 0.964 0.032 0.004 0.000
#> GSM447442 2 0.6327 0.745 0.000 0.652 0.132 0.216
#> GSM447451 2 0.3015 0.740 0.000 0.884 0.092 0.024
#> GSM447462 1 0.4144 0.876 0.828 0.068 0.104 0.000
#> GSM447463 1 0.1820 0.923 0.944 0.036 0.020 0.000
#> GSM447467 2 0.6070 0.640 0.076 0.712 0.188 0.024
#> GSM447469 4 0.1488 0.854 0.000 0.012 0.032 0.956
#> GSM447473 1 0.1004 0.924 0.972 0.024 0.004 0.000
#> GSM447404 1 0.1004 0.924 0.972 0.024 0.004 0.000
#> GSM447406 4 0.1211 0.868 0.000 0.040 0.000 0.960
#> GSM447407 4 0.0188 0.867 0.000 0.004 0.000 0.996
#> GSM447409 1 0.0188 0.926 0.996 0.004 0.000 0.000
#> GSM447412 3 0.3787 0.808 0.000 0.036 0.840 0.124
#> GSM447426 3 0.3444 0.815 0.000 0.000 0.816 0.184
#> GSM447433 1 0.3856 0.818 0.832 0.032 0.000 0.136
#> GSM447439 4 0.1211 0.868 0.000 0.040 0.000 0.960
#> GSM447441 2 0.4015 0.745 0.000 0.832 0.116 0.052
#> GSM447443 1 0.3312 0.898 0.876 0.052 0.072 0.000
#> GSM447445 1 0.1356 0.924 0.960 0.032 0.008 0.000
#> GSM447446 1 0.2023 0.913 0.940 0.028 0.004 0.028
#> GSM447453 1 0.0921 0.924 0.972 0.028 0.000 0.000
#> GSM447455 2 0.6265 0.743 0.000 0.656 0.124 0.220
#> GSM447456 2 0.5802 0.605 0.208 0.712 0.012 0.068
#> GSM447459 4 0.1211 0.868 0.000 0.040 0.000 0.960
#> GSM447466 1 0.1297 0.926 0.964 0.020 0.016 0.000
#> GSM447470 1 0.2256 0.920 0.924 0.056 0.020 0.000
#> GSM447474 1 0.4374 0.867 0.812 0.068 0.120 0.000
#> GSM447475 2 0.1911 0.736 0.004 0.944 0.032 0.020
#> GSM447398 2 0.2921 0.670 0.000 0.860 0.000 0.140
#> GSM447399 4 0.4728 0.599 0.000 0.032 0.216 0.752
#> GSM447408 4 0.3942 0.738 0.000 0.236 0.000 0.764
#> GSM447410 4 0.4103 0.723 0.000 0.256 0.000 0.744
#> GSM447414 3 0.3266 0.819 0.000 0.000 0.832 0.168
#> GSM447417 4 0.0469 0.864 0.000 0.012 0.000 0.988
#> GSM447419 1 0.5646 0.636 0.656 0.048 0.296 0.000
#> GSM447420 3 0.5657 0.364 0.244 0.068 0.688 0.000
#> GSM447421 1 0.4144 0.876 0.828 0.068 0.104 0.000
#> GSM447423 3 0.3495 0.712 0.000 0.140 0.844 0.016
#> GSM447436 1 0.2123 0.914 0.936 0.032 0.004 0.028
#> GSM447437 1 0.0817 0.924 0.976 0.024 0.000 0.000
#> GSM447438 4 0.4072 0.723 0.000 0.252 0.000 0.748
#> GSM447447 1 0.1489 0.923 0.952 0.044 0.004 0.000
#> GSM447454 3 0.5376 0.356 0.000 0.396 0.588 0.016
#> GSM447457 3 0.5353 0.241 0.000 0.432 0.556 0.012
#> GSM447460 2 0.7416 0.500 0.000 0.516 0.244 0.240
#> GSM447465 3 0.6780 0.525 0.000 0.232 0.604 0.164
#> GSM447471 1 0.1004 0.924 0.972 0.024 0.004 0.000
#> GSM447476 4 0.4008 0.726 0.000 0.244 0.000 0.756
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM447401 3 0.2629 0.8342 0.000 0.000 0.860 0.136 0.004
#> GSM447411 1 0.0703 0.6401 0.976 0.000 0.000 0.000 0.024
#> GSM447413 3 0.2230 0.8467 0.000 0.000 0.884 0.116 0.000
#> GSM447415 1 0.4060 0.2202 0.640 0.000 0.000 0.000 0.360
#> GSM447416 3 0.1341 0.8539 0.000 0.000 0.944 0.056 0.000
#> GSM447425 4 0.2429 0.8483 0.000 0.008 0.020 0.904 0.068
#> GSM447430 4 0.1106 0.8757 0.000 0.012 0.024 0.964 0.000
#> GSM447435 1 0.1270 0.6357 0.948 0.000 0.000 0.000 0.052
#> GSM447440 1 0.1851 0.6239 0.912 0.000 0.000 0.000 0.088
#> GSM447444 1 0.4250 0.5257 0.744 0.008 0.016 0.004 0.228
#> GSM447448 1 0.2377 0.6358 0.872 0.000 0.000 0.000 0.128
#> GSM447449 2 0.4974 0.7941 0.000 0.756 0.092 0.116 0.036
#> GSM447450 1 0.2230 0.6075 0.884 0.000 0.000 0.000 0.116
#> GSM447452 4 0.1498 0.8747 0.000 0.016 0.024 0.952 0.008
#> GSM447458 2 0.4665 0.7984 0.000 0.776 0.072 0.120 0.032
#> GSM447461 2 0.1503 0.7847 0.000 0.952 0.008 0.020 0.020
#> GSM447464 1 0.4225 0.0753 0.632 0.000 0.004 0.000 0.364
#> GSM447468 5 0.4341 0.5908 0.404 0.000 0.004 0.000 0.592
#> GSM447472 1 0.4242 0.1424 0.572 0.000 0.000 0.000 0.428
#> GSM447400 5 0.4029 0.7357 0.316 0.000 0.004 0.000 0.680
#> GSM447402 4 0.3239 0.8281 0.000 0.020 0.044 0.868 0.068
#> GSM447403 1 0.4114 0.2622 0.624 0.000 0.000 0.000 0.376
#> GSM447405 1 0.5328 0.4482 0.584 0.000 0.000 0.064 0.352
#> GSM447418 3 0.1921 0.8431 0.000 0.012 0.932 0.044 0.012
#> GSM447422 3 0.1844 0.8432 0.000 0.012 0.936 0.040 0.012
#> GSM447424 3 0.1671 0.8545 0.000 0.000 0.924 0.076 0.000
#> GSM447427 3 0.0865 0.8496 0.000 0.004 0.972 0.024 0.000
#> GSM447428 3 0.4843 0.5100 0.044 0.000 0.676 0.004 0.276
#> GSM447429 5 0.3966 0.7264 0.336 0.000 0.000 0.000 0.664
#> GSM447431 3 0.2775 0.8405 0.000 0.020 0.876 0.100 0.004
#> GSM447432 2 0.4830 0.7973 0.000 0.768 0.104 0.092 0.036
#> GSM447434 1 0.4291 -0.0874 0.536 0.000 0.000 0.000 0.464
#> GSM447442 2 0.5072 0.7881 0.000 0.748 0.120 0.096 0.036
#> GSM447451 2 0.1278 0.7866 0.000 0.960 0.004 0.016 0.020
#> GSM447462 5 0.3969 0.7225 0.304 0.000 0.004 0.000 0.692
#> GSM447463 1 0.1608 0.6189 0.928 0.000 0.000 0.000 0.072
#> GSM447467 2 0.4467 0.7527 0.020 0.768 0.032 0.004 0.176
#> GSM447469 4 0.2476 0.8570 0.000 0.020 0.064 0.904 0.012
#> GSM447473 1 0.4114 0.2622 0.624 0.000 0.000 0.000 0.376
#> GSM447404 1 0.4060 0.2615 0.640 0.000 0.000 0.000 0.360
#> GSM447406 4 0.1211 0.8761 0.000 0.016 0.024 0.960 0.000
#> GSM447407 4 0.1372 0.8745 0.000 0.016 0.024 0.956 0.004
#> GSM447409 1 0.2574 0.6345 0.876 0.000 0.000 0.012 0.112
#> GSM447412 3 0.1579 0.8471 0.000 0.024 0.944 0.032 0.000
#> GSM447426 3 0.2629 0.8342 0.000 0.000 0.860 0.136 0.004
#> GSM447433 1 0.4028 0.5727 0.768 0.000 0.000 0.040 0.192
#> GSM447439 4 0.1211 0.8761 0.000 0.016 0.024 0.960 0.000
#> GSM447441 2 0.3574 0.7878 0.000 0.840 0.108 0.032 0.020
#> GSM447443 5 0.4225 0.6951 0.364 0.000 0.004 0.000 0.632
#> GSM447445 1 0.1792 0.6340 0.916 0.000 0.000 0.000 0.084
#> GSM447446 1 0.3988 0.5687 0.732 0.000 0.000 0.016 0.252
#> GSM447453 1 0.2127 0.6311 0.892 0.000 0.000 0.000 0.108
#> GSM447455 2 0.4839 0.7843 0.000 0.760 0.108 0.108 0.024
#> GSM447456 2 0.6024 0.5378 0.256 0.628 0.000 0.048 0.068
#> GSM447459 4 0.1211 0.8761 0.000 0.016 0.024 0.960 0.000
#> GSM447466 1 0.1341 0.6327 0.944 0.000 0.000 0.000 0.056
#> GSM447470 1 0.3010 0.5120 0.824 0.000 0.000 0.004 0.172
#> GSM447474 1 0.5052 -0.1315 0.536 0.000 0.020 0.008 0.436
#> GSM447475 2 0.1405 0.7874 0.000 0.956 0.008 0.016 0.020
#> GSM447398 2 0.2260 0.7567 0.000 0.908 0.000 0.064 0.028
#> GSM447399 4 0.4586 0.4187 0.000 0.016 0.336 0.644 0.004
#> GSM447408 4 0.3419 0.7854 0.000 0.180 0.016 0.804 0.000
#> GSM447410 4 0.3815 0.7595 0.000 0.220 0.012 0.764 0.004
#> GSM447414 3 0.2068 0.8515 0.000 0.000 0.904 0.092 0.004
#> GSM447417 4 0.1716 0.8726 0.000 0.016 0.024 0.944 0.016
#> GSM447419 5 0.4572 0.6857 0.280 0.000 0.036 0.000 0.684
#> GSM447420 5 0.6116 0.1379 0.100 0.000 0.400 0.008 0.492
#> GSM447421 5 0.4009 0.7396 0.312 0.000 0.004 0.000 0.684
#> GSM447423 3 0.1628 0.8283 0.000 0.056 0.936 0.008 0.000
#> GSM447436 1 0.4329 0.5280 0.672 0.000 0.000 0.016 0.312
#> GSM447437 1 0.0290 0.6435 0.992 0.000 0.000 0.000 0.008
#> GSM447438 4 0.3750 0.7487 0.000 0.232 0.000 0.756 0.012
#> GSM447447 1 0.3053 0.6049 0.828 0.000 0.000 0.008 0.164
#> GSM447454 3 0.4318 0.5690 0.000 0.296 0.688 0.008 0.008
#> GSM447457 3 0.4777 0.2002 0.000 0.436 0.548 0.008 0.008
#> GSM447460 2 0.6125 0.5053 0.000 0.584 0.260 0.148 0.008
#> GSM447465 3 0.5282 0.6184 0.000 0.220 0.676 0.100 0.004
#> GSM447471 1 0.4114 0.2622 0.624 0.000 0.000 0.000 0.376
#> GSM447476 4 0.4264 0.7457 0.000 0.212 0.000 0.744 0.044
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM447401 3 0.2149 0.8091 0.000 0.004 0.888 0.104 0.004 0.000
#> GSM447411 1 0.1391 0.4166 0.944 0.000 0.000 0.000 0.016 0.040
#> GSM447413 3 0.2196 0.8064 0.000 0.004 0.884 0.108 0.004 0.000
#> GSM447415 1 0.5144 0.2324 0.536 0.000 0.000 0.000 0.092 0.372
#> GSM447416 3 0.1180 0.8143 0.000 0.004 0.960 0.024 0.008 0.004
#> GSM447425 4 0.3721 0.7222 0.000 0.004 0.016 0.728 0.252 0.000
#> GSM447430 4 0.0458 0.8236 0.000 0.000 0.016 0.984 0.000 0.000
#> GSM447435 1 0.1983 0.4348 0.908 0.000 0.000 0.000 0.020 0.072
#> GSM447440 1 0.2230 0.4364 0.892 0.000 0.000 0.000 0.024 0.084
#> GSM447444 1 0.5252 0.0200 0.624 0.008 0.000 0.000 0.236 0.132
#> GSM447448 1 0.3523 0.1089 0.780 0.000 0.000 0.000 0.180 0.040
#> GSM447449 2 0.3151 0.7495 0.000 0.832 0.028 0.132 0.004 0.004
#> GSM447450 1 0.2112 0.4365 0.896 0.000 0.000 0.000 0.016 0.088
#> GSM447452 4 0.1801 0.8216 0.000 0.004 0.016 0.924 0.056 0.000
#> GSM447458 2 0.3262 0.7509 0.000 0.828 0.028 0.132 0.008 0.004
#> GSM447461 2 0.5419 0.6857 0.000 0.684 0.024 0.052 0.188 0.052
#> GSM447464 1 0.3961 0.0247 0.556 0.000 0.000 0.000 0.004 0.440
#> GSM447468 6 0.4958 0.2138 0.364 0.000 0.000 0.000 0.076 0.560
#> GSM447472 1 0.5642 0.1232 0.460 0.000 0.000 0.000 0.152 0.388
#> GSM447400 6 0.2489 0.6639 0.128 0.000 0.000 0.000 0.012 0.860
#> GSM447402 4 0.3946 0.7290 0.000 0.028 0.004 0.736 0.228 0.004
#> GSM447403 1 0.5379 0.2334 0.516 0.000 0.000 0.000 0.120 0.364
#> GSM447405 5 0.5227 0.7685 0.368 0.000 0.000 0.004 0.540 0.088
#> GSM447418 3 0.1794 0.8160 0.000 0.036 0.924 0.040 0.000 0.000
#> GSM447422 3 0.2129 0.8112 0.000 0.056 0.904 0.040 0.000 0.000
#> GSM447424 3 0.1219 0.8194 0.000 0.004 0.948 0.048 0.000 0.000
#> GSM447427 3 0.1096 0.8124 0.000 0.020 0.964 0.008 0.004 0.004
#> GSM447428 3 0.5342 0.4175 0.028 0.000 0.600 0.000 0.072 0.300
#> GSM447429 6 0.3279 0.6337 0.176 0.000 0.000 0.000 0.028 0.796
#> GSM447431 3 0.4594 0.6953 0.000 0.016 0.760 0.124 0.072 0.028
#> GSM447432 2 0.3331 0.7525 0.000 0.836 0.056 0.096 0.004 0.008
#> GSM447434 1 0.5355 0.0662 0.468 0.000 0.000 0.000 0.108 0.424
#> GSM447442 2 0.3244 0.7468 0.000 0.832 0.064 0.100 0.000 0.004
#> GSM447451 2 0.4956 0.6943 0.000 0.696 0.012 0.028 0.212 0.052
#> GSM447462 6 0.2783 0.6477 0.148 0.000 0.000 0.000 0.016 0.836
#> GSM447463 1 0.2094 0.4031 0.900 0.000 0.000 0.000 0.020 0.080
#> GSM447467 2 0.3578 0.7076 0.008 0.812 0.000 0.000 0.092 0.088
#> GSM447469 4 0.3397 0.8010 0.000 0.016 0.048 0.836 0.096 0.004
#> GSM447473 1 0.5379 0.2334 0.516 0.000 0.000 0.000 0.120 0.364
#> GSM447404 1 0.5294 0.2407 0.532 0.000 0.000 0.000 0.112 0.356
#> GSM447406 4 0.0458 0.8236 0.000 0.000 0.016 0.984 0.000 0.000
#> GSM447407 4 0.1528 0.8230 0.000 0.000 0.016 0.936 0.048 0.000
#> GSM447409 1 0.3412 0.2712 0.808 0.000 0.000 0.000 0.128 0.064
#> GSM447412 3 0.0924 0.8085 0.000 0.008 0.972 0.004 0.008 0.008
#> GSM447426 3 0.2149 0.8091 0.000 0.004 0.888 0.104 0.004 0.000
#> GSM447433 5 0.4098 0.7271 0.496 0.000 0.000 0.000 0.496 0.008
#> GSM447439 4 0.0458 0.8236 0.000 0.000 0.016 0.984 0.000 0.000
#> GSM447441 2 0.6407 0.6757 0.000 0.608 0.136 0.040 0.168 0.048
#> GSM447443 6 0.4495 0.5098 0.256 0.000 0.000 0.000 0.072 0.672
#> GSM447445 1 0.1829 0.3506 0.920 0.000 0.000 0.000 0.056 0.024
#> GSM447446 5 0.4689 0.8367 0.440 0.000 0.000 0.000 0.516 0.044
#> GSM447453 1 0.2948 0.0992 0.804 0.000 0.000 0.000 0.188 0.008
#> GSM447455 2 0.3416 0.7436 0.000 0.804 0.056 0.140 0.000 0.000
#> GSM447456 1 0.8193 -0.2717 0.328 0.292 0.000 0.108 0.208 0.064
#> GSM447459 4 0.0458 0.8236 0.000 0.000 0.016 0.984 0.000 0.000
#> GSM447466 1 0.1663 0.4405 0.912 0.000 0.000 0.000 0.000 0.088
#> GSM447470 1 0.3865 0.2866 0.752 0.000 0.000 0.000 0.056 0.192
#> GSM447474 6 0.4972 0.2263 0.392 0.000 0.000 0.000 0.072 0.536
#> GSM447475 2 0.4342 0.7174 0.000 0.760 0.028 0.008 0.160 0.044
#> GSM447398 2 0.6531 0.5231 0.004 0.536 0.008 0.176 0.236 0.040
#> GSM447399 4 0.5164 0.2597 0.000 0.036 0.352 0.580 0.028 0.004
#> GSM447408 4 0.3358 0.7503 0.000 0.120 0.024 0.832 0.016 0.008
#> GSM447410 4 0.4359 0.7134 0.000 0.132 0.024 0.768 0.068 0.008
#> GSM447414 3 0.2426 0.8070 0.000 0.012 0.884 0.092 0.012 0.000
#> GSM447417 4 0.2499 0.8097 0.000 0.016 0.004 0.880 0.096 0.004
#> GSM447419 6 0.5014 0.5554 0.148 0.000 0.024 0.000 0.136 0.692
#> GSM447420 6 0.5593 0.2539 0.044 0.000 0.300 0.000 0.072 0.584
#> GSM447421 6 0.2346 0.6640 0.124 0.000 0.000 0.000 0.008 0.868
#> GSM447423 3 0.1109 0.7994 0.000 0.012 0.964 0.004 0.016 0.004
#> GSM447436 5 0.4957 0.8400 0.412 0.000 0.000 0.000 0.520 0.068
#> GSM447437 1 0.1341 0.3950 0.948 0.000 0.000 0.000 0.024 0.028
#> GSM447438 4 0.4753 0.6840 0.000 0.132 0.008 0.724 0.124 0.012
#> GSM447447 1 0.4026 -0.4786 0.636 0.000 0.000 0.000 0.348 0.016
#> GSM447454 3 0.5120 0.4687 0.000 0.252 0.660 0.008 0.044 0.036
#> GSM447457 3 0.5144 -0.0591 0.000 0.452 0.488 0.004 0.044 0.012
#> GSM447460 2 0.5988 0.3763 0.000 0.536 0.292 0.144 0.028 0.000
#> GSM447465 3 0.4933 0.4512 0.000 0.300 0.616 0.080 0.004 0.000
#> GSM447471 1 0.5379 0.2334 0.516 0.000 0.000 0.000 0.120 0.364
#> GSM447476 4 0.5491 0.6672 0.000 0.136 0.012 0.616 0.232 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 gender(p) agent(p) k
#> MAD:skmeans 78 0.821 0.497 2
#> MAD:skmeans 74 0.325 0.260 3
#> MAD:skmeans 75 0.370 0.478 4
#> MAD:skmeans 66 0.657 0.102 5
#> MAD:skmeans 47 0.370 0.629 6
If matrix rows can be associated to genes, consider to use functional_enrichment(res,
...)
to perform function enrichment for the signature genes. See this vignette for more detailed explanations.
The object with results only for a single top-value method and a single partition method can be extracted as:
res = res_list["MAD", "pam"]
# you can also extract it by
# res = res_list["MAD:pam"]
A summary of res
and all the functions that can be applied to it:
res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#> On a matrix with 51941 rows and 79 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'MAD' method.
#> Subgroups are detected by 'pam' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 2.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
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.554 0.893 0.937 0.4624 0.553 0.553
#> 3 3 0.576 0.818 0.893 0.4180 0.790 0.621
#> 4 4 0.769 0.805 0.905 0.1225 0.896 0.706
#> 5 5 0.743 0.715 0.817 0.0425 0.975 0.909
#> 6 6 0.747 0.745 0.858 0.0474 0.928 0.723
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
#> GSM447401 2 0.0000 0.903 0.000 1.000
#> GSM447411 1 0.0000 0.992 1.000 0.000
#> GSM447413 2 0.0000 0.903 0.000 1.000
#> GSM447415 1 0.0000 0.992 1.000 0.000
#> GSM447416 2 0.0000 0.903 0.000 1.000
#> GSM447425 2 0.5737 0.858 0.136 0.864
#> GSM447430 2 0.0000 0.903 0.000 1.000
#> GSM447435 1 0.0000 0.992 1.000 0.000
#> GSM447440 2 0.9209 0.646 0.336 0.664
#> GSM447444 2 0.7139 0.810 0.196 0.804
#> GSM447448 2 0.9209 0.646 0.336 0.664
#> GSM447449 2 0.0000 0.903 0.000 1.000
#> GSM447450 1 0.0000 0.992 1.000 0.000
#> GSM447452 2 0.0000 0.903 0.000 1.000
#> GSM447458 2 0.5737 0.858 0.136 0.864
#> GSM447461 2 0.5737 0.858 0.136 0.864
#> GSM447464 1 0.0000 0.992 1.000 0.000
#> GSM447468 1 0.0000 0.992 1.000 0.000
#> GSM447472 1 0.0000 0.992 1.000 0.000
#> GSM447400 1 0.0000 0.992 1.000 0.000
#> GSM447402 2 0.0000 0.903 0.000 1.000
#> GSM447403 1 0.0000 0.992 1.000 0.000
#> GSM447405 2 0.9209 0.646 0.336 0.664
#> GSM447418 2 0.0000 0.903 0.000 1.000
#> GSM447422 2 0.0000 0.903 0.000 1.000
#> GSM447424 2 0.0000 0.903 0.000 1.000
#> GSM447427 2 0.0000 0.903 0.000 1.000
#> GSM447428 2 0.1843 0.893 0.028 0.972
#> GSM447429 1 0.0000 0.992 1.000 0.000
#> GSM447431 2 0.0000 0.903 0.000 1.000
#> GSM447432 2 0.0000 0.903 0.000 1.000
#> GSM447434 1 0.5946 0.796 0.856 0.144
#> GSM447442 2 0.0000 0.903 0.000 1.000
#> GSM447451 2 0.5737 0.858 0.136 0.864
#> GSM447462 2 0.9209 0.646 0.336 0.664
#> GSM447463 1 0.0000 0.992 1.000 0.000
#> GSM447467 2 0.5737 0.858 0.136 0.864
#> GSM447469 2 0.0000 0.903 0.000 1.000
#> GSM447473 1 0.0000 0.992 1.000 0.000
#> GSM447404 1 0.0000 0.992 1.000 0.000
#> GSM447406 2 0.0000 0.903 0.000 1.000
#> GSM447407 2 0.0000 0.903 0.000 1.000
#> GSM447409 1 0.0000 0.992 1.000 0.000
#> GSM447412 2 0.0000 0.903 0.000 1.000
#> GSM447426 2 0.0000 0.903 0.000 1.000
#> GSM447433 1 0.0000 0.992 1.000 0.000
#> GSM447439 2 0.0376 0.902 0.004 0.996
#> GSM447441 2 0.0000 0.903 0.000 1.000
#> GSM447443 1 0.0000 0.992 1.000 0.000
#> GSM447445 1 0.0000 0.992 1.000 0.000
#> GSM447446 1 0.0000 0.992 1.000 0.000
#> GSM447453 1 0.0000 0.992 1.000 0.000
#> GSM447455 2 0.0000 0.903 0.000 1.000
#> GSM447456 2 0.9087 0.662 0.324 0.676
#> GSM447459 2 0.0000 0.903 0.000 1.000
#> GSM447466 1 0.0000 0.992 1.000 0.000
#> GSM447470 2 0.9209 0.646 0.336 0.664
#> GSM447474 2 0.9209 0.646 0.336 0.664
#> GSM447475 2 0.5737 0.858 0.136 0.864
#> GSM447398 2 0.5737 0.858 0.136 0.864
#> GSM447399 2 0.0000 0.903 0.000 1.000
#> GSM447408 2 0.0000 0.903 0.000 1.000
#> GSM447410 2 0.5737 0.858 0.136 0.864
#> GSM447414 2 0.0000 0.903 0.000 1.000
#> GSM447417 2 0.3733 0.882 0.072 0.928
#> GSM447419 1 0.1633 0.966 0.976 0.024
#> GSM447420 2 0.9209 0.646 0.336 0.664
#> GSM447421 1 0.0000 0.992 1.000 0.000
#> GSM447423 2 0.0000 0.903 0.000 1.000
#> GSM447436 1 0.0000 0.992 1.000 0.000
#> GSM447437 1 0.0000 0.992 1.000 0.000
#> GSM447438 2 0.5737 0.858 0.136 0.864
#> GSM447447 2 0.9209 0.646 0.336 0.664
#> GSM447454 2 0.5629 0.860 0.132 0.868
#> GSM447457 2 0.0000 0.903 0.000 1.000
#> GSM447460 2 0.0000 0.903 0.000 1.000
#> GSM447465 2 0.0000 0.903 0.000 1.000
#> GSM447471 1 0.0000 0.992 1.000 0.000
#> GSM447476 2 0.5737 0.858 0.136 0.864
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM447401 3 0.0000 0.908 0.000 0.000 1.000
#> GSM447411 1 0.0000 0.963 1.000 0.000 0.000
#> GSM447413 3 0.0000 0.908 0.000 0.000 1.000
#> GSM447415 1 0.0000 0.963 1.000 0.000 0.000
#> GSM447416 3 0.2165 0.870 0.000 0.064 0.936
#> GSM447425 2 0.5987 0.693 0.036 0.756 0.208
#> GSM447430 2 0.5431 0.571 0.000 0.716 0.284
#> GSM447435 1 0.0000 0.963 1.000 0.000 0.000
#> GSM447440 2 0.5785 0.645 0.332 0.668 0.000
#> GSM447444 2 0.3686 0.820 0.140 0.860 0.000
#> GSM447448 2 0.5650 0.670 0.312 0.688 0.000
#> GSM447449 3 0.3482 0.813 0.000 0.128 0.872
#> GSM447450 1 0.0000 0.963 1.000 0.000 0.000
#> GSM447452 3 0.3686 0.827 0.000 0.140 0.860
#> GSM447458 2 0.5787 0.808 0.136 0.796 0.068
#> GSM447461 2 0.3619 0.821 0.136 0.864 0.000
#> GSM447464 1 0.0000 0.963 1.000 0.000 0.000
#> GSM447468 1 0.0000 0.963 1.000 0.000 0.000
#> GSM447472 1 0.1031 0.941 0.976 0.024 0.000
#> GSM447400 1 0.0000 0.963 1.000 0.000 0.000
#> GSM447402 3 0.6260 0.385 0.000 0.448 0.552
#> GSM447403 1 0.0000 0.963 1.000 0.000 0.000
#> GSM447405 2 0.3686 0.820 0.140 0.860 0.000
#> GSM447418 3 0.0000 0.908 0.000 0.000 1.000
#> GSM447422 3 0.0000 0.908 0.000 0.000 1.000
#> GSM447424 3 0.0000 0.908 0.000 0.000 1.000
#> GSM447427 3 0.0000 0.908 0.000 0.000 1.000
#> GSM447428 3 0.4605 0.733 0.000 0.204 0.796
#> GSM447429 1 0.0000 0.963 1.000 0.000 0.000
#> GSM447431 2 0.4178 0.747 0.000 0.828 0.172
#> GSM447432 2 0.5621 0.623 0.000 0.692 0.308
#> GSM447434 1 0.5810 0.456 0.664 0.336 0.000
#> GSM447442 3 0.0000 0.908 0.000 0.000 1.000
#> GSM447451 2 0.3851 0.820 0.136 0.860 0.004
#> GSM447462 2 0.5835 0.633 0.340 0.660 0.000
#> GSM447463 1 0.0000 0.963 1.000 0.000 0.000
#> GSM447467 2 0.3851 0.820 0.136 0.860 0.004
#> GSM447469 3 0.3551 0.833 0.000 0.132 0.868
#> GSM447473 1 0.0000 0.963 1.000 0.000 0.000
#> GSM447404 1 0.0000 0.963 1.000 0.000 0.000
#> GSM447406 2 0.5733 0.500 0.000 0.676 0.324
#> GSM447407 2 0.6126 0.316 0.000 0.600 0.400
#> GSM447409 1 0.0000 0.963 1.000 0.000 0.000
#> GSM447412 2 0.3686 0.765 0.000 0.860 0.140
#> GSM447426 3 0.0000 0.908 0.000 0.000 1.000
#> GSM447433 1 0.3482 0.824 0.872 0.128 0.000
#> GSM447439 2 0.4555 0.678 0.000 0.800 0.200
#> GSM447441 2 0.0000 0.793 0.000 1.000 0.000
#> GSM447443 1 0.0000 0.963 1.000 0.000 0.000
#> GSM447445 1 0.0000 0.963 1.000 0.000 0.000
#> GSM447446 1 0.0000 0.963 1.000 0.000 0.000
#> GSM447453 1 0.0000 0.963 1.000 0.000 0.000
#> GSM447455 2 0.6154 0.513 0.000 0.592 0.408
#> GSM447456 2 0.3686 0.820 0.140 0.860 0.000
#> GSM447459 2 0.4605 0.673 0.000 0.796 0.204
#> GSM447466 1 0.0000 0.963 1.000 0.000 0.000
#> GSM447470 2 0.3686 0.820 0.140 0.860 0.000
#> GSM447474 2 0.3686 0.820 0.140 0.860 0.000
#> GSM447475 2 0.3851 0.820 0.136 0.860 0.004
#> GSM447398 2 0.1411 0.806 0.036 0.964 0.000
#> GSM447399 3 0.0000 0.908 0.000 0.000 1.000
#> GSM447408 2 0.0000 0.793 0.000 1.000 0.000
#> GSM447410 2 0.0000 0.793 0.000 1.000 0.000
#> GSM447414 3 0.0000 0.908 0.000 0.000 1.000
#> GSM447417 3 0.4121 0.807 0.000 0.168 0.832
#> GSM447419 1 0.7801 0.439 0.616 0.076 0.308
#> GSM447420 2 0.3851 0.820 0.136 0.860 0.004
#> GSM447421 1 0.0237 0.959 0.996 0.000 0.004
#> GSM447423 3 0.4605 0.733 0.000 0.204 0.796
#> GSM447436 1 0.0000 0.963 1.000 0.000 0.000
#> GSM447437 1 0.0000 0.963 1.000 0.000 0.000
#> GSM447438 2 0.0000 0.793 0.000 1.000 0.000
#> GSM447447 2 0.4002 0.812 0.160 0.840 0.000
#> GSM447454 2 0.3965 0.820 0.132 0.860 0.008
#> GSM447457 2 0.3686 0.765 0.000 0.860 0.140
#> GSM447460 2 0.5859 0.619 0.000 0.656 0.344
#> GSM447465 3 0.0747 0.900 0.000 0.016 0.984
#> GSM447471 1 0.0000 0.963 1.000 0.000 0.000
#> GSM447476 2 0.0000 0.793 0.000 1.000 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM447401 3 0.4804 0.5779 0.000 0.000 0.616 0.384
#> GSM447411 1 0.0000 0.9432 1.000 0.000 0.000 0.000
#> GSM447413 3 0.2814 0.8485 0.000 0.000 0.868 0.132
#> GSM447415 1 0.0000 0.9432 1.000 0.000 0.000 0.000
#> GSM447416 3 0.3803 0.8389 0.000 0.032 0.836 0.132
#> GSM447425 4 0.3219 0.7174 0.000 0.000 0.164 0.836
#> GSM447430 4 0.1557 0.7544 0.000 0.000 0.056 0.944
#> GSM447435 1 0.0000 0.9432 1.000 0.000 0.000 0.000
#> GSM447440 2 0.3528 0.7332 0.192 0.808 0.000 0.000
#> GSM447444 2 0.0000 0.9030 0.000 1.000 0.000 0.000
#> GSM447448 2 0.3311 0.7551 0.172 0.828 0.000 0.000
#> GSM447449 3 0.0188 0.8664 0.000 0.004 0.996 0.000
#> GSM447450 1 0.0000 0.9432 1.000 0.000 0.000 0.000
#> GSM447452 4 0.0000 0.7378 0.000 0.000 0.000 1.000
#> GSM447458 2 0.3569 0.7462 0.000 0.804 0.196 0.000
#> GSM447461 2 0.0000 0.9030 0.000 1.000 0.000 0.000
#> GSM447464 1 0.0000 0.9432 1.000 0.000 0.000 0.000
#> GSM447468 1 0.0000 0.9432 1.000 0.000 0.000 0.000
#> GSM447472 1 0.0817 0.9199 0.976 0.024 0.000 0.000
#> GSM447400 1 0.0000 0.9432 1.000 0.000 0.000 0.000
#> GSM447402 4 0.5268 0.4905 0.000 0.012 0.396 0.592
#> GSM447403 1 0.0000 0.9432 1.000 0.000 0.000 0.000
#> GSM447405 2 0.0000 0.9030 0.000 1.000 0.000 0.000
#> GSM447418 3 0.0000 0.8678 0.000 0.000 1.000 0.000
#> GSM447422 3 0.0000 0.8678 0.000 0.000 1.000 0.000
#> GSM447424 3 0.2814 0.8485 0.000 0.000 0.868 0.132
#> GSM447427 3 0.0000 0.8678 0.000 0.000 1.000 0.000
#> GSM447428 3 0.3610 0.7139 0.000 0.200 0.800 0.000
#> GSM447429 1 0.0000 0.9432 1.000 0.000 0.000 0.000
#> GSM447431 2 0.6439 0.5384 0.000 0.648 0.172 0.180
#> GSM447432 2 0.4431 0.6153 0.000 0.696 0.304 0.000
#> GSM447434 1 0.4605 0.4973 0.664 0.336 0.000 0.000
#> GSM447442 3 0.0000 0.8678 0.000 0.000 1.000 0.000
#> GSM447451 2 0.0000 0.9030 0.000 1.000 0.000 0.000
#> GSM447462 2 0.3649 0.7186 0.204 0.796 0.000 0.000
#> GSM447463 1 0.0000 0.9432 1.000 0.000 0.000 0.000
#> GSM447467 2 0.0000 0.9030 0.000 1.000 0.000 0.000
#> GSM447469 4 0.4999 0.3019 0.000 0.000 0.492 0.508
#> GSM447473 1 0.0000 0.9432 1.000 0.000 0.000 0.000
#> GSM447404 1 0.0000 0.9432 1.000 0.000 0.000 0.000
#> GSM447406 4 0.1118 0.7534 0.000 0.000 0.036 0.964
#> GSM447407 4 0.1118 0.7534 0.000 0.000 0.036 0.964
#> GSM447409 1 0.0000 0.9432 1.000 0.000 0.000 0.000
#> GSM447412 2 0.0000 0.9030 0.000 1.000 0.000 0.000
#> GSM447426 3 0.3569 0.8185 0.000 0.000 0.804 0.196
#> GSM447433 1 0.6953 0.2082 0.536 0.128 0.000 0.336
#> GSM447439 4 0.1389 0.7549 0.000 0.000 0.048 0.952
#> GSM447441 2 0.0000 0.9030 0.000 1.000 0.000 0.000
#> GSM447443 1 0.0000 0.9432 1.000 0.000 0.000 0.000
#> GSM447445 1 0.0000 0.9432 1.000 0.000 0.000 0.000
#> GSM447446 1 0.0000 0.9432 1.000 0.000 0.000 0.000
#> GSM447453 1 0.0000 0.9432 1.000 0.000 0.000 0.000
#> GSM447455 2 0.4193 0.6674 0.000 0.732 0.268 0.000
#> GSM447456 2 0.0000 0.9030 0.000 1.000 0.000 0.000
#> GSM447459 4 0.1118 0.7534 0.000 0.000 0.036 0.964
#> GSM447466 1 0.0000 0.9432 1.000 0.000 0.000 0.000
#> GSM447470 2 0.0000 0.9030 0.000 1.000 0.000 0.000
#> GSM447474 2 0.0000 0.9030 0.000 1.000 0.000 0.000
#> GSM447475 2 0.0000 0.9030 0.000 1.000 0.000 0.000
#> GSM447398 2 0.0000 0.9030 0.000 1.000 0.000 0.000
#> GSM447399 3 0.0000 0.8678 0.000 0.000 1.000 0.000
#> GSM447408 4 0.4916 0.4255 0.000 0.424 0.000 0.576
#> GSM447410 4 0.4916 0.4255 0.000 0.424 0.000 0.576
#> GSM447414 3 0.2814 0.8485 0.000 0.000 0.868 0.132
#> GSM447417 4 0.3266 0.7170 0.000 0.000 0.168 0.832
#> GSM447419 1 0.6537 0.0725 0.500 0.076 0.424 0.000
#> GSM447420 2 0.0000 0.9030 0.000 1.000 0.000 0.000
#> GSM447421 1 0.0000 0.9432 1.000 0.000 0.000 0.000
#> GSM447423 3 0.3266 0.7551 0.000 0.168 0.832 0.000
#> GSM447436 1 0.0000 0.9432 1.000 0.000 0.000 0.000
#> GSM447437 1 0.0000 0.9432 1.000 0.000 0.000 0.000
#> GSM447438 2 0.0000 0.9030 0.000 1.000 0.000 0.000
#> GSM447447 2 0.0707 0.8904 0.020 0.980 0.000 0.000
#> GSM447454 2 0.0000 0.9030 0.000 1.000 0.000 0.000
#> GSM447457 2 0.0000 0.9030 0.000 1.000 0.000 0.000
#> GSM447460 2 0.4491 0.7412 0.000 0.800 0.060 0.140
#> GSM447465 3 0.1520 0.8598 0.000 0.024 0.956 0.020
#> GSM447471 1 0.0000 0.9432 1.000 0.000 0.000 0.000
#> GSM447476 4 0.4916 0.4255 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
#> GSM447401 5 0.5182 0.9903 0.000 0.000 0.412 0.044 0.544
#> GSM447411 1 0.0000 0.7030 1.000 0.000 0.000 0.000 0.000
#> GSM447413 3 0.0794 0.7024 0.000 0.000 0.972 0.028 0.000
#> GSM447415 1 0.0000 0.7030 1.000 0.000 0.000 0.000 0.000
#> GSM447416 3 0.0880 0.6981 0.000 0.000 0.968 0.032 0.000
#> GSM447425 4 0.0794 0.6925 0.000 0.000 0.028 0.972 0.000
#> GSM447430 4 0.0000 0.6988 0.000 0.000 0.000 1.000 0.000
#> GSM447435 1 0.0000 0.7030 1.000 0.000 0.000 0.000 0.000
#> GSM447440 1 0.4161 0.0699 0.608 0.392 0.000 0.000 0.000
#> GSM447444 2 0.1043 0.8960 0.000 0.960 0.000 0.000 0.040
#> GSM447448 2 0.2852 0.7567 0.172 0.828 0.000 0.000 0.000
#> GSM447449 3 0.2561 0.7601 0.000 0.000 0.856 0.144 0.000
#> GSM447450 1 0.1205 0.6851 0.956 0.004 0.000 0.000 0.040
#> GSM447452 4 0.4088 0.4013 0.000 0.000 0.000 0.632 0.368
#> GSM447458 2 0.3846 0.7533 0.000 0.800 0.056 0.144 0.000
#> GSM447461 2 0.0162 0.9067 0.000 0.996 0.000 0.004 0.000
#> GSM447464 1 0.0290 0.7048 0.992 0.000 0.000 0.000 0.008
#> GSM447468 1 0.3452 0.7223 0.756 0.000 0.000 0.000 0.244
#> GSM447472 1 0.0703 0.6913 0.976 0.024 0.000 0.000 0.000
#> GSM447400 1 0.4219 0.7199 0.584 0.000 0.000 0.000 0.416
#> GSM447402 4 0.3333 0.5542 0.000 0.004 0.208 0.788 0.000
#> GSM447403 1 0.4219 0.7199 0.584 0.000 0.000 0.000 0.416
#> GSM447405 2 0.0162 0.9059 0.004 0.996 0.000 0.000 0.000
#> GSM447418 3 0.2561 0.7601 0.000 0.000 0.856 0.144 0.000
#> GSM447422 3 0.2561 0.7601 0.000 0.000 0.856 0.144 0.000
#> GSM447424 3 0.0794 0.7024 0.000 0.000 0.972 0.028 0.000
#> GSM447427 3 0.2561 0.7601 0.000 0.000 0.856 0.144 0.000
#> GSM447428 3 0.3109 0.4792 0.000 0.200 0.800 0.000 0.000
#> GSM447429 1 0.4219 0.7199 0.584 0.000 0.000 0.000 0.416
#> GSM447431 2 0.5043 0.6357 0.000 0.704 0.136 0.160 0.000
#> GSM447432 2 0.5159 0.6163 0.000 0.692 0.164 0.144 0.000
#> GSM447434 1 0.5420 0.3302 0.592 0.332 0.000 0.000 0.076
#> GSM447442 3 0.2561 0.7601 0.000 0.000 0.856 0.144 0.000
#> GSM447451 2 0.0162 0.9067 0.000 0.996 0.000 0.004 0.000
#> GSM447462 2 0.3764 0.7435 0.156 0.800 0.000 0.000 0.044
#> GSM447463 1 0.0000 0.7030 1.000 0.000 0.000 0.000 0.000
#> GSM447467 2 0.0000 0.9066 0.000 1.000 0.000 0.000 0.000
#> GSM447469 4 0.3983 0.3393 0.000 0.000 0.340 0.660 0.000
#> GSM447473 1 0.4219 0.7199 0.584 0.000 0.000 0.000 0.416
#> GSM447404 1 0.4219 0.7199 0.584 0.000 0.000 0.000 0.416
#> GSM447406 4 0.2561 0.6808 0.000 0.000 0.144 0.856 0.000
#> GSM447407 4 0.2561 0.6808 0.000 0.000 0.144 0.856 0.000
#> GSM447409 1 0.4219 0.7199 0.584 0.000 0.000 0.000 0.416
#> GSM447412 2 0.0162 0.9062 0.000 0.996 0.004 0.000 0.000
#> GSM447426 5 0.5125 0.9902 0.000 0.000 0.416 0.040 0.544
#> GSM447433 1 0.3858 0.5796 0.832 0.092 0.000 0.036 0.040
#> GSM447439 4 0.1544 0.7016 0.000 0.000 0.068 0.932 0.000
#> GSM447441 2 0.0162 0.9067 0.000 0.996 0.000 0.004 0.000
#> GSM447443 1 0.4430 0.6996 0.540 0.004 0.000 0.000 0.456
#> GSM447445 1 0.1205 0.6851 0.956 0.004 0.000 0.000 0.040
#> GSM447446 1 0.4219 0.7199 0.584 0.000 0.000 0.000 0.416
#> GSM447453 1 0.4420 0.7025 0.548 0.004 0.000 0.000 0.448
#> GSM447455 2 0.4761 0.6796 0.000 0.732 0.124 0.144 0.000
#> GSM447456 2 0.0000 0.9066 0.000 1.000 0.000 0.000 0.000
#> GSM447459 4 0.2561 0.6808 0.000 0.000 0.144 0.856 0.000
#> GSM447466 1 0.0000 0.7030 1.000 0.000 0.000 0.000 0.000
#> GSM447470 2 0.1043 0.8960 0.000 0.960 0.000 0.000 0.040
#> GSM447474 2 0.1043 0.8960 0.000 0.960 0.000 0.000 0.040
#> GSM447475 2 0.0000 0.9066 0.000 1.000 0.000 0.000 0.000
#> GSM447398 2 0.0162 0.9067 0.000 0.996 0.000 0.004 0.000
#> GSM447399 3 0.2424 0.7613 0.000 0.000 0.868 0.132 0.000
#> GSM447408 4 0.4088 0.5332 0.000 0.368 0.000 0.632 0.000
#> GSM447410 4 0.4088 0.5332 0.000 0.368 0.000 0.632 0.000
#> GSM447414 3 0.0794 0.7024 0.000 0.000 0.972 0.028 0.000
#> GSM447417 4 0.0794 0.6925 0.000 0.000 0.028 0.972 0.000
#> GSM447419 1 0.6071 0.0713 0.484 0.076 0.424 0.000 0.016
#> GSM447420 2 0.1043 0.8960 0.000 0.960 0.000 0.000 0.040
#> GSM447421 1 0.4219 0.7199 0.584 0.000 0.000 0.000 0.416
#> GSM447423 3 0.2852 0.5429 0.000 0.172 0.828 0.000 0.000
#> GSM447436 1 0.4219 0.7199 0.584 0.000 0.000 0.000 0.416
#> GSM447437 1 0.0000 0.7030 1.000 0.000 0.000 0.000 0.000
#> GSM447438 2 0.0162 0.9067 0.000 0.996 0.000 0.004 0.000
#> GSM447447 2 0.0703 0.8977 0.024 0.976 0.000 0.000 0.000
#> GSM447454 2 0.0162 0.9067 0.000 0.996 0.000 0.004 0.000
#> GSM447457 2 0.0162 0.9067 0.000 0.996 0.000 0.004 0.000
#> GSM447460 2 0.3695 0.7581 0.000 0.800 0.164 0.036 0.000
#> GSM447465 3 0.0703 0.7073 0.000 0.024 0.976 0.000 0.000
#> GSM447471 1 0.4219 0.7199 0.584 0.000 0.000 0.000 0.416
#> GSM447476 4 0.4088 0.5332 0.000 0.368 0.000 0.632 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM447401 5 0.0000 0.9054 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM447411 1 0.0713 0.8049 0.972 0.000 0.000 0.000 0.000 0.028
#> GSM447413 3 0.2597 0.7977 0.000 0.000 0.824 0.176 0.000 0.000
#> GSM447415 1 0.0713 0.8049 0.972 0.000 0.000 0.000 0.000 0.028
#> GSM447416 3 0.2597 0.7977 0.000 0.000 0.824 0.176 0.000 0.000
#> GSM447425 4 0.2597 0.6855 0.000 0.000 0.176 0.824 0.000 0.000
#> GSM447430 4 0.2597 0.6855 0.000 0.000 0.176 0.824 0.000 0.000
#> GSM447435 1 0.0713 0.8049 0.972 0.000 0.000 0.000 0.000 0.028
#> GSM447440 1 0.0865 0.7948 0.964 0.036 0.000 0.000 0.000 0.000
#> GSM447444 2 0.2793 0.7930 0.000 0.800 0.000 0.000 0.000 0.200
#> GSM447448 2 0.2562 0.7483 0.172 0.828 0.000 0.000 0.000 0.000
#> GSM447449 3 0.0000 0.8133 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM447450 1 0.2793 0.6467 0.800 0.000 0.000 0.000 0.000 0.200
#> GSM447452 5 0.2762 0.7858 0.000 0.000 0.000 0.196 0.804 0.000
#> GSM447458 2 0.2793 0.7609 0.000 0.800 0.200 0.000 0.000 0.000
#> GSM447461 2 0.0000 0.8780 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM447464 1 0.1610 0.7415 0.916 0.000 0.000 0.000 0.000 0.084
#> GSM447468 1 0.3823 -0.1546 0.564 0.000 0.000 0.000 0.000 0.436
#> GSM447472 1 0.1890 0.7867 0.916 0.024 0.000 0.000 0.000 0.060
#> GSM447400 6 0.2996 0.8988 0.228 0.000 0.000 0.000 0.000 0.772
#> GSM447402 4 0.3769 0.5895 0.000 0.004 0.356 0.640 0.000 0.000
#> GSM447403 6 0.2793 0.9201 0.200 0.000 0.000 0.000 0.000 0.800
#> GSM447405 2 0.0000 0.8780 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM447418 3 0.0000 0.8133 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM447422 3 0.0000 0.8133 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM447424 3 0.2597 0.7977 0.000 0.000 0.824 0.176 0.000 0.000
#> GSM447427 3 0.0000 0.8133 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM447428 3 0.2902 0.6911 0.000 0.196 0.800 0.000 0.000 0.004
#> GSM447429 6 0.2793 0.9201 0.200 0.000 0.000 0.000 0.000 0.800
#> GSM447431 2 0.4321 0.6372 0.000 0.712 0.204 0.084 0.000 0.000
#> GSM447432 2 0.3446 0.6399 0.000 0.692 0.308 0.000 0.000 0.000
#> GSM447434 1 0.6129 0.0915 0.344 0.336 0.000 0.000 0.000 0.320
#> GSM447442 3 0.0000 0.8133 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM447451 2 0.0000 0.8780 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM447462 2 0.3500 0.7688 0.028 0.768 0.000 0.000 0.000 0.204
#> GSM447463 1 0.0000 0.8021 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM447467 2 0.0000 0.8780 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM447469 4 0.3866 0.3777 0.000 0.000 0.484 0.516 0.000 0.000
#> GSM447473 6 0.2793 0.9201 0.200 0.000 0.000 0.000 0.000 0.800
#> GSM447404 6 0.2793 0.9201 0.200 0.000 0.000 0.000 0.000 0.800
#> GSM447406 4 0.0000 0.6546 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM447407 4 0.0000 0.6546 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM447409 6 0.2793 0.9201 0.200 0.000 0.000 0.000 0.000 0.800
#> GSM447412 2 0.0000 0.8780 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM447426 5 0.0000 0.9054 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM447433 1 0.3420 0.6503 0.748 0.000 0.000 0.012 0.000 0.240
#> GSM447439 4 0.1663 0.6859 0.000 0.000 0.088 0.912 0.000 0.000
#> GSM447441 2 0.0000 0.8780 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM447443 6 0.0000 0.6725 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM447445 1 0.2793 0.6467 0.800 0.000 0.000 0.000 0.000 0.200
#> GSM447446 6 0.2793 0.9201 0.200 0.000 0.000 0.000 0.000 0.800
#> GSM447453 6 0.2969 0.3701 0.224 0.000 0.000 0.000 0.000 0.776
#> GSM447455 2 0.3244 0.6952 0.000 0.732 0.268 0.000 0.000 0.000
#> GSM447456 2 0.0000 0.8780 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM447459 4 0.0000 0.6546 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM447466 1 0.0000 0.8021 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM447470 2 0.2793 0.7930 0.000 0.800 0.000 0.000 0.000 0.200
#> GSM447474 2 0.2793 0.7930 0.000 0.800 0.000 0.000 0.000 0.200
#> GSM447475 2 0.0000 0.8780 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM447398 2 0.0000 0.8780 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM447399 3 0.0547 0.8157 0.000 0.000 0.980 0.020 0.000 0.000
#> GSM447408 4 0.3684 0.5215 0.000 0.372 0.000 0.628 0.000 0.000
#> GSM447410 4 0.3684 0.5215 0.000 0.372 0.000 0.628 0.000 0.000
#> GSM447414 3 0.2597 0.7977 0.000 0.000 0.824 0.176 0.000 0.000
#> GSM447417 4 0.2597 0.6855 0.000 0.000 0.176 0.824 0.000 0.000
#> GSM447419 3 0.6621 -0.0757 0.124 0.076 0.424 0.000 0.000 0.376
#> GSM447420 2 0.2793 0.7930 0.000 0.800 0.000 0.000 0.000 0.200
#> GSM447421 6 0.2996 0.8988 0.228 0.000 0.000 0.000 0.000 0.772
#> GSM447423 3 0.2597 0.7177 0.000 0.176 0.824 0.000 0.000 0.000
#> GSM447436 6 0.2793 0.9201 0.200 0.000 0.000 0.000 0.000 0.800
#> GSM447437 1 0.0713 0.8049 0.972 0.000 0.000 0.000 0.000 0.028
#> GSM447438 2 0.0000 0.8780 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM447447 2 0.0547 0.8705 0.020 0.980 0.000 0.000 0.000 0.000
#> GSM447454 2 0.0000 0.8780 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM447457 2 0.0000 0.8780 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM447460 2 0.3104 0.7658 0.000 0.800 0.016 0.184 0.000 0.000
#> GSM447465 3 0.3202 0.7858 0.000 0.024 0.800 0.176 0.000 0.000
#> GSM447471 6 0.2793 0.9201 0.200 0.000 0.000 0.000 0.000 0.800
#> GSM447476 4 0.3684 0.5215 0.000 0.372 0.000 0.628 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 gender(p) agent(p) k
#> MAD:pam 79 1.000 0.4254 2
#> MAD:pam 75 0.176 0.1723 3
#> MAD:pam 71 0.465 0.0727 4
#> MAD:pam 73 0.413 0.1500 5
#> MAD:pam 74 0.199 0.0218 6
If matrix rows can be associated to genes, consider to use functional_enrichment(res,
...)
to perform function enrichment for the signature genes. See this vignette for more detailed explanations.
The object with results only for a single top-value method and a single partition method can be extracted as:
res = res_list["MAD", "mclust"]
# you can also extract it by
# res = res_list["MAD:mclust"]
A summary of res
and all the functions that can be applied to it:
res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#> On a matrix with 51941 rows and 79 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'MAD' method.
#> Subgroups are detected by 'mclust' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 2.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
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.966 0.986 0.4980 0.503 0.503
#> 3 3 0.746 0.766 0.889 0.2077 0.830 0.682
#> 4 4 0.807 0.833 0.889 0.1474 0.864 0.674
#> 5 5 0.630 0.592 0.782 0.1118 0.930 0.770
#> 6 6 0.738 0.781 0.863 0.0558 0.812 0.380
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
#> GSM447401 2 0.0000 0.980 0.000 1.000
#> GSM447411 1 0.0000 0.991 1.000 0.000
#> GSM447413 2 0.0000 0.980 0.000 1.000
#> GSM447415 1 0.0000 0.991 1.000 0.000
#> GSM447416 2 0.0000 0.980 0.000 1.000
#> GSM447425 2 0.0000 0.980 0.000 1.000
#> GSM447430 2 0.0000 0.980 0.000 1.000
#> GSM447435 1 0.0000 0.991 1.000 0.000
#> GSM447440 1 0.0000 0.991 1.000 0.000
#> GSM447444 1 0.0000 0.991 1.000 0.000
#> GSM447448 1 0.0000 0.991 1.000 0.000
#> GSM447449 2 0.0000 0.980 0.000 1.000
#> GSM447450 1 0.0000 0.991 1.000 0.000
#> GSM447452 2 0.0000 0.980 0.000 1.000
#> GSM447458 2 0.0376 0.979 0.004 0.996
#> GSM447461 2 0.0376 0.979 0.004 0.996
#> GSM447464 1 0.0000 0.991 1.000 0.000
#> GSM447468 1 0.0000 0.991 1.000 0.000
#> GSM447472 1 0.0000 0.991 1.000 0.000
#> GSM447400 1 0.0000 0.991 1.000 0.000
#> GSM447402 2 0.0376 0.979 0.004 0.996
#> GSM447403 1 0.0000 0.991 1.000 0.000
#> GSM447405 1 0.0938 0.979 0.988 0.012
#> GSM447418 2 0.0000 0.980 0.000 1.000
#> GSM447422 2 0.0000 0.980 0.000 1.000
#> GSM447424 2 0.0000 0.980 0.000 1.000
#> GSM447427 2 0.0000 0.980 0.000 1.000
#> GSM447428 2 0.6801 0.783 0.180 0.820
#> GSM447429 1 0.0000 0.991 1.000 0.000
#> GSM447431 2 0.0000 0.980 0.000 1.000
#> GSM447432 2 0.0376 0.979 0.004 0.996
#> GSM447434 1 0.0000 0.991 1.000 0.000
#> GSM447442 2 0.0000 0.980 0.000 1.000
#> GSM447451 2 0.0376 0.979 0.004 0.996
#> GSM447462 1 0.0000 0.991 1.000 0.000
#> GSM447463 1 0.0000 0.991 1.000 0.000
#> GSM447467 2 0.0938 0.973 0.012 0.988
#> GSM447469 2 0.0000 0.980 0.000 1.000
#> GSM447473 1 0.0000 0.991 1.000 0.000
#> GSM447404 1 0.0000 0.991 1.000 0.000
#> GSM447406 2 0.0000 0.980 0.000 1.000
#> GSM447407 2 0.0000 0.980 0.000 1.000
#> GSM447409 1 0.0000 0.991 1.000 0.000
#> GSM447412 2 0.0376 0.979 0.004 0.996
#> GSM447426 2 0.0000 0.980 0.000 1.000
#> GSM447433 1 0.0000 0.991 1.000 0.000
#> GSM447439 2 0.0000 0.980 0.000 1.000
#> GSM447441 2 0.0000 0.980 0.000 1.000
#> GSM447443 1 0.0000 0.991 1.000 0.000
#> GSM447445 1 0.0000 0.991 1.000 0.000
#> GSM447446 1 0.0000 0.991 1.000 0.000
#> GSM447453 1 0.0000 0.991 1.000 0.000
#> GSM447455 2 0.0000 0.980 0.000 1.000
#> GSM447456 2 0.7219 0.755 0.200 0.800
#> GSM447459 2 0.0000 0.980 0.000 1.000
#> GSM447466 1 0.0000 0.991 1.000 0.000
#> GSM447470 1 0.0000 0.991 1.000 0.000
#> GSM447474 1 0.0000 0.991 1.000 0.000
#> GSM447475 2 0.0938 0.973 0.012 0.988
#> GSM447398 2 0.0376 0.979 0.004 0.996
#> GSM447399 2 0.0000 0.980 0.000 1.000
#> GSM447408 2 0.0000 0.980 0.000 1.000
#> GSM447410 2 0.0376 0.979 0.004 0.996
#> GSM447414 2 0.0000 0.980 0.000 1.000
#> GSM447417 2 0.0000 0.980 0.000 1.000
#> GSM447419 1 0.8443 0.610 0.728 0.272
#> GSM447420 2 0.9686 0.359 0.396 0.604
#> GSM447421 1 0.0000 0.991 1.000 0.000
#> GSM447423 2 0.0376 0.979 0.004 0.996
#> GSM447436 1 0.0000 0.991 1.000 0.000
#> GSM447437 1 0.0000 0.991 1.000 0.000
#> GSM447438 2 0.0376 0.979 0.004 0.996
#> GSM447447 1 0.0000 0.991 1.000 0.000
#> GSM447454 2 0.0376 0.979 0.004 0.996
#> GSM447457 2 0.0376 0.979 0.004 0.996
#> GSM447460 2 0.0000 0.980 0.000 1.000
#> GSM447465 2 0.0000 0.980 0.000 1.000
#> GSM447471 1 0.0000 0.991 1.000 0.000
#> GSM447476 2 0.0672 0.976 0.008 0.992
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM447401 3 0.5465 0.591 0.000 0.288 0.712
#> GSM447411 1 0.0000 0.959 1.000 0.000 0.000
#> GSM447413 2 0.6225 -0.555 0.000 0.568 0.432
#> GSM447415 1 0.0000 0.959 1.000 0.000 0.000
#> GSM447416 3 0.6225 0.866 0.000 0.432 0.568
#> GSM447425 2 0.6095 0.404 0.000 0.608 0.392
#> GSM447430 2 0.3192 0.767 0.000 0.888 0.112
#> GSM447435 1 0.0000 0.959 1.000 0.000 0.000
#> GSM447440 1 0.0000 0.959 1.000 0.000 0.000
#> GSM447444 1 0.0000 0.959 1.000 0.000 0.000
#> GSM447448 1 0.0000 0.959 1.000 0.000 0.000
#> GSM447449 2 0.1129 0.768 0.004 0.976 0.020
#> GSM447450 1 0.0237 0.956 0.996 0.004 0.000
#> GSM447452 2 0.6095 0.404 0.000 0.608 0.392
#> GSM447458 2 0.1267 0.777 0.004 0.972 0.024
#> GSM447461 2 0.2096 0.762 0.004 0.944 0.052
#> GSM447464 1 0.0000 0.959 1.000 0.000 0.000
#> GSM447468 1 0.0000 0.959 1.000 0.000 0.000
#> GSM447472 1 0.0000 0.959 1.000 0.000 0.000
#> GSM447400 1 0.0000 0.959 1.000 0.000 0.000
#> GSM447402 2 0.3192 0.769 0.000 0.888 0.112
#> GSM447403 1 0.0000 0.959 1.000 0.000 0.000
#> GSM447405 1 0.0000 0.959 1.000 0.000 0.000
#> GSM447418 3 0.6204 0.861 0.000 0.424 0.576
#> GSM447422 3 0.6225 0.866 0.000 0.432 0.568
#> GSM447424 3 0.6252 0.838 0.000 0.444 0.556
#> GSM447427 3 0.6225 0.866 0.000 0.432 0.568
#> GSM447428 1 0.9930 -0.380 0.364 0.276 0.360
#> GSM447429 1 0.0237 0.956 0.996 0.000 0.004
#> GSM447431 2 0.1267 0.762 0.004 0.972 0.024
#> GSM447432 2 0.2096 0.762 0.004 0.944 0.052
#> GSM447434 1 0.0000 0.959 1.000 0.000 0.000
#> GSM447442 2 0.0983 0.769 0.004 0.980 0.016
#> GSM447451 2 0.1399 0.770 0.004 0.968 0.028
#> GSM447462 1 0.0000 0.959 1.000 0.000 0.000
#> GSM447463 1 0.0000 0.959 1.000 0.000 0.000
#> GSM447467 1 0.6859 0.137 0.564 0.420 0.016
#> GSM447469 2 0.1129 0.768 0.004 0.976 0.020
#> GSM447473 1 0.0000 0.959 1.000 0.000 0.000
#> GSM447404 1 0.0000 0.959 1.000 0.000 0.000
#> GSM447406 2 0.3192 0.767 0.000 0.888 0.112
#> GSM447407 2 0.4291 0.707 0.000 0.820 0.180
#> GSM447409 1 0.0237 0.956 0.996 0.004 0.000
#> GSM447412 3 0.6215 0.862 0.000 0.428 0.572
#> GSM447426 3 0.5465 0.591 0.000 0.288 0.712
#> GSM447433 1 0.0237 0.956 0.996 0.004 0.000
#> GSM447439 2 0.3192 0.767 0.000 0.888 0.112
#> GSM447441 2 0.0829 0.768 0.004 0.984 0.012
#> GSM447443 1 0.0000 0.959 1.000 0.000 0.000
#> GSM447445 1 0.0000 0.959 1.000 0.000 0.000
#> GSM447446 1 0.0000 0.959 1.000 0.000 0.000
#> GSM447453 1 0.0000 0.959 1.000 0.000 0.000
#> GSM447455 2 0.1647 0.764 0.004 0.960 0.036
#> GSM447456 2 0.7941 0.337 0.276 0.628 0.096
#> GSM447459 2 0.3192 0.767 0.000 0.888 0.112
#> GSM447466 1 0.0000 0.959 1.000 0.000 0.000
#> GSM447470 1 0.0000 0.959 1.000 0.000 0.000
#> GSM447474 1 0.0000 0.959 1.000 0.000 0.000
#> GSM447475 2 0.1399 0.770 0.004 0.968 0.028
#> GSM447398 2 0.3192 0.769 0.000 0.888 0.112
#> GSM447399 2 0.0237 0.775 0.004 0.996 0.000
#> GSM447408 2 0.2878 0.771 0.000 0.904 0.096
#> GSM447410 2 0.3192 0.769 0.000 0.888 0.112
#> GSM447414 2 0.6204 -0.549 0.000 0.576 0.424
#> GSM447417 2 0.2959 0.771 0.000 0.900 0.100
#> GSM447419 1 0.0475 0.953 0.992 0.004 0.004
#> GSM447420 1 0.6968 0.612 0.732 0.148 0.120
#> GSM447421 1 0.0237 0.956 0.996 0.000 0.004
#> GSM447423 3 0.6225 0.866 0.000 0.432 0.568
#> GSM447436 1 0.0000 0.959 1.000 0.000 0.000
#> GSM447437 1 0.0000 0.959 1.000 0.000 0.000
#> GSM447438 2 0.3192 0.769 0.000 0.888 0.112
#> GSM447447 1 0.0000 0.959 1.000 0.000 0.000
#> GSM447454 2 0.1399 0.770 0.004 0.968 0.028
#> GSM447457 2 0.3573 0.634 0.004 0.876 0.120
#> GSM447460 2 0.1267 0.768 0.004 0.972 0.024
#> GSM447465 2 0.5929 -0.176 0.004 0.676 0.320
#> GSM447471 1 0.0000 0.959 1.000 0.000 0.000
#> GSM447476 2 0.4994 0.718 0.052 0.836 0.112
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM447401 3 0.2775 0.702 0.000 0.020 0.896 0.084
#> GSM447411 1 0.1174 0.966 0.968 0.000 0.012 0.020
#> GSM447413 3 0.4758 0.812 0.000 0.064 0.780 0.156
#> GSM447415 1 0.1059 0.968 0.972 0.000 0.012 0.016
#> GSM447416 3 0.4415 0.825 0.000 0.056 0.804 0.140
#> GSM447425 4 0.4057 0.695 0.000 0.032 0.152 0.816
#> GSM447430 4 0.2345 0.823 0.000 0.100 0.000 0.900
#> GSM447435 1 0.0937 0.969 0.976 0.000 0.012 0.012
#> GSM447440 1 0.1022 0.969 0.968 0.000 0.032 0.000
#> GSM447444 1 0.0804 0.972 0.980 0.000 0.012 0.008
#> GSM447448 1 0.0524 0.972 0.988 0.000 0.004 0.008
#> GSM447449 2 0.3208 0.786 0.000 0.848 0.004 0.148
#> GSM447450 1 0.0336 0.973 0.992 0.000 0.008 0.000
#> GSM447452 4 0.4105 0.692 0.000 0.032 0.156 0.812
#> GSM447458 2 0.1576 0.829 0.000 0.948 0.004 0.048
#> GSM447461 2 0.0817 0.815 0.000 0.976 0.000 0.024
#> GSM447464 1 0.0817 0.970 0.976 0.000 0.024 0.000
#> GSM447468 1 0.0804 0.970 0.980 0.000 0.008 0.012
#> GSM447472 1 0.0921 0.969 0.972 0.000 0.028 0.000
#> GSM447400 1 0.0921 0.969 0.972 0.000 0.028 0.000
#> GSM447402 4 0.5203 0.488 0.000 0.416 0.008 0.576
#> GSM447403 1 0.1284 0.964 0.964 0.000 0.012 0.024
#> GSM447405 1 0.0672 0.972 0.984 0.000 0.008 0.008
#> GSM447418 3 0.4387 0.824 0.000 0.052 0.804 0.144
#> GSM447422 3 0.4440 0.825 0.000 0.060 0.804 0.136
#> GSM447424 3 0.4322 0.820 0.000 0.044 0.804 0.152
#> GSM447427 3 0.4547 0.816 0.000 0.092 0.804 0.104
#> GSM447428 3 0.5453 0.310 0.388 0.020 0.592 0.000
#> GSM447429 1 0.0817 0.973 0.976 0.000 0.024 0.000
#> GSM447431 2 0.6339 0.550 0.000 0.656 0.196 0.148
#> GSM447432 2 0.1824 0.827 0.000 0.936 0.004 0.060
#> GSM447434 1 0.1022 0.969 0.968 0.000 0.032 0.000
#> GSM447442 2 0.3052 0.795 0.000 0.860 0.004 0.136
#> GSM447451 2 0.0188 0.823 0.000 0.996 0.000 0.004
#> GSM447462 1 0.0921 0.969 0.972 0.000 0.028 0.000
#> GSM447463 1 0.1118 0.971 0.964 0.000 0.036 0.000
#> GSM447467 2 0.2699 0.750 0.068 0.904 0.028 0.000
#> GSM447469 2 0.4621 0.632 0.000 0.708 0.008 0.284
#> GSM447473 1 0.1284 0.964 0.964 0.000 0.012 0.024
#> GSM447404 1 0.1284 0.964 0.964 0.000 0.012 0.024
#> GSM447406 4 0.2401 0.820 0.000 0.092 0.004 0.904
#> GSM447407 4 0.2216 0.821 0.000 0.092 0.000 0.908
#> GSM447409 1 0.1174 0.966 0.968 0.000 0.012 0.020
#> GSM447412 3 0.4387 0.787 0.000 0.144 0.804 0.052
#> GSM447426 3 0.2775 0.702 0.000 0.020 0.896 0.084
#> GSM447433 1 0.0524 0.972 0.988 0.000 0.004 0.008
#> GSM447439 4 0.2281 0.822 0.000 0.096 0.000 0.904
#> GSM447441 2 0.2611 0.815 0.000 0.896 0.008 0.096
#> GSM447443 1 0.0707 0.971 0.980 0.000 0.020 0.000
#> GSM447445 1 0.0592 0.972 0.984 0.000 0.016 0.000
#> GSM447446 1 0.0524 0.972 0.988 0.000 0.004 0.008
#> GSM447453 1 0.1059 0.968 0.972 0.000 0.016 0.012
#> GSM447455 2 0.2888 0.813 0.000 0.872 0.004 0.124
#> GSM447456 2 0.3245 0.716 0.100 0.872 0.028 0.000
#> GSM447459 4 0.2345 0.823 0.000 0.100 0.000 0.900
#> GSM447466 1 0.1388 0.971 0.960 0.000 0.028 0.012
#> GSM447470 1 0.0921 0.969 0.972 0.000 0.028 0.000
#> GSM447474 1 0.1022 0.969 0.968 0.000 0.032 0.000
#> GSM447475 2 0.0188 0.823 0.000 0.996 0.000 0.004
#> GSM447398 2 0.0188 0.823 0.000 0.996 0.000 0.004
#> GSM447399 2 0.3401 0.783 0.000 0.840 0.008 0.152
#> GSM447408 4 0.5126 0.311 0.000 0.444 0.004 0.552
#> GSM447410 2 0.3764 0.594 0.000 0.784 0.000 0.216
#> GSM447414 3 0.4711 0.813 0.000 0.064 0.784 0.152
#> GSM447417 4 0.3870 0.728 0.000 0.208 0.004 0.788
#> GSM447419 1 0.0921 0.969 0.972 0.000 0.028 0.000
#> GSM447420 1 0.4797 0.633 0.720 0.020 0.260 0.000
#> GSM447421 1 0.0921 0.969 0.972 0.000 0.028 0.000
#> GSM447423 3 0.4356 0.783 0.000 0.148 0.804 0.048
#> GSM447436 1 0.0927 0.970 0.976 0.000 0.016 0.008
#> GSM447437 1 0.1118 0.971 0.964 0.000 0.036 0.000
#> GSM447438 2 0.3649 0.615 0.000 0.796 0.000 0.204
#> GSM447447 1 0.1022 0.969 0.968 0.000 0.032 0.000
#> GSM447454 2 0.0804 0.829 0.000 0.980 0.008 0.012
#> GSM447457 2 0.0657 0.827 0.000 0.984 0.012 0.004
#> GSM447460 2 0.4149 0.760 0.000 0.812 0.036 0.152
#> GSM447465 3 0.7082 0.497 0.000 0.308 0.540 0.152
#> GSM447471 1 0.0804 0.970 0.980 0.000 0.012 0.008
#> GSM447476 2 0.4401 0.470 0.004 0.724 0.000 0.272
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM447401 3 0.2771 0.63782 0.000 0.000 0.860 0.012 0.128
#> GSM447411 1 0.2144 0.67855 0.912 0.068 0.000 0.000 0.020
#> GSM447413 3 0.3074 0.82566 0.000 0.000 0.804 0.196 0.000
#> GSM447415 1 0.3913 0.30676 0.676 0.000 0.000 0.000 0.324
#> GSM447416 3 0.3779 0.84047 0.000 0.052 0.804 0.144 0.000
#> GSM447425 4 0.4998 0.64282 0.000 0.000 0.196 0.700 0.104
#> GSM447430 4 0.0404 0.81174 0.000 0.012 0.000 0.988 0.000
#> GSM447435 1 0.1544 0.68018 0.932 0.068 0.000 0.000 0.000
#> GSM447440 1 0.4421 0.59190 0.748 0.068 0.000 0.000 0.184
#> GSM447444 1 0.5182 0.30717 0.632 0.068 0.000 0.000 0.300
#> GSM447448 1 0.3056 0.66405 0.864 0.068 0.000 0.000 0.068
#> GSM447449 2 0.3675 0.71958 0.000 0.788 0.024 0.188 0.000
#> GSM447450 1 0.2859 0.65436 0.876 0.000 0.000 0.068 0.056
#> GSM447452 4 0.4998 0.64282 0.000 0.000 0.196 0.700 0.104
#> GSM447458 2 0.1697 0.75998 0.000 0.932 0.008 0.060 0.000
#> GSM447461 2 0.0000 0.78133 0.000 1.000 0.000 0.000 0.000
#> GSM447464 1 0.4119 0.61703 0.780 0.068 0.000 0.000 0.152
#> GSM447468 1 0.3857 0.31883 0.688 0.000 0.000 0.000 0.312
#> GSM447472 1 0.4649 0.49856 0.720 0.068 0.000 0.000 0.212
#> GSM447400 5 0.5553 0.00626 0.448 0.068 0.000 0.000 0.484
#> GSM447402 4 0.4118 0.50029 0.000 0.336 0.004 0.660 0.000
#> GSM447403 1 0.3274 0.45530 0.780 0.000 0.000 0.000 0.220
#> GSM447405 1 0.1908 0.65178 0.908 0.000 0.000 0.000 0.092
#> GSM447418 3 0.3476 0.83713 0.000 0.020 0.804 0.176 0.000
#> GSM447422 3 0.3691 0.84081 0.000 0.040 0.804 0.156 0.000
#> GSM447424 3 0.3419 0.83569 0.000 0.016 0.804 0.180 0.000
#> GSM447427 3 0.3916 0.82260 0.000 0.104 0.804 0.092 0.000
#> GSM447428 5 0.6261 0.31846 0.148 0.000 0.396 0.000 0.456
#> GSM447429 5 0.4555 0.49429 0.200 0.000 0.068 0.000 0.732
#> GSM447431 2 0.6314 0.19676 0.000 0.508 0.312 0.180 0.000
#> GSM447432 2 0.1626 0.78560 0.000 0.940 0.016 0.044 0.000
#> GSM447434 1 0.5300 0.27933 0.604 0.068 0.000 0.000 0.328
#> GSM447442 2 0.3141 0.74669 0.000 0.832 0.016 0.152 0.000
#> GSM447451 2 0.0000 0.78133 0.000 1.000 0.000 0.000 0.000
#> GSM447462 5 0.5524 0.10581 0.416 0.068 0.000 0.000 0.516
#> GSM447463 1 0.3354 0.65447 0.844 0.068 0.000 0.000 0.088
#> GSM447467 2 0.2470 0.72631 0.012 0.884 0.000 0.000 0.104
#> GSM447469 2 0.4825 0.40742 0.000 0.568 0.024 0.408 0.000
#> GSM447473 1 0.3913 0.30676 0.676 0.000 0.000 0.000 0.324
#> GSM447404 1 0.3913 0.30676 0.676 0.000 0.000 0.000 0.324
#> GSM447406 4 0.0404 0.81174 0.000 0.012 0.000 0.988 0.000
#> GSM447407 4 0.0404 0.81174 0.000 0.012 0.000 0.988 0.000
#> GSM447409 1 0.1043 0.66772 0.960 0.000 0.000 0.000 0.040
#> GSM447412 3 0.3803 0.79915 0.000 0.140 0.804 0.056 0.000
#> GSM447426 3 0.2771 0.63782 0.000 0.000 0.860 0.012 0.128
#> GSM447433 1 0.1410 0.66785 0.940 0.000 0.000 0.000 0.060
#> GSM447439 4 0.0404 0.81174 0.000 0.012 0.000 0.988 0.000
#> GSM447441 2 0.2519 0.77351 0.000 0.884 0.016 0.100 0.000
#> GSM447443 5 0.4306 -0.01548 0.492 0.000 0.000 0.000 0.508
#> GSM447445 1 0.2992 0.66760 0.868 0.068 0.000 0.000 0.064
#> GSM447446 1 0.1478 0.66908 0.936 0.000 0.000 0.000 0.064
#> GSM447453 1 0.0404 0.66761 0.988 0.000 0.000 0.000 0.012
#> GSM447455 2 0.2464 0.77471 0.000 0.888 0.016 0.096 0.000
#> GSM447456 2 0.4888 0.67922 0.028 0.752 0.000 0.072 0.148
#> GSM447459 4 0.0404 0.81174 0.000 0.012 0.000 0.988 0.000
#> GSM447466 1 0.3569 0.65820 0.828 0.068 0.000 0.000 0.104
#> GSM447470 1 0.5557 -0.08760 0.468 0.068 0.000 0.000 0.464
#> GSM447474 1 0.5546 0.03124 0.496 0.068 0.000 0.000 0.436
#> GSM447475 2 0.0290 0.77983 0.000 0.992 0.000 0.000 0.008
#> GSM447398 2 0.1608 0.74247 0.000 0.928 0.000 0.072 0.000
#> GSM447399 2 0.3910 0.71241 0.000 0.772 0.032 0.196 0.000
#> GSM447408 4 0.4481 0.23194 0.000 0.416 0.008 0.576 0.000
#> GSM447410 2 0.3730 0.47667 0.000 0.712 0.000 0.288 0.000
#> GSM447414 3 0.3196 0.82861 0.000 0.004 0.804 0.192 0.000
#> GSM447417 4 0.1638 0.78149 0.000 0.064 0.004 0.932 0.000
#> GSM447419 5 0.4555 0.53464 0.200 0.000 0.068 0.000 0.732
#> GSM447420 5 0.5889 0.42279 0.116 0.000 0.340 0.000 0.544
#> GSM447421 5 0.3569 0.55421 0.104 0.000 0.068 0.000 0.828
#> GSM447423 3 0.3825 0.80190 0.000 0.136 0.804 0.060 0.000
#> GSM447436 1 0.0162 0.67301 0.996 0.000 0.000 0.000 0.004
#> GSM447437 1 0.3354 0.65447 0.844 0.068 0.000 0.000 0.088
#> GSM447438 2 0.3612 0.51375 0.000 0.732 0.000 0.268 0.000
#> GSM447447 1 0.4948 0.50040 0.676 0.068 0.000 0.000 0.256
#> GSM447454 2 0.0798 0.78646 0.000 0.976 0.016 0.008 0.000
#> GSM447457 2 0.0798 0.78625 0.000 0.976 0.016 0.008 0.000
#> GSM447460 2 0.4779 0.65916 0.000 0.716 0.084 0.200 0.000
#> GSM447465 3 0.6287 0.44702 0.000 0.296 0.520 0.184 0.000
#> GSM447471 1 0.0703 0.66213 0.976 0.000 0.000 0.000 0.024
#> GSM447476 2 0.5996 0.36706 0.132 0.612 0.000 0.244 0.012
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM447401 5 0.0865 0.890 0.000 0.000 0.036 0.000 0.964 0.000
#> GSM447411 6 0.3857 0.529 0.468 0.000 0.000 0.000 0.000 0.532
#> GSM447413 3 0.1007 0.805 0.000 0.000 0.956 0.044 0.000 0.000
#> GSM447415 1 0.0508 0.923 0.984 0.000 0.000 0.000 0.012 0.004
#> GSM447416 3 0.0260 0.817 0.000 0.008 0.992 0.000 0.000 0.000
#> GSM447425 5 0.2416 0.874 0.000 0.000 0.000 0.156 0.844 0.000
#> GSM447430 4 0.0363 0.740 0.000 0.000 0.012 0.988 0.000 0.000
#> GSM447435 6 0.3823 0.592 0.436 0.000 0.000 0.000 0.000 0.564
#> GSM447440 6 0.2912 0.803 0.216 0.000 0.000 0.000 0.000 0.784
#> GSM447444 6 0.3076 0.666 0.240 0.000 0.000 0.000 0.000 0.760
#> GSM447448 6 0.2631 0.784 0.180 0.000 0.000 0.000 0.000 0.820
#> GSM447449 3 0.3990 0.586 0.000 0.284 0.688 0.028 0.000 0.000
#> GSM447450 6 0.3409 0.768 0.300 0.000 0.000 0.000 0.000 0.700
#> GSM447452 5 0.2378 0.877 0.000 0.000 0.000 0.152 0.848 0.000
#> GSM447458 2 0.1075 0.906 0.000 0.952 0.048 0.000 0.000 0.000
#> GSM447461 2 0.0000 0.911 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM447464 6 0.2730 0.815 0.192 0.000 0.000 0.000 0.000 0.808
#> GSM447468 1 0.0260 0.925 0.992 0.000 0.000 0.000 0.000 0.008
#> GSM447472 6 0.3244 0.734 0.268 0.000 0.000 0.000 0.000 0.732
#> GSM447400 6 0.1838 0.808 0.068 0.000 0.000 0.000 0.016 0.916
#> GSM447402 4 0.4218 0.707 0.000 0.156 0.108 0.736 0.000 0.000
#> GSM447403 1 0.0146 0.925 0.996 0.000 0.000 0.000 0.000 0.004
#> GSM447405 1 0.2346 0.877 0.868 0.000 0.000 0.008 0.000 0.124
#> GSM447418 3 0.0146 0.816 0.000 0.004 0.996 0.000 0.000 0.000
#> GSM447422 3 0.0260 0.817 0.000 0.008 0.992 0.000 0.000 0.000
#> GSM447424 3 0.0000 0.815 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM447427 3 0.1806 0.798 0.000 0.088 0.908 0.004 0.000 0.000
#> GSM447428 3 0.6103 -0.059 0.404 0.000 0.432 0.000 0.024 0.140
#> GSM447429 6 0.3301 0.804 0.188 0.000 0.000 0.000 0.024 0.788
#> GSM447431 3 0.1588 0.806 0.000 0.072 0.924 0.004 0.000 0.000
#> GSM447432 2 0.1327 0.907 0.000 0.936 0.064 0.000 0.000 0.000
#> GSM447434 6 0.2631 0.798 0.180 0.000 0.000 0.000 0.000 0.820
#> GSM447442 2 0.2823 0.765 0.000 0.796 0.204 0.000 0.000 0.000
#> GSM447451 2 0.0000 0.911 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM447462 6 0.0458 0.769 0.000 0.000 0.000 0.000 0.016 0.984
#> GSM447463 6 0.2912 0.806 0.216 0.000 0.000 0.000 0.000 0.784
#> GSM447467 2 0.2178 0.818 0.000 0.868 0.000 0.000 0.000 0.132
#> GSM447469 4 0.4025 0.634 0.000 0.048 0.232 0.720 0.000 0.000
#> GSM447473 1 0.0363 0.921 0.988 0.000 0.000 0.000 0.012 0.000
#> GSM447404 1 0.0363 0.921 0.988 0.000 0.000 0.000 0.012 0.000
#> GSM447406 4 0.0363 0.740 0.000 0.000 0.012 0.988 0.000 0.000
#> GSM447407 4 0.0405 0.738 0.000 0.000 0.008 0.988 0.004 0.000
#> GSM447409 1 0.1007 0.917 0.956 0.000 0.000 0.000 0.000 0.044
#> GSM447412 3 0.1765 0.795 0.000 0.096 0.904 0.000 0.000 0.000
#> GSM447426 5 0.0865 0.890 0.000 0.000 0.036 0.000 0.964 0.000
#> GSM447433 1 0.2302 0.880 0.872 0.000 0.000 0.008 0.000 0.120
#> GSM447439 4 0.0363 0.740 0.000 0.000 0.012 0.988 0.000 0.000
#> GSM447441 2 0.1663 0.893 0.000 0.912 0.088 0.000 0.000 0.000
#> GSM447443 1 0.2791 0.843 0.852 0.000 0.000 0.008 0.016 0.124
#> GSM447445 6 0.3266 0.788 0.272 0.000 0.000 0.000 0.000 0.728
#> GSM447446 1 0.1757 0.911 0.916 0.000 0.000 0.008 0.000 0.076
#> GSM447453 1 0.0935 0.923 0.964 0.000 0.000 0.004 0.000 0.032
#> GSM447455 2 0.1663 0.893 0.000 0.912 0.088 0.000 0.000 0.000
#> GSM447456 2 0.1972 0.866 0.024 0.916 0.000 0.004 0.000 0.056
#> GSM447459 4 0.0363 0.740 0.000 0.000 0.012 0.988 0.000 0.000
#> GSM447466 6 0.2969 0.805 0.224 0.000 0.000 0.000 0.000 0.776
#> GSM447470 6 0.0000 0.775 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM447474 6 0.0000 0.775 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM447475 2 0.0000 0.911 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM447398 2 0.0000 0.911 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM447399 3 0.4222 0.609 0.000 0.088 0.728 0.184 0.000 0.000
#> GSM447408 4 0.4037 0.597 0.000 0.380 0.012 0.608 0.000 0.000
#> GSM447410 4 0.3899 0.567 0.000 0.404 0.004 0.592 0.000 0.000
#> GSM447414 3 0.0000 0.815 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM447417 4 0.1866 0.725 0.000 0.008 0.084 0.908 0.000 0.000
#> GSM447419 1 0.3062 0.812 0.816 0.000 0.000 0.000 0.024 0.160
#> GSM447420 6 0.4939 0.556 0.072 0.000 0.232 0.000 0.024 0.672
#> GSM447421 6 0.2282 0.804 0.088 0.000 0.000 0.000 0.024 0.888
#> GSM447423 3 0.2006 0.788 0.000 0.104 0.892 0.004 0.000 0.000
#> GSM447436 1 0.1196 0.923 0.952 0.000 0.000 0.008 0.000 0.040
#> GSM447437 6 0.2912 0.806 0.216 0.000 0.000 0.000 0.000 0.784
#> GSM447438 4 0.3872 0.586 0.000 0.392 0.004 0.604 0.000 0.000
#> GSM447447 6 0.0937 0.794 0.040 0.000 0.000 0.000 0.000 0.960
#> GSM447454 3 0.3851 0.280 0.000 0.460 0.540 0.000 0.000 0.000
#> GSM447457 2 0.0937 0.914 0.000 0.960 0.040 0.000 0.000 0.000
#> GSM447460 3 0.3834 0.732 0.000 0.116 0.776 0.108 0.000 0.000
#> GSM447465 3 0.1444 0.807 0.000 0.072 0.928 0.000 0.000 0.000
#> GSM447471 1 0.0713 0.923 0.972 0.000 0.000 0.000 0.000 0.028
#> GSM447476 4 0.5172 0.603 0.000 0.284 0.000 0.592 0.000 0.124
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
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 gender(p) agent(p) k
#> MAD:mclust 78 0.819 0.2536 2
#> MAD:mclust 71 0.256 0.4195 3
#> MAD:mclust 74 0.672 0.0749 4
#> MAD:mclust 57 0.514 0.1352 5
#> MAD:mclust 77 0.252 0.1792 6
If matrix rows can be associated to genes, consider to use functional_enrichment(res,
...)
to perform function enrichment for the signature genes. See this vignette for more detailed explanations.
The object with results only for a single top-value method and a single partition method can be extracted as:
res = res_list["MAD", "NMF"]
# you can also extract it by
# res = res_list["MAD:NMF"]
A summary of res
and all the functions that can be applied to it:
res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#> On a matrix with 51941 rows and 79 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'MAD' method.
#> Subgroups are detected by 'NMF' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 2.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
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.897 0.947 0.977 0.5032 0.498 0.498
#> 3 3 0.766 0.869 0.933 0.2893 0.783 0.591
#> 4 4 0.721 0.775 0.877 0.1104 0.847 0.599
#> 5 5 0.674 0.658 0.823 0.0589 0.869 0.587
#> 6 6 0.608 0.524 0.716 0.0462 0.931 0.740
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
#> GSM447401 2 0.000 0.962 0.000 1.000
#> GSM447411 1 0.000 0.991 1.000 0.000
#> GSM447413 2 0.000 0.962 0.000 1.000
#> GSM447415 1 0.000 0.991 1.000 0.000
#> GSM447416 2 0.000 0.962 0.000 1.000
#> GSM447425 2 0.000 0.962 0.000 1.000
#> GSM447430 2 0.000 0.962 0.000 1.000
#> GSM447435 1 0.000 0.991 1.000 0.000
#> GSM447440 1 0.000 0.991 1.000 0.000
#> GSM447444 1 0.000 0.991 1.000 0.000
#> GSM447448 1 0.000 0.991 1.000 0.000
#> GSM447449 2 0.000 0.962 0.000 1.000
#> GSM447450 1 0.000 0.991 1.000 0.000
#> GSM447452 2 0.000 0.962 0.000 1.000
#> GSM447458 2 0.000 0.962 0.000 1.000
#> GSM447461 2 0.000 0.962 0.000 1.000
#> GSM447464 1 0.000 0.991 1.000 0.000
#> GSM447468 1 0.000 0.991 1.000 0.000
#> GSM447472 1 0.000 0.991 1.000 0.000
#> GSM447400 1 0.000 0.991 1.000 0.000
#> GSM447402 2 0.000 0.962 0.000 1.000
#> GSM447403 1 0.000 0.991 1.000 0.000
#> GSM447405 1 0.000 0.991 1.000 0.000
#> GSM447418 2 0.000 0.962 0.000 1.000
#> GSM447422 2 0.000 0.962 0.000 1.000
#> GSM447424 2 0.000 0.962 0.000 1.000
#> GSM447427 2 0.000 0.962 0.000 1.000
#> GSM447428 2 0.781 0.714 0.232 0.768
#> GSM447429 1 0.000 0.991 1.000 0.000
#> GSM447431 2 0.000 0.962 0.000 1.000
#> GSM447432 2 0.000 0.962 0.000 1.000
#> GSM447434 1 0.000 0.991 1.000 0.000
#> GSM447442 2 0.000 0.962 0.000 1.000
#> GSM447451 2 0.224 0.934 0.036 0.964
#> GSM447462 1 0.000 0.991 1.000 0.000
#> GSM447463 1 0.000 0.991 1.000 0.000
#> GSM447467 2 0.971 0.380 0.400 0.600
#> GSM447469 2 0.000 0.962 0.000 1.000
#> GSM447473 1 0.000 0.991 1.000 0.000
#> GSM447404 1 0.000 0.991 1.000 0.000
#> GSM447406 2 0.000 0.962 0.000 1.000
#> GSM447407 2 0.000 0.962 0.000 1.000
#> GSM447409 1 0.000 0.991 1.000 0.000
#> GSM447412 2 0.000 0.962 0.000 1.000
#> GSM447426 2 0.000 0.962 0.000 1.000
#> GSM447433 1 0.000 0.991 1.000 0.000
#> GSM447439 2 0.000 0.962 0.000 1.000
#> GSM447441 2 0.000 0.962 0.000 1.000
#> GSM447443 1 0.000 0.991 1.000 0.000
#> GSM447445 1 0.000 0.991 1.000 0.000
#> GSM447446 1 0.000 0.991 1.000 0.000
#> GSM447453 1 0.000 0.991 1.000 0.000
#> GSM447455 2 0.000 0.962 0.000 1.000
#> GSM447456 1 0.584 0.831 0.860 0.140
#> GSM447459 2 0.000 0.962 0.000 1.000
#> GSM447466 1 0.000 0.991 1.000 0.000
#> GSM447470 1 0.000 0.991 1.000 0.000
#> GSM447474 1 0.000 0.991 1.000 0.000
#> GSM447475 2 0.788 0.708 0.236 0.764
#> GSM447398 2 0.584 0.833 0.140 0.860
#> GSM447399 2 0.000 0.962 0.000 1.000
#> GSM447408 2 0.000 0.962 0.000 1.000
#> GSM447410 2 0.000 0.962 0.000 1.000
#> GSM447414 2 0.000 0.962 0.000 1.000
#> GSM447417 2 0.000 0.962 0.000 1.000
#> GSM447419 1 0.118 0.976 0.984 0.016
#> GSM447420 2 0.969 0.390 0.396 0.604
#> GSM447421 1 0.000 0.991 1.000 0.000
#> GSM447423 2 0.000 0.962 0.000 1.000
#> GSM447436 1 0.000 0.991 1.000 0.000
#> GSM447437 1 0.000 0.991 1.000 0.000
#> GSM447438 2 0.469 0.876 0.100 0.900
#> GSM447447 1 0.000 0.991 1.000 0.000
#> GSM447454 2 0.000 0.962 0.000 1.000
#> GSM447457 2 0.000 0.962 0.000 1.000
#> GSM447460 2 0.000 0.962 0.000 1.000
#> GSM447465 2 0.000 0.962 0.000 1.000
#> GSM447471 1 0.000 0.991 1.000 0.000
#> GSM447476 1 0.563 0.842 0.868 0.132
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM447401 3 0.0000 0.857 0.000 0.000 1.000
#> GSM447411 1 0.0000 0.972 1.000 0.000 0.000
#> GSM447413 3 0.0237 0.856 0.000 0.004 0.996
#> GSM447415 1 0.0000 0.972 1.000 0.000 0.000
#> GSM447416 3 0.3619 0.805 0.000 0.136 0.864
#> GSM447425 2 0.4504 0.809 0.000 0.804 0.196
#> GSM447430 2 0.0237 0.904 0.000 0.996 0.004
#> GSM447435 1 0.0000 0.972 1.000 0.000 0.000
#> GSM447440 1 0.0000 0.972 1.000 0.000 0.000
#> GSM447444 1 0.0000 0.972 1.000 0.000 0.000
#> GSM447448 1 0.0000 0.972 1.000 0.000 0.000
#> GSM447449 2 0.4555 0.806 0.000 0.800 0.200
#> GSM447450 1 0.0000 0.972 1.000 0.000 0.000
#> GSM447452 2 0.4750 0.787 0.000 0.784 0.216
#> GSM447458 2 0.3482 0.852 0.000 0.872 0.128
#> GSM447461 2 0.0000 0.905 0.000 1.000 0.000
#> GSM447464 1 0.0000 0.972 1.000 0.000 0.000
#> GSM447468 1 0.0000 0.972 1.000 0.000 0.000
#> GSM447472 1 0.0000 0.972 1.000 0.000 0.000
#> GSM447400 1 0.0000 0.972 1.000 0.000 0.000
#> GSM447402 2 0.5471 0.819 0.060 0.812 0.128
#> GSM447403 1 0.0000 0.972 1.000 0.000 0.000
#> GSM447405 1 0.0000 0.972 1.000 0.000 0.000
#> GSM447418 3 0.0000 0.857 0.000 0.000 1.000
#> GSM447422 3 0.0000 0.857 0.000 0.000 1.000
#> GSM447424 3 0.0000 0.857 0.000 0.000 1.000
#> GSM447427 3 0.0000 0.857 0.000 0.000 1.000
#> GSM447428 3 0.0000 0.857 0.000 0.000 1.000
#> GSM447429 1 0.5058 0.664 0.756 0.000 0.244
#> GSM447431 3 0.4121 0.766 0.000 0.168 0.832
#> GSM447432 2 0.3941 0.835 0.000 0.844 0.156
#> GSM447434 1 0.0000 0.972 1.000 0.000 0.000
#> GSM447442 2 0.4399 0.815 0.000 0.812 0.188
#> GSM447451 2 0.1765 0.886 0.040 0.956 0.004
#> GSM447462 1 0.0000 0.972 1.000 0.000 0.000
#> GSM447463 1 0.0000 0.972 1.000 0.000 0.000
#> GSM447467 1 0.5505 0.779 0.816 0.088 0.096
#> GSM447469 2 0.4121 0.829 0.000 0.832 0.168
#> GSM447473 1 0.0000 0.972 1.000 0.000 0.000
#> GSM447404 1 0.0000 0.972 1.000 0.000 0.000
#> GSM447406 2 0.0000 0.905 0.000 1.000 0.000
#> GSM447407 2 0.0000 0.905 0.000 1.000 0.000
#> GSM447409 1 0.0000 0.972 1.000 0.000 0.000
#> GSM447412 3 0.2165 0.846 0.000 0.064 0.936
#> GSM447426 3 0.0000 0.857 0.000 0.000 1.000
#> GSM447433 1 0.0424 0.965 0.992 0.008 0.000
#> GSM447439 2 0.0000 0.905 0.000 1.000 0.000
#> GSM447441 2 0.0000 0.905 0.000 1.000 0.000
#> GSM447443 1 0.0000 0.972 1.000 0.000 0.000
#> GSM447445 1 0.0000 0.972 1.000 0.000 0.000
#> GSM447446 1 0.2625 0.890 0.916 0.084 0.000
#> GSM447453 1 0.0000 0.972 1.000 0.000 0.000
#> GSM447455 2 0.0000 0.905 0.000 1.000 0.000
#> GSM447456 2 0.5363 0.615 0.276 0.724 0.000
#> GSM447459 2 0.0000 0.905 0.000 1.000 0.000
#> GSM447466 1 0.0000 0.972 1.000 0.000 0.000
#> GSM447470 1 0.0000 0.972 1.000 0.000 0.000
#> GSM447474 1 0.0000 0.972 1.000 0.000 0.000
#> GSM447475 2 0.4121 0.766 0.168 0.832 0.000
#> GSM447398 2 0.0000 0.905 0.000 1.000 0.000
#> GSM447399 2 0.0592 0.900 0.000 0.988 0.012
#> GSM447408 2 0.0000 0.905 0.000 1.000 0.000
#> GSM447410 2 0.0000 0.905 0.000 1.000 0.000
#> GSM447414 3 0.2356 0.844 0.000 0.072 0.928
#> GSM447417 2 0.0000 0.905 0.000 1.000 0.000
#> GSM447419 3 0.4399 0.724 0.188 0.000 0.812
#> GSM447420 3 0.5760 0.494 0.328 0.000 0.672
#> GSM447421 1 0.5363 0.606 0.724 0.000 0.276
#> GSM447423 3 0.2261 0.845 0.000 0.068 0.932
#> GSM447436 1 0.2165 0.911 0.936 0.064 0.000
#> GSM447437 1 0.0000 0.972 1.000 0.000 0.000
#> GSM447438 2 0.0000 0.905 0.000 1.000 0.000
#> GSM447447 1 0.0000 0.972 1.000 0.000 0.000
#> GSM447454 3 0.6252 0.424 0.000 0.444 0.556
#> GSM447457 3 0.6215 0.451 0.000 0.428 0.572
#> GSM447460 2 0.1529 0.884 0.000 0.960 0.040
#> GSM447465 3 0.6126 0.422 0.000 0.400 0.600
#> GSM447471 1 0.0000 0.972 1.000 0.000 0.000
#> GSM447476 2 0.3752 0.792 0.144 0.856 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM447401 3 0.1474 0.7779 0.000 0.000 0.948 0.052
#> GSM447411 1 0.0000 0.9591 1.000 0.000 0.000 0.000
#> GSM447413 3 0.0657 0.7976 0.000 0.004 0.984 0.012
#> GSM447415 1 0.0000 0.9591 1.000 0.000 0.000 0.000
#> GSM447416 3 0.4514 0.8233 0.000 0.136 0.800 0.064
#> GSM447425 4 0.3528 0.6769 0.000 0.000 0.192 0.808
#> GSM447430 4 0.1174 0.7392 0.000 0.012 0.020 0.968
#> GSM447435 1 0.0000 0.9591 1.000 0.000 0.000 0.000
#> GSM447440 1 0.0000 0.9591 1.000 0.000 0.000 0.000
#> GSM447444 1 0.0707 0.9469 0.980 0.020 0.000 0.000
#> GSM447448 1 0.0188 0.9574 0.996 0.004 0.000 0.000
#> GSM447449 2 0.5109 0.6984 0.000 0.744 0.196 0.060
#> GSM447450 1 0.0000 0.9591 1.000 0.000 0.000 0.000
#> GSM447452 4 0.3528 0.6769 0.000 0.000 0.192 0.808
#> GSM447458 2 0.0188 0.7867 0.000 0.996 0.004 0.000
#> GSM447461 2 0.3123 0.7839 0.000 0.844 0.000 0.156
#> GSM447464 1 0.0000 0.9591 1.000 0.000 0.000 0.000
#> GSM447468 1 0.0000 0.9591 1.000 0.000 0.000 0.000
#> GSM447472 1 0.0000 0.9591 1.000 0.000 0.000 0.000
#> GSM447400 1 0.0336 0.9538 0.992 0.008 0.000 0.000
#> GSM447402 4 0.4092 0.6551 0.008 0.184 0.008 0.800
#> GSM447403 1 0.0000 0.9591 1.000 0.000 0.000 0.000
#> GSM447405 1 0.4989 -0.0791 0.528 0.000 0.000 0.472
#> GSM447418 3 0.3528 0.8359 0.000 0.192 0.808 0.000
#> GSM447422 3 0.4431 0.7534 0.000 0.304 0.696 0.000
#> GSM447424 3 0.3486 0.8354 0.000 0.188 0.812 0.000
#> GSM447427 3 0.3801 0.8260 0.000 0.220 0.780 0.000
#> GSM447428 3 0.2413 0.8083 0.064 0.020 0.916 0.000
#> GSM447429 1 0.1637 0.9088 0.940 0.000 0.060 0.000
#> GSM447431 2 0.3123 0.6306 0.000 0.844 0.156 0.000
#> GSM447432 2 0.0336 0.7849 0.000 0.992 0.008 0.000
#> GSM447434 1 0.0000 0.9591 1.000 0.000 0.000 0.000
#> GSM447442 2 0.0336 0.7849 0.000 0.992 0.008 0.000
#> GSM447451 2 0.4104 0.7713 0.028 0.808 0.000 0.164
#> GSM447462 1 0.2342 0.8728 0.912 0.080 0.008 0.000
#> GSM447463 1 0.0188 0.9574 0.996 0.004 0.000 0.000
#> GSM447467 2 0.3591 0.6300 0.168 0.824 0.008 0.000
#> GSM447469 4 0.4049 0.6438 0.000 0.212 0.008 0.780
#> GSM447473 1 0.0000 0.9591 1.000 0.000 0.000 0.000
#> GSM447404 1 0.0000 0.9591 1.000 0.000 0.000 0.000
#> GSM447406 4 0.2814 0.6898 0.000 0.132 0.000 0.868
#> GSM447407 4 0.0376 0.7390 0.000 0.004 0.004 0.992
#> GSM447409 1 0.0000 0.9591 1.000 0.000 0.000 0.000
#> GSM447412 3 0.3610 0.8334 0.000 0.200 0.800 0.000
#> GSM447426 3 0.1118 0.7867 0.000 0.000 0.964 0.036
#> GSM447433 4 0.4933 0.3207 0.432 0.000 0.000 0.568
#> GSM447439 4 0.1716 0.7290 0.000 0.064 0.000 0.936
#> GSM447441 2 0.3444 0.7688 0.000 0.816 0.000 0.184
#> GSM447443 1 0.0000 0.9591 1.000 0.000 0.000 0.000
#> GSM447445 1 0.0188 0.9574 0.996 0.004 0.000 0.000
#> GSM447446 4 0.3975 0.6232 0.240 0.000 0.000 0.760
#> GSM447453 1 0.0000 0.9591 1.000 0.000 0.000 0.000
#> GSM447455 2 0.2011 0.8014 0.000 0.920 0.000 0.080
#> GSM447456 2 0.5289 0.4420 0.344 0.636 0.000 0.020
#> GSM447459 4 0.0817 0.7383 0.000 0.024 0.000 0.976
#> GSM447466 1 0.0000 0.9591 1.000 0.000 0.000 0.000
#> GSM447470 1 0.1792 0.9025 0.932 0.068 0.000 0.000
#> GSM447474 1 0.0707 0.9472 0.980 0.020 0.000 0.000
#> GSM447475 2 0.4188 0.7103 0.148 0.812 0.000 0.040
#> GSM447398 2 0.3610 0.7590 0.000 0.800 0.000 0.200
#> GSM447399 2 0.4992 0.2481 0.000 0.524 0.000 0.476
#> GSM447408 4 0.3172 0.6664 0.000 0.160 0.000 0.840
#> GSM447410 4 0.4605 0.3325 0.000 0.336 0.000 0.664
#> GSM447414 3 0.4901 0.7887 0.000 0.112 0.780 0.108
#> GSM447417 4 0.1389 0.7349 0.000 0.048 0.000 0.952
#> GSM447419 3 0.4748 0.6186 0.268 0.016 0.716 0.000
#> GSM447420 3 0.4194 0.6731 0.228 0.008 0.764 0.000
#> GSM447421 1 0.4833 0.6348 0.740 0.032 0.228 0.000
#> GSM447423 3 0.4072 0.8058 0.000 0.252 0.748 0.000
#> GSM447436 4 0.4994 0.1762 0.480 0.000 0.000 0.520
#> GSM447437 1 0.0000 0.9591 1.000 0.000 0.000 0.000
#> GSM447438 4 0.3444 0.6379 0.000 0.184 0.000 0.816
#> GSM447447 1 0.1022 0.9373 0.968 0.032 0.000 0.000
#> GSM447454 2 0.3447 0.7956 0.000 0.852 0.020 0.128
#> GSM447457 2 0.1256 0.7787 0.000 0.964 0.028 0.008
#> GSM447460 2 0.4008 0.7198 0.000 0.756 0.000 0.244
#> GSM447465 2 0.1584 0.7763 0.000 0.952 0.036 0.012
#> GSM447471 1 0.0000 0.9591 1.000 0.000 0.000 0.000
#> GSM447476 4 0.4838 0.6138 0.252 0.024 0.000 0.724
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM447401 3 0.2690 0.7826 0.000 0.000 0.844 0.000 0.156
#> GSM447411 1 0.0609 0.8888 0.980 0.020 0.000 0.000 0.000
#> GSM447413 3 0.2690 0.7924 0.000 0.000 0.844 0.000 0.156
#> GSM447415 1 0.0000 0.8894 1.000 0.000 0.000 0.000 0.000
#> GSM447416 3 0.3169 0.7830 0.000 0.016 0.840 0.140 0.004
#> GSM447425 5 0.1300 0.6817 0.000 0.000 0.016 0.028 0.956
#> GSM447430 4 0.4009 0.4611 0.000 0.004 0.000 0.684 0.312
#> GSM447435 1 0.0794 0.8885 0.972 0.028 0.000 0.000 0.000
#> GSM447440 1 0.2249 0.8575 0.896 0.096 0.000 0.008 0.000
#> GSM447444 2 0.5795 0.1826 0.412 0.496 0.000 0.000 0.092
#> GSM447448 1 0.2006 0.8730 0.916 0.072 0.000 0.000 0.012
#> GSM447449 2 0.4183 0.4318 0.000 0.712 0.008 0.008 0.272
#> GSM447450 1 0.1270 0.8850 0.948 0.052 0.000 0.000 0.000
#> GSM447452 5 0.2236 0.6704 0.000 0.000 0.024 0.068 0.908
#> GSM447458 2 0.1983 0.6314 0.008 0.924 0.000 0.008 0.060
#> GSM447461 4 0.4604 0.4283 0.008 0.404 0.000 0.584 0.004
#> GSM447464 1 0.2127 0.8520 0.892 0.108 0.000 0.000 0.000
#> GSM447468 1 0.0162 0.8896 0.996 0.004 0.000 0.000 0.000
#> GSM447472 1 0.1965 0.8473 0.904 0.096 0.000 0.000 0.000
#> GSM447400 1 0.1671 0.8656 0.924 0.076 0.000 0.000 0.000
#> GSM447402 5 0.4602 0.6433 0.008 0.188 0.016 0.032 0.756
#> GSM447403 1 0.0404 0.8880 0.988 0.000 0.000 0.000 0.012
#> GSM447405 1 0.5629 0.4774 0.644 0.004 0.000 0.132 0.220
#> GSM447418 2 0.4562 -0.0322 0.000 0.496 0.496 0.000 0.008
#> GSM447422 2 0.3266 0.5550 0.000 0.796 0.200 0.000 0.004
#> GSM447424 3 0.0794 0.8164 0.000 0.028 0.972 0.000 0.000
#> GSM447427 3 0.2377 0.7801 0.000 0.128 0.872 0.000 0.000
#> GSM447428 3 0.1644 0.8129 0.048 0.004 0.940 0.000 0.008
#> GSM447429 1 0.1525 0.8796 0.948 0.004 0.036 0.000 0.012
#> GSM447431 4 0.4221 0.6188 0.000 0.236 0.032 0.732 0.000
#> GSM447432 2 0.1179 0.6420 0.000 0.964 0.016 0.016 0.004
#> GSM447434 1 0.1195 0.8833 0.960 0.000 0.000 0.028 0.012
#> GSM447442 2 0.2299 0.6273 0.000 0.912 0.032 0.004 0.052
#> GSM447451 4 0.4697 0.2831 0.020 0.388 0.000 0.592 0.000
#> GSM447462 1 0.3811 0.7817 0.808 0.148 0.008 0.036 0.000
#> GSM447463 1 0.1671 0.8731 0.924 0.076 0.000 0.000 0.000
#> GSM447467 2 0.1954 0.6320 0.032 0.932 0.008 0.000 0.028
#> GSM447469 5 0.5896 0.2484 0.000 0.440 0.044 0.028 0.488
#> GSM447473 1 0.0510 0.8875 0.984 0.000 0.000 0.000 0.016
#> GSM447404 1 0.0671 0.8877 0.980 0.004 0.000 0.000 0.016
#> GSM447406 4 0.1430 0.7090 0.000 0.004 0.000 0.944 0.052
#> GSM447407 5 0.3612 0.5120 0.000 0.000 0.000 0.268 0.732
#> GSM447409 1 0.1074 0.8852 0.968 0.004 0.000 0.012 0.016
#> GSM447412 3 0.2813 0.8015 0.000 0.024 0.868 0.108 0.000
#> GSM447426 3 0.2329 0.7963 0.000 0.000 0.876 0.000 0.124
#> GSM447433 1 0.5833 0.1676 0.516 0.020 0.000 0.052 0.412
#> GSM447439 4 0.2068 0.6912 0.000 0.004 0.000 0.904 0.092
#> GSM447441 4 0.3662 0.5611 0.000 0.252 0.000 0.744 0.004
#> GSM447443 1 0.1074 0.8884 0.968 0.012 0.000 0.004 0.016
#> GSM447445 1 0.1282 0.8872 0.952 0.044 0.000 0.000 0.004
#> GSM447446 5 0.3764 0.5471 0.212 0.008 0.000 0.008 0.772
#> GSM447453 1 0.1211 0.8899 0.960 0.024 0.000 0.000 0.016
#> GSM447455 2 0.2517 0.6454 0.000 0.884 0.008 0.104 0.004
#> GSM447456 4 0.5197 0.3498 0.316 0.064 0.000 0.620 0.000
#> GSM447459 4 0.2516 0.6546 0.000 0.000 0.000 0.860 0.140
#> GSM447466 1 0.0794 0.8878 0.972 0.028 0.000 0.000 0.000
#> GSM447470 1 0.3612 0.6339 0.732 0.268 0.000 0.000 0.000
#> GSM447474 1 0.1124 0.8884 0.960 0.036 0.000 0.000 0.004
#> GSM447475 2 0.4392 0.5815 0.048 0.748 0.000 0.200 0.004
#> GSM447398 4 0.2377 0.6884 0.000 0.128 0.000 0.872 0.000
#> GSM447399 4 0.0880 0.7153 0.000 0.032 0.000 0.968 0.000
#> GSM447408 4 0.2208 0.6981 0.000 0.020 0.000 0.908 0.072
#> GSM447410 4 0.1117 0.7152 0.000 0.020 0.000 0.964 0.016
#> GSM447414 3 0.3602 0.7497 0.000 0.024 0.796 0.180 0.000
#> GSM447417 5 0.5931 0.4730 0.000 0.200 0.000 0.204 0.596
#> GSM447419 3 0.5319 0.5477 0.248 0.088 0.660 0.000 0.004
#> GSM447420 3 0.4305 0.6237 0.216 0.036 0.744 0.000 0.004
#> GSM447421 1 0.5185 0.5936 0.672 0.100 0.228 0.000 0.000
#> GSM447423 3 0.1872 0.8180 0.000 0.052 0.928 0.020 0.000
#> GSM447436 1 0.4889 0.0845 0.504 0.004 0.000 0.016 0.476
#> GSM447437 1 0.0693 0.8893 0.980 0.008 0.000 0.000 0.012
#> GSM447438 4 0.1682 0.7115 0.012 0.004 0.000 0.940 0.044
#> GSM447447 2 0.6215 0.2424 0.340 0.520 0.000 0.004 0.136
#> GSM447454 2 0.5592 0.2761 0.000 0.560 0.060 0.372 0.008
#> GSM447457 2 0.3867 0.6279 0.000 0.804 0.048 0.144 0.004
#> GSM447460 2 0.4697 0.3224 0.000 0.592 0.000 0.388 0.020
#> GSM447465 2 0.4410 0.6197 0.000 0.772 0.032 0.168 0.028
#> GSM447471 1 0.0510 0.8875 0.984 0.000 0.000 0.000 0.016
#> GSM447476 4 0.6988 -0.0655 0.292 0.012 0.000 0.436 0.260
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM447401 3 0.3868 0.3236 0.000 0.000 0.508 0.000 0.492 0.000
#> GSM447411 1 0.0713 0.7344 0.972 0.000 0.000 0.000 0.000 0.028
#> GSM447413 3 0.4038 0.6879 0.000 0.008 0.776 0.040 0.160 0.016
#> GSM447415 1 0.0937 0.7369 0.960 0.000 0.000 0.000 0.000 0.040
#> GSM447416 3 0.3430 0.7045 0.000 0.020 0.840 0.088 0.008 0.044
#> GSM447425 5 0.3104 0.5034 0.000 0.016 0.000 0.000 0.800 0.184
#> GSM447430 4 0.4148 0.4596 0.000 0.004 0.000 0.636 0.344 0.016
#> GSM447435 1 0.0865 0.7355 0.964 0.000 0.000 0.000 0.000 0.036
#> GSM447440 1 0.2714 0.7201 0.880 0.036 0.000 0.020 0.000 0.064
#> GSM447444 1 0.5852 0.1374 0.484 0.404 0.004 0.000 0.036 0.072
#> GSM447448 1 0.3284 0.6873 0.832 0.104 0.000 0.000 0.008 0.056
#> GSM447449 2 0.3610 0.6094 0.000 0.804 0.000 0.004 0.088 0.104
#> GSM447450 1 0.1923 0.7306 0.916 0.016 0.000 0.000 0.004 0.064
#> GSM447452 5 0.0520 0.5674 0.000 0.000 0.008 0.008 0.984 0.000
#> GSM447458 2 0.2445 0.6602 0.008 0.892 0.000 0.000 0.040 0.060
#> GSM447461 4 0.5886 0.2635 0.040 0.364 0.000 0.508 0.000 0.088
#> GSM447464 1 0.3045 0.6865 0.840 0.100 0.000 0.000 0.000 0.060
#> GSM447468 1 0.0806 0.7383 0.972 0.000 0.008 0.000 0.000 0.020
#> GSM447472 1 0.2121 0.7352 0.892 0.012 0.000 0.000 0.000 0.096
#> GSM447400 1 0.4598 0.6671 0.712 0.056 0.012 0.008 0.000 0.212
#> GSM447402 6 0.6424 -0.1669 0.000 0.236 0.004 0.012 0.360 0.388
#> GSM447403 1 0.2697 0.6785 0.812 0.000 0.000 0.000 0.000 0.188
#> GSM447405 1 0.6619 -0.0897 0.456 0.000 0.000 0.068 0.144 0.332
#> GSM447418 3 0.4293 0.1421 0.000 0.448 0.536 0.000 0.004 0.012
#> GSM447422 2 0.4034 0.4150 0.000 0.692 0.280 0.004 0.000 0.024
#> GSM447424 3 0.0972 0.7261 0.000 0.028 0.964 0.000 0.008 0.000
#> GSM447427 3 0.2212 0.7152 0.000 0.112 0.880 0.000 0.000 0.008
#> GSM447428 3 0.2595 0.7164 0.056 0.008 0.888 0.000 0.044 0.004
#> GSM447429 1 0.3616 0.6986 0.792 0.000 0.076 0.000 0.000 0.132
#> GSM447431 4 0.4443 0.6705 0.000 0.108 0.040 0.768 0.004 0.080
#> GSM447432 2 0.2499 0.6601 0.000 0.880 0.000 0.048 0.000 0.072
#> GSM447434 1 0.4702 0.5855 0.680 0.000 0.004 0.096 0.000 0.220
#> GSM447442 2 0.2195 0.6495 0.000 0.904 0.012 0.000 0.016 0.068
#> GSM447451 4 0.5431 0.3404 0.024 0.320 0.004 0.584 0.000 0.068
#> GSM447462 1 0.4859 0.6058 0.732 0.120 0.012 0.024 0.000 0.112
#> GSM447463 1 0.2857 0.7201 0.856 0.072 0.000 0.000 0.000 0.072
#> GSM447467 2 0.2504 0.6615 0.032 0.892 0.004 0.000 0.008 0.064
#> GSM447469 2 0.6434 -0.0243 0.000 0.412 0.024 0.012 0.144 0.408
#> GSM447473 1 0.3151 0.6439 0.748 0.000 0.000 0.000 0.000 0.252
#> GSM447404 1 0.2996 0.6658 0.772 0.000 0.000 0.000 0.000 0.228
#> GSM447406 4 0.1958 0.7067 0.000 0.000 0.000 0.896 0.100 0.004
#> GSM447407 5 0.2622 0.5460 0.000 0.004 0.000 0.104 0.868 0.024
#> GSM447409 1 0.3023 0.6588 0.768 0.000 0.000 0.000 0.000 0.232
#> GSM447412 3 0.1820 0.7262 0.000 0.012 0.928 0.044 0.000 0.016
#> GSM447426 3 0.3817 0.4184 0.000 0.000 0.568 0.000 0.432 0.000
#> GSM447433 6 0.6182 0.1925 0.340 0.000 0.000 0.012 0.208 0.440
#> GSM447439 4 0.2843 0.6918 0.000 0.000 0.000 0.848 0.116 0.036
#> GSM447441 4 0.4439 0.5259 0.000 0.240 0.004 0.692 0.000 0.064
#> GSM447443 1 0.3758 0.6489 0.700 0.000 0.016 0.000 0.000 0.284
#> GSM447445 1 0.2383 0.7311 0.880 0.024 0.000 0.000 0.000 0.096
#> GSM447446 5 0.6276 -0.2382 0.244 0.012 0.000 0.000 0.428 0.316
#> GSM447453 1 0.3735 0.6319 0.780 0.012 0.000 0.000 0.172 0.036
#> GSM447455 2 0.2672 0.6713 0.000 0.868 0.000 0.080 0.000 0.052
#> GSM447456 1 0.6596 -0.0403 0.424 0.076 0.000 0.380 0.000 0.120
#> GSM447459 4 0.4051 0.6487 0.000 0.004 0.000 0.756 0.164 0.076
#> GSM447466 1 0.0790 0.7347 0.968 0.000 0.000 0.000 0.000 0.032
#> GSM447470 1 0.4618 0.5155 0.672 0.236 0.000 0.000 0.000 0.092
#> GSM447474 1 0.3023 0.7015 0.836 0.044 0.000 0.000 0.000 0.120
#> GSM447475 2 0.5949 0.5375 0.064 0.612 0.000 0.168 0.000 0.156
#> GSM447398 4 0.3070 0.6948 0.016 0.056 0.000 0.856 0.000 0.072
#> GSM447399 4 0.3152 0.6876 0.000 0.020 0.016 0.832 0.000 0.132
#> GSM447408 4 0.4408 0.6027 0.000 0.012 0.000 0.720 0.064 0.204
#> GSM447410 4 0.3562 0.6342 0.000 0.012 0.000 0.756 0.008 0.224
#> GSM447414 3 0.4834 0.6494 0.000 0.040 0.720 0.172 0.004 0.064
#> GSM447417 6 0.7531 -0.0142 0.000 0.256 0.000 0.168 0.220 0.356
#> GSM447419 3 0.5812 0.3910 0.268 0.008 0.576 0.008 0.004 0.136
#> GSM447420 3 0.5040 0.5563 0.208 0.020 0.680 0.000 0.004 0.088
#> GSM447421 1 0.6245 0.1519 0.472 0.088 0.372 0.000 0.000 0.068
#> GSM447423 3 0.2474 0.7242 0.000 0.040 0.880 0.000 0.000 0.080
#> GSM447436 6 0.6254 0.1784 0.368 0.008 0.000 0.004 0.208 0.412
#> GSM447437 1 0.2003 0.7173 0.884 0.000 0.000 0.000 0.000 0.116
#> GSM447438 4 0.3166 0.6547 0.004 0.000 0.000 0.816 0.024 0.156
#> GSM447447 2 0.6139 0.1007 0.188 0.472 0.000 0.000 0.016 0.324
#> GSM447454 2 0.7085 0.2843 0.000 0.440 0.128 0.276 0.000 0.156
#> GSM447457 2 0.5117 0.6037 0.000 0.688 0.032 0.128 0.000 0.152
#> GSM447460 2 0.5522 0.2940 0.000 0.540 0.004 0.356 0.012 0.088
#> GSM447465 2 0.4166 0.6316 0.000 0.776 0.020 0.144 0.008 0.052
#> GSM447471 1 0.3050 0.6522 0.764 0.000 0.000 0.000 0.000 0.236
#> GSM447476 6 0.6355 0.0533 0.080 0.016 0.000 0.360 0.052 0.492
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 gender(p) agent(p) k
#> MAD:NMF 77 1.0000 0.301 2
#> MAD:NMF 75 0.2977 0.346 3
#> MAD:NMF 73 0.5377 0.250 4
#> MAD:NMF 63 0.1064 0.266 5
#> MAD:NMF 57 0.0804 0.160 6
If matrix rows can be associated to genes, consider to use functional_enrichment(res,
...)
to perform function enrichment for the signature genes. See this vignette for more detailed explanations.
The object with results only for a single top-value method and a single partition method can be extracted as:
res = res_list["ATC", "hclust"]
# you can also extract it by
# res = res_list["ATC:hclust"]
A summary of res
and all the functions that can be applied to it:
res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#> On a matrix with 51941 rows and 79 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'ATC' method.
#> Subgroups are detected by 'hclust' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 2.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
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.496 0.787 0.898 0.4155 0.572 0.572
#> 3 3 0.545 0.703 0.846 0.3104 0.912 0.849
#> 4 4 0.754 0.767 0.877 0.3039 0.787 0.582
#> 5 5 0.835 0.747 0.852 0.0897 0.903 0.690
#> 6 6 0.796 0.722 0.814 0.0444 0.957 0.816
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
#> GSM447401 2 0.0000 0.909 0.000 1.000
#> GSM447411 1 0.7453 0.826 0.788 0.212
#> GSM447413 2 0.0000 0.909 0.000 1.000
#> GSM447415 2 0.0672 0.905 0.008 0.992
#> GSM447416 2 0.0000 0.909 0.000 1.000
#> GSM447425 2 0.2236 0.887 0.036 0.964
#> GSM447430 1 0.0000 0.803 1.000 0.000
#> GSM447435 1 0.7453 0.826 0.788 0.212
#> GSM447440 1 0.4815 0.843 0.896 0.104
#> GSM447444 2 0.0000 0.909 0.000 1.000
#> GSM447448 2 0.0000 0.909 0.000 1.000
#> GSM447449 2 0.0000 0.909 0.000 1.000
#> GSM447450 1 0.4815 0.843 0.896 0.104
#> GSM447452 2 0.9795 0.288 0.416 0.584
#> GSM447458 2 0.0376 0.907 0.004 0.996
#> GSM447461 1 0.9881 0.259 0.564 0.436
#> GSM447464 1 0.7453 0.826 0.788 0.212
#> GSM447468 1 0.7453 0.826 0.788 0.212
#> GSM447472 2 0.3274 0.865 0.060 0.940
#> GSM447400 1 0.5842 0.842 0.860 0.140
#> GSM447402 2 0.1184 0.901 0.016 0.984
#> GSM447403 1 0.7453 0.826 0.788 0.212
#> GSM447405 2 0.0000 0.909 0.000 1.000
#> GSM447418 2 0.0000 0.909 0.000 1.000
#> GSM447422 2 0.0000 0.909 0.000 1.000
#> GSM447424 2 0.0000 0.909 0.000 1.000
#> GSM447427 2 0.0000 0.909 0.000 1.000
#> GSM447428 2 0.0000 0.909 0.000 1.000
#> GSM447429 2 0.0672 0.905 0.008 0.992
#> GSM447431 1 0.0376 0.805 0.996 0.004
#> GSM447432 2 0.0376 0.907 0.004 0.996
#> GSM447434 1 0.4815 0.843 0.896 0.104
#> GSM447442 2 0.0000 0.909 0.000 1.000
#> GSM447451 2 0.0000 0.909 0.000 1.000
#> GSM447462 1 0.5842 0.842 0.860 0.140
#> GSM447463 2 0.0000 0.909 0.000 1.000
#> GSM447467 2 0.0000 0.909 0.000 1.000
#> GSM447469 2 0.1184 0.901 0.016 0.984
#> GSM447473 1 0.7528 0.822 0.784 0.216
#> GSM447404 1 0.7528 0.822 0.784 0.216
#> GSM447406 1 0.0000 0.803 1.000 0.000
#> GSM447407 2 0.2236 0.887 0.036 0.964
#> GSM447409 1 0.4815 0.843 0.896 0.104
#> GSM447412 2 0.0376 0.907 0.004 0.996
#> GSM447426 2 0.0000 0.909 0.000 1.000
#> GSM447433 2 0.2603 0.881 0.044 0.956
#> GSM447439 1 0.0000 0.803 1.000 0.000
#> GSM447441 2 0.0000 0.909 0.000 1.000
#> GSM447443 2 0.9635 0.214 0.388 0.612
#> GSM447445 2 0.0000 0.909 0.000 1.000
#> GSM447446 2 0.0000 0.909 0.000 1.000
#> GSM447453 2 0.0000 0.909 0.000 1.000
#> GSM447455 2 0.0376 0.907 0.004 0.996
#> GSM447456 2 0.9754 0.312 0.408 0.592
#> GSM447459 2 0.9795 0.288 0.416 0.584
#> GSM447466 1 0.7453 0.826 0.788 0.212
#> GSM447470 2 0.3274 0.865 0.060 0.940
#> GSM447474 2 0.4690 0.822 0.100 0.900
#> GSM447475 1 0.9993 0.137 0.516 0.484
#> GSM447398 1 0.0376 0.805 0.996 0.004
#> GSM447399 1 0.0376 0.805 0.996 0.004
#> GSM447408 2 0.9635 0.363 0.388 0.612
#> GSM447410 2 0.9754 0.313 0.408 0.592
#> GSM447414 1 0.9866 0.270 0.568 0.432
#> GSM447417 2 0.2236 0.887 0.036 0.964
#> GSM447419 2 0.9552 0.253 0.376 0.624
#> GSM447420 2 0.0000 0.909 0.000 1.000
#> GSM447421 2 0.0672 0.905 0.008 0.992
#> GSM447423 2 0.0000 0.909 0.000 1.000
#> GSM447436 2 0.0000 0.909 0.000 1.000
#> GSM447437 2 0.0000 0.909 0.000 1.000
#> GSM447438 2 0.9754 0.312 0.408 0.592
#> GSM447447 2 0.0000 0.909 0.000 1.000
#> GSM447454 2 0.0000 0.909 0.000 1.000
#> GSM447457 2 0.0000 0.909 0.000 1.000
#> GSM447460 2 0.0000 0.909 0.000 1.000
#> GSM447465 2 0.0000 0.909 0.000 1.000
#> GSM447471 1 0.7453 0.826 0.788 0.212
#> GSM447476 2 0.9754 0.313 0.408 0.592
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM447401 2 0.4164 0.780 0.144 0.848 0.008
#> GSM447411 1 0.3879 0.861 0.848 0.000 0.152
#> GSM447413 2 0.4164 0.780 0.144 0.848 0.008
#> GSM447415 2 0.6379 0.539 0.368 0.624 0.008
#> GSM447416 2 0.4164 0.780 0.144 0.848 0.008
#> GSM447425 2 0.1411 0.815 0.000 0.964 0.036
#> GSM447430 3 0.0424 0.681 0.008 0.000 0.992
#> GSM447435 1 0.3879 0.861 0.848 0.000 0.152
#> GSM447440 1 0.5254 0.801 0.736 0.000 0.264
#> GSM447444 2 0.0000 0.832 0.000 1.000 0.000
#> GSM447448 2 0.0000 0.832 0.000 1.000 0.000
#> GSM447449 2 0.0000 0.832 0.000 1.000 0.000
#> GSM447450 1 0.5254 0.801 0.736 0.000 0.264
#> GSM447452 2 0.6180 0.258 0.000 0.584 0.416
#> GSM447458 2 0.0237 0.830 0.000 0.996 0.004
#> GSM447461 3 0.7130 0.276 0.024 0.432 0.544
#> GSM447464 1 0.3879 0.861 0.848 0.000 0.152
#> GSM447468 1 0.3816 0.859 0.852 0.000 0.148
#> GSM447472 2 0.7114 0.483 0.388 0.584 0.028
#> GSM447400 1 0.4796 0.830 0.780 0.000 0.220
#> GSM447402 2 0.0747 0.826 0.000 0.984 0.016
#> GSM447403 1 0.3879 0.861 0.848 0.000 0.152
#> GSM447405 2 0.0000 0.832 0.000 1.000 0.000
#> GSM447418 2 0.4164 0.780 0.144 0.848 0.008
#> GSM447422 2 0.4164 0.780 0.144 0.848 0.008
#> GSM447424 2 0.4164 0.780 0.144 0.848 0.008
#> GSM447427 2 0.4164 0.780 0.144 0.848 0.008
#> GSM447428 2 0.4164 0.780 0.144 0.848 0.008
#> GSM447429 2 0.6379 0.539 0.368 0.624 0.008
#> GSM447431 3 0.0592 0.680 0.012 0.000 0.988
#> GSM447432 2 0.0237 0.830 0.000 0.996 0.004
#> GSM447434 1 0.5254 0.801 0.736 0.000 0.264
#> GSM447442 2 0.0000 0.832 0.000 1.000 0.000
#> GSM447451 2 0.0000 0.832 0.000 1.000 0.000
#> GSM447462 1 0.4796 0.830 0.780 0.000 0.220
#> GSM447463 2 0.0000 0.832 0.000 1.000 0.000
#> GSM447467 2 0.0000 0.832 0.000 1.000 0.000
#> GSM447469 2 0.0747 0.826 0.000 0.984 0.016
#> GSM447473 1 0.3752 0.857 0.856 0.000 0.144
#> GSM447404 1 0.3752 0.857 0.856 0.000 0.144
#> GSM447406 3 0.0424 0.681 0.008 0.000 0.992
#> GSM447407 2 0.1411 0.815 0.000 0.964 0.036
#> GSM447409 1 0.5254 0.801 0.736 0.000 0.264
#> GSM447412 2 0.4110 0.777 0.152 0.844 0.004
#> GSM447426 2 0.4164 0.780 0.144 0.848 0.008
#> GSM447433 2 0.1643 0.811 0.000 0.956 0.044
#> GSM447439 3 0.0424 0.681 0.008 0.000 0.992
#> GSM447441 2 0.0000 0.832 0.000 1.000 0.000
#> GSM447443 1 0.5404 0.286 0.740 0.256 0.004
#> GSM447445 2 0.0000 0.832 0.000 1.000 0.000
#> GSM447446 2 0.0000 0.832 0.000 1.000 0.000
#> GSM447453 2 0.0000 0.832 0.000 1.000 0.000
#> GSM447455 2 0.0237 0.830 0.000 0.996 0.004
#> GSM447456 2 0.6154 0.277 0.000 0.592 0.408
#> GSM447459 2 0.6180 0.258 0.000 0.584 0.416
#> GSM447466 1 0.3879 0.861 0.848 0.000 0.152
#> GSM447470 2 0.7114 0.483 0.388 0.584 0.028
#> GSM447474 2 0.7903 0.445 0.356 0.576 0.068
#> GSM447475 3 0.8391 0.225 0.084 0.432 0.484
#> GSM447398 3 0.0592 0.680 0.012 0.000 0.988
#> GSM447399 3 0.0592 0.680 0.012 0.000 0.988
#> GSM447408 2 0.6079 0.312 0.000 0.612 0.388
#> GSM447410 2 0.6154 0.275 0.000 0.592 0.408
#> GSM447414 3 0.6879 0.287 0.016 0.428 0.556
#> GSM447417 2 0.1411 0.815 0.000 0.964 0.036
#> GSM447419 1 0.5497 0.223 0.708 0.292 0.000
#> GSM447420 2 0.4164 0.780 0.144 0.848 0.008
#> GSM447421 2 0.6379 0.539 0.368 0.624 0.008
#> GSM447423 2 0.4164 0.780 0.144 0.848 0.008
#> GSM447436 2 0.0000 0.832 0.000 1.000 0.000
#> GSM447437 2 0.0000 0.832 0.000 1.000 0.000
#> GSM447438 2 0.6154 0.277 0.000 0.592 0.408
#> GSM447447 2 0.0000 0.832 0.000 1.000 0.000
#> GSM447454 2 0.0000 0.832 0.000 1.000 0.000
#> GSM447457 2 0.0000 0.832 0.000 1.000 0.000
#> GSM447460 2 0.0000 0.832 0.000 1.000 0.000
#> GSM447465 2 0.0000 0.832 0.000 1.000 0.000
#> GSM447471 1 0.3816 0.859 0.852 0.000 0.148
#> GSM447476 2 0.6154 0.275 0.000 0.592 0.408
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM447401 3 0.2281 0.8569 0.000 0.096 0.904 0.000
#> GSM447411 1 0.0592 0.8789 0.984 0.000 0.016 0.000
#> GSM447413 3 0.2281 0.8569 0.000 0.096 0.904 0.000
#> GSM447415 3 0.4059 0.7468 0.200 0.012 0.788 0.000
#> GSM447416 3 0.2281 0.8569 0.000 0.096 0.904 0.000
#> GSM447425 2 0.2329 0.8430 0.000 0.916 0.072 0.012
#> GSM447430 4 0.0000 0.8403 0.000 0.000 0.000 1.000
#> GSM447435 1 0.0592 0.8789 0.984 0.000 0.016 0.000
#> GSM447440 1 0.2530 0.8285 0.888 0.000 0.000 0.112
#> GSM447444 2 0.0188 0.8861 0.000 0.996 0.004 0.000
#> GSM447448 2 0.0188 0.8861 0.000 0.996 0.004 0.000
#> GSM447449 2 0.0188 0.8861 0.000 0.996 0.004 0.000
#> GSM447450 1 0.2530 0.8285 0.888 0.000 0.000 0.112
#> GSM447452 2 0.6708 0.3971 0.008 0.536 0.072 0.384
#> GSM447458 2 0.0000 0.8849 0.000 1.000 0.000 0.000
#> GSM447461 4 0.6365 0.2358 0.052 0.004 0.440 0.504
#> GSM447464 1 0.0592 0.8789 0.984 0.000 0.016 0.000
#> GSM447468 1 0.0188 0.8796 0.996 0.000 0.004 0.000
#> GSM447472 3 0.4319 0.7088 0.228 0.000 0.760 0.012
#> GSM447400 1 0.2053 0.8546 0.924 0.000 0.004 0.072
#> GSM447402 2 0.1716 0.8536 0.000 0.936 0.064 0.000
#> GSM447403 1 0.0592 0.8789 0.984 0.000 0.016 0.000
#> GSM447405 2 0.0336 0.8850 0.000 0.992 0.008 0.000
#> GSM447418 3 0.2281 0.8569 0.000 0.096 0.904 0.000
#> GSM447422 3 0.2281 0.8569 0.000 0.096 0.904 0.000
#> GSM447424 3 0.2281 0.8569 0.000 0.096 0.904 0.000
#> GSM447427 3 0.2281 0.8569 0.000 0.096 0.904 0.000
#> GSM447428 3 0.2281 0.8569 0.000 0.096 0.904 0.000
#> GSM447429 3 0.4059 0.7468 0.200 0.012 0.788 0.000
#> GSM447431 4 0.1174 0.8370 0.020 0.000 0.012 0.968
#> GSM447432 2 0.0000 0.8849 0.000 1.000 0.000 0.000
#> GSM447434 1 0.2530 0.8285 0.888 0.000 0.000 0.112
#> GSM447442 2 0.0188 0.8861 0.000 0.996 0.004 0.000
#> GSM447451 2 0.0188 0.8861 0.000 0.996 0.004 0.000
#> GSM447462 1 0.2053 0.8546 0.924 0.000 0.004 0.072
#> GSM447463 2 0.0188 0.8861 0.000 0.996 0.004 0.000
#> GSM447467 2 0.0188 0.8861 0.000 0.996 0.004 0.000
#> GSM447469 2 0.1716 0.8536 0.000 0.936 0.064 0.000
#> GSM447473 1 0.0336 0.8788 0.992 0.000 0.008 0.000
#> GSM447404 1 0.0336 0.8788 0.992 0.000 0.008 0.000
#> GSM447406 4 0.0000 0.8403 0.000 0.000 0.000 1.000
#> GSM447407 2 0.2329 0.8430 0.000 0.916 0.072 0.012
#> GSM447409 1 0.2530 0.8285 0.888 0.000 0.000 0.112
#> GSM447412 3 0.2546 0.8527 0.008 0.092 0.900 0.000
#> GSM447426 3 0.2281 0.8569 0.000 0.096 0.904 0.000
#> GSM447433 2 0.1796 0.8624 0.004 0.948 0.016 0.032
#> GSM447439 4 0.0000 0.8403 0.000 0.000 0.000 1.000
#> GSM447441 2 0.0188 0.8861 0.000 0.996 0.004 0.000
#> GSM447443 1 0.5060 0.2056 0.584 0.004 0.412 0.000
#> GSM447445 2 0.0188 0.8861 0.000 0.996 0.004 0.000
#> GSM447446 2 0.0188 0.8861 0.000 0.996 0.004 0.000
#> GSM447453 2 0.0188 0.8861 0.000 0.996 0.004 0.000
#> GSM447455 2 0.0000 0.8849 0.000 1.000 0.000 0.000
#> GSM447456 2 0.6687 0.4134 0.008 0.544 0.072 0.376
#> GSM447459 2 0.6708 0.3971 0.008 0.536 0.072 0.384
#> GSM447466 1 0.0592 0.8789 0.984 0.000 0.016 0.000
#> GSM447470 3 0.4319 0.7088 0.228 0.000 0.760 0.012
#> GSM447474 3 0.5025 0.6672 0.252 0.000 0.716 0.032
#> GSM447475 3 0.7010 -0.2499 0.100 0.004 0.448 0.448
#> GSM447398 4 0.0895 0.8399 0.020 0.000 0.004 0.976
#> GSM447399 4 0.0895 0.8399 0.020 0.000 0.004 0.976
#> GSM447408 2 0.6509 0.4473 0.004 0.564 0.072 0.360
#> GSM447410 2 0.6687 0.4136 0.008 0.544 0.072 0.376
#> GSM447414 4 0.5997 0.2736 0.032 0.004 0.436 0.528
#> GSM447417 2 0.2329 0.8430 0.000 0.916 0.072 0.012
#> GSM447419 1 0.5137 0.0948 0.544 0.004 0.452 0.000
#> GSM447420 3 0.2281 0.8569 0.000 0.096 0.904 0.000
#> GSM447421 3 0.4059 0.7468 0.200 0.012 0.788 0.000
#> GSM447423 3 0.2281 0.8569 0.000 0.096 0.904 0.000
#> GSM447436 2 0.0188 0.8861 0.000 0.996 0.004 0.000
#> GSM447437 2 0.0188 0.8861 0.000 0.996 0.004 0.000
#> GSM447438 2 0.6687 0.4134 0.008 0.544 0.072 0.376
#> GSM447447 2 0.0188 0.8861 0.000 0.996 0.004 0.000
#> GSM447454 2 0.0188 0.8861 0.000 0.996 0.004 0.000
#> GSM447457 2 0.0188 0.8861 0.000 0.996 0.004 0.000
#> GSM447460 2 0.0188 0.8861 0.000 0.996 0.004 0.000
#> GSM447465 2 0.0188 0.8861 0.000 0.996 0.004 0.000
#> GSM447471 1 0.0188 0.8796 0.996 0.000 0.004 0.000
#> GSM447476 2 0.6687 0.4136 0.008 0.544 0.072 0.376
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM447401 3 0.0963 0.8089 0.000 0.036 0.964 0.000 0.000
#> GSM447411 1 0.2989 0.8343 0.880 0.000 0.036 0.016 0.068
#> GSM447413 3 0.0963 0.8089 0.000 0.036 0.964 0.000 0.000
#> GSM447415 3 0.5987 0.6015 0.116 0.004 0.624 0.012 0.244
#> GSM447416 3 0.0963 0.8089 0.000 0.036 0.964 0.000 0.000
#> GSM447425 4 0.4321 0.4006 0.000 0.396 0.000 0.600 0.004
#> GSM447430 5 0.3730 0.9364 0.000 0.000 0.000 0.288 0.712
#> GSM447435 1 0.2989 0.8343 0.880 0.000 0.036 0.016 0.068
#> GSM447440 1 0.2522 0.8125 0.880 0.000 0.000 0.012 0.108
#> GSM447444 2 0.0000 0.9330 0.000 1.000 0.000 0.000 0.000
#> GSM447448 2 0.0000 0.9330 0.000 1.000 0.000 0.000 0.000
#> GSM447449 2 0.0162 0.9317 0.000 0.996 0.004 0.000 0.000
#> GSM447450 1 0.2522 0.8125 0.880 0.000 0.000 0.012 0.108
#> GSM447452 4 0.0693 0.6849 0.000 0.012 0.000 0.980 0.008
#> GSM447458 2 0.0162 0.9319 0.000 0.996 0.000 0.004 0.000
#> GSM447461 3 0.7283 -0.0663 0.036 0.000 0.412 0.196 0.356
#> GSM447464 1 0.2989 0.8343 0.880 0.000 0.036 0.016 0.068
#> GSM447468 1 0.0451 0.8540 0.988 0.000 0.008 0.004 0.000
#> GSM447472 3 0.4877 0.6890 0.132 0.000 0.760 0.036 0.072
#> GSM447400 1 0.1697 0.8368 0.932 0.000 0.000 0.008 0.060
#> GSM447402 2 0.4299 0.2488 0.000 0.608 0.000 0.388 0.004
#> GSM447403 1 0.2445 0.8415 0.908 0.000 0.020 0.016 0.056
#> GSM447405 2 0.1608 0.8721 0.000 0.928 0.000 0.072 0.000
#> GSM447418 3 0.0963 0.8089 0.000 0.036 0.964 0.000 0.000
#> GSM447422 3 0.0963 0.8089 0.000 0.036 0.964 0.000 0.000
#> GSM447424 3 0.0963 0.8089 0.000 0.036 0.964 0.000 0.000
#> GSM447427 3 0.0963 0.8089 0.000 0.036 0.964 0.000 0.000
#> GSM447428 3 0.0963 0.8089 0.000 0.036 0.964 0.000 0.000
#> GSM447429 3 0.5987 0.6015 0.116 0.004 0.624 0.012 0.244
#> GSM447431 5 0.4470 0.9208 0.012 0.000 0.000 0.372 0.616
#> GSM447432 2 0.0162 0.9319 0.000 0.996 0.000 0.004 0.000
#> GSM447434 1 0.2416 0.8117 0.888 0.000 0.000 0.012 0.100
#> GSM447442 2 0.1124 0.9070 0.000 0.960 0.004 0.036 0.000
#> GSM447451 2 0.0000 0.9330 0.000 1.000 0.000 0.000 0.000
#> GSM447462 1 0.1697 0.8368 0.932 0.000 0.000 0.008 0.060
#> GSM447463 2 0.0000 0.9330 0.000 1.000 0.000 0.000 0.000
#> GSM447467 2 0.0000 0.9330 0.000 1.000 0.000 0.000 0.000
#> GSM447469 2 0.4299 0.2488 0.000 0.608 0.000 0.388 0.004
#> GSM447473 1 0.0451 0.8535 0.988 0.000 0.008 0.004 0.000
#> GSM447404 1 0.0451 0.8535 0.988 0.000 0.008 0.004 0.000
#> GSM447406 5 0.3730 0.9364 0.000 0.000 0.000 0.288 0.712
#> GSM447407 4 0.4321 0.4006 0.000 0.396 0.000 0.600 0.004
#> GSM447409 1 0.2522 0.8125 0.880 0.000 0.000 0.012 0.108
#> GSM447412 3 0.1168 0.8053 0.008 0.032 0.960 0.000 0.000
#> GSM447426 3 0.0963 0.8089 0.000 0.036 0.964 0.000 0.000
#> GSM447433 2 0.4138 0.2951 0.000 0.616 0.000 0.384 0.000
#> GSM447439 5 0.3730 0.9364 0.000 0.000 0.000 0.288 0.712
#> GSM447441 2 0.0162 0.9317 0.000 0.996 0.004 0.000 0.000
#> GSM447443 1 0.5785 0.1877 0.528 0.004 0.396 0.004 0.068
#> GSM447445 2 0.0000 0.9330 0.000 1.000 0.000 0.000 0.000
#> GSM447446 2 0.0000 0.9330 0.000 1.000 0.000 0.000 0.000
#> GSM447453 2 0.0000 0.9330 0.000 1.000 0.000 0.000 0.000
#> GSM447455 2 0.0162 0.9319 0.000 0.996 0.000 0.004 0.000
#> GSM447456 4 0.0898 0.6930 0.000 0.020 0.000 0.972 0.008
#> GSM447459 4 0.0693 0.6849 0.000 0.012 0.000 0.980 0.008
#> GSM447466 1 0.2989 0.8343 0.880 0.000 0.036 0.016 0.068
#> GSM447470 3 0.4877 0.6890 0.132 0.000 0.760 0.036 0.072
#> GSM447474 3 0.5448 0.6624 0.156 0.000 0.716 0.048 0.080
#> GSM447475 3 0.7832 0.0430 0.092 0.000 0.416 0.188 0.304
#> GSM447398 5 0.4430 0.9335 0.012 0.000 0.000 0.360 0.628
#> GSM447399 5 0.4430 0.9335 0.012 0.000 0.000 0.360 0.628
#> GSM447408 4 0.1041 0.6881 0.000 0.032 0.000 0.964 0.004
#> GSM447410 4 0.0671 0.6928 0.000 0.016 0.000 0.980 0.004
#> GSM447414 3 0.7169 -0.1076 0.024 0.000 0.408 0.216 0.352
#> GSM447417 4 0.4321 0.4006 0.000 0.396 0.000 0.600 0.004
#> GSM447419 1 0.5834 0.0801 0.488 0.004 0.436 0.004 0.068
#> GSM447420 3 0.0963 0.8089 0.000 0.036 0.964 0.000 0.000
#> GSM447421 3 0.5987 0.6015 0.116 0.004 0.624 0.012 0.244
#> GSM447423 3 0.0963 0.8089 0.000 0.036 0.964 0.000 0.000
#> GSM447436 2 0.0000 0.9330 0.000 1.000 0.000 0.000 0.000
#> GSM447437 2 0.0000 0.9330 0.000 1.000 0.000 0.000 0.000
#> GSM447438 4 0.0898 0.6930 0.000 0.020 0.000 0.972 0.008
#> GSM447447 2 0.0000 0.9330 0.000 1.000 0.000 0.000 0.000
#> GSM447454 2 0.1124 0.9070 0.000 0.960 0.004 0.036 0.000
#> GSM447457 2 0.0162 0.9317 0.000 0.996 0.004 0.000 0.000
#> GSM447460 2 0.0162 0.9317 0.000 0.996 0.004 0.000 0.000
#> GSM447465 2 0.0162 0.9317 0.000 0.996 0.004 0.000 0.000
#> GSM447471 1 0.0451 0.8540 0.988 0.000 0.008 0.004 0.000
#> GSM447476 4 0.0671 0.6928 0.000 0.016 0.000 0.980 0.004
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM447401 3 0.0146 0.8266 0.000 0.004 0.996 0.000 0.000 0.000
#> GSM447411 1 0.3133 0.8452 0.780 0.000 0.000 0.000 0.008 0.212
#> GSM447413 3 0.0146 0.8266 0.000 0.004 0.996 0.000 0.000 0.000
#> GSM447415 6 0.1957 0.6216 0.000 0.000 0.112 0.000 0.000 0.888
#> GSM447416 3 0.0146 0.8266 0.000 0.004 0.996 0.000 0.000 0.000
#> GSM447425 4 0.4099 0.5213 0.000 0.372 0.000 0.612 0.000 0.016
#> GSM447430 5 0.3201 0.9222 0.000 0.000 0.000 0.208 0.780 0.012
#> GSM447435 1 0.3133 0.8452 0.780 0.000 0.000 0.000 0.008 0.212
#> GSM447440 1 0.0405 0.8590 0.988 0.000 0.000 0.000 0.008 0.004
#> GSM447444 2 0.1010 0.8368 0.000 0.960 0.000 0.000 0.036 0.004
#> GSM447448 2 0.3281 0.8018 0.000 0.784 0.000 0.004 0.200 0.012
#> GSM447449 2 0.0000 0.8344 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM447450 1 0.0405 0.8590 0.988 0.000 0.000 0.000 0.008 0.004
#> GSM447452 4 0.0405 0.7565 0.004 0.000 0.000 0.988 0.008 0.000
#> GSM447458 2 0.0146 0.8341 0.000 0.996 0.000 0.004 0.000 0.000
#> GSM447461 3 0.7113 0.0116 0.016 0.000 0.408 0.144 0.356 0.076
#> GSM447464 1 0.3133 0.8452 0.780 0.000 0.000 0.000 0.008 0.212
#> GSM447468 1 0.2003 0.8910 0.884 0.000 0.000 0.000 0.000 0.116
#> GSM447472 6 0.4434 0.3694 0.012 0.000 0.460 0.004 0.004 0.520
#> GSM447400 1 0.1007 0.8799 0.956 0.000 0.000 0.000 0.000 0.044
#> GSM447402 2 0.4159 0.0768 0.000 0.588 0.000 0.396 0.000 0.016
#> GSM447403 1 0.2697 0.8608 0.812 0.000 0.000 0.000 0.000 0.188
#> GSM447405 2 0.4655 0.7547 0.000 0.708 0.000 0.072 0.200 0.020
#> GSM447418 3 0.0260 0.8256 0.000 0.008 0.992 0.000 0.000 0.000
#> GSM447422 3 0.0146 0.8266 0.000 0.004 0.996 0.000 0.000 0.000
#> GSM447424 3 0.0260 0.8256 0.000 0.008 0.992 0.000 0.000 0.000
#> GSM447427 3 0.0260 0.8256 0.000 0.008 0.992 0.000 0.000 0.000
#> GSM447428 3 0.0405 0.8231 0.000 0.008 0.988 0.000 0.000 0.004
#> GSM447429 6 0.1957 0.6216 0.000 0.000 0.112 0.000 0.000 0.888
#> GSM447431 5 0.4585 0.9121 0.004 0.000 0.004 0.272 0.668 0.052
#> GSM447432 2 0.0146 0.8341 0.000 0.996 0.000 0.004 0.000 0.000
#> GSM447434 1 0.0000 0.8578 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM447442 2 0.0935 0.8167 0.000 0.964 0.000 0.032 0.000 0.004
#> GSM447451 2 0.1010 0.8368 0.000 0.960 0.000 0.000 0.036 0.004
#> GSM447462 1 0.1007 0.8799 0.956 0.000 0.000 0.000 0.000 0.044
#> GSM447463 2 0.3281 0.8018 0.000 0.784 0.000 0.004 0.200 0.012
#> GSM447467 2 0.1010 0.8368 0.000 0.960 0.000 0.000 0.036 0.004
#> GSM447469 2 0.4159 0.0768 0.000 0.588 0.000 0.396 0.000 0.016
#> GSM447473 1 0.2135 0.8887 0.872 0.000 0.000 0.000 0.000 0.128
#> GSM447404 1 0.2135 0.8887 0.872 0.000 0.000 0.000 0.000 0.128
#> GSM447406 5 0.3201 0.9222 0.000 0.000 0.000 0.208 0.780 0.012
#> GSM447407 4 0.4099 0.5213 0.000 0.372 0.000 0.612 0.000 0.016
#> GSM447409 1 0.0405 0.8590 0.988 0.000 0.000 0.000 0.008 0.004
#> GSM447412 3 0.0260 0.8170 0.000 0.000 0.992 0.000 0.000 0.008
#> GSM447426 3 0.0146 0.8266 0.000 0.004 0.996 0.000 0.000 0.000
#> GSM447433 2 0.6157 0.1358 0.000 0.404 0.000 0.392 0.192 0.012
#> GSM447439 5 0.3201 0.9222 0.000 0.000 0.000 0.208 0.780 0.012
#> GSM447441 2 0.0000 0.8344 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM447443 6 0.5077 0.1643 0.404 0.000 0.080 0.000 0.000 0.516
#> GSM447445 2 0.3281 0.8018 0.000 0.784 0.000 0.004 0.200 0.012
#> GSM447446 2 0.3281 0.8018 0.000 0.784 0.000 0.004 0.200 0.012
#> GSM447453 2 0.3281 0.8018 0.000 0.784 0.000 0.004 0.200 0.012
#> GSM447455 2 0.0146 0.8341 0.000 0.996 0.000 0.004 0.000 0.000
#> GSM447456 4 0.0696 0.7609 0.004 0.004 0.000 0.980 0.008 0.004
#> GSM447459 4 0.0405 0.7565 0.004 0.000 0.000 0.988 0.008 0.000
#> GSM447466 1 0.3133 0.8452 0.780 0.000 0.000 0.000 0.008 0.212
#> GSM447470 6 0.4434 0.3694 0.012 0.000 0.460 0.004 0.004 0.520
#> GSM447474 6 0.4625 0.3795 0.024 0.000 0.424 0.004 0.004 0.544
#> GSM447475 3 0.7542 0.0770 0.024 0.000 0.408 0.140 0.304 0.124
#> GSM447398 5 0.4405 0.9191 0.004 0.000 0.004 0.272 0.680 0.040
#> GSM447399 5 0.4405 0.9191 0.004 0.000 0.004 0.272 0.680 0.040
#> GSM447408 4 0.0725 0.7547 0.000 0.012 0.000 0.976 0.000 0.012
#> GSM447410 4 0.0146 0.7600 0.004 0.000 0.000 0.996 0.000 0.000
#> GSM447414 3 0.6948 -0.0255 0.004 0.000 0.404 0.168 0.352 0.072
#> GSM447417 4 0.4099 0.5213 0.000 0.372 0.000 0.612 0.000 0.016
#> GSM447419 6 0.5362 0.2795 0.356 0.000 0.120 0.000 0.000 0.524
#> GSM447420 3 0.0405 0.8231 0.000 0.008 0.988 0.000 0.000 0.004
#> GSM447421 6 0.1957 0.6216 0.000 0.000 0.112 0.000 0.000 0.888
#> GSM447423 3 0.0146 0.8266 0.000 0.004 0.996 0.000 0.000 0.000
#> GSM447436 2 0.3281 0.8018 0.000 0.784 0.000 0.004 0.200 0.012
#> GSM447437 2 0.3281 0.8018 0.000 0.784 0.000 0.004 0.200 0.012
#> GSM447438 4 0.0696 0.7609 0.004 0.004 0.000 0.980 0.008 0.004
#> GSM447447 2 0.3183 0.8030 0.000 0.788 0.000 0.004 0.200 0.008
#> GSM447454 2 0.0935 0.8167 0.000 0.964 0.000 0.032 0.000 0.004
#> GSM447457 2 0.0000 0.8344 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM447460 2 0.0000 0.8344 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM447465 2 0.0000 0.8344 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM447471 1 0.2003 0.8910 0.884 0.000 0.000 0.000 0.000 0.116
#> GSM447476 4 0.0146 0.7600 0.004 0.000 0.000 0.996 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 gender(p) agent(p) k
#> ATC:hclust 67 0.6325 0.542 2
#> ATC:hclust 64 0.2027 0.473 3
#> ATC:hclust 67 0.2327 0.763 4
#> ATC:hclust 68 0.0742 0.842 5
#> ATC:hclust 68 0.0966 0.881 6
If matrix rows can be associated to genes, consider to use functional_enrichment(res,
...)
to perform function enrichment for the signature genes. See this vignette for more detailed explanations.
The object with results only for a single top-value method and a single partition method can be extracted as:
res = res_list["ATC", "kmeans"]
# you can also extract it by
# res = res_list["ATC:kmeans"]
A summary of res
and all the functions that can be applied to it:
res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#> On a matrix with 51941 rows and 79 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 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.702 0.858 0.928 0.4952 0.503 0.503
#> 3 3 0.581 0.648 0.752 0.3207 0.741 0.536
#> 4 4 0.810 0.920 0.933 0.1338 0.825 0.555
#> 5 5 0.827 0.693 0.803 0.0683 0.930 0.736
#> 6 6 0.842 0.855 0.862 0.0425 0.925 0.666
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 4
Following shows the table of the partitions (You need to click the show/hide
code output link to see it). The membership matrix (columns with name p*
)
is inferred by
clue::cl_consensus()
function with the SE
method. Basically the value in the membership matrix
represents the probability to belong to a certain group. The finall class
label for an item is determined with the group with highest probability it
belongs to.
In get_classes()
function, the entropy is calculated from the membership
matrix and the silhouette score is calculated from the consensus matrix.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> GSM447401 2 0.8386 0.662 0.268 0.732
#> GSM447411 1 0.0672 0.925 0.992 0.008
#> GSM447413 2 0.8443 0.664 0.272 0.728
#> GSM447415 1 0.0672 0.925 0.992 0.008
#> GSM447416 2 0.8267 0.674 0.260 0.740
#> GSM447425 2 0.0672 0.916 0.008 0.992
#> GSM447430 1 0.4161 0.897 0.916 0.084
#> GSM447435 1 0.0672 0.925 0.992 0.008
#> GSM447440 1 0.0672 0.925 0.992 0.008
#> GSM447444 2 0.0376 0.916 0.004 0.996
#> GSM447448 2 0.0376 0.916 0.004 0.996
#> GSM447449 2 0.0000 0.917 0.000 1.000
#> GSM447450 1 0.0000 0.922 1.000 0.000
#> GSM447452 2 0.5294 0.827 0.120 0.880
#> GSM447458 2 0.0672 0.916 0.008 0.992
#> GSM447461 1 0.4161 0.897 0.916 0.084
#> GSM447464 1 0.0672 0.925 0.992 0.008
#> GSM447468 1 0.0672 0.925 0.992 0.008
#> GSM447472 1 0.0672 0.925 0.992 0.008
#> GSM447400 1 0.0672 0.925 0.992 0.008
#> GSM447402 2 0.0672 0.916 0.008 0.992
#> GSM447403 1 0.0672 0.925 0.992 0.008
#> GSM447405 2 0.0376 0.916 0.004 0.996
#> GSM447418 2 0.0376 0.916 0.004 0.996
#> GSM447422 2 0.3733 0.880 0.072 0.928
#> GSM447424 2 0.0376 0.916 0.004 0.996
#> GSM447427 2 0.4562 0.862 0.096 0.904
#> GSM447428 2 0.3274 0.888 0.060 0.940
#> GSM447429 2 0.9710 0.457 0.400 0.600
#> GSM447431 1 0.4161 0.897 0.916 0.084
#> GSM447432 2 0.0672 0.916 0.008 0.992
#> GSM447434 1 0.0000 0.922 1.000 0.000
#> GSM447442 2 0.0672 0.916 0.008 0.992
#> GSM447451 2 0.0000 0.917 0.000 1.000
#> GSM447462 1 0.0672 0.925 0.992 0.008
#> GSM447463 2 0.4161 0.863 0.084 0.916
#> GSM447467 2 0.0000 0.917 0.000 1.000
#> GSM447469 2 0.0672 0.916 0.008 0.992
#> GSM447473 1 0.0672 0.925 0.992 0.008
#> GSM447404 1 0.0672 0.925 0.992 0.008
#> GSM447406 1 0.4161 0.897 0.916 0.084
#> GSM447407 2 0.0672 0.916 0.008 0.992
#> GSM447409 1 0.0000 0.922 1.000 0.000
#> GSM447412 1 0.4298 0.898 0.912 0.088
#> GSM447426 2 0.4562 0.862 0.096 0.904
#> GSM447433 2 0.0672 0.916 0.008 0.992
#> GSM447439 1 0.4161 0.897 0.916 0.084
#> GSM447441 2 0.0672 0.916 0.008 0.992
#> GSM447443 1 0.0672 0.925 0.992 0.008
#> GSM447445 2 0.0376 0.916 0.004 0.996
#> GSM447446 2 0.0000 0.917 0.000 1.000
#> GSM447453 2 0.0376 0.916 0.004 0.996
#> GSM447455 2 0.0672 0.916 0.008 0.992
#> GSM447456 1 0.9933 0.276 0.548 0.452
#> GSM447459 1 0.7528 0.761 0.784 0.216
#> GSM447466 1 0.0672 0.925 0.992 0.008
#> GSM447470 2 0.9286 0.571 0.344 0.656
#> GSM447474 1 0.0672 0.925 0.992 0.008
#> GSM447475 1 0.4022 0.898 0.920 0.080
#> GSM447398 1 0.4161 0.897 0.916 0.084
#> GSM447399 1 0.4161 0.897 0.916 0.084
#> GSM447408 2 0.0672 0.916 0.008 0.992
#> GSM447410 2 0.7453 0.699 0.212 0.788
#> GSM447414 1 0.5408 0.861 0.876 0.124
#> GSM447417 2 0.0672 0.916 0.008 0.992
#> GSM447419 1 0.0672 0.925 0.992 0.008
#> GSM447420 2 0.6623 0.806 0.172 0.828
#> GSM447421 2 0.9661 0.475 0.392 0.608
#> GSM447423 2 0.8386 0.662 0.268 0.732
#> GSM447436 2 0.0376 0.916 0.004 0.996
#> GSM447437 2 0.4161 0.863 0.084 0.916
#> GSM447438 1 0.7056 0.792 0.808 0.192
#> GSM447447 2 0.0000 0.917 0.000 1.000
#> GSM447454 2 0.0000 0.917 0.000 1.000
#> GSM447457 2 0.0000 0.917 0.000 1.000
#> GSM447460 2 0.0672 0.916 0.008 0.992
#> GSM447465 2 0.0000 0.917 0.000 1.000
#> GSM447471 1 0.0672 0.925 0.992 0.008
#> GSM447476 1 0.9963 0.240 0.536 0.464
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM447401 3 0.8173 0.604 0.100 0.300 0.600
#> GSM447411 1 0.0000 0.868 1.000 0.000 0.000
#> GSM447413 3 0.8408 0.564 0.100 0.344 0.556
#> GSM447415 1 0.6653 0.561 0.680 0.288 0.032
#> GSM447416 3 0.8173 0.604 0.100 0.300 0.600
#> GSM447425 2 0.6291 0.360 0.000 0.532 0.468
#> GSM447430 2 0.6267 0.428 0.452 0.548 0.000
#> GSM447435 1 0.0000 0.868 1.000 0.000 0.000
#> GSM447440 1 0.2448 0.797 0.924 0.076 0.000
#> GSM447444 3 0.1031 0.756 0.000 0.024 0.976
#> GSM447448 3 0.1031 0.756 0.000 0.024 0.976
#> GSM447449 3 0.1163 0.743 0.000 0.028 0.972
#> GSM447450 1 0.2711 0.782 0.912 0.088 0.000
#> GSM447452 2 0.5591 0.552 0.000 0.696 0.304
#> GSM447458 3 0.3686 0.661 0.000 0.140 0.860
#> GSM447461 2 0.6267 0.428 0.452 0.548 0.000
#> GSM447464 1 0.0000 0.868 1.000 0.000 0.000
#> GSM447468 1 0.0000 0.868 1.000 0.000 0.000
#> GSM447472 1 0.0000 0.868 1.000 0.000 0.000
#> GSM447400 1 0.0747 0.859 0.984 0.016 0.000
#> GSM447402 3 0.3686 0.661 0.000 0.140 0.860
#> GSM447403 1 0.0000 0.868 1.000 0.000 0.000
#> GSM447405 3 0.1031 0.756 0.000 0.024 0.976
#> GSM447418 3 0.6956 0.635 0.040 0.300 0.660
#> GSM447422 3 0.7970 0.612 0.088 0.300 0.612
#> GSM447424 3 0.6512 0.641 0.024 0.300 0.676
#> GSM447427 3 0.7970 0.612 0.088 0.300 0.612
#> GSM447428 3 0.7995 0.620 0.088 0.304 0.608
#> GSM447429 1 0.8894 0.398 0.548 0.300 0.152
#> GSM447431 2 0.6267 0.428 0.452 0.548 0.000
#> GSM447432 3 0.3686 0.661 0.000 0.140 0.860
#> GSM447434 1 0.2711 0.782 0.912 0.088 0.000
#> GSM447442 3 0.3879 0.647 0.000 0.152 0.848
#> GSM447451 3 0.0000 0.754 0.000 0.000 1.000
#> GSM447462 1 0.0747 0.859 0.984 0.016 0.000
#> GSM447463 3 0.1031 0.756 0.000 0.024 0.976
#> GSM447467 3 0.0592 0.755 0.000 0.012 0.988
#> GSM447469 3 0.3686 0.661 0.000 0.140 0.860
#> GSM447473 1 0.0000 0.868 1.000 0.000 0.000
#> GSM447404 1 0.0000 0.868 1.000 0.000 0.000
#> GSM447406 2 0.5905 0.516 0.352 0.648 0.000
#> GSM447407 2 0.6286 0.369 0.000 0.536 0.464
#> GSM447409 1 0.2711 0.782 0.912 0.088 0.000
#> GSM447412 3 0.9959 0.221 0.324 0.300 0.376
#> GSM447426 3 0.7970 0.612 0.088 0.300 0.612
#> GSM447433 2 0.6252 0.360 0.000 0.556 0.444
#> GSM447439 2 0.6267 0.428 0.452 0.548 0.000
#> GSM447441 3 0.3686 0.661 0.000 0.140 0.860
#> GSM447443 1 0.0000 0.868 1.000 0.000 0.000
#> GSM447445 3 0.1031 0.756 0.000 0.024 0.976
#> GSM447446 3 0.4002 0.665 0.000 0.160 0.840
#> GSM447453 3 0.1031 0.756 0.000 0.024 0.976
#> GSM447455 3 0.3686 0.661 0.000 0.140 0.860
#> GSM447456 2 0.6541 0.561 0.024 0.672 0.304
#> GSM447459 2 0.6322 0.563 0.276 0.700 0.024
#> GSM447466 1 0.0000 0.868 1.000 0.000 0.000
#> GSM447470 3 0.8962 0.559 0.156 0.304 0.540
#> GSM447474 1 0.0000 0.868 1.000 0.000 0.000
#> GSM447475 2 0.6299 0.379 0.476 0.524 0.000
#> GSM447398 2 0.6267 0.428 0.452 0.548 0.000
#> GSM447399 2 0.6267 0.428 0.452 0.548 0.000
#> GSM447408 2 0.6140 0.458 0.000 0.596 0.404
#> GSM447410 2 0.5760 0.540 0.000 0.672 0.328
#> GSM447414 2 0.5681 0.440 0.236 0.748 0.016
#> GSM447417 2 0.6286 0.369 0.000 0.536 0.464
#> GSM447419 1 0.5254 0.613 0.736 0.264 0.000
#> GSM447420 3 0.8325 0.606 0.108 0.304 0.588
#> GSM447421 1 0.8894 0.398 0.548 0.300 0.152
#> GSM447423 3 0.8645 0.574 0.132 0.300 0.568
#> GSM447436 3 0.1031 0.756 0.000 0.024 0.976
#> GSM447437 3 0.1031 0.756 0.000 0.024 0.976
#> GSM447438 2 0.6229 0.561 0.280 0.700 0.020
#> GSM447447 3 0.1031 0.756 0.000 0.024 0.976
#> GSM447454 3 0.0000 0.754 0.000 0.000 1.000
#> GSM447457 3 0.0000 0.754 0.000 0.000 1.000
#> GSM447460 3 0.1529 0.737 0.000 0.040 0.960
#> GSM447465 3 0.0892 0.747 0.000 0.020 0.980
#> GSM447471 1 0.0747 0.859 0.984 0.016 0.000
#> GSM447476 2 0.6541 0.561 0.024 0.672 0.304
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM447401 3 0.1510 0.971 0.028 0.016 0.956 0.000
#> GSM447411 1 0.0779 0.964 0.980 0.000 0.016 0.004
#> GSM447413 3 0.1510 0.971 0.028 0.016 0.956 0.000
#> GSM447415 1 0.2310 0.908 0.920 0.004 0.068 0.008
#> GSM447416 3 0.1510 0.971 0.028 0.016 0.956 0.000
#> GSM447425 2 0.2882 0.857 0.000 0.892 0.024 0.084
#> GSM447430 4 0.1940 0.913 0.076 0.000 0.000 0.924
#> GSM447435 1 0.0779 0.964 0.980 0.000 0.016 0.004
#> GSM447440 1 0.1211 0.937 0.960 0.000 0.000 0.040
#> GSM447444 2 0.2773 0.908 0.004 0.880 0.116 0.000
#> GSM447448 2 0.2958 0.907 0.004 0.876 0.116 0.004
#> GSM447449 2 0.1022 0.918 0.000 0.968 0.032 0.000
#> GSM447450 1 0.1211 0.937 0.960 0.000 0.000 0.040
#> GSM447452 4 0.3325 0.865 0.000 0.112 0.024 0.864
#> GSM447458 2 0.0707 0.916 0.000 0.980 0.020 0.000
#> GSM447461 4 0.1940 0.913 0.076 0.000 0.000 0.924
#> GSM447464 1 0.0592 0.965 0.984 0.000 0.016 0.000
#> GSM447468 1 0.0592 0.965 0.984 0.000 0.016 0.000
#> GSM447472 1 0.0592 0.965 0.984 0.000 0.016 0.000
#> GSM447400 1 0.0188 0.960 0.996 0.000 0.000 0.004
#> GSM447402 2 0.0779 0.915 0.000 0.980 0.016 0.004
#> GSM447403 1 0.0779 0.964 0.980 0.000 0.016 0.004
#> GSM447405 2 0.2899 0.908 0.004 0.880 0.112 0.004
#> GSM447418 3 0.1211 0.961 0.000 0.040 0.960 0.000
#> GSM447422 3 0.1388 0.969 0.012 0.028 0.960 0.000
#> GSM447424 3 0.1474 0.949 0.000 0.052 0.948 0.000
#> GSM447427 3 0.1388 0.969 0.012 0.028 0.960 0.000
#> GSM447428 3 0.1339 0.966 0.008 0.024 0.964 0.004
#> GSM447429 3 0.2245 0.955 0.040 0.020 0.932 0.008
#> GSM447431 4 0.1940 0.913 0.076 0.000 0.000 0.924
#> GSM447432 2 0.0707 0.916 0.000 0.980 0.020 0.000
#> GSM447434 1 0.1302 0.934 0.956 0.000 0.000 0.044
#> GSM447442 2 0.2908 0.868 0.000 0.896 0.040 0.064
#> GSM447451 2 0.2831 0.906 0.004 0.876 0.120 0.000
#> GSM447462 1 0.0188 0.960 0.996 0.000 0.000 0.004
#> GSM447463 2 0.2958 0.907 0.004 0.876 0.116 0.004
#> GSM447467 2 0.2593 0.909 0.004 0.892 0.104 0.000
#> GSM447469 2 0.0707 0.916 0.000 0.980 0.020 0.000
#> GSM447473 1 0.0592 0.965 0.984 0.000 0.016 0.000
#> GSM447404 1 0.0592 0.965 0.984 0.000 0.016 0.000
#> GSM447406 4 0.0817 0.907 0.024 0.000 0.000 0.976
#> GSM447407 2 0.2882 0.857 0.000 0.892 0.024 0.084
#> GSM447409 1 0.1118 0.940 0.964 0.000 0.000 0.036
#> GSM447412 3 0.1557 0.953 0.056 0.000 0.944 0.000
#> GSM447426 3 0.1388 0.969 0.012 0.028 0.960 0.000
#> GSM447433 2 0.3077 0.866 0.004 0.892 0.036 0.068
#> GSM447439 4 0.1940 0.913 0.076 0.000 0.000 0.924
#> GSM447441 2 0.0817 0.917 0.000 0.976 0.024 0.000
#> GSM447443 1 0.0779 0.963 0.980 0.000 0.016 0.004
#> GSM447445 2 0.2958 0.907 0.004 0.876 0.116 0.004
#> GSM447446 2 0.0779 0.912 0.004 0.980 0.016 0.000
#> GSM447453 2 0.2958 0.907 0.004 0.876 0.116 0.004
#> GSM447455 2 0.0817 0.917 0.000 0.976 0.024 0.000
#> GSM447456 4 0.3266 0.867 0.000 0.108 0.024 0.868
#> GSM447459 4 0.1471 0.898 0.004 0.012 0.024 0.960
#> GSM447466 1 0.0592 0.965 0.984 0.000 0.016 0.000
#> GSM447470 3 0.2245 0.955 0.040 0.020 0.932 0.008
#> GSM447474 1 0.0592 0.965 0.984 0.000 0.016 0.000
#> GSM447475 4 0.1940 0.913 0.076 0.000 0.000 0.924
#> GSM447398 4 0.1940 0.913 0.076 0.000 0.000 0.924
#> GSM447399 4 0.1940 0.913 0.076 0.000 0.000 0.924
#> GSM447408 4 0.4464 0.767 0.000 0.208 0.024 0.768
#> GSM447410 4 0.3325 0.865 0.000 0.112 0.024 0.864
#> GSM447414 4 0.2255 0.910 0.068 0.000 0.012 0.920
#> GSM447417 2 0.2882 0.857 0.000 0.892 0.024 0.084
#> GSM447419 1 0.4483 0.601 0.712 0.000 0.284 0.004
#> GSM447420 3 0.1771 0.960 0.012 0.036 0.948 0.004
#> GSM447421 3 0.2245 0.955 0.040 0.020 0.932 0.008
#> GSM447423 3 0.1488 0.969 0.032 0.012 0.956 0.000
#> GSM447436 2 0.2958 0.907 0.004 0.876 0.116 0.004
#> GSM447437 2 0.2958 0.907 0.004 0.876 0.116 0.004
#> GSM447438 4 0.1486 0.900 0.008 0.008 0.024 0.960
#> GSM447447 2 0.2773 0.908 0.004 0.880 0.116 0.000
#> GSM447454 2 0.2647 0.906 0.000 0.880 0.120 0.000
#> GSM447457 2 0.2647 0.906 0.000 0.880 0.120 0.000
#> GSM447460 2 0.1022 0.918 0.000 0.968 0.032 0.000
#> GSM447465 2 0.1022 0.918 0.000 0.968 0.032 0.000
#> GSM447471 1 0.0188 0.960 0.996 0.000 0.000 0.004
#> GSM447476 4 0.3325 0.865 0.000 0.112 0.024 0.864
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM447401 3 0.0671 0.9446 0.004 0.000 0.980 0.016 0.000
#> GSM447411 1 0.0609 0.9492 0.980 0.000 0.000 0.020 0.000
#> GSM447413 3 0.0671 0.9446 0.004 0.000 0.980 0.016 0.000
#> GSM447415 1 0.3525 0.8189 0.816 0.000 0.024 0.156 0.004
#> GSM447416 3 0.0451 0.9461 0.004 0.000 0.988 0.008 0.000
#> GSM447425 4 0.3779 0.4273 0.000 0.200 0.000 0.776 0.024
#> GSM447430 5 0.0955 0.8779 0.028 0.000 0.000 0.004 0.968
#> GSM447435 1 0.0609 0.9492 0.980 0.000 0.000 0.020 0.000
#> GSM447440 1 0.0613 0.9477 0.984 0.000 0.004 0.008 0.004
#> GSM447444 2 0.0162 0.6891 0.000 0.996 0.000 0.004 0.000
#> GSM447448 2 0.0000 0.6896 0.000 1.000 0.000 0.000 0.000
#> GSM447449 2 0.4251 0.5701 0.000 0.624 0.004 0.372 0.000
#> GSM447450 1 0.0613 0.9477 0.984 0.000 0.004 0.008 0.004
#> GSM447452 4 0.4306 0.0323 0.000 0.000 0.000 0.508 0.492
#> GSM447458 2 0.4430 0.4623 0.000 0.540 0.004 0.456 0.000
#> GSM447461 5 0.1547 0.8698 0.032 0.000 0.004 0.016 0.948
#> GSM447464 1 0.0609 0.9492 0.980 0.000 0.000 0.020 0.000
#> GSM447468 1 0.0290 0.9505 0.992 0.000 0.000 0.008 0.000
#> GSM447472 1 0.0771 0.9481 0.976 0.000 0.004 0.020 0.000
#> GSM447400 1 0.0566 0.9489 0.984 0.000 0.004 0.012 0.000
#> GSM447402 4 0.4451 -0.4313 0.000 0.492 0.004 0.504 0.000
#> GSM447403 1 0.0510 0.9503 0.984 0.000 0.000 0.016 0.000
#> GSM447405 2 0.0609 0.6814 0.000 0.980 0.000 0.020 0.000
#> GSM447418 3 0.0510 0.9456 0.000 0.000 0.984 0.016 0.000
#> GSM447422 3 0.0404 0.9443 0.000 0.000 0.988 0.012 0.000
#> GSM447424 3 0.0510 0.9456 0.000 0.000 0.984 0.016 0.000
#> GSM447427 3 0.0671 0.9460 0.004 0.000 0.980 0.016 0.000
#> GSM447428 3 0.2548 0.9127 0.004 0.004 0.876 0.116 0.000
#> GSM447429 3 0.3538 0.8855 0.016 0.004 0.816 0.160 0.004
#> GSM447431 5 0.0955 0.8777 0.028 0.000 0.000 0.004 0.968
#> GSM447432 2 0.4430 0.4623 0.000 0.540 0.004 0.456 0.000
#> GSM447434 1 0.3067 0.8142 0.844 0.000 0.004 0.012 0.140
#> GSM447442 4 0.4155 0.3741 0.000 0.228 0.004 0.744 0.024
#> GSM447451 2 0.3715 0.6420 0.000 0.736 0.004 0.260 0.000
#> GSM447462 1 0.0566 0.9489 0.984 0.000 0.004 0.012 0.000
#> GSM447463 2 0.0510 0.6839 0.000 0.984 0.000 0.016 0.000
#> GSM447467 2 0.3662 0.6448 0.000 0.744 0.004 0.252 0.000
#> GSM447469 4 0.4452 -0.4360 0.000 0.496 0.004 0.500 0.000
#> GSM447473 1 0.0510 0.9504 0.984 0.000 0.000 0.016 0.000
#> GSM447404 1 0.0510 0.9504 0.984 0.000 0.000 0.016 0.000
#> GSM447406 5 0.0290 0.8552 0.000 0.000 0.000 0.008 0.992
#> GSM447407 4 0.3779 0.4273 0.000 0.200 0.000 0.776 0.024
#> GSM447409 1 0.0324 0.9492 0.992 0.000 0.000 0.004 0.004
#> GSM447412 3 0.0451 0.9448 0.004 0.000 0.988 0.008 0.000
#> GSM447426 3 0.0324 0.9466 0.004 0.000 0.992 0.004 0.000
#> GSM447433 2 0.4878 -0.1151 0.000 0.536 0.000 0.440 0.024
#> GSM447439 5 0.0955 0.8779 0.028 0.000 0.000 0.004 0.968
#> GSM447441 2 0.4430 0.4623 0.000 0.540 0.004 0.456 0.000
#> GSM447443 1 0.0609 0.9503 0.980 0.000 0.000 0.020 0.000
#> GSM447445 2 0.0290 0.6887 0.000 0.992 0.000 0.008 0.000
#> GSM447446 2 0.0290 0.6887 0.000 0.992 0.000 0.008 0.000
#> GSM447453 2 0.0290 0.6887 0.000 0.992 0.000 0.008 0.000
#> GSM447455 2 0.4430 0.4623 0.000 0.540 0.004 0.456 0.000
#> GSM447456 4 0.4448 0.0651 0.000 0.004 0.000 0.516 0.480
#> GSM447459 5 0.3949 0.4227 0.000 0.000 0.000 0.332 0.668
#> GSM447466 1 0.0404 0.9506 0.988 0.000 0.000 0.012 0.000
#> GSM447470 3 0.3712 0.8796 0.020 0.004 0.804 0.168 0.004
#> GSM447474 1 0.0771 0.9481 0.976 0.000 0.004 0.020 0.000
#> GSM447475 5 0.1710 0.8642 0.040 0.000 0.004 0.016 0.940
#> GSM447398 5 0.0794 0.8779 0.028 0.000 0.000 0.000 0.972
#> GSM447399 5 0.0794 0.8779 0.028 0.000 0.000 0.000 0.972
#> GSM447408 4 0.3934 0.4431 0.000 0.016 0.000 0.740 0.244
#> GSM447410 4 0.4304 0.0556 0.000 0.000 0.000 0.516 0.484
#> GSM447414 5 0.3356 0.7595 0.024 0.000 0.120 0.012 0.844
#> GSM447417 4 0.3779 0.4273 0.000 0.200 0.000 0.776 0.024
#> GSM447419 1 0.6209 0.3913 0.560 0.000 0.268 0.168 0.004
#> GSM447420 3 0.3035 0.8994 0.004 0.004 0.844 0.144 0.004
#> GSM447421 3 0.3538 0.8855 0.016 0.004 0.816 0.160 0.004
#> GSM447423 3 0.0324 0.9466 0.004 0.000 0.992 0.004 0.000
#> GSM447436 2 0.0290 0.6887 0.000 0.992 0.000 0.008 0.000
#> GSM447437 2 0.0510 0.6839 0.000 0.984 0.000 0.016 0.000
#> GSM447438 5 0.4015 0.3864 0.000 0.000 0.000 0.348 0.652
#> GSM447447 2 0.0000 0.6896 0.000 1.000 0.000 0.000 0.000
#> GSM447454 2 0.4251 0.5701 0.000 0.624 0.004 0.372 0.000
#> GSM447457 2 0.3838 0.6328 0.000 0.716 0.004 0.280 0.000
#> GSM447460 2 0.4430 0.4623 0.000 0.540 0.004 0.456 0.000
#> GSM447465 2 0.4251 0.5701 0.000 0.624 0.004 0.372 0.000
#> GSM447471 1 0.0404 0.9500 0.988 0.000 0.000 0.012 0.000
#> GSM447476 4 0.4448 0.0651 0.000 0.004 0.000 0.516 0.480
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM447401 3 0.1059 0.854 0.016 0.000 0.964 0.004 0.016 0.000
#> GSM447411 6 0.1003 0.916 0.028 0.000 0.000 0.004 0.004 0.964
#> GSM447413 3 0.1059 0.854 0.016 0.000 0.964 0.004 0.016 0.000
#> GSM447415 6 0.5169 0.637 0.224 0.000 0.000 0.024 0.096 0.656
#> GSM447416 3 0.0000 0.868 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM447425 4 0.3136 0.754 0.004 0.228 0.000 0.768 0.000 0.000
#> GSM447430 5 0.3154 0.912 0.012 0.000 0.000 0.184 0.800 0.004
#> GSM447435 6 0.1003 0.916 0.028 0.000 0.000 0.004 0.004 0.964
#> GSM447440 6 0.1863 0.900 0.016 0.000 0.000 0.004 0.060 0.920
#> GSM447444 1 0.3464 0.992 0.688 0.312 0.000 0.000 0.000 0.000
#> GSM447448 1 0.3446 0.998 0.692 0.308 0.000 0.000 0.000 0.000
#> GSM447449 2 0.0000 0.875 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM447450 6 0.1863 0.900 0.016 0.000 0.000 0.004 0.060 0.920
#> GSM447452 4 0.0790 0.831 0.000 0.032 0.000 0.968 0.000 0.000
#> GSM447458 2 0.1387 0.895 0.000 0.932 0.000 0.068 0.000 0.000
#> GSM447461 5 0.3423 0.873 0.036 0.000 0.000 0.148 0.808 0.008
#> GSM447464 6 0.1003 0.916 0.028 0.000 0.000 0.004 0.004 0.964
#> GSM447468 6 0.0520 0.915 0.008 0.000 0.000 0.000 0.008 0.984
#> GSM447472 6 0.2213 0.902 0.044 0.000 0.000 0.004 0.048 0.904
#> GSM447400 6 0.1225 0.909 0.012 0.000 0.000 0.000 0.036 0.952
#> GSM447402 2 0.1908 0.871 0.004 0.900 0.000 0.096 0.000 0.000
#> GSM447403 6 0.0935 0.915 0.032 0.000 0.000 0.004 0.000 0.964
#> GSM447405 1 0.3653 0.986 0.692 0.300 0.000 0.008 0.000 0.000
#> GSM447418 3 0.1334 0.868 0.032 0.000 0.948 0.000 0.020 0.000
#> GSM447422 3 0.0291 0.867 0.004 0.000 0.992 0.004 0.000 0.000
#> GSM447424 3 0.1334 0.868 0.032 0.000 0.948 0.000 0.020 0.000
#> GSM447427 3 0.1334 0.868 0.032 0.000 0.948 0.000 0.020 0.000
#> GSM447428 3 0.4471 0.792 0.156 0.000 0.736 0.016 0.092 0.000
#> GSM447429 3 0.5910 0.726 0.232 0.000 0.612 0.024 0.108 0.024
#> GSM447431 5 0.2838 0.912 0.000 0.000 0.000 0.188 0.808 0.004
#> GSM447432 2 0.1387 0.895 0.000 0.932 0.000 0.068 0.000 0.000
#> GSM447434 6 0.3430 0.744 0.016 0.000 0.000 0.004 0.208 0.772
#> GSM447442 2 0.3684 0.316 0.000 0.628 0.000 0.372 0.000 0.000
#> GSM447451 2 0.0865 0.840 0.036 0.964 0.000 0.000 0.000 0.000
#> GSM447462 6 0.1225 0.909 0.012 0.000 0.000 0.000 0.036 0.952
#> GSM447463 1 0.3446 0.998 0.692 0.308 0.000 0.000 0.000 0.000
#> GSM447467 2 0.0937 0.834 0.040 0.960 0.000 0.000 0.000 0.000
#> GSM447469 2 0.1765 0.872 0.000 0.904 0.000 0.096 0.000 0.000
#> GSM447473 6 0.0405 0.916 0.008 0.000 0.000 0.004 0.000 0.988
#> GSM447404 6 0.0405 0.916 0.008 0.000 0.000 0.004 0.000 0.988
#> GSM447406 5 0.3046 0.910 0.012 0.000 0.000 0.188 0.800 0.000
#> GSM447407 4 0.3136 0.754 0.004 0.228 0.000 0.768 0.000 0.000
#> GSM447409 6 0.0603 0.914 0.004 0.000 0.000 0.000 0.016 0.980
#> GSM447412 3 0.0260 0.867 0.008 0.000 0.992 0.000 0.000 0.000
#> GSM447426 3 0.0291 0.869 0.004 0.000 0.992 0.000 0.004 0.000
#> GSM447433 4 0.3543 0.709 0.200 0.032 0.000 0.768 0.000 0.000
#> GSM447439 5 0.3154 0.912 0.012 0.000 0.000 0.184 0.800 0.004
#> GSM447441 2 0.1387 0.895 0.000 0.932 0.000 0.068 0.000 0.000
#> GSM447443 6 0.0935 0.915 0.032 0.000 0.000 0.004 0.000 0.964
#> GSM447445 1 0.3446 0.998 0.692 0.308 0.000 0.000 0.000 0.000
#> GSM447446 1 0.3446 0.998 0.692 0.308 0.000 0.000 0.000 0.000
#> GSM447453 1 0.3446 0.998 0.692 0.308 0.000 0.000 0.000 0.000
#> GSM447455 2 0.1327 0.895 0.000 0.936 0.000 0.064 0.000 0.000
#> GSM447456 4 0.0935 0.833 0.004 0.032 0.000 0.964 0.000 0.000
#> GSM447459 4 0.2053 0.700 0.004 0.000 0.000 0.888 0.108 0.000
#> GSM447466 6 0.0922 0.916 0.024 0.000 0.000 0.004 0.004 0.968
#> GSM447470 3 0.6058 0.698 0.256 0.000 0.580 0.028 0.120 0.016
#> GSM447474 6 0.2213 0.902 0.044 0.000 0.000 0.004 0.048 0.904
#> GSM447475 5 0.4254 0.843 0.060 0.000 0.004 0.144 0.768 0.024
#> GSM447398 5 0.2933 0.912 0.000 0.000 0.000 0.200 0.796 0.004
#> GSM447399 5 0.2933 0.912 0.000 0.000 0.000 0.200 0.796 0.004
#> GSM447408 4 0.2520 0.815 0.004 0.152 0.000 0.844 0.000 0.000
#> GSM447410 4 0.0935 0.833 0.004 0.032 0.000 0.964 0.000 0.000
#> GSM447414 5 0.5271 0.631 0.028 0.000 0.272 0.076 0.624 0.000
#> GSM447417 4 0.3136 0.754 0.004 0.228 0.000 0.768 0.000 0.000
#> GSM447419 6 0.7618 0.275 0.236 0.000 0.168 0.028 0.128 0.440
#> GSM447420 3 0.5233 0.748 0.220 0.000 0.648 0.020 0.112 0.000
#> GSM447421 3 0.5910 0.726 0.232 0.000 0.612 0.024 0.108 0.024
#> GSM447423 3 0.0000 0.868 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM447436 1 0.3446 0.998 0.692 0.308 0.000 0.000 0.000 0.000
#> GSM447437 1 0.3446 0.998 0.692 0.308 0.000 0.000 0.000 0.000
#> GSM447438 4 0.1411 0.770 0.000 0.004 0.000 0.936 0.060 0.000
#> GSM447447 1 0.3446 0.998 0.692 0.308 0.000 0.000 0.000 0.000
#> GSM447454 2 0.0146 0.874 0.000 0.996 0.000 0.004 0.000 0.000
#> GSM447457 2 0.0790 0.844 0.032 0.968 0.000 0.000 0.000 0.000
#> GSM447460 2 0.1327 0.895 0.000 0.936 0.000 0.064 0.000 0.000
#> GSM447465 2 0.0000 0.875 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM447471 6 0.0520 0.915 0.008 0.000 0.000 0.000 0.008 0.984
#> GSM447476 4 0.0935 0.833 0.004 0.032 0.000 0.964 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 gender(p) agent(p) k
#> ATC:kmeans 75 1.0000 0.125 2
#> ATC:kmeans 63 0.0654 0.157 3
#> ATC:kmeans 79 0.0884 0.398 4
#> ATC:kmeans 59 0.2578 0.233 5
#> ATC:kmeans 77 0.1052 0.381 6
If matrix rows can be associated to genes, consider to use functional_enrichment(res,
...)
to perform function enrichment for the signature genes. See this vignette for more detailed explanations.
The object with results only for a single top-value method and a single partition method can be extracted as:
res = res_list["ATC", "skmeans"]
# you can also extract it by
# res = res_list["ATC:skmeans"]
A summary of res
and all the functions that can be applied to it:
res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#> On a matrix with 51941 rows and 79 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'ATC' method.
#> Subgroups are detected by 'skmeans' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 6.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 0.697 0.811 0.930 0.5048 0.496 0.496
#> 3 3 0.704 0.931 0.947 0.3000 0.758 0.552
#> 4 4 1.000 0.990 0.995 0.1325 0.848 0.597
#> 5 5 0.890 0.921 0.935 0.0774 0.929 0.730
#> 6 6 0.995 0.956 0.971 0.0391 0.950 0.760
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 6
#> attr(,"optional")
#> [1] 4
There is also optional best \(k\) = 4 that is worth to check.
Following shows the table of the partitions (You need to click the show/hide
code output link to see it). The membership matrix (columns with name p*
)
is inferred by
clue::cl_consensus()
function with the SE
method. Basically the value in the membership matrix
represents the probability to belong to a certain group. The finall class
label for an item is determined with the group with highest probability it
belongs to.
In get_classes()
function, the entropy is calculated from the membership
matrix and the silhouette score is calculated from the consensus matrix.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> GSM447401 2 0.994 0.1865 0.456 0.544
#> GSM447411 1 0.000 0.9237 1.000 0.000
#> GSM447413 2 0.994 0.1865 0.456 0.544
#> GSM447415 1 0.000 0.9237 1.000 0.000
#> GSM447416 2 0.994 0.1865 0.456 0.544
#> GSM447425 2 0.000 0.9128 0.000 1.000
#> GSM447430 1 0.000 0.9237 1.000 0.000
#> GSM447435 1 0.000 0.9237 1.000 0.000
#> GSM447440 1 0.000 0.9237 1.000 0.000
#> GSM447444 2 0.000 0.9128 0.000 1.000
#> GSM447448 2 0.000 0.9128 0.000 1.000
#> GSM447449 2 0.000 0.9128 0.000 1.000
#> GSM447450 1 0.000 0.9237 1.000 0.000
#> GSM447452 2 0.966 0.2994 0.392 0.608
#> GSM447458 2 0.000 0.9128 0.000 1.000
#> GSM447461 1 0.000 0.9237 1.000 0.000
#> GSM447464 1 0.000 0.9237 1.000 0.000
#> GSM447468 1 0.000 0.9237 1.000 0.000
#> GSM447472 1 0.000 0.9237 1.000 0.000
#> GSM447400 1 0.000 0.9237 1.000 0.000
#> GSM447402 2 0.000 0.9128 0.000 1.000
#> GSM447403 1 0.000 0.9237 1.000 0.000
#> GSM447405 2 0.000 0.9128 0.000 1.000
#> GSM447418 2 0.000 0.9128 0.000 1.000
#> GSM447422 2 0.373 0.8596 0.072 0.928
#> GSM447424 2 0.000 0.9128 0.000 1.000
#> GSM447427 2 0.518 0.8189 0.116 0.884
#> GSM447428 2 0.373 0.8596 0.072 0.928
#> GSM447429 1 0.969 0.2815 0.604 0.396
#> GSM447431 1 0.000 0.9237 1.000 0.000
#> GSM447432 2 0.000 0.9128 0.000 1.000
#> GSM447434 1 0.000 0.9237 1.000 0.000
#> GSM447442 2 0.000 0.9128 0.000 1.000
#> GSM447451 2 0.000 0.9128 0.000 1.000
#> GSM447462 1 0.000 0.9237 1.000 0.000
#> GSM447463 2 0.000 0.9128 0.000 1.000
#> GSM447467 2 0.000 0.9128 0.000 1.000
#> GSM447469 2 0.000 0.9128 0.000 1.000
#> GSM447473 1 0.000 0.9237 1.000 0.000
#> GSM447404 1 0.000 0.9237 1.000 0.000
#> GSM447406 1 0.000 0.9237 1.000 0.000
#> GSM447407 2 0.000 0.9128 0.000 1.000
#> GSM447409 1 0.000 0.9237 1.000 0.000
#> GSM447412 1 0.000 0.9237 1.000 0.000
#> GSM447426 2 0.518 0.8189 0.116 0.884
#> GSM447433 2 0.000 0.9128 0.000 1.000
#> GSM447439 1 0.000 0.9237 1.000 0.000
#> GSM447441 2 0.000 0.9128 0.000 1.000
#> GSM447443 1 0.000 0.9237 1.000 0.000
#> GSM447445 2 0.000 0.9128 0.000 1.000
#> GSM447446 2 0.000 0.9128 0.000 1.000
#> GSM447453 2 0.000 0.9128 0.000 1.000
#> GSM447455 2 0.000 0.9128 0.000 1.000
#> GSM447456 1 0.994 0.1479 0.544 0.456
#> GSM447459 1 0.541 0.8027 0.876 0.124
#> GSM447466 1 0.000 0.9237 1.000 0.000
#> GSM447470 1 0.969 0.2815 0.604 0.396
#> GSM447474 1 0.000 0.9237 1.000 0.000
#> GSM447475 1 0.000 0.9237 1.000 0.000
#> GSM447398 1 0.000 0.9237 1.000 0.000
#> GSM447399 1 0.000 0.9237 1.000 0.000
#> GSM447408 2 0.000 0.9128 0.000 1.000
#> GSM447410 2 0.969 0.2888 0.396 0.604
#> GSM447414 1 0.000 0.9237 1.000 0.000
#> GSM447417 2 0.000 0.9128 0.000 1.000
#> GSM447419 1 0.000 0.9237 1.000 0.000
#> GSM447420 2 0.518 0.8189 0.116 0.884
#> GSM447421 1 0.969 0.2815 0.604 0.396
#> GSM447423 2 0.999 0.0935 0.484 0.516
#> GSM447436 2 0.000 0.9128 0.000 1.000
#> GSM447437 2 0.000 0.9128 0.000 1.000
#> GSM447438 1 0.518 0.8112 0.884 0.116
#> GSM447447 2 0.000 0.9128 0.000 1.000
#> GSM447454 2 0.000 0.9128 0.000 1.000
#> GSM447457 2 0.000 0.9128 0.000 1.000
#> GSM447460 2 0.000 0.9128 0.000 1.000
#> GSM447465 2 0.000 0.9128 0.000 1.000
#> GSM447471 1 0.000 0.9237 1.000 0.000
#> GSM447476 1 0.999 0.0572 0.516 0.484
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM447401 3 0.2959 0.924 0.000 0.100 0.900
#> GSM447411 1 0.0237 0.957 0.996 0.000 0.004
#> GSM447413 3 0.0237 0.865 0.004 0.000 0.996
#> GSM447415 3 0.3482 0.880 0.128 0.000 0.872
#> GSM447416 3 0.3375 0.925 0.008 0.100 0.892
#> GSM447425 2 0.2959 0.913 0.000 0.900 0.100
#> GSM447430 1 0.3116 0.914 0.892 0.000 0.108
#> GSM447435 1 0.0237 0.957 0.996 0.000 0.004
#> GSM447440 1 0.0000 0.957 1.000 0.000 0.000
#> GSM447444 2 0.0000 0.961 0.000 1.000 0.000
#> GSM447448 2 0.0000 0.961 0.000 1.000 0.000
#> GSM447449 2 0.0000 0.961 0.000 1.000 0.000
#> GSM447450 1 0.0000 0.957 1.000 0.000 0.000
#> GSM447452 2 0.3349 0.905 0.004 0.888 0.108
#> GSM447458 2 0.0000 0.961 0.000 1.000 0.000
#> GSM447461 1 0.3116 0.914 0.892 0.000 0.108
#> GSM447464 1 0.0237 0.957 0.996 0.000 0.004
#> GSM447468 1 0.0237 0.957 0.996 0.000 0.004
#> GSM447472 1 0.0237 0.957 0.996 0.000 0.004
#> GSM447400 1 0.0237 0.957 0.996 0.000 0.004
#> GSM447402 2 0.0000 0.961 0.000 1.000 0.000
#> GSM447403 1 0.0237 0.957 0.996 0.000 0.004
#> GSM447405 2 0.0000 0.961 0.000 1.000 0.000
#> GSM447418 3 0.3192 0.922 0.000 0.112 0.888
#> GSM447422 3 0.3192 0.922 0.000 0.112 0.888
#> GSM447424 3 0.3192 0.922 0.000 0.112 0.888
#> GSM447427 3 0.3116 0.924 0.000 0.108 0.892
#> GSM447428 3 0.3116 0.924 0.000 0.108 0.892
#> GSM447429 3 0.3116 0.892 0.108 0.000 0.892
#> GSM447431 1 0.3116 0.914 0.892 0.000 0.108
#> GSM447432 2 0.0000 0.961 0.000 1.000 0.000
#> GSM447434 1 0.0000 0.957 1.000 0.000 0.000
#> GSM447442 2 0.2959 0.913 0.000 0.900 0.100
#> GSM447451 2 0.0000 0.961 0.000 1.000 0.000
#> GSM447462 1 0.0237 0.957 0.996 0.000 0.004
#> GSM447463 2 0.0000 0.961 0.000 1.000 0.000
#> GSM447467 2 0.0000 0.961 0.000 1.000 0.000
#> GSM447469 2 0.0000 0.961 0.000 1.000 0.000
#> GSM447473 1 0.0237 0.957 0.996 0.000 0.004
#> GSM447404 1 0.0237 0.957 0.996 0.000 0.004
#> GSM447406 1 0.3116 0.914 0.892 0.000 0.108
#> GSM447407 2 0.2959 0.913 0.000 0.900 0.100
#> GSM447409 1 0.0000 0.957 1.000 0.000 0.000
#> GSM447412 3 0.3116 0.892 0.108 0.000 0.892
#> GSM447426 3 0.3116 0.924 0.000 0.108 0.892
#> GSM447433 2 0.2959 0.913 0.000 0.900 0.100
#> GSM447439 1 0.3116 0.914 0.892 0.000 0.108
#> GSM447441 2 0.0000 0.961 0.000 1.000 0.000
#> GSM447443 1 0.0237 0.957 0.996 0.000 0.004
#> GSM447445 2 0.0000 0.961 0.000 1.000 0.000
#> GSM447446 2 0.0000 0.961 0.000 1.000 0.000
#> GSM447453 2 0.0000 0.961 0.000 1.000 0.000
#> GSM447455 2 0.0000 0.961 0.000 1.000 0.000
#> GSM447456 2 0.5117 0.852 0.060 0.832 0.108
#> GSM447459 1 0.3987 0.897 0.872 0.020 0.108
#> GSM447466 1 0.0237 0.957 0.996 0.000 0.004
#> GSM447470 3 0.3116 0.892 0.108 0.000 0.892
#> GSM447474 1 0.0237 0.957 0.996 0.000 0.004
#> GSM447475 1 0.1163 0.948 0.972 0.000 0.028
#> GSM447398 1 0.3116 0.914 0.892 0.000 0.108
#> GSM447399 1 0.3116 0.914 0.892 0.000 0.108
#> GSM447408 2 0.3116 0.908 0.000 0.892 0.108
#> GSM447410 2 0.3349 0.905 0.004 0.888 0.108
#> GSM447414 3 0.4452 0.676 0.192 0.000 0.808
#> GSM447417 2 0.2959 0.913 0.000 0.900 0.100
#> GSM447419 3 0.4399 0.825 0.188 0.000 0.812
#> GSM447420 3 0.3116 0.924 0.000 0.108 0.892
#> GSM447421 3 0.3116 0.892 0.108 0.000 0.892
#> GSM447423 3 0.3375 0.925 0.008 0.100 0.892
#> GSM447436 2 0.0000 0.961 0.000 1.000 0.000
#> GSM447437 2 0.0000 0.961 0.000 1.000 0.000
#> GSM447438 1 0.3116 0.914 0.892 0.000 0.108
#> GSM447447 2 0.0000 0.961 0.000 1.000 0.000
#> GSM447454 2 0.0000 0.961 0.000 1.000 0.000
#> GSM447457 2 0.0000 0.961 0.000 1.000 0.000
#> GSM447460 2 0.0000 0.961 0.000 1.000 0.000
#> GSM447465 2 0.0000 0.961 0.000 1.000 0.000
#> GSM447471 1 0.0237 0.957 0.996 0.000 0.004
#> GSM447476 2 0.3349 0.905 0.004 0.888 0.108
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM447401 3 0.0000 1.000 0.000 0.000 1.000 0.000
#> GSM447411 1 0.0000 0.991 1.000 0.000 0.000 0.000
#> GSM447413 3 0.0000 1.000 0.000 0.000 1.000 0.000
#> GSM447415 1 0.0188 0.987 0.996 0.000 0.004 0.000
#> GSM447416 3 0.0000 1.000 0.000 0.000 1.000 0.000
#> GSM447425 2 0.0469 0.986 0.000 0.988 0.000 0.012
#> GSM447430 4 0.0188 0.992 0.004 0.000 0.000 0.996
#> GSM447435 1 0.0000 0.991 1.000 0.000 0.000 0.000
#> GSM447440 1 0.0000 0.991 1.000 0.000 0.000 0.000
#> GSM447444 2 0.0000 0.995 0.000 1.000 0.000 0.000
#> GSM447448 2 0.0000 0.995 0.000 1.000 0.000 0.000
#> GSM447449 2 0.0000 0.995 0.000 1.000 0.000 0.000
#> GSM447450 1 0.0000 0.991 1.000 0.000 0.000 0.000
#> GSM447452 4 0.0000 0.992 0.000 0.000 0.000 1.000
#> GSM447458 2 0.0000 0.995 0.000 1.000 0.000 0.000
#> GSM447461 4 0.0188 0.992 0.004 0.000 0.000 0.996
#> GSM447464 1 0.0000 0.991 1.000 0.000 0.000 0.000
#> GSM447468 1 0.0000 0.991 1.000 0.000 0.000 0.000
#> GSM447472 1 0.0000 0.991 1.000 0.000 0.000 0.000
#> GSM447400 1 0.0000 0.991 1.000 0.000 0.000 0.000
#> GSM447402 2 0.0000 0.995 0.000 1.000 0.000 0.000
#> GSM447403 1 0.0000 0.991 1.000 0.000 0.000 0.000
#> GSM447405 2 0.0000 0.995 0.000 1.000 0.000 0.000
#> GSM447418 3 0.0000 1.000 0.000 0.000 1.000 0.000
#> GSM447422 3 0.0000 1.000 0.000 0.000 1.000 0.000
#> GSM447424 3 0.0000 1.000 0.000 0.000 1.000 0.000
#> GSM447427 3 0.0000 1.000 0.000 0.000 1.000 0.000
#> GSM447428 3 0.0000 1.000 0.000 0.000 1.000 0.000
#> GSM447429 3 0.0000 1.000 0.000 0.000 1.000 0.000
#> GSM447431 4 0.0188 0.992 0.004 0.000 0.000 0.996
#> GSM447432 2 0.0000 0.995 0.000 1.000 0.000 0.000
#> GSM447434 1 0.0000 0.991 1.000 0.000 0.000 0.000
#> GSM447442 2 0.0188 0.993 0.000 0.996 0.000 0.004
#> GSM447451 2 0.0000 0.995 0.000 1.000 0.000 0.000
#> GSM447462 1 0.0000 0.991 1.000 0.000 0.000 0.000
#> GSM447463 2 0.0000 0.995 0.000 1.000 0.000 0.000
#> GSM447467 2 0.0000 0.995 0.000 1.000 0.000 0.000
#> GSM447469 2 0.0000 0.995 0.000 1.000 0.000 0.000
#> GSM447473 1 0.0000 0.991 1.000 0.000 0.000 0.000
#> GSM447404 1 0.0000 0.991 1.000 0.000 0.000 0.000
#> GSM447406 4 0.0000 0.992 0.000 0.000 0.000 1.000
#> GSM447407 2 0.2469 0.881 0.000 0.892 0.000 0.108
#> GSM447409 1 0.0000 0.991 1.000 0.000 0.000 0.000
#> GSM447412 3 0.0000 1.000 0.000 0.000 1.000 0.000
#> GSM447426 3 0.0000 1.000 0.000 0.000 1.000 0.000
#> GSM447433 2 0.0188 0.993 0.000 0.996 0.000 0.004
#> GSM447439 4 0.0188 0.992 0.004 0.000 0.000 0.996
#> GSM447441 2 0.0000 0.995 0.000 1.000 0.000 0.000
#> GSM447443 1 0.0000 0.991 1.000 0.000 0.000 0.000
#> GSM447445 2 0.0000 0.995 0.000 1.000 0.000 0.000
#> GSM447446 2 0.0000 0.995 0.000 1.000 0.000 0.000
#> GSM447453 2 0.0000 0.995 0.000 1.000 0.000 0.000
#> GSM447455 2 0.0000 0.995 0.000 1.000 0.000 0.000
#> GSM447456 4 0.0000 0.992 0.000 0.000 0.000 1.000
#> GSM447459 4 0.0000 0.992 0.000 0.000 0.000 1.000
#> GSM447466 1 0.0000 0.991 1.000 0.000 0.000 0.000
#> GSM447470 3 0.0000 1.000 0.000 0.000 1.000 0.000
#> GSM447474 1 0.0000 0.991 1.000 0.000 0.000 0.000
#> GSM447475 4 0.1637 0.937 0.060 0.000 0.000 0.940
#> GSM447398 4 0.0188 0.992 0.004 0.000 0.000 0.996
#> GSM447399 4 0.0188 0.992 0.004 0.000 0.000 0.996
#> GSM447408 4 0.0707 0.973 0.000 0.020 0.000 0.980
#> GSM447410 4 0.0000 0.992 0.000 0.000 0.000 1.000
#> GSM447414 4 0.0188 0.992 0.004 0.000 0.000 0.996
#> GSM447417 2 0.0188 0.993 0.000 0.996 0.000 0.004
#> GSM447419 1 0.3172 0.810 0.840 0.000 0.160 0.000
#> GSM447420 3 0.0000 1.000 0.000 0.000 1.000 0.000
#> GSM447421 3 0.0000 1.000 0.000 0.000 1.000 0.000
#> GSM447423 3 0.0000 1.000 0.000 0.000 1.000 0.000
#> GSM447436 2 0.0000 0.995 0.000 1.000 0.000 0.000
#> GSM447437 2 0.0000 0.995 0.000 1.000 0.000 0.000
#> GSM447438 4 0.0000 0.992 0.000 0.000 0.000 1.000
#> GSM447447 2 0.0000 0.995 0.000 1.000 0.000 0.000
#> GSM447454 2 0.0000 0.995 0.000 1.000 0.000 0.000
#> GSM447457 2 0.0000 0.995 0.000 1.000 0.000 0.000
#> GSM447460 2 0.0000 0.995 0.000 1.000 0.000 0.000
#> GSM447465 2 0.0000 0.995 0.000 1.000 0.000 0.000
#> GSM447471 1 0.0000 0.991 1.000 0.000 0.000 0.000
#> GSM447476 4 0.0000 0.992 0.000 0.000 0.000 1.000
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM447401 3 0.0000 0.999 0.000 0.000 1.000 0.000 0.000
#> GSM447411 1 0.0000 0.982 1.000 0.000 0.000 0.000 0.000
#> GSM447413 3 0.0000 0.999 0.000 0.000 1.000 0.000 0.000
#> GSM447415 1 0.0162 0.979 0.996 0.000 0.000 0.000 0.004
#> GSM447416 3 0.0000 0.999 0.000 0.000 1.000 0.000 0.000
#> GSM447425 2 0.3366 0.755 0.000 0.784 0.000 0.004 0.212
#> GSM447430 4 0.0162 0.912 0.004 0.000 0.000 0.996 0.000
#> GSM447435 1 0.0000 0.982 1.000 0.000 0.000 0.000 0.000
#> GSM447440 1 0.0000 0.982 1.000 0.000 0.000 0.000 0.000
#> GSM447444 5 0.3242 0.969 0.000 0.216 0.000 0.000 0.784
#> GSM447448 5 0.3242 0.969 0.000 0.216 0.000 0.000 0.784
#> GSM447449 2 0.0162 0.886 0.000 0.996 0.000 0.000 0.004
#> GSM447450 1 0.0000 0.982 1.000 0.000 0.000 0.000 0.000
#> GSM447452 4 0.3366 0.860 0.000 0.004 0.000 0.784 0.212
#> GSM447458 2 0.0000 0.888 0.000 1.000 0.000 0.000 0.000
#> GSM447461 4 0.0162 0.912 0.004 0.000 0.000 0.996 0.000
#> GSM447464 1 0.0000 0.982 1.000 0.000 0.000 0.000 0.000
#> GSM447468 1 0.0000 0.982 1.000 0.000 0.000 0.000 0.000
#> GSM447472 1 0.0000 0.982 1.000 0.000 0.000 0.000 0.000
#> GSM447400 1 0.0000 0.982 1.000 0.000 0.000 0.000 0.000
#> GSM447402 2 0.0404 0.884 0.000 0.988 0.000 0.000 0.012
#> GSM447403 1 0.0000 0.982 1.000 0.000 0.000 0.000 0.000
#> GSM447405 5 0.3210 0.965 0.000 0.212 0.000 0.000 0.788
#> GSM447418 3 0.0000 0.999 0.000 0.000 1.000 0.000 0.000
#> GSM447422 3 0.0000 0.999 0.000 0.000 1.000 0.000 0.000
#> GSM447424 3 0.0000 0.999 0.000 0.000 1.000 0.000 0.000
#> GSM447427 3 0.0000 0.999 0.000 0.000 1.000 0.000 0.000
#> GSM447428 3 0.0162 0.998 0.000 0.000 0.996 0.000 0.004
#> GSM447429 3 0.0162 0.998 0.000 0.000 0.996 0.000 0.004
#> GSM447431 4 0.0162 0.912 0.004 0.000 0.000 0.996 0.000
#> GSM447432 2 0.0000 0.888 0.000 1.000 0.000 0.000 0.000
#> GSM447434 1 0.2813 0.814 0.832 0.000 0.000 0.168 0.000
#> GSM447442 2 0.3210 0.757 0.000 0.788 0.000 0.000 0.212
#> GSM447451 2 0.0290 0.884 0.000 0.992 0.000 0.000 0.008
#> GSM447462 1 0.0000 0.982 1.000 0.000 0.000 0.000 0.000
#> GSM447463 5 0.3242 0.969 0.000 0.216 0.000 0.000 0.784
#> GSM447467 2 0.0290 0.884 0.000 0.992 0.000 0.000 0.008
#> GSM447469 2 0.0404 0.884 0.000 0.988 0.000 0.000 0.012
#> GSM447473 1 0.0000 0.982 1.000 0.000 0.000 0.000 0.000
#> GSM447404 1 0.0000 0.982 1.000 0.000 0.000 0.000 0.000
#> GSM447406 4 0.0000 0.910 0.000 0.000 0.000 1.000 0.000
#> GSM447407 2 0.3366 0.755 0.000 0.784 0.000 0.004 0.212
#> GSM447409 1 0.0000 0.982 1.000 0.000 0.000 0.000 0.000
#> GSM447412 3 0.0000 0.999 0.000 0.000 1.000 0.000 0.000
#> GSM447426 3 0.0000 0.999 0.000 0.000 1.000 0.000 0.000
#> GSM447433 5 0.0451 0.695 0.000 0.008 0.000 0.004 0.988
#> GSM447439 4 0.0162 0.912 0.004 0.000 0.000 0.996 0.000
#> GSM447441 2 0.0000 0.888 0.000 1.000 0.000 0.000 0.000
#> GSM447443 1 0.0000 0.982 1.000 0.000 0.000 0.000 0.000
#> GSM447445 5 0.3242 0.969 0.000 0.216 0.000 0.000 0.784
#> GSM447446 5 0.3242 0.969 0.000 0.216 0.000 0.000 0.784
#> GSM447453 5 0.3242 0.969 0.000 0.216 0.000 0.000 0.784
#> GSM447455 2 0.0000 0.888 0.000 1.000 0.000 0.000 0.000
#> GSM447456 4 0.3366 0.860 0.000 0.004 0.000 0.784 0.212
#> GSM447459 4 0.3143 0.865 0.000 0.000 0.000 0.796 0.204
#> GSM447466 1 0.0000 0.982 1.000 0.000 0.000 0.000 0.000
#> GSM447470 3 0.0162 0.998 0.000 0.000 0.996 0.000 0.004
#> GSM447474 1 0.0000 0.982 1.000 0.000 0.000 0.000 0.000
#> GSM447475 4 0.0290 0.909 0.008 0.000 0.000 0.992 0.000
#> GSM447398 4 0.0162 0.912 0.004 0.000 0.000 0.996 0.000
#> GSM447399 4 0.0162 0.912 0.004 0.000 0.000 0.996 0.000
#> GSM447408 2 0.6507 0.182 0.000 0.472 0.000 0.316 0.212
#> GSM447410 4 0.3366 0.860 0.000 0.004 0.000 0.784 0.212
#> GSM447414 4 0.0162 0.912 0.004 0.000 0.000 0.996 0.000
#> GSM447417 2 0.3366 0.755 0.000 0.784 0.000 0.004 0.212
#> GSM447419 1 0.2690 0.814 0.844 0.000 0.156 0.000 0.000
#> GSM447420 3 0.0162 0.998 0.000 0.000 0.996 0.000 0.004
#> GSM447421 3 0.0162 0.998 0.000 0.000 0.996 0.000 0.004
#> GSM447423 3 0.0000 0.999 0.000 0.000 1.000 0.000 0.000
#> GSM447436 5 0.3242 0.969 0.000 0.216 0.000 0.000 0.784
#> GSM447437 5 0.3242 0.969 0.000 0.216 0.000 0.000 0.784
#> GSM447438 4 0.3109 0.866 0.000 0.000 0.000 0.800 0.200
#> GSM447447 5 0.3242 0.969 0.000 0.216 0.000 0.000 0.784
#> GSM447454 2 0.0162 0.886 0.000 0.996 0.000 0.000 0.004
#> GSM447457 2 0.0162 0.886 0.000 0.996 0.000 0.000 0.004
#> GSM447460 2 0.0000 0.888 0.000 1.000 0.000 0.000 0.000
#> GSM447465 2 0.0162 0.886 0.000 0.996 0.000 0.000 0.004
#> GSM447471 1 0.0000 0.982 1.000 0.000 0.000 0.000 0.000
#> GSM447476 4 0.3366 0.860 0.000 0.004 0.000 0.784 0.212
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM447401 3 0.0000 0.9743 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM447411 6 0.0000 0.9588 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM447413 3 0.0000 0.9743 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM447415 6 0.1838 0.8924 0.016 0.000 0.000 0.068 0.000 0.916
#> GSM447416 3 0.0000 0.9743 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM447425 4 0.1387 0.9341 0.000 0.068 0.000 0.932 0.000 0.000
#> GSM447430 5 0.0000 0.9910 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM447435 6 0.0000 0.9588 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM447440 6 0.0000 0.9588 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM447444 1 0.0632 0.9911 0.976 0.024 0.000 0.000 0.000 0.000
#> GSM447448 1 0.0458 0.9990 0.984 0.016 0.000 0.000 0.000 0.000
#> GSM447449 2 0.0146 0.9918 0.004 0.996 0.000 0.000 0.000 0.000
#> GSM447450 6 0.0000 0.9588 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM447452 4 0.1471 0.9570 0.000 0.004 0.000 0.932 0.064 0.000
#> GSM447458 2 0.0000 0.9922 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM447461 5 0.0000 0.9910 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM447464 6 0.0000 0.9588 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM447468 6 0.0000 0.9588 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM447472 6 0.0000 0.9588 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM447400 6 0.0000 0.9588 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM447402 2 0.1075 0.9496 0.000 0.952 0.000 0.048 0.000 0.000
#> GSM447403 6 0.0000 0.9588 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM447405 1 0.0458 0.9990 0.984 0.016 0.000 0.000 0.000 0.000
#> GSM447418 3 0.0000 0.9743 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM447422 3 0.0000 0.9743 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM447424 3 0.0000 0.9743 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM447427 3 0.0000 0.9743 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM447428 3 0.1745 0.9487 0.012 0.000 0.920 0.068 0.000 0.000
#> GSM447429 3 0.1838 0.9472 0.016 0.000 0.916 0.068 0.000 0.000
#> GSM447431 5 0.0000 0.9910 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM447432 2 0.0000 0.9922 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM447434 6 0.3864 0.0828 0.000 0.000 0.000 0.000 0.480 0.520
#> GSM447442 2 0.0458 0.9779 0.000 0.984 0.000 0.016 0.000 0.000
#> GSM447451 2 0.0146 0.9918 0.004 0.996 0.000 0.000 0.000 0.000
#> GSM447462 6 0.0000 0.9588 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM447463 1 0.0458 0.9990 0.984 0.016 0.000 0.000 0.000 0.000
#> GSM447467 2 0.0146 0.9918 0.004 0.996 0.000 0.000 0.000 0.000
#> GSM447469 2 0.0146 0.9893 0.000 0.996 0.000 0.004 0.000 0.000
#> GSM447473 6 0.0000 0.9588 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM447404 6 0.0000 0.9588 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM447406 5 0.0000 0.9910 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM447407 4 0.1387 0.9341 0.000 0.068 0.000 0.932 0.000 0.000
#> GSM447409 6 0.0000 0.9588 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM447412 3 0.0000 0.9743 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM447426 3 0.0000 0.9743 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM447433 4 0.1471 0.9211 0.064 0.004 0.000 0.932 0.000 0.000
#> GSM447439 5 0.0000 0.9910 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM447441 2 0.0000 0.9922 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM447443 6 0.0000 0.9588 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM447445 1 0.0458 0.9990 0.984 0.016 0.000 0.000 0.000 0.000
#> GSM447446 1 0.0458 0.9990 0.984 0.016 0.000 0.000 0.000 0.000
#> GSM447453 1 0.0458 0.9990 0.984 0.016 0.000 0.000 0.000 0.000
#> GSM447455 2 0.0000 0.9922 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM447456 4 0.1471 0.9570 0.000 0.004 0.000 0.932 0.064 0.000
#> GSM447459 4 0.1610 0.9457 0.000 0.000 0.000 0.916 0.084 0.000
#> GSM447466 6 0.0000 0.9588 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM447470 3 0.1838 0.9472 0.016 0.000 0.916 0.068 0.000 0.000
#> GSM447474 6 0.0000 0.9588 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM447475 5 0.0000 0.9910 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM447398 5 0.0000 0.9910 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM447399 5 0.0000 0.9910 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM447408 4 0.1649 0.9524 0.000 0.032 0.000 0.932 0.036 0.000
#> GSM447410 4 0.1471 0.9570 0.000 0.004 0.000 0.932 0.064 0.000
#> GSM447414 5 0.1267 0.9281 0.000 0.000 0.060 0.000 0.940 0.000
#> GSM447417 4 0.1387 0.9341 0.000 0.068 0.000 0.932 0.000 0.000
#> GSM447419 6 0.3798 0.7534 0.008 0.000 0.136 0.068 0.000 0.788
#> GSM447420 3 0.1838 0.9472 0.016 0.000 0.916 0.068 0.000 0.000
#> GSM447421 3 0.1838 0.9472 0.016 0.000 0.916 0.068 0.000 0.000
#> GSM447423 3 0.0000 0.9743 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM447436 1 0.0458 0.9990 0.984 0.016 0.000 0.000 0.000 0.000
#> GSM447437 1 0.0458 0.9990 0.984 0.016 0.000 0.000 0.000 0.000
#> GSM447438 4 0.1814 0.9333 0.000 0.000 0.000 0.900 0.100 0.000
#> GSM447447 1 0.0458 0.9990 0.984 0.016 0.000 0.000 0.000 0.000
#> GSM447454 2 0.0146 0.9918 0.004 0.996 0.000 0.000 0.000 0.000
#> GSM447457 2 0.0146 0.9918 0.004 0.996 0.000 0.000 0.000 0.000
#> GSM447460 2 0.0000 0.9922 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM447465 2 0.0146 0.9918 0.004 0.996 0.000 0.000 0.000 0.000
#> GSM447471 6 0.0000 0.9588 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM447476 4 0.1471 0.9570 0.000 0.004 0.000 0.932 0.064 0.000
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)
An example of the output of tb
is:
#> which_row fdr mean_1 mean_2 scaled_mean_1 scaled_mean_2 km
#> 1 38 0.042760348 8.373488 9.131774 -0.5533452 0.5164555 1
#> 2 40 0.018707592 7.106213 8.469186 -0.6173731 0.5762149 1
#> 3 55 0.019134737 10.221463 11.207825 -0.6159697 0.5749050 1
#> 4 59 0.006059896 5.921854 7.869574 -0.6899429 0.6439467 1
#> 5 60 0.018055526 8.928898 10.211722 -0.6204761 0.5791110 1
#> 6 98 0.009384629 15.714769 14.887706 0.6635654 -0.6193277 2
...
The columns in tb
are:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.km
: Row groups if k-means clustering is applied to rows.UMAP plot which shows how samples are separated.
dimension_reduction(res, k = 2, method = "UMAP")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.
test_to_known_factors(res)
#> n gender(p) agent(p) k
#> ATC:skmeans 68 1.0000 0.0536 2
#> ATC:skmeans 79 0.5740 0.1408 3
#> ATC:skmeans 79 0.0884 0.3980 4
#> ATC:skmeans 78 0.1621 0.4022 5
#> ATC:skmeans 78 0.1557 0.3109 6
If matrix rows can be associated to genes, consider to use functional_enrichment(res,
...)
to perform function enrichment for the signature genes. See this vignette for more detailed explanations.
The object with results only for a single top-value method and a single partition method can be extracted as:
res = res_list["ATC", "pam"]
# you can also extract it by
# res = res_list["ATC:pam"]
A summary of res
and all the functions that can be applied to it:
res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#> On a matrix with 51941 rows and 79 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'ATC' method.
#> Subgroups are detected by 'pam' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 6.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 1.000 0.971 0.989 0.4945 0.503 0.503
#> 3 3 1.000 0.969 0.983 0.2825 0.824 0.663
#> 4 4 0.834 0.832 0.927 0.1812 0.823 0.552
#> 5 5 0.975 0.944 0.972 0.0499 0.950 0.805
#> 6 6 0.908 0.822 0.921 0.0427 0.904 0.606
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 6
#> attr(,"optional")
#> [1] 2 3 5
There is also optional best \(k\) = 2 3 5 that is worth to check.
Following shows the table of the partitions (You need to click the show/hide
code output link to see it). The membership matrix (columns with name p*
)
is inferred by
clue::cl_consensus()
function with the SE
method. Basically the value in the membership matrix
represents the probability to belong to a certain group. The finall class
label for an item is determined with the group with highest probability it
belongs to.
In get_classes()
function, the entropy is calculated from the membership
matrix and the silhouette score is calculated from the consensus matrix.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> GSM447401 1 0.0000 0.9969 1.000 0.000
#> GSM447411 1 0.0000 0.9969 1.000 0.000
#> GSM447413 1 0.0000 0.9969 1.000 0.000
#> GSM447415 1 0.0000 0.9969 1.000 0.000
#> GSM447416 1 0.0000 0.9969 1.000 0.000
#> GSM447425 2 0.1184 0.9631 0.016 0.984
#> GSM447430 1 0.0000 0.9969 1.000 0.000
#> GSM447435 1 0.0000 0.9969 1.000 0.000
#> GSM447440 1 0.0000 0.9969 1.000 0.000
#> GSM447444 2 0.0000 0.9768 0.000 1.000
#> GSM447448 2 0.0000 0.9768 0.000 1.000
#> GSM447449 2 0.0000 0.9768 0.000 1.000
#> GSM447450 1 0.0000 0.9969 1.000 0.000
#> GSM447452 1 0.0000 0.9969 1.000 0.000
#> GSM447458 2 0.0000 0.9768 0.000 1.000
#> GSM447461 1 0.0000 0.9969 1.000 0.000
#> GSM447464 1 0.0000 0.9969 1.000 0.000
#> GSM447468 1 0.0000 0.9969 1.000 0.000
#> GSM447472 1 0.0000 0.9969 1.000 0.000
#> GSM447400 1 0.0000 0.9969 1.000 0.000
#> GSM447402 2 0.0000 0.9768 0.000 1.000
#> GSM447403 1 0.0000 0.9969 1.000 0.000
#> GSM447405 1 0.4939 0.8763 0.892 0.108
#> GSM447418 2 0.0000 0.9768 0.000 1.000
#> GSM447422 2 1.0000 0.0383 0.496 0.504
#> GSM447424 2 0.0000 0.9768 0.000 1.000
#> GSM447427 2 0.0000 0.9768 0.000 1.000
#> GSM447428 2 0.0000 0.9768 0.000 1.000
#> GSM447429 1 0.0000 0.9969 1.000 0.000
#> GSM447431 1 0.0000 0.9969 1.000 0.000
#> GSM447432 2 0.0000 0.9768 0.000 1.000
#> GSM447434 1 0.0000 0.9969 1.000 0.000
#> GSM447442 2 0.0000 0.9768 0.000 1.000
#> GSM447451 2 0.0000 0.9768 0.000 1.000
#> GSM447462 1 0.0000 0.9969 1.000 0.000
#> GSM447463 2 0.0000 0.9768 0.000 1.000
#> GSM447467 2 0.0000 0.9768 0.000 1.000
#> GSM447469 2 0.0000 0.9768 0.000 1.000
#> GSM447473 1 0.0000 0.9969 1.000 0.000
#> GSM447404 1 0.0000 0.9969 1.000 0.000
#> GSM447406 1 0.0000 0.9969 1.000 0.000
#> GSM447407 2 0.0000 0.9768 0.000 1.000
#> GSM447409 1 0.0000 0.9969 1.000 0.000
#> GSM447412 1 0.0000 0.9969 1.000 0.000
#> GSM447426 2 0.7883 0.6897 0.236 0.764
#> GSM447433 1 0.1633 0.9731 0.976 0.024
#> GSM447439 1 0.0000 0.9969 1.000 0.000
#> GSM447441 2 0.0000 0.9768 0.000 1.000
#> GSM447443 1 0.0000 0.9969 1.000 0.000
#> GSM447445 2 0.0000 0.9768 0.000 1.000
#> GSM447446 2 0.0000 0.9768 0.000 1.000
#> GSM447453 2 0.0000 0.9768 0.000 1.000
#> GSM447455 2 0.0000 0.9768 0.000 1.000
#> GSM447456 1 0.0000 0.9969 1.000 0.000
#> GSM447459 1 0.0000 0.9969 1.000 0.000
#> GSM447466 1 0.0000 0.9969 1.000 0.000
#> GSM447470 1 0.0000 0.9969 1.000 0.000
#> GSM447474 1 0.0000 0.9969 1.000 0.000
#> GSM447475 1 0.0000 0.9969 1.000 0.000
#> GSM447398 1 0.0000 0.9969 1.000 0.000
#> GSM447399 1 0.0000 0.9969 1.000 0.000
#> GSM447408 2 0.0938 0.9668 0.012 0.988
#> GSM447410 1 0.0000 0.9969 1.000 0.000
#> GSM447414 1 0.0000 0.9969 1.000 0.000
#> GSM447417 2 0.0000 0.9768 0.000 1.000
#> GSM447419 1 0.0000 0.9969 1.000 0.000
#> GSM447420 2 0.0000 0.9768 0.000 1.000
#> GSM447421 1 0.0000 0.9969 1.000 0.000
#> GSM447423 1 0.0000 0.9969 1.000 0.000
#> GSM447436 2 0.0000 0.9768 0.000 1.000
#> GSM447437 2 0.0000 0.9768 0.000 1.000
#> GSM447438 1 0.0000 0.9969 1.000 0.000
#> GSM447447 2 0.0000 0.9768 0.000 1.000
#> GSM447454 2 0.0000 0.9768 0.000 1.000
#> GSM447457 2 0.0000 0.9768 0.000 1.000
#> GSM447460 2 0.0000 0.9768 0.000 1.000
#> GSM447465 2 0.0000 0.9768 0.000 1.000
#> GSM447471 1 0.0000 0.9969 1.000 0.000
#> GSM447476 1 0.0000 0.9969 1.000 0.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM447401 3 0.0000 0.960 0.000 0.000 1.000
#> GSM447411 1 0.0237 0.982 0.996 0.000 0.004
#> GSM447413 3 0.3941 0.834 0.156 0.000 0.844
#> GSM447415 1 0.1031 0.970 0.976 0.000 0.024
#> GSM447416 3 0.0000 0.960 0.000 0.000 1.000
#> GSM447425 2 0.0983 0.975 0.016 0.980 0.004
#> GSM447430 1 0.0000 0.982 1.000 0.000 0.000
#> GSM447435 1 0.0237 0.982 0.996 0.000 0.004
#> GSM447440 1 0.0000 0.982 1.000 0.000 0.000
#> GSM447444 2 0.1289 0.970 0.000 0.968 0.032
#> GSM447448 2 0.1411 0.966 0.000 0.964 0.036
#> GSM447449 2 0.0000 0.991 0.000 1.000 0.000
#> GSM447450 1 0.0000 0.982 1.000 0.000 0.000
#> GSM447452 1 0.2269 0.952 0.944 0.040 0.016
#> GSM447458 2 0.0000 0.991 0.000 1.000 0.000
#> GSM447461 1 0.0000 0.982 1.000 0.000 0.000
#> GSM447464 1 0.0237 0.982 0.996 0.000 0.004
#> GSM447468 1 0.0000 0.982 1.000 0.000 0.000
#> GSM447472 1 0.0237 0.982 0.996 0.000 0.004
#> GSM447400 1 0.0000 0.982 1.000 0.000 0.000
#> GSM447402 2 0.0000 0.991 0.000 1.000 0.000
#> GSM447403 1 0.0237 0.982 0.996 0.000 0.004
#> GSM447405 1 0.4033 0.842 0.856 0.136 0.008
#> GSM447418 3 0.0000 0.960 0.000 0.000 1.000
#> GSM447422 3 0.0000 0.960 0.000 0.000 1.000
#> GSM447424 3 0.0000 0.960 0.000 0.000 1.000
#> GSM447427 3 0.0000 0.960 0.000 0.000 1.000
#> GSM447428 3 0.0000 0.960 0.000 0.000 1.000
#> GSM447429 3 0.0424 0.956 0.008 0.000 0.992
#> GSM447431 1 0.0424 0.979 0.992 0.000 0.008
#> GSM447432 2 0.0000 0.991 0.000 1.000 0.000
#> GSM447434 1 0.0000 0.982 1.000 0.000 0.000
#> GSM447442 2 0.0747 0.982 0.000 0.984 0.016
#> GSM447451 2 0.0000 0.991 0.000 1.000 0.000
#> GSM447462 1 0.0000 0.982 1.000 0.000 0.000
#> GSM447463 2 0.0983 0.980 0.004 0.980 0.016
#> GSM447467 2 0.0000 0.991 0.000 1.000 0.000
#> GSM447469 2 0.0000 0.991 0.000 1.000 0.000
#> GSM447473 1 0.0000 0.982 1.000 0.000 0.000
#> GSM447404 1 0.0000 0.982 1.000 0.000 0.000
#> GSM447406 1 0.0000 0.982 1.000 0.000 0.000
#> GSM447407 2 0.0000 0.991 0.000 1.000 0.000
#> GSM447409 1 0.0000 0.982 1.000 0.000 0.000
#> GSM447412 3 0.3551 0.860 0.132 0.000 0.868
#> GSM447426 3 0.0000 0.960 0.000 0.000 1.000
#> GSM447433 1 0.2165 0.937 0.936 0.064 0.000
#> GSM447439 1 0.0000 0.982 1.000 0.000 0.000
#> GSM447441 2 0.0000 0.991 0.000 1.000 0.000
#> GSM447443 1 0.0237 0.982 0.996 0.000 0.004
#> GSM447445 2 0.0000 0.991 0.000 1.000 0.000
#> GSM447446 2 0.0000 0.991 0.000 1.000 0.000
#> GSM447453 2 0.1289 0.970 0.000 0.968 0.032
#> GSM447455 2 0.0000 0.991 0.000 1.000 0.000
#> GSM447456 1 0.1832 0.959 0.956 0.036 0.008
#> GSM447459 1 0.1950 0.956 0.952 0.040 0.008
#> GSM447466 1 0.0237 0.982 0.996 0.000 0.004
#> GSM447470 1 0.1643 0.956 0.956 0.000 0.044
#> GSM447474 1 0.0237 0.982 0.996 0.000 0.004
#> GSM447475 1 0.0237 0.982 0.996 0.000 0.004
#> GSM447398 1 0.0000 0.982 1.000 0.000 0.000
#> GSM447399 1 0.0000 0.982 1.000 0.000 0.000
#> GSM447408 2 0.0592 0.981 0.012 0.988 0.000
#> GSM447410 1 0.1950 0.956 0.952 0.040 0.008
#> GSM447414 3 0.4555 0.784 0.200 0.000 0.800
#> GSM447417 2 0.0000 0.991 0.000 1.000 0.000
#> GSM447419 1 0.0424 0.980 0.992 0.000 0.008
#> GSM447420 3 0.0000 0.960 0.000 0.000 1.000
#> GSM447421 3 0.0424 0.956 0.008 0.000 0.992
#> GSM447423 3 0.0000 0.960 0.000 0.000 1.000
#> GSM447436 2 0.0592 0.985 0.000 0.988 0.012
#> GSM447437 2 0.1525 0.967 0.004 0.964 0.032
#> GSM447438 1 0.1832 0.959 0.956 0.036 0.008
#> GSM447447 2 0.0000 0.991 0.000 1.000 0.000
#> GSM447454 2 0.0424 0.986 0.000 0.992 0.008
#> GSM447457 2 0.0000 0.991 0.000 1.000 0.000
#> GSM447460 2 0.0000 0.991 0.000 1.000 0.000
#> GSM447465 2 0.0000 0.991 0.000 1.000 0.000
#> GSM447471 1 0.0000 0.982 1.000 0.000 0.000
#> GSM447476 1 0.1950 0.956 0.952 0.040 0.008
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM447401 3 0.0000 0.8938 0.000 0.000 1.000 0.000
#> GSM447411 1 0.0188 0.8916 0.996 0.000 0.004 0.000
#> GSM447413 3 0.0000 0.8938 0.000 0.000 1.000 0.000
#> GSM447415 1 0.0592 0.8833 0.984 0.000 0.016 0.000
#> GSM447416 3 0.0000 0.8938 0.000 0.000 1.000 0.000
#> GSM447425 4 0.2281 0.8845 0.000 0.096 0.000 0.904
#> GSM447430 4 0.2921 0.8161 0.140 0.000 0.000 0.860
#> GSM447435 1 0.0188 0.8916 0.996 0.000 0.004 0.000
#> GSM447440 1 0.0000 0.8918 1.000 0.000 0.000 0.000
#> GSM447444 2 0.0000 0.9503 0.000 1.000 0.000 0.000
#> GSM447448 2 0.0000 0.9503 0.000 1.000 0.000 0.000
#> GSM447449 2 0.0188 0.9501 0.000 0.996 0.000 0.004
#> GSM447450 1 0.1302 0.8647 0.956 0.000 0.000 0.044
#> GSM447452 4 0.0188 0.9194 0.000 0.000 0.004 0.996
#> GSM447458 2 0.0188 0.9501 0.000 0.996 0.000 0.004
#> GSM447461 1 0.7275 0.2218 0.472 0.000 0.376 0.152
#> GSM447464 1 0.0188 0.8916 0.996 0.000 0.004 0.000
#> GSM447468 1 0.0000 0.8918 1.000 0.000 0.000 0.000
#> GSM447472 1 0.0188 0.8916 0.996 0.000 0.004 0.000
#> GSM447400 1 0.0000 0.8918 1.000 0.000 0.000 0.000
#> GSM447402 2 0.0188 0.9501 0.000 0.996 0.000 0.004
#> GSM447403 1 0.0188 0.8916 0.996 0.000 0.004 0.000
#> GSM447405 2 0.2530 0.8555 0.000 0.896 0.004 0.100
#> GSM447418 3 0.0000 0.8938 0.000 0.000 1.000 0.000
#> GSM447422 3 0.0000 0.8938 0.000 0.000 1.000 0.000
#> GSM447424 3 0.0000 0.8938 0.000 0.000 1.000 0.000
#> GSM447427 3 0.0000 0.8938 0.000 0.000 1.000 0.000
#> GSM447428 3 0.0000 0.8938 0.000 0.000 1.000 0.000
#> GSM447429 3 0.4477 0.5567 0.312 0.000 0.688 0.000
#> GSM447431 1 0.7400 0.2324 0.468 0.000 0.360 0.172
#> GSM447432 2 0.0188 0.9501 0.000 0.996 0.000 0.004
#> GSM447434 1 0.2281 0.8251 0.904 0.000 0.000 0.096
#> GSM447442 2 0.5151 0.1741 0.000 0.532 0.464 0.004
#> GSM447451 2 0.0000 0.9503 0.000 1.000 0.000 0.000
#> GSM447462 1 0.0000 0.8918 1.000 0.000 0.000 0.000
#> GSM447463 2 0.1118 0.9212 0.036 0.964 0.000 0.000
#> GSM447467 2 0.0000 0.9503 0.000 1.000 0.000 0.000
#> GSM447469 2 0.0188 0.9501 0.000 0.996 0.000 0.004
#> GSM447473 1 0.0000 0.8918 1.000 0.000 0.000 0.000
#> GSM447404 1 0.0000 0.8918 1.000 0.000 0.000 0.000
#> GSM447406 4 0.0188 0.9189 0.004 0.000 0.000 0.996
#> GSM447407 4 0.2281 0.8845 0.000 0.096 0.000 0.904
#> GSM447409 1 0.0000 0.8918 1.000 0.000 0.000 0.000
#> GSM447412 3 0.0000 0.8938 0.000 0.000 1.000 0.000
#> GSM447426 3 0.0000 0.8938 0.000 0.000 1.000 0.000
#> GSM447433 4 0.2281 0.8845 0.000 0.096 0.000 0.904
#> GSM447439 4 0.2921 0.8161 0.140 0.000 0.000 0.860
#> GSM447441 2 0.0188 0.9501 0.000 0.996 0.000 0.004
#> GSM447443 1 0.0188 0.8916 0.996 0.000 0.004 0.000
#> GSM447445 2 0.0000 0.9503 0.000 1.000 0.000 0.000
#> GSM447446 2 0.0000 0.9503 0.000 1.000 0.000 0.000
#> GSM447453 2 0.0000 0.9503 0.000 1.000 0.000 0.000
#> GSM447455 2 0.0188 0.9501 0.000 0.996 0.000 0.004
#> GSM447456 4 0.0000 0.9206 0.000 0.000 0.000 1.000
#> GSM447459 4 0.0000 0.9206 0.000 0.000 0.000 1.000
#> GSM447466 1 0.0188 0.8916 0.996 0.000 0.004 0.000
#> GSM447470 3 0.7159 0.4478 0.272 0.180 0.548 0.000
#> GSM447474 1 0.0188 0.8916 0.996 0.000 0.004 0.000
#> GSM447475 1 0.7275 0.2262 0.472 0.000 0.376 0.152
#> GSM447398 4 0.3486 0.7505 0.188 0.000 0.000 0.812
#> GSM447399 1 0.4994 0.0842 0.520 0.000 0.000 0.480
#> GSM447408 4 0.1938 0.9024 0.000 0.052 0.012 0.936
#> GSM447410 4 0.0000 0.9206 0.000 0.000 0.000 1.000
#> GSM447414 3 0.0927 0.8780 0.016 0.000 0.976 0.008
#> GSM447417 4 0.2281 0.8845 0.000 0.096 0.000 0.904
#> GSM447419 3 0.4996 0.1343 0.484 0.000 0.516 0.000
#> GSM447420 3 0.0000 0.8938 0.000 0.000 1.000 0.000
#> GSM447421 3 0.4164 0.6271 0.264 0.000 0.736 0.000
#> GSM447423 3 0.0000 0.8938 0.000 0.000 1.000 0.000
#> GSM447436 2 0.0000 0.9503 0.000 1.000 0.000 0.000
#> GSM447437 2 0.4103 0.6431 0.256 0.744 0.000 0.000
#> GSM447438 4 0.0000 0.9206 0.000 0.000 0.000 1.000
#> GSM447447 2 0.0000 0.9503 0.000 1.000 0.000 0.000
#> GSM447454 2 0.3257 0.8024 0.000 0.844 0.152 0.004
#> GSM447457 2 0.0000 0.9503 0.000 1.000 0.000 0.000
#> GSM447460 2 0.0188 0.9501 0.000 0.996 0.000 0.004
#> GSM447465 2 0.0188 0.9501 0.000 0.996 0.000 0.004
#> GSM447471 1 0.0000 0.8918 1.000 0.000 0.000 0.000
#> GSM447476 4 0.0000 0.9206 0.000 0.000 0.000 1.000
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM447401 3 0.0000 0.941 0.000 0.000 1.000 0.000 0.000
#> GSM447411 1 0.0000 0.994 1.000 0.000 0.000 0.000 0.000
#> GSM447413 3 0.0000 0.941 0.000 0.000 1.000 0.000 0.000
#> GSM447415 1 0.0000 0.994 1.000 0.000 0.000 0.000 0.000
#> GSM447416 3 0.0000 0.941 0.000 0.000 1.000 0.000 0.000
#> GSM447425 4 0.0000 0.984 0.000 0.000 0.000 1.000 0.000
#> GSM447430 5 0.0000 0.951 0.000 0.000 0.000 0.000 1.000
#> GSM447435 1 0.0000 0.994 1.000 0.000 0.000 0.000 0.000
#> GSM447440 1 0.0000 0.994 1.000 0.000 0.000 0.000 0.000
#> GSM447444 2 0.0000 0.963 0.000 1.000 0.000 0.000 0.000
#> GSM447448 2 0.0000 0.963 0.000 1.000 0.000 0.000 0.000
#> GSM447449 2 0.1043 0.961 0.000 0.960 0.000 0.040 0.000
#> GSM447450 1 0.1908 0.894 0.908 0.000 0.000 0.000 0.092
#> GSM447452 4 0.0162 0.984 0.000 0.000 0.000 0.996 0.004
#> GSM447458 2 0.1043 0.961 0.000 0.960 0.000 0.040 0.000
#> GSM447461 5 0.1195 0.933 0.012 0.000 0.028 0.000 0.960
#> GSM447464 1 0.0000 0.994 1.000 0.000 0.000 0.000 0.000
#> GSM447468 1 0.0000 0.994 1.000 0.000 0.000 0.000 0.000
#> GSM447472 1 0.0000 0.994 1.000 0.000 0.000 0.000 0.000
#> GSM447400 1 0.0000 0.994 1.000 0.000 0.000 0.000 0.000
#> GSM447402 2 0.1043 0.961 0.000 0.960 0.000 0.040 0.000
#> GSM447403 1 0.0000 0.994 1.000 0.000 0.000 0.000 0.000
#> GSM447405 2 0.2230 0.865 0.000 0.884 0.000 0.116 0.000
#> GSM447418 3 0.0000 0.941 0.000 0.000 1.000 0.000 0.000
#> GSM447422 3 0.0000 0.941 0.000 0.000 1.000 0.000 0.000
#> GSM447424 3 0.0000 0.941 0.000 0.000 1.000 0.000 0.000
#> GSM447427 3 0.0000 0.941 0.000 0.000 1.000 0.000 0.000
#> GSM447428 3 0.0000 0.941 0.000 0.000 1.000 0.000 0.000
#> GSM447429 3 0.2852 0.757 0.172 0.000 0.828 0.000 0.000
#> GSM447431 5 0.0000 0.951 0.000 0.000 0.000 0.000 1.000
#> GSM447432 2 0.1043 0.961 0.000 0.960 0.000 0.040 0.000
#> GSM447434 5 0.2690 0.812 0.156 0.000 0.000 0.000 0.844
#> GSM447442 2 0.2588 0.912 0.000 0.892 0.060 0.048 0.000
#> GSM447451 2 0.0000 0.963 0.000 1.000 0.000 0.000 0.000
#> GSM447462 1 0.0000 0.994 1.000 0.000 0.000 0.000 0.000
#> GSM447463 2 0.0000 0.963 0.000 1.000 0.000 0.000 0.000
#> GSM447467 2 0.0000 0.963 0.000 1.000 0.000 0.000 0.000
#> GSM447469 2 0.1043 0.961 0.000 0.960 0.000 0.040 0.000
#> GSM447473 1 0.0000 0.994 1.000 0.000 0.000 0.000 0.000
#> GSM447404 1 0.0000 0.994 1.000 0.000 0.000 0.000 0.000
#> GSM447406 5 0.0000 0.951 0.000 0.000 0.000 0.000 1.000
#> GSM447407 4 0.0000 0.984 0.000 0.000 0.000 1.000 0.000
#> GSM447409 1 0.0000 0.994 1.000 0.000 0.000 0.000 0.000
#> GSM447412 3 0.0000 0.941 0.000 0.000 1.000 0.000 0.000
#> GSM447426 3 0.0000 0.941 0.000 0.000 1.000 0.000 0.000
#> GSM447433 4 0.0000 0.984 0.000 0.000 0.000 1.000 0.000
#> GSM447439 5 0.0000 0.951 0.000 0.000 0.000 0.000 1.000
#> GSM447441 2 0.1043 0.961 0.000 0.960 0.000 0.040 0.000
#> GSM447443 1 0.0000 0.994 1.000 0.000 0.000 0.000 0.000
#> GSM447445 2 0.0000 0.963 0.000 1.000 0.000 0.000 0.000
#> GSM447446 2 0.0000 0.963 0.000 1.000 0.000 0.000 0.000
#> GSM447453 2 0.0000 0.963 0.000 1.000 0.000 0.000 0.000
#> GSM447455 2 0.1043 0.961 0.000 0.960 0.000 0.040 0.000
#> GSM447456 4 0.0703 0.973 0.000 0.000 0.000 0.976 0.024
#> GSM447459 4 0.1043 0.959 0.000 0.000 0.000 0.960 0.040
#> GSM447466 1 0.0000 0.994 1.000 0.000 0.000 0.000 0.000
#> GSM447470 3 0.6402 0.238 0.180 0.348 0.472 0.000 0.000
#> GSM447474 1 0.0000 0.994 1.000 0.000 0.000 0.000 0.000
#> GSM447475 5 0.3151 0.827 0.020 0.000 0.144 0.000 0.836
#> GSM447398 5 0.0000 0.951 0.000 0.000 0.000 0.000 1.000
#> GSM447399 5 0.0000 0.951 0.000 0.000 0.000 0.000 1.000
#> GSM447408 4 0.0000 0.984 0.000 0.000 0.000 1.000 0.000
#> GSM447410 4 0.0000 0.984 0.000 0.000 0.000 1.000 0.000
#> GSM447414 3 0.0703 0.924 0.000 0.000 0.976 0.000 0.024
#> GSM447417 4 0.0000 0.984 0.000 0.000 0.000 1.000 0.000
#> GSM447419 3 0.1671 0.874 0.076 0.000 0.924 0.000 0.000
#> GSM447420 3 0.0000 0.941 0.000 0.000 1.000 0.000 0.000
#> GSM447421 3 0.0609 0.925 0.020 0.000 0.980 0.000 0.000
#> GSM447423 3 0.0000 0.941 0.000 0.000 1.000 0.000 0.000
#> GSM447436 2 0.0000 0.963 0.000 1.000 0.000 0.000 0.000
#> GSM447437 2 0.2891 0.765 0.176 0.824 0.000 0.000 0.000
#> GSM447438 4 0.1043 0.959 0.000 0.000 0.000 0.960 0.040
#> GSM447447 2 0.0000 0.963 0.000 1.000 0.000 0.000 0.000
#> GSM447454 2 0.1997 0.938 0.000 0.924 0.036 0.040 0.000
#> GSM447457 2 0.0000 0.963 0.000 1.000 0.000 0.000 0.000
#> GSM447460 2 0.1043 0.961 0.000 0.960 0.000 0.040 0.000
#> GSM447465 2 0.1043 0.961 0.000 0.960 0.000 0.040 0.000
#> GSM447471 1 0.0000 0.994 1.000 0.000 0.000 0.000 0.000
#> GSM447476 4 0.0510 0.979 0.000 0.000 0.000 0.984 0.016
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM447401 3 0.0000 0.88214 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM447411 6 0.2178 0.69257 0.132 0.000 0.000 0.000 0.000 0.868
#> GSM447413 3 0.1556 0.84307 0.000 0.000 0.920 0.000 0.000 0.080
#> GSM447415 6 0.0937 0.74004 0.040 0.000 0.000 0.000 0.000 0.960
#> GSM447416 3 0.0000 0.88214 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM447425 4 0.0458 0.98442 0.000 0.000 0.000 0.984 0.000 0.016
#> GSM447430 5 0.0000 1.00000 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM447435 6 0.0937 0.74004 0.040 0.000 0.000 0.000 0.000 0.960
#> GSM447440 6 0.3857 0.15052 0.468 0.000 0.000 0.000 0.000 0.532
#> GSM447444 2 0.0458 0.95859 0.000 0.984 0.000 0.000 0.000 0.016
#> GSM447448 2 0.0458 0.95859 0.000 0.984 0.000 0.000 0.000 0.016
#> GSM447449 2 0.0632 0.95917 0.000 0.976 0.000 0.000 0.000 0.024
#> GSM447450 1 0.2783 0.73059 0.836 0.000 0.000 0.000 0.016 0.148
#> GSM447452 4 0.0000 0.99368 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM447458 2 0.0632 0.95917 0.000 0.976 0.000 0.000 0.000 0.024
#> GSM447461 3 0.5587 0.05990 0.000 0.000 0.436 0.000 0.140 0.424
#> GSM447464 6 0.1957 0.70781 0.112 0.000 0.000 0.000 0.000 0.888
#> GSM447468 1 0.0000 0.87953 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM447472 6 0.0937 0.74004 0.040 0.000 0.000 0.000 0.000 0.960
#> GSM447400 1 0.0000 0.87953 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM447402 2 0.0632 0.95917 0.000 0.976 0.000 0.000 0.000 0.024
#> GSM447403 1 0.3446 0.48372 0.692 0.000 0.000 0.000 0.000 0.308
#> GSM447405 2 0.4340 0.65705 0.000 0.720 0.000 0.104 0.000 0.176
#> GSM447418 3 0.0000 0.88214 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM447422 3 0.0000 0.88214 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM447424 3 0.0000 0.88214 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM447427 3 0.0000 0.88214 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM447428 3 0.1610 0.83009 0.000 0.000 0.916 0.000 0.000 0.084
#> GSM447429 6 0.3198 0.57121 0.000 0.000 0.260 0.000 0.000 0.740
#> GSM447431 5 0.0000 1.00000 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM447432 2 0.0632 0.95917 0.000 0.976 0.000 0.000 0.000 0.024
#> GSM447434 1 0.0937 0.84911 0.960 0.000 0.000 0.000 0.040 0.000
#> GSM447442 3 0.4343 0.30850 0.000 0.384 0.592 0.004 0.000 0.020
#> GSM447451 2 0.0000 0.96005 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM447462 1 0.0000 0.87953 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM447463 2 0.0632 0.95484 0.000 0.976 0.000 0.000 0.000 0.024
#> GSM447467 2 0.0260 0.95961 0.000 0.992 0.000 0.000 0.000 0.008
#> GSM447469 2 0.0632 0.95917 0.000 0.976 0.000 0.000 0.000 0.024
#> GSM447473 1 0.0000 0.87953 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM447404 1 0.0000 0.87953 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM447406 5 0.0000 1.00000 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM447407 4 0.0547 0.98145 0.000 0.000 0.000 0.980 0.000 0.020
#> GSM447409 1 0.0000 0.87953 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM447412 3 0.1444 0.84862 0.000 0.000 0.928 0.000 0.000 0.072
#> GSM447426 3 0.0000 0.88214 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM447433 4 0.0000 0.99368 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM447439 5 0.0000 1.00000 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM447441 2 0.0632 0.95917 0.000 0.976 0.000 0.000 0.000 0.024
#> GSM447443 1 0.0937 0.85387 0.960 0.000 0.000 0.000 0.000 0.040
#> GSM447445 2 0.0458 0.95859 0.000 0.984 0.000 0.000 0.000 0.016
#> GSM447446 2 0.0458 0.95859 0.000 0.984 0.000 0.000 0.000 0.016
#> GSM447453 2 0.0458 0.95859 0.000 0.984 0.000 0.000 0.000 0.016
#> GSM447455 2 0.0632 0.95917 0.000 0.976 0.000 0.000 0.000 0.024
#> GSM447456 4 0.0000 0.99368 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM447459 4 0.0000 0.99368 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM447466 6 0.2941 0.60628 0.220 0.000 0.000 0.000 0.000 0.780
#> GSM447470 6 0.0937 0.72855 0.000 0.000 0.040 0.000 0.000 0.960
#> GSM447474 6 0.0937 0.74004 0.040 0.000 0.000 0.000 0.000 0.960
#> GSM447475 6 0.4587 0.19995 0.000 0.000 0.356 0.000 0.048 0.596
#> GSM447398 5 0.0000 1.00000 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM447399 5 0.0000 1.00000 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM447408 4 0.0000 0.99368 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM447410 4 0.0000 0.99368 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM447414 3 0.1753 0.83791 0.000 0.000 0.912 0.000 0.004 0.084
#> GSM447417 4 0.0547 0.98145 0.000 0.000 0.000 0.980 0.000 0.020
#> GSM447419 1 0.6094 0.00892 0.388 0.000 0.312 0.000 0.000 0.300
#> GSM447420 3 0.1714 0.82274 0.000 0.000 0.908 0.000 0.000 0.092
#> GSM447421 6 0.3838 0.19328 0.000 0.000 0.448 0.000 0.000 0.552
#> GSM447423 3 0.0000 0.88214 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM447436 2 0.0458 0.95859 0.000 0.984 0.000 0.000 0.000 0.016
#> GSM447437 6 0.3868 -0.01081 0.000 0.496 0.000 0.000 0.000 0.504
#> GSM447438 4 0.0000 0.99368 0.000 0.000 0.000 1.000 0.000 0.000
#> GSM447447 2 0.0458 0.95859 0.000 0.984 0.000 0.000 0.000 0.016
#> GSM447454 2 0.3284 0.73859 0.000 0.784 0.196 0.000 0.000 0.020
#> GSM447457 2 0.0146 0.96000 0.000 0.996 0.000 0.000 0.000 0.004
#> GSM447460 2 0.0632 0.95917 0.000 0.976 0.000 0.000 0.000 0.024
#> GSM447465 2 0.0632 0.95917 0.000 0.976 0.000 0.000 0.000 0.024
#> GSM447471 1 0.0000 0.87953 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM447476 4 0.0000 0.99368 0.000 0.000 0.000 1.000 0.000 0.000
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)
An example of the output of tb
is:
#> which_row fdr mean_1 mean_2 scaled_mean_1 scaled_mean_2 km
#> 1 38 0.042760348 8.373488 9.131774 -0.5533452 0.5164555 1
#> 2 40 0.018707592 7.106213 8.469186 -0.6173731 0.5762149 1
#> 3 55 0.019134737 10.221463 11.207825 -0.6159697 0.5749050 1
#> 4 59 0.006059896 5.921854 7.869574 -0.6899429 0.6439467 1
#> 5 60 0.018055526 8.928898 10.211722 -0.6204761 0.5791110 1
#> 6 98 0.009384629 15.714769 14.887706 0.6635654 -0.6193277 2
...
The columns in tb
are:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.km
: Row groups if k-means clustering is applied to rows.UMAP plot which shows how samples are separated.
dimension_reduction(res, k = 2, method = "UMAP")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
Test correlation between subgroups and known annotations. If the known annotation is numeric, one-way ANOVA test is applied, and if the known annotation is discrete, chi-squared contingency table test is applied.
test_to_known_factors(res)
#> n gender(p) agent(p) k
#> ATC:pam 78 1.0000 0.0667 2
#> ATC:pam 79 0.6226 0.0921 3
#> ATC:pam 72 0.0348 0.1149 4
#> ATC:pam 78 0.1460 0.1134 5
#> ATC:pam 71 0.2061 0.2250 6
If matrix rows can be associated to genes, consider to use functional_enrichment(res,
...)
to perform function enrichment for the signature genes. See this vignette for more detailed explanations.
The object with results only for a single top-value method and a single partition method can be extracted as:
res = res_list["ATC", "mclust"]
# you can also extract it by
# res = res_list["ATC:mclust"]
A summary of res
and all the functions that can be applied to it:
res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#> On a matrix with 51941 rows and 79 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'ATC' method.
#> Subgroups are detected by 'mclust' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 6.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
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.999 1.000 0.5004 0.500 0.500
#> 3 3 1.000 0.998 0.999 0.2904 0.855 0.709
#> 4 4 1.000 0.970 0.989 0.0687 0.952 0.866
#> 5 5 1.000 0.985 0.994 0.1240 0.871 0.611
#> 6 6 0.927 0.947 0.957 0.0553 0.938 0.736
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 6
#> attr(,"optional")
#> [1] 2 3 4 5
There is also optional best \(k\) = 2 3 4 5 that is worth to check.
Following shows the table of the partitions (You need to click the show/hide
code output link to see it). The membership matrix (columns with name p*
)
is inferred by
clue::cl_consensus()
function with the SE
method. Basically the value in the membership matrix
represents the probability to belong to a certain group. The finall class
label for an item is determined with the group with highest probability it
belongs to.
In get_classes()
function, the entropy is calculated from the membership
matrix and the silhouette score is calculated from the consensus matrix.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> GSM447401 1 0.0000 0.999 1.000 0.000
#> GSM447411 1 0.0000 0.999 1.000 0.000
#> GSM447413 1 0.0000 0.999 1.000 0.000
#> GSM447415 1 0.0000 0.999 1.000 0.000
#> GSM447416 1 0.0000 0.999 1.000 0.000
#> GSM447425 2 0.0000 1.000 0.000 1.000
#> GSM447430 1 0.0000 0.999 1.000 0.000
#> GSM447435 1 0.0000 0.999 1.000 0.000
#> GSM447440 1 0.0000 0.999 1.000 0.000
#> GSM447444 2 0.0000 1.000 0.000 1.000
#> GSM447448 2 0.0000 1.000 0.000 1.000
#> GSM447449 2 0.0000 1.000 0.000 1.000
#> GSM447450 1 0.0000 0.999 1.000 0.000
#> GSM447452 2 0.0000 1.000 0.000 1.000
#> GSM447458 2 0.0000 1.000 0.000 1.000
#> GSM447461 1 0.0000 0.999 1.000 0.000
#> GSM447464 1 0.0000 0.999 1.000 0.000
#> GSM447468 1 0.0000 0.999 1.000 0.000
#> GSM447472 1 0.0000 0.999 1.000 0.000
#> GSM447400 1 0.0000 0.999 1.000 0.000
#> GSM447402 2 0.0000 1.000 0.000 1.000
#> GSM447403 1 0.0000 0.999 1.000 0.000
#> GSM447405 2 0.0000 1.000 0.000 1.000
#> GSM447418 1 0.0000 0.999 1.000 0.000
#> GSM447422 1 0.0000 0.999 1.000 0.000
#> GSM447424 1 0.0000 0.999 1.000 0.000
#> GSM447427 1 0.0000 0.999 1.000 0.000
#> GSM447428 1 0.0000 0.999 1.000 0.000
#> GSM447429 1 0.0000 0.999 1.000 0.000
#> GSM447431 1 0.0000 0.999 1.000 0.000
#> GSM447432 2 0.0000 1.000 0.000 1.000
#> GSM447434 1 0.0000 0.999 1.000 0.000
#> GSM447442 2 0.0000 1.000 0.000 1.000
#> GSM447451 2 0.0000 1.000 0.000 1.000
#> GSM447462 1 0.0000 0.999 1.000 0.000
#> GSM447463 2 0.0000 1.000 0.000 1.000
#> GSM447467 2 0.0000 1.000 0.000 1.000
#> GSM447469 2 0.0000 1.000 0.000 1.000
#> GSM447473 1 0.0000 0.999 1.000 0.000
#> GSM447404 1 0.0000 0.999 1.000 0.000
#> GSM447406 1 0.1843 0.971 0.972 0.028
#> GSM447407 2 0.0000 1.000 0.000 1.000
#> GSM447409 1 0.0000 0.999 1.000 0.000
#> GSM447412 1 0.0000 0.999 1.000 0.000
#> GSM447426 1 0.0000 0.999 1.000 0.000
#> GSM447433 2 0.0000 1.000 0.000 1.000
#> GSM447439 1 0.0000 0.999 1.000 0.000
#> GSM447441 2 0.0000 1.000 0.000 1.000
#> GSM447443 1 0.0000 0.999 1.000 0.000
#> GSM447445 2 0.0000 1.000 0.000 1.000
#> GSM447446 2 0.0000 1.000 0.000 1.000
#> GSM447453 2 0.0000 1.000 0.000 1.000
#> GSM447455 2 0.0000 1.000 0.000 1.000
#> GSM447456 2 0.0000 1.000 0.000 1.000
#> GSM447459 2 0.0000 1.000 0.000 1.000
#> GSM447466 1 0.0000 0.999 1.000 0.000
#> GSM447470 1 0.0000 0.999 1.000 0.000
#> GSM447474 1 0.0000 0.999 1.000 0.000
#> GSM447475 1 0.0000 0.999 1.000 0.000
#> GSM447398 1 0.0000 0.999 1.000 0.000
#> GSM447399 1 0.0000 0.999 1.000 0.000
#> GSM447408 2 0.0000 1.000 0.000 1.000
#> GSM447410 2 0.0000 1.000 0.000 1.000
#> GSM447414 1 0.0000 0.999 1.000 0.000
#> GSM447417 2 0.0000 1.000 0.000 1.000
#> GSM447419 1 0.0000 0.999 1.000 0.000
#> GSM447420 1 0.0000 0.999 1.000 0.000
#> GSM447421 1 0.0000 0.999 1.000 0.000
#> GSM447423 1 0.0000 0.999 1.000 0.000
#> GSM447436 2 0.0000 1.000 0.000 1.000
#> GSM447437 2 0.0000 1.000 0.000 1.000
#> GSM447438 2 0.0672 0.992 0.008 0.992
#> GSM447447 2 0.0000 1.000 0.000 1.000
#> GSM447454 2 0.0000 1.000 0.000 1.000
#> GSM447457 2 0.0000 1.000 0.000 1.000
#> GSM447460 2 0.0000 1.000 0.000 1.000
#> GSM447465 2 0.0000 1.000 0.000 1.000
#> GSM447471 1 0.0000 0.999 1.000 0.000
#> GSM447476 2 0.0000 1.000 0.000 1.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM447401 3 0.0000 0.998 0.000 0 1.000
#> GSM447411 1 0.0000 0.998 1.000 0 0.000
#> GSM447413 3 0.0000 0.998 0.000 0 1.000
#> GSM447415 1 0.0000 0.998 1.000 0 0.000
#> GSM447416 3 0.0000 0.998 0.000 0 1.000
#> GSM447425 2 0.0000 1.000 0.000 1 0.000
#> GSM447430 1 0.0424 0.994 0.992 0 0.008
#> GSM447435 1 0.0000 0.998 1.000 0 0.000
#> GSM447440 1 0.0000 0.998 1.000 0 0.000
#> GSM447444 2 0.0000 1.000 0.000 1 0.000
#> GSM447448 2 0.0000 1.000 0.000 1 0.000
#> GSM447449 2 0.0000 1.000 0.000 1 0.000
#> GSM447450 1 0.0000 0.998 1.000 0 0.000
#> GSM447452 2 0.0000 1.000 0.000 1 0.000
#> GSM447458 2 0.0000 1.000 0.000 1 0.000
#> GSM447461 1 0.0424 0.994 0.992 0 0.008
#> GSM447464 1 0.0000 0.998 1.000 0 0.000
#> GSM447468 1 0.0000 0.998 1.000 0 0.000
#> GSM447472 1 0.0000 0.998 1.000 0 0.000
#> GSM447400 1 0.0000 0.998 1.000 0 0.000
#> GSM447402 2 0.0000 1.000 0.000 1 0.000
#> GSM447403 1 0.0000 0.998 1.000 0 0.000
#> GSM447405 2 0.0000 1.000 0.000 1 0.000
#> GSM447418 3 0.0000 0.998 0.000 0 1.000
#> GSM447422 3 0.0000 0.998 0.000 0 1.000
#> GSM447424 3 0.0000 0.998 0.000 0 1.000
#> GSM447427 3 0.0000 0.998 0.000 0 1.000
#> GSM447428 3 0.0000 0.998 0.000 0 1.000
#> GSM447429 3 0.0424 0.993 0.008 0 0.992
#> GSM447431 1 0.0424 0.994 0.992 0 0.008
#> GSM447432 2 0.0000 1.000 0.000 1 0.000
#> GSM447434 1 0.0000 0.998 1.000 0 0.000
#> GSM447442 2 0.0000 1.000 0.000 1 0.000
#> GSM447451 2 0.0000 1.000 0.000 1 0.000
#> GSM447462 1 0.0000 0.998 1.000 0 0.000
#> GSM447463 2 0.0000 1.000 0.000 1 0.000
#> GSM447467 2 0.0000 1.000 0.000 1 0.000
#> GSM447469 2 0.0000 1.000 0.000 1 0.000
#> GSM447473 1 0.0000 0.998 1.000 0 0.000
#> GSM447404 1 0.0000 0.998 1.000 0 0.000
#> GSM447406 1 0.0424 0.994 0.992 0 0.008
#> GSM447407 2 0.0000 1.000 0.000 1 0.000
#> GSM447409 1 0.0000 0.998 1.000 0 0.000
#> GSM447412 3 0.0000 0.998 0.000 0 1.000
#> GSM447426 3 0.0000 0.998 0.000 0 1.000
#> GSM447433 2 0.0000 1.000 0.000 1 0.000
#> GSM447439 1 0.0424 0.994 0.992 0 0.008
#> GSM447441 2 0.0000 1.000 0.000 1 0.000
#> GSM447443 1 0.0000 0.998 1.000 0 0.000
#> GSM447445 2 0.0000 1.000 0.000 1 0.000
#> GSM447446 2 0.0000 1.000 0.000 1 0.000
#> GSM447453 2 0.0000 1.000 0.000 1 0.000
#> GSM447455 2 0.0000 1.000 0.000 1 0.000
#> GSM447456 2 0.0000 1.000 0.000 1 0.000
#> GSM447459 2 0.0000 1.000 0.000 1 0.000
#> GSM447466 1 0.0000 0.998 1.000 0 0.000
#> GSM447470 1 0.0000 0.998 1.000 0 0.000
#> GSM447474 1 0.0000 0.998 1.000 0 0.000
#> GSM447475 1 0.0424 0.994 0.992 0 0.008
#> GSM447398 1 0.0424 0.994 0.992 0 0.008
#> GSM447399 1 0.0424 0.994 0.992 0 0.008
#> GSM447408 2 0.0000 1.000 0.000 1 0.000
#> GSM447410 2 0.0000 1.000 0.000 1 0.000
#> GSM447414 3 0.0000 0.998 0.000 0 1.000
#> GSM447417 2 0.0000 1.000 0.000 1 0.000
#> GSM447419 3 0.0424 0.993 0.008 0 0.992
#> GSM447420 3 0.0000 0.998 0.000 0 1.000
#> GSM447421 3 0.0424 0.993 0.008 0 0.992
#> GSM447423 3 0.0000 0.998 0.000 0 1.000
#> GSM447436 2 0.0000 1.000 0.000 1 0.000
#> GSM447437 2 0.0000 1.000 0.000 1 0.000
#> GSM447438 2 0.0000 1.000 0.000 1 0.000
#> GSM447447 2 0.0000 1.000 0.000 1 0.000
#> GSM447454 2 0.0000 1.000 0.000 1 0.000
#> GSM447457 2 0.0000 1.000 0.000 1 0.000
#> GSM447460 2 0.0000 1.000 0.000 1 0.000
#> GSM447465 2 0.0000 1.000 0.000 1 0.000
#> GSM447471 1 0.0000 0.998 1.000 0 0.000
#> GSM447476 2 0.0000 1.000 0.000 1 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM447401 3 0.0000 0.966 0.000 0.000 1.000 0.000
#> GSM447411 1 0.0000 0.999 1.000 0.000 0.000 0.000
#> GSM447413 3 0.0000 0.966 0.000 0.000 1.000 0.000
#> GSM447415 1 0.0000 0.999 1.000 0.000 0.000 0.000
#> GSM447416 3 0.0000 0.966 0.000 0.000 1.000 0.000
#> GSM447425 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> GSM447430 4 0.0000 0.910 0.000 0.000 0.000 1.000
#> GSM447435 1 0.0000 0.999 1.000 0.000 0.000 0.000
#> GSM447440 1 0.0000 0.999 1.000 0.000 0.000 0.000
#> GSM447444 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> GSM447448 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> GSM447449 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> GSM447450 1 0.0000 0.999 1.000 0.000 0.000 0.000
#> GSM447452 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> GSM447458 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> GSM447461 4 0.4985 0.122 0.468 0.000 0.000 0.532
#> GSM447464 1 0.0000 0.999 1.000 0.000 0.000 0.000
#> GSM447468 1 0.0000 0.999 1.000 0.000 0.000 0.000
#> GSM447472 1 0.0000 0.999 1.000 0.000 0.000 0.000
#> GSM447400 1 0.0000 0.999 1.000 0.000 0.000 0.000
#> GSM447402 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> GSM447403 1 0.0000 0.999 1.000 0.000 0.000 0.000
#> GSM447405 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> GSM447418 3 0.0000 0.966 0.000 0.000 1.000 0.000
#> GSM447422 3 0.0000 0.966 0.000 0.000 1.000 0.000
#> GSM447424 3 0.0000 0.966 0.000 0.000 1.000 0.000
#> GSM447427 3 0.0000 0.966 0.000 0.000 1.000 0.000
#> GSM447428 3 0.0000 0.966 0.000 0.000 1.000 0.000
#> GSM447429 3 0.2081 0.888 0.084 0.000 0.916 0.000
#> GSM447431 4 0.0000 0.910 0.000 0.000 0.000 1.000
#> GSM447432 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> GSM447434 1 0.0000 0.999 1.000 0.000 0.000 0.000
#> GSM447442 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> GSM447451 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> GSM447462 1 0.0000 0.999 1.000 0.000 0.000 0.000
#> GSM447463 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> GSM447467 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> GSM447469 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> GSM447473 1 0.0000 0.999 1.000 0.000 0.000 0.000
#> GSM447404 1 0.0000 0.999 1.000 0.000 0.000 0.000
#> GSM447406 4 0.0000 0.910 0.000 0.000 0.000 1.000
#> GSM447407 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> GSM447409 1 0.0000 0.999 1.000 0.000 0.000 0.000
#> GSM447412 3 0.0000 0.966 0.000 0.000 1.000 0.000
#> GSM447426 3 0.0000 0.966 0.000 0.000 1.000 0.000
#> GSM447433 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> GSM447439 4 0.0000 0.910 0.000 0.000 0.000 1.000
#> GSM447441 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> GSM447443 1 0.0000 0.999 1.000 0.000 0.000 0.000
#> GSM447445 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> GSM447446 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> GSM447453 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> GSM447455 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> GSM447456 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> GSM447459 2 0.0188 0.996 0.000 0.996 0.000 0.004
#> GSM447466 1 0.0000 0.999 1.000 0.000 0.000 0.000
#> GSM447470 1 0.0336 0.990 0.992 0.000 0.008 0.000
#> GSM447474 1 0.0000 0.999 1.000 0.000 0.000 0.000
#> GSM447475 1 0.0000 0.999 1.000 0.000 0.000 0.000
#> GSM447398 4 0.0000 0.910 0.000 0.000 0.000 1.000
#> GSM447399 4 0.0000 0.910 0.000 0.000 0.000 1.000
#> GSM447408 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> GSM447410 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> GSM447414 3 0.0000 0.966 0.000 0.000 1.000 0.000
#> GSM447417 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> GSM447419 3 0.3123 0.805 0.156 0.000 0.844 0.000
#> GSM447420 3 0.0000 0.966 0.000 0.000 1.000 0.000
#> GSM447421 3 0.3123 0.805 0.156 0.000 0.844 0.000
#> GSM447423 3 0.0000 0.966 0.000 0.000 1.000 0.000
#> GSM447436 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> GSM447437 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> GSM447438 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> GSM447447 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> GSM447454 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> GSM447457 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> GSM447460 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> GSM447465 2 0.0000 1.000 0.000 1.000 0.000 0.000
#> GSM447471 1 0.0000 0.999 1.000 0.000 0.000 0.000
#> GSM447476 2 0.0000 1.000 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
#> GSM447401 3 0.0000 0.989 0.000 0.000 1.000 0.000 0.000
#> GSM447411 1 0.0000 1.000 1.000 0.000 0.000 0.000 0.000
#> GSM447413 3 0.0000 0.989 0.000 0.000 1.000 0.000 0.000
#> GSM447415 1 0.0000 1.000 1.000 0.000 0.000 0.000 0.000
#> GSM447416 3 0.0000 0.989 0.000 0.000 1.000 0.000 0.000
#> GSM447425 2 0.0000 0.985 0.000 1.000 0.000 0.000 0.000
#> GSM447430 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000
#> GSM447435 1 0.0000 1.000 1.000 0.000 0.000 0.000 0.000
#> GSM447440 1 0.0000 1.000 1.000 0.000 0.000 0.000 0.000
#> GSM447444 5 0.0290 0.991 0.000 0.008 0.000 0.000 0.992
#> GSM447448 5 0.0000 0.997 0.000 0.000 0.000 0.000 1.000
#> GSM447449 2 0.0000 0.985 0.000 1.000 0.000 0.000 0.000
#> GSM447450 1 0.0000 1.000 1.000 0.000 0.000 0.000 0.000
#> GSM447452 2 0.0000 0.985 0.000 1.000 0.000 0.000 0.000
#> GSM447458 2 0.0000 0.985 0.000 1.000 0.000 0.000 0.000
#> GSM447461 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000
#> GSM447464 1 0.0000 1.000 1.000 0.000 0.000 0.000 0.000
#> GSM447468 1 0.0000 1.000 1.000 0.000 0.000 0.000 0.000
#> GSM447472 1 0.0000 1.000 1.000 0.000 0.000 0.000 0.000
#> GSM447400 1 0.0000 1.000 1.000 0.000 0.000 0.000 0.000
#> GSM447402 2 0.0000 0.985 0.000 1.000 0.000 0.000 0.000
#> GSM447403 1 0.0000 1.000 1.000 0.000 0.000 0.000 0.000
#> GSM447405 5 0.0290 0.991 0.000 0.008 0.000 0.000 0.992
#> GSM447418 3 0.0000 0.989 0.000 0.000 1.000 0.000 0.000
#> GSM447422 3 0.0000 0.989 0.000 0.000 1.000 0.000 0.000
#> GSM447424 3 0.0000 0.989 0.000 0.000 1.000 0.000 0.000
#> GSM447427 3 0.0000 0.989 0.000 0.000 1.000 0.000 0.000
#> GSM447428 3 0.0290 0.982 0.008 0.000 0.992 0.000 0.000
#> GSM447429 1 0.0000 1.000 1.000 0.000 0.000 0.000 0.000
#> GSM447431 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000
#> GSM447432 2 0.0000 0.985 0.000 1.000 0.000 0.000 0.000
#> GSM447434 1 0.0000 1.000 1.000 0.000 0.000 0.000 0.000
#> GSM447442 2 0.0000 0.985 0.000 1.000 0.000 0.000 0.000
#> GSM447451 2 0.0000 0.985 0.000 1.000 0.000 0.000 0.000
#> GSM447462 1 0.0000 1.000 1.000 0.000 0.000 0.000 0.000
#> GSM447463 5 0.0000 0.997 0.000 0.000 0.000 0.000 1.000
#> GSM447467 2 0.0000 0.985 0.000 1.000 0.000 0.000 0.000
#> GSM447469 2 0.0000 0.985 0.000 1.000 0.000 0.000 0.000
#> GSM447473 1 0.0000 1.000 1.000 0.000 0.000 0.000 0.000
#> GSM447404 1 0.0000 1.000 1.000 0.000 0.000 0.000 0.000
#> GSM447406 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000
#> GSM447407 2 0.0000 0.985 0.000 1.000 0.000 0.000 0.000
#> GSM447409 1 0.0000 1.000 1.000 0.000 0.000 0.000 0.000
#> GSM447412 3 0.0000 0.989 0.000 0.000 1.000 0.000 0.000
#> GSM447426 3 0.0000 0.989 0.000 0.000 1.000 0.000 0.000
#> GSM447433 5 0.0290 0.991 0.000 0.008 0.000 0.000 0.992
#> GSM447439 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000
#> GSM447441 2 0.0000 0.985 0.000 1.000 0.000 0.000 0.000
#> GSM447443 1 0.0000 1.000 1.000 0.000 0.000 0.000 0.000
#> GSM447445 5 0.0000 0.997 0.000 0.000 0.000 0.000 1.000
#> GSM447446 5 0.0000 0.997 0.000 0.000 0.000 0.000 1.000
#> GSM447453 5 0.0000 0.997 0.000 0.000 0.000 0.000 1.000
#> GSM447455 2 0.0000 0.985 0.000 1.000 0.000 0.000 0.000
#> GSM447456 2 0.3932 0.510 0.000 0.672 0.000 0.000 0.328
#> GSM447459 2 0.0000 0.985 0.000 1.000 0.000 0.000 0.000
#> GSM447466 1 0.0000 1.000 1.000 0.000 0.000 0.000 0.000
#> GSM447470 1 0.0000 1.000 1.000 0.000 0.000 0.000 0.000
#> GSM447474 1 0.0000 1.000 1.000 0.000 0.000 0.000 0.000
#> GSM447475 3 0.2411 0.875 0.008 0.000 0.884 0.108 0.000
#> GSM447398 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000
#> GSM447399 4 0.0000 1.000 0.000 0.000 0.000 1.000 0.000
#> GSM447408 2 0.0000 0.985 0.000 1.000 0.000 0.000 0.000
#> GSM447410 2 0.0000 0.985 0.000 1.000 0.000 0.000 0.000
#> GSM447414 3 0.0290 0.984 0.000 0.000 0.992 0.008 0.000
#> GSM447417 2 0.0000 0.985 0.000 1.000 0.000 0.000 0.000
#> GSM447419 1 0.0000 1.000 1.000 0.000 0.000 0.000 0.000
#> GSM447420 3 0.0404 0.978 0.012 0.000 0.988 0.000 0.000
#> GSM447421 1 0.0000 1.000 1.000 0.000 0.000 0.000 0.000
#> GSM447423 3 0.0000 0.989 0.000 0.000 1.000 0.000 0.000
#> GSM447436 5 0.0000 0.997 0.000 0.000 0.000 0.000 1.000
#> GSM447437 5 0.0000 0.997 0.000 0.000 0.000 0.000 1.000
#> GSM447438 2 0.0000 0.985 0.000 1.000 0.000 0.000 0.000
#> GSM447447 5 0.0000 0.997 0.000 0.000 0.000 0.000 1.000
#> GSM447454 2 0.0000 0.985 0.000 1.000 0.000 0.000 0.000
#> GSM447457 2 0.0000 0.985 0.000 1.000 0.000 0.000 0.000
#> GSM447460 2 0.0000 0.985 0.000 1.000 0.000 0.000 0.000
#> GSM447465 2 0.0000 0.985 0.000 1.000 0.000 0.000 0.000
#> GSM447471 1 0.0000 1.000 1.000 0.000 0.000 0.000 0.000
#> GSM447476 2 0.0000 0.985 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
#> GSM447401 3 0.0000 0.949 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM447411 6 0.0000 0.966 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM447413 3 0.0000 0.949 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM447415 6 0.0000 0.966 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM447416 3 0.0000 0.949 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM447425 2 0.0713 0.972 0.000 0.972 0.000 0.028 0.000 0.000
#> GSM447430 5 0.0000 1.000 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM447435 6 0.0000 0.966 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM447440 6 0.0000 0.966 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM447444 1 0.0865 0.935 0.964 0.036 0.000 0.000 0.000 0.000
#> GSM447448 1 0.0000 0.968 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM447449 2 0.0000 0.993 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM447450 6 0.0000 0.966 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM447452 4 0.2664 0.959 0.000 0.184 0.000 0.816 0.000 0.000
#> GSM447458 2 0.0000 0.993 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM447461 5 0.0000 1.000 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM447464 6 0.0000 0.966 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM447468 6 0.0000 0.966 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM447472 6 0.0146 0.964 0.000 0.000 0.000 0.004 0.000 0.996
#> GSM447400 6 0.0000 0.966 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM447402 2 0.0000 0.993 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM447403 6 0.0000 0.966 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM447405 1 0.0000 0.968 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM447418 3 0.0000 0.949 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM447422 3 0.0000 0.949 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM447424 3 0.0000 0.949 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM447427 3 0.0000 0.949 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM447428 3 0.0713 0.934 0.000 0.000 0.972 0.028 0.000 0.000
#> GSM447429 6 0.3104 0.824 0.000 0.000 0.016 0.184 0.000 0.800
#> GSM447431 5 0.0000 1.000 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM447432 2 0.0000 0.993 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM447434 6 0.0000 0.966 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM447442 4 0.2730 0.955 0.000 0.192 0.000 0.808 0.000 0.000
#> GSM447451 2 0.0000 0.993 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM447462 6 0.0000 0.966 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM447463 1 0.0000 0.968 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM447467 1 0.2969 0.651 0.776 0.224 0.000 0.000 0.000 0.000
#> GSM447469 2 0.0000 0.993 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM447473 6 0.0000 0.966 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM447404 6 0.0000 0.966 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM447406 5 0.0000 1.000 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM447407 2 0.0458 0.983 0.000 0.984 0.000 0.016 0.000 0.000
#> GSM447409 6 0.0000 0.966 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM447412 3 0.0000 0.949 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM447426 3 0.0000 0.949 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM447433 1 0.0458 0.957 0.984 0.000 0.000 0.016 0.000 0.000
#> GSM447439 5 0.0000 1.000 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM447441 2 0.0000 0.993 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM447443 6 0.0000 0.966 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM447445 1 0.0000 0.968 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM447446 1 0.0000 0.968 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM447453 1 0.0000 0.968 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM447455 2 0.0000 0.993 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM447456 4 0.3229 0.781 0.140 0.044 0.000 0.816 0.000 0.000
#> GSM447459 4 0.2912 0.957 0.000 0.172 0.000 0.816 0.012 0.000
#> GSM447466 6 0.0000 0.966 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM447470 3 0.2664 0.822 0.000 0.000 0.816 0.184 0.000 0.000
#> GSM447474 6 0.2562 0.847 0.000 0.000 0.000 0.172 0.000 0.828
#> GSM447475 3 0.3804 0.517 0.000 0.000 0.656 0.000 0.336 0.008
#> GSM447398 5 0.0000 1.000 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM447399 5 0.0000 1.000 0.000 0.000 0.000 0.000 1.000 0.000
#> GSM447408 2 0.0458 0.983 0.000 0.984 0.000 0.016 0.000 0.000
#> GSM447410 4 0.2664 0.959 0.000 0.184 0.000 0.816 0.000 0.000
#> GSM447414 3 0.0260 0.944 0.000 0.000 0.992 0.000 0.008 0.000
#> GSM447417 2 0.0458 0.983 0.000 0.984 0.000 0.016 0.000 0.000
#> GSM447419 6 0.2915 0.831 0.000 0.000 0.008 0.184 0.000 0.808
#> GSM447420 3 0.2664 0.822 0.000 0.000 0.816 0.184 0.000 0.000
#> GSM447421 6 0.3104 0.824 0.000 0.000 0.016 0.184 0.000 0.800
#> GSM447423 3 0.0000 0.949 0.000 0.000 1.000 0.000 0.000 0.000
#> GSM447436 1 0.0000 0.968 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM447437 1 0.0000 0.968 1.000 0.000 0.000 0.000 0.000 0.000
#> GSM447438 4 0.2912 0.957 0.000 0.172 0.000 0.816 0.012 0.000
#> GSM447447 1 0.0146 0.965 0.996 0.004 0.000 0.000 0.000 0.000
#> GSM447454 4 0.2793 0.949 0.000 0.200 0.000 0.800 0.000 0.000
#> GSM447457 2 0.0000 0.993 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM447460 2 0.0000 0.993 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM447465 2 0.0000 0.993 0.000 1.000 0.000 0.000 0.000 0.000
#> GSM447471 6 0.0000 0.966 0.000 0.000 0.000 0.000 0.000 1.000
#> GSM447476 4 0.2848 0.958 0.008 0.176 0.000 0.816 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 gender(p) agent(p) k
#> ATC:mclust 79 0.208 0.4204 2
#> ATC:mclust 79 0.331 0.0383 3
#> ATC:mclust 78 0.326 0.0794 4
#> ATC:mclust 79 0.560 0.5422 5
#> ATC:mclust 79 0.516 0.8457 6
If matrix rows can be associated to genes, consider to use functional_enrichment(res,
...)
to perform function enrichment for the signature genes. See this vignette for more detailed explanations.
The object with results only for a single top-value method and a single partition method can be extracted as:
res = res_list["ATC", "NMF"]
# you can also extract it by
# res = res_list["ATC:NMF"]
A summary of res
and all the functions that can be applied to it:
res
#> A 'ConsensusPartition' object with k = 2, 3, 4, 5, 6.
#> On a matrix with 51941 rows and 79 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.706 0.857 0.940 0.5017 0.494 0.494
#> 3 3 0.823 0.877 0.944 0.3278 0.710 0.481
#> 4 4 0.849 0.847 0.935 0.1261 0.746 0.391
#> 5 5 0.685 0.700 0.815 0.0654 0.887 0.593
#> 6 6 0.678 0.632 0.765 0.0373 0.941 0.720
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
#> GSM447401 2 0.9323 0.5113 0.348 0.652
#> GSM447411 1 0.0000 0.9520 1.000 0.000
#> GSM447413 2 0.9754 0.3701 0.408 0.592
#> GSM447415 1 0.0000 0.9520 1.000 0.000
#> GSM447416 2 0.9732 0.3800 0.404 0.596
#> GSM447425 2 0.0000 0.9126 0.000 1.000
#> GSM447430 1 0.0000 0.9520 1.000 0.000
#> GSM447435 1 0.0000 0.9520 1.000 0.000
#> GSM447440 1 0.0000 0.9520 1.000 0.000
#> GSM447444 2 0.0000 0.9126 0.000 1.000
#> GSM447448 2 0.0000 0.9126 0.000 1.000
#> GSM447449 2 0.0000 0.9126 0.000 1.000
#> GSM447450 1 0.0000 0.9520 1.000 0.000
#> GSM447452 2 0.9087 0.5583 0.324 0.676
#> GSM447458 2 0.0000 0.9126 0.000 1.000
#> GSM447461 1 0.0000 0.9520 1.000 0.000
#> GSM447464 1 0.0000 0.9520 1.000 0.000
#> GSM447468 1 0.0000 0.9520 1.000 0.000
#> GSM447472 1 0.0000 0.9520 1.000 0.000
#> GSM447400 1 0.0000 0.9520 1.000 0.000
#> GSM447402 2 0.0000 0.9126 0.000 1.000
#> GSM447403 1 0.0000 0.9520 1.000 0.000
#> GSM447405 2 0.8955 0.5742 0.312 0.688
#> GSM447418 2 0.0000 0.9126 0.000 1.000
#> GSM447422 2 0.6623 0.7739 0.172 0.828
#> GSM447424 2 0.0000 0.9126 0.000 1.000
#> GSM447427 2 0.1184 0.9031 0.016 0.984
#> GSM447428 2 0.0000 0.9126 0.000 1.000
#> GSM447429 1 0.0000 0.9520 1.000 0.000
#> GSM447431 1 0.0000 0.9520 1.000 0.000
#> GSM447432 2 0.0000 0.9126 0.000 1.000
#> GSM447434 1 0.0000 0.9520 1.000 0.000
#> GSM447442 2 0.0000 0.9126 0.000 1.000
#> GSM447451 2 0.0000 0.9126 0.000 1.000
#> GSM447462 1 0.0000 0.9520 1.000 0.000
#> GSM447463 2 0.7453 0.7186 0.212 0.788
#> GSM447467 2 0.0000 0.9126 0.000 1.000
#> GSM447469 2 0.0000 0.9126 0.000 1.000
#> GSM447473 1 0.0000 0.9520 1.000 0.000
#> GSM447404 1 0.0000 0.9520 1.000 0.000
#> GSM447406 1 0.3879 0.8792 0.924 0.076
#> GSM447407 2 0.0000 0.9126 0.000 1.000
#> GSM447409 1 0.0000 0.9520 1.000 0.000
#> GSM447412 1 0.0000 0.9520 1.000 0.000
#> GSM447426 2 0.4815 0.8390 0.104 0.896
#> GSM447433 2 0.6438 0.7811 0.164 0.836
#> GSM447439 1 0.0000 0.9520 1.000 0.000
#> GSM447441 2 0.0000 0.9126 0.000 1.000
#> GSM447443 1 0.0000 0.9520 1.000 0.000
#> GSM447445 2 0.0000 0.9126 0.000 1.000
#> GSM447446 2 0.0000 0.9126 0.000 1.000
#> GSM447453 2 0.0000 0.9126 0.000 1.000
#> GSM447455 2 0.0000 0.9126 0.000 1.000
#> GSM447456 1 0.0672 0.9453 0.992 0.008
#> GSM447459 1 0.6048 0.7942 0.852 0.148
#> GSM447466 1 0.0000 0.9520 1.000 0.000
#> GSM447470 1 0.0000 0.9520 1.000 0.000
#> GSM447474 1 0.0000 0.9520 1.000 0.000
#> GSM447475 1 0.0000 0.9520 1.000 0.000
#> GSM447398 1 0.0000 0.9520 1.000 0.000
#> GSM447399 1 0.0000 0.9520 1.000 0.000
#> GSM447408 2 0.0000 0.9126 0.000 1.000
#> GSM447410 2 0.9129 0.5568 0.328 0.672
#> GSM447414 1 0.9635 0.3035 0.612 0.388
#> GSM447417 2 0.0000 0.9126 0.000 1.000
#> GSM447419 1 0.0000 0.9520 1.000 0.000
#> GSM447420 2 0.9248 0.5338 0.340 0.660
#> GSM447421 1 0.0000 0.9520 1.000 0.000
#> GSM447423 1 0.7602 0.6825 0.780 0.220
#> GSM447436 2 0.0000 0.9126 0.000 1.000
#> GSM447437 1 0.9963 0.0701 0.536 0.464
#> GSM447438 1 0.0000 0.9520 1.000 0.000
#> GSM447447 2 0.0000 0.9126 0.000 1.000
#> GSM447454 2 0.0000 0.9126 0.000 1.000
#> GSM447457 2 0.0000 0.9126 0.000 1.000
#> GSM447460 2 0.0000 0.9126 0.000 1.000
#> GSM447465 2 0.0000 0.9126 0.000 1.000
#> GSM447471 1 0.0000 0.9520 1.000 0.000
#> GSM447476 1 0.8861 0.5226 0.696 0.304
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> GSM447401 2 0.8801 0.462 0.152 0.564 0.284
#> GSM447411 1 0.0000 0.927 1.000 0.000 0.000
#> GSM447413 3 0.1289 0.951 0.000 0.032 0.968
#> GSM447415 1 0.0000 0.927 1.000 0.000 0.000
#> GSM447416 1 0.6140 0.263 0.596 0.404 0.000
#> GSM447425 2 0.2165 0.887 0.000 0.936 0.064
#> GSM447430 3 0.0000 0.978 0.000 0.000 1.000
#> GSM447435 1 0.0000 0.927 1.000 0.000 0.000
#> GSM447440 1 0.6274 0.177 0.544 0.000 0.456
#> GSM447444 2 0.0000 0.924 0.000 1.000 0.000
#> GSM447448 2 0.2711 0.875 0.088 0.912 0.000
#> GSM447449 2 0.0000 0.924 0.000 1.000 0.000
#> GSM447450 3 0.2165 0.919 0.064 0.000 0.936
#> GSM447452 3 0.0000 0.978 0.000 0.000 1.000
#> GSM447458 2 0.0000 0.924 0.000 1.000 0.000
#> GSM447461 3 0.0000 0.978 0.000 0.000 1.000
#> GSM447464 1 0.0000 0.927 1.000 0.000 0.000
#> GSM447468 1 0.0000 0.927 1.000 0.000 0.000
#> GSM447472 1 0.1643 0.900 0.956 0.000 0.044
#> GSM447400 1 0.2356 0.878 0.928 0.000 0.072
#> GSM447402 2 0.0000 0.924 0.000 1.000 0.000
#> GSM447403 1 0.0000 0.927 1.000 0.000 0.000
#> GSM447405 1 0.5835 0.476 0.660 0.340 0.000
#> GSM447418 2 0.4605 0.757 0.204 0.796 0.000
#> GSM447422 2 0.4605 0.757 0.204 0.796 0.000
#> GSM447424 2 0.4605 0.757 0.204 0.796 0.000
#> GSM447427 1 0.4555 0.714 0.800 0.200 0.000
#> GSM447428 1 0.0592 0.920 0.988 0.012 0.000
#> GSM447429 1 0.0000 0.927 1.000 0.000 0.000
#> GSM447431 3 0.0000 0.978 0.000 0.000 1.000
#> GSM447432 2 0.0000 0.924 0.000 1.000 0.000
#> GSM447434 3 0.0237 0.975 0.004 0.000 0.996
#> GSM447442 2 0.0237 0.922 0.000 0.996 0.004
#> GSM447451 2 0.0000 0.924 0.000 1.000 0.000
#> GSM447462 1 0.4062 0.780 0.836 0.000 0.164
#> GSM447463 1 0.3816 0.799 0.852 0.148 0.000
#> GSM447467 2 0.0000 0.924 0.000 1.000 0.000
#> GSM447469 2 0.0000 0.924 0.000 1.000 0.000
#> GSM447473 1 0.0000 0.927 1.000 0.000 0.000
#> GSM447404 1 0.0000 0.927 1.000 0.000 0.000
#> GSM447406 3 0.0000 0.978 0.000 0.000 1.000
#> GSM447407 2 0.4346 0.758 0.000 0.816 0.184
#> GSM447409 3 0.1411 0.948 0.036 0.000 0.964
#> GSM447412 1 0.0592 0.921 0.988 0.000 0.012
#> GSM447426 2 0.6111 0.383 0.396 0.604 0.000
#> GSM447433 2 0.2063 0.899 0.008 0.948 0.044
#> GSM447439 3 0.0000 0.978 0.000 0.000 1.000
#> GSM447441 2 0.0000 0.924 0.000 1.000 0.000
#> GSM447443 1 0.0000 0.927 1.000 0.000 0.000
#> GSM447445 2 0.3686 0.822 0.140 0.860 0.000
#> GSM447446 2 0.0000 0.924 0.000 1.000 0.000
#> GSM447453 2 0.2625 0.877 0.084 0.916 0.000
#> GSM447455 2 0.0000 0.924 0.000 1.000 0.000
#> GSM447456 3 0.0000 0.978 0.000 0.000 1.000
#> GSM447459 3 0.0000 0.978 0.000 0.000 1.000
#> GSM447466 1 0.0000 0.927 1.000 0.000 0.000
#> GSM447470 1 0.0000 0.927 1.000 0.000 0.000
#> GSM447474 1 0.0000 0.927 1.000 0.000 0.000
#> GSM447475 3 0.0000 0.978 0.000 0.000 1.000
#> GSM447398 3 0.0000 0.978 0.000 0.000 1.000
#> GSM447399 3 0.0000 0.978 0.000 0.000 1.000
#> GSM447408 3 0.5178 0.641 0.000 0.256 0.744
#> GSM447410 3 0.0000 0.978 0.000 0.000 1.000
#> GSM447414 3 0.0000 0.978 0.000 0.000 1.000
#> GSM447417 2 0.0237 0.922 0.000 0.996 0.004
#> GSM447419 1 0.0000 0.927 1.000 0.000 0.000
#> GSM447420 1 0.0000 0.927 1.000 0.000 0.000
#> GSM447421 1 0.0000 0.927 1.000 0.000 0.000
#> GSM447423 1 0.0000 0.927 1.000 0.000 0.000
#> GSM447436 2 0.2165 0.892 0.064 0.936 0.000
#> GSM447437 1 0.0000 0.927 1.000 0.000 0.000
#> GSM447438 3 0.0000 0.978 0.000 0.000 1.000
#> GSM447447 2 0.0000 0.924 0.000 1.000 0.000
#> GSM447454 2 0.0000 0.924 0.000 1.000 0.000
#> GSM447457 2 0.0000 0.924 0.000 1.000 0.000
#> GSM447460 2 0.0000 0.924 0.000 1.000 0.000
#> GSM447465 2 0.0000 0.924 0.000 1.000 0.000
#> GSM447471 1 0.1860 0.894 0.948 0.000 0.052
#> GSM447476 3 0.0000 0.978 0.000 0.000 1.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> GSM447401 3 0.0000 0.92976 0.000 0.000 1.000 0.000
#> GSM447411 1 0.0000 0.88892 1.000 0.000 0.000 0.000
#> GSM447413 3 0.0000 0.92976 0.000 0.000 1.000 0.000
#> GSM447415 1 0.0000 0.88892 1.000 0.000 0.000 0.000
#> GSM447416 3 0.0000 0.92976 0.000 0.000 1.000 0.000
#> GSM447425 2 0.0000 0.98223 0.000 1.000 0.000 0.000
#> GSM447430 4 0.0000 0.88974 0.000 0.000 0.000 1.000
#> GSM447435 1 0.0000 0.88892 1.000 0.000 0.000 0.000
#> GSM447440 4 0.0188 0.88809 0.004 0.000 0.000 0.996
#> GSM447444 2 0.0000 0.98223 0.000 1.000 0.000 0.000
#> GSM447448 1 0.4817 0.43951 0.612 0.388 0.000 0.000
#> GSM447449 2 0.0000 0.98223 0.000 1.000 0.000 0.000
#> GSM447450 4 0.0000 0.88974 0.000 0.000 0.000 1.000
#> GSM447452 4 0.1637 0.85094 0.000 0.060 0.000 0.940
#> GSM447458 2 0.0000 0.98223 0.000 1.000 0.000 0.000
#> GSM447461 4 0.0000 0.88974 0.000 0.000 0.000 1.000
#> GSM447464 1 0.0592 0.88070 0.984 0.000 0.000 0.016
#> GSM447468 1 0.3569 0.68445 0.804 0.000 0.000 0.196
#> GSM447472 4 0.4585 0.49889 0.332 0.000 0.000 0.668
#> GSM447400 4 0.0592 0.88189 0.016 0.000 0.000 0.984
#> GSM447402 2 0.0000 0.98223 0.000 1.000 0.000 0.000
#> GSM447403 1 0.0000 0.88892 1.000 0.000 0.000 0.000
#> GSM447405 1 0.4916 0.35100 0.576 0.424 0.000 0.000
#> GSM447418 3 0.0000 0.92976 0.000 0.000 1.000 0.000
#> GSM447422 3 0.0000 0.92976 0.000 0.000 1.000 0.000
#> GSM447424 3 0.0000 0.92976 0.000 0.000 1.000 0.000
#> GSM447427 3 0.0000 0.92976 0.000 0.000 1.000 0.000
#> GSM447428 3 0.0000 0.92976 0.000 0.000 1.000 0.000
#> GSM447429 3 0.1867 0.88270 0.072 0.000 0.928 0.000
#> GSM447431 4 0.0000 0.88974 0.000 0.000 0.000 1.000
#> GSM447432 2 0.0000 0.98223 0.000 1.000 0.000 0.000
#> GSM447434 4 0.0000 0.88974 0.000 0.000 0.000 1.000
#> GSM447442 2 0.0000 0.98223 0.000 1.000 0.000 0.000
#> GSM447451 2 0.0000 0.98223 0.000 1.000 0.000 0.000
#> GSM447462 4 0.0000 0.88974 0.000 0.000 0.000 1.000
#> GSM447463 1 0.0188 0.88749 0.996 0.004 0.000 0.000
#> GSM447467 2 0.0000 0.98223 0.000 1.000 0.000 0.000
#> GSM447469 2 0.0000 0.98223 0.000 1.000 0.000 0.000
#> GSM447473 1 0.0000 0.88892 1.000 0.000 0.000 0.000
#> GSM447404 1 0.0000 0.88892 1.000 0.000 0.000 0.000
#> GSM447406 4 0.0000 0.88974 0.000 0.000 0.000 1.000
#> GSM447407 2 0.0000 0.98223 0.000 1.000 0.000 0.000
#> GSM447409 4 0.0817 0.87714 0.024 0.000 0.000 0.976
#> GSM447412 3 0.0000 0.92976 0.000 0.000 1.000 0.000
#> GSM447426 3 0.0000 0.92976 0.000 0.000 1.000 0.000
#> GSM447433 2 0.0000 0.98223 0.000 1.000 0.000 0.000
#> GSM447439 4 0.0000 0.88974 0.000 0.000 0.000 1.000
#> GSM447441 2 0.0000 0.98223 0.000 1.000 0.000 0.000
#> GSM447443 1 0.2300 0.84699 0.924 0.000 0.028 0.048
#> GSM447445 1 0.4134 0.67025 0.740 0.260 0.000 0.000
#> GSM447446 2 0.0000 0.98223 0.000 1.000 0.000 0.000
#> GSM447453 1 0.2589 0.82401 0.884 0.116 0.000 0.000
#> GSM447455 2 0.0000 0.98223 0.000 1.000 0.000 0.000
#> GSM447456 4 0.4356 0.60994 0.000 0.292 0.000 0.708
#> GSM447459 4 0.0000 0.88974 0.000 0.000 0.000 1.000
#> GSM447466 1 0.0000 0.88892 1.000 0.000 0.000 0.000
#> GSM447470 3 0.3219 0.78574 0.164 0.000 0.836 0.000
#> GSM447474 4 0.7629 0.00419 0.392 0.000 0.204 0.404
#> GSM447475 4 0.0000 0.88974 0.000 0.000 0.000 1.000
#> GSM447398 4 0.0000 0.88974 0.000 0.000 0.000 1.000
#> GSM447399 4 0.0000 0.88974 0.000 0.000 0.000 1.000
#> GSM447408 2 0.0000 0.98223 0.000 1.000 0.000 0.000
#> GSM447410 4 0.3172 0.76582 0.000 0.160 0.000 0.840
#> GSM447414 3 0.4454 0.52252 0.000 0.000 0.692 0.308
#> GSM447417 2 0.0000 0.98223 0.000 1.000 0.000 0.000
#> GSM447419 3 0.1042 0.91522 0.008 0.000 0.972 0.020
#> GSM447420 3 0.0000 0.92976 0.000 0.000 1.000 0.000
#> GSM447421 3 0.2760 0.83061 0.128 0.000 0.872 0.000
#> GSM447423 3 0.0000 0.92976 0.000 0.000 1.000 0.000
#> GSM447436 2 0.4522 0.44846 0.320 0.680 0.000 0.000
#> GSM447437 1 0.0000 0.88892 1.000 0.000 0.000 0.000
#> GSM447438 4 0.0188 0.88791 0.000 0.004 0.000 0.996
#> GSM447447 2 0.0000 0.98223 0.000 1.000 0.000 0.000
#> GSM447454 3 0.4746 0.41306 0.000 0.368 0.632 0.000
#> GSM447457 2 0.0188 0.97846 0.000 0.996 0.004 0.000
#> GSM447460 2 0.0000 0.98223 0.000 1.000 0.000 0.000
#> GSM447465 2 0.0188 0.97846 0.000 0.996 0.004 0.000
#> GSM447471 4 0.4994 0.12359 0.480 0.000 0.000 0.520
#> GSM447476 4 0.4356 0.60924 0.000 0.292 0.000 0.708
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> GSM447401 3 0.1282 0.86758 0.000 0.004 0.952 0.000 0.044
#> GSM447411 1 0.1443 0.83484 0.948 0.004 0.000 0.044 0.004
#> GSM447413 3 0.0693 0.87751 0.000 0.012 0.980 0.000 0.008
#> GSM447415 1 0.2139 0.82718 0.916 0.000 0.032 0.000 0.052
#> GSM447416 3 0.0451 0.87681 0.000 0.008 0.988 0.000 0.004
#> GSM447425 5 0.3586 0.74497 0.000 0.264 0.000 0.000 0.736
#> GSM447430 4 0.2020 0.83292 0.000 0.000 0.000 0.900 0.100
#> GSM447435 1 0.2054 0.83020 0.916 0.004 0.000 0.072 0.008
#> GSM447440 4 0.0992 0.82677 0.008 0.000 0.000 0.968 0.024
#> GSM447444 2 0.3774 0.67903 0.032 0.808 0.008 0.000 0.152
#> GSM447448 2 0.4659 -0.02567 0.488 0.500 0.000 0.000 0.012
#> GSM447449 2 0.1544 0.72295 0.000 0.932 0.000 0.000 0.068
#> GSM447450 4 0.1012 0.82814 0.012 0.000 0.000 0.968 0.020
#> GSM447452 5 0.3675 0.52405 0.000 0.024 0.000 0.188 0.788
#> GSM447458 2 0.3661 0.45666 0.000 0.724 0.000 0.000 0.276
#> GSM447461 4 0.0955 0.82704 0.004 0.000 0.000 0.968 0.028
#> GSM447464 1 0.3280 0.74702 0.812 0.000 0.000 0.176 0.012
#> GSM447468 1 0.6404 0.24214 0.472 0.000 0.004 0.372 0.152
#> GSM447472 4 0.1942 0.81370 0.068 0.000 0.000 0.920 0.012
#> GSM447400 4 0.3343 0.79656 0.016 0.000 0.000 0.812 0.172
#> GSM447402 5 0.4192 0.61101 0.000 0.404 0.000 0.000 0.596
#> GSM447403 1 0.1544 0.82952 0.932 0.000 0.000 0.000 0.068
#> GSM447405 5 0.4599 0.64058 0.156 0.100 0.000 0.000 0.744
#> GSM447418 3 0.2930 0.81256 0.000 0.164 0.832 0.000 0.004
#> GSM447422 3 0.3461 0.75616 0.000 0.224 0.772 0.000 0.004
#> GSM447424 3 0.3196 0.79030 0.000 0.192 0.804 0.000 0.004
#> GSM447427 3 0.1168 0.87651 0.000 0.032 0.960 0.000 0.008
#> GSM447428 3 0.2074 0.85160 0.000 0.104 0.896 0.000 0.000
#> GSM447429 3 0.2344 0.84832 0.064 0.000 0.904 0.000 0.032
#> GSM447431 4 0.2127 0.83338 0.000 0.000 0.000 0.892 0.108
#> GSM447432 2 0.3074 0.62020 0.000 0.804 0.000 0.000 0.196
#> GSM447434 4 0.2230 0.82769 0.000 0.000 0.000 0.884 0.116
#> GSM447442 2 0.2438 0.69597 0.000 0.900 0.000 0.060 0.040
#> GSM447451 2 0.0404 0.72331 0.000 0.988 0.000 0.000 0.012
#> GSM447462 4 0.3309 0.81433 0.036 0.000 0.000 0.836 0.128
#> GSM447463 1 0.1331 0.81719 0.952 0.040 0.000 0.000 0.008
#> GSM447467 2 0.2116 0.72375 0.008 0.912 0.004 0.000 0.076
#> GSM447469 5 0.4171 0.62583 0.000 0.396 0.000 0.000 0.604
#> GSM447473 1 0.3780 0.80021 0.820 0.000 0.028 0.020 0.132
#> GSM447404 1 0.3344 0.81781 0.852 0.000 0.016 0.028 0.104
#> GSM447406 4 0.2605 0.80852 0.000 0.000 0.000 0.852 0.148
#> GSM447407 5 0.3707 0.73899 0.000 0.284 0.000 0.000 0.716
#> GSM447409 4 0.5934 0.64802 0.176 0.000 0.000 0.592 0.232
#> GSM447412 3 0.0324 0.87596 0.000 0.000 0.992 0.004 0.004
#> GSM447426 3 0.0404 0.87748 0.000 0.012 0.988 0.000 0.000
#> GSM447433 5 0.3663 0.74073 0.016 0.208 0.000 0.000 0.776
#> GSM447439 4 0.2020 0.83312 0.000 0.000 0.000 0.900 0.100
#> GSM447441 2 0.0880 0.72357 0.000 0.968 0.000 0.000 0.032
#> GSM447443 3 0.7514 -0.00792 0.340 0.000 0.424 0.064 0.172
#> GSM447445 1 0.4201 0.22776 0.592 0.408 0.000 0.000 0.000
#> GSM447446 5 0.4675 0.63379 0.020 0.380 0.000 0.000 0.600
#> GSM447453 1 0.3318 0.67014 0.800 0.192 0.000 0.000 0.008
#> GSM447455 2 0.3074 0.61614 0.000 0.804 0.000 0.000 0.196
#> GSM447456 4 0.5580 0.62952 0.024 0.076 0.000 0.664 0.236
#> GSM447459 4 0.4210 0.58061 0.000 0.000 0.000 0.588 0.412
#> GSM447466 1 0.2193 0.83640 0.912 0.000 0.000 0.060 0.028
#> GSM447470 2 0.8557 -0.03847 0.232 0.396 0.252 0.088 0.032
#> GSM447474 4 0.3369 0.78108 0.076 0.004 0.020 0.864 0.036
#> GSM447475 4 0.2282 0.81191 0.008 0.036 0.004 0.920 0.032
#> GSM447398 4 0.1121 0.83678 0.000 0.000 0.000 0.956 0.044
#> GSM447399 4 0.2813 0.82440 0.000 0.000 0.000 0.832 0.168
#> GSM447408 5 0.3586 0.74397 0.000 0.264 0.000 0.000 0.736
#> GSM447410 5 0.3471 0.67331 0.000 0.092 0.000 0.072 0.836
#> GSM447414 3 0.4630 0.68370 0.000 0.000 0.744 0.140 0.116
#> GSM447417 5 0.3932 0.70690 0.000 0.328 0.000 0.000 0.672
#> GSM447419 3 0.3807 0.79146 0.012 0.000 0.828 0.072 0.088
#> GSM447420 3 0.1331 0.87590 0.000 0.040 0.952 0.000 0.008
#> GSM447421 3 0.2628 0.82832 0.088 0.000 0.884 0.000 0.028
#> GSM447423 3 0.0162 0.87551 0.000 0.000 0.996 0.000 0.004
#> GSM447436 5 0.6744 0.36099 0.332 0.268 0.000 0.000 0.400
#> GSM447437 1 0.0290 0.82731 0.992 0.000 0.000 0.000 0.008
#> GSM447438 4 0.4723 0.45697 0.000 0.016 0.000 0.536 0.448
#> GSM447447 2 0.4400 0.59380 0.052 0.736 0.000 0.000 0.212
#> GSM447454 2 0.3635 0.48463 0.000 0.748 0.248 0.000 0.004
#> GSM447457 2 0.0671 0.71195 0.000 0.980 0.016 0.000 0.004
#> GSM447460 2 0.2707 0.68487 0.000 0.860 0.008 0.000 0.132
#> GSM447465 2 0.1168 0.72057 0.000 0.960 0.008 0.000 0.032
#> GSM447471 4 0.5547 0.55295 0.208 0.000 0.000 0.644 0.148
#> GSM447476 5 0.3416 0.66165 0.000 0.072 0.000 0.088 0.840
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> GSM447401 3 0.2741 0.82874 0.000 0.032 0.868 0.008 0.000 0.092
#> GSM447411 1 0.0951 0.65534 0.968 0.004 0.000 0.000 0.008 0.020
#> GSM447413 3 0.1528 0.85114 0.000 0.048 0.936 0.000 0.000 0.016
#> GSM447415 1 0.2350 0.62771 0.888 0.000 0.076 0.000 0.000 0.036
#> GSM447416 3 0.1003 0.84774 0.000 0.016 0.964 0.000 0.000 0.020
#> GSM447425 4 0.2052 0.78848 0.000 0.056 0.000 0.912 0.004 0.028
#> GSM447430 5 0.2128 0.72793 0.000 0.004 0.000 0.032 0.908 0.056
#> GSM447435 1 0.1890 0.64511 0.924 0.008 0.000 0.000 0.044 0.024
#> GSM447440 5 0.1546 0.72838 0.028 0.004 0.000 0.004 0.944 0.020
#> GSM447444 2 0.3322 0.80467 0.032 0.856 0.012 0.056 0.000 0.044
#> GSM447448 2 0.4209 0.33419 0.384 0.596 0.000 0.000 0.000 0.020
#> GSM447449 2 0.3752 0.79674 0.000 0.772 0.000 0.164 0.000 0.064
#> GSM447450 5 0.1312 0.73767 0.020 0.008 0.000 0.004 0.956 0.012
#> GSM447452 4 0.4141 0.67310 0.000 0.012 0.000 0.764 0.084 0.140
#> GSM447458 2 0.4570 0.65583 0.000 0.644 0.000 0.292 0.000 0.064
#> GSM447461 5 0.1340 0.73313 0.000 0.008 0.000 0.004 0.948 0.040
#> GSM447464 1 0.3654 0.54332 0.792 0.004 0.000 0.000 0.144 0.060
#> GSM447468 6 0.6128 0.45202 0.284 0.000 0.020 0.000 0.192 0.504
#> GSM447472 5 0.3717 0.56470 0.160 0.000 0.000 0.000 0.776 0.064
#> GSM447400 6 0.4955 0.47147 0.060 0.000 0.004 0.000 0.388 0.548
#> GSM447402 4 0.2730 0.71579 0.000 0.152 0.000 0.836 0.000 0.012
#> GSM447403 1 0.2823 0.59045 0.796 0.000 0.000 0.000 0.000 0.204
#> GSM447405 4 0.3007 0.77323 0.064 0.012 0.004 0.864 0.000 0.056
#> GSM447418 3 0.3789 0.78381 0.000 0.196 0.760 0.004 0.000 0.040
#> GSM447422 3 0.3900 0.75087 0.000 0.232 0.728 0.000 0.000 0.040
#> GSM447424 3 0.3753 0.76306 0.000 0.220 0.748 0.004 0.000 0.028
#> GSM447427 3 0.1498 0.85326 0.000 0.032 0.940 0.000 0.000 0.028
#> GSM447428 3 0.3455 0.81862 0.004 0.128 0.816 0.004 0.000 0.048
#> GSM447429 3 0.3435 0.76435 0.136 0.000 0.804 0.000 0.000 0.060
#> GSM447431 5 0.4524 0.61683 0.000 0.028 0.004 0.048 0.732 0.188
#> GSM447432 2 0.4414 0.75788 0.000 0.712 0.000 0.180 0.000 0.108
#> GSM447434 5 0.4041 -0.02172 0.000 0.004 0.000 0.004 0.584 0.408
#> GSM447442 2 0.4248 0.79181 0.000 0.780 0.000 0.080 0.048 0.092
#> GSM447451 2 0.1769 0.82320 0.004 0.924 0.000 0.060 0.000 0.012
#> GSM447462 6 0.5615 0.47843 0.072 0.004 0.024 0.000 0.372 0.528
#> GSM447463 1 0.2595 0.64387 0.872 0.084 0.000 0.000 0.000 0.044
#> GSM447467 2 0.2206 0.82246 0.008 0.904 0.000 0.064 0.000 0.024
#> GSM447469 4 0.2473 0.73158 0.000 0.136 0.000 0.856 0.000 0.008
#> GSM447473 1 0.5033 0.10457 0.480 0.000 0.052 0.000 0.008 0.460
#> GSM447404 1 0.4861 0.23344 0.552 0.000 0.044 0.000 0.008 0.396
#> GSM447406 5 0.2263 0.72640 0.000 0.004 0.000 0.060 0.900 0.036
#> GSM447407 4 0.1480 0.79070 0.000 0.040 0.000 0.940 0.000 0.020
#> GSM447409 6 0.7200 0.32756 0.252 0.004 0.000 0.072 0.312 0.360
#> GSM447412 3 0.1082 0.84260 0.000 0.000 0.956 0.000 0.004 0.040
#> GSM447426 3 0.1863 0.85268 0.000 0.036 0.920 0.000 0.000 0.044
#> GSM447433 4 0.1995 0.79218 0.000 0.036 0.000 0.912 0.000 0.052
#> GSM447439 5 0.2249 0.72395 0.000 0.004 0.000 0.032 0.900 0.064
#> GSM447441 2 0.3514 0.80807 0.000 0.804 0.000 0.088 0.000 0.108
#> GSM447443 6 0.5905 0.15239 0.112 0.000 0.404 0.000 0.024 0.460
#> GSM447445 1 0.4580 0.03022 0.528 0.440 0.000 0.004 0.000 0.028
#> GSM447446 4 0.3797 0.74231 0.072 0.080 0.000 0.812 0.000 0.036
#> GSM447453 1 0.4732 0.53522 0.704 0.200 0.000 0.024 0.000 0.072
#> GSM447455 2 0.4494 0.74132 0.000 0.692 0.000 0.216 0.000 0.092
#> GSM447456 5 0.7083 0.32336 0.024 0.100 0.000 0.164 0.524 0.188
#> GSM447459 4 0.6173 0.00211 0.000 0.004 0.000 0.412 0.300 0.284
#> GSM447466 1 0.3084 0.61258 0.832 0.004 0.000 0.000 0.032 0.132
#> GSM447470 1 0.8568 0.12221 0.328 0.200 0.232 0.000 0.124 0.116
#> GSM447474 5 0.4181 0.60736 0.104 0.012 0.028 0.000 0.792 0.064
#> GSM447475 5 0.1780 0.73426 0.004 0.024 0.000 0.004 0.932 0.036
#> GSM447398 5 0.2036 0.73270 0.000 0.016 0.000 0.008 0.912 0.064
#> GSM447399 5 0.4562 0.09564 0.000 0.004 0.000 0.032 0.576 0.388
#> GSM447408 4 0.2475 0.78185 0.000 0.036 0.000 0.892 0.012 0.060
#> GSM447410 4 0.3414 0.76251 0.000 0.028 0.000 0.828 0.032 0.112
#> GSM447414 3 0.5812 0.27791 0.000 0.000 0.544 0.032 0.104 0.320
#> GSM447417 4 0.1501 0.77703 0.000 0.076 0.000 0.924 0.000 0.000
#> GSM447419 3 0.3086 0.78038 0.020 0.000 0.856 0.000 0.048 0.076
#> GSM447420 3 0.2188 0.84944 0.020 0.036 0.912 0.000 0.000 0.032
#> GSM447421 3 0.3202 0.74988 0.144 0.000 0.816 0.000 0.000 0.040
#> GSM447423 3 0.0547 0.84445 0.000 0.000 0.980 0.000 0.000 0.020
#> GSM447436 4 0.5629 0.37863 0.348 0.052 0.004 0.552 0.000 0.044
#> GSM447437 1 0.1719 0.65522 0.924 0.016 0.000 0.000 0.000 0.060
#> GSM447438 4 0.4836 0.25133 0.000 0.004 0.000 0.564 0.380 0.052
#> GSM447447 2 0.4819 0.75059 0.104 0.704 0.000 0.172 0.000 0.020
#> GSM447454 2 0.2826 0.73578 0.000 0.856 0.092 0.000 0.000 0.052
#> GSM447457 2 0.1605 0.79480 0.000 0.940 0.032 0.012 0.000 0.016
#> GSM447460 2 0.3160 0.80636 0.000 0.840 0.008 0.104 0.000 0.048
#> GSM447465 2 0.2978 0.81283 0.000 0.856 0.008 0.084 0.000 0.052
#> GSM447471 6 0.6108 0.55695 0.196 0.000 0.012 0.000 0.328 0.464
#> GSM447476 4 0.2240 0.78001 0.000 0.008 0.000 0.904 0.032 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 gender(p) agent(p) k
#> ATC:NMF 75 0.728 0.1337 2
#> ATC:NMF 74 0.418 0.7008 3
#> ATC:NMF 72 0.898 0.1976 4
#> ATC:NMF 70 0.845 0.2113 5
#> ATC:NMF 62 0.734 0.0893 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