Date: 2019-12-25 22:34:17 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 17118 rows and 78 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)
Dimension of the input matrix:
mat = get_matrix(res_list)
dim(mat)
#> [1] 17118 78
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, 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 | ||
---|---|---|---|---|---|---|
CV:hclust | 2 | 1.000 | 1.000 | 1.000 | ** | |
ATC:skmeans | 4 | 1.000 | 0.978 | 0.990 | ** | 2,3 |
ATC:NMF | 2 | 1.000 | 0.978 | 0.991 | ** | |
SD:NMF | 2 | 0.996 | 0.959 | 0.982 | ** | |
CV:mclust | 2 | 0.973 | 0.950 | 0.979 | ** | |
CV:NMF | 4 | 0.958 | 0.933 | 0.969 | ** | 2 |
SD:skmeans | 2 | 0.946 | 0.903 | 0.966 | * | |
ATC:mclust | 4 | 0.937 | 0.951 | 0.981 | * | 2,3 |
MAD:pam | 3 | 0.850 | 0.815 | 0.910 | ||
MAD:NMF | 2 | 0.843 | 0.931 | 0.968 | ||
MAD:skmeans | 2 | 0.842 | 0.870 | 0.950 | ||
SD:pam | 3 | 0.828 | 0.869 | 0.939 | ||
CV:skmeans | 2 | 0.778 | 0.901 | 0.958 | ||
CV:kmeans | 5 | 0.753 | 0.805 | 0.881 | ||
ATC:kmeans | 4 | 0.739 | 0.915 | 0.923 | ||
CV:pam | 5 | 0.693 | 0.760 | 0.882 | ||
ATC:hclust | 2 | 0.672 | 0.847 | 0.933 | ||
MAD:hclust | 6 | 0.565 | 0.553 | 0.706 | ||
ATC:pam | 2 | 0.490 | 0.818 | 0.874 | ||
SD:mclust | 2 | 0.455 | 0.774 | 0.889 | ||
MAD:mclust | 2 | 0.429 | 0.727 | 0.821 | ||
MAD:kmeans | 2 | 0.395 | 0.748 | 0.865 | ||
SD:kmeans | 2 | 0.343 | 0.788 | 0.877 | ||
SD:hclust | 3 | 0.170 | 0.654 | 0.764 |
**: 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.9963 0.959 0.982 0.5039 0.497 0.497
#> CV:NMF 2 0.9200 0.950 0.978 0.5032 0.499 0.499
#> MAD:NMF 2 0.8430 0.931 0.968 0.5036 0.494 0.494
#> ATC:NMF 2 1.0000 0.978 0.991 0.4105 0.590 0.590
#> SD:skmeans 2 0.9459 0.903 0.966 0.5062 0.494 0.494
#> CV:skmeans 2 0.7779 0.901 0.958 0.5043 0.494 0.494
#> MAD:skmeans 2 0.8423 0.870 0.950 0.5051 0.495 0.495
#> ATC:skmeans 2 0.9993 0.939 0.975 0.5003 0.499 0.499
#> SD:mclust 2 0.4550 0.774 0.889 0.4389 0.534 0.534
#> CV:mclust 2 0.9730 0.950 0.979 0.0897 0.949 0.949
#> MAD:mclust 2 0.4287 0.727 0.821 0.4333 0.601 0.601
#> ATC:mclust 2 1.0000 0.988 0.994 0.4553 0.541 0.541
#> SD:kmeans 2 0.3434 0.788 0.877 0.4750 0.499 0.499
#> CV:kmeans 2 0.4221 0.693 0.804 0.3517 0.568 0.568
#> MAD:kmeans 2 0.3954 0.748 0.865 0.4892 0.510 0.510
#> ATC:kmeans 2 0.5298 0.755 0.881 0.4159 0.568 0.568
#> SD:pam 2 0.4111 0.576 0.809 0.4182 0.670 0.670
#> CV:pam 2 0.5578 0.898 0.935 0.1373 0.949 0.949
#> MAD:pam 2 0.3428 0.686 0.813 0.4273 0.568 0.568
#> ATC:pam 2 0.4905 0.818 0.874 0.4576 0.550 0.550
#> SD:hclust 2 0.3580 0.840 0.890 0.2018 0.949 0.949
#> CV:hclust 2 1.0000 1.000 1.000 0.0516 0.949 0.949
#> MAD:hclust 2 0.0918 0.194 0.592 0.3805 0.497 0.497
#> ATC:hclust 2 0.6719 0.847 0.933 0.4431 0.568 0.568
get_stats(res_list, k = 3)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> SD:NMF 3 0.648 0.807 0.909 0.302 0.765 0.564
#> CV:NMF 3 0.665 0.731 0.842 0.293 0.803 0.625
#> MAD:NMF 3 0.719 0.813 0.918 0.313 0.740 0.522
#> ATC:NMF 3 0.648 0.796 0.898 0.470 0.736 0.582
#> SD:skmeans 3 0.863 0.894 0.936 0.299 0.782 0.587
#> CV:skmeans 3 0.735 0.839 0.917 0.303 0.782 0.587
#> MAD:skmeans 3 0.687 0.846 0.921 0.309 0.763 0.558
#> ATC:skmeans 3 1.000 0.950 0.972 0.295 0.793 0.610
#> SD:mclust 3 0.563 0.471 0.752 0.418 0.649 0.457
#> CV:mclust 3 0.250 0.564 0.739 4.392 0.524 0.499
#> MAD:mclust 3 0.475 0.689 0.839 0.378 0.489 0.323
#> ATC:mclust 3 0.983 0.924 0.959 -0.051 0.488 0.369
#> SD:kmeans 3 0.566 0.781 0.863 0.329 0.793 0.610
#> CV:kmeans 3 0.572 0.709 0.844 0.595 0.689 0.515
#> MAD:kmeans 3 0.558 0.756 0.854 0.296 0.774 0.588
#> ATC:kmeans 3 0.628 0.820 0.887 0.393 0.832 0.717
#> SD:pam 3 0.828 0.869 0.939 0.433 0.687 0.545
#> CV:pam 3 0.372 0.694 0.867 2.170 0.627 0.607
#> MAD:pam 3 0.850 0.815 0.910 0.380 0.819 0.689
#> ATC:pam 3 0.539 0.621 0.791 0.320 0.478 0.306
#> SD:hclust 3 0.170 0.654 0.764 1.187 0.695 0.679
#> CV:hclust 3 0.497 0.753 0.884 5.869 0.762 0.749
#> MAD:hclust 3 0.118 0.332 0.622 0.353 0.553 0.384
#> ATC:hclust 3 0.788 0.841 0.933 0.125 0.953 0.918
get_stats(res_list, k = 4)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> SD:NMF 4 0.693 0.586 0.790 0.0979 0.867 0.643
#> CV:NMF 4 0.958 0.933 0.969 0.1317 0.835 0.580
#> MAD:NMF 4 0.632 0.759 0.857 0.0804 0.924 0.782
#> ATC:NMF 4 0.891 0.847 0.945 0.1802 0.744 0.460
#> SD:skmeans 4 0.719 0.770 0.852 0.1323 0.852 0.605
#> CV:skmeans 4 0.872 0.838 0.932 0.1177 0.848 0.598
#> MAD:skmeans 4 0.590 0.446 0.701 0.1310 0.892 0.712
#> ATC:skmeans 4 1.000 0.978 0.990 0.1652 0.819 0.536
#> SD:mclust 4 0.631 0.627 0.826 0.1074 0.859 0.678
#> CV:mclust 4 0.670 0.835 0.889 0.2978 0.744 0.536
#> MAD:mclust 4 0.635 0.722 0.827 0.1472 0.861 0.673
#> ATC:mclust 4 0.937 0.951 0.981 0.5854 0.721 0.519
#> SD:kmeans 4 0.638 0.721 0.791 0.1405 0.856 0.625
#> CV:kmeans 4 0.610 0.807 0.847 0.1920 0.822 0.598
#> MAD:kmeans 4 0.599 0.525 0.733 0.1465 0.892 0.722
#> ATC:kmeans 4 0.739 0.915 0.923 0.2124 0.755 0.501
#> SD:pam 4 0.701 0.641 0.816 0.1939 0.780 0.505
#> CV:pam 4 0.630 0.745 0.877 0.3670 0.793 0.661
#> MAD:pam 4 0.698 0.779 0.856 0.2274 0.776 0.505
#> ATC:pam 4 0.645 0.778 0.879 0.1704 0.726 0.446
#> SD:hclust 4 0.272 0.649 0.736 0.3342 0.772 0.648
#> CV:hclust 4 0.392 0.527 0.773 0.4609 0.748 0.653
#> MAD:hclust 4 0.295 0.534 0.714 0.2719 0.697 0.467
#> ATC:hclust 4 0.554 0.721 0.848 0.1677 0.909 0.832
get_stats(res_list, k = 5)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> SD:NMF 5 0.721 0.723 0.844 0.0518 0.915 0.717
#> CV:NMF 5 0.819 0.846 0.900 0.0484 0.953 0.831
#> MAD:NMF 5 0.571 0.637 0.779 0.0646 0.887 0.654
#> ATC:NMF 5 0.834 0.820 0.912 0.0532 0.870 0.608
#> SD:skmeans 5 0.790 0.815 0.876 0.0803 0.909 0.662
#> CV:skmeans 5 0.783 0.755 0.874 0.0951 0.875 0.565
#> MAD:skmeans 5 0.692 0.673 0.791 0.0731 0.809 0.443
#> ATC:skmeans 5 0.792 0.633 0.803 0.0607 0.912 0.673
#> SD:mclust 5 0.590 0.554 0.761 0.1195 0.855 0.579
#> CV:mclust 5 0.664 0.691 0.863 0.1498 0.829 0.572
#> MAD:mclust 5 0.622 0.588 0.781 0.1120 0.858 0.579
#> ATC:mclust 5 0.839 0.757 0.893 0.0605 0.947 0.834
#> SD:kmeans 5 0.665 0.641 0.773 0.0741 0.971 0.893
#> CV:kmeans 5 0.753 0.805 0.881 0.0981 0.960 0.871
#> MAD:kmeans 5 0.632 0.550 0.726 0.0714 0.880 0.636
#> ATC:kmeans 5 0.733 0.684 0.828 0.0895 0.970 0.898
#> SD:pam 5 0.743 0.613 0.812 0.0735 0.927 0.748
#> CV:pam 5 0.693 0.760 0.882 0.1473 0.825 0.617
#> MAD:pam 5 0.660 0.603 0.784 0.0805 0.862 0.557
#> ATC:pam 5 0.708 0.692 0.792 0.0735 0.817 0.475
#> SD:hclust 5 0.380 0.407 0.665 0.1437 0.820 0.591
#> CV:hclust 5 0.583 0.630 0.804 0.2266 0.890 0.783
#> MAD:hclust 5 0.365 0.420 0.667 0.0669 0.893 0.696
#> ATC:hclust 5 0.559 0.646 0.766 0.1504 0.810 0.610
get_stats(res_list, k = 6)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> SD:NMF 6 0.737 0.628 0.798 0.0430 0.938 0.770
#> CV:NMF 6 0.785 0.736 0.779 0.0540 0.919 0.667
#> MAD:NMF 6 0.712 0.654 0.810 0.0424 0.933 0.745
#> ATC:NMF 6 0.632 0.381 0.684 0.0438 0.858 0.524
#> SD:skmeans 6 0.771 0.622 0.794 0.0381 0.966 0.830
#> CV:skmeans 6 0.755 0.669 0.801 0.0368 0.959 0.793
#> MAD:skmeans 6 0.747 0.581 0.774 0.0407 0.928 0.664
#> ATC:skmeans 6 0.799 0.621 0.800 0.0388 0.909 0.610
#> SD:mclust 6 0.636 0.574 0.733 0.0381 0.908 0.619
#> CV:mclust 6 0.793 0.690 0.827 0.0528 0.925 0.735
#> MAD:mclust 6 0.632 0.510 0.659 0.0663 0.895 0.575
#> ATC:mclust 6 0.828 0.870 0.917 0.0696 0.912 0.700
#> SD:kmeans 6 0.734 0.651 0.770 0.0473 0.893 0.592
#> CV:kmeans 6 0.737 0.632 0.811 0.0665 0.953 0.833
#> MAD:kmeans 6 0.709 0.625 0.762 0.0450 0.891 0.579
#> ATC:kmeans 6 0.712 0.656 0.775 0.0524 0.908 0.677
#> SD:pam 6 0.823 0.825 0.910 0.0416 0.888 0.581
#> CV:pam 6 0.602 0.656 0.798 0.0849 0.971 0.907
#> MAD:pam 6 0.662 0.576 0.753 0.0457 0.877 0.522
#> ATC:pam 6 0.748 0.761 0.869 0.0387 0.947 0.782
#> SD:hclust 6 0.566 0.616 0.757 0.1116 0.824 0.478
#> CV:hclust 6 0.565 0.581 0.786 0.1042 0.832 0.605
#> MAD:hclust 6 0.565 0.553 0.706 0.0644 0.891 0.675
#> ATC:hclust 6 0.620 0.740 0.836 0.0833 0.936 0.809
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)
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 17118 rows and 78 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'SD' method.
#> Subgroups are detected by 'hclust' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 3.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 0.358 0.840 0.890 0.202 0.949 0.949
#> 3 3 0.170 0.654 0.764 1.187 0.695 0.679
#> 4 4 0.272 0.649 0.736 0.334 0.772 0.648
#> 5 5 0.380 0.407 0.665 0.144 0.820 0.591
#> 6 6 0.566 0.616 0.757 0.112 0.824 0.478
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
#> ERR863675 1 0.3431 0.883 0.936 0.064
#> ERR863705 1 0.7299 0.776 0.796 0.204
#> ERR863704 1 0.6148 0.854 0.848 0.152
#> ERR863679 1 0.7299 0.776 0.796 0.204
#> ERR863680 1 0.4815 0.867 0.896 0.104
#> ERR863676 1 0.4815 0.867 0.896 0.104
#> ERR863677 1 0.2948 0.882 0.948 0.052
#> ERR863688 1 0.5629 0.839 0.868 0.132
#> ERR863690 1 0.2603 0.887 0.956 0.044
#> ERR863692 1 0.2603 0.884 0.956 0.044
#> ERR863703 1 0.1184 0.889 0.984 0.016
#> ERR863712 1 0.2948 0.882 0.948 0.052
#> ERR863711 1 0.0938 0.888 0.988 0.012
#> ERR863760 1 0.8207 0.729 0.744 0.256
#> ERR863727 1 0.2043 0.885 0.968 0.032
#> ERR863766 1 0.7139 0.777 0.804 0.196
#> ERR863767 1 0.0672 0.888 0.992 0.008
#> ERR863752 1 0.5178 0.869 0.884 0.116
#> ERR863757 1 0.7453 0.768 0.788 0.212
#> ERR863758 1 0.2423 0.886 0.960 0.040
#> ERR863755 1 0.5737 0.840 0.864 0.136
#> ERR863756 1 0.4431 0.871 0.908 0.092
#> ERR863707 1 0.7299 0.776 0.796 0.204
#> ERR863681 2 0.4562 1.000 0.096 0.904
#> ERR863719 1 0.5059 0.867 0.888 0.112
#> ERR863759 1 0.4690 0.877 0.900 0.100
#> ERR863718 1 0.2423 0.886 0.960 0.040
#> ERR863717 1 0.2236 0.889 0.964 0.036
#> ERR863715 1 0.9866 0.353 0.568 0.432
#> ERR863716 1 0.4690 0.863 0.900 0.100
#> ERR863722 1 0.4298 0.881 0.912 0.088
#> ERR863721 1 0.2948 0.882 0.948 0.052
#> ERR863720 1 0.4815 0.867 0.896 0.104
#> ERR863723 1 0.2043 0.888 0.968 0.032
#> ERR863761 1 0.9129 0.624 0.672 0.328
#> ERR863735 1 0.2423 0.886 0.960 0.040
#> ERR863734 1 0.7139 0.777 0.804 0.196
#> ERR863736 1 0.8267 0.723 0.740 0.260
#> ERR863729 1 0.9850 0.348 0.572 0.428
#> ERR863728 1 0.2603 0.891 0.956 0.044
#> ERR863731 1 0.2423 0.886 0.960 0.040
#> ERR863764 1 0.3114 0.891 0.944 0.056
#> ERR863740 1 0.2948 0.885 0.948 0.052
#> ERR863765 1 0.3274 0.882 0.940 0.060
#> ERR863762 1 0.6887 0.794 0.816 0.184
#> ERR863724 2 0.4562 1.000 0.096 0.904
#> ERR863733 1 0.3584 0.889 0.932 0.068
#> ERR863732 1 0.4939 0.871 0.892 0.108
#> ERR863730 1 0.2043 0.885 0.968 0.032
#> ERR863742 1 0.2948 0.885 0.948 0.052
#> ERR863763 1 0.2948 0.882 0.948 0.052
#> ERR863741 1 0.9850 0.348 0.572 0.428
#> ERR863743 1 0.2423 0.886 0.960 0.040
#> ERR863745 1 0.4690 0.877 0.900 0.100
#> ERR863744 1 0.3584 0.887 0.932 0.068
#> ERR863746 1 0.2043 0.885 0.968 0.032
#> ERR863748 1 0.2778 0.890 0.952 0.048
#> ERR863747 1 0.4690 0.877 0.900 0.100
#> ERR863694 1 0.5059 0.867 0.888 0.112
#> ERR863693 1 0.2948 0.882 0.948 0.052
#> ERR863686 1 0.7139 0.778 0.804 0.196
#> ERR863678 1 0.4431 0.879 0.908 0.092
#> ERR863685 1 0.7139 0.777 0.804 0.196
#> ERR863689 1 0.2603 0.884 0.956 0.044
#> ERR863691 1 0.2603 0.884 0.956 0.044
#> ERR863682 1 0.5842 0.837 0.860 0.140
#> ERR863695 1 0.4815 0.867 0.896 0.104
#> ERR863683 1 0.1414 0.887 0.980 0.020
#> ERR863684 1 0.2603 0.890 0.956 0.044
#> ERR863702 1 0.7139 0.778 0.804 0.196
#> ERR863687 1 0.5059 0.875 0.888 0.112
#> ERR863706 1 0.7056 0.782 0.808 0.192
#> ERR863708 1 0.4815 0.867 0.896 0.104
#> ERR863710 1 0.2423 0.886 0.960 0.040
#> ERR863709 1 0.4562 0.871 0.904 0.096
#> ERR863753 1 0.5178 0.869 0.884 0.116
#> ERR863754 1 0.2948 0.887 0.948 0.052
#> ERR863749 1 0.0938 0.888 0.988 0.012
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> ERR863675 1 0.3695 0.72224 0.880 0.108 0.012
#> ERR863705 1 0.8689 0.49281 0.596 0.200 0.204
#> ERR863704 2 0.5775 0.67969 0.260 0.728 0.012
#> ERR863679 1 0.8689 0.49281 0.596 0.200 0.204
#> ERR863680 2 0.5431 0.72594 0.284 0.716 0.000
#> ERR863676 2 0.5431 0.72594 0.284 0.716 0.000
#> ERR863677 1 0.3116 0.72234 0.892 0.108 0.000
#> ERR863688 1 0.5167 0.69773 0.792 0.192 0.016
#> ERR863690 1 0.2261 0.76641 0.932 0.068 0.000
#> ERR863692 1 0.3272 0.72731 0.892 0.104 0.004
#> ERR863703 1 0.1170 0.77166 0.976 0.016 0.008
#> ERR863712 1 0.3116 0.72234 0.892 0.108 0.000
#> ERR863711 1 0.1170 0.77169 0.976 0.016 0.008
#> ERR863760 2 0.6585 0.38268 0.244 0.712 0.044
#> ERR863727 1 0.3293 0.75606 0.900 0.088 0.012
#> ERR863766 1 0.8241 0.55507 0.636 0.160 0.204
#> ERR863767 1 0.0747 0.76795 0.984 0.016 0.000
#> ERR863752 2 0.6422 0.69813 0.324 0.660 0.016
#> ERR863757 1 0.6379 0.62481 0.712 0.256 0.032
#> ERR863758 1 0.1860 0.76461 0.948 0.052 0.000
#> ERR863755 1 0.5020 0.69950 0.796 0.192 0.012
#> ERR863756 1 0.6646 0.67170 0.740 0.184 0.076
#> ERR863707 1 0.8689 0.49281 0.596 0.200 0.204
#> ERR863681 3 0.1163 1.00000 0.028 0.000 0.972
#> ERR863719 1 0.4465 0.70220 0.820 0.176 0.004
#> ERR863759 1 0.7400 0.24543 0.552 0.412 0.036
#> ERR863718 1 0.1860 0.76461 0.948 0.052 0.000
#> ERR863717 1 0.2537 0.77172 0.920 0.080 0.000
#> ERR863715 2 0.6897 0.26460 0.068 0.712 0.220
#> ERR863716 1 0.4514 0.72710 0.832 0.156 0.012
#> ERR863722 1 0.5970 0.67936 0.780 0.160 0.060
#> ERR863721 1 0.2959 0.72835 0.900 0.100 0.000
#> ERR863720 2 0.5431 0.72594 0.284 0.716 0.000
#> ERR863723 1 0.2527 0.77053 0.936 0.044 0.020
#> ERR863761 1 0.9278 0.35749 0.516 0.288 0.196
#> ERR863735 1 0.1860 0.76461 0.948 0.052 0.000
#> ERR863734 1 0.8241 0.55507 0.636 0.160 0.204
#> ERR863736 2 0.6597 0.36641 0.268 0.696 0.036
#> ERR863729 2 0.5220 0.20647 0.012 0.780 0.208
#> ERR863728 1 0.3695 0.73456 0.880 0.108 0.012
#> ERR863731 1 0.1860 0.76461 0.948 0.052 0.000
#> ERR863764 1 0.4602 0.71448 0.832 0.152 0.016
#> ERR863740 1 0.3875 0.75931 0.888 0.068 0.044
#> ERR863765 1 0.5573 0.71482 0.796 0.160 0.044
#> ERR863762 1 0.8398 0.53908 0.624 0.192 0.184
#> ERR863724 3 0.1163 1.00000 0.028 0.000 0.972
#> ERR863733 1 0.4033 0.72626 0.856 0.136 0.008
#> ERR863732 1 0.7047 0.65558 0.712 0.204 0.084
#> ERR863730 1 0.3293 0.75606 0.900 0.088 0.012
#> ERR863742 1 0.3875 0.75931 0.888 0.068 0.044
#> ERR863763 1 0.2959 0.72835 0.900 0.100 0.000
#> ERR863741 2 0.5220 0.20647 0.012 0.780 0.208
#> ERR863743 1 0.1860 0.76461 0.948 0.052 0.000
#> ERR863745 2 0.7074 0.30444 0.480 0.500 0.020
#> ERR863744 1 0.4165 0.76601 0.876 0.076 0.048
#> ERR863746 1 0.3293 0.75606 0.900 0.088 0.012
#> ERR863748 1 0.4531 0.71036 0.824 0.168 0.008
#> ERR863747 1 0.7400 0.24463 0.552 0.412 0.036
#> ERR863694 1 0.4465 0.70220 0.820 0.176 0.004
#> ERR863693 1 0.2959 0.72835 0.900 0.100 0.000
#> ERR863686 1 0.5737 0.63321 0.732 0.256 0.012
#> ERR863678 1 0.5884 0.68983 0.788 0.148 0.064
#> ERR863685 1 0.8241 0.55507 0.636 0.160 0.204
#> ERR863689 1 0.3272 0.72762 0.892 0.104 0.004
#> ERR863691 1 0.3272 0.72731 0.892 0.104 0.004
#> ERR863682 1 0.5122 0.69723 0.788 0.200 0.012
#> ERR863695 2 0.5431 0.72594 0.284 0.716 0.000
#> ERR863683 1 0.2550 0.76625 0.932 0.056 0.012
#> ERR863684 1 0.3112 0.76264 0.900 0.096 0.004
#> ERR863702 1 0.5881 0.63244 0.728 0.256 0.016
#> ERR863687 1 0.7581 0.00812 0.496 0.464 0.040
#> ERR863706 1 0.8199 0.56062 0.640 0.160 0.200
#> ERR863708 2 0.5431 0.72594 0.284 0.716 0.000
#> ERR863710 1 0.1860 0.76461 0.948 0.052 0.000
#> ERR863709 2 0.5621 0.71536 0.308 0.692 0.000
#> ERR863753 2 0.6422 0.69813 0.324 0.660 0.016
#> ERR863754 1 0.2448 0.76592 0.924 0.076 0.000
#> ERR863749 1 0.0983 0.77040 0.980 0.016 0.004
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> ERR863675 1 0.4203 0.7305 0.828 0.012 0.128 0.032
#> ERR863705 3 0.2926 0.7488 0.096 0.012 0.888 0.004
#> ERR863704 2 0.6922 0.6510 0.168 0.584 0.248 0.000
#> ERR863679 3 0.2926 0.7488 0.096 0.012 0.888 0.004
#> ERR863680 2 0.7205 0.6964 0.168 0.528 0.304 0.000
#> ERR863676 2 0.7205 0.6964 0.168 0.528 0.304 0.000
#> ERR863677 1 0.4129 0.7319 0.836 0.012 0.116 0.036
#> ERR863688 1 0.5042 0.6889 0.768 0.096 0.136 0.000
#> ERR863690 1 0.1724 0.7876 0.948 0.032 0.020 0.000
#> ERR863692 1 0.3736 0.7491 0.856 0.016 0.108 0.020
#> ERR863703 1 0.1118 0.7887 0.964 0.000 0.036 0.000
#> ERR863712 1 0.4071 0.7329 0.840 0.012 0.112 0.036
#> ERR863711 1 0.1389 0.7860 0.952 0.000 0.048 0.000
#> ERR863760 2 0.5998 0.3068 0.212 0.680 0.108 0.000
#> ERR863727 1 0.2973 0.7398 0.856 0.000 0.144 0.000
#> ERR863766 3 0.3272 0.7575 0.128 0.004 0.860 0.008
#> ERR863767 1 0.1302 0.7891 0.956 0.000 0.044 0.000
#> ERR863752 2 0.7332 0.6194 0.160 0.468 0.372 0.000
#> ERR863757 1 0.6349 0.6073 0.680 0.164 0.148 0.008
#> ERR863758 1 0.1209 0.7881 0.964 0.032 0.004 0.000
#> ERR863755 1 0.5173 0.6934 0.768 0.096 0.132 0.004
#> ERR863756 3 0.4789 0.6535 0.224 0.004 0.748 0.024
#> ERR863707 3 0.2926 0.7488 0.096 0.012 0.888 0.004
#> ERR863681 4 0.1118 1.0000 0.000 0.000 0.036 0.964
#> ERR863719 1 0.5908 0.7130 0.744 0.084 0.136 0.036
#> ERR863759 3 0.5964 0.5585 0.096 0.228 0.676 0.000
#> ERR863718 1 0.1209 0.7881 0.964 0.032 0.004 0.000
#> ERR863717 1 0.2803 0.7891 0.900 0.012 0.080 0.008
#> ERR863715 2 0.2266 0.3699 0.004 0.912 0.084 0.000
#> ERR863716 1 0.4356 0.7210 0.812 0.064 0.124 0.000
#> ERR863722 1 0.6038 0.2828 0.532 0.028 0.432 0.008
#> ERR863721 1 0.3681 0.7380 0.856 0.004 0.104 0.036
#> ERR863720 2 0.7205 0.6964 0.168 0.528 0.304 0.000
#> ERR863723 1 0.2466 0.7705 0.900 0.000 0.096 0.004
#> ERR863761 3 0.7208 0.4589 0.216 0.208 0.572 0.004
#> ERR863735 1 0.1356 0.7887 0.960 0.032 0.008 0.000
#> ERR863734 3 0.3272 0.7575 0.128 0.004 0.860 0.008
#> ERR863736 2 0.6364 0.2632 0.204 0.652 0.144 0.000
#> ERR863729 2 0.0844 0.3697 0.004 0.980 0.012 0.004
#> ERR863728 1 0.4499 0.6768 0.756 0.012 0.228 0.004
#> ERR863731 1 0.1209 0.7881 0.964 0.032 0.004 0.000
#> ERR863764 1 0.6592 0.4031 0.556 0.028 0.380 0.036
#> ERR863740 1 0.3907 0.7141 0.808 0.004 0.180 0.008
#> ERR863765 1 0.5459 0.0411 0.512 0.004 0.476 0.008
#> ERR863762 3 0.3016 0.7552 0.120 0.004 0.872 0.004
#> ERR863724 4 0.1118 1.0000 0.000 0.000 0.036 0.964
#> ERR863733 1 0.6349 0.5264 0.604 0.024 0.336 0.036
#> ERR863732 3 0.5721 0.3367 0.376 0.020 0.596 0.008
#> ERR863730 1 0.2973 0.7398 0.856 0.000 0.144 0.000
#> ERR863742 1 0.3907 0.7141 0.808 0.004 0.180 0.008
#> ERR863763 1 0.3741 0.7378 0.852 0.004 0.108 0.036
#> ERR863741 2 0.0844 0.3697 0.004 0.980 0.012 0.004
#> ERR863743 1 0.1209 0.7881 0.964 0.032 0.004 0.000
#> ERR863745 3 0.7564 -0.3238 0.208 0.328 0.464 0.000
#> ERR863744 1 0.4502 0.6675 0.748 0.016 0.236 0.000
#> ERR863746 1 0.2973 0.7398 0.856 0.000 0.144 0.000
#> ERR863748 1 0.6632 0.3542 0.540 0.028 0.396 0.036
#> ERR863747 3 0.5964 0.5580 0.096 0.228 0.676 0.000
#> ERR863694 1 0.5908 0.7130 0.744 0.084 0.136 0.036
#> ERR863693 1 0.3681 0.7380 0.856 0.004 0.104 0.036
#> ERR863686 1 0.5855 0.6320 0.704 0.160 0.136 0.000
#> ERR863678 1 0.5945 0.3083 0.540 0.024 0.428 0.008
#> ERR863685 3 0.3272 0.7575 0.128 0.004 0.860 0.008
#> ERR863689 1 0.3445 0.7513 0.864 0.012 0.112 0.012
#> ERR863691 1 0.3736 0.7491 0.856 0.016 0.108 0.020
#> ERR863682 1 0.5006 0.6872 0.772 0.104 0.124 0.000
#> ERR863695 2 0.7205 0.6964 0.168 0.528 0.304 0.000
#> ERR863683 1 0.2888 0.7555 0.872 0.004 0.124 0.000
#> ERR863684 1 0.4121 0.7732 0.844 0.020 0.100 0.036
#> ERR863702 1 0.6079 0.6297 0.696 0.160 0.140 0.004
#> ERR863687 3 0.6664 0.4252 0.128 0.272 0.600 0.000
#> ERR863706 3 0.3326 0.7562 0.132 0.004 0.856 0.008
#> ERR863708 2 0.7205 0.6964 0.168 0.528 0.304 0.000
#> ERR863710 1 0.1209 0.7881 0.964 0.032 0.004 0.000
#> ERR863709 2 0.7514 0.6764 0.184 0.504 0.308 0.004
#> ERR863753 2 0.7332 0.6194 0.160 0.468 0.372 0.000
#> ERR863754 1 0.2841 0.7869 0.912 0.032 0.032 0.024
#> ERR863749 1 0.1022 0.7879 0.968 0.000 0.032 0.000
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> ERR863675 1 0.0865 0.4995 0.972 0.000 0.024 0.000 0.004
#> ERR863705 3 0.0000 0.7224 0.000 0.000 1.000 0.000 0.000
#> ERR863704 2 0.7544 0.6455 0.200 0.516 0.120 0.000 0.164
#> ERR863679 3 0.0000 0.7224 0.000 0.000 1.000 0.000 0.000
#> ERR863680 2 0.5920 0.7496 0.252 0.588 0.160 0.000 0.000
#> ERR863676 2 0.5920 0.7496 0.252 0.588 0.160 0.000 0.000
#> ERR863677 1 0.0566 0.4987 0.984 0.000 0.012 0.000 0.004
#> ERR863688 5 0.4525 0.5572 0.360 0.000 0.016 0.000 0.624
#> ERR863690 1 0.4249 0.0358 0.568 0.000 0.000 0.000 0.432
#> ERR863692 1 0.1877 0.4978 0.924 0.000 0.012 0.000 0.064
#> ERR863703 1 0.4527 0.0326 0.596 0.000 0.012 0.000 0.392
#> ERR863712 1 0.0451 0.4993 0.988 0.000 0.008 0.000 0.004
#> ERR863711 1 0.4582 -0.0651 0.572 0.000 0.012 0.000 0.416
#> ERR863760 5 0.5135 -0.1959 0.052 0.308 0.004 0.000 0.636
#> ERR863727 5 0.4968 0.4849 0.456 0.000 0.028 0.000 0.516
#> ERR863766 3 0.1455 0.7300 0.008 0.000 0.952 0.008 0.032
#> ERR863767 1 0.4846 0.1006 0.612 0.004 0.024 0.000 0.360
#> ERR863752 2 0.6387 0.6689 0.236 0.516 0.248 0.000 0.000
#> ERR863757 5 0.4466 0.5484 0.256 0.000 0.024 0.008 0.712
#> ERR863758 1 0.4210 0.1039 0.588 0.000 0.000 0.000 0.412
#> ERR863755 5 0.4564 0.5475 0.372 0.000 0.016 0.000 0.612
#> ERR863756 3 0.3229 0.6556 0.128 0.000 0.840 0.000 0.032
#> ERR863707 3 0.0000 0.7224 0.000 0.000 1.000 0.000 0.000
#> ERR863681 4 0.0000 1.0000 0.000 0.000 0.000 1.000 0.000
#> ERR863719 1 0.3635 0.4405 0.828 0.004 0.056 0.000 0.112
#> ERR863759 3 0.3305 0.5383 0.000 0.224 0.776 0.000 0.000
#> ERR863718 1 0.4210 0.1039 0.588 0.000 0.000 0.000 0.412
#> ERR863717 1 0.4101 0.1170 0.664 0.000 0.004 0.000 0.332
#> ERR863715 2 0.4557 0.2544 0.008 0.764 0.088 0.000 0.140
#> ERR863716 5 0.4494 0.5518 0.380 0.000 0.012 0.000 0.608
#> ERR863722 1 0.5904 0.2073 0.532 0.020 0.388 0.000 0.060
#> ERR863721 1 0.0290 0.4997 0.992 0.000 0.000 0.000 0.008
#> ERR863720 2 0.5920 0.7496 0.252 0.588 0.160 0.000 0.000
#> ERR863723 1 0.5187 -0.3638 0.504 0.000 0.032 0.004 0.460
#> ERR863761 3 0.5393 0.2863 0.020 0.024 0.592 0.004 0.360
#> ERR863735 1 0.4359 0.1076 0.584 0.000 0.004 0.000 0.412
#> ERR863734 3 0.1455 0.7300 0.008 0.000 0.952 0.008 0.032
#> ERR863736 5 0.5962 -0.2253 0.040 0.292 0.060 0.000 0.608
#> ERR863729 2 0.3563 0.2022 0.000 0.780 0.012 0.000 0.208
#> ERR863728 1 0.6101 0.3372 0.600 0.008 0.176 0.000 0.216
#> ERR863731 1 0.4210 0.1039 0.588 0.000 0.000 0.000 0.412
#> ERR863764 1 0.4642 0.2684 0.648 0.020 0.328 0.000 0.004
#> ERR863740 5 0.6021 0.4392 0.428 0.000 0.088 0.008 0.476
#> ERR863765 3 0.6654 -0.0496 0.196 0.000 0.488 0.008 0.308
#> ERR863762 3 0.0794 0.7268 0.000 0.000 0.972 0.000 0.028
#> ERR863724 4 0.0000 1.0000 0.000 0.000 0.000 1.000 0.000
#> ERR863733 1 0.4241 0.3614 0.716 0.012 0.264 0.000 0.008
#> ERR863732 3 0.5252 0.4144 0.272 0.008 0.656 0.000 0.064
#> ERR863730 5 0.4968 0.4849 0.456 0.000 0.028 0.000 0.516
#> ERR863742 5 0.6021 0.4392 0.428 0.000 0.088 0.008 0.476
#> ERR863763 1 0.0451 0.5004 0.988 0.000 0.004 0.000 0.008
#> ERR863741 2 0.3563 0.2022 0.000 0.780 0.012 0.000 0.208
#> ERR863743 1 0.4210 0.1039 0.588 0.000 0.000 0.000 0.412
#> ERR863745 3 0.6643 -0.3814 0.224 0.372 0.404 0.000 0.000
#> ERR863744 1 0.6630 0.0668 0.496 0.008 0.196 0.000 0.300
#> ERR863746 5 0.4968 0.4849 0.456 0.000 0.028 0.000 0.516
#> ERR863748 1 0.4735 0.2039 0.624 0.020 0.352 0.000 0.004
#> ERR863747 3 0.3305 0.5377 0.000 0.224 0.776 0.000 0.000
#> ERR863694 1 0.3635 0.4405 0.828 0.004 0.056 0.000 0.112
#> ERR863693 1 0.0404 0.4995 0.988 0.000 0.000 0.000 0.012
#> ERR863686 5 0.3967 0.5563 0.264 0.000 0.012 0.000 0.724
#> ERR863678 1 0.6139 0.2371 0.520 0.020 0.380 0.000 0.080
#> ERR863685 3 0.1455 0.7300 0.008 0.000 0.952 0.008 0.032
#> ERR863689 1 0.2575 0.4793 0.884 0.004 0.012 0.000 0.100
#> ERR863691 1 0.1877 0.4978 0.924 0.000 0.012 0.000 0.064
#> ERR863682 5 0.4074 0.5140 0.364 0.000 0.000 0.000 0.636
#> ERR863695 2 0.5920 0.7496 0.252 0.588 0.160 0.000 0.000
#> ERR863683 5 0.5238 0.3893 0.472 0.000 0.044 0.000 0.484
#> ERR863684 1 0.3323 0.4597 0.844 0.004 0.036 0.000 0.116
#> ERR863702 5 0.4114 0.5528 0.272 0.000 0.016 0.000 0.712
#> ERR863687 3 0.4712 0.4164 0.048 0.268 0.684 0.000 0.000
#> ERR863706 3 0.1538 0.7288 0.008 0.000 0.948 0.008 0.036
#> ERR863708 2 0.5920 0.7496 0.252 0.588 0.160 0.000 0.000
#> ERR863710 1 0.4210 0.1039 0.588 0.000 0.000 0.000 0.412
#> ERR863709 2 0.6036 0.7311 0.276 0.564 0.160 0.000 0.000
#> ERR863753 2 0.6387 0.6689 0.236 0.516 0.248 0.000 0.000
#> ERR863754 1 0.3816 0.2537 0.696 0.000 0.000 0.000 0.304
#> ERR863749 1 0.4446 0.0146 0.592 0.000 0.008 0.000 0.400
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> ERR863675 4 0.0922 0.6937 0.004 0.004 0.024 0.968 0.000 0.000
#> ERR863705 3 0.0458 0.8125 0.000 0.000 0.984 0.000 0.016 0.000
#> ERR863704 2 0.4875 0.5966 0.092 0.732 0.008 0.036 0.132 0.000
#> ERR863679 3 0.0458 0.8125 0.000 0.000 0.984 0.000 0.016 0.000
#> ERR863680 2 0.1075 0.8634 0.000 0.952 0.000 0.048 0.000 0.000
#> ERR863676 2 0.1075 0.8634 0.000 0.952 0.000 0.048 0.000 0.000
#> ERR863677 4 0.0653 0.6924 0.004 0.004 0.012 0.980 0.000 0.000
#> ERR863688 1 0.2355 0.6585 0.876 0.000 0.008 0.112 0.004 0.000
#> ERR863690 1 0.4047 0.6315 0.604 0.000 0.000 0.384 0.012 0.000
#> ERR863692 4 0.2220 0.6678 0.060 0.004 0.016 0.908 0.012 0.000
#> ERR863703 1 0.3934 0.6581 0.616 0.000 0.008 0.376 0.000 0.000
#> ERR863712 4 0.0551 0.6914 0.004 0.004 0.008 0.984 0.000 0.000
#> ERR863711 1 0.3728 0.6768 0.652 0.000 0.004 0.344 0.000 0.000
#> ERR863760 5 0.5611 0.3314 0.396 0.104 0.000 0.012 0.488 0.000
#> ERR863727 1 0.3320 0.7134 0.772 0.000 0.016 0.212 0.000 0.000
#> ERR863766 3 0.1442 0.8106 0.040 0.000 0.944 0.000 0.012 0.004
#> ERR863767 1 0.4648 0.5859 0.524 0.004 0.024 0.444 0.004 0.000
#> ERR863752 2 0.3171 0.7965 0.004 0.848 0.088 0.052 0.008 0.000
#> ERR863757 1 0.1015 0.5837 0.968 0.000 0.012 0.004 0.012 0.004
#> ERR863758 1 0.4101 0.6205 0.580 0.000 0.000 0.408 0.012 0.000
#> ERR863755 1 0.2488 0.6555 0.864 0.000 0.008 0.124 0.004 0.000
#> ERR863756 3 0.2976 0.7360 0.020 0.000 0.844 0.124 0.012 0.000
#> ERR863707 3 0.0458 0.8125 0.000 0.000 0.984 0.000 0.016 0.000
#> ERR863681 6 0.0000 1.0000 0.000 0.000 0.000 0.000 0.000 1.000
#> ERR863719 4 0.3618 0.6601 0.132 0.004 0.056 0.804 0.004 0.000
#> ERR863759 3 0.3217 0.6686 0.000 0.224 0.768 0.000 0.008 0.000
#> ERR863718 1 0.4101 0.6205 0.580 0.000 0.000 0.408 0.012 0.000
#> ERR863717 4 0.3881 -0.1035 0.396 0.004 0.000 0.600 0.000 0.000
#> ERR863715 5 0.5400 0.3035 0.016 0.328 0.076 0.004 0.576 0.000
#> ERR863716 1 0.2278 0.6897 0.868 0.000 0.000 0.128 0.004 0.000
#> ERR863722 4 0.5752 0.3419 0.064 0.024 0.396 0.504 0.012 0.000
#> ERR863721 4 0.0520 0.6852 0.008 0.000 0.000 0.984 0.008 0.000
#> ERR863720 2 0.1219 0.8616 0.000 0.948 0.000 0.048 0.004 0.000
#> ERR863723 1 0.4138 0.7051 0.692 0.000 0.020 0.276 0.012 0.000
#> ERR863761 3 0.5808 0.2665 0.288 0.028 0.572 0.004 0.108 0.000
#> ERR863735 1 0.4218 0.6236 0.584 0.000 0.004 0.400 0.012 0.000
#> ERR863734 3 0.1442 0.8106 0.040 0.000 0.944 0.000 0.012 0.004
#> ERR863736 5 0.6359 0.3301 0.384 0.100 0.056 0.004 0.456 0.000
#> ERR863729 5 0.3721 0.5047 0.016 0.252 0.004 0.000 0.728 0.000
#> ERR863728 4 0.5953 0.3657 0.268 0.012 0.176 0.540 0.004 0.000
#> ERR863731 1 0.4101 0.6205 0.580 0.000 0.000 0.408 0.012 0.000
#> ERR863764 4 0.5013 0.4467 0.024 0.024 0.328 0.612 0.012 0.000
#> ERR863740 1 0.4782 0.6713 0.692 0.000 0.076 0.216 0.012 0.004
#> ERR863765 1 0.4312 -0.0583 0.508 0.000 0.476 0.000 0.012 0.004
#> ERR863762 3 0.0909 0.8123 0.012 0.000 0.968 0.000 0.020 0.000
#> ERR863724 6 0.0000 1.0000 0.000 0.000 0.000 0.000 0.000 1.000
#> ERR863733 4 0.4299 0.5572 0.016 0.020 0.264 0.696 0.004 0.000
#> ERR863732 3 0.5129 0.4740 0.080 0.012 0.664 0.232 0.012 0.000
#> ERR863730 1 0.3320 0.7134 0.772 0.000 0.016 0.212 0.000 0.000
#> ERR863742 1 0.4782 0.6713 0.692 0.000 0.076 0.216 0.012 0.004
#> ERR863763 4 0.0767 0.6884 0.012 0.000 0.004 0.976 0.008 0.000
#> ERR863741 5 0.3721 0.5047 0.016 0.252 0.004 0.000 0.728 0.000
#> ERR863743 1 0.4101 0.6205 0.580 0.000 0.000 0.408 0.012 0.000
#> ERR863745 2 0.4928 0.4856 0.016 0.668 0.252 0.056 0.008 0.000
#> ERR863744 4 0.6153 0.1188 0.344 0.012 0.200 0.444 0.000 0.000
#> ERR863746 1 0.3320 0.7134 0.772 0.000 0.016 0.212 0.000 0.000
#> ERR863748 4 0.5089 0.3877 0.024 0.024 0.352 0.588 0.012 0.000
#> ERR863747 3 0.3217 0.6679 0.000 0.224 0.768 0.000 0.008 0.000
#> ERR863694 4 0.3826 0.6594 0.132 0.004 0.056 0.796 0.012 0.000
#> ERR863693 4 0.0363 0.6837 0.012 0.000 0.000 0.988 0.000 0.000
#> ERR863686 1 0.0458 0.6103 0.984 0.000 0.000 0.016 0.000 0.000
#> ERR863678 4 0.6182 0.3460 0.100 0.024 0.388 0.472 0.016 0.000
#> ERR863685 3 0.1442 0.8106 0.040 0.000 0.944 0.000 0.012 0.004
#> ERR863689 4 0.2771 0.6255 0.100 0.008 0.016 0.868 0.008 0.000
#> ERR863691 4 0.2220 0.6678 0.060 0.004 0.016 0.908 0.012 0.000
#> ERR863682 1 0.2805 0.6725 0.828 0.000 0.000 0.160 0.012 0.000
#> ERR863695 2 0.1075 0.8634 0.000 0.952 0.000 0.048 0.000 0.000
#> ERR863683 1 0.3904 0.7061 0.732 0.000 0.032 0.232 0.004 0.000
#> ERR863684 4 0.3275 0.6304 0.144 0.004 0.036 0.816 0.000 0.000
#> ERR863702 1 0.1036 0.6022 0.964 0.000 0.008 0.024 0.004 0.000
#> ERR863687 3 0.4531 0.5729 0.012 0.276 0.676 0.028 0.008 0.000
#> ERR863706 3 0.1511 0.8088 0.044 0.000 0.940 0.000 0.012 0.004
#> ERR863708 2 0.1075 0.8634 0.000 0.952 0.000 0.048 0.000 0.000
#> ERR863710 1 0.4101 0.6205 0.580 0.000 0.000 0.408 0.012 0.000
#> ERR863709 2 0.1686 0.8433 0.000 0.924 0.000 0.064 0.012 0.000
#> ERR863753 2 0.3171 0.7965 0.004 0.848 0.088 0.052 0.008 0.000
#> ERR863754 4 0.3860 -0.3849 0.472 0.000 0.000 0.528 0.000 0.000
#> ERR863749 1 0.3954 0.6629 0.620 0.000 0.004 0.372 0.004 0.000
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)
An example of the output of tb
is:
#> which_row fdr mean_1 mean_2 scaled_mean_1 scaled_mean_2 km
#> 1 38 0.042760348 8.373488 9.131774 -0.5533452 0.5164555 1
#> 2 40 0.018707592 7.106213 8.469186 -0.6173731 0.5762149 1
#> 3 55 0.019134737 10.221463 11.207825 -0.6159697 0.5749050 1
#> 4 59 0.006059896 5.921854 7.869574 -0.6899429 0.6439467 1
#> 5 60 0.018055526 8.928898 10.211722 -0.6204761 0.5791110 1
#> 6 98 0.009384629 15.714769 14.887706 0.6635654 -0.6193277 2
...
The columns in tb
are:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.km
: Row groups if k-means clustering is applied to rows.UMAP plot which shows how samples are separated.
dimension_reduction(res, k = 2, method = "UMAP")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
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 17118 rows and 78 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 0.343 0.788 0.877 0.4750 0.499 0.499
#> 3 3 0.566 0.781 0.863 0.3290 0.793 0.610
#> 4 4 0.638 0.721 0.791 0.1405 0.856 0.625
#> 5 5 0.665 0.641 0.773 0.0741 0.971 0.893
#> 6 6 0.734 0.651 0.770 0.0473 0.893 0.592
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
#> ERR863675 2 0.6801 0.844 0.180 0.820
#> ERR863705 2 0.5178 0.816 0.116 0.884
#> ERR863704 2 0.6343 0.852 0.160 0.840
#> ERR863679 2 0.5178 0.816 0.116 0.884
#> ERR863680 2 0.6343 0.852 0.160 0.840
#> ERR863676 2 0.6343 0.852 0.160 0.840
#> ERR863677 2 0.9710 0.520 0.400 0.600
#> ERR863688 1 0.2603 0.876 0.956 0.044
#> ERR863690 1 0.0672 0.894 0.992 0.008
#> ERR863692 1 0.0672 0.894 0.992 0.008
#> ERR863703 1 0.0672 0.894 0.992 0.008
#> ERR863712 1 1.0000 -0.245 0.504 0.496
#> ERR863711 1 0.0000 0.895 1.000 0.000
#> ERR863760 2 0.6343 0.852 0.160 0.840
#> ERR863727 1 0.0672 0.895 0.992 0.008
#> ERR863766 1 0.9954 0.120 0.540 0.460
#> ERR863767 1 0.0000 0.895 1.000 0.000
#> ERR863752 2 0.3584 0.847 0.068 0.932
#> ERR863757 1 0.3274 0.866 0.940 0.060
#> ERR863758 1 0.0376 0.895 0.996 0.004
#> ERR863755 1 0.0672 0.895 0.992 0.008
#> ERR863756 2 0.7139 0.768 0.196 0.804
#> ERR863707 2 0.5178 0.816 0.116 0.884
#> ERR863681 2 0.6973 0.725 0.188 0.812
#> ERR863719 1 0.4815 0.840 0.896 0.104
#> ERR863759 2 0.2423 0.834 0.040 0.960
#> ERR863718 1 0.0376 0.895 0.996 0.004
#> ERR863717 1 0.0000 0.895 1.000 0.000
#> ERR863715 2 0.5059 0.857 0.112 0.888
#> ERR863716 1 0.0672 0.895 0.992 0.008
#> ERR863722 2 0.6148 0.856 0.152 0.848
#> ERR863721 1 0.4939 0.812 0.892 0.108
#> ERR863720 2 0.6438 0.850 0.164 0.836
#> ERR863723 1 0.0672 0.895 0.992 0.008
#> ERR863761 2 0.5178 0.816 0.116 0.884
#> ERR863735 1 0.0672 0.895 0.992 0.008
#> ERR863734 2 0.9460 0.469 0.364 0.636
#> ERR863736 2 0.3584 0.848 0.068 0.932
#> ERR863729 2 0.5178 0.857 0.116 0.884
#> ERR863728 1 0.0672 0.894 0.992 0.008
#> ERR863731 1 0.0672 0.894 0.992 0.008
#> ERR863764 2 0.6712 0.847 0.176 0.824
#> ERR863740 1 0.3879 0.852 0.924 0.076
#> ERR863765 1 0.9635 0.355 0.612 0.388
#> ERR863762 2 0.8499 0.654 0.276 0.724
#> ERR863724 1 0.9933 0.251 0.548 0.452
#> ERR863733 2 0.5178 0.857 0.116 0.884
#> ERR863732 2 0.5737 0.809 0.136 0.864
#> ERR863730 1 0.3274 0.865 0.940 0.060
#> ERR863742 1 0.4562 0.832 0.904 0.096
#> ERR863763 2 0.9710 0.520 0.400 0.600
#> ERR863741 1 0.7219 0.698 0.800 0.200
#> ERR863743 1 0.0672 0.894 0.992 0.008
#> ERR863745 2 0.6148 0.854 0.152 0.848
#> ERR863744 1 0.1184 0.892 0.984 0.016
#> ERR863746 1 0.0672 0.895 0.992 0.008
#> ERR863748 2 0.2948 0.840 0.052 0.948
#> ERR863747 2 0.2423 0.834 0.040 0.960
#> ERR863694 2 0.9552 0.571 0.376 0.624
#> ERR863693 1 0.4022 0.838 0.920 0.080
#> ERR863686 1 0.1414 0.893 0.980 0.020
#> ERR863678 1 0.0938 0.893 0.988 0.012
#> ERR863685 2 0.7745 0.726 0.228 0.772
#> ERR863689 1 0.3114 0.860 0.944 0.056
#> ERR863691 1 0.4022 0.838 0.920 0.080
#> ERR863682 1 0.0938 0.895 0.988 0.012
#> ERR863695 2 0.6343 0.852 0.160 0.840
#> ERR863683 1 0.3274 0.865 0.940 0.060
#> ERR863684 1 0.4939 0.812 0.892 0.108
#> ERR863702 1 0.2603 0.876 0.956 0.044
#> ERR863687 2 0.2423 0.834 0.040 0.960
#> ERR863706 1 0.9635 0.355 0.612 0.388
#> ERR863708 2 0.6343 0.852 0.160 0.840
#> ERR863710 1 0.0376 0.895 0.996 0.004
#> ERR863709 2 0.9129 0.649 0.328 0.672
#> ERR863753 2 0.6343 0.852 0.160 0.840
#> ERR863754 1 0.4022 0.838 0.920 0.080
#> ERR863749 1 0.0000 0.895 1.000 0.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> ERR863675 2 0.9021 0.527 0.184 0.552 0.264
#> ERR863705 3 0.4784 0.789 0.004 0.200 0.796
#> ERR863704 2 0.1015 0.760 0.008 0.980 0.012
#> ERR863679 3 0.4784 0.789 0.004 0.200 0.796
#> ERR863680 2 0.1182 0.762 0.012 0.976 0.012
#> ERR863676 2 0.1170 0.762 0.016 0.976 0.008
#> ERR863677 2 0.9358 0.505 0.244 0.516 0.240
#> ERR863688 1 0.2636 0.915 0.932 0.020 0.048
#> ERR863690 1 0.0424 0.932 0.992 0.008 0.000
#> ERR863692 1 0.3607 0.856 0.880 0.008 0.112
#> ERR863703 1 0.0237 0.933 0.996 0.004 0.000
#> ERR863712 2 0.9153 0.488 0.308 0.520 0.172
#> ERR863711 1 0.0475 0.933 0.992 0.004 0.004
#> ERR863760 2 0.0829 0.755 0.004 0.984 0.012
#> ERR863727 1 0.1525 0.929 0.964 0.004 0.032
#> ERR863766 3 0.5069 0.794 0.128 0.044 0.828
#> ERR863767 1 0.0475 0.933 0.992 0.004 0.004
#> ERR863752 2 0.1163 0.747 0.000 0.972 0.028
#> ERR863757 1 0.2947 0.908 0.920 0.020 0.060
#> ERR863758 1 0.0237 0.933 0.996 0.004 0.000
#> ERR863755 1 0.0983 0.933 0.980 0.004 0.016
#> ERR863756 3 0.3293 0.774 0.012 0.088 0.900
#> ERR863707 3 0.4682 0.792 0.004 0.192 0.804
#> ERR863681 3 0.4505 0.786 0.092 0.048 0.860
#> ERR863719 1 0.8168 0.537 0.612 0.108 0.280
#> ERR863759 3 0.6154 0.557 0.000 0.408 0.592
#> ERR863718 1 0.0237 0.933 0.996 0.004 0.000
#> ERR863717 1 0.0424 0.934 0.992 0.000 0.008
#> ERR863715 2 0.1585 0.747 0.008 0.964 0.028
#> ERR863716 1 0.1129 0.932 0.976 0.004 0.020
#> ERR863722 2 0.7187 0.230 0.024 0.496 0.480
#> ERR863721 1 0.7800 0.533 0.668 0.204 0.128
#> ERR863720 2 0.1585 0.760 0.028 0.964 0.008
#> ERR863723 1 0.1525 0.929 0.964 0.004 0.032
#> ERR863761 3 0.4575 0.795 0.004 0.184 0.812
#> ERR863735 1 0.0237 0.933 0.996 0.000 0.004
#> ERR863734 3 0.5243 0.811 0.100 0.072 0.828
#> ERR863736 2 0.0983 0.750 0.004 0.980 0.016
#> ERR863729 2 0.1585 0.745 0.008 0.964 0.028
#> ERR863728 1 0.0829 0.929 0.984 0.004 0.012
#> ERR863731 1 0.0237 0.933 0.996 0.004 0.000
#> ERR863764 2 0.7476 0.418 0.040 0.556 0.404
#> ERR863740 1 0.1878 0.923 0.952 0.004 0.044
#> ERR863765 3 0.5178 0.760 0.164 0.028 0.808
#> ERR863762 3 0.5582 0.812 0.100 0.088 0.812
#> ERR863724 3 0.4342 0.772 0.120 0.024 0.856
#> ERR863733 2 0.7080 0.409 0.024 0.564 0.412
#> ERR863732 3 0.2945 0.777 0.004 0.088 0.908
#> ERR863730 1 0.1525 0.929 0.964 0.004 0.032
#> ERR863742 1 0.2096 0.918 0.944 0.004 0.052
#> ERR863763 2 0.9358 0.505 0.244 0.516 0.240
#> ERR863741 2 0.8625 0.527 0.252 0.592 0.156
#> ERR863743 1 0.0237 0.933 0.996 0.004 0.000
#> ERR863745 2 0.1182 0.762 0.012 0.976 0.012
#> ERR863744 1 0.1267 0.932 0.972 0.004 0.024
#> ERR863746 1 0.1399 0.930 0.968 0.004 0.028
#> ERR863748 3 0.6205 0.363 0.008 0.336 0.656
#> ERR863747 3 0.6095 0.582 0.000 0.392 0.608
#> ERR863694 2 0.8423 0.595 0.156 0.616 0.228
#> ERR863693 1 0.3607 0.856 0.880 0.008 0.112
#> ERR863686 1 0.2527 0.917 0.936 0.020 0.044
#> ERR863678 1 0.2590 0.891 0.924 0.004 0.072
#> ERR863685 3 0.5243 0.811 0.100 0.072 0.828
#> ERR863689 1 0.3375 0.866 0.892 0.008 0.100
#> ERR863691 1 0.3607 0.856 0.880 0.008 0.112
#> ERR863682 1 0.1315 0.932 0.972 0.008 0.020
#> ERR863695 2 0.1182 0.762 0.012 0.976 0.012
#> ERR863683 1 0.1525 0.929 0.964 0.004 0.032
#> ERR863684 1 0.6309 0.729 0.772 0.100 0.128
#> ERR863702 1 0.2743 0.914 0.928 0.020 0.052
#> ERR863687 3 0.5882 0.643 0.000 0.348 0.652
#> ERR863706 3 0.5178 0.760 0.164 0.028 0.808
#> ERR863708 2 0.1182 0.762 0.012 0.976 0.012
#> ERR863710 1 0.0237 0.933 0.996 0.004 0.000
#> ERR863709 2 0.4914 0.717 0.068 0.844 0.088
#> ERR863753 2 0.1182 0.762 0.012 0.976 0.012
#> ERR863754 1 0.3532 0.859 0.884 0.008 0.108
#> ERR863749 1 0.0475 0.933 0.992 0.004 0.004
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> ERR863675 4 0.7900 0.6282 0.156 0.268 0.036 0.540
#> ERR863705 3 0.2111 0.8525 0.000 0.044 0.932 0.024
#> ERR863704 2 0.0000 0.8982 0.000 1.000 0.000 0.000
#> ERR863679 3 0.2002 0.8528 0.000 0.044 0.936 0.020
#> ERR863680 2 0.0188 0.8985 0.000 0.996 0.004 0.000
#> ERR863676 2 0.0469 0.8955 0.000 0.988 0.000 0.012
#> ERR863677 4 0.7696 0.6427 0.180 0.256 0.020 0.544
#> ERR863688 1 0.5033 0.6128 0.708 0.004 0.020 0.268
#> ERR863690 1 0.1557 0.8430 0.944 0.000 0.000 0.056
#> ERR863692 4 0.4992 0.3648 0.476 0.000 0.000 0.524
#> ERR863703 1 0.1474 0.8452 0.948 0.000 0.000 0.052
#> ERR863712 4 0.7492 0.6421 0.180 0.256 0.012 0.552
#> ERR863711 1 0.0921 0.8516 0.972 0.000 0.000 0.028
#> ERR863760 2 0.2987 0.8414 0.000 0.880 0.016 0.104
#> ERR863727 1 0.2002 0.8404 0.936 0.000 0.020 0.044
#> ERR863766 3 0.2363 0.8483 0.024 0.000 0.920 0.056
#> ERR863767 1 0.1211 0.8493 0.960 0.000 0.000 0.040
#> ERR863752 2 0.1854 0.8628 0.000 0.940 0.048 0.012
#> ERR863757 1 0.5964 0.4891 0.612 0.004 0.044 0.340
#> ERR863758 1 0.1557 0.8456 0.944 0.000 0.000 0.056
#> ERR863755 1 0.0469 0.8534 0.988 0.000 0.000 0.012
#> ERR863756 3 0.4253 0.6965 0.000 0.016 0.776 0.208
#> ERR863707 3 0.1767 0.8545 0.000 0.044 0.944 0.012
#> ERR863681 3 0.4401 0.7237 0.004 0.000 0.724 0.272
#> ERR863719 4 0.4698 0.5571 0.180 0.008 0.032 0.780
#> ERR863759 3 0.5062 0.6126 0.000 0.300 0.680 0.020
#> ERR863718 1 0.1557 0.8456 0.944 0.000 0.000 0.056
#> ERR863717 1 0.1174 0.8530 0.968 0.000 0.012 0.020
#> ERR863715 2 0.4635 0.7310 0.000 0.720 0.012 0.268
#> ERR863716 1 0.1042 0.8503 0.972 0.000 0.008 0.020
#> ERR863722 4 0.7324 0.4828 0.000 0.228 0.240 0.532
#> ERR863721 4 0.6774 0.6047 0.312 0.120 0.000 0.568
#> ERR863720 2 0.0524 0.8949 0.000 0.988 0.004 0.008
#> ERR863723 1 0.1913 0.8413 0.940 0.000 0.020 0.040
#> ERR863761 3 0.2282 0.8557 0.000 0.024 0.924 0.052
#> ERR863735 1 0.1389 0.8483 0.952 0.000 0.000 0.048
#> ERR863734 3 0.2474 0.8525 0.016 0.008 0.920 0.056
#> ERR863736 2 0.5088 0.7044 0.000 0.688 0.024 0.288
#> ERR863729 2 0.5113 0.7026 0.000 0.684 0.024 0.292
#> ERR863728 1 0.4188 0.5451 0.752 0.004 0.000 0.244
#> ERR863731 1 0.1557 0.8456 0.944 0.000 0.000 0.056
#> ERR863764 4 0.7931 0.5188 0.028 0.244 0.196 0.532
#> ERR863740 1 0.2623 0.8188 0.908 0.000 0.028 0.064
#> ERR863765 3 0.2830 0.8381 0.040 0.000 0.900 0.060
#> ERR863762 3 0.1975 0.8540 0.012 0.016 0.944 0.028
#> ERR863724 3 0.4401 0.7237 0.004 0.000 0.724 0.272
#> ERR863733 4 0.7315 0.4693 0.000 0.252 0.216 0.532
#> ERR863732 3 0.2060 0.8456 0.000 0.016 0.932 0.052
#> ERR863730 1 0.2002 0.8404 0.936 0.000 0.020 0.044
#> ERR863742 1 0.2965 0.8081 0.892 0.000 0.036 0.072
#> ERR863763 4 0.7969 0.6447 0.184 0.252 0.032 0.532
#> ERR863741 4 0.6381 -0.0184 0.056 0.328 0.012 0.604
#> ERR863743 1 0.1557 0.8456 0.944 0.000 0.000 0.056
#> ERR863745 2 0.0672 0.8957 0.000 0.984 0.008 0.008
#> ERR863744 1 0.1610 0.8511 0.952 0.000 0.016 0.032
#> ERR863746 1 0.1820 0.8441 0.944 0.000 0.020 0.036
#> ERR863748 4 0.6953 0.1400 0.000 0.112 0.412 0.476
#> ERR863747 3 0.4936 0.6443 0.000 0.280 0.700 0.020
#> ERR863694 4 0.6187 0.5171 0.044 0.236 0.036 0.684
#> ERR863693 4 0.5472 0.4386 0.440 0.016 0.000 0.544
#> ERR863686 1 0.5454 0.5563 0.664 0.004 0.028 0.304
#> ERR863678 1 0.5079 0.5029 0.728 0.004 0.032 0.236
#> ERR863685 3 0.2353 0.8535 0.012 0.008 0.924 0.056
#> ERR863689 1 0.4741 0.3212 0.668 0.004 0.000 0.328
#> ERR863691 4 0.5158 0.3745 0.472 0.004 0.000 0.524
#> ERR863682 1 0.1488 0.8520 0.956 0.000 0.012 0.032
#> ERR863695 2 0.0376 0.8981 0.000 0.992 0.004 0.004
#> ERR863683 1 0.1820 0.8414 0.944 0.000 0.020 0.036
#> ERR863684 4 0.6176 0.5430 0.368 0.060 0.000 0.572
#> ERR863702 1 0.5166 0.5872 0.688 0.004 0.020 0.288
#> ERR863687 3 0.4706 0.7138 0.000 0.224 0.748 0.028
#> ERR863706 3 0.2908 0.8358 0.040 0.000 0.896 0.064
#> ERR863708 2 0.0376 0.8981 0.000 0.992 0.004 0.004
#> ERR863710 1 0.1557 0.8456 0.944 0.000 0.000 0.056
#> ERR863709 2 0.1994 0.8483 0.008 0.936 0.004 0.052
#> ERR863753 2 0.0524 0.8974 0.000 0.988 0.004 0.008
#> ERR863754 4 0.4992 0.3668 0.476 0.000 0.000 0.524
#> ERR863749 1 0.1211 0.8493 0.960 0.000 0.000 0.040
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> ERR863675 4 0.3733 0.6871 0.032 0.160 0.000 0.804 0.004
#> ERR863705 3 0.1597 0.7948 0.000 0.012 0.940 0.048 0.000
#> ERR863704 2 0.1731 0.8149 0.000 0.940 0.008 0.012 0.040
#> ERR863679 3 0.1597 0.7948 0.000 0.012 0.940 0.048 0.000
#> ERR863680 2 0.0981 0.8530 0.000 0.972 0.012 0.008 0.008
#> ERR863676 2 0.0727 0.8512 0.000 0.980 0.004 0.012 0.004
#> ERR863677 4 0.3577 0.6880 0.032 0.160 0.000 0.808 0.000
#> ERR863688 1 0.4047 0.3681 0.676 0.000 0.004 0.000 0.320
#> ERR863690 1 0.5264 0.7157 0.676 0.000 0.000 0.128 0.196
#> ERR863692 4 0.5010 0.5496 0.224 0.000 0.000 0.688 0.088
#> ERR863703 1 0.5264 0.7157 0.676 0.000 0.000 0.128 0.196
#> ERR863712 4 0.3615 0.6901 0.036 0.156 0.000 0.808 0.000
#> ERR863711 1 0.5072 0.7227 0.696 0.000 0.000 0.116 0.188
#> ERR863760 2 0.3874 0.5349 0.004 0.780 0.004 0.016 0.196
#> ERR863727 1 0.1074 0.7279 0.968 0.000 0.012 0.004 0.016
#> ERR863766 3 0.2775 0.7858 0.020 0.000 0.876 0.004 0.100
#> ERR863767 1 0.5083 0.7218 0.696 0.000 0.000 0.120 0.184
#> ERR863752 2 0.2103 0.7845 0.000 0.920 0.056 0.020 0.004
#> ERR863757 1 0.4713 0.0987 0.544 0.000 0.016 0.000 0.440
#> ERR863758 1 0.5264 0.7158 0.676 0.000 0.000 0.128 0.196
#> ERR863755 1 0.1195 0.7377 0.960 0.000 0.000 0.012 0.028
#> ERR863756 3 0.4001 0.6585 0.000 0.004 0.764 0.208 0.024
#> ERR863707 3 0.1408 0.7957 0.000 0.008 0.948 0.044 0.000
#> ERR863681 3 0.6957 0.3827 0.092 0.004 0.460 0.052 0.392
#> ERR863719 4 0.4226 0.5864 0.140 0.000 0.000 0.776 0.084
#> ERR863759 3 0.4532 0.5930 0.000 0.248 0.712 0.036 0.004
#> ERR863718 1 0.5295 0.7153 0.672 0.000 0.000 0.128 0.200
#> ERR863717 1 0.2694 0.7388 0.888 0.000 0.004 0.076 0.032
#> ERR863715 2 0.4437 -0.5491 0.000 0.532 0.004 0.000 0.464
#> ERR863716 1 0.0162 0.7363 0.996 0.000 0.000 0.004 0.000
#> ERR863722 4 0.5164 0.6172 0.000 0.124 0.120 0.732 0.024
#> ERR863721 4 0.2879 0.6912 0.080 0.032 0.000 0.880 0.008
#> ERR863720 2 0.1153 0.8359 0.000 0.964 0.004 0.008 0.024
#> ERR863723 1 0.0566 0.7340 0.984 0.000 0.012 0.000 0.004
#> ERR863761 3 0.3217 0.7799 0.004 0.008 0.852 0.016 0.120
#> ERR863735 1 0.5253 0.7172 0.676 0.000 0.000 0.124 0.200
#> ERR863734 3 0.2775 0.7858 0.020 0.000 0.876 0.004 0.100
#> ERR863736 5 0.5859 0.4890 0.016 0.452 0.024 0.020 0.488
#> ERR863729 5 0.4437 0.4990 0.000 0.464 0.000 0.004 0.532
#> ERR863728 1 0.6417 0.4790 0.504 0.000 0.000 0.280 0.216
#> ERR863731 1 0.5295 0.7153 0.672 0.000 0.000 0.128 0.200
#> ERR863764 4 0.5271 0.6252 0.004 0.128 0.112 0.732 0.024
#> ERR863740 1 0.1405 0.7230 0.956 0.000 0.016 0.008 0.020
#> ERR863765 3 0.3898 0.7556 0.076 0.000 0.812 0.004 0.108
#> ERR863762 3 0.1805 0.7954 0.008 0.004 0.936 0.048 0.004
#> ERR863724 3 0.6953 0.3853 0.092 0.004 0.464 0.052 0.388
#> ERR863733 4 0.5209 0.6038 0.000 0.128 0.128 0.724 0.020
#> ERR863732 3 0.1857 0.7909 0.000 0.004 0.928 0.060 0.008
#> ERR863730 1 0.1306 0.7238 0.960 0.000 0.016 0.008 0.016
#> ERR863742 1 0.1471 0.7199 0.952 0.000 0.020 0.004 0.024
#> ERR863763 4 0.3693 0.6894 0.032 0.156 0.000 0.808 0.004
#> ERR863741 5 0.6458 0.4204 0.024 0.152 0.000 0.248 0.576
#> ERR863743 1 0.5264 0.7158 0.676 0.000 0.000 0.128 0.196
#> ERR863745 2 0.0960 0.8511 0.000 0.972 0.016 0.008 0.004
#> ERR863744 1 0.1901 0.7388 0.932 0.000 0.004 0.024 0.040
#> ERR863746 1 0.0968 0.7292 0.972 0.000 0.012 0.004 0.012
#> ERR863748 4 0.5569 0.4586 0.000 0.056 0.284 0.636 0.024
#> ERR863747 3 0.4476 0.6433 0.000 0.204 0.744 0.044 0.008
#> ERR863694 4 0.4202 0.6575 0.012 0.124 0.000 0.796 0.068
#> ERR863693 4 0.2727 0.6764 0.116 0.000 0.000 0.868 0.016
#> ERR863686 1 0.4480 0.2004 0.592 0.000 0.004 0.004 0.400
#> ERR863678 1 0.6494 0.5040 0.516 0.000 0.004 0.268 0.212
#> ERR863685 3 0.2775 0.7858 0.020 0.000 0.876 0.004 0.100
#> ERR863689 4 0.6438 -0.1742 0.400 0.000 0.000 0.424 0.176
#> ERR863691 4 0.5010 0.5496 0.224 0.000 0.000 0.688 0.088
#> ERR863682 1 0.2329 0.7406 0.876 0.000 0.000 0.000 0.124
#> ERR863695 2 0.0981 0.8530 0.000 0.972 0.012 0.008 0.008
#> ERR863683 1 0.0960 0.7277 0.972 0.000 0.016 0.008 0.004
#> ERR863684 4 0.2899 0.6834 0.100 0.008 0.000 0.872 0.020
#> ERR863702 1 0.4389 0.2741 0.624 0.000 0.004 0.004 0.368
#> ERR863687 3 0.3880 0.7027 0.000 0.152 0.800 0.044 0.004
#> ERR863706 3 0.4123 0.7433 0.092 0.000 0.796 0.004 0.108
#> ERR863708 2 0.0981 0.8526 0.000 0.972 0.012 0.008 0.008
#> ERR863710 1 0.5295 0.7153 0.672 0.000 0.000 0.128 0.200
#> ERR863709 2 0.2046 0.7696 0.000 0.916 0.000 0.068 0.016
#> ERR863753 2 0.0960 0.8511 0.000 0.972 0.016 0.008 0.004
#> ERR863754 4 0.5668 0.4339 0.232 0.000 0.000 0.624 0.144
#> ERR863749 1 0.5104 0.7217 0.692 0.000 0.000 0.116 0.192
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> ERR863675 4 0.2113 0.7963 0.032 0.028 0.000 0.920 0.012 0.008
#> ERR863705 3 0.0291 0.7943 0.000 0.004 0.992 0.000 0.004 0.000
#> ERR863704 2 0.1789 0.8709 0.000 0.924 0.000 0.000 0.032 0.044
#> ERR863679 3 0.0146 0.7951 0.000 0.004 0.996 0.000 0.000 0.000
#> ERR863680 2 0.1003 0.9242 0.000 0.964 0.000 0.020 0.016 0.000
#> ERR863676 2 0.0603 0.9255 0.000 0.980 0.000 0.016 0.004 0.000
#> ERR863677 4 0.1642 0.7982 0.032 0.028 0.000 0.936 0.004 0.000
#> ERR863688 6 0.5504 0.6580 0.188 0.000 0.000 0.000 0.252 0.560
#> ERR863690 1 0.1257 0.7571 0.952 0.000 0.000 0.000 0.020 0.028
#> ERR863692 4 0.5956 0.3918 0.332 0.000 0.000 0.532 0.072 0.064
#> ERR863703 1 0.1168 0.7552 0.956 0.000 0.000 0.000 0.016 0.028
#> ERR863712 4 0.1498 0.7983 0.032 0.028 0.000 0.940 0.000 0.000
#> ERR863711 1 0.0993 0.7522 0.964 0.000 0.000 0.000 0.012 0.024
#> ERR863760 2 0.4399 0.6026 0.000 0.716 0.004 0.004 0.212 0.064
#> ERR863727 6 0.3737 0.7564 0.392 0.000 0.000 0.000 0.000 0.608
#> ERR863766 3 0.4164 0.7392 0.000 0.000 0.764 0.020 0.064 0.152
#> ERR863767 1 0.0632 0.7544 0.976 0.000 0.000 0.000 0.000 0.024
#> ERR863752 2 0.1490 0.9027 0.000 0.948 0.024 0.016 0.008 0.004
#> ERR863757 6 0.5454 0.5093 0.128 0.000 0.000 0.004 0.316 0.552
#> ERR863758 1 0.0146 0.7625 0.996 0.000 0.000 0.000 0.004 0.000
#> ERR863755 6 0.4161 0.6515 0.448 0.000 0.000 0.000 0.012 0.540
#> ERR863756 3 0.3110 0.6769 0.000 0.000 0.836 0.128 0.020 0.016
#> ERR863707 3 0.0291 0.7956 0.000 0.004 0.992 0.000 0.000 0.004
#> ERR863681 5 0.6894 0.0931 0.000 0.000 0.288 0.048 0.352 0.312
#> ERR863719 4 0.2129 0.7665 0.000 0.000 0.000 0.904 0.040 0.056
#> ERR863759 3 0.2955 0.6631 0.000 0.172 0.816 0.000 0.008 0.004
#> ERR863718 1 0.0260 0.7625 0.992 0.000 0.000 0.000 0.008 0.000
#> ERR863717 1 0.4086 -0.4879 0.528 0.000 0.000 0.000 0.008 0.464
#> ERR863715 5 0.4090 0.3157 0.000 0.384 0.008 0.000 0.604 0.004
#> ERR863716 6 0.3961 0.7132 0.440 0.000 0.000 0.000 0.004 0.556
#> ERR863722 4 0.4865 0.6853 0.004 0.012 0.188 0.720 0.048 0.028
#> ERR863721 4 0.2164 0.7875 0.068 0.000 0.000 0.900 0.032 0.000
#> ERR863720 2 0.1723 0.9018 0.000 0.932 0.004 0.012 0.048 0.004
#> ERR863723 6 0.4025 0.7483 0.416 0.000 0.000 0.000 0.008 0.576
#> ERR863761 3 0.4664 0.7143 0.000 0.004 0.724 0.020 0.076 0.176
#> ERR863735 1 0.0146 0.7625 0.996 0.000 0.000 0.000 0.004 0.000
#> ERR863734 3 0.4164 0.7392 0.000 0.000 0.764 0.020 0.064 0.152
#> ERR863736 5 0.5986 0.3188 0.000 0.336 0.044 0.008 0.536 0.076
#> ERR863729 5 0.3508 0.4129 0.000 0.292 0.004 0.000 0.704 0.000
#> ERR863728 1 0.3219 0.6859 0.852 0.000 0.000 0.060 0.032 0.056
#> ERR863731 1 0.0260 0.7625 0.992 0.000 0.000 0.000 0.008 0.000
#> ERR863764 4 0.4804 0.6930 0.004 0.012 0.180 0.728 0.048 0.028
#> ERR863740 6 0.3841 0.7668 0.380 0.000 0.000 0.000 0.004 0.616
#> ERR863765 3 0.4951 0.6734 0.004 0.000 0.680 0.020 0.072 0.224
#> ERR863762 3 0.0520 0.7935 0.000 0.000 0.984 0.000 0.008 0.008
#> ERR863724 5 0.7016 0.0864 0.004 0.000 0.284 0.048 0.344 0.320
#> ERR863733 4 0.4540 0.7026 0.000 0.012 0.172 0.744 0.044 0.028
#> ERR863732 3 0.1332 0.7791 0.000 0.000 0.952 0.028 0.012 0.008
#> ERR863730 6 0.3659 0.7670 0.364 0.000 0.000 0.000 0.000 0.636
#> ERR863742 6 0.4118 0.7516 0.396 0.000 0.000 0.008 0.004 0.592
#> ERR863763 4 0.1642 0.7980 0.032 0.028 0.000 0.936 0.004 0.000
#> ERR863741 5 0.4720 0.4193 0.028 0.052 0.004 0.152 0.748 0.016
#> ERR863743 1 0.0520 0.7620 0.984 0.000 0.000 0.000 0.008 0.008
#> ERR863745 2 0.0951 0.9218 0.000 0.968 0.004 0.020 0.008 0.000
#> ERR863744 1 0.3996 -0.5404 0.512 0.000 0.000 0.000 0.004 0.484
#> ERR863746 6 0.3747 0.7528 0.396 0.000 0.000 0.000 0.000 0.604
#> ERR863748 4 0.5139 0.4781 0.000 0.000 0.348 0.580 0.044 0.028
#> ERR863747 3 0.3153 0.6930 0.000 0.128 0.832 0.000 0.008 0.032
#> ERR863694 4 0.2179 0.7827 0.012 0.024 0.000 0.916 0.040 0.008
#> ERR863693 4 0.2631 0.7766 0.076 0.000 0.000 0.876 0.044 0.004
#> ERR863686 6 0.5497 0.5944 0.140 0.000 0.000 0.004 0.300 0.556
#> ERR863678 1 0.2633 0.6992 0.888 0.000 0.000 0.044 0.028 0.040
#> ERR863685 3 0.4164 0.7392 0.000 0.000 0.764 0.020 0.064 0.152
#> ERR863689 1 0.5297 0.5224 0.680 0.000 0.000 0.172 0.064 0.084
#> ERR863691 4 0.5956 0.3918 0.332 0.000 0.000 0.532 0.072 0.064
#> ERR863682 1 0.4493 -0.4432 0.548 0.000 0.000 0.004 0.024 0.424
#> ERR863695 2 0.1003 0.9242 0.000 0.964 0.000 0.020 0.016 0.000
#> ERR863683 6 0.3945 0.7641 0.380 0.000 0.000 0.000 0.008 0.612
#> ERR863684 4 0.2237 0.7856 0.068 0.000 0.000 0.896 0.036 0.000
#> ERR863702 6 0.5544 0.6139 0.152 0.000 0.000 0.004 0.288 0.556
#> ERR863687 3 0.2218 0.7320 0.000 0.104 0.884 0.000 0.012 0.000
#> ERR863706 3 0.4951 0.6724 0.004 0.000 0.680 0.020 0.072 0.224
#> ERR863708 2 0.0603 0.9255 0.000 0.980 0.000 0.016 0.004 0.000
#> ERR863710 1 0.0405 0.7613 0.988 0.000 0.000 0.000 0.008 0.004
#> ERR863709 2 0.2134 0.8829 0.000 0.904 0.000 0.044 0.052 0.000
#> ERR863753 2 0.1007 0.9204 0.000 0.968 0.004 0.016 0.008 0.004
#> ERR863754 1 0.5713 0.1420 0.532 0.000 0.000 0.356 0.068 0.044
#> ERR863749 1 0.0909 0.7553 0.968 0.000 0.000 0.000 0.012 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)
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 17118 rows and 78 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 0.946 0.903 0.966 0.5062 0.494 0.494
#> 3 3 0.863 0.894 0.936 0.2989 0.782 0.587
#> 4 4 0.719 0.770 0.852 0.1323 0.852 0.605
#> 5 5 0.790 0.815 0.876 0.0803 0.909 0.662
#> 6 6 0.771 0.622 0.794 0.0381 0.966 0.830
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
#> ERR863675 2 0.0000 0.9563 0.000 1.000
#> ERR863705 2 0.0000 0.9563 0.000 1.000
#> ERR863704 2 0.0000 0.9563 0.000 1.000
#> ERR863679 2 0.0000 0.9563 0.000 1.000
#> ERR863680 2 0.0000 0.9563 0.000 1.000
#> ERR863676 2 0.0000 0.9563 0.000 1.000
#> ERR863677 2 0.0376 0.9537 0.004 0.996
#> ERR863688 1 0.0000 0.9690 1.000 0.000
#> ERR863690 1 0.0000 0.9690 1.000 0.000
#> ERR863692 1 0.0000 0.9690 1.000 0.000
#> ERR863703 1 0.0000 0.9690 1.000 0.000
#> ERR863712 1 0.9996 0.0344 0.512 0.488
#> ERR863711 1 0.0000 0.9690 1.000 0.000
#> ERR863760 2 0.0000 0.9563 0.000 1.000
#> ERR863727 1 0.0000 0.9690 1.000 0.000
#> ERR863766 2 0.5519 0.8269 0.128 0.872
#> ERR863767 1 0.0000 0.9690 1.000 0.000
#> ERR863752 2 0.0000 0.9563 0.000 1.000
#> ERR863757 1 0.0000 0.9690 1.000 0.000
#> ERR863758 1 0.0000 0.9690 1.000 0.000
#> ERR863755 1 0.0000 0.9690 1.000 0.000
#> ERR863756 2 0.0000 0.9563 0.000 1.000
#> ERR863707 2 0.0000 0.9563 0.000 1.000
#> ERR863681 2 0.0000 0.9563 0.000 1.000
#> ERR863719 1 0.9998 -0.0348 0.508 0.492
#> ERR863759 2 0.0000 0.9563 0.000 1.000
#> ERR863718 1 0.0000 0.9690 1.000 0.000
#> ERR863717 1 0.0000 0.9690 1.000 0.000
#> ERR863715 2 0.0000 0.9563 0.000 1.000
#> ERR863716 1 0.0000 0.9690 1.000 0.000
#> ERR863722 2 0.0000 0.9563 0.000 1.000
#> ERR863721 1 0.0000 0.9690 1.000 0.000
#> ERR863720 2 0.0000 0.9563 0.000 1.000
#> ERR863723 1 0.0000 0.9690 1.000 0.000
#> ERR863761 2 0.0000 0.9563 0.000 1.000
#> ERR863735 1 0.0000 0.9690 1.000 0.000
#> ERR863734 2 0.1843 0.9326 0.028 0.972
#> ERR863736 2 0.0000 0.9563 0.000 1.000
#> ERR863729 2 0.0000 0.9563 0.000 1.000
#> ERR863728 1 0.0000 0.9690 1.000 0.000
#> ERR863731 1 0.0000 0.9690 1.000 0.000
#> ERR863764 2 0.0000 0.9563 0.000 1.000
#> ERR863740 1 0.0000 0.9690 1.000 0.000
#> ERR863765 2 0.9988 0.1052 0.480 0.520
#> ERR863762 2 0.0000 0.9563 0.000 1.000
#> ERR863724 2 0.9896 0.2322 0.440 0.560
#> ERR863733 2 0.0000 0.9563 0.000 1.000
#> ERR863732 2 0.0000 0.9563 0.000 1.000
#> ERR863730 1 0.0000 0.9690 1.000 0.000
#> ERR863742 1 0.0000 0.9690 1.000 0.000
#> ERR863763 2 0.0376 0.9537 0.004 0.996
#> ERR863741 1 0.4431 0.8736 0.908 0.092
#> ERR863743 1 0.0000 0.9690 1.000 0.000
#> ERR863745 2 0.0000 0.9563 0.000 1.000
#> ERR863744 1 0.0000 0.9690 1.000 0.000
#> ERR863746 1 0.0000 0.9690 1.000 0.000
#> ERR863748 2 0.0000 0.9563 0.000 1.000
#> ERR863747 2 0.0000 0.9563 0.000 1.000
#> ERR863694 2 0.0376 0.9537 0.004 0.996
#> ERR863693 1 0.0000 0.9690 1.000 0.000
#> ERR863686 1 0.0000 0.9690 1.000 0.000
#> ERR863678 1 0.2236 0.9348 0.964 0.036
#> ERR863685 2 0.0000 0.9563 0.000 1.000
#> ERR863689 1 0.0000 0.9690 1.000 0.000
#> ERR863691 1 0.0000 0.9690 1.000 0.000
#> ERR863682 1 0.0000 0.9690 1.000 0.000
#> ERR863695 2 0.0000 0.9563 0.000 1.000
#> ERR863683 1 0.0000 0.9690 1.000 0.000
#> ERR863684 1 0.0000 0.9690 1.000 0.000
#> ERR863702 1 0.0000 0.9690 1.000 0.000
#> ERR863687 2 0.0000 0.9563 0.000 1.000
#> ERR863706 2 0.9988 0.1052 0.480 0.520
#> ERR863708 2 0.0000 0.9563 0.000 1.000
#> ERR863710 1 0.0000 0.9690 1.000 0.000
#> ERR863709 2 0.0672 0.9505 0.008 0.992
#> ERR863753 2 0.0000 0.9563 0.000 1.000
#> ERR863754 1 0.0000 0.9690 1.000 0.000
#> ERR863749 1 0.0000 0.9690 1.000 0.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> ERR863675 2 0.0000 0.8971 0.000 1.000 0.000
#> ERR863705 3 0.0000 0.9020 0.000 0.000 1.000
#> ERR863704 2 0.2796 0.9101 0.000 0.908 0.092
#> ERR863679 3 0.0000 0.9020 0.000 0.000 1.000
#> ERR863680 2 0.2796 0.9101 0.000 0.908 0.092
#> ERR863676 2 0.2796 0.9101 0.000 0.908 0.092
#> ERR863677 2 0.0000 0.8971 0.000 1.000 0.000
#> ERR863688 1 0.0000 0.9723 1.000 0.000 0.000
#> ERR863690 1 0.0000 0.9723 1.000 0.000 0.000
#> ERR863692 1 0.2796 0.9019 0.908 0.092 0.000
#> ERR863703 1 0.0000 0.9723 1.000 0.000 0.000
#> ERR863712 2 0.0000 0.8971 0.000 1.000 0.000
#> ERR863711 1 0.0000 0.9723 1.000 0.000 0.000
#> ERR863760 2 0.2796 0.9101 0.000 0.908 0.092
#> ERR863727 1 0.0000 0.9723 1.000 0.000 0.000
#> ERR863766 3 0.2711 0.8817 0.088 0.000 0.912
#> ERR863767 1 0.0000 0.9723 1.000 0.000 0.000
#> ERR863752 2 0.2796 0.9101 0.000 0.908 0.092
#> ERR863757 1 0.0747 0.9626 0.984 0.000 0.016
#> ERR863758 1 0.0000 0.9723 1.000 0.000 0.000
#> ERR863755 1 0.0000 0.9723 1.000 0.000 0.000
#> ERR863756 3 0.2796 0.8703 0.000 0.092 0.908
#> ERR863707 3 0.0000 0.9020 0.000 0.000 1.000
#> ERR863681 3 0.0000 0.9020 0.000 0.000 1.000
#> ERR863719 3 0.5728 0.6946 0.008 0.272 0.720
#> ERR863759 3 0.2261 0.8672 0.000 0.068 0.932
#> ERR863718 1 0.0000 0.9723 1.000 0.000 0.000
#> ERR863717 1 0.0000 0.9723 1.000 0.000 0.000
#> ERR863715 2 0.3551 0.8841 0.000 0.868 0.132
#> ERR863716 1 0.0000 0.9723 1.000 0.000 0.000
#> ERR863722 2 0.6274 -0.0227 0.000 0.544 0.456
#> ERR863721 2 0.1411 0.8778 0.036 0.964 0.000
#> ERR863720 2 0.2796 0.9101 0.000 0.908 0.092
#> ERR863723 1 0.0000 0.9723 1.000 0.000 0.000
#> ERR863761 3 0.0000 0.9020 0.000 0.000 1.000
#> ERR863735 1 0.0000 0.9723 1.000 0.000 0.000
#> ERR863734 3 0.2625 0.8839 0.084 0.000 0.916
#> ERR863736 2 0.5859 0.5873 0.000 0.656 0.344
#> ERR863729 2 0.3551 0.8841 0.000 0.868 0.132
#> ERR863728 1 0.2096 0.9328 0.944 0.052 0.004
#> ERR863731 1 0.0000 0.9723 1.000 0.000 0.000
#> ERR863764 2 0.2066 0.8709 0.000 0.940 0.060
#> ERR863740 1 0.0747 0.9626 0.984 0.000 0.016
#> ERR863765 3 0.2796 0.8790 0.092 0.000 0.908
#> ERR863762 3 0.2584 0.8916 0.064 0.008 0.928
#> ERR863724 3 0.2796 0.8790 0.092 0.000 0.908
#> ERR863733 2 0.0892 0.8927 0.000 0.980 0.020
#> ERR863732 3 0.2448 0.8792 0.000 0.076 0.924
#> ERR863730 1 0.0237 0.9702 0.996 0.000 0.004
#> ERR863742 1 0.0747 0.9626 0.984 0.000 0.016
#> ERR863763 2 0.0237 0.8963 0.000 0.996 0.004
#> ERR863741 2 0.1753 0.8751 0.048 0.952 0.000
#> ERR863743 1 0.0000 0.9723 1.000 0.000 0.000
#> ERR863745 2 0.2796 0.9101 0.000 0.908 0.092
#> ERR863744 1 0.0000 0.9723 1.000 0.000 0.000
#> ERR863746 1 0.0000 0.9723 1.000 0.000 0.000
#> ERR863748 3 0.6192 0.3884 0.000 0.420 0.580
#> ERR863747 3 0.2066 0.8733 0.000 0.060 0.940
#> ERR863694 2 0.0000 0.8971 0.000 1.000 0.000
#> ERR863693 1 0.4346 0.8142 0.816 0.184 0.000
#> ERR863686 1 0.0000 0.9723 1.000 0.000 0.000
#> ERR863678 1 0.4418 0.8341 0.848 0.020 0.132
#> ERR863685 3 0.0000 0.9020 0.000 0.000 1.000
#> ERR863689 1 0.3038 0.8975 0.896 0.104 0.000
#> ERR863691 1 0.3816 0.8538 0.852 0.148 0.000
#> ERR863682 1 0.0000 0.9723 1.000 0.000 0.000
#> ERR863695 2 0.2796 0.9101 0.000 0.908 0.092
#> ERR863683 1 0.0237 0.9702 0.996 0.000 0.004
#> ERR863684 2 0.1643 0.8716 0.044 0.956 0.000
#> ERR863702 1 0.0000 0.9723 1.000 0.000 0.000
#> ERR863687 3 0.2066 0.8733 0.000 0.060 0.940
#> ERR863706 3 0.2796 0.8790 0.092 0.000 0.908
#> ERR863708 2 0.2796 0.9101 0.000 0.908 0.092
#> ERR863710 1 0.0000 0.9723 1.000 0.000 0.000
#> ERR863709 2 0.1411 0.9061 0.000 0.964 0.036
#> ERR863753 2 0.2796 0.9101 0.000 0.908 0.092
#> ERR863754 1 0.3038 0.8926 0.896 0.104 0.000
#> ERR863749 1 0.0000 0.9723 1.000 0.000 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> ERR863675 4 0.4477 0.6601 0.000 0.312 0.000 0.688
#> ERR863705 3 0.0657 0.9077 0.000 0.012 0.984 0.004
#> ERR863704 2 0.0188 0.9010 0.000 0.996 0.000 0.004
#> ERR863679 3 0.0524 0.9093 0.000 0.008 0.988 0.004
#> ERR863680 2 0.0188 0.9034 0.000 0.996 0.000 0.004
#> ERR863676 2 0.0188 0.9034 0.000 0.996 0.000 0.004
#> ERR863677 4 0.4477 0.6601 0.000 0.312 0.000 0.688
#> ERR863688 1 0.3306 0.7770 0.840 0.004 0.000 0.156
#> ERR863690 1 0.3123 0.8399 0.844 0.000 0.000 0.156
#> ERR863692 4 0.3266 0.6670 0.168 0.000 0.000 0.832
#> ERR863703 1 0.3123 0.8399 0.844 0.000 0.000 0.156
#> ERR863712 4 0.4477 0.6601 0.000 0.312 0.000 0.688
#> ERR863711 1 0.3074 0.8416 0.848 0.000 0.000 0.152
#> ERR863760 2 0.2760 0.8374 0.000 0.872 0.000 0.128
#> ERR863727 1 0.1975 0.8468 0.936 0.000 0.016 0.048
#> ERR863766 3 0.0000 0.9106 0.000 0.000 1.000 0.000
#> ERR863767 1 0.3074 0.8416 0.848 0.000 0.000 0.152
#> ERR863752 2 0.0336 0.9011 0.000 0.992 0.000 0.008
#> ERR863757 1 0.3760 0.7708 0.828 0.004 0.012 0.156
#> ERR863758 1 0.3123 0.8399 0.844 0.000 0.000 0.156
#> ERR863755 1 0.1022 0.8576 0.968 0.000 0.000 0.032
#> ERR863756 3 0.3831 0.6943 0.000 0.004 0.792 0.204
#> ERR863707 3 0.0376 0.9104 0.000 0.004 0.992 0.004
#> ERR863681 3 0.0779 0.9009 0.004 0.000 0.980 0.016
#> ERR863719 4 0.4093 0.5841 0.156 0.004 0.024 0.816
#> ERR863759 3 0.4872 0.5200 0.000 0.356 0.640 0.004
#> ERR863718 1 0.3123 0.8399 0.844 0.000 0.000 0.156
#> ERR863717 1 0.1389 0.8586 0.952 0.000 0.000 0.048
#> ERR863715 2 0.3401 0.8162 0.008 0.840 0.000 0.152
#> ERR863716 1 0.1637 0.8462 0.940 0.000 0.000 0.060
#> ERR863722 4 0.6320 0.6181 0.000 0.140 0.204 0.656
#> ERR863721 4 0.3763 0.7129 0.024 0.144 0.000 0.832
#> ERR863720 2 0.0188 0.9034 0.000 0.996 0.000 0.004
#> ERR863723 1 0.2179 0.8401 0.924 0.000 0.012 0.064
#> ERR863761 3 0.0188 0.9109 0.000 0.004 0.996 0.000
#> ERR863735 1 0.3074 0.8416 0.848 0.000 0.000 0.152
#> ERR863734 3 0.0000 0.9106 0.000 0.000 1.000 0.000
#> ERR863736 2 0.4901 0.7741 0.012 0.784 0.048 0.156
#> ERR863729 2 0.3910 0.7990 0.024 0.820 0.000 0.156
#> ERR863728 1 0.5859 0.1632 0.504 0.024 0.004 0.468
#> ERR863731 1 0.3123 0.8399 0.844 0.000 0.000 0.156
#> ERR863764 4 0.5013 0.6679 0.000 0.292 0.020 0.688
#> ERR863740 1 0.1837 0.8495 0.944 0.000 0.028 0.028
#> ERR863765 3 0.0000 0.9106 0.000 0.000 1.000 0.000
#> ERR863762 3 0.0376 0.9104 0.000 0.004 0.992 0.004
#> ERR863724 3 0.0524 0.9056 0.004 0.000 0.988 0.008
#> ERR863733 4 0.4868 0.6624 0.000 0.304 0.012 0.684
#> ERR863732 3 0.0524 0.9090 0.000 0.004 0.988 0.008
#> ERR863730 1 0.1733 0.8507 0.948 0.000 0.028 0.024
#> ERR863742 1 0.1118 0.8540 0.964 0.000 0.036 0.000
#> ERR863763 4 0.4277 0.6825 0.000 0.280 0.000 0.720
#> ERR863741 2 0.6371 0.3299 0.064 0.508 0.000 0.428
#> ERR863743 1 0.3123 0.8399 0.844 0.000 0.000 0.156
#> ERR863745 2 0.0188 0.9034 0.000 0.996 0.000 0.004
#> ERR863744 1 0.0927 0.8601 0.976 0.000 0.008 0.016
#> ERR863746 1 0.0657 0.8599 0.984 0.000 0.004 0.012
#> ERR863748 4 0.5881 0.2111 0.000 0.036 0.420 0.544
#> ERR863747 3 0.4677 0.5947 0.000 0.316 0.680 0.004
#> ERR863694 4 0.3873 0.6550 0.000 0.228 0.000 0.772
#> ERR863693 4 0.3970 0.7068 0.084 0.076 0.000 0.840
#> ERR863686 1 0.3632 0.7730 0.832 0.004 0.008 0.156
#> ERR863678 4 0.8218 0.0207 0.372 0.020 0.208 0.400
#> ERR863685 3 0.0000 0.9106 0.000 0.000 1.000 0.000
#> ERR863689 4 0.4920 0.2877 0.368 0.004 0.000 0.628
#> ERR863691 4 0.3711 0.6887 0.140 0.024 0.000 0.836
#> ERR863682 1 0.2011 0.8359 0.920 0.000 0.000 0.080
#> ERR863695 2 0.0188 0.9034 0.000 0.996 0.000 0.004
#> ERR863683 1 0.1151 0.8569 0.968 0.000 0.024 0.008
#> ERR863684 4 0.2480 0.7102 0.008 0.088 0.000 0.904
#> ERR863702 1 0.3760 0.7708 0.828 0.004 0.012 0.156
#> ERR863687 3 0.4655 0.6019 0.000 0.312 0.684 0.004
#> ERR863706 3 0.0000 0.9106 0.000 0.000 1.000 0.000
#> ERR863708 2 0.0188 0.9034 0.000 0.996 0.000 0.004
#> ERR863710 1 0.3123 0.8399 0.844 0.000 0.000 0.156
#> ERR863709 2 0.0469 0.8972 0.000 0.988 0.000 0.012
#> ERR863753 2 0.0188 0.9034 0.000 0.996 0.000 0.004
#> ERR863754 4 0.3710 0.6434 0.192 0.004 0.000 0.804
#> ERR863749 1 0.3074 0.8416 0.848 0.000 0.000 0.152
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> ERR863675 4 0.1608 0.855 0.000 0.072 0.000 0.928 0.000
#> ERR863705 3 0.0290 0.866 0.000 0.000 0.992 0.008 0.000
#> ERR863704 2 0.0000 0.917 0.000 1.000 0.000 0.000 0.000
#> ERR863679 3 0.0290 0.866 0.000 0.000 0.992 0.008 0.000
#> ERR863680 2 0.0162 0.917 0.000 0.996 0.000 0.004 0.000
#> ERR863676 2 0.0162 0.917 0.000 0.996 0.000 0.004 0.000
#> ERR863677 4 0.1638 0.858 0.004 0.064 0.000 0.932 0.000
#> ERR863688 5 0.2536 0.814 0.052 0.004 0.000 0.044 0.900
#> ERR863690 1 0.0671 0.910 0.980 0.000 0.000 0.004 0.016
#> ERR863692 4 0.4562 0.574 0.292 0.000 0.000 0.676 0.032
#> ERR863703 1 0.0703 0.913 0.976 0.000 0.000 0.000 0.024
#> ERR863712 4 0.1697 0.859 0.008 0.060 0.000 0.932 0.000
#> ERR863711 1 0.1544 0.885 0.932 0.000 0.000 0.000 0.068
#> ERR863760 2 0.2074 0.888 0.000 0.920 0.000 0.044 0.036
#> ERR863727 5 0.2674 0.871 0.140 0.000 0.004 0.000 0.856
#> ERR863766 3 0.1270 0.870 0.000 0.000 0.948 0.000 0.052
#> ERR863767 1 0.1965 0.857 0.904 0.000 0.000 0.000 0.096
#> ERR863752 2 0.0566 0.912 0.000 0.984 0.004 0.012 0.000
#> ERR863757 5 0.2536 0.789 0.044 0.004 0.000 0.052 0.900
#> ERR863758 1 0.0703 0.914 0.976 0.000 0.000 0.000 0.024
#> ERR863755 5 0.3752 0.771 0.292 0.000 0.000 0.000 0.708
#> ERR863756 3 0.2929 0.709 0.000 0.000 0.820 0.180 0.000
#> ERR863707 3 0.0290 0.866 0.000 0.000 0.992 0.008 0.000
#> ERR863681 3 0.2575 0.849 0.000 0.004 0.884 0.012 0.100
#> ERR863719 4 0.2389 0.792 0.000 0.000 0.004 0.880 0.116
#> ERR863759 3 0.4517 0.301 0.000 0.436 0.556 0.008 0.000
#> ERR863718 1 0.0703 0.914 0.976 0.000 0.000 0.000 0.024
#> ERR863717 5 0.3661 0.794 0.276 0.000 0.000 0.000 0.724
#> ERR863715 2 0.3427 0.845 0.000 0.836 0.000 0.056 0.108
#> ERR863716 5 0.3388 0.857 0.200 0.000 0.000 0.008 0.792
#> ERR863722 4 0.4271 0.746 0.008 0.044 0.180 0.768 0.000
#> ERR863721 4 0.2032 0.851 0.052 0.020 0.000 0.924 0.004
#> ERR863720 2 0.0290 0.916 0.000 0.992 0.000 0.008 0.000
#> ERR863723 5 0.2852 0.870 0.172 0.000 0.000 0.000 0.828
#> ERR863761 3 0.1270 0.870 0.000 0.000 0.948 0.000 0.052
#> ERR863735 1 0.0963 0.909 0.964 0.000 0.000 0.000 0.036
#> ERR863734 3 0.1270 0.870 0.000 0.000 0.948 0.000 0.052
#> ERR863736 2 0.4030 0.832 0.000 0.808 0.012 0.060 0.120
#> ERR863729 2 0.3911 0.820 0.000 0.796 0.000 0.060 0.144
#> ERR863728 1 0.2518 0.849 0.896 0.000 0.008 0.080 0.016
#> ERR863731 1 0.0609 0.914 0.980 0.000 0.000 0.000 0.020
#> ERR863764 4 0.3457 0.832 0.008 0.064 0.080 0.848 0.000
#> ERR863740 5 0.2969 0.867 0.128 0.000 0.020 0.000 0.852
#> ERR863765 3 0.1908 0.856 0.000 0.000 0.908 0.000 0.092
#> ERR863762 3 0.0290 0.866 0.000 0.000 0.992 0.008 0.000
#> ERR863724 3 0.2563 0.842 0.000 0.000 0.872 0.008 0.120
#> ERR863733 4 0.3441 0.831 0.008 0.088 0.056 0.848 0.000
#> ERR863732 3 0.0404 0.865 0.000 0.000 0.988 0.012 0.000
#> ERR863730 5 0.2969 0.869 0.128 0.000 0.020 0.000 0.852
#> ERR863742 5 0.3399 0.862 0.168 0.000 0.020 0.000 0.812
#> ERR863763 4 0.1571 0.859 0.004 0.060 0.000 0.936 0.000
#> ERR863741 2 0.7670 0.374 0.088 0.468 0.000 0.248 0.196
#> ERR863743 1 0.0703 0.914 0.976 0.000 0.000 0.000 0.024
#> ERR863745 2 0.0162 0.917 0.000 0.996 0.000 0.004 0.000
#> ERR863744 5 0.3741 0.804 0.264 0.000 0.004 0.000 0.732
#> ERR863746 5 0.3010 0.867 0.172 0.000 0.004 0.000 0.824
#> ERR863748 4 0.4735 0.418 0.008 0.012 0.372 0.608 0.000
#> ERR863747 3 0.4415 0.422 0.000 0.388 0.604 0.008 0.000
#> ERR863694 4 0.1800 0.837 0.000 0.020 0.000 0.932 0.048
#> ERR863693 4 0.2011 0.832 0.088 0.000 0.000 0.908 0.004
#> ERR863686 5 0.2451 0.802 0.036 0.004 0.000 0.056 0.904
#> ERR863678 1 0.2338 0.859 0.916 0.000 0.036 0.032 0.016
#> ERR863685 3 0.1270 0.870 0.000 0.000 0.948 0.000 0.052
#> ERR863689 1 0.4295 0.661 0.740 0.000 0.000 0.216 0.044
#> ERR863691 4 0.4503 0.550 0.312 0.000 0.000 0.664 0.024
#> ERR863682 5 0.4885 0.583 0.400 0.000 0.000 0.028 0.572
#> ERR863695 2 0.0162 0.917 0.000 0.996 0.000 0.004 0.000
#> ERR863683 5 0.3236 0.869 0.152 0.000 0.020 0.000 0.828
#> ERR863684 4 0.1356 0.855 0.028 0.012 0.000 0.956 0.004
#> ERR863702 5 0.2451 0.803 0.036 0.004 0.000 0.056 0.904
#> ERR863687 3 0.4165 0.545 0.000 0.320 0.672 0.008 0.000
#> ERR863706 3 0.1792 0.860 0.000 0.000 0.916 0.000 0.084
#> ERR863708 2 0.0162 0.917 0.000 0.996 0.000 0.004 0.000
#> ERR863710 1 0.0609 0.914 0.980 0.000 0.000 0.000 0.020
#> ERR863709 2 0.1544 0.874 0.000 0.932 0.000 0.068 0.000
#> ERR863753 2 0.0162 0.917 0.000 0.996 0.000 0.004 0.000
#> ERR863754 1 0.3928 0.541 0.700 0.000 0.000 0.296 0.004
#> ERR863749 1 0.0880 0.911 0.968 0.000 0.000 0.000 0.032
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> ERR863675 4 0.2240 0.7574 0.008 0.032 0.000 0.904 0.056 0.000
#> ERR863705 3 0.0146 0.6754 0.000 0.000 0.996 0.000 0.004 0.000
#> ERR863704 2 0.0146 0.8740 0.000 0.996 0.000 0.000 0.004 0.000
#> ERR863679 3 0.0146 0.6754 0.000 0.000 0.996 0.000 0.004 0.000
#> ERR863680 2 0.0363 0.8727 0.000 0.988 0.000 0.000 0.012 0.000
#> ERR863676 2 0.0000 0.8743 0.000 1.000 0.000 0.000 0.000 0.000
#> ERR863677 4 0.0603 0.7761 0.000 0.016 0.000 0.980 0.004 0.000
#> ERR863688 1 0.3820 0.4043 0.660 0.000 0.000 0.004 0.332 0.004
#> ERR863690 6 0.1693 0.8782 0.020 0.000 0.000 0.004 0.044 0.932
#> ERR863692 4 0.6331 0.3243 0.076 0.000 0.000 0.524 0.108 0.292
#> ERR863703 6 0.1225 0.8840 0.012 0.000 0.000 0.000 0.036 0.952
#> ERR863712 4 0.0603 0.7757 0.000 0.016 0.000 0.980 0.004 0.000
#> ERR863711 6 0.1524 0.8746 0.060 0.000 0.000 0.000 0.008 0.932
#> ERR863760 2 0.2948 0.6612 0.000 0.804 0.000 0.008 0.188 0.000
#> ERR863727 1 0.0458 0.7205 0.984 0.000 0.000 0.000 0.000 0.016
#> ERR863766 3 0.4843 0.6336 0.068 0.000 0.636 0.008 0.288 0.000
#> ERR863767 6 0.2135 0.8186 0.128 0.000 0.000 0.000 0.000 0.872
#> ERR863752 2 0.0748 0.8541 0.000 0.976 0.016 0.004 0.004 0.000
#> ERR863757 5 0.4437 -0.2937 0.436 0.000 0.000 0.004 0.540 0.020
#> ERR863758 6 0.0806 0.8935 0.020 0.000 0.000 0.000 0.008 0.972
#> ERR863755 1 0.4863 0.5478 0.656 0.000 0.000 0.004 0.100 0.240
#> ERR863756 3 0.1890 0.6443 0.000 0.000 0.916 0.060 0.024 0.000
#> ERR863707 3 0.0146 0.6752 0.000 0.000 0.996 0.000 0.004 0.000
#> ERR863681 3 0.4785 0.5528 0.024 0.004 0.512 0.004 0.452 0.004
#> ERR863719 4 0.3470 0.6381 0.028 0.000 0.000 0.772 0.200 0.000
#> ERR863759 3 0.3996 0.2881 0.000 0.388 0.604 0.004 0.004 0.000
#> ERR863718 6 0.0806 0.8935 0.020 0.000 0.000 0.000 0.008 0.972
#> ERR863717 1 0.3203 0.6629 0.812 0.000 0.000 0.004 0.024 0.160
#> ERR863715 2 0.3972 0.3194 0.012 0.664 0.000 0.004 0.320 0.000
#> ERR863716 1 0.3822 0.6699 0.776 0.000 0.000 0.000 0.096 0.128
#> ERR863722 3 0.7004 -0.2267 0.008 0.064 0.412 0.384 0.120 0.012
#> ERR863721 4 0.0984 0.7748 0.000 0.012 0.000 0.968 0.012 0.008
#> ERR863720 2 0.0405 0.8716 0.000 0.988 0.000 0.004 0.008 0.000
#> ERR863723 1 0.2956 0.7038 0.848 0.000 0.000 0.000 0.064 0.088
#> ERR863761 3 0.4631 0.6405 0.052 0.000 0.652 0.008 0.288 0.000
#> ERR863735 6 0.0806 0.8927 0.020 0.000 0.000 0.000 0.008 0.972
#> ERR863734 3 0.4740 0.6376 0.060 0.000 0.644 0.008 0.288 0.000
#> ERR863736 2 0.4661 -0.0260 0.008 0.556 0.016 0.008 0.412 0.000
#> ERR863729 5 0.4463 0.0223 0.020 0.468 0.000 0.004 0.508 0.000
#> ERR863728 6 0.1881 0.8683 0.004 0.000 0.004 0.016 0.052 0.924
#> ERR863731 6 0.0717 0.8931 0.016 0.000 0.000 0.000 0.008 0.976
#> ERR863764 4 0.6433 0.3787 0.008 0.052 0.324 0.512 0.100 0.004
#> ERR863740 1 0.1391 0.7148 0.944 0.000 0.000 0.000 0.040 0.016
#> ERR863765 3 0.5264 0.6083 0.100 0.000 0.588 0.008 0.304 0.000
#> ERR863762 3 0.0146 0.6737 0.000 0.000 0.996 0.004 0.000 0.000
#> ERR863724 3 0.4891 0.5568 0.040 0.000 0.516 0.004 0.436 0.004
#> ERR863733 4 0.6275 0.4087 0.004 0.084 0.292 0.540 0.080 0.000
#> ERR863732 3 0.0508 0.6725 0.000 0.000 0.984 0.004 0.012 0.000
#> ERR863730 1 0.0820 0.7201 0.972 0.000 0.000 0.000 0.012 0.016
#> ERR863742 1 0.3976 0.5780 0.764 0.000 0.004 0.008 0.180 0.044
#> ERR863763 4 0.1457 0.7731 0.004 0.016 0.000 0.948 0.028 0.004
#> ERR863741 5 0.6171 0.4056 0.048 0.256 0.000 0.108 0.576 0.012
#> ERR863743 6 0.0692 0.8932 0.020 0.000 0.000 0.000 0.004 0.976
#> ERR863745 2 0.0260 0.8723 0.000 0.992 0.000 0.000 0.008 0.000
#> ERR863744 1 0.2257 0.7019 0.876 0.000 0.000 0.000 0.008 0.116
#> ERR863746 1 0.1010 0.7246 0.960 0.000 0.000 0.000 0.004 0.036
#> ERR863748 3 0.6070 0.1124 0.008 0.036 0.544 0.308 0.104 0.000
#> ERR863747 3 0.3969 0.3883 0.000 0.344 0.644 0.004 0.008 0.000
#> ERR863694 4 0.2791 0.7290 0.008 0.016 0.000 0.852 0.124 0.000
#> ERR863693 4 0.1562 0.7627 0.004 0.000 0.000 0.940 0.032 0.024
#> ERR863686 1 0.4172 0.2160 0.564 0.000 0.000 0.004 0.424 0.008
#> ERR863678 6 0.2619 0.8360 0.008 0.000 0.032 0.004 0.072 0.884
#> ERR863685 3 0.4686 0.6389 0.056 0.000 0.648 0.008 0.288 0.000
#> ERR863689 6 0.5966 0.4745 0.084 0.000 0.000 0.240 0.084 0.592
#> ERR863691 4 0.6159 0.2787 0.048 0.000 0.000 0.512 0.116 0.324
#> ERR863682 1 0.5974 0.2530 0.424 0.000 0.000 0.004 0.192 0.380
#> ERR863695 2 0.0260 0.8736 0.000 0.992 0.000 0.000 0.008 0.000
#> ERR863683 1 0.1498 0.7194 0.940 0.000 0.000 0.000 0.032 0.028
#> ERR863684 4 0.1332 0.7718 0.000 0.008 0.000 0.952 0.028 0.012
#> ERR863702 1 0.4144 0.2471 0.580 0.000 0.000 0.004 0.408 0.008
#> ERR863687 3 0.3240 0.5137 0.000 0.244 0.752 0.000 0.004 0.000
#> ERR863706 3 0.5197 0.6114 0.092 0.000 0.592 0.008 0.308 0.000
#> ERR863708 2 0.0000 0.8743 0.000 1.000 0.000 0.000 0.000 0.000
#> ERR863710 6 0.0806 0.8935 0.020 0.000 0.000 0.000 0.008 0.972
#> ERR863709 2 0.1644 0.8229 0.000 0.932 0.000 0.040 0.028 0.000
#> ERR863753 2 0.0000 0.8743 0.000 1.000 0.000 0.000 0.000 0.000
#> ERR863754 6 0.5271 0.1975 0.004 0.000 0.000 0.392 0.088 0.516
#> ERR863749 6 0.1151 0.8882 0.032 0.000 0.000 0.000 0.012 0.956
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)
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 17118 rows and 78 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.411 0.576 0.809 0.4182 0.670 0.670
#> 3 3 0.828 0.869 0.939 0.4333 0.687 0.545
#> 4 4 0.701 0.641 0.816 0.1939 0.780 0.505
#> 5 5 0.743 0.613 0.812 0.0735 0.927 0.748
#> 6 6 0.823 0.825 0.910 0.0416 0.888 0.581
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
#> ERR863675 1 0.0376 0.35328 0.996 0.004
#> ERR863705 2 0.9996 0.68726 0.488 0.512
#> ERR863704 1 0.0000 0.34941 1.000 0.000
#> ERR863679 2 0.9996 0.68726 0.488 0.512
#> ERR863680 1 0.0000 0.34941 1.000 0.000
#> ERR863676 1 0.0000 0.34941 1.000 0.000
#> ERR863677 1 0.9170 0.63866 0.668 0.332
#> ERR863688 1 0.9996 0.73649 0.512 0.488
#> ERR863690 1 0.9996 0.73649 0.512 0.488
#> ERR863692 1 0.9996 0.73649 0.512 0.488
#> ERR863703 1 0.9996 0.73649 0.512 0.488
#> ERR863712 1 0.8386 0.58637 0.732 0.268
#> ERR863711 1 0.9996 0.73649 0.512 0.488
#> ERR863760 1 0.1633 0.37057 0.976 0.024
#> ERR863727 1 0.9996 0.73649 0.512 0.488
#> ERR863766 2 0.2948 0.50173 0.052 0.948
#> ERR863767 1 0.9996 0.73649 0.512 0.488
#> ERR863752 2 0.9996 0.68726 0.488 0.512
#> ERR863757 1 0.9996 0.73649 0.512 0.488
#> ERR863758 1 0.9996 0.73649 0.512 0.488
#> ERR863755 1 0.9996 0.73649 0.512 0.488
#> ERR863756 2 0.2948 0.50173 0.052 0.948
#> ERR863707 2 0.9996 0.68726 0.488 0.512
#> ERR863681 1 0.9754 0.52546 0.592 0.408
#> ERR863719 1 0.9954 0.72190 0.540 0.460
#> ERR863759 2 0.9996 0.68726 0.488 0.512
#> ERR863718 1 0.9996 0.73649 0.512 0.488
#> ERR863717 1 0.9996 0.73649 0.512 0.488
#> ERR863715 1 0.0376 0.34317 0.996 0.004
#> ERR863716 1 0.9996 0.73649 0.512 0.488
#> ERR863722 1 0.5408 0.09605 0.876 0.124
#> ERR863721 1 0.9881 0.70673 0.564 0.436
#> ERR863720 1 0.0000 0.34941 1.000 0.000
#> ERR863723 1 0.9996 0.73649 0.512 0.488
#> ERR863761 2 0.9491 0.67088 0.368 0.632
#> ERR863735 1 0.9996 0.73649 0.512 0.488
#> ERR863734 2 0.2948 0.50173 0.052 0.948
#> ERR863736 1 0.5294 0.10595 0.880 0.120
#> ERR863729 1 0.0000 0.34941 1.000 0.000
#> ERR863728 1 0.9996 0.73649 0.512 0.488
#> ERR863731 1 0.9996 0.73649 0.512 0.488
#> ERR863764 1 0.5408 0.09605 0.876 0.124
#> ERR863740 1 0.9996 0.73649 0.512 0.488
#> ERR863765 2 0.1184 0.45108 0.016 0.984
#> ERR863762 2 0.6048 0.58836 0.148 0.852
#> ERR863724 1 0.9996 0.73649 0.512 0.488
#> ERR863733 1 0.5408 0.09605 0.876 0.124
#> ERR863732 2 0.7950 0.64274 0.240 0.760
#> ERR863730 1 0.9996 0.73649 0.512 0.488
#> ERR863742 1 0.9996 0.73649 0.512 0.488
#> ERR863763 1 0.0000 0.34941 1.000 0.000
#> ERR863741 1 0.9996 0.73649 0.512 0.488
#> ERR863743 1 0.9996 0.73649 0.512 0.488
#> ERR863745 1 0.5408 0.09605 0.876 0.124
#> ERR863744 1 0.9996 0.73649 0.512 0.488
#> ERR863746 1 0.9996 0.73649 0.512 0.488
#> ERR863748 1 0.6247 -0.00719 0.844 0.156
#> ERR863747 2 0.9996 0.68726 0.488 0.512
#> ERR863694 1 0.0000 0.34941 1.000 0.000
#> ERR863693 1 0.9977 0.72855 0.528 0.472
#> ERR863686 1 0.9996 0.73649 0.512 0.488
#> ERR863678 1 0.9881 0.70673 0.564 0.436
#> ERR863685 2 0.7376 0.62925 0.208 0.792
#> ERR863689 1 0.9996 0.73649 0.512 0.488
#> ERR863691 1 0.9993 0.73466 0.516 0.484
#> ERR863682 1 0.9996 0.73649 0.512 0.488
#> ERR863695 1 0.5408 0.09605 0.876 0.124
#> ERR863683 1 0.9996 0.73649 0.512 0.488
#> ERR863684 1 0.9922 0.71461 0.552 0.448
#> ERR863702 1 0.9996 0.73649 0.512 0.488
#> ERR863687 2 0.9996 0.68726 0.488 0.512
#> ERR863706 2 0.0000 0.42495 0.000 1.000
#> ERR863708 1 0.5408 0.09605 0.876 0.124
#> ERR863710 1 0.9996 0.73649 0.512 0.488
#> ERR863709 1 0.0000 0.34941 1.000 0.000
#> ERR863753 1 0.1843 0.30154 0.972 0.028
#> ERR863754 1 0.9996 0.73649 0.512 0.488
#> ERR863749 1 0.9996 0.73649 0.512 0.488
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> ERR863675 2 0.5650 0.6130 0.312 0.688 0.000
#> ERR863705 3 0.0000 0.9620 0.000 0.000 1.000
#> ERR863704 2 0.0592 0.7993 0.012 0.988 0.000
#> ERR863679 3 0.0000 0.9620 0.000 0.000 1.000
#> ERR863680 2 0.0237 0.8078 0.004 0.996 0.000
#> ERR863676 2 0.0237 0.8078 0.004 0.996 0.000
#> ERR863677 1 0.5291 0.6258 0.732 0.268 0.000
#> ERR863688 1 0.0237 0.9700 0.996 0.004 0.000
#> ERR863690 1 0.0592 0.9732 0.988 0.012 0.000
#> ERR863692 1 0.0592 0.9732 0.988 0.012 0.000
#> ERR863703 1 0.0592 0.9732 0.988 0.012 0.000
#> ERR863712 1 0.4974 0.6657 0.764 0.236 0.000
#> ERR863711 1 0.0000 0.9711 1.000 0.000 0.000
#> ERR863760 2 0.5785 0.5900 0.332 0.668 0.000
#> ERR863727 1 0.0237 0.9700 0.996 0.004 0.000
#> ERR863766 3 0.0000 0.9620 0.000 0.000 1.000
#> ERR863767 1 0.0592 0.9732 0.988 0.012 0.000
#> ERR863752 2 0.0747 0.7966 0.000 0.984 0.016
#> ERR863757 1 0.0237 0.9700 0.996 0.004 0.000
#> ERR863758 1 0.0592 0.9732 0.988 0.012 0.000
#> ERR863755 1 0.0237 0.9700 0.996 0.004 0.000
#> ERR863756 3 0.0000 0.9620 0.000 0.000 1.000
#> ERR863707 3 0.0000 0.9620 0.000 0.000 1.000
#> ERR863681 1 0.6490 0.6627 0.752 0.172 0.076
#> ERR863719 1 0.0237 0.9700 0.996 0.004 0.000
#> ERR863759 3 0.0592 0.9497 0.000 0.012 0.988
#> ERR863718 1 0.0592 0.9732 0.988 0.012 0.000
#> ERR863717 1 0.0237 0.9719 0.996 0.004 0.000
#> ERR863715 2 0.0592 0.7993 0.012 0.988 0.000
#> ERR863716 1 0.0237 0.9700 0.996 0.004 0.000
#> ERR863722 2 0.6513 0.1567 0.004 0.520 0.476
#> ERR863721 1 0.0592 0.9732 0.988 0.012 0.000
#> ERR863720 2 0.0237 0.8078 0.004 0.996 0.000
#> ERR863723 1 0.0237 0.9700 0.996 0.004 0.000
#> ERR863761 3 0.0000 0.9620 0.000 0.000 1.000
#> ERR863735 1 0.0592 0.9732 0.988 0.012 0.000
#> ERR863734 3 0.0000 0.9620 0.000 0.000 1.000
#> ERR863736 2 0.7022 0.5936 0.056 0.684 0.260
#> ERR863729 2 0.5678 0.6248 0.316 0.684 0.000
#> ERR863728 1 0.0592 0.9732 0.988 0.012 0.000
#> ERR863731 1 0.0592 0.9732 0.988 0.012 0.000
#> ERR863764 3 0.6460 0.0428 0.004 0.440 0.556
#> ERR863740 1 0.0592 0.9732 0.988 0.012 0.000
#> ERR863765 3 0.0000 0.9620 0.000 0.000 1.000
#> ERR863762 3 0.0000 0.9620 0.000 0.000 1.000
#> ERR863724 1 0.0592 0.9732 0.988 0.012 0.000
#> ERR863733 2 0.0237 0.8078 0.004 0.996 0.000
#> ERR863732 3 0.0000 0.9620 0.000 0.000 1.000
#> ERR863730 1 0.0237 0.9700 0.996 0.004 0.000
#> ERR863742 1 0.0592 0.9732 0.988 0.012 0.000
#> ERR863763 2 0.5560 0.6364 0.300 0.700 0.000
#> ERR863741 1 0.0237 0.9700 0.996 0.004 0.000
#> ERR863743 1 0.0592 0.9732 0.988 0.012 0.000
#> ERR863745 2 0.0237 0.8078 0.004 0.996 0.000
#> ERR863744 1 0.0592 0.9732 0.988 0.012 0.000
#> ERR863746 1 0.0000 0.9711 1.000 0.000 0.000
#> ERR863748 2 0.6298 0.4126 0.004 0.608 0.388
#> ERR863747 3 0.0000 0.9620 0.000 0.000 1.000
#> ERR863694 2 0.5621 0.6250 0.308 0.692 0.000
#> ERR863693 1 0.0592 0.9732 0.988 0.012 0.000
#> ERR863686 1 0.0237 0.9700 0.996 0.004 0.000
#> ERR863678 1 0.0592 0.9732 0.988 0.012 0.000
#> ERR863685 3 0.0000 0.9620 0.000 0.000 1.000
#> ERR863689 1 0.0592 0.9732 0.988 0.012 0.000
#> ERR863691 1 0.0592 0.9732 0.988 0.012 0.000
#> ERR863682 1 0.0237 0.9700 0.996 0.004 0.000
#> ERR863695 2 0.0237 0.8078 0.004 0.996 0.000
#> ERR863683 1 0.0237 0.9700 0.996 0.004 0.000
#> ERR863684 1 0.0237 0.9700 0.996 0.004 0.000
#> ERR863702 1 0.0237 0.9700 0.996 0.004 0.000
#> ERR863687 2 0.5835 0.5004 0.000 0.660 0.340
#> ERR863706 3 0.0000 0.9620 0.000 0.000 1.000
#> ERR863708 2 0.0237 0.8078 0.004 0.996 0.000
#> ERR863710 1 0.0592 0.9732 0.988 0.012 0.000
#> ERR863709 2 0.0237 0.8078 0.004 0.996 0.000
#> ERR863753 2 0.0237 0.8078 0.004 0.996 0.000
#> ERR863754 1 0.0592 0.9732 0.988 0.012 0.000
#> ERR863749 1 0.0592 0.9732 0.988 0.012 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> ERR863675 4 0.2542 0.53552 0.012 0.084 0.000 0.904
#> ERR863705 3 0.0188 0.95255 0.000 0.000 0.996 0.004
#> ERR863704 2 0.0000 0.97692 0.000 1.000 0.000 0.000
#> ERR863679 3 0.0000 0.95360 0.000 0.000 1.000 0.000
#> ERR863680 2 0.0000 0.97692 0.000 1.000 0.000 0.000
#> ERR863676 2 0.0000 0.97692 0.000 1.000 0.000 0.000
#> ERR863677 4 0.7370 -0.00627 0.412 0.160 0.000 0.428
#> ERR863688 1 0.0336 0.78749 0.992 0.000 0.000 0.008
#> ERR863690 1 0.0921 0.78178 0.972 0.000 0.000 0.028
#> ERR863692 1 0.0188 0.78906 0.996 0.000 0.000 0.004
#> ERR863703 1 0.1302 0.76671 0.956 0.000 0.000 0.044
#> ERR863712 4 0.3749 0.53527 0.128 0.032 0.000 0.840
#> ERR863711 1 0.0921 0.78091 0.972 0.000 0.000 0.028
#> ERR863760 1 0.7640 0.03173 0.456 0.228 0.000 0.316
#> ERR863727 1 0.0188 0.78906 0.996 0.000 0.000 0.004
#> ERR863766 3 0.0000 0.95360 0.000 0.000 1.000 0.000
#> ERR863767 4 0.4941 0.34198 0.436 0.000 0.000 0.564
#> ERR863752 2 0.0000 0.97692 0.000 1.000 0.000 0.000
#> ERR863757 1 0.1902 0.75459 0.932 0.000 0.004 0.064
#> ERR863758 4 0.4941 0.34198 0.436 0.000 0.000 0.564
#> ERR863755 1 0.0336 0.78749 0.992 0.000 0.000 0.008
#> ERR863756 3 0.1867 0.92017 0.000 0.000 0.928 0.072
#> ERR863707 3 0.0000 0.95360 0.000 0.000 1.000 0.000
#> ERR863681 1 0.5423 0.56519 0.756 0.028 0.044 0.172
#> ERR863719 1 0.4877 0.22912 0.592 0.000 0.000 0.408
#> ERR863759 3 0.1867 0.91510 0.000 0.072 0.928 0.000
#> ERR863718 4 0.4948 0.33374 0.440 0.000 0.000 0.560
#> ERR863717 1 0.0188 0.78906 0.996 0.000 0.000 0.004
#> ERR863715 2 0.0524 0.96799 0.004 0.988 0.000 0.008
#> ERR863716 1 0.0188 0.78906 0.996 0.000 0.000 0.004
#> ERR863722 4 0.2466 0.54213 0.000 0.056 0.028 0.916
#> ERR863721 4 0.1118 0.57165 0.036 0.000 0.000 0.964
#> ERR863720 2 0.0000 0.97692 0.000 1.000 0.000 0.000
#> ERR863723 1 0.0000 0.78908 1.000 0.000 0.000 0.000
#> ERR863761 3 0.0000 0.95360 0.000 0.000 1.000 0.000
#> ERR863735 4 0.4941 0.34198 0.436 0.000 0.000 0.564
#> ERR863734 3 0.0000 0.95360 0.000 0.000 1.000 0.000
#> ERR863736 4 0.7326 0.37919 0.008 0.164 0.272 0.556
#> ERR863729 4 0.7249 0.36679 0.260 0.200 0.000 0.540
#> ERR863728 1 0.5000 -0.27809 0.504 0.000 0.000 0.496
#> ERR863731 4 0.4941 0.34198 0.436 0.000 0.000 0.564
#> ERR863764 4 0.2761 0.53864 0.000 0.048 0.048 0.904
#> ERR863740 4 0.5000 0.23588 0.496 0.000 0.000 0.504
#> ERR863765 3 0.0000 0.95360 0.000 0.000 1.000 0.000
#> ERR863762 3 0.1867 0.92017 0.000 0.000 0.928 0.072
#> ERR863724 1 0.1867 0.74015 0.928 0.000 0.000 0.072
#> ERR863733 4 0.4877 -0.05562 0.000 0.408 0.000 0.592
#> ERR863732 3 0.2011 0.91439 0.000 0.000 0.920 0.080
#> ERR863730 1 0.0336 0.78749 0.992 0.000 0.000 0.008
#> ERR863742 4 0.6302 0.38978 0.368 0.000 0.068 0.564
#> ERR863763 4 0.2563 0.54627 0.020 0.072 0.000 0.908
#> ERR863741 1 0.0469 0.78788 0.988 0.000 0.000 0.012
#> ERR863743 1 0.3266 0.65119 0.832 0.000 0.000 0.168
#> ERR863745 2 0.0188 0.97474 0.000 0.996 0.000 0.004
#> ERR863744 1 0.4817 0.05435 0.612 0.000 0.000 0.388
#> ERR863746 1 0.0188 0.78906 0.996 0.000 0.000 0.004
#> ERR863748 4 0.6845 0.27104 0.000 0.128 0.308 0.564
#> ERR863747 3 0.1867 0.91510 0.000 0.072 0.928 0.000
#> ERR863694 4 0.2101 0.55115 0.012 0.060 0.000 0.928
#> ERR863693 1 0.4790 0.26412 0.620 0.000 0.000 0.380
#> ERR863686 1 0.0336 0.78749 0.992 0.000 0.000 0.008
#> ERR863678 4 0.4746 0.40967 0.368 0.000 0.000 0.632
#> ERR863685 3 0.0000 0.95360 0.000 0.000 1.000 0.000
#> ERR863689 1 0.4955 -0.14197 0.556 0.000 0.000 0.444
#> ERR863691 1 0.4998 -0.26169 0.512 0.000 0.000 0.488
#> ERR863682 1 0.1637 0.75744 0.940 0.000 0.000 0.060
#> ERR863695 2 0.0707 0.95903 0.000 0.980 0.000 0.020
#> ERR863683 1 0.0188 0.78856 0.996 0.000 0.000 0.004
#> ERR863684 1 0.4877 0.22595 0.592 0.000 0.000 0.408
#> ERR863702 1 0.0336 0.78749 0.992 0.000 0.000 0.008
#> ERR863687 3 0.5288 0.68908 0.000 0.200 0.732 0.068
#> ERR863706 3 0.0000 0.95360 0.000 0.000 1.000 0.000
#> ERR863708 2 0.0000 0.97692 0.000 1.000 0.000 0.000
#> ERR863710 4 0.4941 0.34198 0.436 0.000 0.000 0.564
#> ERR863709 2 0.3400 0.79003 0.000 0.820 0.000 0.180
#> ERR863753 2 0.0000 0.97692 0.000 1.000 0.000 0.000
#> ERR863754 1 0.0336 0.78833 0.992 0.000 0.000 0.008
#> ERR863749 1 0.0336 0.78833 0.992 0.000 0.000 0.008
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> ERR863675 4 0.0404 0.4108 0.000 0.012 0.000 0.988 0.000
#> ERR863705 3 0.0162 0.9572 0.000 0.000 0.996 0.004 0.000
#> ERR863704 2 0.0000 0.9748 0.000 1.000 0.000 0.000 0.000
#> ERR863679 3 0.0000 0.9583 0.000 0.000 1.000 0.000 0.000
#> ERR863680 2 0.0000 0.9748 0.000 1.000 0.000 0.000 0.000
#> ERR863676 2 0.0000 0.9748 0.000 1.000 0.000 0.000 0.000
#> ERR863677 4 0.5996 0.0794 0.368 0.120 0.000 0.512 0.000
#> ERR863688 1 0.0000 0.7914 1.000 0.000 0.000 0.000 0.000
#> ERR863690 1 0.1117 0.7857 0.964 0.000 0.000 0.016 0.020
#> ERR863692 1 0.0404 0.7929 0.988 0.000 0.000 0.012 0.000
#> ERR863703 1 0.1270 0.7708 0.948 0.000 0.000 0.052 0.000
#> ERR863712 4 0.1544 0.4070 0.068 0.000 0.000 0.932 0.000
#> ERR863711 1 0.3663 0.6237 0.776 0.000 0.000 0.016 0.208
#> ERR863760 1 0.6489 0.0284 0.448 0.192 0.000 0.360 0.000
#> ERR863727 1 0.0404 0.7929 0.988 0.000 0.000 0.012 0.000
#> ERR863766 3 0.0000 0.9583 0.000 0.000 1.000 0.000 0.000
#> ERR863767 5 0.4450 0.7519 0.004 0.000 0.000 0.488 0.508
#> ERR863752 2 0.0000 0.9748 0.000 1.000 0.000 0.000 0.000
#> ERR863757 1 0.3242 0.6298 0.784 0.000 0.000 0.000 0.216
#> ERR863758 5 0.4305 0.7574 0.000 0.000 0.000 0.488 0.512
#> ERR863755 1 0.0000 0.7914 1.000 0.000 0.000 0.000 0.000
#> ERR863756 3 0.1478 0.9281 0.000 0.000 0.936 0.064 0.000
#> ERR863707 3 0.0000 0.9583 0.000 0.000 1.000 0.000 0.000
#> ERR863681 5 0.6357 -0.3040 0.392 0.020 0.016 0.060 0.512
#> ERR863719 1 0.4304 0.0926 0.516 0.000 0.000 0.484 0.000
#> ERR863759 3 0.1478 0.9258 0.000 0.064 0.936 0.000 0.000
#> ERR863718 5 0.4449 0.7514 0.004 0.000 0.000 0.484 0.512
#> ERR863717 1 0.0404 0.7929 0.988 0.000 0.000 0.012 0.000
#> ERR863715 2 0.0404 0.9650 0.012 0.988 0.000 0.000 0.000
#> ERR863716 1 0.0404 0.7929 0.988 0.000 0.000 0.012 0.000
#> ERR863722 4 0.0404 0.4117 0.000 0.000 0.012 0.988 0.000
#> ERR863721 4 0.3210 0.0115 0.000 0.000 0.000 0.788 0.212
#> ERR863720 2 0.0000 0.9748 0.000 1.000 0.000 0.000 0.000
#> ERR863723 1 0.0290 0.7929 0.992 0.000 0.000 0.008 0.000
#> ERR863761 3 0.0000 0.9583 0.000 0.000 1.000 0.000 0.000
#> ERR863735 5 0.4305 0.7574 0.000 0.000 0.000 0.488 0.512
#> ERR863734 3 0.0000 0.9583 0.000 0.000 1.000 0.000 0.000
#> ERR863736 4 0.7627 -0.2275 0.012 0.108 0.132 0.532 0.216
#> ERR863729 4 0.6000 0.2775 0.268 0.160 0.000 0.572 0.000
#> ERR863728 4 0.6422 -0.1867 0.316 0.000 0.000 0.488 0.196
#> ERR863731 5 0.4305 0.7574 0.000 0.000 0.000 0.488 0.512
#> ERR863764 4 0.0404 0.4117 0.000 0.000 0.012 0.988 0.000
#> ERR863740 4 0.6466 -0.3542 0.204 0.000 0.000 0.480 0.316
#> ERR863765 3 0.0000 0.9583 0.000 0.000 1.000 0.000 0.000
#> ERR863762 3 0.1478 0.9281 0.000 0.000 0.936 0.064 0.000
#> ERR863724 1 0.4307 0.3318 0.504 0.000 0.000 0.000 0.496
#> ERR863733 4 0.4030 0.2273 0.000 0.352 0.000 0.648 0.000
#> ERR863732 3 0.1608 0.9219 0.000 0.000 0.928 0.072 0.000
#> ERR863730 1 0.0000 0.7914 1.000 0.000 0.000 0.000 0.000
#> ERR863742 5 0.4450 0.7530 0.000 0.000 0.004 0.488 0.508
#> ERR863763 4 0.0000 0.4076 0.000 0.000 0.000 1.000 0.000
#> ERR863741 1 0.0162 0.7917 0.996 0.000 0.000 0.004 0.000
#> ERR863743 1 0.5778 0.2765 0.528 0.000 0.000 0.096 0.376
#> ERR863745 2 0.0000 0.9748 0.000 1.000 0.000 0.000 0.000
#> ERR863744 1 0.4171 0.2457 0.604 0.000 0.000 0.396 0.000
#> ERR863746 1 0.0404 0.7929 0.988 0.000 0.000 0.012 0.000
#> ERR863748 4 0.5644 0.1400 0.000 0.096 0.328 0.576 0.000
#> ERR863747 3 0.1478 0.9258 0.000 0.064 0.936 0.000 0.000
#> ERR863694 4 0.0000 0.4076 0.000 0.000 0.000 1.000 0.000
#> ERR863693 1 0.4210 0.2968 0.588 0.000 0.000 0.412 0.000
#> ERR863686 1 0.0000 0.7914 1.000 0.000 0.000 0.000 0.000
#> ERR863678 4 0.4909 -0.6032 0.028 0.000 0.000 0.560 0.412
#> ERR863685 3 0.0000 0.9583 0.000 0.000 1.000 0.000 0.000
#> ERR863689 1 0.4278 0.0989 0.548 0.000 0.000 0.452 0.000
#> ERR863691 1 0.4307 -0.0291 0.504 0.000 0.000 0.496 0.000
#> ERR863682 1 0.3596 0.6341 0.776 0.000 0.000 0.012 0.212
#> ERR863695 2 0.0609 0.9550 0.000 0.980 0.000 0.020 0.000
#> ERR863683 1 0.0324 0.7926 0.992 0.000 0.000 0.004 0.004
#> ERR863684 4 0.4306 -0.1516 0.492 0.000 0.000 0.508 0.000
#> ERR863702 1 0.0000 0.7914 1.000 0.000 0.000 0.000 0.000
#> ERR863687 3 0.4482 0.7341 0.000 0.160 0.752 0.088 0.000
#> ERR863706 3 0.0000 0.9583 0.000 0.000 1.000 0.000 0.000
#> ERR863708 2 0.0000 0.9748 0.000 1.000 0.000 0.000 0.000
#> ERR863710 5 0.4305 0.7574 0.000 0.000 0.000 0.488 0.512
#> ERR863709 2 0.3074 0.7545 0.000 0.804 0.000 0.196 0.000
#> ERR863753 2 0.0000 0.9748 0.000 1.000 0.000 0.000 0.000
#> ERR863754 1 0.0510 0.7921 0.984 0.000 0.000 0.016 0.000
#> ERR863749 1 0.0510 0.7921 0.984 0.000 0.000 0.016 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> ERR863675 4 0.1765 0.8409 0.000 0.000 0.000 0.904 0.000 0.096
#> ERR863705 3 0.0146 0.9269 0.000 0.000 0.996 0.004 0.000 0.000
#> ERR863704 2 0.0000 0.9632 0.000 1.000 0.000 0.000 0.000 0.000
#> ERR863679 3 0.0000 0.9276 0.000 0.000 1.000 0.000 0.000 0.000
#> ERR863680 2 0.0000 0.9632 0.000 1.000 0.000 0.000 0.000 0.000
#> ERR863676 2 0.0000 0.9632 0.000 1.000 0.000 0.000 0.000 0.000
#> ERR863677 4 0.1984 0.7998 0.056 0.032 0.000 0.912 0.000 0.000
#> ERR863688 1 0.0146 0.9069 0.996 0.000 0.000 0.004 0.000 0.000
#> ERR863690 1 0.1141 0.8999 0.948 0.000 0.000 0.000 0.000 0.052
#> ERR863692 1 0.0713 0.9067 0.972 0.000 0.000 0.000 0.000 0.028
#> ERR863703 1 0.1007 0.9037 0.956 0.000 0.000 0.000 0.000 0.044
#> ERR863712 4 0.1765 0.8409 0.000 0.000 0.000 0.904 0.000 0.096
#> ERR863711 6 0.3899 0.4330 0.404 0.000 0.000 0.004 0.000 0.592
#> ERR863760 4 0.4059 0.6742 0.100 0.148 0.000 0.752 0.000 0.000
#> ERR863727 1 0.0767 0.9082 0.976 0.000 0.000 0.008 0.004 0.012
#> ERR863766 3 0.0000 0.9276 0.000 0.000 1.000 0.000 0.000 0.000
#> ERR863767 6 0.0458 0.7944 0.016 0.000 0.000 0.000 0.000 0.984
#> ERR863752 2 0.0000 0.9632 0.000 1.000 0.000 0.000 0.000 0.000
#> ERR863757 1 0.3636 0.6764 0.764 0.000 0.000 0.012 0.016 0.208
#> ERR863758 6 0.0146 0.7961 0.004 0.000 0.000 0.000 0.000 0.996
#> ERR863755 1 0.0622 0.9065 0.980 0.000 0.000 0.008 0.000 0.012
#> ERR863756 3 0.1327 0.9002 0.000 0.000 0.936 0.064 0.000 0.000
#> ERR863707 3 0.0000 0.9276 0.000 0.000 1.000 0.000 0.000 0.000
#> ERR863681 5 0.0146 1.0000 0.004 0.000 0.000 0.000 0.996 0.000
#> ERR863719 4 0.2178 0.7674 0.132 0.000 0.000 0.868 0.000 0.000
#> ERR863759 3 0.1327 0.8945 0.000 0.064 0.936 0.000 0.000 0.000
#> ERR863718 6 0.0000 0.7966 0.000 0.000 0.000 0.000 0.000 1.000
#> ERR863717 1 0.0622 0.9086 0.980 0.000 0.000 0.008 0.000 0.012
#> ERR863715 2 0.1858 0.8888 0.012 0.912 0.000 0.076 0.000 0.000
#> ERR863716 1 0.0363 0.9088 0.988 0.000 0.000 0.000 0.000 0.012
#> ERR863722 4 0.1957 0.8352 0.000 0.000 0.000 0.888 0.000 0.112
#> ERR863721 4 0.3531 0.6130 0.000 0.000 0.000 0.672 0.000 0.328
#> ERR863720 2 0.0000 0.9632 0.000 1.000 0.000 0.000 0.000 0.000
#> ERR863723 1 0.0508 0.9091 0.984 0.000 0.000 0.000 0.004 0.012
#> ERR863761 3 0.0000 0.9276 0.000 0.000 1.000 0.000 0.000 0.000
#> ERR863735 6 0.0000 0.7966 0.000 0.000 0.000 0.000 0.000 1.000
#> ERR863734 3 0.0000 0.9276 0.000 0.000 1.000 0.000 0.000 0.000
#> ERR863736 6 0.5764 0.5319 0.024 0.104 0.132 0.064 0.000 0.676
#> ERR863729 1 0.6062 -0.0172 0.420 0.156 0.000 0.408 0.000 0.016
#> ERR863728 6 0.4118 0.5483 0.312 0.000 0.000 0.028 0.000 0.660
#> ERR863731 6 0.0000 0.7966 0.000 0.000 0.000 0.000 0.000 1.000
#> ERR863764 4 0.1957 0.8352 0.000 0.000 0.000 0.888 0.000 0.112
#> ERR863740 6 0.3273 0.6618 0.212 0.000 0.000 0.008 0.004 0.776
#> ERR863765 3 0.0508 0.9182 0.012 0.000 0.984 0.000 0.004 0.000
#> ERR863762 3 0.1327 0.9002 0.000 0.000 0.936 0.064 0.000 0.000
#> ERR863724 5 0.0146 1.0000 0.004 0.000 0.000 0.000 0.996 0.000
#> ERR863733 4 0.3062 0.7759 0.000 0.112 0.000 0.836 0.000 0.052
#> ERR863732 3 0.1387 0.8973 0.000 0.000 0.932 0.068 0.000 0.000
#> ERR863730 1 0.0405 0.9068 0.988 0.000 0.000 0.008 0.004 0.000
#> ERR863742 6 0.0912 0.7894 0.012 0.000 0.004 0.008 0.004 0.972
#> ERR863763 4 0.1765 0.8409 0.000 0.000 0.000 0.904 0.000 0.096
#> ERR863741 1 0.2019 0.8639 0.900 0.000 0.000 0.088 0.000 0.012
#> ERR863743 6 0.3428 0.5047 0.304 0.000 0.000 0.000 0.000 0.696
#> ERR863745 2 0.0000 0.9632 0.000 1.000 0.000 0.000 0.000 0.000
#> ERR863744 1 0.2092 0.8254 0.876 0.000 0.000 0.000 0.000 0.124
#> ERR863746 1 0.0622 0.9086 0.980 0.000 0.000 0.008 0.000 0.012
#> ERR863748 3 0.5616 0.5670 0.000 0.092 0.652 0.176 0.000 0.080
#> ERR863747 3 0.1327 0.8945 0.000 0.064 0.936 0.000 0.000 0.000
#> ERR863694 4 0.1765 0.8409 0.000 0.000 0.000 0.904 0.000 0.096
#> ERR863693 4 0.5011 0.3733 0.368 0.000 0.000 0.552 0.000 0.080
#> ERR863686 1 0.0603 0.9060 0.980 0.000 0.000 0.016 0.004 0.000
#> ERR863678 6 0.2009 0.7538 0.024 0.000 0.000 0.068 0.000 0.908
#> ERR863685 3 0.0000 0.9276 0.000 0.000 1.000 0.000 0.000 0.000
#> ERR863689 1 0.2178 0.8248 0.868 0.000 0.000 0.000 0.000 0.132
#> ERR863691 1 0.2473 0.8163 0.856 0.000 0.000 0.008 0.000 0.136
#> ERR863682 1 0.3481 0.6884 0.756 0.000 0.000 0.012 0.004 0.228
#> ERR863695 2 0.0363 0.9507 0.000 0.988 0.000 0.000 0.000 0.012
#> ERR863683 1 0.0964 0.9068 0.968 0.000 0.000 0.016 0.004 0.012
#> ERR863684 4 0.1910 0.7854 0.108 0.000 0.000 0.892 0.000 0.000
#> ERR863702 1 0.0363 0.9059 0.988 0.000 0.000 0.012 0.000 0.000
#> ERR863687 3 0.4085 0.6986 0.000 0.156 0.748 0.096 0.000 0.000
#> ERR863706 3 0.0000 0.9276 0.000 0.000 1.000 0.000 0.000 0.000
#> ERR863708 2 0.0000 0.9632 0.000 1.000 0.000 0.000 0.000 0.000
#> ERR863710 6 0.0000 0.7966 0.000 0.000 0.000 0.000 0.000 1.000
#> ERR863709 2 0.2762 0.7122 0.000 0.804 0.000 0.196 0.000 0.000
#> ERR863753 2 0.0000 0.9632 0.000 1.000 0.000 0.000 0.000 0.000
#> ERR863754 1 0.0891 0.9030 0.968 0.000 0.000 0.024 0.000 0.008
#> ERR863749 1 0.0790 0.9059 0.968 0.000 0.000 0.000 0.000 0.032
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)
An example of the output of tb
is:
#> which_row fdr mean_1 mean_2 scaled_mean_1 scaled_mean_2 km
#> 1 38 0.042760348 8.373488 9.131774 -0.5533452 0.5164555 1
#> 2 40 0.018707592 7.106213 8.469186 -0.6173731 0.5762149 1
#> 3 55 0.019134737 10.221463 11.207825 -0.6159697 0.5749050 1
#> 4 59 0.006059896 5.921854 7.869574 -0.6899429 0.6439467 1
#> 5 60 0.018055526 8.928898 10.211722 -0.6204761 0.5791110 1
#> 6 98 0.009384629 15.714769 14.887706 0.6635654 -0.6193277 2
...
The columns in tb
are:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.km
: Row groups if k-means clustering is applied to rows.UMAP plot which shows how samples are separated.
dimension_reduction(res, k = 2, method = "UMAP")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
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 17118 rows and 78 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.455 0.774 0.889 0.4389 0.534 0.534
#> 3 3 0.563 0.471 0.752 0.4183 0.649 0.457
#> 4 4 0.631 0.627 0.826 0.1074 0.859 0.678
#> 5 5 0.590 0.554 0.761 0.1195 0.855 0.579
#> 6 6 0.636 0.574 0.733 0.0381 0.908 0.619
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
#> ERR863675 2 0.4431 0.8762 0.092 0.908
#> ERR863705 2 0.0000 0.8769 0.000 1.000
#> ERR863704 2 0.0000 0.8769 0.000 1.000
#> ERR863679 2 0.0000 0.8769 0.000 1.000
#> ERR863680 2 0.0000 0.8769 0.000 1.000
#> ERR863676 2 0.0000 0.8769 0.000 1.000
#> ERR863677 2 0.4562 0.8749 0.096 0.904
#> ERR863688 2 0.9686 0.3984 0.396 0.604
#> ERR863690 1 0.1184 0.8260 0.984 0.016
#> ERR863692 1 0.7602 0.7058 0.780 0.220
#> ERR863703 1 0.6973 0.7310 0.812 0.188
#> ERR863712 2 0.4815 0.8720 0.104 0.896
#> ERR863711 1 0.0000 0.8291 1.000 0.000
#> ERR863760 2 0.0000 0.8769 0.000 1.000
#> ERR863727 1 0.0000 0.8291 1.000 0.000
#> ERR863766 2 0.6048 0.8392 0.148 0.852
#> ERR863767 1 0.3431 0.8098 0.936 0.064
#> ERR863752 2 0.0000 0.8769 0.000 1.000
#> ERR863757 2 0.9129 0.5896 0.328 0.672
#> ERR863758 1 0.0000 0.8291 1.000 0.000
#> ERR863755 1 0.0672 0.8287 0.992 0.008
#> ERR863756 2 0.4815 0.8716 0.104 0.896
#> ERR863707 2 0.0000 0.8769 0.000 1.000
#> ERR863681 2 0.1414 0.8783 0.020 0.980
#> ERR863719 2 0.8608 0.6622 0.284 0.716
#> ERR863759 2 0.0000 0.8769 0.000 1.000
#> ERR863718 1 0.0000 0.8291 1.000 0.000
#> ERR863717 1 0.0672 0.8289 0.992 0.008
#> ERR863715 2 0.0000 0.8769 0.000 1.000
#> ERR863716 1 0.0000 0.8291 1.000 0.000
#> ERR863722 2 0.4431 0.8762 0.092 0.908
#> ERR863721 1 0.9710 0.3726 0.600 0.400
#> ERR863720 2 0.0000 0.8769 0.000 1.000
#> ERR863723 1 0.0000 0.8291 1.000 0.000
#> ERR863761 2 0.0000 0.8769 0.000 1.000
#> ERR863735 1 0.0000 0.8291 1.000 0.000
#> ERR863734 2 0.4815 0.8716 0.104 0.896
#> ERR863736 2 0.0000 0.8769 0.000 1.000
#> ERR863729 2 0.0000 0.8769 0.000 1.000
#> ERR863728 2 0.8081 0.7230 0.248 0.752
#> ERR863731 1 0.0000 0.8291 1.000 0.000
#> ERR863764 2 0.4431 0.8762 0.092 0.908
#> ERR863740 1 0.9993 -0.0867 0.516 0.484
#> ERR863765 2 0.6531 0.8205 0.168 0.832
#> ERR863762 2 0.4815 0.8716 0.104 0.896
#> ERR863724 2 0.6712 0.8142 0.176 0.824
#> ERR863733 2 0.4431 0.8762 0.092 0.908
#> ERR863732 2 0.4815 0.8716 0.104 0.896
#> ERR863730 1 0.9358 0.3986 0.648 0.352
#> ERR863742 2 0.9996 0.1382 0.488 0.512
#> ERR863763 2 0.4431 0.8762 0.092 0.908
#> ERR863741 2 0.5178 0.8643 0.116 0.884
#> ERR863743 1 0.0000 0.8291 1.000 0.000
#> ERR863745 2 0.0000 0.8769 0.000 1.000
#> ERR863744 1 0.9933 0.1802 0.548 0.452
#> ERR863746 1 0.0672 0.8289 0.992 0.008
#> ERR863748 2 0.4431 0.8762 0.092 0.908
#> ERR863747 2 0.0000 0.8769 0.000 1.000
#> ERR863694 2 0.4431 0.8762 0.092 0.908
#> ERR863693 2 0.8144 0.7114 0.252 0.748
#> ERR863686 2 0.8813 0.6357 0.300 0.700
#> ERR863678 2 0.7056 0.7968 0.192 0.808
#> ERR863685 2 0.1414 0.8783 0.020 0.980
#> ERR863689 1 0.8144 0.6724 0.748 0.252
#> ERR863691 1 0.8207 0.6669 0.744 0.256
#> ERR863682 1 0.8327 0.6255 0.736 0.264
#> ERR863695 2 0.0000 0.8769 0.000 1.000
#> ERR863683 1 0.8955 0.4949 0.688 0.312
#> ERR863684 1 0.7815 0.6947 0.768 0.232
#> ERR863702 2 0.8713 0.6517 0.292 0.708
#> ERR863687 2 0.0000 0.8769 0.000 1.000
#> ERR863706 2 0.6531 0.8205 0.168 0.832
#> ERR863708 2 0.0000 0.8769 0.000 1.000
#> ERR863710 1 0.0000 0.8291 1.000 0.000
#> ERR863709 2 0.3114 0.8792 0.056 0.944
#> ERR863753 2 0.0000 0.8769 0.000 1.000
#> ERR863754 1 0.8016 0.6825 0.756 0.244
#> ERR863749 1 0.0000 0.8291 1.000 0.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> ERR863675 2 0.8955 -0.2527 0.140 0.516 0.344
#> ERR863705 2 0.5988 0.0959 0.000 0.632 0.368
#> ERR863704 2 0.5560 0.4277 0.000 0.700 0.300
#> ERR863679 2 0.5988 0.0959 0.000 0.632 0.368
#> ERR863680 2 0.5591 0.4274 0.000 0.696 0.304
#> ERR863676 2 0.5591 0.4274 0.000 0.696 0.304
#> ERR863677 1 0.6912 0.4824 0.628 0.028 0.344
#> ERR863688 1 0.5785 0.5073 0.696 0.300 0.004
#> ERR863690 1 0.0000 0.8373 1.000 0.000 0.000
#> ERR863692 1 0.1289 0.8293 0.968 0.000 0.032
#> ERR863703 1 0.0000 0.8373 1.000 0.000 0.000
#> ERR863712 1 0.6988 0.5140 0.644 0.036 0.320
#> ERR863711 1 0.0000 0.8373 1.000 0.000 0.000
#> ERR863760 2 0.0424 0.4020 0.000 0.992 0.008
#> ERR863727 1 0.0000 0.8373 1.000 0.000 0.000
#> ERR863766 3 0.7274 0.6880 0.052 0.304 0.644
#> ERR863767 1 0.0000 0.8373 1.000 0.000 0.000
#> ERR863752 2 0.0747 0.3977 0.000 0.984 0.016
#> ERR863757 1 0.9304 0.0834 0.508 0.300 0.192
#> ERR863758 1 0.0000 0.8373 1.000 0.000 0.000
#> ERR863755 1 0.0000 0.8373 1.000 0.000 0.000
#> ERR863756 3 0.5988 0.6735 0.008 0.304 0.688
#> ERR863707 2 0.6126 0.0216 0.000 0.600 0.400
#> ERR863681 2 0.8261 -0.2302 0.080 0.524 0.396
#> ERR863719 1 0.9468 0.1277 0.488 0.300 0.212
#> ERR863759 2 0.5926 0.1100 0.000 0.644 0.356
#> ERR863718 1 0.0000 0.8373 1.000 0.000 0.000
#> ERR863717 1 0.0000 0.8373 1.000 0.000 0.000
#> ERR863715 2 0.0424 0.4056 0.000 0.992 0.008
#> ERR863716 1 0.0000 0.8373 1.000 0.000 0.000
#> ERR863722 2 0.7685 -0.1517 0.060 0.596 0.344
#> ERR863721 1 0.2496 0.8138 0.928 0.004 0.068
#> ERR863720 2 0.5560 0.4277 0.000 0.700 0.300
#> ERR863723 1 0.0000 0.8373 1.000 0.000 0.000
#> ERR863761 2 0.5988 0.0959 0.000 0.632 0.368
#> ERR863735 1 0.0000 0.8373 1.000 0.000 0.000
#> ERR863734 3 0.7084 0.6879 0.044 0.304 0.652
#> ERR863736 2 0.0747 0.3977 0.000 0.984 0.016
#> ERR863729 2 0.0000 0.4044 0.000 1.000 0.000
#> ERR863728 1 0.2301 0.8188 0.936 0.004 0.060
#> ERR863731 1 0.0000 0.8373 1.000 0.000 0.000
#> ERR863764 2 0.9091 -0.2660 0.152 0.504 0.344
#> ERR863740 1 0.5529 0.5177 0.704 0.296 0.000
#> ERR863765 3 0.7798 0.6663 0.080 0.296 0.624
#> ERR863762 3 0.5591 0.6699 0.000 0.304 0.696
#> ERR863724 3 0.9929 0.3492 0.312 0.296 0.392
#> ERR863733 2 0.5859 -0.0665 0.000 0.656 0.344
#> ERR863732 3 0.5591 0.6699 0.000 0.304 0.696
#> ERR863730 1 0.5291 0.5665 0.732 0.268 0.000
#> ERR863742 1 0.5529 0.5177 0.704 0.296 0.000
#> ERR863763 1 0.7768 0.4233 0.592 0.064 0.344
#> ERR863741 2 0.8390 -0.2041 0.100 0.560 0.340
#> ERR863743 1 0.0000 0.8373 1.000 0.000 0.000
#> ERR863745 2 0.5591 0.4274 0.000 0.696 0.304
#> ERR863744 1 0.1525 0.8239 0.964 0.032 0.004
#> ERR863746 1 0.0000 0.8373 1.000 0.000 0.000
#> ERR863748 2 0.6291 -0.3199 0.000 0.532 0.468
#> ERR863747 2 0.5926 0.1100 0.000 0.644 0.356
#> ERR863694 2 0.6404 -0.0827 0.012 0.644 0.344
#> ERR863693 1 0.2496 0.8138 0.928 0.004 0.068
#> ERR863686 1 0.6956 0.4494 0.660 0.300 0.040
#> ERR863678 1 0.5873 0.5458 0.684 0.004 0.312
#> ERR863685 2 0.7555 -0.2044 0.040 0.520 0.440
#> ERR863689 1 0.2261 0.8151 0.932 0.000 0.068
#> ERR863691 1 0.2261 0.8151 0.932 0.000 0.068
#> ERR863682 1 0.0424 0.8348 0.992 0.008 0.000
#> ERR863695 2 0.5621 0.4273 0.000 0.692 0.308
#> ERR863683 1 0.4555 0.6646 0.800 0.200 0.000
#> ERR863684 1 0.2261 0.8151 0.932 0.000 0.068
#> ERR863702 1 0.9833 -0.1746 0.424 0.300 0.276
#> ERR863687 2 0.5760 0.1388 0.000 0.672 0.328
#> ERR863706 3 0.7944 0.6672 0.088 0.296 0.616
#> ERR863708 2 0.5591 0.4274 0.000 0.696 0.304
#> ERR863710 1 0.0000 0.8373 1.000 0.000 0.000
#> ERR863709 3 0.6244 -0.3083 0.000 0.440 0.560
#> ERR863753 2 0.5591 0.4274 0.000 0.696 0.304
#> ERR863754 1 0.2261 0.8151 0.932 0.000 0.068
#> ERR863749 1 0.0000 0.8373 1.000 0.000 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> ERR863675 2 0.6116 0.4013 0.004 0.588 0.048 0.360
#> ERR863705 3 0.2647 0.7313 0.000 0.120 0.880 0.000
#> ERR863704 2 0.0000 0.6788 0.000 1.000 0.000 0.000
#> ERR863679 3 0.2530 0.7322 0.000 0.112 0.888 0.000
#> ERR863680 2 0.0000 0.6788 0.000 1.000 0.000 0.000
#> ERR863676 2 0.0000 0.6788 0.000 1.000 0.000 0.000
#> ERR863677 1 0.6189 0.4413 0.584 0.008 0.044 0.364
#> ERR863688 1 0.3688 0.6709 0.792 0.000 0.000 0.208
#> ERR863690 1 0.0376 0.8689 0.992 0.000 0.004 0.004
#> ERR863692 1 0.3494 0.7716 0.824 0.000 0.004 0.172
#> ERR863703 1 0.0376 0.8689 0.992 0.000 0.004 0.004
#> ERR863712 4 0.8755 -0.0550 0.260 0.344 0.040 0.356
#> ERR863711 1 0.0188 0.8696 0.996 0.000 0.000 0.004
#> ERR863760 2 0.5778 0.1150 0.000 0.604 0.040 0.356
#> ERR863727 1 0.0000 0.8694 1.000 0.000 0.000 0.000
#> ERR863766 3 0.3166 0.7067 0.016 0.000 0.868 0.116
#> ERR863767 1 0.0188 0.8696 0.996 0.000 0.000 0.004
#> ERR863752 2 0.1211 0.6602 0.000 0.960 0.040 0.000
#> ERR863757 4 0.5583 0.3128 0.240 0.008 0.048 0.704
#> ERR863758 1 0.0336 0.8696 0.992 0.000 0.000 0.008
#> ERR863755 1 0.0000 0.8694 1.000 0.000 0.000 0.000
#> ERR863756 3 0.4605 0.5198 0.000 0.000 0.664 0.336
#> ERR863707 3 0.2469 0.7330 0.000 0.108 0.892 0.000
#> ERR863681 3 0.9097 -0.1302 0.120 0.136 0.384 0.360
#> ERR863719 1 0.5040 0.5318 0.628 0.000 0.008 0.364
#> ERR863759 3 0.2973 0.7220 0.000 0.144 0.856 0.000
#> ERR863718 1 0.0188 0.8695 0.996 0.000 0.000 0.004
#> ERR863717 1 0.0188 0.8696 0.996 0.000 0.000 0.004
#> ERR863715 2 0.5132 -0.1115 0.000 0.548 0.004 0.448
#> ERR863716 1 0.0000 0.8694 1.000 0.000 0.000 0.000
#> ERR863722 2 0.6000 0.4065 0.000 0.592 0.052 0.356
#> ERR863721 1 0.3831 0.7502 0.792 0.000 0.004 0.204
#> ERR863720 2 0.0000 0.6788 0.000 1.000 0.000 0.000
#> ERR863723 1 0.0336 0.8680 0.992 0.000 0.000 0.008
#> ERR863761 3 0.2760 0.7301 0.000 0.128 0.872 0.000
#> ERR863735 1 0.0000 0.8694 1.000 0.000 0.000 0.000
#> ERR863734 3 0.2773 0.7078 0.004 0.000 0.880 0.116
#> ERR863736 4 0.5911 0.1963 0.000 0.372 0.044 0.584
#> ERR863729 4 0.4843 0.1824 0.000 0.396 0.000 0.604
#> ERR863728 1 0.2520 0.8349 0.904 0.004 0.004 0.088
#> ERR863731 1 0.0336 0.8696 0.992 0.000 0.000 0.008
#> ERR863764 2 0.6116 0.4013 0.004 0.588 0.048 0.360
#> ERR863740 1 0.0336 0.8681 0.992 0.000 0.000 0.008
#> ERR863765 3 0.4389 0.6746 0.072 0.000 0.812 0.116
#> ERR863762 3 0.3710 0.6814 0.004 0.000 0.804 0.192
#> ERR863724 3 0.7378 0.1979 0.352 0.008 0.504 0.136
#> ERR863733 2 0.5985 0.4100 0.000 0.596 0.052 0.352
#> ERR863732 3 0.3569 0.6792 0.000 0.000 0.804 0.196
#> ERR863730 1 0.0336 0.8681 0.992 0.000 0.000 0.008
#> ERR863742 1 0.0779 0.8660 0.980 0.000 0.004 0.016
#> ERR863763 1 0.8463 0.0255 0.428 0.164 0.048 0.360
#> ERR863741 4 0.2522 0.3339 0.012 0.016 0.052 0.920
#> ERR863743 1 0.0336 0.8696 0.992 0.000 0.000 0.008
#> ERR863745 2 0.0188 0.6790 0.000 0.996 0.004 0.000
#> ERR863744 1 0.0469 0.8687 0.988 0.000 0.000 0.012
#> ERR863746 1 0.0000 0.8694 1.000 0.000 0.000 0.000
#> ERR863748 4 0.7921 -0.1095 0.000 0.328 0.324 0.348
#> ERR863747 3 0.2921 0.7241 0.000 0.140 0.860 0.000
#> ERR863694 2 0.7574 0.2939 0.080 0.548 0.052 0.320
#> ERR863693 1 0.4153 0.7451 0.784 0.008 0.004 0.204
#> ERR863686 1 0.5433 0.1392 0.540 0.008 0.004 0.448
#> ERR863678 1 0.5664 0.5992 0.716 0.004 0.080 0.200
#> ERR863685 3 0.0469 0.7235 0.000 0.012 0.988 0.000
#> ERR863689 1 0.3831 0.7502 0.792 0.000 0.004 0.204
#> ERR863691 1 0.3870 0.7471 0.788 0.000 0.004 0.208
#> ERR863682 1 0.0188 0.8695 0.996 0.000 0.000 0.004
#> ERR863695 2 0.0000 0.6788 0.000 1.000 0.000 0.000
#> ERR863683 1 0.0336 0.8681 0.992 0.000 0.000 0.008
#> ERR863684 1 0.3908 0.7466 0.784 0.000 0.004 0.212
#> ERR863702 1 0.4882 0.6461 0.756 0.008 0.028 0.208
#> ERR863687 3 0.3356 0.7007 0.000 0.176 0.824 0.000
#> ERR863706 3 0.5742 0.5543 0.168 0.000 0.712 0.120
#> ERR863708 2 0.0188 0.6790 0.000 0.996 0.004 0.000
#> ERR863710 1 0.0336 0.8692 0.992 0.000 0.000 0.008
#> ERR863709 2 0.4986 0.5166 0.000 0.740 0.044 0.216
#> ERR863753 2 0.0188 0.6790 0.000 0.996 0.004 0.000
#> ERR863754 1 0.3831 0.7502 0.792 0.000 0.004 0.204
#> ERR863749 1 0.0000 0.8694 1.000 0.000 0.000 0.000
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> ERR863675 2 0.6181 0.4676 0.004 0.524 0.132 0.340 0.000
#> ERR863705 3 0.3845 0.7487 0.000 0.024 0.768 0.000 0.208
#> ERR863704 2 0.0000 0.7207 0.000 1.000 0.000 0.000 0.000
#> ERR863679 3 0.3845 0.7487 0.000 0.024 0.768 0.000 0.208
#> ERR863680 2 0.0000 0.7207 0.000 1.000 0.000 0.000 0.000
#> ERR863676 2 0.0000 0.7207 0.000 1.000 0.000 0.000 0.000
#> ERR863677 4 0.2754 0.6115 0.032 0.004 0.080 0.884 0.000
#> ERR863688 1 0.3388 0.5692 0.792 0.000 0.000 0.008 0.200
#> ERR863690 4 0.5838 0.3084 0.336 0.000 0.000 0.552 0.112
#> ERR863692 4 0.2605 0.6941 0.148 0.000 0.000 0.852 0.000
#> ERR863703 4 0.4356 0.4217 0.340 0.000 0.000 0.648 0.012
#> ERR863712 4 0.3481 0.5889 0.084 0.044 0.020 0.852 0.000
#> ERR863711 1 0.4256 0.2066 0.564 0.000 0.000 0.436 0.000
#> ERR863760 2 0.5986 -0.3015 0.008 0.464 0.084 0.000 0.444
#> ERR863727 1 0.1671 0.6993 0.924 0.000 0.000 0.076 0.000
#> ERR863766 3 0.0968 0.7343 0.012 0.000 0.972 0.012 0.004
#> ERR863767 1 0.4300 0.0554 0.524 0.000 0.000 0.476 0.000
#> ERR863752 2 0.3059 0.6359 0.000 0.856 0.120 0.008 0.016
#> ERR863757 5 0.7349 0.2651 0.292 0.000 0.256 0.032 0.420
#> ERR863758 4 0.6025 0.1670 0.384 0.000 0.000 0.496 0.120
#> ERR863755 1 0.2648 0.6733 0.848 0.000 0.000 0.152 0.000
#> ERR863756 3 0.2707 0.6895 0.000 0.000 0.860 0.132 0.008
#> ERR863707 3 0.3551 0.7493 0.000 0.008 0.772 0.000 0.220
#> ERR863681 5 0.6193 0.2865 0.008 0.108 0.332 0.004 0.548
#> ERR863719 1 0.4054 0.4391 0.732 0.000 0.020 0.248 0.000
#> ERR863759 3 0.4703 0.7218 0.000 0.096 0.752 0.008 0.144
#> ERR863718 1 0.6099 0.0421 0.452 0.000 0.000 0.424 0.124
#> ERR863717 1 0.4262 0.1874 0.560 0.000 0.000 0.440 0.000
#> ERR863715 5 0.5043 0.5120 0.000 0.356 0.044 0.000 0.600
#> ERR863716 1 0.4203 0.6337 0.760 0.000 0.000 0.188 0.052
#> ERR863722 2 0.6174 0.5098 0.000 0.556 0.208 0.236 0.000
#> ERR863721 4 0.2077 0.7198 0.084 0.000 0.000 0.908 0.008
#> ERR863720 2 0.0000 0.7207 0.000 1.000 0.000 0.000 0.000
#> ERR863723 1 0.0404 0.6723 0.988 0.000 0.000 0.012 0.000
#> ERR863761 3 0.4223 0.7307 0.000 0.028 0.724 0.000 0.248
#> ERR863735 1 0.1671 0.6993 0.924 0.000 0.000 0.076 0.000
#> ERR863734 3 0.0404 0.7358 0.000 0.000 0.988 0.012 0.000
#> ERR863736 5 0.4743 0.5973 0.000 0.156 0.112 0.000 0.732
#> ERR863729 5 0.4276 0.4781 0.000 0.380 0.004 0.000 0.616
#> ERR863728 4 0.3452 0.6467 0.244 0.000 0.000 0.756 0.000
#> ERR863731 4 0.6050 0.2281 0.360 0.000 0.000 0.512 0.128
#> ERR863764 2 0.6225 0.5037 0.000 0.544 0.200 0.256 0.000
#> ERR863740 1 0.1341 0.6980 0.944 0.000 0.000 0.056 0.000
#> ERR863765 3 0.1356 0.7266 0.028 0.000 0.956 0.012 0.004
#> ERR863762 3 0.2198 0.7314 0.048 0.000 0.920 0.020 0.012
#> ERR863724 3 0.4524 0.2929 0.336 0.000 0.644 0.020 0.000
#> ERR863733 2 0.5981 0.5314 0.000 0.576 0.160 0.264 0.000
#> ERR863732 3 0.2908 0.7062 0.016 0.000 0.868 0.108 0.008
#> ERR863730 1 0.1671 0.6993 0.924 0.000 0.000 0.076 0.000
#> ERR863742 1 0.2488 0.6067 0.872 0.000 0.124 0.000 0.004
#> ERR863763 4 0.3166 0.5790 0.020 0.012 0.112 0.856 0.000
#> ERR863741 5 0.6351 0.4768 0.044 0.000 0.112 0.232 0.612
#> ERR863743 4 0.6031 0.2510 0.352 0.000 0.000 0.520 0.128
#> ERR863745 2 0.0162 0.7200 0.000 0.996 0.000 0.000 0.004
#> ERR863744 1 0.0290 0.6818 0.992 0.000 0.000 0.008 0.000
#> ERR863746 1 0.2179 0.6921 0.888 0.000 0.000 0.112 0.000
#> ERR863748 3 0.6399 0.0792 0.000 0.308 0.496 0.196 0.000
#> ERR863747 3 0.4285 0.7458 0.000 0.032 0.752 0.008 0.208
#> ERR863694 2 0.6281 0.5386 0.008 0.596 0.148 0.240 0.008
#> ERR863693 4 0.1851 0.7196 0.088 0.000 0.000 0.912 0.000
#> ERR863686 1 0.5583 0.1359 0.504 0.000 0.000 0.072 0.424
#> ERR863678 4 0.5917 0.4440 0.224 0.000 0.180 0.596 0.000
#> ERR863685 3 0.2377 0.7503 0.000 0.000 0.872 0.000 0.128
#> ERR863689 4 0.1851 0.7196 0.088 0.000 0.000 0.912 0.000
#> ERR863691 4 0.2020 0.7182 0.100 0.000 0.000 0.900 0.000
#> ERR863682 1 0.5102 0.5977 0.696 0.000 0.000 0.176 0.128
#> ERR863695 2 0.0000 0.7207 0.000 1.000 0.000 0.000 0.000
#> ERR863683 1 0.1043 0.6943 0.960 0.000 0.000 0.040 0.000
#> ERR863684 4 0.2358 0.7170 0.104 0.000 0.000 0.888 0.008
#> ERR863702 1 0.5833 0.4734 0.688 0.000 0.092 0.060 0.160
#> ERR863687 3 0.4446 0.7433 0.000 0.048 0.752 0.008 0.192
#> ERR863706 3 0.3719 0.5233 0.208 0.000 0.776 0.012 0.004
#> ERR863708 2 0.0324 0.7203 0.000 0.992 0.000 0.004 0.004
#> ERR863710 1 0.6047 0.1983 0.500 0.000 0.000 0.376 0.124
#> ERR863709 2 0.3567 0.6615 0.000 0.832 0.112 0.052 0.004
#> ERR863753 2 0.0162 0.7200 0.000 0.996 0.000 0.000 0.004
#> ERR863754 4 0.2193 0.7197 0.092 0.000 0.000 0.900 0.008
#> ERR863749 1 0.3752 0.5287 0.708 0.000 0.000 0.292 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> ERR863675 4 0.4636 0.5416 0.000 0.020 0.024 0.620 0.000 0.336
#> ERR863705 3 0.4218 0.7052 0.000 0.032 0.772 0.000 0.068 0.128
#> ERR863704 2 0.0000 0.9746 0.000 1.000 0.000 0.000 0.000 0.000
#> ERR863679 3 0.4218 0.7052 0.000 0.032 0.772 0.000 0.068 0.128
#> ERR863680 2 0.0000 0.9746 0.000 1.000 0.000 0.000 0.000 0.000
#> ERR863676 2 0.0000 0.9746 0.000 1.000 0.000 0.000 0.000 0.000
#> ERR863677 4 0.4138 0.5809 0.000 0.000 0.020 0.656 0.004 0.320
#> ERR863688 1 0.3978 0.4625 0.700 0.000 0.000 0.032 0.268 0.000
#> ERR863690 4 0.4628 0.4322 0.156 0.000 0.000 0.712 0.124 0.008
#> ERR863692 4 0.2911 0.6698 0.024 0.000 0.000 0.832 0.000 0.144
#> ERR863703 4 0.3284 0.4484 0.196 0.000 0.000 0.784 0.020 0.000
#> ERR863712 4 0.4392 0.6034 0.012 0.004 0.020 0.688 0.004 0.272
#> ERR863711 1 0.3966 0.3815 0.552 0.000 0.000 0.444 0.004 0.000
#> ERR863760 5 0.4570 0.5389 0.000 0.248 0.020 0.024 0.696 0.012
#> ERR863727 1 0.2491 0.7068 0.836 0.000 0.000 0.164 0.000 0.000
#> ERR863766 3 0.0891 0.7574 0.024 0.000 0.968 0.000 0.008 0.000
#> ERR863767 1 0.4779 0.1219 0.488 0.000 0.000 0.468 0.004 0.040
#> ERR863752 6 0.4254 0.2573 0.000 0.404 0.020 0.000 0.000 0.576
#> ERR863757 5 0.6288 0.4032 0.220 0.000 0.172 0.024 0.564 0.020
#> ERR863758 4 0.5229 0.2991 0.228 0.000 0.000 0.636 0.124 0.012
#> ERR863755 1 0.3405 0.6624 0.724 0.000 0.000 0.272 0.000 0.004
#> ERR863756 3 0.4771 0.5214 0.000 0.000 0.692 0.116 0.008 0.184
#> ERR863707 3 0.4097 0.7118 0.000 0.020 0.776 0.000 0.076 0.128
#> ERR863681 5 0.4117 0.4110 0.016 0.012 0.228 0.000 0.732 0.012
#> ERR863719 1 0.5156 0.4495 0.580 0.000 0.024 0.352 0.004 0.040
#> ERR863759 6 0.5153 0.5272 0.000 0.084 0.220 0.000 0.032 0.664
#> ERR863718 4 0.5600 0.0423 0.312 0.000 0.000 0.552 0.124 0.012
#> ERR863717 1 0.3860 0.3281 0.528 0.000 0.000 0.472 0.000 0.000
#> ERR863715 5 0.4343 0.3865 0.000 0.380 0.000 0.000 0.592 0.028
#> ERR863716 1 0.5105 0.4608 0.540 0.000 0.000 0.388 0.064 0.008
#> ERR863722 6 0.3142 0.6127 0.000 0.012 0.024 0.132 0.000 0.832
#> ERR863721 4 0.2656 0.6681 0.008 0.000 0.000 0.860 0.012 0.120
#> ERR863720 2 0.0000 0.9746 0.000 1.000 0.000 0.000 0.000 0.000
#> ERR863723 1 0.2597 0.7070 0.824 0.000 0.000 0.176 0.000 0.000
#> ERR863761 3 0.4500 0.6807 0.000 0.032 0.704 0.000 0.232 0.032
#> ERR863735 1 0.2527 0.7074 0.832 0.000 0.000 0.168 0.000 0.000
#> ERR863734 3 0.0405 0.7570 0.004 0.000 0.988 0.000 0.008 0.000
#> ERR863736 5 0.3605 0.5589 0.000 0.108 0.056 0.000 0.816 0.020
#> ERR863729 5 0.4004 0.4295 0.000 0.368 0.012 0.000 0.620 0.000
#> ERR863728 4 0.5091 0.6114 0.148 0.000 0.008 0.656 0.000 0.188
#> ERR863731 4 0.5205 0.3090 0.224 0.000 0.000 0.640 0.124 0.012
#> ERR863764 6 0.3465 0.5907 0.000 0.016 0.024 0.156 0.000 0.804
#> ERR863740 1 0.0000 0.6414 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR863765 3 0.1918 0.7274 0.088 0.000 0.904 0.000 0.008 0.000
#> ERR863762 3 0.2107 0.7579 0.036 0.000 0.920 0.012 0.008 0.024
#> ERR863724 3 0.3828 0.2069 0.440 0.000 0.560 0.000 0.000 0.000
#> ERR863733 6 0.3476 0.6150 0.000 0.028 0.024 0.132 0.000 0.816
#> ERR863732 3 0.3845 0.6581 0.000 0.000 0.788 0.084 0.008 0.120
#> ERR863730 1 0.0858 0.6495 0.968 0.000 0.000 0.028 0.004 0.000
#> ERR863742 1 0.1556 0.5739 0.920 0.000 0.080 0.000 0.000 0.000
#> ERR863763 4 0.4199 0.5698 0.000 0.000 0.020 0.640 0.004 0.336
#> ERR863741 5 0.5405 0.4589 0.008 0.000 0.028 0.260 0.632 0.072
#> ERR863743 4 0.5107 0.3431 0.208 0.000 0.000 0.656 0.124 0.012
#> ERR863745 2 0.0363 0.9706 0.000 0.988 0.000 0.000 0.000 0.012
#> ERR863744 1 0.3110 0.6999 0.792 0.000 0.012 0.196 0.000 0.000
#> ERR863746 1 0.2805 0.7041 0.812 0.000 0.000 0.184 0.004 0.000
#> ERR863748 6 0.3933 0.6252 0.000 0.012 0.080 0.124 0.000 0.784
#> ERR863747 6 0.5231 0.5086 0.000 0.064 0.232 0.000 0.048 0.656
#> ERR863694 5 0.8117 0.2297 0.000 0.264 0.036 0.232 0.324 0.144
#> ERR863693 4 0.2915 0.6624 0.008 0.000 0.000 0.808 0.000 0.184
#> ERR863686 5 0.6087 0.0125 0.348 0.000 0.004 0.196 0.448 0.004
#> ERR863678 4 0.6637 0.5547 0.140 0.000 0.108 0.548 0.004 0.200
#> ERR863685 3 0.1668 0.7608 0.004 0.000 0.928 0.000 0.060 0.008
#> ERR863689 4 0.3156 0.6604 0.020 0.000 0.000 0.800 0.000 0.180
#> ERR863691 4 0.2968 0.6665 0.016 0.000 0.000 0.816 0.000 0.168
#> ERR863682 1 0.5979 0.3634 0.468 0.000 0.000 0.384 0.124 0.024
#> ERR863695 2 0.0000 0.9746 0.000 1.000 0.000 0.000 0.000 0.000
#> ERR863683 1 0.0000 0.6414 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR863684 4 0.1745 0.6555 0.012 0.000 0.000 0.920 0.000 0.068
#> ERR863702 1 0.5685 0.3574 0.616 0.000 0.068 0.036 0.264 0.016
#> ERR863687 6 0.5199 0.5156 0.000 0.068 0.228 0.000 0.044 0.660
#> ERR863706 3 0.3298 0.5693 0.236 0.000 0.756 0.000 0.008 0.000
#> ERR863708 2 0.0363 0.9706 0.000 0.988 0.000 0.000 0.000 0.012
#> ERR863710 4 0.5775 -0.2250 0.400 0.000 0.000 0.464 0.124 0.012
#> ERR863709 2 0.2738 0.8284 0.008 0.888 0.024 0.004 0.016 0.060
#> ERR863753 2 0.0363 0.9706 0.000 0.988 0.000 0.000 0.000 0.012
#> ERR863754 4 0.0976 0.6228 0.016 0.000 0.000 0.968 0.008 0.008
#> ERR863749 1 0.3426 0.6525 0.720 0.000 0.000 0.276 0.004 0.000
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)
An example of the output of tb
is:
#> which_row fdr mean_1 mean_2 scaled_mean_1 scaled_mean_2 km
#> 1 38 0.042760348 8.373488 9.131774 -0.5533452 0.5164555 1
#> 2 40 0.018707592 7.106213 8.469186 -0.6173731 0.5762149 1
#> 3 55 0.019134737 10.221463 11.207825 -0.6159697 0.5749050 1
#> 4 59 0.006059896 5.921854 7.869574 -0.6899429 0.6439467 1
#> 5 60 0.018055526 8.928898 10.211722 -0.6204761 0.5791110 1
#> 6 98 0.009384629 15.714769 14.887706 0.6635654 -0.6193277 2
...
The columns in tb
are:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.km
: Row groups if k-means clustering is applied to rows.UMAP plot which shows how samples are separated.
dimension_reduction(res, k = 2, method = "UMAP")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
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 17118 rows and 78 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.996 0.959 0.982 0.5039 0.497 0.497
#> 3 3 0.648 0.807 0.909 0.3019 0.765 0.564
#> 4 4 0.693 0.586 0.790 0.0979 0.867 0.643
#> 5 5 0.721 0.723 0.844 0.0518 0.915 0.717
#> 6 6 0.737 0.628 0.798 0.0430 0.938 0.770
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
#> ERR863675 2 0.0000 0.984 0.000 1.000
#> ERR863705 2 0.0000 0.984 0.000 1.000
#> ERR863704 2 0.0000 0.984 0.000 1.000
#> ERR863679 2 0.0000 0.984 0.000 1.000
#> ERR863680 2 0.0000 0.984 0.000 1.000
#> ERR863676 2 0.0000 0.984 0.000 1.000
#> ERR863677 2 0.1414 0.969 0.020 0.980
#> ERR863688 1 0.0000 0.979 1.000 0.000
#> ERR863690 1 0.0000 0.979 1.000 0.000
#> ERR863692 1 0.0000 0.979 1.000 0.000
#> ERR863703 1 0.0000 0.979 1.000 0.000
#> ERR863712 2 0.9358 0.448 0.352 0.648
#> ERR863711 1 0.0000 0.979 1.000 0.000
#> ERR863760 2 0.0000 0.984 0.000 1.000
#> ERR863727 1 0.0000 0.979 1.000 0.000
#> ERR863766 1 0.4298 0.897 0.912 0.088
#> ERR863767 1 0.0000 0.979 1.000 0.000
#> ERR863752 2 0.0000 0.984 0.000 1.000
#> ERR863757 1 0.0000 0.979 1.000 0.000
#> ERR863758 1 0.0000 0.979 1.000 0.000
#> ERR863755 1 0.0000 0.979 1.000 0.000
#> ERR863756 2 0.1414 0.969 0.020 0.980
#> ERR863707 2 0.0000 0.984 0.000 1.000
#> ERR863681 2 0.2043 0.958 0.032 0.968
#> ERR863719 1 0.0376 0.976 0.996 0.004
#> ERR863759 2 0.0000 0.984 0.000 1.000
#> ERR863718 1 0.0000 0.979 1.000 0.000
#> ERR863717 1 0.0000 0.979 1.000 0.000
#> ERR863715 2 0.0000 0.984 0.000 1.000
#> ERR863716 1 0.0000 0.979 1.000 0.000
#> ERR863722 2 0.0000 0.984 0.000 1.000
#> ERR863721 1 0.0000 0.979 1.000 0.000
#> ERR863720 2 0.0000 0.984 0.000 1.000
#> ERR863723 1 0.0000 0.979 1.000 0.000
#> ERR863761 2 0.0000 0.984 0.000 1.000
#> ERR863735 1 0.0000 0.979 1.000 0.000
#> ERR863734 2 0.1184 0.972 0.016 0.984
#> ERR863736 2 0.0000 0.984 0.000 1.000
#> ERR863729 2 0.0000 0.984 0.000 1.000
#> ERR863728 1 0.0000 0.979 1.000 0.000
#> ERR863731 1 0.0000 0.979 1.000 0.000
#> ERR863764 2 0.0000 0.984 0.000 1.000
#> ERR863740 1 0.0000 0.979 1.000 0.000
#> ERR863765 1 0.0672 0.973 0.992 0.008
#> ERR863762 2 0.4431 0.892 0.092 0.908
#> ERR863724 1 0.9491 0.428 0.632 0.368
#> ERR863733 2 0.0000 0.984 0.000 1.000
#> ERR863732 2 0.0000 0.984 0.000 1.000
#> ERR863730 1 0.0000 0.979 1.000 0.000
#> ERR863742 1 0.0000 0.979 1.000 0.000
#> ERR863763 2 0.1414 0.969 0.020 0.980
#> ERR863741 1 0.7674 0.717 0.776 0.224
#> ERR863743 1 0.0000 0.979 1.000 0.000
#> ERR863745 2 0.0000 0.984 0.000 1.000
#> ERR863744 1 0.0000 0.979 1.000 0.000
#> ERR863746 1 0.0000 0.979 1.000 0.000
#> ERR863748 2 0.0000 0.984 0.000 1.000
#> ERR863747 2 0.0000 0.984 0.000 1.000
#> ERR863694 2 0.0000 0.984 0.000 1.000
#> ERR863693 1 0.0000 0.979 1.000 0.000
#> ERR863686 1 0.0000 0.979 1.000 0.000
#> ERR863678 1 0.5737 0.841 0.864 0.136
#> ERR863685 2 0.0000 0.984 0.000 1.000
#> ERR863689 1 0.0000 0.979 1.000 0.000
#> ERR863691 1 0.0000 0.979 1.000 0.000
#> ERR863682 1 0.0000 0.979 1.000 0.000
#> ERR863695 2 0.0000 0.984 0.000 1.000
#> ERR863683 1 0.0000 0.979 1.000 0.000
#> ERR863684 1 0.0000 0.979 1.000 0.000
#> ERR863702 1 0.0000 0.979 1.000 0.000
#> ERR863687 2 0.0000 0.984 0.000 1.000
#> ERR863706 1 0.0000 0.979 1.000 0.000
#> ERR863708 2 0.0000 0.984 0.000 1.000
#> ERR863710 1 0.0000 0.979 1.000 0.000
#> ERR863709 2 0.0000 0.984 0.000 1.000
#> ERR863753 2 0.0000 0.984 0.000 1.000
#> ERR863754 1 0.0000 0.979 1.000 0.000
#> ERR863749 1 0.0000 0.979 1.000 0.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> ERR863675 2 0.0000 0.8795 0.000 1.000 0.000
#> ERR863705 3 0.0000 0.8535 0.000 0.000 1.000
#> ERR863704 2 0.3482 0.8507 0.000 0.872 0.128
#> ERR863679 3 0.0000 0.8535 0.000 0.000 1.000
#> ERR863680 2 0.2878 0.8698 0.000 0.904 0.096
#> ERR863676 2 0.2959 0.8681 0.000 0.900 0.100
#> ERR863677 2 0.0000 0.8795 0.000 1.000 0.000
#> ERR863688 1 0.0000 0.9193 1.000 0.000 0.000
#> ERR863690 1 0.0892 0.9098 0.980 0.020 0.000
#> ERR863692 1 0.3686 0.8215 0.860 0.140 0.000
#> ERR863703 1 0.0424 0.9160 0.992 0.008 0.000
#> ERR863712 2 0.0000 0.8795 0.000 1.000 0.000
#> ERR863711 1 0.0000 0.9193 1.000 0.000 0.000
#> ERR863760 3 0.3482 0.7540 0.000 0.128 0.872
#> ERR863727 1 0.0000 0.9193 1.000 0.000 0.000
#> ERR863766 3 0.4291 0.7455 0.180 0.000 0.820
#> ERR863767 1 0.0000 0.9193 1.000 0.000 0.000
#> ERR863752 2 0.4887 0.7347 0.000 0.772 0.228
#> ERR863757 1 0.3192 0.8196 0.888 0.000 0.112
#> ERR863758 1 0.0000 0.9193 1.000 0.000 0.000
#> ERR863755 1 0.0000 0.9193 1.000 0.000 0.000
#> ERR863756 3 0.4555 0.7325 0.000 0.200 0.800
#> ERR863707 3 0.0000 0.8535 0.000 0.000 1.000
#> ERR863681 3 0.0237 0.8531 0.004 0.000 0.996
#> ERR863719 1 0.5817 0.7735 0.800 0.100 0.100
#> ERR863759 3 0.3941 0.7348 0.000 0.156 0.844
#> ERR863718 1 0.0000 0.9193 1.000 0.000 0.000
#> ERR863717 1 0.0000 0.9193 1.000 0.000 0.000
#> ERR863715 3 0.6126 0.2630 0.000 0.400 0.600
#> ERR863716 1 0.0000 0.9193 1.000 0.000 0.000
#> ERR863722 2 0.0000 0.8795 0.000 1.000 0.000
#> ERR863721 2 0.4121 0.7258 0.168 0.832 0.000
#> ERR863720 2 0.2878 0.8698 0.000 0.904 0.096
#> ERR863723 1 0.0000 0.9193 1.000 0.000 0.000
#> ERR863761 3 0.0000 0.8535 0.000 0.000 1.000
#> ERR863735 1 0.0000 0.9193 1.000 0.000 0.000
#> ERR863734 3 0.1289 0.8439 0.032 0.000 0.968
#> ERR863736 3 0.0000 0.8535 0.000 0.000 1.000
#> ERR863729 3 0.6291 0.0506 0.000 0.468 0.532
#> ERR863728 1 0.5785 0.5469 0.668 0.332 0.000
#> ERR863731 1 0.0747 0.9120 0.984 0.016 0.000
#> ERR863764 2 0.0424 0.8788 0.000 0.992 0.008
#> ERR863740 1 0.0237 0.9171 0.996 0.000 0.004
#> ERR863765 3 0.4291 0.7448 0.180 0.000 0.820
#> ERR863762 3 0.1411 0.8413 0.036 0.000 0.964
#> ERR863724 3 0.6168 0.3273 0.412 0.000 0.588
#> ERR863733 2 0.1964 0.8622 0.000 0.944 0.056
#> ERR863732 3 0.0237 0.8528 0.000 0.004 0.996
#> ERR863730 1 0.0000 0.9193 1.000 0.000 0.000
#> ERR863742 1 0.1529 0.8909 0.960 0.000 0.040
#> ERR863763 2 0.0000 0.8795 0.000 1.000 0.000
#> ERR863741 2 0.4324 0.7875 0.112 0.860 0.028
#> ERR863743 1 0.0000 0.9193 1.000 0.000 0.000
#> ERR863745 2 0.3551 0.8476 0.000 0.868 0.132
#> ERR863744 1 0.0000 0.9193 1.000 0.000 0.000
#> ERR863746 1 0.0000 0.9193 1.000 0.000 0.000
#> ERR863748 2 0.5785 0.4164 0.000 0.668 0.332
#> ERR863747 3 0.0592 0.8503 0.000 0.012 0.988
#> ERR863694 2 0.0000 0.8795 0.000 1.000 0.000
#> ERR863693 1 0.5988 0.5174 0.632 0.368 0.000
#> ERR863686 1 0.0000 0.9193 1.000 0.000 0.000
#> ERR863678 1 0.6396 0.5479 0.664 0.320 0.016
#> ERR863685 3 0.0000 0.8535 0.000 0.000 1.000
#> ERR863689 1 0.5882 0.5580 0.652 0.348 0.000
#> ERR863691 2 0.5178 0.5785 0.256 0.744 0.000
#> ERR863682 1 0.0000 0.9193 1.000 0.000 0.000
#> ERR863695 2 0.2878 0.8698 0.000 0.904 0.096
#> ERR863683 1 0.0000 0.9193 1.000 0.000 0.000
#> ERR863684 1 0.6008 0.5101 0.628 0.372 0.000
#> ERR863702 1 0.0892 0.9070 0.980 0.000 0.020
#> ERR863687 3 0.0592 0.8504 0.000 0.012 0.988
#> ERR863706 3 0.4887 0.6982 0.228 0.000 0.772
#> ERR863708 2 0.3116 0.8640 0.000 0.892 0.108
#> ERR863710 1 0.0000 0.9193 1.000 0.000 0.000
#> ERR863709 2 0.0000 0.8795 0.000 1.000 0.000
#> ERR863753 2 0.3192 0.8618 0.000 0.888 0.112
#> ERR863754 1 0.5216 0.6925 0.740 0.260 0.000
#> ERR863749 1 0.0000 0.9193 1.000 0.000 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> ERR863675 2 0.4999 -0.0939 0.000 0.508 0.000 0.492
#> ERR863705 3 0.2021 0.8238 0.000 0.012 0.932 0.056
#> ERR863704 2 0.2918 0.5511 0.000 0.876 0.116 0.008
#> ERR863679 3 0.0524 0.8321 0.000 0.004 0.988 0.008
#> ERR863680 2 0.1970 0.6034 0.000 0.932 0.008 0.060
#> ERR863676 2 0.1297 0.6103 0.000 0.964 0.020 0.016
#> ERR863677 2 0.4998 -0.0930 0.000 0.512 0.000 0.488
#> ERR863688 1 0.2053 0.8730 0.924 0.000 0.004 0.072
#> ERR863690 1 0.2775 0.8341 0.896 0.084 0.000 0.020
#> ERR863692 4 0.5861 0.1627 0.480 0.032 0.000 0.488
#> ERR863703 1 0.1406 0.9019 0.960 0.024 0.000 0.016
#> ERR863712 2 0.4999 -0.0939 0.000 0.508 0.000 0.492
#> ERR863711 1 0.0188 0.9240 0.996 0.000 0.004 0.000
#> ERR863760 3 0.4422 0.7045 0.000 0.256 0.736 0.008
#> ERR863727 1 0.0000 0.9245 1.000 0.000 0.000 0.000
#> ERR863766 3 0.1489 0.8206 0.044 0.004 0.952 0.000
#> ERR863767 1 0.0188 0.9239 0.996 0.000 0.000 0.004
#> ERR863752 2 0.4567 0.3423 0.000 0.716 0.276 0.008
#> ERR863757 1 0.2412 0.8453 0.908 0.000 0.084 0.008
#> ERR863758 1 0.0188 0.9236 0.996 0.000 0.000 0.004
#> ERR863755 1 0.0000 0.9245 1.000 0.000 0.000 0.000
#> ERR863756 3 0.4137 0.6703 0.000 0.012 0.780 0.208
#> ERR863707 3 0.0804 0.8324 0.000 0.012 0.980 0.008
#> ERR863681 3 0.6621 0.4436 0.012 0.056 0.528 0.404
#> ERR863719 4 0.6560 0.1595 0.460 0.000 0.076 0.464
#> ERR863759 3 0.5755 0.3862 0.000 0.444 0.528 0.028
#> ERR863718 1 0.0188 0.9236 0.996 0.000 0.000 0.004
#> ERR863717 1 0.0336 0.9225 0.992 0.000 0.000 0.008
#> ERR863715 2 0.5512 0.1313 0.000 0.492 0.016 0.492
#> ERR863716 1 0.0000 0.9245 1.000 0.000 0.000 0.000
#> ERR863722 4 0.4477 0.1537 0.000 0.312 0.000 0.688
#> ERR863721 4 0.6271 0.1327 0.056 0.452 0.000 0.492
#> ERR863720 2 0.1059 0.6127 0.000 0.972 0.016 0.012
#> ERR863723 1 0.0188 0.9240 0.996 0.000 0.004 0.000
#> ERR863761 3 0.1807 0.8307 0.000 0.052 0.940 0.008
#> ERR863735 1 0.0000 0.9245 1.000 0.000 0.000 0.000
#> ERR863734 3 0.0804 0.8326 0.012 0.008 0.980 0.000
#> ERR863736 3 0.1970 0.8292 0.000 0.060 0.932 0.008
#> ERR863729 4 0.6529 -0.1569 0.000 0.388 0.080 0.532
#> ERR863728 1 0.6432 0.0951 0.540 0.400 0.008 0.052
#> ERR863731 1 0.1284 0.9042 0.964 0.012 0.000 0.024
#> ERR863764 4 0.5693 0.0208 0.000 0.472 0.024 0.504
#> ERR863740 1 0.0592 0.9174 0.984 0.000 0.016 0.000
#> ERR863765 3 0.4158 0.6343 0.224 0.000 0.768 0.008
#> ERR863762 3 0.2124 0.8143 0.000 0.008 0.924 0.068
#> ERR863724 4 0.8081 -0.1690 0.332 0.004 0.328 0.336
#> ERR863733 4 0.6179 0.0805 0.000 0.392 0.056 0.552
#> ERR863732 3 0.1474 0.8234 0.000 0.000 0.948 0.052
#> ERR863730 1 0.0376 0.9230 0.992 0.000 0.004 0.004
#> ERR863742 1 0.1867 0.8674 0.928 0.000 0.072 0.000
#> ERR863763 2 0.4999 -0.0939 0.000 0.508 0.000 0.492
#> ERR863741 4 0.4527 0.1397 0.020 0.192 0.008 0.780
#> ERR863743 1 0.0927 0.9137 0.976 0.008 0.000 0.016
#> ERR863745 2 0.3463 0.5805 0.000 0.864 0.040 0.096
#> ERR863744 1 0.0657 0.9200 0.984 0.000 0.012 0.004
#> ERR863746 1 0.0188 0.9240 0.996 0.000 0.004 0.000
#> ERR863748 4 0.5792 0.1837 0.000 0.056 0.296 0.648
#> ERR863747 3 0.4567 0.6862 0.000 0.276 0.716 0.008
#> ERR863694 4 0.2973 0.2713 0.000 0.144 0.000 0.856
#> ERR863693 4 0.6273 0.1225 0.056 0.456 0.000 0.488
#> ERR863686 1 0.0000 0.9245 1.000 0.000 0.000 0.000
#> ERR863678 1 0.4785 0.6898 0.784 0.164 0.008 0.044
#> ERR863685 3 0.1209 0.8329 0.000 0.032 0.964 0.004
#> ERR863689 1 0.7312 -0.2298 0.436 0.412 0.000 0.152
#> ERR863691 4 0.7441 0.2948 0.180 0.352 0.000 0.468
#> ERR863682 1 0.0000 0.9245 1.000 0.000 0.000 0.000
#> ERR863695 2 0.1576 0.6010 0.000 0.948 0.004 0.048
#> ERR863683 1 0.0188 0.9240 0.996 0.000 0.004 0.000
#> ERR863684 4 0.7219 0.2782 0.148 0.364 0.000 0.488
#> ERR863702 1 0.1398 0.8995 0.956 0.000 0.040 0.004
#> ERR863687 3 0.4606 0.6946 0.000 0.264 0.724 0.012
#> ERR863706 3 0.2921 0.7448 0.140 0.000 0.860 0.000
#> ERR863708 2 0.0895 0.6141 0.000 0.976 0.020 0.004
#> ERR863710 1 0.0000 0.9245 1.000 0.000 0.000 0.000
#> ERR863709 2 0.2973 0.4927 0.000 0.856 0.000 0.144
#> ERR863753 2 0.1635 0.6078 0.000 0.948 0.044 0.008
#> ERR863754 4 0.7517 0.3181 0.212 0.304 0.000 0.484
#> ERR863749 1 0.0000 0.9245 1.000 0.000 0.000 0.000
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> ERR863675 4 0.1908 0.756 0.000 0.092 0.000 0.908 0.000
#> ERR863705 3 0.2403 0.738 0.000 0.012 0.904 0.012 0.072
#> ERR863704 2 0.1267 0.765 0.000 0.960 0.012 0.024 0.004
#> ERR863679 3 0.1623 0.745 0.000 0.016 0.948 0.016 0.020
#> ERR863680 2 0.2850 0.769 0.000 0.872 0.000 0.092 0.036
#> ERR863676 2 0.1768 0.790 0.000 0.924 0.000 0.072 0.004
#> ERR863677 4 0.1908 0.756 0.000 0.092 0.000 0.908 0.000
#> ERR863688 1 0.1907 0.889 0.928 0.000 0.000 0.028 0.044
#> ERR863690 1 0.2471 0.856 0.864 0.000 0.000 0.136 0.000
#> ERR863692 4 0.2605 0.701 0.148 0.000 0.000 0.852 0.000
#> ERR863703 1 0.2020 0.886 0.900 0.000 0.000 0.100 0.000
#> ERR863712 4 0.1908 0.756 0.000 0.092 0.000 0.908 0.000
#> ERR863711 1 0.0703 0.919 0.976 0.000 0.000 0.024 0.000
#> ERR863760 2 0.4326 0.373 0.000 0.708 0.264 0.000 0.028
#> ERR863727 1 0.0451 0.917 0.988 0.000 0.000 0.008 0.004
#> ERR863766 3 0.0162 0.749 0.004 0.000 0.996 0.000 0.000
#> ERR863767 1 0.1341 0.911 0.944 0.000 0.000 0.056 0.000
#> ERR863752 2 0.1956 0.741 0.000 0.928 0.052 0.012 0.008
#> ERR863757 1 0.4549 0.670 0.752 0.004 0.196 0.016 0.032
#> ERR863758 1 0.1410 0.910 0.940 0.000 0.000 0.060 0.000
#> ERR863755 1 0.0162 0.919 0.996 0.000 0.000 0.000 0.004
#> ERR863756 3 0.5632 0.519 0.000 0.020 0.596 0.052 0.332
#> ERR863707 3 0.1815 0.743 0.000 0.016 0.940 0.024 0.020
#> ERR863681 3 0.7140 0.432 0.036 0.148 0.576 0.028 0.212
#> ERR863719 4 0.4792 0.648 0.052 0.008 0.180 0.748 0.012
#> ERR863759 2 0.5530 0.237 0.000 0.588 0.352 0.028 0.032
#> ERR863718 1 0.0880 0.918 0.968 0.000 0.000 0.032 0.000
#> ERR863717 1 0.1768 0.905 0.924 0.000 0.000 0.072 0.004
#> ERR863715 5 0.5297 0.450 0.000 0.404 0.008 0.036 0.552
#> ERR863716 1 0.0000 0.919 1.000 0.000 0.000 0.000 0.000
#> ERR863722 4 0.3690 0.619 0.000 0.020 0.000 0.780 0.200
#> ERR863721 4 0.1992 0.772 0.044 0.032 0.000 0.924 0.000
#> ERR863720 2 0.1638 0.789 0.000 0.932 0.000 0.064 0.004
#> ERR863723 1 0.0162 0.919 0.996 0.000 0.000 0.000 0.004
#> ERR863761 3 0.3229 0.702 0.000 0.128 0.840 0.000 0.032
#> ERR863735 1 0.0000 0.919 1.000 0.000 0.000 0.000 0.000
#> ERR863734 3 0.1087 0.749 0.000 0.008 0.968 0.008 0.016
#> ERR863736 3 0.3656 0.684 0.000 0.168 0.800 0.000 0.032
#> ERR863729 5 0.5129 0.607 0.000 0.264 0.024 0.036 0.676
#> ERR863728 1 0.6615 0.517 0.612 0.144 0.012 0.200 0.032
#> ERR863731 1 0.1478 0.908 0.936 0.000 0.000 0.064 0.000
#> ERR863764 4 0.3769 0.653 0.000 0.032 0.180 0.788 0.000
#> ERR863740 1 0.0162 0.919 0.996 0.000 0.000 0.000 0.004
#> ERR863765 3 0.1956 0.726 0.076 0.000 0.916 0.000 0.008
#> ERR863762 3 0.5146 0.560 0.000 0.016 0.636 0.032 0.316
#> ERR863724 3 0.8176 0.197 0.324 0.076 0.416 0.028 0.156
#> ERR863733 4 0.6379 0.486 0.000 0.044 0.180 0.624 0.152
#> ERR863732 3 0.3754 0.698 0.000 0.016 0.824 0.036 0.124
#> ERR863730 1 0.3458 0.824 0.840 0.000 0.016 0.024 0.120
#> ERR863742 1 0.1628 0.888 0.936 0.000 0.056 0.008 0.000
#> ERR863763 4 0.1908 0.756 0.000 0.092 0.000 0.908 0.000
#> ERR863741 5 0.5214 0.408 0.000 0.052 0.008 0.300 0.640
#> ERR863743 1 0.1341 0.911 0.944 0.000 0.000 0.056 0.000
#> ERR863745 2 0.3021 0.765 0.000 0.872 0.004 0.060 0.064
#> ERR863744 1 0.3247 0.878 0.868 0.000 0.028 0.032 0.072
#> ERR863746 1 0.0451 0.920 0.988 0.000 0.000 0.008 0.004
#> ERR863748 4 0.5752 0.463 0.000 0.012 0.252 0.632 0.104
#> ERR863747 3 0.4879 0.422 0.000 0.360 0.612 0.008 0.020
#> ERR863694 4 0.3081 0.654 0.000 0.012 0.000 0.832 0.156
#> ERR863693 4 0.2036 0.772 0.056 0.024 0.000 0.920 0.000
#> ERR863686 1 0.1673 0.903 0.944 0.000 0.008 0.032 0.016
#> ERR863678 1 0.4154 0.828 0.816 0.024 0.032 0.116 0.012
#> ERR863685 3 0.1331 0.745 0.000 0.040 0.952 0.000 0.008
#> ERR863689 4 0.7385 0.136 0.380 0.080 0.000 0.420 0.120
#> ERR863691 4 0.3278 0.746 0.092 0.028 0.000 0.860 0.020
#> ERR863682 1 0.0000 0.919 1.000 0.000 0.000 0.000 0.000
#> ERR863695 2 0.3670 0.722 0.000 0.820 0.000 0.112 0.068
#> ERR863683 1 0.0162 0.919 0.996 0.000 0.000 0.000 0.004
#> ERR863684 4 0.1809 0.770 0.060 0.012 0.000 0.928 0.000
#> ERR863702 1 0.4709 0.716 0.748 0.000 0.060 0.016 0.176
#> ERR863687 3 0.4632 0.227 0.000 0.448 0.540 0.012 0.000
#> ERR863706 3 0.3975 0.650 0.144 0.016 0.808 0.004 0.028
#> ERR863708 2 0.1952 0.787 0.000 0.912 0.000 0.084 0.004
#> ERR863710 1 0.0404 0.920 0.988 0.000 0.000 0.012 0.000
#> ERR863709 2 0.4394 0.568 0.000 0.732 0.000 0.220 0.048
#> ERR863753 2 0.1430 0.788 0.000 0.944 0.000 0.052 0.004
#> ERR863754 4 0.2293 0.760 0.084 0.016 0.000 0.900 0.000
#> ERR863749 1 0.0794 0.919 0.972 0.000 0.000 0.028 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> ERR863675 4 0.0458 0.8655 0.000 0.016 0.000 0.984 0.000 0.000
#> ERR863705 3 0.5451 0.0603 0.000 0.000 0.532 0.000 0.140 0.328
#> ERR863704 2 0.1910 0.7420 0.000 0.892 0.108 0.000 0.000 0.000
#> ERR863679 6 0.3998 0.0699 0.000 0.000 0.492 0.004 0.000 0.504
#> ERR863680 2 0.0405 0.7702 0.000 0.988 0.000 0.008 0.004 0.000
#> ERR863676 2 0.0777 0.7767 0.000 0.972 0.024 0.004 0.000 0.000
#> ERR863677 4 0.0717 0.8652 0.000 0.016 0.000 0.976 0.000 0.008
#> ERR863688 1 0.3996 0.8033 0.784 0.000 0.088 0.000 0.112 0.016
#> ERR863690 1 0.1663 0.8343 0.940 0.024 0.008 0.024 0.004 0.000
#> ERR863692 4 0.0767 0.8612 0.012 0.000 0.004 0.976 0.000 0.008
#> ERR863703 1 0.2317 0.7991 0.892 0.088 0.008 0.008 0.004 0.000
#> ERR863712 4 0.0458 0.8655 0.000 0.016 0.000 0.984 0.000 0.000
#> ERR863711 1 0.0146 0.8549 0.996 0.000 0.004 0.000 0.000 0.000
#> ERR863760 2 0.3512 0.5898 0.000 0.720 0.272 0.000 0.000 0.008
#> ERR863727 1 0.3610 0.8141 0.812 0.000 0.136 0.008 0.020 0.024
#> ERR863766 3 0.3817 -0.0541 0.000 0.000 0.568 0.000 0.000 0.432
#> ERR863767 1 0.0436 0.8531 0.988 0.000 0.004 0.004 0.004 0.000
#> ERR863752 2 0.1196 0.7739 0.000 0.952 0.040 0.000 0.000 0.008
#> ERR863757 3 0.4627 0.0468 0.400 0.000 0.568 0.004 0.016 0.012
#> ERR863758 1 0.0291 0.8541 0.992 0.000 0.000 0.004 0.004 0.000
#> ERR863755 1 0.0806 0.8559 0.972 0.000 0.020 0.000 0.000 0.008
#> ERR863756 6 0.2587 0.3692 0.000 0.004 0.008 0.004 0.120 0.864
#> ERR863707 6 0.4076 0.2675 0.000 0.004 0.428 0.004 0.000 0.564
#> ERR863681 3 0.1983 0.3961 0.000 0.020 0.908 0.000 0.072 0.000
#> ERR863719 4 0.1148 0.8539 0.000 0.000 0.016 0.960 0.004 0.020
#> ERR863759 2 0.4088 0.3440 0.000 0.556 0.000 0.004 0.004 0.436
#> ERR863718 1 0.0291 0.8541 0.992 0.000 0.000 0.004 0.004 0.000
#> ERR863717 1 0.2293 0.8483 0.896 0.000 0.080 0.004 0.004 0.016
#> ERR863715 5 0.3684 0.3829 0.000 0.372 0.000 0.000 0.628 0.000
#> ERR863716 1 0.2666 0.8356 0.864 0.000 0.112 0.000 0.012 0.012
#> ERR863722 4 0.3136 0.6897 0.000 0.000 0.000 0.768 0.228 0.004
#> ERR863721 4 0.0291 0.8655 0.004 0.004 0.000 0.992 0.000 0.000
#> ERR863720 2 0.1674 0.7629 0.000 0.924 0.068 0.004 0.004 0.000
#> ERR863723 1 0.2445 0.8376 0.868 0.000 0.120 0.000 0.008 0.004
#> ERR863761 3 0.3102 0.3732 0.000 0.028 0.816 0.000 0.000 0.156
#> ERR863735 1 0.0146 0.8544 0.996 0.000 0.000 0.000 0.004 0.000
#> ERR863734 3 0.3857 -0.1812 0.000 0.000 0.532 0.000 0.000 0.468
#> ERR863736 3 0.3633 0.3623 0.000 0.056 0.792 0.004 0.000 0.148
#> ERR863729 5 0.2487 0.7046 0.000 0.092 0.000 0.000 0.876 0.032
#> ERR863728 1 0.5301 0.6067 0.712 0.156 0.016 0.064 0.008 0.044
#> ERR863731 1 0.1210 0.8449 0.960 0.020 0.008 0.008 0.004 0.000
#> ERR863764 4 0.2613 0.7667 0.000 0.000 0.012 0.848 0.000 0.140
#> ERR863740 1 0.2847 0.8308 0.852 0.000 0.120 0.000 0.012 0.016
#> ERR863765 3 0.4520 0.2811 0.052 0.000 0.688 0.000 0.012 0.248
#> ERR863762 6 0.4018 0.4569 0.000 0.000 0.112 0.004 0.116 0.768
#> ERR863724 3 0.3775 0.3524 0.116 0.012 0.804 0.000 0.064 0.004
#> ERR863733 4 0.4600 0.4040 0.000 0.012 0.000 0.552 0.020 0.416
#> ERR863732 6 0.3738 0.4311 0.000 0.004 0.312 0.004 0.000 0.680
#> ERR863730 1 0.6478 0.3145 0.428 0.000 0.128 0.020 0.024 0.400
#> ERR863742 1 0.2834 0.8319 0.848 0.000 0.128 0.000 0.008 0.016
#> ERR863763 4 0.0458 0.8655 0.000 0.016 0.000 0.984 0.000 0.000
#> ERR863741 5 0.2408 0.6417 0.000 0.000 0.012 0.108 0.876 0.004
#> ERR863743 1 0.0291 0.8541 0.992 0.000 0.000 0.004 0.004 0.000
#> ERR863745 2 0.1251 0.7719 0.000 0.956 0.012 0.008 0.024 0.000
#> ERR863744 1 0.1829 0.8506 0.920 0.000 0.000 0.000 0.056 0.024
#> ERR863746 1 0.3188 0.8361 0.848 0.000 0.100 0.004 0.024 0.024
#> ERR863748 4 0.6475 0.0898 0.000 0.004 0.016 0.432 0.268 0.280
#> ERR863747 2 0.5176 0.3612 0.000 0.548 0.100 0.000 0.000 0.352
#> ERR863694 4 0.1003 0.8565 0.000 0.000 0.016 0.964 0.020 0.000
#> ERR863693 4 0.0405 0.8658 0.004 0.008 0.000 0.988 0.000 0.000
#> ERR863686 1 0.4533 0.7612 0.740 0.000 0.184 0.024 0.020 0.032
#> ERR863678 1 0.3506 0.7677 0.844 0.084 0.008 0.032 0.024 0.008
#> ERR863685 3 0.3852 0.0829 0.000 0.004 0.612 0.000 0.000 0.384
#> ERR863689 1 0.7726 0.0276 0.424 0.160 0.016 0.252 0.008 0.140
#> ERR863691 4 0.4372 0.7244 0.028 0.128 0.016 0.784 0.032 0.012
#> ERR863682 1 0.2266 0.8412 0.880 0.000 0.108 0.000 0.012 0.000
#> ERR863695 2 0.2395 0.7097 0.000 0.892 0.012 0.020 0.076 0.000
#> ERR863683 1 0.2612 0.8389 0.868 0.000 0.108 0.000 0.008 0.016
#> ERR863684 4 0.0622 0.8627 0.008 0.000 0.012 0.980 0.000 0.000
#> ERR863702 1 0.6137 0.4837 0.524 0.000 0.156 0.004 0.024 0.292
#> ERR863687 2 0.5676 0.3247 0.000 0.540 0.176 0.004 0.000 0.280
#> ERR863706 3 0.4043 0.4004 0.128 0.000 0.756 0.000 0.000 0.116
#> ERR863708 2 0.0260 0.7710 0.000 0.992 0.000 0.008 0.000 0.000
#> ERR863710 1 0.0146 0.8544 0.996 0.000 0.000 0.000 0.004 0.000
#> ERR863709 2 0.3075 0.6388 0.000 0.844 0.008 0.108 0.040 0.000
#> ERR863753 2 0.0692 0.7766 0.000 0.976 0.020 0.004 0.000 0.000
#> ERR863754 4 0.2556 0.8099 0.028 0.076 0.012 0.884 0.000 0.000
#> ERR863749 1 0.0291 0.8541 0.992 0.000 0.000 0.004 0.004 0.000
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)
An example of the output of tb
is:
#> which_row fdr mean_1 mean_2 scaled_mean_1 scaled_mean_2 km
#> 1 38 0.042760348 8.373488 9.131774 -0.5533452 0.5164555 1
#> 2 40 0.018707592 7.106213 8.469186 -0.6173731 0.5762149 1
#> 3 55 0.019134737 10.221463 11.207825 -0.6159697 0.5749050 1
#> 4 59 0.006059896 5.921854 7.869574 -0.6899429 0.6439467 1
#> 5 60 0.018055526 8.928898 10.211722 -0.6204761 0.5791110 1
#> 6 98 0.009384629 15.714769 14.887706 0.6635654 -0.6193277 2
...
The columns in tb
are:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.km
: Row groups if k-means clustering is applied to rows.UMAP plot which shows how samples are separated.
dimension_reduction(res, k = 2, method = "UMAP")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
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 17118 rows and 78 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 1.000 1.000 1.000 0.0516 0.949 0.949
#> 3 3 0.497 0.753 0.884 5.8687 0.762 0.749
#> 4 4 0.392 0.527 0.773 0.4609 0.748 0.653
#> 5 5 0.583 0.630 0.804 0.2266 0.890 0.783
#> 6 6 0.565 0.581 0.786 0.1042 0.832 0.605
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
#> ERR863675 1 0 1 1 0
#> ERR863705 1 0 1 1 0
#> ERR863704 1 0 1 1 0
#> ERR863679 1 0 1 1 0
#> ERR863680 1 0 1 1 0
#> ERR863676 1 0 1 1 0
#> ERR863677 1 0 1 1 0
#> ERR863688 1 0 1 1 0
#> ERR863690 1 0 1 1 0
#> ERR863692 1 0 1 1 0
#> ERR863703 1 0 1 1 0
#> ERR863712 1 0 1 1 0
#> ERR863711 1 0 1 1 0
#> ERR863760 1 0 1 1 0
#> ERR863727 1 0 1 1 0
#> ERR863766 1 0 1 1 0
#> ERR863767 1 0 1 1 0
#> ERR863752 1 0 1 1 0
#> ERR863757 1 0 1 1 0
#> ERR863758 1 0 1 1 0
#> ERR863755 1 0 1 1 0
#> ERR863756 1 0 1 1 0
#> ERR863707 1 0 1 1 0
#> ERR863681 2 0 1 0 1
#> ERR863719 1 0 1 1 0
#> ERR863759 1 0 1 1 0
#> ERR863718 1 0 1 1 0
#> ERR863717 1 0 1 1 0
#> ERR863715 1 0 1 1 0
#> ERR863716 1 0 1 1 0
#> ERR863722 1 0 1 1 0
#> ERR863721 1 0 1 1 0
#> ERR863720 1 0 1 1 0
#> ERR863723 1 0 1 1 0
#> ERR863761 1 0 1 1 0
#> ERR863735 1 0 1 1 0
#> ERR863734 1 0 1 1 0
#> ERR863736 1 0 1 1 0
#> ERR863729 1 0 1 1 0
#> ERR863728 1 0 1 1 0
#> ERR863731 1 0 1 1 0
#> ERR863764 1 0 1 1 0
#> ERR863740 1 0 1 1 0
#> ERR863765 1 0 1 1 0
#> ERR863762 1 0 1 1 0
#> ERR863724 2 0 1 0 1
#> ERR863733 1 0 1 1 0
#> ERR863732 1 0 1 1 0
#> ERR863730 1 0 1 1 0
#> ERR863742 1 0 1 1 0
#> ERR863763 1 0 1 1 0
#> ERR863741 1 0 1 1 0
#> ERR863743 1 0 1 1 0
#> ERR863745 1 0 1 1 0
#> ERR863744 1 0 1 1 0
#> ERR863746 1 0 1 1 0
#> ERR863748 1 0 1 1 0
#> ERR863747 1 0 1 1 0
#> ERR863694 1 0 1 1 0
#> ERR863693 1 0 1 1 0
#> ERR863686 1 0 1 1 0
#> ERR863678 1 0 1 1 0
#> ERR863685 1 0 1 1 0
#> ERR863689 1 0 1 1 0
#> ERR863691 1 0 1 1 0
#> ERR863682 1 0 1 1 0
#> ERR863695 1 0 1 1 0
#> ERR863683 1 0 1 1 0
#> ERR863684 1 0 1 1 0
#> ERR863702 1 0 1 1 0
#> ERR863687 1 0 1 1 0
#> ERR863706 1 0 1 1 0
#> ERR863708 1 0 1 1 0
#> ERR863710 1 0 1 1 0
#> ERR863709 1 0 1 1 0
#> ERR863753 1 0 1 1 0
#> ERR863754 1 0 1 1 0
#> ERR863749 1 0 1 1 0
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> ERR863675 1 0.2066 0.864874 0.940 0 0.060
#> ERR863705 3 0.2625 0.728034 0.084 0 0.916
#> ERR863704 1 0.3482 0.826589 0.872 0 0.128
#> ERR863679 3 0.2537 0.725504 0.080 0 0.920
#> ERR863680 1 0.3412 0.829198 0.876 0 0.124
#> ERR863676 1 0.3482 0.826589 0.872 0 0.128
#> ERR863677 1 0.2261 0.860703 0.932 0 0.068
#> ERR863688 1 0.1031 0.873038 0.976 0 0.024
#> ERR863690 1 0.0592 0.872882 0.988 0 0.012
#> ERR863692 1 0.1289 0.869557 0.968 0 0.032
#> ERR863703 1 0.0592 0.872882 0.988 0 0.012
#> ERR863712 1 0.2356 0.859929 0.928 0 0.072
#> ERR863711 1 0.0747 0.872628 0.984 0 0.016
#> ERR863760 1 0.3412 0.827321 0.876 0 0.124
#> ERR863727 1 0.0747 0.872628 0.984 0 0.016
#> ERR863766 3 0.2796 0.728780 0.092 0 0.908
#> ERR863767 1 0.0747 0.872628 0.984 0 0.016
#> ERR863752 1 0.3482 0.826589 0.872 0 0.128
#> ERR863757 1 0.4702 0.670941 0.788 0 0.212
#> ERR863758 1 0.0747 0.872628 0.984 0 0.016
#> ERR863755 1 0.0747 0.872628 0.984 0 0.016
#> ERR863756 1 0.6111 0.302621 0.604 0 0.396
#> ERR863707 3 0.2537 0.725504 0.080 0 0.920
#> ERR863681 2 0.0000 1.000000 0.000 1 0.000
#> ERR863719 1 0.2448 0.859257 0.924 0 0.076
#> ERR863759 1 0.6252 0.200543 0.556 0 0.444
#> ERR863718 1 0.0747 0.872628 0.984 0 0.016
#> ERR863717 1 0.0892 0.873099 0.980 0 0.020
#> ERR863715 1 0.3482 0.826589 0.872 0 0.128
#> ERR863716 1 0.0747 0.872628 0.984 0 0.016
#> ERR863722 1 0.6192 0.174051 0.580 0 0.420
#> ERR863721 1 0.2261 0.860301 0.932 0 0.068
#> ERR863720 1 0.3551 0.823833 0.868 0 0.132
#> ERR863723 1 0.1964 0.855685 0.944 0 0.056
#> ERR863761 3 0.2537 0.725504 0.080 0 0.920
#> ERR863735 1 0.0747 0.872628 0.984 0 0.016
#> ERR863734 3 0.2796 0.728780 0.092 0 0.908
#> ERR863736 1 0.3482 0.812206 0.872 0 0.128
#> ERR863729 1 0.1529 0.867977 0.960 0 0.040
#> ERR863728 1 0.0747 0.873255 0.984 0 0.016
#> ERR863731 1 0.0747 0.872628 0.984 0 0.016
#> ERR863764 1 0.5882 0.419520 0.652 0 0.348
#> ERR863740 1 0.2356 0.842178 0.928 0 0.072
#> ERR863765 1 0.5926 0.324727 0.644 0 0.356
#> ERR863762 3 0.5497 0.583284 0.292 0 0.708
#> ERR863724 2 0.0000 1.000000 0.000 1 0.000
#> ERR863733 1 0.5291 0.587433 0.732 0 0.268
#> ERR863732 1 0.6280 -0.000135 0.540 0 0.460
#> ERR863730 1 0.0747 0.872628 0.984 0 0.016
#> ERR863742 1 0.2448 0.840976 0.924 0 0.076
#> ERR863763 1 0.2448 0.859336 0.924 0 0.076
#> ERR863741 1 0.1529 0.867977 0.960 0 0.040
#> ERR863743 1 0.0747 0.872628 0.984 0 0.016
#> ERR863745 1 0.5968 0.416546 0.636 0 0.364
#> ERR863744 1 0.0892 0.872157 0.980 0 0.020
#> ERR863746 1 0.0747 0.872628 0.984 0 0.016
#> ERR863748 1 0.6307 -0.070902 0.512 0 0.488
#> ERR863747 3 0.6291 0.193459 0.468 0 0.532
#> ERR863694 1 0.2448 0.859257 0.924 0 0.076
#> ERR863693 1 0.2261 0.860301 0.932 0 0.068
#> ERR863686 1 0.1411 0.869385 0.964 0 0.036
#> ERR863678 1 0.5760 0.388447 0.672 0 0.328
#> ERR863685 3 0.2537 0.725504 0.080 0 0.920
#> ERR863689 1 0.0892 0.873099 0.980 0 0.020
#> ERR863691 1 0.1411 0.870105 0.964 0 0.036
#> ERR863682 1 0.0747 0.872628 0.984 0 0.016
#> ERR863695 1 0.3412 0.829198 0.876 0 0.124
#> ERR863683 1 0.1031 0.870705 0.976 0 0.024
#> ERR863684 1 0.2356 0.859929 0.928 0 0.072
#> ERR863702 1 0.1411 0.869385 0.964 0 0.036
#> ERR863687 3 0.5859 0.547113 0.344 0 0.656
#> ERR863706 3 0.5905 0.550961 0.352 0 0.648
#> ERR863708 1 0.3482 0.826589 0.872 0 0.128
#> ERR863710 1 0.0747 0.872628 0.984 0 0.016
#> ERR863709 1 0.1753 0.866834 0.952 0 0.048
#> ERR863753 1 0.3482 0.826589 0.872 0 0.128
#> ERR863754 1 0.1031 0.872666 0.976 0 0.024
#> ERR863749 1 0.0747 0.872628 0.984 0 0.016
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> ERR863675 1 0.5144 0.5517 0.732 0.216 0.052 0
#> ERR863705 3 0.2053 0.6341 0.072 0.004 0.924 0
#> ERR863704 2 0.6276 0.6391 0.464 0.480 0.056 0
#> ERR863679 3 0.1867 0.6339 0.072 0.000 0.928 0
#> ERR863680 2 0.6235 0.6529 0.420 0.524 0.056 0
#> ERR863676 2 0.6273 0.6569 0.456 0.488 0.056 0
#> ERR863677 1 0.5598 0.5176 0.704 0.220 0.076 0
#> ERR863688 1 0.0524 0.7460 0.988 0.004 0.008 0
#> ERR863690 1 0.0592 0.7445 0.984 0.016 0.000 0
#> ERR863692 1 0.2565 0.7204 0.912 0.056 0.032 0
#> ERR863703 1 0.0592 0.7445 0.984 0.016 0.000 0
#> ERR863712 1 0.5631 0.5124 0.700 0.224 0.076 0
#> ERR863711 1 0.0188 0.7452 0.996 0.004 0.000 0
#> ERR863760 1 0.5705 0.0511 0.676 0.260 0.064 0
#> ERR863727 1 0.0000 0.7460 1.000 0.000 0.000 0
#> ERR863766 3 0.2081 0.6357 0.084 0.000 0.916 0
#> ERR863767 1 0.0707 0.7440 0.980 0.020 0.000 0
#> ERR863752 2 0.6273 0.6569 0.456 0.488 0.056 0
#> ERR863757 1 0.4123 0.4797 0.772 0.008 0.220 0
#> ERR863758 1 0.0000 0.7460 1.000 0.000 0.000 0
#> ERR863755 1 0.0000 0.7460 1.000 0.000 0.000 0
#> ERR863756 3 0.7729 0.0706 0.372 0.228 0.400 0
#> ERR863707 3 0.1867 0.6339 0.072 0.000 0.928 0
#> ERR863681 4 0.0000 1.0000 0.000 0.000 0.000 1
#> ERR863719 1 0.5628 0.5200 0.704 0.216 0.080 0
#> ERR863759 2 0.7638 0.1033 0.208 0.420 0.372 0
#> ERR863718 1 0.0000 0.7460 1.000 0.000 0.000 0
#> ERR863717 1 0.1209 0.7420 0.964 0.032 0.004 0
#> ERR863715 1 0.6275 -0.6196 0.484 0.460 0.056 0
#> ERR863716 1 0.0188 0.7452 0.996 0.004 0.000 0
#> ERR863722 3 0.7823 0.3054 0.272 0.320 0.408 0
#> ERR863721 1 0.5318 0.5512 0.732 0.196 0.072 0
#> ERR863720 1 0.6315 -0.4840 0.540 0.396 0.064 0
#> ERR863723 1 0.1398 0.7260 0.956 0.004 0.040 0
#> ERR863761 3 0.1867 0.6339 0.072 0.000 0.928 0
#> ERR863735 1 0.0000 0.7460 1.000 0.000 0.000 0
#> ERR863734 3 0.2081 0.6357 0.084 0.000 0.916 0
#> ERR863736 1 0.6752 -0.2568 0.588 0.280 0.132 0
#> ERR863729 1 0.5231 0.3788 0.676 0.296 0.028 0
#> ERR863728 1 0.1489 0.7387 0.952 0.044 0.004 0
#> ERR863731 1 0.0592 0.7450 0.984 0.016 0.000 0
#> ERR863764 1 0.7745 -0.2050 0.420 0.240 0.340 0
#> ERR863740 1 0.1890 0.7097 0.936 0.008 0.056 0
#> ERR863765 1 0.5040 0.1777 0.628 0.008 0.364 0
#> ERR863762 3 0.5740 0.5610 0.208 0.092 0.700 0
#> ERR863724 4 0.0000 1.0000 0.000 0.000 0.000 1
#> ERR863733 1 0.7698 -0.0781 0.452 0.292 0.256 0
#> ERR863732 3 0.7690 0.3659 0.264 0.280 0.456 0
#> ERR863730 1 0.0000 0.7460 1.000 0.000 0.000 0
#> ERR863742 1 0.1970 0.7071 0.932 0.008 0.060 0
#> ERR863763 1 0.5628 0.5155 0.704 0.216 0.080 0
#> ERR863741 1 0.5182 0.3955 0.684 0.288 0.028 0
#> ERR863743 1 0.0188 0.7452 0.996 0.004 0.000 0
#> ERR863745 2 0.7745 0.0402 0.240 0.420 0.340 0
#> ERR863744 1 0.0657 0.7448 0.984 0.012 0.004 0
#> ERR863746 1 0.0000 0.7460 1.000 0.000 0.000 0
#> ERR863748 3 0.7375 0.3844 0.176 0.336 0.488 0
#> ERR863747 3 0.7394 0.2381 0.244 0.236 0.520 0
#> ERR863694 1 0.5628 0.5200 0.704 0.216 0.080 0
#> ERR863693 1 0.5318 0.5512 0.732 0.196 0.072 0
#> ERR863686 1 0.2385 0.7212 0.920 0.052 0.028 0
#> ERR863678 1 0.7531 -0.2468 0.476 0.208 0.316 0
#> ERR863685 3 0.1867 0.6339 0.072 0.000 0.928 0
#> ERR863689 1 0.1305 0.7416 0.960 0.036 0.004 0
#> ERR863691 1 0.2660 0.7186 0.908 0.056 0.036 0
#> ERR863682 1 0.0188 0.7452 0.996 0.004 0.000 0
#> ERR863695 2 0.2840 0.0364 0.044 0.900 0.056 0
#> ERR863683 1 0.0672 0.7420 0.984 0.008 0.008 0
#> ERR863684 1 0.5384 0.5488 0.728 0.196 0.076 0
#> ERR863702 1 0.2385 0.7212 0.920 0.052 0.028 0
#> ERR863687 3 0.6136 0.5336 0.080 0.288 0.632 0
#> ERR863706 3 0.4643 0.3650 0.344 0.000 0.656 0
#> ERR863708 2 0.6273 0.6569 0.456 0.488 0.056 0
#> ERR863710 1 0.0188 0.7452 0.996 0.004 0.000 0
#> ERR863709 1 0.5141 0.4634 0.700 0.268 0.032 0
#> ERR863753 2 0.6273 0.6569 0.456 0.488 0.056 0
#> ERR863754 1 0.2413 0.7228 0.916 0.064 0.020 0
#> ERR863749 1 0.0188 0.7452 0.996 0.004 0.000 0
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> ERR863675 1 0.5281 0.66393 0.680 0.088 0.008 NA 0
#> ERR863705 3 0.0486 0.63022 0.004 0.004 0.988 NA 0
#> ERR863704 2 0.1828 0.70253 0.032 0.936 0.004 NA 0
#> ERR863679 3 0.0324 0.63012 0.004 0.004 0.992 NA 0
#> ERR863680 2 0.2972 0.67132 0.024 0.864 0.004 NA 0
#> ERR863676 2 0.1356 0.70498 0.028 0.956 0.004 NA 0
#> ERR863677 1 0.5104 0.62534 0.632 0.060 0.000 NA 0
#> ERR863688 1 0.0579 0.83144 0.984 0.008 0.000 NA 0
#> ERR863690 1 0.0579 0.83060 0.984 0.008 0.000 NA 0
#> ERR863692 1 0.2464 0.80765 0.888 0.016 0.000 NA 0
#> ERR863703 1 0.0579 0.83060 0.984 0.008 0.000 NA 0
#> ERR863712 1 0.5063 0.62503 0.632 0.056 0.000 NA 0
#> ERR863711 1 0.0162 0.82891 0.996 0.000 0.000 NA 0
#> ERR863760 2 0.6176 0.51710 0.104 0.620 0.036 NA 0
#> ERR863727 1 0.0000 0.82958 1.000 0.000 0.000 NA 0
#> ERR863766 3 0.0854 0.62964 0.012 0.004 0.976 NA 0
#> ERR863767 1 0.1117 0.82921 0.964 0.016 0.000 NA 0
#> ERR863752 2 0.1243 0.70546 0.028 0.960 0.004 NA 0
#> ERR863757 1 0.4170 0.57086 0.712 0.004 0.272 NA 0
#> ERR863758 1 0.0324 0.83002 0.992 0.004 0.000 NA 0
#> ERR863755 1 0.0000 0.82958 1.000 0.000 0.000 NA 0
#> ERR863756 3 0.7543 0.19592 0.324 0.036 0.324 NA 0
#> ERR863707 3 0.0324 0.63012 0.004 0.004 0.992 NA 0
#> ERR863681 5 0.0000 1.00000 0.000 0.000 0.000 NA 1
#> ERR863719 1 0.5186 0.61849 0.624 0.052 0.004 NA 0
#> ERR863759 2 0.5843 0.28836 0.024 0.592 0.320 NA 0
#> ERR863718 1 0.0579 0.83078 0.984 0.008 0.000 NA 0
#> ERR863717 1 0.1211 0.82822 0.960 0.016 0.000 NA 0
#> ERR863715 2 0.2353 0.69853 0.028 0.908 0.004 NA 0
#> ERR863716 1 0.0162 0.82891 0.996 0.000 0.000 NA 0
#> ERR863722 3 0.8012 0.34879 0.212 0.100 0.380 NA 0
#> ERR863721 1 0.4801 0.65672 0.668 0.048 0.000 NA 0
#> ERR863720 2 0.4518 0.63304 0.044 0.772 0.028 NA 0
#> ERR863723 1 0.1364 0.81431 0.952 0.000 0.036 NA 0
#> ERR863761 3 0.0324 0.63012 0.004 0.004 0.992 NA 0
#> ERR863735 1 0.0579 0.83078 0.984 0.008 0.000 NA 0
#> ERR863734 3 0.0854 0.62964 0.012 0.004 0.976 NA 0
#> ERR863736 2 0.6508 0.52267 0.044 0.608 0.188 NA 0
#> ERR863729 2 0.6303 0.37638 0.280 0.524 0.000 NA 0
#> ERR863728 1 0.1828 0.82425 0.936 0.028 0.004 NA 0
#> ERR863731 1 0.1018 0.82957 0.968 0.016 0.000 NA 0
#> ERR863764 1 0.7863 -0.21028 0.368 0.072 0.316 NA 0
#> ERR863740 1 0.1901 0.80187 0.928 0.004 0.056 NA 0
#> ERR863765 1 0.4730 0.24822 0.568 0.004 0.416 NA 0
#> ERR863762 3 0.5924 0.52743 0.168 0.052 0.676 NA 0
#> ERR863724 5 0.0000 1.00000 0.000 0.000 0.000 NA 1
#> ERR863733 1 0.7993 -0.00310 0.404 0.100 0.228 NA 0
#> ERR863732 3 0.7777 0.39573 0.216 0.080 0.428 NA 0
#> ERR863730 1 0.0000 0.82958 1.000 0.000 0.000 NA 0
#> ERR863742 1 0.1970 0.79981 0.924 0.004 0.060 NA 0
#> ERR863763 1 0.5276 0.62882 0.636 0.056 0.008 NA 0
#> ERR863741 2 0.6298 0.37060 0.292 0.520 0.000 NA 0
#> ERR863743 1 0.0451 0.82949 0.988 0.004 0.000 NA 0
#> ERR863745 2 0.6933 0.11244 0.028 0.456 0.360 NA 0
#> ERR863744 1 0.0833 0.82961 0.976 0.016 0.004 NA 0
#> ERR863746 1 0.0000 0.82958 1.000 0.000 0.000 NA 0
#> ERR863748 3 0.7185 0.39417 0.116 0.064 0.424 NA 0
#> ERR863747 3 0.6120 0.21502 0.028 0.332 0.564 NA 0
#> ERR863694 1 0.5186 0.61849 0.624 0.052 0.004 NA 0
#> ERR863693 1 0.4801 0.65672 0.668 0.048 0.000 NA 0
#> ERR863686 1 0.2438 0.80796 0.900 0.040 0.000 NA 0
#> ERR863678 1 0.7355 -0.14259 0.448 0.048 0.316 NA 0
#> ERR863685 3 0.0324 0.63012 0.004 0.004 0.992 NA 0
#> ERR863689 1 0.1469 0.82623 0.948 0.016 0.000 NA 0
#> ERR863691 1 0.2616 0.80680 0.888 0.036 0.000 NA 0
#> ERR863682 1 0.0162 0.82891 0.996 0.000 0.000 NA 0
#> ERR863695 2 0.4451 0.25516 0.000 0.504 0.004 NA 0
#> ERR863683 1 0.0693 0.82675 0.980 0.000 0.008 NA 0
#> ERR863684 1 0.4822 0.65412 0.664 0.048 0.000 NA 0
#> ERR863702 1 0.2438 0.80796 0.900 0.040 0.000 NA 0
#> ERR863687 3 0.5543 0.48857 0.008 0.160 0.672 NA 0
#> ERR863706 3 0.4064 0.43858 0.272 0.004 0.716 NA 0
#> ERR863708 2 0.1356 0.70498 0.028 0.956 0.004 NA 0
#> ERR863710 1 0.0451 0.82949 0.988 0.004 0.000 NA 0
#> ERR863709 1 0.6575 -0.00845 0.424 0.368 0.000 NA 0
#> ERR863753 2 0.1243 0.70546 0.028 0.960 0.004 NA 0
#> ERR863754 1 0.2359 0.81306 0.904 0.036 0.000 NA 0
#> ERR863749 1 0.0451 0.82949 0.988 0.004 0.000 NA 0
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> ERR863675 4 0.4769 0.67002 0.352 0.036 0.008 0.600 0 0.004
#> ERR863705 3 0.0291 0.72100 0.000 0.000 0.992 0.004 0 0.004
#> ERR863704 2 0.2058 0.34311 0.000 0.908 0.000 0.056 0 0.036
#> ERR863679 3 0.0146 0.72139 0.000 0.000 0.996 0.000 0 0.004
#> ERR863680 2 0.2070 0.29518 0.000 0.892 0.000 0.008 0 0.100
#> ERR863676 2 0.0146 0.40652 0.000 0.996 0.000 0.000 0 0.004
#> ERR863677 4 0.3816 0.73451 0.296 0.016 0.000 0.688 0 0.000
#> ERR863688 1 0.0748 0.87639 0.976 0.004 0.000 0.016 0 0.004
#> ERR863690 1 0.0935 0.87232 0.964 0.004 0.000 0.032 0 0.000
#> ERR863692 1 0.2389 0.78158 0.864 0.008 0.000 0.128 0 0.000
#> ERR863703 1 0.1010 0.87112 0.960 0.004 0.000 0.036 0 0.000
#> ERR863712 4 0.3729 0.73465 0.296 0.012 0.000 0.692 0 0.000
#> ERR863711 1 0.0260 0.87765 0.992 0.000 0.000 0.008 0 0.000
#> ERR863760 6 0.6178 0.13624 0.012 0.340 0.004 0.180 0 0.464
#> ERR863727 1 0.0146 0.87869 0.996 0.000 0.000 0.004 0 0.000
#> ERR863766 3 0.0692 0.71640 0.004 0.000 0.976 0.020 0 0.000
#> ERR863767 1 0.1116 0.87688 0.960 0.004 0.000 0.028 0 0.008
#> ERR863752 2 0.0000 0.40769 0.000 1.000 0.000 0.000 0 0.000
#> ERR863757 1 0.4623 0.42285 0.664 0.000 0.264 0.068 0 0.004
#> ERR863758 1 0.0458 0.87934 0.984 0.000 0.000 0.016 0 0.000
#> ERR863755 1 0.0146 0.87869 0.996 0.000 0.000 0.004 0 0.000
#> ERR863756 4 0.5747 0.21035 0.112 0.004 0.324 0.544 0 0.016
#> ERR863707 3 0.0146 0.72139 0.000 0.000 0.996 0.000 0 0.004
#> ERR863681 5 0.0000 1.00000 0.000 0.000 0.000 0.000 1 0.000
#> ERR863719 4 0.3620 0.70923 0.248 0.008 0.000 0.736 0 0.008
#> ERR863759 2 0.5160 -0.00949 0.000 0.604 0.316 0.032 0 0.048
#> ERR863718 1 0.0632 0.87882 0.976 0.000 0.000 0.024 0 0.000
#> ERR863717 1 0.1265 0.86193 0.948 0.008 0.000 0.044 0 0.000
#> ERR863715 2 0.1807 0.38820 0.000 0.920 0.000 0.020 0 0.060
#> ERR863716 1 0.0260 0.87793 0.992 0.000 0.000 0.008 0 0.000
#> ERR863722 3 0.7635 0.03307 0.128 0.056 0.376 0.356 0 0.084
#> ERR863721 4 0.4193 0.63528 0.384 0.008 0.000 0.600 0 0.008
#> ERR863720 2 0.3797 0.08033 0.000 0.692 0.000 0.016 0 0.292
#> ERR863723 1 0.1498 0.85023 0.940 0.000 0.032 0.028 0 0.000
#> ERR863761 3 0.0146 0.71977 0.000 0.000 0.996 0.004 0 0.000
#> ERR863735 1 0.0632 0.87882 0.976 0.000 0.000 0.024 0 0.000
#> ERR863734 3 0.0692 0.71640 0.004 0.000 0.976 0.020 0 0.000
#> ERR863736 2 0.5660 0.05113 0.000 0.608 0.196 0.024 0 0.172
#> ERR863729 2 0.6432 0.14078 0.128 0.504 0.000 0.300 0 0.068
#> ERR863728 1 0.1925 0.85448 0.920 0.008 0.004 0.060 0 0.008
#> ERR863731 1 0.1194 0.87447 0.956 0.004 0.000 0.032 0 0.008
#> ERR863764 4 0.7633 0.16124 0.228 0.044 0.316 0.356 0 0.056
#> ERR863740 1 0.2000 0.83048 0.916 0.000 0.048 0.032 0 0.004
#> ERR863765 1 0.5083 0.11438 0.520 0.000 0.408 0.068 0 0.004
#> ERR863762 3 0.5577 0.48794 0.132 0.036 0.672 0.144 0 0.016
#> ERR863724 5 0.0000 1.00000 0.000 0.000 0.000 0.000 1 0.000
#> ERR863733 4 0.7262 0.38232 0.208 0.048 0.228 0.472 0 0.044
#> ERR863732 3 0.7566 0.15469 0.148 0.048 0.424 0.300 0 0.080
#> ERR863730 1 0.0146 0.87869 0.996 0.000 0.000 0.004 0 0.000
#> ERR863742 1 0.2065 0.82639 0.912 0.000 0.052 0.032 0 0.004
#> ERR863763 4 0.4091 0.73360 0.292 0.012 0.008 0.684 0 0.004
#> ERR863741 2 0.6497 0.13848 0.140 0.500 0.000 0.292 0 0.068
#> ERR863743 1 0.0632 0.87966 0.976 0.000 0.000 0.024 0 0.000
#> ERR863745 2 0.6519 -0.07225 0.004 0.460 0.364 0.076 0 0.096
#> ERR863744 1 0.0837 0.87732 0.972 0.004 0.004 0.020 0 0.000
#> ERR863746 1 0.0146 0.87869 0.996 0.000 0.000 0.004 0 0.000
#> ERR863748 4 0.5819 -0.22620 0.008 0.024 0.420 0.472 0 0.076
#> ERR863747 3 0.5463 0.25125 0.000 0.336 0.568 0.044 0 0.052
#> ERR863694 4 0.3620 0.70923 0.248 0.008 0.000 0.736 0 0.008
#> ERR863693 4 0.4221 0.61585 0.396 0.008 0.000 0.588 0 0.008
#> ERR863686 1 0.2420 0.80406 0.888 0.032 0.000 0.076 0 0.004
#> ERR863678 1 0.7504 -0.26636 0.404 0.032 0.312 0.172 0 0.080
#> ERR863685 3 0.0146 0.72139 0.000 0.000 0.996 0.000 0 0.004
#> ERR863689 1 0.2302 0.78562 0.872 0.008 0.000 0.120 0 0.000
#> ERR863691 1 0.2715 0.77683 0.860 0.024 0.000 0.112 0 0.004
#> ERR863682 1 0.0260 0.87765 0.992 0.000 0.000 0.008 0 0.000
#> ERR863695 6 0.4636 0.11676 0.000 0.444 0.000 0.040 0 0.516
#> ERR863683 1 0.0858 0.86928 0.968 0.000 0.000 0.028 0 0.004
#> ERR863684 4 0.4060 0.69081 0.340 0.008 0.000 0.644 0 0.008
#> ERR863702 1 0.2420 0.80406 0.888 0.032 0.000 0.076 0 0.004
#> ERR863687 3 0.5496 0.51331 0.000 0.140 0.672 0.080 0 0.108
#> ERR863706 3 0.4147 0.45234 0.224 0.000 0.716 0.060 0 0.000
#> ERR863708 2 0.0146 0.40652 0.000 0.996 0.000 0.000 0 0.004
#> ERR863710 1 0.0547 0.87849 0.980 0.000 0.000 0.020 0 0.000
#> ERR863709 2 0.7078 -0.22584 0.276 0.348 0.000 0.308 0 0.068
#> ERR863753 2 0.0000 0.40769 0.000 1.000 0.000 0.000 0 0.000
#> ERR863754 1 0.3371 0.62718 0.780 0.016 0.000 0.200 0 0.004
#> ERR863749 1 0.0632 0.87966 0.976 0.000 0.000 0.024 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)
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 17118 rows and 78 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 5.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 0.422 0.693 0.804 0.3517 0.568 0.568
#> 3 3 0.572 0.709 0.844 0.5954 0.689 0.515
#> 4 4 0.610 0.807 0.847 0.1920 0.822 0.598
#> 5 5 0.753 0.805 0.881 0.0981 0.960 0.871
#> 6 6 0.737 0.632 0.811 0.0665 0.953 0.833
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 5
Following shows the table of the partitions (You need to click the show/hide
code output link to see it). The membership matrix (columns with name p*
)
is inferred by
clue::cl_consensus()
function with the SE
method. Basically the value in the membership matrix
represents the probability to belong to a certain group. The finall class
label for an item is determined with the group with highest probability it
belongs to.
In get_classes()
function, the entropy is calculated from the membership
matrix and the silhouette score is calculated from the consensus matrix.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> ERR863675 1 0.343 0.8570 0.936 0.064
#> ERR863705 2 0.730 0.6688 0.204 0.796
#> ERR863704 2 1.000 0.4934 0.492 0.508
#> ERR863679 2 0.745 0.6696 0.212 0.788
#> ERR863680 2 1.000 0.5037 0.488 0.512
#> ERR863676 2 1.000 0.5037 0.488 0.512
#> ERR863677 1 0.343 0.8570 0.936 0.064
#> ERR863688 1 0.000 0.8836 1.000 0.000
#> ERR863690 1 0.204 0.8745 0.968 0.032
#> ERR863692 1 0.204 0.8745 0.968 0.032
#> ERR863703 1 0.000 0.8836 1.000 0.000
#> ERR863712 1 0.343 0.8570 0.936 0.064
#> ERR863711 1 0.000 0.8836 1.000 0.000
#> ERR863760 2 1.000 0.4934 0.492 0.508
#> ERR863727 1 0.000 0.8836 1.000 0.000
#> ERR863766 2 0.753 0.6694 0.216 0.784
#> ERR863767 1 0.000 0.8836 1.000 0.000
#> ERR863752 2 1.000 0.5037 0.488 0.512
#> ERR863757 1 0.000 0.8836 1.000 0.000
#> ERR863758 1 0.000 0.8836 1.000 0.000
#> ERR863755 1 0.000 0.8836 1.000 0.000
#> ERR863756 1 0.714 0.5988 0.804 0.196
#> ERR863707 2 0.753 0.6694 0.216 0.784
#> ERR863681 2 0.469 0.5955 0.100 0.900
#> ERR863719 1 0.327 0.8601 0.940 0.060
#> ERR863759 2 0.921 0.6263 0.336 0.664
#> ERR863718 1 0.000 0.8836 1.000 0.000
#> ERR863717 1 0.000 0.8836 1.000 0.000
#> ERR863715 2 1.000 0.5037 0.488 0.512
#> ERR863716 1 0.000 0.8836 1.000 0.000
#> ERR863722 1 0.952 0.0682 0.628 0.372
#> ERR863721 1 0.311 0.8626 0.944 0.056
#> ERR863720 2 1.000 0.5037 0.488 0.512
#> ERR863723 1 0.000 0.8836 1.000 0.000
#> ERR863761 2 0.753 0.6694 0.216 0.784
#> ERR863735 1 0.000 0.8836 1.000 0.000
#> ERR863734 2 0.753 0.6694 0.216 0.784
#> ERR863736 1 0.994 -0.3578 0.544 0.456
#> ERR863729 1 0.494 0.7920 0.892 0.108
#> ERR863728 1 0.000 0.8836 1.000 0.000
#> ERR863731 1 0.000 0.8836 1.000 0.000
#> ERR863764 1 0.343 0.8570 0.936 0.064
#> ERR863740 1 0.000 0.8836 1.000 0.000
#> ERR863765 2 0.994 0.3828 0.456 0.544
#> ERR863762 1 0.981 -0.1801 0.580 0.420
#> ERR863724 2 0.469 0.5955 0.100 0.900
#> ERR863733 1 0.327 0.8603 0.940 0.060
#> ERR863732 1 0.985 -0.1970 0.572 0.428
#> ERR863730 1 0.000 0.8836 1.000 0.000
#> ERR863742 1 0.000 0.8836 1.000 0.000
#> ERR863763 1 0.388 0.8453 0.924 0.076
#> ERR863741 1 0.260 0.8681 0.956 0.044
#> ERR863743 1 0.000 0.8836 1.000 0.000
#> ERR863745 2 1.000 0.5037 0.488 0.512
#> ERR863744 1 0.000 0.8836 1.000 0.000
#> ERR863746 1 0.000 0.8836 1.000 0.000
#> ERR863748 1 0.997 -0.2239 0.532 0.468
#> ERR863747 2 0.921 0.6263 0.336 0.664
#> ERR863694 1 0.343 0.8570 0.936 0.064
#> ERR863693 1 0.260 0.8681 0.956 0.044
#> ERR863686 1 0.204 0.8745 0.968 0.032
#> ERR863678 1 0.000 0.8836 1.000 0.000
#> ERR863685 2 0.753 0.6694 0.216 0.784
#> ERR863689 1 0.204 0.8745 0.968 0.032
#> ERR863691 1 0.260 0.8681 0.956 0.044
#> ERR863682 1 0.000 0.8836 1.000 0.000
#> ERR863695 1 0.994 -0.3590 0.544 0.456
#> ERR863683 1 0.000 0.8836 1.000 0.000
#> ERR863684 1 0.311 0.8626 0.944 0.056
#> ERR863702 1 0.141 0.8786 0.980 0.020
#> ERR863687 2 0.821 0.6520 0.256 0.744
#> ERR863706 2 0.917 0.5831 0.332 0.668
#> ERR863708 2 1.000 0.5037 0.488 0.512
#> ERR863710 1 0.000 0.8836 1.000 0.000
#> ERR863709 1 0.529 0.7802 0.880 0.120
#> ERR863753 2 1.000 0.5037 0.488 0.512
#> ERR863754 1 0.260 0.8681 0.956 0.044
#> ERR863749 1 0.000 0.8836 1.000 0.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> ERR863675 2 0.8643 0.4881 0.376 0.516 0.108
#> ERR863705 3 0.6777 0.8462 0.020 0.364 0.616
#> ERR863704 2 0.1753 0.6333 0.048 0.952 0.000
#> ERR863679 3 0.6777 0.8449 0.020 0.364 0.616
#> ERR863680 2 0.1753 0.6333 0.048 0.952 0.000
#> ERR863676 2 0.1753 0.6333 0.048 0.952 0.000
#> ERR863677 2 0.8619 0.3976 0.420 0.480 0.100
#> ERR863688 1 0.0000 0.9121 1.000 0.000 0.000
#> ERR863690 1 0.0237 0.9098 0.996 0.000 0.004
#> ERR863692 1 0.1905 0.8808 0.956 0.016 0.028
#> ERR863703 1 0.0000 0.9121 1.000 0.000 0.000
#> ERR863712 2 0.8619 0.3976 0.420 0.480 0.100
#> ERR863711 1 0.0000 0.9121 1.000 0.000 0.000
#> ERR863760 2 0.1753 0.6333 0.048 0.952 0.000
#> ERR863727 1 0.0000 0.9121 1.000 0.000 0.000
#> ERR863766 3 0.7425 0.8206 0.052 0.328 0.620
#> ERR863767 1 0.0000 0.9121 1.000 0.000 0.000
#> ERR863752 2 0.1753 0.6333 0.048 0.952 0.000
#> ERR863757 1 0.0237 0.9088 0.996 0.000 0.004
#> ERR863758 1 0.0000 0.9121 1.000 0.000 0.000
#> ERR863755 1 0.0000 0.9121 1.000 0.000 0.000
#> ERR863756 1 0.8688 -0.0731 0.516 0.372 0.112
#> ERR863707 3 0.6758 0.8487 0.020 0.360 0.620
#> ERR863681 3 0.3349 0.6918 0.004 0.108 0.888
#> ERR863719 1 0.8094 0.2687 0.612 0.288 0.100
#> ERR863759 2 0.0983 0.5870 0.016 0.980 0.004
#> ERR863718 1 0.0000 0.9121 1.000 0.000 0.000
#> ERR863717 1 0.0000 0.9121 1.000 0.000 0.000
#> ERR863715 2 0.1753 0.6333 0.048 0.952 0.000
#> ERR863716 1 0.0000 0.9121 1.000 0.000 0.000
#> ERR863722 2 0.9006 0.4932 0.288 0.544 0.168
#> ERR863721 1 0.6374 0.6551 0.768 0.132 0.100
#> ERR863720 2 0.1753 0.6333 0.048 0.952 0.000
#> ERR863723 1 0.0000 0.9121 1.000 0.000 0.000
#> ERR863761 3 0.6758 0.8487 0.020 0.360 0.620
#> ERR863735 1 0.0000 0.9121 1.000 0.000 0.000
#> ERR863734 3 0.6954 0.8465 0.028 0.352 0.620
#> ERR863736 2 0.2663 0.6278 0.044 0.932 0.024
#> ERR863729 2 0.7360 0.5954 0.212 0.692 0.096
#> ERR863728 1 0.0000 0.9121 1.000 0.000 0.000
#> ERR863731 1 0.0000 0.9121 1.000 0.000 0.000
#> ERR863764 2 0.8643 0.4881 0.376 0.516 0.108
#> ERR863740 1 0.0000 0.9121 1.000 0.000 0.000
#> ERR863765 1 0.7735 -0.0466 0.512 0.048 0.440
#> ERR863762 1 0.9930 -0.3362 0.368 0.356 0.276
#> ERR863724 3 0.3349 0.6918 0.004 0.108 0.888
#> ERR863733 2 0.8559 0.4684 0.388 0.512 0.100
#> ERR863732 2 0.9240 0.4257 0.224 0.532 0.244
#> ERR863730 1 0.0000 0.9121 1.000 0.000 0.000
#> ERR863742 1 0.0000 0.9121 1.000 0.000 0.000
#> ERR863763 2 0.8675 0.4664 0.388 0.504 0.108
#> ERR863741 1 0.6757 0.5689 0.736 0.180 0.084
#> ERR863743 1 0.0000 0.9121 1.000 0.000 0.000
#> ERR863745 2 0.1411 0.6180 0.036 0.964 0.000
#> ERR863744 1 0.0000 0.9121 1.000 0.000 0.000
#> ERR863746 1 0.0000 0.9121 1.000 0.000 0.000
#> ERR863748 2 0.9092 0.4343 0.200 0.548 0.252
#> ERR863747 2 0.1182 0.5769 0.012 0.976 0.012
#> ERR863694 2 0.8675 0.4664 0.388 0.504 0.108
#> ERR863693 1 0.3966 0.8058 0.876 0.024 0.100
#> ERR863686 1 0.0237 0.9098 0.996 0.000 0.004
#> ERR863678 1 0.0424 0.9073 0.992 0.000 0.008
#> ERR863685 3 0.6758 0.8487 0.020 0.360 0.620
#> ERR863689 1 0.0237 0.9098 0.996 0.000 0.004
#> ERR863691 1 0.1170 0.8961 0.976 0.008 0.016
#> ERR863682 1 0.0000 0.9121 1.000 0.000 0.000
#> ERR863695 2 0.4609 0.6216 0.052 0.856 0.092
#> ERR863683 1 0.0000 0.9121 1.000 0.000 0.000
#> ERR863684 1 0.6374 0.6551 0.768 0.132 0.100
#> ERR863702 1 0.0000 0.9121 1.000 0.000 0.000
#> ERR863687 2 0.1182 0.5769 0.012 0.976 0.012
#> ERR863706 3 0.9574 0.4827 0.292 0.232 0.476
#> ERR863708 2 0.1753 0.6333 0.048 0.952 0.000
#> ERR863710 1 0.0000 0.9121 1.000 0.000 0.000
#> ERR863709 2 0.6737 0.6096 0.156 0.744 0.100
#> ERR863753 2 0.1753 0.6333 0.048 0.952 0.000
#> ERR863754 1 0.1751 0.8834 0.960 0.012 0.028
#> ERR863749 1 0.0000 0.9121 1.000 0.000 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> ERR863675 4 0.7180 0.8082 0.124 0.152 0.064 0.660
#> ERR863705 3 0.3494 0.8428 0.004 0.172 0.824 0.000
#> ERR863704 2 0.0779 0.9290 0.016 0.980 0.000 0.004
#> ERR863679 3 0.4598 0.8314 0.004 0.160 0.792 0.044
#> ERR863680 2 0.0779 0.9283 0.016 0.980 0.000 0.004
#> ERR863676 2 0.0592 0.9292 0.016 0.984 0.000 0.000
#> ERR863677 4 0.6310 0.8142 0.188 0.152 0.000 0.660
#> ERR863688 1 0.0376 0.9188 0.992 0.000 0.004 0.004
#> ERR863690 1 0.0657 0.9156 0.984 0.000 0.004 0.012
#> ERR863692 1 0.4220 0.5823 0.748 0.000 0.004 0.248
#> ERR863703 1 0.0376 0.9188 0.992 0.000 0.004 0.004
#> ERR863712 4 0.6310 0.8142 0.188 0.152 0.000 0.660
#> ERR863711 1 0.0000 0.9187 1.000 0.000 0.000 0.000
#> ERR863760 2 0.0779 0.9290 0.016 0.980 0.000 0.004
#> ERR863727 1 0.0657 0.9172 0.984 0.000 0.004 0.012
#> ERR863766 3 0.4274 0.8392 0.040 0.120 0.828 0.012
#> ERR863767 1 0.0188 0.9190 0.996 0.000 0.000 0.004
#> ERR863752 2 0.0779 0.9290 0.016 0.980 0.000 0.004
#> ERR863757 1 0.1356 0.8903 0.960 0.000 0.032 0.008
#> ERR863758 1 0.0188 0.9190 0.996 0.000 0.000 0.004
#> ERR863755 1 0.0376 0.9184 0.992 0.000 0.004 0.004
#> ERR863756 4 0.7225 0.7745 0.144 0.072 0.124 0.660
#> ERR863707 3 0.3760 0.8545 0.004 0.156 0.828 0.012
#> ERR863681 3 0.5538 0.5925 0.000 0.036 0.644 0.320
#> ERR863719 4 0.6147 0.8032 0.224 0.112 0.000 0.664
#> ERR863759 2 0.1822 0.8877 0.008 0.944 0.044 0.004
#> ERR863718 1 0.0188 0.9190 0.996 0.000 0.000 0.004
#> ERR863717 1 0.0376 0.9184 0.992 0.000 0.004 0.004
#> ERR863715 2 0.0779 0.9280 0.016 0.980 0.000 0.004
#> ERR863716 1 0.0188 0.9190 0.996 0.000 0.000 0.004
#> ERR863722 4 0.6798 0.6567 0.040 0.076 0.232 0.652
#> ERR863721 4 0.6157 0.7999 0.232 0.108 0.000 0.660
#> ERR863720 2 0.0592 0.9292 0.016 0.984 0.000 0.000
#> ERR863723 1 0.0336 0.9168 0.992 0.000 0.000 0.008
#> ERR863761 3 0.3760 0.8545 0.004 0.156 0.828 0.012
#> ERR863735 1 0.0188 0.9190 0.996 0.000 0.000 0.004
#> ERR863734 3 0.4203 0.8464 0.032 0.128 0.828 0.012
#> ERR863736 2 0.1796 0.9073 0.016 0.948 0.032 0.004
#> ERR863729 4 0.6674 0.6253 0.096 0.316 0.004 0.584
#> ERR863728 1 0.3074 0.7525 0.848 0.000 0.000 0.152
#> ERR863731 1 0.0188 0.9190 0.996 0.000 0.000 0.004
#> ERR863764 4 0.7222 0.8075 0.124 0.156 0.064 0.656
#> ERR863740 1 0.0336 0.9168 0.992 0.000 0.000 0.008
#> ERR863765 1 0.5236 0.1930 0.560 0.000 0.432 0.008
#> ERR863762 4 0.7911 0.3548 0.180 0.016 0.336 0.468
#> ERR863724 3 0.5538 0.5925 0.000 0.036 0.644 0.320
#> ERR863733 4 0.6362 0.8122 0.176 0.168 0.000 0.656
#> ERR863732 4 0.6725 0.5533 0.036 0.052 0.296 0.616
#> ERR863730 1 0.0657 0.9172 0.984 0.000 0.004 0.012
#> ERR863742 1 0.0336 0.9168 0.992 0.000 0.000 0.008
#> ERR863763 4 0.7180 0.8082 0.124 0.152 0.064 0.660
#> ERR863741 4 0.6611 0.6338 0.356 0.080 0.004 0.560
#> ERR863743 1 0.0188 0.9190 0.996 0.000 0.000 0.004
#> ERR863745 2 0.0592 0.9292 0.016 0.984 0.000 0.000
#> ERR863744 1 0.0524 0.9173 0.988 0.000 0.004 0.008
#> ERR863746 1 0.0657 0.9172 0.984 0.000 0.004 0.012
#> ERR863748 4 0.6690 0.6434 0.032 0.076 0.240 0.652
#> ERR863747 2 0.2593 0.8186 0.000 0.892 0.104 0.004
#> ERR863694 4 0.7131 0.8057 0.120 0.152 0.064 0.664
#> ERR863693 4 0.5286 0.5735 0.384 0.008 0.004 0.604
#> ERR863686 1 0.0657 0.9156 0.984 0.000 0.004 0.012
#> ERR863678 1 0.3837 0.6284 0.776 0.000 0.000 0.224
#> ERR863685 3 0.3854 0.8552 0.008 0.152 0.828 0.012
#> ERR863689 1 0.0657 0.9156 0.984 0.000 0.004 0.012
#> ERR863691 1 0.4053 0.6259 0.768 0.000 0.004 0.228
#> ERR863682 1 0.0188 0.9190 0.996 0.000 0.000 0.004
#> ERR863695 2 0.1182 0.9206 0.016 0.968 0.000 0.016
#> ERR863683 1 0.0336 0.9168 0.992 0.000 0.000 0.008
#> ERR863684 4 0.6157 0.7999 0.232 0.108 0.000 0.660
#> ERR863702 1 0.0524 0.9176 0.988 0.000 0.004 0.008
#> ERR863687 2 0.5393 0.4586 0.000 0.688 0.268 0.044
#> ERR863706 1 0.6459 -0.0273 0.492 0.032 0.456 0.020
#> ERR863708 2 0.0592 0.9292 0.016 0.984 0.000 0.000
#> ERR863710 1 0.0000 0.9187 1.000 0.000 0.000 0.000
#> ERR863709 2 0.5199 0.5278 0.036 0.720 0.004 0.240
#> ERR863753 2 0.0779 0.9290 0.016 0.980 0.000 0.004
#> ERR863754 1 0.3494 0.7248 0.824 0.000 0.004 0.172
#> ERR863749 1 0.0000 0.9187 1.000 0.000 0.000 0.000
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> ERR863675 4 0.1365 0.86509 0.040 0.004 0.004 0.952 0.000
#> ERR863705 3 0.1648 0.80396 0.000 0.040 0.940 0.020 0.000
#> ERR863704 2 0.0898 0.88572 0.000 0.972 0.000 0.008 0.020
#> ERR863679 3 0.2409 0.78683 0.000 0.032 0.900 0.068 0.000
#> ERR863680 2 0.1012 0.88536 0.000 0.968 0.000 0.020 0.012
#> ERR863676 2 0.0693 0.88796 0.000 0.980 0.000 0.012 0.008
#> ERR863677 4 0.1569 0.86529 0.044 0.004 0.000 0.944 0.008
#> ERR863688 1 0.2629 0.89458 0.860 0.000 0.004 0.000 0.136
#> ERR863690 1 0.1571 0.88420 0.936 0.000 0.004 0.000 0.060
#> ERR863692 1 0.5144 0.60224 0.680 0.000 0.008 0.244 0.068
#> ERR863703 1 0.0794 0.89184 0.972 0.000 0.000 0.000 0.028
#> ERR863712 4 0.1569 0.86529 0.044 0.004 0.000 0.944 0.008
#> ERR863711 1 0.1764 0.89812 0.928 0.000 0.008 0.000 0.064
#> ERR863760 2 0.1757 0.87349 0.000 0.936 0.004 0.012 0.048
#> ERR863727 1 0.2690 0.89052 0.844 0.000 0.000 0.000 0.156
#> ERR863766 3 0.1186 0.81287 0.008 0.020 0.964 0.008 0.000
#> ERR863767 1 0.0579 0.89252 0.984 0.000 0.008 0.000 0.008
#> ERR863752 2 0.0671 0.88756 0.000 0.980 0.000 0.004 0.016
#> ERR863757 1 0.3427 0.85965 0.836 0.000 0.056 0.000 0.108
#> ERR863758 1 0.0451 0.89326 0.988 0.000 0.008 0.000 0.004
#> ERR863755 1 0.2516 0.89472 0.860 0.000 0.000 0.000 0.140
#> ERR863756 4 0.3441 0.75043 0.024 0.004 0.148 0.824 0.000
#> ERR863707 3 0.1579 0.81012 0.000 0.032 0.944 0.024 0.000
#> ERR863681 5 0.3480 1.00000 0.000 0.000 0.248 0.000 0.752
#> ERR863719 4 0.1569 0.86501 0.044 0.004 0.008 0.944 0.000
#> ERR863759 2 0.0798 0.88460 0.000 0.976 0.000 0.008 0.016
#> ERR863718 1 0.0451 0.89326 0.988 0.000 0.008 0.000 0.004
#> ERR863717 1 0.2886 0.89097 0.844 0.000 0.008 0.000 0.148
#> ERR863715 2 0.0404 0.88764 0.000 0.988 0.000 0.000 0.012
#> ERR863716 1 0.2612 0.89675 0.868 0.000 0.008 0.000 0.124
#> ERR863722 4 0.2248 0.80030 0.012 0.000 0.088 0.900 0.000
#> ERR863721 4 0.2116 0.86032 0.052 0.004 0.008 0.924 0.012
#> ERR863720 2 0.1682 0.87494 0.000 0.940 0.004 0.012 0.044
#> ERR863723 1 0.2411 0.88944 0.884 0.000 0.008 0.000 0.108
#> ERR863761 3 0.1168 0.81285 0.000 0.032 0.960 0.008 0.000
#> ERR863735 1 0.0579 0.89252 0.984 0.000 0.008 0.000 0.008
#> ERR863734 3 0.1186 0.81287 0.008 0.020 0.964 0.008 0.000
#> ERR863736 2 0.2305 0.85938 0.000 0.916 0.028 0.012 0.044
#> ERR863729 4 0.5540 0.64659 0.088 0.156 0.008 0.716 0.032
#> ERR863728 1 0.2189 0.83926 0.904 0.000 0.000 0.084 0.012
#> ERR863731 1 0.0693 0.89183 0.980 0.000 0.008 0.000 0.012
#> ERR863764 4 0.1492 0.86506 0.040 0.004 0.008 0.948 0.000
#> ERR863740 1 0.2411 0.88944 0.884 0.000 0.008 0.000 0.108
#> ERR863765 3 0.4535 0.59169 0.140 0.000 0.752 0.000 0.108
#> ERR863762 3 0.5460 0.49560 0.088 0.000 0.652 0.252 0.008
#> ERR863724 5 0.3480 1.00000 0.000 0.000 0.248 0.000 0.752
#> ERR863733 4 0.1856 0.86155 0.044 0.008 0.008 0.936 0.004
#> ERR863732 4 0.4803 -0.09609 0.012 0.000 0.492 0.492 0.004
#> ERR863730 1 0.2690 0.89052 0.844 0.000 0.000 0.000 0.156
#> ERR863742 1 0.2813 0.88146 0.868 0.000 0.024 0.000 0.108
#> ERR863763 4 0.1526 0.86538 0.040 0.004 0.004 0.948 0.004
#> ERR863741 4 0.5186 0.55729 0.268 0.008 0.008 0.672 0.044
#> ERR863743 1 0.0451 0.89339 0.988 0.000 0.008 0.000 0.004
#> ERR863745 2 0.0324 0.88779 0.000 0.992 0.000 0.004 0.004
#> ERR863744 1 0.2377 0.89457 0.872 0.000 0.000 0.000 0.128
#> ERR863746 1 0.2690 0.89052 0.844 0.000 0.000 0.000 0.156
#> ERR863748 4 0.2909 0.74567 0.012 0.000 0.140 0.848 0.000
#> ERR863747 2 0.1808 0.85463 0.000 0.936 0.044 0.008 0.012
#> ERR863694 4 0.1605 0.86448 0.040 0.004 0.012 0.944 0.000
#> ERR863693 4 0.3888 0.76481 0.112 0.000 0.008 0.816 0.064
#> ERR863686 1 0.2843 0.89163 0.848 0.000 0.008 0.000 0.144
#> ERR863678 1 0.2623 0.82998 0.884 0.000 0.004 0.096 0.016
#> ERR863685 3 0.1168 0.81285 0.000 0.032 0.960 0.008 0.000
#> ERR863689 1 0.2228 0.87460 0.912 0.000 0.008 0.012 0.068
#> ERR863691 1 0.5037 0.63328 0.696 0.000 0.008 0.228 0.068
#> ERR863682 1 0.2193 0.90016 0.900 0.000 0.008 0.000 0.092
#> ERR863695 2 0.1106 0.88384 0.000 0.964 0.000 0.024 0.012
#> ERR863683 1 0.2358 0.89031 0.888 0.000 0.008 0.000 0.104
#> ERR863684 4 0.2116 0.86032 0.052 0.004 0.008 0.924 0.012
#> ERR863702 1 0.2798 0.89232 0.852 0.000 0.008 0.000 0.140
#> ERR863687 2 0.5556 -0.13824 0.000 0.476 0.456 0.068 0.000
#> ERR863706 3 0.4605 0.60427 0.132 0.000 0.756 0.004 0.108
#> ERR863708 2 0.0693 0.88796 0.000 0.980 0.000 0.012 0.008
#> ERR863710 1 0.0579 0.89252 0.984 0.000 0.008 0.000 0.008
#> ERR863709 2 0.5747 0.00958 0.020 0.492 0.008 0.452 0.028
#> ERR863753 2 0.0671 0.88756 0.000 0.980 0.000 0.004 0.016
#> ERR863754 1 0.4981 0.63830 0.704 0.000 0.008 0.220 0.068
#> ERR863749 1 0.0579 0.89409 0.984 0.000 0.008 0.000 0.008
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> ERR863675 4 0.0363 0.81098 0.000 0.000 0.000 0.988 0.000 0.012
#> ERR863705 3 0.1863 0.77508 0.000 0.000 0.896 0.000 0.000 0.104
#> ERR863704 2 0.1926 0.88062 0.000 0.912 0.000 0.000 0.020 0.068
#> ERR863679 3 0.2907 0.74803 0.000 0.000 0.828 0.020 0.000 0.152
#> ERR863680 2 0.0806 0.88371 0.000 0.972 0.000 0.000 0.008 0.020
#> ERR863676 2 0.0520 0.88661 0.000 0.984 0.000 0.000 0.008 0.008
#> ERR863677 4 0.0363 0.81142 0.000 0.000 0.000 0.988 0.000 0.012
#> ERR863688 1 0.2805 0.52285 0.812 0.000 0.000 0.000 0.004 0.184
#> ERR863690 1 0.3737 0.32183 0.608 0.000 0.000 0.000 0.000 0.392
#> ERR863692 6 0.5988 0.89297 0.356 0.000 0.000 0.200 0.004 0.440
#> ERR863703 1 0.3647 0.39031 0.640 0.000 0.000 0.000 0.000 0.360
#> ERR863712 4 0.0260 0.81132 0.000 0.000 0.000 0.992 0.000 0.008
#> ERR863711 1 0.2454 0.56101 0.840 0.000 0.000 0.000 0.000 0.160
#> ERR863760 2 0.2680 0.86965 0.000 0.860 0.000 0.000 0.032 0.108
#> ERR863727 1 0.2048 0.51302 0.880 0.000 0.000 0.000 0.000 0.120
#> ERR863766 3 0.0000 0.79046 0.000 0.000 1.000 0.000 0.000 0.000
#> ERR863767 1 0.3592 0.41727 0.656 0.000 0.000 0.000 0.000 0.344
#> ERR863752 2 0.1500 0.88460 0.000 0.936 0.000 0.000 0.012 0.052
#> ERR863757 1 0.1713 0.52865 0.928 0.000 0.028 0.000 0.000 0.044
#> ERR863758 1 0.3515 0.43701 0.676 0.000 0.000 0.000 0.000 0.324
#> ERR863755 1 0.2664 0.53216 0.816 0.000 0.000 0.000 0.000 0.184
#> ERR863756 4 0.4114 0.69416 0.004 0.000 0.116 0.768 0.004 0.108
#> ERR863707 3 0.1075 0.78929 0.000 0.000 0.952 0.000 0.000 0.048
#> ERR863681 5 0.1471 0.99811 0.000 0.004 0.064 0.000 0.932 0.000
#> ERR863719 4 0.1196 0.80311 0.000 0.000 0.000 0.952 0.008 0.040
#> ERR863759 2 0.1802 0.88091 0.000 0.916 0.000 0.000 0.012 0.072
#> ERR863718 1 0.3547 0.43462 0.668 0.000 0.000 0.000 0.000 0.332
#> ERR863717 1 0.2668 0.48106 0.828 0.000 0.000 0.000 0.004 0.168
#> ERR863715 2 0.2094 0.87399 0.000 0.900 0.000 0.000 0.020 0.080
#> ERR863716 1 0.0937 0.57900 0.960 0.000 0.000 0.000 0.000 0.040
#> ERR863722 4 0.4305 0.66407 0.000 0.000 0.068 0.700 0.000 0.232
#> ERR863721 4 0.1700 0.79466 0.000 0.000 0.000 0.916 0.004 0.080
#> ERR863720 2 0.1779 0.87851 0.000 0.920 0.000 0.000 0.016 0.064
#> ERR863723 1 0.0865 0.56176 0.964 0.000 0.000 0.000 0.000 0.036
#> ERR863761 3 0.0146 0.79057 0.000 0.000 0.996 0.000 0.000 0.004
#> ERR863735 1 0.3592 0.41727 0.656 0.000 0.000 0.000 0.000 0.344
#> ERR863734 3 0.0146 0.78953 0.000 0.000 0.996 0.000 0.000 0.004
#> ERR863736 2 0.3717 0.81025 0.000 0.808 0.036 0.000 0.036 0.120
#> ERR863729 4 0.6601 0.34893 0.024 0.140 0.000 0.444 0.024 0.368
#> ERR863728 1 0.4468 0.12770 0.560 0.000 0.000 0.032 0.000 0.408
#> ERR863731 1 0.3607 0.41011 0.652 0.000 0.000 0.000 0.000 0.348
#> ERR863764 4 0.2300 0.77568 0.000 0.000 0.000 0.856 0.000 0.144
#> ERR863740 1 0.0937 0.56049 0.960 0.000 0.000 0.000 0.000 0.040
#> ERR863765 3 0.3123 0.66824 0.136 0.000 0.824 0.000 0.000 0.040
#> ERR863762 3 0.5246 0.62438 0.032 0.000 0.652 0.088 0.000 0.228
#> ERR863724 5 0.1615 0.99811 0.000 0.004 0.064 0.000 0.928 0.004
#> ERR863733 4 0.2191 0.78320 0.000 0.000 0.000 0.876 0.004 0.120
#> ERR863732 3 0.5973 0.32655 0.004 0.000 0.472 0.308 0.000 0.216
#> ERR863730 1 0.2048 0.51302 0.880 0.000 0.000 0.000 0.000 0.120
#> ERR863742 1 0.1267 0.55465 0.940 0.000 0.000 0.000 0.000 0.060
#> ERR863763 4 0.0632 0.81121 0.000 0.000 0.000 0.976 0.000 0.024
#> ERR863741 4 0.5908 0.06342 0.108 0.004 0.000 0.488 0.020 0.380
#> ERR863743 1 0.3515 0.43701 0.676 0.000 0.000 0.000 0.000 0.324
#> ERR863745 2 0.0405 0.88526 0.000 0.988 0.000 0.000 0.004 0.008
#> ERR863744 1 0.1444 0.55771 0.928 0.000 0.000 0.000 0.000 0.072
#> ERR863746 1 0.1910 0.52341 0.892 0.000 0.000 0.000 0.000 0.108
#> ERR863748 4 0.4513 0.63347 0.000 0.000 0.096 0.692 0.000 0.212
#> ERR863747 2 0.3125 0.84205 0.000 0.852 0.056 0.000 0.016 0.076
#> ERR863694 4 0.1333 0.80308 0.000 0.000 0.000 0.944 0.008 0.048
#> ERR863693 4 0.3273 0.68803 0.004 0.000 0.000 0.776 0.008 0.212
#> ERR863686 1 0.3298 0.42804 0.756 0.000 0.000 0.000 0.008 0.236
#> ERR863678 1 0.4689 -0.03681 0.516 0.000 0.000 0.044 0.000 0.440
#> ERR863685 3 0.0000 0.79046 0.000 0.000 1.000 0.000 0.000 0.000
#> ERR863689 1 0.4313 -0.11366 0.504 0.000 0.000 0.012 0.004 0.480
#> ERR863691 6 0.5813 0.89221 0.308 0.000 0.000 0.184 0.004 0.504
#> ERR863682 1 0.2219 0.57532 0.864 0.000 0.000 0.000 0.000 0.136
#> ERR863695 2 0.2408 0.82254 0.000 0.876 0.000 0.004 0.012 0.108
#> ERR863683 1 0.0790 0.56243 0.968 0.000 0.000 0.000 0.000 0.032
#> ERR863684 4 0.1700 0.79466 0.000 0.000 0.000 0.916 0.004 0.080
#> ERR863702 1 0.3136 0.45302 0.768 0.000 0.000 0.000 0.004 0.228
#> ERR863687 3 0.6393 0.35470 0.000 0.308 0.472 0.024 0.004 0.192
#> ERR863706 3 0.1745 0.76106 0.056 0.000 0.924 0.000 0.000 0.020
#> ERR863708 2 0.0520 0.88661 0.000 0.984 0.000 0.000 0.008 0.008
#> ERR863710 1 0.3563 0.43539 0.664 0.000 0.000 0.000 0.000 0.336
#> ERR863709 2 0.6047 -0.00195 0.000 0.448 0.000 0.380 0.016 0.156
#> ERR863753 2 0.1500 0.88460 0.000 0.936 0.000 0.000 0.012 0.052
#> ERR863754 6 0.5884 0.90187 0.328 0.000 0.000 0.188 0.004 0.480
#> ERR863749 1 0.3531 0.43679 0.672 0.000 0.000 0.000 0.000 0.328
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)
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 17118 rows and 78 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 0.778 0.901 0.958 0.5043 0.494 0.494
#> 3 3 0.735 0.839 0.917 0.3028 0.782 0.587
#> 4 4 0.872 0.838 0.932 0.1177 0.848 0.598
#> 5 5 0.783 0.755 0.874 0.0951 0.875 0.565
#> 6 6 0.755 0.669 0.801 0.0368 0.959 0.793
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
#> ERR863675 2 0.0000 0.929 0.000 1.000
#> ERR863705 2 0.0000 0.929 0.000 1.000
#> ERR863704 2 0.0000 0.929 0.000 1.000
#> ERR863679 2 0.0000 0.929 0.000 1.000
#> ERR863680 2 0.0000 0.929 0.000 1.000
#> ERR863676 2 0.0000 0.929 0.000 1.000
#> ERR863677 2 0.9635 0.427 0.388 0.612
#> ERR863688 1 0.0000 0.979 1.000 0.000
#> ERR863690 1 0.0000 0.979 1.000 0.000
#> ERR863692 1 0.0000 0.979 1.000 0.000
#> ERR863703 1 0.0000 0.979 1.000 0.000
#> ERR863712 2 0.9635 0.427 0.388 0.612
#> ERR863711 1 0.0000 0.979 1.000 0.000
#> ERR863760 2 0.0000 0.929 0.000 1.000
#> ERR863727 1 0.0000 0.979 1.000 0.000
#> ERR863766 2 0.0000 0.929 0.000 1.000
#> ERR863767 1 0.0000 0.979 1.000 0.000
#> ERR863752 2 0.0000 0.929 0.000 1.000
#> ERR863757 1 0.0000 0.979 1.000 0.000
#> ERR863758 1 0.0000 0.979 1.000 0.000
#> ERR863755 1 0.0000 0.979 1.000 0.000
#> ERR863756 2 0.8267 0.654 0.260 0.740
#> ERR863707 2 0.0000 0.929 0.000 1.000
#> ERR863681 2 0.0000 0.929 0.000 1.000
#> ERR863719 1 0.8386 0.585 0.732 0.268
#> ERR863759 2 0.0000 0.929 0.000 1.000
#> ERR863718 1 0.0000 0.979 1.000 0.000
#> ERR863717 1 0.0000 0.979 1.000 0.000
#> ERR863715 2 0.0000 0.929 0.000 1.000
#> ERR863716 1 0.0000 0.979 1.000 0.000
#> ERR863722 2 0.0000 0.929 0.000 1.000
#> ERR863721 1 0.1184 0.965 0.984 0.016
#> ERR863720 2 0.0000 0.929 0.000 1.000
#> ERR863723 1 0.0000 0.979 1.000 0.000
#> ERR863761 2 0.0000 0.929 0.000 1.000
#> ERR863735 1 0.0000 0.979 1.000 0.000
#> ERR863734 2 0.0000 0.929 0.000 1.000
#> ERR863736 2 0.0000 0.929 0.000 1.000
#> ERR863729 2 0.9963 0.227 0.464 0.536
#> ERR863728 1 0.0000 0.979 1.000 0.000
#> ERR863731 1 0.0000 0.979 1.000 0.000
#> ERR863764 2 0.0000 0.929 0.000 1.000
#> ERR863740 1 0.0000 0.979 1.000 0.000
#> ERR863765 1 0.9635 0.313 0.612 0.388
#> ERR863762 2 0.3114 0.892 0.056 0.944
#> ERR863724 2 0.0000 0.929 0.000 1.000
#> ERR863733 2 0.5408 0.832 0.124 0.876
#> ERR863732 2 0.0000 0.929 0.000 1.000
#> ERR863730 1 0.0000 0.979 1.000 0.000
#> ERR863742 1 0.0000 0.979 1.000 0.000
#> ERR863763 2 0.6887 0.768 0.184 0.816
#> ERR863741 1 0.0000 0.979 1.000 0.000
#> ERR863743 1 0.0000 0.979 1.000 0.000
#> ERR863745 2 0.0000 0.929 0.000 1.000
#> ERR863744 1 0.0000 0.979 1.000 0.000
#> ERR863746 1 0.0000 0.979 1.000 0.000
#> ERR863748 2 0.0000 0.929 0.000 1.000
#> ERR863747 2 0.0000 0.929 0.000 1.000
#> ERR863694 2 0.7056 0.758 0.192 0.808
#> ERR863693 1 0.0000 0.979 1.000 0.000
#> ERR863686 1 0.0000 0.979 1.000 0.000
#> ERR863678 1 0.0938 0.968 0.988 0.012
#> ERR863685 2 0.0000 0.929 0.000 1.000
#> ERR863689 1 0.0000 0.979 1.000 0.000
#> ERR863691 1 0.0000 0.979 1.000 0.000
#> ERR863682 1 0.0000 0.979 1.000 0.000
#> ERR863695 2 0.0000 0.929 0.000 1.000
#> ERR863683 1 0.0000 0.979 1.000 0.000
#> ERR863684 1 0.1184 0.965 0.984 0.016
#> ERR863702 1 0.0000 0.979 1.000 0.000
#> ERR863687 2 0.0000 0.929 0.000 1.000
#> ERR863706 2 0.4939 0.845 0.108 0.892
#> ERR863708 2 0.0000 0.929 0.000 1.000
#> ERR863710 1 0.0000 0.979 1.000 0.000
#> ERR863709 2 0.9635 0.427 0.388 0.612
#> ERR863753 2 0.0000 0.929 0.000 1.000
#> ERR863754 1 0.0000 0.979 1.000 0.000
#> ERR863749 1 0.0000 0.979 1.000 0.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> ERR863675 2 0.2878 0.7764 0.000 0.904 0.096
#> ERR863705 3 0.0000 0.8615 0.000 0.000 1.000
#> ERR863704 2 0.4452 0.8247 0.000 0.808 0.192
#> ERR863679 3 0.0000 0.8615 0.000 0.000 1.000
#> ERR863680 2 0.4452 0.8247 0.000 0.808 0.192
#> ERR863676 2 0.4452 0.8247 0.000 0.808 0.192
#> ERR863677 2 0.0000 0.8161 0.000 1.000 0.000
#> ERR863688 1 0.0000 0.9640 1.000 0.000 0.000
#> ERR863690 1 0.0000 0.9640 1.000 0.000 0.000
#> ERR863692 1 0.3816 0.8305 0.852 0.148 0.000
#> ERR863703 1 0.0000 0.9640 1.000 0.000 0.000
#> ERR863712 2 0.0000 0.8161 0.000 1.000 0.000
#> ERR863711 1 0.0000 0.9640 1.000 0.000 0.000
#> ERR863760 2 0.4452 0.8247 0.000 0.808 0.192
#> ERR863727 1 0.0000 0.9640 1.000 0.000 0.000
#> ERR863766 3 0.0000 0.8615 0.000 0.000 1.000
#> ERR863767 1 0.0000 0.9640 1.000 0.000 0.000
#> ERR863752 2 0.4452 0.8247 0.000 0.808 0.192
#> ERR863757 1 0.1411 0.9347 0.964 0.000 0.036
#> ERR863758 1 0.0000 0.9640 1.000 0.000 0.000
#> ERR863755 1 0.0000 0.9640 1.000 0.000 0.000
#> ERR863756 3 0.5929 0.6325 0.004 0.320 0.676
#> ERR863707 3 0.0000 0.8615 0.000 0.000 1.000
#> ERR863681 3 0.0000 0.8615 0.000 0.000 1.000
#> ERR863719 2 0.3752 0.7658 0.020 0.884 0.096
#> ERR863759 3 0.6140 0.1897 0.000 0.404 0.596
#> ERR863718 1 0.0000 0.9640 1.000 0.000 0.000
#> ERR863717 1 0.0000 0.9640 1.000 0.000 0.000
#> ERR863715 2 0.4452 0.8247 0.000 0.808 0.192
#> ERR863716 1 0.0000 0.9640 1.000 0.000 0.000
#> ERR863722 3 0.4605 0.7364 0.000 0.204 0.796
#> ERR863721 2 0.3482 0.7292 0.128 0.872 0.000
#> ERR863720 2 0.4452 0.8247 0.000 0.808 0.192
#> ERR863723 1 0.0000 0.9640 1.000 0.000 0.000
#> ERR863761 3 0.0000 0.8615 0.000 0.000 1.000
#> ERR863735 1 0.0000 0.9640 1.000 0.000 0.000
#> ERR863734 3 0.0000 0.8615 0.000 0.000 1.000
#> ERR863736 2 0.4555 0.8174 0.000 0.800 0.200
#> ERR863729 2 0.0000 0.8161 0.000 1.000 0.000
#> ERR863728 1 0.0237 0.9611 0.996 0.000 0.004
#> ERR863731 1 0.0000 0.9640 1.000 0.000 0.000
#> ERR863764 2 0.3686 0.7344 0.000 0.860 0.140
#> ERR863740 1 0.0000 0.9640 1.000 0.000 0.000
#> ERR863765 3 0.4452 0.6975 0.192 0.000 0.808
#> ERR863762 3 0.5588 0.7548 0.068 0.124 0.808
#> ERR863724 3 0.0000 0.8615 0.000 0.000 1.000
#> ERR863733 2 0.0000 0.8161 0.000 1.000 0.000
#> ERR863732 3 0.3482 0.7945 0.000 0.128 0.872
#> ERR863730 1 0.0000 0.9640 1.000 0.000 0.000
#> ERR863742 1 0.0237 0.9612 0.996 0.000 0.004
#> ERR863763 2 0.2878 0.7764 0.000 0.904 0.096
#> ERR863741 2 0.4555 0.6383 0.200 0.800 0.000
#> ERR863743 1 0.0000 0.9640 1.000 0.000 0.000
#> ERR863745 2 0.4452 0.8247 0.000 0.808 0.192
#> ERR863744 1 0.0000 0.9640 1.000 0.000 0.000
#> ERR863746 1 0.0000 0.9640 1.000 0.000 0.000
#> ERR863748 3 0.4887 0.7255 0.000 0.228 0.772
#> ERR863747 3 0.5968 0.3140 0.000 0.364 0.636
#> ERR863694 2 0.2878 0.7764 0.000 0.904 0.096
#> ERR863693 1 0.4504 0.7744 0.804 0.196 0.000
#> ERR863686 1 0.0000 0.9640 1.000 0.000 0.000
#> ERR863678 1 0.6305 0.0249 0.516 0.000 0.484
#> ERR863685 3 0.0000 0.8615 0.000 0.000 1.000
#> ERR863689 1 0.0000 0.9640 1.000 0.000 0.000
#> ERR863691 1 0.2796 0.8861 0.908 0.092 0.000
#> ERR863682 1 0.0000 0.9640 1.000 0.000 0.000
#> ERR863695 2 0.4452 0.8247 0.000 0.808 0.192
#> ERR863683 1 0.0000 0.9640 1.000 0.000 0.000
#> ERR863684 2 0.3482 0.7292 0.128 0.872 0.000
#> ERR863702 1 0.0000 0.9640 1.000 0.000 0.000
#> ERR863687 3 0.1289 0.8418 0.000 0.032 0.968
#> ERR863706 3 0.0000 0.8615 0.000 0.000 1.000
#> ERR863708 2 0.4452 0.8247 0.000 0.808 0.192
#> ERR863710 1 0.0000 0.9640 1.000 0.000 0.000
#> ERR863709 2 0.0000 0.8161 0.000 1.000 0.000
#> ERR863753 2 0.4452 0.8247 0.000 0.808 0.192
#> ERR863754 1 0.4002 0.8173 0.840 0.160 0.000
#> ERR863749 1 0.0000 0.9640 1.000 0.000 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> ERR863675 4 0.0921 0.826 0.000 0.028 0.000 0.972
#> ERR863705 3 0.0000 0.881 0.000 0.000 1.000 0.000
#> ERR863704 2 0.0000 0.970 0.000 1.000 0.000 0.000
#> ERR863679 3 0.0000 0.881 0.000 0.000 1.000 0.000
#> ERR863680 2 0.0000 0.970 0.000 1.000 0.000 0.000
#> ERR863676 2 0.0000 0.970 0.000 1.000 0.000 0.000
#> ERR863677 4 0.0921 0.826 0.000 0.028 0.000 0.972
#> ERR863688 1 0.0336 0.961 0.992 0.000 0.000 0.008
#> ERR863690 1 0.0921 0.958 0.972 0.000 0.000 0.028
#> ERR863692 4 0.4941 0.237 0.436 0.000 0.000 0.564
#> ERR863703 1 0.0817 0.959 0.976 0.000 0.000 0.024
#> ERR863712 4 0.0921 0.826 0.000 0.028 0.000 0.972
#> ERR863711 1 0.0188 0.961 0.996 0.000 0.000 0.004
#> ERR863760 2 0.0000 0.970 0.000 1.000 0.000 0.000
#> ERR863727 1 0.0336 0.961 0.992 0.000 0.000 0.008
#> ERR863766 3 0.0000 0.881 0.000 0.000 1.000 0.000
#> ERR863767 1 0.0707 0.959 0.980 0.000 0.000 0.020
#> ERR863752 2 0.0000 0.970 0.000 1.000 0.000 0.000
#> ERR863757 1 0.4661 0.446 0.652 0.000 0.348 0.000
#> ERR863758 1 0.0707 0.959 0.980 0.000 0.000 0.020
#> ERR863755 1 0.0336 0.961 0.992 0.000 0.000 0.008
#> ERR863756 4 0.4855 0.122 0.000 0.000 0.400 0.600
#> ERR863707 3 0.0000 0.881 0.000 0.000 1.000 0.000
#> ERR863681 3 0.0000 0.881 0.000 0.000 1.000 0.000
#> ERR863719 4 0.0804 0.821 0.012 0.008 0.000 0.980
#> ERR863759 2 0.0921 0.947 0.000 0.972 0.028 0.000
#> ERR863718 1 0.0707 0.959 0.980 0.000 0.000 0.020
#> ERR863717 1 0.0336 0.961 0.992 0.000 0.000 0.008
#> ERR863715 2 0.0000 0.970 0.000 1.000 0.000 0.000
#> ERR863716 1 0.0336 0.961 0.992 0.000 0.000 0.008
#> ERR863722 3 0.4941 0.296 0.000 0.000 0.564 0.436
#> ERR863721 4 0.0188 0.821 0.000 0.004 0.000 0.996
#> ERR863720 2 0.0000 0.970 0.000 1.000 0.000 0.000
#> ERR863723 1 0.0000 0.960 1.000 0.000 0.000 0.000
#> ERR863761 3 0.0000 0.881 0.000 0.000 1.000 0.000
#> ERR863735 1 0.0707 0.959 0.980 0.000 0.000 0.020
#> ERR863734 3 0.0000 0.881 0.000 0.000 1.000 0.000
#> ERR863736 2 0.0188 0.967 0.000 0.996 0.000 0.004
#> ERR863729 2 0.3486 0.773 0.000 0.812 0.000 0.188
#> ERR863728 1 0.2868 0.835 0.864 0.000 0.000 0.136
#> ERR863731 1 0.0707 0.959 0.980 0.000 0.000 0.020
#> ERR863764 4 0.0921 0.826 0.000 0.028 0.000 0.972
#> ERR863740 1 0.0000 0.960 1.000 0.000 0.000 0.000
#> ERR863765 3 0.0000 0.881 0.000 0.000 1.000 0.000
#> ERR863762 3 0.0000 0.881 0.000 0.000 1.000 0.000
#> ERR863724 3 0.0000 0.881 0.000 0.000 1.000 0.000
#> ERR863733 4 0.0921 0.826 0.000 0.028 0.000 0.972
#> ERR863732 3 0.0469 0.873 0.000 0.000 0.988 0.012
#> ERR863730 1 0.0336 0.961 0.992 0.000 0.000 0.008
#> ERR863742 1 0.0000 0.960 1.000 0.000 0.000 0.000
#> ERR863763 4 0.0921 0.826 0.000 0.028 0.000 0.972
#> ERR863741 4 0.4424 0.732 0.100 0.088 0.000 0.812
#> ERR863743 1 0.0707 0.959 0.980 0.000 0.000 0.020
#> ERR863745 2 0.0000 0.970 0.000 1.000 0.000 0.000
#> ERR863744 1 0.0336 0.962 0.992 0.000 0.000 0.008
#> ERR863746 1 0.0336 0.961 0.992 0.000 0.000 0.008
#> ERR863748 3 0.4955 0.277 0.000 0.000 0.556 0.444
#> ERR863747 2 0.1940 0.899 0.000 0.924 0.076 0.000
#> ERR863694 4 0.0921 0.826 0.000 0.028 0.000 0.972
#> ERR863693 4 0.0000 0.819 0.000 0.000 0.000 1.000
#> ERR863686 1 0.0592 0.957 0.984 0.000 0.000 0.016
#> ERR863678 3 0.5968 0.430 0.324 0.004 0.624 0.048
#> ERR863685 3 0.0000 0.881 0.000 0.000 1.000 0.000
#> ERR863689 1 0.3942 0.685 0.764 0.000 0.000 0.236
#> ERR863691 4 0.4972 0.171 0.456 0.000 0.000 0.544
#> ERR863682 1 0.0469 0.962 0.988 0.000 0.000 0.012
#> ERR863695 2 0.0000 0.970 0.000 1.000 0.000 0.000
#> ERR863683 1 0.0188 0.961 0.996 0.000 0.000 0.004
#> ERR863684 4 0.0336 0.823 0.000 0.008 0.000 0.992
#> ERR863702 1 0.0336 0.961 0.992 0.000 0.000 0.008
#> ERR863687 3 0.4941 0.224 0.000 0.436 0.564 0.000
#> ERR863706 3 0.0000 0.881 0.000 0.000 1.000 0.000
#> ERR863708 2 0.0000 0.970 0.000 1.000 0.000 0.000
#> ERR863710 1 0.0707 0.959 0.980 0.000 0.000 0.020
#> ERR863709 2 0.2704 0.857 0.000 0.876 0.000 0.124
#> ERR863753 2 0.0000 0.970 0.000 1.000 0.000 0.000
#> ERR863754 4 0.4855 0.332 0.400 0.000 0.000 0.600
#> ERR863749 1 0.0707 0.959 0.980 0.000 0.000 0.020
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> ERR863675 4 0.0162 0.8367 0.000 0.000 0.000 0.996 0.004
#> ERR863705 3 0.0703 0.9378 0.024 0.000 0.976 0.000 0.000
#> ERR863704 2 0.0000 0.9578 0.000 1.000 0.000 0.000 0.000
#> ERR863679 3 0.1116 0.9322 0.028 0.000 0.964 0.004 0.004
#> ERR863680 2 0.0000 0.9578 0.000 1.000 0.000 0.000 0.000
#> ERR863676 2 0.0000 0.9578 0.000 1.000 0.000 0.000 0.000
#> ERR863677 4 0.0000 0.8371 0.000 0.000 0.000 1.000 0.000
#> ERR863688 5 0.1671 0.7642 0.076 0.000 0.000 0.000 0.924
#> ERR863690 1 0.3305 0.7168 0.776 0.000 0.000 0.000 0.224
#> ERR863692 5 0.6700 -0.0380 0.256 0.000 0.000 0.324 0.420
#> ERR863703 1 0.2891 0.7523 0.824 0.000 0.000 0.000 0.176
#> ERR863712 4 0.0000 0.8371 0.000 0.000 0.000 1.000 0.000
#> ERR863711 1 0.3932 0.4394 0.672 0.000 0.000 0.000 0.328
#> ERR863760 2 0.0000 0.9578 0.000 1.000 0.000 0.000 0.000
#> ERR863727 5 0.0703 0.7621 0.024 0.000 0.000 0.000 0.976
#> ERR863766 3 0.0000 0.9455 0.000 0.000 1.000 0.000 0.000
#> ERR863767 1 0.1478 0.7978 0.936 0.000 0.000 0.000 0.064
#> ERR863752 2 0.0000 0.9578 0.000 1.000 0.000 0.000 0.000
#> ERR863757 5 0.5002 0.6353 0.132 0.000 0.160 0.000 0.708
#> ERR863758 1 0.2127 0.7927 0.892 0.000 0.000 0.000 0.108
#> ERR863755 5 0.2813 0.7152 0.168 0.000 0.000 0.000 0.832
#> ERR863756 4 0.4675 0.4088 0.016 0.000 0.360 0.620 0.004
#> ERR863707 3 0.0290 0.9436 0.008 0.000 0.992 0.000 0.000
#> ERR863681 3 0.0000 0.9455 0.000 0.000 1.000 0.000 0.000
#> ERR863719 4 0.0162 0.8365 0.000 0.000 0.000 0.996 0.004
#> ERR863759 2 0.0955 0.9359 0.004 0.968 0.028 0.000 0.000
#> ERR863718 1 0.1732 0.7983 0.920 0.000 0.000 0.000 0.080
#> ERR863717 5 0.0794 0.7619 0.028 0.000 0.000 0.000 0.972
#> ERR863715 2 0.0000 0.9578 0.000 1.000 0.000 0.000 0.000
#> ERR863716 5 0.3274 0.7133 0.220 0.000 0.000 0.000 0.780
#> ERR863722 4 0.5321 0.0689 0.040 0.000 0.472 0.484 0.004
#> ERR863721 4 0.0162 0.8365 0.000 0.000 0.000 0.996 0.004
#> ERR863720 2 0.0000 0.9578 0.000 1.000 0.000 0.000 0.000
#> ERR863723 5 0.3661 0.6607 0.276 0.000 0.000 0.000 0.724
#> ERR863761 3 0.0000 0.9455 0.000 0.000 1.000 0.000 0.000
#> ERR863735 1 0.1410 0.7966 0.940 0.000 0.000 0.000 0.060
#> ERR863734 3 0.0000 0.9455 0.000 0.000 1.000 0.000 0.000
#> ERR863736 2 0.0404 0.9508 0.000 0.988 0.012 0.000 0.000
#> ERR863729 2 0.6083 0.6026 0.068 0.668 0.000 0.164 0.100
#> ERR863728 1 0.1205 0.7831 0.956 0.000 0.004 0.000 0.040
#> ERR863731 1 0.1197 0.7946 0.952 0.000 0.000 0.000 0.048
#> ERR863764 4 0.1041 0.8261 0.032 0.000 0.000 0.964 0.004
#> ERR863740 5 0.3366 0.7052 0.232 0.000 0.000 0.000 0.768
#> ERR863765 3 0.0404 0.9386 0.000 0.000 0.988 0.000 0.012
#> ERR863762 3 0.1492 0.9241 0.040 0.000 0.948 0.008 0.004
#> ERR863724 3 0.0000 0.9455 0.000 0.000 1.000 0.000 0.000
#> ERR863733 4 0.0912 0.8288 0.012 0.000 0.000 0.972 0.016
#> ERR863732 3 0.2504 0.8737 0.032 0.000 0.900 0.064 0.004
#> ERR863730 5 0.0703 0.7621 0.024 0.000 0.000 0.000 0.976
#> ERR863742 5 0.3932 0.5981 0.328 0.000 0.000 0.000 0.672
#> ERR863763 4 0.0162 0.8367 0.000 0.000 0.000 0.996 0.004
#> ERR863741 4 0.7926 0.2028 0.224 0.104 0.000 0.432 0.240
#> ERR863743 1 0.2179 0.7915 0.888 0.000 0.000 0.000 0.112
#> ERR863745 2 0.0000 0.9578 0.000 1.000 0.000 0.000 0.000
#> ERR863744 5 0.2813 0.7483 0.168 0.000 0.000 0.000 0.832
#> ERR863746 5 0.0963 0.7648 0.036 0.000 0.000 0.000 0.964
#> ERR863748 4 0.5143 0.2423 0.032 0.000 0.420 0.544 0.004
#> ERR863747 2 0.2389 0.8432 0.004 0.880 0.116 0.000 0.000
#> ERR863694 4 0.0162 0.8367 0.000 0.000 0.000 0.996 0.004
#> ERR863693 4 0.3476 0.6851 0.020 0.000 0.000 0.804 0.176
#> ERR863686 5 0.1282 0.7352 0.044 0.000 0.000 0.004 0.952
#> ERR863678 1 0.1444 0.7476 0.948 0.000 0.040 0.000 0.012
#> ERR863685 3 0.0000 0.9455 0.000 0.000 1.000 0.000 0.000
#> ERR863689 1 0.5598 0.4003 0.524 0.000 0.000 0.076 0.400
#> ERR863691 1 0.6438 0.3508 0.500 0.000 0.000 0.220 0.280
#> ERR863682 5 0.4307 0.0869 0.496 0.000 0.000 0.000 0.504
#> ERR863695 2 0.0162 0.9560 0.004 0.996 0.000 0.000 0.000
#> ERR863683 5 0.3424 0.6970 0.240 0.000 0.000 0.000 0.760
#> ERR863684 4 0.0162 0.8365 0.000 0.000 0.000 0.996 0.004
#> ERR863702 5 0.1571 0.7413 0.060 0.000 0.000 0.004 0.936
#> ERR863687 3 0.4885 0.3190 0.028 0.400 0.572 0.000 0.000
#> ERR863706 3 0.0000 0.9455 0.000 0.000 1.000 0.000 0.000
#> ERR863708 2 0.0000 0.9578 0.000 1.000 0.000 0.000 0.000
#> ERR863710 1 0.2020 0.7932 0.900 0.000 0.000 0.000 0.100
#> ERR863709 2 0.3166 0.8407 0.020 0.860 0.000 0.104 0.016
#> ERR863753 2 0.0000 0.9578 0.000 1.000 0.000 0.000 0.000
#> ERR863754 1 0.6319 0.4132 0.524 0.000 0.000 0.204 0.272
#> ERR863749 1 0.2516 0.7718 0.860 0.000 0.000 0.000 0.140
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> ERR863675 4 0.2003 0.7656 0.000 0.000 0.000 0.884 0.116 0.000
#> ERR863705 3 0.2178 0.7951 0.000 0.000 0.868 0.000 0.132 0.000
#> ERR863704 2 0.0260 0.9503 0.000 0.992 0.000 0.000 0.008 0.000
#> ERR863679 3 0.3547 0.6732 0.000 0.000 0.696 0.004 0.300 0.000
#> ERR863680 2 0.0146 0.9505 0.000 0.996 0.000 0.000 0.004 0.000
#> ERR863676 2 0.0146 0.9505 0.000 0.996 0.000 0.000 0.004 0.000
#> ERR863677 4 0.0146 0.7954 0.000 0.000 0.000 0.996 0.004 0.000
#> ERR863688 6 0.3693 0.7311 0.120 0.000 0.000 0.000 0.092 0.788
#> ERR863690 1 0.4575 0.6251 0.696 0.000 0.000 0.000 0.180 0.124
#> ERR863692 5 0.7578 0.2450 0.156 0.000 0.000 0.268 0.312 0.264
#> ERR863703 1 0.3627 0.6992 0.792 0.000 0.000 0.000 0.080 0.128
#> ERR863712 4 0.0363 0.7964 0.000 0.000 0.000 0.988 0.012 0.000
#> ERR863711 1 0.3950 0.5125 0.696 0.000 0.000 0.000 0.028 0.276
#> ERR863760 2 0.0458 0.9484 0.000 0.984 0.000 0.000 0.016 0.000
#> ERR863727 6 0.1003 0.7695 0.016 0.000 0.000 0.000 0.020 0.964
#> ERR863766 3 0.0000 0.8294 0.000 0.000 1.000 0.000 0.000 0.000
#> ERR863767 1 0.1908 0.7486 0.916 0.000 0.000 0.000 0.056 0.028
#> ERR863752 2 0.0363 0.9502 0.000 0.988 0.000 0.000 0.012 0.000
#> ERR863757 6 0.5466 0.6224 0.084 0.000 0.188 0.000 0.068 0.660
#> ERR863758 1 0.1867 0.7527 0.916 0.000 0.000 0.000 0.020 0.064
#> ERR863755 6 0.4297 0.6544 0.176 0.000 0.000 0.000 0.100 0.724
#> ERR863756 4 0.5417 0.2214 0.000 0.000 0.264 0.584 0.148 0.004
#> ERR863707 3 0.1387 0.8220 0.000 0.000 0.932 0.000 0.068 0.000
#> ERR863681 3 0.0935 0.8305 0.000 0.000 0.964 0.004 0.032 0.000
#> ERR863719 4 0.1152 0.7932 0.000 0.000 0.000 0.952 0.044 0.004
#> ERR863759 2 0.1088 0.9360 0.000 0.960 0.016 0.000 0.024 0.000
#> ERR863718 1 0.1995 0.7552 0.912 0.000 0.000 0.000 0.036 0.052
#> ERR863717 6 0.2658 0.7458 0.036 0.000 0.000 0.000 0.100 0.864
#> ERR863715 2 0.0547 0.9490 0.000 0.980 0.000 0.000 0.020 0.000
#> ERR863716 6 0.3712 0.7238 0.180 0.000 0.000 0.000 0.052 0.768
#> ERR863722 5 0.6147 0.0142 0.004 0.000 0.264 0.312 0.420 0.000
#> ERR863721 4 0.1007 0.7832 0.000 0.000 0.000 0.956 0.044 0.000
#> ERR863720 2 0.0146 0.9505 0.000 0.996 0.000 0.000 0.004 0.000
#> ERR863723 6 0.4317 0.6353 0.252 0.000 0.000 0.000 0.060 0.688
#> ERR863761 3 0.0260 0.8301 0.000 0.000 0.992 0.000 0.008 0.000
#> ERR863735 1 0.2179 0.7458 0.900 0.000 0.000 0.000 0.064 0.036
#> ERR863734 3 0.0146 0.8285 0.000 0.000 0.996 0.000 0.004 0.000
#> ERR863736 2 0.1745 0.9161 0.000 0.924 0.020 0.000 0.056 0.000
#> ERR863729 5 0.6105 0.1489 0.028 0.336 0.000 0.080 0.532 0.024
#> ERR863728 1 0.2425 0.7359 0.884 0.000 0.000 0.004 0.088 0.024
#> ERR863731 1 0.1657 0.7461 0.928 0.000 0.000 0.000 0.056 0.016
#> ERR863764 4 0.3782 0.4693 0.000 0.000 0.004 0.636 0.360 0.000
#> ERR863740 6 0.3293 0.7339 0.140 0.000 0.000 0.000 0.048 0.812
#> ERR863765 3 0.2511 0.7442 0.000 0.000 0.880 0.000 0.056 0.064
#> ERR863762 3 0.4438 0.5885 0.004 0.000 0.612 0.016 0.360 0.008
#> ERR863724 3 0.0935 0.8305 0.000 0.000 0.964 0.004 0.032 0.000
#> ERR863733 4 0.3023 0.6954 0.004 0.008 0.000 0.808 0.180 0.000
#> ERR863732 3 0.4720 0.6042 0.004 0.000 0.628 0.060 0.308 0.000
#> ERR863730 6 0.1003 0.7692 0.016 0.000 0.000 0.000 0.020 0.964
#> ERR863742 6 0.5390 0.5458 0.288 0.000 0.040 0.000 0.064 0.608
#> ERR863763 4 0.1501 0.7809 0.000 0.000 0.000 0.924 0.076 0.000
#> ERR863741 5 0.7162 0.2597 0.100 0.036 0.000 0.272 0.492 0.100
#> ERR863743 1 0.1845 0.7546 0.920 0.000 0.000 0.000 0.028 0.052
#> ERR863745 2 0.0632 0.9463 0.000 0.976 0.000 0.000 0.024 0.000
#> ERR863744 6 0.2586 0.7658 0.100 0.000 0.000 0.000 0.032 0.868
#> ERR863746 6 0.1334 0.7712 0.032 0.000 0.000 0.000 0.020 0.948
#> ERR863748 5 0.6029 -0.0445 0.000 0.000 0.248 0.356 0.396 0.000
#> ERR863747 2 0.2509 0.8486 0.000 0.876 0.088 0.000 0.036 0.000
#> ERR863694 4 0.1663 0.7833 0.000 0.000 0.000 0.912 0.088 0.000
#> ERR863693 4 0.4507 0.4423 0.012 0.000 0.000 0.716 0.196 0.076
#> ERR863686 6 0.4630 0.5378 0.036 0.000 0.000 0.020 0.284 0.660
#> ERR863678 1 0.5505 0.3939 0.592 0.000 0.052 0.004 0.308 0.044
#> ERR863685 3 0.0000 0.8294 0.000 0.000 1.000 0.000 0.000 0.000
#> ERR863689 1 0.7144 0.0559 0.380 0.000 0.000 0.084 0.288 0.248
#> ERR863691 5 0.7253 0.1953 0.244 0.000 0.000 0.176 0.428 0.152
#> ERR863682 1 0.5065 0.1394 0.524 0.000 0.000 0.000 0.080 0.396
#> ERR863695 2 0.1644 0.9073 0.004 0.920 0.000 0.000 0.076 0.000
#> ERR863683 6 0.3660 0.7155 0.160 0.000 0.000 0.000 0.060 0.780
#> ERR863684 4 0.1204 0.7808 0.000 0.000 0.000 0.944 0.056 0.000
#> ERR863702 6 0.4883 0.5823 0.088 0.000 0.000 0.008 0.248 0.656
#> ERR863687 3 0.6097 0.2016 0.000 0.320 0.384 0.000 0.296 0.000
#> ERR863706 3 0.0622 0.8214 0.000 0.000 0.980 0.000 0.012 0.008
#> ERR863708 2 0.0000 0.9505 0.000 1.000 0.000 0.000 0.000 0.000
#> ERR863710 1 0.1970 0.7494 0.912 0.000 0.000 0.000 0.028 0.060
#> ERR863709 2 0.4590 0.6274 0.008 0.720 0.000 0.092 0.176 0.004
#> ERR863753 2 0.0363 0.9502 0.000 0.988 0.000 0.000 0.012 0.000
#> ERR863754 1 0.7296 -0.1636 0.348 0.000 0.000 0.188 0.340 0.124
#> ERR863749 1 0.1983 0.7496 0.908 0.000 0.000 0.000 0.020 0.072
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)
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 17118 rows and 78 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'CV' method.
#> Subgroups are detected by 'pam' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 5.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 0.558 0.898 0.935 0.1373 0.949 0.949
#> 3 3 0.372 0.694 0.867 2.1701 0.627 0.607
#> 4 4 0.630 0.745 0.877 0.3670 0.793 0.661
#> 5 5 0.693 0.760 0.882 0.1473 0.825 0.617
#> 6 6 0.602 0.656 0.798 0.0849 0.971 0.907
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 5
Following shows the table of the partitions (You need to click the show/hide
code output link to see it). The membership matrix (columns with name p*
)
is inferred by
clue::cl_consensus()
function with the SE
method. Basically the value in the membership matrix
represents the probability to belong to a certain group. The finall class
label for an item is determined with the group with highest probability it
belongs to.
In get_classes()
function, the entropy is calculated from the membership
matrix and the silhouette score is calculated from the consensus matrix.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> ERR863675 1 0.3879 0.900 0.924 0.076
#> ERR863705 1 0.7745 0.807 0.772 0.228
#> ERR863704 1 0.6148 0.861 0.848 0.152
#> ERR863679 1 0.7745 0.807 0.772 0.228
#> ERR863680 1 0.6247 0.859 0.844 0.156
#> ERR863676 1 0.6247 0.859 0.844 0.156
#> ERR863677 1 0.0672 0.926 0.992 0.008
#> ERR863688 1 0.0000 0.929 1.000 0.000
#> ERR863690 1 0.0000 0.929 1.000 0.000
#> ERR863692 1 0.0000 0.929 1.000 0.000
#> ERR863703 1 0.0000 0.929 1.000 0.000
#> ERR863712 1 0.0000 0.929 1.000 0.000
#> ERR863711 1 0.0000 0.929 1.000 0.000
#> ERR863760 1 0.6247 0.859 0.844 0.156
#> ERR863727 1 0.0000 0.929 1.000 0.000
#> ERR863766 1 0.7745 0.807 0.772 0.228
#> ERR863767 1 0.0000 0.929 1.000 0.000
#> ERR863752 1 0.6801 0.845 0.820 0.180
#> ERR863757 1 0.0376 0.928 0.996 0.004
#> ERR863758 1 0.0000 0.929 1.000 0.000
#> ERR863755 1 0.0000 0.929 1.000 0.000
#> ERR863756 1 0.2778 0.908 0.952 0.048
#> ERR863707 1 0.7745 0.807 0.772 0.228
#> ERR863681 2 0.0000 1.000 0.000 1.000
#> ERR863719 1 0.0000 0.929 1.000 0.000
#> ERR863759 1 0.7745 0.807 0.772 0.228
#> ERR863718 1 0.0000 0.929 1.000 0.000
#> ERR863717 1 0.0000 0.929 1.000 0.000
#> ERR863715 1 0.6247 0.861 0.844 0.156
#> ERR863716 1 0.0000 0.929 1.000 0.000
#> ERR863722 1 0.1184 0.924 0.984 0.016
#> ERR863721 1 0.0000 0.929 1.000 0.000
#> ERR863720 1 0.5946 0.866 0.856 0.144
#> ERR863723 1 0.0000 0.929 1.000 0.000
#> ERR863761 1 0.7745 0.807 0.772 0.228
#> ERR863735 1 0.0000 0.929 1.000 0.000
#> ERR863734 1 0.7745 0.807 0.772 0.228
#> ERR863736 1 0.6247 0.859 0.844 0.156
#> ERR863729 1 0.0000 0.929 1.000 0.000
#> ERR863728 1 0.0672 0.926 0.992 0.008
#> ERR863731 1 0.0000 0.929 1.000 0.000
#> ERR863764 1 0.0000 0.929 1.000 0.000
#> ERR863740 1 0.0000 0.929 1.000 0.000
#> ERR863765 1 0.7056 0.836 0.808 0.192
#> ERR863762 1 0.3274 0.901 0.940 0.060
#> ERR863724 2 0.0000 1.000 0.000 1.000
#> ERR863733 1 0.0672 0.926 0.992 0.008
#> ERR863732 1 0.7745 0.807 0.772 0.228
#> ERR863730 1 0.0000 0.929 1.000 0.000
#> ERR863742 1 0.0000 0.929 1.000 0.000
#> ERR863763 1 0.0000 0.929 1.000 0.000
#> ERR863741 1 0.0000 0.929 1.000 0.000
#> ERR863743 1 0.0000 0.929 1.000 0.000
#> ERR863745 1 0.7219 0.830 0.800 0.200
#> ERR863744 1 0.0672 0.926 0.992 0.008
#> ERR863746 1 0.0000 0.929 1.000 0.000
#> ERR863748 1 0.5946 0.867 0.856 0.144
#> ERR863747 1 0.7745 0.807 0.772 0.228
#> ERR863694 1 0.0000 0.929 1.000 0.000
#> ERR863693 1 0.0000 0.929 1.000 0.000
#> ERR863686 1 0.0000 0.929 1.000 0.000
#> ERR863678 1 0.0000 0.929 1.000 0.000
#> ERR863685 1 0.7745 0.807 0.772 0.228
#> ERR863689 1 0.0000 0.929 1.000 0.000
#> ERR863691 1 0.0000 0.929 1.000 0.000
#> ERR863682 1 0.0000 0.929 1.000 0.000
#> ERR863695 1 0.1414 0.924 0.980 0.020
#> ERR863683 1 0.0000 0.929 1.000 0.000
#> ERR863684 1 0.0000 0.929 1.000 0.000
#> ERR863702 1 0.0000 0.929 1.000 0.000
#> ERR863687 1 0.7745 0.807 0.772 0.228
#> ERR863706 1 0.7745 0.807 0.772 0.228
#> ERR863708 1 0.6247 0.859 0.844 0.156
#> ERR863710 1 0.0000 0.929 1.000 0.000
#> ERR863709 1 0.0000 0.929 1.000 0.000
#> ERR863753 1 0.6438 0.855 0.836 0.164
#> ERR863754 1 0.0000 0.929 1.000 0.000
#> ERR863749 1 0.0000 0.929 1.000 0.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> ERR863675 1 0.5706 0.566 0.680 0 0.320
#> ERR863705 3 0.0237 0.611 0.004 0 0.996
#> ERR863704 1 0.5988 0.446 0.632 0 0.368
#> ERR863679 3 0.0747 0.620 0.016 0 0.984
#> ERR863680 1 0.6126 0.404 0.600 0 0.400
#> ERR863676 1 0.6045 0.419 0.620 0 0.380
#> ERR863677 1 0.6095 0.305 0.608 0 0.392
#> ERR863688 1 0.0000 0.849 1.000 0 0.000
#> ERR863690 1 0.0000 0.849 1.000 0 0.000
#> ERR863692 1 0.0000 0.849 1.000 0 0.000
#> ERR863703 1 0.0892 0.844 0.980 0 0.020
#> ERR863712 1 0.3941 0.768 0.844 0 0.156
#> ERR863711 1 0.0000 0.849 1.000 0 0.000
#> ERR863760 1 0.5291 0.563 0.732 0 0.268
#> ERR863727 1 0.0000 0.849 1.000 0 0.000
#> ERR863766 3 0.4121 0.621 0.168 0 0.832
#> ERR863767 1 0.0892 0.844 0.980 0 0.020
#> ERR863752 3 0.6008 0.412 0.372 0 0.628
#> ERR863757 1 0.0237 0.848 0.996 0 0.004
#> ERR863758 1 0.0892 0.844 0.980 0 0.020
#> ERR863755 1 0.0000 0.849 1.000 0 0.000
#> ERR863756 1 0.6252 0.155 0.556 0 0.444
#> ERR863707 3 0.0237 0.611 0.004 0 0.996
#> ERR863681 2 0.0000 1.000 0.000 1 0.000
#> ERR863719 1 0.3619 0.773 0.864 0 0.136
#> ERR863759 3 0.5678 0.526 0.316 0 0.684
#> ERR863718 1 0.0892 0.844 0.980 0 0.020
#> ERR863717 1 0.0000 0.849 1.000 0 0.000
#> ERR863715 3 0.6062 0.384 0.384 0 0.616
#> ERR863716 1 0.0000 0.849 1.000 0 0.000
#> ERR863722 3 0.6079 0.377 0.388 0 0.612
#> ERR863721 1 0.2066 0.833 0.940 0 0.060
#> ERR863720 1 0.5948 0.493 0.640 0 0.360
#> ERR863723 1 0.0000 0.849 1.000 0 0.000
#> ERR863761 3 0.4002 0.624 0.160 0 0.840
#> ERR863735 1 0.0892 0.844 0.980 0 0.020
#> ERR863734 3 0.4346 0.620 0.184 0 0.816
#> ERR863736 1 0.4931 0.597 0.768 0 0.232
#> ERR863729 1 0.3752 0.767 0.856 0 0.144
#> ERR863728 1 0.4178 0.681 0.828 0 0.172
#> ERR863731 1 0.0892 0.844 0.980 0 0.020
#> ERR863764 1 0.4346 0.745 0.816 0 0.184
#> ERR863740 1 0.0000 0.849 1.000 0 0.000
#> ERR863765 3 0.5138 0.616 0.252 0 0.748
#> ERR863762 3 0.5178 0.549 0.256 0 0.744
#> ERR863724 2 0.0000 1.000 0.000 1 0.000
#> ERR863733 1 0.6192 0.243 0.580 0 0.420
#> ERR863732 3 0.1529 0.632 0.040 0 0.960
#> ERR863730 1 0.0000 0.849 1.000 0 0.000
#> ERR863742 1 0.0892 0.844 0.980 0 0.020
#> ERR863763 1 0.4062 0.761 0.836 0 0.164
#> ERR863741 1 0.0747 0.846 0.984 0 0.016
#> ERR863743 1 0.0000 0.849 1.000 0 0.000
#> ERR863745 3 0.5785 0.472 0.332 0 0.668
#> ERR863744 1 0.4887 0.576 0.772 0 0.228
#> ERR863746 1 0.0000 0.849 1.000 0 0.000
#> ERR863748 3 0.3551 0.628 0.132 0 0.868
#> ERR863747 3 0.4452 0.636 0.192 0 0.808
#> ERR863694 1 0.3752 0.781 0.856 0 0.144
#> ERR863693 1 0.3619 0.773 0.864 0 0.136
#> ERR863686 1 0.0000 0.849 1.000 0 0.000
#> ERR863678 1 0.0892 0.844 0.980 0 0.020
#> ERR863685 3 0.4121 0.621 0.168 0 0.832
#> ERR863689 1 0.0000 0.849 1.000 0 0.000
#> ERR863691 1 0.2356 0.822 0.928 0 0.072
#> ERR863682 1 0.0000 0.849 1.000 0 0.000
#> ERR863695 1 0.6280 0.160 0.540 0 0.460
#> ERR863683 1 0.0000 0.849 1.000 0 0.000
#> ERR863684 1 0.1860 0.831 0.948 0 0.052
#> ERR863702 1 0.0000 0.849 1.000 0 0.000
#> ERR863687 3 0.0000 0.605 0.000 0 1.000
#> ERR863706 3 0.4399 0.619 0.188 0 0.812
#> ERR863708 1 0.6026 0.428 0.624 0 0.376
#> ERR863710 1 0.0892 0.844 0.980 0 0.020
#> ERR863709 1 0.4062 0.763 0.836 0 0.164
#> ERR863753 3 0.6026 0.402 0.376 0 0.624
#> ERR863754 1 0.0000 0.849 1.000 0 0.000
#> ERR863749 1 0.0000 0.849 1.000 0 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> ERR863675 1 0.4898 0.533 0.584 0.416 0.000 0
#> ERR863705 3 0.0000 0.817 0.000 0.000 1.000 0
#> ERR863704 2 0.0804 0.801 0.008 0.980 0.012 0
#> ERR863679 3 0.0188 0.815 0.000 0.004 0.996 0
#> ERR863680 2 0.2281 0.809 0.000 0.904 0.096 0
#> ERR863676 2 0.3852 0.752 0.008 0.800 0.192 0
#> ERR863677 1 0.4877 0.534 0.592 0.408 0.000 0
#> ERR863688 1 0.0000 0.851 1.000 0.000 0.000 0
#> ERR863690 1 0.0000 0.851 1.000 0.000 0.000 0
#> ERR863692 1 0.0188 0.850 0.996 0.004 0.000 0
#> ERR863703 1 0.0336 0.849 0.992 0.008 0.000 0
#> ERR863712 1 0.4898 0.533 0.584 0.416 0.000 0
#> ERR863711 1 0.0000 0.851 1.000 0.000 0.000 0
#> ERR863760 2 0.7373 0.404 0.300 0.508 0.192 0
#> ERR863727 1 0.0000 0.851 1.000 0.000 0.000 0
#> ERR863766 3 0.0000 0.817 0.000 0.000 1.000 0
#> ERR863767 1 0.0336 0.849 0.992 0.008 0.000 0
#> ERR863752 2 0.0336 0.794 0.008 0.992 0.000 0
#> ERR863757 1 0.0188 0.850 0.996 0.000 0.004 0
#> ERR863758 1 0.0336 0.849 0.992 0.008 0.000 0
#> ERR863755 1 0.0000 0.851 1.000 0.000 0.000 0
#> ERR863756 2 0.4114 0.719 0.112 0.828 0.060 0
#> ERR863707 3 0.0000 0.817 0.000 0.000 1.000 0
#> ERR863681 4 0.0000 1.000 0.000 0.000 0.000 1
#> ERR863719 1 0.4877 0.534 0.592 0.408 0.000 0
#> ERR863759 2 0.4086 0.739 0.008 0.776 0.216 0
#> ERR863718 1 0.0336 0.849 0.992 0.008 0.000 0
#> ERR863717 1 0.0000 0.851 1.000 0.000 0.000 0
#> ERR863715 2 0.0336 0.794 0.008 0.992 0.000 0
#> ERR863716 1 0.0000 0.851 1.000 0.000 0.000 0
#> ERR863722 1 0.5203 0.522 0.576 0.416 0.008 0
#> ERR863721 1 0.4790 0.579 0.620 0.380 0.000 0
#> ERR863720 2 0.3441 0.794 0.024 0.856 0.120 0
#> ERR863723 1 0.0000 0.851 1.000 0.000 0.000 0
#> ERR863761 3 0.0000 0.817 0.000 0.000 1.000 0
#> ERR863735 1 0.0336 0.849 0.992 0.008 0.000 0
#> ERR863734 3 0.0000 0.817 0.000 0.000 1.000 0
#> ERR863736 1 0.4204 0.693 0.788 0.020 0.192 0
#> ERR863729 1 0.4877 0.534 0.592 0.408 0.000 0
#> ERR863728 1 0.0336 0.849 0.992 0.008 0.000 0
#> ERR863731 1 0.0336 0.849 0.992 0.008 0.000 0
#> ERR863764 1 0.4898 0.533 0.584 0.416 0.000 0
#> ERR863740 1 0.0000 0.851 1.000 0.000 0.000 0
#> ERR863765 3 0.4585 0.330 0.332 0.000 0.668 0
#> ERR863762 3 0.5592 0.427 0.264 0.056 0.680 0
#> ERR863724 4 0.0000 1.000 0.000 0.000 0.000 1
#> ERR863733 2 0.1389 0.766 0.048 0.952 0.000 0
#> ERR863732 3 0.3444 0.641 0.000 0.184 0.816 0
#> ERR863730 1 0.0000 0.851 1.000 0.000 0.000 0
#> ERR863742 1 0.0336 0.849 0.992 0.008 0.000 0
#> ERR863763 1 0.4898 0.533 0.584 0.416 0.000 0
#> ERR863741 1 0.2921 0.773 0.860 0.140 0.000 0
#> ERR863743 1 0.0000 0.851 1.000 0.000 0.000 0
#> ERR863745 2 0.3528 0.751 0.000 0.808 0.192 0
#> ERR863744 1 0.0336 0.849 0.992 0.008 0.000 0
#> ERR863746 1 0.0000 0.851 1.000 0.000 0.000 0
#> ERR863748 3 0.4898 0.221 0.000 0.416 0.584 0
#> ERR863747 2 0.5150 0.388 0.008 0.596 0.396 0
#> ERR863694 1 0.4830 0.564 0.608 0.392 0.000 0
#> ERR863693 1 0.4866 0.540 0.596 0.404 0.000 0
#> ERR863686 1 0.0336 0.849 0.992 0.008 0.000 0
#> ERR863678 1 0.0336 0.849 0.992 0.008 0.000 0
#> ERR863685 3 0.0000 0.817 0.000 0.000 1.000 0
#> ERR863689 1 0.0000 0.851 1.000 0.000 0.000 0
#> ERR863691 1 0.4103 0.688 0.744 0.256 0.000 0
#> ERR863682 1 0.0000 0.851 1.000 0.000 0.000 0
#> ERR863695 2 0.0188 0.790 0.004 0.996 0.000 0
#> ERR863683 1 0.0000 0.851 1.000 0.000 0.000 0
#> ERR863684 1 0.4776 0.575 0.624 0.376 0.000 0
#> ERR863702 1 0.0000 0.851 1.000 0.000 0.000 0
#> ERR863687 3 0.1211 0.790 0.000 0.040 0.960 0
#> ERR863706 3 0.0000 0.817 0.000 0.000 1.000 0
#> ERR863708 2 0.1807 0.812 0.008 0.940 0.052 0
#> ERR863710 1 0.0336 0.849 0.992 0.008 0.000 0
#> ERR863709 1 0.4967 0.462 0.548 0.452 0.000 0
#> ERR863753 2 0.2342 0.813 0.008 0.912 0.080 0
#> ERR863754 1 0.2760 0.788 0.872 0.128 0.000 0
#> ERR863749 1 0.0000 0.851 1.000 0.000 0.000 0
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> ERR863675 4 0.3242 0.777 0.216 0.000 0.000 0.784 0
#> ERR863705 3 0.1908 0.767 0.000 0.000 0.908 0.092 0
#> ERR863704 2 0.2230 0.750 0.000 0.884 0.000 0.116 0
#> ERR863679 3 0.3039 0.715 0.000 0.000 0.808 0.192 0
#> ERR863680 2 0.0162 0.821 0.000 0.996 0.004 0.000 0
#> ERR863676 2 0.0162 0.821 0.000 0.996 0.004 0.000 0
#> ERR863677 4 0.2690 0.769 0.156 0.000 0.000 0.844 0
#> ERR863688 1 0.0290 0.918 0.992 0.000 0.000 0.008 0
#> ERR863690 1 0.0000 0.919 1.000 0.000 0.000 0.000 0
#> ERR863692 1 0.0162 0.918 0.996 0.000 0.000 0.004 0
#> ERR863703 1 0.0000 0.919 1.000 0.000 0.000 0.000 0
#> ERR863712 4 0.3242 0.777 0.216 0.000 0.000 0.784 0
#> ERR863711 1 0.1270 0.899 0.948 0.000 0.000 0.052 0
#> ERR863760 2 0.7372 0.289 0.264 0.508 0.092 0.136 0
#> ERR863727 1 0.1043 0.910 0.960 0.000 0.000 0.040 0
#> ERR863766 3 0.0000 0.797 0.000 0.000 1.000 0.000 0
#> ERR863767 1 0.0000 0.919 1.000 0.000 0.000 0.000 0
#> ERR863752 2 0.0000 0.821 0.000 1.000 0.000 0.000 0
#> ERR863757 1 0.0771 0.915 0.976 0.000 0.004 0.020 0
#> ERR863758 1 0.0000 0.919 1.000 0.000 0.000 0.000 0
#> ERR863755 1 0.1043 0.906 0.960 0.000 0.000 0.040 0
#> ERR863756 4 0.3251 0.618 0.080 0.016 0.040 0.864 0
#> ERR863707 3 0.0000 0.797 0.000 0.000 1.000 0.000 0
#> ERR863681 5 0.0000 1.000 0.000 0.000 0.000 0.000 1
#> ERR863719 4 0.3003 0.767 0.188 0.000 0.000 0.812 0
#> ERR863759 2 0.4355 0.689 0.000 0.760 0.164 0.076 0
#> ERR863718 1 0.0000 0.919 1.000 0.000 0.000 0.000 0
#> ERR863717 1 0.1410 0.898 0.940 0.000 0.000 0.060 0
#> ERR863715 2 0.1792 0.794 0.000 0.916 0.000 0.084 0
#> ERR863716 1 0.0162 0.918 0.996 0.000 0.000 0.004 0
#> ERR863722 4 0.1638 0.671 0.064 0.000 0.004 0.932 0
#> ERR863721 1 0.4150 0.165 0.612 0.000 0.000 0.388 0
#> ERR863720 2 0.0000 0.821 0.000 1.000 0.000 0.000 0
#> ERR863723 1 0.1341 0.901 0.944 0.000 0.000 0.056 0
#> ERR863761 3 0.0000 0.797 0.000 0.000 1.000 0.000 0
#> ERR863735 1 0.0000 0.919 1.000 0.000 0.000 0.000 0
#> ERR863734 3 0.0000 0.797 0.000 0.000 1.000 0.000 0
#> ERR863736 1 0.3865 0.763 0.808 0.000 0.100 0.092 0
#> ERR863729 4 0.3452 0.731 0.244 0.000 0.000 0.756 0
#> ERR863728 1 0.0794 0.904 0.972 0.000 0.000 0.028 0
#> ERR863731 1 0.0000 0.919 1.000 0.000 0.000 0.000 0
#> ERR863764 4 0.2813 0.768 0.168 0.000 0.000 0.832 0
#> ERR863740 1 0.0510 0.915 0.984 0.000 0.000 0.016 0
#> ERR863765 3 0.5968 0.353 0.268 0.000 0.576 0.156 0
#> ERR863762 4 0.6759 -0.212 0.268 0.000 0.348 0.384 0
#> ERR863724 5 0.0000 1.000 0.000 0.000 0.000 0.000 1
#> ERR863733 4 0.2561 0.618 0.000 0.144 0.000 0.856 0
#> ERR863732 3 0.4297 0.411 0.000 0.000 0.528 0.472 0
#> ERR863730 1 0.1544 0.894 0.932 0.000 0.000 0.068 0
#> ERR863742 1 0.0510 0.915 0.984 0.000 0.000 0.016 0
#> ERR863763 4 0.3305 0.774 0.224 0.000 0.000 0.776 0
#> ERR863741 1 0.2966 0.740 0.816 0.000 0.000 0.184 0
#> ERR863743 1 0.0000 0.919 1.000 0.000 0.000 0.000 0
#> ERR863745 2 0.3346 0.756 0.000 0.844 0.064 0.092 0
#> ERR863744 1 0.1121 0.898 0.956 0.000 0.000 0.044 0
#> ERR863746 1 0.0609 0.915 0.980 0.000 0.000 0.020 0
#> ERR863748 4 0.1544 0.602 0.000 0.000 0.068 0.932 0
#> ERR863747 2 0.6319 0.402 0.000 0.524 0.272 0.204 0
#> ERR863694 4 0.3895 0.683 0.320 0.000 0.000 0.680 0
#> ERR863693 4 0.3895 0.695 0.320 0.000 0.000 0.680 0
#> ERR863686 1 0.1608 0.894 0.928 0.000 0.000 0.072 0
#> ERR863678 1 0.0000 0.919 1.000 0.000 0.000 0.000 0
#> ERR863685 3 0.0000 0.797 0.000 0.000 1.000 0.000 0
#> ERR863689 1 0.0000 0.919 1.000 0.000 0.000 0.000 0
#> ERR863691 1 0.4150 0.267 0.612 0.000 0.000 0.388 0
#> ERR863682 1 0.0000 0.919 1.000 0.000 0.000 0.000 0
#> ERR863695 4 0.3796 0.475 0.000 0.300 0.000 0.700 0
#> ERR863683 1 0.1544 0.894 0.932 0.000 0.000 0.068 0
#> ERR863684 1 0.4304 -0.148 0.516 0.000 0.000 0.484 0
#> ERR863702 1 0.1270 0.899 0.948 0.000 0.000 0.052 0
#> ERR863687 3 0.4201 0.521 0.000 0.000 0.592 0.408 0
#> ERR863706 3 0.0000 0.797 0.000 0.000 1.000 0.000 0
#> ERR863708 2 0.0000 0.821 0.000 1.000 0.000 0.000 0
#> ERR863710 1 0.0000 0.919 1.000 0.000 0.000 0.000 0
#> ERR863709 4 0.4349 0.767 0.176 0.068 0.000 0.756 0
#> ERR863753 2 0.0000 0.821 0.000 1.000 0.000 0.000 0
#> ERR863754 1 0.2377 0.786 0.872 0.000 0.000 0.128 0
#> ERR863749 1 0.0000 0.919 1.000 0.000 0.000 0.000 0
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> ERR863675 4 0.1910 0.681 0.108 0.000 0.000 0.892 0 0.000
#> ERR863705 3 0.2609 0.596 0.000 0.000 0.868 0.036 0 0.096
#> ERR863704 2 0.2019 0.751 0.000 0.900 0.000 0.088 0 0.012
#> ERR863679 3 0.4945 -0.448 0.000 0.000 0.484 0.064 0 0.452
#> ERR863680 2 0.1387 0.777 0.000 0.932 0.000 0.000 0 0.068
#> ERR863676 2 0.1327 0.777 0.000 0.936 0.000 0.000 0 0.064
#> ERR863677 4 0.0935 0.669 0.032 0.000 0.000 0.964 0 0.004
#> ERR863688 1 0.1806 0.834 0.908 0.000 0.000 0.004 0 0.088
#> ERR863690 1 0.0632 0.841 0.976 0.000 0.000 0.000 0 0.024
#> ERR863692 1 0.1765 0.831 0.904 0.000 0.000 0.000 0 0.096
#> ERR863703 1 0.0458 0.842 0.984 0.000 0.000 0.000 0 0.016
#> ERR863712 4 0.1765 0.686 0.096 0.000 0.000 0.904 0 0.000
#> ERR863711 1 0.3268 0.790 0.824 0.000 0.000 0.076 0 0.100
#> ERR863760 2 0.8191 0.180 0.132 0.368 0.092 0.288 0 0.120
#> ERR863727 1 0.3688 0.774 0.724 0.000 0.000 0.020 0 0.256
#> ERR863766 3 0.0000 0.759 0.000 0.000 1.000 0.000 0 0.000
#> ERR863767 1 0.0458 0.842 0.984 0.000 0.000 0.000 0 0.016
#> ERR863752 2 0.1501 0.775 0.000 0.924 0.000 0.000 0 0.076
#> ERR863757 1 0.3087 0.780 0.808 0.000 0.004 0.012 0 0.176
#> ERR863758 1 0.0363 0.839 0.988 0.000 0.000 0.000 0 0.012
#> ERR863755 1 0.3211 0.811 0.824 0.000 0.000 0.056 0 0.120
#> ERR863756 4 0.5741 0.161 0.072 0.000 0.040 0.512 0 0.376
#> ERR863707 3 0.0000 0.759 0.000 0.000 1.000 0.000 0 0.000
#> ERR863681 5 0.0000 1.000 0.000 0.000 0.000 0.000 1 0.000
#> ERR863719 4 0.1334 0.668 0.032 0.000 0.000 0.948 0 0.020
#> ERR863759 2 0.4404 0.671 0.000 0.752 0.152 0.060 0 0.036
#> ERR863718 1 0.0547 0.842 0.980 0.000 0.000 0.000 0 0.020
#> ERR863717 1 0.4500 0.730 0.676 0.000 0.000 0.076 0 0.248
#> ERR863715 2 0.3172 0.743 0.000 0.832 0.000 0.076 0 0.092
#> ERR863716 1 0.0713 0.843 0.972 0.000 0.000 0.000 0 0.028
#> ERR863722 4 0.1501 0.603 0.000 0.000 0.000 0.924 0 0.076
#> ERR863721 1 0.3727 0.246 0.612 0.000 0.000 0.388 0 0.000
#> ERR863720 2 0.1349 0.780 0.000 0.940 0.000 0.004 0 0.056
#> ERR863723 1 0.3645 0.783 0.784 0.000 0.000 0.064 0 0.152
#> ERR863761 3 0.0000 0.759 0.000 0.000 1.000 0.000 0 0.000
#> ERR863735 1 0.0363 0.839 0.988 0.000 0.000 0.000 0 0.012
#> ERR863734 3 0.0000 0.759 0.000 0.000 1.000 0.000 0 0.000
#> ERR863736 1 0.5981 0.612 0.604 0.000 0.100 0.084 0 0.212
#> ERR863729 4 0.5068 0.472 0.240 0.000 0.000 0.624 0 0.136
#> ERR863728 1 0.0291 0.841 0.992 0.000 0.000 0.004 0 0.004
#> ERR863731 1 0.0363 0.839 0.988 0.000 0.000 0.000 0 0.012
#> ERR863764 4 0.2852 0.657 0.080 0.000 0.000 0.856 0 0.064
#> ERR863740 1 0.3428 0.744 0.696 0.000 0.000 0.000 0 0.304
#> ERR863765 3 0.6118 -0.168 0.208 0.000 0.428 0.008 0 0.356
#> ERR863762 6 0.6347 0.381 0.184 0.000 0.200 0.064 0 0.552
#> ERR863724 5 0.0000 1.000 0.000 0.000 0.000 0.000 1 0.000
#> ERR863733 4 0.2277 0.635 0.000 0.032 0.000 0.892 0 0.076
#> ERR863732 6 0.5842 0.493 0.000 0.000 0.356 0.196 0 0.448
#> ERR863730 1 0.4994 0.626 0.544 0.000 0.000 0.076 0 0.380
#> ERR863742 1 0.2527 0.784 0.832 0.000 0.000 0.000 0 0.168
#> ERR863763 4 0.1957 0.680 0.112 0.000 0.000 0.888 0 0.000
#> ERR863741 1 0.4159 0.760 0.744 0.000 0.000 0.116 0 0.140
#> ERR863743 1 0.0458 0.840 0.984 0.000 0.000 0.000 0 0.016
#> ERR863745 2 0.3610 0.752 0.000 0.828 0.064 0.060 0 0.048
#> ERR863744 1 0.2362 0.824 0.860 0.000 0.000 0.004 0 0.136
#> ERR863746 1 0.3534 0.776 0.740 0.000 0.000 0.016 0 0.244
#> ERR863748 4 0.4581 -0.111 0.000 0.000 0.036 0.516 0 0.448
#> ERR863747 2 0.6395 0.160 0.000 0.380 0.244 0.360 0 0.016
#> ERR863694 4 0.2491 0.655 0.164 0.000 0.000 0.836 0 0.000
#> ERR863693 4 0.4864 0.422 0.384 0.000 0.000 0.552 0 0.064
#> ERR863686 1 0.4948 0.644 0.564 0.000 0.000 0.076 0 0.360
#> ERR863678 1 0.0363 0.840 0.988 0.000 0.000 0.000 0 0.012
#> ERR863685 3 0.0000 0.759 0.000 0.000 1.000 0.000 0 0.000
#> ERR863689 1 0.1610 0.833 0.916 0.000 0.000 0.000 0 0.084
#> ERR863691 1 0.5481 0.314 0.520 0.000 0.000 0.340 0 0.140
#> ERR863682 1 0.0937 0.841 0.960 0.000 0.000 0.000 0 0.040
#> ERR863695 4 0.3982 0.119 0.000 0.460 0.000 0.536 0 0.004
#> ERR863683 1 0.4522 0.705 0.672 0.000 0.000 0.076 0 0.252
#> ERR863684 4 0.5300 0.239 0.400 0.000 0.000 0.496 0 0.104
#> ERR863702 1 0.4278 0.742 0.712 0.000 0.000 0.076 0 0.212
#> ERR863687 6 0.5807 0.476 0.000 0.000 0.324 0.200 0 0.476
#> ERR863706 3 0.0000 0.759 0.000 0.000 1.000 0.000 0 0.000
#> ERR863708 2 0.1327 0.777 0.000 0.936 0.000 0.000 0 0.064
#> ERR863710 1 0.0363 0.839 0.988 0.000 0.000 0.000 0 0.012
#> ERR863709 4 0.4683 0.642 0.076 0.100 0.000 0.748 0 0.076
#> ERR863753 2 0.1501 0.775 0.000 0.924 0.000 0.000 0 0.076
#> ERR863754 1 0.2266 0.765 0.880 0.000 0.000 0.108 0 0.012
#> ERR863749 1 0.0363 0.839 0.988 0.000 0.000 0.000 0 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)
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 17118 rows and 78 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.973 0.950 0.979 0.0897 0.949 0.949
#> 3 3 0.250 0.564 0.739 4.3918 0.524 0.499
#> 4 4 0.670 0.835 0.889 0.2978 0.744 0.536
#> 5 5 0.664 0.691 0.863 0.1498 0.829 0.572
#> 6 6 0.793 0.690 0.827 0.0528 0.925 0.735
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
#> ERR863675 1 0.0000 0.978 1.000 0.000
#> ERR863705 1 0.8016 0.685 0.756 0.244
#> ERR863704 1 0.0000 0.978 1.000 0.000
#> ERR863679 1 0.7674 0.718 0.776 0.224
#> ERR863680 1 0.0000 0.978 1.000 0.000
#> ERR863676 1 0.0000 0.978 1.000 0.000
#> ERR863677 1 0.0000 0.978 1.000 0.000
#> ERR863688 1 0.0000 0.978 1.000 0.000
#> ERR863690 1 0.0000 0.978 1.000 0.000
#> ERR863692 1 0.0000 0.978 1.000 0.000
#> ERR863703 1 0.0000 0.978 1.000 0.000
#> ERR863712 1 0.1184 0.966 0.984 0.016
#> ERR863711 1 0.0000 0.978 1.000 0.000
#> ERR863760 1 0.0000 0.978 1.000 0.000
#> ERR863727 1 0.0000 0.978 1.000 0.000
#> ERR863766 1 0.0000 0.978 1.000 0.000
#> ERR863767 1 0.0000 0.978 1.000 0.000
#> ERR863752 1 0.0000 0.978 1.000 0.000
#> ERR863757 1 0.0000 0.978 1.000 0.000
#> ERR863758 1 0.0000 0.978 1.000 0.000
#> ERR863755 1 0.0000 0.978 1.000 0.000
#> ERR863756 1 0.0000 0.978 1.000 0.000
#> ERR863707 1 0.9963 0.174 0.536 0.464
#> ERR863681 2 0.0000 1.000 0.000 1.000
#> ERR863719 1 0.1184 0.966 0.984 0.016
#> ERR863759 1 0.0000 0.978 1.000 0.000
#> ERR863718 1 0.0000 0.978 1.000 0.000
#> ERR863717 1 0.0000 0.978 1.000 0.000
#> ERR863715 1 0.0000 0.978 1.000 0.000
#> ERR863716 1 0.0000 0.978 1.000 0.000
#> ERR863722 1 0.0000 0.978 1.000 0.000
#> ERR863721 1 0.1184 0.966 0.984 0.016
#> ERR863720 1 0.0000 0.978 1.000 0.000
#> ERR863723 1 0.0000 0.978 1.000 0.000
#> ERR863761 1 0.7219 0.753 0.800 0.200
#> ERR863735 1 0.0000 0.978 1.000 0.000
#> ERR863734 1 0.2043 0.952 0.968 0.032
#> ERR863736 1 0.0000 0.978 1.000 0.000
#> ERR863729 1 0.0000 0.978 1.000 0.000
#> ERR863728 1 0.0000 0.978 1.000 0.000
#> ERR863731 1 0.0000 0.978 1.000 0.000
#> ERR863764 1 0.0000 0.978 1.000 0.000
#> ERR863740 1 0.0000 0.978 1.000 0.000
#> ERR863765 1 0.0000 0.978 1.000 0.000
#> ERR863762 1 0.0000 0.978 1.000 0.000
#> ERR863724 2 0.0000 1.000 0.000 1.000
#> ERR863733 1 0.0000 0.978 1.000 0.000
#> ERR863732 1 0.0000 0.978 1.000 0.000
#> ERR863730 1 0.0000 0.978 1.000 0.000
#> ERR863742 1 0.0000 0.978 1.000 0.000
#> ERR863763 1 0.0672 0.972 0.992 0.008
#> ERR863741 1 0.0000 0.978 1.000 0.000
#> ERR863743 1 0.0000 0.978 1.000 0.000
#> ERR863745 1 0.0000 0.978 1.000 0.000
#> ERR863744 1 0.0000 0.978 1.000 0.000
#> ERR863746 1 0.0000 0.978 1.000 0.000
#> ERR863748 1 0.0376 0.975 0.996 0.004
#> ERR863747 1 0.0000 0.978 1.000 0.000
#> ERR863694 1 0.1184 0.966 0.984 0.016
#> ERR863693 1 0.1184 0.966 0.984 0.016
#> ERR863686 1 0.0000 0.978 1.000 0.000
#> ERR863678 1 0.0000 0.978 1.000 0.000
#> ERR863685 1 0.9358 0.477 0.648 0.352
#> ERR863689 1 0.0000 0.978 1.000 0.000
#> ERR863691 1 0.0000 0.978 1.000 0.000
#> ERR863682 1 0.0000 0.978 1.000 0.000
#> ERR863695 1 0.0000 0.978 1.000 0.000
#> ERR863683 1 0.0000 0.978 1.000 0.000
#> ERR863684 1 0.1184 0.966 0.984 0.016
#> ERR863702 1 0.0000 0.978 1.000 0.000
#> ERR863687 1 0.0000 0.978 1.000 0.000
#> ERR863706 1 0.0000 0.978 1.000 0.000
#> ERR863708 1 0.0672 0.972 0.992 0.008
#> ERR863710 1 0.0000 0.978 1.000 0.000
#> ERR863709 1 0.0000 0.978 1.000 0.000
#> ERR863753 1 0.0000 0.978 1.000 0.000
#> ERR863754 1 0.0000 0.978 1.000 0.000
#> ERR863749 1 0.0000 0.978 1.000 0.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> ERR863675 2 0.1289 0.79859 0.032 0.968 0.000
#> ERR863705 1 0.9951 -0.26573 0.380 0.324 0.296
#> ERR863704 2 0.0000 0.80487 0.000 1.000 0.000
#> ERR863679 1 0.9951 -0.26573 0.380 0.324 0.296
#> ERR863680 2 0.0000 0.80487 0.000 1.000 0.000
#> ERR863676 2 0.0000 0.80487 0.000 1.000 0.000
#> ERR863677 2 0.1411 0.79573 0.036 0.964 0.000
#> ERR863688 1 0.5621 0.68767 0.692 0.308 0.000
#> ERR863690 1 0.5431 0.69218 0.716 0.284 0.000
#> ERR863692 1 0.6140 0.56111 0.596 0.404 0.000
#> ERR863703 1 0.5678 0.68361 0.684 0.316 0.000
#> ERR863712 2 0.3686 0.68688 0.140 0.860 0.000
#> ERR863711 1 0.5397 0.69158 0.720 0.280 0.000
#> ERR863760 2 0.0237 0.80417 0.004 0.996 0.000
#> ERR863727 1 0.5621 0.68754 0.692 0.308 0.000
#> ERR863766 1 0.8132 0.03294 0.600 0.304 0.096
#> ERR863767 1 0.5591 0.68696 0.696 0.304 0.000
#> ERR863752 2 0.0747 0.79544 0.016 0.984 0.000
#> ERR863757 1 0.5988 0.57542 0.632 0.368 0.000
#> ERR863758 1 0.5397 0.69158 0.720 0.280 0.000
#> ERR863755 1 0.5678 0.68361 0.684 0.316 0.000
#> ERR863756 2 0.5859 0.49381 0.344 0.656 0.000
#> ERR863707 1 0.9927 -0.26341 0.392 0.316 0.292
#> ERR863681 3 0.0000 1.00000 0.000 0.000 1.000
#> ERR863719 2 0.5706 0.23641 0.320 0.680 0.000
#> ERR863759 2 0.4121 0.65433 0.168 0.832 0.000
#> ERR863718 1 0.5431 0.69218 0.716 0.284 0.000
#> ERR863717 1 0.5678 0.68361 0.684 0.316 0.000
#> ERR863715 2 0.0000 0.80487 0.000 1.000 0.000
#> ERR863716 1 0.5678 0.68361 0.684 0.316 0.000
#> ERR863722 2 0.4291 0.69526 0.180 0.820 0.000
#> ERR863721 2 0.6154 0.00823 0.408 0.592 0.000
#> ERR863720 2 0.0000 0.80487 0.000 1.000 0.000
#> ERR863723 1 0.5397 0.69158 0.720 0.280 0.000
#> ERR863761 1 0.9764 -0.19733 0.436 0.312 0.252
#> ERR863735 1 0.5397 0.69158 0.720 0.280 0.000
#> ERR863734 1 0.8173 0.03719 0.600 0.300 0.100
#> ERR863736 2 0.1267 0.80152 0.024 0.972 0.004
#> ERR863729 2 0.1289 0.79851 0.032 0.968 0.000
#> ERR863728 1 0.5905 0.64631 0.648 0.352 0.000
#> ERR863731 1 0.5431 0.69142 0.716 0.284 0.000
#> ERR863764 2 0.1643 0.79111 0.044 0.956 0.000
#> ERR863740 1 0.5291 0.68741 0.732 0.268 0.000
#> ERR863765 1 0.7970 0.04279 0.612 0.300 0.088
#> ERR863762 1 0.5988 -0.07921 0.632 0.368 0.000
#> ERR863724 3 0.0000 1.00000 0.000 0.000 1.000
#> ERR863733 2 0.1411 0.79573 0.036 0.964 0.000
#> ERR863732 2 0.6225 0.37556 0.432 0.568 0.000
#> ERR863730 1 0.5678 0.68361 0.684 0.316 0.000
#> ERR863742 1 0.5810 0.60985 0.664 0.336 0.000
#> ERR863763 2 0.1163 0.80018 0.028 0.972 0.000
#> ERR863741 2 0.4062 0.62855 0.164 0.836 0.000
#> ERR863743 1 0.5431 0.69218 0.716 0.284 0.000
#> ERR863745 2 0.1411 0.77973 0.036 0.964 0.000
#> ERR863744 1 0.5529 0.68854 0.704 0.296 0.000
#> ERR863746 1 0.5678 0.68361 0.684 0.316 0.000
#> ERR863748 2 0.4555 0.66623 0.200 0.800 0.000
#> ERR863747 2 0.4121 0.65433 0.168 0.832 0.000
#> ERR863694 2 0.1289 0.79859 0.032 0.968 0.000
#> ERR863693 2 0.6168 -0.01002 0.412 0.588 0.000
#> ERR863686 1 0.5968 0.62035 0.636 0.364 0.000
#> ERR863678 2 0.5968 0.15799 0.364 0.636 0.000
#> ERR863685 1 0.8181 0.02252 0.592 0.312 0.096
#> ERR863689 1 0.6308 0.37666 0.508 0.492 0.000
#> ERR863691 1 0.6192 0.55308 0.580 0.420 0.000
#> ERR863682 1 0.5678 0.68361 0.684 0.316 0.000
#> ERR863695 2 0.0000 0.80487 0.000 1.000 0.000
#> ERR863683 1 0.5733 0.65280 0.676 0.324 0.000
#> ERR863684 2 0.6140 0.00777 0.404 0.596 0.000
#> ERR863702 1 0.5859 0.66556 0.656 0.344 0.000
#> ERR863687 2 0.4121 0.65433 0.168 0.832 0.000
#> ERR863706 1 0.8020 0.03069 0.604 0.308 0.088
#> ERR863708 2 0.0000 0.80487 0.000 1.000 0.000
#> ERR863710 1 0.5397 0.69158 0.720 0.280 0.000
#> ERR863709 2 0.1289 0.79851 0.032 0.968 0.000
#> ERR863753 2 0.0000 0.80487 0.000 1.000 0.000
#> ERR863754 1 0.6140 0.56757 0.596 0.404 0.000
#> ERR863749 1 0.5327 0.68926 0.728 0.272 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> ERR863675 2 0.5355 0.751 0.084 0.736 0.180 0.000
#> ERR863705 3 0.3311 0.834 0.000 0.172 0.828 0.000
#> ERR863704 2 0.0469 0.814 0.000 0.988 0.012 0.000
#> ERR863679 3 0.3311 0.834 0.000 0.172 0.828 0.000
#> ERR863680 2 0.0592 0.809 0.000 0.984 0.016 0.000
#> ERR863676 2 0.0336 0.812 0.000 0.992 0.008 0.000
#> ERR863677 2 0.6476 0.654 0.180 0.644 0.176 0.000
#> ERR863688 1 0.0000 0.934 1.000 0.000 0.000 0.000
#> ERR863690 1 0.0000 0.934 1.000 0.000 0.000 0.000
#> ERR863692 1 0.1661 0.912 0.944 0.004 0.052 0.000
#> ERR863703 1 0.0000 0.934 1.000 0.000 0.000 0.000
#> ERR863712 2 0.7036 0.573 0.212 0.576 0.212 0.000
#> ERR863711 1 0.0000 0.934 1.000 0.000 0.000 0.000
#> ERR863760 2 0.1211 0.811 0.000 0.960 0.040 0.000
#> ERR863727 1 0.0000 0.934 1.000 0.000 0.000 0.000
#> ERR863766 3 0.3316 0.823 0.020 0.064 0.888 0.028
#> ERR863767 1 0.0000 0.934 1.000 0.000 0.000 0.000
#> ERR863752 2 0.0592 0.809 0.000 0.984 0.016 0.000
#> ERR863757 1 0.3164 0.867 0.884 0.052 0.064 0.000
#> ERR863758 1 0.0000 0.934 1.000 0.000 0.000 0.000
#> ERR863755 1 0.0000 0.934 1.000 0.000 0.000 0.000
#> ERR863756 1 0.6362 0.404 0.560 0.072 0.368 0.000
#> ERR863707 3 0.3311 0.834 0.000 0.172 0.828 0.000
#> ERR863681 4 0.0000 1.000 0.000 0.000 0.000 1.000
#> ERR863719 1 0.5412 0.735 0.736 0.096 0.168 0.000
#> ERR863759 2 0.2216 0.769 0.000 0.908 0.092 0.000
#> ERR863718 1 0.0000 0.934 1.000 0.000 0.000 0.000
#> ERR863717 1 0.0336 0.932 0.992 0.000 0.008 0.000
#> ERR863715 2 0.0336 0.812 0.000 0.992 0.008 0.000
#> ERR863716 1 0.0000 0.934 1.000 0.000 0.000 0.000
#> ERR863722 2 0.5881 0.707 0.084 0.676 0.240 0.000
#> ERR863721 1 0.5080 0.767 0.764 0.092 0.144 0.000
#> ERR863720 2 0.0469 0.810 0.000 0.988 0.012 0.000
#> ERR863723 1 0.0000 0.934 1.000 0.000 0.000 0.000
#> ERR863761 3 0.3311 0.834 0.000 0.172 0.828 0.000
#> ERR863735 1 0.0000 0.934 1.000 0.000 0.000 0.000
#> ERR863734 3 0.3316 0.823 0.020 0.064 0.888 0.028
#> ERR863736 2 0.3216 0.774 0.076 0.880 0.044 0.000
#> ERR863729 2 0.5678 0.736 0.112 0.716 0.172 0.000
#> ERR863728 1 0.0000 0.934 1.000 0.000 0.000 0.000
#> ERR863731 1 0.0000 0.934 1.000 0.000 0.000 0.000
#> ERR863764 2 0.6497 0.639 0.200 0.640 0.160 0.000
#> ERR863740 1 0.0000 0.934 1.000 0.000 0.000 0.000
#> ERR863765 3 0.3833 0.783 0.088 0.048 0.856 0.008
#> ERR863762 3 0.4804 0.652 0.160 0.064 0.776 0.000
#> ERR863724 4 0.0000 1.000 0.000 0.000 0.000 1.000
#> ERR863733 2 0.5454 0.747 0.096 0.732 0.172 0.000
#> ERR863732 3 0.5678 0.647 0.112 0.172 0.716 0.000
#> ERR863730 1 0.0000 0.934 1.000 0.000 0.000 0.000
#> ERR863742 1 0.1256 0.920 0.964 0.008 0.028 0.000
#> ERR863763 2 0.5763 0.732 0.096 0.700 0.204 0.000
#> ERR863741 1 0.4786 0.778 0.788 0.108 0.104 0.000
#> ERR863743 1 0.0000 0.934 1.000 0.000 0.000 0.000
#> ERR863745 2 0.0592 0.809 0.000 0.984 0.016 0.000
#> ERR863744 1 0.0000 0.934 1.000 0.000 0.000 0.000
#> ERR863746 1 0.0000 0.934 1.000 0.000 0.000 0.000
#> ERR863748 2 0.5272 0.721 0.032 0.680 0.288 0.000
#> ERR863747 2 0.2011 0.778 0.000 0.920 0.080 0.000
#> ERR863694 2 0.4914 0.758 0.044 0.748 0.208 0.000
#> ERR863693 1 0.5080 0.767 0.764 0.092 0.144 0.000
#> ERR863686 1 0.0817 0.926 0.976 0.000 0.024 0.000
#> ERR863678 1 0.4282 0.804 0.816 0.060 0.124 0.000
#> ERR863685 3 0.3311 0.834 0.000 0.172 0.828 0.000
#> ERR863689 1 0.3764 0.845 0.852 0.072 0.076 0.000
#> ERR863691 1 0.1716 0.907 0.936 0.000 0.064 0.000
#> ERR863682 1 0.0000 0.934 1.000 0.000 0.000 0.000
#> ERR863695 2 0.2149 0.805 0.000 0.912 0.088 0.000
#> ERR863683 1 0.0895 0.926 0.976 0.004 0.020 0.000
#> ERR863684 1 0.5080 0.767 0.764 0.092 0.144 0.000
#> ERR863702 1 0.1474 0.914 0.948 0.000 0.052 0.000
#> ERR863687 2 0.2345 0.762 0.000 0.900 0.100 0.000
#> ERR863706 3 0.3346 0.821 0.024 0.060 0.888 0.028
#> ERR863708 2 0.0336 0.812 0.000 0.992 0.008 0.000
#> ERR863710 1 0.0000 0.934 1.000 0.000 0.000 0.000
#> ERR863709 2 0.5395 0.753 0.092 0.736 0.172 0.000
#> ERR863753 2 0.0592 0.809 0.000 0.984 0.016 0.000
#> ERR863754 1 0.1716 0.907 0.936 0.000 0.064 0.000
#> ERR863749 1 0.0000 0.934 1.000 0.000 0.000 0.000
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> ERR863675 4 0.4235 0.3775 0.000 0.424 0.000 0.576 0
#> ERR863705 3 0.0000 0.9044 0.000 0.000 1.000 0.000 0
#> ERR863704 2 0.0290 0.7751 0.000 0.992 0.000 0.008 0
#> ERR863679 3 0.0609 0.8853 0.000 0.020 0.980 0.000 0
#> ERR863680 2 0.0000 0.7782 0.000 1.000 0.000 0.000 0
#> ERR863676 2 0.0000 0.7782 0.000 1.000 0.000 0.000 0
#> ERR863677 4 0.4060 0.4660 0.000 0.360 0.000 0.640 0
#> ERR863688 1 0.0000 0.9259 1.000 0.000 0.000 0.000 0
#> ERR863690 1 0.3932 0.5134 0.672 0.000 0.000 0.328 0
#> ERR863692 4 0.3816 0.4035 0.304 0.000 0.000 0.696 0
#> ERR863703 1 0.0000 0.9259 1.000 0.000 0.000 0.000 0
#> ERR863712 4 0.3534 0.5470 0.000 0.256 0.000 0.744 0
#> ERR863711 1 0.0000 0.9259 1.000 0.000 0.000 0.000 0
#> ERR863760 2 0.3388 0.5747 0.000 0.792 0.008 0.200 0
#> ERR863727 1 0.0000 0.9259 1.000 0.000 0.000 0.000 0
#> ERR863766 3 0.0000 0.9044 0.000 0.000 1.000 0.000 0
#> ERR863767 1 0.0000 0.9259 1.000 0.000 0.000 0.000 0
#> ERR863752 2 0.0000 0.7782 0.000 1.000 0.000 0.000 0
#> ERR863757 1 0.2519 0.8326 0.884 0.000 0.100 0.016 0
#> ERR863758 1 0.0000 0.9259 1.000 0.000 0.000 0.000 0
#> ERR863755 1 0.0000 0.9259 1.000 0.000 0.000 0.000 0
#> ERR863756 4 0.7498 0.4614 0.124 0.144 0.212 0.520 0
#> ERR863707 3 0.0000 0.9044 0.000 0.000 1.000 0.000 0
#> ERR863681 5 0.0000 1.0000 0.000 0.000 0.000 0.000 1
#> ERR863719 4 0.4908 0.4673 0.320 0.044 0.000 0.636 0
#> ERR863759 2 0.3003 0.6763 0.000 0.812 0.188 0.000 0
#> ERR863718 1 0.0000 0.9259 1.000 0.000 0.000 0.000 0
#> ERR863717 1 0.0000 0.9259 1.000 0.000 0.000 0.000 0
#> ERR863715 2 0.0000 0.7782 0.000 1.000 0.000 0.000 0
#> ERR863716 1 0.0000 0.9259 1.000 0.000 0.000 0.000 0
#> ERR863722 4 0.6100 0.1562 0.000 0.428 0.124 0.448 0
#> ERR863721 4 0.0000 0.5238 0.000 0.000 0.000 1.000 0
#> ERR863720 2 0.0000 0.7782 0.000 1.000 0.000 0.000 0
#> ERR863723 1 0.0000 0.9259 1.000 0.000 0.000 0.000 0
#> ERR863761 3 0.0000 0.9044 0.000 0.000 1.000 0.000 0
#> ERR863735 1 0.0000 0.9259 1.000 0.000 0.000 0.000 0
#> ERR863734 3 0.0000 0.9044 0.000 0.000 1.000 0.000 0
#> ERR863736 2 0.5720 0.4152 0.012 0.644 0.112 0.232 0
#> ERR863729 2 0.4622 -0.1003 0.012 0.548 0.000 0.440 0
#> ERR863728 1 0.3003 0.7217 0.812 0.000 0.000 0.188 0
#> ERR863731 1 0.1043 0.8960 0.960 0.000 0.000 0.040 0
#> ERR863764 4 0.6269 0.3325 0.148 0.408 0.000 0.444 0
#> ERR863740 1 0.0000 0.9259 1.000 0.000 0.000 0.000 0
#> ERR863765 3 0.0000 0.9044 0.000 0.000 1.000 0.000 0
#> ERR863762 3 0.4793 0.5096 0.232 0.000 0.700 0.068 0
#> ERR863724 5 0.0000 1.0000 0.000 0.000 0.000 0.000 1
#> ERR863733 4 0.4273 0.3283 0.000 0.448 0.000 0.552 0
#> ERR863732 3 0.5908 0.5217 0.128 0.032 0.664 0.176 0
#> ERR863730 1 0.0000 0.9259 1.000 0.000 0.000 0.000 0
#> ERR863742 1 0.2280 0.8233 0.880 0.000 0.120 0.000 0
#> ERR863763 4 0.4242 0.3718 0.000 0.428 0.000 0.572 0
#> ERR863741 4 0.4326 0.5519 0.028 0.264 0.000 0.708 0
#> ERR863743 1 0.0000 0.9259 1.000 0.000 0.000 0.000 0
#> ERR863745 2 0.0000 0.7782 0.000 1.000 0.000 0.000 0
#> ERR863744 1 0.0000 0.9259 1.000 0.000 0.000 0.000 0
#> ERR863746 1 0.0000 0.9259 1.000 0.000 0.000 0.000 0
#> ERR863748 2 0.6576 -0.0239 0.000 0.436 0.212 0.352 0
#> ERR863747 2 0.3242 0.6549 0.000 0.784 0.216 0.000 0
#> ERR863694 4 0.4219 0.3909 0.000 0.416 0.000 0.584 0
#> ERR863693 4 0.0000 0.5238 0.000 0.000 0.000 1.000 0
#> ERR863686 1 0.3508 0.6204 0.748 0.000 0.000 0.252 0
#> ERR863678 1 0.7442 -0.2737 0.424 0.256 0.040 0.280 0
#> ERR863685 3 0.0000 0.9044 0.000 0.000 1.000 0.000 0
#> ERR863689 4 0.1544 0.5354 0.068 0.000 0.000 0.932 0
#> ERR863691 4 0.5325 0.4621 0.308 0.076 0.000 0.616 0
#> ERR863682 1 0.0000 0.9259 1.000 0.000 0.000 0.000 0
#> ERR863695 2 0.1671 0.7264 0.000 0.924 0.000 0.076 0
#> ERR863683 1 0.0290 0.9208 0.992 0.000 0.008 0.000 0
#> ERR863684 4 0.0000 0.5238 0.000 0.000 0.000 1.000 0
#> ERR863702 1 0.2179 0.8274 0.888 0.000 0.000 0.112 0
#> ERR863687 2 0.3366 0.6384 0.000 0.768 0.232 0.000 0
#> ERR863706 3 0.0000 0.9044 0.000 0.000 1.000 0.000 0
#> ERR863708 2 0.0000 0.7782 0.000 1.000 0.000 0.000 0
#> ERR863710 1 0.0000 0.9259 1.000 0.000 0.000 0.000 0
#> ERR863709 2 0.4622 -0.1003 0.012 0.548 0.000 0.440 0
#> ERR863753 2 0.0000 0.7782 0.000 1.000 0.000 0.000 0
#> ERR863754 4 0.3143 0.4404 0.204 0.000 0.000 0.796 0
#> ERR863749 1 0.0000 0.9259 1.000 0.000 0.000 0.000 0
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> ERR863675 4 0.0000 0.57638 0.000 0.000 0.000 1.000 0 0.000
#> ERR863705 3 0.0508 0.87487 0.000 0.004 0.984 0.000 0 0.012
#> ERR863704 2 0.3765 0.70515 0.000 0.596 0.000 0.404 0 0.000
#> ERR863679 3 0.0993 0.86270 0.000 0.024 0.964 0.000 0 0.012
#> ERR863680 2 0.3428 0.78216 0.000 0.696 0.000 0.304 0 0.000
#> ERR863676 2 0.3428 0.78216 0.000 0.696 0.000 0.304 0 0.000
#> ERR863677 4 0.0603 0.57834 0.000 0.004 0.000 0.980 0 0.016
#> ERR863688 1 0.0000 0.95173 1.000 0.000 0.000 0.000 0 0.000
#> ERR863690 1 0.5536 -0.03136 0.540 0.292 0.000 0.000 0 0.168
#> ERR863692 6 0.7590 0.66382 0.228 0.300 0.000 0.168 0 0.304
#> ERR863703 1 0.0000 0.95173 1.000 0.000 0.000 0.000 0 0.000
#> ERR863712 4 0.6101 -0.57724 0.000 0.296 0.000 0.380 0 0.324
#> ERR863711 1 0.0458 0.94798 0.984 0.000 0.000 0.000 0 0.016
#> ERR863760 4 0.3737 -0.37651 0.000 0.392 0.000 0.608 0 0.000
#> ERR863727 1 0.0000 0.95173 1.000 0.000 0.000 0.000 0 0.000
#> ERR863766 3 0.2178 0.86441 0.000 0.000 0.868 0.000 0 0.132
#> ERR863767 1 0.0146 0.95113 0.996 0.000 0.000 0.000 0 0.004
#> ERR863752 2 0.3482 0.77990 0.000 0.684 0.000 0.316 0 0.000
#> ERR863757 1 0.1806 0.88529 0.908 0.000 0.004 0.000 0 0.088
#> ERR863758 1 0.0000 0.95173 1.000 0.000 0.000 0.000 0 0.000
#> ERR863755 1 0.0000 0.95173 1.000 0.000 0.000 0.000 0 0.000
#> ERR863756 4 0.3827 0.44871 0.008 0.000 0.004 0.680 0 0.308
#> ERR863707 3 0.0508 0.87487 0.000 0.004 0.984 0.000 0 0.012
#> ERR863681 5 0.0000 1.00000 0.000 0.000 0.000 0.000 1 0.000
#> ERR863719 4 0.5731 0.06748 0.304 0.004 0.000 0.520 0 0.172
#> ERR863759 2 0.6214 0.15949 0.000 0.388 0.004 0.304 0 0.304
#> ERR863718 1 0.0000 0.95173 1.000 0.000 0.000 0.000 0 0.000
#> ERR863717 1 0.0000 0.95173 1.000 0.000 0.000 0.000 0 0.000
#> ERR863715 2 0.3515 0.77667 0.000 0.676 0.000 0.324 0 0.000
#> ERR863716 1 0.0000 0.95173 1.000 0.000 0.000 0.000 0 0.000
#> ERR863722 4 0.3371 0.46797 0.000 0.000 0.000 0.708 0 0.292
#> ERR863721 6 0.6288 0.80585 0.020 0.300 0.000 0.216 0 0.464
#> ERR863720 2 0.3428 0.78216 0.000 0.696 0.000 0.304 0 0.000
#> ERR863723 1 0.0603 0.94704 0.980 0.000 0.000 0.004 0 0.016
#> ERR863761 3 0.0508 0.87487 0.000 0.004 0.984 0.000 0 0.012
#> ERR863735 1 0.0603 0.94704 0.980 0.000 0.000 0.004 0 0.016
#> ERR863734 3 0.2178 0.86441 0.000 0.000 0.868 0.000 0 0.132
#> ERR863736 4 0.4891 -0.00557 0.000 0.224 0.024 0.680 0 0.072
#> ERR863729 4 0.1745 0.54426 0.000 0.012 0.000 0.920 0 0.068
#> ERR863728 1 0.0547 0.93981 0.980 0.000 0.000 0.020 0 0.000
#> ERR863731 1 0.0146 0.95020 0.996 0.000 0.000 0.004 0 0.000
#> ERR863764 4 0.1615 0.55144 0.004 0.004 0.000 0.928 0 0.064
#> ERR863740 1 0.0458 0.94798 0.984 0.000 0.000 0.000 0 0.016
#> ERR863765 3 0.2340 0.85857 0.000 0.000 0.852 0.000 0 0.148
#> ERR863762 3 0.4762 0.47174 0.256 0.000 0.668 0.016 0 0.060
#> ERR863724 5 0.0000 1.00000 0.000 0.000 0.000 0.000 1 0.000
#> ERR863733 4 0.0146 0.57726 0.000 0.000 0.000 0.996 0 0.004
#> ERR863732 4 0.6160 0.33297 0.060 0.000 0.100 0.520 0 0.320
#> ERR863730 1 0.0000 0.95173 1.000 0.000 0.000 0.000 0 0.000
#> ERR863742 1 0.1643 0.90221 0.924 0.000 0.008 0.000 0 0.068
#> ERR863763 4 0.0547 0.57648 0.000 0.000 0.000 0.980 0 0.020
#> ERR863741 4 0.4465 0.26372 0.020 0.052 0.000 0.716 0 0.212
#> ERR863743 1 0.0000 0.95173 1.000 0.000 0.000 0.000 0 0.000
#> ERR863745 2 0.3727 0.72278 0.000 0.612 0.000 0.388 0 0.000
#> ERR863744 1 0.0000 0.95173 1.000 0.000 0.000 0.000 0 0.000
#> ERR863746 1 0.0000 0.95173 1.000 0.000 0.000 0.000 0 0.000
#> ERR863748 4 0.4106 0.45723 0.000 0.020 0.004 0.664 0 0.312
#> ERR863747 2 0.6307 0.15568 0.000 0.384 0.008 0.304 0 0.304
#> ERR863694 4 0.1765 0.54809 0.000 0.000 0.000 0.904 0 0.096
#> ERR863693 6 0.6339 0.80839 0.024 0.300 0.000 0.212 0 0.464
#> ERR863686 1 0.0725 0.94021 0.976 0.000 0.000 0.012 0 0.012
#> ERR863678 1 0.4052 0.37872 0.628 0.000 0.000 0.356 0 0.016
#> ERR863685 3 0.0000 0.87447 0.000 0.000 1.000 0.000 0 0.000
#> ERR863689 6 0.6926 0.78771 0.056 0.296 0.000 0.264 0 0.384
#> ERR863691 4 0.7614 -0.61807 0.192 0.296 0.000 0.308 0 0.204
#> ERR863682 1 0.0000 0.95173 1.000 0.000 0.000 0.000 0 0.000
#> ERR863695 2 0.3592 0.75299 0.000 0.656 0.000 0.344 0 0.000
#> ERR863683 1 0.0603 0.94645 0.980 0.000 0.004 0.000 0 0.016
#> ERR863684 6 0.6288 0.80585 0.020 0.300 0.000 0.216 0 0.464
#> ERR863702 1 0.0790 0.93311 0.968 0.000 0.000 0.032 0 0.000
#> ERR863687 2 0.6307 0.15568 0.000 0.384 0.008 0.304 0 0.304
#> ERR863706 3 0.2340 0.85857 0.000 0.000 0.852 0.000 0 0.148
#> ERR863708 2 0.3428 0.78216 0.000 0.696 0.000 0.304 0 0.000
#> ERR863710 1 0.0458 0.94798 0.984 0.000 0.000 0.000 0 0.016
#> ERR863709 4 0.1745 0.54426 0.000 0.012 0.000 0.920 0 0.068
#> ERR863753 2 0.3428 0.78216 0.000 0.696 0.000 0.304 0 0.000
#> ERR863754 6 0.7573 0.70741 0.188 0.300 0.000 0.192 0 0.320
#> ERR863749 1 0.0458 0.94798 0.984 0.000 0.000 0.000 0 0.016
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)
An example of the output of tb
is:
#> which_row fdr mean_1 mean_2 scaled_mean_1 scaled_mean_2 km
#> 1 38 0.042760348 8.373488 9.131774 -0.5533452 0.5164555 1
#> 2 40 0.018707592 7.106213 8.469186 -0.6173731 0.5762149 1
#> 3 55 0.019134737 10.221463 11.207825 -0.6159697 0.5749050 1
#> 4 59 0.006059896 5.921854 7.869574 -0.6899429 0.6439467 1
#> 5 60 0.018055526 8.928898 10.211722 -0.6204761 0.5791110 1
#> 6 98 0.009384629 15.714769 14.887706 0.6635654 -0.6193277 2
...
The columns in tb
are:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.km
: Row groups if k-means clustering is applied to rows.UMAP plot which shows how samples are separated.
dimension_reduction(res, k = 2, method = "UMAP")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
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 17118 rows and 78 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'CV' method.
#> Subgroups are detected by 'NMF' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 4.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 0.920 0.950 0.978 0.5032 0.499 0.499
#> 3 3 0.665 0.731 0.842 0.2928 0.803 0.625
#> 4 4 0.958 0.933 0.969 0.1317 0.835 0.580
#> 5 5 0.819 0.846 0.900 0.0484 0.953 0.831
#> 6 6 0.785 0.736 0.779 0.0540 0.919 0.667
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 4
#> attr(,"optional")
#> [1] 2
There is also optional best \(k\) = 2 that is worth to check.
Following shows the table of the partitions (You need to click the show/hide
code output link to see it). The membership matrix (columns with name p*
)
is inferred by
clue::cl_consensus()
function with the SE
method. Basically the value in the membership matrix
represents the probability to belong to a certain group. The finall class
label for an item is determined with the group with highest probability it
belongs to.
In get_classes()
function, the entropy is calculated from the membership
matrix and the silhouette score is calculated from the consensus matrix.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> ERR863675 2 0.0000 0.989 0.000 1.000
#> ERR863705 2 0.0000 0.989 0.000 1.000
#> ERR863704 2 0.0000 0.989 0.000 1.000
#> ERR863679 2 0.0000 0.989 0.000 1.000
#> ERR863680 2 0.0000 0.989 0.000 1.000
#> ERR863676 2 0.0000 0.989 0.000 1.000
#> ERR863677 2 0.0376 0.985 0.004 0.996
#> ERR863688 1 0.0000 0.968 1.000 0.000
#> ERR863690 1 0.0000 0.968 1.000 0.000
#> ERR863692 1 0.0000 0.968 1.000 0.000
#> ERR863703 1 0.0000 0.968 1.000 0.000
#> ERR863712 2 0.7528 0.715 0.216 0.784
#> ERR863711 1 0.0000 0.968 1.000 0.000
#> ERR863760 2 0.0000 0.989 0.000 1.000
#> ERR863727 1 0.0000 0.968 1.000 0.000
#> ERR863766 1 0.9754 0.339 0.592 0.408
#> ERR863767 1 0.0000 0.968 1.000 0.000
#> ERR863752 2 0.0000 0.989 0.000 1.000
#> ERR863757 1 0.0000 0.968 1.000 0.000
#> ERR863758 1 0.0000 0.968 1.000 0.000
#> ERR863755 1 0.0000 0.968 1.000 0.000
#> ERR863756 1 0.9044 0.550 0.680 0.320
#> ERR863707 2 0.0000 0.989 0.000 1.000
#> ERR863681 2 0.0000 0.989 0.000 1.000
#> ERR863719 1 0.1184 0.955 0.984 0.016
#> ERR863759 2 0.0000 0.989 0.000 1.000
#> ERR863718 1 0.0000 0.968 1.000 0.000
#> ERR863717 1 0.0000 0.968 1.000 0.000
#> ERR863715 2 0.0000 0.989 0.000 1.000
#> ERR863716 1 0.0000 0.968 1.000 0.000
#> ERR863722 2 0.2236 0.955 0.036 0.964
#> ERR863721 1 0.0000 0.968 1.000 0.000
#> ERR863720 2 0.0000 0.989 0.000 1.000
#> ERR863723 1 0.0000 0.968 1.000 0.000
#> ERR863761 2 0.0000 0.989 0.000 1.000
#> ERR863735 1 0.0000 0.968 1.000 0.000
#> ERR863734 1 0.7674 0.719 0.776 0.224
#> ERR863736 2 0.0000 0.989 0.000 1.000
#> ERR863729 2 0.0000 0.989 0.000 1.000
#> ERR863728 1 0.0000 0.968 1.000 0.000
#> ERR863731 1 0.0000 0.968 1.000 0.000
#> ERR863764 2 0.0000 0.989 0.000 1.000
#> ERR863740 1 0.0000 0.968 1.000 0.000
#> ERR863765 1 0.0000 0.968 1.000 0.000
#> ERR863762 2 0.4939 0.874 0.108 0.892
#> ERR863724 2 0.0000 0.989 0.000 1.000
#> ERR863733 2 0.0376 0.985 0.004 0.996
#> ERR863732 2 0.0000 0.989 0.000 1.000
#> ERR863730 1 0.0000 0.968 1.000 0.000
#> ERR863742 1 0.0000 0.968 1.000 0.000
#> ERR863763 2 0.0000 0.989 0.000 1.000
#> ERR863741 1 0.7602 0.725 0.780 0.220
#> ERR863743 1 0.0000 0.968 1.000 0.000
#> ERR863745 2 0.0000 0.989 0.000 1.000
#> ERR863744 1 0.0000 0.968 1.000 0.000
#> ERR863746 1 0.0000 0.968 1.000 0.000
#> ERR863748 2 0.0000 0.989 0.000 1.000
#> ERR863747 2 0.0000 0.989 0.000 1.000
#> ERR863694 2 0.0000 0.989 0.000 1.000
#> ERR863693 1 0.0000 0.968 1.000 0.000
#> ERR863686 1 0.0000 0.968 1.000 0.000
#> ERR863678 1 0.4815 0.872 0.896 0.104
#> ERR863685 2 0.0000 0.989 0.000 1.000
#> ERR863689 1 0.0000 0.968 1.000 0.000
#> ERR863691 1 0.0000 0.968 1.000 0.000
#> ERR863682 1 0.0000 0.968 1.000 0.000
#> ERR863695 2 0.0000 0.989 0.000 1.000
#> ERR863683 1 0.0000 0.968 1.000 0.000
#> ERR863684 1 0.0000 0.968 1.000 0.000
#> ERR863702 1 0.0000 0.968 1.000 0.000
#> ERR863687 2 0.0000 0.989 0.000 1.000
#> ERR863706 1 0.2236 0.938 0.964 0.036
#> ERR863708 2 0.0000 0.989 0.000 1.000
#> ERR863710 1 0.0000 0.968 1.000 0.000
#> ERR863709 2 0.0000 0.989 0.000 1.000
#> ERR863753 2 0.0000 0.989 0.000 1.000
#> ERR863754 1 0.0000 0.968 1.000 0.000
#> ERR863749 1 0.0000 0.968 1.000 0.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> ERR863675 2 0.5678 0.686 0.000 0.684 0.316
#> ERR863705 3 0.5678 0.728 0.000 0.316 0.684
#> ERR863704 2 0.0000 0.771 0.000 1.000 0.000
#> ERR863679 3 0.5678 0.728 0.000 0.316 0.684
#> ERR863680 2 0.0000 0.771 0.000 1.000 0.000
#> ERR863676 2 0.0000 0.771 0.000 1.000 0.000
#> ERR863677 2 0.5678 0.686 0.000 0.684 0.316
#> ERR863688 1 0.0000 0.888 1.000 0.000 0.000
#> ERR863690 1 0.0000 0.888 1.000 0.000 0.000
#> ERR863692 1 0.5678 0.643 0.684 0.000 0.316
#> ERR863703 1 0.0000 0.888 1.000 0.000 0.000
#> ERR863712 2 0.5678 0.686 0.000 0.684 0.316
#> ERR863711 1 0.0000 0.888 1.000 0.000 0.000
#> ERR863760 2 0.0000 0.771 0.000 1.000 0.000
#> ERR863727 1 0.0000 0.888 1.000 0.000 0.000
#> ERR863766 3 0.7588 0.698 0.196 0.120 0.684
#> ERR863767 1 0.0000 0.888 1.000 0.000 0.000
#> ERR863752 2 0.0000 0.771 0.000 1.000 0.000
#> ERR863757 1 0.5291 0.507 0.732 0.000 0.268
#> ERR863758 1 0.0000 0.888 1.000 0.000 0.000
#> ERR863755 1 0.0000 0.888 1.000 0.000 0.000
#> ERR863756 3 0.6585 0.270 0.244 0.044 0.712
#> ERR863707 3 0.5678 0.728 0.000 0.316 0.684
#> ERR863681 2 0.1529 0.736 0.000 0.960 0.040
#> ERR863719 1 0.8054 0.517 0.580 0.080 0.340
#> ERR863759 2 0.0237 0.768 0.000 0.996 0.004
#> ERR863718 1 0.0000 0.888 1.000 0.000 0.000
#> ERR863717 1 0.0000 0.888 1.000 0.000 0.000
#> ERR863715 2 0.0000 0.771 0.000 1.000 0.000
#> ERR863716 1 0.0000 0.888 1.000 0.000 0.000
#> ERR863722 2 0.6617 0.585 0.008 0.556 0.436
#> ERR863721 1 0.7442 0.579 0.628 0.056 0.316
#> ERR863720 2 0.0000 0.771 0.000 1.000 0.000
#> ERR863723 1 0.1163 0.865 0.972 0.000 0.028
#> ERR863761 3 0.5678 0.728 0.000 0.316 0.684
#> ERR863735 1 0.0000 0.888 1.000 0.000 0.000
#> ERR863734 3 0.6904 0.663 0.268 0.048 0.684
#> ERR863736 3 0.5678 0.728 0.000 0.316 0.684
#> ERR863729 2 0.2959 0.752 0.000 0.900 0.100
#> ERR863728 1 0.0237 0.886 0.996 0.000 0.004
#> ERR863731 1 0.0000 0.888 1.000 0.000 0.000
#> ERR863764 3 0.2537 0.438 0.000 0.080 0.920
#> ERR863740 1 0.0000 0.888 1.000 0.000 0.000
#> ERR863765 3 0.5706 0.599 0.320 0.000 0.680
#> ERR863762 3 0.7444 0.724 0.096 0.220 0.684
#> ERR863724 2 0.1753 0.727 0.000 0.952 0.048
#> ERR863733 2 0.5678 0.686 0.000 0.684 0.316
#> ERR863732 3 0.5650 0.727 0.000 0.312 0.688
#> ERR863730 1 0.0000 0.888 1.000 0.000 0.000
#> ERR863742 1 0.3619 0.741 0.864 0.000 0.136
#> ERR863763 2 0.5678 0.686 0.000 0.684 0.316
#> ERR863741 2 0.9589 0.417 0.220 0.464 0.316
#> ERR863743 1 0.0000 0.888 1.000 0.000 0.000
#> ERR863745 2 0.0000 0.771 0.000 1.000 0.000
#> ERR863744 1 0.0000 0.888 1.000 0.000 0.000
#> ERR863746 1 0.0000 0.888 1.000 0.000 0.000
#> ERR863748 2 0.6302 0.538 0.000 0.520 0.480
#> ERR863747 2 0.6180 -0.212 0.000 0.584 0.416
#> ERR863694 2 0.5678 0.686 0.000 0.684 0.316
#> ERR863693 1 0.5902 0.639 0.680 0.004 0.316
#> ERR863686 1 0.2066 0.850 0.940 0.000 0.060
#> ERR863678 3 0.6204 0.410 0.424 0.000 0.576
#> ERR863685 3 0.5678 0.728 0.000 0.316 0.684
#> ERR863689 1 0.5650 0.647 0.688 0.000 0.312
#> ERR863691 1 0.5678 0.643 0.684 0.000 0.316
#> ERR863682 1 0.0000 0.888 1.000 0.000 0.000
#> ERR863695 2 0.0237 0.771 0.000 0.996 0.004
#> ERR863683 1 0.0000 0.888 1.000 0.000 0.000
#> ERR863684 1 0.6855 0.609 0.652 0.032 0.316
#> ERR863702 1 0.0000 0.888 1.000 0.000 0.000
#> ERR863687 3 0.5835 0.700 0.000 0.340 0.660
#> ERR863706 3 0.5678 0.604 0.316 0.000 0.684
#> ERR863708 2 0.0000 0.771 0.000 1.000 0.000
#> ERR863710 1 0.0000 0.888 1.000 0.000 0.000
#> ERR863709 2 0.5465 0.697 0.000 0.712 0.288
#> ERR863753 2 0.0000 0.771 0.000 1.000 0.000
#> ERR863754 1 0.5678 0.643 0.684 0.000 0.316
#> ERR863749 1 0.0000 0.888 1.000 0.000 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> ERR863675 4 0.0188 0.941 0.000 0.004 0.000 0.996
#> ERR863705 3 0.0000 0.935 0.000 0.000 1.000 0.000
#> ERR863704 2 0.0000 0.992 0.000 1.000 0.000 0.000
#> ERR863679 3 0.0188 0.934 0.000 0.000 0.996 0.004
#> ERR863680 2 0.0000 0.992 0.000 1.000 0.000 0.000
#> ERR863676 2 0.0000 0.992 0.000 1.000 0.000 0.000
#> ERR863677 4 0.0469 0.939 0.000 0.012 0.000 0.988
#> ERR863688 1 0.0000 0.980 1.000 0.000 0.000 0.000
#> ERR863690 1 0.0000 0.980 1.000 0.000 0.000 0.000
#> ERR863692 4 0.0921 0.930 0.028 0.000 0.000 0.972
#> ERR863703 1 0.0000 0.980 1.000 0.000 0.000 0.000
#> ERR863712 4 0.0336 0.940 0.000 0.008 0.000 0.992
#> ERR863711 1 0.0000 0.980 1.000 0.000 0.000 0.000
#> ERR863760 2 0.0188 0.990 0.000 0.996 0.004 0.000
#> ERR863727 1 0.0000 0.980 1.000 0.000 0.000 0.000
#> ERR863766 3 0.0000 0.935 0.000 0.000 1.000 0.000
#> ERR863767 1 0.0000 0.980 1.000 0.000 0.000 0.000
#> ERR863752 2 0.0000 0.992 0.000 1.000 0.000 0.000
#> ERR863757 1 0.1389 0.937 0.952 0.000 0.048 0.000
#> ERR863758 1 0.0000 0.980 1.000 0.000 0.000 0.000
#> ERR863755 1 0.0000 0.980 1.000 0.000 0.000 0.000
#> ERR863756 4 0.4454 0.562 0.000 0.000 0.308 0.692
#> ERR863707 3 0.0000 0.935 0.000 0.000 1.000 0.000
#> ERR863681 2 0.1022 0.968 0.000 0.968 0.032 0.000
#> ERR863719 4 0.0000 0.941 0.000 0.000 0.000 1.000
#> ERR863759 2 0.0000 0.992 0.000 1.000 0.000 0.000
#> ERR863718 1 0.0000 0.980 1.000 0.000 0.000 0.000
#> ERR863717 1 0.0000 0.980 1.000 0.000 0.000 0.000
#> ERR863715 2 0.0000 0.992 0.000 1.000 0.000 0.000
#> ERR863716 1 0.0000 0.980 1.000 0.000 0.000 0.000
#> ERR863722 4 0.0000 0.941 0.000 0.000 0.000 1.000
#> ERR863721 4 0.0469 0.939 0.012 0.000 0.000 0.988
#> ERR863720 2 0.0000 0.992 0.000 1.000 0.000 0.000
#> ERR863723 1 0.0336 0.974 0.992 0.000 0.008 0.000
#> ERR863761 3 0.0000 0.935 0.000 0.000 1.000 0.000
#> ERR863735 1 0.0000 0.980 1.000 0.000 0.000 0.000
#> ERR863734 3 0.0188 0.934 0.004 0.000 0.996 0.000
#> ERR863736 3 0.0469 0.929 0.000 0.012 0.988 0.000
#> ERR863729 4 0.5458 0.670 0.000 0.204 0.076 0.720
#> ERR863728 1 0.4713 0.425 0.640 0.000 0.000 0.360
#> ERR863731 1 0.0188 0.977 0.996 0.000 0.000 0.004
#> ERR863764 4 0.1557 0.907 0.000 0.000 0.056 0.944
#> ERR863740 1 0.0000 0.980 1.000 0.000 0.000 0.000
#> ERR863765 3 0.3649 0.740 0.204 0.000 0.796 0.000
#> ERR863762 3 0.0336 0.932 0.000 0.000 0.992 0.008
#> ERR863724 2 0.1022 0.968 0.000 0.968 0.032 0.000
#> ERR863733 4 0.0188 0.941 0.000 0.004 0.000 0.996
#> ERR863732 3 0.0336 0.932 0.000 0.000 0.992 0.008
#> ERR863730 1 0.0000 0.980 1.000 0.000 0.000 0.000
#> ERR863742 1 0.0469 0.971 0.988 0.000 0.012 0.000
#> ERR863763 4 0.0188 0.941 0.000 0.004 0.000 0.996
#> ERR863741 4 0.0000 0.941 0.000 0.000 0.000 1.000
#> ERR863743 1 0.0000 0.980 1.000 0.000 0.000 0.000
#> ERR863745 2 0.0000 0.992 0.000 1.000 0.000 0.000
#> ERR863744 1 0.0000 0.980 1.000 0.000 0.000 0.000
#> ERR863746 1 0.0000 0.980 1.000 0.000 0.000 0.000
#> ERR863748 4 0.0921 0.926 0.000 0.000 0.028 0.972
#> ERR863747 2 0.0188 0.990 0.000 0.996 0.004 0.000
#> ERR863694 4 0.0000 0.941 0.000 0.000 0.000 1.000
#> ERR863693 4 0.0921 0.930 0.028 0.000 0.000 0.972
#> ERR863686 1 0.0592 0.967 0.984 0.000 0.000 0.016
#> ERR863678 3 0.6908 0.524 0.220 0.000 0.592 0.188
#> ERR863685 3 0.0000 0.935 0.000 0.000 1.000 0.000
#> ERR863689 1 0.1716 0.918 0.936 0.000 0.000 0.064
#> ERR863691 4 0.1474 0.910 0.052 0.000 0.000 0.948
#> ERR863682 1 0.0000 0.980 1.000 0.000 0.000 0.000
#> ERR863695 2 0.0707 0.977 0.000 0.980 0.000 0.020
#> ERR863683 1 0.0000 0.980 1.000 0.000 0.000 0.000
#> ERR863684 4 0.0469 0.939 0.012 0.000 0.000 0.988
#> ERR863702 1 0.0000 0.980 1.000 0.000 0.000 0.000
#> ERR863687 3 0.3545 0.777 0.000 0.164 0.828 0.008
#> ERR863706 3 0.0188 0.934 0.004 0.000 0.996 0.000
#> ERR863708 2 0.0000 0.992 0.000 1.000 0.000 0.000
#> ERR863710 1 0.0000 0.980 1.000 0.000 0.000 0.000
#> ERR863709 2 0.0817 0.973 0.000 0.976 0.000 0.024
#> ERR863753 2 0.0000 0.992 0.000 1.000 0.000 0.000
#> ERR863754 4 0.3074 0.794 0.152 0.000 0.000 0.848
#> ERR863749 1 0.0000 0.980 1.000 0.000 0.000 0.000
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> ERR863675 4 0.0000 0.926 0.000 0.000 0.000 1.000 0.000
#> ERR863705 3 0.0290 0.890 0.000 0.000 0.992 0.000 0.008
#> ERR863704 2 0.0162 0.968 0.000 0.996 0.000 0.000 0.004
#> ERR863679 3 0.1544 0.865 0.000 0.000 0.932 0.000 0.068
#> ERR863680 2 0.0290 0.969 0.000 0.992 0.000 0.000 0.008
#> ERR863676 2 0.0000 0.969 0.000 1.000 0.000 0.000 0.000
#> ERR863677 4 0.0162 0.925 0.000 0.000 0.000 0.996 0.004
#> ERR863688 1 0.2929 0.877 0.820 0.000 0.000 0.000 0.180
#> ERR863690 1 0.0162 0.874 0.996 0.000 0.000 0.000 0.004
#> ERR863692 4 0.1282 0.906 0.004 0.000 0.000 0.952 0.044
#> ERR863703 1 0.0000 0.875 1.000 0.000 0.000 0.000 0.000
#> ERR863712 4 0.0000 0.926 0.000 0.000 0.000 1.000 0.000
#> ERR863711 1 0.1671 0.884 0.924 0.000 0.000 0.000 0.076
#> ERR863760 2 0.0609 0.961 0.000 0.980 0.000 0.000 0.020
#> ERR863727 1 0.3430 0.863 0.776 0.000 0.004 0.000 0.220
#> ERR863766 3 0.0162 0.891 0.000 0.000 0.996 0.000 0.004
#> ERR863767 1 0.0000 0.875 1.000 0.000 0.000 0.000 0.000
#> ERR863752 2 0.0290 0.969 0.000 0.992 0.000 0.000 0.008
#> ERR863757 1 0.5032 0.776 0.704 0.000 0.128 0.000 0.168
#> ERR863758 1 0.0000 0.875 1.000 0.000 0.000 0.000 0.000
#> ERR863755 1 0.1908 0.875 0.908 0.000 0.000 0.000 0.092
#> ERR863756 4 0.3061 0.747 0.000 0.000 0.136 0.844 0.020
#> ERR863707 3 0.0162 0.890 0.000 0.000 0.996 0.000 0.004
#> ERR863681 2 0.3003 0.859 0.008 0.872 0.096 0.004 0.020
#> ERR863719 4 0.0000 0.926 0.000 0.000 0.000 1.000 0.000
#> ERR863759 2 0.0162 0.968 0.000 0.996 0.000 0.000 0.004
#> ERR863718 1 0.0000 0.875 1.000 0.000 0.000 0.000 0.000
#> ERR863717 1 0.3274 0.864 0.780 0.000 0.000 0.000 0.220
#> ERR863715 2 0.0290 0.969 0.000 0.992 0.000 0.000 0.008
#> ERR863716 1 0.2813 0.876 0.832 0.000 0.000 0.000 0.168
#> ERR863722 5 0.3684 0.647 0.000 0.000 0.000 0.280 0.720
#> ERR863721 4 0.0703 0.920 0.000 0.000 0.000 0.976 0.024
#> ERR863720 2 0.0162 0.968 0.000 0.996 0.000 0.000 0.004
#> ERR863723 1 0.4215 0.841 0.768 0.000 0.064 0.000 0.168
#> ERR863761 3 0.0000 0.891 0.000 0.000 1.000 0.000 0.000
#> ERR863735 1 0.0000 0.875 1.000 0.000 0.000 0.000 0.000
#> ERR863734 3 0.1341 0.862 0.000 0.000 0.944 0.000 0.056
#> ERR863736 3 0.1041 0.878 0.000 0.032 0.964 0.000 0.004
#> ERR863729 5 0.5482 0.676 0.000 0.180 0.032 0.088 0.700
#> ERR863728 1 0.1018 0.861 0.968 0.000 0.000 0.016 0.016
#> ERR863731 1 0.0000 0.875 1.000 0.000 0.000 0.000 0.000
#> ERR863764 4 0.3955 0.726 0.000 0.000 0.116 0.800 0.084
#> ERR863740 1 0.3010 0.874 0.824 0.000 0.004 0.000 0.172
#> ERR863765 3 0.4215 0.656 0.064 0.000 0.768 0.000 0.168
#> ERR863762 3 0.4138 0.444 0.000 0.000 0.616 0.000 0.384
#> ERR863724 2 0.2891 0.869 0.008 0.880 0.088 0.004 0.020
#> ERR863733 4 0.0703 0.922 0.000 0.000 0.000 0.976 0.024
#> ERR863732 3 0.2813 0.831 0.000 0.000 0.868 0.024 0.108
#> ERR863730 1 0.3300 0.868 0.792 0.000 0.004 0.000 0.204
#> ERR863742 1 0.2970 0.875 0.828 0.000 0.004 0.000 0.168
#> ERR863763 4 0.0290 0.926 0.000 0.000 0.000 0.992 0.008
#> ERR863741 5 0.4211 0.574 0.004 0.000 0.000 0.360 0.636
#> ERR863743 1 0.0000 0.875 1.000 0.000 0.000 0.000 0.000
#> ERR863745 2 0.0290 0.969 0.000 0.992 0.000 0.000 0.008
#> ERR863744 1 0.2891 0.876 0.824 0.000 0.000 0.000 0.176
#> ERR863746 1 0.3196 0.871 0.804 0.000 0.004 0.000 0.192
#> ERR863748 5 0.3861 0.670 0.000 0.000 0.008 0.264 0.728
#> ERR863747 2 0.1357 0.931 0.000 0.948 0.048 0.000 0.004
#> ERR863694 4 0.0000 0.926 0.000 0.000 0.000 1.000 0.000
#> ERR863693 4 0.1121 0.909 0.000 0.000 0.000 0.956 0.044
#> ERR863686 1 0.3643 0.862 0.776 0.000 0.004 0.008 0.212
#> ERR863678 5 0.5225 0.518 0.268 0.000 0.072 0.004 0.656
#> ERR863685 3 0.0000 0.891 0.000 0.000 1.000 0.000 0.000
#> ERR863689 1 0.3216 0.749 0.848 0.000 0.000 0.108 0.044
#> ERR863691 1 0.5673 0.293 0.596 0.000 0.000 0.292 0.112
#> ERR863682 1 0.1341 0.883 0.944 0.000 0.000 0.000 0.056
#> ERR863695 5 0.4060 0.407 0.000 0.360 0.000 0.000 0.640
#> ERR863683 1 0.2852 0.875 0.828 0.000 0.000 0.000 0.172
#> ERR863684 4 0.0000 0.926 0.000 0.000 0.000 1.000 0.000
#> ERR863702 1 0.3231 0.870 0.800 0.000 0.004 0.000 0.196
#> ERR863687 3 0.4428 0.712 0.000 0.144 0.760 0.000 0.096
#> ERR863706 3 0.0703 0.883 0.000 0.000 0.976 0.000 0.024
#> ERR863708 2 0.0162 0.969 0.000 0.996 0.000 0.000 0.004
#> ERR863710 1 0.0000 0.875 1.000 0.000 0.000 0.000 0.000
#> ERR863709 2 0.0671 0.964 0.000 0.980 0.000 0.004 0.016
#> ERR863753 2 0.0290 0.969 0.000 0.992 0.000 0.000 0.008
#> ERR863754 4 0.3991 0.668 0.172 0.000 0.000 0.780 0.048
#> ERR863749 1 0.0000 0.875 1.000 0.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
#> ERR863675 4 0.0146 0.8546 0.000 0.000 0.000 0.996 0.004 0.000
#> ERR863705 3 0.0363 0.8645 0.000 0.000 0.988 0.000 0.012 0.000
#> ERR863704 2 0.0914 0.8880 0.000 0.968 0.000 0.000 0.016 0.016
#> ERR863679 3 0.2981 0.7560 0.000 0.000 0.820 0.000 0.160 0.020
#> ERR863680 2 0.0363 0.8905 0.000 0.988 0.000 0.000 0.012 0.000
#> ERR863676 2 0.0508 0.8909 0.000 0.984 0.000 0.000 0.004 0.012
#> ERR863677 4 0.0692 0.8547 0.004 0.000 0.000 0.976 0.000 0.020
#> ERR863688 1 0.0458 0.7842 0.984 0.000 0.000 0.000 0.000 0.016
#> ERR863690 6 0.4032 0.8760 0.420 0.000 0.000 0.000 0.008 0.572
#> ERR863692 4 0.2758 0.8135 0.012 0.000 0.000 0.872 0.036 0.080
#> ERR863703 6 0.3915 0.8722 0.412 0.000 0.000 0.000 0.004 0.584
#> ERR863712 4 0.0146 0.8543 0.000 0.000 0.000 0.996 0.000 0.004
#> ERR863711 6 0.3991 0.8016 0.472 0.000 0.000 0.000 0.004 0.524
#> ERR863760 2 0.4186 0.7508 0.000 0.756 0.016 0.000 0.064 0.164
#> ERR863727 1 0.1556 0.7607 0.920 0.000 0.000 0.000 0.000 0.080
#> ERR863766 3 0.0146 0.8660 0.000 0.000 0.996 0.000 0.000 0.004
#> ERR863767 6 0.3789 0.8769 0.416 0.000 0.000 0.000 0.000 0.584
#> ERR863752 2 0.0547 0.8891 0.000 0.980 0.000 0.000 0.020 0.000
#> ERR863757 1 0.5200 0.4554 0.604 0.000 0.276 0.000 0.004 0.116
#> ERR863758 6 0.3797 0.8783 0.420 0.000 0.000 0.000 0.000 0.580
#> ERR863755 1 0.4396 0.0121 0.612 0.000 0.000 0.000 0.036 0.352
#> ERR863756 4 0.5339 0.5191 0.180 0.000 0.092 0.672 0.000 0.056
#> ERR863707 3 0.0260 0.8653 0.000 0.000 0.992 0.000 0.008 0.000
#> ERR863681 2 0.6889 0.4773 0.020 0.532 0.096 0.012 0.072 0.268
#> ERR863719 4 0.0717 0.8485 0.000 0.000 0.000 0.976 0.008 0.016
#> ERR863759 2 0.0993 0.8871 0.000 0.964 0.000 0.000 0.024 0.012
#> ERR863718 6 0.3810 0.8742 0.428 0.000 0.000 0.000 0.000 0.572
#> ERR863717 1 0.3195 0.7055 0.836 0.000 0.000 0.012 0.036 0.116
#> ERR863715 2 0.0717 0.8900 0.000 0.976 0.000 0.000 0.016 0.008
#> ERR863716 1 0.2946 0.5432 0.808 0.000 0.004 0.000 0.004 0.184
#> ERR863722 5 0.4035 0.5738 0.000 0.000 0.004 0.196 0.744 0.056
#> ERR863721 4 0.1492 0.8455 0.000 0.000 0.000 0.940 0.024 0.036
#> ERR863720 2 0.1391 0.8808 0.000 0.944 0.000 0.000 0.040 0.016
#> ERR863723 1 0.3922 0.6607 0.776 0.000 0.096 0.000 0.004 0.124
#> ERR863761 3 0.0713 0.8626 0.000 0.000 0.972 0.000 0.000 0.028
#> ERR863735 6 0.3810 0.8742 0.428 0.000 0.000 0.000 0.000 0.572
#> ERR863734 3 0.0405 0.8648 0.008 0.000 0.988 0.000 0.000 0.004
#> ERR863736 3 0.2403 0.8217 0.000 0.040 0.900 0.000 0.020 0.040
#> ERR863729 5 0.3736 0.6184 0.000 0.168 0.000 0.024 0.784 0.024
#> ERR863728 6 0.4652 0.7985 0.352 0.000 0.000 0.004 0.044 0.600
#> ERR863731 6 0.3930 0.8755 0.420 0.000 0.000 0.000 0.004 0.576
#> ERR863764 4 0.5131 0.5788 0.000 0.000 0.104 0.680 0.184 0.032
#> ERR863740 1 0.1155 0.7728 0.956 0.000 0.004 0.000 0.004 0.036
#> ERR863765 3 0.3733 0.5229 0.288 0.000 0.700 0.000 0.004 0.008
#> ERR863762 5 0.4300 -0.0567 0.000 0.000 0.432 0.000 0.548 0.020
#> ERR863724 2 0.7123 0.4627 0.032 0.524 0.088 0.016 0.076 0.264
#> ERR863733 4 0.3089 0.8089 0.040 0.000 0.000 0.856 0.024 0.080
#> ERR863732 3 0.4858 0.5492 0.000 0.000 0.660 0.076 0.252 0.012
#> ERR863730 1 0.1444 0.7677 0.928 0.000 0.000 0.000 0.000 0.072
#> ERR863742 1 0.3549 0.5341 0.776 0.000 0.028 0.000 0.004 0.192
#> ERR863763 4 0.0622 0.8555 0.000 0.000 0.000 0.980 0.008 0.012
#> ERR863741 5 0.5066 0.4759 0.000 0.000 0.000 0.304 0.592 0.104
#> ERR863743 6 0.3797 0.8783 0.420 0.000 0.000 0.000 0.000 0.580
#> ERR863745 2 0.0790 0.8848 0.000 0.968 0.000 0.000 0.032 0.000
#> ERR863744 1 0.0260 0.7880 0.992 0.000 0.000 0.000 0.000 0.008
#> ERR863746 1 0.0260 0.7880 0.992 0.000 0.000 0.000 0.000 0.008
#> ERR863748 5 0.3128 0.6253 0.000 0.000 0.008 0.168 0.812 0.012
#> ERR863747 2 0.2434 0.8508 0.000 0.896 0.056 0.000 0.032 0.016
#> ERR863694 4 0.0622 0.8502 0.000 0.000 0.000 0.980 0.008 0.012
#> ERR863693 4 0.2617 0.8160 0.004 0.000 0.000 0.876 0.040 0.080
#> ERR863686 1 0.1296 0.7824 0.948 0.000 0.004 0.004 0.000 0.044
#> ERR863678 5 0.5424 0.4019 0.044 0.000 0.056 0.000 0.592 0.308
#> ERR863685 3 0.0547 0.8647 0.000 0.000 0.980 0.000 0.000 0.020
#> ERR863689 6 0.5832 0.5697 0.280 0.000 0.000 0.096 0.048 0.576
#> ERR863691 6 0.7235 0.2889 0.204 0.000 0.000 0.176 0.176 0.444
#> ERR863682 6 0.4310 0.7908 0.472 0.000 0.004 0.000 0.012 0.512
#> ERR863695 5 0.3934 0.4481 0.000 0.304 0.000 0.000 0.676 0.020
#> ERR863683 1 0.1296 0.7671 0.948 0.000 0.004 0.000 0.004 0.044
#> ERR863684 4 0.0405 0.8527 0.000 0.000 0.000 0.988 0.008 0.004
#> ERR863702 1 0.1444 0.7692 0.928 0.000 0.000 0.000 0.000 0.072
#> ERR863687 3 0.4622 0.6794 0.000 0.092 0.724 0.000 0.164 0.020
#> ERR863706 3 0.0777 0.8630 0.000 0.000 0.972 0.000 0.004 0.024
#> ERR863708 2 0.0363 0.8909 0.000 0.988 0.000 0.000 0.000 0.012
#> ERR863710 6 0.3944 0.8716 0.428 0.000 0.000 0.000 0.004 0.568
#> ERR863709 2 0.1370 0.8763 0.000 0.948 0.000 0.004 0.036 0.012
#> ERR863753 2 0.0547 0.8891 0.000 0.980 0.000 0.000 0.020 0.000
#> ERR863754 4 0.4766 0.3545 0.004 0.000 0.000 0.552 0.044 0.400
#> ERR863749 6 0.3797 0.8783 0.420 0.000 0.000 0.000 0.000 0.580
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)
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 17118 rows and 78 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'MAD' method.
#> Subgroups are detected by 'hclust' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 6.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 0.0918 0.194 0.592 0.3805 0.497 0.497
#> 3 3 0.1175 0.332 0.622 0.3527 0.553 0.384
#> 4 4 0.2951 0.534 0.714 0.2719 0.697 0.467
#> 5 5 0.3650 0.420 0.667 0.0669 0.893 0.696
#> 6 6 0.5653 0.553 0.706 0.0644 0.891 0.675
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 6
Following shows the table of the partitions (You need to click the show/hide
code output link to see it). The membership matrix (columns with name p*
)
is inferred by
clue::cl_consensus()
function with the SE
method. Basically the value in the membership matrix
represents the probability to belong to a certain group. The finall class
label for an item is determined with the group with highest probability it
belongs to.
In get_classes()
function, the entropy is calculated from the membership
matrix and the silhouette score is calculated from the consensus matrix.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> ERR863675 2 0.9661 0.15693 0.392 0.608
#> ERR863705 2 0.9775 0.32004 0.412 0.588
#> ERR863704 2 0.9963 -0.00825 0.464 0.536
#> ERR863679 2 0.9775 0.32004 0.412 0.588
#> ERR863680 2 0.0672 0.36604 0.008 0.992
#> ERR863676 2 0.0672 0.36604 0.008 0.992
#> ERR863677 2 0.9661 0.15693 0.392 0.608
#> ERR863688 1 0.6148 0.28418 0.848 0.152
#> ERR863690 1 0.9996 0.12285 0.512 0.488
#> ERR863692 2 0.9686 0.14847 0.396 0.604
#> ERR863703 1 0.9983 0.15630 0.524 0.476
#> ERR863712 2 0.9661 0.15693 0.392 0.608
#> ERR863711 1 0.9944 0.17256 0.544 0.456
#> ERR863760 1 0.9129 0.08671 0.672 0.328
#> ERR863727 1 0.9833 0.18975 0.576 0.424
#> ERR863766 1 0.9998 -0.13956 0.508 0.492
#> ERR863767 1 0.9996 0.10674 0.512 0.488
#> ERR863752 2 0.6148 0.40306 0.152 0.848
#> ERR863757 1 0.1843 0.27665 0.972 0.028
#> ERR863758 1 0.9983 0.15935 0.524 0.476
#> ERR863755 1 0.7219 0.27558 0.800 0.200
#> ERR863756 2 0.9686 0.33492 0.396 0.604
#> ERR863707 2 0.9775 0.32004 0.412 0.588
#> ERR863681 1 0.7219 0.18816 0.800 0.200
#> ERR863719 1 0.8661 0.20478 0.712 0.288
#> ERR863759 2 0.9323 0.35049 0.348 0.652
#> ERR863718 1 0.9983 0.15935 0.524 0.476
#> ERR863717 1 0.9922 0.16494 0.552 0.448
#> ERR863715 1 0.9580 0.04246 0.620 0.380
#> ERR863716 1 0.8608 0.24022 0.716 0.284
#> ERR863722 2 0.9909 0.26579 0.444 0.556
#> ERR863721 2 0.9635 0.14186 0.388 0.612
#> ERR863720 2 0.0672 0.36604 0.008 0.992
#> ERR863723 1 0.9522 0.20612 0.628 0.372
#> ERR863761 1 0.7453 0.20415 0.788 0.212
#> ERR863735 1 0.9983 0.15935 0.524 0.476
#> ERR863734 1 0.9998 -0.13956 0.508 0.492
#> ERR863736 1 0.9522 0.06919 0.628 0.372
#> ERR863729 1 0.9635 0.04930 0.612 0.388
#> ERR863728 2 0.9993 -0.04775 0.484 0.516
#> ERR863731 1 0.9983 0.15935 0.524 0.476
#> ERR863764 2 0.9933 0.26821 0.452 0.548
#> ERR863740 1 0.9933 0.16078 0.548 0.452
#> ERR863765 1 0.9881 0.00242 0.564 0.436
#> ERR863762 2 0.9775 0.32004 0.412 0.588
#> ERR863724 1 0.7219 0.18816 0.800 0.200
#> ERR863733 2 0.9580 0.35337 0.380 0.620
#> ERR863732 2 0.9954 0.24207 0.460 0.540
#> ERR863730 1 0.9833 0.18975 0.576 0.424
#> ERR863742 1 0.9933 0.16078 0.548 0.452
#> ERR863763 2 0.9580 0.16561 0.380 0.620
#> ERR863741 1 0.9635 0.04930 0.612 0.388
#> ERR863743 1 0.9970 0.17014 0.532 0.468
#> ERR863745 2 0.6531 0.40608 0.168 0.832
#> ERR863744 2 0.9933 0.16993 0.452 0.548
#> ERR863746 1 0.9833 0.18975 0.576 0.424
#> ERR863748 2 0.9866 0.30285 0.432 0.568
#> ERR863747 2 0.9323 0.35049 0.348 0.652
#> ERR863694 1 0.8661 0.20478 0.712 0.288
#> ERR863693 2 0.9635 0.14186 0.388 0.612
#> ERR863686 1 0.1843 0.27665 0.972 0.028
#> ERR863678 2 0.9970 0.19010 0.468 0.532
#> ERR863685 1 0.9998 -0.13956 0.508 0.492
#> ERR863689 2 0.9635 0.15179 0.388 0.612
#> ERR863691 2 0.9686 0.14847 0.396 0.604
#> ERR863682 1 0.3114 0.28233 0.944 0.056
#> ERR863695 2 0.0672 0.36604 0.008 0.992
#> ERR863683 1 0.9833 0.18975 0.576 0.424
#> ERR863684 2 0.9988 0.00827 0.480 0.520
#> ERR863702 1 0.2236 0.27913 0.964 0.036
#> ERR863687 2 0.9248 0.34879 0.340 0.660
#> ERR863706 1 0.9983 -0.10399 0.524 0.476
#> ERR863708 2 0.0672 0.36604 0.008 0.992
#> ERR863710 1 0.9983 0.15935 0.524 0.476
#> ERR863709 2 0.0672 0.36604 0.008 0.992
#> ERR863753 2 0.6148 0.40306 0.152 0.848
#> ERR863754 1 0.9998 0.11577 0.508 0.492
#> ERR863749 1 0.9977 0.16571 0.528 0.472
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> ERR863675 1 0.4473 0.4872 0.828 0.164 0.008
#> ERR863705 3 0.9986 -0.3141 0.308 0.340 0.352
#> ERR863704 3 0.9820 0.1670 0.244 0.360 0.396
#> ERR863679 3 0.9986 -0.3141 0.308 0.340 0.352
#> ERR863680 2 0.6062 0.6875 0.384 0.616 0.000
#> ERR863676 2 0.6062 0.6875 0.384 0.616 0.000
#> ERR863677 1 0.4473 0.4872 0.828 0.164 0.008
#> ERR863688 1 0.6448 0.3659 0.636 0.012 0.352
#> ERR863690 1 0.2313 0.5743 0.944 0.032 0.024
#> ERR863692 1 0.5173 0.4831 0.816 0.148 0.036
#> ERR863703 1 0.1636 0.5908 0.964 0.020 0.016
#> ERR863712 1 0.4473 0.4872 0.828 0.164 0.008
#> ERR863711 1 0.1878 0.5925 0.952 0.004 0.044
#> ERR863760 3 0.9048 0.3562 0.184 0.268 0.548
#> ERR863727 1 0.4859 0.5778 0.840 0.044 0.116
#> ERR863766 1 0.9857 -0.2492 0.416 0.308 0.276
#> ERR863767 1 0.4095 0.5807 0.880 0.064 0.056
#> ERR863752 2 0.9301 0.6384 0.360 0.472 0.168
#> ERR863757 1 0.6305 0.1157 0.516 0.000 0.484
#> ERR863758 1 0.1015 0.5875 0.980 0.008 0.012
#> ERR863755 1 0.6193 0.4304 0.692 0.016 0.292
#> ERR863756 1 0.9949 -0.4169 0.360 0.356 0.284
#> ERR863707 3 0.9986 -0.3141 0.308 0.340 0.352
#> ERR863681 3 0.9963 0.2941 0.292 0.348 0.360
#> ERR863719 1 0.7637 0.4166 0.640 0.076 0.284
#> ERR863759 2 0.9898 0.3127 0.308 0.404 0.288
#> ERR863718 1 0.1015 0.5875 0.980 0.008 0.012
#> ERR863717 1 0.4423 0.5841 0.864 0.048 0.088
#> ERR863715 3 0.6512 0.3293 0.024 0.300 0.676
#> ERR863716 1 0.5156 0.5350 0.776 0.008 0.216
#> ERR863722 1 0.9502 -0.1895 0.480 0.308 0.212
#> ERR863721 1 0.3879 0.4925 0.848 0.152 0.000
#> ERR863720 2 0.6062 0.6875 0.384 0.616 0.000
#> ERR863723 1 0.5581 0.5617 0.792 0.040 0.168
#> ERR863761 3 0.8702 0.2278 0.292 0.140 0.568
#> ERR863735 1 0.1015 0.5875 0.980 0.008 0.012
#> ERR863734 1 0.9857 -0.2492 0.416 0.308 0.276
#> ERR863736 3 0.9268 0.3400 0.188 0.300 0.512
#> ERR863729 3 0.6008 0.3411 0.004 0.332 0.664
#> ERR863728 1 0.5094 0.5298 0.832 0.112 0.056
#> ERR863731 1 0.1015 0.5875 0.980 0.008 0.012
#> ERR863764 1 0.9575 -0.2070 0.464 0.320 0.216
#> ERR863740 1 0.5067 0.5732 0.832 0.052 0.116
#> ERR863765 1 0.8494 0.2058 0.608 0.236 0.156
#> ERR863762 3 0.9986 -0.3141 0.308 0.340 0.352
#> ERR863724 3 0.9963 0.2941 0.292 0.348 0.360
#> ERR863733 1 0.9920 -0.4089 0.368 0.360 0.272
#> ERR863732 1 0.9575 -0.1902 0.464 0.320 0.216
#> ERR863730 1 0.4859 0.5778 0.840 0.044 0.116
#> ERR863742 1 0.5067 0.5732 0.832 0.052 0.116
#> ERR863763 1 0.4409 0.4788 0.824 0.172 0.004
#> ERR863741 3 0.6008 0.3411 0.004 0.332 0.664
#> ERR863743 1 0.1315 0.5873 0.972 0.008 0.020
#> ERR863745 2 0.9475 0.6204 0.360 0.452 0.188
#> ERR863744 1 0.8838 0.1343 0.580 0.220 0.200
#> ERR863746 1 0.4859 0.5778 0.840 0.044 0.116
#> ERR863748 1 0.9688 -0.2759 0.440 0.332 0.228
#> ERR863747 2 0.9898 0.3127 0.308 0.404 0.288
#> ERR863694 1 0.7637 0.4166 0.640 0.076 0.284
#> ERR863693 1 0.3879 0.4925 0.848 0.152 0.000
#> ERR863686 1 0.6302 0.1226 0.520 0.000 0.480
#> ERR863678 1 0.8839 0.0459 0.572 0.256 0.172
#> ERR863685 1 0.9857 -0.2492 0.416 0.308 0.276
#> ERR863689 1 0.5119 0.4783 0.816 0.152 0.032
#> ERR863691 1 0.5173 0.4831 0.816 0.148 0.036
#> ERR863682 1 0.6235 0.1757 0.564 0.000 0.436
#> ERR863695 2 0.6062 0.6875 0.384 0.616 0.000
#> ERR863683 1 0.4636 0.5820 0.852 0.044 0.104
#> ERR863684 1 0.6309 0.4889 0.772 0.128 0.100
#> ERR863702 1 0.6291 0.1429 0.532 0.000 0.468
#> ERR863687 2 0.9872 0.3417 0.320 0.408 0.272
#> ERR863706 1 0.9790 -0.2061 0.436 0.292 0.272
#> ERR863708 2 0.6062 0.6875 0.384 0.616 0.000
#> ERR863710 1 0.1015 0.5875 0.980 0.008 0.012
#> ERR863709 2 0.6062 0.6875 0.384 0.616 0.000
#> ERR863753 2 0.9301 0.6384 0.360 0.472 0.168
#> ERR863754 1 0.2176 0.5739 0.948 0.032 0.020
#> ERR863749 1 0.0829 0.5899 0.984 0.004 0.012
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> ERR863675 1 0.5139 0.6552 0.788 0.128 0.028 0.056
#> ERR863705 3 0.0188 0.6604 0.000 0.000 0.996 0.004
#> ERR863704 4 0.8201 0.2996 0.136 0.228 0.080 0.556
#> ERR863679 3 0.0188 0.6604 0.000 0.000 0.996 0.004
#> ERR863680 2 0.7540 0.6569 0.216 0.480 0.304 0.000
#> ERR863676 2 0.7540 0.6569 0.216 0.480 0.304 0.000
#> ERR863677 1 0.5139 0.6552 0.788 0.128 0.028 0.056
#> ERR863688 1 0.6015 0.0729 0.512 0.004 0.032 0.452
#> ERR863690 1 0.2335 0.7255 0.920 0.020 0.000 0.060
#> ERR863692 1 0.5551 0.6557 0.768 0.132 0.048 0.052
#> ERR863703 1 0.2141 0.7339 0.936 0.012 0.012 0.040
#> ERR863712 1 0.5139 0.6552 0.788 0.128 0.028 0.056
#> ERR863711 1 0.3342 0.7119 0.868 0.000 0.032 0.100
#> ERR863760 4 0.5507 0.5102 0.112 0.156 0.000 0.732
#> ERR863727 1 0.5042 0.6435 0.768 0.012 0.044 0.176
#> ERR863766 3 0.3312 0.6420 0.072 0.000 0.876 0.052
#> ERR863767 1 0.4157 0.7228 0.852 0.032 0.064 0.052
#> ERR863752 3 0.7460 0.0393 0.152 0.276 0.556 0.016
#> ERR863757 4 0.5217 0.3344 0.380 0.000 0.012 0.608
#> ERR863758 1 0.1767 0.7289 0.944 0.000 0.012 0.044
#> ERR863755 1 0.5543 0.2980 0.612 0.000 0.028 0.360
#> ERR863756 3 0.2365 0.6734 0.064 0.012 0.920 0.004
#> ERR863707 3 0.0188 0.6604 0.000 0.000 0.996 0.004
#> ERR863681 2 0.9662 -0.1212 0.164 0.376 0.244 0.216
#> ERR863719 1 0.7550 0.3403 0.516 0.064 0.056 0.364
#> ERR863759 3 0.2222 0.6526 0.016 0.060 0.924 0.000
#> ERR863718 1 0.1635 0.7285 0.948 0.000 0.008 0.044
#> ERR863717 1 0.4707 0.6859 0.800 0.016 0.040 0.144
#> ERR863715 4 0.7689 0.2080 0.004 0.292 0.220 0.484
#> ERR863716 1 0.5300 0.4770 0.664 0.000 0.028 0.308
#> ERR863722 3 0.6558 0.4812 0.228 0.068 0.668 0.036
#> ERR863721 1 0.4286 0.6663 0.812 0.136 0.000 0.052
#> ERR863720 2 0.7540 0.6569 0.216 0.480 0.304 0.000
#> ERR863723 1 0.5381 0.5774 0.716 0.004 0.048 0.232
#> ERR863761 4 0.7186 0.3003 0.140 0.000 0.384 0.476
#> ERR863735 1 0.1635 0.7285 0.948 0.000 0.008 0.044
#> ERR863734 3 0.3312 0.6420 0.072 0.000 0.876 0.052
#> ERR863736 4 0.7105 0.4808 0.076 0.128 0.124 0.672
#> ERR863729 4 0.5475 0.3878 0.000 0.308 0.036 0.656
#> ERR863728 1 0.5226 0.5832 0.740 0.036 0.212 0.012
#> ERR863731 1 0.1635 0.7285 0.948 0.000 0.008 0.044
#> ERR863764 3 0.6023 0.5463 0.192 0.060 0.716 0.032
#> ERR863740 1 0.5520 0.6454 0.744 0.012 0.072 0.172
#> ERR863765 3 0.6248 0.3633 0.260 0.000 0.640 0.100
#> ERR863762 3 0.0188 0.6604 0.000 0.000 0.996 0.004
#> ERR863724 2 0.9662 -0.1212 0.164 0.376 0.244 0.216
#> ERR863733 3 0.5135 0.6019 0.148 0.048 0.780 0.024
#> ERR863732 3 0.5245 0.6063 0.156 0.044 0.772 0.028
#> ERR863730 1 0.5123 0.6412 0.764 0.012 0.048 0.176
#> ERR863742 1 0.5520 0.6454 0.744 0.012 0.072 0.172
#> ERR863763 1 0.5165 0.6504 0.784 0.136 0.028 0.052
#> ERR863741 4 0.5475 0.3878 0.000 0.308 0.036 0.656
#> ERR863743 1 0.1890 0.7259 0.936 0.000 0.008 0.056
#> ERR863745 3 0.7273 0.1820 0.144 0.240 0.596 0.020
#> ERR863744 1 0.7813 0.2745 0.512 0.052 0.344 0.092
#> ERR863746 1 0.5123 0.6412 0.764 0.012 0.048 0.176
#> ERR863748 3 0.6011 0.5662 0.168 0.068 0.728 0.036
#> ERR863747 3 0.2222 0.6526 0.016 0.060 0.924 0.000
#> ERR863694 1 0.7550 0.3403 0.516 0.064 0.056 0.364
#> ERR863693 1 0.4286 0.6663 0.812 0.136 0.000 0.052
#> ERR863686 4 0.5279 0.3079 0.400 0.000 0.012 0.588
#> ERR863678 3 0.7212 0.2727 0.344 0.064 0.552 0.040
#> ERR863685 3 0.3312 0.6420 0.072 0.000 0.876 0.052
#> ERR863689 1 0.5678 0.6531 0.760 0.136 0.056 0.048
#> ERR863691 1 0.5551 0.6557 0.768 0.132 0.048 0.052
#> ERR863682 4 0.5158 0.1816 0.472 0.000 0.004 0.524
#> ERR863695 2 0.7540 0.6569 0.216 0.480 0.304 0.000
#> ERR863683 1 0.4597 0.6669 0.800 0.008 0.044 0.148
#> ERR863684 1 0.6232 0.6308 0.720 0.096 0.036 0.148
#> ERR863702 4 0.5310 0.2794 0.412 0.000 0.012 0.576
#> ERR863687 3 0.3494 0.6241 0.008 0.116 0.860 0.016
#> ERR863706 3 0.3716 0.6289 0.096 0.000 0.852 0.052
#> ERR863708 2 0.7540 0.6569 0.216 0.480 0.304 0.000
#> ERR863710 1 0.1635 0.7285 0.948 0.000 0.008 0.044
#> ERR863709 2 0.7707 0.6529 0.216 0.476 0.304 0.004
#> ERR863753 3 0.7460 0.0393 0.152 0.276 0.556 0.016
#> ERR863754 1 0.2335 0.7241 0.920 0.020 0.000 0.060
#> ERR863749 1 0.1798 0.7295 0.944 0.000 0.016 0.040
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> ERR863675 1 0.1195 0.5626 0.960 0.000 0.028 0.000 0.012
#> ERR863705 3 0.0579 0.7081 0.000 0.000 0.984 0.008 0.008
#> ERR863704 5 0.8853 -0.2041 0.112 0.132 0.068 0.304 0.384
#> ERR863679 3 0.0579 0.7081 0.000 0.000 0.984 0.008 0.008
#> ERR863680 2 0.6376 0.5964 0.264 0.516 0.220 0.000 0.000
#> ERR863676 2 0.6376 0.5964 0.264 0.516 0.220 0.000 0.000
#> ERR863677 1 0.1195 0.5626 0.960 0.000 0.028 0.000 0.012
#> ERR863688 5 0.3987 0.4020 0.188 0.004 0.024 0.004 0.780
#> ERR863690 1 0.3999 0.5369 0.656 0.000 0.000 0.000 0.344
#> ERR863692 1 0.2536 0.5663 0.904 0.012 0.052 0.000 0.032
#> ERR863703 1 0.4306 0.5485 0.660 0.000 0.012 0.000 0.328
#> ERR863712 1 0.1195 0.5626 0.960 0.000 0.028 0.000 0.012
#> ERR863711 1 0.4909 0.4015 0.560 0.000 0.028 0.000 0.412
#> ERR863760 5 0.6158 -0.1126 0.028 0.076 0.000 0.344 0.552
#> ERR863727 5 0.5111 -0.1393 0.464 0.000 0.036 0.000 0.500
#> ERR863766 3 0.3004 0.6787 0.008 0.000 0.864 0.020 0.108
#> ERR863767 1 0.4788 0.5280 0.696 0.000 0.064 0.000 0.240
#> ERR863752 3 0.6637 0.0969 0.172 0.304 0.512 0.004 0.008
#> ERR863757 5 0.1365 0.3776 0.040 0.000 0.004 0.004 0.952
#> ERR863758 1 0.4371 0.5409 0.644 0.000 0.012 0.000 0.344
#> ERR863755 5 0.4382 0.2908 0.288 0.000 0.024 0.000 0.688
#> ERR863756 3 0.1798 0.7123 0.064 0.004 0.928 0.000 0.004
#> ERR863707 3 0.0579 0.7081 0.000 0.000 0.984 0.008 0.008
#> ERR863681 4 0.5487 1.0000 0.004 0.012 0.076 0.668 0.240
#> ERR863719 1 0.5578 0.1942 0.564 0.012 0.052 0.000 0.372
#> ERR863759 3 0.1774 0.7056 0.016 0.052 0.932 0.000 0.000
#> ERR863718 1 0.4268 0.5428 0.648 0.000 0.008 0.000 0.344
#> ERR863717 1 0.5083 0.2373 0.532 0.000 0.036 0.000 0.432
#> ERR863715 2 0.7261 -0.1258 0.000 0.544 0.220 0.120 0.116
#> ERR863716 5 0.4540 0.1434 0.340 0.000 0.020 0.000 0.640
#> ERR863722 3 0.4985 0.5609 0.284 0.024 0.672 0.004 0.016
#> ERR863721 1 0.0000 0.5689 1.000 0.000 0.000 0.000 0.000
#> ERR863720 2 0.6376 0.5964 0.264 0.516 0.220 0.000 0.000
#> ERR863723 5 0.5095 0.0129 0.400 0.000 0.040 0.000 0.560
#> ERR863761 5 0.5773 -0.1789 0.008 0.024 0.372 0.032 0.564
#> ERR863735 1 0.4268 0.5428 0.648 0.000 0.008 0.000 0.344
#> ERR863734 3 0.3004 0.6787 0.008 0.000 0.864 0.020 0.108
#> ERR863736 5 0.6963 -0.1716 0.000 0.052 0.124 0.316 0.508
#> ERR863729 2 0.6827 -0.1931 0.000 0.460 0.036 0.384 0.120
#> ERR863728 1 0.6164 0.4265 0.592 0.008 0.212 0.000 0.188
#> ERR863731 1 0.4268 0.5428 0.648 0.000 0.008 0.000 0.344
#> ERR863764 3 0.4505 0.6139 0.244 0.020 0.720 0.000 0.016
#> ERR863740 1 0.5646 0.1460 0.488 0.000 0.064 0.004 0.444
#> ERR863765 3 0.5350 0.3805 0.072 0.000 0.632 0.004 0.292
#> ERR863762 3 0.0579 0.7081 0.000 0.000 0.984 0.008 0.008
#> ERR863724 4 0.5487 1.0000 0.004 0.012 0.076 0.668 0.240
#> ERR863733 3 0.4171 0.6600 0.172 0.024 0.784 0.004 0.016
#> ERR863732 3 0.4389 0.6640 0.168 0.020 0.772 0.000 0.040
#> ERR863730 5 0.5173 -0.1317 0.460 0.000 0.040 0.000 0.500
#> ERR863742 1 0.5646 0.1460 0.488 0.000 0.064 0.004 0.444
#> ERR863763 1 0.0794 0.5615 0.972 0.000 0.028 0.000 0.000
#> ERR863741 2 0.6827 -0.1931 0.000 0.460 0.036 0.384 0.120
#> ERR863743 1 0.4313 0.5296 0.636 0.000 0.008 0.000 0.356
#> ERR863745 3 0.6533 0.2410 0.168 0.260 0.556 0.004 0.012
#> ERR863744 1 0.6757 0.1732 0.480 0.020 0.344 0.000 0.156
#> ERR863746 5 0.5173 -0.1317 0.460 0.000 0.040 0.000 0.500
#> ERR863748 3 0.4590 0.6267 0.224 0.028 0.732 0.004 0.012
#> ERR863747 3 0.1774 0.7056 0.016 0.052 0.932 0.000 0.000
#> ERR863694 1 0.5578 0.1942 0.564 0.012 0.052 0.000 0.372
#> ERR863693 1 0.0000 0.5689 1.000 0.000 0.000 0.000 0.000
#> ERR863686 5 0.1638 0.4073 0.064 0.000 0.004 0.000 0.932
#> ERR863678 3 0.5723 0.3930 0.376 0.024 0.556 0.000 0.044
#> ERR863685 3 0.3004 0.6787 0.008 0.000 0.864 0.020 0.108
#> ERR863689 1 0.2502 0.5645 0.904 0.012 0.060 0.000 0.024
#> ERR863691 1 0.2536 0.5663 0.904 0.012 0.052 0.000 0.032
#> ERR863682 5 0.2930 0.4193 0.164 0.000 0.004 0.000 0.832
#> ERR863695 2 0.6376 0.5964 0.264 0.516 0.220 0.000 0.000
#> ERR863683 1 0.5176 0.1567 0.492 0.000 0.040 0.000 0.468
#> ERR863684 1 0.3573 0.5105 0.832 0.012 0.032 0.000 0.124
#> ERR863702 5 0.1892 0.4216 0.080 0.000 0.004 0.000 0.916
#> ERR863687 3 0.3272 0.6753 0.016 0.120 0.848 0.000 0.016
#> ERR863706 3 0.3542 0.6679 0.028 0.000 0.840 0.020 0.112
#> ERR863708 2 0.6376 0.5964 0.264 0.516 0.220 0.000 0.000
#> ERR863710 1 0.4268 0.5428 0.648 0.000 0.008 0.000 0.344
#> ERR863709 2 0.6521 0.5934 0.264 0.512 0.220 0.004 0.000
#> ERR863753 3 0.6637 0.0969 0.172 0.304 0.512 0.004 0.008
#> ERR863754 1 0.3913 0.5490 0.676 0.000 0.000 0.000 0.324
#> ERR863749 1 0.4451 0.5332 0.644 0.000 0.016 0.000 0.340
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> ERR863675 1 0.5218 0.5490 0.636 0.044 0.028 0.000 0.280 0.012
#> ERR863705 3 0.0858 0.7691 0.000 0.000 0.968 0.028 0.004 0.000
#> ERR863704 6 0.6032 -0.0202 0.020 0.244 0.000 0.048 0.084 0.604
#> ERR863679 3 0.0858 0.7691 0.000 0.000 0.968 0.028 0.004 0.000
#> ERR863680 2 0.0547 0.7601 0.020 0.980 0.000 0.000 0.000 0.000
#> ERR863676 2 0.0547 0.7601 0.020 0.980 0.000 0.000 0.000 0.000
#> ERR863677 1 0.5218 0.5490 0.636 0.044 0.028 0.000 0.280 0.012
#> ERR863688 6 0.5382 0.2471 0.436 0.000 0.016 0.020 0.032 0.496
#> ERR863690 1 0.2450 0.6052 0.896 0.024 0.000 0.012 0.004 0.064
#> ERR863692 1 0.5582 0.5615 0.656 0.036 0.048 0.012 0.232 0.016
#> ERR863703 1 0.1894 0.6202 0.928 0.004 0.012 0.000 0.016 0.040
#> ERR863712 1 0.5218 0.5490 0.636 0.044 0.028 0.000 0.280 0.012
#> ERR863711 1 0.2892 0.5658 0.840 0.000 0.020 0.004 0.000 0.136
#> ERR863760 6 0.3885 0.1822 0.024 0.020 0.000 0.044 0.096 0.816
#> ERR863727 1 0.4384 0.4216 0.688 0.000 0.028 0.012 0.004 0.268
#> ERR863766 3 0.3241 0.7342 0.008 0.000 0.844 0.084 0.004 0.060
#> ERR863767 1 0.3986 0.6086 0.812 0.000 0.060 0.008 0.060 0.060
#> ERR863752 2 0.4717 0.4848 0.012 0.608 0.348 0.028 0.004 0.000
#> ERR863757 6 0.4957 0.5470 0.304 0.000 0.000 0.052 0.020 0.624
#> ERR863758 1 0.1296 0.6117 0.948 0.004 0.004 0.000 0.000 0.044
#> ERR863755 1 0.5093 -0.1065 0.528 0.000 0.020 0.004 0.032 0.416
#> ERR863756 3 0.1760 0.7696 0.020 0.000 0.928 0.000 0.048 0.004
#> ERR863707 3 0.0858 0.7691 0.000 0.000 0.968 0.028 0.004 0.000
#> ERR863681 4 0.1871 1.0000 0.032 0.000 0.024 0.928 0.000 0.016
#> ERR863719 1 0.7745 0.2138 0.376 0.000 0.052 0.060 0.264 0.248
#> ERR863759 3 0.1672 0.7646 0.016 0.048 0.932 0.000 0.004 0.000
#> ERR863718 1 0.1152 0.6114 0.952 0.004 0.000 0.000 0.000 0.044
#> ERR863717 1 0.4206 0.5082 0.744 0.000 0.028 0.004 0.024 0.200
#> ERR863715 5 0.6511 0.4517 0.000 0.104 0.216 0.032 0.584 0.064
#> ERR863716 1 0.4345 0.1986 0.604 0.000 0.012 0.012 0.000 0.372
#> ERR863722 3 0.5726 0.6110 0.128 0.020 0.668 0.032 0.148 0.004
#> ERR863721 1 0.4656 0.5579 0.660 0.044 0.000 0.000 0.280 0.016
#> ERR863720 2 0.0547 0.7601 0.020 0.980 0.000 0.000 0.000 0.000
#> ERR863723 1 0.4556 0.3288 0.652 0.000 0.032 0.016 0.000 0.300
#> ERR863761 6 0.6307 0.0664 0.032 0.020 0.352 0.084 0.004 0.508
#> ERR863735 1 0.1152 0.6114 0.952 0.004 0.000 0.000 0.000 0.044
#> ERR863734 3 0.3241 0.7342 0.008 0.000 0.844 0.084 0.004 0.060
#> ERR863736 6 0.5501 0.1268 0.024 0.020 0.120 0.044 0.072 0.720
#> ERR863729 5 0.4768 0.7206 0.000 0.000 0.032 0.068 0.708 0.192
#> ERR863728 1 0.4637 0.4954 0.720 0.008 0.208 0.020 0.040 0.004
#> ERR863731 1 0.1152 0.6114 0.952 0.004 0.000 0.000 0.000 0.044
#> ERR863764 3 0.5116 0.6645 0.092 0.012 0.716 0.028 0.148 0.004
#> ERR863740 1 0.5311 0.4296 0.644 0.000 0.056 0.020 0.020 0.260
#> ERR863765 3 0.5752 0.4522 0.168 0.000 0.632 0.020 0.016 0.164
#> ERR863762 3 0.0632 0.7703 0.000 0.000 0.976 0.024 0.000 0.000
#> ERR863724 4 0.1871 1.0000 0.032 0.000 0.024 0.928 0.000 0.016
#> ERR863733 3 0.4431 0.7066 0.088 0.012 0.784 0.024 0.084 0.008
#> ERR863732 3 0.4600 0.7156 0.076 0.004 0.768 0.032 0.108 0.012
#> ERR863730 1 0.4454 0.4173 0.684 0.000 0.032 0.012 0.004 0.268
#> ERR863742 1 0.5311 0.4296 0.644 0.000 0.056 0.020 0.020 0.260
#> ERR863763 1 0.5303 0.5494 0.632 0.044 0.028 0.000 0.280 0.016
#> ERR863741 5 0.4768 0.7206 0.000 0.000 0.032 0.068 0.708 0.192
#> ERR863743 1 0.1686 0.6080 0.932 0.004 0.000 0.008 0.004 0.052
#> ERR863745 2 0.4997 0.3928 0.008 0.556 0.392 0.032 0.012 0.000
#> ERR863744 1 0.7503 0.1997 0.420 0.008 0.336 0.032 0.112 0.092
#> ERR863746 1 0.4454 0.4173 0.684 0.000 0.032 0.012 0.004 0.268
#> ERR863748 3 0.5017 0.6744 0.084 0.020 0.728 0.032 0.136 0.000
#> ERR863747 3 0.1672 0.7646 0.016 0.048 0.932 0.000 0.004 0.000
#> ERR863694 1 0.7745 0.2138 0.376 0.000 0.052 0.060 0.264 0.248
#> ERR863693 1 0.4656 0.5579 0.660 0.044 0.000 0.000 0.280 0.016
#> ERR863686 6 0.4873 0.5353 0.328 0.000 0.000 0.040 0.020 0.612
#> ERR863678 3 0.6675 0.4538 0.232 0.024 0.552 0.028 0.152 0.012
#> ERR863685 3 0.3241 0.7342 0.008 0.000 0.844 0.084 0.004 0.060
#> ERR863689 1 0.5574 0.5626 0.656 0.032 0.052 0.012 0.232 0.016
#> ERR863691 1 0.5582 0.5615 0.656 0.036 0.048 0.012 0.232 0.016
#> ERR863682 6 0.4755 0.3776 0.460 0.000 0.000 0.048 0.000 0.492
#> ERR863695 2 0.0547 0.7601 0.020 0.980 0.000 0.000 0.000 0.000
#> ERR863683 1 0.3960 0.4694 0.736 0.000 0.032 0.008 0.000 0.224
#> ERR863684 1 0.6858 0.4991 0.564 0.036 0.032 0.048 0.252 0.068
#> ERR863702 6 0.4678 0.5237 0.328 0.000 0.000 0.020 0.028 0.624
#> ERR863687 3 0.3078 0.7232 0.000 0.112 0.844 0.032 0.012 0.000
#> ERR863706 3 0.3687 0.7239 0.020 0.000 0.820 0.084 0.004 0.072
#> ERR863708 2 0.0547 0.7601 0.020 0.980 0.000 0.000 0.000 0.000
#> ERR863710 1 0.1152 0.6114 0.952 0.004 0.000 0.000 0.000 0.044
#> ERR863709 2 0.0692 0.7578 0.020 0.976 0.000 0.004 0.000 0.000
#> ERR863753 2 0.4717 0.4848 0.012 0.608 0.348 0.028 0.004 0.000
#> ERR863754 1 0.2483 0.6089 0.896 0.024 0.000 0.004 0.016 0.060
#> ERR863749 1 0.1124 0.6131 0.956 0.000 0.008 0.000 0.000 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)
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 17118 rows and 78 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.395 0.748 0.865 0.4892 0.510 0.510
#> 3 3 0.558 0.756 0.854 0.2957 0.774 0.588
#> 4 4 0.599 0.525 0.733 0.1465 0.892 0.722
#> 5 5 0.632 0.550 0.726 0.0714 0.880 0.636
#> 6 6 0.709 0.625 0.762 0.0450 0.891 0.579
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
#> ERR863675 2 0.7528 0.8125 0.216 0.784
#> ERR863705 2 0.2778 0.8093 0.048 0.952
#> ERR863704 2 0.7219 0.8172 0.200 0.800
#> ERR863679 2 0.2778 0.8093 0.048 0.952
#> ERR863680 2 0.7376 0.8182 0.208 0.792
#> ERR863676 2 0.7376 0.8182 0.208 0.792
#> ERR863677 1 0.9866 -0.0698 0.568 0.432
#> ERR863688 1 0.5408 0.8193 0.876 0.124
#> ERR863690 1 0.1633 0.8439 0.976 0.024
#> ERR863692 1 0.1414 0.8455 0.980 0.020
#> ERR863703 1 0.0672 0.8498 0.992 0.008
#> ERR863712 1 0.9922 -0.1270 0.552 0.448
#> ERR863711 1 0.0376 0.8513 0.996 0.004
#> ERR863760 2 0.7299 0.8151 0.204 0.796
#> ERR863727 1 0.4690 0.8277 0.900 0.100
#> ERR863766 1 0.8813 0.6530 0.700 0.300
#> ERR863767 1 0.2236 0.8481 0.964 0.036
#> ERR863752 2 0.2603 0.8294 0.044 0.956
#> ERR863757 1 0.5408 0.8193 0.876 0.124
#> ERR863758 1 0.0672 0.8498 0.992 0.008
#> ERR863755 1 0.0672 0.8511 0.992 0.008
#> ERR863756 2 0.4431 0.7812 0.092 0.908
#> ERR863707 2 0.2778 0.8093 0.048 0.952
#> ERR863681 2 0.9732 0.1246 0.404 0.596
#> ERR863719 1 0.5408 0.8193 0.876 0.124
#> ERR863759 2 0.1414 0.8190 0.020 0.980
#> ERR863718 1 0.0672 0.8498 0.992 0.008
#> ERR863717 1 0.0000 0.8509 1.000 0.000
#> ERR863715 2 0.4939 0.8341 0.108 0.892
#> ERR863716 1 0.0938 0.8505 0.988 0.012
#> ERR863722 2 0.4690 0.8318 0.100 0.900
#> ERR863721 1 0.2236 0.8365 0.964 0.036
#> ERR863720 2 0.7376 0.8156 0.208 0.792
#> ERR863723 1 0.3274 0.8437 0.940 0.060
#> ERR863761 2 0.2423 0.8079 0.040 0.960
#> ERR863735 1 0.3114 0.8440 0.944 0.056
#> ERR863734 1 0.9775 0.4501 0.588 0.412
#> ERR863736 2 0.1633 0.8205 0.024 0.976
#> ERR863729 2 0.6048 0.8303 0.148 0.852
#> ERR863728 1 0.1633 0.8439 0.976 0.024
#> ERR863731 1 0.0672 0.8498 0.992 0.008
#> ERR863764 2 0.6973 0.8251 0.188 0.812
#> ERR863740 1 0.7056 0.7624 0.808 0.192
#> ERR863765 1 0.8813 0.6530 0.700 0.300
#> ERR863762 2 0.7815 0.5859 0.232 0.768
#> ERR863724 1 0.8499 0.6808 0.724 0.276
#> ERR863733 2 0.2603 0.8294 0.044 0.956
#> ERR863732 2 0.3431 0.8018 0.064 0.936
#> ERR863730 1 0.6712 0.7768 0.824 0.176
#> ERR863742 1 0.7056 0.7624 0.808 0.192
#> ERR863763 1 0.9922 -0.1270 0.552 0.448
#> ERR863741 2 0.9896 0.4371 0.440 0.560
#> ERR863743 1 0.0672 0.8498 0.992 0.008
#> ERR863745 2 0.7056 0.8242 0.192 0.808
#> ERR863744 1 0.5294 0.8184 0.880 0.120
#> ERR863746 1 0.3114 0.8440 0.944 0.056
#> ERR863748 2 0.2043 0.8268 0.032 0.968
#> ERR863747 2 0.1414 0.8190 0.020 0.980
#> ERR863694 2 0.9710 0.5262 0.400 0.600
#> ERR863693 1 0.2236 0.8365 0.964 0.036
#> ERR863686 1 0.3114 0.8442 0.944 0.056
#> ERR863678 1 0.1633 0.8439 0.976 0.024
#> ERR863685 1 0.9983 0.2875 0.524 0.476
#> ERR863689 1 0.2043 0.8392 0.968 0.032
#> ERR863691 1 0.2236 0.8365 0.964 0.036
#> ERR863682 1 0.0938 0.8505 0.988 0.012
#> ERR863695 2 0.7376 0.8182 0.208 0.792
#> ERR863683 1 0.6712 0.7768 0.824 0.176
#> ERR863684 1 0.2423 0.8358 0.960 0.040
#> ERR863702 1 0.5408 0.8193 0.876 0.124
#> ERR863687 2 0.1414 0.8190 0.020 0.980
#> ERR863706 1 0.8813 0.6530 0.700 0.300
#> ERR863708 2 0.7376 0.8182 0.208 0.792
#> ERR863710 1 0.0672 0.8498 0.992 0.008
#> ERR863709 2 0.8813 0.7129 0.300 0.700
#> ERR863753 2 0.7376 0.8182 0.208 0.792
#> ERR863754 1 0.2236 0.8365 0.964 0.036
#> ERR863749 1 0.0376 0.8513 0.996 0.004
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> ERR863675 2 0.8526 0.562 0.308 0.572 0.120
#> ERR863705 3 0.3983 0.773 0.004 0.144 0.852
#> ERR863704 2 0.2176 0.788 0.020 0.948 0.032
#> ERR863679 3 0.3272 0.796 0.004 0.104 0.892
#> ERR863680 2 0.3649 0.805 0.068 0.896 0.036
#> ERR863676 2 0.4056 0.803 0.092 0.876 0.032
#> ERR863677 1 0.8637 -0.304 0.452 0.448 0.100
#> ERR863688 1 0.6313 0.789 0.768 0.084 0.148
#> ERR863690 1 0.0848 0.885 0.984 0.008 0.008
#> ERR863692 1 0.1950 0.871 0.952 0.008 0.040
#> ERR863703 1 0.0237 0.887 0.996 0.004 0.000
#> ERR863712 2 0.8140 0.410 0.404 0.524 0.072
#> ERR863711 1 0.0747 0.889 0.984 0.000 0.016
#> ERR863760 2 0.2297 0.775 0.020 0.944 0.036
#> ERR863727 1 0.4139 0.850 0.860 0.016 0.124
#> ERR863766 3 0.2625 0.791 0.084 0.000 0.916
#> ERR863767 1 0.0892 0.889 0.980 0.000 0.020
#> ERR863752 2 0.4047 0.718 0.004 0.848 0.148
#> ERR863757 1 0.6622 0.775 0.748 0.088 0.164
#> ERR863758 1 0.0000 0.888 1.000 0.000 0.000
#> ERR863755 1 0.1774 0.887 0.960 0.016 0.024
#> ERR863756 3 0.2339 0.802 0.012 0.048 0.940
#> ERR863707 3 0.3272 0.796 0.004 0.104 0.892
#> ERR863681 3 0.7424 0.514 0.288 0.064 0.648
#> ERR863719 1 0.8255 0.668 0.620 0.128 0.252
#> ERR863759 3 0.5058 0.693 0.000 0.244 0.756
#> ERR863718 1 0.0000 0.888 1.000 0.000 0.000
#> ERR863717 1 0.0592 0.889 0.988 0.000 0.012
#> ERR863715 2 0.1989 0.764 0.004 0.948 0.048
#> ERR863716 1 0.1905 0.887 0.956 0.016 0.028
#> ERR863722 3 0.7558 0.444 0.072 0.284 0.644
#> ERR863721 1 0.4087 0.817 0.880 0.068 0.052
#> ERR863720 2 0.4056 0.803 0.092 0.876 0.032
#> ERR863723 1 0.4068 0.852 0.864 0.016 0.120
#> ERR863761 3 0.2860 0.797 0.004 0.084 0.912
#> ERR863735 1 0.1267 0.889 0.972 0.004 0.024
#> ERR863734 3 0.2772 0.794 0.080 0.004 0.916
#> ERR863736 2 0.2537 0.746 0.000 0.920 0.080
#> ERR863729 2 0.1878 0.763 0.004 0.952 0.044
#> ERR863728 1 0.1765 0.873 0.956 0.004 0.040
#> ERR863731 1 0.0237 0.887 0.996 0.004 0.000
#> ERR863764 2 0.8058 0.400 0.072 0.552 0.376
#> ERR863740 1 0.4700 0.809 0.812 0.008 0.180
#> ERR863765 3 0.2711 0.790 0.088 0.000 0.912
#> ERR863762 3 0.3589 0.807 0.052 0.048 0.900
#> ERR863724 3 0.6935 0.364 0.372 0.024 0.604
#> ERR863733 2 0.6518 0.105 0.004 0.512 0.484
#> ERR863732 3 0.2229 0.802 0.012 0.044 0.944
#> ERR863730 1 0.4700 0.809 0.812 0.008 0.180
#> ERR863742 1 0.4755 0.806 0.808 0.008 0.184
#> ERR863763 2 0.8631 0.314 0.432 0.468 0.100
#> ERR863741 2 0.5492 0.725 0.104 0.816 0.080
#> ERR863743 1 0.0237 0.887 0.996 0.004 0.000
#> ERR863745 2 0.3764 0.803 0.068 0.892 0.040
#> ERR863744 1 0.3682 0.856 0.876 0.008 0.116
#> ERR863746 1 0.3129 0.870 0.904 0.008 0.088
#> ERR863748 3 0.5254 0.613 0.000 0.264 0.736
#> ERR863747 3 0.4974 0.699 0.000 0.236 0.764
#> ERR863694 2 0.5253 0.747 0.096 0.828 0.076
#> ERR863693 1 0.2636 0.861 0.932 0.020 0.048
#> ERR863686 1 0.5804 0.819 0.800 0.088 0.112
#> ERR863678 1 0.1878 0.873 0.952 0.004 0.044
#> ERR863685 3 0.2772 0.794 0.080 0.004 0.916
#> ERR863689 1 0.2116 0.869 0.948 0.012 0.040
#> ERR863691 1 0.2116 0.869 0.948 0.012 0.040
#> ERR863682 1 0.3888 0.865 0.888 0.064 0.048
#> ERR863695 2 0.3649 0.805 0.068 0.896 0.036
#> ERR863683 1 0.4700 0.809 0.812 0.008 0.180
#> ERR863684 1 0.3896 0.825 0.888 0.060 0.052
#> ERR863702 1 0.6431 0.784 0.760 0.084 0.156
#> ERR863687 3 0.4931 0.702 0.000 0.232 0.768
#> ERR863706 3 0.3425 0.769 0.112 0.004 0.884
#> ERR863708 2 0.3649 0.805 0.068 0.896 0.036
#> ERR863710 1 0.0000 0.888 1.000 0.000 0.000
#> ERR863709 2 0.4324 0.792 0.112 0.860 0.028
#> ERR863753 2 0.3649 0.805 0.068 0.896 0.036
#> ERR863754 1 0.2339 0.865 0.940 0.012 0.048
#> ERR863749 1 0.0592 0.889 0.988 0.000 0.012
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> ERR863675 4 0.8210 0.47436 0.240 0.324 0.016 0.420
#> ERR863705 3 0.1398 0.79282 0.000 0.040 0.956 0.004
#> ERR863704 2 0.1151 0.84719 0.000 0.968 0.008 0.024
#> ERR863679 3 0.1109 0.79588 0.000 0.028 0.968 0.004
#> ERR863680 2 0.0592 0.85145 0.000 0.984 0.016 0.000
#> ERR863676 2 0.1174 0.83497 0.020 0.968 0.000 0.012
#> ERR863677 4 0.8344 0.46034 0.272 0.292 0.020 0.416
#> ERR863688 1 0.5573 0.23924 0.508 0.004 0.012 0.476
#> ERR863690 1 0.2053 0.62108 0.924 0.000 0.004 0.072
#> ERR863692 1 0.5039 0.24204 0.592 0.000 0.004 0.404
#> ERR863703 1 0.2053 0.62108 0.924 0.000 0.004 0.072
#> ERR863712 4 0.8149 0.47913 0.256 0.312 0.012 0.420
#> ERR863711 1 0.0592 0.63871 0.984 0.000 0.000 0.016
#> ERR863760 2 0.3494 0.75647 0.000 0.824 0.004 0.172
#> ERR863727 1 0.4204 0.58893 0.788 0.000 0.020 0.192
#> ERR863766 3 0.2987 0.76254 0.016 0.000 0.880 0.104
#> ERR863767 1 0.1022 0.63402 0.968 0.000 0.000 0.032
#> ERR863752 2 0.2654 0.75575 0.000 0.888 0.108 0.004
#> ERR863757 4 0.5666 -0.27541 0.460 0.004 0.016 0.520
#> ERR863758 1 0.2011 0.62164 0.920 0.000 0.000 0.080
#> ERR863755 1 0.2773 0.62426 0.880 0.000 0.004 0.116
#> ERR863756 3 0.1004 0.79556 0.000 0.024 0.972 0.004
#> ERR863707 3 0.1109 0.79588 0.000 0.028 0.968 0.004
#> ERR863681 4 0.7773 -0.14694 0.184 0.008 0.360 0.448
#> ERR863719 4 0.3647 0.26158 0.152 0.000 0.016 0.832
#> ERR863759 3 0.3257 0.73795 0.000 0.152 0.844 0.004
#> ERR863718 1 0.2011 0.62164 0.920 0.000 0.000 0.080
#> ERR863717 1 0.1545 0.63736 0.952 0.000 0.008 0.040
#> ERR863715 2 0.4891 0.62510 0.000 0.680 0.012 0.308
#> ERR863716 1 0.3157 0.61626 0.852 0.000 0.004 0.144
#> ERR863722 3 0.8455 -0.13728 0.032 0.208 0.384 0.376
#> ERR863721 1 0.6305 0.05896 0.516 0.060 0.000 0.424
#> ERR863720 2 0.1297 0.83861 0.016 0.964 0.000 0.020
#> ERR863723 1 0.4245 0.58719 0.784 0.000 0.020 0.196
#> ERR863761 3 0.2983 0.76408 0.004 0.008 0.880 0.108
#> ERR863735 1 0.0336 0.63777 0.992 0.000 0.000 0.008
#> ERR863734 3 0.2987 0.76254 0.016 0.000 0.880 0.104
#> ERR863736 2 0.5386 0.58595 0.000 0.632 0.024 0.344
#> ERR863729 2 0.5069 0.61033 0.000 0.664 0.016 0.320
#> ERR863728 1 0.4991 0.25728 0.608 0.000 0.004 0.388
#> ERR863731 1 0.2011 0.62164 0.920 0.000 0.000 0.080
#> ERR863764 4 0.8652 0.20159 0.032 0.304 0.292 0.372
#> ERR863740 1 0.4692 0.57047 0.756 0.000 0.032 0.212
#> ERR863765 3 0.3441 0.74417 0.024 0.000 0.856 0.120
#> ERR863762 3 0.1377 0.79545 0.008 0.020 0.964 0.008
#> ERR863724 1 0.8020 -0.00856 0.364 0.004 0.360 0.272
#> ERR863733 3 0.7808 -0.07338 0.000 0.256 0.400 0.344
#> ERR863732 3 0.1362 0.79531 0.004 0.020 0.964 0.012
#> ERR863730 1 0.4485 0.57947 0.772 0.000 0.028 0.200
#> ERR863742 1 0.4764 0.56711 0.748 0.000 0.032 0.220
#> ERR863763 4 0.8165 0.46428 0.272 0.296 0.012 0.420
#> ERR863741 4 0.6013 -0.33859 0.016 0.460 0.016 0.508
#> ERR863743 1 0.1940 0.62203 0.924 0.000 0.000 0.076
#> ERR863745 2 0.0779 0.84995 0.000 0.980 0.016 0.004
#> ERR863744 1 0.3219 0.62384 0.868 0.000 0.020 0.112
#> ERR863746 1 0.4163 0.59139 0.792 0.000 0.020 0.188
#> ERR863748 3 0.6214 0.44149 0.000 0.092 0.636 0.272
#> ERR863747 3 0.3257 0.73795 0.000 0.152 0.844 0.004
#> ERR863694 4 0.5900 0.26589 0.040 0.292 0.012 0.656
#> ERR863693 1 0.5233 0.21158 0.580 0.004 0.004 0.412
#> ERR863686 1 0.5592 0.21322 0.496 0.008 0.008 0.488
#> ERR863678 1 0.4877 0.24366 0.592 0.000 0.000 0.408
#> ERR863685 3 0.2987 0.76254 0.016 0.000 0.880 0.104
#> ERR863689 1 0.5016 0.24721 0.600 0.000 0.004 0.396
#> ERR863691 1 0.5039 0.24204 0.592 0.000 0.004 0.404
#> ERR863682 1 0.3850 0.59713 0.804 0.004 0.004 0.188
#> ERR863695 2 0.0592 0.85145 0.000 0.984 0.016 0.000
#> ERR863683 1 0.4485 0.57947 0.772 0.000 0.028 0.200
#> ERR863684 1 0.6391 0.07956 0.528 0.056 0.004 0.412
#> ERR863702 1 0.5807 0.21269 0.492 0.008 0.016 0.484
#> ERR863687 3 0.3088 0.75218 0.000 0.128 0.864 0.008
#> ERR863706 3 0.5517 0.59025 0.092 0.000 0.724 0.184
#> ERR863708 2 0.0592 0.85145 0.000 0.984 0.016 0.000
#> ERR863710 1 0.2011 0.62164 0.920 0.000 0.000 0.080
#> ERR863709 2 0.1520 0.82560 0.024 0.956 0.000 0.020
#> ERR863753 2 0.0779 0.84995 0.000 0.980 0.016 0.004
#> ERR863754 1 0.5039 0.23104 0.592 0.000 0.004 0.404
#> ERR863749 1 0.0000 0.63832 1.000 0.000 0.000 0.000
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> ERR863675 4 0.5072 0.7620 0.116 0.188 0.000 0.696 0.000
#> ERR863705 3 0.0932 0.8109 0.000 0.020 0.972 0.004 0.004
#> ERR863704 2 0.1124 0.8649 0.000 0.960 0.000 0.036 0.004
#> ERR863679 3 0.0833 0.8122 0.000 0.016 0.976 0.004 0.004
#> ERR863680 2 0.0162 0.8843 0.000 0.996 0.000 0.000 0.004
#> ERR863676 2 0.0000 0.8849 0.000 1.000 0.000 0.000 0.000
#> ERR863677 4 0.5016 0.7659 0.120 0.176 0.000 0.704 0.000
#> ERR863688 5 0.4940 0.3240 0.304 0.000 0.020 0.020 0.656
#> ERR863690 1 0.0955 0.6393 0.968 0.000 0.000 0.028 0.004
#> ERR863692 1 0.4731 -0.1485 0.528 0.000 0.000 0.456 0.016
#> ERR863703 1 0.0703 0.6401 0.976 0.000 0.000 0.024 0.000
#> ERR863712 4 0.4971 0.7658 0.116 0.176 0.000 0.708 0.000
#> ERR863711 1 0.0510 0.6383 0.984 0.000 0.000 0.000 0.016
#> ERR863760 2 0.5584 0.4035 0.000 0.584 0.000 0.092 0.324
#> ERR863727 1 0.5873 0.3823 0.576 0.000 0.020 0.068 0.336
#> ERR863766 3 0.3992 0.7431 0.000 0.000 0.796 0.080 0.124
#> ERR863767 1 0.0833 0.6382 0.976 0.000 0.004 0.004 0.016
#> ERR863752 2 0.2017 0.8008 0.000 0.912 0.080 0.008 0.000
#> ERR863757 5 0.3858 0.5323 0.156 0.000 0.016 0.024 0.804
#> ERR863758 1 0.1041 0.6392 0.964 0.000 0.000 0.032 0.004
#> ERR863755 1 0.3671 0.5401 0.756 0.000 0.000 0.008 0.236
#> ERR863756 3 0.0404 0.8131 0.000 0.000 0.988 0.012 0.000
#> ERR863707 3 0.0566 0.8135 0.000 0.012 0.984 0.004 0.000
#> ERR863681 5 0.6060 0.1950 0.020 0.000 0.244 0.120 0.616
#> ERR863719 4 0.4583 0.5390 0.036 0.000 0.004 0.704 0.256
#> ERR863759 3 0.2771 0.7490 0.000 0.128 0.860 0.012 0.000
#> ERR863718 1 0.1041 0.6392 0.964 0.000 0.000 0.032 0.004
#> ERR863717 1 0.3461 0.5803 0.812 0.000 0.004 0.016 0.168
#> ERR863715 2 0.6180 0.0614 0.000 0.460 0.000 0.136 0.404
#> ERR863716 1 0.4090 0.5138 0.716 0.000 0.000 0.016 0.268
#> ERR863722 4 0.6384 0.5553 0.012 0.100 0.320 0.556 0.012
#> ERR863721 4 0.4363 0.6626 0.268 0.016 0.000 0.708 0.008
#> ERR863720 2 0.1012 0.8730 0.000 0.968 0.000 0.012 0.020
#> ERR863723 1 0.5858 0.3652 0.568 0.000 0.020 0.064 0.348
#> ERR863761 3 0.4482 0.7287 0.000 0.000 0.752 0.088 0.160
#> ERR863735 1 0.0451 0.6393 0.988 0.000 0.000 0.004 0.008
#> ERR863734 3 0.3992 0.7431 0.000 0.000 0.796 0.080 0.124
#> ERR863736 5 0.6166 0.1297 0.000 0.292 0.008 0.136 0.564
#> ERR863729 5 0.6223 0.0544 0.000 0.328 0.000 0.160 0.512
#> ERR863728 1 0.4444 0.0760 0.624 0.000 0.000 0.364 0.012
#> ERR863731 1 0.1041 0.6392 0.964 0.000 0.000 0.032 0.004
#> ERR863764 4 0.6412 0.6166 0.012 0.124 0.268 0.584 0.012
#> ERR863740 1 0.6361 0.2930 0.516 0.000 0.024 0.096 0.364
#> ERR863765 3 0.4412 0.7038 0.000 0.000 0.756 0.080 0.164
#> ERR863762 3 0.0324 0.8137 0.000 0.000 0.992 0.004 0.004
#> ERR863724 5 0.8127 0.2109 0.204 0.000 0.260 0.132 0.404
#> ERR863733 4 0.6212 0.5314 0.000 0.116 0.328 0.544 0.012
#> ERR863732 3 0.0324 0.8137 0.000 0.000 0.992 0.004 0.004
#> ERR863730 1 0.6333 0.3128 0.528 0.000 0.024 0.096 0.352
#> ERR863742 1 0.6430 0.2543 0.496 0.000 0.028 0.092 0.384
#> ERR863763 4 0.4989 0.7667 0.124 0.168 0.000 0.708 0.000
#> ERR863741 5 0.7131 0.2209 0.048 0.212 0.000 0.220 0.520
#> ERR863743 1 0.0955 0.6393 0.968 0.000 0.000 0.028 0.004
#> ERR863745 2 0.0000 0.8849 0.000 1.000 0.000 0.000 0.000
#> ERR863744 1 0.4993 0.5174 0.708 0.000 0.020 0.048 0.224
#> ERR863746 1 0.5764 0.3923 0.584 0.000 0.020 0.060 0.336
#> ERR863748 3 0.5483 0.2129 0.000 0.048 0.604 0.332 0.016
#> ERR863747 3 0.2625 0.7633 0.000 0.108 0.876 0.016 0.000
#> ERR863694 4 0.5237 0.6691 0.028 0.108 0.000 0.728 0.136
#> ERR863693 4 0.3876 0.6029 0.316 0.000 0.000 0.684 0.000
#> ERR863686 5 0.4876 0.5077 0.216 0.000 0.012 0.056 0.716
#> ERR863678 1 0.4430 0.0998 0.628 0.000 0.000 0.360 0.012
#> ERR863685 3 0.3992 0.7431 0.000 0.000 0.796 0.080 0.124
#> ERR863689 1 0.4620 0.0139 0.592 0.000 0.000 0.392 0.016
#> ERR863691 1 0.4731 -0.1562 0.528 0.000 0.000 0.456 0.016
#> ERR863682 1 0.4747 0.4056 0.636 0.000 0.000 0.032 0.332
#> ERR863695 2 0.0324 0.8836 0.000 0.992 0.000 0.004 0.004
#> ERR863683 1 0.6289 0.3356 0.544 0.000 0.024 0.096 0.336
#> ERR863684 4 0.4313 0.6566 0.276 0.012 0.000 0.704 0.008
#> ERR863702 5 0.4704 0.5008 0.216 0.000 0.016 0.040 0.728
#> ERR863687 3 0.2339 0.7738 0.000 0.100 0.892 0.004 0.004
#> ERR863706 3 0.5904 0.4507 0.020 0.000 0.604 0.084 0.292
#> ERR863708 2 0.0000 0.8849 0.000 1.000 0.000 0.000 0.000
#> ERR863710 1 0.1041 0.6392 0.964 0.000 0.000 0.032 0.004
#> ERR863709 2 0.0693 0.8759 0.000 0.980 0.000 0.012 0.008
#> ERR863753 2 0.0000 0.8849 0.000 1.000 0.000 0.000 0.000
#> ERR863754 1 0.4262 -0.1249 0.560 0.000 0.000 0.440 0.000
#> ERR863749 1 0.0000 0.6394 1.000 0.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
#> ERR863675 4 0.3765 0.7786 0.076 0.084 0.016 0.816 0.000 0.008
#> ERR863705 3 0.0405 0.8148 0.000 0.000 0.988 0.000 0.004 0.008
#> ERR863704 2 0.3077 0.7679 0.000 0.852 0.000 0.052 0.084 0.012
#> ERR863679 3 0.0405 0.8148 0.000 0.000 0.988 0.000 0.004 0.008
#> ERR863680 2 0.0551 0.8888 0.000 0.984 0.004 0.004 0.008 0.000
#> ERR863676 2 0.0551 0.8859 0.000 0.984 0.000 0.008 0.004 0.004
#> ERR863677 4 0.3802 0.7805 0.076 0.076 0.016 0.820 0.004 0.008
#> ERR863688 6 0.5242 0.4790 0.116 0.004 0.000 0.004 0.256 0.620
#> ERR863690 1 0.1148 0.7569 0.960 0.000 0.000 0.004 0.020 0.016
#> ERR863692 1 0.5848 0.1974 0.512 0.004 0.000 0.376 0.052 0.056
#> ERR863703 1 0.1074 0.7563 0.960 0.000 0.000 0.000 0.028 0.012
#> ERR863712 4 0.3668 0.7793 0.084 0.084 0.012 0.816 0.000 0.004
#> ERR863711 1 0.1719 0.7358 0.924 0.000 0.000 0.000 0.016 0.060
#> ERR863760 2 0.5757 -0.2362 0.000 0.456 0.000 0.068 0.436 0.040
#> ERR863727 6 0.3390 0.6325 0.296 0.000 0.000 0.000 0.000 0.704
#> ERR863766 3 0.4749 0.6927 0.000 0.000 0.708 0.028 0.072 0.192
#> ERR863767 1 0.1946 0.7288 0.912 0.004 0.000 0.000 0.012 0.072
#> ERR863752 2 0.2126 0.7940 0.000 0.904 0.072 0.004 0.000 0.020
#> ERR863757 6 0.4621 0.2855 0.024 0.000 0.000 0.016 0.356 0.604
#> ERR863758 1 0.0951 0.7602 0.968 0.000 0.000 0.004 0.008 0.020
#> ERR863755 6 0.4310 0.3960 0.472 0.004 0.000 0.000 0.012 0.512
#> ERR863756 3 0.0508 0.8104 0.000 0.000 0.984 0.004 0.000 0.012
#> ERR863707 3 0.0000 0.8138 0.000 0.000 1.000 0.000 0.000 0.000
#> ERR863681 6 0.7034 -0.0903 0.000 0.004 0.168 0.084 0.328 0.416
#> ERR863719 4 0.3935 0.6697 0.004 0.000 0.016 0.788 0.052 0.140
#> ERR863759 3 0.2290 0.7636 0.000 0.084 0.892 0.004 0.000 0.020
#> ERR863718 1 0.1053 0.7598 0.964 0.000 0.000 0.004 0.012 0.020
#> ERR863717 1 0.4222 -0.3107 0.516 0.004 0.000 0.000 0.008 0.472
#> ERR863715 5 0.5245 0.6697 0.000 0.324 0.008 0.016 0.596 0.056
#> ERR863716 6 0.3944 0.5002 0.428 0.000 0.000 0.004 0.000 0.568
#> ERR863722 4 0.6749 0.4683 0.008 0.056 0.352 0.488 0.048 0.048
#> ERR863721 4 0.3053 0.7303 0.172 0.000 0.000 0.812 0.004 0.012
#> ERR863720 2 0.1078 0.8789 0.000 0.964 0.000 0.012 0.016 0.008
#> ERR863723 6 0.3827 0.6279 0.308 0.000 0.000 0.004 0.008 0.680
#> ERR863761 3 0.6185 0.5832 0.000 0.000 0.592 0.084 0.164 0.160
#> ERR863735 1 0.1578 0.7437 0.936 0.004 0.000 0.000 0.012 0.048
#> ERR863734 3 0.4697 0.6945 0.000 0.000 0.712 0.028 0.068 0.192
#> ERR863736 5 0.4780 0.7560 0.000 0.144 0.004 0.064 0.736 0.052
#> ERR863729 5 0.4221 0.8197 0.000 0.172 0.004 0.016 0.756 0.052
#> ERR863728 1 0.4720 0.6255 0.732 0.004 0.000 0.164 0.056 0.044
#> ERR863731 1 0.0964 0.7604 0.968 0.000 0.000 0.004 0.012 0.016
#> ERR863764 4 0.6624 0.5448 0.008 0.060 0.304 0.536 0.048 0.044
#> ERR863740 6 0.3163 0.6544 0.232 0.000 0.000 0.000 0.004 0.764
#> ERR863765 3 0.5030 0.6455 0.000 0.000 0.660 0.028 0.068 0.244
#> ERR863762 3 0.0405 0.8148 0.000 0.000 0.988 0.000 0.004 0.008
#> ERR863724 6 0.6821 0.3201 0.052 0.004 0.168 0.076 0.108 0.592
#> ERR863733 4 0.6603 0.4282 0.000 0.056 0.372 0.472 0.048 0.052
#> ERR863732 3 0.0405 0.8148 0.000 0.000 0.988 0.000 0.004 0.008
#> ERR863730 6 0.2996 0.6547 0.228 0.000 0.000 0.000 0.000 0.772
#> ERR863742 6 0.4464 0.6331 0.228 0.000 0.000 0.024 0.040 0.708
#> ERR863763 4 0.3527 0.7797 0.084 0.084 0.012 0.820 0.000 0.000
#> ERR863741 5 0.4375 0.7875 0.032 0.084 0.000 0.036 0.792 0.056
#> ERR863743 1 0.1232 0.7579 0.956 0.000 0.000 0.004 0.016 0.024
#> ERR863745 2 0.0291 0.8881 0.000 0.992 0.004 0.000 0.000 0.004
#> ERR863744 6 0.4442 0.4204 0.440 0.004 0.000 0.000 0.020 0.536
#> ERR863746 6 0.3464 0.6215 0.312 0.000 0.000 0.000 0.000 0.688
#> ERR863748 3 0.5459 0.3706 0.000 0.012 0.652 0.232 0.048 0.056
#> ERR863747 3 0.2538 0.7691 0.000 0.068 0.892 0.012 0.008 0.020
#> ERR863694 4 0.4286 0.7203 0.020 0.072 0.008 0.796 0.088 0.016
#> ERR863693 4 0.3546 0.7080 0.196 0.000 0.000 0.776 0.016 0.012
#> ERR863686 6 0.4894 0.2019 0.052 0.000 0.000 0.004 0.412 0.532
#> ERR863678 1 0.4786 0.6270 0.724 0.004 0.000 0.172 0.056 0.044
#> ERR863685 3 0.4749 0.6927 0.000 0.000 0.708 0.028 0.072 0.192
#> ERR863689 1 0.5001 0.5920 0.700 0.004 0.000 0.192 0.052 0.052
#> ERR863691 1 0.5804 0.1971 0.512 0.004 0.000 0.380 0.052 0.052
#> ERR863682 6 0.5207 0.4499 0.432 0.000 0.000 0.008 0.068 0.492
#> ERR863695 2 0.0696 0.8866 0.004 0.980 0.008 0.004 0.004 0.000
#> ERR863683 6 0.3076 0.6535 0.240 0.000 0.000 0.000 0.000 0.760
#> ERR863684 4 0.3354 0.7241 0.184 0.000 0.000 0.792 0.008 0.016
#> ERR863702 6 0.4776 0.3029 0.052 0.000 0.000 0.004 0.356 0.588
#> ERR863687 3 0.2125 0.7801 0.000 0.068 0.908 0.004 0.004 0.016
#> ERR863706 6 0.5713 -0.1731 0.000 0.000 0.412 0.032 0.076 0.480
#> ERR863708 2 0.0146 0.8887 0.000 0.996 0.004 0.000 0.000 0.000
#> ERR863710 1 0.1053 0.7598 0.964 0.000 0.000 0.004 0.012 0.020
#> ERR863709 2 0.1232 0.8723 0.000 0.956 0.000 0.016 0.024 0.004
#> ERR863753 2 0.0291 0.8886 0.000 0.992 0.004 0.000 0.000 0.004
#> ERR863754 1 0.4383 0.5525 0.696 0.000 0.000 0.252 0.036 0.016
#> ERR863749 1 0.1461 0.7495 0.940 0.000 0.000 0.000 0.016 0.044
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)
An example of the output of tb
is:
#> which_row fdr mean_1 mean_2 scaled_mean_1 scaled_mean_2 km
#> 1 38 0.042760348 8.373488 9.131774 -0.5533452 0.5164555 1
#> 2 40 0.018707592 7.106213 8.469186 -0.6173731 0.5762149 1
#> 3 55 0.019134737 10.221463 11.207825 -0.6159697 0.5749050 1
#> 4 59 0.006059896 5.921854 7.869574 -0.6899429 0.6439467 1
#> 5 60 0.018055526 8.928898 10.211722 -0.6204761 0.5791110 1
#> 6 98 0.009384629 15.714769 14.887706 0.6635654 -0.6193277 2
...
The columns in tb
are:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.km
: Row groups if k-means clustering is applied to rows.UMAP plot which shows how samples are separated.
dimension_reduction(res, k = 2, method = "UMAP")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
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 17118 rows and 78 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 0.842 0.870 0.950 0.5051 0.495 0.495
#> 3 3 0.687 0.846 0.921 0.3093 0.763 0.558
#> 4 4 0.590 0.446 0.701 0.1310 0.892 0.712
#> 5 5 0.692 0.673 0.791 0.0731 0.809 0.443
#> 6 6 0.747 0.581 0.774 0.0407 0.928 0.664
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
#> ERR863675 2 0.0376 0.9443 0.004 0.996
#> ERR863705 2 0.0000 0.9446 0.000 1.000
#> ERR863704 2 0.0376 0.9443 0.004 0.996
#> ERR863679 2 0.0000 0.9446 0.000 1.000
#> ERR863680 2 0.0376 0.9443 0.004 0.996
#> ERR863676 2 0.0376 0.9443 0.004 0.996
#> ERR863677 2 0.4815 0.8592 0.104 0.896
#> ERR863688 1 0.0376 0.9414 0.996 0.004
#> ERR863690 1 0.0000 0.9427 1.000 0.000
#> ERR863692 1 0.0000 0.9427 1.000 0.000
#> ERR863703 1 0.0000 0.9427 1.000 0.000
#> ERR863712 2 0.9686 0.3442 0.396 0.604
#> ERR863711 1 0.0000 0.9427 1.000 0.000
#> ERR863760 2 0.0376 0.9443 0.004 0.996
#> ERR863727 1 0.0376 0.9414 0.996 0.004
#> ERR863766 2 0.9998 -0.0379 0.492 0.508
#> ERR863767 1 0.0000 0.9427 1.000 0.000
#> ERR863752 2 0.0000 0.9446 0.000 1.000
#> ERR863757 1 0.0376 0.9414 0.996 0.004
#> ERR863758 1 0.0000 0.9427 1.000 0.000
#> ERR863755 1 0.0000 0.9427 1.000 0.000
#> ERR863756 2 0.0000 0.9446 0.000 1.000
#> ERR863707 2 0.0000 0.9446 0.000 1.000
#> ERR863681 2 0.2236 0.9200 0.036 0.964
#> ERR863719 1 0.9129 0.5101 0.672 0.328
#> ERR863759 2 0.0000 0.9446 0.000 1.000
#> ERR863718 1 0.0000 0.9427 1.000 0.000
#> ERR863717 1 0.0000 0.9427 1.000 0.000
#> ERR863715 2 0.0000 0.9446 0.000 1.000
#> ERR863716 1 0.0000 0.9427 1.000 0.000
#> ERR863722 2 0.0376 0.9443 0.004 0.996
#> ERR863721 1 0.0000 0.9427 1.000 0.000
#> ERR863720 2 0.0376 0.9443 0.004 0.996
#> ERR863723 1 0.0376 0.9414 0.996 0.004
#> ERR863761 2 0.0000 0.9446 0.000 1.000
#> ERR863735 1 0.0000 0.9427 1.000 0.000
#> ERR863734 2 0.9522 0.3638 0.372 0.628
#> ERR863736 2 0.0000 0.9446 0.000 1.000
#> ERR863729 2 0.0000 0.9446 0.000 1.000
#> ERR863728 1 0.1184 0.9306 0.984 0.016
#> ERR863731 1 0.0000 0.9427 1.000 0.000
#> ERR863764 2 0.0376 0.9443 0.004 0.996
#> ERR863740 1 0.0376 0.9414 0.996 0.004
#> ERR863765 1 0.9732 0.3392 0.596 0.404
#> ERR863762 2 0.0376 0.9429 0.004 0.996
#> ERR863724 1 0.9552 0.4093 0.624 0.376
#> ERR863733 2 0.0000 0.9446 0.000 1.000
#> ERR863732 2 0.0000 0.9446 0.000 1.000
#> ERR863730 1 0.0376 0.9414 0.996 0.004
#> ERR863742 1 0.0376 0.9414 0.996 0.004
#> ERR863763 2 0.6531 0.7818 0.168 0.832
#> ERR863741 1 0.9993 0.0128 0.516 0.484
#> ERR863743 1 0.0000 0.9427 1.000 0.000
#> ERR863745 2 0.0376 0.9443 0.004 0.996
#> ERR863744 1 0.0376 0.9414 0.996 0.004
#> ERR863746 1 0.0000 0.9427 1.000 0.000
#> ERR863748 2 0.0000 0.9446 0.000 1.000
#> ERR863747 2 0.0000 0.9446 0.000 1.000
#> ERR863694 2 0.4161 0.8800 0.084 0.916
#> ERR863693 1 0.0000 0.9427 1.000 0.000
#> ERR863686 1 0.0376 0.9414 0.996 0.004
#> ERR863678 1 0.3274 0.8882 0.940 0.060
#> ERR863685 2 0.2423 0.9166 0.040 0.960
#> ERR863689 1 0.0000 0.9427 1.000 0.000
#> ERR863691 1 0.0000 0.9427 1.000 0.000
#> ERR863682 1 0.0000 0.9427 1.000 0.000
#> ERR863695 2 0.0376 0.9443 0.004 0.996
#> ERR863683 1 0.0376 0.9414 0.996 0.004
#> ERR863684 1 0.0000 0.9427 1.000 0.000
#> ERR863702 1 0.0376 0.9414 0.996 0.004
#> ERR863687 2 0.0000 0.9446 0.000 1.000
#> ERR863706 1 0.9686 0.3603 0.604 0.396
#> ERR863708 2 0.0376 0.9443 0.004 0.996
#> ERR863710 1 0.0000 0.9427 1.000 0.000
#> ERR863709 2 0.3733 0.8923 0.072 0.928
#> ERR863753 2 0.0376 0.9443 0.004 0.996
#> ERR863754 1 0.0000 0.9427 1.000 0.000
#> ERR863749 1 0.0000 0.9427 1.000 0.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> ERR863675 2 0.0000 0.917 0.000 1.000 0.000
#> ERR863705 3 0.2356 0.852 0.000 0.072 0.928
#> ERR863704 2 0.0000 0.917 0.000 1.000 0.000
#> ERR863679 3 0.0747 0.878 0.000 0.016 0.984
#> ERR863680 2 0.0000 0.917 0.000 1.000 0.000
#> ERR863676 2 0.0000 0.917 0.000 1.000 0.000
#> ERR863677 2 0.0000 0.917 0.000 1.000 0.000
#> ERR863688 1 0.3816 0.866 0.852 0.000 0.148
#> ERR863690 1 0.0000 0.919 1.000 0.000 0.000
#> ERR863692 1 0.0000 0.919 1.000 0.000 0.000
#> ERR863703 1 0.0000 0.919 1.000 0.000 0.000
#> ERR863712 2 0.0000 0.917 0.000 1.000 0.000
#> ERR863711 1 0.0000 0.919 1.000 0.000 0.000
#> ERR863760 2 0.0000 0.917 0.000 1.000 0.000
#> ERR863727 1 0.3879 0.863 0.848 0.000 0.152
#> ERR863766 3 0.0000 0.881 0.000 0.000 1.000
#> ERR863767 1 0.0000 0.919 1.000 0.000 0.000
#> ERR863752 2 0.2711 0.849 0.000 0.912 0.088
#> ERR863757 1 0.4399 0.834 0.812 0.000 0.188
#> ERR863758 1 0.0000 0.919 1.000 0.000 0.000
#> ERR863755 1 0.0000 0.919 1.000 0.000 0.000
#> ERR863756 3 0.0000 0.881 0.000 0.000 1.000
#> ERR863707 3 0.0424 0.880 0.000 0.008 0.992
#> ERR863681 3 0.4121 0.791 0.000 0.168 0.832
#> ERR863719 3 0.3293 0.826 0.012 0.088 0.900
#> ERR863759 3 0.4555 0.752 0.000 0.200 0.800
#> ERR863718 1 0.0000 0.919 1.000 0.000 0.000
#> ERR863717 1 0.0000 0.919 1.000 0.000 0.000
#> ERR863715 2 0.2448 0.861 0.000 0.924 0.076
#> ERR863716 1 0.0000 0.919 1.000 0.000 0.000
#> ERR863722 3 0.6295 0.215 0.000 0.472 0.528
#> ERR863721 2 0.4654 0.707 0.208 0.792 0.000
#> ERR863720 2 0.0000 0.917 0.000 1.000 0.000
#> ERR863723 1 0.3941 0.861 0.844 0.000 0.156
#> ERR863761 3 0.0424 0.880 0.000 0.008 0.992
#> ERR863735 1 0.0000 0.919 1.000 0.000 0.000
#> ERR863734 3 0.0000 0.881 0.000 0.000 1.000
#> ERR863736 2 0.5497 0.548 0.000 0.708 0.292
#> ERR863729 2 0.2448 0.861 0.000 0.924 0.076
#> ERR863728 1 0.5408 0.785 0.812 0.136 0.052
#> ERR863731 1 0.0000 0.919 1.000 0.000 0.000
#> ERR863764 2 0.2711 0.852 0.000 0.912 0.088
#> ERR863740 1 0.4002 0.858 0.840 0.000 0.160
#> ERR863765 3 0.0000 0.881 0.000 0.000 1.000
#> ERR863762 3 0.0000 0.881 0.000 0.000 1.000
#> ERR863724 3 0.4887 0.635 0.228 0.000 0.772
#> ERR863733 2 0.6126 0.215 0.000 0.600 0.400
#> ERR863732 3 0.0000 0.881 0.000 0.000 1.000
#> ERR863730 1 0.4002 0.858 0.840 0.000 0.160
#> ERR863742 1 0.4452 0.830 0.808 0.000 0.192
#> ERR863763 2 0.0000 0.917 0.000 1.000 0.000
#> ERR863741 2 0.2711 0.846 0.088 0.912 0.000
#> ERR863743 1 0.0000 0.919 1.000 0.000 0.000
#> ERR863745 2 0.0000 0.917 0.000 1.000 0.000
#> ERR863744 1 0.3879 0.865 0.848 0.000 0.152
#> ERR863746 1 0.2165 0.903 0.936 0.000 0.064
#> ERR863748 3 0.5650 0.597 0.000 0.312 0.688
#> ERR863747 3 0.4555 0.752 0.000 0.200 0.800
#> ERR863694 2 0.0000 0.917 0.000 1.000 0.000
#> ERR863693 1 0.3340 0.842 0.880 0.120 0.000
#> ERR863686 1 0.4232 0.882 0.872 0.044 0.084
#> ERR863678 1 0.5635 0.742 0.784 0.180 0.036
#> ERR863685 3 0.0000 0.881 0.000 0.000 1.000
#> ERR863689 1 0.2165 0.884 0.936 0.064 0.000
#> ERR863691 1 0.3482 0.834 0.872 0.128 0.000
#> ERR863682 1 0.0000 0.919 1.000 0.000 0.000
#> ERR863695 2 0.0000 0.917 0.000 1.000 0.000
#> ERR863683 1 0.4002 0.858 0.840 0.000 0.160
#> ERR863684 2 0.5138 0.652 0.252 0.748 0.000
#> ERR863702 1 0.5236 0.836 0.804 0.028 0.168
#> ERR863687 3 0.4605 0.748 0.000 0.204 0.796
#> ERR863706 3 0.0000 0.881 0.000 0.000 1.000
#> ERR863708 2 0.0000 0.917 0.000 1.000 0.000
#> ERR863710 1 0.0000 0.919 1.000 0.000 0.000
#> ERR863709 2 0.0000 0.917 0.000 1.000 0.000
#> ERR863753 2 0.0000 0.917 0.000 1.000 0.000
#> ERR863754 1 0.0592 0.915 0.988 0.012 0.000
#> ERR863749 1 0.0000 0.919 1.000 0.000 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> ERR863675 2 0.0000 0.2615 0.000 1.000 0.000 0.000
#> ERR863705 3 0.0817 0.8460 0.000 0.000 0.976 0.024
#> ERR863704 2 0.4933 -0.2959 0.000 0.568 0.000 0.432
#> ERR863679 3 0.0817 0.8460 0.000 0.000 0.976 0.024
#> ERR863680 2 0.4790 -0.1344 0.000 0.620 0.000 0.380
#> ERR863676 2 0.4790 -0.1344 0.000 0.620 0.000 0.380
#> ERR863677 2 0.0336 0.2679 0.000 0.992 0.000 0.008
#> ERR863688 1 0.5271 0.4084 0.656 0.000 0.024 0.320
#> ERR863690 1 0.4697 0.6627 0.696 0.008 0.000 0.296
#> ERR863692 1 0.7890 0.2657 0.376 0.328 0.000 0.296
#> ERR863703 1 0.4697 0.6627 0.696 0.008 0.000 0.296
#> ERR863712 2 0.0336 0.2678 0.000 0.992 0.000 0.008
#> ERR863711 1 0.4356 0.6655 0.708 0.000 0.000 0.292
#> ERR863760 4 0.4679 0.8277 0.000 0.352 0.000 0.648
#> ERR863727 1 0.3856 0.5937 0.832 0.000 0.032 0.136
#> ERR863766 3 0.0895 0.8475 0.020 0.000 0.976 0.004
#> ERR863767 1 0.4560 0.6639 0.700 0.004 0.000 0.296
#> ERR863752 2 0.5936 -0.1575 0.000 0.576 0.044 0.380
#> ERR863757 1 0.5291 0.4055 0.652 0.000 0.024 0.324
#> ERR863758 1 0.4697 0.6627 0.696 0.008 0.000 0.296
#> ERR863755 1 0.2216 0.6655 0.908 0.000 0.000 0.092
#> ERR863756 3 0.0469 0.8481 0.000 0.012 0.988 0.000
#> ERR863707 3 0.0707 0.8475 0.000 0.000 0.980 0.020
#> ERR863681 3 0.7191 0.5719 0.180 0.020 0.616 0.184
#> ERR863719 2 0.8375 -0.0925 0.304 0.356 0.016 0.324
#> ERR863759 3 0.5321 0.6741 0.000 0.112 0.748 0.140
#> ERR863718 1 0.4697 0.6627 0.696 0.008 0.000 0.296
#> ERR863717 1 0.3105 0.6723 0.856 0.004 0.000 0.140
#> ERR863715 4 0.4406 0.8911 0.000 0.300 0.000 0.700
#> ERR863716 1 0.3123 0.6063 0.844 0.000 0.000 0.156
#> ERR863722 2 0.4950 0.0677 0.000 0.620 0.376 0.004
#> ERR863721 2 0.6792 0.1824 0.140 0.588 0.000 0.272
#> ERR863720 2 0.4790 -0.1344 0.000 0.620 0.000 0.380
#> ERR863723 1 0.4225 0.5597 0.792 0.000 0.024 0.184
#> ERR863761 3 0.1624 0.8488 0.020 0.000 0.952 0.028
#> ERR863735 1 0.4382 0.6649 0.704 0.000 0.000 0.296
#> ERR863734 3 0.0895 0.8475 0.020 0.000 0.976 0.004
#> ERR863736 4 0.6052 0.7856 0.004 0.224 0.092 0.680
#> ERR863729 4 0.4406 0.8911 0.000 0.300 0.000 0.700
#> ERR863728 2 0.7846 -0.1671 0.300 0.404 0.000 0.296
#> ERR863731 1 0.4697 0.6627 0.696 0.008 0.000 0.296
#> ERR863764 2 0.3355 0.2646 0.000 0.836 0.160 0.004
#> ERR863740 1 0.3390 0.6023 0.852 0.000 0.132 0.016
#> ERR863765 3 0.1902 0.8246 0.064 0.000 0.932 0.004
#> ERR863762 3 0.0000 0.8497 0.000 0.000 1.000 0.000
#> ERR863724 3 0.5691 0.3359 0.408 0.000 0.564 0.028
#> ERR863733 2 0.4542 0.2337 0.000 0.752 0.228 0.020
#> ERR863732 3 0.0336 0.8491 0.000 0.008 0.992 0.000
#> ERR863730 1 0.3390 0.6023 0.852 0.000 0.132 0.016
#> ERR863742 1 0.3105 0.6001 0.856 0.000 0.140 0.004
#> ERR863763 2 0.1637 0.2853 0.000 0.940 0.000 0.060
#> ERR863741 4 0.5349 0.8253 0.024 0.336 0.000 0.640
#> ERR863743 1 0.4697 0.6627 0.696 0.008 0.000 0.296
#> ERR863745 2 0.4790 -0.1344 0.000 0.620 0.000 0.380
#> ERR863744 1 0.3858 0.6534 0.844 0.000 0.100 0.056
#> ERR863746 1 0.1004 0.6591 0.972 0.000 0.024 0.004
#> ERR863748 3 0.5436 0.4767 0.000 0.356 0.620 0.024
#> ERR863747 3 0.5314 0.6745 0.000 0.108 0.748 0.144
#> ERR863694 2 0.4356 -0.1299 0.000 0.708 0.000 0.292
#> ERR863693 2 0.7580 -0.0357 0.228 0.476 0.000 0.296
#> ERR863686 1 0.5291 0.4055 0.652 0.000 0.024 0.324
#> ERR863678 1 0.8818 0.1916 0.328 0.320 0.040 0.312
#> ERR863685 3 0.0895 0.8475 0.020 0.000 0.976 0.004
#> ERR863689 1 0.7890 0.2652 0.376 0.328 0.000 0.296
#> ERR863691 2 0.7837 -0.1630 0.296 0.408 0.000 0.296
#> ERR863682 1 0.4072 0.5421 0.748 0.000 0.000 0.252
#> ERR863695 2 0.4790 -0.1344 0.000 0.620 0.000 0.380
#> ERR863683 1 0.3142 0.6052 0.860 0.000 0.132 0.008
#> ERR863684 2 0.5933 0.1708 0.036 0.500 0.000 0.464
#> ERR863702 1 0.5291 0.4055 0.652 0.000 0.024 0.324
#> ERR863687 3 0.5140 0.6885 0.000 0.096 0.760 0.144
#> ERR863706 3 0.3300 0.7576 0.144 0.000 0.848 0.008
#> ERR863708 2 0.4790 -0.1344 0.000 0.620 0.000 0.380
#> ERR863710 1 0.4697 0.6627 0.696 0.008 0.000 0.296
#> ERR863709 2 0.4746 -0.1326 0.000 0.632 0.000 0.368
#> ERR863753 2 0.4790 -0.1344 0.000 0.620 0.000 0.380
#> ERR863754 1 0.7902 0.2222 0.352 0.352 0.000 0.296
#> ERR863749 1 0.4382 0.6649 0.704 0.000 0.000 0.296
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> ERR863675 4 0.3366 0.7354 0.000 0.232 0.000 0.768 0.000
#> ERR863705 3 0.0000 0.7965 0.000 0.000 1.000 0.000 0.000
#> ERR863704 2 0.0162 0.8418 0.000 0.996 0.000 0.000 0.004
#> ERR863679 3 0.0000 0.7965 0.000 0.000 1.000 0.000 0.000
#> ERR863680 2 0.0000 0.8422 0.000 1.000 0.000 0.000 0.000
#> ERR863676 2 0.0000 0.8422 0.000 1.000 0.000 0.000 0.000
#> ERR863677 4 0.3274 0.7432 0.000 0.220 0.000 0.780 0.000
#> ERR863688 5 0.3656 0.6416 0.020 0.000 0.000 0.196 0.784
#> ERR863690 1 0.1117 0.8410 0.964 0.000 0.000 0.020 0.016
#> ERR863692 1 0.4656 0.1734 0.508 0.000 0.000 0.480 0.012
#> ERR863703 1 0.1012 0.8419 0.968 0.000 0.000 0.012 0.020
#> ERR863712 4 0.3487 0.7476 0.008 0.212 0.000 0.780 0.000
#> ERR863711 1 0.1671 0.7947 0.924 0.000 0.000 0.000 0.076
#> ERR863760 2 0.4219 0.7416 0.000 0.772 0.000 0.156 0.072
#> ERR863727 5 0.2605 0.7436 0.148 0.000 0.000 0.000 0.852
#> ERR863766 3 0.3171 0.7429 0.000 0.000 0.816 0.008 0.176
#> ERR863767 1 0.1478 0.8109 0.936 0.000 0.000 0.000 0.064
#> ERR863752 2 0.1952 0.7774 0.000 0.912 0.084 0.004 0.000
#> ERR863757 5 0.3562 0.6361 0.016 0.000 0.000 0.196 0.788
#> ERR863758 1 0.0290 0.8429 0.992 0.000 0.000 0.000 0.008
#> ERR863755 5 0.5261 0.4209 0.424 0.000 0.000 0.048 0.528
#> ERR863756 3 0.0000 0.7965 0.000 0.000 1.000 0.000 0.000
#> ERR863707 3 0.0000 0.7965 0.000 0.000 1.000 0.000 0.000
#> ERR863681 5 0.7707 -0.1277 0.024 0.068 0.400 0.104 0.404
#> ERR863719 4 0.3305 0.4663 0.000 0.000 0.000 0.776 0.224
#> ERR863759 3 0.3305 0.6603 0.000 0.224 0.776 0.000 0.000
#> ERR863718 1 0.0404 0.8424 0.988 0.000 0.000 0.000 0.012
#> ERR863717 5 0.4291 0.3677 0.464 0.000 0.000 0.000 0.536
#> ERR863715 2 0.5452 0.6685 0.000 0.656 0.000 0.200 0.144
#> ERR863716 5 0.5110 0.6896 0.224 0.000 0.000 0.096 0.680
#> ERR863722 3 0.6291 -0.0786 0.008 0.120 0.480 0.392 0.000
#> ERR863721 4 0.4058 0.6757 0.152 0.064 0.000 0.784 0.000
#> ERR863720 2 0.0162 0.8414 0.000 0.996 0.000 0.000 0.004
#> ERR863723 5 0.3577 0.7431 0.160 0.000 0.000 0.032 0.808
#> ERR863761 3 0.3039 0.7569 0.000 0.000 0.836 0.012 0.152
#> ERR863735 1 0.0963 0.8279 0.964 0.000 0.000 0.000 0.036
#> ERR863734 3 0.3132 0.7463 0.000 0.000 0.820 0.008 0.172
#> ERR863736 2 0.6150 0.6394 0.000 0.612 0.016 0.208 0.164
#> ERR863729 2 0.5625 0.6547 0.000 0.636 0.000 0.204 0.160
#> ERR863728 1 0.2929 0.7701 0.860 0.008 0.004 0.124 0.004
#> ERR863731 1 0.0290 0.8429 0.992 0.000 0.000 0.000 0.008
#> ERR863764 4 0.6340 0.5101 0.008 0.168 0.272 0.552 0.000
#> ERR863740 5 0.3197 0.7402 0.140 0.000 0.024 0.000 0.836
#> ERR863765 3 0.3756 0.6690 0.000 0.000 0.744 0.008 0.248
#> ERR863762 3 0.0000 0.7965 0.000 0.000 1.000 0.000 0.000
#> ERR863724 5 0.6022 0.1488 0.052 0.000 0.360 0.036 0.552
#> ERR863733 4 0.6842 0.2244 0.008 0.212 0.372 0.408 0.000
#> ERR863732 3 0.0000 0.7965 0.000 0.000 1.000 0.000 0.000
#> ERR863730 5 0.3197 0.7408 0.140 0.000 0.024 0.000 0.836
#> ERR863742 5 0.3521 0.7357 0.144 0.000 0.024 0.008 0.824
#> ERR863763 4 0.3530 0.7496 0.012 0.204 0.000 0.784 0.000
#> ERR863741 2 0.6786 0.5833 0.040 0.560 0.000 0.232 0.168
#> ERR863743 1 0.0404 0.8422 0.988 0.000 0.000 0.000 0.012
#> ERR863745 2 0.0162 0.8408 0.000 0.996 0.004 0.000 0.000
#> ERR863744 5 0.4511 0.5523 0.356 0.000 0.016 0.000 0.628
#> ERR863746 5 0.3039 0.7270 0.192 0.000 0.000 0.000 0.808
#> ERR863748 3 0.5328 0.4375 0.008 0.076 0.660 0.256 0.000
#> ERR863747 3 0.3143 0.6787 0.000 0.204 0.796 0.000 0.000
#> ERR863694 4 0.3812 0.6554 0.000 0.092 0.000 0.812 0.096
#> ERR863693 4 0.3491 0.5637 0.228 0.004 0.000 0.768 0.000
#> ERR863686 5 0.3630 0.6381 0.016 0.000 0.000 0.204 0.780
#> ERR863678 1 0.2692 0.7846 0.884 0.016 0.008 0.092 0.000
#> ERR863685 3 0.3053 0.7517 0.000 0.000 0.828 0.008 0.164
#> ERR863689 1 0.3550 0.6711 0.760 0.000 0.000 0.236 0.004
#> ERR863691 1 0.4450 0.1456 0.508 0.000 0.000 0.488 0.004
#> ERR863682 5 0.5783 0.6653 0.228 0.000 0.000 0.160 0.612
#> ERR863695 2 0.0000 0.8422 0.000 1.000 0.000 0.000 0.000
#> ERR863683 5 0.3236 0.7397 0.152 0.000 0.020 0.000 0.828
#> ERR863684 4 0.2946 0.7143 0.088 0.044 0.000 0.868 0.000
#> ERR863702 5 0.3630 0.6381 0.016 0.000 0.000 0.204 0.780
#> ERR863687 3 0.2813 0.7070 0.000 0.168 0.832 0.000 0.000
#> ERR863706 3 0.4327 0.4762 0.000 0.000 0.632 0.008 0.360
#> ERR863708 2 0.0000 0.8422 0.000 1.000 0.000 0.000 0.000
#> ERR863710 1 0.0404 0.8424 0.988 0.000 0.000 0.000 0.012
#> ERR863709 2 0.0771 0.8278 0.000 0.976 0.000 0.020 0.004
#> ERR863753 2 0.0000 0.8422 0.000 1.000 0.000 0.000 0.000
#> ERR863754 1 0.3990 0.5822 0.688 0.000 0.000 0.308 0.004
#> ERR863749 1 0.0794 0.8368 0.972 0.000 0.000 0.000 0.028
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> ERR863675 4 0.2176 0.7302 0.000 0.080 0.000 0.896 0.000 0.024
#> ERR863705 3 0.0146 0.6982 0.000 0.000 0.996 0.004 0.000 0.000
#> ERR863704 2 0.1053 0.8743 0.000 0.964 0.000 0.004 0.020 0.012
#> ERR863679 3 0.0146 0.6982 0.000 0.000 0.996 0.004 0.000 0.000
#> ERR863680 2 0.0146 0.8901 0.000 0.996 0.000 0.004 0.000 0.000
#> ERR863676 2 0.0363 0.8885 0.000 0.988 0.000 0.012 0.000 0.000
#> ERR863677 4 0.0935 0.7577 0.000 0.032 0.000 0.964 0.000 0.004
#> ERR863688 5 0.2558 0.2190 0.004 0.000 0.000 0.000 0.840 0.156
#> ERR863690 1 0.1078 0.8916 0.964 0.000 0.000 0.008 0.016 0.012
#> ERR863692 4 0.5733 0.1837 0.380 0.000 0.000 0.508 0.036 0.076
#> ERR863703 1 0.0862 0.8930 0.972 0.000 0.000 0.004 0.016 0.008
#> ERR863712 4 0.0865 0.7568 0.000 0.036 0.000 0.964 0.000 0.000
#> ERR863711 1 0.2344 0.8443 0.896 0.000 0.000 0.004 0.052 0.048
#> ERR863760 2 0.4449 0.5451 0.000 0.684 0.000 0.016 0.264 0.036
#> ERR863727 6 0.4403 0.6979 0.028 0.000 0.000 0.000 0.408 0.564
#> ERR863766 3 0.4109 0.4997 0.000 0.000 0.576 0.012 0.000 0.412
#> ERR863767 1 0.2957 0.8008 0.844 0.000 0.000 0.004 0.032 0.120
#> ERR863752 2 0.1793 0.8490 0.000 0.928 0.036 0.004 0.000 0.032
#> ERR863757 5 0.2482 0.3364 0.004 0.000 0.000 0.000 0.848 0.148
#> ERR863758 1 0.0146 0.8957 0.996 0.000 0.000 0.000 0.000 0.004
#> ERR863755 5 0.5779 -0.1932 0.392 0.000 0.000 0.000 0.432 0.176
#> ERR863756 3 0.0291 0.6973 0.000 0.000 0.992 0.004 0.000 0.004
#> ERR863707 3 0.0000 0.6978 0.000 0.000 1.000 0.000 0.000 0.000
#> ERR863681 5 0.7812 -0.0100 0.024 0.032 0.260 0.036 0.332 0.316
#> ERR863719 4 0.4343 0.3310 0.000 0.004 0.000 0.592 0.384 0.020
#> ERR863759 3 0.3798 0.5718 0.000 0.216 0.748 0.004 0.000 0.032
#> ERR863718 1 0.0363 0.8953 0.988 0.000 0.000 0.000 0.000 0.012
#> ERR863717 6 0.6359 0.4146 0.268 0.000 0.000 0.012 0.332 0.388
#> ERR863715 2 0.4701 0.1710 0.000 0.524 0.000 0.004 0.436 0.036
#> ERR863716 5 0.5523 -0.4008 0.164 0.000 0.000 0.000 0.540 0.296
#> ERR863722 3 0.6476 0.2981 0.000 0.108 0.532 0.256 0.000 0.104
#> ERR863721 4 0.1080 0.7570 0.032 0.004 0.000 0.960 0.000 0.004
#> ERR863720 2 0.0725 0.8847 0.000 0.976 0.000 0.012 0.000 0.012
#> ERR863723 6 0.5034 0.5841 0.072 0.000 0.000 0.000 0.456 0.472
#> ERR863761 3 0.4601 0.5113 0.000 0.000 0.584 0.012 0.024 0.380
#> ERR863735 1 0.1141 0.8824 0.948 0.000 0.000 0.000 0.000 0.052
#> ERR863734 3 0.4109 0.4997 0.000 0.000 0.576 0.012 0.000 0.412
#> ERR863736 5 0.5622 0.1131 0.000 0.356 0.016 0.008 0.540 0.080
#> ERR863729 5 0.4945 0.1535 0.000 0.344 0.000 0.004 0.584 0.068
#> ERR863728 1 0.2781 0.8430 0.872 0.004 0.000 0.084 0.008 0.032
#> ERR863731 1 0.0458 0.8946 0.984 0.000 0.000 0.000 0.000 0.016
#> ERR863764 4 0.6602 0.0408 0.000 0.116 0.376 0.428 0.000 0.080
#> ERR863740 6 0.3979 0.7114 0.012 0.000 0.000 0.000 0.360 0.628
#> ERR863765 3 0.4293 0.4490 0.000 0.000 0.536 0.012 0.004 0.448
#> ERR863762 3 0.0146 0.6982 0.000 0.000 0.996 0.004 0.000 0.000
#> ERR863724 6 0.7351 -0.0432 0.060 0.000 0.244 0.020 0.288 0.388
#> ERR863733 3 0.6722 0.2809 0.000 0.176 0.508 0.224 0.000 0.092
#> ERR863732 3 0.0291 0.6976 0.000 0.000 0.992 0.004 0.000 0.004
#> ERR863730 6 0.4015 0.7144 0.012 0.000 0.000 0.000 0.372 0.616
#> ERR863742 6 0.4138 0.6317 0.020 0.000 0.004 0.008 0.268 0.700
#> ERR863763 4 0.1194 0.7582 0.004 0.032 0.000 0.956 0.000 0.008
#> ERR863741 5 0.5884 0.2605 0.024 0.268 0.000 0.024 0.596 0.088
#> ERR863743 1 0.0405 0.8954 0.988 0.000 0.000 0.000 0.008 0.004
#> ERR863745 2 0.0777 0.8879 0.000 0.972 0.004 0.000 0.000 0.024
#> ERR863744 6 0.5980 0.5706 0.188 0.000 0.008 0.004 0.280 0.520
#> ERR863746 6 0.4921 0.7051 0.060 0.000 0.000 0.004 0.372 0.564
#> ERR863748 3 0.5237 0.5403 0.000 0.096 0.700 0.116 0.000 0.088
#> ERR863747 3 0.3878 0.5653 0.000 0.228 0.736 0.004 0.000 0.032
#> ERR863694 4 0.4028 0.6112 0.000 0.028 0.000 0.764 0.176 0.032
#> ERR863693 4 0.2000 0.7460 0.048 0.004 0.000 0.916 0.000 0.032
#> ERR863686 5 0.0837 0.3755 0.000 0.004 0.000 0.004 0.972 0.020
#> ERR863678 1 0.2476 0.8530 0.892 0.004 0.004 0.040 0.000 0.060
#> ERR863685 3 0.4093 0.5068 0.000 0.000 0.584 0.012 0.000 0.404
#> ERR863689 1 0.5091 0.4864 0.628 0.000 0.000 0.288 0.028 0.056
#> ERR863691 4 0.5379 0.1701 0.396 0.000 0.000 0.516 0.016 0.072
#> ERR863682 5 0.4979 0.0920 0.224 0.000 0.000 0.000 0.640 0.136
#> ERR863695 2 0.0603 0.8899 0.000 0.980 0.004 0.000 0.000 0.016
#> ERR863683 6 0.4099 0.7177 0.016 0.000 0.000 0.000 0.372 0.612
#> ERR863684 4 0.1837 0.7541 0.032 0.004 0.000 0.932 0.012 0.020
#> ERR863702 5 0.1155 0.3634 0.000 0.004 0.000 0.004 0.956 0.036
#> ERR863687 3 0.3274 0.6241 0.000 0.168 0.804 0.004 0.000 0.024
#> ERR863706 3 0.5018 0.3656 0.000 0.000 0.480 0.012 0.044 0.464
#> ERR863708 2 0.0692 0.8883 0.000 0.976 0.004 0.000 0.000 0.020
#> ERR863710 1 0.0363 0.8953 0.988 0.000 0.000 0.000 0.000 0.012
#> ERR863709 2 0.1334 0.8717 0.000 0.948 0.000 0.032 0.000 0.020
#> ERR863753 2 0.0692 0.8883 0.000 0.976 0.004 0.000 0.000 0.020
#> ERR863754 1 0.4406 0.4159 0.624 0.000 0.000 0.344 0.008 0.024
#> ERR863749 1 0.1036 0.8921 0.964 0.000 0.000 0.004 0.024 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)
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 17118 rows and 78 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'MAD' method.
#> Subgroups are detected by 'pam' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 3.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 0.343 0.686 0.813 0.4273 0.568 0.568
#> 3 3 0.850 0.815 0.910 0.3798 0.819 0.689
#> 4 4 0.698 0.779 0.856 0.2274 0.776 0.505
#> 5 5 0.660 0.603 0.784 0.0805 0.862 0.557
#> 6 6 0.662 0.576 0.753 0.0457 0.877 0.522
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
#> ERR863675 1 0.855 0.545 0.720 0.280
#> ERR863705 2 0.430 0.677 0.088 0.912
#> ERR863704 1 0.855 0.545 0.720 0.280
#> ERR863679 2 0.000 0.688 0.000 1.000
#> ERR863680 1 0.855 0.545 0.720 0.280
#> ERR863676 1 0.855 0.545 0.720 0.280
#> ERR863677 1 0.706 0.714 0.808 0.192
#> ERR863688 1 0.000 0.836 1.000 0.000
#> ERR863690 1 0.000 0.836 1.000 0.000
#> ERR863692 1 0.000 0.836 1.000 0.000
#> ERR863703 1 0.000 0.836 1.000 0.000
#> ERR863712 1 0.224 0.813 0.964 0.036
#> ERR863711 1 0.000 0.836 1.000 0.000
#> ERR863760 1 0.913 0.539 0.672 0.328
#> ERR863727 1 0.662 0.721 0.828 0.172
#> ERR863766 2 0.855 0.595 0.280 0.720
#> ERR863767 1 0.000 0.836 1.000 0.000
#> ERR863752 2 0.662 0.640 0.172 0.828
#> ERR863757 1 0.662 0.721 0.828 0.172
#> ERR863758 1 0.000 0.836 1.000 0.000
#> ERR863755 1 0.000 0.836 1.000 0.000
#> ERR863756 2 0.814 0.624 0.252 0.748
#> ERR863707 2 0.000 0.688 0.000 1.000
#> ERR863681 1 0.141 0.829 0.980 0.020
#> ERR863719 1 0.662 0.721 0.828 0.172
#> ERR863759 2 0.184 0.688 0.028 0.972
#> ERR863718 1 0.000 0.836 1.000 0.000
#> ERR863717 1 0.224 0.821 0.964 0.036
#> ERR863715 1 0.855 0.545 0.720 0.280
#> ERR863716 1 0.625 0.735 0.844 0.156
#> ERR863722 2 0.993 0.279 0.452 0.548
#> ERR863721 1 0.000 0.836 1.000 0.000
#> ERR863720 1 0.855 0.545 0.720 0.280
#> ERR863723 1 0.634 0.732 0.840 0.160
#> ERR863761 2 0.697 0.663 0.188 0.812
#> ERR863735 1 0.000 0.836 1.000 0.000
#> ERR863734 2 0.808 0.628 0.248 0.752
#> ERR863736 2 0.946 0.382 0.364 0.636
#> ERR863729 1 0.855 0.545 0.720 0.280
#> ERR863728 1 0.000 0.836 1.000 0.000
#> ERR863731 1 0.000 0.836 1.000 0.000
#> ERR863764 2 0.991 0.293 0.444 0.556
#> ERR863740 1 0.662 0.721 0.828 0.172
#> ERR863765 2 0.855 0.595 0.280 0.720
#> ERR863762 2 0.775 0.642 0.228 0.772
#> ERR863724 1 0.343 0.805 0.936 0.064
#> ERR863733 2 0.760 0.619 0.220 0.780
#> ERR863732 2 0.653 0.670 0.168 0.832
#> ERR863730 1 0.662 0.721 0.828 0.172
#> ERR863742 1 0.662 0.721 0.828 0.172
#> ERR863763 1 0.833 0.577 0.736 0.264
#> ERR863741 1 0.000 0.836 1.000 0.000
#> ERR863743 1 0.000 0.836 1.000 0.000
#> ERR863745 2 0.995 0.264 0.460 0.540
#> ERR863744 1 0.184 0.825 0.972 0.028
#> ERR863746 1 0.662 0.721 0.828 0.172
#> ERR863748 2 0.753 0.622 0.216 0.784
#> ERR863747 2 0.000 0.688 0.000 1.000
#> ERR863694 1 0.850 0.551 0.724 0.276
#> ERR863693 1 0.000 0.836 1.000 0.000
#> ERR863686 1 0.443 0.787 0.908 0.092
#> ERR863678 1 0.000 0.836 1.000 0.000
#> ERR863685 2 0.808 0.628 0.248 0.752
#> ERR863689 1 0.000 0.836 1.000 0.000
#> ERR863691 1 0.000 0.836 1.000 0.000
#> ERR863682 1 0.584 0.750 0.860 0.140
#> ERR863695 2 0.995 0.264 0.460 0.540
#> ERR863683 1 0.625 0.735 0.844 0.156
#> ERR863684 1 0.000 0.836 1.000 0.000
#> ERR863702 1 0.625 0.735 0.844 0.156
#> ERR863687 2 0.000 0.688 0.000 1.000
#> ERR863706 2 0.855 0.595 0.280 0.720
#> ERR863708 2 0.995 0.264 0.460 0.540
#> ERR863710 1 0.000 0.836 1.000 0.000
#> ERR863709 1 0.855 0.545 0.720 0.280
#> ERR863753 1 0.861 0.538 0.716 0.284
#> ERR863754 1 0.000 0.836 1.000 0.000
#> ERR863749 1 0.000 0.836 1.000 0.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> ERR863675 1 0.6302 0.0873 0.520 0.480 0.000
#> ERR863705 3 0.0592 0.8832 0.000 0.012 0.988
#> ERR863704 2 0.0592 0.8235 0.012 0.988 0.000
#> ERR863679 3 0.0000 0.8879 0.000 0.000 1.000
#> ERR863680 2 0.1031 0.8492 0.024 0.976 0.000
#> ERR863676 2 0.1031 0.8492 0.024 0.976 0.000
#> ERR863677 1 0.2680 0.8715 0.924 0.068 0.008
#> ERR863688 1 0.1031 0.9070 0.976 0.024 0.000
#> ERR863690 1 0.2165 0.9193 0.936 0.064 0.000
#> ERR863692 1 0.0424 0.9145 0.992 0.008 0.000
#> ERR863703 1 0.2356 0.9178 0.928 0.072 0.000
#> ERR863712 1 0.3267 0.8860 0.884 0.116 0.000
#> ERR863711 1 0.2448 0.9170 0.924 0.076 0.000
#> ERR863760 2 0.6295 -0.0155 0.472 0.528 0.000
#> ERR863727 1 0.1620 0.9041 0.964 0.024 0.012
#> ERR863766 3 0.0000 0.8879 0.000 0.000 1.000
#> ERR863767 1 0.2356 0.9178 0.928 0.072 0.000
#> ERR863752 2 0.2878 0.7434 0.000 0.904 0.096
#> ERR863757 1 0.1620 0.9041 0.964 0.024 0.012
#> ERR863758 1 0.2356 0.9178 0.928 0.072 0.000
#> ERR863755 1 0.2537 0.9167 0.920 0.080 0.000
#> ERR863756 3 0.0000 0.8879 0.000 0.000 1.000
#> ERR863707 3 0.0000 0.8879 0.000 0.000 1.000
#> ERR863681 1 0.3031 0.9174 0.912 0.076 0.012
#> ERR863719 1 0.1620 0.9041 0.964 0.024 0.012
#> ERR863759 3 0.0592 0.8832 0.000 0.012 0.988
#> ERR863718 1 0.2165 0.9197 0.936 0.064 0.000
#> ERR863717 1 0.0237 0.9134 0.996 0.004 0.000
#> ERR863715 2 0.2261 0.7713 0.068 0.932 0.000
#> ERR863716 1 0.1031 0.9070 0.976 0.024 0.000
#> ERR863722 3 0.7080 0.3625 0.024 0.412 0.564
#> ERR863721 1 0.2356 0.9178 0.928 0.072 0.000
#> ERR863720 2 0.1031 0.8492 0.024 0.976 0.000
#> ERR863723 1 0.1620 0.9041 0.964 0.024 0.012
#> ERR863761 3 0.0000 0.8879 0.000 0.000 1.000
#> ERR863735 1 0.2356 0.9178 0.928 0.072 0.000
#> ERR863734 3 0.0000 0.8879 0.000 0.000 1.000
#> ERR863736 3 0.6410 0.4026 0.004 0.420 0.576
#> ERR863729 2 0.6302 -0.0539 0.480 0.520 0.000
#> ERR863728 1 0.2356 0.9178 0.928 0.072 0.000
#> ERR863731 1 0.2356 0.9178 0.928 0.072 0.000
#> ERR863764 3 0.6451 0.5839 0.024 0.292 0.684
#> ERR863740 1 0.1182 0.9124 0.976 0.012 0.012
#> ERR863765 3 0.0000 0.8879 0.000 0.000 1.000
#> ERR863762 3 0.0000 0.8879 0.000 0.000 1.000
#> ERR863724 1 0.1015 0.9133 0.980 0.008 0.012
#> ERR863733 2 0.3573 0.7346 0.004 0.876 0.120
#> ERR863732 3 0.0000 0.8879 0.000 0.000 1.000
#> ERR863730 1 0.1620 0.9041 0.964 0.024 0.012
#> ERR863742 1 0.2939 0.9158 0.916 0.072 0.012
#> ERR863763 1 0.6305 0.0728 0.516 0.484 0.000
#> ERR863741 1 0.1289 0.9086 0.968 0.032 0.000
#> ERR863743 1 0.2356 0.9178 0.928 0.072 0.000
#> ERR863745 2 0.1031 0.8492 0.024 0.976 0.000
#> ERR863744 1 0.2584 0.9190 0.928 0.064 0.008
#> ERR863746 1 0.1620 0.9041 0.964 0.024 0.012
#> ERR863748 3 0.6307 0.5446 0.012 0.328 0.660
#> ERR863747 3 0.0592 0.8832 0.000 0.012 0.988
#> ERR863694 1 0.6026 0.3252 0.624 0.376 0.000
#> ERR863693 1 0.2261 0.9188 0.932 0.068 0.000
#> ERR863686 1 0.1031 0.9070 0.976 0.024 0.000
#> ERR863678 1 0.2774 0.9169 0.920 0.072 0.008
#> ERR863685 3 0.0000 0.8879 0.000 0.000 1.000
#> ERR863689 1 0.2356 0.9178 0.928 0.072 0.000
#> ERR863691 1 0.2356 0.9178 0.928 0.072 0.000
#> ERR863682 1 0.1031 0.9070 0.976 0.024 0.000
#> ERR863695 2 0.1031 0.8492 0.024 0.976 0.000
#> ERR863683 1 0.1031 0.9070 0.976 0.024 0.000
#> ERR863684 1 0.1643 0.9137 0.956 0.044 0.000
#> ERR863702 1 0.1031 0.9070 0.976 0.024 0.000
#> ERR863687 3 0.4750 0.7134 0.000 0.216 0.784
#> ERR863706 3 0.2165 0.8400 0.064 0.000 0.936
#> ERR863708 2 0.1031 0.8492 0.024 0.976 0.000
#> ERR863710 1 0.2356 0.9178 0.928 0.072 0.000
#> ERR863709 2 0.1031 0.8492 0.024 0.976 0.000
#> ERR863753 2 0.1031 0.8492 0.024 0.976 0.000
#> ERR863754 1 0.2165 0.9193 0.936 0.064 0.000
#> ERR863749 1 0.2165 0.9193 0.936 0.064 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> ERR863675 4 0.3427 0.653 0.112 0.028 0.000 0.860
#> ERR863705 3 0.0779 0.949 0.000 0.004 0.980 0.016
#> ERR863704 2 0.0000 0.969 0.000 1.000 0.000 0.000
#> ERR863679 3 0.0000 0.958 0.000 0.000 1.000 0.000
#> ERR863680 2 0.0000 0.969 0.000 1.000 0.000 0.000
#> ERR863676 2 0.0000 0.969 0.000 1.000 0.000 0.000
#> ERR863677 1 0.5785 0.533 0.680 0.060 0.004 0.256
#> ERR863688 1 0.0000 0.853 1.000 0.000 0.000 0.000
#> ERR863690 1 0.2868 0.774 0.864 0.000 0.000 0.136
#> ERR863692 1 0.0707 0.850 0.980 0.000 0.000 0.020
#> ERR863703 1 0.2973 0.735 0.856 0.000 0.000 0.144
#> ERR863712 4 0.4331 0.466 0.288 0.000 0.000 0.712
#> ERR863711 1 0.2281 0.805 0.904 0.000 0.000 0.096
#> ERR863760 1 0.7402 0.331 0.516 0.264 0.000 0.220
#> ERR863727 1 0.0592 0.850 0.984 0.000 0.016 0.000
#> ERR863766 3 0.0000 0.958 0.000 0.000 1.000 0.000
#> ERR863767 4 0.4103 0.735 0.256 0.000 0.000 0.744
#> ERR863752 2 0.0000 0.969 0.000 1.000 0.000 0.000
#> ERR863757 1 0.2413 0.813 0.916 0.000 0.020 0.064
#> ERR863758 4 0.4193 0.730 0.268 0.000 0.000 0.732
#> ERR863755 1 0.2011 0.810 0.920 0.000 0.000 0.080
#> ERR863756 3 0.0188 0.957 0.000 0.000 0.996 0.004
#> ERR863707 3 0.0000 0.958 0.000 0.000 1.000 0.000
#> ERR863681 1 0.5173 0.358 0.660 0.000 0.020 0.320
#> ERR863719 1 0.4472 0.624 0.760 0.000 0.020 0.220
#> ERR863759 3 0.0707 0.947 0.000 0.020 0.980 0.000
#> ERR863718 4 0.4331 0.721 0.288 0.000 0.000 0.712
#> ERR863717 1 0.0000 0.853 1.000 0.000 0.000 0.000
#> ERR863715 2 0.0000 0.969 0.000 1.000 0.000 0.000
#> ERR863716 1 0.0000 0.853 1.000 0.000 0.000 0.000
#> ERR863722 4 0.2466 0.648 0.000 0.028 0.056 0.916
#> ERR863721 4 0.0707 0.680 0.020 0.000 0.000 0.980
#> ERR863720 2 0.0000 0.969 0.000 1.000 0.000 0.000
#> ERR863723 1 0.0469 0.851 0.988 0.000 0.012 0.000
#> ERR863761 3 0.0000 0.958 0.000 0.000 1.000 0.000
#> ERR863735 4 0.4103 0.735 0.256 0.000 0.000 0.744
#> ERR863734 3 0.0000 0.958 0.000 0.000 1.000 0.000
#> ERR863736 4 0.5137 0.493 0.000 0.024 0.296 0.680
#> ERR863729 4 0.7220 0.412 0.240 0.212 0.000 0.548
#> ERR863728 4 0.4454 0.715 0.308 0.000 0.000 0.692
#> ERR863731 4 0.4103 0.735 0.256 0.000 0.000 0.744
#> ERR863764 4 0.3166 0.637 0.000 0.016 0.116 0.868
#> ERR863740 4 0.5602 0.497 0.472 0.000 0.020 0.508
#> ERR863765 3 0.0000 0.958 0.000 0.000 1.000 0.000
#> ERR863762 3 0.0188 0.957 0.000 0.000 0.996 0.004
#> ERR863724 1 0.0927 0.851 0.976 0.000 0.016 0.008
#> ERR863733 2 0.5279 0.702 0.000 0.704 0.044 0.252
#> ERR863732 3 0.0707 0.949 0.000 0.000 0.980 0.020
#> ERR863730 1 0.0707 0.848 0.980 0.000 0.020 0.000
#> ERR863742 4 0.4642 0.734 0.240 0.000 0.020 0.740
#> ERR863763 4 0.1624 0.670 0.020 0.028 0.000 0.952
#> ERR863741 1 0.0921 0.847 0.972 0.000 0.000 0.028
#> ERR863743 1 0.4193 0.550 0.732 0.000 0.000 0.268
#> ERR863745 2 0.0000 0.969 0.000 1.000 0.000 0.000
#> ERR863744 4 0.5161 0.466 0.476 0.000 0.004 0.520
#> ERR863746 1 0.0592 0.850 0.984 0.000 0.016 0.000
#> ERR863748 3 0.5511 0.410 0.000 0.028 0.620 0.352
#> ERR863747 3 0.0336 0.955 0.000 0.008 0.992 0.000
#> ERR863694 4 0.1938 0.664 0.052 0.012 0.000 0.936
#> ERR863693 4 0.5000 0.178 0.500 0.000 0.000 0.500
#> ERR863686 1 0.0000 0.853 1.000 0.000 0.000 0.000
#> ERR863678 4 0.3975 0.738 0.240 0.000 0.000 0.760
#> ERR863685 3 0.0000 0.958 0.000 0.000 1.000 0.000
#> ERR863689 4 0.4877 0.611 0.408 0.000 0.000 0.592
#> ERR863691 4 0.4643 0.690 0.344 0.000 0.000 0.656
#> ERR863682 1 0.1867 0.811 0.928 0.000 0.000 0.072
#> ERR863695 2 0.0921 0.946 0.000 0.972 0.000 0.028
#> ERR863683 1 0.0000 0.853 1.000 0.000 0.000 0.000
#> ERR863684 1 0.4040 0.624 0.752 0.000 0.000 0.248
#> ERR863702 1 0.0000 0.853 1.000 0.000 0.000 0.000
#> ERR863687 3 0.1297 0.938 0.000 0.020 0.964 0.016
#> ERR863706 3 0.2149 0.874 0.088 0.000 0.912 0.000
#> ERR863708 2 0.0000 0.969 0.000 1.000 0.000 0.000
#> ERR863710 4 0.4103 0.735 0.256 0.000 0.000 0.744
#> ERR863709 2 0.1389 0.938 0.000 0.952 0.000 0.048
#> ERR863753 2 0.0000 0.969 0.000 1.000 0.000 0.000
#> ERR863754 1 0.2081 0.807 0.916 0.000 0.000 0.084
#> ERR863749 1 0.2081 0.807 0.916 0.000 0.000 0.084
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> ERR863675 4 0.2864 0.4547 0.024 0.112 0.000 0.864 0.000
#> ERR863705 3 0.0000 0.9627 0.000 0.000 1.000 0.000 0.000
#> ERR863704 2 0.0000 0.9632 0.000 1.000 0.000 0.000 0.000
#> ERR863679 3 0.0000 0.9627 0.000 0.000 1.000 0.000 0.000
#> ERR863680 2 0.0000 0.9632 0.000 1.000 0.000 0.000 0.000
#> ERR863676 2 0.0000 0.9632 0.000 1.000 0.000 0.000 0.000
#> ERR863677 4 0.6010 0.4030 0.204 0.212 0.000 0.584 0.000
#> ERR863688 1 0.0162 0.6746 0.996 0.000 0.000 0.000 0.004
#> ERR863690 1 0.5816 0.5491 0.588 0.000 0.000 0.280 0.132
#> ERR863692 1 0.3612 0.6419 0.764 0.000 0.000 0.228 0.008
#> ERR863703 1 0.4840 0.6012 0.676 0.000 0.000 0.268 0.056
#> ERR863712 4 0.2707 0.4562 0.024 0.100 0.000 0.876 0.000
#> ERR863711 1 0.6193 0.4355 0.544 0.000 0.000 0.184 0.272
#> ERR863760 4 0.7323 0.3463 0.188 0.056 0.000 0.488 0.268
#> ERR863727 1 0.0880 0.6660 0.968 0.000 0.000 0.000 0.032
#> ERR863766 3 0.0324 0.9575 0.004 0.000 0.992 0.000 0.004
#> ERR863767 5 0.6201 0.4744 0.232 0.000 0.000 0.216 0.552
#> ERR863752 2 0.0000 0.9632 0.000 1.000 0.000 0.000 0.000
#> ERR863757 1 0.3534 0.5185 0.744 0.000 0.000 0.000 0.256
#> ERR863758 5 0.4604 0.5781 0.012 0.000 0.000 0.428 0.560
#> ERR863755 1 0.4573 0.6299 0.700 0.000 0.000 0.044 0.256
#> ERR863756 3 0.0000 0.9627 0.000 0.000 1.000 0.000 0.000
#> ERR863707 3 0.0000 0.9627 0.000 0.000 1.000 0.000 0.000
#> ERR863681 1 0.5928 0.4724 0.548 0.000 0.000 0.124 0.328
#> ERR863719 4 0.6319 0.3626 0.272 0.000 0.000 0.524 0.204
#> ERR863759 3 0.0000 0.9627 0.000 0.000 1.000 0.000 0.000
#> ERR863718 5 0.4841 0.5779 0.024 0.000 0.000 0.416 0.560
#> ERR863717 1 0.1410 0.6793 0.940 0.000 0.000 0.000 0.060
#> ERR863715 2 0.3508 0.7039 0.000 0.748 0.000 0.000 0.252
#> ERR863716 1 0.0290 0.6764 0.992 0.000 0.000 0.000 0.008
#> ERR863722 4 0.2605 0.4103 0.000 0.000 0.148 0.852 0.000
#> ERR863721 4 0.3196 0.1144 0.004 0.000 0.000 0.804 0.192
#> ERR863720 2 0.0000 0.9632 0.000 1.000 0.000 0.000 0.000
#> ERR863723 1 0.0794 0.6670 0.972 0.000 0.000 0.000 0.028
#> ERR863761 3 0.0000 0.9627 0.000 0.000 1.000 0.000 0.000
#> ERR863735 5 0.5267 0.5703 0.048 0.000 0.000 0.428 0.524
#> ERR863734 3 0.0000 0.9627 0.000 0.000 1.000 0.000 0.000
#> ERR863736 5 0.6807 0.1995 0.040 0.000 0.236 0.168 0.556
#> ERR863729 5 0.8179 -0.2952 0.136 0.184 0.000 0.340 0.340
#> ERR863728 4 0.6456 -0.2012 0.368 0.000 0.000 0.448 0.184
#> ERR863731 5 0.4390 0.5806 0.004 0.000 0.000 0.428 0.568
#> ERR863764 4 0.3074 0.3693 0.000 0.000 0.196 0.804 0.000
#> ERR863740 1 0.6157 -0.2184 0.496 0.000 0.000 0.140 0.364
#> ERR863765 3 0.4597 0.5868 0.260 0.000 0.696 0.000 0.044
#> ERR863762 3 0.0000 0.9627 0.000 0.000 1.000 0.000 0.000
#> ERR863724 1 0.5059 0.6314 0.700 0.000 0.000 0.176 0.124
#> ERR863733 4 0.4658 -0.0665 0.000 0.484 0.012 0.504 0.000
#> ERR863732 3 0.0162 0.9600 0.000 0.000 0.996 0.004 0.000
#> ERR863730 1 0.1121 0.6604 0.956 0.000 0.000 0.000 0.044
#> ERR863742 5 0.6193 0.4521 0.260 0.000 0.000 0.192 0.548
#> ERR863763 4 0.0000 0.4055 0.000 0.000 0.000 1.000 0.000
#> ERR863741 1 0.4585 0.5763 0.628 0.000 0.000 0.020 0.352
#> ERR863743 1 0.6699 0.2715 0.428 0.000 0.000 0.304 0.268
#> ERR863745 2 0.0510 0.9531 0.000 0.984 0.000 0.016 0.000
#> ERR863744 1 0.4066 0.5264 0.768 0.000 0.000 0.188 0.044
#> ERR863746 1 0.0162 0.6738 0.996 0.000 0.000 0.000 0.004
#> ERR863748 3 0.2329 0.8309 0.000 0.000 0.876 0.124 0.000
#> ERR863747 3 0.0000 0.9627 0.000 0.000 1.000 0.000 0.000
#> ERR863694 4 0.0794 0.4219 0.028 0.000 0.000 0.972 0.000
#> ERR863693 4 0.5006 0.0748 0.328 0.000 0.000 0.624 0.048
#> ERR863686 1 0.3534 0.6144 0.744 0.000 0.000 0.000 0.256
#> ERR863678 4 0.5816 -0.5175 0.092 0.000 0.000 0.468 0.440
#> ERR863685 3 0.0000 0.9627 0.000 0.000 1.000 0.000 0.000
#> ERR863689 1 0.5345 0.4359 0.540 0.000 0.000 0.404 0.056
#> ERR863691 1 0.5261 0.4183 0.528 0.000 0.000 0.424 0.048
#> ERR863682 1 0.6069 0.4702 0.524 0.000 0.000 0.136 0.340
#> ERR863695 2 0.0794 0.9367 0.000 0.972 0.000 0.028 0.000
#> ERR863683 1 0.1121 0.6604 0.956 0.000 0.000 0.000 0.044
#> ERR863684 4 0.5303 0.4006 0.232 0.000 0.000 0.660 0.108
#> ERR863702 1 0.3816 0.6113 0.696 0.000 0.000 0.000 0.304
#> ERR863687 3 0.0000 0.9627 0.000 0.000 1.000 0.000 0.000
#> ERR863706 3 0.1341 0.9131 0.056 0.000 0.944 0.000 0.000
#> ERR863708 2 0.0000 0.9632 0.000 1.000 0.000 0.000 0.000
#> ERR863710 5 0.4604 0.5781 0.012 0.000 0.000 0.428 0.560
#> ERR863709 2 0.1043 0.9334 0.000 0.960 0.000 0.040 0.000
#> ERR863753 2 0.0000 0.9632 0.000 1.000 0.000 0.000 0.000
#> ERR863754 1 0.4730 0.6084 0.688 0.000 0.000 0.260 0.052
#> ERR863749 1 0.4769 0.6083 0.688 0.000 0.000 0.256 0.056
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> ERR863675 4 0.4066 0.6842 0.000 0.064 0.000 0.732 0.000 0.204
#> ERR863705 3 0.0146 0.9459 0.000 0.004 0.996 0.000 0.000 0.000
#> ERR863704 2 0.0146 0.9558 0.000 0.996 0.000 0.000 0.004 0.000
#> ERR863679 3 0.0000 0.9468 0.000 0.000 1.000 0.000 0.000 0.000
#> ERR863680 2 0.0000 0.9562 0.000 1.000 0.000 0.000 0.000 0.000
#> ERR863676 2 0.0000 0.9562 0.000 1.000 0.000 0.000 0.000 0.000
#> ERR863677 4 0.4953 0.6239 0.076 0.128 0.000 0.732 0.056 0.008
#> ERR863688 1 0.3620 0.2863 0.648 0.000 0.000 0.000 0.352 0.000
#> ERR863690 6 0.3838 0.1521 0.448 0.000 0.000 0.000 0.000 0.552
#> ERR863692 1 0.4498 0.4191 0.644 0.000 0.000 0.000 0.056 0.300
#> ERR863703 1 0.3482 0.3953 0.684 0.000 0.000 0.000 0.000 0.316
#> ERR863712 4 0.4011 0.6843 0.000 0.056 0.000 0.732 0.000 0.212
#> ERR863711 1 0.4506 0.3536 0.608 0.000 0.000 0.000 0.044 0.348
#> ERR863760 1 0.5668 -0.3307 0.468 0.040 0.000 0.432 0.060 0.000
#> ERR863727 5 0.3819 0.3331 0.372 0.000 0.004 0.000 0.624 0.000
#> ERR863766 3 0.1910 0.9088 0.000 0.000 0.892 0.000 0.108 0.000
#> ERR863767 5 0.3819 0.4515 0.004 0.000 0.000 0.000 0.624 0.372
#> ERR863752 2 0.0146 0.9558 0.000 0.996 0.000 0.000 0.004 0.000
#> ERR863757 5 0.4419 0.5239 0.220 0.000 0.004 0.000 0.704 0.072
#> ERR863758 6 0.0000 0.7135 0.000 0.000 0.000 0.000 0.000 1.000
#> ERR863755 1 0.1657 0.5026 0.928 0.000 0.000 0.000 0.016 0.056
#> ERR863756 3 0.0146 0.9462 0.000 0.000 0.996 0.000 0.004 0.000
#> ERR863707 3 0.0000 0.9468 0.000 0.000 1.000 0.000 0.000 0.000
#> ERR863681 1 0.5205 0.3556 0.576 0.000 0.000 0.348 0.044 0.032
#> ERR863719 4 0.4732 0.4580 0.320 0.000 0.000 0.612 0.068 0.000
#> ERR863759 3 0.0146 0.9462 0.000 0.000 0.996 0.000 0.004 0.000
#> ERR863718 6 0.0405 0.7130 0.004 0.000 0.000 0.000 0.008 0.988
#> ERR863717 1 0.4180 0.2918 0.628 0.000 0.000 0.000 0.348 0.024
#> ERR863715 2 0.5031 0.6316 0.196 0.680 0.000 0.024 0.100 0.000
#> ERR863716 1 0.3668 0.3200 0.668 0.000 0.000 0.000 0.328 0.004
#> ERR863722 4 0.4577 0.6331 0.000 0.000 0.072 0.656 0.000 0.272
#> ERR863721 6 0.2772 0.5517 0.004 0.000 0.000 0.180 0.000 0.816
#> ERR863720 2 0.0000 0.9562 0.000 1.000 0.000 0.000 0.000 0.000
#> ERR863723 1 0.3869 -0.0947 0.500 0.000 0.000 0.000 0.500 0.000
#> ERR863761 3 0.1814 0.9135 0.000 0.000 0.900 0.000 0.100 0.000
#> ERR863735 6 0.0632 0.7011 0.000 0.000 0.000 0.000 0.024 0.976
#> ERR863734 3 0.1814 0.9135 0.000 0.000 0.900 0.000 0.100 0.000
#> ERR863736 5 0.7444 0.1996 0.276 0.000 0.164 0.000 0.372 0.188
#> ERR863729 1 0.8259 -0.2332 0.332 0.188 0.000 0.276 0.148 0.056
#> ERR863728 6 0.5651 -0.0515 0.400 0.000 0.000 0.152 0.000 0.448
#> ERR863731 6 0.0000 0.7135 0.000 0.000 0.000 0.000 0.000 1.000
#> ERR863764 4 0.5150 0.5896 0.000 0.000 0.136 0.608 0.000 0.256
#> ERR863740 5 0.3911 0.5916 0.056 0.000 0.004 0.000 0.760 0.180
#> ERR863765 5 0.3076 0.4882 0.000 0.000 0.240 0.000 0.760 0.000
#> ERR863762 3 0.0000 0.9468 0.000 0.000 1.000 0.000 0.000 0.000
#> ERR863724 1 0.5337 0.4212 0.560 0.000 0.000 0.356 0.032 0.052
#> ERR863733 4 0.4536 0.0629 0.000 0.476 0.024 0.496 0.004 0.000
#> ERR863732 3 0.0146 0.9462 0.000 0.000 0.996 0.004 0.000 0.000
#> ERR863730 5 0.3136 0.5399 0.228 0.000 0.004 0.000 0.768 0.000
#> ERR863742 5 0.3163 0.5704 0.000 0.000 0.004 0.000 0.764 0.232
#> ERR863763 4 0.3244 0.6503 0.000 0.000 0.000 0.732 0.000 0.268
#> ERR863741 1 0.3618 0.4209 0.824 0.000 0.000 0.044 0.088 0.044
#> ERR863743 6 0.3101 0.5434 0.244 0.000 0.000 0.000 0.000 0.756
#> ERR863745 2 0.0547 0.9438 0.000 0.980 0.000 0.020 0.000 0.000
#> ERR863744 5 0.5684 0.1516 0.380 0.000 0.000 0.004 0.476 0.140
#> ERR863746 1 0.3823 0.1236 0.564 0.000 0.000 0.000 0.436 0.000
#> ERR863748 3 0.3096 0.7952 0.000 0.004 0.840 0.048 0.000 0.108
#> ERR863747 3 0.0146 0.9462 0.000 0.000 0.996 0.000 0.004 0.000
#> ERR863694 4 0.3695 0.6656 0.000 0.000 0.000 0.732 0.024 0.244
#> ERR863693 4 0.6381 0.1093 0.332 0.000 0.000 0.376 0.012 0.280
#> ERR863686 1 0.3101 0.2329 0.756 0.000 0.000 0.000 0.244 0.000
#> ERR863678 6 0.3370 0.5918 0.148 0.000 0.000 0.048 0.000 0.804
#> ERR863685 3 0.1814 0.9135 0.000 0.000 0.900 0.000 0.100 0.000
#> ERR863689 1 0.4537 0.2139 0.552 0.000 0.000 0.036 0.000 0.412
#> ERR863691 1 0.4318 0.1604 0.532 0.000 0.000 0.020 0.000 0.448
#> ERR863682 6 0.4932 0.3587 0.312 0.000 0.000 0.000 0.088 0.600
#> ERR863695 2 0.0547 0.9396 0.000 0.980 0.000 0.000 0.000 0.020
#> ERR863683 5 0.3448 0.4922 0.280 0.000 0.000 0.000 0.716 0.004
#> ERR863684 4 0.5026 0.5914 0.204 0.000 0.000 0.680 0.028 0.088
#> ERR863702 1 0.1411 0.4465 0.936 0.000 0.000 0.000 0.060 0.004
#> ERR863687 3 0.0146 0.9459 0.000 0.004 0.996 0.000 0.000 0.000
#> ERR863706 3 0.2416 0.8688 0.000 0.000 0.844 0.000 0.156 0.000
#> ERR863708 2 0.0000 0.9562 0.000 1.000 0.000 0.000 0.000 0.000
#> ERR863710 6 0.0000 0.7135 0.000 0.000 0.000 0.000 0.000 1.000
#> ERR863709 2 0.1007 0.9239 0.000 0.956 0.000 0.044 0.000 0.000
#> ERR863753 2 0.0146 0.9558 0.000 0.996 0.000 0.000 0.004 0.000
#> ERR863754 1 0.4459 0.4477 0.700 0.000 0.000 0.096 0.000 0.204
#> ERR863749 1 0.3409 0.4101 0.700 0.000 0.000 0.000 0.000 0.300
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)
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 17118 rows and 78 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 0.429 0.727 0.821 0.4333 0.601 0.601
#> 3 3 0.475 0.689 0.839 0.3781 0.489 0.323
#> 4 4 0.635 0.722 0.827 0.1472 0.861 0.673
#> 5 5 0.622 0.588 0.781 0.1120 0.858 0.579
#> 6 6 0.632 0.510 0.659 0.0663 0.895 0.575
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
#> ERR863675 2 0.9000 0.747 0.316 0.684
#> ERR863705 2 0.9661 0.735 0.392 0.608
#> ERR863704 2 0.9881 0.721 0.436 0.564
#> ERR863679 2 0.9661 0.735 0.392 0.608
#> ERR863680 2 0.9661 0.735 0.392 0.608
#> ERR863676 2 0.9661 0.735 0.392 0.608
#> ERR863677 2 0.3431 0.662 0.064 0.936
#> ERR863688 2 0.3274 0.597 0.060 0.940
#> ERR863690 1 0.9922 0.979 0.552 0.448
#> ERR863692 1 0.9933 0.977 0.548 0.452
#> ERR863703 1 0.9933 0.977 0.548 0.452
#> ERR863712 2 0.7745 0.735 0.228 0.772
#> ERR863711 1 0.9922 0.979 0.552 0.448
#> ERR863760 2 0.9922 0.715 0.448 0.552
#> ERR863727 2 0.9850 -0.765 0.428 0.572
#> ERR863766 2 0.0000 0.608 0.000 1.000
#> ERR863767 2 0.8661 -0.146 0.288 0.712
#> ERR863752 2 0.9661 0.735 0.392 0.608
#> ERR863757 2 0.3114 0.602 0.056 0.944
#> ERR863758 1 0.9922 0.979 0.552 0.448
#> ERR863755 1 0.9710 0.934 0.600 0.400
#> ERR863756 2 0.7056 0.724 0.192 0.808
#> ERR863707 2 0.9522 0.740 0.372 0.628
#> ERR863681 2 0.4431 0.637 0.092 0.908
#> ERR863719 2 0.3274 0.597 0.060 0.940
#> ERR863759 2 0.9661 0.735 0.392 0.608
#> ERR863718 1 0.9922 0.979 0.552 0.448
#> ERR863717 1 0.9922 0.979 0.552 0.448
#> ERR863715 2 0.9922 0.715 0.448 0.552
#> ERR863716 1 0.9661 0.924 0.608 0.392
#> ERR863722 2 0.9000 0.747 0.316 0.684
#> ERR863721 1 0.9983 0.947 0.524 0.476
#> ERR863720 2 0.9661 0.735 0.392 0.608
#> ERR863723 1 0.9661 0.924 0.608 0.392
#> ERR863761 2 0.9795 0.724 0.416 0.584
#> ERR863735 1 0.9922 0.979 0.552 0.448
#> ERR863734 2 0.1633 0.632 0.024 0.976
#> ERR863736 2 0.9922 0.715 0.448 0.552
#> ERR863729 2 0.9922 0.715 0.448 0.552
#> ERR863728 2 0.3114 0.599 0.056 0.944
#> ERR863731 1 0.9922 0.979 0.552 0.448
#> ERR863764 2 0.9000 0.747 0.316 0.684
#> ERR863740 2 0.0672 0.600 0.008 0.992
#> ERR863765 2 0.0000 0.608 0.000 1.000
#> ERR863762 2 0.6712 0.719 0.176 0.824
#> ERR863724 2 0.0672 0.604 0.008 0.992
#> ERR863733 2 0.9000 0.747 0.316 0.684
#> ERR863732 2 0.7219 0.727 0.200 0.800
#> ERR863730 2 0.0672 0.600 0.008 0.992
#> ERR863742 2 0.0672 0.600 0.008 0.992
#> ERR863763 2 0.5519 0.693 0.128 0.872
#> ERR863741 2 0.8608 0.731 0.284 0.716
#> ERR863743 1 0.9922 0.979 0.552 0.448
#> ERR863745 2 0.9661 0.735 0.392 0.608
#> ERR863744 2 0.1184 0.586 0.016 0.984
#> ERR863746 1 0.9933 0.977 0.548 0.452
#> ERR863748 2 0.9000 0.747 0.316 0.684
#> ERR863747 2 0.9661 0.735 0.392 0.608
#> ERR863694 2 0.9491 0.738 0.368 0.632
#> ERR863693 2 0.4161 0.560 0.084 0.916
#> ERR863686 2 0.3274 0.597 0.060 0.940
#> ERR863678 2 0.0376 0.603 0.004 0.996
#> ERR863685 2 0.1843 0.635 0.028 0.972
#> ERR863689 1 0.9732 0.929 0.596 0.404
#> ERR863691 1 0.9944 0.974 0.544 0.456
#> ERR863682 2 0.3274 0.597 0.060 0.940
#> ERR863695 2 0.9661 0.735 0.392 0.608
#> ERR863683 2 0.3879 0.470 0.076 0.924
#> ERR863684 1 0.9944 0.974 0.544 0.456
#> ERR863702 2 0.3274 0.597 0.060 0.940
#> ERR863687 2 0.9661 0.735 0.392 0.608
#> ERR863706 2 0.0000 0.608 0.000 1.000
#> ERR863708 2 0.9661 0.735 0.392 0.608
#> ERR863710 1 0.9909 0.976 0.556 0.444
#> ERR863709 2 0.9000 0.747 0.316 0.684
#> ERR863753 2 0.9661 0.735 0.392 0.608
#> ERR863754 1 0.9933 0.977 0.548 0.452
#> ERR863749 1 0.9922 0.979 0.552 0.448
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> ERR863675 1 0.9866 -0.0231 0.388 0.256 0.356
#> ERR863705 3 0.3816 0.6899 0.000 0.148 0.852
#> ERR863704 2 0.5179 0.7658 0.088 0.832 0.080
#> ERR863679 3 0.3816 0.6899 0.000 0.148 0.852
#> ERR863680 2 0.4206 0.7681 0.088 0.872 0.040
#> ERR863676 2 0.4045 0.7612 0.104 0.872 0.024
#> ERR863677 1 0.4994 0.7457 0.816 0.024 0.160
#> ERR863688 1 0.8016 0.6038 0.656 0.156 0.188
#> ERR863690 1 0.0000 0.8497 1.000 0.000 0.000
#> ERR863692 1 0.0237 0.8484 0.996 0.000 0.004
#> ERR863703 1 0.0000 0.8497 1.000 0.000 0.000
#> ERR863712 1 0.6034 0.7139 0.780 0.068 0.152
#> ERR863711 1 0.0000 0.8497 1.000 0.000 0.000
#> ERR863760 2 0.6875 0.6546 0.080 0.724 0.196
#> ERR863727 1 0.2625 0.8179 0.916 0.000 0.084
#> ERR863766 3 0.1163 0.7282 0.028 0.000 0.972
#> ERR863767 1 0.0000 0.8497 1.000 0.000 0.000
#> ERR863752 2 0.5835 0.5174 0.000 0.660 0.340
#> ERR863757 1 0.8982 0.4544 0.548 0.168 0.284
#> ERR863758 1 0.0000 0.8497 1.000 0.000 0.000
#> ERR863755 1 0.0000 0.8497 1.000 0.000 0.000
#> ERR863756 3 0.0237 0.7397 0.004 0.000 0.996
#> ERR863707 3 0.3816 0.6899 0.000 0.148 0.852
#> ERR863681 3 0.9311 0.0185 0.364 0.168 0.468
#> ERR863719 1 0.7065 0.5749 0.644 0.040 0.316
#> ERR863759 3 0.4605 0.6598 0.000 0.204 0.796
#> ERR863718 1 0.0000 0.8497 1.000 0.000 0.000
#> ERR863717 1 0.0000 0.8497 1.000 0.000 0.000
#> ERR863715 2 0.4452 0.6357 0.000 0.808 0.192
#> ERR863716 1 0.0000 0.8497 1.000 0.000 0.000
#> ERR863722 3 0.9313 0.1037 0.288 0.200 0.512
#> ERR863721 1 0.0829 0.8453 0.984 0.012 0.004
#> ERR863720 2 0.4063 0.7571 0.112 0.868 0.020
#> ERR863723 1 0.0592 0.8478 0.988 0.000 0.012
#> ERR863761 3 0.4504 0.6729 0.000 0.196 0.804
#> ERR863735 1 0.0000 0.8497 1.000 0.000 0.000
#> ERR863734 3 0.0424 0.7391 0.008 0.000 0.992
#> ERR863736 2 0.4702 0.6139 0.000 0.788 0.212
#> ERR863729 2 0.4452 0.6357 0.000 0.808 0.192
#> ERR863728 1 0.1711 0.8420 0.960 0.008 0.032
#> ERR863731 1 0.0000 0.8497 1.000 0.000 0.000
#> ERR863764 3 0.9853 -0.2293 0.252 0.360 0.388
#> ERR863740 1 0.4968 0.7358 0.800 0.012 0.188
#> ERR863765 3 0.0892 0.7338 0.020 0.000 0.980
#> ERR863762 3 0.0237 0.7397 0.004 0.000 0.996
#> ERR863724 1 0.6867 0.6129 0.672 0.040 0.288
#> ERR863733 3 0.4555 0.5539 0.000 0.200 0.800
#> ERR863732 3 0.0237 0.7397 0.004 0.000 0.996
#> ERR863730 1 0.4399 0.7439 0.812 0.000 0.188
#> ERR863742 1 0.4399 0.7439 0.812 0.000 0.188
#> ERR863763 1 0.5573 0.7308 0.796 0.044 0.160
#> ERR863741 2 0.7600 0.3896 0.056 0.600 0.344
#> ERR863743 1 0.0000 0.8497 1.000 0.000 0.000
#> ERR863745 2 0.4269 0.7454 0.052 0.872 0.076
#> ERR863744 1 0.4346 0.7474 0.816 0.000 0.184
#> ERR863746 1 0.0000 0.8497 1.000 0.000 0.000
#> ERR863748 3 0.3038 0.6807 0.000 0.104 0.896
#> ERR863747 3 0.4235 0.6778 0.000 0.176 0.824
#> ERR863694 2 0.8362 0.4877 0.096 0.556 0.348
#> ERR863693 1 0.1267 0.8406 0.972 0.024 0.004
#> ERR863686 1 0.8297 0.5750 0.632 0.168 0.200
#> ERR863678 1 0.3879 0.7640 0.848 0.000 0.152
#> ERR863685 3 0.0661 0.7404 0.004 0.008 0.988
#> ERR863689 1 0.0237 0.8484 0.996 0.000 0.004
#> ERR863691 1 0.0237 0.8484 0.996 0.000 0.004
#> ERR863682 1 0.5200 0.7355 0.796 0.020 0.184
#> ERR863695 2 0.4232 0.7677 0.084 0.872 0.044
#> ERR863683 1 0.4399 0.7439 0.812 0.000 0.188
#> ERR863684 1 0.0237 0.8484 0.996 0.000 0.004
#> ERR863702 1 0.9148 0.3714 0.504 0.160 0.336
#> ERR863687 3 0.4887 0.6348 0.000 0.228 0.772
#> ERR863706 1 0.6682 0.2647 0.504 0.008 0.488
#> ERR863708 2 0.4206 0.7681 0.088 0.872 0.040
#> ERR863710 1 0.0000 0.8497 1.000 0.000 0.000
#> ERR863709 2 0.6728 0.6724 0.128 0.748 0.124
#> ERR863753 2 0.4253 0.7663 0.080 0.872 0.048
#> ERR863754 1 0.0237 0.8484 0.996 0.000 0.004
#> ERR863749 1 0.0000 0.8497 1.000 0.000 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> ERR863675 2 0.7592 0.4618 0.204 0.612 0.124 0.060
#> ERR863705 3 0.3367 0.7990 0.000 0.108 0.864 0.028
#> ERR863704 2 0.0657 0.8319 0.000 0.984 0.004 0.012
#> ERR863679 3 0.3245 0.7979 0.000 0.100 0.872 0.028
#> ERR863680 2 0.0000 0.8359 0.000 1.000 0.000 0.000
#> ERR863676 2 0.0336 0.8332 0.000 0.992 0.000 0.008
#> ERR863677 1 0.4869 0.7492 0.804 0.016 0.092 0.088
#> ERR863688 4 0.5506 0.1077 0.472 0.016 0.000 0.512
#> ERR863690 1 0.0469 0.8877 0.988 0.000 0.000 0.012
#> ERR863692 1 0.1398 0.8752 0.956 0.000 0.004 0.040
#> ERR863703 1 0.0336 0.8875 0.992 0.000 0.000 0.008
#> ERR863712 1 0.8179 0.1250 0.512 0.312 0.088 0.088
#> ERR863711 1 0.1022 0.8875 0.968 0.000 0.000 0.032
#> ERR863760 4 0.5951 0.1304 0.024 0.432 0.008 0.536
#> ERR863727 1 0.2345 0.8609 0.900 0.000 0.000 0.100
#> ERR863766 3 0.3099 0.7612 0.020 0.000 0.876 0.104
#> ERR863767 1 0.0000 0.8884 1.000 0.000 0.000 0.000
#> ERR863752 2 0.3051 0.7700 0.000 0.884 0.088 0.028
#> ERR863757 4 0.5219 0.5717 0.160 0.016 0.056 0.768
#> ERR863758 1 0.0469 0.8877 0.988 0.000 0.000 0.012
#> ERR863755 1 0.1474 0.8826 0.948 0.000 0.000 0.052
#> ERR863756 3 0.0817 0.8001 0.000 0.000 0.976 0.024
#> ERR863707 3 0.3182 0.7994 0.000 0.096 0.876 0.028
#> ERR863681 4 0.7047 0.4533 0.140 0.016 0.228 0.616
#> ERR863719 1 0.5452 0.7428 0.760 0.016 0.080 0.144
#> ERR863759 3 0.3542 0.7976 0.000 0.120 0.852 0.028
#> ERR863718 1 0.0707 0.8888 0.980 0.000 0.000 0.020
#> ERR863717 1 0.0000 0.8884 1.000 0.000 0.000 0.000
#> ERR863715 4 0.5039 0.2943 0.000 0.404 0.004 0.592
#> ERR863716 1 0.1792 0.8758 0.932 0.000 0.000 0.068
#> ERR863722 2 0.6904 0.5710 0.044 0.628 0.264 0.064
#> ERR863721 1 0.1854 0.8695 0.940 0.000 0.012 0.048
#> ERR863720 2 0.1305 0.8220 0.000 0.960 0.004 0.036
#> ERR863723 1 0.2944 0.8474 0.868 0.000 0.004 0.128
#> ERR863761 3 0.4724 0.7648 0.000 0.096 0.792 0.112
#> ERR863735 1 0.2345 0.8603 0.900 0.000 0.000 0.100
#> ERR863734 3 0.1724 0.7985 0.020 0.000 0.948 0.032
#> ERR863736 4 0.4391 0.4455 0.000 0.252 0.008 0.740
#> ERR863729 4 0.4372 0.4373 0.000 0.268 0.004 0.728
#> ERR863728 1 0.2522 0.8634 0.920 0.016 0.012 0.052
#> ERR863731 1 0.0336 0.8882 0.992 0.000 0.000 0.008
#> ERR863764 2 0.6166 0.6643 0.056 0.728 0.152 0.064
#> ERR863740 1 0.2760 0.8483 0.872 0.000 0.000 0.128
#> ERR863765 3 0.3325 0.7567 0.024 0.000 0.864 0.112
#> ERR863762 3 0.1004 0.7997 0.004 0.000 0.972 0.024
#> ERR863724 1 0.6541 0.5864 0.676 0.016 0.160 0.148
#> ERR863733 3 0.6334 -0.1516 0.000 0.456 0.484 0.060
#> ERR863732 3 0.0817 0.8001 0.000 0.000 0.976 0.024
#> ERR863730 1 0.2760 0.8488 0.872 0.000 0.000 0.128
#> ERR863742 1 0.2868 0.8445 0.864 0.000 0.000 0.136
#> ERR863763 1 0.5178 0.7314 0.792 0.028 0.096 0.084
#> ERR863741 4 0.5617 0.4878 0.024 0.112 0.104 0.760
#> ERR863743 1 0.0469 0.8877 0.988 0.000 0.000 0.012
#> ERR863745 2 0.0000 0.8359 0.000 1.000 0.000 0.000
#> ERR863744 1 0.1637 0.8841 0.940 0.000 0.000 0.060
#> ERR863746 1 0.2216 0.8660 0.908 0.000 0.000 0.092
#> ERR863748 3 0.4656 0.6738 0.000 0.160 0.784 0.056
#> ERR863747 3 0.3542 0.7976 0.000 0.120 0.852 0.028
#> ERR863694 2 0.7795 0.3396 0.056 0.556 0.104 0.284
#> ERR863693 1 0.1863 0.8709 0.944 0.004 0.012 0.040
#> ERR863686 4 0.5215 0.5598 0.256 0.016 0.016 0.712
#> ERR863678 1 0.4292 0.7724 0.832 0.008 0.088 0.072
#> ERR863685 3 0.1394 0.8082 0.016 0.012 0.964 0.008
#> ERR863689 1 0.1677 0.8711 0.948 0.000 0.012 0.040
#> ERR863691 1 0.1767 0.8707 0.944 0.000 0.012 0.044
#> ERR863682 1 0.2796 0.8641 0.892 0.016 0.000 0.092
#> ERR863695 2 0.0000 0.8359 0.000 1.000 0.000 0.000
#> ERR863683 1 0.2647 0.8534 0.880 0.000 0.000 0.120
#> ERR863684 1 0.1938 0.8691 0.936 0.000 0.012 0.052
#> ERR863702 4 0.6954 0.0643 0.448 0.016 0.068 0.468
#> ERR863687 3 0.3913 0.7819 0.000 0.148 0.824 0.028
#> ERR863706 3 0.7570 0.1374 0.300 0.016 0.532 0.152
#> ERR863708 2 0.0000 0.8359 0.000 1.000 0.000 0.000
#> ERR863710 1 0.1302 0.8870 0.956 0.000 0.000 0.044
#> ERR863709 2 0.2830 0.7888 0.000 0.900 0.060 0.040
#> ERR863753 2 0.0000 0.8359 0.000 1.000 0.000 0.000
#> ERR863754 1 0.1854 0.8695 0.940 0.000 0.012 0.048
#> ERR863749 1 0.0707 0.8888 0.980 0.000 0.000 0.020
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> ERR863675 2 0.6170 0.46773 0.284 0.612 0.060 0.016 0.028
#> ERR863705 3 0.2741 0.77245 0.000 0.132 0.860 0.004 0.004
#> ERR863704 2 0.0703 0.83838 0.000 0.976 0.000 0.000 0.024
#> ERR863679 3 0.2548 0.77447 0.000 0.116 0.876 0.004 0.004
#> ERR863680 2 0.0609 0.83907 0.000 0.980 0.000 0.000 0.020
#> ERR863676 2 0.0703 0.83838 0.000 0.976 0.000 0.000 0.024
#> ERR863677 1 0.2355 0.75286 0.916 0.000 0.024 0.036 0.024
#> ERR863688 4 0.5440 0.07271 0.064 0.000 0.000 0.540 0.396
#> ERR863690 1 0.3237 0.79855 0.848 0.000 0.000 0.104 0.048
#> ERR863692 1 0.1569 0.79433 0.944 0.000 0.004 0.044 0.008
#> ERR863703 1 0.2818 0.80259 0.856 0.000 0.000 0.132 0.012
#> ERR863712 1 0.3832 0.67346 0.848 0.072 0.020 0.036 0.024
#> ERR863711 1 0.3684 0.69184 0.720 0.000 0.000 0.280 0.000
#> ERR863760 5 0.4557 0.44066 0.008 0.324 0.012 0.000 0.656
#> ERR863727 4 0.4235 0.09285 0.424 0.000 0.000 0.576 0.000
#> ERR863766 4 0.4540 0.12250 0.000 0.000 0.320 0.656 0.024
#> ERR863767 1 0.3074 0.77727 0.804 0.000 0.000 0.196 0.000
#> ERR863752 2 0.2471 0.74747 0.000 0.864 0.136 0.000 0.000
#> ERR863757 5 0.4837 0.39340 0.008 0.000 0.020 0.348 0.624
#> ERR863758 1 0.3365 0.79612 0.836 0.000 0.000 0.120 0.044
#> ERR863755 1 0.3999 0.58838 0.656 0.000 0.000 0.344 0.000
#> ERR863756 3 0.1686 0.75271 0.028 0.000 0.944 0.008 0.020
#> ERR863707 3 0.1864 0.77504 0.000 0.068 0.924 0.004 0.004
#> ERR863681 5 0.4749 0.50075 0.008 0.000 0.040 0.252 0.700
#> ERR863719 4 0.5803 0.22363 0.368 0.000 0.020 0.556 0.056
#> ERR863759 3 0.2773 0.76368 0.000 0.164 0.836 0.000 0.000
#> ERR863718 1 0.3639 0.78545 0.812 0.000 0.000 0.144 0.044
#> ERR863717 1 0.2966 0.78383 0.816 0.000 0.000 0.184 0.000
#> ERR863715 5 0.4126 0.47496 0.000 0.380 0.000 0.000 0.620
#> ERR863716 1 0.4313 0.51794 0.636 0.000 0.000 0.356 0.008
#> ERR863722 2 0.6551 0.45580 0.128 0.560 0.280 0.000 0.032
#> ERR863721 1 0.1768 0.78291 0.924 0.000 0.000 0.004 0.072
#> ERR863720 2 0.1121 0.82851 0.000 0.956 0.000 0.000 0.044
#> ERR863723 4 0.4397 0.02890 0.432 0.000 0.000 0.564 0.004
#> ERR863761 4 0.7757 -0.21659 0.000 0.096 0.292 0.440 0.172
#> ERR863735 4 0.4268 0.00825 0.444 0.000 0.000 0.556 0.000
#> ERR863734 3 0.4841 0.37111 0.000 0.000 0.560 0.416 0.024
#> ERR863736 5 0.2795 0.64480 0.000 0.100 0.028 0.000 0.872
#> ERR863729 5 0.3123 0.62301 0.000 0.184 0.004 0.000 0.812
#> ERR863728 1 0.1455 0.77965 0.952 0.000 0.008 0.032 0.008
#> ERR863731 1 0.3389 0.79633 0.836 0.000 0.000 0.116 0.048
#> ERR863764 2 0.5643 0.65042 0.128 0.712 0.120 0.008 0.032
#> ERR863740 4 0.1197 0.53840 0.048 0.000 0.000 0.952 0.000
#> ERR863765 4 0.4522 0.11586 0.000 0.000 0.316 0.660 0.024
#> ERR863762 3 0.1503 0.75340 0.008 0.000 0.952 0.020 0.020
#> ERR863724 4 0.1869 0.52402 0.036 0.000 0.016 0.936 0.012
#> ERR863733 3 0.6414 0.30948 0.112 0.284 0.572 0.000 0.032
#> ERR863732 3 0.1405 0.75609 0.016 0.000 0.956 0.008 0.020
#> ERR863730 4 0.1341 0.53941 0.056 0.000 0.000 0.944 0.000
#> ERR863742 4 0.1787 0.53178 0.044 0.000 0.016 0.936 0.004
#> ERR863763 1 0.2263 0.75375 0.920 0.000 0.020 0.036 0.024
#> ERR863741 5 0.2788 0.63351 0.064 0.008 0.032 0.004 0.892
#> ERR863743 1 0.3389 0.79633 0.836 0.000 0.000 0.116 0.048
#> ERR863745 2 0.0000 0.84232 0.000 1.000 0.000 0.000 0.000
#> ERR863744 4 0.4268 0.00300 0.444 0.000 0.000 0.556 0.000
#> ERR863746 1 0.4219 0.41872 0.584 0.000 0.000 0.416 0.000
#> ERR863748 3 0.4923 0.65003 0.108 0.108 0.756 0.000 0.028
#> ERR863747 3 0.2732 0.76499 0.000 0.160 0.840 0.000 0.000
#> ERR863694 5 0.6516 0.27219 0.096 0.340 0.036 0.000 0.528
#> ERR863693 1 0.1059 0.78423 0.968 0.000 0.004 0.020 0.008
#> ERR863686 5 0.5165 0.24497 0.048 0.000 0.000 0.376 0.576
#> ERR863678 1 0.3664 0.78029 0.840 0.000 0.024 0.096 0.040
#> ERR863685 3 0.4726 0.38614 0.000 0.000 0.580 0.400 0.020
#> ERR863689 1 0.1153 0.78421 0.964 0.000 0.004 0.024 0.008
#> ERR863691 1 0.1280 0.78242 0.960 0.000 0.008 0.024 0.008
#> ERR863682 1 0.5285 0.44037 0.584 0.000 0.000 0.356 0.060
#> ERR863695 2 0.0000 0.84232 0.000 1.000 0.000 0.000 0.000
#> ERR863683 4 0.1732 0.54364 0.080 0.000 0.000 0.920 0.000
#> ERR863684 1 0.1443 0.78489 0.948 0.000 0.004 0.004 0.044
#> ERR863702 4 0.5517 -0.01538 0.032 0.000 0.020 0.536 0.412
#> ERR863687 3 0.2773 0.76368 0.000 0.164 0.836 0.000 0.000
#> ERR863706 4 0.1626 0.47112 0.000 0.000 0.044 0.940 0.016
#> ERR863708 2 0.0000 0.84232 0.000 1.000 0.000 0.000 0.000
#> ERR863710 1 0.4264 0.72568 0.744 0.000 0.000 0.212 0.044
#> ERR863709 2 0.3530 0.74725 0.024 0.844 0.028 0.000 0.104
#> ERR863753 2 0.0000 0.84232 0.000 1.000 0.000 0.000 0.000
#> ERR863754 1 0.1768 0.78291 0.924 0.000 0.000 0.004 0.072
#> ERR863749 1 0.3508 0.72686 0.748 0.000 0.000 0.252 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> ERR863675 4 0.6841 0.3824 0.336 0.092 0.024 0.480 0.004 0.064
#> ERR863705 3 0.5266 0.6193 0.000 0.112 0.544 0.344 0.000 0.000
#> ERR863704 2 0.1814 0.9083 0.000 0.900 0.000 0.000 0.100 0.000
#> ERR863679 3 0.5362 0.6197 0.000 0.108 0.544 0.344 0.000 0.004
#> ERR863680 2 0.1610 0.9082 0.000 0.916 0.000 0.000 0.084 0.000
#> ERR863676 2 0.1814 0.9083 0.000 0.900 0.000 0.000 0.100 0.000
#> ERR863677 4 0.4379 0.4189 0.376 0.000 0.004 0.600 0.004 0.016
#> ERR863688 6 0.5379 0.1712 0.072 0.000 0.000 0.016 0.396 0.516
#> ERR863690 1 0.0291 0.7011 0.992 0.000 0.000 0.000 0.004 0.004
#> ERR863692 1 0.4234 0.3167 0.644 0.000 0.000 0.324 0.000 0.032
#> ERR863703 1 0.2586 0.6728 0.868 0.000 0.000 0.032 0.000 0.100
#> ERR863712 4 0.5426 0.4175 0.372 0.012 0.004 0.544 0.004 0.064
#> ERR863711 1 0.4011 0.6141 0.732 0.000 0.000 0.056 0.000 0.212
#> ERR863760 5 0.3448 0.4952 0.004 0.280 0.000 0.000 0.716 0.000
#> ERR863727 6 0.4616 0.4624 0.316 0.000 0.000 0.060 0.000 0.624
#> ERR863766 6 0.6335 -0.0612 0.004 0.000 0.184 0.332 0.020 0.460
#> ERR863767 1 0.5492 0.2982 0.552 0.000 0.000 0.280 0.000 0.168
#> ERR863752 3 0.3728 0.3551 0.000 0.344 0.652 0.004 0.000 0.000
#> ERR863757 5 0.4840 0.4868 0.080 0.000 0.000 0.012 0.668 0.240
#> ERR863758 1 0.0405 0.7028 0.988 0.000 0.000 0.000 0.004 0.008
#> ERR863755 1 0.4083 0.0763 0.532 0.000 0.000 0.008 0.000 0.460
#> ERR863756 3 0.3684 0.5924 0.000 0.000 0.628 0.372 0.000 0.000
#> ERR863707 3 0.4493 0.6116 0.000 0.044 0.612 0.344 0.000 0.000
#> ERR863681 5 0.2959 0.6881 0.008 0.000 0.000 0.024 0.844 0.124
#> ERR863719 6 0.5457 0.5451 0.116 0.000 0.000 0.076 0.132 0.676
#> ERR863759 3 0.2092 0.6302 0.000 0.124 0.876 0.000 0.000 0.000
#> ERR863718 1 0.0858 0.7027 0.968 0.000 0.000 0.000 0.004 0.028
#> ERR863717 1 0.3700 0.6392 0.780 0.000 0.000 0.068 0.000 0.152
#> ERR863715 5 0.3784 0.5649 0.000 0.308 0.000 0.012 0.680 0.000
#> ERR863716 1 0.3360 0.4405 0.732 0.000 0.000 0.004 0.000 0.264
#> ERR863722 3 0.4103 0.2465 0.000 0.004 0.544 0.448 0.004 0.000
#> ERR863721 1 0.3265 0.5753 0.836 0.000 0.000 0.108 0.040 0.016
#> ERR863720 2 0.1814 0.9083 0.000 0.900 0.000 0.000 0.100 0.000
#> ERR863723 6 0.3774 0.4482 0.328 0.000 0.000 0.008 0.000 0.664
#> ERR863761 4 0.7966 -0.2833 0.000 0.092 0.044 0.332 0.260 0.272
#> ERR863735 6 0.3409 0.5007 0.300 0.000 0.000 0.000 0.000 0.700
#> ERR863734 4 0.6478 -0.3670 0.000 0.000 0.328 0.356 0.016 0.300
#> ERR863736 5 0.1555 0.7194 0.000 0.060 0.004 0.000 0.932 0.004
#> ERR863729 5 0.2980 0.6761 0.000 0.180 0.000 0.012 0.808 0.000
#> ERR863728 4 0.4209 0.4101 0.384 0.000 0.000 0.596 0.000 0.020
#> ERR863731 1 0.0405 0.7028 0.988 0.000 0.000 0.000 0.004 0.008
#> ERR863764 3 0.5595 0.2679 0.000 0.132 0.504 0.360 0.004 0.000
#> ERR863740 6 0.1926 0.6547 0.068 0.000 0.000 0.020 0.000 0.912
#> ERR863765 6 0.6474 -0.1044 0.008 0.000 0.184 0.364 0.020 0.424
#> ERR863762 3 0.4328 0.5818 0.000 0.000 0.620 0.352 0.004 0.024
#> ERR863724 6 0.2288 0.6457 0.072 0.000 0.000 0.028 0.004 0.896
#> ERR863733 3 0.2946 0.5659 0.000 0.004 0.808 0.184 0.004 0.000
#> ERR863732 3 0.3672 0.5944 0.000 0.000 0.632 0.368 0.000 0.000
#> ERR863730 6 0.3123 0.6536 0.112 0.000 0.000 0.056 0.000 0.832
#> ERR863742 6 0.1471 0.6503 0.064 0.000 0.000 0.000 0.004 0.932
#> ERR863763 4 0.5112 0.4160 0.376 0.000 0.004 0.552 0.004 0.064
#> ERR863741 5 0.2349 0.7143 0.020 0.000 0.008 0.080 0.892 0.000
#> ERR863743 1 0.0405 0.7028 0.988 0.000 0.000 0.000 0.004 0.008
#> ERR863745 2 0.0000 0.9101 0.000 1.000 0.000 0.000 0.000 0.000
#> ERR863744 6 0.3953 0.6230 0.132 0.000 0.000 0.104 0.000 0.764
#> ERR863746 6 0.4824 0.2259 0.420 0.000 0.000 0.056 0.000 0.524
#> ERR863748 3 0.2520 0.5912 0.000 0.000 0.844 0.152 0.004 0.000
#> ERR863747 3 0.2092 0.6302 0.000 0.124 0.876 0.000 0.000 0.000
#> ERR863694 5 0.4414 0.6606 0.008 0.148 0.012 0.080 0.752 0.000
#> ERR863693 4 0.4445 0.3852 0.396 0.000 0.000 0.572 0.000 0.032
#> ERR863686 5 0.5365 0.4565 0.160 0.000 0.000 0.008 0.616 0.216
#> ERR863678 4 0.5818 0.2670 0.388 0.000 0.000 0.448 0.004 0.160
#> ERR863685 4 0.6541 -0.3700 0.000 0.000 0.328 0.356 0.020 0.296
#> ERR863689 4 0.4445 0.3852 0.396 0.000 0.000 0.572 0.000 0.032
#> ERR863691 1 0.4523 -0.1189 0.516 0.000 0.000 0.452 0.000 0.032
#> ERR863682 1 0.5062 0.3337 0.648 0.000 0.000 0.012 0.100 0.240
#> ERR863695 2 0.0000 0.9101 0.000 1.000 0.000 0.000 0.000 0.000
#> ERR863683 6 0.2923 0.6559 0.100 0.000 0.000 0.052 0.000 0.848
#> ERR863684 1 0.2994 0.6031 0.856 0.000 0.000 0.096 0.028 0.020
#> ERR863702 6 0.5590 0.0844 0.064 0.000 0.000 0.032 0.420 0.484
#> ERR863687 3 0.2092 0.6302 0.000 0.124 0.876 0.000 0.000 0.000
#> ERR863706 6 0.1862 0.6079 0.024 0.000 0.004 0.020 0.020 0.932
#> ERR863708 2 0.0000 0.9101 0.000 1.000 0.000 0.000 0.000 0.000
#> ERR863710 1 0.1196 0.6997 0.952 0.000 0.000 0.000 0.008 0.040
#> ERR863709 2 0.3231 0.7927 0.000 0.800 0.008 0.012 0.180 0.000
#> ERR863753 2 0.0000 0.9101 0.000 1.000 0.000 0.000 0.000 0.000
#> ERR863754 1 0.2797 0.6169 0.872 0.000 0.000 0.076 0.036 0.016
#> ERR863749 1 0.3835 0.6340 0.756 0.000 0.000 0.056 0.000 0.188
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)
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 17118 rows and 78 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.843 0.931 0.968 0.5036 0.494 0.494
#> 3 3 0.719 0.813 0.918 0.3126 0.740 0.522
#> 4 4 0.632 0.759 0.857 0.0804 0.924 0.782
#> 5 5 0.571 0.637 0.779 0.0646 0.887 0.654
#> 6 6 0.712 0.654 0.810 0.0424 0.933 0.745
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
#> ERR863675 2 0.0000 0.949 0.000 1.000
#> ERR863705 2 0.0000 0.949 0.000 1.000
#> ERR863704 2 0.0000 0.949 0.000 1.000
#> ERR863679 2 0.0000 0.949 0.000 1.000
#> ERR863680 2 0.0000 0.949 0.000 1.000
#> ERR863676 2 0.0000 0.949 0.000 1.000
#> ERR863677 2 0.5059 0.862 0.112 0.888
#> ERR863688 1 0.0000 0.982 1.000 0.000
#> ERR863690 1 0.0000 0.982 1.000 0.000
#> ERR863692 1 0.0000 0.982 1.000 0.000
#> ERR863703 1 0.0000 0.982 1.000 0.000
#> ERR863712 2 0.9710 0.374 0.400 0.600
#> ERR863711 1 0.0000 0.982 1.000 0.000
#> ERR863760 2 0.0000 0.949 0.000 1.000
#> ERR863727 1 0.0000 0.982 1.000 0.000
#> ERR863766 1 0.4690 0.885 0.900 0.100
#> ERR863767 1 0.0000 0.982 1.000 0.000
#> ERR863752 2 0.0000 0.949 0.000 1.000
#> ERR863757 1 0.0000 0.982 1.000 0.000
#> ERR863758 1 0.0000 0.982 1.000 0.000
#> ERR863755 1 0.0000 0.982 1.000 0.000
#> ERR863756 2 0.1414 0.937 0.020 0.980
#> ERR863707 2 0.0000 0.949 0.000 1.000
#> ERR863681 2 0.7745 0.722 0.228 0.772
#> ERR863719 1 0.2043 0.954 0.968 0.032
#> ERR863759 2 0.0000 0.949 0.000 1.000
#> ERR863718 1 0.0000 0.982 1.000 0.000
#> ERR863717 1 0.0000 0.982 1.000 0.000
#> ERR863715 2 0.0000 0.949 0.000 1.000
#> ERR863716 1 0.0000 0.982 1.000 0.000
#> ERR863722 2 0.0000 0.949 0.000 1.000
#> ERR863721 1 0.0000 0.982 1.000 0.000
#> ERR863720 2 0.0000 0.949 0.000 1.000
#> ERR863723 1 0.0000 0.982 1.000 0.000
#> ERR863761 2 0.0000 0.949 0.000 1.000
#> ERR863735 1 0.0000 0.982 1.000 0.000
#> ERR863734 2 0.8713 0.615 0.292 0.708
#> ERR863736 2 0.0000 0.949 0.000 1.000
#> ERR863729 2 0.0000 0.949 0.000 1.000
#> ERR863728 1 0.6712 0.782 0.824 0.176
#> ERR863731 1 0.0000 0.982 1.000 0.000
#> ERR863764 2 0.0000 0.949 0.000 1.000
#> ERR863740 1 0.0000 0.982 1.000 0.000
#> ERR863765 1 0.8144 0.659 0.748 0.252
#> ERR863762 2 0.1843 0.932 0.028 0.972
#> ERR863724 1 0.4562 0.890 0.904 0.096
#> ERR863733 2 0.0000 0.949 0.000 1.000
#> ERR863732 2 0.0000 0.949 0.000 1.000
#> ERR863730 1 0.0000 0.982 1.000 0.000
#> ERR863742 1 0.0000 0.982 1.000 0.000
#> ERR863763 2 0.7453 0.742 0.212 0.788
#> ERR863741 2 0.6531 0.802 0.168 0.832
#> ERR863743 1 0.0000 0.982 1.000 0.000
#> ERR863745 2 0.0000 0.949 0.000 1.000
#> ERR863744 1 0.0000 0.982 1.000 0.000
#> ERR863746 1 0.0000 0.982 1.000 0.000
#> ERR863748 2 0.0000 0.949 0.000 1.000
#> ERR863747 2 0.0000 0.949 0.000 1.000
#> ERR863694 2 0.0376 0.947 0.004 0.996
#> ERR863693 1 0.0000 0.982 1.000 0.000
#> ERR863686 1 0.0000 0.982 1.000 0.000
#> ERR863678 2 0.8813 0.614 0.300 0.700
#> ERR863685 2 0.2948 0.914 0.052 0.948
#> ERR863689 1 0.0000 0.982 1.000 0.000
#> ERR863691 1 0.0376 0.978 0.996 0.004
#> ERR863682 1 0.0000 0.982 1.000 0.000
#> ERR863695 2 0.0000 0.949 0.000 1.000
#> ERR863683 1 0.0000 0.982 1.000 0.000
#> ERR863684 1 0.0000 0.982 1.000 0.000
#> ERR863702 1 0.0000 0.982 1.000 0.000
#> ERR863687 2 0.0000 0.949 0.000 1.000
#> ERR863706 1 0.1184 0.969 0.984 0.016
#> ERR863708 2 0.0000 0.949 0.000 1.000
#> ERR863710 1 0.0000 0.982 1.000 0.000
#> ERR863709 2 0.0000 0.949 0.000 1.000
#> ERR863753 2 0.0000 0.949 0.000 1.000
#> ERR863754 1 0.0000 0.982 1.000 0.000
#> ERR863749 1 0.0000 0.982 1.000 0.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> ERR863675 2 0.0000 0.8840 0.000 1.000 0.000
#> ERR863705 3 0.0000 0.8609 0.000 0.000 1.000
#> ERR863704 2 0.2261 0.8475 0.000 0.932 0.068
#> ERR863679 3 0.0000 0.8609 0.000 0.000 1.000
#> ERR863680 2 0.0237 0.8840 0.000 0.996 0.004
#> ERR863676 2 0.0237 0.8840 0.000 0.996 0.004
#> ERR863677 2 0.0237 0.8832 0.004 0.996 0.000
#> ERR863688 1 0.0424 0.9424 0.992 0.000 0.008
#> ERR863690 1 0.0592 0.9387 0.988 0.012 0.000
#> ERR863692 1 0.2066 0.9002 0.940 0.060 0.000
#> ERR863703 1 0.0424 0.9407 0.992 0.008 0.000
#> ERR863712 2 0.0000 0.8840 0.000 1.000 0.000
#> ERR863711 1 0.0000 0.9444 1.000 0.000 0.000
#> ERR863760 3 0.5810 0.4822 0.000 0.336 0.664
#> ERR863727 1 0.0000 0.9444 1.000 0.000 0.000
#> ERR863766 3 0.4654 0.6943 0.208 0.000 0.792
#> ERR863767 1 0.0000 0.9444 1.000 0.000 0.000
#> ERR863752 3 0.6291 0.2285 0.000 0.468 0.532
#> ERR863757 1 0.2165 0.9022 0.936 0.000 0.064
#> ERR863758 1 0.0000 0.9444 1.000 0.000 0.000
#> ERR863755 1 0.0000 0.9444 1.000 0.000 0.000
#> ERR863756 3 0.0000 0.8609 0.000 0.000 1.000
#> ERR863707 3 0.0000 0.8609 0.000 0.000 1.000
#> ERR863681 3 0.3619 0.7767 0.136 0.000 0.864
#> ERR863719 1 0.4121 0.7899 0.832 0.000 0.168
#> ERR863759 3 0.1964 0.8385 0.000 0.056 0.944
#> ERR863718 1 0.0000 0.9444 1.000 0.000 0.000
#> ERR863717 1 0.0000 0.9444 1.000 0.000 0.000
#> ERR863715 3 0.3752 0.7815 0.000 0.144 0.856
#> ERR863716 1 0.0000 0.9444 1.000 0.000 0.000
#> ERR863722 2 0.0237 0.8840 0.000 0.996 0.004
#> ERR863721 2 0.3879 0.7833 0.152 0.848 0.000
#> ERR863720 2 0.0237 0.8840 0.000 0.996 0.004
#> ERR863723 1 0.0237 0.9437 0.996 0.000 0.004
#> ERR863761 3 0.0000 0.8609 0.000 0.000 1.000
#> ERR863735 1 0.0000 0.9444 1.000 0.000 0.000
#> ERR863734 3 0.0424 0.8582 0.008 0.000 0.992
#> ERR863736 3 0.0000 0.8609 0.000 0.000 1.000
#> ERR863729 3 0.4796 0.7119 0.000 0.220 0.780
#> ERR863728 2 0.5216 0.6632 0.260 0.740 0.000
#> ERR863731 1 0.1643 0.9140 0.956 0.044 0.000
#> ERR863764 2 0.3412 0.7843 0.000 0.876 0.124
#> ERR863740 1 0.1031 0.9338 0.976 0.000 0.024
#> ERR863765 3 0.2261 0.8255 0.068 0.000 0.932
#> ERR863762 3 0.0000 0.8609 0.000 0.000 1.000
#> ERR863724 1 0.4605 0.7392 0.796 0.000 0.204
#> ERR863733 3 0.6309 0.1818 0.000 0.496 0.504
#> ERR863732 3 0.0000 0.8609 0.000 0.000 1.000
#> ERR863730 1 0.0424 0.9424 0.992 0.000 0.008
#> ERR863742 1 0.2878 0.8728 0.904 0.000 0.096
#> ERR863763 2 0.0000 0.8840 0.000 1.000 0.000
#> ERR863741 2 0.2774 0.8329 0.008 0.920 0.072
#> ERR863743 1 0.0237 0.9428 0.996 0.004 0.000
#> ERR863745 2 0.1753 0.8624 0.000 0.952 0.048
#> ERR863744 1 0.0424 0.9424 0.992 0.000 0.008
#> ERR863746 1 0.0000 0.9444 1.000 0.000 0.000
#> ERR863748 3 0.4842 0.7157 0.000 0.224 0.776
#> ERR863747 3 0.0000 0.8609 0.000 0.000 1.000
#> ERR863694 2 0.0000 0.8840 0.000 1.000 0.000
#> ERR863693 1 0.6126 0.2716 0.600 0.400 0.000
#> ERR863686 1 0.0237 0.9437 0.996 0.000 0.004
#> ERR863678 2 0.3619 0.8032 0.136 0.864 0.000
#> ERR863685 3 0.0237 0.8595 0.004 0.000 0.996
#> ERR863689 2 0.6235 0.2685 0.436 0.564 0.000
#> ERR863691 2 0.3412 0.8081 0.124 0.876 0.000
#> ERR863682 1 0.0000 0.9444 1.000 0.000 0.000
#> ERR863695 2 0.0237 0.8840 0.000 0.996 0.004
#> ERR863683 1 0.0424 0.9424 0.992 0.000 0.008
#> ERR863684 2 0.6309 0.0452 0.500 0.500 0.000
#> ERR863702 1 0.3686 0.8263 0.860 0.000 0.140
#> ERR863687 3 0.0892 0.8541 0.000 0.020 0.980
#> ERR863706 3 0.6180 0.2597 0.416 0.000 0.584
#> ERR863708 2 0.1031 0.8762 0.000 0.976 0.024
#> ERR863710 1 0.0000 0.9444 1.000 0.000 0.000
#> ERR863709 2 0.0000 0.8840 0.000 1.000 0.000
#> ERR863753 2 0.1643 0.8651 0.000 0.956 0.044
#> ERR863754 1 0.5621 0.5177 0.692 0.308 0.000
#> ERR863749 1 0.0000 0.9444 1.000 0.000 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> ERR863675 2 0.0188 0.730 0.000 0.996 0.000 0.004
#> ERR863705 3 0.2530 0.814 0.000 0.000 0.888 0.112
#> ERR863704 2 0.5624 0.620 0.000 0.724 0.128 0.148
#> ERR863679 3 0.0469 0.857 0.000 0.000 0.988 0.012
#> ERR863680 2 0.3852 0.718 0.000 0.808 0.012 0.180
#> ERR863676 2 0.3790 0.725 0.000 0.820 0.016 0.164
#> ERR863677 2 0.1576 0.726 0.000 0.948 0.004 0.048
#> ERR863688 1 0.4560 0.601 0.700 0.000 0.004 0.296
#> ERR863690 1 0.3873 0.713 0.772 0.228 0.000 0.000
#> ERR863692 1 0.3768 0.789 0.808 0.184 0.000 0.008
#> ERR863703 1 0.2197 0.887 0.916 0.080 0.000 0.004
#> ERR863712 2 0.0336 0.731 0.000 0.992 0.000 0.008
#> ERR863711 1 0.0524 0.920 0.988 0.000 0.004 0.008
#> ERR863760 3 0.3198 0.809 0.000 0.080 0.880 0.040
#> ERR863727 1 0.2271 0.905 0.928 0.052 0.008 0.012
#> ERR863766 3 0.1209 0.849 0.032 0.000 0.964 0.004
#> ERR863767 1 0.0188 0.919 0.996 0.000 0.000 0.004
#> ERR863752 3 0.5670 0.619 0.000 0.152 0.720 0.128
#> ERR863757 1 0.2266 0.872 0.912 0.000 0.084 0.004
#> ERR863758 1 0.0707 0.918 0.980 0.020 0.000 0.000
#> ERR863755 1 0.0524 0.920 0.988 0.008 0.000 0.004
#> ERR863756 3 0.2412 0.839 0.000 0.008 0.908 0.084
#> ERR863707 3 0.0336 0.858 0.000 0.000 0.992 0.008
#> ERR863681 4 0.6897 0.448 0.180 0.000 0.228 0.592
#> ERR863719 1 0.6456 0.714 0.708 0.148 0.100 0.044
#> ERR863759 3 0.3667 0.799 0.000 0.056 0.856 0.088
#> ERR863718 1 0.0592 0.918 0.984 0.016 0.000 0.000
#> ERR863717 1 0.2473 0.887 0.908 0.080 0.000 0.012
#> ERR863715 4 0.4203 0.689 0.000 0.068 0.108 0.824
#> ERR863716 1 0.0188 0.920 0.996 0.004 0.000 0.000
#> ERR863722 4 0.5345 0.185 0.000 0.428 0.012 0.560
#> ERR863721 2 0.2593 0.701 0.104 0.892 0.000 0.004
#> ERR863720 2 0.3881 0.722 0.000 0.812 0.016 0.172
#> ERR863723 1 0.0921 0.913 0.972 0.000 0.028 0.000
#> ERR863761 3 0.0188 0.857 0.000 0.000 0.996 0.004
#> ERR863735 1 0.0000 0.919 1.000 0.000 0.000 0.000
#> ERR863734 3 0.1174 0.854 0.020 0.000 0.968 0.012
#> ERR863736 3 0.0188 0.857 0.000 0.000 0.996 0.004
#> ERR863729 4 0.2843 0.702 0.000 0.020 0.088 0.892
#> ERR863728 2 0.4793 0.638 0.204 0.756 0.000 0.040
#> ERR863731 1 0.1792 0.890 0.932 0.068 0.000 0.000
#> ERR863764 2 0.5358 0.371 0.000 0.700 0.252 0.048
#> ERR863740 1 0.0817 0.915 0.976 0.000 0.024 0.000
#> ERR863765 3 0.3172 0.722 0.160 0.000 0.840 0.000
#> ERR863762 3 0.3324 0.808 0.012 0.000 0.852 0.136
#> ERR863724 1 0.2706 0.875 0.900 0.000 0.020 0.080
#> ERR863733 3 0.6653 0.427 0.000 0.328 0.568 0.104
#> ERR863732 3 0.0921 0.856 0.000 0.000 0.972 0.028
#> ERR863730 1 0.3398 0.889 0.888 0.036 0.028 0.048
#> ERR863742 1 0.2469 0.854 0.892 0.000 0.108 0.000
#> ERR863763 2 0.0188 0.731 0.000 0.996 0.000 0.004
#> ERR863741 4 0.2530 0.694 0.000 0.112 0.000 0.888
#> ERR863743 1 0.1022 0.913 0.968 0.032 0.000 0.000
#> ERR863745 2 0.4406 0.699 0.000 0.780 0.028 0.192
#> ERR863744 1 0.0779 0.920 0.980 0.000 0.004 0.016
#> ERR863746 1 0.1745 0.916 0.952 0.020 0.008 0.020
#> ERR863748 3 0.6575 0.201 0.000 0.080 0.508 0.412
#> ERR863747 3 0.2111 0.844 0.000 0.024 0.932 0.044
#> ERR863694 4 0.5441 0.493 0.012 0.396 0.004 0.588
#> ERR863693 2 0.2805 0.701 0.100 0.888 0.000 0.012
#> ERR863686 1 0.1975 0.914 0.944 0.028 0.012 0.016
#> ERR863678 2 0.7613 0.179 0.408 0.440 0.012 0.140
#> ERR863685 3 0.0524 0.857 0.008 0.000 0.988 0.004
#> ERR863689 2 0.4459 0.652 0.188 0.780 0.000 0.032
#> ERR863691 2 0.4553 0.646 0.180 0.780 0.000 0.040
#> ERR863682 1 0.0000 0.919 1.000 0.000 0.000 0.000
#> ERR863695 2 0.3808 0.721 0.000 0.812 0.012 0.176
#> ERR863683 1 0.1174 0.916 0.968 0.000 0.020 0.012
#> ERR863684 2 0.3208 0.663 0.148 0.848 0.000 0.004
#> ERR863702 1 0.4867 0.766 0.784 0.004 0.144 0.068
#> ERR863687 3 0.1706 0.848 0.000 0.036 0.948 0.016
#> ERR863706 3 0.3356 0.701 0.176 0.000 0.824 0.000
#> ERR863708 2 0.3718 0.723 0.000 0.820 0.012 0.168
#> ERR863710 1 0.0000 0.919 1.000 0.000 0.000 0.000
#> ERR863709 2 0.3052 0.728 0.000 0.860 0.004 0.136
#> ERR863753 2 0.4050 0.719 0.000 0.808 0.024 0.168
#> ERR863754 2 0.3751 0.606 0.196 0.800 0.000 0.004
#> ERR863749 1 0.0188 0.920 0.996 0.004 0.000 0.000
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> ERR863675 4 0.3876 6.48e-01 0.000 0.316 0.000 0.684 0.000
#> ERR863705 3 0.4315 5.66e-01 0.000 0.000 0.700 0.024 0.276
#> ERR863704 2 0.2688 7.19e-01 0.000 0.896 0.056 0.036 0.012
#> ERR863679 3 0.1653 7.03e-01 0.000 0.004 0.944 0.028 0.024
#> ERR863680 2 0.0912 8.04e-01 0.000 0.972 0.000 0.012 0.016
#> ERR863676 2 0.1419 8.04e-01 0.000 0.956 0.016 0.016 0.012
#> ERR863677 4 0.3838 6.71e-01 0.000 0.280 0.004 0.716 0.000
#> ERR863688 1 0.3912 6.57e-01 0.752 0.000 0.000 0.020 0.228
#> ERR863690 1 0.5040 6.14e-01 0.680 0.084 0.000 0.236 0.000
#> ERR863692 4 0.3774 4.99e-01 0.296 0.000 0.000 0.704 0.000
#> ERR863703 1 0.3958 7.49e-01 0.776 0.040 0.000 0.184 0.000
#> ERR863712 4 0.3969 6.60e-01 0.004 0.304 0.000 0.692 0.000
#> ERR863711 1 0.2179 8.20e-01 0.888 0.000 0.000 0.112 0.000
#> ERR863760 3 0.6083 1.18e-01 0.000 0.452 0.456 0.076 0.016
#> ERR863727 1 0.2536 7.90e-01 0.868 0.000 0.000 0.128 0.004
#> ERR863766 3 0.2299 7.02e-01 0.052 0.000 0.912 0.032 0.004
#> ERR863767 1 0.3289 7.90e-01 0.816 0.004 0.008 0.172 0.000
#> ERR863752 2 0.5674 2.20e-01 0.000 0.596 0.316 0.080 0.008
#> ERR863757 1 0.3184 7.39e-01 0.852 0.000 0.100 0.048 0.000
#> ERR863758 1 0.2605 7.99e-01 0.852 0.000 0.000 0.148 0.000
#> ERR863755 1 0.1965 8.26e-01 0.904 0.000 0.000 0.096 0.000
#> ERR863756 3 0.5467 5.64e-01 0.000 0.008 0.672 0.204 0.116
#> ERR863707 3 0.2444 6.96e-01 0.000 0.012 0.904 0.068 0.016
#> ERR863681 3 0.8597 5.52e-02 0.268 0.016 0.348 0.116 0.252
#> ERR863719 4 0.5447 4.48e-01 0.172 0.000 0.168 0.660 0.000
#> ERR863759 3 0.6165 5.46e-01 0.000 0.180 0.644 0.136 0.040
#> ERR863718 1 0.1732 8.25e-01 0.920 0.000 0.000 0.080 0.000
#> ERR863717 1 0.3452 7.24e-01 0.756 0.000 0.000 0.244 0.000
#> ERR863715 5 0.3819 6.80e-01 0.000 0.228 0.016 0.000 0.756
#> ERR863716 1 0.0510 8.24e-01 0.984 0.000 0.000 0.016 0.000
#> ERR863722 5 0.6797 2.86e-01 0.000 0.156 0.024 0.328 0.492
#> ERR863721 4 0.4701 6.99e-01 0.060 0.236 0.000 0.704 0.000
#> ERR863720 2 0.0451 8.10e-01 0.000 0.988 0.000 0.004 0.008
#> ERR863723 1 0.0671 8.16e-01 0.980 0.000 0.004 0.016 0.000
#> ERR863761 3 0.4114 6.75e-01 0.032 0.040 0.828 0.088 0.012
#> ERR863735 1 0.0609 8.25e-01 0.980 0.000 0.000 0.020 0.000
#> ERR863734 3 0.1082 7.04e-01 0.000 0.000 0.964 0.028 0.008
#> ERR863736 3 0.4854 6.61e-01 0.044 0.064 0.788 0.088 0.016
#> ERR863729 5 0.2304 7.67e-01 0.000 0.100 0.008 0.000 0.892
#> ERR863728 2 0.6742 -1.58e-01 0.264 0.460 0.000 0.272 0.004
#> ERR863731 1 0.3098 7.95e-01 0.836 0.016 0.000 0.148 0.000
#> ERR863764 4 0.5651 4.37e-01 0.000 0.092 0.216 0.668 0.024
#> ERR863740 1 0.0451 8.18e-01 0.988 0.000 0.004 0.008 0.000
#> ERR863765 3 0.4665 5.42e-01 0.260 0.000 0.692 0.048 0.000
#> ERR863762 3 0.5239 5.93e-01 0.004 0.000 0.696 0.144 0.156
#> ERR863724 1 0.4956 6.72e-01 0.768 0.004 0.100 0.088 0.040
#> ERR863733 4 0.6597 7.31e-02 0.000 0.044 0.324 0.536 0.096
#> ERR863732 3 0.3669 6.60e-01 0.000 0.000 0.816 0.128 0.056
#> ERR863730 1 0.6218 5.67e-01 0.644 0.000 0.064 0.200 0.092
#> ERR863742 1 0.2305 7.81e-01 0.896 0.000 0.092 0.012 0.000
#> ERR863763 4 0.4047 6.45e-01 0.004 0.320 0.000 0.676 0.000
#> ERR863741 5 0.2784 7.71e-01 0.004 0.108 0.000 0.016 0.872
#> ERR863743 1 0.2605 7.99e-01 0.852 0.000 0.000 0.148 0.000
#> ERR863745 2 0.0703 8.00e-01 0.000 0.976 0.000 0.000 0.024
#> ERR863744 1 0.3088 8.02e-01 0.828 0.000 0.004 0.164 0.004
#> ERR863746 1 0.2445 8.14e-01 0.884 0.000 0.004 0.108 0.004
#> ERR863748 3 0.7749 4.11e-05 0.000 0.084 0.400 0.176 0.340
#> ERR863747 3 0.3009 6.96e-01 0.000 0.080 0.876 0.028 0.016
#> ERR863694 4 0.6025 2.66e-01 0.004 0.120 0.000 0.552 0.324
#> ERR863693 4 0.4528 7.03e-01 0.060 0.212 0.000 0.728 0.000
#> ERR863686 1 0.2966 7.76e-01 0.848 0.000 0.016 0.136 0.000
#> ERR863678 1 0.7856 1.68e-01 0.448 0.304 0.008 0.144 0.096
#> ERR863685 3 0.2368 7.00e-01 0.024 0.016 0.920 0.032 0.008
#> ERR863689 4 0.6951 4.94e-01 0.224 0.272 0.000 0.484 0.020
#> ERR863691 4 0.5258 6.43e-01 0.180 0.140 0.000 0.680 0.000
#> ERR863682 1 0.0566 8.18e-01 0.984 0.000 0.004 0.012 0.000
#> ERR863695 2 0.1386 7.96e-01 0.000 0.952 0.000 0.032 0.016
#> ERR863683 1 0.0566 8.21e-01 0.984 0.000 0.004 0.012 0.000
#> ERR863684 4 0.4630 6.97e-01 0.088 0.176 0.000 0.736 0.000
#> ERR863702 1 0.6982 4.65e-01 0.568 0.000 0.152 0.208 0.072
#> ERR863687 3 0.4700 6.29e-01 0.000 0.160 0.752 0.076 0.012
#> ERR863706 3 0.5474 4.09e-01 0.348 0.000 0.576 0.076 0.000
#> ERR863708 2 0.0613 8.12e-01 0.000 0.984 0.004 0.008 0.004
#> ERR863710 1 0.1341 8.28e-01 0.944 0.000 0.000 0.056 0.000
#> ERR863709 2 0.1628 7.76e-01 0.000 0.936 0.000 0.056 0.008
#> ERR863753 2 0.0486 8.11e-01 0.000 0.988 0.004 0.004 0.004
#> ERR863754 4 0.5411 6.64e-01 0.160 0.176 0.000 0.664 0.000
#> ERR863749 1 0.2329 8.12e-01 0.876 0.000 0.000 0.124 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> ERR863675 4 0.1471 0.8657 0.000 0.064 0.004 0.932 0.000 0.000
#> ERR863705 3 0.4756 0.2845 0.000 0.000 0.540 0.000 0.408 0.052
#> ERR863704 2 0.2053 0.7472 0.000 0.888 0.108 0.000 0.004 0.000
#> ERR863679 3 0.3915 0.5412 0.000 0.000 0.692 0.004 0.016 0.288
#> ERR863680 2 0.1262 0.7958 0.000 0.956 0.000 0.020 0.016 0.008
#> ERR863676 2 0.1232 0.8058 0.000 0.956 0.024 0.016 0.004 0.000
#> ERR863677 4 0.1082 0.8679 0.000 0.040 0.000 0.956 0.000 0.004
#> ERR863688 1 0.4303 0.5687 0.656 0.000 0.012 0.008 0.316 0.008
#> ERR863690 1 0.3991 0.7011 0.748 0.044 0.000 0.200 0.000 0.008
#> ERR863692 4 0.1196 0.8481 0.040 0.008 0.000 0.952 0.000 0.000
#> ERR863703 1 0.3907 0.7504 0.784 0.108 0.000 0.100 0.000 0.008
#> ERR863712 4 0.1075 0.8678 0.000 0.048 0.000 0.952 0.000 0.000
#> ERR863711 1 0.0725 0.8670 0.976 0.000 0.000 0.012 0.000 0.012
#> ERR863760 2 0.3854 0.1675 0.000 0.536 0.464 0.000 0.000 0.000
#> ERR863727 1 0.3845 0.7730 0.812 0.000 0.056 0.100 0.024 0.008
#> ERR863766 3 0.3187 0.6079 0.012 0.000 0.796 0.004 0.000 0.188
#> ERR863767 1 0.2195 0.8478 0.904 0.016 0.000 0.068 0.000 0.012
#> ERR863752 2 0.2909 0.6981 0.000 0.836 0.028 0.000 0.000 0.136
#> ERR863757 1 0.4169 0.6092 0.724 0.000 0.236 0.012 0.016 0.012
#> ERR863758 1 0.2094 0.8490 0.908 0.016 0.000 0.068 0.000 0.008
#> ERR863755 1 0.1053 0.8682 0.964 0.000 0.000 0.020 0.012 0.004
#> ERR863756 6 0.1584 0.4227 0.000 0.000 0.064 0.008 0.000 0.928
#> ERR863707 3 0.4181 0.4399 0.000 0.000 0.600 0.012 0.004 0.384
#> ERR863681 3 0.5574 0.4406 0.064 0.012 0.672 0.028 0.204 0.020
#> ERR863719 4 0.2745 0.7982 0.012 0.000 0.044 0.884 0.008 0.052
#> ERR863759 6 0.4402 0.2619 0.000 0.268 0.060 0.000 0.000 0.672
#> ERR863718 1 0.0865 0.8674 0.964 0.000 0.000 0.036 0.000 0.000
#> ERR863717 1 0.1555 0.8663 0.932 0.000 0.004 0.060 0.000 0.004
#> ERR863715 5 0.3426 0.5483 0.000 0.220 0.012 0.004 0.764 0.000
#> ERR863716 1 0.1026 0.8639 0.968 0.000 0.008 0.012 0.004 0.008
#> ERR863722 4 0.4801 0.5598 0.000 0.020 0.012 0.672 0.264 0.032
#> ERR863721 4 0.0935 0.8684 0.004 0.032 0.000 0.964 0.000 0.000
#> ERR863720 2 0.1477 0.7972 0.000 0.940 0.048 0.008 0.004 0.000
#> ERR863723 1 0.0692 0.8604 0.976 0.000 0.020 0.000 0.000 0.004
#> ERR863761 3 0.1411 0.6070 0.000 0.060 0.936 0.000 0.004 0.000
#> ERR863735 1 0.0363 0.8657 0.988 0.000 0.000 0.012 0.000 0.000
#> ERR863734 3 0.3371 0.5540 0.000 0.000 0.708 0.000 0.000 0.292
#> ERR863736 3 0.1972 0.6060 0.000 0.056 0.916 0.000 0.004 0.024
#> ERR863729 5 0.0725 0.6746 0.000 0.000 0.012 0.000 0.976 0.012
#> ERR863728 2 0.7436 0.0411 0.332 0.364 0.000 0.204 0.016 0.084
#> ERR863731 1 0.3164 0.8071 0.844 0.048 0.000 0.096 0.000 0.012
#> ERR863764 4 0.2742 0.8021 0.000 0.016 0.036 0.876 0.000 0.072
#> ERR863740 1 0.1180 0.8555 0.960 0.000 0.024 0.008 0.004 0.004
#> ERR863765 3 0.5385 0.3119 0.296 0.000 0.580 0.008 0.000 0.116
#> ERR863762 6 0.3662 0.3726 0.000 0.000 0.124 0.012 0.060 0.804
#> ERR863724 1 0.5805 0.5081 0.620 0.004 0.248 0.024 0.084 0.020
#> ERR863733 6 0.3724 0.2708 0.000 0.004 0.012 0.268 0.000 0.716
#> ERR863732 6 0.4486 -0.2849 0.000 0.000 0.464 0.008 0.016 0.512
#> ERR863730 6 0.5894 0.2878 0.312 0.000 0.060 0.076 0.000 0.552
#> ERR863742 1 0.1956 0.8353 0.908 0.000 0.080 0.004 0.000 0.008
#> ERR863763 4 0.1644 0.8600 0.000 0.076 0.004 0.920 0.000 0.000
#> ERR863741 5 0.0436 0.6754 0.004 0.004 0.000 0.004 0.988 0.000
#> ERR863743 1 0.1701 0.8518 0.920 0.000 0.000 0.072 0.000 0.008
#> ERR863745 2 0.1579 0.8036 0.000 0.944 0.024 0.008 0.020 0.004
#> ERR863744 1 0.1151 0.8685 0.956 0.000 0.000 0.032 0.000 0.012
#> ERR863746 1 0.1410 0.8673 0.944 0.000 0.004 0.044 0.000 0.008
#> ERR863748 5 0.6967 0.0873 0.000 0.000 0.112 0.140 0.428 0.320
#> ERR863747 3 0.5175 0.4647 0.000 0.196 0.620 0.000 0.000 0.184
#> ERR863694 4 0.2543 0.8216 0.000 0.016 0.024 0.892 0.064 0.004
#> ERR863693 4 0.0790 0.8685 0.000 0.032 0.000 0.968 0.000 0.000
#> ERR863686 1 0.3931 0.7659 0.808 0.000 0.084 0.076 0.008 0.024
#> ERR863678 1 0.7601 0.4021 0.540 0.152 0.024 0.120 0.112 0.052
#> ERR863685 3 0.2320 0.6233 0.000 0.004 0.864 0.000 0.000 0.132
#> ERR863689 4 0.7105 0.2722 0.208 0.240 0.000 0.460 0.008 0.084
#> ERR863691 4 0.2777 0.8354 0.012 0.072 0.000 0.880 0.024 0.012
#> ERR863682 1 0.0837 0.8592 0.972 0.000 0.020 0.000 0.004 0.004
#> ERR863695 2 0.2544 0.7724 0.000 0.896 0.004 0.048 0.024 0.028
#> ERR863683 1 0.0520 0.8635 0.984 0.000 0.008 0.000 0.000 0.008
#> ERR863684 4 0.1036 0.8642 0.004 0.024 0.008 0.964 0.000 0.000
#> ERR863702 6 0.5454 0.2492 0.384 0.000 0.076 0.012 0.004 0.524
#> ERR863687 3 0.4426 0.4245 0.000 0.296 0.652 0.000 0.000 0.052
#> ERR863706 3 0.4341 0.3806 0.272 0.004 0.688 0.004 0.004 0.028
#> ERR863708 2 0.0806 0.8052 0.000 0.972 0.008 0.020 0.000 0.000
#> ERR863710 1 0.1082 0.8663 0.956 0.000 0.000 0.040 0.000 0.004
#> ERR863709 2 0.2146 0.7666 0.000 0.908 0.000 0.060 0.024 0.008
#> ERR863753 2 0.0748 0.8030 0.000 0.976 0.016 0.004 0.004 0.000
#> ERR863754 4 0.3429 0.7852 0.056 0.108 0.000 0.824 0.000 0.012
#> ERR863749 1 0.0858 0.8680 0.968 0.000 0.000 0.028 0.000 0.004
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)
An example of the output of tb
is:
#> which_row fdr mean_1 mean_2 scaled_mean_1 scaled_mean_2 km
#> 1 38 0.042760348 8.373488 9.131774 -0.5533452 0.5164555 1
#> 2 40 0.018707592 7.106213 8.469186 -0.6173731 0.5762149 1
#> 3 55 0.019134737 10.221463 11.207825 -0.6159697 0.5749050 1
#> 4 59 0.006059896 5.921854 7.869574 -0.6899429 0.6439467 1
#> 5 60 0.018055526 8.928898 10.211722 -0.6204761 0.5791110 1
#> 6 98 0.009384629 15.714769 14.887706 0.6635654 -0.6193277 2
...
The columns in tb
are:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.km
: Row groups if k-means clustering is applied to rows.UMAP plot which shows how samples are separated.
dimension_reduction(res, k = 2, method = "UMAP")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
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 17118 rows and 78 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.672 0.847 0.933 0.4431 0.568 0.568
#> 3 3 0.788 0.841 0.933 0.1254 0.953 0.918
#> 4 4 0.554 0.721 0.848 0.1677 0.909 0.832
#> 5 5 0.559 0.646 0.766 0.1504 0.810 0.610
#> 6 6 0.620 0.740 0.836 0.0833 0.936 0.809
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
#> ERR863675 1 0.0376 0.9227 0.996 0.004
#> ERR863705 2 0.0938 0.9336 0.012 0.988
#> ERR863704 2 0.9963 0.0642 0.464 0.536
#> ERR863679 2 0.0938 0.9336 0.012 0.988
#> ERR863680 1 0.3431 0.8999 0.936 0.064
#> ERR863676 1 0.0000 0.9235 1.000 0.000
#> ERR863677 1 0.0000 0.9235 1.000 0.000
#> ERR863688 2 0.0000 0.9307 0.000 1.000
#> ERR863690 1 0.0000 0.9235 1.000 0.000
#> ERR863692 1 0.3584 0.8963 0.932 0.068
#> ERR863703 1 0.0938 0.9198 0.988 0.012
#> ERR863712 1 0.0000 0.9235 1.000 0.000
#> ERR863711 1 0.0000 0.9235 1.000 0.000
#> ERR863760 2 0.9775 0.2477 0.412 0.588
#> ERR863727 1 0.6048 0.8370 0.852 0.148
#> ERR863766 2 0.1184 0.9325 0.016 0.984
#> ERR863767 1 0.0000 0.9235 1.000 0.000
#> ERR863752 1 0.0000 0.9235 1.000 0.000
#> ERR863757 2 0.0000 0.9307 0.000 1.000
#> ERR863758 1 0.0000 0.9235 1.000 0.000
#> ERR863755 1 0.5408 0.8579 0.876 0.124
#> ERR863756 1 0.9977 0.1512 0.528 0.472
#> ERR863707 2 0.1184 0.9325 0.016 0.984
#> ERR863681 2 0.0000 0.9307 0.000 1.000
#> ERR863719 1 0.6623 0.8129 0.828 0.172
#> ERR863759 1 0.9977 0.1512 0.528 0.472
#> ERR863718 1 0.0000 0.9235 1.000 0.000
#> ERR863717 1 0.5294 0.8604 0.880 0.120
#> ERR863715 2 0.0000 0.9307 0.000 1.000
#> ERR863716 1 0.6148 0.8331 0.848 0.152
#> ERR863722 1 0.3114 0.8932 0.944 0.056
#> ERR863721 1 0.0000 0.9235 1.000 0.000
#> ERR863720 1 0.0000 0.9235 1.000 0.000
#> ERR863723 1 0.6148 0.8331 0.848 0.152
#> ERR863761 2 0.0938 0.9336 0.012 0.988
#> ERR863735 1 0.0000 0.9235 1.000 0.000
#> ERR863734 2 0.1184 0.9325 0.016 0.984
#> ERR863736 2 0.9323 0.4214 0.348 0.652
#> ERR863729 2 0.0000 0.9307 0.000 1.000
#> ERR863728 1 0.0376 0.9227 0.996 0.004
#> ERR863731 1 0.0000 0.9235 1.000 0.000
#> ERR863764 1 0.3431 0.8986 0.936 0.064
#> ERR863740 1 0.1184 0.9192 0.984 0.016
#> ERR863765 2 0.1184 0.9325 0.016 0.984
#> ERR863762 2 0.0938 0.9336 0.012 0.988
#> ERR863724 2 0.0000 0.9307 0.000 1.000
#> ERR863733 1 0.3431 0.8986 0.936 0.064
#> ERR863732 2 0.0938 0.9336 0.012 0.988
#> ERR863730 1 0.0376 0.9227 0.996 0.004
#> ERR863742 1 0.0376 0.9227 0.996 0.004
#> ERR863763 1 0.0000 0.9235 1.000 0.000
#> ERR863741 2 0.0000 0.9307 0.000 1.000
#> ERR863743 1 0.0000 0.9235 1.000 0.000
#> ERR863745 1 0.0000 0.9235 1.000 0.000
#> ERR863744 1 0.5629 0.8508 0.868 0.132
#> ERR863746 1 0.0000 0.9235 1.000 0.000
#> ERR863748 1 0.9977 0.1512 0.528 0.472
#> ERR863747 1 0.9977 0.1512 0.528 0.472
#> ERR863694 1 0.6438 0.8215 0.836 0.164
#> ERR863693 1 0.0000 0.9235 1.000 0.000
#> ERR863686 2 0.0938 0.9293 0.012 0.988
#> ERR863678 1 0.0000 0.9235 1.000 0.000
#> ERR863685 2 0.1184 0.9325 0.016 0.984
#> ERR863689 1 0.0000 0.9235 1.000 0.000
#> ERR863691 1 0.3584 0.8963 0.932 0.068
#> ERR863682 1 0.6148 0.8331 0.848 0.152
#> ERR863695 1 0.0000 0.9235 1.000 0.000
#> ERR863683 1 0.0376 0.9227 0.996 0.004
#> ERR863684 1 0.3879 0.8922 0.924 0.076
#> ERR863702 2 0.0938 0.9293 0.012 0.988
#> ERR863687 2 0.0938 0.9336 0.012 0.988
#> ERR863706 2 0.1184 0.9325 0.016 0.984
#> ERR863708 1 0.0000 0.9235 1.000 0.000
#> ERR863710 1 0.0000 0.9235 1.000 0.000
#> ERR863709 1 0.0000 0.9235 1.000 0.000
#> ERR863753 1 0.0000 0.9235 1.000 0.000
#> ERR863754 1 0.3114 0.9024 0.944 0.056
#> ERR863749 1 0.0376 0.9227 0.996 0.004
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> ERR863675 1 0.0237 0.913 0.996 0.000 0.004
#> ERR863705 3 0.0592 0.994 0.012 0.000 0.988
#> ERR863704 2 0.6286 0.204 0.464 0.536 0.000
#> ERR863679 3 0.0592 0.994 0.012 0.000 0.988
#> ERR863680 1 0.2165 0.886 0.936 0.064 0.000
#> ERR863676 1 0.0000 0.914 1.000 0.000 0.000
#> ERR863677 1 0.0000 0.914 1.000 0.000 0.000
#> ERR863688 2 0.0000 0.778 0.000 1.000 0.000
#> ERR863690 1 0.0000 0.914 1.000 0.000 0.000
#> ERR863692 1 0.2261 0.882 0.932 0.068 0.000
#> ERR863703 1 0.0592 0.909 0.988 0.012 0.000
#> ERR863712 1 0.0000 0.914 1.000 0.000 0.000
#> ERR863711 1 0.0000 0.914 1.000 0.000 0.000
#> ERR863760 2 0.6168 0.361 0.412 0.588 0.000
#> ERR863727 1 0.3816 0.813 0.852 0.148 0.000
#> ERR863766 3 0.0747 0.992 0.016 0.000 0.984
#> ERR863767 1 0.0000 0.914 1.000 0.000 0.000
#> ERR863752 1 0.0000 0.914 1.000 0.000 0.000
#> ERR863757 2 0.0000 0.778 0.000 1.000 0.000
#> ERR863758 1 0.0000 0.914 1.000 0.000 0.000
#> ERR863755 1 0.3412 0.838 0.876 0.124 0.000
#> ERR863756 1 0.6295 0.169 0.528 0.000 0.472
#> ERR863707 3 0.0747 0.992 0.016 0.000 0.984
#> ERR863681 3 0.0000 0.980 0.000 0.000 1.000
#> ERR863719 1 0.4178 0.786 0.828 0.172 0.000
#> ERR863759 1 0.6295 0.169 0.528 0.000 0.472
#> ERR863718 1 0.0000 0.914 1.000 0.000 0.000
#> ERR863717 1 0.3340 0.839 0.880 0.120 0.000
#> ERR863715 2 0.0000 0.778 0.000 1.000 0.000
#> ERR863716 1 0.3879 0.808 0.848 0.152 0.000
#> ERR863722 1 0.1964 0.872 0.944 0.000 0.056
#> ERR863721 1 0.0000 0.914 1.000 0.000 0.000
#> ERR863720 1 0.0000 0.914 1.000 0.000 0.000
#> ERR863723 1 0.3879 0.808 0.848 0.152 0.000
#> ERR863761 3 0.0592 0.994 0.012 0.000 0.988
#> ERR863735 1 0.0000 0.914 1.000 0.000 0.000
#> ERR863734 3 0.0747 0.992 0.016 0.000 0.984
#> ERR863736 2 0.5882 0.495 0.348 0.652 0.000
#> ERR863729 2 0.0000 0.778 0.000 1.000 0.000
#> ERR863728 1 0.0237 0.913 0.996 0.000 0.004
#> ERR863731 1 0.0000 0.914 1.000 0.000 0.000
#> ERR863764 1 0.2165 0.885 0.936 0.064 0.000
#> ERR863740 1 0.0829 0.909 0.984 0.012 0.004
#> ERR863765 3 0.0747 0.992 0.016 0.000 0.984
#> ERR863762 3 0.0592 0.994 0.012 0.000 0.988
#> ERR863724 3 0.0000 0.980 0.000 0.000 1.000
#> ERR863733 1 0.2165 0.885 0.936 0.064 0.000
#> ERR863732 3 0.0592 0.994 0.012 0.000 0.988
#> ERR863730 1 0.0237 0.913 0.996 0.000 0.004
#> ERR863742 1 0.0237 0.913 0.996 0.000 0.004
#> ERR863763 1 0.0000 0.914 1.000 0.000 0.000
#> ERR863741 2 0.0000 0.778 0.000 1.000 0.000
#> ERR863743 1 0.0000 0.914 1.000 0.000 0.000
#> ERR863745 1 0.0000 0.914 1.000 0.000 0.000
#> ERR863744 1 0.3551 0.828 0.868 0.132 0.000
#> ERR863746 1 0.0000 0.914 1.000 0.000 0.000
#> ERR863748 1 0.6295 0.169 0.528 0.000 0.472
#> ERR863747 1 0.6295 0.169 0.528 0.000 0.472
#> ERR863694 1 0.4062 0.795 0.836 0.164 0.000
#> ERR863693 1 0.0000 0.914 1.000 0.000 0.000
#> ERR863686 2 0.0592 0.777 0.012 0.988 0.000
#> ERR863678 1 0.0000 0.914 1.000 0.000 0.000
#> ERR863685 3 0.0747 0.992 0.016 0.000 0.984
#> ERR863689 1 0.0000 0.914 1.000 0.000 0.000
#> ERR863691 1 0.2261 0.882 0.932 0.068 0.000
#> ERR863682 1 0.3879 0.808 0.848 0.152 0.000
#> ERR863695 1 0.0000 0.914 1.000 0.000 0.000
#> ERR863683 1 0.0237 0.913 0.996 0.000 0.004
#> ERR863684 1 0.2448 0.877 0.924 0.076 0.000
#> ERR863702 2 0.0592 0.777 0.012 0.988 0.000
#> ERR863687 3 0.0592 0.994 0.012 0.000 0.988
#> ERR863706 3 0.0747 0.992 0.016 0.000 0.984
#> ERR863708 1 0.0000 0.914 1.000 0.000 0.000
#> ERR863710 1 0.0000 0.914 1.000 0.000 0.000
#> ERR863709 1 0.0000 0.914 1.000 0.000 0.000
#> ERR863753 1 0.0000 0.914 1.000 0.000 0.000
#> ERR863754 1 0.1964 0.889 0.944 0.056 0.000
#> ERR863749 1 0.0237 0.913 0.996 0.000 0.004
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> ERR863675 1 0.2469 0.831 0.892 0.000 0.108 0.000
#> ERR863705 3 0.4406 0.637 0.000 0.000 0.700 0.300
#> ERR863704 2 0.6998 0.170 0.424 0.484 0.012 0.080
#> ERR863679 3 0.4406 0.637 0.000 0.000 0.700 0.300
#> ERR863680 1 0.6278 0.714 0.684 0.052 0.228 0.036
#> ERR863676 1 0.4328 0.746 0.748 0.000 0.244 0.008
#> ERR863677 1 0.4360 0.747 0.744 0.000 0.248 0.008
#> ERR863688 2 0.1211 0.677 0.000 0.960 0.000 0.040
#> ERR863690 1 0.1059 0.853 0.972 0.000 0.012 0.016
#> ERR863692 1 0.2652 0.828 0.912 0.056 0.004 0.028
#> ERR863703 1 0.1059 0.853 0.972 0.000 0.012 0.016
#> ERR863712 1 0.4360 0.747 0.744 0.000 0.248 0.008
#> ERR863711 1 0.0524 0.852 0.988 0.000 0.008 0.004
#> ERR863760 2 0.6775 0.322 0.384 0.516 0.000 0.100
#> ERR863727 1 0.4297 0.749 0.820 0.084 0.000 0.096
#> ERR863766 3 0.4382 0.637 0.000 0.000 0.704 0.296
#> ERR863767 1 0.0657 0.852 0.984 0.000 0.012 0.004
#> ERR863752 1 0.4250 0.726 0.724 0.000 0.276 0.000
#> ERR863757 2 0.1211 0.677 0.000 0.960 0.000 0.040
#> ERR863758 1 0.0469 0.852 0.988 0.000 0.012 0.000
#> ERR863755 1 0.3903 0.773 0.844 0.076 0.000 0.080
#> ERR863756 3 0.3764 0.256 0.216 0.000 0.784 0.000
#> ERR863707 3 0.4382 0.637 0.000 0.000 0.704 0.296
#> ERR863681 4 0.3074 1.000 0.000 0.000 0.152 0.848
#> ERR863719 1 0.4669 0.727 0.796 0.104 0.000 0.100
#> ERR863759 3 0.3764 0.256 0.216 0.000 0.784 0.000
#> ERR863718 1 0.0469 0.850 0.988 0.000 0.000 0.012
#> ERR863717 1 0.3617 0.784 0.860 0.064 0.000 0.076
#> ERR863715 2 0.0000 0.686 0.000 1.000 0.000 0.000
#> ERR863716 1 0.4359 0.744 0.816 0.084 0.000 0.100
#> ERR863722 1 0.2921 0.804 0.860 0.000 0.140 0.000
#> ERR863721 1 0.2048 0.844 0.928 0.000 0.064 0.008
#> ERR863720 1 0.4360 0.745 0.744 0.000 0.248 0.008
#> ERR863723 1 0.4359 0.744 0.816 0.084 0.000 0.100
#> ERR863761 3 0.4406 0.637 0.000 0.000 0.700 0.300
#> ERR863735 1 0.0469 0.850 0.988 0.000 0.000 0.012
#> ERR863734 3 0.4382 0.637 0.000 0.000 0.704 0.296
#> ERR863736 2 0.6570 0.467 0.320 0.580 0.000 0.100
#> ERR863729 2 0.0000 0.686 0.000 1.000 0.000 0.000
#> ERR863728 1 0.1743 0.848 0.940 0.000 0.056 0.004
#> ERR863731 1 0.0592 0.850 0.984 0.000 0.000 0.016
#> ERR863764 1 0.5074 0.788 0.764 0.064 0.168 0.004
#> ERR863740 1 0.1139 0.851 0.972 0.008 0.012 0.008
#> ERR863765 3 0.4584 0.631 0.004 0.000 0.696 0.300
#> ERR863762 3 0.4406 0.637 0.000 0.000 0.700 0.300
#> ERR863724 4 0.3074 1.000 0.000 0.000 0.152 0.848
#> ERR863733 1 0.5074 0.788 0.764 0.064 0.168 0.004
#> ERR863732 3 0.4406 0.637 0.000 0.000 0.700 0.300
#> ERR863730 1 0.0657 0.852 0.984 0.000 0.012 0.004
#> ERR863742 1 0.0657 0.852 0.984 0.000 0.012 0.004
#> ERR863763 1 0.4360 0.747 0.744 0.000 0.248 0.008
#> ERR863741 2 0.0000 0.686 0.000 1.000 0.000 0.000
#> ERR863743 1 0.0592 0.851 0.984 0.000 0.000 0.016
#> ERR863745 1 0.4250 0.726 0.724 0.000 0.276 0.000
#> ERR863744 1 0.3833 0.775 0.848 0.072 0.000 0.080
#> ERR863746 1 0.0336 0.852 0.992 0.000 0.008 0.000
#> ERR863748 3 0.3764 0.256 0.216 0.000 0.784 0.000
#> ERR863747 3 0.3764 0.256 0.216 0.000 0.784 0.000
#> ERR863694 1 0.4549 0.737 0.804 0.096 0.000 0.100
#> ERR863693 1 0.4647 0.715 0.704 0.000 0.288 0.008
#> ERR863686 2 0.2053 0.680 0.004 0.924 0.000 0.072
#> ERR863678 1 0.0592 0.852 0.984 0.000 0.016 0.000
#> ERR863685 3 0.4382 0.637 0.000 0.000 0.704 0.296
#> ERR863689 1 0.1305 0.851 0.960 0.000 0.036 0.004
#> ERR863691 1 0.2652 0.828 0.912 0.056 0.004 0.028
#> ERR863682 1 0.4359 0.744 0.816 0.084 0.000 0.100
#> ERR863695 1 0.4697 0.707 0.696 0.000 0.296 0.008
#> ERR863683 1 0.0657 0.852 0.984 0.000 0.012 0.004
#> ERR863684 1 0.3302 0.825 0.888 0.064 0.016 0.032
#> ERR863702 2 0.2053 0.680 0.004 0.924 0.000 0.072
#> ERR863687 3 0.4406 0.637 0.000 0.000 0.700 0.300
#> ERR863706 3 0.4584 0.631 0.004 0.000 0.696 0.300
#> ERR863708 1 0.4328 0.746 0.748 0.000 0.244 0.008
#> ERR863710 1 0.0336 0.851 0.992 0.000 0.000 0.008
#> ERR863709 1 0.4360 0.745 0.744 0.000 0.248 0.008
#> ERR863753 1 0.4250 0.726 0.724 0.000 0.276 0.000
#> ERR863754 1 0.2214 0.832 0.928 0.044 0.000 0.028
#> ERR863749 1 0.1305 0.850 0.960 0.000 0.036 0.004
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> ERR863675 1 0.3010 0.546 0.824 0.172 0.004 0.000 0.000
#> ERR863705 3 0.0000 0.768 0.000 0.000 1.000 0.000 0.000
#> ERR863704 1 0.8418 -0.230 0.296 0.280 0.000 0.148 0.276
#> ERR863679 3 0.0000 0.768 0.000 0.000 1.000 0.000 0.000
#> ERR863680 2 0.4359 0.544 0.412 0.584 0.000 0.000 0.004
#> ERR863676 2 0.4262 0.852 0.440 0.560 0.000 0.000 0.000
#> ERR863677 2 0.4262 0.843 0.440 0.560 0.000 0.000 0.000
#> ERR863688 5 0.1197 0.744 0.000 0.048 0.000 0.000 0.952
#> ERR863690 1 0.1544 0.694 0.932 0.068 0.000 0.000 0.000
#> ERR863692 1 0.2377 0.707 0.872 0.128 0.000 0.000 0.000
#> ERR863703 1 0.1270 0.732 0.948 0.052 0.000 0.000 0.000
#> ERR863712 2 0.4262 0.843 0.440 0.560 0.000 0.000 0.000
#> ERR863711 1 0.1197 0.718 0.952 0.048 0.000 0.000 0.000
#> ERR863760 1 0.8482 -0.288 0.296 0.240 0.000 0.172 0.292
#> ERR863727 1 0.3756 0.621 0.744 0.248 0.000 0.000 0.008
#> ERR863766 3 0.0162 0.768 0.000 0.000 0.996 0.004 0.000
#> ERR863767 1 0.1270 0.714 0.948 0.052 0.000 0.000 0.000
#> ERR863752 2 0.4161 0.826 0.392 0.608 0.000 0.000 0.000
#> ERR863757 5 0.1197 0.744 0.000 0.048 0.000 0.000 0.952
#> ERR863758 1 0.0880 0.725 0.968 0.032 0.000 0.000 0.000
#> ERR863755 1 0.3582 0.638 0.768 0.224 0.000 0.000 0.008
#> ERR863756 3 0.6210 0.260 0.124 0.388 0.484 0.004 0.000
#> ERR863707 3 0.0162 0.768 0.000 0.000 0.996 0.004 0.000
#> ERR863681 4 0.2891 1.000 0.000 0.000 0.176 0.824 0.000
#> ERR863719 1 0.4193 0.600 0.720 0.256 0.000 0.000 0.024
#> ERR863759 3 0.6210 0.260 0.124 0.388 0.484 0.004 0.000
#> ERR863718 1 0.0162 0.733 0.996 0.004 0.000 0.000 0.000
#> ERR863717 1 0.2732 0.682 0.840 0.160 0.000 0.000 0.000
#> ERR863715 5 0.0000 0.760 0.000 0.000 0.000 0.000 1.000
#> ERR863716 1 0.3783 0.617 0.740 0.252 0.000 0.000 0.008
#> ERR863722 1 0.3779 0.558 0.816 0.124 0.056 0.004 0.000
#> ERR863721 1 0.3774 0.106 0.704 0.296 0.000 0.000 0.000
#> ERR863720 2 0.4235 0.852 0.424 0.576 0.000 0.000 0.000
#> ERR863723 1 0.3783 0.617 0.740 0.252 0.000 0.000 0.008
#> ERR863761 3 0.0000 0.768 0.000 0.000 1.000 0.000 0.000
#> ERR863735 1 0.0290 0.734 0.992 0.008 0.000 0.000 0.000
#> ERR863734 3 0.0162 0.768 0.000 0.000 0.996 0.004 0.000
#> ERR863736 5 0.8400 0.240 0.236 0.236 0.000 0.172 0.356
#> ERR863729 5 0.0000 0.760 0.000 0.000 0.000 0.000 1.000
#> ERR863728 1 0.1991 0.683 0.916 0.076 0.004 0.004 0.000
#> ERR863731 1 0.0880 0.723 0.968 0.032 0.000 0.000 0.000
#> ERR863764 1 0.4583 -0.242 0.528 0.464 0.004 0.000 0.004
#> ERR863740 1 0.1892 0.726 0.916 0.080 0.004 0.000 0.000
#> ERR863765 3 0.0162 0.765 0.000 0.004 0.996 0.000 0.000
#> ERR863762 3 0.0000 0.768 0.000 0.000 1.000 0.000 0.000
#> ERR863724 4 0.2891 1.000 0.000 0.000 0.176 0.824 0.000
#> ERR863733 1 0.4583 -0.242 0.528 0.464 0.004 0.000 0.004
#> ERR863732 3 0.0000 0.768 0.000 0.000 1.000 0.000 0.000
#> ERR863730 1 0.0955 0.729 0.968 0.028 0.004 0.000 0.000
#> ERR863742 1 0.0955 0.729 0.968 0.028 0.004 0.000 0.000
#> ERR863763 2 0.4242 0.841 0.428 0.572 0.000 0.000 0.000
#> ERR863741 5 0.0000 0.760 0.000 0.000 0.000 0.000 1.000
#> ERR863743 1 0.1197 0.713 0.952 0.048 0.000 0.000 0.000
#> ERR863745 2 0.4171 0.822 0.396 0.604 0.000 0.000 0.000
#> ERR863744 1 0.3074 0.661 0.804 0.196 0.000 0.000 0.000
#> ERR863746 1 0.1043 0.722 0.960 0.040 0.000 0.000 0.000
#> ERR863748 3 0.6210 0.260 0.124 0.388 0.484 0.004 0.000
#> ERR863747 3 0.6210 0.260 0.124 0.388 0.484 0.004 0.000
#> ERR863694 1 0.4040 0.605 0.724 0.260 0.000 0.000 0.016
#> ERR863693 2 0.3796 0.763 0.300 0.700 0.000 0.000 0.000
#> ERR863686 5 0.5117 0.655 0.008 0.108 0.000 0.172 0.712
#> ERR863678 1 0.0963 0.723 0.964 0.036 0.000 0.000 0.000
#> ERR863685 3 0.0162 0.768 0.000 0.000 0.996 0.004 0.000
#> ERR863689 1 0.1965 0.675 0.904 0.096 0.000 0.000 0.000
#> ERR863691 1 0.2377 0.707 0.872 0.128 0.000 0.000 0.000
#> ERR863682 1 0.3783 0.617 0.740 0.252 0.000 0.000 0.008
#> ERR863695 2 0.3730 0.757 0.288 0.712 0.000 0.000 0.000
#> ERR863683 1 0.0955 0.729 0.968 0.028 0.004 0.000 0.000
#> ERR863684 1 0.3048 0.677 0.820 0.176 0.000 0.000 0.004
#> ERR863702 5 0.5117 0.655 0.008 0.108 0.000 0.172 0.712
#> ERR863687 3 0.0000 0.768 0.000 0.000 1.000 0.000 0.000
#> ERR863706 3 0.0162 0.765 0.000 0.004 0.996 0.000 0.000
#> ERR863708 2 0.4262 0.852 0.440 0.560 0.000 0.000 0.000
#> ERR863710 1 0.0162 0.732 0.996 0.004 0.000 0.000 0.000
#> ERR863709 2 0.4235 0.852 0.424 0.576 0.000 0.000 0.000
#> ERR863753 2 0.4161 0.826 0.392 0.608 0.000 0.000 0.000
#> ERR863754 1 0.2127 0.715 0.892 0.108 0.000 0.000 0.000
#> ERR863749 1 0.1518 0.714 0.944 0.048 0.004 0.004 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> ERR863675 1 0.3791 0.643 0.768 0.180 0.004 0 0.000 0.048
#> ERR863705 3 0.0000 0.801 0.000 0.000 1.000 0 0.000 0.000
#> ERR863704 6 0.3283 0.564 0.036 0.160 0.000 0 0.000 0.804
#> ERR863679 3 0.0000 0.801 0.000 0.000 1.000 0 0.000 0.000
#> ERR863680 2 0.5095 0.543 0.104 0.584 0.000 0 0.000 0.312
#> ERR863676 2 0.3213 0.788 0.132 0.820 0.000 0 0.000 0.048
#> ERR863677 2 0.3529 0.784 0.208 0.764 0.000 0 0.000 0.028
#> ERR863688 5 0.1075 0.946 0.000 0.048 0.000 0 0.952 0.000
#> ERR863690 1 0.1958 0.809 0.896 0.100 0.000 0 0.000 0.004
#> ERR863692 1 0.3175 0.803 0.832 0.088 0.000 0 0.000 0.080
#> ERR863703 1 0.1657 0.842 0.928 0.056 0.000 0 0.000 0.016
#> ERR863712 2 0.3529 0.784 0.208 0.764 0.000 0 0.000 0.028
#> ERR863711 1 0.1204 0.835 0.944 0.056 0.000 0 0.000 0.000
#> ERR863760 6 0.1700 0.636 0.004 0.080 0.000 0 0.000 0.916
#> ERR863727 1 0.3952 0.734 0.736 0.052 0.000 0 0.000 0.212
#> ERR863766 3 0.0790 0.795 0.000 0.032 0.968 0 0.000 0.000
#> ERR863767 1 0.1327 0.832 0.936 0.064 0.000 0 0.000 0.000
#> ERR863752 2 0.3790 0.770 0.156 0.772 0.000 0 0.000 0.072
#> ERR863757 5 0.1075 0.946 0.000 0.048 0.000 0 0.952 0.000
#> ERR863758 1 0.0790 0.838 0.968 0.032 0.000 0 0.000 0.000
#> ERR863755 1 0.3539 0.752 0.756 0.024 0.000 0 0.000 0.220
#> ERR863756 3 0.5726 0.194 0.076 0.436 0.456 0 0.000 0.032
#> ERR863707 3 0.0790 0.795 0.000 0.032 0.968 0 0.000 0.000
#> ERR863681 4 0.0000 1.000 0.000 0.000 0.000 1 0.000 0.000
#> ERR863719 1 0.4247 0.701 0.700 0.060 0.000 0 0.000 0.240
#> ERR863759 3 0.5726 0.194 0.076 0.436 0.456 0 0.000 0.032
#> ERR863718 1 0.0260 0.843 0.992 0.000 0.000 0 0.000 0.008
#> ERR863717 1 0.3062 0.795 0.836 0.052 0.000 0 0.000 0.112
#> ERR863715 5 0.0000 0.964 0.000 0.000 0.000 0 1.000 0.000
#> ERR863716 1 0.4007 0.727 0.728 0.052 0.000 0 0.000 0.220
#> ERR863722 1 0.4049 0.676 0.776 0.148 0.048 0 0.000 0.028
#> ERR863721 1 0.4367 0.230 0.604 0.364 0.000 0 0.000 0.032
#> ERR863720 2 0.3678 0.786 0.128 0.788 0.000 0 0.000 0.084
#> ERR863723 1 0.4065 0.724 0.724 0.056 0.000 0 0.000 0.220
#> ERR863761 3 0.0000 0.801 0.000 0.000 1.000 0 0.000 0.000
#> ERR863735 1 0.0622 0.843 0.980 0.008 0.000 0 0.000 0.012
#> ERR863734 3 0.0790 0.795 0.000 0.032 0.968 0 0.000 0.000
#> ERR863736 6 0.2328 0.651 0.000 0.052 0.000 0 0.056 0.892
#> ERR863729 5 0.0000 0.964 0.000 0.000 0.000 0 1.000 0.000
#> ERR863728 1 0.1956 0.806 0.908 0.080 0.004 0 0.000 0.008
#> ERR863731 1 0.1141 0.836 0.948 0.052 0.000 0 0.000 0.000
#> ERR863764 2 0.5681 0.466 0.360 0.492 0.004 0 0.000 0.144
#> ERR863740 1 0.2034 0.838 0.912 0.024 0.004 0 0.000 0.060
#> ERR863765 3 0.0146 0.799 0.000 0.004 0.996 0 0.000 0.000
#> ERR863762 3 0.0000 0.801 0.000 0.000 1.000 0 0.000 0.000
#> ERR863724 4 0.0000 1.000 0.000 0.000 0.000 1 0.000 0.000
#> ERR863733 2 0.5681 0.466 0.360 0.492 0.004 0 0.000 0.144
#> ERR863732 3 0.0000 0.801 0.000 0.000 1.000 0 0.000 0.000
#> ERR863730 1 0.0858 0.839 0.968 0.028 0.004 0 0.000 0.000
#> ERR863742 1 0.0858 0.839 0.968 0.028 0.004 0 0.000 0.000
#> ERR863763 2 0.3500 0.782 0.204 0.768 0.000 0 0.000 0.028
#> ERR863741 5 0.0000 0.964 0.000 0.000 0.000 0 1.000 0.000
#> ERR863743 1 0.1700 0.822 0.916 0.080 0.000 0 0.000 0.004
#> ERR863745 2 0.3806 0.768 0.152 0.772 0.000 0 0.000 0.076
#> ERR863744 1 0.3432 0.777 0.800 0.052 0.000 0 0.000 0.148
#> ERR863746 1 0.1075 0.836 0.952 0.048 0.000 0 0.000 0.000
#> ERR863748 3 0.5726 0.194 0.076 0.436 0.456 0 0.000 0.032
#> ERR863747 3 0.5726 0.194 0.076 0.436 0.456 0 0.000 0.032
#> ERR863694 1 0.4370 0.686 0.684 0.064 0.000 0 0.000 0.252
#> ERR863693 2 0.4062 0.725 0.196 0.736 0.000 0 0.000 0.068
#> ERR863686 6 0.3789 0.396 0.000 0.000 0.000 0 0.416 0.584
#> ERR863678 1 0.0937 0.837 0.960 0.040 0.000 0 0.000 0.000
#> ERR863685 3 0.0790 0.795 0.000 0.032 0.968 0 0.000 0.000
#> ERR863689 1 0.2048 0.804 0.880 0.120 0.000 0 0.000 0.000
#> ERR863691 1 0.3175 0.803 0.832 0.088 0.000 0 0.000 0.080
#> ERR863682 1 0.4007 0.727 0.728 0.052 0.000 0 0.000 0.220
#> ERR863695 2 0.3206 0.744 0.104 0.828 0.000 0 0.000 0.068
#> ERR863683 1 0.0858 0.839 0.968 0.028 0.004 0 0.000 0.000
#> ERR863684 1 0.3701 0.777 0.788 0.100 0.000 0 0.000 0.112
#> ERR863702 6 0.3789 0.396 0.000 0.000 0.000 0 0.416 0.584
#> ERR863687 3 0.0000 0.801 0.000 0.000 1.000 0 0.000 0.000
#> ERR863706 3 0.0146 0.799 0.000 0.004 0.996 0 0.000 0.000
#> ERR863708 2 0.3213 0.788 0.132 0.820 0.000 0 0.000 0.048
#> ERR863710 1 0.0520 0.843 0.984 0.008 0.000 0 0.000 0.008
#> ERR863709 2 0.3667 0.788 0.132 0.788 0.000 0 0.000 0.080
#> ERR863753 2 0.3790 0.770 0.156 0.772 0.000 0 0.000 0.072
#> ERR863754 1 0.2910 0.813 0.852 0.080 0.000 0 0.000 0.068
#> ERR863749 1 0.1542 0.828 0.936 0.052 0.004 0 0.000 0.008
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
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)
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 17118 rows and 78 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.530 0.755 0.881 0.4159 0.568 0.568
#> 3 3 0.628 0.820 0.887 0.3930 0.832 0.717
#> 4 4 0.739 0.915 0.923 0.2124 0.755 0.501
#> 5 5 0.733 0.684 0.828 0.0895 0.970 0.898
#> 6 6 0.712 0.656 0.775 0.0524 0.908 0.677
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
#> ERR863675 1 0.2043 0.8923 0.968 0.032
#> ERR863705 2 0.3114 0.7721 0.056 0.944
#> ERR863704 1 0.1843 0.8821 0.972 0.028
#> ERR863679 2 0.3114 0.7721 0.056 0.944
#> ERR863680 1 0.1843 0.8821 0.972 0.028
#> ERR863676 1 0.1633 0.8938 0.976 0.024
#> ERR863677 1 0.2236 0.8925 0.964 0.036
#> ERR863688 2 0.8267 0.6951 0.260 0.740
#> ERR863690 1 0.1633 0.8829 0.976 0.024
#> ERR863692 1 0.1843 0.8821 0.972 0.028
#> ERR863703 1 0.0000 0.8913 1.000 0.000
#> ERR863712 1 0.1843 0.8821 0.972 0.028
#> ERR863711 1 0.2043 0.8923 0.968 0.032
#> ERR863760 1 0.1843 0.8821 0.972 0.028
#> ERR863727 1 0.9286 0.3520 0.656 0.344
#> ERR863766 2 0.9795 0.3804 0.416 0.584
#> ERR863767 1 0.2043 0.8923 0.968 0.032
#> ERR863752 1 0.2236 0.8925 0.964 0.036
#> ERR863757 2 0.7602 0.7184 0.220 0.780
#> ERR863758 1 0.0938 0.8932 0.988 0.012
#> ERR863755 1 0.9833 0.0915 0.576 0.424
#> ERR863756 2 0.9833 0.3591 0.424 0.576
#> ERR863707 2 0.9710 0.4139 0.400 0.600
#> ERR863681 2 0.1843 0.7577 0.028 0.972
#> ERR863719 2 0.8386 0.6895 0.268 0.732
#> ERR863759 1 0.9522 0.2914 0.628 0.372
#> ERR863718 1 0.1633 0.8829 0.976 0.024
#> ERR863717 1 0.0376 0.8921 0.996 0.004
#> ERR863715 2 0.8144 0.7013 0.252 0.748
#> ERR863716 1 0.8144 0.5907 0.748 0.252
#> ERR863722 1 0.2043 0.8923 0.968 0.032
#> ERR863721 1 0.1843 0.8821 0.972 0.028
#> ERR863720 1 0.1843 0.8821 0.972 0.028
#> ERR863723 1 0.8267 0.5632 0.740 0.260
#> ERR863761 2 0.3114 0.7721 0.056 0.944
#> ERR863735 1 0.0672 0.8926 0.992 0.008
#> ERR863734 2 0.9795 0.3804 0.416 0.584
#> ERR863736 2 0.8267 0.6951 0.260 0.740
#> ERR863729 2 0.8144 0.7013 0.252 0.748
#> ERR863728 1 0.2043 0.8923 0.968 0.032
#> ERR863731 1 0.0000 0.8913 1.000 0.000
#> ERR863764 1 0.2043 0.8932 0.968 0.032
#> ERR863740 1 0.5629 0.7814 0.868 0.132
#> ERR863765 2 0.3114 0.7721 0.056 0.944
#> ERR863762 2 0.3114 0.7721 0.056 0.944
#> ERR863724 2 0.3114 0.7721 0.056 0.944
#> ERR863733 1 0.2236 0.8925 0.964 0.036
#> ERR863732 2 0.3114 0.7721 0.056 0.944
#> ERR863730 1 0.2043 0.8923 0.968 0.032
#> ERR863742 1 0.2043 0.8923 0.968 0.032
#> ERR863763 1 0.2236 0.8925 0.964 0.036
#> ERR863741 2 0.8267 0.6951 0.260 0.740
#> ERR863743 1 0.1633 0.8829 0.976 0.024
#> ERR863745 1 0.2043 0.8932 0.968 0.032
#> ERR863744 1 0.5059 0.7939 0.888 0.112
#> ERR863746 1 0.2043 0.8923 0.968 0.032
#> ERR863748 1 0.9850 0.0998 0.572 0.428
#> ERR863747 1 0.9988 -0.0921 0.520 0.480
#> ERR863694 1 0.6973 0.6886 0.812 0.188
#> ERR863693 1 0.2043 0.8923 0.968 0.032
#> ERR863686 2 0.8267 0.6951 0.260 0.740
#> ERR863678 1 0.2043 0.8923 0.968 0.032
#> ERR863685 2 0.9795 0.3804 0.416 0.584
#> ERR863689 1 0.2043 0.8923 0.968 0.032
#> ERR863691 1 0.1633 0.8829 0.976 0.024
#> ERR863682 1 0.8386 0.5516 0.732 0.268
#> ERR863695 1 0.2236 0.8925 0.964 0.036
#> ERR863683 1 0.2043 0.8923 0.968 0.032
#> ERR863684 1 0.1843 0.8821 0.972 0.028
#> ERR863702 2 0.8267 0.6951 0.260 0.740
#> ERR863687 2 0.2948 0.7709 0.052 0.948
#> ERR863706 2 0.3114 0.7721 0.056 0.944
#> ERR863708 1 0.1633 0.8938 0.976 0.024
#> ERR863710 1 0.0376 0.8921 0.996 0.004
#> ERR863709 1 0.1843 0.8821 0.972 0.028
#> ERR863753 1 0.2236 0.8925 0.964 0.036
#> ERR863754 1 0.1633 0.8829 0.976 0.024
#> ERR863749 1 0.2043 0.8923 0.968 0.032
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> ERR863675 1 0.4062 0.8559 0.836 0.164 0.000
#> ERR863705 3 0.0592 0.8846 0.000 0.012 0.988
#> ERR863704 1 0.5431 0.7588 0.716 0.284 0.000
#> ERR863679 3 0.0592 0.8846 0.000 0.012 0.988
#> ERR863680 1 0.4452 0.8433 0.808 0.192 0.000
#> ERR863676 1 0.4121 0.8547 0.832 0.168 0.000
#> ERR863677 1 0.4121 0.8547 0.832 0.168 0.000
#> ERR863688 2 0.4178 0.8496 0.000 0.828 0.172
#> ERR863690 1 0.0892 0.8794 0.980 0.020 0.000
#> ERR863692 1 0.0747 0.8794 0.984 0.016 0.000
#> ERR863703 1 0.0661 0.8783 0.988 0.008 0.004
#> ERR863712 1 0.4121 0.8551 0.832 0.168 0.000
#> ERR863711 1 0.1015 0.8775 0.980 0.008 0.012
#> ERR863760 1 0.5882 0.6706 0.652 0.348 0.000
#> ERR863727 1 0.6832 0.2305 0.604 0.376 0.020
#> ERR863766 3 0.4345 0.8032 0.136 0.016 0.848
#> ERR863767 1 0.0829 0.8785 0.984 0.004 0.012
#> ERR863752 1 0.4121 0.8547 0.832 0.168 0.000
#> ERR863757 2 0.4178 0.8496 0.000 0.828 0.172
#> ERR863758 1 0.0661 0.8783 0.988 0.008 0.004
#> ERR863755 2 0.6673 0.5658 0.344 0.636 0.020
#> ERR863756 3 0.4663 0.8161 0.016 0.156 0.828
#> ERR863707 3 0.4217 0.8478 0.032 0.100 0.868
#> ERR863681 3 0.0592 0.8846 0.000 0.012 0.988
#> ERR863719 2 0.4589 0.8448 0.008 0.820 0.172
#> ERR863759 3 0.5988 0.7563 0.056 0.168 0.776
#> ERR863718 1 0.0661 0.8783 0.988 0.008 0.004
#> ERR863717 1 0.1015 0.8767 0.980 0.008 0.012
#> ERR863715 2 0.4178 0.8496 0.000 0.828 0.172
#> ERR863716 2 0.6758 0.5334 0.360 0.620 0.020
#> ERR863722 1 0.2229 0.8779 0.944 0.044 0.012
#> ERR863721 1 0.3752 0.8612 0.856 0.144 0.000
#> ERR863720 1 0.4121 0.8551 0.832 0.168 0.000
#> ERR863723 1 0.6849 0.2178 0.600 0.380 0.020
#> ERR863761 3 0.0592 0.8846 0.000 0.012 0.988
#> ERR863735 1 0.1015 0.8767 0.980 0.008 0.012
#> ERR863734 3 0.4139 0.8165 0.124 0.016 0.860
#> ERR863736 2 0.4121 0.8479 0.000 0.832 0.168
#> ERR863729 2 0.4178 0.8496 0.000 0.828 0.172
#> ERR863728 1 0.2229 0.8779 0.944 0.044 0.012
#> ERR863731 1 0.0661 0.8783 0.988 0.008 0.004
#> ERR863764 1 0.4121 0.8547 0.832 0.168 0.000
#> ERR863740 1 0.1015 0.8767 0.980 0.008 0.012
#> ERR863765 3 0.0661 0.8851 0.004 0.008 0.988
#> ERR863762 3 0.0592 0.8846 0.000 0.012 0.988
#> ERR863724 3 0.0592 0.8846 0.000 0.012 0.988
#> ERR863733 1 0.4121 0.8547 0.832 0.168 0.000
#> ERR863732 3 0.0661 0.8851 0.004 0.008 0.988
#> ERR863730 1 0.1015 0.8775 0.980 0.008 0.012
#> ERR863742 1 0.1015 0.8775 0.980 0.008 0.012
#> ERR863763 1 0.4121 0.8547 0.832 0.168 0.000
#> ERR863741 2 0.4178 0.8496 0.000 0.828 0.172
#> ERR863743 1 0.0661 0.8783 0.988 0.008 0.004
#> ERR863745 1 0.4121 0.8547 0.832 0.168 0.000
#> ERR863744 1 0.1015 0.8767 0.980 0.008 0.012
#> ERR863746 1 0.0829 0.8773 0.984 0.004 0.012
#> ERR863748 3 0.4663 0.8161 0.016 0.156 0.828
#> ERR863747 3 0.4692 0.8025 0.012 0.168 0.820
#> ERR863694 1 0.7460 0.0788 0.524 0.440 0.036
#> ERR863693 1 0.4062 0.8562 0.836 0.164 0.000
#> ERR863686 2 0.4178 0.8496 0.000 0.828 0.172
#> ERR863678 1 0.0829 0.8785 0.984 0.004 0.012
#> ERR863685 3 0.4139 0.8165 0.124 0.016 0.860
#> ERR863689 1 0.2625 0.8737 0.916 0.084 0.000
#> ERR863691 1 0.0747 0.8794 0.984 0.016 0.000
#> ERR863682 2 0.6696 0.5587 0.348 0.632 0.020
#> ERR863695 1 0.4121 0.8547 0.832 0.168 0.000
#> ERR863683 1 0.1015 0.8775 0.980 0.008 0.012
#> ERR863684 1 0.1529 0.8792 0.960 0.040 0.000
#> ERR863702 2 0.4178 0.8496 0.000 0.828 0.172
#> ERR863687 3 0.0592 0.8846 0.000 0.012 0.988
#> ERR863706 3 0.1170 0.8819 0.016 0.008 0.976
#> ERR863708 1 0.4121 0.8547 0.832 0.168 0.000
#> ERR863710 1 0.1015 0.8767 0.980 0.008 0.012
#> ERR863709 1 0.4121 0.8551 0.832 0.168 0.000
#> ERR863753 1 0.4121 0.8547 0.832 0.168 0.000
#> ERR863754 1 0.0747 0.8794 0.984 0.016 0.000
#> ERR863749 1 0.1015 0.8775 0.980 0.008 0.012
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> ERR863675 2 0.3024 0.946 0.148 0.852 0.000 0.000
#> ERR863705 3 0.2329 0.938 0.000 0.072 0.916 0.012
#> ERR863704 2 0.2976 0.895 0.120 0.872 0.000 0.008
#> ERR863679 3 0.0469 0.976 0.000 0.000 0.988 0.012
#> ERR863680 2 0.2814 0.905 0.132 0.868 0.000 0.000
#> ERR863676 2 0.2868 0.951 0.136 0.864 0.000 0.000
#> ERR863677 2 0.3024 0.946 0.148 0.852 0.000 0.000
#> ERR863688 4 0.0469 0.962 0.000 0.012 0.000 0.988
#> ERR863690 1 0.1022 0.919 0.968 0.032 0.000 0.000
#> ERR863692 1 0.1389 0.903 0.952 0.048 0.000 0.000
#> ERR863703 1 0.0592 0.921 0.984 0.016 0.000 0.000
#> ERR863712 2 0.2868 0.951 0.136 0.864 0.000 0.000
#> ERR863711 1 0.1022 0.919 0.968 0.032 0.000 0.000
#> ERR863760 2 0.3108 0.886 0.112 0.872 0.000 0.016
#> ERR863727 1 0.2840 0.863 0.900 0.056 0.000 0.044
#> ERR863766 3 0.0592 0.974 0.000 0.016 0.984 0.000
#> ERR863767 1 0.1356 0.917 0.960 0.032 0.008 0.000
#> ERR863752 2 0.2868 0.951 0.136 0.864 0.000 0.000
#> ERR863757 4 0.0469 0.962 0.000 0.012 0.000 0.988
#> ERR863758 1 0.1022 0.919 0.968 0.032 0.000 0.000
#> ERR863755 1 0.4541 0.763 0.796 0.060 0.000 0.144
#> ERR863756 3 0.0592 0.974 0.000 0.016 0.984 0.000
#> ERR863707 3 0.0592 0.974 0.000 0.016 0.984 0.000
#> ERR863681 3 0.2329 0.938 0.000 0.072 0.916 0.012
#> ERR863719 4 0.4282 0.818 0.124 0.060 0.000 0.816
#> ERR863759 2 0.2868 0.790 0.000 0.864 0.136 0.000
#> ERR863718 1 0.0000 0.921 1.000 0.000 0.000 0.000
#> ERR863717 1 0.0336 0.919 0.992 0.008 0.000 0.000
#> ERR863715 4 0.0000 0.964 0.000 0.000 0.000 1.000
#> ERR863716 1 0.4491 0.769 0.800 0.060 0.000 0.140
#> ERR863722 1 0.3300 0.806 0.848 0.144 0.008 0.000
#> ERR863721 2 0.3172 0.935 0.160 0.840 0.000 0.000
#> ERR863720 2 0.2868 0.951 0.136 0.864 0.000 0.000
#> ERR863723 1 0.2919 0.862 0.896 0.060 0.000 0.044
#> ERR863761 3 0.0672 0.976 0.000 0.008 0.984 0.008
#> ERR863735 1 0.0188 0.920 0.996 0.004 0.000 0.000
#> ERR863734 3 0.0592 0.974 0.000 0.016 0.984 0.000
#> ERR863736 4 0.2483 0.914 0.032 0.052 0.000 0.916
#> ERR863729 4 0.0000 0.964 0.000 0.000 0.000 1.000
#> ERR863728 1 0.3351 0.801 0.844 0.148 0.008 0.000
#> ERR863731 1 0.1022 0.919 0.968 0.032 0.000 0.000
#> ERR863764 2 0.2868 0.951 0.136 0.864 0.000 0.000
#> ERR863740 1 0.1722 0.896 0.944 0.048 0.008 0.000
#> ERR863765 3 0.0469 0.976 0.000 0.000 0.988 0.012
#> ERR863762 3 0.0469 0.976 0.000 0.000 0.988 0.012
#> ERR863724 3 0.2329 0.938 0.000 0.072 0.916 0.012
#> ERR863733 2 0.2345 0.928 0.100 0.900 0.000 0.000
#> ERR863732 3 0.0469 0.976 0.000 0.000 0.988 0.012
#> ERR863730 1 0.1151 0.920 0.968 0.024 0.008 0.000
#> ERR863742 1 0.2408 0.901 0.920 0.044 0.036 0.000
#> ERR863763 2 0.3024 0.946 0.148 0.852 0.000 0.000
#> ERR863741 4 0.0000 0.964 0.000 0.000 0.000 1.000
#> ERR863743 1 0.0188 0.921 0.996 0.004 0.000 0.000
#> ERR863745 2 0.2868 0.951 0.136 0.864 0.000 0.000
#> ERR863744 1 0.1474 0.899 0.948 0.052 0.000 0.000
#> ERR863746 1 0.1356 0.917 0.960 0.032 0.008 0.000
#> ERR863748 3 0.0592 0.974 0.000 0.016 0.984 0.000
#> ERR863747 2 0.3219 0.755 0.000 0.836 0.164 0.000
#> ERR863694 1 0.5560 0.720 0.728 0.156 0.000 0.116
#> ERR863693 2 0.4086 0.871 0.216 0.776 0.008 0.000
#> ERR863686 4 0.0000 0.964 0.000 0.000 0.000 1.000
#> ERR863678 1 0.1356 0.917 0.960 0.032 0.008 0.000
#> ERR863685 3 0.0592 0.974 0.000 0.016 0.984 0.000
#> ERR863689 1 0.4158 0.680 0.768 0.224 0.008 0.000
#> ERR863691 1 0.0336 0.920 0.992 0.008 0.000 0.000
#> ERR863682 1 0.4541 0.763 0.796 0.060 0.000 0.144
#> ERR863695 2 0.3024 0.946 0.148 0.852 0.000 0.000
#> ERR863683 1 0.1356 0.917 0.960 0.032 0.008 0.000
#> ERR863684 1 0.1389 0.907 0.952 0.048 0.000 0.000
#> ERR863702 4 0.0000 0.964 0.000 0.000 0.000 1.000
#> ERR863687 3 0.0469 0.976 0.000 0.000 0.988 0.012
#> ERR863706 3 0.0469 0.976 0.000 0.000 0.988 0.012
#> ERR863708 2 0.2868 0.951 0.136 0.864 0.000 0.000
#> ERR863710 1 0.0000 0.921 1.000 0.000 0.000 0.000
#> ERR863709 2 0.2868 0.951 0.136 0.864 0.000 0.000
#> ERR863753 2 0.2868 0.951 0.136 0.864 0.000 0.000
#> ERR863754 1 0.0336 0.920 0.992 0.008 0.000 0.000
#> ERR863749 1 0.1356 0.917 0.960 0.032 0.008 0.000
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> ERR863675 2 0.4514 0.780 0.072 0.740 0.000 0.188 0.000
#> ERR863705 3 0.2763 0.820 0.000 0.004 0.848 0.148 0.000
#> ERR863704 2 0.2685 0.800 0.028 0.880 0.000 0.092 0.000
#> ERR863679 3 0.0324 0.893 0.000 0.004 0.992 0.004 0.000
#> ERR863680 2 0.2344 0.814 0.032 0.904 0.000 0.064 0.000
#> ERR863676 2 0.1012 0.841 0.020 0.968 0.000 0.012 0.000
#> ERR863677 2 0.4127 0.784 0.080 0.784 0.000 0.136 0.000
#> ERR863688 5 0.1197 0.913 0.000 0.000 0.000 0.048 0.952
#> ERR863690 1 0.1485 0.683 0.948 0.032 0.000 0.020 0.000
#> ERR863692 1 0.4489 0.345 0.572 0.008 0.000 0.420 0.000
#> ERR863703 1 0.1041 0.693 0.964 0.004 0.000 0.032 0.000
#> ERR863712 2 0.2426 0.829 0.036 0.900 0.000 0.064 0.000
#> ERR863711 1 0.1300 0.684 0.956 0.028 0.000 0.016 0.000
#> ERR863760 2 0.2685 0.800 0.028 0.880 0.000 0.092 0.000
#> ERR863727 1 0.4630 0.322 0.572 0.004 0.000 0.416 0.008
#> ERR863766 3 0.2497 0.882 0.004 0.004 0.880 0.112 0.000
#> ERR863767 1 0.1907 0.668 0.928 0.028 0.000 0.044 0.000
#> ERR863752 2 0.3340 0.812 0.016 0.824 0.004 0.156 0.000
#> ERR863757 5 0.1197 0.913 0.000 0.000 0.000 0.048 0.952
#> ERR863758 1 0.0771 0.691 0.976 0.020 0.000 0.004 0.000
#> ERR863755 1 0.5137 0.267 0.548 0.004 0.000 0.416 0.032
#> ERR863756 3 0.4016 0.768 0.000 0.012 0.716 0.272 0.000
#> ERR863707 3 0.2338 0.882 0.000 0.004 0.884 0.112 0.000
#> ERR863681 3 0.3455 0.777 0.000 0.008 0.784 0.208 0.000
#> ERR863719 4 0.6100 0.128 0.096 0.008 0.000 0.472 0.424
#> ERR863759 2 0.6287 0.446 0.000 0.520 0.184 0.296 0.000
#> ERR863718 1 0.3048 0.638 0.820 0.004 0.000 0.176 0.000
#> ERR863717 1 0.3421 0.617 0.788 0.008 0.000 0.204 0.000
#> ERR863715 5 0.0000 0.937 0.000 0.000 0.000 0.000 1.000
#> ERR863716 1 0.5137 0.267 0.548 0.004 0.000 0.416 0.032
#> ERR863722 1 0.5104 0.412 0.692 0.116 0.000 0.192 0.000
#> ERR863721 2 0.3810 0.761 0.100 0.812 0.000 0.088 0.000
#> ERR863720 2 0.0771 0.840 0.020 0.976 0.000 0.004 0.000
#> ERR863723 1 0.4630 0.322 0.572 0.004 0.000 0.416 0.008
#> ERR863761 3 0.1768 0.891 0.004 0.000 0.924 0.072 0.000
#> ERR863735 1 0.2753 0.660 0.856 0.008 0.000 0.136 0.000
#> ERR863734 3 0.2497 0.882 0.004 0.004 0.880 0.112 0.000
#> ERR863736 5 0.3845 0.605 0.012 0.004 0.000 0.224 0.760
#> ERR863729 5 0.0000 0.937 0.000 0.000 0.000 0.000 1.000
#> ERR863728 1 0.4805 0.453 0.728 0.128 0.000 0.144 0.000
#> ERR863731 1 0.1082 0.687 0.964 0.028 0.000 0.008 0.000
#> ERR863764 2 0.2727 0.833 0.016 0.868 0.000 0.116 0.000
#> ERR863740 1 0.4182 0.441 0.644 0.004 0.000 0.352 0.000
#> ERR863765 3 0.0740 0.893 0.004 0.008 0.980 0.008 0.000
#> ERR863762 3 0.0451 0.893 0.000 0.004 0.988 0.008 0.000
#> ERR863724 3 0.3455 0.777 0.000 0.008 0.784 0.208 0.000
#> ERR863733 2 0.3844 0.793 0.028 0.788 0.004 0.180 0.000
#> ERR863732 3 0.0579 0.893 0.000 0.008 0.984 0.008 0.000
#> ERR863730 1 0.0865 0.691 0.972 0.004 0.000 0.024 0.000
#> ERR863742 1 0.1538 0.686 0.948 0.008 0.008 0.036 0.000
#> ERR863763 2 0.4083 0.786 0.080 0.788 0.000 0.132 0.000
#> ERR863741 5 0.0000 0.937 0.000 0.000 0.000 0.000 1.000
#> ERR863743 1 0.1768 0.684 0.924 0.004 0.000 0.072 0.000
#> ERR863745 2 0.1399 0.839 0.020 0.952 0.000 0.028 0.000
#> ERR863744 1 0.4380 0.400 0.616 0.008 0.000 0.376 0.000
#> ERR863746 1 0.0912 0.691 0.972 0.016 0.000 0.012 0.000
#> ERR863748 3 0.4374 0.750 0.000 0.028 0.700 0.272 0.000
#> ERR863747 2 0.6287 0.446 0.000 0.520 0.184 0.296 0.000
#> ERR863694 4 0.7054 0.351 0.216 0.292 0.000 0.468 0.024
#> ERR863693 1 0.6247 -0.219 0.428 0.428 0.000 0.144 0.000
#> ERR863686 5 0.0162 0.937 0.000 0.000 0.000 0.004 0.996
#> ERR863678 1 0.2036 0.666 0.920 0.024 0.000 0.056 0.000
#> ERR863685 3 0.2497 0.882 0.004 0.004 0.880 0.112 0.000
#> ERR863689 1 0.5618 0.304 0.632 0.224 0.000 0.144 0.000
#> ERR863691 1 0.3246 0.634 0.808 0.008 0.000 0.184 0.000
#> ERR863682 1 0.5137 0.267 0.548 0.004 0.000 0.416 0.032
#> ERR863695 2 0.2964 0.828 0.024 0.856 0.000 0.120 0.000
#> ERR863683 1 0.1211 0.691 0.960 0.016 0.000 0.024 0.000
#> ERR863684 1 0.6236 0.181 0.544 0.248 0.000 0.208 0.000
#> ERR863702 5 0.0162 0.937 0.000 0.000 0.000 0.004 0.996
#> ERR863687 3 0.1408 0.886 0.000 0.008 0.948 0.044 0.000
#> ERR863706 3 0.0162 0.892 0.004 0.000 0.996 0.000 0.000
#> ERR863708 2 0.0609 0.841 0.020 0.980 0.000 0.000 0.000
#> ERR863710 1 0.1768 0.684 0.924 0.004 0.000 0.072 0.000
#> ERR863709 2 0.2221 0.828 0.036 0.912 0.000 0.052 0.000
#> ERR863753 2 0.1568 0.844 0.020 0.944 0.000 0.036 0.000
#> ERR863754 1 0.3353 0.625 0.796 0.008 0.000 0.196 0.000
#> ERR863749 1 0.0992 0.690 0.968 0.024 0.000 0.008 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> ERR863675 2 0.6666 0.5575 0.156 0.536 0.000 0.124 0.000 0.184
#> ERR863705 3 0.1989 0.5613 0.000 0.004 0.916 0.028 0.000 0.052
#> ERR863704 2 0.4558 0.6675 0.000 0.700 0.000 0.132 0.000 0.168
#> ERR863679 3 0.3468 0.7322 0.000 0.000 0.712 0.004 0.000 0.284
#> ERR863680 2 0.3325 0.7386 0.000 0.820 0.000 0.096 0.000 0.084
#> ERR863676 2 0.0146 0.7942 0.004 0.996 0.000 0.000 0.000 0.000
#> ERR863677 2 0.4655 0.7079 0.088 0.744 0.000 0.120 0.000 0.048
#> ERR863688 5 0.1714 0.8681 0.000 0.000 0.000 0.092 0.908 0.000
#> ERR863690 1 0.2452 0.6933 0.892 0.008 0.000 0.044 0.000 0.056
#> ERR863692 4 0.4313 0.7334 0.284 0.000 0.000 0.668 0.000 0.048
#> ERR863703 1 0.2979 0.6670 0.840 0.000 0.000 0.116 0.000 0.044
#> ERR863712 2 0.2894 0.7758 0.020 0.864 0.000 0.088 0.000 0.028
#> ERR863711 1 0.0520 0.7007 0.984 0.008 0.000 0.000 0.000 0.008
#> ERR863760 2 0.4650 0.6577 0.000 0.688 0.000 0.132 0.000 0.180
#> ERR863727 4 0.3330 0.8052 0.284 0.000 0.000 0.716 0.000 0.000
#> ERR863766 3 0.4184 0.6278 0.004 0.000 0.556 0.008 0.000 0.432
#> ERR863767 1 0.1655 0.6815 0.932 0.008 0.000 0.052 0.000 0.008
#> ERR863752 2 0.3983 0.5732 0.004 0.640 0.000 0.008 0.000 0.348
#> ERR863757 5 0.1714 0.8681 0.000 0.000 0.000 0.092 0.908 0.000
#> ERR863758 1 0.1464 0.7038 0.944 0.004 0.000 0.016 0.000 0.036
#> ERR863755 4 0.3383 0.8138 0.268 0.000 0.000 0.728 0.004 0.000
#> ERR863756 6 0.2883 0.5738 0.000 0.000 0.212 0.000 0.000 0.788
#> ERR863707 3 0.3955 0.6311 0.000 0.000 0.560 0.004 0.000 0.436
#> ERR863681 3 0.2265 0.4614 0.000 0.004 0.896 0.076 0.000 0.024
#> ERR863719 4 0.4246 0.4177 0.012 0.000 0.012 0.752 0.184 0.040
#> ERR863759 6 0.2416 0.7189 0.000 0.156 0.000 0.000 0.000 0.844
#> ERR863718 1 0.4299 0.3525 0.652 0.000 0.000 0.308 0.000 0.040
#> ERR863717 1 0.4300 0.2899 0.640 0.000 0.000 0.324 0.000 0.036
#> ERR863715 5 0.0260 0.8999 0.000 0.000 0.000 0.000 0.992 0.008
#> ERR863716 4 0.3360 0.8128 0.264 0.000 0.000 0.732 0.004 0.000
#> ERR863722 1 0.5476 0.4942 0.676 0.084 0.000 0.112 0.000 0.128
#> ERR863721 2 0.4955 0.6829 0.084 0.716 0.000 0.144 0.000 0.056
#> ERR863720 2 0.0951 0.7924 0.004 0.968 0.000 0.008 0.000 0.020
#> ERR863723 4 0.3244 0.8122 0.268 0.000 0.000 0.732 0.000 0.000
#> ERR863761 3 0.3830 0.6822 0.000 0.000 0.620 0.004 0.000 0.376
#> ERR863735 1 0.4067 0.4471 0.700 0.000 0.000 0.260 0.000 0.040
#> ERR863734 3 0.4184 0.6278 0.004 0.000 0.556 0.008 0.000 0.432
#> ERR863736 5 0.5157 0.4561 0.000 0.000 0.000 0.360 0.544 0.096
#> ERR863729 5 0.0260 0.8999 0.000 0.000 0.000 0.000 0.992 0.008
#> ERR863728 1 0.4426 0.5536 0.760 0.092 0.000 0.112 0.000 0.036
#> ERR863731 1 0.1410 0.7041 0.944 0.008 0.000 0.004 0.000 0.044
#> ERR863764 2 0.3741 0.7300 0.004 0.756 0.000 0.032 0.000 0.208
#> ERR863740 4 0.4039 0.5794 0.424 0.000 0.000 0.568 0.000 0.008
#> ERR863765 3 0.3555 0.7322 0.000 0.000 0.712 0.008 0.000 0.280
#> ERR863762 3 0.3508 0.7294 0.000 0.000 0.704 0.004 0.000 0.292
#> ERR863724 3 0.2265 0.4614 0.000 0.004 0.896 0.076 0.000 0.024
#> ERR863733 2 0.4587 0.5475 0.000 0.596 0.000 0.048 0.000 0.356
#> ERR863732 3 0.3615 0.7291 0.000 0.000 0.700 0.008 0.000 0.292
#> ERR863730 1 0.1524 0.6862 0.932 0.000 0.000 0.060 0.000 0.008
#> ERR863742 1 0.1769 0.6838 0.924 0.000 0.004 0.060 0.000 0.012
#> ERR863763 2 0.4614 0.7085 0.088 0.748 0.000 0.116 0.000 0.048
#> ERR863741 5 0.0260 0.8999 0.000 0.000 0.000 0.000 0.992 0.008
#> ERR863743 1 0.3588 0.5799 0.776 0.000 0.000 0.180 0.000 0.044
#> ERR863745 2 0.1732 0.7850 0.004 0.920 0.000 0.004 0.000 0.072
#> ERR863744 4 0.3862 0.6617 0.388 0.000 0.000 0.608 0.000 0.004
#> ERR863746 1 0.1124 0.6973 0.956 0.000 0.000 0.036 0.000 0.008
#> ERR863748 6 0.3078 0.6207 0.000 0.012 0.192 0.000 0.000 0.796
#> ERR863747 6 0.2593 0.7260 0.000 0.148 0.008 0.000 0.000 0.844
#> ERR863694 4 0.3906 0.5551 0.040 0.132 0.000 0.796 0.004 0.028
#> ERR863693 1 0.6003 0.2651 0.560 0.276 0.000 0.116 0.000 0.048
#> ERR863686 5 0.0717 0.8968 0.000 0.000 0.000 0.008 0.976 0.016
#> ERR863678 1 0.1643 0.6793 0.924 0.008 0.000 0.068 0.000 0.000
#> ERR863685 3 0.4082 0.6287 0.004 0.000 0.560 0.004 0.000 0.432
#> ERR863689 1 0.5294 0.4868 0.676 0.164 0.000 0.116 0.000 0.044
#> ERR863691 1 0.4403 0.3945 0.648 0.000 0.000 0.304 0.000 0.048
#> ERR863682 4 0.3383 0.8138 0.268 0.000 0.000 0.728 0.004 0.000
#> ERR863695 2 0.2838 0.7700 0.024 0.872 0.000 0.072 0.000 0.032
#> ERR863683 1 0.1524 0.6862 0.932 0.000 0.000 0.060 0.000 0.008
#> ERR863684 1 0.6817 -0.0655 0.372 0.204 0.000 0.368 0.000 0.056
#> ERR863702 5 0.0914 0.8953 0.000 0.000 0.000 0.016 0.968 0.016
#> ERR863687 3 0.3890 0.5762 0.000 0.000 0.596 0.004 0.000 0.400
#> ERR863706 3 0.3468 0.7322 0.000 0.000 0.728 0.008 0.000 0.264
#> ERR863708 2 0.0603 0.7936 0.004 0.980 0.000 0.000 0.000 0.016
#> ERR863710 1 0.3555 0.5887 0.780 0.000 0.000 0.176 0.000 0.044
#> ERR863709 2 0.1173 0.7923 0.008 0.960 0.000 0.016 0.000 0.016
#> ERR863753 2 0.1668 0.7883 0.004 0.928 0.000 0.008 0.000 0.060
#> ERR863754 1 0.4548 0.3675 0.632 0.000 0.000 0.312 0.000 0.056
#> ERR863749 1 0.0717 0.7016 0.976 0.000 0.000 0.016 0.000 0.008
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
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)
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 17118 rows and 78 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'ATC' method.
#> Subgroups are detected by 'skmeans' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 4.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
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.999 0.939 0.975 0.5003 0.499 0.499
#> 3 3 1.000 0.950 0.972 0.2951 0.793 0.610
#> 4 4 1.000 0.978 0.990 0.1652 0.819 0.536
#> 5 5 0.792 0.633 0.803 0.0607 0.912 0.673
#> 6 6 0.799 0.621 0.800 0.0388 0.909 0.610
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 4
#> attr(,"optional")
#> [1] 2 3
There is also optional best \(k\) = 2 3 that is worth to check.
Following shows the table of the partitions (You need to click the show/hide
code output link to see it). The membership matrix (columns with name p*
)
is inferred by
clue::cl_consensus()
function with the SE
method. Basically the value in the membership matrix
represents the probability to belong to a certain group. The finall class
label for an item is determined with the group with highest probability it
belongs to.
In get_classes()
function, the entropy is calculated from the membership
matrix and the silhouette score is calculated from the consensus matrix.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> ERR863675 1 0.0376 0.9786 0.996 0.004
#> ERR863705 2 0.0000 0.9670 0.000 1.000
#> ERR863704 1 0.3733 0.9193 0.928 0.072
#> ERR863679 2 0.0000 0.9670 0.000 1.000
#> ERR863680 1 0.2236 0.9527 0.964 0.036
#> ERR863676 1 0.0376 0.9786 0.996 0.004
#> ERR863677 1 0.0376 0.9786 0.996 0.004
#> ERR863688 2 0.0376 0.9662 0.004 0.996
#> ERR863690 1 0.0000 0.9784 1.000 0.000
#> ERR863692 1 0.0000 0.9784 1.000 0.000
#> ERR863703 1 0.0000 0.9784 1.000 0.000
#> ERR863712 1 0.0000 0.9784 1.000 0.000
#> ERR863711 1 0.0376 0.9786 0.996 0.004
#> ERR863760 2 0.9087 0.5199 0.324 0.676
#> ERR863727 2 0.2423 0.9443 0.040 0.960
#> ERR863766 2 0.0000 0.9670 0.000 1.000
#> ERR863767 1 0.0376 0.9786 0.996 0.004
#> ERR863752 1 0.2423 0.9521 0.960 0.040
#> ERR863757 2 0.0376 0.9662 0.004 0.996
#> ERR863758 1 0.0000 0.9784 1.000 0.000
#> ERR863755 2 0.2423 0.9443 0.040 0.960
#> ERR863756 2 0.0000 0.9670 0.000 1.000
#> ERR863707 2 0.0000 0.9670 0.000 1.000
#> ERR863681 2 0.0000 0.9670 0.000 1.000
#> ERR863719 2 0.0376 0.9662 0.004 0.996
#> ERR863759 2 0.0672 0.9629 0.008 0.992
#> ERR863718 1 0.0000 0.9784 1.000 0.000
#> ERR863717 1 0.0000 0.9784 1.000 0.000
#> ERR863715 2 0.0376 0.9662 0.004 0.996
#> ERR863716 2 0.9954 0.1694 0.460 0.540
#> ERR863722 1 0.0376 0.9786 0.996 0.004
#> ERR863721 1 0.0000 0.9784 1.000 0.000
#> ERR863720 1 0.0000 0.9784 1.000 0.000
#> ERR863723 2 0.2423 0.9443 0.040 0.960
#> ERR863761 2 0.0000 0.9670 0.000 1.000
#> ERR863735 1 0.0000 0.9784 1.000 0.000
#> ERR863734 2 0.0000 0.9670 0.000 1.000
#> ERR863736 2 0.0376 0.9662 0.004 0.996
#> ERR863729 2 0.0376 0.9662 0.004 0.996
#> ERR863728 1 0.0376 0.9786 0.996 0.004
#> ERR863731 1 0.0000 0.9784 1.000 0.000
#> ERR863764 1 0.2423 0.9521 0.960 0.040
#> ERR863740 2 0.2423 0.9443 0.040 0.960
#> ERR863765 2 0.0000 0.9670 0.000 1.000
#> ERR863762 2 0.0000 0.9670 0.000 1.000
#> ERR863724 2 0.0000 0.9670 0.000 1.000
#> ERR863733 2 0.3584 0.9105 0.068 0.932
#> ERR863732 2 0.0000 0.9670 0.000 1.000
#> ERR863730 1 0.0938 0.9741 0.988 0.012
#> ERR863742 1 0.2043 0.9581 0.968 0.032
#> ERR863763 1 0.0376 0.9786 0.996 0.004
#> ERR863741 2 0.0376 0.9662 0.004 0.996
#> ERR863743 1 0.0000 0.9784 1.000 0.000
#> ERR863745 1 0.2423 0.9521 0.960 0.040
#> ERR863744 2 0.2423 0.9443 0.040 0.960
#> ERR863746 1 0.0376 0.9786 0.996 0.004
#> ERR863748 2 0.0376 0.9653 0.004 0.996
#> ERR863747 2 0.0000 0.9670 0.000 1.000
#> ERR863694 1 0.2603 0.9439 0.956 0.044
#> ERR863693 1 0.0376 0.9786 0.996 0.004
#> ERR863686 2 0.0376 0.9662 0.004 0.996
#> ERR863678 1 0.0376 0.9786 0.996 0.004
#> ERR863685 2 0.0000 0.9670 0.000 1.000
#> ERR863689 1 0.0376 0.9786 0.996 0.004
#> ERR863691 1 0.0000 0.9784 1.000 0.000
#> ERR863682 1 0.9998 -0.0373 0.508 0.492
#> ERR863695 1 0.0376 0.9786 0.996 0.004
#> ERR863683 1 0.0376 0.9786 0.996 0.004
#> ERR863684 1 0.0000 0.9784 1.000 0.000
#> ERR863702 2 0.0376 0.9662 0.004 0.996
#> ERR863687 2 0.0000 0.9670 0.000 1.000
#> ERR863706 2 0.0000 0.9670 0.000 1.000
#> ERR863708 1 0.0376 0.9786 0.996 0.004
#> ERR863710 1 0.0000 0.9784 1.000 0.000
#> ERR863709 1 0.0000 0.9784 1.000 0.000
#> ERR863753 1 0.0376 0.9786 0.996 0.004
#> ERR863754 1 0.0000 0.9784 1.000 0.000
#> ERR863749 1 0.0376 0.9786 0.996 0.004
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> ERR863675 1 0.0747 0.966 0.984 0.000 0.016
#> ERR863705 3 0.0747 0.964 0.000 0.016 0.984
#> ERR863704 2 0.1491 0.969 0.016 0.968 0.016
#> ERR863679 3 0.0747 0.964 0.000 0.016 0.984
#> ERR863680 2 0.1636 0.967 0.020 0.964 0.016
#> ERR863676 1 0.0747 0.966 0.984 0.000 0.016
#> ERR863677 1 0.0747 0.966 0.984 0.000 0.016
#> ERR863688 2 0.0747 0.984 0.000 0.984 0.016
#> ERR863690 1 0.0747 0.970 0.984 0.016 0.000
#> ERR863692 2 0.1753 0.939 0.048 0.952 0.000
#> ERR863703 1 0.0747 0.970 0.984 0.016 0.000
#> ERR863712 1 0.0747 0.966 0.984 0.000 0.016
#> ERR863711 1 0.0747 0.970 0.984 0.016 0.000
#> ERR863760 2 0.1491 0.969 0.016 0.968 0.016
#> ERR863727 2 0.0000 0.982 0.000 1.000 0.000
#> ERR863766 3 0.0592 0.960 0.012 0.000 0.988
#> ERR863767 1 0.0747 0.970 0.984 0.016 0.000
#> ERR863752 1 0.6274 0.163 0.544 0.000 0.456
#> ERR863757 2 0.0747 0.984 0.000 0.984 0.016
#> ERR863758 1 0.0747 0.970 0.984 0.016 0.000
#> ERR863755 2 0.0000 0.982 0.000 1.000 0.000
#> ERR863756 3 0.0000 0.961 0.000 0.000 1.000
#> ERR863707 3 0.0000 0.961 0.000 0.000 1.000
#> ERR863681 3 0.0747 0.964 0.000 0.016 0.984
#> ERR863719 2 0.0747 0.984 0.000 0.984 0.016
#> ERR863759 3 0.0747 0.953 0.016 0.000 0.984
#> ERR863718 1 0.0747 0.970 0.984 0.016 0.000
#> ERR863717 1 0.0747 0.970 0.984 0.016 0.000
#> ERR863715 2 0.0747 0.984 0.000 0.984 0.016
#> ERR863716 2 0.0000 0.982 0.000 1.000 0.000
#> ERR863722 1 0.0424 0.968 0.992 0.000 0.008
#> ERR863721 1 0.0592 0.967 0.988 0.000 0.012
#> ERR863720 1 0.0747 0.966 0.984 0.000 0.016
#> ERR863723 2 0.0000 0.982 0.000 1.000 0.000
#> ERR863761 3 0.0747 0.964 0.000 0.016 0.984
#> ERR863735 1 0.0747 0.970 0.984 0.016 0.000
#> ERR863734 3 0.0592 0.960 0.012 0.000 0.988
#> ERR863736 2 0.0747 0.984 0.000 0.984 0.016
#> ERR863729 2 0.0747 0.984 0.000 0.984 0.016
#> ERR863728 1 0.0000 0.969 1.000 0.000 0.000
#> ERR863731 1 0.0747 0.970 0.984 0.016 0.000
#> ERR863764 1 0.0747 0.966 0.984 0.000 0.016
#> ERR863740 3 0.5956 0.652 0.016 0.264 0.720
#> ERR863765 3 0.0747 0.964 0.000 0.016 0.984
#> ERR863762 3 0.0747 0.964 0.000 0.016 0.984
#> ERR863724 3 0.0747 0.964 0.000 0.016 0.984
#> ERR863733 3 0.0747 0.953 0.016 0.000 0.984
#> ERR863732 3 0.0747 0.964 0.000 0.016 0.984
#> ERR863730 1 0.4539 0.812 0.836 0.016 0.148
#> ERR863742 3 0.5115 0.755 0.188 0.016 0.796
#> ERR863763 1 0.0747 0.966 0.984 0.000 0.016
#> ERR863741 2 0.0747 0.984 0.000 0.984 0.016
#> ERR863743 1 0.0747 0.970 0.984 0.016 0.000
#> ERR863745 1 0.0747 0.966 0.984 0.000 0.016
#> ERR863744 2 0.0237 0.979 0.004 0.996 0.000
#> ERR863746 1 0.0747 0.970 0.984 0.016 0.000
#> ERR863748 3 0.0747 0.953 0.016 0.000 0.984
#> ERR863747 3 0.0747 0.953 0.016 0.000 0.984
#> ERR863694 2 0.0829 0.981 0.012 0.984 0.004
#> ERR863693 1 0.0000 0.969 1.000 0.000 0.000
#> ERR863686 2 0.0747 0.984 0.000 0.984 0.016
#> ERR863678 1 0.0747 0.970 0.984 0.016 0.000
#> ERR863685 3 0.0592 0.960 0.012 0.000 0.988
#> ERR863689 1 0.0000 0.969 1.000 0.000 0.000
#> ERR863691 1 0.0747 0.970 0.984 0.016 0.000
#> ERR863682 2 0.0237 0.979 0.004 0.996 0.000
#> ERR863695 1 0.0747 0.966 0.984 0.000 0.016
#> ERR863683 1 0.0747 0.970 0.984 0.016 0.000
#> ERR863684 1 0.0829 0.970 0.984 0.012 0.004
#> ERR863702 2 0.0747 0.984 0.000 0.984 0.016
#> ERR863687 3 0.0747 0.964 0.000 0.016 0.984
#> ERR863706 3 0.0747 0.964 0.000 0.016 0.984
#> ERR863708 1 0.0747 0.966 0.984 0.000 0.016
#> ERR863710 1 0.0747 0.970 0.984 0.016 0.000
#> ERR863709 1 0.0747 0.966 0.984 0.000 0.016
#> ERR863753 1 0.0747 0.966 0.984 0.000 0.016
#> ERR863754 1 0.0747 0.970 0.984 0.016 0.000
#> ERR863749 1 0.0747 0.970 0.984 0.016 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> ERR863675 2 0.0000 0.990 0.000 1.000 0.000 0.000
#> ERR863705 3 0.0000 0.982 0.000 0.000 1.000 0.000
#> ERR863704 2 0.0188 0.987 0.000 0.996 0.000 0.004
#> ERR863679 3 0.0000 0.982 0.000 0.000 1.000 0.000
#> ERR863680 2 0.0188 0.987 0.000 0.996 0.000 0.004
#> ERR863676 2 0.0000 0.990 0.000 1.000 0.000 0.000
#> ERR863677 2 0.0000 0.990 0.000 1.000 0.000 0.000
#> ERR863688 4 0.0000 0.995 0.000 0.000 0.000 1.000
#> ERR863690 1 0.0000 0.987 1.000 0.000 0.000 0.000
#> ERR863692 4 0.0336 0.988 0.008 0.000 0.000 0.992
#> ERR863703 1 0.0000 0.987 1.000 0.000 0.000 0.000
#> ERR863712 2 0.0000 0.990 0.000 1.000 0.000 0.000
#> ERR863711 1 0.0000 0.987 1.000 0.000 0.000 0.000
#> ERR863760 2 0.0336 0.984 0.000 0.992 0.000 0.008
#> ERR863727 4 0.0000 0.995 0.000 0.000 0.000 1.000
#> ERR863766 3 0.0000 0.982 0.000 0.000 1.000 0.000
#> ERR863767 1 0.0000 0.987 1.000 0.000 0.000 0.000
#> ERR863752 2 0.0000 0.990 0.000 1.000 0.000 0.000
#> ERR863757 4 0.0000 0.995 0.000 0.000 0.000 1.000
#> ERR863758 1 0.0000 0.987 1.000 0.000 0.000 0.000
#> ERR863755 4 0.0000 0.995 0.000 0.000 0.000 1.000
#> ERR863756 3 0.0000 0.982 0.000 0.000 1.000 0.000
#> ERR863707 3 0.0000 0.982 0.000 0.000 1.000 0.000
#> ERR863681 3 0.0000 0.982 0.000 0.000 1.000 0.000
#> ERR863719 4 0.0000 0.995 0.000 0.000 0.000 1.000
#> ERR863759 3 0.3024 0.838 0.000 0.148 0.852 0.000
#> ERR863718 1 0.0000 0.987 1.000 0.000 0.000 0.000
#> ERR863717 1 0.0000 0.987 1.000 0.000 0.000 0.000
#> ERR863715 4 0.0000 0.995 0.000 0.000 0.000 1.000
#> ERR863716 4 0.0000 0.995 0.000 0.000 0.000 1.000
#> ERR863722 1 0.1356 0.958 0.960 0.008 0.032 0.000
#> ERR863721 2 0.0000 0.990 0.000 1.000 0.000 0.000
#> ERR863720 2 0.0000 0.990 0.000 1.000 0.000 0.000
#> ERR863723 4 0.0000 0.995 0.000 0.000 0.000 1.000
#> ERR863761 3 0.0000 0.982 0.000 0.000 1.000 0.000
#> ERR863735 1 0.0000 0.987 1.000 0.000 0.000 0.000
#> ERR863734 3 0.0000 0.982 0.000 0.000 1.000 0.000
#> ERR863736 4 0.0000 0.995 0.000 0.000 0.000 1.000
#> ERR863729 4 0.0000 0.995 0.000 0.000 0.000 1.000
#> ERR863728 1 0.0336 0.982 0.992 0.008 0.000 0.000
#> ERR863731 1 0.0000 0.987 1.000 0.000 0.000 0.000
#> ERR863764 2 0.0000 0.990 0.000 1.000 0.000 0.000
#> ERR863740 1 0.3219 0.804 0.836 0.000 0.000 0.164
#> ERR863765 3 0.0000 0.982 0.000 0.000 1.000 0.000
#> ERR863762 3 0.0000 0.982 0.000 0.000 1.000 0.000
#> ERR863724 3 0.0000 0.982 0.000 0.000 1.000 0.000
#> ERR863733 2 0.0000 0.990 0.000 1.000 0.000 0.000
#> ERR863732 3 0.0000 0.982 0.000 0.000 1.000 0.000
#> ERR863730 1 0.0000 0.987 1.000 0.000 0.000 0.000
#> ERR863742 1 0.0000 0.987 1.000 0.000 0.000 0.000
#> ERR863763 2 0.0000 0.990 0.000 1.000 0.000 0.000
#> ERR863741 4 0.0000 0.995 0.000 0.000 0.000 1.000
#> ERR863743 1 0.0000 0.987 1.000 0.000 0.000 0.000
#> ERR863745 2 0.0000 0.990 0.000 1.000 0.000 0.000
#> ERR863744 4 0.1637 0.934 0.060 0.000 0.000 0.940
#> ERR863746 1 0.0000 0.987 1.000 0.000 0.000 0.000
#> ERR863748 3 0.0000 0.982 0.000 0.000 1.000 0.000
#> ERR863747 3 0.3024 0.838 0.000 0.148 0.852 0.000
#> ERR863694 4 0.0000 0.995 0.000 0.000 0.000 1.000
#> ERR863693 1 0.1389 0.947 0.952 0.048 0.000 0.000
#> ERR863686 4 0.0000 0.995 0.000 0.000 0.000 1.000
#> ERR863678 1 0.0000 0.987 1.000 0.000 0.000 0.000
#> ERR863685 3 0.0000 0.982 0.000 0.000 1.000 0.000
#> ERR863689 1 0.0817 0.970 0.976 0.024 0.000 0.000
#> ERR863691 1 0.0336 0.982 0.992 0.008 0.000 0.000
#> ERR863682 4 0.0000 0.995 0.000 0.000 0.000 1.000
#> ERR863695 2 0.0000 0.990 0.000 1.000 0.000 0.000
#> ERR863683 1 0.0000 0.987 1.000 0.000 0.000 0.000
#> ERR863684 2 0.2973 0.826 0.144 0.856 0.000 0.000
#> ERR863702 4 0.0000 0.995 0.000 0.000 0.000 1.000
#> ERR863687 3 0.0000 0.982 0.000 0.000 1.000 0.000
#> ERR863706 3 0.0000 0.982 0.000 0.000 1.000 0.000
#> ERR863708 2 0.0000 0.990 0.000 1.000 0.000 0.000
#> ERR863710 1 0.0000 0.987 1.000 0.000 0.000 0.000
#> ERR863709 2 0.0000 0.990 0.000 1.000 0.000 0.000
#> ERR863753 2 0.0000 0.990 0.000 1.000 0.000 0.000
#> ERR863754 1 0.0000 0.987 1.000 0.000 0.000 0.000
#> ERR863749 1 0.0000 0.987 1.000 0.000 0.000 0.000
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> ERR863675 2 0.4086 0.7228 0.012 0.704 0.000 0.284 0.000
#> ERR863705 3 0.0000 0.9454 0.000 0.000 1.000 0.000 0.000
#> ERR863704 2 0.0798 0.8201 0.000 0.976 0.000 0.016 0.008
#> ERR863679 3 0.0000 0.9454 0.000 0.000 1.000 0.000 0.000
#> ERR863680 2 0.0671 0.8205 0.000 0.980 0.000 0.016 0.004
#> ERR863676 2 0.1792 0.8113 0.000 0.916 0.000 0.084 0.000
#> ERR863677 2 0.3909 0.7416 0.024 0.760 0.000 0.216 0.000
#> ERR863688 5 0.0290 0.9529 0.000 0.000 0.000 0.008 0.992
#> ERR863690 1 0.2424 0.4444 0.868 0.000 0.000 0.132 0.000
#> ERR863692 1 0.6032 0.1048 0.492 0.000 0.000 0.120 0.388
#> ERR863703 1 0.1341 0.4759 0.944 0.000 0.000 0.056 0.000
#> ERR863712 2 0.3789 0.7481 0.016 0.760 0.000 0.224 0.000
#> ERR863711 1 0.3837 -0.0660 0.692 0.000 0.000 0.308 0.000
#> ERR863760 2 0.0912 0.8194 0.000 0.972 0.000 0.016 0.012
#> ERR863727 5 0.3143 0.7705 0.000 0.000 0.000 0.204 0.796
#> ERR863766 3 0.2424 0.9165 0.000 0.000 0.868 0.132 0.000
#> ERR863767 1 0.3949 -0.1163 0.668 0.000 0.000 0.332 0.000
#> ERR863752 2 0.1544 0.7991 0.000 0.932 0.000 0.068 0.000
#> ERR863757 5 0.0290 0.9529 0.000 0.000 0.000 0.008 0.992
#> ERR863758 1 0.0963 0.4578 0.964 0.000 0.000 0.036 0.000
#> ERR863755 5 0.0290 0.9529 0.000 0.000 0.000 0.008 0.992
#> ERR863756 3 0.3074 0.8753 0.000 0.000 0.804 0.196 0.000
#> ERR863707 3 0.2377 0.9166 0.000 0.000 0.872 0.128 0.000
#> ERR863681 3 0.0000 0.9454 0.000 0.000 1.000 0.000 0.000
#> ERR863719 5 0.0000 0.9539 0.000 0.000 0.000 0.000 1.000
#> ERR863759 2 0.6519 -0.0443 0.000 0.436 0.368 0.196 0.000
#> ERR863718 1 0.1341 0.4533 0.944 0.000 0.000 0.056 0.000
#> ERR863717 1 0.3752 0.0794 0.708 0.000 0.000 0.292 0.000
#> ERR863715 5 0.0000 0.9539 0.000 0.000 0.000 0.000 1.000
#> ERR863716 5 0.0290 0.9529 0.000 0.000 0.000 0.008 0.992
#> ERR863722 4 0.5383 0.1928 0.356 0.020 0.032 0.592 0.000
#> ERR863721 2 0.6629 0.2600 0.332 0.436 0.000 0.232 0.000
#> ERR863720 2 0.0963 0.8226 0.000 0.964 0.000 0.036 0.000
#> ERR863723 5 0.0404 0.9514 0.000 0.000 0.000 0.012 0.988
#> ERR863761 3 0.1121 0.9390 0.000 0.000 0.956 0.044 0.000
#> ERR863735 1 0.3684 0.1009 0.720 0.000 0.000 0.280 0.000
#> ERR863734 3 0.2424 0.9165 0.000 0.000 0.868 0.132 0.000
#> ERR863736 5 0.0000 0.9539 0.000 0.000 0.000 0.000 1.000
#> ERR863729 5 0.0000 0.9539 0.000 0.000 0.000 0.000 1.000
#> ERR863728 1 0.4798 -0.1892 0.540 0.020 0.000 0.440 0.000
#> ERR863731 1 0.0162 0.4776 0.996 0.000 0.000 0.004 0.000
#> ERR863764 2 0.0609 0.8220 0.000 0.980 0.000 0.020 0.000
#> ERR863740 4 0.6124 0.3464 0.412 0.000 0.000 0.460 0.128
#> ERR863765 3 0.0290 0.9426 0.000 0.000 0.992 0.008 0.000
#> ERR863762 3 0.0000 0.9454 0.000 0.000 1.000 0.000 0.000
#> ERR863724 3 0.0000 0.9454 0.000 0.000 1.000 0.000 0.000
#> ERR863733 2 0.1544 0.7991 0.000 0.932 0.000 0.068 0.000
#> ERR863732 3 0.0000 0.9454 0.000 0.000 1.000 0.000 0.000
#> ERR863730 4 0.4273 0.5014 0.448 0.000 0.000 0.552 0.000
#> ERR863742 4 0.4249 0.5004 0.432 0.000 0.000 0.568 0.000
#> ERR863763 2 0.4073 0.7359 0.032 0.752 0.000 0.216 0.000
#> ERR863741 5 0.0000 0.9539 0.000 0.000 0.000 0.000 1.000
#> ERR863743 1 0.0162 0.4797 0.996 0.000 0.000 0.004 0.000
#> ERR863745 2 0.0000 0.8217 0.000 1.000 0.000 0.000 0.000
#> ERR863744 5 0.6133 0.3101 0.164 0.000 0.000 0.292 0.544
#> ERR863746 4 0.4291 0.4890 0.464 0.000 0.000 0.536 0.000
#> ERR863748 3 0.3231 0.8721 0.000 0.004 0.800 0.196 0.000
#> ERR863747 2 0.6537 -0.1423 0.000 0.404 0.400 0.196 0.000
#> ERR863694 5 0.0000 0.9539 0.000 0.000 0.000 0.000 1.000
#> ERR863693 4 0.5454 0.0591 0.452 0.060 0.000 0.488 0.000
#> ERR863686 5 0.0000 0.9539 0.000 0.000 0.000 0.000 1.000
#> ERR863678 1 0.3876 -0.0446 0.684 0.000 0.000 0.316 0.000
#> ERR863685 3 0.2424 0.9165 0.000 0.000 0.868 0.132 0.000
#> ERR863689 4 0.5049 0.0452 0.480 0.032 0.000 0.488 0.000
#> ERR863691 1 0.2971 0.4323 0.836 0.008 0.000 0.156 0.000
#> ERR863682 5 0.0404 0.9514 0.000 0.000 0.000 0.012 0.988
#> ERR863695 2 0.1851 0.8103 0.000 0.912 0.000 0.088 0.000
#> ERR863683 4 0.4278 0.5009 0.452 0.000 0.000 0.548 0.000
#> ERR863684 1 0.6102 0.1550 0.568 0.200 0.000 0.232 0.000
#> ERR863702 5 0.0000 0.9539 0.000 0.000 0.000 0.000 1.000
#> ERR863687 3 0.0000 0.9454 0.000 0.000 1.000 0.000 0.000
#> ERR863706 3 0.0290 0.9426 0.000 0.000 0.992 0.008 0.000
#> ERR863708 2 0.0162 0.8222 0.000 0.996 0.000 0.004 0.000
#> ERR863710 1 0.2127 0.4004 0.892 0.000 0.000 0.108 0.000
#> ERR863709 2 0.4000 0.7420 0.024 0.748 0.000 0.228 0.000
#> ERR863753 2 0.0162 0.8214 0.000 0.996 0.000 0.004 0.000
#> ERR863754 1 0.2732 0.4323 0.840 0.000 0.000 0.160 0.000
#> ERR863749 1 0.3983 -0.1367 0.660 0.000 0.000 0.340 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> ERR863675 2 0.5443 0.6062 0.048 0.560 0.000 0.044 0.000 0.348
#> ERR863705 3 0.0000 0.8298 0.000 0.000 1.000 0.000 0.000 0.000
#> ERR863704 2 0.1148 0.8246 0.004 0.960 0.000 0.000 0.020 0.016
#> ERR863679 3 0.0000 0.8298 0.000 0.000 1.000 0.000 0.000 0.000
#> ERR863680 2 0.0603 0.8294 0.004 0.980 0.000 0.000 0.000 0.016
#> ERR863676 2 0.1714 0.8277 0.000 0.908 0.000 0.000 0.000 0.092
#> ERR863677 2 0.4709 0.7261 0.024 0.704 0.000 0.068 0.000 0.204
#> ERR863688 5 0.1225 0.9403 0.012 0.000 0.000 0.000 0.952 0.036
#> ERR863690 4 0.0547 0.6345 0.020 0.000 0.000 0.980 0.000 0.000
#> ERR863692 4 0.3692 0.4669 0.040 0.004 0.000 0.800 0.144 0.012
#> ERR863703 4 0.1265 0.6322 0.044 0.000 0.000 0.948 0.000 0.008
#> ERR863712 2 0.3874 0.7775 0.008 0.776 0.000 0.060 0.000 0.156
#> ERR863711 1 0.4850 0.1320 0.496 0.000 0.000 0.448 0.000 0.056
#> ERR863760 2 0.1636 0.8144 0.004 0.936 0.000 0.000 0.036 0.024
#> ERR863727 5 0.5567 0.4076 0.320 0.000 0.000 0.016 0.556 0.108
#> ERR863766 3 0.4092 0.4582 0.020 0.000 0.636 0.000 0.000 0.344
#> ERR863767 1 0.4822 0.3154 0.596 0.000 0.000 0.332 0.000 0.072
#> ERR863752 2 0.3448 0.5827 0.004 0.716 0.000 0.000 0.000 0.280
#> ERR863757 5 0.1320 0.9394 0.016 0.000 0.000 0.000 0.948 0.036
#> ERR863758 4 0.2907 0.5501 0.152 0.000 0.000 0.828 0.000 0.020
#> ERR863755 5 0.1552 0.9371 0.020 0.000 0.000 0.004 0.940 0.036
#> ERR863756 6 0.3684 0.3716 0.000 0.000 0.372 0.000 0.000 0.628
#> ERR863707 3 0.3592 0.4778 0.000 0.000 0.656 0.000 0.000 0.344
#> ERR863681 3 0.0000 0.8298 0.000 0.000 1.000 0.000 0.000 0.000
#> ERR863719 5 0.0000 0.9466 0.000 0.000 0.000 0.000 1.000 0.000
#> ERR863759 6 0.5025 0.5725 0.000 0.232 0.136 0.000 0.000 0.632
#> ERR863718 4 0.2006 0.5904 0.104 0.000 0.000 0.892 0.000 0.004
#> ERR863717 1 0.4941 0.2616 0.552 0.000 0.000 0.376 0.000 0.072
#> ERR863715 5 0.0000 0.9466 0.000 0.000 0.000 0.000 1.000 0.000
#> ERR863716 5 0.1492 0.9369 0.024 0.000 0.000 0.000 0.940 0.036
#> ERR863722 6 0.5709 -0.1589 0.340 0.004 0.012 0.112 0.000 0.532
#> ERR863721 4 0.5809 -0.1949 0.008 0.420 0.000 0.432 0.000 0.140
#> ERR863720 2 0.0937 0.8348 0.000 0.960 0.000 0.000 0.000 0.040
#> ERR863723 5 0.1572 0.9353 0.028 0.000 0.000 0.000 0.936 0.036
#> ERR863761 3 0.2300 0.7264 0.000 0.000 0.856 0.000 0.000 0.144
#> ERR863735 1 0.4996 0.2265 0.520 0.000 0.000 0.408 0.000 0.072
#> ERR863734 3 0.4092 0.4582 0.020 0.000 0.636 0.000 0.000 0.344
#> ERR863736 5 0.0000 0.9466 0.000 0.000 0.000 0.000 1.000 0.000
#> ERR863729 5 0.0000 0.9466 0.000 0.000 0.000 0.000 1.000 0.000
#> ERR863728 1 0.6276 0.0318 0.400 0.012 0.000 0.360 0.000 0.228
#> ERR863731 4 0.2170 0.6038 0.100 0.000 0.000 0.888 0.000 0.012
#> ERR863764 2 0.1714 0.8008 0.000 0.908 0.000 0.000 0.000 0.092
#> ERR863740 1 0.4290 0.4918 0.776 0.000 0.000 0.052 0.068 0.104
#> ERR863765 3 0.0146 0.8276 0.004 0.000 0.996 0.000 0.000 0.000
#> ERR863762 3 0.0000 0.8298 0.000 0.000 1.000 0.000 0.000 0.000
#> ERR863724 3 0.0000 0.8298 0.000 0.000 1.000 0.000 0.000 0.000
#> ERR863733 2 0.3448 0.5796 0.004 0.716 0.000 0.000 0.000 0.280
#> ERR863732 3 0.0000 0.8298 0.000 0.000 1.000 0.000 0.000 0.000
#> ERR863730 1 0.1643 0.5821 0.924 0.000 0.000 0.068 0.000 0.008
#> ERR863742 1 0.1713 0.5762 0.928 0.000 0.000 0.044 0.000 0.028
#> ERR863763 2 0.4737 0.7191 0.024 0.696 0.000 0.064 0.000 0.216
#> ERR863741 5 0.0000 0.9466 0.000 0.000 0.000 0.000 1.000 0.000
#> ERR863743 4 0.1444 0.6204 0.072 0.000 0.000 0.928 0.000 0.000
#> ERR863745 2 0.0146 0.8304 0.004 0.996 0.000 0.000 0.000 0.000
#> ERR863744 1 0.5940 0.2742 0.584 0.000 0.004 0.044 0.260 0.108
#> ERR863746 1 0.2118 0.5736 0.888 0.000 0.000 0.104 0.000 0.008
#> ERR863748 6 0.3684 0.3716 0.000 0.000 0.372 0.000 0.000 0.628
#> ERR863747 6 0.5064 0.5766 0.000 0.216 0.152 0.000 0.000 0.632
#> ERR863694 5 0.0291 0.9428 0.000 0.000 0.000 0.004 0.992 0.004
#> ERR863693 4 0.6870 -0.0627 0.340 0.052 0.000 0.368 0.000 0.240
#> ERR863686 5 0.0000 0.9466 0.000 0.000 0.000 0.000 1.000 0.000
#> ERR863678 4 0.5326 -0.1499 0.432 0.000 0.000 0.464 0.000 0.104
#> ERR863685 3 0.4092 0.4582 0.020 0.000 0.636 0.000 0.000 0.344
#> ERR863689 4 0.6656 -0.0507 0.340 0.036 0.000 0.392 0.000 0.232
#> ERR863691 4 0.0291 0.6313 0.000 0.004 0.000 0.992 0.000 0.004
#> ERR863682 5 0.1829 0.9306 0.028 0.000 0.000 0.008 0.928 0.036
#> ERR863695 2 0.3104 0.7913 0.016 0.800 0.000 0.000 0.000 0.184
#> ERR863683 1 0.1701 0.5820 0.920 0.000 0.000 0.072 0.000 0.008
#> ERR863684 4 0.3330 0.5313 0.008 0.108 0.000 0.828 0.000 0.056
#> ERR863702 5 0.0000 0.9466 0.000 0.000 0.000 0.000 1.000 0.000
#> ERR863687 3 0.0000 0.8298 0.000 0.000 1.000 0.000 0.000 0.000
#> ERR863706 3 0.0146 0.8276 0.004 0.000 0.996 0.000 0.000 0.000
#> ERR863708 2 0.0363 0.8340 0.000 0.988 0.000 0.000 0.000 0.012
#> ERR863710 4 0.3734 0.3548 0.264 0.000 0.000 0.716 0.000 0.020
#> ERR863709 2 0.3328 0.7979 0.000 0.816 0.000 0.064 0.000 0.120
#> ERR863753 2 0.0405 0.8316 0.004 0.988 0.000 0.000 0.000 0.008
#> ERR863754 4 0.0260 0.6314 0.000 0.000 0.000 0.992 0.000 0.008
#> ERR863749 1 0.5009 0.2325 0.536 0.000 0.000 0.388 0.000 0.076
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)
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 17118 rows and 78 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 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.490 0.818 0.874 0.4576 0.550 0.550
#> 3 3 0.539 0.621 0.791 0.3198 0.478 0.306
#> 4 4 0.645 0.778 0.879 0.1704 0.726 0.446
#> 5 5 0.708 0.692 0.792 0.0735 0.817 0.475
#> 6 6 0.748 0.761 0.869 0.0387 0.947 0.782
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
#> ERR863675 2 0.0000 0.906 0.000 1.000
#> ERR863705 1 0.0938 0.800 0.988 0.012
#> ERR863704 2 0.0376 0.905 0.004 0.996
#> ERR863679 1 0.8207 0.437 0.744 0.256
#> ERR863680 2 0.0000 0.906 0.000 1.000
#> ERR863676 2 0.0000 0.906 0.000 1.000
#> ERR863677 2 0.0376 0.903 0.004 0.996
#> ERR863688 1 0.0000 0.805 1.000 0.000
#> ERR863690 1 0.8016 0.852 0.756 0.244
#> ERR863692 1 0.7950 0.855 0.760 0.240
#> ERR863703 1 0.7950 0.855 0.760 0.240
#> ERR863712 2 0.0000 0.906 0.000 1.000
#> ERR863711 1 0.8016 0.852 0.756 0.244
#> ERR863760 2 0.1414 0.896 0.020 0.980
#> ERR863727 1 0.0000 0.805 1.000 0.000
#> ERR863766 1 0.0938 0.800 0.988 0.012
#> ERR863767 1 0.8081 0.850 0.752 0.248
#> ERR863752 2 0.0000 0.906 0.000 1.000
#> ERR863757 1 0.0000 0.805 1.000 0.000
#> ERR863758 1 0.7950 0.855 0.760 0.240
#> ERR863755 1 0.7674 0.856 0.776 0.224
#> ERR863756 2 0.8016 0.743 0.244 0.756
#> ERR863707 2 0.8016 0.743 0.244 0.756
#> ERR863681 1 0.0000 0.805 1.000 0.000
#> ERR863719 1 0.0000 0.805 1.000 0.000
#> ERR863759 2 0.7602 0.761 0.220 0.780
#> ERR863718 1 0.7950 0.855 0.760 0.240
#> ERR863717 1 0.7950 0.855 0.760 0.240
#> ERR863715 1 0.0000 0.805 1.000 0.000
#> ERR863716 1 0.7950 0.855 0.760 0.240
#> ERR863722 1 0.8081 0.850 0.752 0.248
#> ERR863721 1 0.8016 0.852 0.756 0.244
#> ERR863720 2 0.0000 0.906 0.000 1.000
#> ERR863723 1 0.6712 0.853 0.824 0.176
#> ERR863761 1 0.0000 0.805 1.000 0.000
#> ERR863735 1 0.7815 0.856 0.768 0.232
#> ERR863734 1 0.0938 0.800 0.988 0.012
#> ERR863736 1 0.6343 0.850 0.840 0.160
#> ERR863729 1 0.0000 0.805 1.000 0.000
#> ERR863728 2 0.9358 0.142 0.352 0.648
#> ERR863731 1 0.8016 0.852 0.756 0.244
#> ERR863764 2 0.0000 0.906 0.000 1.000
#> ERR863740 1 0.7139 0.856 0.804 0.196
#> ERR863765 1 0.0000 0.805 1.000 0.000
#> ERR863762 1 0.0672 0.802 0.992 0.008
#> ERR863724 1 0.0000 0.805 1.000 0.000
#> ERR863733 2 0.4161 0.855 0.084 0.916
#> ERR863732 1 0.0000 0.805 1.000 0.000
#> ERR863730 1 0.7950 0.855 0.760 0.240
#> ERR863742 1 0.7056 0.855 0.808 0.192
#> ERR863763 2 0.0000 0.906 0.000 1.000
#> ERR863741 1 0.4562 0.835 0.904 0.096
#> ERR863743 1 0.7950 0.855 0.760 0.240
#> ERR863745 2 0.0000 0.906 0.000 1.000
#> ERR863744 1 0.2236 0.817 0.964 0.036
#> ERR863746 1 0.7950 0.855 0.760 0.240
#> ERR863748 2 0.6801 0.790 0.180 0.820
#> ERR863747 2 0.8016 0.743 0.244 0.756
#> ERR863694 1 0.7602 0.857 0.780 0.220
#> ERR863693 2 0.0000 0.906 0.000 1.000
#> ERR863686 1 0.6343 0.850 0.840 0.160
#> ERR863678 1 0.8144 0.848 0.748 0.252
#> ERR863685 2 0.8016 0.743 0.244 0.756
#> ERR863689 2 0.0000 0.906 0.000 1.000
#> ERR863691 1 0.8016 0.852 0.756 0.244
#> ERR863682 1 0.7602 0.857 0.780 0.220
#> ERR863695 2 0.0000 0.906 0.000 1.000
#> ERR863683 1 0.7950 0.855 0.760 0.240
#> ERR863684 1 0.8016 0.852 0.756 0.244
#> ERR863702 1 0.0376 0.807 0.996 0.004
#> ERR863687 1 0.9954 -0.237 0.540 0.460
#> ERR863706 1 0.0000 0.805 1.000 0.000
#> ERR863708 2 0.0000 0.906 0.000 1.000
#> ERR863710 1 0.7950 0.855 0.760 0.240
#> ERR863709 2 0.0000 0.906 0.000 1.000
#> ERR863753 2 0.0000 0.906 0.000 1.000
#> ERR863754 1 0.7950 0.855 0.760 0.240
#> ERR863749 1 0.7950 0.855 0.760 0.240
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> ERR863675 1 0.5926 0.6516 0.644 0.000 0.356
#> ERR863705 3 0.7337 0.7328 0.056 0.300 0.644
#> ERR863704 2 0.9364 0.2917 0.176 0.468 0.356
#> ERR863679 3 0.7246 0.7316 0.052 0.300 0.648
#> ERR863680 1 0.8798 0.5309 0.520 0.124 0.356
#> ERR863676 1 0.5926 0.6516 0.644 0.000 0.356
#> ERR863677 1 0.6507 0.6783 0.688 0.028 0.284
#> ERR863688 2 0.1529 0.7294 0.040 0.960 0.000
#> ERR863690 1 0.0237 0.7698 0.996 0.000 0.004
#> ERR863692 1 0.1860 0.7430 0.948 0.052 0.000
#> ERR863703 1 0.0237 0.7693 0.996 0.004 0.000
#> ERR863712 1 0.5926 0.6516 0.644 0.000 0.356
#> ERR863711 1 0.0000 0.7698 1.000 0.000 0.000
#> ERR863760 2 0.9318 0.3105 0.172 0.476 0.352
#> ERR863727 3 0.7607 0.3502 0.364 0.052 0.584
#> ERR863766 3 0.7798 0.7165 0.080 0.296 0.624
#> ERR863767 1 0.0000 0.7698 1.000 0.000 0.000
#> ERR863752 1 0.5948 0.6483 0.640 0.000 0.360
#> ERR863757 2 0.2537 0.7023 0.080 0.920 0.000
#> ERR863758 1 0.0237 0.7693 0.996 0.004 0.000
#> ERR863755 1 0.5325 0.4944 0.748 0.248 0.004
#> ERR863756 3 0.0237 0.4566 0.000 0.004 0.996
#> ERR863707 3 0.5560 0.6823 0.000 0.300 0.700
#> ERR863681 3 0.7337 0.7328 0.056 0.300 0.644
#> ERR863719 2 0.7970 -0.0524 0.080 0.596 0.324
#> ERR863759 3 0.1289 0.4294 0.032 0.000 0.968
#> ERR863718 1 0.0747 0.7648 0.984 0.016 0.000
#> ERR863717 1 0.1753 0.7460 0.952 0.048 0.000
#> ERR863715 2 0.0892 0.7352 0.020 0.980 0.000
#> ERR863716 1 0.6111 0.1460 0.604 0.396 0.000
#> ERR863722 1 0.6161 0.4920 0.696 0.288 0.016
#> ERR863721 1 0.1267 0.7618 0.972 0.024 0.004
#> ERR863720 1 0.5926 0.6516 0.644 0.000 0.356
#> ERR863723 1 0.7736 -0.0361 0.548 0.052 0.400
#> ERR863761 3 0.7337 0.7328 0.056 0.300 0.644
#> ERR863735 1 0.0475 0.7683 0.992 0.004 0.004
#> ERR863734 3 0.7337 0.7328 0.056 0.300 0.644
#> ERR863736 2 0.5726 0.5269 0.216 0.760 0.024
#> ERR863729 2 0.0892 0.7352 0.020 0.980 0.000
#> ERR863728 1 0.6843 0.6727 0.740 0.116 0.144
#> ERR863731 1 0.0000 0.7698 1.000 0.000 0.000
#> ERR863764 1 0.5926 0.6516 0.644 0.000 0.356
#> ERR863740 1 0.3134 0.7253 0.916 0.052 0.032
#> ERR863765 3 0.7391 0.7268 0.056 0.308 0.636
#> ERR863762 3 0.7337 0.7328 0.056 0.300 0.644
#> ERR863724 3 0.7337 0.7328 0.056 0.300 0.644
#> ERR863733 3 0.5467 0.2681 0.176 0.032 0.792
#> ERR863732 3 0.7337 0.7328 0.056 0.300 0.644
#> ERR863730 1 0.1753 0.7460 0.952 0.048 0.000
#> ERR863742 1 0.1399 0.7555 0.968 0.004 0.028
#> ERR863763 1 0.5926 0.6516 0.644 0.000 0.356
#> ERR863741 2 0.0892 0.7352 0.020 0.980 0.000
#> ERR863743 1 0.0237 0.7693 0.996 0.004 0.000
#> ERR863745 1 0.5926 0.6516 0.644 0.000 0.356
#> ERR863744 3 0.8722 0.4603 0.272 0.152 0.576
#> ERR863746 1 0.0237 0.7693 0.996 0.004 0.000
#> ERR863748 3 0.6451 -0.2848 0.384 0.008 0.608
#> ERR863747 3 0.1711 0.4280 0.008 0.032 0.960
#> ERR863694 1 0.8408 0.3419 0.616 0.232 0.152
#> ERR863693 1 0.5926 0.6516 0.644 0.000 0.356
#> ERR863686 2 0.0892 0.7352 0.020 0.980 0.000
#> ERR863678 1 0.0475 0.7698 0.992 0.004 0.004
#> ERR863685 3 0.5785 0.6862 0.004 0.300 0.696
#> ERR863689 1 0.4235 0.7250 0.824 0.000 0.176
#> ERR863691 1 0.0237 0.7693 0.996 0.004 0.000
#> ERR863682 1 0.6476 -0.0354 0.548 0.448 0.004
#> ERR863695 1 0.5926 0.6516 0.644 0.000 0.356
#> ERR863683 1 0.0237 0.7693 0.996 0.004 0.000
#> ERR863684 1 0.0237 0.7698 0.996 0.000 0.004
#> ERR863702 2 0.0892 0.7352 0.020 0.980 0.000
#> ERR863687 3 0.7246 0.7316 0.052 0.300 0.648
#> ERR863706 3 0.7553 0.7070 0.060 0.320 0.620
#> ERR863708 1 0.5926 0.6516 0.644 0.000 0.356
#> ERR863710 1 0.0237 0.7693 0.996 0.004 0.000
#> ERR863709 1 0.5650 0.6724 0.688 0.000 0.312
#> ERR863753 1 0.5926 0.6516 0.644 0.000 0.356
#> ERR863754 1 0.0424 0.7681 0.992 0.008 0.000
#> ERR863749 1 0.0237 0.7693 0.996 0.004 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> ERR863675 2 0.3569 0.851 0.196 0.804 0.000 0.000
#> ERR863705 3 0.0000 0.922 0.000 0.000 1.000 0.000
#> ERR863704 2 0.0000 0.680 0.000 1.000 0.000 0.000
#> ERR863679 3 0.0000 0.922 0.000 0.000 1.000 0.000
#> ERR863680 2 0.0000 0.680 0.000 1.000 0.000 0.000
#> ERR863676 2 0.3486 0.852 0.188 0.812 0.000 0.000
#> ERR863677 2 0.4730 0.708 0.364 0.636 0.000 0.000
#> ERR863688 4 0.0000 0.867 0.000 0.000 0.000 1.000
#> ERR863690 1 0.0469 0.852 0.988 0.012 0.000 0.000
#> ERR863692 1 0.3528 0.776 0.808 0.192 0.000 0.000
#> ERR863703 1 0.0188 0.856 0.996 0.004 0.000 0.000
#> ERR863712 2 0.4134 0.819 0.260 0.740 0.000 0.000
#> ERR863711 1 0.0000 0.856 1.000 0.000 0.000 0.000
#> ERR863760 4 0.4994 0.441 0.000 0.480 0.000 0.520
#> ERR863727 1 0.5940 0.664 0.692 0.188 0.120 0.000
#> ERR863766 3 0.0000 0.922 0.000 0.000 1.000 0.000
#> ERR863767 1 0.0336 0.852 0.992 0.008 0.000 0.000
#> ERR863752 2 0.3528 0.852 0.192 0.808 0.000 0.000
#> ERR863757 4 0.0000 0.867 0.000 0.000 0.000 1.000
#> ERR863758 1 0.0000 0.856 1.000 0.000 0.000 0.000
#> ERR863755 1 0.3528 0.776 0.808 0.192 0.000 0.000
#> ERR863756 2 0.3942 0.629 0.000 0.764 0.236 0.000
#> ERR863707 3 0.0000 0.922 0.000 0.000 1.000 0.000
#> ERR863681 3 0.0000 0.922 0.000 0.000 1.000 0.000
#> ERR863719 3 0.7484 0.222 0.008 0.200 0.544 0.248
#> ERR863759 2 0.4274 0.830 0.148 0.808 0.044 0.000
#> ERR863718 1 0.0817 0.854 0.976 0.024 0.000 0.000
#> ERR863717 1 0.3528 0.776 0.808 0.192 0.000 0.000
#> ERR863715 4 0.0000 0.867 0.000 0.000 0.000 1.000
#> ERR863716 1 0.3710 0.774 0.804 0.192 0.000 0.004
#> ERR863722 3 0.6200 0.105 0.444 0.052 0.504 0.000
#> ERR863721 1 0.0921 0.840 0.972 0.028 0.000 0.000
#> ERR863720 2 0.3486 0.852 0.188 0.812 0.000 0.000
#> ERR863723 1 0.3710 0.774 0.804 0.192 0.004 0.000
#> ERR863761 3 0.0000 0.922 0.000 0.000 1.000 0.000
#> ERR863735 1 0.0000 0.856 1.000 0.000 0.000 0.000
#> ERR863734 3 0.0000 0.922 0.000 0.000 1.000 0.000
#> ERR863736 4 0.7562 0.463 0.008 0.208 0.252 0.532
#> ERR863729 4 0.0000 0.867 0.000 0.000 0.000 1.000
#> ERR863728 2 0.7284 0.456 0.424 0.428 0.148 0.000
#> ERR863731 1 0.0469 0.852 0.988 0.012 0.000 0.000
#> ERR863764 2 0.3486 0.852 0.188 0.812 0.000 0.000
#> ERR863740 1 0.5874 0.672 0.696 0.192 0.112 0.000
#> ERR863765 3 0.0000 0.922 0.000 0.000 1.000 0.000
#> ERR863762 3 0.0000 0.922 0.000 0.000 1.000 0.000
#> ERR863724 3 0.0000 0.922 0.000 0.000 1.000 0.000
#> ERR863733 2 0.4292 0.760 0.080 0.820 0.100 0.000
#> ERR863732 3 0.0000 0.922 0.000 0.000 1.000 0.000
#> ERR863730 1 0.3444 0.782 0.816 0.184 0.000 0.000
#> ERR863742 1 0.0336 0.854 0.992 0.000 0.008 0.000
#> ERR863763 2 0.4500 0.778 0.316 0.684 0.000 0.000
#> ERR863741 4 0.0000 0.867 0.000 0.000 0.000 1.000
#> ERR863743 1 0.1211 0.849 0.960 0.040 0.000 0.000
#> ERR863745 2 0.3486 0.852 0.188 0.812 0.000 0.000
#> ERR863744 1 0.7546 0.089 0.408 0.188 0.404 0.000
#> ERR863746 1 0.0000 0.856 1.000 0.000 0.000 0.000
#> ERR863748 2 0.5220 0.743 0.092 0.752 0.156 0.000
#> ERR863747 2 0.1474 0.692 0.000 0.948 0.052 0.000
#> ERR863694 1 0.6977 0.549 0.584 0.212 0.204 0.000
#> ERR863693 2 0.4543 0.770 0.324 0.676 0.000 0.000
#> ERR863686 4 0.0000 0.867 0.000 0.000 0.000 1.000
#> ERR863678 1 0.0000 0.856 1.000 0.000 0.000 0.000
#> ERR863685 3 0.0000 0.922 0.000 0.000 1.000 0.000
#> ERR863689 1 0.4643 0.115 0.656 0.344 0.000 0.000
#> ERR863691 1 0.0188 0.856 0.996 0.004 0.000 0.000
#> ERR863682 1 0.3710 0.774 0.804 0.192 0.000 0.004
#> ERR863695 2 0.3528 0.852 0.192 0.808 0.000 0.000
#> ERR863683 1 0.0000 0.856 1.000 0.000 0.000 0.000
#> ERR863684 1 0.0921 0.840 0.972 0.028 0.000 0.000
#> ERR863702 4 0.3810 0.759 0.000 0.188 0.008 0.804
#> ERR863687 3 0.0000 0.922 0.000 0.000 1.000 0.000
#> ERR863706 3 0.0000 0.922 0.000 0.000 1.000 0.000
#> ERR863708 2 0.3486 0.852 0.188 0.812 0.000 0.000
#> ERR863710 1 0.0000 0.856 1.000 0.000 0.000 0.000
#> ERR863709 2 0.4888 0.630 0.412 0.588 0.000 0.000
#> ERR863753 2 0.3528 0.852 0.192 0.808 0.000 0.000
#> ERR863754 1 0.0188 0.856 0.996 0.004 0.000 0.000
#> ERR863749 1 0.0000 0.856 1.000 0.000 0.000 0.000
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> ERR863675 1 0.4283 0.160 0.544 0.456 0.000 0.000 0.000
#> ERR863705 3 0.0162 0.810 0.000 0.000 0.996 0.000 0.004
#> ERR863704 2 0.0955 0.856 0.004 0.968 0.000 0.028 0.000
#> ERR863679 3 0.0000 0.811 0.000 0.000 1.000 0.000 0.000
#> ERR863680 2 0.0162 0.872 0.004 0.996 0.000 0.000 0.000
#> ERR863676 2 0.0000 0.874 0.000 1.000 0.000 0.000 0.000
#> ERR863677 2 0.4624 0.621 0.164 0.740 0.000 0.096 0.000
#> ERR863688 4 0.4227 -0.600 0.000 0.000 0.000 0.580 0.420
#> ERR863690 1 0.0290 0.852 0.992 0.008 0.000 0.000 0.000
#> ERR863692 4 0.4150 0.672 0.388 0.000 0.000 0.612 0.000
#> ERR863703 1 0.0000 0.852 1.000 0.000 0.000 0.000 0.000
#> ERR863712 2 0.4192 0.222 0.404 0.596 0.000 0.000 0.000
#> ERR863711 1 0.0162 0.852 0.996 0.004 0.000 0.000 0.000
#> ERR863760 4 0.4096 0.120 0.004 0.232 0.000 0.744 0.020
#> ERR863727 4 0.4218 0.720 0.332 0.000 0.008 0.660 0.000
#> ERR863766 3 0.7078 0.440 0.248 0.000 0.424 0.016 0.312
#> ERR863767 1 0.0798 0.849 0.976 0.008 0.000 0.016 0.000
#> ERR863752 2 0.0000 0.874 0.000 1.000 0.000 0.000 0.000
#> ERR863757 4 0.4101 -0.511 0.000 0.000 0.000 0.628 0.372
#> ERR863758 1 0.0000 0.852 1.000 0.000 0.000 0.000 0.000
#> ERR863755 4 0.4045 0.707 0.356 0.000 0.000 0.644 0.000
#> ERR863756 2 0.4974 0.558 0.000 0.696 0.212 0.000 0.092
#> ERR863707 3 0.3857 0.735 0.000 0.000 0.688 0.000 0.312
#> ERR863681 3 0.0865 0.800 0.000 0.000 0.972 0.004 0.024
#> ERR863719 4 0.1996 0.381 0.008 0.004 0.040 0.932 0.016
#> ERR863759 2 0.0794 0.862 0.000 0.972 0.000 0.000 0.028
#> ERR863718 1 0.1608 0.782 0.928 0.000 0.000 0.072 0.000
#> ERR863717 4 0.4273 0.559 0.448 0.000 0.000 0.552 0.000
#> ERR863715 5 0.3966 1.000 0.000 0.000 0.000 0.336 0.664
#> ERR863716 4 0.3999 0.715 0.344 0.000 0.000 0.656 0.000
#> ERR863722 1 0.1918 0.820 0.928 0.036 0.036 0.000 0.000
#> ERR863721 1 0.3391 0.572 0.800 0.012 0.000 0.188 0.000
#> ERR863720 2 0.0000 0.874 0.000 1.000 0.000 0.000 0.000
#> ERR863723 4 0.3983 0.716 0.340 0.000 0.000 0.660 0.000
#> ERR863761 3 0.4232 0.730 0.000 0.000 0.676 0.012 0.312
#> ERR863735 1 0.0609 0.845 0.980 0.000 0.000 0.020 0.000
#> ERR863734 3 0.4329 0.729 0.000 0.000 0.672 0.016 0.312
#> ERR863736 4 0.2283 0.341 0.008 0.024 0.016 0.924 0.028
#> ERR863729 5 0.3966 1.000 0.000 0.000 0.000 0.336 0.664
#> ERR863728 1 0.2929 0.736 0.840 0.152 0.008 0.000 0.000
#> ERR863731 1 0.0290 0.852 0.992 0.008 0.000 0.000 0.000
#> ERR863764 2 0.2732 0.731 0.160 0.840 0.000 0.000 0.000
#> ERR863740 4 0.5328 0.690 0.256 0.000 0.008 0.660 0.076
#> ERR863765 3 0.0671 0.806 0.004 0.000 0.980 0.016 0.000
#> ERR863762 3 0.0000 0.811 0.000 0.000 1.000 0.000 0.000
#> ERR863724 3 0.0865 0.800 0.000 0.000 0.972 0.004 0.024
#> ERR863733 2 0.0290 0.871 0.000 0.992 0.008 0.000 0.000
#> ERR863732 3 0.0162 0.811 0.004 0.000 0.996 0.000 0.000
#> ERR863730 4 0.4558 0.718 0.324 0.000 0.000 0.652 0.024
#> ERR863742 1 0.4854 0.508 0.648 0.000 0.000 0.044 0.308
#> ERR863763 1 0.4015 0.460 0.652 0.348 0.000 0.000 0.000
#> ERR863741 5 0.3966 1.000 0.000 0.000 0.000 0.336 0.664
#> ERR863743 1 0.0880 0.830 0.968 0.000 0.000 0.032 0.000
#> ERR863745 2 0.0000 0.874 0.000 1.000 0.000 0.000 0.000
#> ERR863744 4 0.4522 0.721 0.316 0.000 0.024 0.660 0.000
#> ERR863746 1 0.0609 0.845 0.980 0.000 0.000 0.020 0.000
#> ERR863748 2 0.5497 0.335 0.052 0.560 0.380 0.000 0.008
#> ERR863747 2 0.0833 0.865 0.000 0.976 0.004 0.004 0.016
#> ERR863694 4 0.4467 0.712 0.344 0.000 0.016 0.640 0.000
#> ERR863693 1 0.3274 0.671 0.780 0.220 0.000 0.000 0.000
#> ERR863686 5 0.3966 1.000 0.000 0.000 0.000 0.336 0.664
#> ERR863678 1 0.0000 0.852 1.000 0.000 0.000 0.000 0.000
#> ERR863685 3 0.3857 0.735 0.000 0.000 0.688 0.000 0.312
#> ERR863689 1 0.1544 0.819 0.932 0.068 0.000 0.000 0.000
#> ERR863691 1 0.0162 0.852 0.996 0.004 0.000 0.000 0.000
#> ERR863682 4 0.3983 0.716 0.340 0.000 0.000 0.660 0.000
#> ERR863695 2 0.0000 0.874 0.000 1.000 0.000 0.000 0.000
#> ERR863683 1 0.0609 0.845 0.980 0.000 0.000 0.020 0.000
#> ERR863684 1 0.0290 0.852 0.992 0.008 0.000 0.000 0.000
#> ERR863702 4 0.1571 0.285 0.000 0.000 0.004 0.936 0.060
#> ERR863687 3 0.0162 0.811 0.004 0.000 0.996 0.000 0.000
#> ERR863706 3 0.6778 0.356 0.000 0.000 0.392 0.312 0.296
#> ERR863708 2 0.0000 0.874 0.000 1.000 0.000 0.000 0.000
#> ERR863710 1 0.0609 0.845 0.980 0.000 0.000 0.020 0.000
#> ERR863709 1 0.4302 0.127 0.520 0.480 0.000 0.000 0.000
#> ERR863753 2 0.0000 0.874 0.000 1.000 0.000 0.000 0.000
#> ERR863754 1 0.0000 0.852 1.000 0.000 0.000 0.000 0.000
#> ERR863749 1 0.0162 0.851 0.996 0.000 0.000 0.004 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> ERR863675 1 0.4067 0.1206 0.548 0.444 0.000 0.008 0.000 0.000
#> ERR863705 3 0.0000 0.9127 0.000 0.000 1.000 0.000 0.000 0.000
#> ERR863704 2 0.0405 0.8109 0.008 0.988 0.000 0.004 0.000 0.000
#> ERR863679 3 0.1152 0.9166 0.000 0.000 0.952 0.004 0.000 0.044
#> ERR863680 2 0.0260 0.8112 0.008 0.992 0.000 0.000 0.000 0.000
#> ERR863676 2 0.0260 0.8111 0.000 0.992 0.000 0.008 0.000 0.000
#> ERR863677 2 0.3918 0.6429 0.108 0.768 0.000 0.124 0.000 0.000
#> ERR863688 5 0.3351 0.6096 0.000 0.000 0.000 0.288 0.712 0.000
#> ERR863690 1 0.0000 0.8987 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR863692 4 0.3288 0.7734 0.276 0.000 0.000 0.724 0.000 0.000
#> ERR863703 1 0.0000 0.8987 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR863712 2 0.3874 0.3963 0.356 0.636 0.000 0.008 0.000 0.000
#> ERR863711 1 0.0146 0.8981 0.996 0.004 0.000 0.000 0.000 0.000
#> ERR863760 4 0.5664 0.3121 0.008 0.236 0.000 0.568 0.188 0.000
#> ERR863727 4 0.2664 0.8343 0.184 0.000 0.000 0.816 0.000 0.000
#> ERR863766 6 0.0458 0.9231 0.000 0.000 0.000 0.016 0.000 0.984
#> ERR863767 1 0.0603 0.8949 0.980 0.004 0.000 0.016 0.000 0.000
#> ERR863752 2 0.0000 0.8121 0.000 1.000 0.000 0.000 0.000 0.000
#> ERR863757 5 0.3647 0.4786 0.000 0.000 0.000 0.360 0.640 0.000
#> ERR863758 1 0.0000 0.8987 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR863755 4 0.2823 0.8309 0.204 0.000 0.000 0.796 0.000 0.000
#> ERR863756 2 0.3843 0.2473 0.000 0.548 0.000 0.000 0.000 0.452
#> ERR863707 6 0.0458 0.9270 0.000 0.000 0.016 0.000 0.000 0.984
#> ERR863681 3 0.3037 0.8333 0.000 0.000 0.808 0.176 0.000 0.016
#> ERR863719 4 0.3351 0.6234 0.000 0.000 0.040 0.800 0.160 0.000
#> ERR863759 2 0.2762 0.6812 0.000 0.804 0.000 0.000 0.000 0.196
#> ERR863718 1 0.1444 0.8381 0.928 0.000 0.000 0.072 0.000 0.000
#> ERR863717 4 0.3789 0.5352 0.416 0.000 0.000 0.584 0.000 0.000
#> ERR863715 5 0.0000 0.8340 0.000 0.000 0.000 0.000 1.000 0.000
#> ERR863716 4 0.2730 0.8345 0.192 0.000 0.000 0.808 0.000 0.000
#> ERR863722 1 0.1788 0.8628 0.928 0.004 0.040 0.028 0.000 0.000
#> ERR863721 1 0.3468 0.4441 0.712 0.004 0.000 0.284 0.000 0.000
#> ERR863720 2 0.0260 0.8111 0.000 0.992 0.000 0.008 0.000 0.000
#> ERR863723 4 0.2697 0.8341 0.188 0.000 0.000 0.812 0.000 0.000
#> ERR863761 6 0.0458 0.9270 0.000 0.000 0.016 0.000 0.000 0.984
#> ERR863735 1 0.1007 0.8796 0.956 0.000 0.000 0.044 0.000 0.000
#> ERR863734 6 0.0458 0.9231 0.000 0.000 0.000 0.016 0.000 0.984
#> ERR863736 4 0.3371 0.5969 0.000 0.016 0.004 0.780 0.200 0.000
#> ERR863729 5 0.0000 0.8340 0.000 0.000 0.000 0.000 1.000 0.000
#> ERR863728 1 0.2149 0.8150 0.888 0.104 0.004 0.004 0.000 0.000
#> ERR863731 1 0.0000 0.8987 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR863764 2 0.3052 0.6480 0.216 0.780 0.000 0.004 0.000 0.000
#> ERR863740 4 0.2848 0.8324 0.176 0.000 0.000 0.816 0.000 0.008
#> ERR863765 3 0.1807 0.9079 0.000 0.000 0.920 0.020 0.000 0.060
#> ERR863762 3 0.1196 0.9182 0.000 0.000 0.952 0.008 0.000 0.040
#> ERR863724 3 0.3037 0.8333 0.000 0.000 0.808 0.176 0.000 0.016
#> ERR863733 2 0.0436 0.8103 0.004 0.988 0.004 0.000 0.000 0.004
#> ERR863732 3 0.1657 0.9034 0.000 0.000 0.928 0.056 0.000 0.016
#> ERR863730 4 0.3168 0.8269 0.172 0.000 0.000 0.804 0.000 0.024
#> ERR863742 6 0.3301 0.6609 0.188 0.000 0.000 0.024 0.000 0.788
#> ERR863763 1 0.3984 0.2626 0.596 0.396 0.000 0.008 0.000 0.000
#> ERR863741 5 0.0000 0.8340 0.000 0.000 0.000 0.000 1.000 0.000
#> ERR863743 1 0.0790 0.8797 0.968 0.000 0.000 0.032 0.000 0.000
#> ERR863745 2 0.0146 0.8116 0.004 0.996 0.000 0.000 0.000 0.000
#> ERR863744 4 0.3102 0.8205 0.156 0.000 0.028 0.816 0.000 0.000
#> ERR863746 1 0.0713 0.8904 0.972 0.000 0.000 0.028 0.000 0.000
#> ERR863748 2 0.5333 0.0863 0.064 0.480 0.440 0.000 0.000 0.016
#> ERR863747 2 0.2912 0.6673 0.000 0.784 0.000 0.000 0.000 0.216
#> ERR863694 4 0.3081 0.8162 0.220 0.000 0.004 0.776 0.000 0.000
#> ERR863693 1 0.2778 0.7215 0.824 0.168 0.000 0.008 0.000 0.000
#> ERR863686 5 0.0000 0.8340 0.000 0.000 0.000 0.000 1.000 0.000
#> ERR863678 1 0.0000 0.8987 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR863685 6 0.0458 0.9270 0.000 0.000 0.016 0.000 0.000 0.984
#> ERR863689 1 0.1265 0.8731 0.948 0.044 0.000 0.008 0.000 0.000
#> ERR863691 1 0.0000 0.8987 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR863682 4 0.2883 0.8258 0.212 0.000 0.000 0.788 0.000 0.000
#> ERR863695 2 0.0000 0.8121 0.000 1.000 0.000 0.000 0.000 0.000
#> ERR863683 1 0.0547 0.8934 0.980 0.000 0.000 0.020 0.000 0.000
#> ERR863684 1 0.0260 0.8963 0.992 0.000 0.000 0.008 0.000 0.000
#> ERR863702 4 0.3337 0.5389 0.000 0.000 0.004 0.736 0.260 0.000
#> ERR863687 3 0.1693 0.9055 0.000 0.020 0.932 0.044 0.000 0.004
#> ERR863706 6 0.1719 0.8892 0.000 0.000 0.060 0.016 0.000 0.924
#> ERR863708 2 0.0000 0.8121 0.000 1.000 0.000 0.000 0.000 0.000
#> ERR863710 1 0.0632 0.8920 0.976 0.000 0.000 0.024 0.000 0.000
#> ERR863709 2 0.4089 0.0810 0.468 0.524 0.000 0.008 0.000 0.000
#> ERR863753 2 0.0000 0.8121 0.000 1.000 0.000 0.000 0.000 0.000
#> ERR863754 1 0.0000 0.8987 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR863749 1 0.0260 0.8973 0.992 0.000 0.000 0.008 0.000 0.000
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)
An example of the output of tb
is:
#> which_row fdr mean_1 mean_2 scaled_mean_1 scaled_mean_2 km
#> 1 38 0.042760348 8.373488 9.131774 -0.5533452 0.5164555 1
#> 2 40 0.018707592 7.106213 8.469186 -0.6173731 0.5762149 1
#> 3 55 0.019134737 10.221463 11.207825 -0.6159697 0.5749050 1
#> 4 59 0.006059896 5.921854 7.869574 -0.6899429 0.6439467 1
#> 5 60 0.018055526 8.928898 10.211722 -0.6204761 0.5791110 1
#> 6 98 0.009384629 15.714769 14.887706 0.6635654 -0.6193277 2
...
The columns in tb
are:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.km
: Row groups if k-means clustering is applied to rows.UMAP plot which shows how samples are separated.
dimension_reduction(res, k = 2, method = "UMAP")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
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 17118 rows and 78 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'ATC' method.
#> Subgroups are detected by 'mclust' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 4.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 1.000 0.988 0.994 0.4553 0.541 0.541
#> 3 3 0.983 0.924 0.959 -0.0510 0.488 0.369
#> 4 4 0.937 0.951 0.981 0.5854 0.721 0.519
#> 5 5 0.839 0.757 0.893 0.0605 0.947 0.834
#> 6 6 0.828 0.870 0.917 0.0696 0.912 0.700
suggest_best_k()
suggests the best \(k\) based on these statistics. The rules are as follows:
suggest_best_k(res)
#> [1] 4
#> attr(,"optional")
#> [1] 2 3
There is also optional best \(k\) = 2 3 that is worth to check.
Following shows the table of the partitions (You need to click the show/hide
code output link to see it). The membership matrix (columns with name p*
)
is inferred by
clue::cl_consensus()
function with the SE
method. Basically the value in the membership matrix
represents the probability to belong to a certain group. The finall class
label for an item is determined with the group with highest probability it
belongs to.
In get_classes()
function, the entropy is calculated from the membership
matrix and the silhouette score is calculated from the consensus matrix.
cbind(get_classes(res, k = 2), get_membership(res, k = 2))
#> class entropy silhouette p1 p2
#> ERR863675 2 0.0000 1.000 0.000 1.000
#> ERR863705 2 0.0000 1.000 0.000 1.000
#> ERR863704 2 0.0000 1.000 0.000 1.000
#> ERR863679 2 0.0000 1.000 0.000 1.000
#> ERR863680 2 0.0000 1.000 0.000 1.000
#> ERR863676 2 0.0000 1.000 0.000 1.000
#> ERR863677 2 0.0000 1.000 0.000 1.000
#> ERR863688 2 0.0000 1.000 0.000 1.000
#> ERR863690 1 0.0000 0.983 1.000 0.000
#> ERR863692 1 0.3274 0.930 0.940 0.060
#> ERR863703 1 0.0000 0.983 1.000 0.000
#> ERR863712 2 0.0000 1.000 0.000 1.000
#> ERR863711 1 0.0000 0.983 1.000 0.000
#> ERR863760 2 0.0000 1.000 0.000 1.000
#> ERR863727 1 0.0000 0.983 1.000 0.000
#> ERR863766 2 0.0000 1.000 0.000 1.000
#> ERR863767 1 0.0000 0.983 1.000 0.000
#> ERR863752 2 0.0000 1.000 0.000 1.000
#> ERR863757 2 0.0000 1.000 0.000 1.000
#> ERR863758 1 0.0000 0.983 1.000 0.000
#> ERR863755 1 0.0000 0.983 1.000 0.000
#> ERR863756 2 0.0000 1.000 0.000 1.000
#> ERR863707 2 0.0000 1.000 0.000 1.000
#> ERR863681 2 0.0000 1.000 0.000 1.000
#> ERR863719 2 0.0000 1.000 0.000 1.000
#> ERR863759 2 0.0000 1.000 0.000 1.000
#> ERR863718 1 0.0000 0.983 1.000 0.000
#> ERR863717 1 0.0000 0.983 1.000 0.000
#> ERR863715 2 0.0000 1.000 0.000 1.000
#> ERR863716 1 0.7056 0.773 0.808 0.192
#> ERR863722 2 0.0000 1.000 0.000 1.000
#> ERR863721 2 0.0000 1.000 0.000 1.000
#> ERR863720 2 0.0000 1.000 0.000 1.000
#> ERR863723 1 0.0000 0.983 1.000 0.000
#> ERR863761 2 0.0000 1.000 0.000 1.000
#> ERR863735 1 0.0000 0.983 1.000 0.000
#> ERR863734 2 0.0000 1.000 0.000 1.000
#> ERR863736 2 0.0000 1.000 0.000 1.000
#> ERR863729 2 0.0000 1.000 0.000 1.000
#> ERR863728 2 0.0000 1.000 0.000 1.000
#> ERR863731 1 0.0000 0.983 1.000 0.000
#> ERR863764 2 0.0000 1.000 0.000 1.000
#> ERR863740 1 0.0000 0.983 1.000 0.000
#> ERR863765 2 0.0000 1.000 0.000 1.000
#> ERR863762 2 0.0000 1.000 0.000 1.000
#> ERR863724 2 0.0000 1.000 0.000 1.000
#> ERR863733 2 0.0000 1.000 0.000 1.000
#> ERR863732 2 0.0000 1.000 0.000 1.000
#> ERR863730 1 0.0000 0.983 1.000 0.000
#> ERR863742 1 0.0000 0.983 1.000 0.000
#> ERR863763 2 0.0000 1.000 0.000 1.000
#> ERR863741 2 0.0000 1.000 0.000 1.000
#> ERR863743 1 0.0000 0.983 1.000 0.000
#> ERR863745 2 0.0000 1.000 0.000 1.000
#> ERR863744 1 0.0000 0.983 1.000 0.000
#> ERR863746 1 0.0000 0.983 1.000 0.000
#> ERR863748 2 0.0000 1.000 0.000 1.000
#> ERR863747 2 0.0000 1.000 0.000 1.000
#> ERR863694 2 0.0000 1.000 0.000 1.000
#> ERR863693 2 0.0000 1.000 0.000 1.000
#> ERR863686 2 0.0000 1.000 0.000 1.000
#> ERR863678 1 0.0376 0.980 0.996 0.004
#> ERR863685 2 0.0000 1.000 0.000 1.000
#> ERR863689 2 0.0000 1.000 0.000 1.000
#> ERR863691 1 0.6973 0.780 0.812 0.188
#> ERR863682 1 0.0000 0.983 1.000 0.000
#> ERR863695 2 0.0000 1.000 0.000 1.000
#> ERR863683 1 0.0000 0.983 1.000 0.000
#> ERR863684 2 0.0000 1.000 0.000 1.000
#> ERR863702 2 0.0000 1.000 0.000 1.000
#> ERR863687 2 0.0000 1.000 0.000 1.000
#> ERR863706 2 0.0000 1.000 0.000 1.000
#> ERR863708 2 0.0000 1.000 0.000 1.000
#> ERR863710 1 0.0000 0.983 1.000 0.000
#> ERR863709 2 0.0000 1.000 0.000 1.000
#> ERR863753 2 0.0000 1.000 0.000 1.000
#> ERR863754 1 0.0000 0.983 1.000 0.000
#> ERR863749 1 0.0000 0.983 1.000 0.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> ERR863675 1 0.1753 0.958 0.952 0.000 0.048
#> ERR863705 3 0.0000 0.861 0.000 0.000 1.000
#> ERR863704 1 0.1753 0.960 0.952 0.048 0.000
#> ERR863679 3 0.0000 0.861 0.000 0.000 1.000
#> ERR863680 1 0.1753 0.960 0.952 0.048 0.000
#> ERR863676 1 0.1753 0.960 0.952 0.048 0.000
#> ERR863677 1 0.1753 0.958 0.952 0.000 0.048
#> ERR863688 2 0.1753 1.000 0.000 0.952 0.048
#> ERR863690 1 0.0000 0.966 1.000 0.000 0.000
#> ERR863692 1 0.1753 0.958 0.952 0.000 0.048
#> ERR863703 1 0.0000 0.966 1.000 0.000 0.000
#> ERR863712 1 0.1753 0.958 0.952 0.000 0.048
#> ERR863711 1 0.0000 0.966 1.000 0.000 0.000
#> ERR863760 1 0.1753 0.960 0.952 0.048 0.000
#> ERR863727 1 0.0000 0.966 1.000 0.000 0.000
#> ERR863766 3 0.1529 0.822 0.040 0.000 0.960
#> ERR863767 1 0.0000 0.966 1.000 0.000 0.000
#> ERR863752 1 0.1753 0.960 0.952 0.048 0.000
#> ERR863757 2 0.1753 1.000 0.000 0.952 0.048
#> ERR863758 1 0.0000 0.966 1.000 0.000 0.000
#> ERR863755 1 0.0000 0.966 1.000 0.000 0.000
#> ERR863756 1 0.6045 0.380 0.620 0.000 0.380
#> ERR863707 3 0.0000 0.861 0.000 0.000 1.000
#> ERR863681 3 0.0000 0.861 0.000 0.000 1.000
#> ERR863719 1 0.1753 0.958 0.952 0.000 0.048
#> ERR863759 1 0.1753 0.960 0.952 0.048 0.000
#> ERR863718 1 0.0000 0.966 1.000 0.000 0.000
#> ERR863717 1 0.0000 0.966 1.000 0.000 0.000
#> ERR863715 2 0.1753 1.000 0.000 0.952 0.048
#> ERR863716 1 0.0747 0.965 0.984 0.000 0.016
#> ERR863722 1 0.1753 0.958 0.952 0.000 0.048
#> ERR863721 1 0.1753 0.958 0.952 0.000 0.048
#> ERR863720 1 0.1753 0.960 0.952 0.048 0.000
#> ERR863723 1 0.0000 0.966 1.000 0.000 0.000
#> ERR863761 3 0.0000 0.861 0.000 0.000 1.000
#> ERR863735 1 0.0000 0.966 1.000 0.000 0.000
#> ERR863734 3 0.0000 0.861 0.000 0.000 1.000
#> ERR863736 1 0.1753 0.958 0.952 0.000 0.048
#> ERR863729 2 0.1753 1.000 0.000 0.952 0.048
#> ERR863728 1 0.1753 0.958 0.952 0.000 0.048
#> ERR863731 1 0.0000 0.966 1.000 0.000 0.000
#> ERR863764 1 0.1753 0.960 0.952 0.048 0.000
#> ERR863740 1 0.0000 0.966 1.000 0.000 0.000
#> ERR863765 3 0.0000 0.861 0.000 0.000 1.000
#> ERR863762 3 0.0000 0.861 0.000 0.000 1.000
#> ERR863724 3 0.0000 0.861 0.000 0.000 1.000
#> ERR863733 1 0.1999 0.962 0.952 0.036 0.012
#> ERR863732 3 0.6204 0.268 0.424 0.000 0.576
#> ERR863730 1 0.0000 0.966 1.000 0.000 0.000
#> ERR863742 1 0.0000 0.966 1.000 0.000 0.000
#> ERR863763 1 0.1753 0.958 0.952 0.000 0.048
#> ERR863741 2 0.1753 1.000 0.000 0.952 0.048
#> ERR863743 1 0.0000 0.966 1.000 0.000 0.000
#> ERR863745 1 0.1753 0.960 0.952 0.048 0.000
#> ERR863744 1 0.0237 0.966 0.996 0.000 0.004
#> ERR863746 1 0.0000 0.966 1.000 0.000 0.000
#> ERR863748 1 0.3038 0.906 0.896 0.000 0.104
#> ERR863747 1 0.1753 0.960 0.952 0.048 0.000
#> ERR863694 1 0.1753 0.958 0.952 0.000 0.048
#> ERR863693 1 0.1753 0.958 0.952 0.000 0.048
#> ERR863686 2 0.1753 1.000 0.000 0.952 0.048
#> ERR863678 1 0.1643 0.960 0.956 0.000 0.044
#> ERR863685 3 0.0000 0.861 0.000 0.000 1.000
#> ERR863689 1 0.1753 0.958 0.952 0.000 0.048
#> ERR863691 1 0.1753 0.958 0.952 0.000 0.048
#> ERR863682 1 0.0000 0.966 1.000 0.000 0.000
#> ERR863695 1 0.1753 0.960 0.952 0.048 0.000
#> ERR863683 1 0.0000 0.966 1.000 0.000 0.000
#> ERR863684 1 0.1753 0.958 0.952 0.000 0.048
#> ERR863702 2 0.1753 1.000 0.000 0.952 0.048
#> ERR863687 3 0.6095 0.349 0.392 0.000 0.608
#> ERR863706 3 0.1860 0.806 0.052 0.000 0.948
#> ERR863708 1 0.1753 0.960 0.952 0.048 0.000
#> ERR863710 1 0.0000 0.966 1.000 0.000 0.000
#> ERR863709 1 0.1753 0.958 0.952 0.000 0.048
#> ERR863753 1 0.1753 0.960 0.952 0.048 0.000
#> ERR863754 1 0.0000 0.966 1.000 0.000 0.000
#> ERR863749 1 0.0000 0.966 1.000 0.000 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> ERR863675 2 0.3610 0.683 0.200 0.800 0.000 0.000
#> ERR863705 3 0.0000 0.965 0.000 0.000 1.000 0.000
#> ERR863704 2 0.0000 0.970 0.000 1.000 0.000 0.000
#> ERR863679 3 0.0000 0.965 0.000 0.000 1.000 0.000
#> ERR863680 2 0.0000 0.970 0.000 1.000 0.000 0.000
#> ERR863676 2 0.0000 0.970 0.000 1.000 0.000 0.000
#> ERR863677 2 0.0000 0.970 0.000 1.000 0.000 0.000
#> ERR863688 4 0.2704 0.847 0.124 0.000 0.000 0.876
#> ERR863690 1 0.0000 0.985 1.000 0.000 0.000 0.000
#> ERR863692 1 0.0000 0.985 1.000 0.000 0.000 0.000
#> ERR863703 1 0.0000 0.985 1.000 0.000 0.000 0.000
#> ERR863712 2 0.0000 0.970 0.000 1.000 0.000 0.000
#> ERR863711 1 0.0000 0.985 1.000 0.000 0.000 0.000
#> ERR863760 2 0.0000 0.970 0.000 1.000 0.000 0.000
#> ERR863727 1 0.0000 0.985 1.000 0.000 0.000 0.000
#> ERR863766 3 0.0000 0.965 0.000 0.000 1.000 0.000
#> ERR863767 1 0.0000 0.985 1.000 0.000 0.000 0.000
#> ERR863752 2 0.0000 0.970 0.000 1.000 0.000 0.000
#> ERR863757 4 0.2704 0.847 0.124 0.000 0.000 0.876
#> ERR863758 1 0.0000 0.985 1.000 0.000 0.000 0.000
#> ERR863755 1 0.0000 0.985 1.000 0.000 0.000 0.000
#> ERR863756 3 0.1867 0.887 0.000 0.072 0.928 0.000
#> ERR863707 3 0.0000 0.965 0.000 0.000 1.000 0.000
#> ERR863681 3 0.0000 0.965 0.000 0.000 1.000 0.000
#> ERR863719 1 0.0188 0.981 0.996 0.004 0.000 0.000
#> ERR863759 2 0.0000 0.970 0.000 1.000 0.000 0.000
#> ERR863718 1 0.0000 0.985 1.000 0.000 0.000 0.000
#> ERR863717 1 0.0000 0.985 1.000 0.000 0.000 0.000
#> ERR863715 4 0.0000 0.940 0.000 0.000 0.000 1.000
#> ERR863716 1 0.0000 0.985 1.000 0.000 0.000 0.000
#> ERR863722 1 0.0000 0.985 1.000 0.000 0.000 0.000
#> ERR863721 1 0.3444 0.748 0.816 0.184 0.000 0.000
#> ERR863720 2 0.0000 0.970 0.000 1.000 0.000 0.000
#> ERR863723 1 0.0000 0.985 1.000 0.000 0.000 0.000
#> ERR863761 3 0.0000 0.965 0.000 0.000 1.000 0.000
#> ERR863735 1 0.0000 0.985 1.000 0.000 0.000 0.000
#> ERR863734 3 0.0000 0.965 0.000 0.000 1.000 0.000
#> ERR863736 2 0.0707 0.954 0.000 0.980 0.000 0.020
#> ERR863729 4 0.0000 0.940 0.000 0.000 0.000 1.000
#> ERR863728 1 0.0000 0.985 1.000 0.000 0.000 0.000
#> ERR863731 1 0.0000 0.985 1.000 0.000 0.000 0.000
#> ERR863764 2 0.0000 0.970 0.000 1.000 0.000 0.000
#> ERR863740 1 0.0000 0.985 1.000 0.000 0.000 0.000
#> ERR863765 3 0.2408 0.839 0.104 0.000 0.896 0.000
#> ERR863762 3 0.0000 0.965 0.000 0.000 1.000 0.000
#> ERR863724 3 0.0000 0.965 0.000 0.000 1.000 0.000
#> ERR863733 2 0.0000 0.970 0.000 1.000 0.000 0.000
#> ERR863732 3 0.0000 0.965 0.000 0.000 1.000 0.000
#> ERR863730 1 0.0000 0.985 1.000 0.000 0.000 0.000
#> ERR863742 1 0.0000 0.985 1.000 0.000 0.000 0.000
#> ERR863763 2 0.0000 0.970 0.000 1.000 0.000 0.000
#> ERR863741 4 0.0000 0.940 0.000 0.000 0.000 1.000
#> ERR863743 1 0.0000 0.985 1.000 0.000 0.000 0.000
#> ERR863745 2 0.0000 0.970 0.000 1.000 0.000 0.000
#> ERR863744 1 0.0000 0.985 1.000 0.000 0.000 0.000
#> ERR863746 1 0.0000 0.985 1.000 0.000 0.000 0.000
#> ERR863748 2 0.1716 0.909 0.000 0.936 0.064 0.000
#> ERR863747 2 0.0000 0.970 0.000 1.000 0.000 0.000
#> ERR863694 1 0.0188 0.981 0.996 0.004 0.000 0.000
#> ERR863693 1 0.3801 0.694 0.780 0.220 0.000 0.000
#> ERR863686 4 0.0000 0.940 0.000 0.000 0.000 1.000
#> ERR863678 1 0.0000 0.985 1.000 0.000 0.000 0.000
#> ERR863685 3 0.0000 0.965 0.000 0.000 1.000 0.000
#> ERR863689 1 0.0000 0.985 1.000 0.000 0.000 0.000
#> ERR863691 1 0.0000 0.985 1.000 0.000 0.000 0.000
#> ERR863682 1 0.0000 0.985 1.000 0.000 0.000 0.000
#> ERR863695 2 0.0000 0.970 0.000 1.000 0.000 0.000
#> ERR863683 1 0.0000 0.985 1.000 0.000 0.000 0.000
#> ERR863684 1 0.0000 0.985 1.000 0.000 0.000 0.000
#> ERR863702 4 0.0000 0.940 0.000 0.000 0.000 1.000
#> ERR863687 2 0.3873 0.701 0.000 0.772 0.228 0.000
#> ERR863706 3 0.2704 0.807 0.124 0.000 0.876 0.000
#> ERR863708 2 0.0000 0.970 0.000 1.000 0.000 0.000
#> ERR863710 1 0.0000 0.985 1.000 0.000 0.000 0.000
#> ERR863709 2 0.0000 0.970 0.000 1.000 0.000 0.000
#> ERR863753 2 0.0000 0.970 0.000 1.000 0.000 0.000
#> ERR863754 1 0.0000 0.985 1.000 0.000 0.000 0.000
#> ERR863749 1 0.0000 0.985 1.000 0.000 0.000 0.000
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> ERR863675 2 0.5498 0.309 0.064 0.496 0.000 0.440 0.000
#> ERR863705 3 0.0000 0.937 0.000 0.000 1.000 0.000 0.000
#> ERR863704 2 0.0000 0.873 0.000 1.000 0.000 0.000 0.000
#> ERR863679 3 0.0000 0.937 0.000 0.000 1.000 0.000 0.000
#> ERR863680 2 0.0000 0.873 0.000 1.000 0.000 0.000 0.000
#> ERR863676 2 0.0404 0.871 0.000 0.988 0.000 0.012 0.000
#> ERR863677 2 0.4249 0.477 0.000 0.568 0.000 0.432 0.000
#> ERR863688 5 0.6771 0.417 0.272 0.000 0.000 0.360 0.368
#> ERR863690 1 0.0000 0.873 1.000 0.000 0.000 0.000 0.000
#> ERR863692 1 0.1121 0.845 0.956 0.000 0.000 0.044 0.000
#> ERR863703 1 0.0000 0.873 1.000 0.000 0.000 0.000 0.000
#> ERR863712 2 0.3752 0.646 0.000 0.708 0.000 0.292 0.000
#> ERR863711 1 0.0880 0.859 0.968 0.000 0.000 0.032 0.000
#> ERR863760 2 0.0000 0.873 0.000 1.000 0.000 0.000 0.000
#> ERR863727 1 0.1197 0.842 0.952 0.000 0.000 0.048 0.000
#> ERR863766 3 0.0000 0.937 0.000 0.000 1.000 0.000 0.000
#> ERR863767 1 0.0880 0.859 0.968 0.000 0.000 0.032 0.000
#> ERR863752 2 0.0000 0.873 0.000 1.000 0.000 0.000 0.000
#> ERR863757 5 0.6771 0.417 0.272 0.000 0.000 0.360 0.368
#> ERR863758 1 0.0510 0.868 0.984 0.000 0.000 0.016 0.000
#> ERR863755 1 0.1197 0.842 0.952 0.000 0.000 0.048 0.000
#> ERR863756 2 0.4150 0.365 0.000 0.612 0.388 0.000 0.000
#> ERR863707 3 0.0000 0.937 0.000 0.000 1.000 0.000 0.000
#> ERR863681 3 0.0000 0.937 0.000 0.000 1.000 0.000 0.000
#> ERR863719 1 0.4620 -0.188 0.652 0.028 0.000 0.320 0.000
#> ERR863759 2 0.0000 0.873 0.000 1.000 0.000 0.000 0.000
#> ERR863718 1 0.0000 0.873 1.000 0.000 0.000 0.000 0.000
#> ERR863717 1 0.0000 0.873 1.000 0.000 0.000 0.000 0.000
#> ERR863715 5 0.0000 0.820 0.000 0.000 0.000 0.000 1.000
#> ERR863716 1 0.1197 0.842 0.952 0.000 0.000 0.048 0.000
#> ERR863722 1 0.4302 -0.783 0.520 0.000 0.000 0.480 0.000
#> ERR863721 4 0.6100 0.702 0.368 0.132 0.000 0.500 0.000
#> ERR863720 2 0.0290 0.872 0.000 0.992 0.000 0.008 0.000
#> ERR863723 1 0.1197 0.842 0.952 0.000 0.000 0.048 0.000
#> ERR863761 3 0.0000 0.937 0.000 0.000 1.000 0.000 0.000
#> ERR863735 1 0.0000 0.873 1.000 0.000 0.000 0.000 0.000
#> ERR863734 3 0.0000 0.937 0.000 0.000 1.000 0.000 0.000
#> ERR863736 2 0.2654 0.807 0.000 0.888 0.000 0.048 0.064
#> ERR863729 5 0.0000 0.820 0.000 0.000 0.000 0.000 1.000
#> ERR863728 4 0.4304 0.798 0.484 0.000 0.000 0.516 0.000
#> ERR863731 1 0.0000 0.873 1.000 0.000 0.000 0.000 0.000
#> ERR863764 2 0.0000 0.873 0.000 1.000 0.000 0.000 0.000
#> ERR863740 1 0.0000 0.873 1.000 0.000 0.000 0.000 0.000
#> ERR863765 3 0.3424 0.609 0.240 0.000 0.760 0.000 0.000
#> ERR863762 3 0.0000 0.937 0.000 0.000 1.000 0.000 0.000
#> ERR863724 3 0.0000 0.937 0.000 0.000 1.000 0.000 0.000
#> ERR863733 2 0.0000 0.873 0.000 1.000 0.000 0.000 0.000
#> ERR863732 3 0.0000 0.937 0.000 0.000 1.000 0.000 0.000
#> ERR863730 1 0.0794 0.862 0.972 0.000 0.000 0.028 0.000
#> ERR863742 1 0.0880 0.859 0.968 0.000 0.000 0.032 0.000
#> ERR863763 2 0.4291 0.427 0.000 0.536 0.000 0.464 0.000
#> ERR863741 5 0.0000 0.820 0.000 0.000 0.000 0.000 1.000
#> ERR863743 1 0.0000 0.873 1.000 0.000 0.000 0.000 0.000
#> ERR863745 2 0.0000 0.873 0.000 1.000 0.000 0.000 0.000
#> ERR863744 1 0.1043 0.849 0.960 0.000 0.000 0.040 0.000
#> ERR863746 1 0.0794 0.862 0.972 0.000 0.000 0.028 0.000
#> ERR863748 2 0.1410 0.837 0.000 0.940 0.060 0.000 0.000
#> ERR863747 2 0.0000 0.873 0.000 1.000 0.000 0.000 0.000
#> ERR863694 1 0.3966 -0.156 0.664 0.000 0.000 0.336 0.000
#> ERR863693 4 0.4201 0.807 0.408 0.000 0.000 0.592 0.000
#> ERR863686 5 0.0000 0.820 0.000 0.000 0.000 0.000 1.000
#> ERR863678 1 0.1043 0.853 0.960 0.000 0.000 0.040 0.000
#> ERR863685 3 0.0000 0.937 0.000 0.000 1.000 0.000 0.000
#> ERR863689 4 0.4306 0.788 0.492 0.000 0.000 0.508 0.000
#> ERR863691 1 0.0404 0.866 0.988 0.000 0.000 0.012 0.000
#> ERR863682 1 0.1197 0.842 0.952 0.000 0.000 0.048 0.000
#> ERR863695 2 0.0404 0.871 0.000 0.988 0.000 0.012 0.000
#> ERR863683 1 0.0880 0.859 0.968 0.000 0.000 0.032 0.000
#> ERR863684 1 0.3796 -0.171 0.700 0.000 0.000 0.300 0.000
#> ERR863702 5 0.0000 0.820 0.000 0.000 0.000 0.000 1.000
#> ERR863687 2 0.1341 0.841 0.000 0.944 0.056 0.000 0.000
#> ERR863706 3 0.3508 0.587 0.252 0.000 0.748 0.000 0.000
#> ERR863708 2 0.0290 0.872 0.000 0.992 0.000 0.008 0.000
#> ERR863710 1 0.0000 0.873 1.000 0.000 0.000 0.000 0.000
#> ERR863709 2 0.3661 0.665 0.000 0.724 0.000 0.276 0.000
#> ERR863753 2 0.0000 0.873 0.000 1.000 0.000 0.000 0.000
#> ERR863754 1 0.0000 0.873 1.000 0.000 0.000 0.000 0.000
#> ERR863749 1 0.0880 0.859 0.968 0.000 0.000 0.032 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> ERR863675 4 0.3134 0.763 0.024 0.168 0.000 0.808 0.000 0.000
#> ERR863705 3 0.0260 0.932 0.000 0.000 0.992 0.000 0.000 0.008
#> ERR863704 2 0.0000 0.931 0.000 1.000 0.000 0.000 0.000 0.000
#> ERR863679 3 0.0622 0.927 0.000 0.000 0.980 0.012 0.000 0.008
#> ERR863680 2 0.0000 0.931 0.000 1.000 0.000 0.000 0.000 0.000
#> ERR863676 2 0.0260 0.929 0.000 0.992 0.000 0.008 0.000 0.000
#> ERR863677 4 0.3314 0.731 0.004 0.256 0.000 0.740 0.000 0.000
#> ERR863688 6 0.2457 1.000 0.036 0.000 0.000 0.000 0.084 0.880
#> ERR863690 1 0.0146 0.921 0.996 0.000 0.000 0.000 0.000 0.004
#> ERR863692 1 0.0909 0.913 0.968 0.000 0.000 0.012 0.000 0.020
#> ERR863703 1 0.0000 0.921 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR863712 4 0.3309 0.713 0.000 0.280 0.000 0.720 0.000 0.000
#> ERR863711 1 0.2999 0.864 0.840 0.000 0.000 0.112 0.000 0.048
#> ERR863760 2 0.0000 0.931 0.000 1.000 0.000 0.000 0.000 0.000
#> ERR863727 1 0.0909 0.913 0.968 0.000 0.000 0.012 0.000 0.020
#> ERR863766 3 0.0000 0.933 0.000 0.000 1.000 0.000 0.000 0.000
#> ERR863767 1 0.3370 0.836 0.804 0.000 0.000 0.148 0.000 0.048
#> ERR863752 2 0.0865 0.920 0.000 0.964 0.000 0.000 0.000 0.036
#> ERR863757 6 0.2457 1.000 0.036 0.000 0.000 0.000 0.084 0.880
#> ERR863758 1 0.1461 0.913 0.940 0.000 0.000 0.016 0.000 0.044
#> ERR863755 1 0.0909 0.913 0.968 0.000 0.000 0.012 0.000 0.020
#> ERR863756 2 0.4463 0.705 0.000 0.744 0.164 0.048 0.000 0.044
#> ERR863707 3 0.0363 0.927 0.000 0.000 0.988 0.012 0.000 0.000
#> ERR863681 3 0.0260 0.932 0.000 0.000 0.992 0.000 0.000 0.008
#> ERR863719 4 0.4516 0.714 0.188 0.068 0.000 0.724 0.000 0.020
#> ERR863759 2 0.2070 0.890 0.000 0.908 0.000 0.048 0.000 0.044
#> ERR863718 1 0.0000 0.921 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR863717 1 0.0146 0.922 0.996 0.000 0.000 0.004 0.000 0.000
#> ERR863715 5 0.0000 1.000 0.000 0.000 0.000 0.000 1.000 0.000
#> ERR863716 1 0.0909 0.913 0.968 0.000 0.000 0.012 0.000 0.020
#> ERR863722 4 0.1444 0.733 0.072 0.000 0.000 0.928 0.000 0.000
#> ERR863721 4 0.4309 0.760 0.080 0.176 0.000 0.736 0.000 0.008
#> ERR863720 2 0.0260 0.929 0.000 0.992 0.000 0.008 0.000 0.000
#> ERR863723 1 0.0909 0.913 0.968 0.000 0.000 0.012 0.000 0.020
#> ERR863761 3 0.0000 0.933 0.000 0.000 1.000 0.000 0.000 0.000
#> ERR863735 1 0.1074 0.918 0.960 0.000 0.000 0.028 0.000 0.012
#> ERR863734 3 0.0000 0.933 0.000 0.000 1.000 0.000 0.000 0.000
#> ERR863736 2 0.4048 0.558 0.000 0.684 0.000 0.012 0.292 0.012
#> ERR863729 5 0.0000 1.000 0.000 0.000 0.000 0.000 1.000 0.000
#> ERR863728 4 0.1444 0.733 0.072 0.000 0.000 0.928 0.000 0.000
#> ERR863731 1 0.0405 0.922 0.988 0.000 0.000 0.004 0.000 0.008
#> ERR863764 2 0.0000 0.931 0.000 1.000 0.000 0.000 0.000 0.000
#> ERR863740 1 0.1082 0.918 0.956 0.000 0.000 0.040 0.000 0.004
#> ERR863765 3 0.3210 0.698 0.152 0.000 0.812 0.036 0.000 0.000
#> ERR863762 3 0.0000 0.933 0.000 0.000 1.000 0.000 0.000 0.000
#> ERR863724 3 0.0260 0.932 0.000 0.000 0.992 0.000 0.000 0.008
#> ERR863733 2 0.0000 0.931 0.000 1.000 0.000 0.000 0.000 0.000
#> ERR863732 3 0.0790 0.907 0.000 0.000 0.968 0.032 0.000 0.000
#> ERR863730 1 0.2762 0.877 0.860 0.000 0.000 0.092 0.000 0.048
#> ERR863742 1 0.3370 0.836 0.804 0.000 0.000 0.148 0.000 0.048
#> ERR863763 4 0.2912 0.745 0.000 0.216 0.000 0.784 0.000 0.000
#> ERR863741 5 0.0000 1.000 0.000 0.000 0.000 0.000 1.000 0.000
#> ERR863743 1 0.0000 0.921 1.000 0.000 0.000 0.000 0.000 0.000
#> ERR863745 2 0.0000 0.931 0.000 1.000 0.000 0.000 0.000 0.000
#> ERR863744 1 0.1333 0.919 0.944 0.000 0.000 0.048 0.000 0.008
#> ERR863746 1 0.2660 0.881 0.868 0.000 0.000 0.084 0.000 0.048
#> ERR863748 2 0.3181 0.850 0.000 0.856 0.052 0.048 0.000 0.044
#> ERR863747 2 0.2325 0.886 0.000 0.900 0.008 0.048 0.000 0.044
#> ERR863694 4 0.4129 0.681 0.220 0.028 0.000 0.732 0.000 0.020
#> ERR863693 4 0.1434 0.738 0.048 0.012 0.000 0.940 0.000 0.000
#> ERR863686 5 0.0000 1.000 0.000 0.000 0.000 0.000 1.000 0.000
#> ERR863678 1 0.3351 0.834 0.800 0.000 0.000 0.160 0.000 0.040
#> ERR863685 3 0.0000 0.933 0.000 0.000 1.000 0.000 0.000 0.000
#> ERR863689 4 0.1444 0.733 0.072 0.000 0.000 0.928 0.000 0.000
#> ERR863691 1 0.2473 0.788 0.856 0.000 0.000 0.136 0.000 0.008
#> ERR863682 1 0.0909 0.913 0.968 0.000 0.000 0.012 0.000 0.020
#> ERR863695 2 0.0909 0.925 0.000 0.968 0.000 0.012 0.000 0.020
#> ERR863683 1 0.3088 0.859 0.832 0.000 0.000 0.120 0.000 0.048
#> ERR863684 4 0.3634 0.619 0.296 0.000 0.000 0.696 0.000 0.008
#> ERR863702 5 0.0000 1.000 0.000 0.000 0.000 0.000 1.000 0.000
#> ERR863687 2 0.2606 0.882 0.000 0.888 0.020 0.048 0.000 0.044
#> ERR863706 3 0.3694 0.564 0.232 0.000 0.740 0.028 0.000 0.000
#> ERR863708 2 0.0260 0.929 0.000 0.992 0.000 0.008 0.000 0.000
#> ERR863710 1 0.0405 0.922 0.988 0.000 0.000 0.004 0.000 0.008
#> ERR863709 4 0.3371 0.700 0.000 0.292 0.000 0.708 0.000 0.000
#> ERR863753 2 0.0146 0.930 0.000 0.996 0.000 0.004 0.000 0.000
#> ERR863754 1 0.0260 0.920 0.992 0.000 0.000 0.000 0.000 0.008
#> ERR863749 1 0.3332 0.839 0.808 0.000 0.000 0.144 0.000 0.048
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)
An example of the output of tb
is:
#> which_row fdr mean_1 mean_2 scaled_mean_1 scaled_mean_2 km
#> 1 38 0.042760348 8.373488 9.131774 -0.5533452 0.5164555 1
#> 2 40 0.018707592 7.106213 8.469186 -0.6173731 0.5762149 1
#> 3 55 0.019134737 10.221463 11.207825 -0.6159697 0.5749050 1
#> 4 59 0.006059896 5.921854 7.869574 -0.6899429 0.6439467 1
#> 5 60 0.018055526 8.928898 10.211722 -0.6204761 0.5791110 1
#> 6 98 0.009384629 15.714769 14.887706 0.6635654 -0.6193277 2
...
The columns in tb
are:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.km
: Row groups if k-means clustering is applied to rows.UMAP plot which shows how samples are separated.
dimension_reduction(res, k = 2, method = "UMAP")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
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 17118 rows and 78 columns.
#> Top rows (1000, 2000, 3000, 4000, 5000) are extracted by 'ATC' method.
#> Subgroups are detected by 'NMF' method.
#> Performed in total 1250 partitions by row resampling.
#> Best k for subgroups seems to be 2.
#>
#> Following methods can be applied to this 'ConsensusPartition' object:
#> [1] "cola_report" "collect_classes" "collect_plots"
#> [4] "collect_stats" "colnames" "compare_signatures"
#> [7] "consensus_heatmap" "dimension_reduction" "functional_enrichment"
#> [10] "get_anno_col" "get_anno" "get_classes"
#> [13] "get_consensus" "get_matrix" "get_membership"
#> [16] "get_param" "get_signatures" "get_stats"
#> [19] "is_best_k" "is_stable_k" "membership_heatmap"
#> [22] "ncol" "nrow" "plot_ecdf"
#> [25] "rownames" "select_partition_number" "show"
#> [28] "suggest_best_k" "test_to_known_factors"
collect_plots()
function collects all the plots made from res
for all k
(number of partitions)
into one single page to provide an easy and fast comparison between different k
.
collect_plots(res)
The plots are:
k
and the heatmap of
predicted classes for each k
.k
.k
.k
.All the plots in panels can be made by individual functions and they are plotted later in this section.
select_partition_number()
produces several plots showing different
statistics for choosing “optimized” k
. There are following statistics:
k
;k
, the area increased is defined as \(A_k - A_{k-1}\).The detailed explanations of these statistics can be found in the cola vignette.
Generally speaking, lower PAC score, higher mean silhouette score or higher
concordance corresponds to better partition. Rand index and Jaccard index
measure how similar the current partition is compared to partition with k-1
.
If they are too similar, we won't accept k
is better than k-1
.
select_partition_number(res)
The numeric values for all these statistics can be obtained by get_stats()
.
get_stats(res)
#> k 1-PAC mean_silhouette concordance area_increased Rand Jaccard
#> 2 2 1.000 0.978 0.991 0.4105 0.590 0.590
#> 3 3 0.648 0.796 0.898 0.4696 0.736 0.582
#> 4 4 0.891 0.847 0.945 0.1802 0.744 0.460
#> 5 5 0.834 0.820 0.912 0.0532 0.870 0.608
#> 6 6 0.632 0.381 0.684 0.0438 0.858 0.524
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
#> ERR863675 1 0.0000 0.993 1.000 0.000
#> ERR863705 2 0.0000 0.982 0.000 1.000
#> ERR863704 1 0.0000 0.993 1.000 0.000
#> ERR863679 2 0.0000 0.982 0.000 1.000
#> ERR863680 1 0.0000 0.993 1.000 0.000
#> ERR863676 1 0.0000 0.993 1.000 0.000
#> ERR863677 1 0.0000 0.993 1.000 0.000
#> ERR863688 2 0.0000 0.982 0.000 1.000
#> ERR863690 1 0.0000 0.993 1.000 0.000
#> ERR863692 1 0.0000 0.993 1.000 0.000
#> ERR863703 1 0.0000 0.993 1.000 0.000
#> ERR863712 1 0.0000 0.993 1.000 0.000
#> ERR863711 1 0.0000 0.993 1.000 0.000
#> ERR863760 1 0.0000 0.993 1.000 0.000
#> ERR863727 1 0.2423 0.955 0.960 0.040
#> ERR863766 2 0.9358 0.450 0.352 0.648
#> ERR863767 1 0.0000 0.993 1.000 0.000
#> ERR863752 1 0.0000 0.993 1.000 0.000
#> ERR863757 2 0.0000 0.982 0.000 1.000
#> ERR863758 1 0.0000 0.993 1.000 0.000
#> ERR863755 1 0.0376 0.990 0.996 0.004
#> ERR863756 1 0.3879 0.916 0.924 0.076
#> ERR863707 2 0.0000 0.982 0.000 1.000
#> ERR863681 2 0.0000 0.982 0.000 1.000
#> ERR863719 2 0.0376 0.980 0.004 0.996
#> ERR863759 1 0.0000 0.993 1.000 0.000
#> ERR863718 1 0.0000 0.993 1.000 0.000
#> ERR863717 1 0.0000 0.993 1.000 0.000
#> ERR863715 2 0.0000 0.982 0.000 1.000
#> ERR863716 1 0.0000 0.993 1.000 0.000
#> ERR863722 1 0.0000 0.993 1.000 0.000
#> ERR863721 1 0.0000 0.993 1.000 0.000
#> ERR863720 1 0.0000 0.993 1.000 0.000
#> ERR863723 1 0.0000 0.993 1.000 0.000
#> ERR863761 2 0.0000 0.982 0.000 1.000
#> ERR863735 1 0.0000 0.993 1.000 0.000
#> ERR863734 2 0.0376 0.980 0.004 0.996
#> ERR863736 1 0.7674 0.709 0.776 0.224
#> ERR863729 2 0.0000 0.982 0.000 1.000
#> ERR863728 1 0.0000 0.993 1.000 0.000
#> ERR863731 1 0.0000 0.993 1.000 0.000
#> ERR863764 1 0.0000 0.993 1.000 0.000
#> ERR863740 1 0.0938 0.983 0.988 0.012
#> ERR863765 2 0.0000 0.982 0.000 1.000
#> ERR863762 2 0.0000 0.982 0.000 1.000
#> ERR863724 2 0.0000 0.982 0.000 1.000
#> ERR863733 1 0.0000 0.993 1.000 0.000
#> ERR863732 2 0.0000 0.982 0.000 1.000
#> ERR863730 1 0.0000 0.993 1.000 0.000
#> ERR863742 1 0.0000 0.993 1.000 0.000
#> ERR863763 1 0.0000 0.993 1.000 0.000
#> ERR863741 2 0.0000 0.982 0.000 1.000
#> ERR863743 1 0.0000 0.993 1.000 0.000
#> ERR863745 1 0.0000 0.993 1.000 0.000
#> ERR863744 1 0.0000 0.993 1.000 0.000
#> ERR863746 1 0.0000 0.993 1.000 0.000
#> ERR863748 1 0.0376 0.990 0.996 0.004
#> ERR863747 1 0.0000 0.993 1.000 0.000
#> ERR863694 1 0.0000 0.993 1.000 0.000
#> ERR863693 1 0.0000 0.993 1.000 0.000
#> ERR863686 2 0.0000 0.982 0.000 1.000
#> ERR863678 1 0.0000 0.993 1.000 0.000
#> ERR863685 2 0.0376 0.980 0.004 0.996
#> ERR863689 1 0.0000 0.993 1.000 0.000
#> ERR863691 1 0.0000 0.993 1.000 0.000
#> ERR863682 1 0.0000 0.993 1.000 0.000
#> ERR863695 1 0.0000 0.993 1.000 0.000
#> ERR863683 1 0.0000 0.993 1.000 0.000
#> ERR863684 1 0.0000 0.993 1.000 0.000
#> ERR863702 2 0.0000 0.982 0.000 1.000
#> ERR863687 2 0.0000 0.982 0.000 1.000
#> ERR863706 2 0.0000 0.982 0.000 1.000
#> ERR863708 1 0.0000 0.993 1.000 0.000
#> ERR863710 1 0.0000 0.993 1.000 0.000
#> ERR863709 1 0.0000 0.993 1.000 0.000
#> ERR863753 1 0.0000 0.993 1.000 0.000
#> ERR863754 1 0.0000 0.993 1.000 0.000
#> ERR863749 1 0.0000 0.993 1.000 0.000
cbind(get_classes(res, k = 3), get_membership(res, k = 3))
#> class entropy silhouette p1 p2 p3
#> ERR863675 1 0.0424 0.892 0.992 0.000 0.008
#> ERR863705 3 0.0237 0.878 0.000 0.004 0.996
#> ERR863704 1 0.0424 0.892 0.992 0.000 0.008
#> ERR863679 3 0.0237 0.878 0.000 0.004 0.996
#> ERR863680 1 0.0424 0.892 0.992 0.000 0.008
#> ERR863676 1 0.0237 0.893 0.996 0.000 0.004
#> ERR863677 1 0.0000 0.894 1.000 0.000 0.000
#> ERR863688 2 0.1411 0.810 0.000 0.964 0.036
#> ERR863690 1 0.3116 0.877 0.892 0.108 0.000
#> ERR863692 1 0.5327 0.724 0.728 0.272 0.000
#> ERR863703 1 0.3267 0.873 0.884 0.116 0.000
#> ERR863712 1 0.0000 0.894 1.000 0.000 0.000
#> ERR863711 1 0.2711 0.884 0.912 0.088 0.000
#> ERR863760 1 0.3038 0.814 0.896 0.000 0.104
#> ERR863727 2 0.0237 0.814 0.004 0.996 0.000
#> ERR863766 3 0.1163 0.870 0.028 0.000 0.972
#> ERR863767 1 0.1643 0.893 0.956 0.044 0.000
#> ERR863752 1 0.2959 0.818 0.900 0.000 0.100
#> ERR863757 2 0.2625 0.792 0.000 0.916 0.084
#> ERR863758 1 0.3412 0.868 0.876 0.124 0.000
#> ERR863755 2 0.0424 0.814 0.008 0.992 0.000
#> ERR863756 3 0.2959 0.819 0.100 0.000 0.900
#> ERR863707 3 0.1289 0.867 0.032 0.000 0.968
#> ERR863681 3 0.0424 0.876 0.000 0.008 0.992
#> ERR863719 2 0.7809 0.413 0.060 0.568 0.372
#> ERR863759 3 0.5431 0.612 0.284 0.000 0.716
#> ERR863718 1 0.6280 0.342 0.540 0.460 0.000
#> ERR863717 1 0.5882 0.604 0.652 0.348 0.000
#> ERR863715 2 0.5098 0.634 0.000 0.752 0.248
#> ERR863716 2 0.0424 0.814 0.008 0.992 0.000
#> ERR863722 1 0.0424 0.892 0.992 0.000 0.008
#> ERR863721 1 0.1643 0.893 0.956 0.044 0.000
#> ERR863720 1 0.0237 0.893 0.996 0.000 0.004
#> ERR863723 2 0.5859 0.310 0.344 0.656 0.000
#> ERR863761 3 0.0237 0.878 0.000 0.004 0.996
#> ERR863735 1 0.6095 0.515 0.608 0.392 0.000
#> ERR863734 3 0.0000 0.878 0.000 0.000 1.000
#> ERR863736 3 0.5968 0.457 0.364 0.000 0.636
#> ERR863729 2 0.5560 0.559 0.000 0.700 0.300
#> ERR863728 1 0.0000 0.894 1.000 0.000 0.000
#> ERR863731 1 0.3116 0.877 0.892 0.108 0.000
#> ERR863764 1 0.0892 0.886 0.980 0.000 0.020
#> ERR863740 2 0.1529 0.796 0.040 0.960 0.000
#> ERR863765 3 0.0592 0.874 0.000 0.012 0.988
#> ERR863762 3 0.0237 0.878 0.000 0.004 0.996
#> ERR863724 3 0.0424 0.876 0.000 0.008 0.992
#> ERR863733 1 0.2878 0.823 0.904 0.000 0.096
#> ERR863732 3 0.0237 0.878 0.000 0.004 0.996
#> ERR863730 1 0.3267 0.874 0.884 0.116 0.000
#> ERR863742 1 0.2878 0.882 0.904 0.096 0.000
#> ERR863763 1 0.0237 0.893 0.996 0.000 0.004
#> ERR863741 2 0.2448 0.797 0.000 0.924 0.076
#> ERR863743 1 0.4974 0.768 0.764 0.236 0.000
#> ERR863745 1 0.1031 0.883 0.976 0.000 0.024
#> ERR863744 2 0.5397 0.490 0.280 0.720 0.000
#> ERR863746 1 0.3192 0.875 0.888 0.112 0.000
#> ERR863748 3 0.4121 0.759 0.168 0.000 0.832
#> ERR863747 3 0.4504 0.729 0.196 0.000 0.804
#> ERR863694 1 0.5678 0.660 0.684 0.316 0.000
#> ERR863693 1 0.0000 0.894 1.000 0.000 0.000
#> ERR863686 2 0.2625 0.792 0.000 0.916 0.084
#> ERR863678 1 0.1411 0.893 0.964 0.036 0.000
#> ERR863685 3 0.1031 0.871 0.024 0.000 0.976
#> ERR863689 1 0.0000 0.894 1.000 0.000 0.000
#> ERR863691 1 0.3116 0.878 0.892 0.108 0.000
#> ERR863682 2 0.0424 0.814 0.008 0.992 0.000
#> ERR863695 1 0.0424 0.892 0.992 0.000 0.008
#> ERR863683 1 0.3192 0.875 0.888 0.112 0.000
#> ERR863684 1 0.2796 0.883 0.908 0.092 0.000
#> ERR863702 3 0.6308 -0.141 0.000 0.492 0.508
#> ERR863687 3 0.0000 0.878 0.000 0.000 1.000
#> ERR863706 3 0.0424 0.876 0.000 0.008 0.992
#> ERR863708 1 0.0424 0.892 0.992 0.000 0.008
#> ERR863710 1 0.5178 0.745 0.744 0.256 0.000
#> ERR863709 1 0.0000 0.894 1.000 0.000 0.000
#> ERR863753 1 0.0424 0.892 0.992 0.000 0.008
#> ERR863754 1 0.4121 0.835 0.832 0.168 0.000
#> ERR863749 1 0.2448 0.887 0.924 0.076 0.000
cbind(get_classes(res, k = 4), get_membership(res, k = 4))
#> class entropy silhouette p1 p2 p3 p4
#> ERR863675 2 0.0000 0.9146 0.000 1.000 0.000 0.000
#> ERR863705 3 0.0000 0.9455 0.000 0.000 1.000 0.000
#> ERR863704 2 0.0000 0.9146 0.000 1.000 0.000 0.000
#> ERR863679 3 0.0000 0.9455 0.000 0.000 1.000 0.000
#> ERR863680 2 0.0000 0.9146 0.000 1.000 0.000 0.000
#> ERR863676 2 0.0000 0.9146 0.000 1.000 0.000 0.000
#> ERR863677 2 0.0188 0.9119 0.004 0.996 0.000 0.000
#> ERR863688 4 0.0188 0.8864 0.004 0.000 0.000 0.996
#> ERR863690 1 0.0336 0.9244 0.992 0.008 0.000 0.000
#> ERR863692 1 0.0188 0.9271 0.996 0.000 0.000 0.004
#> ERR863703 1 0.0000 0.9300 1.000 0.000 0.000 0.000
#> ERR863712 2 0.0000 0.9146 0.000 1.000 0.000 0.000
#> ERR863711 1 0.0000 0.9300 1.000 0.000 0.000 0.000
#> ERR863760 2 0.1389 0.8638 0.000 0.952 0.048 0.000
#> ERR863727 1 0.0000 0.9300 1.000 0.000 0.000 0.000
#> ERR863766 3 0.0469 0.9390 0.012 0.000 0.988 0.000
#> ERR863767 1 0.2011 0.8560 0.920 0.080 0.000 0.000
#> ERR863752 2 0.0000 0.9146 0.000 1.000 0.000 0.000
#> ERR863757 4 0.0469 0.8832 0.012 0.000 0.000 0.988
#> ERR863758 1 0.0000 0.9300 1.000 0.000 0.000 0.000
#> ERR863755 1 0.0000 0.9300 1.000 0.000 0.000 0.000
#> ERR863756 3 0.0000 0.9455 0.000 0.000 1.000 0.000
#> ERR863707 3 0.0000 0.9455 0.000 0.000 1.000 0.000
#> ERR863681 3 0.0188 0.9435 0.000 0.000 0.996 0.004
#> ERR863719 1 0.4406 0.5539 0.700 0.000 0.300 0.000
#> ERR863759 2 0.4866 0.2316 0.000 0.596 0.404 0.000
#> ERR863718 1 0.0000 0.9300 1.000 0.000 0.000 0.000
#> ERR863717 1 0.0000 0.9300 1.000 0.000 0.000 0.000
#> ERR863715 4 0.0000 0.8866 0.000 0.000 0.000 1.000
#> ERR863716 1 0.0000 0.9300 1.000 0.000 0.000 0.000
#> ERR863722 2 0.0000 0.9146 0.000 1.000 0.000 0.000
#> ERR863721 2 0.4955 0.1304 0.444 0.556 0.000 0.000
#> ERR863720 2 0.0000 0.9146 0.000 1.000 0.000 0.000
#> ERR863723 1 0.0000 0.9300 1.000 0.000 0.000 0.000
#> ERR863761 3 0.0000 0.9455 0.000 0.000 1.000 0.000
#> ERR863735 1 0.0000 0.9300 1.000 0.000 0.000 0.000
#> ERR863734 3 0.0469 0.9390 0.012 0.000 0.988 0.000
#> ERR863736 3 0.5165 0.4669 0.004 0.352 0.636 0.008
#> ERR863729 4 0.0000 0.8866 0.000 0.000 0.000 1.000
#> ERR863728 2 0.0707 0.8965 0.020 0.980 0.000 0.000
#> ERR863731 1 0.1022 0.9035 0.968 0.032 0.000 0.000
#> ERR863764 2 0.0000 0.9146 0.000 1.000 0.000 0.000
#> ERR863740 1 0.0000 0.9300 1.000 0.000 0.000 0.000
#> ERR863765 3 0.0469 0.9390 0.012 0.000 0.988 0.000
#> ERR863762 3 0.0000 0.9455 0.000 0.000 1.000 0.000
#> ERR863724 3 0.0000 0.9455 0.000 0.000 1.000 0.000
#> ERR863733 2 0.0000 0.9146 0.000 1.000 0.000 0.000
#> ERR863732 3 0.0000 0.9455 0.000 0.000 1.000 0.000
#> ERR863730 1 0.0000 0.9300 1.000 0.000 0.000 0.000
#> ERR863742 1 0.0188 0.9270 0.996 0.000 0.004 0.000
#> ERR863763 2 0.0188 0.9119 0.004 0.996 0.000 0.000
#> ERR863741 4 0.0000 0.8866 0.000 0.000 0.000 1.000
#> ERR863743 1 0.0000 0.9300 1.000 0.000 0.000 0.000
#> ERR863745 2 0.0000 0.9146 0.000 1.000 0.000 0.000
#> ERR863744 1 0.0000 0.9300 1.000 0.000 0.000 0.000
#> ERR863746 1 0.0000 0.9300 1.000 0.000 0.000 0.000
#> ERR863748 3 0.2011 0.8782 0.000 0.080 0.920 0.000
#> ERR863747 3 0.3266 0.7723 0.000 0.168 0.832 0.000
#> ERR863694 4 0.4989 0.0873 0.000 0.472 0.000 0.528
#> ERR863693 2 0.0817 0.8933 0.024 0.976 0.000 0.000
#> ERR863686 4 0.3219 0.7955 0.112 0.000 0.020 0.868
#> ERR863678 1 0.4356 0.5807 0.708 0.292 0.000 0.000
#> ERR863685 3 0.0000 0.9455 0.000 0.000 1.000 0.000
#> ERR863689 2 0.4761 0.3567 0.372 0.628 0.000 0.000
#> ERR863691 1 0.4898 0.2986 0.584 0.416 0.000 0.000
#> ERR863682 1 0.0000 0.9300 1.000 0.000 0.000 0.000
#> ERR863695 2 0.0000 0.9146 0.000 1.000 0.000 0.000
#> ERR863683 1 0.0000 0.9300 1.000 0.000 0.000 0.000
#> ERR863684 1 0.4977 0.1619 0.540 0.460 0.000 0.000
#> ERR863702 3 0.2011 0.8617 0.080 0.000 0.920 0.000
#> ERR863687 3 0.1118 0.9206 0.000 0.036 0.964 0.000
#> ERR863706 3 0.0000 0.9455 0.000 0.000 1.000 0.000
#> ERR863708 2 0.0000 0.9146 0.000 1.000 0.000 0.000
#> ERR863710 1 0.0000 0.9300 1.000 0.000 0.000 0.000
#> ERR863709 2 0.0000 0.9146 0.000 1.000 0.000 0.000
#> ERR863753 2 0.0000 0.9146 0.000 1.000 0.000 0.000
#> ERR863754 1 0.0000 0.9300 1.000 0.000 0.000 0.000
#> ERR863749 1 0.0000 0.9300 1.000 0.000 0.000 0.000
cbind(get_classes(res, k = 5), get_membership(res, k = 5))
#> class entropy silhouette p1 p2 p3 p4 p5
#> ERR863675 2 0.0162 0.90706 0.004 0.996 0.000 0.000 0.000
#> ERR863705 4 0.1851 0.84601 0.000 0.000 0.088 0.912 0.000
#> ERR863704 2 0.0290 0.90725 0.000 0.992 0.008 0.000 0.000
#> ERR863679 3 0.3561 0.65880 0.000 0.000 0.740 0.260 0.000
#> ERR863680 2 0.0162 0.90713 0.000 0.996 0.004 0.000 0.000
#> ERR863676 2 0.0162 0.90713 0.000 0.996 0.004 0.000 0.000
#> ERR863677 2 0.0324 0.90759 0.000 0.992 0.004 0.004 0.000
#> ERR863688 5 0.0579 0.85895 0.008 0.000 0.000 0.008 0.984
#> ERR863690 1 0.3942 0.67730 0.748 0.232 0.000 0.020 0.000
#> ERR863692 1 0.1750 0.92941 0.936 0.028 0.000 0.036 0.000
#> ERR863703 1 0.1701 0.93004 0.936 0.016 0.000 0.048 0.000
#> ERR863712 2 0.0162 0.90706 0.004 0.996 0.000 0.000 0.000
#> ERR863711 1 0.1087 0.93463 0.968 0.008 0.008 0.016 0.000
#> ERR863760 2 0.1082 0.89128 0.000 0.964 0.028 0.008 0.000
#> ERR863727 1 0.0794 0.93738 0.972 0.000 0.000 0.028 0.000
#> ERR863766 3 0.3821 0.70333 0.020 0.000 0.764 0.216 0.000
#> ERR863767 1 0.1934 0.91715 0.932 0.008 0.040 0.020 0.000
#> ERR863752 3 0.3949 0.49086 0.000 0.332 0.668 0.000 0.000
#> ERR863757 5 0.5631 0.20570 0.076 0.000 0.000 0.424 0.500
#> ERR863758 1 0.1557 0.92964 0.940 0.008 0.000 0.052 0.000
#> ERR863755 1 0.1478 0.92386 0.936 0.000 0.000 0.064 0.000
#> ERR863756 3 0.0162 0.85094 0.000 0.000 0.996 0.004 0.000
#> ERR863707 3 0.1197 0.84433 0.000 0.000 0.952 0.048 0.000
#> ERR863681 4 0.1792 0.84731 0.000 0.000 0.084 0.916 0.000
#> ERR863719 3 0.3443 0.74932 0.120 0.000 0.840 0.028 0.012
#> ERR863759 3 0.0898 0.84382 0.000 0.020 0.972 0.008 0.000
#> ERR863718 1 0.1270 0.92903 0.948 0.000 0.000 0.052 0.000
#> ERR863717 1 0.0609 0.93851 0.980 0.000 0.000 0.020 0.000
#> ERR863715 5 0.0000 0.86725 0.000 0.000 0.000 0.000 1.000
#> ERR863716 1 0.0671 0.93636 0.980 0.000 0.004 0.016 0.000
#> ERR863722 2 0.0324 0.90738 0.004 0.992 0.004 0.000 0.000
#> ERR863721 2 0.2674 0.83463 0.084 0.888 0.008 0.020 0.000
#> ERR863720 2 0.0290 0.90725 0.000 0.992 0.008 0.000 0.000
#> ERR863723 1 0.0693 0.93703 0.980 0.000 0.008 0.012 0.000
#> ERR863761 4 0.1908 0.84214 0.000 0.000 0.092 0.908 0.000
#> ERR863735 1 0.0960 0.93512 0.972 0.004 0.008 0.016 0.000
#> ERR863734 3 0.0798 0.85081 0.008 0.000 0.976 0.016 0.000
#> ERR863736 3 0.2196 0.80544 0.056 0.004 0.916 0.024 0.000
#> ERR863729 5 0.0000 0.86725 0.000 0.000 0.000 0.000 1.000
#> ERR863728 2 0.0404 0.90461 0.012 0.988 0.000 0.000 0.000
#> ERR863731 1 0.3437 0.75228 0.808 0.176 0.004 0.012 0.000
#> ERR863764 2 0.4300 -0.02079 0.000 0.524 0.476 0.000 0.000
#> ERR863740 1 0.0898 0.93473 0.972 0.000 0.008 0.020 0.000
#> ERR863765 3 0.1195 0.84862 0.012 0.000 0.960 0.028 0.000
#> ERR863762 3 0.0794 0.84924 0.000 0.000 0.972 0.028 0.000
#> ERR863724 4 0.1792 0.84731 0.000 0.000 0.084 0.916 0.000
#> ERR863733 3 0.2773 0.72353 0.000 0.164 0.836 0.000 0.000
#> ERR863732 3 0.0703 0.85002 0.000 0.000 0.976 0.024 0.000
#> ERR863730 1 0.1012 0.93360 0.968 0.000 0.012 0.020 0.000
#> ERR863742 1 0.1965 0.90781 0.924 0.000 0.052 0.024 0.000
#> ERR863763 2 0.0932 0.89975 0.020 0.972 0.004 0.004 0.000
#> ERR863741 5 0.0000 0.86725 0.000 0.000 0.000 0.000 1.000
#> ERR863743 1 0.1626 0.93173 0.940 0.016 0.000 0.044 0.000
#> ERR863745 2 0.0290 0.90725 0.000 0.992 0.008 0.000 0.000
#> ERR863744 1 0.1725 0.91456 0.936 0.000 0.044 0.020 0.000
#> ERR863746 1 0.0798 0.93517 0.976 0.000 0.008 0.016 0.000
#> ERR863748 3 0.0609 0.85044 0.000 0.000 0.980 0.020 0.000
#> ERR863747 3 0.0290 0.85045 0.000 0.000 0.992 0.008 0.000
#> ERR863694 2 0.0290 0.90598 0.000 0.992 0.000 0.000 0.008
#> ERR863693 2 0.2364 0.85254 0.064 0.908 0.008 0.020 0.000
#> ERR863686 4 0.6491 -0.00131 0.264 0.000 0.000 0.492 0.244
#> ERR863678 2 0.4764 0.21740 0.436 0.548 0.004 0.012 0.000
#> ERR863685 3 0.3876 0.56804 0.000 0.000 0.684 0.316 0.000
#> ERR863689 2 0.2170 0.84529 0.088 0.904 0.004 0.004 0.000
#> ERR863691 2 0.3752 0.56555 0.292 0.708 0.000 0.000 0.000
#> ERR863682 1 0.1410 0.92582 0.940 0.000 0.000 0.060 0.000
#> ERR863695 2 0.0290 0.90725 0.000 0.992 0.008 0.000 0.000
#> ERR863683 1 0.0451 0.93884 0.988 0.000 0.004 0.008 0.000
#> ERR863684 2 0.1341 0.87596 0.056 0.944 0.000 0.000 0.000
#> ERR863702 3 0.4404 0.51420 0.264 0.000 0.704 0.032 0.000
#> ERR863687 3 0.1901 0.83919 0.000 0.012 0.928 0.056 0.004
#> ERR863706 4 0.1732 0.84430 0.000 0.000 0.080 0.920 0.000
#> ERR863708 2 0.0290 0.90725 0.000 0.992 0.008 0.000 0.000
#> ERR863710 1 0.0510 0.93908 0.984 0.000 0.000 0.016 0.000
#> ERR863709 2 0.0162 0.90706 0.004 0.996 0.000 0.000 0.000
#> ERR863753 2 0.0290 0.90725 0.000 0.992 0.008 0.000 0.000
#> ERR863754 1 0.2370 0.91170 0.904 0.040 0.000 0.056 0.000
#> ERR863749 1 0.1251 0.93573 0.956 0.008 0.000 0.036 0.000
cbind(get_classes(res, k = 6), get_membership(res, k = 6))
#> class entropy silhouette p1 p2 p3 p4 p5 p6
#> ERR863675 2 0.3464 0.3202 0.000 0.688 0.000 0.312 0.000 0.000
#> ERR863705 6 0.0508 0.8489 0.000 0.000 0.012 0.004 0.000 0.984
#> ERR863704 2 0.3848 0.3379 0.000 0.692 0.012 0.004 0.292 0.000
#> ERR863679 3 0.3998 0.3580 0.000 0.000 0.644 0.016 0.000 0.340
#> ERR863680 2 0.0291 0.6172 0.000 0.992 0.000 0.004 0.004 0.000
#> ERR863676 2 0.0865 0.6146 0.000 0.964 0.000 0.036 0.000 0.000
#> ERR863677 2 0.4172 0.0418 0.008 0.564 0.004 0.424 0.000 0.000
#> ERR863688 4 0.6082 -0.6894 0.356 0.000 0.000 0.372 0.272 0.000
#> ERR863690 4 0.5851 0.3163 0.304 0.220 0.000 0.476 0.000 0.000
#> ERR863692 1 0.5587 -0.1437 0.432 0.140 0.000 0.428 0.000 0.000
#> ERR863703 1 0.5029 0.0308 0.484 0.072 0.000 0.444 0.000 0.000
#> ERR863712 2 0.3782 0.1104 0.000 0.588 0.000 0.412 0.000 0.000
#> ERR863711 4 0.4129 -0.2300 0.496 0.004 0.004 0.496 0.000 0.000
#> ERR863760 2 0.6218 0.0913 0.000 0.508 0.052 0.040 0.364 0.036
#> ERR863727 1 0.1080 0.5326 0.960 0.000 0.004 0.032 0.000 0.004
#> ERR863766 3 0.6225 0.2370 0.028 0.000 0.528 0.040 0.068 0.336
#> ERR863767 4 0.4594 -0.0903 0.424 0.024 0.008 0.544 0.000 0.000
#> ERR863752 2 0.5516 0.0846 0.000 0.576 0.248 0.004 0.172 0.000
#> ERR863757 1 0.6251 -0.2116 0.520 0.000 0.000 0.180 0.036 0.264
#> ERR863758 1 0.4587 0.1148 0.508 0.036 0.000 0.456 0.000 0.000
#> ERR863755 1 0.0972 0.5199 0.964 0.000 0.000 0.028 0.000 0.008
#> ERR863756 3 0.0458 0.7366 0.000 0.000 0.984 0.000 0.016 0.000
#> ERR863707 3 0.1411 0.7266 0.000 0.000 0.936 0.000 0.004 0.060
#> ERR863681 6 0.0260 0.8501 0.000 0.000 0.008 0.000 0.000 0.992
#> ERR863719 3 0.2156 0.7212 0.048 0.000 0.912 0.020 0.020 0.000
#> ERR863759 3 0.4282 0.6063 0.000 0.040 0.656 0.000 0.304 0.000
#> ERR863718 1 0.4039 0.2801 0.568 0.000 0.000 0.424 0.000 0.008
#> ERR863717 1 0.3563 0.3826 0.664 0.000 0.000 0.336 0.000 0.000
#> ERR863715 5 0.3672 0.9982 0.000 0.000 0.000 0.368 0.632 0.000
#> ERR863716 1 0.4276 0.3279 0.564 0.000 0.000 0.416 0.020 0.000
#> ERR863722 4 0.3867 0.1239 0.000 0.488 0.000 0.512 0.000 0.000
#> ERR863721 4 0.4482 0.2825 0.032 0.416 0.000 0.552 0.000 0.000
#> ERR863720 2 0.1261 0.6149 0.000 0.952 0.000 0.024 0.024 0.000
#> ERR863723 1 0.0790 0.5345 0.968 0.000 0.000 0.032 0.000 0.000
#> ERR863761 6 0.1461 0.8292 0.000 0.000 0.044 0.000 0.016 0.940
#> ERR863735 1 0.4032 0.2852 0.572 0.000 0.008 0.420 0.000 0.000
#> ERR863734 3 0.3564 0.6786 0.004 0.000 0.776 0.004 0.196 0.020
#> ERR863736 3 0.4538 0.5717 0.000 0.008 0.600 0.028 0.364 0.000
#> ERR863729 5 0.3659 0.9964 0.000 0.000 0.000 0.364 0.636 0.000
#> ERR863728 2 0.3782 0.0928 0.000 0.588 0.000 0.412 0.000 0.000
#> ERR863731 4 0.5543 0.2537 0.320 0.156 0.000 0.524 0.000 0.000
#> ERR863764 3 0.5020 0.0589 0.004 0.436 0.500 0.060 0.000 0.000
#> ERR863740 1 0.1462 0.5313 0.936 0.000 0.008 0.056 0.000 0.000
#> ERR863765 3 0.0922 0.7345 0.024 0.000 0.968 0.004 0.000 0.004
#> ERR863762 3 0.1049 0.7336 0.000 0.000 0.960 0.032 0.000 0.008
#> ERR863724 6 0.0260 0.8501 0.000 0.000 0.008 0.000 0.000 0.992
#> ERR863733 3 0.4153 0.4726 0.000 0.340 0.636 0.024 0.000 0.000
#> ERR863732 3 0.1261 0.7346 0.004 0.000 0.956 0.028 0.008 0.004
#> ERR863730 1 0.2573 0.5146 0.864 0.000 0.112 0.024 0.000 0.000
#> ERR863742 1 0.5776 0.3720 0.544 0.000 0.284 0.160 0.012 0.000
#> ERR863763 4 0.3866 0.1315 0.000 0.484 0.000 0.516 0.000 0.000
#> ERR863741 5 0.3672 0.9982 0.000 0.000 0.000 0.368 0.632 0.000
#> ERR863743 4 0.4407 -0.1849 0.484 0.024 0.000 0.492 0.000 0.000
#> ERR863745 2 0.0363 0.6162 0.000 0.988 0.000 0.000 0.012 0.000
#> ERR863744 1 0.7055 0.3478 0.468 0.000 0.164 0.228 0.140 0.000
#> ERR863746 1 0.3769 0.4006 0.640 0.000 0.004 0.356 0.000 0.000
#> ERR863748 3 0.2194 0.7317 0.000 0.004 0.912 0.036 0.008 0.040
#> ERR863747 3 0.3998 0.6003 0.000 0.016 0.644 0.000 0.340 0.000
#> ERR863694 2 0.4384 0.2185 0.000 0.616 0.000 0.348 0.036 0.000
#> ERR863693 4 0.4549 0.2722 0.028 0.416 0.004 0.552 0.000 0.000
#> ERR863686 1 0.5511 -0.0340 0.616 0.000 0.000 0.188 0.016 0.180
#> ERR863678 4 0.5400 0.4133 0.132 0.332 0.000 0.536 0.000 0.000
#> ERR863685 6 0.5037 0.0753 0.000 0.000 0.408 0.004 0.064 0.524
#> ERR863689 4 0.4083 0.1996 0.008 0.460 0.000 0.532 0.000 0.000
#> ERR863691 2 0.4873 -0.1438 0.060 0.520 0.000 0.420 0.000 0.000
#> ERR863682 1 0.0806 0.5223 0.972 0.000 0.000 0.020 0.000 0.008
#> ERR863695 2 0.1075 0.6108 0.000 0.952 0.000 0.048 0.000 0.000
#> ERR863683 1 0.0632 0.5338 0.976 0.000 0.000 0.024 0.000 0.000
#> ERR863684 2 0.4253 -0.1187 0.016 0.524 0.000 0.460 0.000 0.000
#> ERR863702 1 0.4461 -0.1820 0.512 0.000 0.464 0.020 0.000 0.004
#> ERR863687 3 0.3189 0.6989 0.000 0.068 0.860 0.032 0.008 0.032
#> ERR863706 6 0.1268 0.8244 0.036 0.000 0.008 0.004 0.000 0.952
#> ERR863708 2 0.0520 0.6181 0.000 0.984 0.000 0.008 0.008 0.000
#> ERR863710 1 0.3979 0.2575 0.540 0.000 0.000 0.456 0.000 0.004
#> ERR863709 2 0.1556 0.5934 0.000 0.920 0.000 0.080 0.000 0.000
#> ERR863753 2 0.0790 0.6086 0.000 0.968 0.000 0.000 0.032 0.000
#> ERR863754 1 0.4819 0.1487 0.528 0.056 0.000 0.416 0.000 0.000
#> ERR863749 1 0.4082 0.2425 0.560 0.004 0.000 0.432 0.000 0.004
Heatmaps for the consensus matrix. It visualizes the probability of two samples to be in a same group.
consensus_heatmap(res, k = 2)
consensus_heatmap(res, k = 3)
consensus_heatmap(res, k = 4)
consensus_heatmap(res, k = 5)
consensus_heatmap(res, k = 6)
Heatmaps for the membership of samples in all partitions to see how consistent they are:
membership_heatmap(res, k = 2)
membership_heatmap(res, k = 3)
membership_heatmap(res, k = 4)
membership_heatmap(res, k = 5)
membership_heatmap(res, k = 6)
As soon as we have had the classes for columns, we can look for signatures which are significantly different between classes which can be candidate marks for certain classes. Following are the heatmaps for signatures.
Signature heatmaps where rows are scaled:
get_signatures(res, k = 2)
get_signatures(res, k = 3)
get_signatures(res, k = 4)
get_signatures(res, k = 5)
get_signatures(res, k = 6)
Signature heatmaps where rows are not scaled:
get_signatures(res, k = 2, scale_rows = FALSE)
get_signatures(res, k = 3, scale_rows = FALSE)
get_signatures(res, k = 4, scale_rows = FALSE)
get_signatures(res, k = 5, scale_rows = FALSE)
get_signatures(res, k = 6, scale_rows = FALSE)
Compare the overlap of signatures from different k:
compare_signatures(res)
get_signature()
returns a data frame invisibly. TO get the list of signatures, the function
call should be assigned to a variable explicitly. In following code, if plot
argument is set
to FALSE
, no heatmap is plotted while only the differential analysis is performed.
# code only for demonstration
tb = get_signature(res, k = ..., plot = FALSE)
An example of the output of tb
is:
#> which_row fdr mean_1 mean_2 scaled_mean_1 scaled_mean_2 km
#> 1 38 0.042760348 8.373488 9.131774 -0.5533452 0.5164555 1
#> 2 40 0.018707592 7.106213 8.469186 -0.6173731 0.5762149 1
#> 3 55 0.019134737 10.221463 11.207825 -0.6159697 0.5749050 1
#> 4 59 0.006059896 5.921854 7.869574 -0.6899429 0.6439467 1
#> 5 60 0.018055526 8.928898 10.211722 -0.6204761 0.5791110 1
#> 6 98 0.009384629 15.714769 14.887706 0.6635654 -0.6193277 2
...
The columns in tb
are:
which_row
: row indices corresponding to the input matrix.fdr
: FDR for the differential test. mean_x
: The mean value in group x.scaled_mean_x
: The mean value in group x after rows are scaled.km
: Row groups if k-means clustering is applied to rows.UMAP plot which shows how samples are separated.
dimension_reduction(res, k = 2, method = "UMAP")
dimension_reduction(res, k = 3, method = "UMAP")
dimension_reduction(res, k = 4, method = "UMAP")
dimension_reduction(res, k = 5, method = "UMAP")
dimension_reduction(res, k = 6, method = "UMAP")
Following heatmap shows how subgroups are split when increasing k
:
collect_classes(res)
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